Browse Source

ExtUI Heated Chamber support (#14198)

InsanityAutomation 6 years ago
parent
commit
66e22d9f5a

+ 39
- 22
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

@@ -170,12 +170,17 @@ namespace ExtUI {
170 170
 
171 171
   void enableHeater(const heater_t heater) {
172 172
     #if HEATER_IDLE_HANDLER
173
-      #if HAS_HEATED_BED
174
-        if (heater == BED)
175
-          thermalManager.reset_bed_idle_timer();
176
-        else
177
-      #endif
178
-          thermalManager.reset_heater_idle_timer(heater - H0);
173
+      switch (heater) {
174
+        #if HAS_HEATED_BED
175
+          case BED:
176
+            thermalManager.reset_bed_idle_timer();
177
+            return;
178
+        #endif
179
+        #if HAS_HEATED_CHAMBER
180
+          case CHAMBER: return; // Chamber has no idle timer
181
+        #endif
182
+        default: thermalManager.reset_heater_idle_timer(heater - H0);
183
+      }
179 184
     #endif
180 185
   }
181 186
 
@@ -188,23 +193,31 @@ namespace ExtUI {
188 193
   }
189 194
 
190 195
   bool isHeaterIdle(const heater_t heater) {
191
-    return (false
192
-      #if HEATER_IDLE_HANDLER
193
-        || (heater == BED ? (false
194
-          #if HAS_HEATED_BED
195
-            || thermalManager.bed_idle.timed_out
196
-          #endif
197
-        ) : thermalManager.hotend_idle[heater - H0].timed_out)
198
-      #endif
199
-    );
196
+    #if HEATER_IDLE_HANDLER
197
+      switch (heater) {
198
+        #if HAS_HEATED_BED
199
+          case BED: return thermalManager.bed_idle.timed_out;
200
+        #endif
201
+        #if HAS_HEATED_CHAMBER
202
+          case CHAMBER: return false; // Chamber has no idle timer
203
+        #endif
204
+        default: return thermalManager.hotend_idle[heater - H0].timed_out;
205
+      }
206
+    #else
207
+      return false;
208
+    #endif
200 209
   }
201 210
 
202 211
   float getActualTemp_celsius(const heater_t heater) {
203
-    return heater == BED ? (0
212
+    switch (heater) {
204 213
       #if HAS_HEATED_BED
205
-        + thermalManager.degBed()
214
+        case BED: return thermalManager.degBed();
215
+      #endif
216
+      #if HAS_HEATED_CHAMBER
217
+        case CHAMBER: return thermalManager.degChamber();
206 218
       #endif
207
-    ) : thermalManager.degHotend(heater - H0);
219
+      default: return thermalManager.degHotend(heater - H0);
220
+    }
208 221
   }
209 222
 
210 223
   float getActualTemp_celsius(const extruder_t extruder) {
@@ -212,11 +225,15 @@ namespace ExtUI {
212 225
   }
213 226
 
214 227
   float getTargetTemp_celsius(const heater_t heater) {
215
-    return heater == BED ? (0
228
+    switch (heater) {
216 229
       #if HAS_HEATED_BED
217
-        + thermalManager.degTargetBed()
230
+        case BED: return thermalManager.degTargetBed();
218 231
       #endif
219
-    ) : thermalManager.degTargetHotend(heater - H0);
232
+      #if HAS_HEATED_CHAMBER
233
+        case CHAMBER: return thermalManager.degTargetChamber();
234
+      #endif
235
+      default: return thermalManager.degTargetHotend(heater - H0);
236
+    }
220 237
   }
221 238
 
222 239
   float getTargetTemp_celsius(const extruder_t extruder) {
@@ -839,7 +856,7 @@ namespace ExtUI {
839 856
   }
840 857
 
841 858
   void stopPrint() {
842
-    ui.stop_print();
859
+    ui.abort_print();
843 860
   }
844 861
 
845 862
   FileList::FileList() { refresh(); }

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

@@ -54,7 +54,7 @@ namespace ExtUI {
54 54
 
55 55
   enum axis_t     : uint8_t { X, Y, Z };
56 56
   enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5 };
57
-  enum heater_t   : uint8_t { H0, H1, H2, H3, H4, H5, BED };
57
+  enum heater_t   : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER };
58 58
   enum fan_t      : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5 };
59 59
 
60 60
   constexpr uint8_t extruderCount = EXTRUDERS;

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

@@ -1380,7 +1380,9 @@ void MarlinUI::update() {
1380 1380
   }
1381 1381
 
1382 1382
   void MarlinUI::pause_print() {
1383
-    synchronize(PSTR(MSG_PAUSE_PRINT));
1383
+    #if HAS_LCD_MENU
1384
+      synchronize(PSTR(MSG_PAUSE_PRINT));
1385
+    #endif
1384 1386
 
1385 1387
     #if ENABLED(POWER_LOSS_RECOVERY)
1386 1388
       if (recovery.enabled) recovery.save(true, false);

+ 1
- 1
buildroot/share/tests/DUE-tests View File

@@ -7,7 +7,7 @@
7 7
 set -e
8 8
 
9 9
 restore_configs
10
-opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB
10
+opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB EXTENSIBLE_UI EXTUI_EXAMPLE
11 11
 opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS
12 12
 opt_set E0_AUTO_FAN_PIN 8
13 13
 opt_set EXTRUDER_AUTO_FAN_SPEED 100

Loading…
Cancel
Save