Browse Source

Fix some ExtUI issues (#13799)

InsanityAutomation 6 years ago
parent
commit
610fb46683

+ 4
- 0
Marlin/src/feature/bedlevel/abl/abl.cpp View File

@@ -32,6 +32,10 @@
32 32
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
33 33
 #include "../../../core/debug_out.h"
34 34
 
35
+#if ENABLED(EXTENSIBLE_UI)
36
+  #include "../../../lcd/extensible_ui/ui_api.h"
37
+#endif
38
+
35 39
 int bilinear_grid_spacing[2], bilinear_start[2];
36 40
 float bilinear_grid_factor[2],
37 41
       z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];

+ 4
- 0
Marlin/src/feature/bedlevel/bedlevel.cpp View File

@@ -42,6 +42,10 @@
42 42
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
43 43
 #include "../../core/debug_out.h"
44 44
 
45
+#if ENABLED(EXTENSIBLE_UI)
46
+  #include "../../lcd/extensible_ui/ui_api.h"
47
+#endif
48
+
45 49
 bool leveling_is_valid() {
46 50
   return
47 51
     #if ENABLED(MESH_BED_LEVELING)

+ 3
- 1
Marlin/src/feature/pause.cpp View File

@@ -656,7 +656,9 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
656 656
   // Resume the print job timer if it was running
657 657
   if (print_job_timer.isPaused()) print_job_timer.start();
658 658
 
659
-  ui.reset_status();
659
+  #if HAS_LCD_MENU
660
+    ui.return_to_status();
661
+  #endif
660 662
 }
661 663
 
662 664
 #endif // ADVANCED_PAUSE_FEATURE

+ 9
- 4
Marlin/src/gcode/bedlevel/M420.cpp View File

@@ -32,6 +32,10 @@
32 32
   #include "../../module/configuration_store.h"
33 33
 #endif
34 34
 
35
+#if ENABLED(EXTENSIBLE_UI)
36
+  #include "../../lcd/extensible_ui/ui_api.h"
37
+#endif
38
+
35 39
 //#define M420_C_USE_MEAN
36 40
 
37 41
 /**
@@ -175,14 +179,15 @@ void GcodeSuite::M420() {
175 179
             set_bed_leveling_enabled(false);
176 180
             // Subtract the mean from all values
177 181
             for (uint8_t x = GRID_MAX_POINTS_X; x--;)
178
-              for (uint8_t y = GRID_MAX_POINTS_Y; y--;)
182
+              for (uint8_t y = GRID_MAX_POINTS_Y; y--;) {
179 183
                 Z_VALUES(x, y) -= zmean;
184
+                #if ENABLED(EXTENSIBLE_UI)
185
+                  ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y));
186
+                #endif
187
+              }
180 188
             #if ENABLED(ABL_BILINEAR_SUBDIVISION)
181 189
               bed_level_virt_interpolate();
182 190
             #endif
183
-            #if ENABLED(EXTENSIBLE_UI)
184
-              ExtUI::onMeshUpdate(x, y, Z_VALUES(x, y));
185
-            #endif
186 191
           }
187 192
 
188 193
         #endif

+ 4
- 0
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

@@ -51,6 +51,10 @@
51 51
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
52 52
 #include "../../../core/debug_out.h"
53 53
 
54
+#if ENABLED(EXTENSIBLE_UI)
55
+  #include "../../../lcd/extensible_ui/ui_api.h"
56
+#endif
57
+
54 58
 #if ABL_GRID
55 59
   #if ENABLED(PROBE_Y_FIRST)
56 60
     #define PR_OUTER_VAR xCount

+ 4
- 0
Marlin/src/gcode/bedlevel/abl/M421.cpp View File

@@ -31,6 +31,10 @@
31 31
 #include "../../gcode.h"
32 32
 #include "../../../feature/bedlevel/abl/abl.h"
33 33
 
34
+#if ENABLED(EXTENSIBLE_UI)
35
+  #include "../../../lcd/extensible_ui/ui_api.h"
36
+#endif
37
+
34 38
 /**
35 39
  * M421: Set a single Mesh Bed Leveling Z coordinate
36 40
  *

+ 6
- 0
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

@@ -715,6 +715,7 @@ namespace ExtUI {
715 715
     #if HAS_MESH
716 716
       bool getMeshValid() { return leveling_is_valid(); }
717 717
       bed_mesh_t getMeshArray() { return Z_VALUES_ARR; }
718
+      float getMeshPoint(const uint8_t xpos, const uint8_t ypos) { return Z_VALUES(xpos,ypos); }
718 719
       void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) {
719 720
         if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) {
720 721
           Z_VALUES(xpos, ypos) = zoff;
@@ -748,10 +749,15 @@ namespace ExtUI {
748 749
     enqueue_and_echo_commands_P(gcode);
749 750
   }
750 751
 
752
+  bool commandsInQueue() { return (planner.movesplanned() || commands_in_queue); }
753
+  
751 754
   bool isAxisPositionKnown(const axis_t axis) {
752 755
     return TEST(axis_known_position, axis);
753 756
   }
754 757
 
758
+  bool isPositionKnown() { return all_axes_known(); }
759
+  bool isMachineHomed() { return all_axes_homed(); }
760
+
755 761
   PGM_P getFirmwareName_str() {
756 762
     static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION;
757 763
     return firmware_name;

+ 5
- 0
Marlin/src/lcd/extensible_ui/ui_api.h View File

@@ -58,9 +58,12 @@ namespace ExtUI {
58 58
 
59 59
   bool isMoving();
60 60
   bool isAxisPositionKnown(const axis_t);
61
+  bool isPositionKnown(); // Axis position guaranteed, steppers active since homing
62
+  bool isMachineHomed(); // Axis position most likely correct, steppers may have deactivated
61 63
   bool canMove(const axis_t);
62 64
   bool canMove(const extruder_t);
63 65
   void enqueueCommands_P(PGM_P const);
66
+  bool commandsInQueue();
64 67
 
65 68
   /**
66 69
    * Getters and setters
@@ -110,8 +113,10 @@ namespace ExtUI {
110 113
     bool getLevelingActive();
111 114
     void setLevelingActive(const bool);
112 115
     #if HAS_MESH
116
+      #include "../../feature/bedlevel/bedlevel.h"
113 117
       bool getMeshValid();
114 118
       bed_mesh_t getMeshArray();
119
+      float getMeshPoint(const uint8_t xpos, const uint8_t ypos);
115 120
       void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval);
116 121
       void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval);
117 122
     #endif

+ 1
- 0
Marlin/src/lcd/ultralcd.cpp View File

@@ -25,6 +25,7 @@
25 25
 // These displays all share the MarlinUI class
26 26
 #if HAS_SPI_LCD || EITHER(MALYAN_LCD, EXTENSIBLE_UI)
27 27
   #include "ultralcd.h"
28
+  #include "fontutils.h"
28 29
   MarlinUI ui;
29 30
   #include "../sd/cardreader.h"
30 31
   #if ENABLED(EXTENSIBLE_UI)

Loading…
Cancel
Save