Multi-language support (#15453)
This commit is contained in:
committed by
Scott Lahteine
parent
dc14d4a13c
commit
6a865a6146
@@ -289,11 +289,11 @@ void DGUSScreenVariableHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable
|
||||
|
||||
// Don't let the user in the dark why there is no reaction.
|
||||
if (!ExtUI::isMediaInserted()) {
|
||||
setstatusmessagePGM(PSTR(MSG_NO_MEDIA));
|
||||
setstatusmessagePGM(GET_TEXT(MSG_NO_MEDIA));
|
||||
return;
|
||||
}
|
||||
if (card.flag.abort_sd_printing) {
|
||||
setstatusmessagePGM(PSTR(MSG_MEDIA_ABORTING));
|
||||
setstatusmessagePGM(GET_TEXT(MSG_MEDIA_ABORTING));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -472,13 +472,13 @@ void DGUSScreenVariableHandler::HandleTemperatureChanged(DGUS_VP_Variable &var,
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
#if HOTENDS >= 1
|
||||
case VP_T_E1_Set:
|
||||
case VP_T_E0_Set:
|
||||
thermalManager.setTargetHotend(newvalue, 0);
|
||||
acceptedvalue = thermalManager.temp_hotend[0].target;
|
||||
break;
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
case VP_T_E2_Set:
|
||||
case VP_T_E1_Set:
|
||||
thermalManager.setTargetHotend(newvalue, 1);
|
||||
acceptedvalue = thermalManager.temp_hotend[1].target;
|
||||
break;
|
||||
@@ -503,10 +503,10 @@ void DGUSScreenVariableHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, voi
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
#if (HOTENDS >= 1)
|
||||
case VP_Flowrate_E1: target_extruder = 0; break;
|
||||
case VP_Flowrate_E0: target_extruder = 0; break;
|
||||
#endif
|
||||
#if (HOTENDS >= 2)
|
||||
case VP_Flowrate_E2: target_extruder = 1; break;
|
||||
case VP_Flowrate_E1: target_extruder = 1; break;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -526,11 +526,11 @@ void DGUSScreenVariableHandler::HandleManualExtrude(DGUS_VP_Variable &var, void
|
||||
ExtUI::extruder_t target_extruder;
|
||||
|
||||
switch (var.VP) {
|
||||
#if HOTENDS >=1
|
||||
case VP_MOVE_E1: target_extruder = ExtUI::extruder_t::E0; break;
|
||||
#if HOTENDS >= 1
|
||||
case VP_MOVE_E0: target_extruder = ExtUI::extruder_t::E0; break;
|
||||
#endif
|
||||
#if HOTENDS >=2
|
||||
case VP_MOVE_E2: target_extruder = ExtUI::extruder_t::E1; break
|
||||
#if HOTENDS >= 2
|
||||
case VP_MOVE_E1: target_extruder = ExtUI::extruder_t::E1; break
|
||||
#endif
|
||||
default: return;
|
||||
}
|
||||
|
@@ -46,10 +46,10 @@ const uint16_t VPList_Main[] PROGMEM = {
|
||||
|
||||
const uint16_t VPList_Temp[] PROGMEM = {
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
VP_T_E2_I, VP_T_E2_S,
|
||||
VP_T_E1_I, VP_T_E1_S,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
@@ -60,10 +60,10 @@ const uint16_t VPList_Temp[] PROGMEM = {
|
||||
const uint16_t VPList_Status[] PROGMEM = {
|
||||
/* VP_M117, for completeness, but it cannot be auto-uploaded */
|
||||
#if HOTENDS >= 1
|
||||
VP_T_E1_Is, VP_T_E1_Set,
|
||||
VP_T_E0_Is, VP_T_E0_Set,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
VP_T_E2_I, VP_T_E2_S,
|
||||
VP_T_E1_I, VP_T_E1_S,
|
||||
#endif
|
||||
#if HAS_HEATED_BED
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
@@ -81,10 +81,10 @@ const uint16_t VPList_Status[] PROGMEM = {
|
||||
const uint16_t VPList_Status2[] PROGMEM = {
|
||||
/* VP_M117, for completeness, but it cannot be auto-uploaded */
|
||||
#if HOTENDS >= 1
|
||||
VP_Flowrate_E1,
|
||||
VP_Flowrate_E0,
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
VP_Flowrate_E2,
|
||||
VP_Flowrate_E1,
|
||||
#endif
|
||||
VP_PrintProgress_Percentage,
|
||||
VP_PrintTime,
|
||||
@@ -107,7 +107,7 @@ const uint16_t VPList_FanAndFeedrate[] PROGMEM = {
|
||||
};
|
||||
|
||||
const uint16_t VPList_SD_FlowRates[] PROGMEM = {
|
||||
VP_Flowrate_E1, VP_Flowrate_E2,
|
||||
VP_Flowrate_E0, VP_Flowrate_E1,
|
||||
0x0000
|
||||
};
|
||||
|
||||
@@ -166,17 +166,17 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
|
||||
// Temperature Data
|
||||
#if HOTENDS >= 1
|
||||
VPHELPER(VP_T_E1_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E1_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E1, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E0, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>),
|
||||
VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
|
||||
VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
|
||||
#endif
|
||||
#if HOTENDS >= 2
|
||||
VPHELPER(VP_T_E2_I, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E2_S, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E2, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_MOVE_E2, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
|
||||
VPHELPER(VP_T_E1_I, &thermalManager.temp_hotend[1].celsius, nullptr, DGUSLCD_SendFloatAsLongValueToDisplay<0>),
|
||||
VPHELPER(VP_T_E1_S, &thermalManager.temp_hotend[1].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_Flowrate_E1, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
|
||||
VPHELPER(VP_MOVE_E1, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
|
||||
#endif
|
||||
#if HOTENDS >= 3
|
||||
#error More than 2 Hotends currently not implemented on the Display UI design.
|
||||
|
@@ -109,12 +109,12 @@ constexpr uint16_t VP_SD_AbortPrintConfirmed = 0x2028; // Abort print confirmati
|
||||
constexpr uint16_t VP_MOVE_X = 0x2100;
|
||||
constexpr uint16_t VP_MOVE_Y = 0x2102;
|
||||
constexpr uint16_t VP_MOVE_Z = 0x2104;
|
||||
constexpr uint16_t VP_MOVE_E1 = 0x2110;
|
||||
constexpr uint16_t VP_MOVE_E2 = 0x2112;
|
||||
//constexpr uint16_t VP_MOVE_E3 = 0x2114;
|
||||
//constexpr uint16_t VP_MOVE_E4 = 0x2116;
|
||||
//constexpr uint16_t VP_MOVE_E5 = 0x2118;
|
||||
//constexpr uint16_t VP_MOVE_E6 = 0x211A;
|
||||
constexpr uint16_t VP_MOVE_E0 = 0x2110;
|
||||
constexpr uint16_t VP_MOVE_E1 = 0x2112;
|
||||
//constexpr uint16_t VP_MOVE_E2 = 0x2114;
|
||||
//constexpr uint16_t VP_MOVE_E3 = 0x2116;
|
||||
//constexpr uint16_t VP_MOVE_E4 = 0x2118;
|
||||
//constexpr uint16_t VP_MOVE_E5 = 0x211A;
|
||||
constexpr uint16_t VP_HOME_ALL = 0x2120;
|
||||
|
||||
// Firmware version on the boot screen.
|
||||
@@ -126,34 +126,34 @@ constexpr uint16_t VP_M117 = 0x3020;
|
||||
constexpr uint8_t VP_M117_LEN = 0x20;
|
||||
|
||||
// Temperatures.
|
||||
constexpr uint16_t VP_T_E1_Is = 0x3060; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E1_Set = 0x3062; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E2_Is = 0x3064; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E0_Is = 0x3060; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E0_Set = 0x3062; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E1_Is = 0x3064; // 4 Byte Integer
|
||||
|
||||
// reserved to support up to 6 Extruders:
|
||||
//constexpr uint16_t VP_T_E2_Set = 0x3066; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E3_Is = 0x3068; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E3_Set = 0x306A; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E4_Is = 0x306C; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E4_Set = 0x306E; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E5_Is = 0x3070; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E5_Set = 0x3072; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E5_Is = 0x3074; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E5_Set = 0x3076; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E6_Is = 0x3078; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E6_Set = 0x307A; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E1_Set = 0x3066; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E2_Is = 0x3068; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E2_Set = 0x306A; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E3_Is = 0x306C; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E3_Set = 0x306E; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E4_Is = 0x3070; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E4_Set = 0x3072; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E4_Is = 0x3074; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E4_Set = 0x3076; // 2 Byte Integer
|
||||
//constexpr uint16_t VP_T_E5_Is = 0x3078; // 4 Byte Integer
|
||||
//constexpr uint16_t VP_T_E5_Set = 0x307A; // 2 Byte Integer
|
||||
|
||||
constexpr uint16_t VP_T_Bed_Is = 0x3080; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_Bed_Set = 0x3082; // 2 Byte Integer
|
||||
|
||||
constexpr uint16_t VP_Flowrate_E1 = 0x3090; // 2 Byte Integer
|
||||
constexpr uint16_t VP_Flowrate_E2 = 0x3092; // 2 Byte Integer
|
||||
constexpr uint16_t VP_Flowrate_E0 = 0x3090; // 2 Byte Integer
|
||||
constexpr uint16_t VP_Flowrate_E1 = 0x3092; // 2 Byte Integer
|
||||
|
||||
// reserved for up to 6 Extruders:
|
||||
//constexpr uint16_t VP_Flowrate_E3 = 0x3094;
|
||||
//constexpr uint16_t VP_Flowrate_E4 = 0x3096;
|
||||
//constexpr uint16_t VP_Flowrate_E5 = 0x3098;
|
||||
//constexpr uint16_t VP_Flowrate_E6 = 0x309A;
|
||||
//constexpr uint16_t VP_Flowrate_E2 = 0x3094;
|
||||
//constexpr uint16_t VP_Flowrate_E3 = 0x3096;
|
||||
//constexpr uint16_t VP_Flowrate_E4 = 0x3098;
|
||||
//constexpr uint16_t VP_Flowrate_E5 = 0x309A;
|
||||
|
||||
constexpr uint16_t VP_Fan_Percentage = 0x3100; // 2 Byte Integer (0..100)
|
||||
constexpr uint16_t VP_Feedrate_Percentage = 0x3102; // 2 Byte Integer (0..100)
|
||||
@@ -182,9 +182,9 @@ constexpr uint16_t VP_SD_FileName4 = 0x3280;
|
||||
// located at 0x5000 and up
|
||||
// Not used yet!
|
||||
// This can be used e.g to make controls / data display invisible
|
||||
constexpr uint16_t SP_T_E1_Is = 0x5000;
|
||||
constexpr uint16_t SP_T_E1_Set = 0x5010;
|
||||
constexpr uint16_t SP_T_E2_Is = 0x5020;
|
||||
constexpr uint16_t SP_T_E0_Is = 0x5000;
|
||||
constexpr uint16_t SP_T_E0_Set = 0x5010;
|
||||
constexpr uint16_t SP_T_E1_Is = 0x5020;
|
||||
constexpr uint16_t SP_T_Bed_Is = 0x5030;
|
||||
constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
||||
|
||||
|
@@ -38,11 +38,6 @@
|
||||
// __MARLIN_FIRMWARE__ exists when compiled within Marlin.
|
||||
#include "pin_mappings.h"
|
||||
#else
|
||||
// Messages that are declared in Marlin
|
||||
#define WELCOME_MSG "Printer Ready"
|
||||
#define MSG_MEDIA_INSERTED "Media Inserted"
|
||||
#define MSG_MEDIA_REMOVED "Media Removed"
|
||||
|
||||
namespace UI {
|
||||
static inline uint32_t safe_millis() {return millis();};
|
||||
static inline void yield() {};
|
||||
|
@@ -20,70 +20,6 @@
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
|
||||
typedef const char Language_Str[];
|
||||
|
||||
// Count how many languages are defined.
|
||||
|
||||
#if defined(LCD_LANGUAGE_5)
|
||||
#define NUM_LANGUAGES 5
|
||||
#elif defined(LCD_LANGUAGE_4)
|
||||
#define NUM_LANGUAGES 4
|
||||
#elif defined(LCD_LANGUAGE_3)
|
||||
#define NUM_LANGUAGES 3
|
||||
#elif defined(LCD_LANGUAGE_2)
|
||||
#define NUM_LANGUAGES 2
|
||||
#else
|
||||
#define NUM_LANGUAGES 1
|
||||
#endif
|
||||
|
||||
// Set undefined languages equal to the last and
|
||||
// let the compiler optimize out the duplicates
|
||||
|
||||
#ifndef LCD_LANGUAGE_1
|
||||
#define LCD_LANGUAGE_1 LCD_LANGUAGE
|
||||
#endif
|
||||
|
||||
#ifndef LCD_LANGUAGE_2
|
||||
#define LCD_LANGUAGE_2 LCD_LANGUAGE_1
|
||||
#endif
|
||||
|
||||
#ifndef LCD_LANGUAGE_3
|
||||
#define LCD_LANGUAGE_3 LCD_LANGUAGE_2
|
||||
#endif
|
||||
|
||||
#ifndef LCD_LANGUAGE_4
|
||||
#define LCD_LANGUAGE_4 LCD_LANGUAGE_3
|
||||
#endif
|
||||
|
||||
#ifndef LCD_LANGUAGE_5
|
||||
#define LCD_LANGUAGE_5 LCD_LANGUAGE_4
|
||||
#endif
|
||||
|
||||
// Indirection required to paste together the namespace name
|
||||
|
||||
#define _GET_LANG(LANG) Language_##LANG
|
||||
#define GET_LANG(LANG) _GET_LANG(LANG)
|
||||
|
||||
#if NUM_LANGUAGES > 1
|
||||
extern uint8_t lang;
|
||||
// The compiler does a good job of "flattening" out this
|
||||
// if statement when there are fewer than five languages.
|
||||
#define GET_TEXT(MSG) ( \
|
||||
lang == 0 ? GET_LANG(LCD_LANGUAGE_1)::MSG : \
|
||||
lang == 1 ? GET_LANG(LCD_LANGUAGE_2)::MSG : \
|
||||
lang == 2 ? GET_LANG(LCD_LANGUAGE_3)::MSG : \
|
||||
lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \
|
||||
GET_LANG(LCD_LANGUAGE_5)::MSG \
|
||||
)
|
||||
#else
|
||||
#define GET_TEXT(MSG) GET_LANG(LCD_LANGUAGE_1)::MSG
|
||||
#endif
|
||||
#define GET_TEXT_F(MSG) reinterpret_cast<const __FlashStringHelper *>(GET_TEXT(MSG))
|
||||
|
||||
#define GET_LANGUAGE_NAME(N) GET_LANG(LCD_LANGUAGE_##N)::LANGUAGE
|
||||
|
||||
// All the language tables go here
|
||||
|
||||
#include "language_en.h"
|
||||
#include "language_de.h"
|
||||
#include "language_fr.h"
|
||||
|
@@ -24,8 +24,6 @@
|
||||
namespace Language_de {
|
||||
using namespace Language_en; // Inherit undefined strings from English
|
||||
|
||||
PROGMEM Language_Str LANGUAGE = u8"Deutsche";
|
||||
|
||||
PROGMEM Language_Str YES = u8"JA";
|
||||
PROGMEM Language_Str NO = u8"NEIN";
|
||||
PROGMEM Language_Str BACK = u8"Zurück";
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include "language.h"
|
||||
|
||||
namespace Language_en {
|
||||
PROGMEM Language_Str LANGUAGE = u8"English";
|
||||
|
||||
PROGMEM Language_Str YES = u8"Yes";
|
||||
PROGMEM Language_Str NO = u8"No";
|
||||
PROGMEM Language_Str BACK = u8"Back";
|
||||
|
@@ -24,8 +24,6 @@
|
||||
namespace Language_fr {
|
||||
using namespace Language_en; // Inherit undefined strings from English
|
||||
|
||||
PROGMEM Language_Str LANGUAGE = u8"Français";
|
||||
|
||||
PROGMEM Language_Str YES = u8"oui";
|
||||
PROGMEM Language_Str NO = u8"non";
|
||||
PROGMEM Language_Str BACK = u8"Retour";
|
||||
|
@@ -38,19 +38,21 @@ namespace ExtUI {
|
||||
EventLoop::loop();
|
||||
}
|
||||
|
||||
void onPrinterKilled(PGM_P lcd_msg) {
|
||||
KillScreen::show(progmem_str(lcd_msg));
|
||||
void onPrinterKilled(PGM_P const error, PGM_P const component) {
|
||||
char str[strlen_P(error) + strlen_P(component) + 3];
|
||||
sprintf_P(str, PSTR(S_FMT ": " S_FMT), error, component);
|
||||
KillScreen::show(str);
|
||||
}
|
||||
|
||||
void onMediaInserted() {
|
||||
if (AT_SCREEN(StatusScreen))
|
||||
StatusScreen::setStatusMessage(F(MSG_MEDIA_INSERTED));
|
||||
StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_INSERTED));
|
||||
sound.play(media_inserted, PLAY_ASYNCHRONOUS);
|
||||
}
|
||||
|
||||
void onMediaRemoved() {
|
||||
if (AT_SCREEN(StatusScreen))
|
||||
StatusScreen::setStatusMessage(F(MSG_MEDIA_REMOVED));
|
||||
StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MEDIA_REMOVED));
|
||||
sound.play(media_removed, PLAY_ASYNCHRONOUS);
|
||||
if (AT_SCREEN(FilesScreen)) {
|
||||
GOTO_SCREEN(StatusScreen)
|
||||
|
@@ -85,10 +85,10 @@ void BootScreen::onIdle() {
|
||||
PUSH_SCREEN(StatusScreen);
|
||||
PUSH_SCREEN(BioConfirmHomeE);
|
||||
#elif NUM_LANGUAGES > 1
|
||||
StatusScreen::setStatusMessage(F(WELCOME_MSG));
|
||||
StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG));
|
||||
GOTO_SCREEN(LanguageMenu);
|
||||
#else
|
||||
StatusScreen::setStatusMessage(F(WELCOME_MSG));
|
||||
StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG));
|
||||
GOTO_SCREEN(StatusScreen);
|
||||
#endif
|
||||
}
|
||||
|
@@ -32,10 +32,12 @@ using namespace ExtUI;
|
||||
|
||||
void EndstopStatesScreen::onEntry() {
|
||||
BaseScreen::onEntry();
|
||||
enable_emi_pins(true);
|
||||
}
|
||||
|
||||
void EndstopStatesScreen::onExit() {
|
||||
BaseScreen::onExit();
|
||||
enable_emi_pins(false);
|
||||
}
|
||||
|
||||
void EndstopStatesScreen::onRedraw(draw_mode_t) {
|
||||
|
@@ -32,7 +32,7 @@ using namespace FTDI;
|
||||
// loop. So we only have a show() method rather than onRedraw(). The KillScreen
|
||||
// should not be used as a model for other UI screens as it is an exception.
|
||||
|
||||
void KillScreen::show(progmem_str message) {
|
||||
void KillScreen::show(const char *message) {
|
||||
CommandProcessor cmd;
|
||||
|
||||
cmd.cmd(CMD_DLSTART)
|
||||
|
@@ -39,15 +39,15 @@ void MaxAccelerationScreen::onRedraw(draw_mode_t what) {
|
||||
w.color(y_axis) .adjuster( 4, GET_TEXT_F(AMAX_Y), getAxisMaxAcceleration_mm_s2(Y) );
|
||||
w.color(z_axis) .adjuster( 6, GET_TEXT_F(AMAX_Z), getAxisMaxAcceleration_mm_s2(Z) );
|
||||
#if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
|
||||
w.color(e_axis).adjuster( 8, GET_TEXT_F(AMAX_E1), getAxisMaxAcceleration_mm_s2(E0) );
|
||||
w.color(e_axis).adjuster( 8, GET_TEXT_F(AMAX_E0), getAxisMaxAcceleration_mm_s2(E0) );
|
||||
#elif EXTRUDERS > 1
|
||||
w.color(e_axis).adjuster( 8, GET_TEXT_F(AMAX_E1), getAxisMaxAcceleration_mm_s2(E0) );
|
||||
w.color(e_axis).adjuster(10, GET_TEXT_F(AMAX_E2), getAxisMaxAcceleration_mm_s2(E1) );
|
||||
w.color(e_axis).adjuster( 8, GET_TEXT_F(AMAX_E0), getAxisMaxAcceleration_mm_s2(E0) );
|
||||
w.color(e_axis).adjuster(10, GET_TEXT_F(AMAX_E1), getAxisMaxAcceleration_mm_s2(E1) );
|
||||
#if EXTRUDERS > 2
|
||||
w.color(e_axis).adjuster(12, GET_TEXT_F(AMAX_E3), getAxisMaxAcceleration_mm_s2(E2) );
|
||||
w.color(e_axis).adjuster(12, GET_TEXT_F(AMAX_E2), getAxisMaxAcceleration_mm_s2(E2) );
|
||||
#endif
|
||||
#if EXTRUDERS > 3
|
||||
w.color(e_axis).adjuster(14, GET_TEXT_F(AMAX_E4), getAxisMaxAcceleration_mm_s2(E3) );
|
||||
w.color(e_axis).adjuster(14, GET_TEXT_F(AMAX_E3), getAxisMaxAcceleration_mm_s2(E3) );
|
||||
#endif
|
||||
#endif
|
||||
w.increments();
|
||||
|
@@ -135,7 +135,7 @@ class KillScreen {
|
||||
// The KillScreen is behaves differently than the
|
||||
// others, so we do not bother extending UIScreen.
|
||||
public:
|
||||
static void show(progmem_str msg);
|
||||
static void show(const char*);
|
||||
};
|
||||
|
||||
class DialogBoxBaseClass : public BaseScreen {
|
||||
|
@@ -939,6 +939,12 @@ namespace ExtUI {
|
||||
ui.abort_print();
|
||||
}
|
||||
|
||||
void onUserConfirmRequired_P(PGM_P const pstr) {
|
||||
char msg[strlen_P(pstr) + 1];
|
||||
strcpy_P(msg, pstr);
|
||||
onUserConfirmRequired(msg);
|
||||
}
|
||||
|
||||
FileList::FileList() { refresh(); }
|
||||
|
||||
void FileList::refresh() { num_files = 0xFFFF; }
|
||||
@@ -1036,11 +1042,11 @@ void MarlinUI::update() {
|
||||
ExtUI::onIdle();
|
||||
}
|
||||
|
||||
void MarlinUI::kill_screen(PGM_P const msg) {
|
||||
void MarlinUI::kill_screen(PGM_P const error, PGM_P const component) {
|
||||
using namespace ExtUI;
|
||||
if (!flags.printer_killed) {
|
||||
flags.printer_killed = true;
|
||||
onPrinterKilled(msg);
|
||||
onPrinterKilled(error, component);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -293,12 +293,13 @@ namespace ExtUI {
|
||||
void onMediaError();
|
||||
void onMediaRemoved();
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration);
|
||||
void onPrinterKilled(PGM_P const msg);
|
||||
void onPrinterKilled(PGM_P const error, PGM_P const component);
|
||||
void onPrintTimerStarted();
|
||||
void onPrintTimerPaused();
|
||||
void onPrintTimerStopped();
|
||||
void onFilamentRunout(const extruder_t extruder);
|
||||
void onUserConfirmRequired(const char * const msg);
|
||||
void onUserConfirmRequired_P(PGM_P const pstr);
|
||||
void onStatusChanged(const char * const msg);
|
||||
void onFactoryReset();
|
||||
void onStoreSettings(char *);
|
||||
|
Reference in New Issue
Block a user