Skip to content

Commit

Permalink
revert ExtUI / EXTENSIBLE_UI
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Aug 11, 2024
1 parent 85bff40 commit 9c5407d
Show file tree
Hide file tree
Showing 27 changed files with 169 additions and 41 deletions.
6 changes: 2 additions & 4 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,13 +1598,11 @@ void setup() {
SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n");
#endif

#if ENABLED(DWIN_CREALITY_LCD)
#if HAS_DWIN_E3V2_BASIC
SETUP_RUN(dwinInitScreen());
#elif ENABLED(DWIN_LCD_PROUI)
SETUP_RUN(ExtUI::onStartup());
#endif

#if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD)
#if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC
SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status
#endif

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@ void unified_bed_leveling::restore_ubl_active_state(const bool is_done/*=true*/)
set_bed_leveling_enabled(ubl_state_at_invocation);

if (is_done) {
TERN_(DWIN_LCD_PROUI, dwinLevelingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
}
}
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../lcd/e3v2/proui/dwin_popup.h"
#endif

#include "../lcd/marlinui.h"
Expand Down Expand Up @@ -531,6 +533,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
// Wait for filament insert by user and press button
KEEPALIVE_STATE(PAUSED_FOR_USER);
TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_NOZZLE_PARKED)));
TERN_(DWIN_LCD_PROUI, LCD_MESSAGE(MSG_NOZZLE_PARKED));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED)));
wait_for_user = true; // LCD click or M108 will clear this
while (wait_for_user) {
Expand Down
23 changes: 19 additions & 4 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
#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"
#include "../../../lcd/e3v2/proui/meshviewer.h"
#endif

#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
Expand Down Expand Up @@ -81,7 +84,7 @@ static void pre_g29_return(const bool retry, const bool did) {
}
#if DISABLED(G29_RETRY_AND_RECOVER)
if (!retry || did) {
TERN_(DWIN_CREALITY_LCD, dwinLevelingDone());
TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone());
}
#endif
Expand Down Expand Up @@ -326,6 +329,7 @@ G29_TYPE GcodeSuite::G29() {
set_bed_leveling_enabled(false);
bedlevel.z_values[i][j] = rz;
bedlevel.refresh_bed_level();
TERN_(DWIN_LCD_PROUI, meshViewer.drawMeshPoint(i, j, rz));
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(i, j, rz));
if (abl.reenable) {
set_bed_leveling_enabled(true);
Expand Down Expand Up @@ -430,6 +434,8 @@ 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());
Expand All @@ -439,7 +445,13 @@ G29_TYPE GcodeSuite::G29() {

#if ENABLED(PREHEAT_BEFORE_LEVELING)
if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP,
TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP)
#if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED)
hmiData.bedLevT
#elif ENABLED(EXTENSIBLE_UI)
ExtUI::getLevelingBedTemp()
#else
LEVELING_BED_TEMP
#endif
);
#endif
}
Expand Down Expand Up @@ -567,6 +579,7 @@ G29_TYPE GcodeSuite::G29() {

const float newz = abl.measured_z + abl.Z_offset;
abl.z_values[abl.meshCount.x][abl.meshCount.y] = newz;
TERN_(DWIN_LCD_PROUI, meshViewer.drawMeshPoint(abl.meshCount.x, abl.meshCount.y, newz));
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, newz));

if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM_P(PSTR("Save X"), abl.meshCount.x, SP_Y_STR, abl.meshCount.y, SP_Z_STR, abl.measured_z + abl.Z_offset);
Expand Down Expand Up @@ -773,6 +786,7 @@ G29_TYPE GcodeSuite::G29() {

const float z = abl.measured_z + abl.Z_offset;
abl.z_values[abl.meshCount.x][abl.meshCount.y] = z;
TERN_(DWIN_LCD_PROUI, meshViewer.drawMeshPoint(abl.meshCount.x, abl.meshCount.y, z));
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(abl.meshCount, z));

