diff --git a/Marlin/src/feature/bedlevel/abl/abl.cpp b/Marlin/src/feature/bedlevel/abl/abl.cpp index ce2799cd38444b05ff16613d069c1836eeeccc42..b6011332bf633e01f7f974d0b724a8ec339dcf37 100644 --- a/Marlin/src/feature/bedlevel/abl/abl.cpp +++ b/Marlin/src/feature/bedlevel/abl/abl.cpp @@ -32,6 +32,10 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../../lcd/extensible_ui/ui_api.h" +#endif + int bilinear_grid_spacing[2], bilinear_start[2]; float bilinear_grid_factor[2], z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 55267b44e045aa912cd53f93e3b2758502a35bcf..3cac3d5b46579f8e810f21e9b2dc1afe59365376 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -42,6 +42,10 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../core/debug_out.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extensible_ui/ui_api.h" +#endif + bool leveling_is_valid() { return #if ENABLED(MESH_BED_LEVELING) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 75705e15930065294f08b1b7f90bc6134309b656..99dbb380e5938d3466e3071ffd873df8eaa545e9 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -656,7 +656,9 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); - ui.reset_status(); + #if HAS_LCD_MENU + ui.return_to_status(); + #endif } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index f87c60fecb7b884169f2132782094417da588f02..3ce43b2fef53a2bc3085824782a926c71fded16b 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -32,6 +32,10 @@ #include "../../module/configuration_store.h" #endif +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extensible_ui/ui_api.h" +#endif + //#define M420_C_USE_MEAN /** @@ -175,14 +179,15 @@ void GcodeSuite::M420() { set_bed_leveling_enabled(false); // Subtract the mean from all values for (uint8_t x = GRID_MAX_POINTS_X; x--;) - for (uint8_t y = GRID_MAX_POINTS_Y; y--;) + for (uint8_t y = GRID_MAX_POINTS_Y; y--;) { Z_VALUES(x, y) -= zmean; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); + #endif + } #if ENABLED(ABL_BILINEAR_SUBDIVISION) bed_level_virt_interpolate(); #endif - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y)); - #endif } #endif diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 675cd2b88ec6febef4e2f00ef699d7dc2d71d5bc..22cc0c1754061784d4ddc373f03ce69f0b2a20a2 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -51,6 +51,10 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../../lcd/extensible_ui/ui_api.h" +#endif + #if ABL_GRID #if ENABLED(PROBE_Y_FIRST) #define PR_OUTER_VAR xCount diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index cba905b4fb42b186e3fa0efb4d83f120070f47c3..295911330cfa926355d42e7002dc34a38ae38b3a 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -31,6 +31,10 @@ #include "../../gcode.h" #include "../../../feature/bedlevel/abl/abl.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../../lcd/extensible_ui/ui_api.h" +#endif + /** * M421: Set a single Mesh Bed Leveling Z coordinate * diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index aa71743e129ecb0e500a3df4abbf040feffe06a9..8e531ec2a9b78d9a45ac2278e66df6f4f2c292b6 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -715,6 +715,7 @@ namespace ExtUI { #if HAS_MESH bool getMeshValid() { return leveling_is_valid(); } bed_mesh_t getMeshArray() { return Z_VALUES_ARR; } + float getMeshPoint(const uint8_t xpos, const uint8_t ypos) { return Z_VALUES(xpos,ypos); } void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) { if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) { Z_VALUES(xpos, ypos) = zoff; @@ -748,10 +749,15 @@ namespace ExtUI { enqueue_and_echo_commands_P(gcode); } + bool commandsInQueue() { return (planner.movesplanned() || commands_in_queue); } + bool isAxisPositionKnown(const axis_t axis) { return TEST(axis_known_position, axis); } + bool isPositionKnown() { return all_axes_known(); } + bool isMachineHomed() { return all_axes_homed(); } + PGM_P getFirmwareName_str() { static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION; return firmware_name; diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index b5be58dcca1adea2818198f395fb4355b73e1b5c..2f2f99dc11ac86e3f28d640faa9651b5582ef9e3 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -58,9 +58,12 @@ namespace ExtUI { bool isMoving(); bool isAxisPositionKnown(const axis_t); + bool isPositionKnown(); // Axis position guaranteed, steppers active since homing + bool isMachineHomed(); // Axis position most likely correct, steppers may have deactivated bool canMove(const axis_t); bool canMove(const extruder_t); void enqueueCommands_P(PGM_P const); + bool commandsInQueue(); /** * Getters and setters @@ -110,8 +113,10 @@ namespace ExtUI { bool getLevelingActive(); void setLevelingActive(const bool); #if HAS_MESH + #include "../../feature/bedlevel/bedlevel.h" bool getMeshValid(); bed_mesh_t getMeshArray(); + float getMeshPoint(const uint8_t xpos, const uint8_t ypos); void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval); void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval); #endif diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 0d4b88d2c300514c88d3dcc72f84668619e8b352..f7381c1d14dfb0bfe1cee11b4959b09d26e3b392 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -25,6 +25,7 @@ // These displays all share the MarlinUI class #if HAS_SPI_LCD || EITHER(MALYAN_LCD, EXTENSIBLE_UI) #include "ultralcd.h" + #include "fontutils.h" MarlinUI ui; #include "../sd/cardreader.h" #if ENABLED(EXTENSIBLE_UI)