Browse Source

Fix MKS LVGL UI Main screen / print buttons (#21468)

Malderin 3 years ago
parent
commit
a335cf2edf
No account linked to committer's email address

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp View File

486
 
486
 
487
 void filament_sprayer_temp() {
487
 void filament_sprayer_temp() {
488
   char buf[20] = {0};
488
   char buf[20] = {0};
489
-  sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
489
+  sprintf(buf, preheat_menu.value_state, thermalManager.degHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));
490
 
490
 
491
   strcpy(public_buf_l, uiCfg.extruderIndex < 1 ? extrude_menu.ext1 : extrude_menu.ext2);
491
   strcpy(public_buf_l, uiCfg.extruderIndex < 1 ? extrude_menu.ext1 : extrude_menu.ext2);
492
   strcat_P(public_buf_l, PSTR(": "));
492
   strcat_P(public_buf_l, PSTR(": "));

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp View File

195
 
195
 
196
 void disp_hotend_temp() {
196
 void disp_hotend_temp() {
197
   char buf[20] = {0};
197
   char buf[20] = {0};
198
-  sprintf(buf, extrude_menu.temp_value, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
198
+  sprintf(buf, extrude_menu.temp_value, thermalManager.degHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));
199
   strcpy(public_buf_l, extrude_menu.temper_text);
199
   strcpy(public_buf_l, extrude_menu.temper_text);
200
   strcat(public_buf_l, buf);
200
   strcat(public_buf_l, buf);
201
   lv_label_set_text(tempText, public_buf_l);
201
   lv_label_set_text(tempText, public_buf_l);

+ 5
- 5
Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp View File

50
   switch (obj->mks_obj_id) {
50
   switch (obj->mks_obj_id) {
51
     case ID_FILAMNT_IN:
51
     case ID_FILAMNT_IN:
52
       uiCfg.filament_load_heat_flg = true;
52
       uiCfg.filament_load_heat_flg = true;
53
-      if ((abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex)) <= 1)
54
-          || (gCfgItems.filament_limit_temp <= thermalManager.degHotend(uiCfg.extruderIndex))) {
53
+      if (abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex)) <= 1
54
+          || gCfgItems.filament_limit_temp <= thermalManager.degHotend(uiCfg.extruderIndex)) {
55
         lv_clear_filament_change();
55
         lv_clear_filament_change();
56
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED);
56
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED);
57
       }
57
       }
67
     case ID_FILAMNT_OUT:
67
     case ID_FILAMNT_OUT:
68
       uiCfg.filament_unload_heat_flg = true;
68
       uiCfg.filament_unload_heat_flg = true;
69
       if (thermalManager.degTargetHotend(uiCfg.extruderIndex)
69
       if (thermalManager.degTargetHotend(uiCfg.extruderIndex)
70
-          && ((abs((int)((int)thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex))) <= 1)
71
-              || ((int)thermalManager.degHotend(uiCfg.extruderIndex) >= gCfgItems.filament_limit_temp))
70
+          && (abs((int)(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex))) <= 1
71
+              || thermalManager.degHotend(uiCfg.extruderIndex) >= gCfgItems.filament_limit_temp)
72
       ) {
72
       ) {
73
         lv_clear_filament_change();
73
         lv_clear_filament_change();
74
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED);
74
         lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED);
154
   public_buf_l[0] = '\0';
154
   public_buf_l[0] = '\0';
155
 
155
 
156
   strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
156
   strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
157
-  sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
157
+  sprintf(buf, preheat_menu.value_state, thermalManager.degHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));
158
 
158
 
159
   strcat_P(public_buf_l, PSTR(": "));
159
   strcat_P(public_buf_l, PSTR(": "));
160
   strcat(public_buf_l, buf);
160
   strcat(public_buf_l, buf);

+ 4
- 4
Marlin/src/lcd/extui/lib/mks_ui/draw_preHeat.cpp View File

76
 
76
 
77
     case ID_P_DEC:
77
     case ID_P_DEC:
