🚸 Refactor MKS H43 LCD (#27776)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
7a257ef3e1
commit
c5de0c69e5
6 changed files with 314 additions and 522 deletions
|
|
@ -325,7 +325,11 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
|
|||
|
||||
void DGUSScreenHandler::sdCardError() {
|
||||
DGUSScreenHandler::sdCardRemoved();
|
||||
sendInfoScreen(F("NOTICE"), nullptr, F("SD card error"), nullptr);
|
||||
#if DGUS_LCD_UI_MKS
|
||||
screen.sendInfoScreenMKS(F("NOTICE"), nullptr, F("SD card error"), nullptr, mks_language_index);
|
||||
#else
|
||||
sendInfoScreen(F("NOTICE"), nullptr, F("SD card error"), nullptr, true, true, true, true);
|
||||
#endif
|
||||
setupConfirmAction(nullptr);
|
||||
gotoScreen(DGUS_SCREEN_POPUP);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,12 @@ namespace ExtUI {
|
|||
void onIdle() { screen.loop(); }
|
||||
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const) {
|
||||
#if DGUS_LCD_UI_MKS
|
||||
screen.sendInfoScreenMKS(GET_TEXT_F(MSG_HALTED), error, nullptr, GET_TEXT_F(MSG_PLEASE_RESET), mks_language_index);
|
||||
#else
|
||||
screen.sendInfoScreen(GET_TEXT_F(MSG_HALTED), error, FPSTR(NUL_STR), GET_TEXT_F(MSG_PLEASE_RESET));
|
||||
#endif
|
||||
|
||||
screen.gotoScreen(DGUS_SCREEN_KILL);
|
||||
while (!screen.loop()); // Wait while anything is left to be sent
|
||||
}
|
||||
|
|
@ -64,7 +69,11 @@ namespace ExtUI {
|
|||
|
||||
void onUserConfirmRequired(const char * const msg) {
|
||||
if (msg) {
|
||||
screen.sendInfoScreen(F("Please confirm."), nullptr, msg, nullptr, true, true, false, true);
|
||||
#if DGUS_LCD_UI_MKS
|
||||
screen.sendInfoScreenMKS(F("Please confirm."), nullptr, msg, nullptr, mks_language_index);
|
||||
#else
|
||||
screen.sendInfoScreen(F("Please confirm."), nullptr, msg, nullptr, true, false, false, false);
|
||||
#endif
|
||||
screen.setupConfirmAction(setUserConfirmed);
|
||||
screen.gotoScreen(DGUS_SCREEN_POPUP);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ void MKS_resume_print_move() {
|
|||
|
||||
float z_offset_add = 0;
|
||||
|
||||
xyz_int_t tmc_step; // = { 0, 0, 0 }
|
||||
xyz_int_t tmc_stall_sens; // = { 0, 0, 0 }
|
||||
|
||||
uint16_t lcd_default_light = 50;
|
||||
|
||||
|
|
@ -117,7 +117,10 @@ const uint16_t VPList_Boot[] PROGMEM = {
|
|||
};
|
||||
|
||||
#define MKSLIST_E_ITEM(N) VP_T_E##N##_Is, VP_T_E##N##_Set,
|
||||
#define INFO_BAR REPEAT(EXTRUDERS, MKSLIST_E_ITEM) VP_T_Bed_Is, VP_T_Bed_Set, VP_Fan0_Percentage,
|
||||
|
||||
// Not defined in firmware 1.30 or 1.31
|
||||
/*
|
||||
const uint16_t VPList_Main[] PROGMEM = {
|
||||
// VP_M117, for completeness, but it cannot be auto-uploaded.
|
||||
#if HAS_HOTEND
|
||||
|
|
@ -140,53 +143,31 @@ const uint16_t VPList_Main[] PROGMEM = {
|
|||
#endif
|
||||
0x0000
|
||||
};
|
||||
*/
|
||||
|
||||
const uint16_t MKSList_Home[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
// Language
|
||||
// VP_HOME_Dis,
|
||||
INFO_BAR
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_Setting[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
// Language
|
||||
VP_Setting_Dis,
|
||||
INFO_BAR
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_Tool[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
// Language
|
||||
VP_Tool_Dis,
|
||||
// LCD BLK
|
||||
INFO_BAR
|
||||
|
||||
// LCD BackLight
|
||||
VP_LCD_BLK,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_EXTRUDE[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
VP_Filament_distance,
|
||||
VP_Filament_speed,
|
||||
|
|
@ -195,34 +176,19 @@ const uint16_t MKSList_EXTRUDE[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_LEVEL[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_MOVE[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_Print[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
// Print Percent
|
||||
VP_PrintProgress_Percentage,
|
||||
|
||||
|
|
@ -254,24 +220,13 @@ const uint16_t MKSList_SD_File[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_TempOnly[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
// LCD BLK
|
||||
VP_LCD_BLK,
|
||||
INFO_BAR
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_Pulse[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
const uint16_t MKSList_Steps_mm[] PROGMEM = {
|
||||
INFO_BAR
|
||||
|
||||
// Steps/mm
|
||||
VP_X_STEP_PER_MM,
|
||||
|
|
@ -284,12 +239,7 @@ const uint16_t MKSList_Pulse[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_MaxSpeed[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
// Max Speed
|
||||
VP_X_MAX_SPEED,
|
||||
|
|
@ -302,31 +252,20 @@ const uint16_t MKSList_MaxSpeed[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_MaxAcc[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
// ACC
|
||||
VP_ACC_SPEED,
|
||||
VP_X_ACC_MAX_SPEED,
|
||||
VP_Y_ACC_MAX_SPEED,
|
||||
VP_Z_ACC_MAX_SPEED,
|
||||
VP_E0_ACC_MAX_SPEED,
|
||||
VP_E1_ACC_MAX_SPEED,
|
||||
// Acceleration
|
||||
VP_X_MAX_ACC,
|
||||
VP_Y_MAX_ACC,
|
||||
VP_Z_MAX_ACC,
|
||||
VP_E0_MAX_ACC,
|
||||
VP_E1_MAX_ACC,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_PID[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
// PID
|
||||
VP_E0_PID_P,
|
||||
|
|
@ -337,12 +276,7 @@ const uint16_t MKSList_PID[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_Level_Point[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
// FAN
|
||||
VP_Fan0_Percentage,
|
||||
INFO_BAR
|
||||
|
||||
// Level Point
|
||||
VP_Level_Point_One_X,
|
||||
|
|
@ -372,10 +306,7 @@ const uint16_t MKSList_Level_PrintConfig[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_PrintPauseConfig[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
INFO_BAR
|
||||
|
||||
VP_X_PARK_POS,
|
||||
VP_Y_PARK_POS,
|
||||
|
|
@ -384,11 +315,8 @@ const uint16_t MKSList_PrintPauseConfig[] PROGMEM = {
|
|||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSList_MotoConfig[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
const uint16_t MKSList_MotionConfig[] PROGMEM = {
|
||||
INFO_BAR
|
||||
|
||||
VP_TRAVEL_SPEED,
|
||||
VP_FEEDRATE_MIN_SPEED,
|
||||
|
|
@ -398,24 +326,18 @@ const uint16_t MKSList_MotoConfig[] PROGMEM = {
|
|||
};
|
||||
|
||||
const uint16_t MKSList_EX_Config[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
INFO_BAR
|
||||
VP_MIN_EX_T,VP_Min_EX_T_E,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSTMC_Config[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
// HB Temp
|
||||
VP_T_Bed_Is, VP_T_Bed_Set,
|
||||
VP_MIN_EX_T,
|
||||
INFO_BAR
|
||||
|
||||
VP_TMC_X_STEP,
|
||||
VP_TMC_Y_STEP,
|
||||
VP_TMC_Z_STEP,
|
||||
VP_TMC_X_SENS,
|
||||
VP_TMC_Y_SENS,
|
||||
VP_TMC_Z_SENS,
|
||||
VP_TMC_X1_Current,
|
||||
VP_TMC_Y1_Current,
|
||||
VP_TMC_X_Current,
|
||||
|
|
@ -431,20 +353,23 @@ const uint16_t MKSTMC_Config[] PROGMEM = {
|
|||
const uint16_t MKSAuto_Level[] PROGMEM = {
|
||||
VP_MESH_LEVEL_POINT_DIS,
|
||||
VP_ZPos,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSOffset_Config[] PROGMEM = {
|
||||
// E Temp
|
||||
REPEAT(EXTRUDERS, MKSLIST_E_ITEM)
|
||||
INFO_BAR
|
||||
|
||||
VP_OFFSET_X,
|
||||
VP_OFFSET_Y,
|
||||
VP_OFFSET_Z,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
const uint16_t MKSBabyStep[] PROGMEM = {
|
||||
VP_ZOffset_DE_DIS,
|
||||
|
||||
0x0000
|
||||
};
|
||||
|
||||
|
|
@ -472,14 +397,14 @@ const struct VPMapping VPMap[] PROGMEM = {
|
|||
{ MKSLCD_SCREEN_PRINT, MKSList_Print }, // Page 7
|
||||
{ MKSLCD_SCREEN_PAUSE, MKSList_Print }, // Page 26
|
||||
{ MKSLCD_SCREEN_CHOOSE_FILE, MKSList_SD_File }, // Page 15
|
||||
{ MKSLCD_SCREEN_MOTOR_PULSE, MKSList_Pulse }, // Page 51
|
||||
{ MKSLCD_SCREEN_MOTOR_SPEED, MKSList_MaxSpeed }, // Page 55
|
||||
{ MKSLCD_SCREEN_MOTOR_ACC_MAX, MKSList_MaxAcc }, // Page 53
|
||||
{ MKSLCD_SCREEN_STEPS_MM, MKSList_Steps_mm }, // Page 51
|
||||
{ MKSLCD_SCREEN_AXIS_SPEED, MKSList_MaxSpeed }, // Page 55
|
||||
{ MKSLCD_SCREEN_AXIS_ACC_MAX, MKSList_MaxAcc }, // Page 53
|
||||
{ MKSLCD_SCREEN_LEVEL_DATA, MKSList_Level_Point }, // Page 48
|
||||
{ MKSLCD_PrintPause_SET, MKSList_PrintPauseConfig }, // Page 49
|
||||
{ MKSLCD_FILAMENT_DATA, MKSList_SD_File }, // Page 50
|
||||
//{ MKSLCD_FILAMENT_DATA, MKSList_SD_File }, // Page 50
|
||||
{ MKSLCD_SCREEN_Config, MKSList_TempOnly }, // Page 46
|
||||
{ MKSLCD_SCREEN_Config_MOTOR, MKSList_MotoConfig }, // Page 47
|
||||
{ MKSLCD_SCREEN_Config_MOTOR, MKSList_MotionConfig }, // Page 47
|
||||
{ MKSLCD_PID, MKSList_PID }, // Page 56
|
||||
{ MKSLCD_ABOUT, MKSList_About }, // Page 36
|
||||
{ MKSLCD_SCREEN_PRINT_CONFIG, MKSList_Level_PrintConfig }, // Page 60
|
||||
|
|
@ -495,7 +420,7 @@ const struct VPMapping VPMap[] PROGMEM = {
|
|||
};
|
||||
|
||||
const char MarlinVersion[] PROGMEM = SHORT_BUILD_VERSION;
|
||||
const char H43Version[] PROGMEM = "MKS H43_V1.30";
|
||||
const char H43Version[] PROGMEM = "MKS H43_V1.31";
|
||||
const char Updata_Time[] PROGMEM = STRING_DISTRIBUTION_DATE;
|
||||
|
||||
const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
||||
|
|
@ -664,27 +589,27 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
|||
VPHELPER(VP_Z_MAX_SPEED, &planner.settings.max_feedrate_mm_s[Z_AXIS], screen.handleMaxSpeedChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(0)], screen.handleExtruderMaxSpeedChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_E0_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(0)], screen.handleMaxSpeedChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], screen.handleExtruderMaxSpeedChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_E1_MAX_SPEED, &planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], screen.handleMaxSpeedChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
VPHELPER(VP_X_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[X_AXIS], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_Y_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Y_AXIS], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_Z_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Z_AXIS], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_X_MAX_ACC, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[X_AXIS], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_Y_MAX_ACC, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Y_AXIS], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_Z_MAX_ACC, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[Z_AXIS], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(0)], screen.handleExtruderAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_E0_MAX_ACC, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(0)], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_ACC_MAX_SPEED, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], screen.handleExtruderAccChange, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_E1_MAX_ACC, (uint16_t *)&planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], screen.handleMaxAccChange, screen.sendWordValueToDisplay),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
VPHELPER(VP_TRAVEL_SPEED, (uint16_t *)&planner.settings.travel_acceleration, screen.handleTravelAccChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_FEEDRATE_MIN_SPEED, (uint16_t *)&planner.settings.min_feedrate_mm_s, screen.handleFeedRateMinChange, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_T_F_SPEED, (uint16_t *)&planner.settings.min_travel_feedrate_mm_s, screen.handleMin_T_F, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_ACC_SPEED, (uint16_t *)&planner.settings.acceleration, screen.handleAccChange, screen.sendWordValueToDisplay),
|
||||
//VPHELPER(VP_DEFAULT_ACC, (uint16_t *)&planner.settings.acceleration, screen.handleAccChange, screen.sendWordValueToDisplay),
|
||||
|
||||
VPHELPER(VP_X_PARK_POS, &mks_park_pos.x, screen.getParkPos, screen.sendWordValueToDisplay),
|
||||
VPHELPER(VP_Y_PARK_POS, &mks_park_pos.y, screen.getParkPos, screen.sendWordValueToDisplay),
|
||||
|
|
@ -696,13 +621,13 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
|||
|
||||
#if ENABLED(SENSORLESS_HOMING) // TMC SENSORLESS Setting
|
||||
#if X_HAS_STEALTHCHOP
|
||||
VPHELPER(VP_TMC_X_STEP, &tmc_step.x, screen.tmcChangeConfig, screen.sendTMCStepValue),
|
||||
VPHELPER(VP_TMC_X_SENS, &tmc_stall_sens.x, screen.tmcChangeConfig, screen.sendTMCSensValue),
|
||||
#endif
|
||||
#if Y_HAS_STEALTHCHOP
|
||||
VPHELPER(VP_TMC_Y_STEP, &tmc_step.y, screen.tmcChangeConfig, screen.sendTMCStepValue),
|
||||
VPHELPER(VP_TMC_Y_SENS, &tmc_stall_sens.y, screen.tmcChangeConfig, screen.sendTMCSensValue),
|
||||
#endif
|
||||
#if Z_HAS_STEALTHCHOP
|
||||
VPHELPER(VP_TMC_Z_STEP, &tmc_step.z, screen.tmcChangeConfig, screen.sendTMCStepValue),
|
||||
VPHELPER(VP_TMC_Z_SENS, &tmc_stall_sens.z, screen.tmcChangeConfig, screen.sendTMCSensValue),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -753,9 +678,9 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
|
|||
|
||||
#if ENABLED(EDITABLE_STEPS_PER_UNIT)
|
||||
#if HAS_HOTEND
|
||||
VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], screen.handleStepPerMMExtruderChanged, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_E0_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(0)], screen.handleStepPerMMChanged, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
#if HAS_MULTI_HOTEND
|
||||
VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], screen.handleStepPerMMExtruderChanged, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
VPHELPER(VP_E1_STEP_PER_MM, &planner.settings.axis_steps_per_mm[E_AXIS_N(1)], screen.handleStepPerMMChanged, screen.sendFloatAsIntValueToDisplay<0>),
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ void MKS_resume_print_move();
|
|||
|
||||
extern float z_offset_add;
|
||||
|
||||
extern xyz_int_t tmc_step;
|
||||
extern xyz_int_t tmc_stall_sens;
|
||||
|
||||
extern uint16_t lcd_default_light;
|
||||
|
||||
|
|
@ -130,16 +130,16 @@ enum DGUS_ScreenID : uint8_t {
|
|||
MKSLCD_SCREEN_PRINT = 68,
|
||||
MKSLCD_SCREEN_PAUSE = 70,
|
||||
MKSLCD_SCREEN_CHOOSE_FILE = 87,
|
||||
MKSLCD_SCREEN_NO_CHOOSE_FILE = 88,
|
||||
//MKSLCD_SCREEN_NO_CHOOSE_FILE = 88, // Missing in 1.31 firmware
|
||||
MKSLCD_SCREEN_Config = 101,
|
||||
MKSLCD_SCREEN_Config_MOTOR = 103,
|
||||
MKSLCD_SCREEN_MOTOR_PULSE = 104,
|
||||
MKSLCD_SCREEN_MOTOR_SPEED = 102,
|
||||
MKSLCD_SCREEN_MOTOR_ACC_MAX = 105,
|
||||
MKSLCD_SCREEN_STEPS_MM = 104,
|
||||
MKSLCD_SCREEN_AXIS_SPEED = 102,
|
||||
MKSLCD_SCREEN_AXIS_ACC_MAX = 105,
|
||||
MKSLCD_SCREEN_PRINT_CONFIG = 72,
|
||||
MKSLCD_SCREEN_LEVEL_DATA = 106,
|
||||
MKSLCD_PrintPause_SET = 107,
|
||||
MKSLCD_FILAMENT_DATA = 50,
|
||||
//MKSLCD_FILAMENT_DATA = 50, // Missing in 1.31 firmware
|
||||
MKSLCD_ABOUT = 83,
|
||||
MKSLCD_PID = 108,
|
||||
MKSLCD_PAUSE_SETTING_MOVE = 98,
|
||||
|
|
@ -185,16 +185,16 @@ enum DGUS_ScreenID : uint8_t {
|
|||
MKSLCD_SCREEN_PAUSE = 26,
|
||||
MKSLCD_SCREEN_PAUSE_PRESS = 26,
|
||||
MKSLCD_SCREEN_CHOOSE_FILE = 15,
|
||||
MKSLCD_SCREEN_NO_CHOOSE_FILE = 17,
|
||||
//MKSLCD_SCREEN_NO_CHOOSE_FILE = 17, // Missing in 1.30 firmware
|
||||
MKSLCD_SCREEN_Config = 46,
|
||||
MKSLCD_SCREEN_Config_MOTOR = 47,
|
||||
MKSLCD_SCREEN_MOTOR_PULSE = 51,
|
||||
MKSLCD_SCREEN_STEPS_MM = 51,
|
||||
MKSLCD_SCREEN_MOTOR_SPEED = 55,
|
||||
MKSLCD_SCREEN_MOTOR_ACC_MAX = 53,
|
||||
MKSLCD_SCREEN_PRINT_CONFIG = 60,
|
||||
MKSLCD_SCREEN_LEVEL_DATA = 48,
|
||||
MKSLCD_PrintPause_SET = 49,
|
||||
MKSLCD_FILAMENT_DATA = 50,
|
||||
//MKSLCD_FILAMENT_DATA = 50, // Missing in 1.31 firmware
|
||||
MKSLCD_ABOUT = 36,
|
||||
MKSLCD_PID = 56,
|
||||
MKSLCD_PAUSE_SETTING_MOVE = 58,
|
||||
|
|
@ -214,7 +214,7 @@ enum DGUS_ScreenID : uint8_t {
|
|||
|
||||
DGUS_SCREEN_CONFIRM = 240,
|
||||
DGUS_SCREEN_KILL = 250, //!< Kill Screen. Must always be 250 (to be able to display "Error wrong LCD Version")
|
||||
DGUS_SCREEN_WAITING = 251,
|
||||
DGUS_SCREEN_WAITING = 252, // Missing in 1.30 and 1.31 firmware, workaround
|
||||
DGUS_SCREEN_POPUP = 252, //!< special target, popup screen will also return this code to say "return to previous screen"
|
||||
DGUS_SCREEN_UNUSED = 255
|
||||
};
|
||||
|
|
@ -226,23 +226,8 @@ constexpr uint8_t VP_M117_LEN = 0x20;
|
|||
// Heater status
|
||||
constexpr uint16_t VP_E0_STATUS = 0x3410;
|
||||
constexpr uint16_t VP_E1_STATUS = 0x3412;
|
||||
//constexpr uint16_t VP_E2_STATUS = 0x3414;
|
||||
//constexpr uint16_t VP_E3_STATUS = 0x3416;
|
||||
//constexpr uint16_t VP_E4_STATUS = 0x3418;
|
||||
//constexpr uint16_t VP_E5_STATUS = 0x341A;
|
||||
constexpr uint16_t VP_MOVE_OPTION = 0x3500;
|
||||
|
||||
// // PIDs
|
||||
// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
|
||||
// constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
// constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
|
||||
// constexpr uint16_t VP_E1_PID_I = 0x3708;
|
||||
// constexpr uint16_t VP_E1_PID_D = 0x370A;
|
||||
// constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
// constexpr uint16_t VP_BED_PID_I = 0x3712;
|
||||
// constexpr uint16_t VP_BED_PID_D = 0x3714;
|
||||
|
||||
// Waiting screen status
|
||||
constexpr uint16_t VP_WAITING_STATUS = 0x3800;
|
||||
|
||||
|
|
@ -288,22 +273,11 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_POWER_LOSS_RECOVERY = 0x1680;
|
||||
/* -------------------------------0x2000-0x2FFF------------------------------- */
|
||||
// Temperatures.
|
||||
// Only E0 and E1 are present in H43 firmware
|
||||
constexpr uint16_t VP_T_E0_Is = 0x2000; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E0_Set = 0x2004; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E1_Is = 0x2008; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E1_Set = 0x200B; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E2_Is = 0x2010; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E2_Set = 0x2014; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E3_Is = 0x2018; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E3_Set = 0x201B; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E4_Is = 0x2020; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E4_Set = 0x2024; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E5_Is = 0x2028; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E5_Set = 0x202B; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E6_Is = 0x2030; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E6_Set = 0x2034; // 2 Byte Integer
|
||||
constexpr uint16_t VP_T_E7_Is = 0x2038; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_E7_Set = 0x203B; // 2 Byte Integer
|
||||
|
||||
constexpr uint16_t VP_T_Bed_Is = 0x2040; // 4 Byte Integer
|
||||
constexpr uint16_t VP_T_Bed_Set = 0x2044; // 2 Byte Integer
|
||||
|
|
@ -312,12 +286,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
|
||||
constexpr uint16_t VP_Flowrate_E0 = 0x2200; // 2 Byte Integer
|
||||
constexpr uint16_t VP_Flowrate_E1 = 0x2202; // 2 Byte Integer
|
||||
constexpr uint16_t VP_Flowrate_E2 = 0x2204;
|
||||
constexpr uint16_t VP_Flowrate_E3 = 0x2206;
|
||||
constexpr uint16_t VP_Flowrate_E4 = 0x2208;
|
||||
constexpr uint16_t VP_Flowrate_E5 = 0x220A;
|
||||
constexpr uint16_t VP_Flowrate_E6 = 0x220C;
|
||||
constexpr uint16_t VP_Flowrate_E7 = 0x220E;
|
||||
|
||||
// Move
|
||||
constexpr uint16_t VP_MOVE_X = 0x2300;
|
||||
|
|
@ -325,12 +293,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_MOVE_Z = 0x2304;
|
||||
constexpr uint16_t VP_MOVE_E0 = 0x2310;
|
||||
constexpr uint16_t VP_MOVE_E1 = 0x2312;
|
||||
constexpr uint16_t VP_MOVE_E2 = 0x2314;
|
||||
constexpr uint16_t VP_MOVE_E3 = 0x2316;
|
||||
constexpr uint16_t VP_MOVE_E4 = 0x2318;
|
||||
constexpr uint16_t VP_MOVE_E5 = 0x231A;
|
||||
constexpr uint16_t VP_MOVE_E6 = 0x231C;
|
||||
constexpr uint16_t VP_MOVE_E7 = 0x231E;
|
||||
|
||||
constexpr uint16_t VP_HOME_ALL = 0x2320;
|
||||
constexpr uint16_t VP_MOTOR_LOCK_UNLOCK = 0x2330;
|
||||
|
|
@ -350,9 +312,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_LANGUAGE_CHANGE = 0x2380;
|
||||
constexpr uint16_t VP_LANGUAGE_CHANGE1 = 0x2382;
|
||||
constexpr uint16_t VP_LANGUAGE_CHANGE2 = 0x2384;
|
||||
constexpr uint16_t VP_LANGUAGE_CHANGE3 = 0x2386;
|
||||
constexpr uint16_t VP_LANGUAGE_CHANGE4 = 0x2388;
|
||||
constexpr uint16_t VP_LANGUAGE_CHANGE5 = 0x238A;
|
||||
|
||||
// LEVEL
|
||||
constexpr uint16_t VP_LEVEL_POINT = 0x2400;
|
||||
|
|
@ -396,12 +355,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_Z_STEP_PER_MM = 0x2908;
|
||||
constexpr uint16_t VP_E0_STEP_PER_MM = 0x2910;
|
||||
constexpr uint16_t VP_E1_STEP_PER_MM = 0x2912;
|
||||
constexpr uint16_t VP_E2_STEP_PER_MM = 0x2914;
|
||||
constexpr uint16_t VP_E3_STEP_PER_MM = 0x2916;
|
||||
constexpr uint16_t VP_E4_STEP_PER_MM = 0x2918;
|
||||
constexpr uint16_t VP_E5_STEP_PER_MM = 0x291A;
|
||||
constexpr uint16_t VP_E6_STEP_PER_MM = 0x291C;
|
||||
constexpr uint16_t VP_E7_STEP_PER_MM = 0x291E;
|
||||
|
||||
constexpr uint16_t VP_X_MAX_SPEED = 0x2A00;
|
||||
constexpr uint16_t VP_Y_MAX_SPEED = 0x2A04;
|
||||
|
|
@ -409,16 +362,16 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_E0_MAX_SPEED = 0x2A0C;
|
||||
constexpr uint16_t VP_E1_MAX_SPEED = 0x2A10;
|
||||
|
||||
constexpr uint16_t VP_X_ACC_MAX_SPEED = 0x2A28;
|
||||
constexpr uint16_t VP_Y_ACC_MAX_SPEED = 0x2A2C;
|
||||
constexpr uint16_t VP_Z_ACC_MAX_SPEED = 0x2A30;
|
||||
constexpr uint16_t VP_E0_ACC_MAX_SPEED = 0x2A34;
|
||||
constexpr uint16_t VP_E1_ACC_MAX_SPEED = 0x2A38;
|
||||
constexpr uint16_t VP_X_MAX_ACC = 0x2A28;
|
||||
constexpr uint16_t VP_Y_MAX_ACC = 0x2A2C;
|
||||
constexpr uint16_t VP_Z_MAX_ACC = 0x2A30;
|
||||
constexpr uint16_t VP_E0_MAX_ACC = 0x2A34;
|
||||
constexpr uint16_t VP_E1_MAX_ACC = 0x2A38;
|
||||
|
||||
constexpr uint16_t VP_TRAVEL_SPEED = 0x2A3C;
|
||||
constexpr uint16_t VP_FEEDRATE_MIN_SPEED = 0x2A40;
|
||||
constexpr uint16_t VP_T_F_SPEED = 0x2A44;
|
||||
constexpr uint16_t VP_ACC_SPEED = 0x2A48;
|
||||
constexpr uint16_t VP_DEFAULT_ACC = 0x2A48;
|
||||
|
||||
/* -------------------------------0x3000-0x3FFF------------------------------- */
|
||||
// Buttons on the SD-Card File listing.
|
||||
|
|
@ -479,9 +432,9 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
|
||||
constexpr uint16_t VP_BED_STATUS = 0x341C;
|
||||
|
||||
constexpr uint16_t VP_TMC_X_STEP = 0x3430;
|
||||
constexpr uint16_t VP_TMC_Y_STEP = 0x3432;
|
||||
constexpr uint16_t VP_TMC_Z_STEP = 0x3434;
|
||||
constexpr uint16_t VP_TMC_X_SENS = 0x3430;
|
||||
constexpr uint16_t VP_TMC_Y_SENS = 0x3432;
|
||||
constexpr uint16_t VP_TMC_Z_SENS = 0x3434;
|
||||
|
||||
constexpr uint16_t VP_TMC_X1_Current = 0x3436;
|
||||
constexpr uint16_t VP_TMC_Y1_Current = 0x3438;
|
||||
|
|
@ -516,10 +469,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
// PID autotune
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E0 = 0x3800;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E1 = 0x3802;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E2 = 0x3804;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E3 = 0x3806;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E4 = 0x3808;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_E5 = 0x380A;
|
||||
constexpr uint16_t VP_PID_AUTOTUNE_BED = 0x380C;
|
||||
|
||||
// Calibrate Z
|
||||
|
|
@ -536,19 +485,11 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
// Heater Control Buttons , triged between "cool down" and "heat PLA" state
|
||||
constexpr uint16_t VP_E0_CONTROL = 0x4010;
|
||||
constexpr uint16_t VP_E1_CONTROL = 0x4012;
|
||||
//constexpr uint16_t VP_E2_CONTROL = 0x2214;
|
||||
//constexpr uint16_t VP_E3_CONTROL = 0x2216;
|
||||
//constexpr uint16_t VP_E4_CONTROL = 0x2218;
|
||||
//constexpr uint16_t VP_E5_CONTROL = 0x221A;
|
||||
constexpr uint16_t VP_BED_CONTROL = 0x401C;
|
||||
|
||||
// Preheat
|
||||
constexpr uint16_t VP_E0_BED_PREHEAT = 0x4020;
|
||||
constexpr uint16_t VP_E1_BED_PREHEAT = 0x4022;
|
||||
//constexpr uint16_t VP_E2_BED_PREHEAT = 0x4024;
|
||||
//constexpr uint16_t VP_E3_BED_PREHEAT = 0x4026;
|
||||
//constexpr uint16_t VP_E4_BED_PREHEAT = 0x4028;
|
||||
//constexpr uint16_t VP_E5_BED_PREHEAT = 0x402A;
|
||||
|
||||
// Filament load and unload
|
||||
//constexpr uint16_t VP_E0_FILAMENT_LOAD_UNLOAD = 0x4030;
|
||||
|
|
@ -578,22 +519,21 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_HOME_Dis = 0x5000;
|
||||
constexpr uint16_t VP_Setting_Dis = 0x5010;
|
||||
constexpr uint16_t VP_Tool_Dis = 0x5020;
|
||||
constexpr uint16_t VP_Printing_Dis = 0x5030;
|
||||
constexpr uint16_t VP_Print_Dis = 0x5250;
|
||||
|
||||
constexpr uint16_t VP_Language_Dis = 0x5080;
|
||||
constexpr uint16_t VP_LossPoint_Dis = 0x5090;
|
||||
|
||||
constexpr uint16_t VP_PrintPauseConfig_Dis = 0x5120;
|
||||
constexpr uint16_t VP_MotorPulse_Dis = 0x5140;
|
||||
constexpr uint16_t VP_MotorMaxSpeed_Dis = 0x5150;
|
||||
constexpr uint16_t VP_MotorMaxAcc_Dis = 0x5160;
|
||||
constexpr uint16_t VP_AxisRes_Dis = 0x5140;
|
||||
constexpr uint16_t VP_AxisMaxSpeed_Dis = 0x5150;
|
||||
constexpr uint16_t VP_AxisMaxAcc_Dis = 0x5160;
|
||||
|
||||
constexpr uint16_t VP_X_Pulse_Dis = 0x5170;
|
||||
constexpr uint16_t VP_Y_Pulse_Dis = 0x5180;
|
||||
constexpr uint16_t VP_Z_Pulse_Dis = 0x5190;
|
||||
constexpr uint16_t VP_E0_Pulse_Dis = 0x51A0;
|
||||
constexpr uint16_t VP_E1_Pulse_Dis = 0x51B0;
|
||||
constexpr uint16_t VP_X_Steps_mm_Dis = 0x5170;
|
||||
constexpr uint16_t VP_Y_Steps_mm_Dis = 0x5180;
|
||||
constexpr uint16_t VP_Z_Steps_mm_Dis = 0x5190;
|
||||
constexpr uint16_t VP_E0_Steps_mm_Dis = 0x51A0;
|
||||
constexpr uint16_t VP_E1_Steps_mm_Dis = 0x51B0;
|
||||
|
||||
constexpr uint16_t VP_X_Max_Speed_Dis = 0x5280;
|
||||
constexpr uint16_t VP_Y_Max_Speed_Dis = 0x5290;
|
||||
|
|
@ -629,7 +569,7 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_Extrusion_Dis = 0x5230;
|
||||
constexpr uint16_t VP_HeatBed_Dis = 0x5240;
|
||||
|
||||
constexpr uint16_t VP_Printting_Dis = 0x5430;
|
||||
constexpr uint16_t VP_Printing_Dis = 0x5430;
|
||||
constexpr uint16_t VP_FactoryDefaults_Dis = 0x54C0;
|
||||
constexpr uint16_t VP_StoreSetting_Dis = 0x54B0;
|
||||
constexpr uint16_t VP_Info_EEPROM_2_Dis = 0x54D0;
|
||||
|
|
@ -637,9 +577,9 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
|
||||
constexpr uint16_t VP_AutoLevel_1_Dis = 0x55F0;
|
||||
|
||||
constexpr uint16_t VP_TMC_X_Step_Dis = 0x5530;
|
||||
constexpr uint16_t VP_TMC_Y_Step_Dis = 0x5540;
|
||||
constexpr uint16_t VP_TMC_Z_Step_Dis = 0x5550;
|
||||
constexpr uint16_t VP_TMC_X_SENS_Dis = 0x5530;
|
||||
constexpr uint16_t VP_TMC_Y_SENS_Dis = 0x5540;
|
||||
constexpr uint16_t VP_TMC_Z_SENS_Dis = 0x5550;
|
||||
constexpr uint16_t VP_TMC_X1_Current_Dis = 0x5560;
|
||||
constexpr uint16_t VP_TMC_Y1_Current_Dis = 0x5570;
|
||||
constexpr uint16_t VP_TMC_X_Current_Dis = 0x5580;
|
||||
|
|
@ -653,6 +593,9 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_EX_TEMP_INFO1_Dis = 0x5610;
|
||||
constexpr uint16_t VP_EX_TEMP_INFO2_Dis = 0x5620;
|
||||
constexpr uint16_t VP_EX_TEMP_INFO3_Dis = 0x5630;
|
||||
constexpr uint16_t VP_X_Offset_Dis = 0x5660;
|
||||
constexpr uint16_t VP_Y_Offset_Dis = 0x5670;
|
||||
constexpr uint16_t VP_Z_Offset_Dis = 0x5680;
|
||||
constexpr uint16_t VP_LCD_BLK_Dis = 0x56A0;
|
||||
constexpr uint16_t VP_Info_PrintFinish_1_Dis = 0x5C00;
|
||||
constexpr uint16_t VP_Info_PrintFinish_2_Dis = 0x5C10;
|
||||
|
|
@ -678,6 +621,7 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
|
||||
constexpr uint16_t VP_MotorConfig_Dis = 0x5100;
|
||||
constexpr uint16_t VP_LevelConfig_Dis = 0x5110;
|
||||
constexpr uint16_t VP_Probe_Offset_Dis = 0x5650;
|
||||
constexpr uint16_t VP_Advance_Dis = 0x5130;
|
||||
constexpr uint16_t VP_TemperatureConfig_Dis = 0x5390;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,29 +58,33 @@
|
|||
bool DGUSAutoTurnOff = false;
|
||||
MKS_Language mks_language_index; // Initialized by settings.load
|
||||
|
||||
#if 0
|
||||
void DGUSScreenHandlerMKS::sendinfoscreen_ch(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) {
|
||||
dgus.writeStringVar(VP_MSGSTR1, line1, 32);
|
||||
dgus.writeStringVar(VP_MSGSTR2, line2, 32);
|
||||
dgus.writeStringVar(VP_MSGSTR3, line3, 32);
|
||||
dgus.writeStringVar(VP_MSGSTR4, line4, 32);
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::sendinfoscreen_en(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4) {
|
||||
void DGUSScreenHandlerMKS::sendInfoScreen(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4) {
|
||||
dgus.writeStringVar(VP_MSGSTR1, line1);
|
||||
dgus.writeStringVar(VP_MSGSTR2, line2);
|
||||
dgus.writeStringVar(VP_MSGSTR3, line3);
|
||||
dgus.writeStringVar(VP_MSGSTR4, line4);
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::sendInfoScreen(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language) {
|
||||
if (language == MKS_English)
|
||||
DGUSScreenHandlerMKS::sendinfoscreen_en((char *)line1, (char *)line2, (char *)line3, (char *)line4);
|
||||
else if (language == MKS_SimpleChinese)
|
||||
DGUSScreenHandlerMKS::sendinfoscreen_ch((uint16_t *)line1, (uint16_t *)line2, (uint16_t *)line3, (uint16_t *)line4);
|
||||
void DGUSScreenHandlerMKS::sendInfoScreen(const char *line1, const char *line2, const char *line3, const char *line4) {
|
||||
dgus.writeStringVar(VP_MSGSTR1, line1);
|
||||
dgus.writeStringVar(VP_MSGSTR2, line2);
|
||||
dgus.writeStringVar(VP_MSGSTR3, line3);
|
||||
dgus.writeStringVar(VP_MSGSTR4, line4);
|
||||
}
|
||||
|
||||
#endif
|
||||
void DGUSScreenHandlerMKS::sendInfoScreen_P(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4) {
|
||||
dgus.writeStringVar_P(VP_MSGSTR1, line1);
|
||||
dgus.writeStringVar_P(VP_MSGSTR2, line2);
|
||||
dgus.writeStringVar_P(VP_MSGSTR3, line3);
|
||||
dgus.writeStringVar_P(VP_MSGSTR4, line4);
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::sendInfoScreenMKS(const void *line1, const void *line2, const void *line3, const void *line4, const MKS_Language language) {
|
||||
if (language == MKS_English)
|
||||
DGUSScreenHandlerMKS::sendInfoScreen_P((char *)line1, (char *)line2, (char *)line3, (char *)line4);
|
||||
else if (language == MKS_SimpleChinese)
|
||||
DGUSScreenHandlerMKS::sendInfoScreen((uint16_t *)line1, (uint16_t *)line2, (uint16_t *)line3, (uint16_t *)line4);
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::sendFanToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
|
|
@ -130,18 +134,18 @@ void DGUSScreenHandlerMKS::sendStringToDisplay_Language(DGUS_VP_Variable &var) {
|
|||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::sendTMCStepValue(DGUS_VP_Variable &var) {
|
||||
void DGUSScreenHandlerMKS::sendTMCSensValue(DGUS_VP_Variable &var) {
|
||||
#if ENABLED(SENSORLESS_HOMING)
|
||||
#if X_HAS_STEALTHCHOP
|
||||
tmc_step.x = stepperX.homing_threshold();
|
||||
tmc_stall_sens.x = stepperX.homing_threshold();
|
||||
dgus.writeVariable(var.VP, *(int16_t*)var.memadr);
|
||||
#endif
|
||||
#if Y_HAS_STEALTHCHOP
|
||||
tmc_step.y = stepperY.homing_threshold();
|
||||
tmc_stall_sens.y = stepperY.homing_threshold();
|
||||
dgus.writeVariable(var.VP, *(int16_t*)var.memadr);
|
||||
#endif
|
||||
#if Z_HAS_STEALTHCHOP
|
||||
tmc_step.z = stepperZ.homing_threshold();
|
||||
tmc_stall_sens.z = stepperZ.homing_threshold();
|
||||
dgus.writeVariable(var.VP, *(int16_t*)var.memadr);
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -475,10 +479,8 @@ void DGUSScreenHandlerMKS::meshLevel(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
case 0:
|
||||
offset = mesh_adj_distance;
|
||||
integer = offset; // get int
|
||||
Deci = (offset * 10);
|
||||
Deci = Deci % 10;
|
||||
Deci2 = offset * 100;
|
||||
Deci2 = Deci2 % 10;
|
||||
Deci = (offset * 10) % 10;
|
||||
Deci2 = (offset * 100) % 10;
|
||||
soft_endstop._enabled = false;
|
||||
queue.enqueue_now(F("G91"));
|
||||
snprintf_P(cmd_buf, 30, PSTR("G1 Z%d.%d%d"), integer, Deci, Deci2);
|
||||
|
|
@ -489,10 +491,8 @@ void DGUSScreenHandlerMKS::meshLevel(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
case 1:
|
||||
offset = mesh_adj_distance;
|
||||
integer = offset; // get int
|
||||
Deci = (offset * 10);
|
||||
Deci = Deci % 10;
|
||||
Deci2 = offset * 100;
|
||||
Deci2 = Deci2 % 10;
|
||||
Deci = (offset * 10) % 10;
|
||||
Deci2 = (offset * 100) % 10;
|
||||
soft_endstop._enabled = false;
|
||||
queue.enqueue_now(F("G91"));
|
||||
snprintf_P(cmd_buf, 30, PSTR("G1 Z-%d.%d%d"), integer, Deci, Deci2);
|
||||
|
|
@ -617,39 +617,34 @@ void DGUSScreenHandlerMKS::manualAssistLeveling(DGUS_VP_Variable &var, void *val
|
|||
break;
|
||||
}
|
||||
|
||||
if (WITHIN(point_val, 0x0002, 0x0005)) {
|
||||
//queue.enqueue_now(F("G28Z"));
|
||||
if (WITHIN(point_val, 0x0002, 0x0005))
|
||||
queue.enqueue_now(F("G1Z-10"));
|
||||
}
|
||||
}
|
||||
|
||||
#define mks_min(a, b) ((a) < (b)) ? (a) : (b)
|
||||
#define mks_max(a, b) ((a) > (b)) ? (a) : (b)
|
||||
void DGUSScreenHandlerMKS::tmcChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
#if ANY(HAS_TRINAMIC_CONFIG, HAS_STEALTHCHOP)
|
||||
const uint16_t tmc_val = BE16_P(val_ptr);
|
||||
#endif
|
||||
|
||||
void DGUSScreenHandlerMKS::tmcChangeConfig(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t tmc_val = BE16_P(val_ptr);
|
||||
switch (var.VP) {
|
||||
case VP_TMC_X_STEP:
|
||||
case VP_TMC_X_SENS:
|
||||
#if USE_SENSORLESS && X_HAS_STEALTHCHOP
|
||||
stepperX.homing_threshold(mks_min(tmc_val, 255));
|
||||
stepperX.homing_threshold(_MIN(tmc_val, 255));
|
||||
settings.save();
|
||||
//tmc_step.x = stepperX.homing_threshold();
|
||||
tmc_stall_sens.x = stepperX.homing_threshold();
|
||||
#endif
|
||||
break;
|
||||
case VP_TMC_Y_STEP:
|
||||
case VP_TMC_Y_SENS:
|
||||
#if USE_SENSORLESS && Y_HAS_STEALTHCHOP
|
||||
stepperY.homing_threshold(mks_min(tmc_val, 255));
|
||||
stepperY.homing_threshold(_MIN(tmc_val, 255));
|
||||
settings.save();
|
||||
//tmc_step.y = stepperY.homing_threshold();
|
||||
tmc_stall_sens.y = stepperY.homing_threshold();
|
||||
#endif
|
||||
break;
|
||||
case VP_TMC_Z_STEP:
|
||||
case VP_TMC_Z_SENS:
|
||||
#if USE_SENSORLESS && Z_HAS_STEALTHCHOP
|
||||
stepperZ.homing_threshold(mks_min(tmc_val, 255));
|
||||
stepperZ.homing_threshold(_MIN(tmc_val, 255));
|
||||
settings.save();
|
||||
//tmc_step.z = stepperZ.homing_threshold();
|
||||
tmc_stall_sens.z = stepperZ.homing_threshold();
|
||||
#endif
|
||||
break;
|
||||
case VP_TMC_X_Current:
|
||||
|
|
@ -703,13 +698,10 @@ void DGUSScreenHandlerMKS::tmcChangeConfig(DGUS_VP_Variable &var, void *val_ptr)
|
|||
|
||||
default: break;
|
||||
}
|
||||
#if USE_SENSORLESS
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_step.x = stepperX.homing_threshold());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_step.y = stepperY.homing_threshold());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_step.z = stepperZ.homing_threshold());
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // HAS_TRINAMIC_CONFIG || HAS_STEALTHCHOP
|
||||
|
||||
void DGUSScreenHandler::handleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
int16_t movevalue = BE16_P(val_ptr);
|
||||
|
||||
|
|
@ -721,11 +713,10 @@ void DGUSScreenHandler::handleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
if (!print_job_timer.isPaused() && !queue.ring_buffer.empty())
|
||||
return;
|
||||
|
||||
char axiscode;
|
||||
uint16_t speed = manual_feedrate_mm_m.x; // Default feedrate for manual moves
|
||||
char axiscode = '\0';
|
||||
uint16_t speed = 0;
|
||||
|
||||
switch (var.VP) { // switch X Y Z or Home
|
||||
default: return;
|
||||
#if HAS_X_AXIS
|
||||
case VP_MOVE_X:
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::X)) return;
|
||||
|
|
@ -763,13 +754,8 @@ void DGUSScreenHandler::handleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#endif
|
||||
}
|
||||
|
||||
if (movevalue != 0 && movevalue != 5) { // get move distance
|
||||
switch (movevalue) {
|
||||
case 0x0001: movevalue = manualMoveStep; break;
|
||||
case 0x0002: movevalue = -manualMoveStep; break;
|
||||
default: movevalue = 0; break;
|
||||
}
|
||||
}
|
||||
if WITHIN(movevalue, 1, 4) // get move distance
|
||||
movevalue == 1 ? movevalue = manualMoveStep : movevalue = -manualMoveStep;
|
||||
|
||||
if (!movevalue) {
|
||||
queue.enqueue_one_now(TS(F("G28"), axiscode));
|
||||
|
|
@ -786,8 +772,10 @@ void DGUSScreenHandler::handleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
// Movement
|
||||
const bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) queue.enqueue_now(F("G91"));
|
||||
|
||||
// TODO: Use MString / TS() ...
|
||||
|
||||
char buf[32]; // G1 X9999.99 F12345
|
||||
//const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
char sign[] = "\0";
|
||||
int16_t value = movevalue / 100;
|
||||
if (movevalue < 0) { value = -value; sign[0] = '-'; }
|
||||
|
|
@ -795,13 +783,6 @@ void DGUSScreenHandler::handleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
|
||||
queue.enqueue_one_now(buf);
|
||||
|
||||
//if (backup_speed != speed) {
|
||||
// snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
|
||||
// queue.enqueue_one_now(buf);
|
||||
//}
|
||||
|
||||
//while (!enqueue_and_echo_command(buf)) idle();
|
||||
|
||||
if (!old_relative_mode) queue.enqueue_now(F("G90"));
|
||||
|
||||
forceCompleteUpdate();
|
||||
|
|
@ -826,36 +807,18 @@ void DGUSScreenHandlerMKS::handleChangeLevelPoint(DGUS_VP_Variable &var, void *v
|
|||
#if ENABLED(EDITABLE_STEPS_PER_UNIT)
|
||||
|
||||
void DGUSScreenHandlerMKS::handleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t raw = BE16_P(val_ptr);
|
||||
const float value = (float)raw;
|
||||
|
||||
ExtUI::axis_t axis;
|
||||
const float value = (float)BE16_P(val_ptr);
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
case VP_X_STEP_PER_MM: axis = ExtUI::axis_t::X; break;
|
||||
case VP_Y_STEP_PER_MM: axis = ExtUI::axis_t::Y; break;
|
||||
case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break;
|
||||
}
|
||||
ExtUI::setAxisSteps_per_mm(value, axis);
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::handleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t raw = BE16_P(val_ptr);
|
||||
const float value = (float)raw;
|
||||
|
||||
ExtUI::extruder_t extruder;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
case VP_X_STEP_PER_MM: ExtUI::setAxisSteps_per_mm(value, ExtUI::axis_t::X); break;
|
||||
case VP_Y_STEP_PER_MM: ExtUI::setAxisSteps_per_mm(value, ExtUI::axis_t::Y); break;
|
||||
case VP_Z_STEP_PER_MM: ExtUI::setAxisSteps_per_mm(value, ExtUI::axis_t::Z); break;
|
||||
#if HAS_HOTEND
|
||||
case VP_E0_STEP_PER_MM: extruder = ExtUI::extruder_t::E0; break;
|
||||
case VP_E0_STEP_PER_MM: ExtUI::setAxisSteps_per_mm(value, ExtUI::extruder_t::E0); break;
|
||||
#endif
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_STEP_PER_MM: extruder = ExtUI::extruder_t::E1; break;
|
||||
case VP_E1_STEP_PER_MM: ExtUI::setAxisSteps_per_mm(value, ExtUI::extruder_t::E1); break;
|
||||
#endif
|
||||
}
|
||||
ExtUI::setAxisSteps_per_mm(value, extruder);
|
||||
settings.save();
|
||||
skipVP = var.VP; // Don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
|
@ -863,70 +826,36 @@ void DGUSScreenHandlerMKS::handleChangeLevelPoint(DGUS_VP_Variable &var, void *v
|
|||
#endif // EDITABLE_STEPS_PER_UNIT
|
||||
|
||||
void DGUSScreenHandlerMKS::handleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t raw = BE16_P(val_ptr);
|
||||
const float value = (float)raw;
|
||||
|
||||
ExtUI::axis_t axis;
|
||||
const float value = (float)BE16_P(val_ptr);
|
||||
switch (var.VP) {
|
||||
case VP_X_MAX_SPEED: axis = ExtUI::axis_t::X; break;
|
||||
case VP_Y_MAX_SPEED: axis = ExtUI::axis_t::Y; break;
|
||||
case VP_Z_MAX_SPEED: axis = ExtUI::axis_t::Z; break;
|
||||
default: return;
|
||||
}
|
||||
ExtUI::setAxisMaxFeedrate_mm_s(value, axis);
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::handleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t raw = BE16_P(val_ptr);
|
||||
const float value = (float)raw;
|
||||
|
||||
ExtUI::extruder_t extruder;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
case VP_X_MAX_SPEED: ExtUI::setAxisMaxFeedrate_mm_s(value, ExtUI::axis_t::X); break;
|
||||
case VP_Y_MAX_SPEED: ExtUI::setAxisMaxFeedrate_mm_s(value, ExtUI::axis_t::Y); break;
|
||||
case VP_Z_MAX_SPEED: ExtUI::setAxisMaxFeedrate_mm_s(value, ExtUI::axis_t::Z); break;
|
||||
#if HAS_HOTEND
|
||||
case VP_E0_MAX_SPEED: extruder = ExtUI::extruder_t::E0; break;
|
||||
case VP_E0_MAX_SPEED: ExtUI::setAxisMaxFeedrate_mm_s(value, ExtUI::extruder_t::E0); break;
|
||||
#endif
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_MAX_SPEED: extruder = ExtUI::extruder_t::E1; break;
|
||||
case VP_E1_MAX_SPEED: ExtUI::setAxisMaxFeedrate_mm_s(value, ExtUI::extruder_t::E1); break;
|
||||
#endif
|
||||
}
|
||||
ExtUI::setAxisMaxFeedrate_mm_s(value, extruder);
|
||||
settings.save();
|
||||
skipVP = var.VP; // Don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::handleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t raw = BE16_P(val_ptr);
|
||||
const float value = (float)raw;
|
||||
|
||||
ExtUI::axis_t axis;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
case VP_X_ACC_MAX_SPEED: axis = ExtUI::axis_t::X; break;
|
||||
case VP_Y_ACC_MAX_SPEED: axis = ExtUI::axis_t::Y; break;
|
||||
case VP_Z_ACC_MAX_SPEED: axis = ExtUI::axis_t::Z; break;
|
||||
}
|
||||
ExtUI::setAxisMaxAcceleration_mm_s2(value, axis);
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::handleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
uint16_t raw = BE16_P(val_ptr);
|
||||
float value = (float)raw;
|
||||
ExtUI::extruder_t extruder;
|
||||
const float value = (float)BE16_P(val_ptr);
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
case VP_X_MAX_ACC: ExtUI::setAxisMaxAcceleration_mm_s2(value, ExtUI::axis_t::X); break;
|
||||
case VP_Y_MAX_ACC: ExtUI::setAxisMaxAcceleration_mm_s2(value, ExtUI::axis_t::Y); break;
|
||||
case VP_Z_MAX_ACC: ExtUI::setAxisMaxAcceleration_mm_s2(value, ExtUI::axis_t::Z); break;
|
||||
#if HAS_HOTEND
|
||||
case VP_E0_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E0; settings.load(); break;
|
||||
case VP_E0_MAX_ACC: ExtUI::setAxisMaxAcceleration_mm_s2(value, ExtUI::extruder_t::E0); break;
|
||||
#endif
|
||||
#if HAS_MULTI_HOTEND
|
||||
case VP_E1_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E1; settings.load(); break;
|
||||
case VP_E1_MAX_ACC: ExtUI::setAxisMaxAcceleration_mm_s2(value, ExtUI::extruder_t::E1); break;
|
||||
#endif
|
||||
}
|
||||
ExtUI::setAxisMaxAcceleration_mm_s2(value, extruder);
|
||||
settings.save();
|
||||
skipVP = var.VP; // Don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
|
@ -994,37 +923,14 @@ void DGUSScreenHandlerMKS::handleAccChange(DGUS_VP_Variable &var, void *val_ptr)
|
|||
#if ENABLED(BABYSTEPPING)
|
||||
|
||||
void DGUSScreenHandler::handleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const float step = ZOffset_distance;
|
||||
|
||||
const uint16_t flag = BE16_P(val_ptr);
|
||||
switch (flag) {
|
||||
switch (BE16_P(val_ptr)) {
|
||||
case 0:
|
||||
if (step == 0.01)
|
||||
queue.inject(F("M290 Z-0.01"));
|
||||
else if (step == 0.1)
|
||||
queue.inject(F("M290 Z-0.1"));
|
||||
else if (step == 0.5)
|
||||
queue.inject(F("M290 Z-0.5"));
|
||||
else if (step == 1)
|
||||
queue.inject(F("M290 Z-1"));
|
||||
else
|
||||
queue.inject(F("M290 Z-0.01"));
|
||||
|
||||
queue.inject(TS(F("M290 Z"), -ZOffset_distance));
|
||||
z_offset_add -= ZOffset_distance;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (step == 0.01)
|
||||
queue.inject(F("M290 Z0.01"));
|
||||
else if (step == 0.1)
|
||||
queue.inject(F("M290 Z0.1"));
|
||||
else if (step == 0.5)
|
||||
queue.inject(F("M290 Z0.5"));
|
||||
else if (step == 1)
|
||||
queue.inject(F("M290 Z1"));
|
||||
else
|
||||
queue.inject(F("M290 Z-0.01"));
|
||||
|
||||
queue.inject(TS(F("M290 Z"), ZOffset_distance));
|
||||
z_offset_add += ZOffset_distance;
|
||||
break;
|
||||
|
||||
|
|
@ -1084,15 +990,16 @@ void DGUSScreenHandlerMKS::filamentLoadUnload(DGUS_VP_Variable &var, void *val_p
|
|||
|
||||
#if ALL(HAS_HOTEND, PREVENT_COLD_EXTRUSION)
|
||||
if (hotend_too_cold) {
|
||||
if (thermalManager.targetTooColdToExtrude(hotend_too_cold - 1)) thermalManager.setTargetHotend(thermalManager.extrude_min_temp, hotend_too_cold - 1);
|
||||
sendInfoScreen(F("NOTICE"), nullptr, F("Please wait."), F("Nozzle heating!"));
|
||||
if (thermalManager.targetTooColdToExtrude(hotend_too_cold - 1))
|
||||
thermalManager.setTargetHotend(thermalManager.extrude_min_temp, hotend_too_cold - 1);
|
||||
sendInfoScreenMKS(F("NOTICE"), nullptr, F("Please wait."), F("Nozzle heating!"), MKS_English);
|
||||
setupConfirmAction(nullptr);
|
||||
gotoScreen(DGUS_SCREEN_POPUP);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (swap_tool) {
|
||||
char buf[30];
|
||||
char buf[30]; // TODO: Use MString / TS()
|
||||
snprintf_P(buf, 30,
|
||||
#if ANY(HAS_MULTI_HOTEND, SINGLENOZZLE)
|
||||
PSTR("M1002T%cE%dF%d"), char('0' + swap_tool - 1)
|
||||
|
|
@ -1112,7 +1019,7 @@ void DGUSScreenHandlerMKS::filamentLoadUnload(DGUS_VP_Variable &var, void *val_p
|
|||
void GcodeSuite::M1002() {
|
||||
#if ANY(HAS_MULTI_HOTEND, SINGLENOZZLE)
|
||||
{
|
||||
char buf[3];
|
||||
char buf[3]; // TODO: Use MString / TS()
|
||||
sprintf_P(buf, PSTR("T%c"), char('0' + parser.intval('T')));
|
||||
process_subcommands_now(buf);
|
||||
}
|
||||
|
|
@ -1122,7 +1029,7 @@ void GcodeSuite::M1002() {
|
|||
set_e_relative(); // M83
|
||||
|
||||
{
|
||||
char buf[20];
|
||||
char buf[20]; // TODO: Use MString / TS()
|
||||
snprintf_P(buf, 20, PSTR("G1E%dF%d"), parser.intval('E'), parser.intval('F'));
|
||||
process_subcommands_now(buf);
|
||||
}
|
||||
|
|
@ -1264,9 +1171,9 @@ bool DGUSScreenHandlerMKS::loop() {
|
|||
if (!booted && ELAPSED(ms, TERN(USE_MKS_GREEN_UI, 1000, BOOTSCREEN_TIMEOUT))) {
|
||||
booted = true;
|
||||
#if USE_SENSORLESS
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_step.x = stepperX.homing_threshold());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_step.y = stepperY.homing_threshold());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_step.z = stepperZ.homing_threshold());
|
||||
TERN_(X_HAS_STEALTHCHOP, tmc_stall_sens.x = stepperX.homing_threshold());
|
||||
TERN_(Y_HAS_STEALTHCHOP, tmc_stall_sens.y = stepperY.homing_threshold());
|
||||
TERN_(Z_HAS_STEALTHCHOP, tmc_stall_sens.z = stepperZ.homing_threshold());
|
||||
#endif
|
||||
|
||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||
|
|
@ -1328,7 +1235,7 @@ void DGUSScreenHandlerMKS::runoutIdle() {
|
|||
queue.inject(F("M25"));
|
||||
gotoScreen(MKSLCD_SCREEN_PAUSE);
|
||||
|
||||
sendInfoScreen(F("NOTICE"), nullptr, F("Please change filament!"), nullptr);
|
||||
sendInfoScreenMKS(F("NOTICE"), nullptr, F("Please change filament!"), nullptr, MKS_English);
|
||||
//setupConfirmAction(nullptr);
|
||||
gotoScreen(DGUS_SCREEN_POPUP);
|
||||
break;
|
||||
|
|
@ -1383,6 +1290,9 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
const char TemperatureConfig_buf_en[] = "Temperature";
|
||||
dgus.writeStringVar(VP_TemperatureConfig_Dis, TemperatureConfig_buf_en);
|
||||
|
||||
const char Probe_Offset_buf_en[] = "Probe Offset";
|
||||
dgus.writeStringVar(VP_Probe_Offset_Dis, Probe_Offset_buf_en);
|
||||
|
||||
const char Advance_buf_en[] = "Advanced";
|
||||
dgus.writeStringVar(VP_Advance_Dis, Advance_buf_en);
|
||||
|
||||
|
|
@ -1402,14 +1312,14 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
;
|
||||
dgus.writeStringVar(VP_Level_Dis, Level_buf_en);
|
||||
|
||||
const char MotorPulse_buf_en[] = "MotorPulse";
|
||||
dgus.writeStringVar(VP_MotorPulse_Dis, MotorPulse_buf_en);
|
||||
const char AxisRes_buf_en[] = "Axis Resolution";
|
||||
dgus.writeStringVar(VP_AxisRes_Dis, AxisRes_buf_en);
|
||||
|
||||
const char MotorMaxSpeed_buf_en[] = "MotorMaxSpeed";
|
||||
dgus.writeStringVar(VP_MotorMaxSpeed_Dis, MotorMaxSpeed_buf_en);
|
||||
const char AxisMaxSpeed_buf_en[] = "Axis Max Speed";
|
||||
dgus.writeStringVar(VP_AxisMaxSpeed_Dis, AxisMaxSpeed_buf_en);
|
||||
|
||||
const char MotorMaxAcc_buf_en[] = "MotorAcc";
|
||||
dgus.writeStringVar(VP_MotorMaxAcc_Dis, MotorMaxAcc_buf_en);
|
||||
const char AxisMaxAcc_buf_en[] = "Axis Max Acc.";
|
||||
dgus.writeStringVar(VP_AxisMaxAcc_Dis, AxisMaxAcc_buf_en);
|
||||
|
||||
const char TravelAcc_buf_en[] = "Travel Acc.";
|
||||
dgus.writeStringVar(VP_TravelAcc_Dis, TravelAcc_buf_en);
|
||||
|
|
@ -1447,26 +1357,26 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
const char FactoryDefaults_buf_en[] = "Factory Defaults";
|
||||
dgus.writeStringVar(VP_FactoryDefaults_Dis, FactoryDefaults_buf_en);
|
||||
|
||||
const char StoreSetting_buf_en[] = "Store Setting";
|
||||
const char StoreSetting_buf_en[] = "Store Settings";
|
||||
dgus.writeStringVar(VP_StoreSetting_Dis, StoreSetting_buf_en);
|
||||
|
||||
const char PrintPauseConfig_buf_en[] = "PrintPause Config";
|
||||
dgus.writeStringVar(VP_PrintPauseConfig_Dis, PrintPauseConfig_buf_en);
|
||||
|
||||
const char X_Pulse_buf_en[] = "X_Pulse";
|
||||
dgus.writeStringVar(VP_X_Pulse_Dis, X_Pulse_buf_en);
|
||||
const char X_Steps_mm_buf_en[] = "X steps/mm";
|
||||
dgus.writeStringVar(VP_X_Steps_mm_Dis, X_Steps_mm_buf_en);
|
||||
|
||||
const char Y_Pulse_buf_en[] = "Y_Pulse";
|
||||
dgus.writeStringVar(VP_Y_Pulse_Dis, Y_Pulse_buf_en);
|
||||
const char Y_Steps_mm_buf_en[] = "Y steps/mm";
|
||||
dgus.writeStringVar(VP_Y_Steps_mm_Dis, Y_Steps_mm_buf_en);
|
||||
|
||||
const char Z_Pulse_buf_en[] = "Z_Pulse";
|
||||
dgus.writeStringVar(VP_Z_Pulse_Dis, Z_Pulse_buf_en);
|
||||
const char Z_Steps_mm_buf_en[] = "Z steps/mm";
|
||||
dgus.writeStringVar(VP_Z_Steps_mm_Dis, Z_Steps_mm_buf_en);
|
||||
|
||||
const char E0_Pulse_buf_en[] = "E0_Pulse";
|
||||
dgus.writeStringVar(VP_E0_Pulse_Dis, E0_Pulse_buf_en);
|
||||
const char E0_Steps_mm_buf_en[] = "E0 steps/mm";
|
||||
dgus.writeStringVar(VP_E0_Steps_mm_Dis, E0_Steps_mm_buf_en);
|
||||
|
||||
const char E1_Pulse_buf_en[] = "E1_Pulse";
|
||||
dgus.writeStringVar(VP_E1_Pulse_Dis, E1_Pulse_buf_en);
|
||||
const char E1_Steps_mm_buf_en[] = "E1 steps/mm";
|
||||
dgus.writeStringVar(VP_E1_Steps_mm_Dis, E1_Steps_mm_buf_en);
|
||||
|
||||
const char X_Max_Speed_buf_en[] = "X Max Speed";
|
||||
dgus.writeStringVar(VP_X_Max_Speed_Dis, X_Max_Speed_buf_en);
|
||||
|
|
@ -1550,13 +1460,13 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
dgus.writeStringVar(VP_Info_PrintFinish_1_Dis, Info_PrintFinish_1_buf_en);
|
||||
|
||||
const char TMC_X_Step_buf_en[] = "X Sensitivity";
|
||||
dgus.writeStringVar(VP_TMC_X_Step_Dis, TMC_X_Step_buf_en);
|
||||
dgus.writeStringVar(VP_TMC_X_SENS_Dis, TMC_X_Step_buf_en);
|
||||
|
||||
const char TMC_Y_Step_buf_en[] = "Y Sensitivity";
|
||||
dgus.writeStringVar(VP_TMC_Y_Step_Dis, TMC_Y_Step_buf_en);
|
||||
dgus.writeStringVar(VP_TMC_Y_SENS_Dis, TMC_Y_Step_buf_en);
|
||||
|
||||
const char TMC_Z_Step_buf_en[] = "Z Sensitivity";
|
||||
dgus.writeStringVar(VP_TMC_Z_Step_Dis, TMC_Z_Step_buf_en);
|
||||
dgus.writeStringVar(VP_TMC_Z_SENS_Dis, TMC_Z_Step_buf_en);
|
||||
|
||||
const char TMC_X_Current_buf_en[] = "X Current";
|
||||
dgus.writeStringVar(VP_TMC_X_Current_Dis, TMC_X_Current_buf_en);
|
||||
|
|
@ -1585,6 +1495,15 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
const char Min_Ex_Temp_buf_en[] = "Min Extrude Temp";
|
||||
dgus.writeStringVar(VP_Min_Ex_Temp_Dis, Min_Ex_Temp_buf_en);
|
||||
|
||||
const char X_Offset_buf_en[] = "X Offset";
|
||||
dgus.writeStringVar(VP_X_Offset_Dis, X_Offset_buf_en);
|
||||
|
||||
const char Y_Offset_buf_en[] = "Y Offset";
|
||||
dgus.writeStringVar(VP_Y_Offset_Dis, Y_Offset_buf_en);
|
||||
|
||||
const char Z_Offset_buf_en[] = "Z Offset";
|
||||
dgus.writeStringVar(VP_Z_Offset_Dis, Z_Offset_buf_en);
|
||||
|
||||
const char AutoLEVEL_INFO1_buf_en[] = "Please Press Button!";
|
||||
dgus.writeStringVar(VP_AutoLEVEL_INFO1, AutoLEVEL_INFO1_buf_en);
|
||||
|
||||
|
|
@ -1600,9 +1519,6 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
const char StopPrintConfirm_Info_buf_en[] = "Stop Print?";
|
||||
dgus.writeStringVar(VP_StopPrintConfirm_Info_Dis, StopPrintConfirm_Info_buf_en);
|
||||
|
||||
const char Printting_buf_en[] = "Printing";
|
||||
dgus.writeStringVar(VP_Printting_Dis, Printting_buf_en);
|
||||
|
||||
const char LCD_BLK_buf_en[] = "Backlight";
|
||||
dgus.writeStringVar(VP_LCD_BLK_Dis, LCD_BLK_buf_en);
|
||||
|
||||
|
|
@ -1660,14 +1576,14 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
};
|
||||
dgus.writeStringVar(VP_Level_Dis, Level_buf_ch, 32);
|
||||
|
||||
const uint16_t MotorPulse_buf_ch[] = { 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_MotorPulse_Dis, MotorPulse_buf_ch);
|
||||
const uint16_t AxisRes_buf_ch[] = { 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_AxisRes_Dis, AxisRes_buf_ch);
|
||||
|
||||
const uint16_t MotorMaxSpeed_buf_ch[] = { 0xEED7, 0xF3B4, 0xD9CB, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_MotorMaxSpeed_Dis, MotorMaxSpeed_buf_ch);
|
||||
const uint16_t AxisMaxSpeed_buf_ch[] = { 0xEED7, 0xF3B4, 0xD9CB, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_AxisMaxSpeed_Dis, AxisMaxSpeed_buf_ch);
|
||||
|
||||
const uint16_t MotorMaxAcc_buf_ch[] = { 0xEED7, 0xF3B4, 0xD3BC, 0xD9CB, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_MotorMaxAcc_Dis, MotorMaxAcc_buf_ch);
|
||||
const uint16_t AxisMaxAcc_buf_ch[] = { 0xEED7, 0xF3B4, 0xD3BC, 0xD9CB, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_AxisMaxAcc_Dis, AxisMaxAcc_buf_ch);
|
||||
|
||||
const uint16_t TravelAcc_buf_ch[] = { 0xD5BF, 0xD0D0, 0xD3BC, 0xD9CB, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_TravelAcc_Dis, TravelAcc_buf_ch);
|
||||
|
|
@ -1711,20 +1627,20 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
const uint16_t PrintPauseConfig_buf_ch[] = { 0xDDD4, 0xA3CD, 0xBBCE, 0xC3D6, 0x2000 };
|
||||
dgus.writeStringVar(VP_PrintPauseConfig_Dis, PrintPauseConfig_buf_ch, 32);
|
||||
|
||||
const uint16_t X_Pulse_buf_ch[] = { 0x2058, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_X_Pulse_Dis, X_Pulse_buf_ch);
|
||||
const uint16_t X_Steps_mm_buf_ch[] = { 0x2058, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_X_Steps_mm_Dis, X_Steps_mm_buf_ch);
|
||||
|
||||
const uint16_t Y_Pulse_buf_ch[] = { 0x2059, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_Y_Pulse_Dis, Y_Pulse_buf_ch);
|
||||
const uint16_t Y_Steps_mm_buf_ch[] = { 0x2059, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_Y_Steps_mm_Dis, Y_Steps_mm_buf_ch);
|
||||
|
||||
const uint16_t Z_Pulse_buf_ch[] = { 0x205A, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_Z_Pulse_Dis, Z_Pulse_buf_ch);
|
||||
const uint16_t Z_Steps_mm_buf_ch[] = { 0x205A, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_Z_Steps_mm_Dis, Z_Steps_mm_buf_ch);
|
||||
|
||||
const uint16_t E0_Pulse_buf_ch[] = { 0x3045, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_E0_Pulse_Dis, E0_Pulse_buf_ch);
|
||||
const uint16_t E0_Steps_mm_buf_ch[] = { 0x3045, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_E0_Steps_mm_Dis, E0_Steps_mm_buf_ch);
|
||||
|
||||
const uint16_t E1_Pulse_buf_ch[] = { 0x3145, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_E1_Pulse_Dis, E1_Pulse_buf_ch);
|
||||
const uint16_t E1_Steps_mm_buf_ch[] = { 0x3145, 0xE1D6, 0xF6C2, 0xE5B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_E1_Steps_mm_Dis, E1_Steps_mm_buf_ch);
|
||||
|
||||
const uint16_t X_Max_Speed_buf_ch[] = { 0x2058, 0xEED7, 0xF3B4, 0xD9CB, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_X_Max_Speed_Dis, X_Max_Speed_buf_ch);
|
||||
|
|
@ -1805,13 +1721,13 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
dgus.writeStringVar(VP_Info_EEPROM_2_Dis, Info_EEPROM_2_buf_ch, 32);
|
||||
|
||||
const uint16_t TMC_X_Step_buf_ch[] = { 0x2058, 0xE9C1, 0xF4C3, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_TMC_X_Step_Dis, TMC_X_Step_buf_ch);
|
||||
dgus.writeStringVar(VP_TMC_X_SENS_Dis, TMC_X_Step_buf_ch);
|
||||
|
||||
const uint16_t TMC_Y_Step_buf_ch[] = { 0x2059, 0xE9C1, 0xF4C3, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_TMC_Y_Step_Dis, TMC_Y_Step_buf_ch);
|
||||
dgus.writeStringVar(VP_TMC_Y_SENS_Dis, TMC_Y_Step_buf_ch);
|
||||
|
||||
const uint16_t TMC_Z_Step_buf_ch[] = { 0x205A, 0xE9C1, 0xF4C3, 0xC8B6, 0x2000 };
|
||||
dgus.writeStringVar(VP_TMC_Z_Step_Dis, TMC_Z_Step_buf_ch);
|
||||
dgus.writeStringVar(VP_TMC_Z_SENS_Dis, TMC_Z_Step_buf_ch);
|
||||
|
||||
const uint16_t Info_PrintFinish_1_buf_ch[] = { 0xF2B4, 0xA1D3, 0xEACD, 0xC9B3, 0x2000 };
|
||||
dgus.writeStringVar(VP_Info_PrintFinish_1_Dis, Info_PrintFinish_1_buf_ch, 32);
|
||||
|
|
@ -1858,9 +1774,6 @@ void DGUSScreenHandlerMKS::updateDisplayLanguage() {
|
|||
const uint16_t StopPrintConfirm_Info_buf_ch[] = { 0xC7CA, 0xF1B7, 0xA3CD, 0xB9D6, 0xF2B4, 0xA1D3, 0x2000 };
|
||||
dgus.writeStringVar(VP_StopPrintConfirm_Info_Dis, StopPrintConfirm_Info_buf_ch, 32);
|
||||
|
||||
const uint16_t Printting_buf_ch[] = { 0xF2B4, 0xA1D3, 0xD0D6, 0x2000 };
|
||||
dgus.writeStringVar(VP_Printting_Dis, Printting_buf_ch, 32);
|
||||
|
||||
const uint16_t LCD_BLK_buf_ch[] = { 0xB3B1, 0xE2B9, 0xE8C9, 0xC3D6, 0x2000 };
|
||||
dgus.writeStringVar(VP_LCD_BLK_Dis, LCD_BLK_buf_ch, 32);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,10 @@ class DGUSScreenHandlerMKS : public DGUSScreenHandler {
|
|||
public:
|
||||
DGUSScreenHandlerMKS() = default;
|
||||
|
||||
#if 0
|
||||
static void sendinfoscreen_ch(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4);
|
||||
static void sendinfoscreen_en(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4);
|
||||
static void sendInfoScreen(const void *line1, const void *line2, const void *line3, const void *line4, uint16_t language);
|
||||
#endif
|
||||
static void sendInfoScreen(const char *line1, const char *line2, const char *line3, const char *line4);
|
||||
static void sendInfoScreen(const uint16_t *line1, const uint16_t *line2, const uint16_t *line3, const uint16_t *line4);
|
||||
static void sendInfoScreen_P(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4);
|
||||
static void sendInfoScreenMKS(const void *line1, const void *line2, const void *line3, const void *line4, const MKS_Language language);
|
||||
|
||||
static void screenBackChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
|
|
@ -72,10 +71,8 @@ public:
|
|||
#endif
|
||||
|
||||
static void handleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleAccChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleChangeLevelPoint(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleTravelAccChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
static void handleFeedRateMinChange(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
|
@ -101,7 +98,7 @@ public:
|
|||
static void sendFanToDisplay(DGUS_VP_Variable &var);
|
||||
static void sendGbkToDisplay(DGUS_VP_Variable &var);
|
||||
static void sendStringToDisplay_Language(DGUS_VP_Variable &var);
|
||||
static void sendTMCStepValue(DGUS_VP_Variable &var);
|
||||
static void sendTMCSensValue(DGUS_VP_Variable &var);
|
||||
|
||||
static void setUint8(DGUS_VP_Variable &var, void *val_ptr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue