Merge pull request #2011 from MRprusa3d/PFW-873

GUI updates
This commit is contained in:
NotaRobotexe 2019-07-17 14:49:07 +02:00 committed by GitHub
commit 2bae208133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 33 deletions

View File

@ -84,6 +84,7 @@ const char MSG_SELFTEST_MOTOR[] PROGMEM_I1 = ISTR("Motor"); ////
const char MSG_SELFTEST_FILAMENT_SENSOR[] PROGMEM_I1 = ISTR("Filament sensor"); ////c=17
const char MSG_SELFTEST_WIRINGERROR[] PROGMEM_I1 = ISTR("Wiring error"); ////
const char MSG_SETTINGS[] PROGMEM_I1 = ISTR("Settings"); ////
const char MSG_HW_SETUP[] PROGMEM_I1 = ISTR("HW Setup"); ////
const char MSG_SILENT_MODE_OFF[] PROGMEM_I1 = ISTR("Mode [high power]"); ////
const char MSG_SILENT_MODE_ON[] PROGMEM_I1 = ISTR("Mode [silent]"); ////
const char MSG_STEALTH_MODE_OFF[] PROGMEM_I1 = ISTR("Mode [Normal]"); ////

View File

@ -84,6 +84,7 @@ extern const char MSG_SELFTEST_MOTOR[];
extern const char MSG_SELFTEST_FILAMENT_SENSOR[];
extern const char MSG_SELFTEST_WIRINGERROR[];
extern const char MSG_SETTINGS[];
extern const char MSG_HW_SETUP[];
extern const char MSG_SILENT_MODE_OFF[];
extern const char MSG_SILENT_MODE_ON[];
extern const char MSG_STEALTH_MODE_OFF[];

View File

@ -307,7 +307,7 @@ bool wait_for_unclick;
#endif
bool bMain; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_checkink_menu()' function
bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
@ -5505,18 +5505,27 @@ do\
}\
while (0)
//-//static void lcd_checking_menu()
void lcd_checking_menu()
static void lcd_checking_menu(void)
{
MENU_BEGIN();
MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
SETTINGS_NOZZLE;
MENU_ITEM_TEXT_P(STR_SEPARATOR);
MENU_ITEM_TEXT_P(_i("Checks:"));
MENU_ITEM_BACK_P(_T(MSG_HW_SETUP));
SETTINGS_MODE;
SETTINGS_MODEL;
SETTINGS_VERSION;
SETTINGS_GCODE;
//-// temporarily disabled
//SETTINGS_GCODE;
MENU_END();
}
void lcd_hw_setup_menu(void) // can not be "static"
{
MENU_BEGIN();
MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch
if(!farm_mode)
SETTINGS_NOZZLE;
// ... a sem prijdou 'plechy'
if(!farm_mode)
MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu);
MENU_END();
}
@ -5544,6 +5553,10 @@ static void lcd_settings_menu()
MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1
SETTINGS_SILENT_MODE;
bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
MENU_ITEM_SUBMENU_P(_i("HW Setup"), lcd_hw_setup_menu);////MSG_HW_SETUP
SETTINGS_MMU_MODE;
MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);////MSG_MBL_SETTINGS c=18 r=1
@ -5571,12 +5584,6 @@ static void lcd_settings_menu()
MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT
#endif //(LANG_MODE != 0)
if (!farm_mode)
{
bSettings=true; // flag ('fake parameter') for 'lcd_checking_menu()' function
MENU_ITEM_SUBMENU_P(_i("Print checking"), lcd_checking_menu);
}
SETTINGS_SD;
SETTINGS_SOUND;

View File

@ -140,7 +140,8 @@ void lcd_ignore_click(bool b=true);
void lcd_commands();
extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_checkink_menu()' function
extern bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function
void lcd_hw_setup_menu(void); // NOT static due to using inside "util" module ("nozzle_diameter_check()")
void change_extr(int extr);

View File