78
       if (uiCfg.curTempType == 0) {
78
       if (uiCfg.curTempType == 0) {
79
-        if ((int)thermalManager.degTargetHotend(uiCfg.extruderIndex) > uiCfg.stepHeat)
79
+        if (thermalManager.degTargetHotend(uiCfg.extruderIndex) > uiCfg.stepHeat)
80
           thermalManager.temp_hotend[uiCfg.extruderIndex].target -= uiCfg.stepHeat;
80
           thermalManager.temp_hotend[uiCfg.extruderIndex].target -= uiCfg.stepHeat;
81
         else
81
         else
82
           thermalManager.setTargetHotend(0, uiCfg.extruderIndex);
82
           thermalManager.setTargetHotend(0, uiCfg.extruderIndex);
84
       }
84
       }
85
       #if HAS_HEATED_BED
85
       #if HAS_HEATED_BED
86
         else {
86
         else {
87
-          if ((int)thermalManager.temp_bed.target > uiCfg.stepHeat)
87
+          if (thermalManager.degTargetBed() > uiCfg.stepHeat)
88
             thermalManager.temp_bed.target -= uiCfg.stepHeat;
88
             thermalManager.temp_bed.target -= uiCfg.stepHeat;
89
           else
89
           else
90
             thermalManager.setTargetBed(0);
90
             thermalManager.setTargetBed(0);
217
 
217
 
218
   if (uiCfg.curTempType == 0) {
218
   if (uiCfg.curTempType == 0) {
219
     strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
219
     strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
220
-    sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
220
+    sprintf(buf, preheat_menu.value_state, thermalManager.degHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));
221
   }
221
   }
222
   #if HAS_HEATED_BED
222
   #if HAS_HEATED_BED
223
     else {
223
     else {
224
       strcat(public_buf_l, preheat_menu.hotbed);
224
       strcat(public_buf_l, preheat_menu.hotbed);
225
-      sprintf(buf, preheat_menu.value_state, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target);
225
+      sprintf(buf, preheat_menu.value_state, thermalManager.degBed(), thermalManager.degTargetBed());
226
     }
226
     }
227
   #endif
227
   #endif
228
   strcat_P(public_buf_l, PSTR(": "));
228
   strcat_P(public_buf_l, PSTR(": "));

+ 36
- 22
Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp View File

47
 static lv_obj_t *labelExt1, *labelFan, *labelZpos, *labelTime;
47
 static lv_obj_t *labelExt1, *labelFan, *labelZpos, *labelTime;
48
 static lv_obj_t *labelPause, *labelStop, *labelOperat;
48
 static lv_obj_t *labelPause, *labelStop, *labelOperat;
49
 static lv_obj_t *bar1, *bar1ValueText;
49
 static lv_obj_t *bar1, *bar1ValueText;
50
-static lv_obj_t *buttonPause, *buttonOperat, *buttonStop;
50
+static lv_obj_t *buttonPause, *buttonOperat, *buttonStop, *buttonExt1, *buttonExt2, *buttonBedstate, *buttonFanstate, *buttonZpos;
51
 
51
 
52
 #if ENABLED(HAS_MULTI_EXTRUDER)
52
 #if ENABLED(HAS_MULTI_EXTRUDER)
53
   static lv_obj_t *labelExt2;
53
   static lv_obj_t *labelExt2;
60
 enum {
60
 enum {
61
   ID_PAUSE = 1,
61
   ID_PAUSE = 1,
62
   ID_STOP,
62
   ID_STOP,
63
-  ID_OPTION
63
+  ID_OPTION,
64
+  ID_TEMP_EXT,
65
+  ID_TEMP_BED,
66
+  ID_BABYSTEP,
67
+  ID_FAN
64
 };
68
 };
65
 
69
 
66
 bool once_flag; // = false
70
 bool once_flag; // = false
100
         }
104
         }
101
       #endif
105
       #endif
102
       break;
106
       break;
103
-
104
     case ID_STOP:
107
     case ID_STOP:
105
       lv_clear_printing();
108
       lv_clear_printing();
106
       lv_draw_dialog(DIALOG_TYPE_STOP);
109
       lv_draw_dialog(DIALOG_TYPE_STOP);
109
       lv_clear_printing();
112
       lv_clear_printing();
110
       lv_draw_operation();
113
       lv_draw_operation();
111
       break;
114
       break;
115
+    case ID_TEMP_EXT:
116
+      uiCfg.curTempType = 0;
117
+      lv_clear_printing();
118
+      lv_draw_preHeat();
119
+      break;
120
+    case ID_TEMP_BED:
121
+      uiCfg.curTempType = 1;
122
+      lv_clear_printing();
123
+      lv_draw_preHeat();
124
+      break;
125
+    case ID_BABYSTEP:
126
+      lv_clear_printing();
127
+      lv_draw_baby_stepping();
128
+      break;
129
+    case ID_FAN:
130
+      lv_clear_printing();
131
+      lv_draw_fan();
132
+      break;
112
   }
133
   }
113
 }
134
 }
114
 
135
 
118
   scr = lv_screen_create(PRINTING_UI);
139
   scr = lv_screen_create(PRINTING_UI);
119
 
140
 
120
   // Create image buttons
141
   // Create image buttons
121
-  lv_obj_t *buttonExt1 = lv_img_create(scr, nullptr);
122
-  lv_img_set_src(buttonExt1, "F:/bmp_ext1_state.bin");
123
-  lv_obj_set_pos(buttonExt1, 205, 136);
142
+  buttonExt1 = lv_imgbtn_create(scr, "F:/bmp_ext1_state.bin", 206, 136, event_handler, ID_TEMP_EXT);
124
 
143
 
125
   #if HAS_MULTI_EXTRUDER
144
   #if HAS_MULTI_EXTRUDER
126
-    lv_obj_t *buttonExt2 = lv_img_create(scr, nullptr);
127
-    lv_img_set_src(buttonExt2, "F:/bmp_ext2_state.bin");
128
-    lv_obj_set_pos(buttonExt2, 350, 136);
145
+    buttonExt2 = lv_imgbtn_create(scr, "F:/bmp_ext2_state.bin", 350, 136, event_handler, ID_TEMP_EXT);
129
   #endif
146
   #endif
130
 
147
 
131
   #if HAS_HEATED_BED
148
   #if HAS_HEATED_BED
132
-    lv_obj_t *buttonBedstate = lv_img_create(scr, nullptr);
133
-    lv_img_set_src(buttonBedstate, "F:/bmp_bed_state.bin");
134
-    lv_obj_set_pos(buttonBedstate, 205, 186);
149
+    buttonBedstate = lv_imgbtn_create(scr, "F:/bmp_bed_state.bin", 206, 186, event_handler, ID_TEMP_BED);
135
   #endif
150
   #endif
136
 
151
 
137
-  lv_obj_t *buttonFanstate = lv_img_create(scr, nullptr);
138
-  lv_img_set_src(buttonFanstate, "F:/bmp_fan_state.bin");
139
-  lv_obj_set_pos(buttonFanstate, 350, 186);
152
+  buttonFanstate = lv_imgbtn_create(scr, "F:/bmp_fan_state.bin", 350, 186, event_handler, ID_FAN);
140
 
153
 
141
   lv_obj_t *buttonTime = lv_img_create(scr, nullptr);
154
   lv_obj_t *buttonTime = lv_img_create(scr, nullptr);
142
   lv_img_set_src(buttonTime, "F:/bmp_time_state.bin");
155
   lv_img_set_src(buttonTime, "F:/bmp_time_state.bin");
143
-  lv_obj_set_pos(buttonTime, 205, 86);
156
+  lv_obj_set_pos(buttonTime, 206, 86);
144
 
157
 
145
-  lv_obj_t *buttonZpos = lv_img_create(scr, nullptr);
146
-  lv_img_set_src(buttonZpos, "F:/bmp_zpos_state.bin");
147
-  lv_obj_set_pos(buttonZpos, 350, 86);
158
+  buttonZpos = lv_imgbtn_create(scr, "F:/bmp_zpos_state.bin", 350, 86, event_handler, ID_BABYSTEP);
148
 
159
 
149
   buttonPause = lv_imgbtn_create(scr, uiCfg.print_state == WORKING ? "F:/bmp_pause.bin" : "F:/bmp_resume.bin", 5, 240, event_handler, ID_PAUSE);
