blocking messages in settings/tune menu (PFW104)

switch normal/stealth (PFW110)
This commit is contained in:
Robert Pelnar 2018-01-12 19:54:32 +01:00
parent 0d269261e4
commit 0f46fa0c37
4 changed files with 40 additions and 21 deletions

View File

@ -436,15 +436,15 @@ const char * const MSG_CRASH_DETECTED_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_CRASH_DETECTED_CZ
};
const char MSG_CRASH_DET_ONLY_IN_NORMAL_EN[] PROGMEM = "Crash detection can be turned on only in Normal mode.";
const char MSG_CRASH_DET_ONLY_IN_NORMAL_CZ[] PROGMEM = "Crash detekce muze byt zapnuta pouze v Normal modu";
const char MSG_CRASH_DET_ONLY_IN_NORMAL_EN[] PROGMEM = "\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode";
const char MSG_CRASH_DET_ONLY_IN_NORMAL_CZ[] PROGMEM = "\x1b[2JCrash detekce muze\x1b[1;0Hbyt zapnuta pouze v\x1b[2;0HNormal modu";
const char * const MSG_CRASH_DET_ONLY_IN_NORMAL_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_CRASH_DET_ONLY_IN_NORMAL_EN,
MSG_CRASH_DET_ONLY_IN_NORMAL_CZ
};
const char MSG_CRASH_DET_STEALTH_FORCE_OFF_EN[] PROGMEM = "WARNING: Crash detection disabled in Stealth mode";
const char MSG_CRASH_DET_STEALTH_FORCE_OFF_CZ[] PROGMEM = "POZOR: Crash detekce deaktivovana ve Stealth modu";
const char MSG_CRASH_DET_STEALTH_FORCE_OFF_EN[] PROGMEM = "\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode";
const char MSG_CRASH_DET_STEALTH_FORCE_OFF_CZ[] PROGMEM = "\x1b[2JPOZOR:\x1b[1;0HCrash detekce\x1b[2;0Hdeaktivovana ve\x1b[3;0HStealth modu";
const char * const MSG_CRASH_DET_STEALTH_FORCE_OFF_LANG_TABLE[LANG_NUM] PROGMEM = {
MSG_CRASH_DET_STEALTH_FORCE_OFF_EN,
MSG_CRASH_DET_STEALTH_FORCE_OFF_CZ

View File

@ -389,8 +389,8 @@ ve
#define(length=15, lines=1) MSG_MENU_TEMPERATURES "Teploty"
#define(length=15, lines=1) MSG_MENU_BELT_STATUS "Stav remenu"
#define(length=20, lines=4) MSG_CRASH_DET_ONLY_IN_NORMAL "Crash detekce muze byt zapnuta pouze v Normal modu"
#define(length=20, lines=4) MSG_CRASH_DET_STEALTH_FORCE_OFF "POZOR: Crash detekce deaktivovana ve Stealth modu"
#define(length=20, lines=4) MSG_CRASH_DET_ONLY_IN_NORMAL "\x1b[2JCrash detekce muze\x1b[1;0Hbyt zapnuta pouze v\x1b[2;0HNormal modu"
#define(length=20, lines=4) MSG_CRASH_DET_STEALTH_FORCE_OFF "\x1b[2JPOZOR:\x1b[1;0HCrash detekce\x1b[2;0Hdeaktivovana ve\x1b[3;0HStealth modu"
#define(length=20, lines=4) MSG_AUTOLOADING_ENABLED "Automaticke zavadeni filamentu aktivni, stisknete tlacitko a vlozte filament..."
#define(length=20, lines=4) MSG_AUTOLOADING_ONLY_IF_FSENS_ON "Automaticke zavadeni filamentu dostupne pouze pri zapnutem filament senzoru..."

View File

@ -395,8 +395,8 @@
#define(length=17, lines=1) MSG_SECOND_SERIAL_ON "RPi port [on]"
#define(length=17, lines=1) MSG_SECOND_SERIAL_OFF "RPi port [off]"
#define(length=20, lines=4) MSG_CRASH_DET_ONLY_IN_NORMAL "Crash detection can be turned on only in Normal mode."
#define(length=20, lines=4) MSG_CRASH_DET_STEALTH_FORCE_OFF "WARNING: Crash detection disabled in Stealth mode"
#define(length=20, lines=4) MSG_CRASH_DET_ONLY_IN_NORMAL "\x1b[2JCrash detection can\x1b[1;0Hbe turned on only in\x1b[2;0HNormal mode"
#define(length=20, lines=4) MSG_CRASH_DET_STEALTH_FORCE_OFF "\x1b[2JWARNING:\x1b[1;0HCrash detection\x1b[2;0Hdisabled in\x1b[3;0HStealth mode"
#define(length=20, lines=4) MSG_AUTOLOADING_ENABLED "Autoloading filament is active, just press the knob and insert filament..."
#define(length=20, lines=4) MSG_AUTOLOADING_ONLY_IF_FSENS_ON "Autoloading filament available only when filament sensor is turned on..."

View File

@ -3293,9 +3293,36 @@ static void lcd_sort_type_set() {
}
#endif //SDCARD_SORT_ALPHA
static void lcd_crash_mode_info()
{
lcd_update_enable(true);
static uint32_t tim = 0;
if ((tim + 1000) < millis())
{
fputs_P(MSG_CRASH_DET_ONLY_IN_NORMAL, lcdout);
tim = millis();
}
if (lcd_clicked())
{
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 18);
else lcd_goto_menu(lcd_settings_menu, 16, true, true);
}
}
static void lcd_crash_mode_info2()
{
lcd_show_fullscreen_message_and_wait_P(MSG_CRASH_DET_STEALTH_FORCE_OFF);
lcd_update_enable(true);
static uint32_t tim = 0;
if ((tim + 1000) < millis())
{
fputs_P(MSG_CRASH_DET_STEALTH_FORCE_OFF, lcdout);
tim = millis();
}
if (lcd_clicked())
{
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 16);
else lcd_goto_menu(lcd_settings_menu, 14, true, true);
}
}
static void lcd_filament_autoload_info()
@ -3311,8 +3338,6 @@ static void lcd_fsensor_fail()
static void lcd_silent_mode_set() {
SilentModeMenu = !SilentModeMenu;
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
if (CrashDetectMenu && SilentModeMenu)
lcd_crash_mode_info2();
#ifdef TMC2130
st_synchronize();
if (tmc2130_wait_standstill_xy(1000)) {}
@ -3325,16 +3350,10 @@ static void lcd_silent_mode_set() {
sei();
#endif //TMC2130
digipot_init();
if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 8);
else lcd_goto_menu(lcd_settings_menu, 7);
if (CrashDetectMenu && SilentModeMenu)
lcd_goto_menu(lcd_crash_mode_info2);
}
static void lcd_crash_mode_info()
{
lcd_show_fullscreen_message_and_wait_P(MSG_CRASH_DET_ONLY_IN_NORMAL);
}
static void lcd_crash_mode_set()
{
CrashDetectMenu = !CrashDetectMenu; //set also from crashdet_enable() and crashdet_disable()
@ -3823,7 +3842,7 @@ static void lcd_settings_menu()
if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
}
else MENU_ITEM(function, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
if (temp_cal_active == false) {
MENU_ITEM(function, MSG_TEMP_CALIBRATION_OFF, lcd_temp_calibration_set);
@ -5167,7 +5186,7 @@ static void lcd_tune_menu()
if (CrashDetectMenu == 0) MENU_ITEM(function, MSG_CRASHDETECT_OFF, lcd_crash_mode_set);
else MENU_ITEM(function, MSG_CRASHDETECT_ON, lcd_crash_mode_set);
}
else MENU_ITEM(function, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
else MENU_ITEM(submenu, MSG_CRASHDETECT_NA, lcd_crash_mode_info);
END_MENU();
}