Browse Source

Fix ExtUI invalid speed, timer (#15031)

InsanityAutomation 6 years ago
parent
commit
f218405c36

+ 2
- 2
Marlin/src/feature/babystep.cpp View File

37
 
37
 
38
 volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1];
38
 volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1];
39
 
39
 
40
-#if HAS_LCD_MENU
40
+#if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
41
   int16_t Babystep::accum;
41
   int16_t Babystep::accum;
42
   #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
42
   #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
43
     int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
43
     int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
75
 
75
 
76
   if (!CAN_BABYSTEP(axis)) return;
76
   if (!CAN_BABYSTEP(axis)) return;
77
 
77
 
78
-  #if HAS_LCD_MENU
78
+  #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
79
     accum += distance; // Count up babysteps for the UI
79
     accum += distance; // Count up babysteps for the UI
80
     #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
80
     #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
81
       axis_total[BS_TOTAL_AXIS(axis)] += distance;
81
       axis_total[BS_TOTAL_AXIS(axis)] += distance;

+ 2
- 2
Marlin/src/feature/babystep.h View File

30
   #define BS_TODO_AXIS(A) 0
30
   #define BS_TODO_AXIS(A) 0
31
 #endif
31
 #endif
32
 
32
 
33
-#if HAS_LCD_MENU && ENABLED(BABYSTEP_DISPLAY_TOTAL)
33
+#if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(BABYSTEP_DISPLAY_TOTAL)
34
   #if ENABLED(BABYSTEP_XY)
34
   #if ENABLED(BABYSTEP_XY)
35
     #define BS_TOTAL_AXIS(A) A
35
     #define BS_TOTAL_AXIS(A) A
36
   #else
36
   #else
41
 class Babystep {
41
 class Babystep {
42
 public:
42
 public:
43
   static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1];
43
   static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1];
44
-  #if HAS_LCD_MENU
44
+  #if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
45
     static int16_t accum;                                     // Total babysteps in current edit
45
     static int16_t accum;                                     // Total babysteps in current edit
46
     #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
46
     #if ENABLED(BABYSTEP_DISPLAY_TOTAL)
47
       static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];   // Total babysteps since G28
47
       static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];   // Total babysteps since G28

+ 4
- 4
Marlin/src/feature/pause.cpp View File

188
       host_action_prompt_show();
188
       host_action_prompt_show();
189
     #endif
189
     #endif
190
     #if ENABLED(EXTENSIBLE_UI)
190
     #if ENABLED(EXTENSIBLE_UI)
191
-      ExtUI::onStatusChanged(PSTR("Load Filament"));
191
+      ExtUI::onUserConfirmRequired(PSTR("Load Filament"));
192
     #endif
192
     #endif
