Skip to content

Commit

Permalink
fix onboard button always not show when browse print menu before conn… (
Browse files Browse the repository at this point in the history
#721)

* fix onboard button always not show when browse print menu before connected to printer

* fix status info language not change bug

Co-authored-by: <msq001>
  • Loading branch information
Msq001 authored May 27, 2020
1 parent 939ced7 commit 4ff948d
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 17 deletions.
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/Language.inc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ X_WORD (ROTATE_UI)
X_WORD (TOUCHSCREEN_ADJUST)
X_WORD (MORE)
X_WORD (SCREEN_INFO)
X_WORD (STATUS)
X_WORD (WHITE)
X_WORD (BLACK)
X_WORD (BLUE)
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_am.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define AM_TOUCHSCREEN_ADJUST "TSC Adjust"
#define AM_MORE "More"
#define AM_SCREEN_INFO "Info"
#define AM_STATUS "Status"
#define AM_WHITE "White"
#define AM_BLACK "Black"
#define AM_BLUE "Blue"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_cn.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define CN_TOUCHSCREEN_ADJUST "触屏校准"
#define CN_MORE "更多"
#define CN_SCREEN_INFO "关于"
#define CN_STATUS "状态"
#define CN_WHITE "白色"
#define CN_BLACK "黑色"
#define CN_BLUE "蓝色"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_cz.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define CZ_TOUCHSCREEN_ADJUST "Kalibrace"
#define CZ_MORE "Více"
#define CZ_SCREEN_INFO "Info"
#define CZ_STATUS "Status"
#define CZ_WHITE "Bílá"
#define CZ_BLACK "Černá"
#define CZ_BLUE "Modrá"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_de.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define DE_TOUCHSCREEN_ADJUST "TSC kalib."
#define DE_MORE "Mehr"
#define DE_SCREEN_INFO "Info"
#define DE_STATUS "Status"
#define DE_WHITE "Weiß"
#define DE_BLACK "Schwarz"
#define DE_BLUE "Blau"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_du.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define DU_TOUCHSCREEN_ADJUST "TSC Aanpassen"
#define DU_MORE "Meer"
#define DU_SCREEN_INFO "Info"
#define DU_STATUS "Status"
#define DU_WHITE "Wit"
#define DU_BLACK "Zwart"
#define DU_BLUE "Blauw"
Expand Down
5 changes: 3 additions & 2 deletions TFT/src/User/API/Language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define EN_RGB_SETTINGS "LED Color"
#define EN_RGB_OFF "LED Off"
#define EN_GCODE "Gcode"
#define EN_TERMINAL "Terminal"
#define EN_TERMINAL "Terminal"
#define EN_CUSTOM "Custom"
#define EN_LEVELING "Leveling"
#define EN_POINT_1 "Point 1"
Expand All @@ -31,7 +31,7 @@
#define EN_BLTOUCH_DEPLOY "Deploy"
#define EN_BLTOUCH_STOW "Stow"
#define EN_BLTOUCH_REPEAT "Repeat"
#define EN_Z_OFFSET "Z Offset"
#define EN_Z_OFFSET "Z Offset"
#define EN_PROBE_OFFSET "Probe Offset"
#define EN_EEPROM_SAVE "Save"
#define EN_INC "Increase"
Expand All @@ -55,6 +55,7 @@
#define EN_TOUCHSCREEN_ADJUST "TSC Adjust"
#define EN_MORE "More"
#define EN_SCREEN_INFO "Info"
#define EN_STATUS "Info"
#define EN_WHITE "White"
#define EN_BLACK "Black"
#define EN_BLUE "Blue"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define ES_TOUCHSCREEN_ADJUST "Calibrar"
#define ES_MORE "Más"
#define ES_SCREEN_INFO "Informar"
#define ES_STATUS "Status"
#define ES_WHITE "Blanco"
#define ES_BLACK "Negro"
#define ES_BLUE "Azul"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define FR_TOUCHSCREEN_ADJUST "Ajuster"
#define FR_MORE "Autres"
#define FR_SCREEN_INFO "Info"
#define FR_STATUS "Status"
#define FR_WHITE "blanc"
#define FR_BLACK "noir"
#define FR_BLUE "bleu"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_hu.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define HU_TOUCHSCREEN_ADJUST "Igazítás"
#define HU_MORE "Több"
#define HU_SCREEN_INFO "Infó"
#define HU_STATUS "Status"
#define HU_WHITE "Fehér"
#define HU_BLACK "Fekete"
#define HU_BLUE "Kék"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define IT_TOUCHSCREEN_ADJUST "Calibra"
#define IT_MORE "Altro"
#define IT_SCREEN_INFO "Info"
#define IT_STATUS "Status"
#define IT_WHITE "Bianco"
#define IT_BLACK "Nero"
#define IT_BLUE "Blu"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_jp.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define JP_TOUCHSCREEN_ADJUST "校正する"
#define JP_MORE "詳細"
#define JP_SCREEN_INFO "ついて"
#define JP_STATUS "Status"
#define JP_WHITE "白色"
#define JP_BLACK "黒色"
#define JP_BLUE "青色"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_pl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define PL_TOUCHSCREEN_ADJUST "Kalibracja"
#define PL_MORE "Więcej"
#define PL_SCREEN_INFO "Info"
#define PL_STATUS "Status"
#define PL_WHITE "Biały"
#define PL_BLACK "Czarny"
#define PL_BLUE "Niebieski"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_pt.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define PT_TOUCHSCREEN_ADJUST "Ajustar"
#define PT_MORE "Mais"
#define PT_SCREEN_INFO "Info"
#define PT_STATUS "Status"
#define PT_WHITE "Branco"
#define PT_BLACK "Preto"
#define PT_BLUE "Azul"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_ru.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define RU_TOUCHSCREEN_ADJUST "Калибровка"
#define RU_MORE "Больше\u089C" //Curved Right Arrow
#define RU_SCREEN_INFO "Инфо"
#define RU_STATUS "Status"
#define RU_WHITE "Белый"
#define RU_BLACK "Чёрный"
#define RU_BLUE "Синий"
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/API/Language/language_sk.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define SK_TOUCHSCREEN_ADJUST "Kalibrácia"
#define SK_MORE "Viacej"
#define SK_SCREEN_INFO "Info"
#define SK_STATUS "Status"
#define SK_WHITE "Biela"
#define SK_BLACK "Čierna"
#define SK_BLUE "Modrá"
Expand Down
17 changes: 6 additions & 11 deletions TFT/src/User/Menu/Print.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,31 +391,26 @@ LABEL_PRINT,
{{ICON_ONTFT_SD, LABEL_TFTSD},
#ifdef U_DISK_SUPPORT
{ICON_U_DISK, LABEL_U_DISK},
{ICON_ONBOARD_SD, LABEL_ONBOARDSD},
#define ONBOARD_SD_INDEX 2
#else
{ICON_ONBOARD_SD, LABEL_ONBOARDSD},
#define ONBOARD_SD_INDEX 1
{ICON_BACKGROUND, LABEL_BACKGROUND},
#endif
{ICON_BACKGROUND, LABEL_BACKGROUND},
{ICON_BACKGROUND, LABEL_BACKGROUND},
{ICON_BACKGROUND, LABEL_BACKGROUND},
{ICON_BACKGROUND, LABEL_BACKGROUND},
{ICON_BACKGROUND, LABEL_BACKGROUND},
{ICON_BACK, LABEL_BACK}}
};

void menuPrint(void)
{
KEY_VALUES key_num = KEY_IDLE;
if(infoMachineSettings.onboard_sd_support == DISABLED){
#ifdef U_DISK_SUPPORT
sourceSelItems.items[2].icon = ICON_BACKGROUND;
sourceSelItems.items[2].label.index = LABEL_BACKGROUND;
#else
sourceSelItems.items[1].icon = ICON_BACKGROUND;
sourceSelItems.items[1].label.index = LABEL_BACKGROUND;
#endif

}
sourceSelItems.items[ONBOARD_SD_INDEX].icon = (infoMachineSettings.onboard_sd_support == ENABLED) ? ICON_ONBOARD_SD : ICON_BACKGROUND;
sourceSelItems.items[ONBOARD_SD_INDEX].label.index = (infoMachineSettings.onboard_sd_support == ENABLED) ? LABEL_ONBOARDSD : LABEL_BACKGROUND;

menuDrawPage(&sourceSelItems);
while(infoMenu.menu[infoMenu.cur] == menuPrint)
{
Expand Down
1 change: 1 addition & 0 deletions TFT/src/User/Menu/ScreenSettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ LABEL_SCREEN_SETTINGS,

case KEY_ICON_2:
infoSettings.language = (infoSettings.language + 1) % LANGUAGE_NUM;
statusScreen_setMsg(textSelect(LABEL_STATUS), textSelect(infoHost.connected ? LABEL_READY : LABEL_UNCONNECTED)); // restore msg buffer when language is changed
menuDrawPage(&screenSettingsItems);
break;

Expand Down
8 changes: 4 additions & 4 deletions TFT/src/User/Menu/StatusScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ float getAxisLocation(u8 n){

void statusScreen_setMsg(const uint8_t *title, const uint8_t *msg)
{
memcpy(msgtitle, (char *)title, sizeof(msgtitle));
memcpy(msgbody, (char *)msg, sizeof(msgbody));
strncpy(msgtitle, (char *)title, sizeof(msgtitle));
strncpy(msgbody, (char *)msg, sizeof(msgbody));

if (infoMenu.menu[infoMenu.cur] == menuStatus && booted == true)
{
Expand Down Expand Up @@ -317,10 +317,10 @@ void menuStatus(void)
{
if(infoHost.connected != lastConnection_status){
if(infoHost.connected == false){
statusScreen_setMsg(textSelect(LABEL_SCREEN_INFO), textSelect(LABEL_UNCONNECTED));
statusScreen_setMsg(textSelect(LABEL_STATUS), textSelect(LABEL_UNCONNECTED));
}
else{
statusScreen_setMsg(textSelect(LABEL_SCREEN_INFO), textSelect(LABEL_READY));
statusScreen_setMsg(textSelect(LABEL_STATUS), textSelect(LABEL_READY));
}
lastConnection_status = infoHost.connected;
}
Expand Down

0 comments on commit 4ff948d

Please sign in to comment.