Optimize M600 heater status LCD items
This commit is contained in:
parent
44b4e116bd
commit
6e0b3fcc08
3 changed files with 136 additions and 92 deletions
|
@ -69,6 +69,9 @@ uint16_t max_display_update_time = 0;
|
|||
|
||||
#if ENABLED(DOGLCD)
|
||||
bool drawing_screen = false;
|
||||
#define LCDVIEW_KEEP_REDRAWING LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
#define LCDVIEW_KEEP_REDRAWING LCDVIEW_REDRAW_NOW
|
||||
#endif
|
||||
|
||||
#if ENABLED(DAC_STEPPER_CURRENT)
|
||||
|
@ -1155,13 +1158,7 @@ void kill_screen(const char* lcd_msg) {
|
|||
|
||||
void _lcd_level_bed_done() {
|
||||
if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
|
||||
lcdDrawUpdate =
|
||||
#if ENABLED(DOGLCD)
|
||||
LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
LCDVIEW_CALL_NO_REDRAW
|
||||
#endif
|
||||
;
|
||||
lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1179,13 +1176,7 @@ void kill_screen(const char* lcd_msg) {
|
|||
NOLESS(current_position[Z_AXIS], 0);
|
||||
NOMORE(current_position[Z_AXIS], MESH_HOME_SEARCH_Z * 2);
|
||||
line_to_current(Z_AXIS);
|
||||
lcdDrawUpdate =
|
||||
#if ENABLED(DOGLCD)
|
||||
LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
LCDVIEW_REDRAW_NOW
|
||||
#endif
|
||||
;
|
||||
lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
|
||||
encoderPosition = 0;
|
||||
}
|
||||
|
||||
|
@ -1239,13 +1230,7 @@ KeepDrawing:
|
|||
lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg);
|
||||
}
|
||||
|
||||
lcdDrawUpdate =
|
||||
#if ENABLED(DOGLCD)
|
||||
LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
LCDVIEW_CALL_NO_REDRAW
|
||||
#endif
|
||||
;
|
||||
lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1287,13 +1272,7 @@ KeepDrawing:
|
|||
*/
|
||||
void _lcd_level_bed_homing() {
|
||||
if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_HOMING), NULL);
|
||||
lcdDrawUpdate =
|
||||
#if ENABLED(DOGLCD)
|
||||
LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
LCDVIEW_CALL_NO_REDRAW
|
||||
#endif
|
||||
;
|
||||
lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
|
||||
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
||||
lcd_goto_screen(_lcd_level_bed_homing_done);
|
||||
}
|
||||
|
@ -1380,6 +1359,7 @@ KeepDrawing:
|
|||
// Preheat ABS
|
||||
//
|
||||
#if TEMP_SENSOR_0 != 0
|
||||
|
||||
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0
|
||||
MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_material1_menu);
|
||||
MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_material2_menu);
|
||||
|
@ -1395,7 +1375,8 @@ KeepDrawing:
|
|||
if (!thermalManager.tooColdToExtrude(active_extruder))
|
||||
MENU_ITEM(function, MSG_FILAMENTCHANGE, lcd_enqueue_filament_change);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // TEMP_SENSOR_0 != 0
|
||||
|
||||
//
|
||||
// Cooldown
|
||||
|
@ -1445,13 +1426,7 @@ KeepDrawing:
|
|||
|
||||
void _lcd_calibrate_homing() {
|
||||
if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
|
||||
lcdDrawUpdate =
|
||||
#if ENABLED(DOGLCD)
|
||||
LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
LCDVIEW_CALL_NO_REDRAW
|
||||
#endif
|
||||
;
|
||||
lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
|
||||
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
||||
lcd_goto_previous_menu();
|
||||
}
|
||||
|
@ -2453,20 +2428,36 @@ KeepDrawing:
|
|||
*/
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
|
||||
// Portions from STATIC_ITEM...
|
||||
#define HOTEND_STATUS_ITEM() do { \
|
||||
if (_menuLineNr == _thisItemNr) { \
|
||||
if (lcdDrawUpdate) \
|
||||
lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \
|
||||
lcd_implementation_hotend_status(_lcdLineNr); \
|
||||
if (_skipStatic && encoderLine <= _thisItemNr) { \
|
||||
encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \
|
||||
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \
|
||||
} \
|
||||
else \
|
||||
lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; \
|
||||
} \
|
||||
++_thisItemNr; \
|
||||
} while(0)
|
||||
|
||||
void lcd_filament_change_toocold_menu() {
|
||||
START_MENU();
|
||||
STATIC_ITEM(MSG_HEATING_FAILED_LCD, true, true);
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_MINTEMP STRINGIFY(EXTRUDE_MINTEMP) ".", false, false);
|
||||
MENU_BACK(MSG_BACK);
|
||||
STATIC_ITEM(" ");
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > 4
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
void lcd_filament_change_resume_print() {
|
||||
filament_change_menu_response = FILAMENT_CHANGE_RESPONSE_RESUME_PRINT;
|
||||
lcd_goto_screen(lcd_status_screen);
|
||||
}
|
||||
|
||||
void lcd_filament_change_extrude_more() {
|
||||
|
@ -2489,12 +2480,20 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_INIT_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2);
|
||||
#define __FC_LINES_A 3
|
||||
#else
|
||||
#define __FC_LINES_A 2
|
||||
#endif
|
||||
#ifdef MSG_FILAMENT_CHANGE_INIT_3
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3);
|
||||
#define _FC_LINES_A (__FC_LINES_A + 1)
|
||||
#else
|
||||
#define _FC_LINES_A __FC_LINES_A
|
||||
#endif
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_A + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2504,13 +2503,20 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_UNLOAD_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2);
|
||||
#define __FC_LINES_B 3
|
||||
#else
|
||||
#define __FC_LINES_B 2
|
||||
#endif
|
||||
#ifdef MSG_FILAMENT_CHANGE_UNLOAD_3
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3);
|
||||
#define _FC_LINES_B (__FC_LINES_B + 1)
|
||||
#else
|
||||
#define _FC_LINES_B __FC_LINES_B
|
||||
#endif
|
||||
STATIC_ITEM (" ");
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_B + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2520,10 +2526,14 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_HEATING_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2);
|
||||
#define _FC_LINES_C 3
|
||||
#else
|
||||
#define _FC_LINES_C 2
|
||||
#endif
|
||||
STATIC_ITEM(" ");
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_C + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2533,10 +2543,14 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_INSERT_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2);
|
||||
#define _FC_LINES_D 3
|
||||
#else
|
||||
#define _FC_LINES_D 2
|
||||
#endif
|
||||
STATIC_ITEM(" ");
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_D + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2546,12 +2560,20 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_INSERT_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2);
|
||||
#define __FC_LINES_E 3
|
||||
#else
|
||||
#define __FC_LINES_E 2
|
||||
#endif
|
||||
#ifdef MSG_FILAMENT_CHANGE_INSERT_3
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3);
|
||||
#define _FC_LINES_E (__FC_LINES_E + 1)
|
||||
#else
|
||||
#define _FC_LINES_E __FC_LINES_E
|
||||
#endif
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_E + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2561,13 +2583,20 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_LOAD_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2);
|
||||
#define __FC_LINES_F 3
|
||||
#else
|
||||
#define __FC_LINES_F 2
|
||||
#endif
|
||||
#ifdef MSG_FILAMENT_CHANGE_LOAD_3
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3);
|
||||
#define _FC_LINES_F (__FC_LINES_F + 1)
|
||||
#else
|
||||
#define _FC_LINES_F __FC_LINES_F
|
||||
#endif
|
||||
STATIC_ITEM(" ");
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_F + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2577,13 +2606,20 @@ KeepDrawing:
|
|||
STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_1);
|
||||
#ifdef MSG_FILAMENT_CHANGE_EXTRUDE_2
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_2);
|
||||
#define __FC_LINES_G 3
|
||||
#else
|
||||
#define __FC_LINES_G 2
|
||||
#endif
|
||||
#ifdef MSG_FILAMENT_CHANGE_EXTRUDE_3
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_EXTRUDE_3);
|
||||
#define _FC_LINES_G (__FC_LINES_G + 1)
|
||||
#else
|
||||
#define _FC_LINES_G __FC_LINES_G
|
||||
#endif
|
||||
STATIC_ITEM(" ");
|
||||
STATIC_ITEM(MSG_FILAMENT_CHANGE_NOZZLE, false, true);
|
||||
lcd_implementation_hotend_status();
|
||||
#if LCD_HEIGHT > _FC_LINES_G + 1
|
||||
STATIC_ITEM(" ");
|
||||
#endif
|
||||
HOTEND_STATUS_ITEM();
|
||||
END_SCREEN();
|
||||
}
|
||||
|
||||
|
@ -2967,7 +3003,7 @@ bool lcd_blink() {
|
|||
* - if (lcdDrawUpdate) { redraw }
|
||||
* - Before exiting the handler set lcdDrawUpdate to:
|
||||
* - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT.
|
||||
* - LCDVIEW_REDRAW_NOW or LCDVIEW_NONE to keep drawingm but only in this loop.
|
||||
* - LCDVIEW_REDRAW_NOW or LCDVIEW_NONE to keep drawing, but only in this loop.
|
||||
* - LCDVIEW_CALL_REDRAW_NEXT to keep drawing and draw on the next loop also.
|
||||
* - LCDVIEW_CALL_NO_REDRAW to keep drawing (or start drawing) with no redraw on the next loop.
|
||||
* - NOTE: For graphical displays menu handlers may be called 2 or more times per loop,
|
||||
|
@ -3083,13 +3119,7 @@ void lcd_update() {
|
|||
encoderDiff = 0;
|
||||
}
|
||||
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
|
||||
lcdDrawUpdate =
|
||||
#if ENABLED(DOGLCD)
|
||||
LCDVIEW_CALL_REDRAW_NEXT
|
||||
#else
|
||||
LCDVIEW_REDRAW_NOW
|
||||
#endif
|
||||
;
|
||||
lcdDrawUpdate = LCDVIEW_KEEP_REDRAWING;
|
||||
}
|
||||
#endif // ULTIPANEL
|
||||
|
||||
|
|
|
@ -379,17 +379,6 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr,
|
|||
|
||||
//#define DOGM_SD_PERCENT
|
||||
|
||||
|
||||
static void lcd_implementation_hotend_status() {
|
||||
u8g.setPrintPos(58, 60);
|
||||
lcd_print((char)('0' + active_extruder));
|
||||
lcd_print(' ');
|
||||
lcd_print(' ');
|
||||
lcd_print(itostr3(thermalManager.degHotend(active_extruder)));
|
||||
lcd_print('/');
|
||||
lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder)));
|
||||
}
|
||||
|
||||
static void lcd_implementation_status_screen() {
|
||||
|
||||
bool blink = lcd_blink();
|
||||
|
@ -633,22 +622,41 @@ static void lcd_implementation_status_screen() {
|
|||
#if ENABLED(ULTIPANEL)
|
||||
|
||||
uint8_t row_y1, row_y2;
|
||||
uint8_t constexpr row_height = DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION);
|
||||
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
|
||||
static void lcd_implementation_hotend_status(const uint8_t row) {
|
||||
row_y1 = row * row_height + 1;
|
||||
row_y2 = row_y1 + row_height - 1;
|
||||
|
||||
if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return;
|
||||
|
||||
u8g.setPrintPos(LCD_PIXEL_WIDTH - 11 * (DOG_CHAR_WIDTH), row_y2);
|
||||
lcd_print('E');
|
||||
lcd_print((char)('0' + active_extruder));
|
||||
lcd_print(' ');
|
||||
lcd_print(itostr3(thermalManager.degHotend(active_extruder)));
|
||||
lcd_print('/');
|
||||
lcd_print(itostr3(thermalManager.degTargetHotend(active_extruder)));
|
||||
}
|
||||
|
||||
#endif // FILAMENT_CHANGE_FEATURE
|
||||
|
||||
// Set the colors for a menu item based on whether it is selected
|
||||
static void lcd_implementation_mark_as_selected(const uint8_t row, const bool isSelected) {
|
||||
row_y1 = row * row_height + 1;
|
||||
row_y2 = row_y1 + row_height - 1;
|
||||
|
||||
row_y1 = row * (DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION)) + 1;
|
||||
row_y2 = row_y1 + (DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION)) - 1;
|
||||
|
||||
if (!PAGE_CONTAINS(row_y1 + 1, row_y1 + 1 + DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION))) return;
|
||||
if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return;
|
||||
|
||||
if (isSelected) {
|
||||
#if ENABLED(MENU_HOLLOW_FRAME)
|
||||
u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH);
|
||||
u8g.drawHLine(0, row_y1 + 1 + DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION), LCD_PIXEL_WIDTH);
|
||||
u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH);
|
||||
#else
|
||||
u8g.setColorIndex(1); // black on white
|
||||
u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT - 1 + 2 * (TALL_FONT_CORRECTION));
|
||||
u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, row_height - 1);
|
||||
u8g.setColorIndex(0); // white on black
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -592,14 +592,6 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr,
|
|||
|
||||
#endif // LCD_PROGRESS_BAR
|
||||
|
||||
static void lcd_implementation_hotend_status() {
|
||||
lcd.setCursor(10, 3);
|
||||
lcd.print(LCD_STR_THERMOMETER[active_extruder]);
|
||||
lcd.print(itostr3(thermalManager.degHotend(active_extruder)));
|
||||
lcd.print('/');
|
||||
lcd.print(itostr3(thermalManager.degTargetHotend(active_extruder)));
|
||||
}
|
||||
|
||||
/**
|
||||
Possible status screens:
|
||||
16x2 |000/000 B000/000|
|
||||
|
@ -810,6 +802,20 @@ static void lcd_implementation_status_screen() {
|
|||
|
||||
#if ENABLED(ULTIPANEL)
|
||||
|
||||
#if ENABLED(FILAMENT_CHANGE_FEATURE)
|
||||
|
||||
static void lcd_implementation_hotend_status(const uint8_t row) {
|
||||
if (row < LCD_HEIGHT) {
|
||||
lcd.setCursor(LCD_WIDTH - 9, row);
|
||||
lcd.print(LCD_STR_THERMOMETER[active_extruder]);
|
||||
lcd.print(itostr3(thermalManager.degHotend(active_extruder)));
|
||||
lcd.print('/');
|
||||
lcd.print(itostr3(thermalManager.degTargetHotend(active_extruder)));
|
||||
}
|
||||
}
|
||||
|
||||
#endif // FILAMENT_CHANGE_FEATURE
|
||||
|
||||
static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char *valstr=NULL) {
|
||||
UNUSED(invert);
|
||||
char c;
|
||||
|
|
Reference in a new issue