193
     while (wait_for_user) {
193
     while (wait_for_user) {
194
       #if HAS_BUZZER
194
       #if HAS_BUZZER
243
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Continuous Purge Running..."), PSTR("Continue"));
243
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Continuous Purge Running..."), PSTR("Continue"));
244
     #endif
244
     #endif
245
     #if ENABLED(EXTENSIBLE_UI)
245
     #if ENABLED(EXTENSIBLE_UI)
246
-      ExtUI::onStatusChanged(PSTR("Continuous Purge Running..."));
246
+      ExtUI::onUserConfirmRequired(PSTR("Continuous Purge Running..."));
247
     #endif
247
     #endif
248
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
248
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
249
       do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
249
       do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
524
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue"));
524
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue"));
525
   #endif
525
   #endif
526
   #if ENABLED(EXTENSIBLE_UI)
526
   #if ENABLED(EXTENSIBLE_UI)
527
-    ExtUI::onStatusChanged(PSTR("Nozzle Parked"));
527
+    ExtUI::onUserConfirmRequired(PSTR("Nozzle Parked"));
528
   #endif
528
   #endif
529
   while (wait_for_user) {
529
   while (wait_for_user) {
530
     #if HAS_BUZZER
530
     #if HAS_BUZZER
548
       #endif
548
       #endif
549
 
549
 
550
       #if ENABLED(EXTENSIBLE_UI)
550
       #if ENABLED(EXTENSIBLE_UI)
551
-        ExtUI::onStatusChanged(PSTR("HeaterTimeout"));
551
+        ExtUI::onUserConfirmRequired(PSTR("HeaterTimeout"));
552
       #endif
552
       #endif
553
 
553
 
554
       // Wait for LCD click or M108
554
       // Wait for LCD click or M108

+ 1
- 1
Marlin/src/feature/prusa_MMU2/mmu2.cpp View File

716
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue"));
716
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue"));
717
       #endif
717
       #endif
718
       #if ENABLED(EXTENSIBLE_UI)
718
       #if ENABLED(EXTENSIBLE_UI)
719
-        ExtUI::onStatusChanged(PSTR("MMU2 Eject Recover"));
719
+        ExtUI::onUserConfirmRequired(PSTR("MMU2 Eject Recover"));
720
       #endif
720
       #endif
721
       while (wait_for_user) idle();
721
       while (wait_for_user) idle();
722
       BUZZ(200, 404);
722
       BUZZ(200, 404);

+ 1
- 1
Marlin/src/gcode/config/M43.cpp View File

334
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
334
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
335
       #endif
335
       #endif
336
       #if ENABLED(EXTENSIBLE_UI)
336
       #if ENABLED(EXTENSIBLE_UI)
337
-        ExtUI::onStatusChanged(PSTR("M43 Wait Called"));
337
+        ExtUI::onUserConfirmRequired(PSTR("M43 Wait Called"));
338
       #endif
338
       #endif
339
     #endif
339
     #endif
340
 
340
 

+ 1
- 5
Marlin/src/gcode/lcd/M0_M1.cpp View File

98
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
98
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
99
   #endif
99
   #endif
100
   #if ENABLED(EXTENSIBLE_UI)
100
   #if ENABLED(EXTENSIBLE_UI)
101
-    ExtUI::onStatusChanged(PSTR("M0/1 Break Called"));
101
+    ExtUI::onUserConfirmRequired(PSTR("M0/1 Break Called"));
102
   #endif
102
   #endif
103
 
103
 
104
   if (ms > 0) {
104
   if (ms > 0) {
108
   else
108
   else
109
     while (wait_for_user) idle();
109
     while (wait_for_user) idle();
110
 
110
 
111
-  #if ENABLED(EXTENSIBLE_UI)
112
-    ExtUI::onUserConfirmRequired(nullptr);
113
-  #endif
114
-
115
   #if HAS_LEDS_OFF_FLAG
111
   #if HAS_LEDS_OFF_FLAG
116
     printerEventLEDs.onResumeAfterWait();
112
     printerEventLEDs.onResumeAfterWait();
117
   #endif
113
   #endif

+ 0
- 3
Marlin/src/gcode/stats/M75-M78.cpp View File

33
  */
33
  */
34
 void GcodeSuite::M75() {
34
 void GcodeSuite::M75() {
35
   print_job_timer.start();
35
   print_job_timer.start();
36
-  #if ENABLED(EXTENSIBLE_UI)
37
-    ExtUI::onPrintTimerStarted();
38
-  #endif
39
 }
36
 }
40
 
37
 
41
 /**
38
 /**

+ 19
- 10
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

320
     #endif
320
     #endif
321
 
321
 
322
     constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
322
     constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
323
-    setFeedrate_mm_s(max_manual_feedrate[axis]);
323
+    setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[axis]));
324
 
324
 
325
     if (!flags.manual_motion) set_destination_from_current();
325
     if (!flags.manual_motion) set_destination_from_current();
326
     destination[axis] = clamp(position, min, max);
326
     destination[axis] = clamp(position, min, max);
331
     setActiveTool(extruder, true);
331
     setActiveTool(extruder, true);
332
 
332
 
333
     constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
333
     constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
334
-    setFeedrate_mm_s(max_manual_feedrate[E_AXIS]);
334
+    setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[E_AXIS]));
335
     if (!flags.manual_motion) set_destination_from_current();
335
     if (!flags.manual_motion) set_destination_from_current();
336
     destination[E_AXIS] = position;
336
     destination[E_AXIS] = position;
337
     flags.manual_motion = true;
337
     flags.manual_motion = true;
714
     }
714
     }
715
   #endif
715
   #endif
716
 
716
 
717
-  #if HAS_BED_PROBE
718
-    float getZOffset_mm() {
717
+  float getZOffset_mm() {
718
+    #if HAS_BED_PROBE
719
       return zprobe_zoffset;
719
       return zprobe_zoffset;
720
-    }
720
+    #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
721
+      return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
722
+    #else
723
+      return 0.0;
724
+    #endif
725
+  }
721
 
726
 
722
-    void setZOffset_mm(const float value) {
723
-      if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
727
+  void setZOffset_mm(const float value) {
728
+    #if HAS_BED_PROBE
729
+      if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
724
         zprobe_zoffset = value;
730
         zprobe_zoffset = value;
725
-      }
726
-    }
727
-  #endif // HAS_BED_PROBE
731
+    #elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
732
+      babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]));
733
+    #else
734
+      UNUSED(value);
735
+    #endif
736
+  }
728
 
737
 
729
   #if HAS_HOTEND_OFFSET
738
   #if HAS_HOTEND_OFFSET
730
 
739
 

+ 2
- 4
Marlin/src/lcd/extensible_ui/ui_api.h View File

198
     void normalizeNozzleOffset(const axis_t axis);
198
     void normalizeNozzleOffset(const axis_t axis);
199
   #endif
199
   #endif
200
 
200
 
201
-  #if HAS_BED_PROBE
202
-    float getZOffset_mm();
203
-    void setZOffset_mm(const float);
204
-  #endif
201
+  float getZOffset_mm();
202
+  void setZOffset_mm(const float);
205
 
203
 
206
   #if ENABLED(BACKLASH_GCODE)
204
   #if ENABLED(BACKLASH_GCODE)
207
     float getAxisBacklash_mm(const axis_t);
205
     float getAxisBacklash_mm(const axis_t);

+ 1
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

60
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
60
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
61
     #endif
61
     #endif
62
     #if ENABLED(EXTENSIBLE_UI)
62
     #if ENABLED(EXTENSIBLE_UI)
63
-      ExtUI::onStatusChanged(PSTR("Delta Calibration in progress"));
63
+      ExtUI::onUserConfirmRequired(PSTR("Delta Calibration in progress"));
64
     #endif
64
     #endif
65
     while (wait_for_user) idle();
65
     while (wait_for_user) idle();
66
     ui.goto_previous_screen_no_defer();
66
     ui.goto_previous_screen_no_defer();

+ 4
- 0
Marlin/src/libs/stopwatch.cpp View File

60
     Stopwatch::debug(PSTR("start"));
60
     Stopwatch::debug(PSTR("start"));
61
   #endif
61
   #endif
62
 
62
 
63
+  #if ENABLED(EXTENSIBLE_UI)
64
+    ExtUI::onPrintTimerStarted();
65
+  #endif
66
+
63
   if (!isRunning()) {
67
   if (!isRunning()) {
64
     if (isPaused()) accumulator = duration();
68
     if (isPaused()) accumulator = duration();
65
     else reset();
69
     else reset();

+ 1
- 1
Marlin/src/module/probe.cpp View File

378
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), PSTR("Continue"));
378
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), PSTR("Continue"));
379
       #endif
379
       #endif
380
       #if ENABLED(EXTENSIBLE_UI)
380
       #if ENABLED(EXTENSIBLE_UI)
381
-        ExtUI::onStatusChanged(PSTR("Stow Probe"));
381
+        ExtUI::onUserConfirmRequired(PSTR("Stow Probe"));
382
       #endif
382
       #endif
383
       while (wait_for_user) idle();
383
       while (wait_for_user) idle();
384
       ui.reset_status();
384
       ui.reset_status();

Loading…
Cancel
Save