@ -324,7 +324,7 @@ void update_current_firmware_version_to_eeprom()
//-//
void lcd_checking_menu(void);
#define MSG_PRINT_CHECKING_FAILED_TIMEOUT 30
ClNozzleDiameter oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
ClCheckMode oCheckMode=ClCheckMode::_None;
@ -379,7 +379,7 @@ nDiameter_um=eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM);
if(nDiameter==nDiameter_um)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Nozzle diameter doesn't match ...");
//SERIAL_ECHOLNPGM("Printer nozzle diameter differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN((float)(nDiameter_um/1000.0));
//SERIAL_ECHOPGM("expected: ");
@ -387,18 +387,22 @@ if(nDiameter==nDiameter_um)
switch(oCheckMode)
{
case ClCheckMode::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("Nozzle diameter doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckMode::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("Nozzle diameter doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckMode::_None:
case ClCheckMode::_Undef:
break;
}
bSettings=false; // flag ('fake parameter') for 'lcd_checking_menu()' function
menu_submenu(lcd_checking_menu);
bSettings=false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
menu_submenu(lcd_hw_setup_menu);
}
void printer_model_check(uint16_t nPrinterModel)
@ -408,7 +412,7 @@ if(oCheckModel==ClCheckModel::_None)
if(nPrinterModel==nPrinterType)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer model doesn't match ...");
//SERIAL_ECHOLNPGM("Printer model differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(nPrinterType);
//SERIAL_ECHOPGM("expected: ");
@ -416,10 +420,14 @@ if(nPrinterModel==nPrinterType)
switch(oCheckModel)
{
case ClCheckModel::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer model differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckModel::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckModel::_None:
@ -454,7 +462,7 @@ if(nCompareValueResult==COMPARE_VALUE_EQUAL)
if((nCompareValueResult<COMPARE_VALUE_EQUAL)&&oCheckVersion==ClCheckVersion::_Warn)
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("FW version doesn't match ...");
//SERIAL_ECHOLNPGM("Printer FW version differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(FW_VERSION);
//SERIAL_ECHOPGM("expected: ");
@ -462,10 +470,14 @@ if((nCompareValueResult<COMPARE_VALUE_EQUAL)&&oCheckVersion==ClCheckVersion::_Wa
switch(oCheckVersion)
{
case ClCheckVersion::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("FW version doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer FW version differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckVersion::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("FW version doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckVersion::_None:
@ -483,7 +495,7 @@ if(nGcodeLevel==(uint16_t)GCODE_LEVEL)
if((nGcodeLevel<(uint16_t)GCODE_LEVEL)&&(oCheckGcode==ClCheckGcode::_Warn))
return;
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("G-code level doesn't match ...");
//SERIAL_ECHOLNPGM("Printer G-code level differs from the G-code ...");
//SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(GCODE_LEVEL);
//SERIAL_ECHOPGM("expected: ");
@ -491,10 +503,14 @@ if((nGcodeLevel<(uint16_t)GCODE_LEVEL)&&(oCheckGcode==ClCheckGcode::_Warn))
switch(oCheckGcode)
{
case ClCheckGcode::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("G-code level doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer G-code level differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckGcode::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("G-code level doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckGcode::_None:
@ -543,7 +559,7 @@ if(pResult!=NULL)
return;
}
//SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer model doesn't match ...");
//SERIAL_ECHOLNPGM("Printer model differs from the G-code ...");
//SERIAL_ECHOPGM("actual : \"");
//serialprintPGM(::sPrinterName);
//SERIAL_ECHOLNPGM("\"");
@ -553,10 +569,14 @@ if(pResult!=NULL)
switch(oCheckModel)
{
case ClCheckModel::_Warn:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Press the knob to continue."));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Continue?"));
lcd_display_message_fullscreen_P(_i("Printer model differs from the G-code. Continue?"));
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery
break;
case ClCheckModel::_Strict:
lcd_show_fullscreen_message_and_wait_P(_i("Printer model doesn't match! Print is aborted, press the knob."));
lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Please check the value in settings. Print cancelled."));
lcd_print_stop();
break;
case ClCheckModel::_None: