Skip to content

Commit

Permalink
Misc LCD cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 24, 2021
1 parent 155dea6 commit 8fca37f
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 376 deletions.
35 changes: 18 additions & 17 deletions Marlin/src/lcd/dogm/marlinui_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop

#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)

//
// Draw knob rotation => Z motion key for:
// - menu.cpp:lcd_babystep_zoffset
// - menu_ubl.cpp:_lcd_mesh_fine_tune
//

const unsigned char cw_bmp[] PROGMEM = {
B00000000,B11111110,B00000000,
B00000011,B11111111,B10000000,
Expand Down Expand Up @@ -672,28 +678,23 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
old_zvalue = zvalue;
}

#if ENABLED(OVERLAY_GFX_REVERSE)
const unsigned char *rot_up = ccw_bmp, *rot_down = cw_bmp;
#else
const unsigned char *rot_up = cw_bmp, *rot_down = ccw_bmp;
#endif
const unsigned char *rot_up = TERN(OVERLAY_GFX_REVERSE, ccw_bmp, cw_bmp),
*rot_down = TERN(OVERLAY_GFX_REVERSE, cw_bmp, ccw_bmp);

#if ENABLED(USE_BIG_EDIT_FONT)
const int left = 0, right = 45, nozzle = 95;
#else
const int left = 5, right = 90, nozzle = 60;
#endif
const int left = TERN(USE_BIG_EDIT_FONT, 0, 5),
right = TERN(USE_BIG_EDIT_FONT, 45, 90),
nozzle = TERN(USE_BIG_EDIT_FONT, 95, 60);

// Draw a representation of the nozzle
if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp);
if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp);
// Draw nozzle lowered or raised according to direction moved
if (PAGE_CONTAINS( 3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp);
if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20 , 3, 1, offset_bedline_bmp);

// Draw cw/ccw indicator and up/down arrows.
if (PAGE_CONTAINS(47, 62)) {
u8g.drawBitmapP(right + 0, 48 - dir, 2, 13, up_arrow_bmp);
u8g.drawBitmapP(left + 0, 49 - dir, 2, 13, down_arrow_bmp);
u8g.drawBitmapP(left + 13, 47, 3, 16, rot_down);
u8g.drawBitmapP(right + 13, 47, 3, 16, rot_up);
u8g.drawBitmapP(right + 0, 48 - dir, 2, 13, up_arrow_bmp);
u8g.drawBitmapP(left + 0, 49 - dir, 2, 13, down_arrow_bmp);
u8g.drawBitmapP(left + 13, 47 , 3, 16, rot_down);
u8g.drawBitmapP(right + 13, 47 , 3, 16, rot_up);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_level_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
draw_return_ui();
break;
case ID_LEVEL_POSITION:
lv_draw_manual_level_pos_settings();
lv_draw_tramming_pos_settings();
break;
case ID_LEVEL_COMMAND:
keyboard_value = autoLevelGcodeCommand;
Expand All @@ -62,7 +62,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {

void lv_draw_level_settings() {
scr = lv_screen_create(LEVELING_PARA_UI, machine_menu.LevelingParaConfTitle);
lv_screen_menu_item(scr, machine_menu.LevelingManuPosConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_LEVEL_POSITION, 0);
lv_screen_menu_item(scr, machine_menu.TrammingPosConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_LEVEL_POSITION, 0);
lv_screen_menu_item(scr, machine_menu.LevelingAutoCommandConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_LEVEL_COMMAND, 1);
#if HAS_BED_PROBE
lv_screen_menu_item(scr, machine_menu.LevelingAutoZoffsetConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_LEVEL_ZOFFSET, 2);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/mks_ui/draw_manuaLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
queue.inject_P(G28_STR);
}
const int ind = obj->mks_obj_id - ID_M_POINT1;
sprintf_P(public_buf_l, PSTR("G1 Z10\nG1 X%d Y%d\nG1 Z0"), (int)gCfgItems.levelingPos[ind][0], (int)gCfgItems.levelingPos[ind][1]);
sprintf_P(public_buf_l, PSTR("G1 Z10\nG1 X%d Y%d\nG1 Z0"), (int)gCfgItems.trammingPos[ind][X_AXIS], (int)gCfgItems.trammingPos[ind][Y_AXIS]);
queue.inject(public_buf_l);
}
break;
Expand Down
Loading

0 comments on commit 8fca37f

Please sign in to comment.