diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a12eef2556..13c59b0a44 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3558,7 +3558,7 @@ * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and * to set spindle speed, spindle direction, and laser power. * - * SuperPid is a router/spindle speed controller used in the CNC milling community. + * SuperPID is a router/spindle speed controller used in the CNC milling community. * Marlin can be used to turn the spindle on and off. It can also be used to set * the spindle speed from 5,000 to 30,000 RPM. * diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 8a2561f02d..272e50340a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -77,8 +77,6 @@ #include "lcd/e3v2/common/encoder.h" #if ENABLED(DWIN_CREALITY_LCD) #include "lcd/e3v2/creality/dwin.h" - #elif ENABLED(DWIN_LCD_PROUI) - #include "lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "lcd/e3v2/jyersui/dwin.h" #endif @@ -1594,11 +1592,11 @@ void setup() { SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n"); #endif - #if HAS_DWIN_E3V2_BASIC + #if ENABLED(DWIN_CREALITY_LCD) SETUP_RUN(dwinInitScreen()); #endif - #if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC + #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD) SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status #endif diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 7377f7dfc0..b08cb812f8 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -95,7 +95,7 @@ public: static void report_current_mesh(); static void report_state(); static void save_ubl_active_state_and_disable(); - static void restore_ubl_active_state_and_leave(); + static void restore_ubl_active_state(const bool is_done=true); static void display_map(const uint8_t) __O0; static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0; static mesh_index_pair find_furthest_invalid_mesh_point() __O0; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 2e7ea74327..fcf408b34e 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -309,7 +309,7 @@ void unified_bed_leveling::G29() { #if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING) save_ubl_active_state_and_disable(); gcode.process_subcommands_now(F("G28Z")); - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(false); // ...without telling ExtUI "done" #else // Send 'N' to force homing before G29 (internal only) if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes(); @@ -425,7 +425,7 @@ void unified_bed_leveling::G29() { if (parser.seen_test('J')) { save_ubl_active_state_and_disable(); tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); #if ENABLED(UBL_G29_J_RECENTER) do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y))); #endif @@ -754,7 +754,6 @@ void unified_bed_leveling::shift_mesh_height() { TERN_(HAS_MARLINUI_MENU, ui.capture()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); - TERN_(DWIN_LCD_PROUI, dwinLevelingStart()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained grid_count_t count = GRID_MAX_POINTS; @@ -768,7 +767,6 @@ void unified_bed_leveling::shift_mesh_height() { SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); - TERN_(DWIN_LCD_PROUI, dwinRedrawScreen()); #if HAS_MARLINUI_MENU if (ui.button_pressed()) { @@ -778,8 +776,7 @@ void unified_bed_leveling::shift_mesh_height() { ui.quick_feedback(); ui.release(); probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); - return restore_ubl_active_state_and_leave(); + return restore_ubl_active_state(); } #endif @@ -815,15 +812,12 @@ void unified_bed_leveling::shift_mesh_height() { probe.move_z_after_probing(); - restore_ubl_active_state_and_leave(); - do_blocking_move_to_xy( constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) ); - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); - TERN_(DWIN_LCD_PROUI, dwinLevelingDone()); + restore_ubl_active_state(); } #endif // HAS_BED_PROBE @@ -932,7 +926,7 @@ void set_message_with_feedback(FSTR_P const fstr) { if (param.V_verbosity > 1) SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick."); - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); return thickness; } @@ -987,7 +981,7 @@ void set_message_with_feedback(FSTR_P const fstr) { if (_click_and_hold([]{ SERIAL_ECHOLNPGM("\nMesh only partially populated."); do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); - })) return restore_ubl_active_state_and_leave(); + })) return restore_ubl_active_state(); // Store the Z position minus the shim height z_values[lpos.x][lpos.y] = current_position.z - thick; @@ -1002,10 +996,8 @@ void set_message_with_feedback(FSTR_P const fstr) { if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); - - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } /** @@ -1111,7 +1103,7 @@ void set_message_with_feedback(FSTR_P const fstr) { } while (lpos.x >= 0 && --param.R_repetition > 0); if (do_ubl_mesh_map) display_map(param.T_map_type); - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE); @@ -1263,17 +1255,20 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() { set_bed_leveling_enabled(false); } -void unified_bed_leveling::restore_ubl_active_state_and_leave() { +void unified_bed_leveling::restore_ubl_active_state(const bool is_done/*=true*/) { TERN_(HAS_MARLINUI_MENU, ui.release()); #if ENABLED(UBL_DEVEL_DEBUGGING) if (--ubl_state_recursion_chk) { - SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); + SERIAL_ECHOLNPGM("restore_ubl_active_state() called too many times."); set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR)); return; } #endif set_bed_leveling_enabled(ubl_state_at_invocation); - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + + if (is_done) { + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + } } mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index cc5face259..538aa92e91 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -186,13 +186,13 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { switch (response) { case 0: // "Purge More" button - #if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) + #if ENABLED(M600_PURGE_MORE_RESUMABLE) pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more) #endif break; case 1: // "Continue" / "Disable Runout" button - #if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) + #if ENABLED(M600_PURGE_MORE_RESUMABLE) pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection #endif #if HAS_FILAMENT_SENSOR diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 8756c339e3..74a4f236c0 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -23,6 +23,8 @@ /** * feature/pause.cpp - Pause feature support functions * This may be combined with related G-codes if features are consolidated. + * + * Note: Calls to ui.pause_show_message are passed to either ExtUI or MarlinUI. */ #include "../inc/MarlinConfigPre.h" @@ -60,8 +62,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif #include "../lcd/marlinui.h" @@ -148,7 +148,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder); #endif - ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); UNUSED(mode); + ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); if (wait) return thermalManager.wait_for_hotend(active_extruder); @@ -288,8 +288,8 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load // Show "Purge More" / "Resume" menu and wait for reply KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = false; - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI) + ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR #else pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; #endif diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 70fac66fce..1867aba6ed 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -48,8 +48,8 @@ uint8_t PrintJobRecovery::queue_index_r; uint32_t PrintJobRecovery::cmd_sdpos, // = 0 PrintJobRecovery::sdpos[BUFSIZE]; -#if HAS_DWIN_E3V2_BASIC - bool PrintJobRecovery::dwin_flag; // = false +#if HAS_PLR_UI_FLAG + bool PrintJobRecovery::ui_flag_resume; // = false #endif #include "../sd/cardreader.h" diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 579731ffdd..7de8450c91 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -151,8 +151,8 @@ class PrintJobRecovery { static uint32_t cmd_sdpos, //!< SD position of the next command sdpos[BUFSIZE]; //!< SD positions of queued commands - #if HAS_DWIN_E3V2_BASIC - static bool dwin_flag; + #if HAS_PLR_UI_FLAG + static bool ui_flag_resume; //!< Flag the UI to show a dialog to Resume (M1000) or Cancel (M1000C) #endif static void init(); diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 1d684c6b85..2bcb47e99a 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -68,8 +68,6 @@ bool FilamentMonitorBase::enabled = true, #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif void event_filament_runout(const uint8_t extruder) { @@ -88,7 +86,6 @@ void event_filament_runout(const uint8_t extruder) { #endif TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder))); - TERN_(DWIN_LCD_PROUI, dwinFilamentRunout(extruder)); #if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR) const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder); diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index a0a72058aa..7ed070c9b8 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -144,15 +144,13 @@ class TMCMarlin : public TMC, public TMCStorage { #endif #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if ENABLED(HYBRID_THRESHOLD) - void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #if USE_SENSORLESS - void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif + #if ENABLED(HYBRID_THRESHOLD) + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + #endif + #if USE_SENSORLESS + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif static constexpr int8_t sgt_min = -64, @@ -207,12 +205,10 @@ class TMCMarlin : public TMC220 } #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if ENABLED(HYBRID_THRESHOLD) - void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif + #if ENABLED(HYBRID_THRESHOLD) + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } #endif }; @@ -269,15 +265,13 @@ class TMCMarlin : public TMC220 } #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if ENABLED(HYBRID_THRESHOLD) - void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #if USE_SENSORLESS - void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif + #if ENABLED(HYBRID_THRESHOLD) + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + #endif + #if USE_SENSORLESS + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif static constexpr uint8_t sgt_min = 0, @@ -315,12 +309,10 @@ class TMCMarlin : public TMC266 } #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if USE_SENSORLESS - void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif + #if USE_SENSORLESS + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif static constexpr int8_t sgt_min = -64, diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 3126bee47f..449c25fefd 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -51,8 +51,6 @@ #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -77,7 +75,7 @@ static void pre_g29_return(const bool retry, const bool did) { TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); } if (did) { - TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone()); + TERN_(DWIN_CREALITY_LCD, dwinLevelingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } } @@ -425,8 +423,6 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_3POINT) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - TERN_(DWIN_LCD_PROUI, dwinLevelingStart()); #endif TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); @@ -436,11 +432,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(PREHEAT_BEFORE_LEVELING) if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, - #if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED) - hmiData.bedLevT - #else - LEVELING_BED_TEMP - #endif + TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP) ); #endif } diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index b3f03d03ba..c9c04b4f0c 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -40,8 +40,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -144,7 +142,6 @@ void GcodeSuite::G29() { queue.inject(F("G29S2")); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); - TERN_(DWIN_LCD_PROUI, dwinLevelingStart()); return; } @@ -170,7 +167,6 @@ void GcodeSuite::G29() { // Save Z for the previous mesh position bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z)); - TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z)); SET_SOFT_ENDSTOP_LOOSE(false); } // If there's another point to sample, move there with optional lift. @@ -237,7 +233,6 @@ void GcodeSuite::G29() { if (parser.seenval('Z')) { bedlevel.z_values[ix][iy] = parser.value_linear_units(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); - TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); } else return echo_not_entered('Z'); diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index 3a5aa8cb03..99ba3ce19b 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -33,8 +33,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #endif /** @@ -69,7 +67,6 @@ void GcodeSuite::M421() { float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh - TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ij.x, ij.y, zval)); } } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 55698c942b..0ab1ca6105 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -52,8 +52,6 @@ #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(LASER_FEATURE) @@ -223,7 +221,7 @@ void GcodeSuite::G28() { set_and_report_grblstate(M_HOMING); #endif - TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingStart()); + TERN_(DWIN_CREALITY_LCD, dwinHomingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); planner.synchronize(); // Wait for planner moves to finish! @@ -652,7 +650,7 @@ void GcodeSuite::G28() { ui.refresh(); - TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingDone()); + TERN_(DWIN_CREALITY_LCD, dwinHomingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone()); report_current_position(); diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index 3373e14325..0648f3edca 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -25,12 +25,13 @@ #if ENABLED(PREVENT_COLD_EXTRUSION) #include "../gcode.h" -#include "../../module/temperature.h" -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" #endif +#include "../../module/temperature.h" + /** * M302: Allow cold extrudes, or set the minimum extrude temperature * @@ -50,13 +51,14 @@ void GcodeSuite::M302() { const bool seen_S = parser.seen('S'); if (seen_S) { thermalManager.extrude_min_temp = parser.value_celsius(); - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); - TERN_(DWIN_LCD_PROUI, hmiData.extMinT = thermalManager.extrude_min_temp); + TERN_(EXTENSIBLE_UI, ExtUI::onSetMinExtrusionTemp(thermalManager.extrude_min_temp)); } - if (parser.seen('P')) - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); - else if (!seen_S) { + const bool seen_P = parser.seen('P'); + if (seen_P || seen_S) { + thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || (seen_P && parser.value_bool()); + } + else { // Report current state SERIAL_ECHO_START(); SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)")); diff --git a/Marlin/src/gcode/control/M997.cpp b/Marlin/src/gcode/control/M997.cpp index 5ac0ba23bb..c651961902 100644 --- a/Marlin/src/gcode/control/M997.cpp +++ b/Marlin/src/gcode/control/M997.cpp @@ -24,8 +24,8 @@ #if ENABLED(PLATFORM_M997_SUPPORT) -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" #endif /** @@ -33,7 +33,7 @@ */ void GcodeSuite::M997() { - TERN_(DWIN_LCD_PROUI, dwinRebootScreen()); + TERN_(EXTENSIBLE_UI, ExtUI::onFirmwareFlash()); flashFirmware(parser.intval('S')); diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index c735b72ced..c70bf7667f 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -37,8 +37,6 @@ #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented #endif @@ -76,12 +74,12 @@ void GcodeSuite::M1000() { if (!force_resume && parser.seen_test('S')) { #if HAS_MARLINUI_MENU ui.goto_screen(menu_job_recovery); - #elif HAS_DWIN_E3V2_BASIC - recovery.dwin_flag = true; - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) // Temporary fix until it can be better implemented - jyersDWIN.popupHandler(Popup_Resume); #elif ENABLED(EXTENSIBLE_UI) ExtUI::onPowerLossResume(); + #elif HAS_PLR_UI_FLAG + recovery.ui_flag_resume = true; + #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) // Temporary fix until it can be better implemented + jyersDWIN.popupHandler(Popup_Resume); #else SERIAL_ECHO_MSG("Resume requires LCD."); #endif diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index fcab61b59d..c600bd5da6 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -35,9 +35,6 @@ #include "../../lcd/marlinui.h" #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin_popup.h" - #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(HOST_PROMPT_SUPPORT) @@ -66,16 +63,20 @@ void GcodeSuite::M0_M1() { #endif } + #elif ENABLED(DWIN_LCD_PROUI) // ExtUI with icon, string, button title + + if (parser.string_arg) + ExtUI::onUserConfirmRequired(ICON_Continue_1, parser.string_arg, GET_TEXT_F(MSG_USERWAIT)); + else + ExtUI::onUserConfirmRequired(ICON_Stop_1, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT)); + #elif ENABLED(EXTENSIBLE_UI) + if (parser.string_arg) ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer else ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT)); - #elif ENABLED(DWIN_LCD_PROUI) - if (parser.string_arg) - dwinPopupConfirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT)); - else - dwinPopupConfirm(ICON_BLTouch, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT)); + #else if (parser.string_arg) { diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 5ac2839beb..6f74476240 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -29,10 +29,6 @@ #include "../../sd/cardreader.h" #include "../../libs/numtostr.h" -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" -#endif - /** * M73: Set percentage complete (for display on LCD) * diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index e83df544c8..3ce37bed05 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -34,6 +34,10 @@ #include "../../feature/probe_temp_comp.h" #endif +#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) + #define VERBOSE_SINGLE_PROBE +#endif + /** * G30: Do a single Z probe at the given XY (default: current) * @@ -66,9 +70,7 @@ void GcodeSuite::G30() { remember_feedrate_scaling_off(); - #if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) - process_subcommands_now(F("G28O")); - #endif + TERN_(VERBOSE_SINGLE_PROBE, process_subcommands_now(F("G28O"))); const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; @@ -83,9 +85,7 @@ void GcodeSuite::G30() { F( " Z:"), p_float_t(measured_z, 3) ); msg.echoln(); - #if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) - ui.set_status(msg); - #endif + TERN_(VERBOSE_SINGLE_PROBE, ui.set_status(msg)); } restore_feedrate_and_scaling(); diff --git a/Marlin/src/gcode/sd/M524.cpp b/Marlin/src/gcode/sd/M524.cpp index a3c03e90ba..61185b7e0b 100644 --- a/Marlin/src/gcode/sd/M524.cpp +++ b/Marlin/src/gcode/sd/M524.cpp @@ -27,8 +27,8 @@ #include "../gcode.h" #include "../../sd/cardreader.h" -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/marlinui.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" #endif /** @@ -36,9 +36,9 @@ */ void GcodeSuite::M524() { - #if ENABLED(DWIN_LCD_PROUI) + #if ENABLED(EXTENSIBLE_UI) - ui.abort_print(); + ExtUI::stopPrint(); // Calls ui.abort_print() which does the same as below #else diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index bced97351d..03e76d531d 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -35,10 +35,14 @@ /** * M75: Start print timer + * + * ProUI: If the print fails to start and any text is + * included in the command, print it in the header. */ void GcodeSuite::M75() { - startOrResumeJob(); + startOrResumeJob(); // ... ExtUI::onPrintTimerStarted() #if ENABLED(DWIN_LCD_PROUI) + // TODO: Remove if M75 is never used if (!IS_SD_PRINTING()) dwinPrintHeader(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT)); #endif } @@ -47,7 +51,7 @@ void GcodeSuite::M75() { * M76: Pause print timer */ void GcodeSuite::M76() { - TERN(DWIN_LCD_PROUI, ui.pause_print(), print_job_timer.pause()); + print_job_timer.pause(); // ... ExtUI::onPrintTimerPaused() TERN_(HOST_PAUSE_M76, hostui.pause()); } diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 24702d65f0..730ec65ba4 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -31,8 +31,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(PROUI_PID_TUNE) - #include "../../lcd/e3v2/proui/dwin.h" #endif /** @@ -68,8 +66,7 @@ void GcodeSuite::M303() { default: SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); - TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_BAD_HEATER_ID)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_BAD_HEATER_ID)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_BAD_HEATER_ID)); return; } @@ -79,7 +76,7 @@ void GcodeSuite::M303() { const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); - TERN_(PROUI_PID_TUNE, dwinStartM303(seenC, c, seenS, hid, temp)); + TERN_(EXTENSIBLE_UI, ExtUI::onStartM303(c, hid, temp)); IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY)); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index af2ea772c3..92799b7cd4 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1035,16 +1035,13 @@ #endif // Extensible UI serial touch screens. (See src/lcd/extui) -#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE) +#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE, DWIN_LCD_PROUI) #define IS_EXTUI 1 // Just for sanity check. #define EXTENSIBLE_UI #endif // Aliases for LCD features -#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) - #define HAS_DWIN_E3V2_BASIC 1 -#endif -#if ANY(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI) +#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) #define HAS_DWIN_E3V2 1 #endif @@ -1058,6 +1055,7 @@ #if ENABLED(DWIN_LCD_PROUI) #define DO_LIST_BIN_FILES 1 #define LCD_BRIGHTNESS_DEFAULT 127 + #define STATUS_DO_CLEAR_EMPTY #endif // Serial Controllers require LCD_SERIAL_PORT @@ -1092,6 +1090,7 @@ * - draw_kill_screen * - kill_screen * - draw_status_message + * (calling advance_status_scroll, status_and_len for a scrolling status message) */ #define HAS_DISPLAY 1 #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 4f74fa0067..5f983c60f3 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -323,6 +323,13 @@ #define HAS_LINEAR_E_JERK 1 #endif +// Some displays can toggle Adaptive Step Smoothing. +// The state is saved to EEPROM. +// In future this may be added to a G-code such as M205 A. +#if ALL(ADAPTIVE_STEP_SMOOTHING, DWIN_LCD_PROUI) + #define ADAPTIVE_STEP_SMOOTHING_TOGGLE +#endif + /** * Temperature Sensors; define what sensor(s) we have. */ @@ -1381,6 +1388,11 @@ #endif // Power-Loss Recovery -#if ENABLED(POWER_LOSS_RECOVERY) && defined(PLR_BED_THRESHOLD) - #define HAS_PLR_BED_THRESHOLD 1 +#if ENABLED(POWER_LOSS_RECOVERY) + #ifdef PLR_BED_THRESHOLD + #define HAS_PLR_BED_THRESHOLD 1 + #endif + #if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) + #define HAS_PLR_UI_FLAG 1 // recovery.ui_flag_resume + #endif #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 2683312976..64c95fa6c4 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2487,9 +2487,6 @@ // PID heating #if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #define HAS_PID_HEATING 1 - #if ENABLED(DWIN_LCD_PROUI) && ANY(PIDTEMP, PIDTEMPBED) - #define PROUI_PID_TUNE 1 - #endif #endif // Thermal protection @@ -3047,8 +3044,8 @@ * Advanced Pause - Filament Change */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) - #define M600_PURGE_MORE_RESUMABLE 1 + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) + #define M600_PURGE_MORE_RESUMABLE 1 // UI provides some way to Purge More / Resume #endif #ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h index 59df915f49..9025395f56 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -28,7 +28,7 @@ #include "../../inc/MarlinConfigPre.h" #include -#include "HAL_LCD_class_defines.h" +#include "u8g/HAL_LCD_class_defines.h" //#define ALTERNATIVE_LCD diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/u8g/HAL_LCD_class_defines.h similarity index 99% rename from Marlin/src/lcd/dogm/HAL_LCD_class_defines.h rename to Marlin/src/lcd/dogm/u8g/HAL_LCD_class_defines.h index f07064ea71..907fa43c9b 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/u8g/HAL_LCD_class_defines.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" // use this file to create the public interface for device drivers that are NOT in the U8G library diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/u8g/HAL_LCD_com_defines.h similarity index 97% rename from Marlin/src/lcd/dogm/HAL_LCD_com_defines.h rename to Marlin/src/lcd/dogm/u8g/HAL_LCD_com_defines.h index a70e2b7b8b..e94c753807 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/u8g/HAL_LCD_com_defines.h @@ -27,7 +27,7 @@ #include -#include HAL_PATH(../.., u8g/LCD_defines.h) +#include HAL_PATH(../../.., u8g/LCD_defines.h) #if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp index 5865bb1187..4cd9b8f3c0 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp @@ -65,7 +65,7 @@ * beginning. */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1309_12864.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1309_12864.cpp index 6d40ea0d4b..4aa90d5e8e 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1309_12864.cpp @@ -20,7 +20,7 @@ * */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7565_64128n_HAL.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_st7565_64128n_HAL.cpp index 6c7066179e..61a1e214bd 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7565_64128n_HAL.cpp @@ -53,7 +53,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7920_128x64_HAL.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_st7920_128x64_HAL.cpp index d5f1be18ec..fb9d4b7ad6 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7920_128x64_HAL.cpp @@ -53,7 +53,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB && DISABLED(TFT_CLASSIC_UI) diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_tft_upscale_from_128x64.cpp similarity index 98% rename from Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_tft_upscale_from_128x64.cpp index 51bbee78b9..dcf835a6cb 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_tft_upscale_from_128x64.cpp @@ -53,12 +53,12 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if HAS_MARLINUI_U8GLIB && (PIN_EXISTS(FSMC_CS) || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT) #include "HAL_LCD_com_defines.h" -#include "marlinui_DOGM.h" +#include "../marlinui_DOGM.h" #include @@ -66,7 +66,7 @@ #define HAS_LCD_IO 1 #endif -#include "../tft_io/tft_io.h" +#include "../../tft_io/tft_io.h" TFT_IO tftio; #define WIDTH LCD_PIXEL_WIDTH @@ -74,12 +74,12 @@ TFT_IO tftio; #define PAGE_HEIGHT 8 #if ENABLED(TOUCH_SCREEN_CALIBRATION) - #include "../tft_io/touch_calibration.h" - #include "../marlinui.h" + #include "../../tft_io/touch_calibration.h" + #include "../../marlinui.h" #endif -#include "../touch/touch_buttons.h" -#include "../scaled_tft.h" +#include "../../touch/touch_buttons.h" +#include "../../scaled_tft.h" #define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1) #define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1) diff --git a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_uc1701_mini12864_HAL.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_uc1701_mini12864_HAL.cpp index 172afbd766..95ae2810f2 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_uc1701_mini12864_HAL.cpp @@ -53,7 +53,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.cpp similarity index 98% rename from Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp rename to Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.cpp index 11cd7b14ba..cd7445e019 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -23,11 +23,11 @@ // NOTE - the HAL version of the rrd device uses a generic ST7920 device. // See u8g_dev_st7920_128x64_HAL.cpp for the HAL version. -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ANY(__AVR__, ARDUINO_ARCH_STM32, ARDUINO_ARCH_ESP32) -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if IS_U8GLIB_ST7920 @@ -184,7 +184,7 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_rrd_st7920_128x64_fn, &u8 #pragma GCC reset_options #if ENABLED(LIGHTWEIGHT_UI) - #include "../../HAL/shared/HAL_ST7920.h" + #include "../../../HAL/shared/HAL_ST7920.h" void ST7920_cs() { ST7920_CS(); } void ST7920_ncs() { ST7920_NCS(); } void ST7920_set_cmd() { ST7920_SET_CMD(); } diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.h similarity index 96% rename from Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h rename to Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.h index 9a565fc2ef..f965913341 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.h @@ -24,8 +24,8 @@ // NOTE - the HAL version of the rrd device uses a generic ST7920 device. See the // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. -#include "../../inc/MarlinConfig.h" -#include "../../HAL/shared/Delay.h" +#include "../../../inc/MarlinConfig.h" +#include "../../../HAL/shared/Delay.h" #define ST7920_CLK_PIN LCD_PINS_D4 #define ST7920_DAT_PIN LCD_PINS_EN diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index 342289e993..1688b24230 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -153,21 +153,23 @@ void dwinFrameClear(const uint16_t color) { dwinSend(i); } -// Draw a point -// color: point color -// width: point width 0x01-0x0F -// height: point height 0x01-0x0F -// x,y: upper left point -void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y) { - size_t i = 0; - dwinByte(i, 0x02); - dwinWord(i, color); - dwinByte(i, width); - dwinByte(i, height); - dwinWord(i, x); - dwinWord(i, y); - dwinSend(i); -} +#if DISABLED(TJC_DISPLAY) + // Draw a point + // color: point color + // width: point width 0x01-0x0F + // height: point height 0x01-0x0F + // x,y: upper left point + void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y) { + size_t i = 0; + dwinByte(i, 0x02); + dwinWord(i, color); + dwinByte(i, width); + dwinByte(i, height); + dwinWord(i, x); + dwinWord(i, y); + dwinSend(i); + } +#endif // Draw a line // color: Line segment color diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h index dd4fccbcc5..4878515032 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.h +++ b/Marlin/src/lcd/e3v2/common/dwin_api.h @@ -113,13 +113,6 @@ void dwinUpdateLCD(); // color: Clear screen color void dwinFrameClear(const uint16_t color); -// Draw a point -// color: point color -// width: point width 0x01-0x0F -// height: point height 0x01-0x0F -// x,y: upper left point -void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y); - // Draw a line // color: Line segment color // xStart/yStart: Start point @@ -158,6 +151,19 @@ inline void dwinDrawBox(uint8_t mode, uint16_t color, uint16_t xStart, uint16_t dwinDrawRectangle(mode, color, xStart, yStart, xStart + xSize - 1, yStart + ySize - 1); } +// Draw a point +// color: point color +// width: point width 0x01-0x0F +// height: point height 0x01-0x0F +// x,y: upper left point +#if ENABLED(TJC_DISPLAY) + inline void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y) { + dwinDrawBox(1, color, x, y, 1, 1); + } +#else + void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y); +#endif + // Move a screen area // mode: 0, circle shift; 1, translation // dir: 0=left, 1=right, 2=up, 3=down diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index ada7dec71f..f32d0e6d9e 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -130,7 +130,7 @@ #define ICON_Folder ICON_More #define ICON_AdvSet ICON_Language -#define ICON_HomeOffset ICON_AdvSet +#define ICON_HomeOffset ICON_PrintSize #define ICON_HomeOffsetX ICON_StepX #define ICON_HomeOffsetY ICON_StepY #define ICON_HomeOffsetZ ICON_StepZ @@ -138,8 +138,8 @@ #define ICON_ProbeOffsetX ICON_StepX #define ICON_ProbeOffsetY ICON_StepY #define ICON_ProbeOffsetZ ICON_StepZ -#define ICON_PIDNozzle ICON_SetEndTemp -#define ICON_PIDBed ICON_SetBedTemp +#define ICON_PIDNozzle ICON_HotendTemp +#define ICON_PIDBed ICON_BedTemp #define ICON_FWRetract ICON_StepE #define ICON_FWRetLength ICON_StepE #define ICON_FWRetSpeed ICON_Setspeed diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 08161dffaf..9ecfbfe1fa 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -4169,8 +4169,8 @@ void eachMomentUpdate() { gotoMainMenu(); } #if ENABLED(POWER_LOSS_RECOVERY) - else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off - recovery.dwin_flag = false; + else if (DWIN_lcd_sd_status && recovery.ui_flag_resume) { // Resume interrupted print + recovery.ui_flag_resume = false; auto update_selection = [&](const bool sel) { hmiFlag.select_flag = sel; @@ -4197,7 +4197,7 @@ void eachMomentUpdate() { if (encoder_diffState == ENCODER_DIFF_ENTER) { recovery_flag = false; if (hmiFlag.select_flag) break; - TERN_(POWER_LOSS_RECOVERY, queue.inject(F("M1000C"))); + queue.inject(F("M1000C")); hmiStartFrame(true); return; } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index b65adbb780..bb345e5191 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -158,6 +158,8 @@ #define MAX_ETEMP thermalManager.hotend_max_target(0) #define MIN_BEDTEMP 0 #define MAX_BEDTEMP BED_MAX_TARGET +#define MIN_CHAMBERTEMP 0 +#define MAX_CHAMBERTEMP CHAMBER_MAX_TARGET #define DWIN_VAR_UPDATE_INTERVAL 500 #define DWIN_UPDATE_INTERVAL 1000 @@ -243,11 +245,16 @@ Menu *stepsMenu = nullptr; #if ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) Menu *hotendMPCMenu = nullptr; #endif -#if ENABLED(PIDTEMP) && ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) - Menu *hotendPIDMenu = nullptr; -#endif -#if ENABLED(PIDTEMPBED) && ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) - Menu *bedPIDMenu = nullptr; +#if ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) + #if ENABLED(PIDTEMP) + Menu *hotendPIDMenu = nullptr; + #endif + #if ENABLED(PIDTEMPBED) + Menu *bedPIDMenu = nullptr; + #endif + #if ENABLED(PIDTEMPCHAMBER) + Menu *chamberPIDMenu = nullptr; + #endif #endif #if CASELIGHT_USES_BRIGHTNESS Menu *caseLightMenu = nullptr; @@ -418,49 +425,50 @@ void popupPauseOrStop() { drawSelectHighlight(true); dwinUpdateLCD(); } - else - dwinPopupConfirmCancel(ICON_BLTouch, select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); + else { + switch (select_print.now) { + case PRINT_PAUSE_RESUME: dwinPopupConfirmCancel(ICON_Pause_1, GET_TEXT_F(MSG_PAUSE_PRINT)); break; + case PRINT_STOP: dwinPopupConfirmCancel(ICON_Stop_1, GET_TEXT_F(MSG_STOP_PRINT)); break; + default: break; + } + } } -#if HAS_HOTEND - - void popupETempTooLow() { - if (hmiIsChinese()) { - hmiSaveProcessID(ID_WaitResponse); - DWINUI::clearMainArea(); - drawPopupBkgd(); - DWINUI::drawIcon(ICON_TempTooLow, 102, 105); - dwinFrameAreaCopy(1, 103, 371, 136, 386, 69, 240); - dwinFrameAreaCopy(1, 170, 371, 270, 386, 102, 240); - DWINUI::drawIconWB(ICON_Confirm_C, 86, 280); - dwinUpdateLCD(); - } - else - dwinPopupConfirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT)); - } - -#endif - -#if HAS_HOTEND || HAS_HEATED_BED - void dwinPopupTemperature(const bool toohigh) { +#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER + void dwinPopupTemperature(const int_fast8_t heater_id, const uint8_t state) { hmiSaveProcessID(ID_WaitResponse); if (hmiIsChinese()) { DWINUI::clearMainArea(); drawPopupBkgd(); - if (toohigh) { + if (state == 1) { DWINUI::drawIcon(ICON_TempTooHigh, 102, 165); dwinFrameAreaCopy(1, 103, 371, 237, 386, 52, 285); dwinFrameAreaCopy(1, 151, 389, 185, 402, 187, 285); dwinFrameAreaCopy(1, 189, 389, 271, 402, 95, 310); } - else { + else if (state == 0) { DWINUI::drawIcon(ICON_TempTooLow, 102, 165); dwinFrameAreaCopy(1, 103, 371, 270, 386, 52, 285); dwinFrameAreaCopy(1, 189, 389, 271, 402, 95, 310); } + else { + // Chinese "Temp Error" + } + } + else { + FSTR_P heaterstr = nullptr; + if (TERN0(HAS_HEATED_BED, heater_id == H_BED)) heaterstr = F("Bed"); + else if (TERN0(HAS_HEATED_CHAMBER, heater_id == H_CHAMBER)) heaterstr = F("Chamber"); + else if (TERN0(HAS_HOTEND, heater_id >= 0)) heaterstr = F("Nozzle"); + FSTR_P errorstr; + uint8_t icon; + switch (state) { + case 0: errorstr = GET_TEXT_F(MSG_TEMP_TOO_LOW); icon = ICON_TempTooLow; break; + case 1: errorstr = GET_TEXT_F(MSG_TEMP_TOO_HIGH); icon = ICON_TempTooHigh; break; + default: errorstr = GET_TEXT_F(MSG_ERR_HEATING_FAILED); icon = ICON_Temperature; break; // May be thermal runaway, temp malfunction, etc. + } + dwinShowPopup(icon, heaterstr, errorstr, BTN_Continue); } - else - dwinShowPopup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low"), BTN_Continue); } #endif @@ -581,16 +589,17 @@ void ICON_ResumeOrPause() { if (checkkey == ID_PrintProcess) (print_job_timer.isPaused() || hmiFlag.pause_flag) ? ICON_Resume() : ICON_Pause(); } -// Update filename on print -void dwinPrintHeader(const char *text = nullptr) { +// Print a string (up to 30 characters) in the header, +// e.g., The filename or string sent with M75. +void dwinPrintHeader(const char * const cstr/*=nullptr*/) { static char headertxt[31] = ""; // Print header text - if (text) { - const int8_t size = _MIN(30U, strlen_P(text)); - for (uint8_t i = 0; i < size; ++i) headertxt[i] = text[i]; + if (cstr) { + const int8_t size = _MIN(30U, strlen(cstr)); + for (uint8_t i = 0; i < size; ++i) headertxt[i] = cstr[i]; headertxt[size] = '\0'; } if (checkkey == ID_PrintProcess || checkkey == ID_PrintDone) { - dwinDrawRectangle(1, hmiData.colorBackground, 0, 60, DWIN_WIDTH, 60+16); + dwinDrawRectangle(1, hmiData.colorBackground, 0, 60, DWIN_WIDTH, 60 + 16); DWINUI::drawCenteredString(60, headertxt); } } @@ -601,7 +610,7 @@ void drawPrintProcess() { else title.showCaption(GET_TEXT_F(MSG_PRINTING)); DWINUI::clearMainArea(); - dwinPrintHeader(nullptr); + dwinPrintHeader(); drawPrintLabels(); DWINUI::drawIcon(ICON_PrintTime, 15, 173); DWINUI::drawIcon(ICON_RemainTime, 150, 171); @@ -629,7 +638,7 @@ void drawPrintDone() { TERN_(SET_REMAINING_TIME, ui.reset_remaining_time()); title.showCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::clearMainArea(); - dwinPrintHeader(nullptr); + dwinPrintHeader(); #if HAS_GCODE_PREVIEW const bool haspreview = preview.valid(); if (haspreview) { @@ -1031,7 +1040,7 @@ void hmiSDCardUpdate() { currentMenu = nullptr; drawPrintFileMenu(); } - if (!DWIN_lcd_sd_status && sdPrinting()) ui.abort_print(); // Media removed while printing + if (!DWIN_lcd_sd_status && sdPrinting()) ExtUI::stopPrint(); // Media removed while printing } } @@ -1060,7 +1069,7 @@ void dwinDrawDashboard() { #endif #if HAS_HEATED_BED - DWINUI::drawIcon(ICON_BedTemp, 10, 416); + DWINUI::drawIcon(ICON_SetBedTemp, 10, 416); DWINUI::drawInt(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 3, 28, 417, thermalManager.wholeDegBed()); DWINUI::drawString(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 25 + 3 * STAT_CHR_W + 5, 417, F("/")); DWINUI::drawInt(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.degTargetBed()); @@ -1155,8 +1164,8 @@ void hmiMainMenu() { // Pause or Stop popup void onClickPauseOrStop() { switch (select_print.now) { - case PRINT_PAUSE_RESUME: if (hmiFlag.select_flag) ui.pause_print(); break; // Confirm pause - case PRINT_STOP: if (hmiFlag.select_flag) ui.abort_print(); break; // Stop confirmed then abort print + case PRINT_PAUSE_RESUME: if (hmiFlag.select_flag) ExtUI::pausePrint(); break; // Confirm pause + case PRINT_STOP: if (hmiFlag.select_flag) ExtUI::stopPrint(); break; // Stop confirmed then abort print default: break; } return gotoPrintProcess(); @@ -1190,7 +1199,7 @@ void hmiPrinting() { case PRINT_SETUP: drawTuneMenu(); break; case PRINT_PAUSE_RESUME: if (printingIsPaused()) { // If printer is already in pause - ui.resume_print(); + ExtUI::resumePrint(); break; } else @@ -1213,6 +1222,20 @@ void drawMainArea() { #if HAS_ESDIAG case ID_ESDiagProcess: drawEndStopDiag(); break; #endif + #if ENABLED(PROUI_ITEM_PLOT) + case ID_PlotProcess: + switch (hmiValue.tempControl) { + #if ENABLED(PIDTEMP) + case PIDTEMP_START: drawHPlot(); break; + #endif + #if ENABLED(PIDTEMPBED) + case PIDTEMPBED_START: drawBPlot(); break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: drawCPlot(); break; + #endif + } break; + #endif case ID_Popup: popupDraw(); break; #if HAS_LOCKSCREEN case ID_Locked: lockScreen.draw(); break; @@ -1280,12 +1303,14 @@ void eachMomentUpdate() { if (checkkey == ID_PIDProcess) { TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) plot.update(thermalManager.wholeDegHotend(0))); TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) plot.update(thermalManager.wholeDegBed())); + TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) plot.update(thermalManager.wholeDegChamber())); } TERN_(MPCTEMP, if (checkkey == ID_MPCProcess) plot.update(thermalManager.wholeDegHotend(0))); #if ENABLED(PROUI_ITEM_PLOT) if (checkkey == ID_PlotProcess) { TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); }) TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) { plot.update(thermalManager.wholeDegBed()); }) + TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) { plot.update(thermalManager.wholeDegChamber()); }) TERN_(MPCTEMP, if (hmiValue.tempControl == MPCTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); }) if (hmiFlag.abort_flag || hmiFlag.pause_flag || print_job_timer.isPaused()) { hmiReturnScreen(); @@ -1357,8 +1382,8 @@ void eachMomentUpdate() { drawPrintProgressElapsed(); } } - #if ENABLED(POWER_LOSS_RECOVERY) - else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // Resume print before power off + #if HAS_PLR_UI_FLAG + else if (DWIN_lcd_sd_status && recovery.ui_flag_resume) { // Resume interrupted print return gotoPowerLossRecovery(); } #endif @@ -1368,6 +1393,7 @@ void eachMomentUpdate() { } #if ENABLED(POWER_LOSS_RECOVERY) + void popupPowerLossRecovery() { DWINUI::clearMainArea(); drawPopupBkgd(); @@ -1407,7 +1433,7 @@ void eachMomentUpdate() { } void gotoPowerLossRecovery() { - recovery.dwin_flag = false; + recovery.ui_flag_resume = false; LCD_MESSAGE(MSG_CONTINUE_PRINT_JOB); gotoPopup(popupPowerLossRecovery, onClickPowerLossRecovery); } @@ -1435,7 +1461,8 @@ void dwinHandleScreen() { TERN_(HAS_BED_PROBE, case ID_Leveling:) case ID_Homing: - case ID_PIDProcess: + TERN_(HAS_PID_HEATING, case ID_PIDProcess:) + TERN_(MPCTEMP, case ID_MPCProcess:) case ID_NothingToDo: default: break; } @@ -1449,7 +1476,9 @@ bool idIsPopUp() { // If ID is popup... case ID_WaitResponse: case ID_Popup: case ID_Homing: - case ID_PIDProcess: + TERN_(HAS_PID_HEATING, case ID_PIDProcess:) + TERN_(MPCTEMP, case ID_MPCProcess:) + TERN_(PROUI_ITEM_PLOT, case ID_PlotProcess:) return true; default: break; } @@ -1482,7 +1511,11 @@ void dwinHomingStart() { hmiFlag.home_flag = true; hmiSaveProcessID(ID_Homing); title.showCaption(GET_TEXT_F(MSG_HOMING)); - dwinShowPopup(ICON_BLTouch, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #if ANY(TJC_DISPLAY, DACAI_DISPLAY) + dwinShowPopup(ICON_BLTouch, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #else + dwinShowPopup(ICON_Printer_0, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #endif } void dwinHomingDone() { @@ -1499,22 +1532,7 @@ void dwinLevelingStart() { title.showCaption(GET_TEXT_F(MSG_BED_LEVELING)); dwinShowPopup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); #if ALL(AUTO_BED_LEVELING_UBL, PREHEAT_BEFORE_LEVELING) - #if HAS_BED_PROBE - if (!DEBUGGING(DRYRUN)) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, hmiData.bedLevT); - #else - #if HAS_HOTEND - if (!DEBUGGING(DRYRUN) && thermalManager.degTargetHotend(0) < LEVELING_NOZZLE_TEMP) { - thermalManager.setTargetHotend(LEVELING_NOZZLE_TEMP, 0); - thermalManager.wait_for_hotend(0); - } - #endif - #if HAS_HEATED_BED - if (!DEBUGGING(DRYRUN) && thermalManager.degTargetBed() < hmiData.bedLevT) { - thermalManager.setTargetBed(hmiData.bedLevT); - thermalManager.wait_for_bed_heating(); - } - #endif - #endif + if (!DEBUGGING(DRYRUN)) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, hmiData.bedLevT); #endif #elif ENABLED(MESH_BED_LEVELING) drawManualMeshMenu(); @@ -1551,7 +1569,7 @@ void dwinLevelingDone() { case MPCTEMP_START: DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_MPC_AUTOTUNE)); DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius")); - DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, F("for NOZZLE is running.")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE)); _maxtemp = thermalManager.hotend_maxtemp[0]; _target = 200; break; @@ -1560,18 +1578,27 @@ void dwinLevelingDone() { case PIDTEMP_START: DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_PID_AUTOTUNE)); DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); - DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, F("for NOZZLE is running.")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE)); _maxtemp = thermalManager.hotend_maxtemp[0]; - _target = hmiData.hotendPidT; + _target = hmiData.hotendPIDT; break; #endif #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_PID_AUTOTUNE)); DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); - DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, F("for BED is running.")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_BED)); _maxtemp = BED_MAXTEMP; - _target = hmiData.bedPidT; + _target = hmiData.bedPIDT; + break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_CHAMBER)); + _maxtemp = CHAMBER_MAXTEMP; + _target = hmiData.chamberPIDT; break; #endif } @@ -1585,7 +1612,7 @@ void dwinLevelingDone() { void dwinDrawPlot(tempcontrol_t result) { hmiValue.tempControl = result; - constexpr frame_rect_t gfrm = {30, 135, DWIN_WIDTH - 60, 160}; + constexpr frame_rect_t gfrm = { 30, 135, DWIN_WIDTH - 60, 160 }; DWINUI::clearMainArea(); drawPopupBkgd(); hmiSaveProcessID(ID_PlotProcess); @@ -1597,18 +1624,26 @@ void dwinLevelingDone() { case PIDTEMP_START: #endif title.showCaption(GET_TEXT_F(MSG_HOTEND_TEMP_GRAPH)); - DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, F("Nozzle Temperature")); + DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, GET_TEXT_F(MSG_TEMP_NOZZLE)); _maxtemp = thermalManager.hotend_max_target(0); _target = thermalManager.degTargetHotend(0); break; #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: title.showCaption(GET_TEXT_F(MSG_BED_TEMP_GRAPH)); - DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, F("Bed Temperature")); + DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, GET_TEXT_F(MSG_TEMP_BED)); _maxtemp = BED_MAX_TARGET; _target = thermalManager.degTargetBed(); break; #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: + title.showCaption(GET_TEXT_F(MSG_CHAMBER_TEMP_GRAPH)); + DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, GET_TEXT_F(MSG_TEMP_CHAMBER)); + _maxtemp = CHAMBER_MAX_TARGET; + _target = thermalManager.degTargetChamber(); + break; + #endif default: break; } @@ -1616,7 +1651,6 @@ void dwinLevelingDone() { plot.draw(gfrm, _maxtemp, _target); DWINUI::drawInt(false, 2, hmiData.colorStatusTxt, hmiData.colorPopupBg, 3, gfrm.x + 80, gfrm.y - DWINUI::fontHeight() - 4, _target); DWINUI::drawButton(BTN_Continue, 86, 305); - dwinUpdateLCD(); } void drawHPlot() { @@ -1626,29 +1660,33 @@ void dwinLevelingDone() { void drawBPlot() { TERN_(PIDTEMPBED, dwinDrawPlot(PIDTEMPBED_START)); } + void drawCPlot() { + TERN_(PIDTEMPCHAMBER, dwinDrawPlot(PIDTEMPCHAMBER_START)); + } #endif // PROUI_ITEM_PLOT #endif // PROUI_TUNING_GRAPH -#if PROUI_PID_TUNE +#if HAS_PID_HEATING - void dwinStartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp) { - if (seenC) hmiData.pidCycles = c; - if (seenS) { - switch (hid) { - #if ENABLED(PIDTEMP) - case 0 ... HOTENDS - 1: hmiData.hotendPidT = temp; break; - #endif - #if ENABLED(PIDTEMPBED) - case H_BED: hmiData.bedPidT = temp; break; - #endif - default: break; - } + void dwinStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + hmiData.pidCycles = count; + switch (hid) { + #if ENABLED(PIDTEMP) + case 0 ... HOTENDS - 1: hmiData.hotendPIDT = temp; break; + #endif + #if ENABLED(PIDTEMPBED) + case H_BED: hmiData.bedPIDT = temp; break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case H_CHAMBER: hmiData.chamberPIDT = temp; break; + #endif + default: break; } } - void dwinPidTuning(tempcontrol_t result) { + void dwinPIDTuning(tempcontrol_t result) { hmiValue.tempControl = result; switch (result) { #if ENABLED(PIDTEMP) @@ -1657,22 +1695,20 @@ void dwinLevelingDone() { #if PROUI_TUNING_GRAPH dwinDrawPIDMPCPopup(); #else - dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_PID_FOR_NOZZLE)); #endif break; - case PID_TEMP_TOO_HIGH: - checkkey = last_checkkey; - dwinPopupConfirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); - break; #endif #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: hmiSaveProcessID(ID_PIDProcess); - #if PROUI_TUNING_GRAPH - dwinDrawPIDMPCPopup(); - #else - dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); - #endif + dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_PID_FOR_BED)); + break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: + hmiSaveProcessID(ID_PIDProcess); + dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_PID_FOR_CHAMBER)); break; #endif case PID_BAD_HEATER_ID: @@ -1683,17 +1719,22 @@ void dwinLevelingDone() { checkkey = last_checkkey; dwinPopupConfirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); break; + case PID_TEMP_TOO_HIGH: + checkkey = last_checkkey; + dwinPopupConfirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); + break; case AUTOTUNE_DONE: checkkey = last_checkkey; dwinPopupConfirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); break; default: checkkey = last_checkkey; + dwinPopupConfirm(ICON_Info_0, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_STOPPING)); break; } } -#endif // PROUI_PID_TUNE +#endif // HAS_PID_HEATING #if ENABLED(MPC_AUTOTUNE) @@ -1808,12 +1849,14 @@ void dwinSetColorDefaults() { hmiData.colorCoordinate = defColorCoordinate; } +static_assert(ExtUI::eeprom_data_size >= sizeof(hmi_data_t), "Insufficient space in EEPROM for UI parameters"); + void dwinSetDataDefaults() { dwinSetColorDefaults(); DWINUI::setColors(hmiData.colorText, hmiData.colorBackground, hmiData.colorStatusBg); - TERN_(PIDTEMP, hmiData.hotendPidT = DEF_HOTENDPIDT); - TERN_(PIDTEMPBED, hmiData.bedPidT = DEF_BEDPIDT); - TERN_(PROUI_PID_TUNE, hmiData.pidCycles = DEF_PIDCYCLES); + TERN_(PIDTEMP, hmiData.hotendPIDT = DEF_HOTENDPIDT); + TERN_(PIDTEMPBED, hmiData.bedPIDT = DEF_BEDPIDT); + TERN_(HAS_PID_HEATING, hmiData.pidCycles = DEF_PIDCYCLES); #if ENABLED(PREVENT_COLD_EXTRUSION) hmiData.extMinT = EXTRUDE_MINTEMP; applyExtMinT(); @@ -1835,12 +1878,11 @@ void dwinSetDataDefaults() { TERN_(LED_COLOR_PRESETS, leds.set_default()); applyLEDColor(); #endif - TERN_(ADAPTIVE_STEP_SMOOTHING, hmiData.adaptiveStepSmoothing = true); TERN_(HAS_GCODE_PREVIEW, hmiData.enablePreview = true); } void dwinCopySettingsTo(char * const buff) { - memcpy(buff, &hmiData, eeprom_data_size); + memcpy(buff, &hmiData, sizeof(hmi_data_t)); } void dwinCopySettingsFrom(const char * const buff) { @@ -1895,7 +1937,11 @@ void MarlinUI::update() { #endif void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) { - dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + #if ANY(TJC_DISPLAY, DACAI_DISPLAY) + dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + #else + dwinDrawPopup(ICON_Printer_0, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + #endif DWINUI::drawCenteredString(hmiData.colorPopupTxt, 270, GET_TEXT_F(MSG_TURN_OFF)); dwinUpdateLCD(); } @@ -1920,32 +1966,14 @@ void dwinRedrawScreen() { } #if ENABLED(ADVANCED_PAUSE_FEATURE) + void dwinPopupPause(FSTR_P const fmsg, uint8_t button/*=0*/) { hmiSaveProcessID(button ? ID_WaitResponse : ID_NothingToDo); - dwinShowPopup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); - } - - void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { - if (mode != PAUSE_MODE_SAME) pause_mode = mode; - switch (message) { - case PAUSE_MESSAGE_PARKING: dwinPopupPause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 - case PAUSE_MESSAGE_CHANGING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) - case PAUSE_MESSAGE_WAITING: dwinPopupPause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; - case PAUSE_MESSAGE_INSERT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break; - case PAUSE_MESSAGE_LOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_UNLOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 - case PAUSE_MESSAGE_PURGE: dwinPopupPause(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; - case PAUSE_MESSAGE_OPTION: gotoFilamentPurge(); break; - case PAUSE_MESSAGE_RESUME: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; - case PAUSE_MESSAGE_HEATING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_STATUS: hmiReturnScreen(); break; // Exit from Pause, Load and Unload - default: break; - } + dwinShowPopup(ICON_Pause_1, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); } void drawPopupFilamentPurge() { - dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE_CONTINUE)); + dwinDrawPopup(ICON_AutoLeveling, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE_CONTINUE)); DWINUI::drawButton(BTN_Purge, 26, 280); DWINUI::drawButton(BTN_Continue, 146, 280); drawSelectHighlight(true); @@ -1970,7 +1998,7 @@ void dwinRedrawScreen() { #if HAS_MESH void dwinMeshViewer() { if (!leveling_is_valid()) - dwinPopupContinue(ICON_BLTouch, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); + dwinPopupContinue(ICON_Leveling_1, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); else { hmiSaveProcessID(ID_WaitResponse); meshViewer.draw(); @@ -3088,17 +3116,17 @@ void drawPrepareMenu() { if (SET_MENU(trammingMenu, MSG_BED_TRAMMING, 8)) { BACK_ITEM(drawPrepareMenu); #if HAS_BED_PROBE && HAS_MESH - MENU_ITEM(ICON_ProbeSet, MSG_TRAMMING_WIZARD, onDrawMenuItem, trammingwizard); - EDIT_ITEM(ICON_ProbeSet, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, setManualTramming, &hmiData.fullManualTramming); + MENU_ITEM(ICON_Tram, MSG_TRAMMING_WIZARD, onDrawMenuItem, trammingwizard); + EDIT_ITEM(ICON_Version, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, setManualTramming, &hmiData.fullManualTramming); #elif !HAS_BED_PROBE && HAS_ZOFFSET_ITEM MENU_ITEM_F(ICON_MoveZ0, "Home Z and disable", onDrawMenuItem, homeZAndDisable); #endif - MENU_ITEM(ICON_Axis, MSG_TRAM_FL, onDrawMenuItem, []{ (void)tram(0); }); - MENU_ITEM(ICON_Axis, MSG_TRAM_FR, onDrawMenuItem, []{ (void)tram(1); }); - MENU_ITEM(ICON_Axis, MSG_TRAM_BR, onDrawMenuItem, []{ (void)tram(2); }); - MENU_ITEM(ICON_Axis, MSG_TRAM_BL, onDrawMenuItem, []{ (void)tram(3); }); + MENU_ITEM(ICON_AxisBL, MSG_TRAM_FL, onDrawMenuItem, []{ (void)tram(0); }); + MENU_ITEM(ICON_AxisBR, MSG_TRAM_FR, onDrawMenuItem, []{ (void)tram(1); }); + MENU_ITEM(ICON_AxisTR, MSG_TRAM_BR, onDrawMenuItem, []{ (void)tram(2); }); + MENU_ITEM(ICON_AxisTL, MSG_TRAM_BL, onDrawMenuItem, []{ (void)tram(3); }); #if ENABLED(BED_TRAMMING_INCLUDE_CENTER) - MENU_ITEM(ICON_Axis, MSG_TRAM_C, onDrawMenuItem, []{ (void)tram(4); }); + MENU_ITEM(ICON_AxisC, MSG_TRAM_C, onDrawMenuItem, []{ (void)tram(4); }); #endif } updateMenu(trammingMenu); @@ -3144,13 +3172,13 @@ void drawAdvancedSettingsMenu() { MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); #endif #if HAS_MESH - MENU_ITEM(ICON_ProbeSet, MSG_MESH_LEVELING, onDrawSubMenu, drawMeshSetMenu); + MENU_ITEM(ICON_Mesh, MSG_MESH_LEVELING, onDrawSubMenu, drawMeshSetMenu); #endif #if HAS_BED_PROBE - MENU_ITEM(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, drawProbeSetMenu); + MENU_ITEM(ICON_Probe, MSG_ZPROBE_SETTINGS, onDrawSubMenu, drawProbeSetMenu); #endif #if HAS_HOME_OFFSET - MENU_ITEM(ICON_ProbeSet, MSG_SET_HOME_OFFSETS, onDrawSubMenu, drawHomeOffsetMenu); + MENU_ITEM(ICON_HomeOffset, MSG_SET_HOME_OFFSETS, onDrawSubMenu, drawHomeOffsetMenu); #endif MENU_ITEM(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, drawFilSetMenu); #if ENABLED(PIDTEMP) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) @@ -3176,7 +3204,7 @@ void drawAdvancedSettingsMenu() { MENU_ITEM(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, dwinLockScreen); #endif #if ENABLED(EDITABLE_DISPLAY_TIMEOUT) - EDIT_ITEM(ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_RemainTime, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); #endif #if ENABLED(SOUND_MENU_ITEM) EDIT_ITEM(ICON_Sound, MSG_SOUND_ENABLE, onDrawChkbMenu, setEnableSound, &ui.sound_on); @@ -3196,7 +3224,7 @@ void drawAdvancedSettingsMenu() { #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, setBrightness, &ui.brightness); - MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); + MENU_ITEM(ICON_Box, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); #endif #if HAS_CUSTOM_COLORS MENU_ITEM(ICON_Scolor, MSG_COLORS_SELECT, onDrawSubMenu, drawSelectColorsMenu); @@ -3268,7 +3296,7 @@ void drawMoveMenu() { #if ENABLED(BLTOUCH) MENU_ITEM(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, probeStow); MENU_ITEM(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, probeDeploy); - MENU_ITEM(ICON_BltouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); + MENU_ITEM(ICON_BLTouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); #if HAS_BLTOUCH_HS_MODE EDIT_ITEM(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, setHSMode, &bltouch.high_speed_mode); #endif @@ -3397,10 +3425,10 @@ void drawTuneMenu() { #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, setBrightness, &ui.brightness); - MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); + MENU_ITEM(ICON_Box, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); #endif #if ENABLED(EDITABLE_DISPLAY_TIMEOUT) - EDIT_ITEM(ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_RemainTime, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); #endif #if ALL(PROUI_TUNING_GRAPH, PROUI_ITEM_PLOT) MENU_ITEM(ICON_PIDNozzle, MSG_HOTEND_TEMP_GRAPH, onDrawMenuItem, drawHPlot); @@ -3425,9 +3453,9 @@ void drawTuneMenu() { updateMenu(tuneMenu); } -#if ENABLED(ADAPTIVE_STEP_SMOOTHING) +#if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) void setAdaptiveStepSmoothing() { - toggleCheckboxLine(hmiData.adaptiveStepSmoothing); + toggleCheckboxLine(stepper.adaptive_step_smoothing_enabled); } #endif @@ -3518,8 +3546,8 @@ void drawMotionMenu() { #if ENABLED(SHAPING_MENU) MENU_ITEM(ICON_InputShaping, MSG_INPUT_SHAPING, onDrawSubMenu, drawInputShaping_menu); #endif - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - EDIT_ITEM(ICON_UBLActive, MSG_STEP_SMOOTHING, onDrawChkbMenu, setAdaptiveStepSmoothing, &hmiData.adaptiveStepSmoothing); + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + EDIT_ITEM(ICON_UBLActive, MSG_STEP_SMOOTHING, onDrawChkbMenu, setAdaptiveStepSmoothing, &stepper.adaptive_step_smoothing_enabled); #endif #if ENABLED(EDITABLE_STEPS_PER_UNIT) MENU_ITEM(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, drawStepsMenu); @@ -3589,10 +3617,10 @@ void drawFilamentManMenu() { if (notCurrent) { BACK_ITEM(drawTemperatureMenu); #if HAS_HOTEND - EDIT_ITEM(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, setPreheatEndTemp, &ui.material_preset[hmiValue.select].hotend_temp); + EDIT_ITEM(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, setPreheatEndTemp, &ui.material_preset[hmiValue.select].hotend_temp); #endif #if HAS_HEATED_BED - EDIT_ITEM(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, setPreheatBedTemp, &ui.material_preset[hmiValue.select].bed_temp); + EDIT_ITEM(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, setPreheatBedTemp, &ui.material_preset[hmiValue.select].bed_temp); #endif #if HAS_FAN EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawSetPreheatFan, setPreheatFanSpeed, &ui.material_preset[hmiValue.select].fan_speed); @@ -3618,10 +3646,10 @@ void drawTemperatureMenu() { if (SET_MENU_R(temperatureMenu, selrect({236, 2, 28, 12}), MSG_TEMPERATURE, 4 + PREHEAT_COUNT)) { BACK_ITEM(drawControlMenu); #if HAS_HOTEND - hotendTargetItem = EDIT_ITEM(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, setHotendTemp, &thermalManager.temp_hotend[0].target); + hotendTargetItem = EDIT_ITEM(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, setHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - bedTargetItem = EDIT_ITEM(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, setBedTemp, &thermalManager.temp_bed.target); + bedTargetItem = EDIT_ITEM(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, setBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN fanSpeedItem = EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, setFanSpeed, &thermalManager.fan_speed[0]); @@ -3844,101 +3872,137 @@ void drawMaxAccelMenu() { #endif // MPC_EDIT_MENU || MPC_AUTOTUNE_MENU -#if PROUI_PID_TUNE - void setPID(celsius_t t, heater_id_t h) { - gcode.process_subcommands_now( - MString<60>(F("G28OXY\nG0Z5F300\nG0X"), X_CENTER, F("Y"), Y_CENTER, F("F5000\nM84\nM400")) - ); - thermalManager.PID_autotune(t, h, hmiData.pidCycles, true); - } - void setPidCycles() { setPIntOnClick(3, 50); } -#endif - -#if ALL(HAS_PID_HEATING, PID_EDIT_MENU) - - void setKp() { setPFloatOnClick(0, 1000, 2); } - void applyPIDi() { - *menuData.floatPtr = scalePID_i(menuData.value / POW(10, 2)); - TERN_(PIDTEMP, thermalManager.updatePID()); - } - void applyPIDd() { - *menuData.floatPtr = scalePID_d(menuData.value / POW(10, 2)); - TERN_(PIDTEMP, thermalManager.updatePID()); - } - void setKi() { - menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; - const float value = unscalePID_i(*menuData.floatPtr); - setFloatOnClick(0, 1000, 2, value, applyPIDi); - } - void setKd() { - menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; - const float value = unscalePID_d(*menuData.floatPtr); - setFloatOnClick(0, 1000, 2, value, applyPIDd); - } - void onDrawPIDi(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } - void onDrawPIDd(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } - -#endif // HAS_PID_HEATING && PID_EDIT_MENU - -#if ENABLED(PIDTEMP) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) +#if HAS_PID_HEATING #if ENABLED(PID_AUTOTUNE_MENU) - void hotendPID() { setPID(hmiData.hotendPidT, H_E0); } - void setHotendPidT() { setPIntOnClick(MIN_ETEMP, MAX_ETEMP); } + void setPID(celsius_t t, heater_id_t h) { + gcode.process_subcommands_now( + MString<60>(F("G28OXY\nG0Z5F300\nG0X"), X_CENTER, F("Y"), Y_CENTER, F("F5000\nM84\nM400")) + ); + thermalManager.PID_autotune(t, h, hmiData.pidCycles, true); + } + void setPIDCycles() { setPIntOnClick(3, 50); } #endif - void drawHotendPIDMenu() { - checkkey = ID_Menu; - if (SET_MENU_F(hotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { - BACK_ITEM(drawAdvancedSettingsMenu); - #if ENABLED(PID_AUTOTUNE_MENU) - MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID, onDrawMenuItem, hotendPID); - EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setHotendPidT, &hmiData.hotendPidT); - EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles); - #endif - #if ENABLED(PID_EDIT_MENU) - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_hotend[0].pid.Kp); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_hotend[0].pid.Ki); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_hotend[0].pid.Kd); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); - #endif + #if ENABLED(PID_EDIT_MENU) + void setKp() { setPFloatOnClick(0, 1000, 2); } + void applyPIDi() { + *menuData.floatPtr = scalePID_i(menuData.value / POW(10, 2)); + TERN_(PIDTEMP, thermalManager.updatePID()); } - updateMenu(hotendPIDMenu); - } - -#endif // PIDTEMP && (PID_AUTOTUNE_MENU || PID_EDIT_MENU) - -#if ENABLED(PIDTEMPBED) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) - - #if ENABLED(PID_AUTOTUNE_MENU) - void bedPID() { setPID(hmiData.bedPidT, H_BED); } - void setBedPidT() { setPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } - #endif - - void drawBedPIDMenu() { - checkkey = ID_Menu; - if (SET_MENU_F(bedPIDMenu, STR_BED_PID " Settings", 8)) { - BACK_ITEM(drawAdvancedSettingsMenu); - #if ENABLED(PID_AUTOTUNE_MENU) - MENU_ITEM_F(ICON_PIDBed, STR_BED_PID, onDrawMenuItem,bedPID); - EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setBedPidT, &hmiData.bedPidT); - EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles); - #endif - #if ENABLED(PID_EDIT_MENU) - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_bed.pid.Kp); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_bed.pid.Ki); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_bed.pid.Kd); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); - #endif + void applyPIDd() { + *menuData.floatPtr = scalePID_d(menuData.value / POW(10, 2)); + TERN_(PIDTEMP, thermalManager.updatePID()); } - updateMenu(bedPIDMenu); - } + void setKi() { + menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; + const float value = unscalePID_i(*menuData.floatPtr); + setFloatOnClick(0, 1000, 2, value, applyPIDi); + } + void setKd() { + menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; + const float value = unscalePID_d(*menuData.floatPtr); + setFloatOnClick(0, 1000, 2, value, applyPIDd); + } + void onDrawPIDi(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } + void onDrawPIDd(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } + #endif // PID_EDIT_MENU -#endif // PIDTEMPBED && (PID_AUTOTUNE_MENU || PID_EDIT_MENU) +#endif // HAS_PID_HEATING + +#if ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) + + #if ENABLED(PIDTEMP) + + #if ENABLED(PID_AUTOTUNE_MENU) + void hotendPID() { setPID(hmiData.hotendPIDT, H_E0); } + void setHotendPIDT() { setPIntOnClick(MIN_ETEMP, MAX_ETEMP); } + #endif + + void drawHotendPIDMenu() { + checkkey = ID_Menu; + if (SET_MENU_F(hotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { + BACK_ITEM(drawAdvancedSettingsMenu); + #if ENABLED(PID_AUTOTUNE_MENU) + MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID, onDrawMenuItem, hotendPID); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setHotendPIDT, &hmiData.hotendPIDT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPIDCycles, &hmiData.pidCycles); + #endif + #if ENABLED(PID_EDIT_MENU) + EDIT_ITEM_F(ICON_PIDValue, "Set Kp: ", onDrawPFloat2Menu, setKp, &thermalManager.temp_hotend[0].pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set Ki: ", onDrawPIDi, setKi, &thermalManager.temp_hotend[0].pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set Kd: ", onDrawPIDd, setKd, &thermalManager.temp_hotend[0].pid.Kd); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); + #endif + } + updateMenu(hotendPIDMenu); + } + + #endif // PIDTEMP + + #if ENABLED(PIDTEMPBED) + + #if ENABLED(PID_AUTOTUNE_MENU) + void bedPID() { setPID(hmiData.bedPIDT, H_BED); } + void setBedPIDT() { setPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } + #endif + + void drawBedPIDMenu() { + checkkey = ID_Menu; + if (SET_MENU_F(bedPIDMenu, STR_BED_PID " Settings", 8)) { + BACK_ITEM(drawAdvancedSettingsMenu); + #if ENABLED(PID_AUTOTUNE_MENU) + MENU_ITEM_F(ICON_PIDBed, STR_BED_PID, onDrawMenuItem,bedPID); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setBedPIDT, &hmiData.bedPIDT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPIDCycles, &hmiData.pidCycles); + #endif + #if ENABLED(PID_EDIT_MENU) + EDIT_ITEM_F(ICON_PIDValue, "Set Kp: ", onDrawPFloat2Menu, setKp, &thermalManager.temp_bed.pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set Ki: ", onDrawPIDi, setKi, &thermalManager.temp_bed.pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set Kd: ", onDrawPIDd, setKd, &thermalManager.temp_bed.pid.Kd); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); + #endif + } + updateMenu(bedPIDMenu); + } + + #endif // PIDTEMPBED + + #if ENABLED(PIDTEMPCHAMBER) + + #if ENABLED(PID_AUTOTUNE_MENU) + void chamberPID() { setPID(hmiData.chamberPIDT, H_CHAMBER); } + void setChamberPIDT() { setPIntOnClick(MIN_CHAMBERTEMP, MAX_CHAMBERTEMP); } + #endif + + void drawChamberPIDMenu() { + checkkey = ID_Menu; + if (SET_MENU_F(chamberPIDMenu, STR_CHAMBER_PID " Settings", 8)) { + BACK_ITEM(drawAdvancedSettingsMenu); + #if ENABLED(PID_AUTOTUNE_MENU) + MENU_ITEM_F(ICON_PIDChamber, STR_CHAMBER_PID, onDrawMenuItem,chamberPID); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setChamberPIDT, &hmiData.chamberPIDT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPIDCycles, &hmiData.pidCycles); + #endif + #if ENABLED(PID_EDIT_MENU) + EDIT_ITEM_F(ICON_PIDValue, "Set Kp: ", onDrawPFloat2Menu, setKp, &thermalManager.temp_chamber.pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set Ki: ", onDrawPIDi, setKi, &thermalManager.temp_chamber.pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set Kd: ", onDrawPIDd, setKd, &thermalManager.temp_chamber.pid.Kd); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); + #endif + } + updateMenu(chamberPIDMenu); + } + + #endif // PIDTEMPCHAMBER + +#endif // PID_AUTOTUNE_MENU || PID_EDIT_MENU //============================================================================= @@ -3949,7 +4013,7 @@ void drawMaxAccelMenu() { if (SET_MENU(zOffsetWizMenu, MSG_PROBE_WIZARD, 4)) { BACK_ITEM(drawPrepareMenu); MENU_ITEM(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, autoHome); - MENU_ITEM(ICON_MoveZ0, MSG_MOVE_NOZZLE_TO_BED, onDrawMenuItem, setMoveZto0); + MENU_ITEM(ICON_AxisD, MSG_MOVE_NOZZLE_TO_BED, onDrawMenuItem, setMoveZto0); EDIT_ITEM(ICON_Zoffset, MSG_XATC_UPDATE_Z_OFFSET, onDrawPFloat2Menu, setZOffset, &BABY_Z_VAR); } updateMenu(zOffsetWizMenu); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 94b949b5e7..7d264b8b12 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -53,17 +53,16 @@ enum processID : uint8_t { ID_MainMenu, ID_Menu, ID_SetInt, - ID_SetPInt, - ID_SetIntNoDraw, ID_SetFloat, + ID_SetPInt, ID_SetPFloat, + ID_SetIntNoDraw, ID_PrintProcess, ID_Popup, ID_Leveling, ID_Locked, - ID_Reboot, - ID_PrintDone, ID_ESDiagProcess, + ID_PrintDone, ID_WaitResponse, ID_Homing, ID_PIDProcess, @@ -72,12 +71,20 @@ enum processID : uint8_t { ID_NothingToDo }; -#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) +#if ANY(HAS_PID_HEATING, MPC_AUTOTUNE) - enum tempcontrol_t : uint8_t { - #if PROUI_PID_TUNE - PIDTEMP_START, - PIDTEMPBED_START, + enum TempControl { + AUTOTUNE_DONE, + #if HAS_PID_HEATING + #if ENABLED(PIDTEMP) + PIDTEMP_START, + #endif + #if ENABLED(PIDTEMPBED) + PIDTEMPBED_START, + #endif + #if ENABLED(PIDTEMPCHAMBER) + PIDTEMPCHAMBER_START, + #endif PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, @@ -87,9 +94,11 @@ enum processID : uint8_t { MPC_TEMP_ERROR, MPC_INTERRUPTED, #endif - AUTOTUNE_DONE + TEMPCONTROL_COUNT }; + typedef bits_t(TEMPCONTROL_COUNT) tempcontrol_t; + #endif #define DWIN_CHINESE 123 @@ -117,20 +126,23 @@ typedef struct { uint16_t colorCoordinate; // Temperatures - #if PROUI_PID_TUNE + #if HAS_PID_HEATING int16_t pidCycles = DEF_PIDCYCLES; #if ENABLED(PIDTEMP) - int16_t hotendPidT = DEF_HOTENDPIDT; + celsius_t hotendPIDT = DEF_HOTENDPIDT; #endif #if ENABLED(PIDTEMPBED) - int16_t bedPidT = DEF_BEDPIDT; + celsius_t bedPIDT = DEF_BEDPIDT; + #endif + #if ENABLED(PIDTEMPCHAMBER) + celsius_t chamberPIDT = DEF_CHAMBERPIDT; #endif #endif #if ENABLED(PREVENT_COLD_EXTRUSION) - int16_t extMinT = EXTRUDE_MINTEMP; + celsius_t extMinT = EXTRUDE_MINTEMP; #endif #if ENABLED(PREHEAT_BEFORE_LEVELING) - int16_t bedLevT = LEVELING_BED_TEMP; + celsius_t bedLevT = LEVELING_BED_TEMP; #endif #if ENABLED(BAUD_RATE_GCODE) bool baud115K = false; @@ -144,20 +156,19 @@ typedef struct { bool mediaAutoMount = ENABLED(HAS_SD_EXTENDER); #if ALL(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) uint8_t zAfterHoming = DEF_Z_AFTER_HOMING; + #define Z_POST_CLEARANCE hmiData.zAfterHoming #endif #if ALL(LED_CONTROL_MENU, HAS_COLOR_LEDS) LEDColor ledColor = defColorLeds; #endif - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - bool adaptiveStepSmoothing = true; - #endif #if HAS_GCODE_PREVIEW bool enablePreview = true; #endif } hmi_data_t; extern hmi_data_t hmiData; -static constexpr size_t eeprom_data_size = sizeof(hmi_data_t); + +#define EXTUI_EEPROM_DATA_SIZE sizeof(hmi_data_t) typedef struct { int8_t r, g, b; @@ -174,7 +185,7 @@ typedef struct { typedef struct { rgb_t color; // Color - #if ANY(PROUI_PID_TUNE, MPCTEMP) + #if ANY(HAS_PID_HEATING, MPCTEMP) tempcontrol_t tempControl = AUTOTUNE_DONE; #endif uint8_t select = 0; // Auxiliary selector variable @@ -196,8 +207,8 @@ extern hmi_flag_t hmiFlag; extern uint8_t checkkey; // Popups -#if HAS_HOTEND || HAS_HEATED_BED - void dwinPopupTemperature(const bool toohigh); +#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER + void dwinPopupTemperature(const int_fast8_t heater_id, const uint8_t state); #endif #if ENABLED(POWER_LOSS_RECOVERY) void popupPowerLossRecovery(); @@ -288,7 +299,7 @@ void dwinPrintAborted(); #if HAS_FILAMENT_SENSOR void dwinFilamentRunout(const uint8_t extruder); #endif -void dwinPrintHeader(const char *text); +void dwinPrintHeader(const char * const cstr=nullptr); void dwinSetColorDefaults(); void dwinCopySettingsTo(char * const buff); void dwinCopySettingsFrom(const char * const buff); @@ -313,6 +324,11 @@ void dwinRebootScreen(); #if HAS_ESDIAG void drawEndStopDiag(); #endif +#if ALL(PROUI_TUNING_GRAPH, PROUI_ITEM_PLOT) + void dwinDrawPlot(tempcontrol_t result); + void drawHPlot(); + void drawBPlot(); +#endif // Menu drawing functions void drawPrintFileMenu(); @@ -376,28 +392,29 @@ void drawMaxAccelMenu(); #endif // PID -#if PROUI_PID_TUNE +#if HAS_PID_HEATING #include "../../../module/temperature.h" - void dwinStartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); - void dwinPidTuning(tempcontrol_t result); - #if PROUI_TUNING_GRAPH - void dwinDrawPIDMPCPopup(); - #endif -#endif -#if ENABLED(PIDTEMP) - #if ENABLED(PID_AUTOTUNE_MENU) - void hotendPID(); - #endif + void dwinStartM303(const int count, const heater_id_t hid, const celsius_t temp); + void dwinPIDTuning(tempcontrol_t result); #if ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) - void drawHotendPIDMenu(); - #endif -#endif -#if ENABLED(PIDTEMPBED) - #if ENABLED(PID_AUTOTUNE_MENU) - void bedPID(); - #endif - #if ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) - void drawBedPIDMenu(); + #if ENABLED(PIDTEMP) + #if ENABLED(PID_AUTOTUNE_MENU) + void hotendPID(); + #endif + void drawHotendPIDMenu(); + #endif + #if ENABLED(PIDTEMPBED) + #if ENABLED(PID_AUTOTUNE_MENU) + void bedPID(); + #endif + void drawBedPIDMenu(); + #endif + #if ENABLED(PIDTEMPCHAMBER) + #if ENABLED(PID_AUTOTUNE_MENU) + void chamberPID(); + #endif + void drawChamberPIDMenu(); + #endif #endif #endif @@ -410,3 +427,7 @@ void drawMaxAccelMenu(); void dwinMPCTuning(tempcontrol_t result); #endif #endif + +#if PROUI_TUNING_GRAPH + void dwinDrawPIDMPCPopup(); +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index f7026ebc7d..f09d2bd625 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -30,6 +30,10 @@ #include "../../../inc/MarlinConfigPre.h" +//#define TJC_DISPLAY // Enable for TJC display +//#define DACAI_DISPLAY // Enable for DACAI display +//#define TITLE_CENTERED // Center Menu Title Text + #if HAS_MESH #define PROUI_MESH_EDIT // Add a menu to edit mesh points #if ENABLED(PROUI_MESH_EDIT) @@ -96,6 +100,11 @@ #else #define DEF_BEDPIDT 60 #endif +#ifdef PREHEAT_1_TEMP_CHAMBER + #define DEF_CHAMBERPIDT PREHEAT_1_TEMP_CHAMBER +#else + #define DEF_CHAMBERPIDT 0 +#endif #define DEF_PIDCYCLES 5 /** @@ -113,7 +122,7 @@ #if ENABLED(LIN_ADVANCE) #define PROUI_ITEM_ADVK // Tune > Linear Advance #endif -#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH) +#if ANY(HAS_PID_HEATING, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH) #define PROUI_TUNING_GRAPH 1 #endif #if PROUI_TUNING_GRAPH diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 7c71b8fc59..10e5388274 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -52,14 +52,6 @@ void dwinDrawQR(uint8_t QR_Pixel, uint16_t x, uint16_t y, char *string) { dwinSend(i); } -// Draw an Icon with transparent background -// libID: Icon library ID -// picID: Icon ID -// x/y: Upper-left point -void dwinIconShow(uint8_t libID, uint8_t picID, uint16_t x, uint16_t y) { - dwinIconShow(false, false, true, libID, picID, x, y); -} - // Copy area from current virtual display area to current screen // xStart/yStart: Upper-left of virtual area // xEnd/yEnd: Lower-right of virtual area @@ -134,21 +126,25 @@ void dwinWriteToMem(uint8_t mem, uint16_t addr, uint16_t length, uint8_t *data) } } -// Draw an Icon from SRAM without background transparency for DACAI Screens support -void DACAI_ICON_Show(uint16_t x, uint16_t y, uint16_t addr) { - NOMORE(x, DWIN_WIDTH - 1); - NOMORE(y, DWIN_HEIGHT - 1); - size_t i = 0; - dwinByte(i, 0x70); - dwinWord(i, x); - dwinWord(i, y); - dwinWord(i, addr); - dwinSend(i); -} +#if ENABLED(DACAI_DISPLAY) + + // Draw an Icon from SRAM without background transparency for DACAI Screens support + void dacaiIconShow(uint16_t x, uint16_t y, uint16_t addr) { + NOMORE(x, DWIN_WIDTH - 1); + NOMORE(y, DWIN_HEIGHT - 1); + size_t i = 0; + dwinByte(i, 0x70); + dwinWord(i, x); + dwinWord(i, y); + dwinWord(i, addr); + dwinSend(i); + } + +#endif void dwinIconShow(uint16_t x, uint16_t y, uint16_t addr) { #if ENABLED(DACAI_DISPLAY) - DACAI_ICON_Show(x, y, addr); + dacaiIconShow(x, y, addr); #else dwinIconShow(0, 0, 1, x, y, addr); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 453e21a240..41eab78785 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -209,7 +209,7 @@ void DWINUI::drawFloat(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t co // libID: Icon library ID // picID: Icon ID // x/y: Upper-left point -void DWINUI::ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y) { +void DWINUI::iconShow(bool BG, uint8_t icon, uint16_t x, uint16_t y) { const uint8_t libID = ICON TERN_(HAS_CUSTOMICONS, + (icon / 100)); const uint8_t picID = icon TERN_(HAS_CUSTOMICONS, % 100); dwinIconShow(BG, false, !BG, libID, picID, x, y); diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index b0ff00c527..27825b0869 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -36,14 +36,28 @@ #include "dwin_lcd.h" // Extra Icons +#define ICON_Printer_0 93 +#define ICON_Box 200 +#define ICON_Checkbox 201 +#define ICON_Fade 202 +#define ICON_Mesh 203 +#define ICON_Tilt 204 +#define ICON_Brightness 205 +#define ICON_Probe 206 +#define ICON_AxisD 249 +#define ICON_AxisBR 250 +#define ICON_AxisTR 251 +#define ICON_AxisBL 252 +#define ICON_AxisTL 253 +#define ICON_AxisC 254 + #define ICON_BedSizeX ICON_PrintSize #define ICON_BedSizeY ICON_PrintSize #define ICON_BedTramming ICON_SetHome #define ICON_Binary ICON_Contact -#define ICON_BltouchReset ICON_StockConfiguration -#define ICON_Brightness ICON_Motion +#define ICON_BLTouchReset ICON_ResetEEPROM #define ICON_Cancel ICON_StockConfiguration -#define ICON_CustomPreheat ICON_SetEndTemp +#define ICON_CustomPreheat ICON_BedTemp #define ICON_Error ICON_TempTooHigh #define ICON_esDiag ICON_Info #define ICON_ExtrudeMinT ICON_HotendTemp @@ -55,28 +69,27 @@ #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ -#define ICON_HSMode ICON_StockConfiguration +#define ICON_HSMode ICON_MaxAccZ #define ICON_InputShaping ICON_MaxAccelerated #define ICON_JDmm ICON_MaxJerk -#define ICON_Tram ICON_SetEndTemp -#define ICON_Level ICON_HotendTemp -#define ICON_Lock ICON_Cool -#define ICON_ManualMesh ICON_HotendTemp +#define ICON_Level ICON_Mesh +#define ICON_Lock ICON_Checkbox +#define ICON_ManualMesh ICON_Mesh #define ICON_MaxPosX ICON_MoveX #define ICON_MaxPosY ICON_MoveY #define ICON_MaxPosZ ICON_MoveZ -#define ICON_MeshEdit ICON_Homing +#define ICON_MeshEdit ICON_Fade #define ICON_MeshEditX ICON_MoveX #define ICON_MeshEditY ICON_MoveY -#define ICON_MeshEditZ ICON_MoveZ -#define ICON_MeshNext ICON_Axis -#define ICON_MeshPoints ICON_SetEndTemp -#define ICON_MeshReset ICON_StockConfiguration +#define ICON_MeshEditZ ICON_Zoffset +#define ICON_MeshNext ICON_AxisD +#define ICON_MeshPoints ICON_HotendTemp +#define ICON_MeshReset ICON_ResetEEPROM #define ICON_MeshSave ICON_WriteEEPROM -#define ICON_MeshViewer ICON_HotendTemp -#define ICON_MoveZ0 ICON_HotendTemp -#define ICON_Park ICON_Motion -#define ICON_ParkPos ICON_AdvSet +#define ICON_MeshViewer ICON_Mesh +#define ICON_MoveZ0 ICON_CloseMotor +#define ICON_Park ICON_SetHome +#define ICON_ParkPos ICON_AxisC #define ICON_ParkPosX ICON_StepX #define ICON_ParkPosY ICON_StepY #define ICON_ParkPosZ ICON_StepZ @@ -95,18 +108,18 @@ #define ICON_Preheat8 ICON_CustomPreheat #define ICON_Preheat9 ICON_CustomPreheat #define ICON_Preheat10 ICON_CustomPreheat -#define ICON_ProbeDeploy ICON_SetEndTemp +#define ICON_ProbeDeploy ICON_Probe #define ICON_ProbeMargin ICON_PrintSize #define ICON_ProbeSet ICON_SetEndTemp -#define ICON_ProbeStow ICON_SetEndTemp -#define ICON_ProbeTest ICON_SetEndTemp +#define ICON_ProbeStow ICON_Tilt +#define ICON_ProbeTest ICON_Zoffset #define ICON_ProbeZSpeed ICON_MaxSpeedZ #define ICON_Pwrlossr ICON_Motion #define ICON_Reboot ICON_ResetEEPROM #define ICON_Runout ICON_MaxAccE #define ICON_Scolor ICON_MaxSpeed #define ICON_SetBaudRate ICON_Setspeed -#define ICON_SetCustomPreheat ICON_SetEndTemp +#define ICON_SetCustomPreheat ICON_BedTemp #define ICON_SetPreheat1 ICON_SetPLAPreheat #define ICON_SetPreheat2 ICON_SetABSPreheat #define ICON_SetPreheat3 ICON_SetCustomPreheat @@ -125,22 +138,24 @@ #define ICON_TMCYSet ICON_MoveY #define ICON_TMCZSet ICON_MoveZ #define ICON_TMCESet ICON_Extruder -#define ICON_UBLActive ICON_HotendTemp +#define ICON_Tram ICON_Step +#define ICON_UBLActive ICON_Fade #define ICON_UBLSlot ICON_ResetEEPROM #define ICON_UBLMeshSave ICON_WriteEEPROM #define ICON_UBLMeshLoad ICON_ReadEEPROM -#define ICON_UBLTiltGrid ICON_PrintSize #define ICON_UBLSmartFill ICON_StockConfiguration -#define ICON_ZAfterHome ICON_SetEndTemp +#define ICON_UBLTiltGrid ICON_Tilt +#define ICON_ZAfterHome ICON_Tilt +// LED Lights #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion // MPC -#define ICON_MPCNozzle ICON_SetEndTemp +#define ICON_MPCNozzle ICON_HotendTemp #define ICON_MPCValue ICON_Contact #define ICON_MPCHeater ICON_Temperature -#define ICON_MPCHeatCap ICON_SetBedTemp +#define ICON_MPCHeatCap ICON_BedTemp #define ICON_MPCFan ICON_FanSpeed // Buttons @@ -300,20 +315,20 @@ namespace DWINUI { // libID: Icon library ID // picID: Icon ID // x/y: Upper-left point - void ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y); + void iconShow(bool BG, uint8_t icon, uint16_t x, uint16_t y); // Draw an Icon with transparent background from the library ICON // icon: Icon ID // x/y: Upper-left point inline void drawIcon(uint8_t icon, uint16_t x, uint16_t y) { - ICON_Show(false, icon, x, y); + iconShow(false, icon, x, y); } // Draw an Icon from the library ICON with its background // icon: Icon ID // x/y: Upper-left point inline void drawIconWB(uint8_t icon, uint16_t x, uint16_t y) { - ICON_Show(true, icon, x, y); + iconShow(true, icon, x, y); } // Draw a numeric integer value @@ -486,6 +501,9 @@ namespace DWINUI { // y: Upper coordinate of the string // *string: The string void drawCenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string); + inline void drawCenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string) { + drawCenteredString(bShow, fid, color, bColor, 2 * x, 0, y, string); + } inline void drawCenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { drawCenteredString(bShow, fid, color, bColor, 0, DWIN_WIDTH, y, string); } diff --git a/Marlin/src/lcd/e3v2/proui/proui_extui.cpp b/Marlin/src/lcd/e3v2/proui/proui_extui.cpp new file mode 100644 index 0000000000..d377ca5fdc --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/proui_extui.cpp @@ -0,0 +1,246 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/********************* + * proui_extui.cpp * + *********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_LCD_PROUI) + +#include "dwin_popup.h" + +#include "../../extui/ui_api.h" +#include "../../../module/stepper.h" + +#if ENABLED(PREVENT_COLD_EXTRUSION) + #include "../../../module/temperature.h" +#endif + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../feature/powerloss.h" +#endif + +namespace ExtUI { + + void onStartup() { dwinInitScreen(); } + + void onIdle() {} + void onPrinterKilled(FSTR_P const error, FSTR_P const component) {} + + void onMediaInserted() {} + void onMediaError() {} + void onMediaRemoved() {} + + void onHeatingError(const heater_id_t heater_id) { + dwinPopupTemperature(heater_id, 2); // "Heating failed" + } + void onMinTempError(const heater_id_t heater_id) { + dwinPopupTemperature(heater_id, 0); // "Too low" + } + void onMaxTempError(const heater_id_t heater_id) { + dwinPopupTemperature(heater_id, 1); // "Too high" + } + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} + void onPrintTimerStarted() {} + void onPrintTimerPaused() {} + void onPrintTimerStopped() {} + + #if HAS_FILAMENT_SENSOR + void onFilamentRunout(const extruder_t extruder) { + dwinFilamentRunout(extruder); + } + #endif + + void onUserConfirmRequired(const char * const cstr) { + // TODO: A version of this method that takes an icon and button title, + // or implement some kind of ExtUI enum. + onUserConfirmRequired(ICON_Continue_1, cstr, GET_TEXT_F(MSG_USERWAIT)); + } + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + dwinPopupConfirm(icon, cstr, fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + dwinPopupConfirm(icon, fstr, fBtn); + } + + void onStatusChanged(const char * const) { dwinCheckStatusMessage(); } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { + if (mode != PAUSE_MODE_SAME) pause_mode = mode; + switch (message) { + case PAUSE_MESSAGE_PARKING: dwinPopupPause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 + case PAUSE_MESSAGE_CHANGING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) + case PAUSE_MESSAGE_WAITING: dwinPopupPause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; + case PAUSE_MESSAGE_INSERT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break; + case PAUSE_MESSAGE_LOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; + case PAUSE_MESSAGE_UNLOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 + case PAUSE_MESSAGE_PURGE: dwinPopupPause(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; + case PAUSE_MESSAGE_OPTION: gotoFilamentPurge(); break; + case PAUSE_MESSAGE_RESUME: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; + case PAUSE_MESSAGE_HEAT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; + case PAUSE_MESSAGE_HEATING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; + case PAUSE_MESSAGE_STATUS: hmiReturnScreen(); break; // Exit from Pause, Load and Unload + default: break; + } + } + #endif + + void onHomingStart() { dwinHomingStart(); } + void onHomingDone() { dwinHomingDone(); } + + void onPrintDone() {} + + void onFactoryReset() { dwinSetDataDefaults(); } + + // Copy settings to EEPROM buffer for write + void onStoreSettings(char *buff) { dwinCopySettingsTo(buff); } + + // Get settings from loaded EEPROM data + void onLoadSettings(const char *buff) { dwinCopySettingsFrom(buff); } + + void onPostprocessSettings() { + // Called after loading or resetting stored settings + } + + void onSettingsStored(const bool success) { + // Called after the entire EEPROM has been written, + // whether successful or not. + } + + void onSettingsLoaded(const bool success) { + // Called after the entire EEPROM has been read, + // whether successful or not. + } + + #if HAS_LEVELING + void onLevelingStart() { dwinLevelingStart(); } + void onLevelingDone() { dwinLevelingDone(); } + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return hmiData.bedLevT; } + #endif + #endif + + #if HAS_MESH + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { + const int16_t idx = ypos * (GRID_MAX_POINTS_X) + xpos; + dwinMeshUpdate(_MIN(idx, GRID_MAX_POINTS), int(GRID_MAX_POINTS), zval); + dwinRedrawScreen(); + } + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) { + // Called to indicate a special condition + } + #endif + + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t t) { hmiData.extMinT = t; } + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + void onSetPowerLoss(const bool onoff) { + // Called when power-loss is enabled/disabled + } + void onPowerLoss() { + // Called when power-loss state is detected + } + void onPowerLossResume() { + // Called on resume from power-loss + recovery.ui_flag_resume = true; + } + #endif + + #if HAS_PID_HEATING + void onPIDTuning(const pidresult_t rst) { + // Called for temperature PID tuning result + switch (rst) { + #if ENABLED(PIDTEMP) + case PID_STARTED: dwinPIDTuning(PIDTEMP_START); break; + #endif + #if ENABLED(PIDTEMPBED) + case PID_BED_STARTED: dwinPIDTuning(PIDTEMPBED_START); break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PID_CHAMBER_STARTED: dwinPIDTuning(PIDTEMPCHAMBER_START); break; + #endif + case PID_BAD_HEATER_ID: dwinPIDTuning(tempcontrol_t(PID_BAD_HEATER_ID)); break; + case PID_TEMP_TOO_HIGH: dwinPIDTuning(tempcontrol_t(PID_TEMP_TOO_HIGH)); break; + case PID_TUNING_TIMEOUT: dwinPIDTuning(tempcontrol_t(PID_TUNING_TIMEOUT)); break; + case PID_DONE: dwinPIDTuning(AUTOTUNE_DONE); break; + + } + } + + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + dwinStartM303(count, hid, temp); + } + + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + switch (rst) { + case MPC_STARTED: dwinMPCTuning(MPCTEMP_START); break; + case MPC_TEMP_ERROR: dwinMPCTuning(MPC_TEMP_ERROR); break; + case MPC_INTERRUPTED: dwinMPCTuning(MPC_INTERRUPTED); break; + case MPC_DONE: dwinMPCTuning(AUTOTUNE_DONE); break; + } + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() { dwinRebootScreen(); } + #endif + + void onSteppersDisabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t axis) { + set_axis_untrusted(AxisEnum(axis)); // MRISCOC workaround: https://github.com/MarlinFirmware/Marlin/issues/23095 + } + void onAxisEnabled(const axis_t) {} + +} // ExtUI + +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp index 268111b6cb..78a8ffa3a2 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp @@ -49,6 +49,10 @@ namespace ExtUI { void onMediaError() { chiron.mediaEvent(AC_media_error); } void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { #if ENABLED(SPEAKER) ::tone(BEEPER_PIN, frequency, duration); @@ -65,6 +69,26 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg) { chiron.confirmationRequest(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { chiron.statusChange(msg); } void onHomingStart() {} @@ -109,6 +133,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -123,6 +150,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -135,13 +166,28 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // ANYCUBIC_LCD_CHIRON diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp index ef02664dac..79738fab10 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp @@ -43,6 +43,10 @@ namespace ExtUI { void onMediaError() { anycubicTFT.onSDCardError(); } void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration)); } @@ -53,6 +57,26 @@ namespace ExtUI { void onFilamentRunout(const extruder_t extruder) { anycubicTFT.onFilamentRunout(); } void onUserConfirmRequired(const char * const msg) { anycubicTFT.onUserConfirmRequired(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) {} void onHomingStart() {} @@ -99,6 +123,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -111,6 +138,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -124,13 +155,28 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // ANYCUBIC_LCD_I3MEGA diff --git a/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp b/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp index 85e7b28079..1bf13eafa3 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp @@ -49,6 +49,10 @@ namespace ExtUI { void onMediaError() { dgus.mediaEvent(AC_media_error); } void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { #if ENABLED(SPEAKER) ::tone(BEEPER_PIN, frequency, duration); @@ -65,6 +69,26 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg) { dgus.confirmationRequest(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { dgus.statusChange(msg); } void onHomingStart() { dgus.homingStart(); } @@ -113,6 +137,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -137,20 +164,28 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result - switch (rst) { - case PID_STARTED: break; - case PID_BAD_HEATER_ID: break; - case PID_TEMP_TOO_HIGH: break; - case PID_TUNING_TIMEOUT: break; - case PID_DONE: break; - } } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // ANYCUBIC_LCD_VYPER diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index 58aead6984..2bc6e0d461 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -52,6 +52,10 @@ namespace ExtUI { void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} @@ -70,6 +74,26 @@ namespace ExtUI { } } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { screen.setStatusMessage(msg); } void onHomingStart() {} @@ -116,6 +140,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -128,6 +155,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -142,11 +173,12 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result switch (rst) { case PID_STARTED: case PID_BED_STARTED: + case PID_CHAMBER_STARTED: screen.setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case PID_BAD_HEATER_ID: @@ -164,10 +196,40 @@ namespace ExtUI { } screen.gotoScreen(DGUS_SCREEN_MAIN); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + switch (rst) { + case MPC_STARTED: + screen.setStatusMessage(GET_TEXT_F(MSG_MPC_AUTOTUNE)); + break; + case MPC_TEMP_ERROR: + //screen.setStatusMessage(GET_TEXT_F(MSG_MPC_TEMP_ERROR)); + break; + case MPC_INTERRUPTED: + //screen.setStatusMessage(GET_TEXT_F(MSG_MPC_INTERRUPTED)); + break; + case MPC_DONE: + //screen.setStatusMessage(GET_TEXT_F(MSG_MPC_AUTOTUNE_DONE)); + break; + } + screen.gotoScreen(DGUS_SCREEN_MAIN); + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // HAS_DGUS_LCD_CLASSIC diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp index 58313e4333..c88412fe2c 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp @@ -369,7 +369,7 @@ void DGUSScreenHandler::addCurrentPageStringLength(size_t stringLength, size_t t #endif #if HAS_PID_HEATING - void DGUSScreenHandler::pidTuning(const ExtUI::result_t rst) { + void DGUSScreenHandler::pidTuning(const ExtUI::pidresult_t rst) { dgus.playSound(3); } #endif diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h index a5f053043c..2f8c53f14d 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h @@ -132,7 +132,7 @@ public: #endif #if HAS_PID_HEATING - static void pidTuning(const ExtUI::result_t rst); + static void pidTuning(const ExtUI::pidresult_t rst); #endif static void steppersStatusChanged(bool steppersEnabled); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp index 41f5b41d49..f3f4ff961c 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp @@ -59,6 +59,10 @@ namespace ExtUI { void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { screen.playTone(frequency, duration); } @@ -83,6 +87,26 @@ namespace ExtUI { screen.userConfirmRequired(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { screen.setStatusMessage(msg); } @@ -120,6 +144,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() { screen.levelingStart(); } void onLevelingDone() { screen.levelingEnd(); } + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -129,6 +156,10 @@ namespace ExtUI { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -143,10 +174,23 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result screen.pidTuning(rst); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() { @@ -156,6 +200,9 @@ namespace ExtUI { void onSteppersEnabled() { screen.steppersStatusChanged(true); } + + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // DGUS_LCD_UI_RELOADED diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index c953b417a5..b8ef8bcacc 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -598,7 +598,7 @@ void DGUSRxHandler::filamentMove(DGUS_VP &vp, void *data_ptr) { } if (ExtUI::getActualTemp_celsius(extruder) < (float)EXTRUDE_MINTEMP) { - screen.setStatusMessage(GET_TEXT_F(DGUS_MSG_TEMP_TOO_LOW)); + screen.setStatusMessage(GET_TEXT_F(MSG_TEMP_TOO_LOW)); return; } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index aaef68632a..181d1ae34c 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -305,10 +305,11 @@ void DGUSScreenHandler::filamentRunout(const ExtUI::extruder_t extruder) { #if HAS_PID_HEATING - void DGUSScreenHandler::pidTuning(const ExtUI::result_t rst) { + void DGUSScreenHandler::pidTuning(const ExtUI::pidresult_t rst) { switch (rst) { case ExtUI::PID_STARTED: case ExtUI::PID_BED_STARTED: + case ExtUI::PID_CHAMBER_STARTED: setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case ExtUI::PID_BAD_HEATER_ID: diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index 2cffd55e23..ed8b163d87 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -66,7 +66,7 @@ public: #endif #if HAS_PID_HEATING - static void pidTuning(const ExtUI::result_t rst); + static void pidTuning(const ExtUI::pidresult_t rst); #endif static void setMessageLine(const char * const msg, const uint8_t line); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 1c62bee9d5..fad878a212 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -54,6 +54,10 @@ namespace ExtUI { void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { screen.playTone(frequency, duration); } @@ -78,6 +82,26 @@ namespace ExtUI { screen.userConfirmRequired(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { screen.setStatusMessage(msg); } @@ -112,6 +136,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -125,6 +152,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -139,14 +170,29 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result screen.pidTuning(rst); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // DGUS_LCD_UI_RELOADED diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index 7f9ff62de4..fb033b9655 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -52,6 +52,10 @@ namespace ExtUI { void onMediaError() {} void onMediaRemoved() {} + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} @@ -62,6 +66,20 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg) {} + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) {} + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) {} + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) {} void onHomingStart() {} @@ -108,6 +126,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -120,6 +141,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -133,21 +158,43 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result switch (rst) { case PID_STARTED: case PID_BED_STARTED: + case PID_CHAMBER_STARTED: break; case PID_BAD_HEATER_ID: break; case PID_TEMP_TOO_HIGH: break; case PID_TUNING_TIMEOUT: break; case PID_DONE: break; } } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + switch (rst) { + case MPC_STARTED: break; + case MPC_TEMP_ERROR: break; + case MPC_INTERRUPTED: break; + case MPC_DONE: break; + } + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index 0dda4a977d..48c136bd6e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -70,6 +70,10 @@ namespace ExtUI { #endif } + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onStatusChanged(const char *lcd_msg) { StatusScreen::setStatusMessage(lcd_msg); } void onPrintTimerStarted() { @@ -117,9 +121,32 @@ namespace ExtUI { ConfirmUserRequestAlertBox::hide(); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -131,6 +158,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -144,12 +175,13 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result - //SERIAL_ECHOLNPGM("OnPidTuning:", rst); + //SERIAL_ECHOLNPGM("OnPIDTuning:", rst); switch (rst) { case PID_STARTED: case PID_BED_STARTED: + case PID_CHAMBER_STARTED: StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case PID_BAD_HEATER_ID: @@ -167,10 +199,31 @@ namespace ExtUI { } GOTO_SCREEN(StatusScreen); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } #endif // HAS_PID_HEATING + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + switch (rst) { + case MPC_STARTED: + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_MPC_AUTOTUNE)); + break; + } + GOTO_SCREEN(StatusScreen); + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} + #endif + void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // TOUCH_UI_FTDI_EVE diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp index af5d1c7ace..3440cf987d 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp @@ -98,6 +98,10 @@ void onMediaRemoved() { } } +void onHeatingError(const heater_id_t header_id) {} +void onMinTempError(const heater_id_t header_id) {} +void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t, const uint16_t/*=0*/) { rts.sendData(StartSoundSet, SoundAddr); } @@ -228,6 +232,26 @@ void onUserConfirmRequired(const char *const msg) { lastPauseMsgState = ExtUI::pauseModeStatus; } +// For fancy LCDs include an icon ID, message, and translated button title +void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); +} +void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); +} + +#if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } +#endif + void onStatusChanged(const char *const statMsg) { for (int16_t j = 0; j < 20; j++) // Clear old message rts.sendData(' ', StatusMessageString + j); @@ -356,6 +380,10 @@ void onPostprocessSettings() {} } #endif +#if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} +#endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -373,7 +401,7 @@ void onPostprocessSettings() {} #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result rts.sendData(pid_hotendAutoTemp, HotendPID_AutoTmp); rts.sendData(pid_bedAutoTemp, BedPID_AutoTmp); @@ -387,6 +415,19 @@ void onPostprocessSettings() {} #endif onStatusChanged(F("PID Tune Finished")); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } +#endif + +#if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } +#endif + +#if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onHomingStart() {} @@ -396,6 +437,8 @@ void onPrintDone() {} void onSteppersDisabled() {} void onSteppersEnabled() {} +void onAxisDisabled(const axis_t) {} +void onAxisEnabled(const axis_t) {} } // ExtUI diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 15810b67a5..797b80b0d5 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -163,21 +163,10 @@ void RTS::onIdle() { TERN_(HAS_MULTI_HOTEND, rts.sendData(uint8_t(getActiveTool() + 1), ActiveToolVP)); if (awaitingUserConfirm() && (lastPauseMsgState != ExtUI::pauseModeStatus || userConfValidation > 99)) { - switch (ExtUI::pauseModeStatus) { - case PAUSE_MESSAGE_PARKING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; - case PAUSE_MESSAGE_CHANGING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; - case PAUSE_MESSAGE_UNLOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; - case PAUSE_MESSAGE_WAITING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; - case PAUSE_MESSAGE_INSERT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; - case PAUSE_MESSAGE_LOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: ExtUI::onUserConfirmRequired(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; - case PAUSE_MESSAGE_RESUME: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; - case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_OPTION: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; - case PAUSE_MESSAGE_STATUS: break; - default: onUserConfirmRequired(PSTR("Confirm Continue")); break; - } + if (ExtUI::pauseModeStatus < PAUSE_MESSAGE_COUNT) + ui.pause_show_message(ExtUI::pauseModeStatus); + else + ExtUI::onUserConfirmRequired(F("Confirm Continue")); userConfValidation = 0; } else if (pause_resume_selected && !awaitingUserConfirm()) { diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index 00bc173fb3..9287091cfe 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -104,12 +104,13 @@ namespace ExtUI { #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result - //SERIAL_ECHOLNPGM("OnPidTuning:", rst); + //SERIAL_ECHOLNPGM("OnPIDTuning:", rst); switch (rst) { case PID_STARTED: case PID_BED_STARTED: + case PID_CHAMBER_STARTED: set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case PID_BAD_HEATER_ID: @@ -127,6 +128,10 @@ namespace ExtUI { } } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif void onPrintTimerStarted() { write_to_lcd(F("{SYS:BUILD}")); } @@ -140,11 +145,27 @@ namespace ExtUI { void onMediaError() {} void onMediaRemoved() {} + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t, const uint16_t/*=0*/) {} void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const) {} + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) {} + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) {} + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) {} + #endif + void onHomingStart() {} void onHomingDone() {} @@ -160,6 +181,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -167,6 +191,10 @@ namespace ExtUI { void onMeshUpdate(const int8_t, const int8_t, const ExtUI::probe_state_t) {} #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -179,8 +207,20 @@ namespace ExtUI { } #endif + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} + #endif + void onSteppersDisabled() {} void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // MALYAN_LCD diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp index fc86432097..e72167d380 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp @@ -43,6 +43,10 @@ namespace ExtUI { void onMediaError() {} void onMediaRemoved() {} + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} @@ -51,6 +55,26 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg) { nextion.confirmationRequest(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { nextion.statusChange(msg); } void onHomingStart() {} @@ -97,6 +121,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -109,6 +136,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -122,15 +153,29 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result nextion.panelInfo(37); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} void onSteppersEnabled() {} - + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // NEXTION_TFT diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 9d0b7e2723..ec9b05318c 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -106,7 +106,7 @@ #include "../../feature/host_actions.h" #endif -#if M600_PURGE_MORE_RESUMABLE +#if ENABLED(ADVANCED_PAUSE_FEATURE) #include "../../feature/pause.h" #endif @@ -1116,10 +1116,39 @@ namespace ExtUI { } void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } - #if M600_PURGE_MORE_RESUMABLE + #if ENABLED(ADVANCED_PAUSE_FEATURE) void setPauseMenuResponse(PauseMenuResponse response) { pause_menu_response = response; } - PauseMessage pauseModeStatus = PAUSE_MESSAGE_STATUS; PauseMode getPauseMode() { return pause_mode; } + + PauseMessage pauseModeStatus = PAUSE_MESSAGE_STATUS; + + void stdOnPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + if (mode != PAUSE_MODE_SAME) pause_mode = mode; + pauseModeStatus = message; + switch (message) { + case PAUSE_MESSAGE_PARKING: onUserConfirmRequired(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; + case PAUSE_MESSAGE_CHANGING: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; + case PAUSE_MESSAGE_UNLOAD: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; + case PAUSE_MESSAGE_WAITING: onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; + case PAUSE_MESSAGE_INSERT: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; + case PAUSE_MESSAGE_LOAD: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; + case PAUSE_MESSAGE_PURGE: onUserConfirmRequired( + GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE)) + ); + break; + case PAUSE_MESSAGE_RESUME: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; + case PAUSE_MESSAGE_HEAT: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; + case PAUSE_MESSAGE_HEATING: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; + case PAUSE_MESSAGE_OPTION: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; + case PAUSE_MESSAGE_STATUS: break; + default: break; + } + } + #endif void printFile(const char *filename) { @@ -1228,17 +1257,30 @@ namespace ExtUI { // // MarlinUI passthroughs to ExtUI // +#if DISABLED(HAS_DWIN_E3V2) + void MarlinUI::init_lcd() { ExtUI::onStartup(); } -void MarlinUI::init_lcd() { ExtUI::onStartup(); } + void MarlinUI::update() { ExtUI::onIdle(); } -void MarlinUI::update() { ExtUI::onIdle(); } - -void MarlinUI::kill_screen(FSTR_P const error, FSTR_P const component) { - using namespace ExtUI; - if (!flags.printer_killed) { - flags.printer_killed = true; - onPrinterKilled(error, component); + void MarlinUI::kill_screen(FSTR_P const error, FSTR_P const component) { + using namespace ExtUI; + if (!flags.printer_killed) { + flags.printer_killed = true; + onPrinterKilled(error, component); + } } -} +#endif + +#if ENABLED(ADVANCED_PAUSE_FEATURE) + + void MarlinUI::pause_show_message( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + ExtUI::onPauseMode(message, mode, extruder); + } + +#endif #endif // EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index b7d670de13..8202f7be8d 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -46,8 +46,10 @@ #include "../marlinui.h" #include "../../gcode/gcode.h" +#include "../../module/temperature.h" -#if M600_PURGE_MORE_RESUMABLE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #include "../../module/motion.h" #include "../../feature/pause.h" #endif @@ -66,14 +68,12 @@ namespace ExtUI { enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 }; enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER }; enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 }; - enum result_t : uint8_t { - OPTITEM(HAS_PID_HEATING, PID_STARTED) - OPTITEM(HAS_PID_HEATING, PID_BED_STARTED) - OPTITEM(HAS_PID_HEATING, PID_BAD_HEATER_ID) - OPTITEM(HAS_PID_HEATING, PID_TEMP_TOO_HIGH) - OPTITEM(HAS_PID_HEATING, PID_TUNING_TIMEOUT) - OPTITEM(HAS_PID_HEATING, PID_DONE) - }; + #if HAS_PID_HEATING + enum pidresult_t : uint8_t { PID_STARTED, PID_BED_STARTED, PID_CHAMBER_STARTED, PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; + #endif + #if ENABLED(MPC_AUTOTUNE) + enum mpcresult_t : uint8_t { MPC_STARTED, MPC_TEMP_ERROR, MPC_INTERRUPTED, MPC_DONE }; + #endif constexpr uint8_t extruderCount = EXTRUDERS; constexpr uint8_t hotendCount = HOTENDS; @@ -234,6 +234,9 @@ namespace ExtUI { bool getLevelingIsValid(); void onLevelingStart(); void onLevelingDone(); + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp(); + #endif #if HAS_MESH // Mesh data, utilities, events bed_mesh_t& getMeshArray(); @@ -312,10 +315,9 @@ namespace ExtUI { bool awaitingUserConfirm(); void setUserConfirmed(); - #if M600_PURGE_MORE_RESUMABLE + #if ENABLED(ADVANCED_PAUSE_FEATURE) // "Purge More" has a control screen void setPauseMenuResponse(PauseMenuResponse); - extern PauseMessage pauseModeStatus; PauseMode getPauseMode(); #endif @@ -488,6 +490,10 @@ namespace ExtUI { void onMediaError(); void onMediaRemoved(); + void onHeatingError(const heater_id_t header_id); + void onMinTempError(const heater_id_t header_id); + void onMaxTempError(const heater_id_t header_id); + void onPlayTone(const uint16_t frequency, const uint16_t duration=0); void onPrinterKilled(FSTR_P const error, FSTR_P const component); @@ -503,6 +509,17 @@ namespace ExtUI { void onUserConfirmRequired(const char * const msg); void onUserConfirmRequired(FSTR_P const fstr); + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn); + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn); + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + // Standard stdOnPauseMode sets pauseModeStatus and calls onUserConfirmRequired + extern PauseMessage pauseModeStatus; + void stdOnPauseMode(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); + void onPauseMode(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); + #endif + void onStatusChanged(const char * const msg); void onStatusChanged(FSTR_P const fstr); @@ -511,6 +528,8 @@ namespace ExtUI { void onSteppersDisabled(); void onSteppersEnabled(); + void onAxisDisabled(const axis_t axis); + void onAxisEnabled(const axis_t axis); void onFactoryReset(); void onStoreSettings(char *); @@ -519,13 +538,23 @@ namespace ExtUI { void onSettingsStored(const bool success); void onSettingsLoaded(const bool success); + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t t); + #endif #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff); void onPowerLoss(); void onPowerLossResume(); #endif #if HAS_PID_HEATING - void onPIDTuning(const result_t rst); + void onPIDTuning(const pidresult_t rst); + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp); + #endif + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst); + #endif + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash(); #endif }; diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 2ea52c2ccf..1ecf65a57f 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -360,8 +360,17 @@ namespace LanguageNarrow_en { LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Autotune failed!"); + LSTR MSG_PID_FOR_NOZZLE = _UxGT("for Nozzle is running."); + LSTR MSG_PID_FOR_BED = _UxGT("for BED is running."); + LSTR MSG_PID_FOR_CHAMBER = _UxGT("for CHAMBER is running."); + + LSTR MSG_TEMP_NOZZLE = _UxGT("Nozzle Temperature"); + LSTR MSG_TEMP_BED = _UxGT("Bed Temperature"); + LSTR MSG_TEMP_CHAMBER = _UxGT("Chamber Temperature"); + LSTR MSG_BAD_HEATER_ID = _UxGT("Bad extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperature too high."); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperature too low"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); @@ -841,7 +850,7 @@ namespace LanguageNarrow_en { LSTR MSG_XATC = _UxGT("X-Twist Wizard"); LSTR MSG_XATC_DONE = _UxGT("X-Twist Wizard Done!"); - LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Update Probe Z-Offset to "); + LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Update Z-Offset to "); LSTR MSG_SOUND = _UxGT("Sound"); @@ -881,7 +890,6 @@ namespace LanguageNarrow_en { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Not allowed during print"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Not allowed while idle"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("No file selected"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperature too low"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Executing command..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Bed PID disabled"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID disabled"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 52bbd7fac3..09e7f94917 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -263,6 +263,8 @@ namespace LanguageNarrow_fr { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); + LSTR MSG_SELECT_E = _UxGT("Sélectionner *"); LSTR MSG_ACC = _UxGT("Accélération"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -598,7 +600,6 @@ namespace LanguageNarrow_fr { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Impossible pendant une impression"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Impossible tant que l'imprimante est en attente"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Aucun fichier selectionne"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Execution de la commande..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Bed PID desactive"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID desactive"); diff --git a/Marlin/src/lcd/language/language_fr_na.h b/Marlin/src/lcd/language/language_fr_na.h index 98302af61c..dc31af4fcb 100644 --- a/Marlin/src/lcd/language/language_fr_na.h +++ b/Marlin/src/lcd/language/language_fr_na.h @@ -263,6 +263,8 @@ namespace LanguageNarrow_fr_na { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Oper. expiree"); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); + LSTR MSG_SELECT_E = _UxGT("Selectionner *"); LSTR MSG_ACC = _UxGT("Acceleration"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -601,7 +603,6 @@ namespace LanguageNarrow_fr_na { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Impossible pendant une impression"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Impossible tant que l'imprimante est en attente"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Aucun fichier selectionne"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Execution de la commande..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Bed PID desactive"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID desactive"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 08b048eadd..7a4f17d49b 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -849,7 +849,6 @@ namespace LanguageNarrow_it { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Non ammesso durante la stampa"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Non ammesso mentre è in riposo"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Nessun file selezionato"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperatura troppo bassa"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Esecuzione del comando..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("PID piatto disabilitato"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID disabilitato"); @@ -888,6 +887,7 @@ namespace LanguageWide_it { LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperatura troppo bassa"); #endif } diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 23aefff2f7..1a335bac3a 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -351,6 +351,7 @@ namespace LanguageNarrow_tr { LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Kalibrasyon başarısız!"); LSTR MSG_BAD_HEATER_ID = _UxGT("Kötü ekstruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Sıcaklık çok yüksek."); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Sıcaklık çok düşük"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Kalibrasyon başarısız! Kötü ekstruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Kalibrasyon başarısız! Sıcaklık çok yüksek."); LSTR MSG_PID_TIMEOUT = _UxGT("Kalibrasyon başarısız! Zaman aşımı."); @@ -867,7 +868,6 @@ namespace LanguageNarrow_tr { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Yazdırma sırasında izin verilmez"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Boştayken izin verilmez"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Seçili dosya yok"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Sıcaklık çok düşük"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Komut yürütülüyor..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Tabla PID pasif"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID devre dışı"); diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 4eed5f3c65..aaa8fb65e8 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -48,8 +48,6 @@ MarlinUI ui; #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "e3v2/jyersui/dwin.h" #endif @@ -69,7 +67,7 @@ MarlinUI ui; constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if HAS_STATUS_MESSAGE - #if ENABLED(STATUS_MESSAGE_SCROLLING) && ANY(HAS_WIRED_LCD, DWIN_LCD_PROUI) + #if ENABLED(STATUS_MESSAGE_SCROLLING) uint8_t MarlinUI::status_scroll_offset; // = 0 #endif MString MarlinUI::status_message; @@ -1490,7 +1488,7 @@ void MarlinUI::host_notify(const char * const cstr) { else if (!no_welcome) msg = GET_TEXT_F(WELCOME_MSG); - else if (ENABLED(DWIN_LCD_PROUI)) + else if (ENABLED(STATUS_DO_CLEAR_EMPTY)) msg = F(""); else return; @@ -1609,7 +1607,6 @@ void MarlinUI::host_notify(const char * const cstr) { TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); TERN_(DWIN_CREALITY_LCD, dwinStatusChanged(status_message)); - TERN_(DWIN_LCD_PROUI, dwinCheckStatusMessage()); TERN_(DWIN_CREALITY_LCD_JYERSUI, jyersDWIN.updateStatus(status_message)); } @@ -1888,36 +1885,6 @@ void MarlinUI::host_notify(const char * const cstr) { #endif -#if ALL(EXTENSIBLE_UI, ADVANCED_PAUSE_FEATURE) - - void MarlinUI::pause_show_message( - const PauseMessage message, - const PauseMode mode/*=PAUSE_MODE_SAME*/, - const uint8_t extruder/*=active_extruder*/ - ) { - if (mode != PAUSE_MODE_SAME) pause_mode = mode; - ExtUI::pauseModeStatus = message; - switch (message) { - case PAUSE_MESSAGE_PARKING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; - case PAUSE_MESSAGE_CHANGING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; - case PAUSE_MESSAGE_UNLOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; - case PAUSE_MESSAGE_WAITING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; - case PAUSE_MESSAGE_INSERT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; - case PAUSE_MESSAGE_LOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: - ExtUI::onUserConfirmRequired(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); - break; - case PAUSE_MESSAGE_RESUME: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; - case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_OPTION: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; - case PAUSE_MESSAGE_STATUS: break; - default: break; - } - } - -#endif - #if ENABLED(EEPROM_SETTINGS) #if HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 3388c2047b..f21d2565be 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -53,6 +53,10 @@ #include "e3v2/proui/dwin.h" #endif +#if ALL(HAS_STATUS_MESSAGE, IS_DWIN_MARLINUI) + #include "e3v2/marlinui/marlinui_dwin.h" // for LCD_WIDTH +#endif + typedef bool (*statusResetFunc_t)(); #if HAS_WIRED_LCD @@ -753,7 +757,7 @@ public: static bool use_click() { return false; } #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); #else static void _pause_show_message() {} diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index c7558db43f..f9748871f5 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -31,7 +31,7 @@ #include "../inc/MarlinConfig.h" #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #include "../lcd/e3v2/proui/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" // for Z_POST_CLEARANCE #endif #if IS_SCARA @@ -413,12 +413,12 @@ void remember_feedrate_scaling_off(); void restore_feedrate_and_scaling(); #if HAS_Z_AXIS - #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #define Z_POST_CLEARANCE hmiData.zAfterHoming - #elif defined(Z_AFTER_HOMING) - #define Z_POST_CLEARANCE Z_AFTER_HOMING - #else - #define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING + #ifndef Z_POST_CLEARANCE // May be set by proui/dwin.h :-P + #ifdef Z_AFTER_HOMING + #define Z_POST_CLEARANCE Z_AFTER_HOMING + #else + #define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING + #endif #endif void do_z_clearance(const_float_t zclear, const bool with_probe=true, const bool lower_allowed=false); void do_z_clearance_by(const_float_t zclear); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 2fec098b8a..342ce2bb3a 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -96,8 +96,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin_popup.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -376,8 +374,11 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { #endif TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(ds_fstr)); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(ds_fstr)); - TERN_(DWIN_LCD_PROUI, dwinPopupConfirm(ICON_BLTouch, ds_fstr, FPSTR(CONTINUE_STR))); + #if ENABLED(DWIN_LCD_PROUI) + ExtUI::onUserConfirmRequired(ICON_BLTouch, ds_fstr, FPSTR(CONTINUE_STR)); + #elif ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired(ds_fstr); + #endif TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); ui.reset_status(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index b382f80d51..4880013862 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -75,11 +75,13 @@ #include "../feature/z_stepper_align.h" #endif -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) +#if ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #include "../lcd/e3v2/proui/bedlevel_tools.h" +#endif + +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../lcd/e3v2/jyersui/dwin.h" #endif @@ -490,6 +492,13 @@ typedef struct SettingsDataStruct { #endif uint32_t motor_current_setting[MOTOR_CURRENT_COUNT]; // M907 X Z E ... + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + bool adaptive_step_smoothing_enabled; // G-code pending + #endif + // // CNC_COORDINATE_SYSTEMS // @@ -537,9 +546,7 @@ typedef struct SettingsDataStruct { // // Ender-3 V2 DWIN // - #if ENABLED(DWIN_LCD_PROUI) - uint8_t dwin_data[eeprom_data_size]; - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) uint8_t dwin_settings[jyersDWIN.eeprom_data_size]; #endif @@ -1530,6 +1537,14 @@ void MarlinSettings::postprocess() { #endif } + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + _FIELD_TEST(adaptive_step_smoothing_enabled); + EEPROM_WRITE(stepper.adaptive_step_smoothing_enabled); + #endif + // // CNC Coordinate Systems // @@ -1606,17 +1621,8 @@ void MarlinSettings::postprocess() { #endif // - // Creality DWIN User Data + // JyersUI DWIN User Data // - #if ENABLED(DWIN_LCD_PROUI) - { - _FIELD_TEST(dwin_data); - char dwin_data[eeprom_data_size] = { 0 }; - dwinCopySettingsTo(dwin_data); - EEPROM_WRITE(dwin_data); - } - #endif - #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) { _FIELD_TEST(dwin_settings); @@ -2599,6 +2605,13 @@ void MarlinSettings::postprocess() { #endif } + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + EEPROM_READ(stepper.adaptive_step_smoothing_enabled); + #endif + // // CNC Coordinate System // @@ -2690,16 +2703,9 @@ void MarlinSettings::postprocess() { #endif // - // DWIN User Data + // JyersUI User Data // - #if ENABLED(DWIN_LCD_PROUI) - { - const char dwin_data[eeprom_data_size] = { 0 }; - _FIELD_TEST(dwin_data); - EEPROM_READ(dwin_data); - if (!validating) dwinCopySettingsFrom(dwin_data); - } - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) { const char dwin_settings[jyersDWIN.eeprom_data_size] = { 0 }; _FIELD_TEST(dwin_settings); @@ -3544,6 +3550,13 @@ void MarlinSettings::reset() { DEBUG_ECHOLNPGM("Digipot Written"); #endif + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + stepper.adaptive_step_smoothing_enabled = true; + #endif + // // CNC Coordinate System // @@ -3589,11 +3602,6 @@ void MarlinSettings::reset() { // TERN_(DGUS_LCD_UI_MKS, MKS_reset_settings()); - // - // Ender-3 V2 with ProUI - // - TERN_(DWIN_LCD_PROUI, dwinSetDataDefaults()); - // // Model predictive control // diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 851fa452e7..803c14d73c 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -204,6 +204,11 @@ uint32_t Stepper::acceleration_time, Stepper::deceleration_time; #endif #if ENABLED(ADAPTIVE_STEP_SMOOTHING) + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + bool Stepper::adaptive_step_smoothing_enabled; // Initialized by settings.load() + #else + constexpr bool Stepper::adaptive_step_smoothing_enabled; // = true + #endif // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis uint8_t Stepper::oversampling_factor; #else @@ -547,6 +552,8 @@ void Stepper::enable_axis(const AxisEnum axis) { default: break; } mark_axis_enabled(axis); + + TERN_(EXTENSIBLE_UI, ExtUI::onAxisEnabled(ExtUI::axis_to_axis_t(axis))); } /** @@ -567,7 +574,8 @@ void Stepper::enable_axis(const AxisEnum axis) { bool Stepper::disable_axis(const AxisEnum axis) { mark_axis_disabled(axis); - TERN_(DWIN_LCD_PROUI, set_axis_untrusted(axis)); // MRISCOC workaround: https://github.com/MarlinFirmware/Marlin/issues/23095 + // This scheme prevents shared steppers being disabled. It should consider several axes at once + // and keep a count of how many times each ENA pin has been set. // If all the axes that share the enabled bit are disabled const bool can_disable = can_axis_disable(axis); @@ -577,6 +585,7 @@ bool Stepper::disable_axis(const AxisEnum axis) { MAIN_AXIS_MAP(_CASE_DISABLE) default: break; } + TERN_(EXTENSIBLE_UI, ExtUI::onAxisDisabled(ExtUI::axis_to_axis_t(axis))); } return can_disable; @@ -2640,7 +2649,7 @@ hal_timer_t Stepper::block_phase_isr() { oversampling_factor = TERN(NONLINEAR_EXTRUSION, 1, 0); // Decide if axis smoothing is possible - if (TERN1(DWIN_LCD_PROUI, hmiData.adaptiveStepSmoothing)) { + if (stepper.adaptive_step_smoothing_enabled) { uint32_t max_rate = current_block->nominal_rate; // Get the step event rate while (max_rate < MIN_STEP_ISR_FREQUENCY) { // As long as more ISRs are possible... max_rate <<= 1; // Try to double the rate diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 8c13831d9e..6712198aae 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -336,6 +336,12 @@ class Stepper { static ne_coeff_t ne; #endif + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + static bool adaptive_step_smoothing_enabled; + #else + static constexpr bool adaptive_step_smoothing_enabled = true; + #endif + private: static block_t* current_block; // A pointer to the block currently being traced diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 53b9f37fb2..a1fe14c75d 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -52,8 +52,6 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(EXTENSIBLE_UI) @@ -723,13 +721,11 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(HAS_FAN_LOGIC, fan_update_ms = next_temp_ms + fan_update_interval_ms); - TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_STARTED)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ischamber ? ExtUI::pidresult_t::PID_CHAMBER_STARTED : isbed ? ExtUI::pidresult_t::PID_BED_STARTED : ExtUI::pidresult_t::PID_STARTED)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, hotend_max_target(heater_id))) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); - TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TEMP_TOO_HIGH)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); return; } @@ -822,8 +818,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); - TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TEMP_TOO_HIGH)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); break; } @@ -860,8 +855,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if ((ms - _MIN(t1, t2)) > MIN_TO_MS(PID_AUTOTUNE_MAX_CYCLE_MINS)) { TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TUNING_TIMEOUT)); - TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_TUNING_TIMEOUT)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); break; @@ -919,8 +913,7 @@ volatile bool Temperature::raw_temps_ready = false; EXIT_M303: TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPIDTuningDone(oldcolor)); - TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::result_t::PID_DONE)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(AUTOTUNE_DONE)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_DONE)); TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); return; } @@ -1137,7 +1130,7 @@ volatile bool Temperature::raw_temps_ready = false; // Ensure we don't drift too far from the window between the last sampled temp and the target temperature if (!WITHIN(current_temp, get_sample_3_temp() - 15.0f, hotend.target + 15.0f)) { SERIAL_ECHOLNPGM(STR_MPC_TEMPERATURE_ERROR); - TERN_(DWIN_LCD_PROUI, dwinMPCTuning(MPC_TEMP_ERROR)); + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_TEMP_ERROR)); wait_for_heatup = false; return FAILED; } @@ -1175,7 +1168,7 @@ volatile bool Temperature::raw_temps_ready = false; if (!wait_for_heatup) { SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); - TERN_(DWIN_LCD_PROUI, dwinMPCTuning(MPC_INTERRUPTED)); + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_INTERRUPTED)); return MeasurementState::CANCELLED; } @@ -1202,12 +1195,8 @@ volatile bool Temperature::raw_temps_ready = false; // Determine ambient temperature. SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); - #if ENABLED(DWIN_LCD_PROUI) - dwinMPCTuning(MPCTEMP_START); - LCD_ALERTMESSAGE(MSG_MPC_COOLING_TO_AMBIENT); - #else - LCD_MESSAGE(MSG_COOLING); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPCTEMP_START)); + TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_COOLING_TO_AMBIENT), LCD_MESSAGE(MSG_COOLING)); if (tuner.measure_ambient_temp() != MPC_autotuner::MeasurementState::SUCCESS) return; hotend.modeled_ambient_temp = tuner.get_ambient_temp(); @@ -1293,7 +1282,7 @@ volatile bool Temperature::raw_temps_ready = false; } SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); - TERN_(DWIN_LCD_PROUI, dwinMPCTuning(AUTOTUNE_DONE)); + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_DONE)); SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", mpc.block_heat_capacity); SERIAL_ECHOLNPGM("MPC_SENSOR_RESPONSIVENESS ", p_float_t(mpc.sensor_responsiveness, 4)); @@ -1532,15 +1521,17 @@ void Temperature::_temp_error( } void Temperature::maxtemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)) { - #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) - dwinPopupTemperature(1); + #if HAS_HOTEND || HAS_HEATED_BED + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(1)); + TERN_(EXTENSIBLE_UI, ExtUI::onMaxTempError(heater_id)); #endif _TEMP_ERROR(heater_id, F(STR_T_MAXTEMP), MSG_ERR_MAXTEMP, deg); } void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)) { - #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) - dwinPopupTemperature(0); + #if HAS_HOTEND || HAS_HEATED_BED + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onMinTempError(heater_id)); #endif _TEMP_ERROR(heater_id, F(STR_T_MINTEMP), MSG_ERR_MINTEMP, deg); } @@ -1765,7 +1756,8 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_hotend[e].check(temp)) // Increased enough? start_watching_hotend(e); // If temp reached, turn off elapsed check else { - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(e)); _TEMP_ERROR(e, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, temp); } } @@ -1795,7 +1787,8 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_bed.check(deg)) // Increased enough? start_watching_bed(); // If temp reached, turn off elapsed check else { - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(H_BED)); _TEMP_ERROR(H_BED, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, deg); } } @@ -3247,13 +3240,15 @@ void Temperature::init() { } // fall through case TRRunaway: - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(heater_id)); _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_ERR_THERMAL_RUNAWAY, current); break; #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) case TRMalfunction: - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(heater_id)); _TEMP_ERROR(heater_id, F(STR_T_THERMAL_MALFUNCTION), MSG_ERR_TEMP_MALFUNCTION, current); break; #endif diff --git a/buildroot/share/dwin/bin/DWIN_ICO.py b/buildroot/share/dwin/bin/DWIN_ICO.py index 436a98701d..4594e55017 100644 --- a/buildroot/share/dwin/bin/DWIN_ICO.py +++ b/buildroot/share/dwin/bin/DWIN_ICO.py @@ -76,23 +76,19 @@ class DWIN_ICO_File(): self._parseHeader(infile) self._splitEntryData(infile, outDir) - return - def _parseHeader(self, infile): maxEntries = 256 count = 0 - validEntries = 0 + icon_nums = _iconNames.keys() while count < maxEntries: rawBytes = infile.read(16) entry = Entry() entry.parseRawData(rawBytes) # check that it is valid: is offset nonzero? - # Special case: treat 39 as valid - if (entry.offset > 0) or (count == 39): - validEntries += 1 + # Special case: treat missing numbers as valid + if (entry.offset > 0) or count not in icon_nums: self.entries.append(entry) count += 1 - return def _splitEntryData(self, infile, outDir): print('Splitting Entry Data...') @@ -110,18 +106,16 @@ class DWIN_ICO_File(): if entry.length == 0: count += 1 continue - # Seek file position, read length bytes, and write to new output file. - print('%02d: offset: 0x%06x len: 0x%04x width: %d height: %d' % - (count, entry.offset, entry.length, entry.width, entry.height)) - outfilename = os.path.join(outDir, '%03d-ICON_%s.jpg' % (count, _iconNames7[count])) + outfilename = os.path.join(outDir, '%03d-ICON_%s.jpg' % (count, _iconNames.get(count, "UNKNOWN"))) with open(outfilename, 'wb') as outfile: infile.seek(entry.offset) blob = infile.read(entry.length) outfile.write(blob) - print('Wrote %d bytes to %s' % (entry.length, outfilename)) + # Seek file position, read length bytes, and write to new output file. + print('(%3d: width=%3d height=%3d offset=%6d len=%4d) ... %s' % + (count, entry.width, entry.height, entry.offset, entry.length, os.path.basename(outfilename))) count += 1 - return def createFile(self, iconDir, filename): '''Create a new .ico file from the contents of iconDir. @@ -179,7 +173,6 @@ class DWIN_ICO_File(): offset += e.length #print('%03d: (%d x %d) len=%d off=%d' % # (i, e.width, e.height, e.length, e.offset)) - return def _combineAndWriteIcoFile(self, filename): """Write out final .ico file. @@ -198,7 +191,6 @@ class DWIN_ICO_File(): if 0 == e.length: continue guts = self._getFileContents(e.filename, e.length) outfile.write(guts) - return def _getFileContents(self, filename, length): """Read contents of filename, and return bytes""" @@ -232,7 +224,6 @@ class Entry(): self.height = h self.offset = off self.length = len3 * 65536 + len21 - return def serialize(self): """Convert this Entry's information into a 16-byte @@ -245,97 +236,112 @@ class Entry(): 0, 0, 0, 0, 0) return rawdata -_iconNames7 = { - 0 : "LOGO_Creality", - 1 : "Print_0", - 2 : "Print_1", - 3 : "Prepare_0", - 4 : "Prepare_1", - 5 : "Control_0", - 6 : "Control_1", - 7 : "Leveling_0", - 8 : "Leveling_1", - 9 : "HotendTemp", - 10 : "BedTemp", - 11 : "Speed", - 12 : "Zoffset", - 13 : "Back", - 14 : "File", - 15 : "PrintTime", - 16 : "RemainTime", - 17 : "Setup_0", - 18 : "Setup_1", - 19 : "Pause_0", - 20 : "Pause_1", - 21 : "Continue_0", - 22 : "Continue_1", - 23 : "Stop_0", - 24 : "Stop_1", - 25 : "Bar", - 26 : "More", - 27 : "Axis", - 28 : "CloseMotor", - 29 : "Homing", - 30 : "SetHome", - 31 : "PLAPreheat", - 32 : "ABSPreheat", - 33 : "Cool", - 34 : "Language", - 35 : "MoveX", - 36 : "MoveY", - 37 : "MoveZ", - 38 : "Extruder", - # Skip 39 - 40 : "Temperature", - 41 : "Motion", - 42 : "WriteEEPROM", - 43 : "ReadEEPROM", - 44 : "ResetEEPROM", - 45 : "Info", - 46 : "SetEndTemp", - 47 : "SetBedTemp", - 48 : "FanSpeed", - 49 : "SetPLAPreheat", - 50 : "SetABSPreheat", - 51 : "MaxSpeed", - 52 : "MaxAccelerated", - 53 : "MaxJerk", - 54 : "Step", - 55 : "PrintSize", - 56 : "Version", - 57 : "Contact", - 58 : "StockConfiguraton", - 59 : "MaxSpeedX", - 60 : "MaxSpeedY", - 61 : "MaxSpeedZ", - 62 : "MaxSpeedE", - 63 : "MaxAccX", - 64 : "MaxAccY", - 65 : "MaxAccZ", - 66 : "MaxAccE", - 67 : "MaxSpeedJerkX", - 68 : "MaxSpeedJerkY", - 69 : "MaxSpeedJerkZ", - 70 : "MaxSpeedJerkE", - 71 : "StepX", - 72 : "StepY", - 73 : "StepZ", - 74 : "StepE", - 75 : "Setspeed", - 76 : "SetZOffset", - 77 : "Rectangle", - 78 : "BLTouch", - 79 : "TempTooLow", - 80 : "AutoLeveling", - 81 : "TempTooHigh", - 82 : "NoTips_C", - 83 : "NoTips_E", - 84 : "Continue_C", - 85 : "Continue_E", - 86 : "Cancel_C", - 87 : "Cancel_E", - 88 : "Confirm_C", - 89 : "Confirm_E", - 90 : "Info_0", - 91 : "Info_1" +_iconNames = { + 0 : "LOGO_Creality", + 1 : "Print_0", + 2 : "Print_1", + 3 : "Prepare_0", + 4 : "Prepare_1", + 5 : "Control_0", + 6 : "Control_1", + 7 : "Leveling_0", + 8 : "Leveling_1", + 9 : "HotendTemp", + 10 : "BedTemp", + 11 : "Speed", + 12 : "Zoffset", + 13 : "Back", + 14 : "File", + 15 : "PrintTime", + 16 : "RemainTime", + 17 : "Setup_0", + 18 : "Setup_1", + 19 : "Pause_0", + 20 : "Pause_1", + 21 : "Continue_0", + 22 : "Continue_1", + 23 : "Stop_0", + 24 : "Stop_1", + 25 : "Bar", + 26 : "More", + 27 : "Axis", + 28 : "CloseMotor", + 29 : "Homing", + 30 : "SetHome", + 31 : "PLAPreheat", + 32 : "ABSPreheat", + 33 : "Cool", + 34 : "Language", + 35 : "MoveX", + 36 : "MoveY", + 37 : "MoveZ", + 38 : "Extruder", + # Skip 39 + 40 : "Temperature", + 41 : "Motion", + 42 : "WriteEEPROM", + 43 : "ReadEEPROM", + 44 : "ResetEEPROM", + 45 : "Info", + 46 : "SetEndTemp", + 47 : "SetBedTemp", + 48 : "FanSpeed", + 49 : "SetPLAPreheat", + 50 : "SetABSPreheat", + 51 : "MaxSpeed", + 52 : "MaxAccelerated", + 53 : "MaxJerk", + 54 : "Step", + 55 : "PrintSize", + 56 : "Version", + 57 : "Contact", + 58 : "StockConfiguraton", + 59 : "MaxSpeedX", + 60 : "MaxSpeedY", + 61 : "MaxSpeedZ", + 62 : "MaxSpeedE", + 63 : "MaxAccX", + 64 : "MaxAccY", + 65 : "MaxAccZ", + 66 : "MaxAccE", + 67 : "MaxSpeedJerkX", + 68 : "MaxSpeedJerkY", + 69 : "MaxSpeedJerkZ", + 70 : "MaxSpeedJerkE", + 71 : "StepX", + 72 : "StepY", + 73 : "StepZ", + 74 : "StepE", + 75 : "Setspeed", + 76 : "SetZOffset", + 77 : "Rectangle", + 78 : "BLTouch", + 79 : "TempTooLow", + 80 : "AutoLeveling", + 81 : "TempTooHigh", + 82 : "NoTips_C", + 83 : "NoTips_E", + 84 : "Continue_C", + 85 : "Continue_E", + 86 : "Cancel_C", + 87 : "Cancel_E", + 88 : "Confirm_C", + 89 : "Confirm_E", + 90 : "Info_0", + 91 : "Info_1", + 92 : "DegreesC", + 93 : "Printer_0", + 200 : "Checkbox_F", + 201 : "Checkbox_T", + 202 : "Fade", + 203 : "Mesh", + 204 : "Tilt", + 205 : "Brightness", + 206 : "Probe", + 249 : "AxisD", + 250 : "AxisBR", + 251 : "AxisTR", + 252 : "AxisBL", + 253 : "AxisTL", + 254 : "AxisC" } diff --git a/buildroot/share/dwin/bin/README.md b/buildroot/share/dwin/bin/README.md index a00d679bf8..c78f4eb97f 100644 --- a/buildroot/share/dwin/bin/README.md +++ b/buildroot/share/dwin/bin/README.md @@ -4,7 +4,7 @@ Tools for processing `.ICO` files used by DWIN displays. ## Introduction -The DWIN LCDs that come with the Creality Ender-3 v2 and other 3D printers contain image and container files stored on them which are used to draw various the UI elements. +The DWIN LCDs that come with the Creality Ender-3 V2 and other 3D printers contain image and container files stored on them which are used to draw various the UI elements. Standard `.JPG` files can be installed for things like the boot screen, and `.ICO` files can contain several images within a structured file format. @@ -48,9 +48,11 @@ Pillow is most easily installed with pip: These tools process an `.ICO` file that you specify. The safest method is to create a folder and copy your `.ICO` file there. For example: +``` $ mkdir hackicons - $ cp 9.ICO hackicons + $ cp 7.ICO hackicons $ cd hackicons +``` The following explanations will refer back to this layout. @@ -58,35 +60,68 @@ The following explanations will refer back to this layout. If you want to edit the individual icons stored in an ICO file (or add more images) you'll first need to extract all the images from the archive using `splitIco.py`. -**Usage:** `splitIco.py #.ICO foldername`. +#### Usage: +``` +splitIco.py #.ICO foldername +``` -**Example:** +#### Splitting .ICO FIle In Windows: +- Create `Split-ICO.bat` file in this folder with the following code: + - `for /f %%f in ('dir *.ICO /B /O:-D') do splitico.py %%f %%f-icons` +- Paste `.ICO` file into this folder +- Run `Split-ICO.bat` +- A new folder should appear containing all icons -In this example we're extracting the constituent JPEG files from `9.ICO` and storing them in a folder named `icons`. As each file is extracted the script reports its index number, byte offset, size, dimensions, and filename: +#### Example: - $ cd buildroot/share/dwin - $ ./bin/splitIco.py 9.ICO icons-9 - Splitting 9.ICO into dir icons - Splitting Entry Data... - 00: offset: 0x001000 len: 0x10a2 width: 130 height: 17 - Wrote 4258 bytes to icons/000-ICON_LOGO.jpg - 01: offset: 0x0020a2 len: 0x0eac width: 110 height: 100 - Wrote 3756 bytes to icons/001-ICON_Print_0.jpg - 02: offset: 0x002f4e len: 0x0eaa width: 110 height: 100 - Wrote 3754 bytes to icons/002-ICON_Print_1.jpg - ... - 91: offset: 0x0345fc len: 0x0d89 width: 110 height: 100 - Wrote 3465 bytes to icons/091-ICON_Info_1.jpg +In this example we're extracting the constituent JPEG files from `7.ICO` and storing them in a folder named `icons-7`. As each file is extracted the script reports its index number, byte offset, size, dimensions, and filename: + +``` +$ cd buildroot/share/dwin +$ ./bin/splitIco.py 7.ICO icons-7 + Splitting 7.ICO into dir icons-7 + Splitting Entry Data... + 00: offset: 0x001000 len: 0x10a2 width: 130 height: 17 + Wrote 4258 bytes to icons-7/000-ICON_LOGO.jpg + 01: offset: 0x0020a2 len: 0x0eac width: 110 height: 100 + Wrote 3756 bytes to icons-7/001-ICON_Print_0.jpg + 02: offset: 0x002f4e len: 0x0eaa width: 110 height: 100 + Wrote 3754 bytes to icons-7/002-ICON_Print_1.jpg + ... + 91: offset: 0x0345fc len: 0x0d89 width: 110 height: 100 + Wrote 3465 bytes to icons-7/091-ICON_Info_1.jpg +``` Once the individual JPEG files have been saved they can be edited using common graphics applications like Photoshop. JPEG files are inherently lossy and will usually contain ugly artifacts, so cleanup may be needed before they are re-exported. Keep the limits of bank size in mind when exporting images and try to find the best balance between compressed size and image quality. ### `makeIco.py` - Combine JPEGs into `ICO` archive -After editing images you'll create a new `9.ICO` archive with `makeIco.py` like so: +If you want to create an ICO file you'll need to use `makeIco.py`. - $ cd buildroot/share/dwin - $ ./bin/makeIco.py icons-3 3.ICO - Making .ico file '3.ICO' from contents of 'icons-3' - Scanning icon directory icons-3 - ...Scanned 16 icon files - Scanning done. 16 icons included. +#### Usage: +``` +makeIco.py foldername #.ICO +``` + +#### Making .ICO FIle In Windows: +- Create `Make-ICO.bat` file in this folder with the following code: + - ``` + setlocal enabledelayedexpansion + for /f %%f in ('dir *-icons /B /O:-D') do set f=%%f & makeico.py %%f !f:~0,-7! + ``` +- Paste folder containing all icons into this folder +- Run `Make-ICO.bat` +- A new `.ICO` file should appear + +#### Example: + +After editing images you'll create a new `7.ICO` archive with `makeIco.py` like so: + +``` +$ cd buildroot/share/dwin +$ ./bin/makeIco.py icons-7 7.ICO + Making .ico file '7.ICO' from contents of 'icons-7' + Scanning icon directory icons-7 + ...Scanned 16 icon files + Scanning done. 16 icons included. +``` diff --git a/buildroot/share/dwin/icons-4/016-ICON_Bedline.jpg b/buildroot/share/dwin/icons-4/016-ICON_Bedline.jpg new file mode 100644 index 0000000000..68d65dc5fe Binary files /dev/null and b/buildroot/share/dwin/icons-4/016-ICON_Bedline.jpg differ diff --git a/buildroot/share/dwin/icons-4/017-ICON_BedLeveledOff.jpg b/buildroot/share/dwin/icons-4/017-ICON_BedLeveledOff.jpg new file mode 100644 index 0000000000..853fa5159b Binary files /dev/null and b/buildroot/share/dwin/icons-4/017-ICON_BedLeveledOff.jpg differ diff --git a/buildroot/share/dwin/icons-4/018-ICON_BedLeveledOn.jpg b/buildroot/share/dwin/icons-4/018-ICON_BedLeveledOn.jpg new file mode 100644 index 0000000000..d495b57c0a Binary files /dev/null and b/buildroot/share/dwin/icons-4/018-ICON_BedLeveledOn.jpg differ diff --git a/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg b/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg index 0bf1437c64..b3551f3c5c 100644 Binary files a/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg and b/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg b/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg index 186d02ad3b..2d46d13b84 100644 Binary files a/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg and b/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg b/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg index 387c166566..83da633221 100644 Binary files a/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg and b/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg differ diff --git a/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg b/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg index 2e74ee3986..8956690a75 100644 Binary files a/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg and b/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg differ diff --git a/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg b/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg index 2f6e831109..227f0dd8f4 100644 Binary files a/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg and b/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg differ diff --git a/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg b/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg index 746b943c14..e54823be72 100644 Binary files a/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg and b/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg differ diff --git a/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg b/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg index 14aedc0dd0..bd55f6f929 100644 Binary files a/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg and b/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg differ diff --git a/buildroot/share/dwin/icons-7/034-ICON_Language.jpg b/buildroot/share/dwin/icons-7/034-ICON_Language.jpg index 055b4c1ae8..8cebfa76c7 100644 Binary files a/buildroot/share/dwin/icons-7/034-ICON_Language.jpg and b/buildroot/share/dwin/icons-7/034-ICON_Language.jpg differ diff --git a/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg b/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg index 54f834caaf..20f2aab40c 100644 Binary files a/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg and b/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg differ diff --git a/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg b/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg index b82a5b25cd..72841e97bd 100644 Binary files a/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg and b/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg differ diff --git a/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg b/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg index 487d6e4e44..4af56c25a6 100644 Binary files a/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg and b/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg b/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg index 155b9a5857..69e456c499 100644 Binary files a/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg and b/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg differ diff --git a/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg b/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg index eaea25bbd8..b0eef7e420 100644 Binary files a/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg and b/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg differ diff --git a/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg b/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg index 472a6354e4..ad083a208b 100644 Binary files a/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg and b/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg differ diff --git a/buildroot/share/dwin/icons-7/045-ICON_Info.jpg b/buildroot/share/dwin/icons-7/045-ICON_Info.jpg index 34e63e587a..9cfcf912c8 100644 Binary files a/buildroot/share/dwin/icons-7/045-ICON_Info.jpg and b/buildroot/share/dwin/icons-7/045-ICON_Info.jpg differ diff --git a/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg b/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg index 33f5004183..7565e5defe 100644 Binary files a/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg and b/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg b/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg index 09e5072ab9..186d02ad3b 100644 Binary files a/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg and b/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg b/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg index eaaa21255b..d8b416827d 100644 Binary files a/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg and b/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg differ diff --git a/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg b/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg index 4e9c3ad6e4..dda2a55659 100644 Binary files a/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg and b/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg differ diff --git a/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg b/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg index 119df1a03d..05190db4c3 100644 Binary files a/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg and b/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg differ diff --git a/buildroot/share/dwin/icons-7/054-ICON_Step.jpg b/buildroot/share/dwin/icons-7/054-ICON_Step.jpg index 4a0da4a487..3f240655a5 100644 Binary files a/buildroot/share/dwin/icons-7/054-ICON_Step.jpg and b/buildroot/share/dwin/icons-7/054-ICON_Step.jpg differ diff --git a/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg b/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg index 8e2b6fedbe..7a64b70378 100644 Binary files a/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg and b/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg differ diff --git a/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg b/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg index c60504f326..5950063543 100644 Binary files a/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg and b/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg differ diff --git a/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg b/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg index c3b3cc7ce1..f069adeb02 100644 Binary files a/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg and b/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg differ diff --git a/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg b/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg index fe79df3746..9b604bca12 100644 Binary files a/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg and b/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg b/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg index 519f1b448c..1625ed2c6a 100644 Binary files a/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg and b/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg differ diff --git a/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg b/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg index 9258c8618f..57122f127b 100644 Binary files a/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg and b/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg differ diff --git a/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg b/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg index 1a16331456..d7183b716b 100644 Binary files a/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg and b/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg differ diff --git a/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg b/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg index 23255ce0e5..ccf17d2b41 100644 Binary files a/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg and b/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg b/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg index 5bd3fedd6e..12bb8c1ea9 100644 Binary files a/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg and b/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg differ diff --git a/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg b/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg index c316c750b5..d00fa1156d 100644 Binary files a/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg and b/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg differ diff --git a/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg b/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg index c7cda89503..6b8888a910 100644 Binary files a/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg and b/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg differ diff --git a/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg b/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg index be450cd460..f06a69ae2e 100644 Binary files a/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg and b/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg b/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg index 3c926b8565..9a018367ff 100644 Binary files a/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg and b/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg differ diff --git a/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg b/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg index f1015b8218..432b10626c 100644 Binary files a/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg and b/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg differ diff --git a/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg b/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg index 9bb3e6e6be..9348ef0424 100644 Binary files a/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg and b/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg differ diff --git a/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg b/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg index 78dce2a369..93434107e6 100644 Binary files a/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg and b/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg b/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg index 58eaff5650..9102da951d 100644 Binary files a/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg and b/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg differ diff --git a/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg b/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg index 94b808f716..a0d1568947 100644 Binary files a/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg and b/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg differ diff --git a/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg b/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg index 14aedc0dd0..e9851c75f8 100644 Binary files a/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg and b/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg differ diff --git a/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg b/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg index b3234d45aa..fa4b87b8a9 100644 Binary files a/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg and b/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg differ diff --git a/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg b/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg index c403c328f5..b4ba9b3af0 100644 Binary files a/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg and b/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg differ diff --git a/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg b/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg index 07aae4e5ec..61ca9f41d7 100644 Binary files a/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg and b/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg differ diff --git a/buildroot/share/dwin/icons-7/092-ICON_DegreesC.jpg b/buildroot/share/dwin/icons-7/092-ICON_DegreesC.jpg new file mode 100644 index 0000000000..a5622bf9be Binary files /dev/null and b/buildroot/share/dwin/icons-7/092-ICON_DegreesC.jpg differ diff --git a/buildroot/share/dwin/icons-7/093-ICON_Printer_0.jpg b/buildroot/share/dwin/icons-7/093-ICON_Printer_0.jpg new file mode 100644 index 0000000000..7175b7194e Binary files /dev/null and b/buildroot/share/dwin/icons-7/093-ICON_Printer_0.jpg differ diff --git a/buildroot/share/dwin/icons-7/200-ICON_Checkbox_F.jpg b/buildroot/share/dwin/icons-7/200-ICON_Checkbox_F.jpg new file mode 100644 index 0000000000..8c2c3481b8 Binary files /dev/null and b/buildroot/share/dwin/icons-7/200-ICON_Checkbox_F.jpg differ diff --git a/buildroot/share/dwin/icons-7/201-ICON_Checkbox_T.jpg b/buildroot/share/dwin/icons-7/201-ICON_Checkbox_T.jpg new file mode 100644 index 0000000000..4eabacad4d Binary files /dev/null and b/buildroot/share/dwin/icons-7/201-ICON_Checkbox_T.jpg differ diff --git a/buildroot/share/dwin/icons-7/202-ICON_Fade.jpg b/buildroot/share/dwin/icons-7/202-ICON_Fade.jpg new file mode 100644 index 0000000000..7d327ae9b9 Binary files /dev/null and b/buildroot/share/dwin/icons-7/202-ICON_Fade.jpg differ diff --git a/buildroot/share/dwin/icons-7/203-ICON_Mesh.jpg b/buildroot/share/dwin/icons-7/203-ICON_Mesh.jpg new file mode 100644 index 0000000000..65c94be0dd Binary files /dev/null and b/buildroot/share/dwin/icons-7/203-ICON_Mesh.jpg differ diff --git a/buildroot/share/dwin/icons-7/204-ICON_Tilt.jpg b/buildroot/share/dwin/icons-7/204-ICON_Tilt.jpg new file mode 100644 index 0000000000..a1689e05ea Binary files /dev/null and b/buildroot/share/dwin/icons-7/204-ICON_Tilt.jpg differ diff --git a/buildroot/share/dwin/icons-7/205-ICON_Brightness.jpg b/buildroot/share/dwin/icons-7/205-ICON_Brightness.jpg new file mode 100644 index 0000000000..22eda81168 Binary files /dev/null and b/buildroot/share/dwin/icons-7/205-ICON_Brightness.jpg differ diff --git a/buildroot/share/dwin/icons-7/206-ICON_Probe.jpg b/buildroot/share/dwin/icons-7/206-ICON_Probe.jpg new file mode 100644 index 0000000000..5de52da607 Binary files /dev/null and b/buildroot/share/dwin/icons-7/206-ICON_Probe.jpg differ diff --git a/buildroot/share/dwin/icons-7/249-ICON_AxisD.jpg b/buildroot/share/dwin/icons-7/249-ICON_AxisD.jpg new file mode 100644 index 0000000000..14730dfa42 Binary files /dev/null and b/buildroot/share/dwin/icons-7/249-ICON_AxisD.jpg differ diff --git a/buildroot/share/dwin/icons-7/250-ICON_AxisBR.jpg b/buildroot/share/dwin/icons-7/250-ICON_AxisBR.jpg new file mode 100644 index 0000000000..89d5ef05ce Binary files /dev/null and b/buildroot/share/dwin/icons-7/250-ICON_AxisBR.jpg differ diff --git a/buildroot/share/dwin/icons-7/251-ICON_AxisTR.jpg b/buildroot/share/dwin/icons-7/251-ICON_AxisTR.jpg new file mode 100644 index 0000000000..716b9f7314 Binary files /dev/null and b/buildroot/share/dwin/icons-7/251-ICON_AxisTR.jpg differ diff --git a/buildroot/share/dwin/icons-7/252-ICON_AxisBL.jpg b/buildroot/share/dwin/icons-7/252-ICON_AxisBL.jpg new file mode 100644 index 0000000000..c94915dd25 Binary files /dev/null and b/buildroot/share/dwin/icons-7/252-ICON_AxisBL.jpg differ diff --git a/buildroot/share/dwin/icons-7/253-ICON_AxisTL.jpg b/buildroot/share/dwin/icons-7/253-ICON_AxisTL.jpg new file mode 100644 index 0000000000..7fb5de6e9c Binary files /dev/null and b/buildroot/share/dwin/icons-7/253-ICON_AxisTL.jpg differ diff --git a/buildroot/share/dwin/icons-7/254-ICON_AxisC.jpg b/buildroot/share/dwin/icons-7/254-ICON_AxisC.jpg new file mode 100644 index 0000000000..3dd02c52b0 Binary files /dev/null and b/buildroot/share/dwin/icons-7/254-ICON_AxisC.jpg differ