#endif
Expand Down Expand Up @@ -848,7 +862,8 @@ G29_TYPE GcodeSuite::G29() {
else {
bedlevel.set_grid(abl.gridSpacing, abl.probe_position_lf);
COPY(bedlevel.z_values, abl.z_values);
TERN_(IS_KINEMATIC, bedlevel.extrapolate_unprobed_bed_level());
if (parser.boolval('K')) bedlevel.extrapolate_unprobed_bed_level();
else if (ENABLED(DWIN_LCD_PROUI) || ENABLED(IS_KINEMATIC)) bedlevel.extrapolate_unprobed_bed_level();
bedlevel.refresh_bed_level();

bedlevel.print_leveling_grid();
Expand Down Expand Up @@ -984,7 +999,7 @@ G29_TYPE GcodeSuite::G29() {
// Restore state after probing
if (!faux) restore_feedrate_and_scaling();

TERN_(HAS_BED_PROBE, probe.move_z_after_probing());
TERN_(Z_AFTER_PROBING, probe.move_z_after_probing());

#ifdef EVENT_GCODE_AFTER_G29
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", EVENT_GCODE_AFTER_G29);
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/gcode/bedlevel/abl/M421.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif

/**
Expand All @@ -59,6 +61,7 @@ void GcodeSuite::M421() {
for (uint8_t x = sx; x <= ex; ++x) {
for (uint8_t y = sy; y <= ey; ++y) {
bedlevel.z_values[x][y] = zval + (hasQ ? bedlevel.z_values[x][y] : 0);
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(x, y, bedlevel.z_values[x][y]);)
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, bedlevel.z_values[x][y]));
}
}
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/gcode/bedlevel/mbl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void GcodeSuite::G29() {

queue.inject(F("G29S2"));

TERN_(DWIN_LCD_PROUI, dwinLevelingStart());
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());

return;
Expand All @@ -166,6 +167,7 @@ void GcodeSuite::G29() {
else {
// Save Z for the previous mesh position
bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z);
TERN_(DWIN_LCD_PROUI, dwinPointUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z));
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z));
SET_SOFT_ENDSTOP_LOOSE(false);
}
Expand Down Expand Up @@ -232,6 +234,7 @@ void GcodeSuite::G29() {

if (parser.seenval('Z')) {
bedlevel.z_values[ix][iy] = parser.value_linear_units();
TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy]));
}
else
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/gcode/bedlevel/ubl/M421.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif

/**
Expand Down Expand Up @@ -66,6 +68,7 @@ void GcodeSuite::M421() {
else {
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_(DWIN_LCD_PROUI, dwinMeshUpdate(ij.x, ij.y, zval));
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh
}
}
Expand Down
6 changes: 4 additions & 2 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#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)
Expand Down Expand Up @@ -221,7 +223,7 @@ void GcodeSuite::G28() {
set_and_report_grblstate(M_HOMING);
#endif

TERN_(DWIN_CREALITY_LCD, dwinHomingStart());
TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingStart());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());

planner.synchronize(); // Wait for planner moves to finish!
Expand Down Expand Up @@ -650,7 +652,7 @@ void GcodeSuite::G28() {

ui.refresh();

TERN_(DWIN_CREALITY_LCD, dwinHomingDone());
TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingDone());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone());

report_current_position();
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/gcode/calibrate/M48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@

void GcodeSuite::M48() {

if (homing_needed_error()) return;
#if ENABLED(DWIN_LCD_PROUI)
TERN_(ADVANCED_PAUSE_FEATURE, dwinPopupPause(GET_TEXT_F(MSG_M48_TEST));)
#endif

if (homing_needed_error()) TERN(DWIN_LCD_PROUI, return hmiReturnScreen(), return);

const int8_t verbose_level = parser.byteval('V', 1);
if (!WITHIN(verbose_level, 0, 4)) {
Expand Down Expand Up @@ -274,6 +278,7 @@ void GcodeSuite::M48() {
TERN_(HAS_PTC, ptc.set_enabled(true));

report_current_position();
TERN_(DWIN_LCD_PROUI, hmiReturnScreen();)
}

#endif // Z_MIN_PROBE_REPEATABILITY_TEST
3 changes: 3 additions & 0 deletions Marlin/src/gcode/config/M302.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

#include "../../module/temperature.h"
Expand All @@ -51,6 +53,7 @@ void GcodeSuite::M302() {
const bool seen_S = parser.seen('S');
if (seen_S) {
thermalManager.extrude_min_temp = parser.value_celsius();
TERN_(DWIN_LCD_PROUI, hmiData.extMinT = thermalManager.extrude_min_temp);
TERN_(EXTENSIBLE_UI, ExtUI::onSetMinExtrusionTemp(thermalManager.extrude_min_temp));
}

Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/gcode/control/M997.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

/**
* M997: Perform in-application firmware update
*/
void GcodeSuite::M997() {

TERN_(DWIN_LCD_PROUI, dwinRebootScreen());
TERN_(EXTENSIBLE_UI, ExtUI::onFirmwareFlash());

flashFirmware(parser.intval('S'));
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/gcode/feature/powerloss/M1000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "../../../lcd/e3v2/creality/dwin.h"
#elif ENABLED(DWIN_CREALITY_LCD_JYERSUI)
#include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../../lcd/e3v2/proui/dwin.h"
#endif

#define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY)
Expand Down
10 changes: 6 additions & 4 deletions Marlin/src/gcode/lcd/M0_M1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#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"
#endif

#if ENABLED(HOST_PROMPT_SUPPORT)
Expand Down Expand Up @@ -63,14 +65,14 @@ void GcodeSuite::M0_M1() {
#endif
}

#elif ENABLED(DWIN_LCD_PROUI) // ExtUI with icon, string, button title
#elif ENABLED(DWIN_LCD_PROUI)

if (parser.string_arg)
ExtUI::onUserConfirmRequired(ICON_Continue_1, parser.string_arg, GET_TEXT_F(MSG_USERWAIT));
dwinPopupContinue(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));
dwinPopupContinue(ICON_Stop_1, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT));

#elif ENABLED(EXTENSIBLE_UI)
#elif ENABLED(EXTENSIBLE_UI) // ExtUI with icon, string, button title

if (parser.string_arg)
ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "../../feature/probe_temp_comp.h"
#endif

#if ANY(DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI)
#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI)
#define VERBOSE_SINGLE_PROBE
#endif

Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/gcode/sd/M1001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

#if ENABLED(HOST_ACTION_COMMANDS)
Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/gcode/sd/M524.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/marlinui.h"
#endif

/**
* M524: Abort the current SD print job (started with M24)
*/
void GcodeSuite::M524() {

#if ENABLED(EXTENSIBLE_UI)
#if ENABLED(DWIN_LCD_PROUI)

ui.abort_print();

#elif ENABLED(EXTENSIBLE_UI)

ExtUI::stopPrint(); // Calls ui.abort_print() which does the same as below

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/gcode/temp/M303.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#elif ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#endif

/**
Expand Down Expand Up @@ -66,6 +68,7 @@ void GcodeSuite::M303() {
default:
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
TERN_(DWIN_LCD_PROUI, dwinPIDTuning(PID_BAD_HEATER_ID);)
TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_BAD_HEATER_ID));
return;
}
Expand All @@ -76,6 +79,7 @@ void GcodeSuite::M303() {
const celsius_t temp = seenS ? parser.value_celsius() : default_temp;
const bool u = parser.boolval('U');

TERN_(DWIN_LCD_PROUI, dwinStartM303(c, hid, temp));
TERN_(EXTENSIBLE_UI, ExtUI::onStartM303(c, hid, temp));

IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY));
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@
#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, DWIN_LCD_PROUI)
#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE)
#define IS_EXTUI 1 // Just for sanity check.
#define EXTENSIBLE_UI
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3050,7 +3050,7 @@
* Advanced Pause - Filament Change
*/
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT)
#if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI, DWIN_LCD_PROUI) || 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
Expand Down
Loading

0 comments on commit 9c5407d

Please sign in to comment.