160
   buttonPause = lv_imgbtn_create(scr, uiCfg.print_state == WORKING ? "F:/bmp_pause.bin" : "F:/bmp_resume.bin", 5, 240, event_handler, ID_PAUSE);
150
   buttonStop = lv_imgbtn_create(scr, "F:/bmp_stop.bin", 165, 240, event_handler, ID_STOP);
161
   buttonStop = lv_imgbtn_create(scr, "F:/bmp_stop.bin", 165, 240, event_handler, ID_STOP);
155
       lv_group_add_obj(g, buttonPause);
166
       lv_group_add_obj(g, buttonPause);
156
       lv_group_add_obj(g, buttonStop);
167
       lv_group_add_obj(g, buttonStop);
157
       lv_group_add_obj(g, buttonOperat);
168
       lv_group_add_obj(g, buttonOperat);
169
+      lv_group_add_obj(g, buttonPause);
170
+      lv_group_add_obj(g, buttonPause);
171
+      lv_group_add_obj(g, buttonPause);
158
     }
172
     }
159
   #endif
173
   #endif
160
 
174
 
205
 }
219
 }
206
 
220
 
207
 void disp_ext_temp() {
221
 void disp_ext_temp() {
208
-  sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0));
222
+  sprintf(public_buf_l, printing_menu.temp1, thermalManager.degHotend(0), thermalManager.degTargetHotend(0));
209
   lv_label_set_text(labelExt1, public_buf_l);
223
   lv_label_set_text(labelExt1, public_buf_l);
210
 
224
 
211
   #if HAS_MULTI_EXTRUDER
225
   #if HAS_MULTI_EXTRUDER
212
-    sprintf(public_buf_l, printing_menu.temp1, (int)thermalManager.degHotend(1), (int)thermalManager.degTargetHotend(1));
226
+    sprintf(public_buf_l, printing_menu.temp1, thermalManager.degHotend(1), thermalManager.degTargetHotend(1));
213
     lv_label_set_text(labelExt2, public_buf_l);
227
     lv_label_set_text(labelExt2, public_buf_l);
214
   #endif
228
   #endif
215
 }
229
 }
216
 
230
 
