|
@@ -29,9 +29,16 @@
|
29
|
29
|
#include "rotary_encoder.h"
|
30
|
30
|
#include "../../../libs/BL24CXX.h"
|
31
|
31
|
|
32
|
|
-#include <stdint.h>
|
|
32
|
+#include "../../../inc/MarlinConfigPre.h"
|
33
|
33
|
|
34
|
|
-enum processID {
|
|
34
|
+#if ANY(HAS_HOTEND, HAS_HEATED_BED, HAS_FAN) && PREHEAT_COUNT
|
|
35
|
+ #define HAS_PREHEAT 1
|
|
36
|
+ #if PREHEAT_COUNT < 2
|
|
37
|
+ #error "Creality DWIN requires two material preheat presets."
|
|
38
|
+ #endif
|
|
39
|
+#endif
|
|
40
|
+
|
|
41
|
+enum processID : uint8_t {
|
35
|
42
|
// Process ID
|
36
|
43
|
MainMenu,
|
37
|
44
|
SelectFile,
|
|
@@ -44,7 +51,7 @@ enum processID {
|
44
|
51
|
Motion,
|
45
|
52
|
Info,
|
46
|
53
|
Tune,
|
47
|
|
- #if HAS_HOTEND
|
|
54
|
+ #if HAS_PREHEAT
|
48
|
55
|
PLAPreheat,
|
49
|
56
|
ABSPreheat,
|
50
|
57
|
#endif
|
|
@@ -218,7 +225,7 @@ enum processID {
|
218
|
225
|
#define BarFill_Color 0x10E4 // fill color of progress bar
|
219
|
226
|
#define Select_Color 0x33BB // selected color
|
220
|
227
|
|
221
|
|
-extern int checkkey, last_checkkey;
|
|
228
|
+extern uint8_t checkkey;
|
222
|
229
|
extern float zprobe_zoffset;
|
223
|
230
|
extern char print_filename[16];
|
224
|
231
|
|
|
@@ -227,7 +234,7 @@ extern millis_t dwin_heat_time;
|
227
|
234
|
typedef struct {
|
228
|
235
|
TERN_(HAS_HOTEND, int16_t E_Temp = 0);
|
229
|
236
|
TERN_(HAS_HEATED_BED, int16_t Bed_Temp = 0);
|
230
|
|
- TERN_(HAS_FAN, int16_t Fan_speed = 0);
|
|
237
|
+ TERN_(HAS_PREHEAT, int16_t Fan_speed = 0);
|
231
|
238
|
int16_t print_speed = 100;
|
232
|
239
|
float Max_Feedspeed = 0;
|
233
|
240
|
float Max_Acceleration = 0;
|
|
@@ -236,7 +243,7 @@ typedef struct {
|
236
|
243
|
float Move_X_scale = 0;
|
237
|
244
|
float Move_Y_scale = 0;
|
238
|
245
|
float Move_Z_scale = 0;
|
239
|
|
- #if EXTRUDERS
|
|
246
|
+ #if HAS_HOTEND
|
240
|
247
|
float Move_E_scale = 0;
|
241
|
248
|
#endif
|
242
|
249
|
float offset_value = 0;
|
|
@@ -246,33 +253,27 @@ typedef struct {
|
246
|
253
|
typedef struct {
|
247
|
254
|
bool language_chinese; // 0: EN, 1: CN
|
248
|
255
|
bool pause_flag:1;
|
|
256
|
+ bool pause_action:1;
|
249
|
257
|
bool print_finish:1;
|
250
|
|
- bool confirm_flag:1;
|
|
258
|
+ bool done_confirm_flag:1;
|
251
|
259
|
bool select_flag:1;
|
252
|
260
|
bool home_flag:1;
|
253
|
261
|
bool heat_flag:1; // 0: heating done 1: during heating
|
254
|
|
- #if HAS_HOTEND
|
|
262
|
+ #if ENABLED(PREVENT_COLD_EXTRUSION)
|
255
|
263
|
bool ETempTooLow_flag:1;
|
256
|
264
|
#endif
|
257
|
265
|
#if HAS_LEVELING
|
258
|
266
|
bool leveling_offset_flag:1;
|
259
|
267
|
#endif
|
260
|
268
|
#if HAS_FAN
|
261
|
|
- AxisEnum feedspeed_flag;
|
|
269
|
+ AxisEnum feedspeed_axis;
|
262
|
270
|
#endif
|
263
|
|
- AxisEnum acc_flag;
|
264
|
|
- AxisEnum jerk_flag;
|
265
|
|
- AxisEnum step_flag;
|
|
271
|
+ AxisEnum acc_axis, jerk_axis, step_axis;
|
266
|
272
|
} HMI_Flag;
|
267
|
273
|
|
268
|
274
|
extern HMI_value_t HMI_ValueStruct;
|
269
|
275
|
extern HMI_Flag HMI_flag;
|
270
|
276
|
|
271
|
|
-// Language
|
272
|
|
-void HMI_SetLanguage(void);
|
273
|
|
-void HMI_SetAndSaveLanguageWestern(void);
|
274
|
|
-void HMI_SetAndSaveLanguageChinese(void);
|
275
|
|
-
|
276
|
277
|
// Show ICO
|
277
|
278
|
void ICON_Print(bool show);
|
278
|
279
|
void ICON_Prepare(bool show);
|
|
@@ -285,44 +286,47 @@ void ICON_Pause(bool show);
|
285
|
286
|
void ICON_Continue(bool show);
|
286
|
287
|
void ICON_Stop(bool show);
|
287
|
288
|
|
288
|
|
-// Popup window tips
|
|
289
|
+#if HAS_HOTEND || HAS_HEATED_BED
|
|
290
|
+ // Popup message window
|
|
291
|
+ void DWIN_Popup_Temperature(const bool toohigh);
|
|
292
|
+#endif
|
|
293
|
+
|
289
|
294
|
#if HAS_HOTEND
|
290
|
|
- void Popup_Window_Temperature(const bool toohigh);
|
291
|
|
- void Popup_Window_ETempTooLow(void);
|
|
295
|
+ void Popup_Window_ETempTooLow();
|
292
|
296
|
#endif
|
293
|
297
|
|
294
|
|
-void Popup_Window_Resume(void);
|
295
|
|
-void Popup_Window_Home(void);
|
296
|
|
-void Popup_Window_Leveling(void);
|
|
298
|
+void Popup_Window_Resume();
|
|
299
|
+void Popup_Window_Home(const bool parking=false);
|
|
300
|
+void Popup_Window_Leveling();
|
297
|
301
|
|
298
|
|
-void Goto_PrintProcess(void);
|
299
|
|
-void Goto_MainMenu(void);
|
|
302
|
+void Goto_PrintProcess();
|
|
303
|
+void Goto_MainMenu();
|
300
|
304
|
|
301
|
305
|
// Variable control
|
302
|
|
-void HMI_Move_X(void);
|
303
|
|
-void HMI_Move_Y(void);
|
304
|
|
-void HMI_Move_Z(void);
|
305
|
|
-void HMI_Move_E(void);
|
|
306
|
+void HMI_Move_X();
|
|
307
|
+void HMI_Move_Y();
|
|
308
|
+void HMI_Move_Z();
|
|
309
|
+void HMI_Move_E();
|
306
|
310
|
|
307
|
|
-void HMI_Zoffset(void);
|
|
311
|
+void HMI_Zoffset();
|
308
|
312
|
|
309
|
|
-TERN_(HAS_HOTEND, void HMI_ETemp(void));
|
310
|
|
-TERN_(HAS_HEATED_BED, void HMI_BedTemp(void));
|
311
|
|
-TERN_(HAS_FAN, void HMI_FanSpeed(void));
|
|
313
|
+TERN_(HAS_HOTEND, void HMI_ETemp());
|
|
314
|
+TERN_(HAS_HEATED_BED, void HMI_BedTemp());
|
|
315
|
+TERN_(HAS_FAN, void HMI_FanSpeed());
|
312
|
316
|
|
313
|
|
-void HMI_PrintSpeed(void);
|
|
317
|
+void HMI_PrintSpeed();
|
314
|
318
|
|
315
|
|
-void HMI_MaxFeedspeedXYZE(void);
|
316
|
|
-void HMI_MaxAccelerationXYZE(void);
|
317
|
|
-void HMI_MaxJerkXYZE(void);
|
318
|
|
-void HMI_StepXYZE(void);
|
|
319
|
+void HMI_MaxFeedspeedXYZE();
|
|
320
|
+void HMI_MaxAccelerationXYZE();
|
|
321
|
+void HMI_MaxJerkXYZE();
|
|
322
|
+void HMI_StepXYZE();
|
319
|
323
|
|
320
|
|
-void update_variable(void);
|
|
324
|
+void update_variable();
|
321
|
325
|
void DWIN_Draw_Signed_Float(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value);
|
322
|
326
|
|
323
|
327
|
// SD Card
|
324
|
|
-void HMI_SDCardInit(void);
|
325
|
|
-void HMI_SDCardUpdate(void);
|
|
328
|
+void HMI_SDCardInit();
|
|
329
|
+void HMI_SDCardUpdate();
|
326
|
330
|
|
327
|
331
|
// Main Process
|
328
|
332
|
void Icon_print(bool value);
|
|
@@ -333,32 +337,32 @@ void Icon_leveling(bool value);
|
333
|
337
|
// Other
|
334
|
338
|
bool Pause_HeatStatus();
|
335
|
339
|
void HMI_StartFrame(const bool with_update); // Startup screen
|
336
|
|
-void HMI_MainMenu(void); // Main process screen
|
337
|
|
-void HMI_SelectFile(void); // File page
|
338
|
|
-void HMI_Printing(void); // Print page
|
339
|
|
-void HMI_Prepare(void); // Prepare page
|
340
|
|
-void HMI_Control(void); // Control page
|
341
|
|
-void HMI_Leveling(void); // Level the page
|
342
|
|
-void HMI_AxisMove(void); // Axis movement menu
|
343
|
|
-void HMI_Temperature(void); // Temperature menu
|
344
|
|
-void HMI_Motion(void); // Sports menu
|
345
|
|
-void HMI_Info(void); // Information menu
|
346
|
|
-void HMI_Tune(void); // Adjust the menu
|
347
|
|
-
|
348
|
|
-#if HAS_HOTEND
|
349
|
|
- void HMI_PLAPreheatSetting(void); // PLA warm-up setting
|
350
|
|
- void HMI_ABSPreheatSetting(void); // ABS warm-up setting
|
|
340
|
+void HMI_MainMenu(); // Main process screen
|
|
341
|
+void HMI_SelectFile(); // File page
|
|
342
|
+void HMI_Printing(); // Print page
|
|
343
|
+void HMI_Prepare(); // Prepare page
|
|
344
|
+void HMI_Control(); // Control page
|
|
345
|
+void HMI_Leveling(); // Level the page
|
|
346
|
+void HMI_AxisMove(); // Axis movement menu
|
|
347
|
+void HMI_Temperature(); // Temperature menu
|
|
348
|
+void HMI_Motion(); // Sports menu
|
|
349
|
+void HMI_Info(); // Information menu
|
|
350
|
+void HMI_Tune(); // Adjust the menu
|
|
351
|
+
|
|
352
|
+#if HAS_PREHEAT
|
|
353
|
+ void HMI_PLAPreheatSetting(); // PLA warm-up setting
|
|
354
|
+ void HMI_ABSPreheatSetting(); // ABS warm-up setting
|
351
|
355
|
#endif
|
352
|
356
|
|
353
|
|
-void HMI_MaxSpeed(void); // Maximum speed submenu
|
354
|
|
-void HMI_MaxAcceleration(void); // Maximum acceleration submenu
|
355
|
|
-void HMI_MaxJerk(void); // Maximum jerk speed submenu
|
356
|
|
-void HMI_Step(void); // Transmission ratio
|
|
357
|
+void HMI_MaxSpeed(); // Maximum speed submenu
|
|
358
|
+void HMI_MaxAcceleration(); // Maximum acceleration submenu
|
|
359
|
+void HMI_MaxJerk(); // Maximum jerk speed submenu
|
|
360
|
+void HMI_Step(); // Transmission ratio
|
357
|
361
|
|
358
|
|
-void HMI_Init(void);
|
359
|
|
-void DWIN_Update(void);
|
360
|
|
-void EachMomentUpdate(void);
|
361
|
|
-void DWIN_HandleScreen(void);
|
|
362
|
+void HMI_Init();
|
|
363
|
+void DWIN_Update();
|
|
364
|
+void EachMomentUpdate();
|
|
365
|
+void DWIN_HandleScreen();
|
362
|
366
|
|
363
|
|
-void DWIN_CompletedHoming(void);
|
364
|
|
-void DWIN_CompletedLeveling(void);
|
|
367
|
+void DWIN_CompletedHoming();
|
|
368
|
+void DWIN_CompletedLeveling();
|