Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move menu cosmetics #2834

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions TFT/src/User/API/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,11 @@ void setMenu(MENU_TYPE menu_type, LABEL * title, uint16_t rectCount, const GUI_R
#endif
}

SYS_STATUS getReminderStatus(void)
{
return reminder.status;
}

void drawReminderMsg(void)
{
uint16_t msgRectOffset = (LCD_WIDTH - GUI_StrPixelWidth(reminder.inf)) / 2 - BYTE_WIDTH;
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ extern const GUI_RECT rect_of_titleBar[1];
void setMenuType(MENU_TYPE type);
MENU_TYPE getMenuType(void);

SYS_STATUS getReminderStatus(void);
void setReminderMsg(int16_t inf, SYS_STATUS status);
void notificationDot(void);

Expand Down
26 changes: 14 additions & 12 deletions TFT/src/User/Menu/Move.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ void storeMoveCmd(const AXIS xyz, const float amount)

void drawXYZ(void)
{
if (getReminderStatus() != SYS_STATUS_IDLE || toastRunning()) return;

char tempstr[30];

GUI_SetColor(infoSettings.status_color);

sprintf(tempstr, "X:%.2f ", coordinateGetAxisActual(X_AXIS));
GUI_DispString(START_X + (OFFSET + 0) * SPACE_X + (OFFSET + 0) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
GUI_DispString(START_X + (OFFSET + 0) * SPACE_X + (OFFSET + 0) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);

sprintf(tempstr, "Y:%.2f ", coordinateGetAxisActual(Y_AXIS));
GUI_DispString(START_X + (OFFSET + 1) * SPACE_X + (OFFSET + 1) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
GUI_DispString(START_X + (OFFSET + 1) * SPACE_X + (OFFSET + 1) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);

sprintf(tempstr, "Z:%.2f ", coordinateGetAxisActual(Z_AXIS));
GUI_DispString(START_X + (OFFSET + 2) * SPACE_X + (OFFSET + 2) * ICON_WIDTH, (ICON_START_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);
GUI_DispString(START_X + (OFFSET + 2) * SPACE_X + (OFFSET + 2) * ICON_WIDTH, (TITLE_END_Y - BYTE_HEIGHT) / 2, (uint8_t *)tempstr);

GUI_SetColor(infoSettings.font_color);
}
Expand All @@ -65,20 +67,20 @@ void menuMove(void)
{
#ifdef ALTERNATIVE_MOVE_MENU
{ICON_Z_DEC, LABEL_Z_DEC},
{ICON_Y_INC, LABEL_Y_INC},
{ICON_Y_INC, LABEL_Y_DEC},
{ICON_Z_INC, LABEL_Z_INC},
{ICON_01_MM, LABEL_01_MM},
{ICON_X_DEC, LABEL_X_DEC},
{ICON_Y_DEC, LABEL_Y_DEC},
{ICON_Y_DEC, LABEL_Y_INC},
{ICON_X_INC, LABEL_X_INC},
{ICON_BACK, LABEL_BACK},
#else
{ICON_X_INC, LABEL_X_INC},
{ICON_Y_INC, LABEL_Y_INC},
{ICON_Y_DEC, LABEL_Y_INC},
{ICON_Z_INC, LABEL_Z_INC},
{ICON_01_MM, LABEL_01_MM},
{ICON_X_DEC, LABEL_X_DEC},
{ICON_Y_DEC, LABEL_Y_DEC},
{ICON_Y_INC, LABEL_Y_DEC},
{ICON_Z_DEC, LABEL_Z_DEC},
{ICON_BACK, LABEL_BACK},
#endif
Expand All @@ -96,12 +98,12 @@ void menuMove(void)
uint8_t table[TOTAL_AXIS][2] =
#ifdef ALTERNATIVE_MOVE_MENU
/*-------*-------*-------*---------*
| Z-(0) | Y+(1) | Z+(2) | unit(3) |
| Z-(0) | Y-(1) | Z+(2) | unit(3) |
*-------*-------*-------*---------*
| X-(4) | Y-(5) | X+(6) | back(7) |
| X-(4) | Y+(5) | X+(6) | back(7) |
*-------*-------*-------*---------*
|X+ X- |Y+ Y- |Z+ Z- */
{{6, 4}, {1, 5}, {2, 0}}
{{6, 4}, {5, 1}, {2, 0}}
#else
/*-------*-------*-------*---------*
| X+(0) | Y+(1) | Z+(2) | unit(3) |
Expand Down Expand Up @@ -141,7 +143,7 @@ void menuMove(void)
{
#ifdef ALTERNATIVE_MOVE_MENU
case KEY_ICON_0: storeMoveCmd(Z_AXIS, -amount); break; // Z move down if no invert
case KEY_ICON_1: storeMoveCmd(Y_AXIS, amount); break; // Y move increase if no invert
case KEY_ICON_1: storeMoveCmd(Y_AXIS, -amount); break; // Y move decrease if no invert
case KEY_ICON_2: storeMoveCmd(Z_AXIS, amount); break; // Z move up if no invert

case KEY_ICON_3:
Expand All @@ -154,7 +156,7 @@ void menuMove(void)
break;

case KEY_ICON_4: storeMoveCmd(X_AXIS, -amount); break; // X move decrease if no invert
case KEY_ICON_5: storeMoveCmd(Y_AXIS, -amount); break; // Y move decrease if no invert
case KEY_ICON_5: storeMoveCmd(Y_AXIS, amount); break; // Y move increase if no invert
case KEY_ICON_6: storeMoveCmd(X_AXIS, amount); break; // X move increase if no invert

case KEY_ICON_7: CLOSE_MENU(); break;
Expand Down
Loading