217
 void disp_bed_temp() {
231
 void disp_bed_temp() {
218
   #if HAS_HEATED_BED
232
   #if HAS_HEATED_BED
219
-    sprintf(public_buf_l, printing_menu.bed_temp, (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target);
233
+    sprintf(public_buf_l, printing_menu.bed_temp, thermalManager.degBed(), thermalManager.degTargetBed());
220
     lv_label_set_text(labelBed, public_buf_l);
234
     lv_label_set_text(labelBed, public_buf_l);
221
   #endif
235
   #endif
222
 }
236
 }

+ 23
- 23
Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp View File

63
   uint8_t curent_disp_ui = 0;
63
   uint8_t curent_disp_ui = 0;
64
 #endif
64
 #endif
65
 
65
 
66
-enum { ID_TOOL = 1, ID_SET, ID_PRINT };
66
+enum { ID_TOOL = 1, ID_SET, ID_PRINT, ID_INFO_EXT, ID_INFO_BED, ID_INFO_FAN };
67
 
67
 
68
 static void event_handler(lv_obj_t *obj, lv_event_t event) {
68
 static void event_handler(lv_obj_t *obj, lv_event_t event) {
69
   if (event != LV_EVENT_RELEASED) return;
69
   if (event != LV_EVENT_RELEASED) return;
71
   switch (obj->mks_obj_id) {
71
   switch (obj->mks_obj_id) {
72
     case ID_TOOL:   lv_draw_tool(); break;
72
     case ID_TOOL:   lv_draw_tool(); break;
73
     case ID_SET:    lv_draw_set(); break;
73
     case ID_SET:    lv_draw_set(); break;
74
+    case ID_INFO_EXT:  uiCfg.curTempType = 0; lv_draw_preHeat(); break;
75
+    case ID_INFO_BED:  uiCfg.curTempType = 1; lv_draw_preHeat(); break;
76
+    case ID_INFO_FAN:  lv_draw_fan(); break;
74
     case ID_PRINT:  lv_draw_print_file(); break;
77
     case ID_PRINT:  lv_draw_print_file(); break;
75
   }
78
   }
76
 }
79
 }
181
     lv_big_button_create(scr, "F:/bmp_printing.bin", main_menu.print, 340, 180, event_handler, ID_PRINT);
184
     lv_big_button_create(scr, "F:/bmp_printing.bin", main_menu.print, 340, 180, event_handler, ID_PRINT);
182
 
185
 
183
     // Monitoring
186
     // Monitoring
184
-    lv_obj_t *buttonExt1 = lv_img_create(scr, NULL);
187
+    lv_obj_t *buttonExt1 = lv_big_button_create(scr, "F:/bmp_ext1_state.bin", " ", 55, ICON_POS_Y, event_handler, ID_INFO_EXT);
185
     #if HAS_MULTI_EXTRUDER
188
     #if HAS_MULTI_EXTRUDER
186
-      lv_obj_t *buttonExt2 = lv_img_create(scr, NULL);
189
+        lv_obj_t *buttonExt2 = lv_big_button_create(scr, "F:/bmp_ext2_state.bin", " ", 55, ICON_POS_Y + SECOND_EXT_MOD_Y, event_handler, ID_INFO_EXT);
187
     #endif
190
     #endif
188
     #if HAS_HEATED_BED
191
     #if HAS_HEATED_BED
189
-      lv_obj_t *buttonBedstate = lv_img_create(scr, NULL);
192
+        lv_obj_t *buttonBedstate = lv_big_button_create(scr, "F:/bmp_bed_state.bin", " ", 210, ICON_POS_Y, event_handler, ID_INFO_BED);
190
     #endif
193
     #endif
191
-    lv_obj_t *buttonFanstate = lv_img_create(scr, NULL);
192
-
193
-    lv_img_set_src(buttonExt1, "F:/bmp_ext1_state.bin");
194
-    #if HAS_MULTI_EXTRUDER
195
-      lv_img_set_src(buttonExt2, "F:/bmp_ext2_state.bin");
196
-    #endif
197
-    #if HAS_HEATED_BED
198
-      lv_img_set_src(buttonBedstate, "F:/bmp_bed_state.bin");
199
-    #endif
200
-    lv_img_set_src(buttonFanstate, "F:/bmp_fan_state.bin");
201
-
202
-    lv_obj_set_pos(buttonExt1, 55, ICON_POS_Y);
203
-    #if HAS_MULTI_EXTRUDER
204
-      lv_obj_set_pos(buttonExt2, 55, ICON_POS_Y + SECOND_EXT_MOD_Y);
205
-    #endif
206
-    #if HAS_HEATED_BED
207
-      lv_obj_set_pos(buttonBedstate, 210, ICON_POS_Y);
208
-    #endif
209
-    lv_obj_set_pos(buttonFanstate, 380, ICON_POS_Y);
194
+    lv_obj_t *buttonFanstate = lv_big_button_create(scr, "F:/bmp_fan_state.bin", " ", 380, ICON_POS_Y, event_handler, ID_INFO_FAN);
210
 
195
 
211
     labelExt1 = lv_label_create(scr, 55, LABEL_MOD_Y, nullptr);
196
     labelExt1 = lv_label_create(scr, 55, LABEL_MOD_Y, nullptr);
212
     labelExt1Target = lv_label_create(scr, 55, LABEL_MOD_Y, nullptr);
197
     labelExt1Target = lv_label_create(scr, 55, LABEL_MOD_Y, nullptr);
262
   #endif
247
   #endif
263
 }
248
 }
264
 
249
 
