浏览代码

Marlin Dev Mode for DOGM status screen

Scott Lahteine 6 年前
父节点
当前提交
4fbbce9a35
共有 1 个文件被更改,包括 50 次插入5 次删除
  1. 50
    5
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 50
- 5
Marlin/src/lcd/dogm/status_screen_DOGM.cpp 查看文件

92
 #define MAX_HOTEND_DRAW MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE)))
92
 #define MAX_HOTEND_DRAW MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE)))
93
 #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)
93
 #define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)
94
 
94
 
95
+#if ENABLED(MARLIN_DEV_MODE)
96
+  #define SHOW_ON_STATE READ(X_MIN_PIN)
97
+#else
98
+  #define SHOW_ON_STATE false
99
+#endif
100
+
95
 FORCE_INLINE void _draw_heater_status(const int8_t heater, const bool blink) {
101
 FORCE_INLINE void _draw_heater_status(const int8_t heater, const bool blink) {
96
   #if !HEATER_IDLE_HANDLER
102
   #if !HEATER_IDLE_HANDLER
97
     UNUSED(blink);
103
     UNUSED(blink);
104
     #define IFBED(A,B) (B)
110
     #define IFBED(A,B) (B)
105
   #endif
111
   #endif
106
 
112
 
107
-  const bool isHeat = IFBED(BED_ALT(), HOTEND_ALT(heater));
113
+  #if ENABLED(MARLIN_DEV_MODE)
114
+    constexpr bool isHeat = true;
115
+  #else
116
+    const bool isHeat = IFBED(BED_ALT(), HOTEND_ALT(heater));
117
+  #endif
118
+
108
   const uint8_t tx = IFBED(STATUS_BED_TEXT_X, STATUS_HOTEND_TEXT_X(heater));
119
   const uint8_t tx = IFBED(STATUS_BED_TEXT_X, STATUS_HOTEND_TEXT_X(heater));
109
-  const float temp = IFBED(thermalManager.degBed(), thermalManager.degHotend(heater)),
110
-              target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater));
120
+
121
+  #if ENABLED(MARLIN_DEV_MODE)
122
+    const float temp = 20 + (millis() >> 8) % IFBED(100, 200);
123
+    const float target = IFBED(100, 200);
124
+  #else
125
+    const float temp = IFBED(thermalManager.degBed(), thermalManager.degHotend(heater)),
126
+                target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater));
127
+  #endif
111
 
128
 
112
   #if DISABLED(STATUS_HOTEND_ANIM)
129
   #if DISABLED(STATUS_HOTEND_ANIM)
113
     #define STATIC_HOTEND true
130
     #define STATIC_HOTEND true
236
   }
253
   }
237
 }
254
 }
238
 
255
 
256
+#if ENABLED(MARLIN_DEV_MODE)
257
+  uint16_t count_renders = 0;
258
+  uint32_t total_cycles = 0;
259
+#endif
260
+
239
 void MarlinUI::draw_status_screen() {
261
 void MarlinUI::draw_status_screen() {
240
 
262
 
263
+  #if ENABLED(MARLIN_DEV_MODE)
264
+    if (first_page) count_renders++;
265
+  #endif
266
+
241
   static char xstring[5], ystring[5], zstring[8];
267
   static char xstring[5], ystring[5], zstring[8];
242
   #if ENABLED(FILAMENT_LCD_DISPLAY)
268
   #if ENABLED(FILAMENT_LCD_DISPLAY)
243
     static char wstring[5], mstring[4];
269
     static char wstring[5], mstring[4];
248
     #if ANIM_HOTEND || ANIM_BED
274
     #if ANIM_HOTEND || ANIM_BED
249
       uint8_t new_bits = 0;
275
       uint8_t new_bits = 0;
250
       #if ANIM_HOTEND
276
       #if ANIM_HOTEND
251
-        HOTEND_LOOP() if (thermalManager.isHeatingHotend(e)) SBI(new_bits, e);
277
+        HOTEND_LOOP() if (thermalManager.isHeatingHotend(e) ^ SHOW_ON_STATE) SBI(new_bits, e);
252
       #endif
278
       #endif
253
       #if ANIM_BED
279
       #if ANIM_BED
254
-        if (thermalManager.isHeatingBed()) SBI(new_bits, 7);
280
+        if (thermalManager.isHeatingBed() ^ SHOW_ON_STATE) SBI(new_bits, 7);
255
       #endif
281
       #endif
256
       heat_bits = new_bits;
282
       heat_bits = new_bits;
257
     #endif
283
     #endif
274
   // Status Menu Font
300
   // Status Menu Font
275
   set_font(FONT_STATUSMENU);
301
   set_font(FONT_STATUSMENU);
276
 
302
 
303
+  #if ENABLED(MARLIN_DEV_MODE)
304
+    TCNT5 = 0;
305
+  #endif
306
+
277
   #if STATUS_LOGO_WIDTH
307
   #if STATUS_LOGO_WIDTH
278
     if (PAGE_CONTAINS(STATUS_LOGO_Y, STATUS_LOGO_Y + STATUS_LOGO_HEIGHT - 1))
308
     if (PAGE_CONTAINS(STATUS_LOGO_Y, STATUS_LOGO_Y + STATUS_LOGO_HEIGHT - 1))
279
       u8g.drawBitmapP(STATUS_LOGO_X, STATUS_LOGO_Y, STATUS_LOGO_BYTEWIDTH, STATUS_LOGO_HEIGHT, status_logo_bmp);
309
       u8g.drawBitmapP(STATUS_LOGO_X, STATUS_LOGO_Y, STATUS_LOGO_BYTEWIDTH, STATUS_LOGO_HEIGHT, status_logo_bmp);
356
     #endif
386
     #endif
357
   }
387
   }
358
 
388
 
389
+  #if ENABLED(MARLIN_DEV_MODE)
390
+    total_cycles += TCNT5;
391
+  #endif
392
+
359
   #if ENABLED(SDSUPPORT)
393
   #if ENABLED(SDSUPPORT)
360
     //
394
     //
361
     // SD Card Symbol
395
     // SD Card Symbol
557
 
591
 
558
 void MarlinUI::draw_status_message(const bool blink) {
592
 void MarlinUI::draw_status_message(const bool blink) {
559
 
593
 
594
+  #if ENABLED(MARLIN_DEV_MODE)
595
+    if (PAGE_CONTAINS(64-8, 64-1)) {
596
+      lcd_put_int(total_cycles);
597
+      lcd_put_wchar('/');
598
+      lcd_put_int(count_renders);
599
+      lcd_put_wchar('=');
600
+      lcd_put_int(int(total_cycles / count_renders));
601
+      return;
602
+    }
603
+  #endif
604
+
560
   // Get the UTF8 character count of the string
605
   // Get the UTF8 character count of the string
561
   uint8_t slen = utf8_strlen(status_message);
606
   uint8_t slen = utf8_strlen(status_message);
562
 
607
 

正在加载...
取消
保存