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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user