🐛 Fix FTDI Eve Touch UI progmem strings (#22439)
This commit is contained in:
@@ -36,7 +36,7 @@ bool BioConfirmHomeE::onTouchEnd(uint8_t tag) {
|
|||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 1:
|
case 1:
|
||||||
#if defined(AXIS_LEVELING_COMMANDS) && defined(PARK_AND_RELEASE_COMMANDS)
|
#if defined(AXIS_LEVELING_COMMANDS) && defined(PARK_AND_RELEASE_COMMANDS)
|
||||||
SpinnerDialogBox::enqueueAndWait_P(PSTR(
|
SpinnerDialogBox::enqueueAndWait(F(
|
||||||
"G28 E\n"
|
"G28 E\n"
|
||||||
AXIS_LEVELING_COMMANDS "\n"
|
AXIS_LEVELING_COMMANDS "\n"
|
||||||
PARK_AND_RELEASE_COMMANDS
|
PARK_AND_RELEASE_COMMANDS
|
||||||
|
@@ -36,7 +36,7 @@ bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) {
|
|||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 1:
|
case 1:
|
||||||
#ifdef PARK_AND_RELEASE_COMMANDS
|
#ifdef PARK_AND_RELEASE_COMMANDS
|
||||||
SpinnerDialogBox::enqueueAndWait_P(PSTR(
|
SpinnerDialogBox::enqueueAndWait(F(
|
||||||
"G28\n"
|
"G28\n"
|
||||||
PARK_AND_RELEASE_COMMANDS
|
PARK_AND_RELEASE_COMMANDS
|
||||||
));
|
));
|
||||||
|
@@ -67,17 +67,17 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
|
|||||||
const bool e_homed = isAxisPositionKnown(E0);
|
const bool e_homed = isAxisPositionKnown(E0);
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
|
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
|
||||||
case 2: GOTO_SCREEN(BioConfirmHomeXYZ); break;
|
case 2: GOTO_SCREEN(BioConfirmHomeXYZ); break;
|
||||||
case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? PSTR("G0 E0 F120") : PSTR("G112")); break;
|
case 3: SpinnerDialogBox::enqueueAndWait(e_homed ? F("G0 E0 F120") : F("G112")); break;
|
||||||
case 4: StatusScreen::unlockMotors(); break;
|
case 4: StatusScreen::unlockMotors(); break;
|
||||||
#ifdef AXIS_LEVELING_COMMANDS
|
#ifdef AXIS_LEVELING_COMMANDS
|
||||||
case 5: SpinnerDialogBox::enqueueAndWait_P(PSTR(AXIS_LEVELING_COMMANDS)); break;
|
case 5: SpinnerDialogBox::enqueueAndWait(F(AXIS_LEVELING_COMMANDS)); break;
|
||||||
#endif
|
#endif
|
||||||
case 6: GOTO_SCREEN(TemperatureScreen); break;
|
case 6: GOTO_SCREEN(TemperatureScreen); break;
|
||||||
case 7: GOTO_SCREEN(InterfaceSettingsScreen); break;
|
case 7: GOTO_SCREEN(InterfaceSettingsScreen); break;
|
||||||
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
|
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
|
||||||
case 9: GOTO_SCREEN(AboutScreen); break;
|
case 9: GOTO_SCREEN(AboutScreen); break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -316,7 +316,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
|
|||||||
case 9: GOTO_SCREEN(FilesScreen); break;
|
case 9: GOTO_SCREEN(FilesScreen); break;
|
||||||
case 10: GOTO_SCREEN(MainMenu); break;
|
case 10: GOTO_SCREEN(MainMenu); break;
|
||||||
case 13: GOTO_SCREEN(BioConfirmHomeE); break;
|
case 13: GOTO_SCREEN(BioConfirmHomeE); break;
|
||||||
case 14: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28Z")); break;
|
case 14: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break;
|
||||||
case 15: GOTO_SCREEN(TemperatureScreen); break;
|
case 15: GOTO_SCREEN(TemperatureScreen); break;
|
||||||
case 16: fine_motion = !fine_motion; break;
|
case 16: fine_motion = !fine_motion; break;
|
||||||
default: return false;
|
default: return false;
|
||||||
|
@@ -67,7 +67,7 @@ bool TuneMenu::onTouchEnd(uint8_t tag) {
|
|||||||
case 3: GOTO_SCREEN(TemperatureScreen); break;
|
case 3: GOTO_SCREEN(TemperatureScreen); break;
|
||||||
case 4: GOTO_SCREEN(NudgeNozzleScreen); break;
|
case 4: GOTO_SCREEN(NudgeNozzleScreen); break;
|
||||||
case 5: GOTO_SCREEN(BioConfirmHomeXYZ); break;
|
case 5: GOTO_SCREEN(BioConfirmHomeXYZ); break;
|
||||||
case 6: SpinnerDialogBox::enqueueAndWait_P(PSTR("G0 E0 F120")); break;
|
case 6: SpinnerDialogBox::enqueueAndWait(F("G0 E0 F120")); break;
|
||||||
case 7: StatusScreen::unlockMotors(); break;
|
case 7: StatusScreen::unlockMotors(); break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@@ -82,7 +82,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
|
|||||||
case 3: BedMeshViewScreen::show(); break;
|
case 3: BedMeshViewScreen::show(); break;
|
||||||
case 4: BedMeshEditScreen::show(); break;
|
case 4: BedMeshEditScreen::show(); break;
|
||||||
case 5: injectCommands_P(PSTR("M280 P0 S60")); break;
|
case 5: injectCommands_P(PSTR("M280 P0 S60")); break;
|
||||||
case 6: SpinnerDialogBox::enqueueAndWait_P(PSTR("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
|
case 6: SpinnerDialogBox::enqueueAndWait(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -108,7 +108,6 @@ enum {
|
|||||||
#include "../generic/display_tuning_screen.h"
|
#include "../generic/display_tuning_screen.h"
|
||||||
#include "../generic/statistics_screen.h"
|
#include "../generic/statistics_screen.h"
|
||||||
#include "../generic/stepper_current_screen.h"
|
#include "../generic/stepper_current_screen.h"
|
||||||
#include "../generic/leveling_menu.h"
|
|
||||||
#include "../generic/z_offset_screen.h"
|
#include "../generic/z_offset_screen.h"
|
||||||
#include "../generic/bed_mesh_base.h"
|
#include "../generic/bed_mesh_base.h"
|
||||||
#include "../generic/bed_mesh_view_screen.h"
|
#include "../generic/bed_mesh_view_screen.h"
|
||||||
@@ -130,5 +129,6 @@ enum {
|
|||||||
#include "preheat_menu.h"
|
#include "preheat_menu.h"
|
||||||
#include "preheat_screen.h"
|
#include "preheat_screen.h"
|
||||||
#include "load_chocolate.h"
|
#include "load_chocolate.h"
|
||||||
|
#include "leveling_menu.h"
|
||||||
#include "move_xyz_screen.h"
|
#include "move_xyz_screen.h"
|
||||||
#include "move_e_screen.h"
|
#include "move_e_screen.h"
|
||||||
|
@@ -233,7 +233,7 @@ bool StatusScreen::onTouchStart(uint8_t) {
|
|||||||
|
|
||||||
bool StatusScreen::onTouchEnd(uint8_t tag) {
|
bool StatusScreen::onTouchEnd(uint8_t tag) {
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 1: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28 O\nG27")); break;
|
case 1: SpinnerDialogBox::enqueueAndWait(F("G28 O\nG27")); break;
|
||||||
case 2: GOTO_SCREEN(LoadChocolateScreen); break;
|
case 2: GOTO_SCREEN(LoadChocolateScreen); break;
|
||||||
case 3: GOTO_SCREEN(PreheatMenu); break;
|
case 3: GOTO_SCREEN(PreheatMenu); break;
|
||||||
case 4: GOTO_SCREEN(MainMenu); break;
|
case 4: GOTO_SCREEN(MainMenu); break;
|
||||||
|
@@ -43,7 +43,7 @@ void AlertDialogBox::onRedraw(draw_mode_t what) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void AlertDialogBox::show(const T message) {
|
void AlertDialogBox::show(T message) {
|
||||||
drawMessage(message);
|
drawMessage(message);
|
||||||
storeBackground();
|
storeBackground();
|
||||||
mydata.isError = false;
|
mydata.isError = false;
|
||||||
@@ -51,7 +51,7 @@ void AlertDialogBox::show(const T message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void AlertDialogBox::showError(const T message) {
|
void AlertDialogBox::showError(T message) {
|
||||||
drawMessage(message);
|
drawMessage(message);
|
||||||
storeBackground();
|
storeBackground();
|
||||||
mydata.isError = true;
|
mydata.isError = true;
|
||||||
@@ -64,8 +64,8 @@ void AlertDialogBox::hide() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template void AlertDialogBox::show(const char *);
|
template void AlertDialogBox::show(const char *);
|
||||||
template void AlertDialogBox::show(const progmem_str);
|
template void AlertDialogBox::show(progmem_str);
|
||||||
template void AlertDialogBox::showError(const char *);
|
template void AlertDialogBox::showError(const char *);
|
||||||
template void AlertDialogBox::showError(const progmem_str);
|
template void AlertDialogBox::showError(progmem_str);
|
||||||
|
|
||||||
#endif // FTDI_ALERT_DIALOG_BOX
|
#endif // FTDI_ALERT_DIALOG_BOX
|
||||||
|
@@ -191,7 +191,7 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) {
|
|||||||
|
|
||||||
void BedMeshEditScreen::show() {
|
void BedMeshEditScreen::show() {
|
||||||
// On entry, always home (to account for possible Z offset changes) and save current mesh
|
// On entry, always home (to account for possible Z offset changes) and save current mesh
|
||||||
SpinnerDialogBox::enqueueAndWait_P(PSTR("G28\nG29 S1"));
|
SpinnerDialogBox::enqueueAndWait(F("G28\nG29 S1"));
|
||||||
// After the spinner, go to this screen.
|
// After the spinner, go to this screen.
|
||||||
current_screen.forget();
|
current_screen.forget();
|
||||||
PUSH_SCREEN(BedMeshEditScreen);
|
PUSH_SCREEN(BedMeshEditScreen);
|
||||||
|
@@ -32,7 +32,7 @@ using namespace Theme;
|
|||||||
#define GRID_ROWS 8
|
#define GRID_ROWS 8
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void DialogBoxBaseClass::drawMessage(const T message, int16_t font) {
|
void DialogBoxBaseClass::drawMessage(T message, int16_t font) {
|
||||||
CommandProcessor cmd;
|
CommandProcessor cmd;
|
||||||
cmd.cmd(CMD_DLSTART)
|
cmd.cmd(CMD_DLSTART)
|
||||||
.cmd(CLEAR_COLOR_RGB(bg_color))
|
.cmd(CLEAR_COLOR_RGB(bg_color))
|
||||||
@@ -59,12 +59,16 @@ void DialogBoxBaseClass::drawOkayButton() {
|
|||||||
.tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY));
|
.tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_OKAY));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogBoxBaseClass::drawButton(const progmem_str label) {
|
template<typename T>
|
||||||
|
void DialogBoxBaseClass::drawButton(T label) {
|
||||||
CommandProcessor cmd;
|
CommandProcessor cmd;
|
||||||
cmd.font(font_medium)
|
cmd.font(font_medium)
|
||||||
.tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), label);
|
.tag(1).button(BTN_POS(1,8), BTN_SIZE(2,1), label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template void DialogBoxBaseClass::drawButton(const char *);
|
||||||
|
template void DialogBoxBaseClass::drawButton(progmem_str);
|
||||||
|
|
||||||
void DialogBoxBaseClass::drawSpinner() {
|
void DialogBoxBaseClass::drawSpinner() {
|
||||||
CommandProcessor cmd;
|
CommandProcessor cmd;
|
||||||
cmd.cmd(COLOR_RGB(bg_text_enabled))
|
cmd.cmd(COLOR_RGB(bg_text_enabled))
|
||||||
|
@@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
class DialogBoxBaseClass : public BaseScreen {
|
class DialogBoxBaseClass : public BaseScreen {
|
||||||
protected:
|
protected:
|
||||||
template<typename T> static void drawMessage(const T, int16_t font = 0);
|
template<typename T> static void drawMessage(T, int16_t font = 0);
|
||||||
|
template<typename T> static void drawButton(T);
|
||||||
static void drawYesNoButtons(uint8_t default_btn = 0);
|
static void drawYesNoButtons(uint8_t default_btn = 0);
|
||||||
static void drawOkayButton();
|
static void drawOkayButton();
|
||||||
static void drawSpinner();
|
static void drawSpinner();
|
||||||
static void drawButton(const progmem_str);
|
|
||||||
|
|
||||||
static void onRedraw(draw_mode_t) {};
|
static void onRedraw(draw_mode_t) {};
|
||||||
public:
|
public:
|
||||||
|
@@ -104,7 +104,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
|
|||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 1: GOTO_PREVIOUS(); break;
|
case 1: GOTO_PREVIOUS(); break;
|
||||||
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
|
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
|
||||||
case 2: SpinnerDialogBox::enqueueAndWait_P(PSTR("G34")); break;
|
case 2: SpinnerDialogBox::enqueueAndWait(F("G34")); break;
|
||||||
#endif
|
#endif
|
||||||
#if HAS_BED_PROBE
|
#if HAS_BED_PROBE
|
||||||
case 3:
|
case 3:
|
||||||
@@ -114,7 +114,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
|
|||||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||||
BedMeshViewScreen::doProbe();
|
BedMeshViewScreen::doProbe();
|
||||||
#else
|
#else
|
||||||
SpinnerDialogBox::enqueueAndWait_P(PSTR(BED_LEVELING_COMMANDS));
|
SpinnerDialogBox::enqueueAndWait(F(BED_LEVELING_COMMANDS));
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@@ -127,7 +127,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
|
|||||||
#endif
|
#endif
|
||||||
#if ENABLED(BLTOUCH)
|
#if ENABLED(BLTOUCH)
|
||||||
case 7: injectCommands_P(PSTR("M280 P0 S60")); break;
|
case 7: injectCommands_P(PSTR("M280 P0 S60")); break;
|
||||||
case 8: SpinnerDialogBox::enqueueAndWait_P(PSTR("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
|
case 8: SpinnerDialogBox::enqueueAndWait(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
|
||||||
#endif
|
#endif
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
|
@@ -104,7 +104,7 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
|
|||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
|
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
|
||||||
case 2: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28")); break;
|
case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break;
|
||||||
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
#if ENABLED(NOZZLE_CLEAN_FEATURE)
|
||||||
case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
|
case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -98,10 +98,10 @@ bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) {
|
|||||||
case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break;
|
case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break;
|
||||||
case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break;
|
case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break;
|
||||||
#endif
|
#endif
|
||||||
case 20: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28X")); break;
|
case 20: SpinnerDialogBox::enqueueAndWait(F("G28X")); break;
|
||||||
case 21: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28Y")); break;
|
case 21: SpinnerDialogBox::enqueueAndWait(F("G28Y")); break;
|
||||||
case 22: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28Z")); break;
|
case 22: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break;
|
||||||
case 23: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28")); break;
|
case 23: SpinnerDialogBox::enqueueAndWait(F("G28")); break;
|
||||||
case 24: raiseZtoTop(); break;
|
case 24: raiseZtoTop(); break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@@ -34,7 +34,7 @@ constexpr static SpinnerDialogBoxData &mydata = screen_data.SpinnerDialogBox;
|
|||||||
void SpinnerDialogBox::onRedraw(draw_mode_t) {
|
void SpinnerDialogBox::onRedraw(draw_mode_t) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinnerDialogBox::show(const progmem_str message) {
|
void SpinnerDialogBox::show(progmem_str message) {
|
||||||
drawMessage(message);
|
drawMessage(message);
|
||||||
drawSpinner();
|
drawSpinner();
|
||||||
storeBackground();
|
storeBackground();
|
||||||
@@ -46,17 +46,20 @@ void SpinnerDialogBox::hide() {
|
|||||||
cmd.stop().execute();
|
cmd.stop().execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinnerDialogBox::enqueueAndWait_P(const progmem_str commands) {
|
void SpinnerDialogBox::enqueueAndWait(progmem_str message, progmem_str commands) {
|
||||||
enqueueAndWait_P(GET_TEXT_F(MSG_PLEASE_WAIT), commands);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem_str commands) {
|
|
||||||
show(message);
|
show(message);
|
||||||
GOTO_SCREEN(SpinnerDialogBox);
|
GOTO_SCREEN(SpinnerDialogBox);
|
||||||
ExtUI::injectCommands_P((const char*)commands);
|
ExtUI::injectCommands_P((const char*)commands);
|
||||||
mydata.auto_hide = true;
|
mydata.auto_hide = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpinnerDialogBox::enqueueAndWait(progmem_str message, char *commands) {
|
||||||
|
show(message);
|
||||||
|
GOTO_SCREEN(SpinnerDialogBox);
|
||||||
|
ExtUI::injectCommands(commands);
|
||||||
|
mydata.auto_hide = true;
|
||||||
|
}
|
||||||
|
|
||||||
void SpinnerDialogBox::onIdle() {
|
void SpinnerDialogBox::onIdle() {
|
||||||
reset_menu_timeout();
|
reset_menu_timeout();
|
||||||
if (mydata.auto_hide && !commandsInQueue()) {
|
if (mydata.auto_hide && !commandsInQueue()) {
|
||||||
|
@@ -34,8 +34,12 @@ class SpinnerDialogBox : public DialogBoxBaseClass, public CachedScreen<SPINNER_
|
|||||||
static void onRedraw(draw_mode_t);
|
static void onRedraw(draw_mode_t);
|
||||||
static void onIdle();
|
static void onIdle();
|
||||||
|
|
||||||
static void show(const progmem_str);
|
static void show(progmem_str);
|
||||||
static void hide();
|
static void hide();
|
||||||
static void enqueueAndWait_P(const progmem_str commands);
|
|
||||||
static void enqueueAndWait_P(const progmem_str message, const progmem_str commands);
|
template<typename T>
|
||||||
|
static void enqueueAndWait(T commands) {enqueueAndWait(GET_TEXT_F(MSG_PLEASE_WAIT), commands);}
|
||||||
|
|
||||||
|
static void enqueueAndWait(progmem_str message, char *commands);
|
||||||
|
static void enqueueAndWait(progmem_str message, progmem_str commands);
|
||||||
};
|
};
|
||||||
|
@@ -84,7 +84,7 @@ void ZOffsetScreen::runWizard() {
|
|||||||
strcat(cmd, str);
|
strcat(cmd, str);
|
||||||
injectCommands(cmd);
|
injectCommands(cmd);
|
||||||
// Show instructions for user.
|
// Show instructions for user.
|
||||||
AlertDialogBox::show(PSTR("After the printer finishes homing, adjust the Z Offset so that a sheet of paper can pass between the nozzle and bed with slight resistance."));
|
AlertDialogBox::show(F("After the printer finishes homing, adjust the Z Offset so that a sheet of paper can pass between the nozzle and bed with slight resistance."));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZOffsetScreen::wizardRunning() {
|
bool ZOffsetScreen::wizardRunning() {
|
||||||
|
Reference in New Issue
Block a user