Skip to content

Commit 87e94f4

Browse files
🚸 Update ProUI Plot graph - part 2 (MarlinFirmware#26563)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
1 parent 017a903 commit 87e94f4

File tree

143 files changed

+1781
-837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1781
-837
lines changed

Marlin/Configuration_adv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3558,7 +3558,7 @@
35583558
* Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and
35593559
* to set spindle speed, spindle direction, and laser power.
35603560
*
3561-
* SuperPid is a router/spindle speed controller used in the CNC milling community.
3561+
* SuperPID is a router/spindle speed controller used in the CNC milling community.
35623562
* Marlin can be used to turn the spindle on and off. It can also be used to set
35633563
* the spindle speed from 5,000 to 30,000 RPM.
35643564
*

Marlin/src/MarlinCore.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@
7777
#include "lcd/e3v2/common/encoder.h"
7878
#if ENABLED(DWIN_CREALITY_LCD)
7979
#include "lcd/e3v2/creality/dwin.h"
80-
#elif ENABLED(DWIN_LCD_PROUI)
81-
#include "lcd/e3v2/proui/dwin.h"
8280
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
8381
#include "lcd/e3v2/jyersui/dwin.h"
8482
#endif
@@ -1594,11 +1592,11 @@ void setup() {
15941592
SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
15951593
#endif
15961594

1597-
#if HAS_DWIN_E3V2_BASIC
1595+
#if ENABLED(DWIN_CREALITY_LCD)
15981596
SETUP_RUN(dwinInitScreen());
15991597
#endif
16001598

1601-
#if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC
1599+
#if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
16021600
SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status
16031601
#endif
16041602

Marlin/src/feature/bedlevel/ubl/ubl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class unified_bed_leveling {
9595
static void report_current_mesh();
9696
static void report_state();
9797
static void save_ubl_active_state_and_disable();
98-
static void restore_ubl_active_state_and_leave();
98+
static void restore_ubl_active_state(const bool is_done=true);
9999
static void display_map(const uint8_t) __O0;
100100
static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0;
101101
static mesh_index_pair find_furthest_invalid_mesh_point() __O0;

Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+14-19
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void unified_bed_leveling::G29() {
309309
#if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING)
310310
save_ubl_active_state_and_disable();
311311
gcode.process_subcommands_now(F("G28Z"));
312-
restore_ubl_active_state_and_leave();
312+
restore_ubl_active_state(false); // ...without telling ExtUI "done"
313313
#else
314314
// Send 'N' to force homing before G29 (internal only)
315315
if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes();
@@ -425,7 +425,7 @@ void unified_bed_leveling::G29() {
425425
if (parser.seen_test('J')) {
426426
save_ubl_active_state_and_disable();
427427
tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point
428-
restore_ubl_active_state_and_leave();
428+
restore_ubl_active_state();
429429
#if ENABLED(UBL_G29_J_RECENTER)
430430
do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y)));
431431
#endif
@@ -754,7 +754,6 @@ void unified_bed_leveling::shift_mesh_height() {
754754

755755
TERN_(HAS_MARLINUI_MENU, ui.capture());
756756
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
757-
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
758757

759758
save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained
760759
grid_count_t count = GRID_MAX_POINTS;
@@ -768,7 +767,6 @@ void unified_bed_leveling::shift_mesh_height() {
768767
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
769768
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
770769
TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
771-
TERN_(DWIN_LCD_PROUI, dwinRedrawScreen());
772770

773771
#if HAS_MARLINUI_MENU
774772
if (ui.button_pressed()) {
@@ -778,8 +776,7 @@ void unified_bed_leveling::shift_mesh_height() {
778776
ui.quick_feedback();
779777
ui.release();
780778
probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW
781-
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
782-
return restore_ubl_active_state_and_leave();
779+
return restore_ubl_active_state();
783780
}
784781
#endif
785782

@@ -815,15 +812,12 @@ void unified_bed_leveling::shift_mesh_height() {
815812

816813
probe.move_z_after_probing();
817814

818-
restore_ubl_active_state_and_leave();
819-
820815
do_blocking_move_to_xy(
821816
constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X),
822817
constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y)
823818
);
824819

825-
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
826-
TERN_(DWIN_LCD_PROUI, dwinLevelingDone());
820+
restore_ubl_active_state();
827821
}
828822

829823
#endif // HAS_BED_PROBE
@@ -932,7 +926,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
932926
if (param.V_verbosity > 1)
933927
SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick.");
934928

935-
restore_ubl_active_state_and_leave();
929+
restore_ubl_active_state();
936930

937931
return thickness;
938932
}
@@ -987,7 +981,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
987981
if (_click_and_hold([]{
988982
SERIAL_ECHOLNPGM("\nMesh only partially populated.");
989983
do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE);
990-
})) return restore_ubl_active_state_and_leave();
984+
})) return restore_ubl_active_state();
991985

992986
// Store the Z position minus the shim height
993987
z_values[lpos.x][lpos.y] = current_position.z - thick;
@@ -1002,10 +996,8 @@ void set_message_with_feedback(FSTR_P const fstr) {
1002996

1003997
if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing
1004998

1005-
restore_ubl_active_state_and_leave();
999+
restore_ubl_active_state();
10061000
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE);
1007-
1008-
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
10091001
}
10101002

10111003
/**
@@ -1111,7 +1103,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
11111103
} while (lpos.x >= 0 && --param.R_repetition > 0);
11121104

11131105
if (do_ubl_mesh_map) display_map(param.T_map_type);
1114-
restore_ubl_active_state_and_leave();
1106+
restore_ubl_active_state();
11151107

11161108
do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE);
11171109

@@ -1263,17 +1255,20 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() {
12631255
set_bed_leveling_enabled(false);
12641256
}
12651257

1266-
void unified_bed_leveling::restore_ubl_active_state_and_leave() {
1258+
void unified_bed_leveling::restore_ubl_active_state(const bool is_done/*=true*/) {
12671259
TERN_(HAS_MARLINUI_MENU, ui.release());
12681260
#if ENABLED(UBL_DEVEL_DEBUGGING)
12691261
if (--ubl_state_recursion_chk) {
1270-
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
1262+
SERIAL_ECHOLNPGM("restore_ubl_active_state() called too many times.");
12711263
set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR));
12721264
return;
12731265
}
12741266
#endif
12751267
set_bed_leveling_enabled(ubl_state_at_invocation);
1276-
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
1268+
1269+
if (is_done) {
1270+
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
1271+
}
12771272
}
12781273

12791274
mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() {

Marlin/src/feature/host_actions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
186186
switch (response) {
187187

188188
case 0: // "Purge More" button
189-
#if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE)
189+
#if ENABLED(M600_PURGE_MORE_RESUMABLE)
190190
pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more)
191191
#endif
192192
break;
193193

194194
case 1: // "Continue" / "Disable Runout" button
195-
#if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE)
195+
#if ENABLED(M600_PURGE_MORE_RESUMABLE)
196196
pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection
197197
#endif
198198
#if HAS_FILAMENT_SENSOR

Marlin/src/feature/pause.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
/**
2424
* feature/pause.cpp - Pause feature support functions
2525
* This may be combined with related G-codes if features are consolidated.
26+
*
27+
* Note: Calls to ui.pause_show_message are passed to either ExtUI or MarlinUI.
2628
*/
2729

2830
#include "../inc/MarlinConfigPre.h"
@@ -60,8 +62,6 @@
6062

6163
#if ENABLED(EXTENSIBLE_UI)
6264
#include "../lcd/extui/ui_api.h"
63-
#elif ENABLED(DWIN_LCD_PROUI)
64-
#include "../lcd/e3v2/proui/dwin.h"
6565
#endif
6666

6767
#include "../lcd/marlinui.h"
@@ -148,7 +148,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
148148
thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder);
149149
#endif
150150

151-
ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); UNUSED(mode);
151+
ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode);
152152

153153
if (wait) return thermalManager.wait_for_hotend(active_extruder);
154154

@@ -288,8 +288,8 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
288288
// Show "Purge More" / "Resume" menu and wait for reply
289289
KEEPALIVE_STATE(PAUSED_FOR_USER);
290290
wait_for_user = false;
291-
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
292-
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR
291+
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI)
292+
ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR
293293
#else
294294
pause_menu_response = PAUSE_RESPONSE_WAIT_FOR;
295295
#endif

Marlin/src/feature/powerloss.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ uint8_t PrintJobRecovery::queue_index_r;
4848
uint32_t PrintJobRecovery::cmd_sdpos, // = 0
4949
PrintJobRecovery::sdpos[BUFSIZE];
5050

51-
#if HAS_DWIN_E3V2_BASIC
52-
bool PrintJobRecovery::dwin_flag; // = false
51+
#if HAS_PLR_UI_FLAG
52+
bool PrintJobRecovery::ui_flag_resume; // = false
5353
#endif
5454

5555
#include "../sd/cardreader.h"

Marlin/src/feature/powerloss.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ class PrintJobRecovery {
151151
static uint32_t cmd_sdpos, //!< SD position of the next command
152152
sdpos[BUFSIZE]; //!< SD positions of queued commands
153153

154-
#if HAS_DWIN_E3V2_BASIC
155-
static bool dwin_flag;
154+
#if HAS_PLR_UI_FLAG
155+
static bool ui_flag_resume; //!< Flag the UI to show a dialog to Resume (M1000) or Cancel (M1000C)
156156
#endif
157157

158158
static void init();

Marlin/src/feature/runout.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ bool FilamentMonitorBase::enabled = true,
6868

6969
#if ENABLED(EXTENSIBLE_UI)
7070
#include "../lcd/extui/ui_api.h"
71-
#elif ENABLED(DWIN_LCD_PROUI)
72-
#include "../lcd/e3v2/proui/dwin.h"
7371
#endif
7472

7573
void event_filament_runout(const uint8_t extruder) {
@@ -88,7 +86,6 @@ void event_filament_runout(const uint8_t extruder) {
8886
#endif
8987

9088
TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder)));
91-
TERN_(DWIN_LCD_PROUI, dwinFilamentRunout(extruder));
9289

9390
#if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR)
9491
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder);

Marlin/src/feature/tmc_util.h

+18-26
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,13 @@ class TMCMarlin : public TMC, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
144144
#endif
145145
#endif
146146

147-
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
148-
void refresh_stepper_current() { rms_current(this->val_mA); }
147+
void refresh_stepper_current() { rms_current(this->val_mA); }
149148

150-
#if ENABLED(HYBRID_THRESHOLD)
151-
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
152-
#endif
153-
#if USE_SENSORLESS
154-
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
155-
#endif
149+
#if ENABLED(HYBRID_THRESHOLD)
150+
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
151+
#endif
152+
#if USE_SENSORLESS
153+
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
156154
#endif
157155

158156
static constexpr int8_t sgt_min = -64,
@@ -207,12 +205,10 @@ class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
207205
}
208206
#endif
209207

210-
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
211-
void refresh_stepper_current() { rms_current(this->val_mA); }
208+
void refresh_stepper_current() { rms_current(this->val_mA); }
212209

213-
#if ENABLED(HYBRID_THRESHOLD)
214-
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
215-
#endif
210+
#if ENABLED(HYBRID_THRESHOLD)
211+
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
216212
#endif
217213
};
218214

@@ -269,15 +265,13 @@ class TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC220
269265
}
270266
#endif
271267

272-
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
273-
void refresh_stepper_current() { rms_current(this->val_mA); }
268+
void refresh_stepper_current() { rms_current(this->val_mA); }
274269

275-
#if ENABLED(HYBRID_THRESHOLD)
276-
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
277-
#endif
278-
#if USE_SENSORLESS
279-
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
280-
#endif
270+
#if ENABLED(HYBRID_THRESHOLD)
271+
void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
272+
#endif
273+
#if USE_SENSORLESS
274+
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
281275
#endif
282276

283277
static constexpr uint8_t sgt_min = 0,
@@ -315,12 +309,10 @@ class TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC266
315309
}
316310
#endif
317311

318-
#if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI)
319-
void refresh_stepper_current() { rms_current(this->val_mA); }
312+
void refresh_stepper_current() { rms_current(this->val_mA); }
320313

321-
#if USE_SENSORLESS
322-
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
323-
#endif
314+
#if USE_SENSORLESS
315+
void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); }
324316
#endif
325317

326318
static constexpr int8_t sgt_min = -64,

Marlin/src/gcode/bedlevel/abl/G29.cpp

+2-10
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
#include "../../../lcd/extui/ui_api.h"
5252
#elif ENABLED(DWIN_CREALITY_LCD)
5353
#include "../../../lcd/e3v2/creality/dwin.h"
54-
#elif ENABLED(DWIN_LCD_PROUI)
55-
#include "../../../lcd/e3v2/proui/dwin.h"
5654
#endif
5755

5856
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -77,7 +75,7 @@ static void pre_g29_return(const bool retry, const bool did) {
7775
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false));
7876
}
7977
if (did) {
80-
TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone());
78+
TERN_(DWIN_CREALITY_LCD, dwinLevelingDone());
8179
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
8280
}
8381
}
@@ -425,8 +423,6 @@ G29_TYPE GcodeSuite::G29() {
425423
#if ENABLED(AUTO_BED_LEVELING_3POINT)
426424
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling");
427425
points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points
428-
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
429-
TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
430426
#endif
431427

432428
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
@@ -436,11 +432,7 @@ G29_TYPE GcodeSuite::G29() {
436432

437433
#if ENABLED(PREHEAT_BEFORE_LEVELING)
438434
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
439-
#if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED)
440-
hmiData.bedLevT
441-
#else
442-
LEVELING_BED_TEMP
443-
#endif
435+
TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP)
444436
);
445437
#endif
446438
}

0 commit comments

Comments
 (0)