250
+void lv_temp_refr() {
251
+  #if HAS_HEATED_BED
252
+    sprintf(public_buf_l, printing_menu.bed_temp, thermalManager.degBed(), thermalManager.degTargetBed());
253
+    lv_label_set_text(labelBed, public_buf_l);
254
+  #endif
255
+
256
+  sprintf(public_buf_l, printing_menu.temp1, thermalManager.degHotend(0), thermalManager.degTargetHotend(0));
257
+  lv_label_set_text(labelExt1, public_buf_l);
258
+
259
+  #if HAS_MULTI_EXTRUDER
260
+    sprintf(public_buf_l, printing_menu.temp1, thermalManager.degHotend(1), thermalManager.degTargetHotend(1));
261
+    lv_label_set_text(labelExt2, public_buf_l);
262
+  #endif
263
+}
264
+
265
 void lv_clear_ready_print() {
265
 void lv_clear_ready_print() {
266
   #if HAS_ROTARY_ENCODER
266
   #if HAS_ROTARY_ENCODER
267
     if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
267
     if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);

+ 1
- 0
Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.h View File

32
 extern void disp_det_error();
32
 extern void disp_det_error();
33
 extern void disp_det_ok();
33
 extern void disp_det_ok();
34
 extern void lv_clear_ready_print();
34
 extern void lv_clear_ready_print();
35
+extern void lv_temp_refr();
35
 
36
 
36
 #ifdef __cplusplus
37
 #ifdef __cplusplus
37
   } /* C-declarations for C++ */
38
   } /* C-declarations for C++ */

+ 5
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp View File

805
       }
805
       }
806
       break;
806
       break;
807
     case PRINT_READY_UI:
807
     case PRINT_READY_UI:
808
+      if (temps_update_flag) {
809
+        temps_update_flag = false;
810
+        lv_temp_refr();
811
+      }
808
       break;
812
       break;
809
 
813
 
810
     case PRINT_FILE_UI: break;
814
     case PRINT_FILE_UI: break;
843
     #if ENABLED(MKS_WIFI_MODULE)
847
     #if ENABLED(MKS_WIFI_MODULE)
844
       case WIFI_UI:
848
       case WIFI_UI:
845
         if (temps_update_flag) {
849
         if (temps_update_flag) {
846
-          disp_wifi_state();
847
           temps_update_flag = false;
850
           temps_update_flag = false;
851
+          disp_wifi_state();
848
         }
852
         }
849
         break;
853
         break;
850
 
854
 

+ 6
- 6
Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp View File

897
             strcpy_P(outBuf, PSTR(" B:"));
897
             strcpy_P(outBuf, PSTR(" B:"));
898
             outBuf += 3;
898
             outBuf += 3;
899
             #if HAS_HEATED_BED
899
             #if HAS_HEATED_BED
900
-              strcpy(outBuf, dtostrf(thermalManager.temp_bed.celsius, 1, 1, str_1));
900
+              strcpy(outBuf, dtostrf(thermalManager.degBed(), 1, 1, str_1));
901
               strcat_P(outBuf, PSTR(" /"));
901
               strcat_P(outBuf, PSTR(" /"));
902
-              strcat(outBuf, dtostrf(thermalManager.temp_bed.target, 1, 1, str_1));
902
+              strcat(outBuf, dtostrf(thermalManager.degTargetBed(), 1, 1, str_1));
903
             #else
903
             #else
904
               strcpy_P(outBuf, PSTR("0 /0"));
904
               strcpy_P(outBuf, PSTR("0 /0"));
905
             #endif
905
             #endif
924
           }
924
           }
925
           else {
925
           else {
926
             sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
926
             sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
927
-              (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0),
927
+              thermalManager.degHotend(0), thermalManager.degTargetHotend(0),
928
               #if HAS_HEATED_BED
928
               #if HAS_HEATED_BED
929
-                (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target,
929
+                thermalManager.degBed(), thermalManager.degTargetBed(),
930
               #else
930
               #else
931
                 0, 0,
931
                 0, 0,
932
               #endif
932
               #endif
933
-              (int)thermalManager.degHotend(0), (int)thermalManager.degTargetHotend(0),
933
+              thermalManager.degHotend(0), thermalManager.degTargetHotend(0),
934
               #if HAS_MULTI_HOTEND
934
               #if HAS_MULTI_HOTEND
935
-                (int)thermalManager.degHotend(1), (int)thermalManager.degTargetHotend(1)
935
+                thermalManager.degHotend(1), thermalManager.degTargetHotend(1)
936
               #else
936
               #else
937
                 0, 0
937
                 0, 0
938
               #endif
938
               #endif

Loading…
Cancel
Save