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
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
32
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
33
 #include "../../../core/debug_out.h"
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
 int bilinear_grid_spacing[2], bilinear_start[2];
39
 int bilinear_grid_spacing[2], bilinear_start[2];
36
 float bilinear_grid_factor[2],
40
 float bilinear_grid_factor[2],
37
       z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
41
       z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];

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

42
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
42
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
43
 #include "../../core/debug_out.h"
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
 bool leveling_is_valid() {
49
 bool leveling_is_valid() {
46
   return
50
   return
47
     #if ENABLED(MESH_BED_LEVELING)
51
     #if ENABLED(MESH_BED_LEVELING)

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

656
   // Resume the print job timer if it was running
656
   // Resume the print job timer if it was running
657
   if (print_job_timer.isPaused()) print_job_timer.start();
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
 #endif // ADVANCED_PAUSE_FEATURE
664
 #endif // ADVANCED_PAUSE_FEATURE

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

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

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

51
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
51
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
52
 #include "../../../core/debug_out.h"
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
 #if ABL_GRID
58
 #if ABL_GRID
55
   #if ENABLED(PROBE_Y_FIRST)
59
   #if ENABLED(PROBE_Y_FIRST)
56
     #define PR_OUTER_VAR xCount
60
     #define PR_OUTER_VAR xCount

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

31
 #include "../../gcode.h"
31
 #include "../../gcode.h"
32
 #include "../../../feature/bedlevel/abl/abl.h"
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
  * M421: Set a single Mesh Bed Leveling Z coordinate
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
     #if HAS_MESH
715
     #if HAS_MESH
716
       bool getMeshValid() { return leveling_is_valid(); }
716
       bool getMeshValid() { return leveling_is_valid(); }
717
       bed_mesh_t getMeshArray() { return Z_VALUES_ARR; }
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
       void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) {
719
       void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zoff) {
719
         if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) {
720
         if (WITHIN(xpos, 0, GRID_MAX_POINTS_X) && WITHIN(ypos, 0, GRID_MAX_POINTS_Y)) {
720
           Z_VALUES(xpos, ypos) = zoff;
721
           Z_VALUES(xpos, ypos) = zoff;
748
     enqueue_and_echo_commands_P(gcode);
749
     enqueue_and_echo_commands_P(gcode);
749
   }
750
   }
750
 
751
 
752
+  bool commandsInQueue() { return (planner.movesplanned() || commands_in_queue); }
753
+  
751
   bool isAxisPositionKnown(const axis_t axis) {
754
   bool isAxisPositionKnown(const axis_t axis) {
752
     return TEST(axis_known_position, axis);
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
   PGM_P getFirmwareName_str() {
761
   PGM_P getFirmwareName_str() {
756
     static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION;
762
     static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION;
757
     return firmware_name;
763
     return firmware_name;

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

58
 
58
 
59
   bool isMoving();
59
   bool isMoving();
60
   bool isAxisPositionKnown(const axis_t);
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
   bool canMove(const axis_t);
63
   bool canMove(const axis_t);
62
   bool canMove(const extruder_t);
64
   bool canMove(const extruder_t);
63
   void enqueueCommands_P(PGM_P const);
65
   void enqueueCommands_P(PGM_P const);
66
+  bool commandsInQueue();
64
 
67
 
65
   /**
68
   /**
66
    * Getters and setters
69
    * Getters and setters
110
     bool getLevelingActive();
113
     bool getLevelingActive();
111
     void setLevelingActive(const bool);
114
     void setLevelingActive(const bool);
112
     #if HAS_MESH
115
     #if HAS_MESH
116
+      #include "../../feature/bedlevel/bedlevel.h"
113
       bool getMeshValid();
117
       bool getMeshValid();
114
       bed_mesh_t getMeshArray();
118
       bed_mesh_t getMeshArray();
119
+      float getMeshPoint(const uint8_t xpos, const uint8_t ypos);
115
       void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval);
120
       void setMeshPoint(const uint8_t xpos, const uint8_t ypos, const float zval);
116
       void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval);
121
       void onMeshUpdate(const uint8_t xpos, const uint8_t ypos, const float zval);
117
     #endif
122
     #endif

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

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

Loading…
Cancel
Save