Misc LCD cleanup

2.0.x
Scott Lahteine 4 years ago committed by Scott Lahteine
parent 9e8b158ee1
commit 6b7a92035c

@ -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,
@ -672,19 +678,14 @@ 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
// 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);

@ -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;
@ -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);

@ -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;

@ -204,34 +204,34 @@ static void disp_key_value() {
sprintf_P(public_buf_m, PSTR("%s"), dtostrf(gCfgItems.pausePosZ, 1, 1, str_1));
break;
case level_pos_x1:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[0][0]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[0][X_AXIS]);
break;
case level_pos_y1:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[0][1]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[0][Y_AXIS]);
break;
case level_pos_x2:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[1][0]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[1][X_AXIS]);
break;
case level_pos_y2:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[1][1]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[1][Y_AXIS]);
break;
case level_pos_x3:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[2][0]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[2][X_AXIS]);
break;
case level_pos_y3:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[2][1]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[2][Y_AXIS]);
break;
case level_pos_x4:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[3][0]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[3][X_AXIS]);
break;
case level_pos_y4:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[3][1]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[3][Y_AXIS]);
break;
case level_pos_x5:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[4][0]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[4][X_AXIS]);
break;
case level_pos_y5:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[4][1]);
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.trammingPos[4][Y_AXIS]);
break;
#if HAS_BED_PROBE
case x_offset:
@ -295,194 +295,87 @@ static void disp_key_value() {
}
static void set_value_confirm() {
#if HAS_TRINAMIC_CONFIG
uint16_t current_mA;
#endif
switch (value) {
case PrintAcceleration:
planner.settings.acceleration = atof(key_value);
break;
case RetractAcceleration:
planner.settings.retract_acceleration = atof(key_value);
break;
case TravelAcceleration:
planner.settings.travel_acceleration = atof(key_value);
break;
case XAcceleration:
planner.settings.max_acceleration_mm_per_s2[X_AXIS] = atof(key_value);
break;
case YAcceleration:
planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = atof(key_value);
break;
case ZAcceleration:
planner.settings.max_acceleration_mm_per_s2[Z_AXIS] = atof(key_value);
break;
case E0Acceleration:
planner.settings.max_acceleration_mm_per_s2[E_AXIS] = atof(key_value);
break;
case E1Acceleration:
planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)] = atof(key_value);
break;
case XMaxFeedRate:
planner.settings.max_feedrate_mm_s[X_AXIS] = atof(key_value);
break;
case YMaxFeedRate:
planner.settings.max_feedrate_mm_s[Y_AXIS] = atof(key_value);
break;
case ZMaxFeedRate:
planner.settings.max_feedrate_mm_s[Z_AXIS] = atof(key_value);
break;
case E0MaxFeedRate:
planner.settings.max_feedrate_mm_s[E_AXIS] = atof(key_value);
break;
case E1MaxFeedRate:
planner.settings.max_feedrate_mm_s[E_AXIS_N(1)] = atof(key_value);
break;
case XJerk:
#if HAS_CLASSIC_JERK
planner.max_jerk[X_AXIS] = atof(key_value);
#endif
break;
case YJerk:
#if HAS_CLASSIC_JERK
planner.max_jerk[Y_AXIS] = atof(key_value);
#endif
break;
case ZJerk:
#if HAS_CLASSIC_JERK
planner.max_jerk[Z_AXIS] = atof(key_value);
#endif
break;
case EJerk:
#if HAS_CLASSIC_JERK
planner.max_jerk[E_AXIS] = atof(key_value);
#endif
break;
case Xstep:
planner.settings.axis_steps_per_mm[X_AXIS] = atof(key_value);
planner.refresh_positioning();
break;
case Ystep:
planner.settings.axis_steps_per_mm[Y_AXIS] = atof(key_value);
planner.refresh_positioning();
break;
case Zstep:
planner.settings.axis_steps_per_mm[Z_AXIS] = atof(key_value);
planner.refresh_positioning();
break;
case E0step:
planner.settings.axis_steps_per_mm[E_AXIS] = atof(key_value);
planner.refresh_positioning();
break;
case E1step:
planner.settings.axis_steps_per_mm[E_AXIS_N(1)] = atof(key_value);
planner.refresh_positioning();
break;
case PrintAcceleration: planner.settings.acceleration = atof(key_value); break;
case RetractAcceleration: planner.settings.retract_acceleration = atof(key_value); break;
case TravelAcceleration: planner.settings.travel_acceleration = atof(key_value); break;
case XAcceleration: planner.settings.max_acceleration_mm_per_s2[X_AXIS] = atof(key_value); break;
case YAcceleration: planner.settings.max_acceleration_mm_per_s2[Y_AXIS] = atof(key_value); break;
case ZAcceleration: planner.settings.max_acceleration_mm_per_s2[Z_AXIS] = atof(key_value); break;
case E0Acceleration: planner.settings.max_acceleration_mm_per_s2[E_AXIS] = atof(key_value); break;
case E1Acceleration: planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)] = atof(key_value); break;
case XMaxFeedRate: planner.settings.max_feedrate_mm_s[X_AXIS] = atof(key_value); break;
case YMaxFeedRate: planner.settings.max_feedrate_mm_s[Y_AXIS] = atof(key_value); break;
case ZMaxFeedRate: planner.settings.max_feedrate_mm_s[Z_AXIS] = atof(key_value); break;
case E0MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS] = atof(key_value); break;
case E1MaxFeedRate: planner.settings.max_feedrate_mm_s[E_AXIS_N(1)] = atof(key_value); break;
case XJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[X_AXIS] = atof(key_value)); break;
case YJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[Y_AXIS] = atof(key_value)); break;
case ZJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[Z_AXIS] = atof(key_value)); break;
case EJerk: TERN_(HAS_CLASSIC_JERK, planner.max_jerk[E_AXIS] = atof(key_value)); break;
case Xstep: planner.settings.axis_steps_per_mm[X_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case Ystep: planner.settings.axis_steps_per_mm[Y_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case Zstep: planner.settings.axis_steps_per_mm[Z_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case E0step: planner.settings.axis_steps_per_mm[E_AXIS] = atof(key_value); planner.refresh_positioning(); break;
case E1step: planner.settings.axis_steps_per_mm[E_AXIS_N(1)] = atof(key_value); planner.refresh_positioning(); break;
case Xcurrent:
#if AXIS_IS_TMC(X)
current_mA = atoi(key_value);
stepperX.rms_current(current_mA);
stepperX.rms_current(atoi(key_value));
#endif
break;
case Ycurrent:
#if AXIS_IS_TMC(Y)
current_mA = atoi(key_value);
stepperY.rms_current(current_mA);
stepperY.rms_current(atoi(key_value));
#endif
break;
case Zcurrent:
#if AXIS_IS_TMC(Z)
current_mA = atoi(key_value);
stepperZ.rms_current(current_mA);
stepperZ.rms_current(atoi(key_value));
#endif
break;
case E0current:
#if AXIS_IS_TMC(E0)
current_mA = atoi(key_value);
stepperE0.rms_current(current_mA);
stepperE0.rms_current(atoi(key_value));
#endif
break;
case E1current:
#if AXIS_IS_TMC(E1)
current_mA = atoi(key_value);
stepperE1.rms_current(current_mA);
stepperE1.rms_current(atoi(key_value));
#endif
break;
case pause_pos_x:
gCfgItems.pausePosX = atof(key_value);
update_spi_flash();
break;
case pause_pos_y:
gCfgItems.pausePosY = atof(key_value);
update_spi_flash();
break;
case pause_pos_z:
gCfgItems.pausePosZ = atof(key_value);
update_spi_flash();
break;
case level_pos_x1:
gCfgItems.levelingPos[0][0] = atoi(key_value);
update_spi_flash();
break;
case level_pos_y1:
gCfgItems.levelingPos[0][1] = atoi(key_value);
update_spi_flash();
break;
case level_pos_x2:
gCfgItems.levelingPos[1][0] = atoi(key_value);
update_spi_flash();
break;
case level_pos_y2:
gCfgItems.levelingPos[1][1] = atoi(key_value);
update_spi_flash();
break;
case level_pos_x3:
gCfgItems.levelingPos[2][0] = atoi(key_value);
update_spi_flash();
break;
case level_pos_y3:
gCfgItems.levelingPos[2][1] = atoi(key_value);
update_spi_flash();
break;
case level_pos_x4:
gCfgItems.levelingPos[3][0] = atoi(key_value);
update_spi_flash();
break;
case level_pos_y4:
gCfgItems.levelingPos[3][1] = atoi(key_value);
update_spi_flash();
break;
case level_pos_x5:
gCfgItems.levelingPos[4][0] = atoi(key_value);
update_spi_flash();
break;
case level_pos_y5:
gCfgItems.levelingPos[4][1] = atoi(key_value);
update_spi_flash();
break;
case pause_pos_x: gCfgItems.pausePosX = atof(key_value); update_spi_flash(); break;
case pause_pos_y: gCfgItems.pausePosY = atof(key_value); update_spi_flash(); break;
case pause_pos_z: gCfgItems.pausePosZ = atof(key_value); update_spi_flash(); break;
case level_pos_x1: gCfgItems.trammingPos[0][X_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_y1: gCfgItems.trammingPos[0][Y_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_x2: gCfgItems.trammingPos[1][X_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_y2: gCfgItems.trammingPos[1][Y_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_x3: gCfgItems.trammingPos[2][X_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_y3: gCfgItems.trammingPos[2][Y_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_x4: gCfgItems.trammingPos[3][X_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_y4: gCfgItems.trammingPos[3][Y_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_x5: gCfgItems.trammingPos[4][X_AXIS] = atoi(key_value); update_spi_flash(); break;
case level_pos_y5: gCfgItems.trammingPos[4][Y_AXIS] = atoi(key_value); update_spi_flash(); break;
#if HAS_BED_PROBE
case x_offset:
case x_offset: {
#if HAS_PROBE_XY_OFFSET
float x;
x = atof(key_value);
const float x = atof(key_value);
if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE))
probe.offset.x = x;
#endif
break;
case y_offset:
} break;
case y_offset: {
#if HAS_PROBE_XY_OFFSET
float y;
y = atof(key_value);
const float y = atof(key_value);
if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE))
probe.offset.y = y;
#endif
break;
case z_offset:
float z;
z = atof(key_value);
} break;
case z_offset: {
const float z = atof(key_value);
if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
probe.offset.z = z;
break;
} break;
#endif
case load_length:
gCfgItems.filamentchange_load_length = atoi(key_value);
@ -508,26 +401,10 @@ static void set_value_confirm() {
gCfgItems.filament_limit_temp = atoi(key_value);
update_spi_flash();
break;
case x_sensitivity:
#if X_SENSORLESS
stepperX.homing_threshold(atoi(key_value));
#endif
break;
case y_sensitivity:
#if Y_SENSORLESS
stepperY.homing_threshold(atoi(key_value));
#endif
break;
case z_sensitivity:
#if Z_SENSORLESS
stepperZ.homing_threshold(atoi(key_value));
#endif
break;
case z2_sensitivity:
#if Z2_SENSORLESS
stepperZ2.homing_threshold(atoi(key_value));
#endif
break;
case x_sensitivity: TERN_(X_SENSORLESS, stepperX.homing_threshold(atoi(key_value))); break;
case y_sensitivity: TERN_(Y_SENSORLESS, stepperY.homing_threshold(atoi(key_value))); break;
case z_sensitivity: TERN_(Z_SENSORLESS, stepperZ.homing_threshold(atoi(key_value))); break;
case z2_sensitivity: TERN_(Z2_SENSORLESS, stepperZ2.homing_threshold(atoi(key_value))); break;
}
gcode.process_subcommands_now_P(PSTR("M500"));
}
@ -535,81 +412,9 @@ static void set_value_confirm() {
static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (event != LV_EVENT_RELEASED) return;
switch (obj->mks_obj_id) {
case ID_NUM_KEY1:
case ID_NUM_KEY1 ... ID_NUM_KEY0:
if (cnt <= 10) {
key_value[cnt] = (char)'1';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY2:
if (cnt <= 10) {
key_value[cnt] = (char)'2';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY3:
if (cnt <= 10) {
key_value[cnt] = (char)'3';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY4:
if (cnt <= 10) {
key_value[cnt] = (char)'4';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY5:
if (cnt <= 10) {
key_value[cnt] = (char)'5';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY6:
if (cnt <= 10) {
key_value[cnt] = (char)'6';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY7:
if (cnt <= 10) {
key_value[cnt] = (char)'7';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY8:
if (cnt <= 10) {
key_value[cnt] = (char)'8';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY9:
if (cnt <= 10) {
key_value[cnt] = (char)'9';
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
}
break;
case ID_NUM_KEY0:
if (cnt <= 10) {
key_value[cnt] = (char)'0';
key_value[cnt] = (obj->mks_obj_id == ID_NUM_KEY0) ? (char)'0' : char('1' + obj->mks_obj_id - ID_NUM_KEY1);
lv_label_set_text(labelValue, key_value);
lv_obj_align(labelValue, buttonValue, LV_ALIGN_CENTER, 0, 0);
cnt++;
@ -662,55 +467,22 @@ void lv_draw_number_key() {
buttonValue = lv_btn_create(scr, 92, 40, 296, 40, event_handler, ID_NUM_KEY1, &style_num_text);
labelValue = lv_label_create_empty(buttonValue);
lv_obj_t *NumberKey_1 = lv_btn_create(scr, 92, 90, 68, 40, event_handler, ID_NUM_KEY1, &style_num_key_pre);
lv_obj_t *labelKey_1 = lv_label_create_empty(NumberKey_1);
lv_label_set_text(labelKey_1, machine_menu.key_1);
lv_obj_align(labelKey_1, NumberKey_1, LV_ALIGN_CENTER, 0, 0);
#define DRAW_NUMBER_KEY(N,X,Y) \
lv_obj_t *NumberKey_##N = lv_btn_create(scr, X, Y, 68, 40, event_handler, ID_NUM_KEY##N, &style_num_key_pre); \
lv_obj_t *labelKey_##N = lv_label_create_empty(NumberKey_##N); \
lv_label_set_text(labelKey_##N, machine_menu.key_##N); \
lv_obj_align(labelKey_##N, NumberKey_##N, LV_ALIGN_CENTER, 0, 0)
lv_obj_t *NumberKey_2 = lv_btn_create(scr, 168, 90, 68, 40, event_handler, ID_NUM_KEY2, &style_num_key_pre);
lv_obj_t *labelKey_2 = lv_label_create_empty(NumberKey_2);
lv_label_set_text(labelKey_2, machine_menu.key_2);
lv_obj_align(labelKey_2, NumberKey_2, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_3 = lv_btn_create(scr, 244, 90, 68, 40, event_handler, ID_NUM_KEY3, &style_num_key_pre);
lv_obj_t *labelKey_3 = lv_label_create_empty(NumberKey_3);
lv_label_set_text(labelKey_3, machine_menu.key_3);
lv_obj_align(labelKey_3, NumberKey_3, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_4 = lv_btn_create(scr, 92, 140, 68, 40, event_handler, ID_NUM_KEY4, &style_num_key_pre);
lv_obj_t *labelKey_4 = lv_label_create_empty(NumberKey_4);
lv_label_set_text(labelKey_4, machine_menu.key_4);
lv_obj_align(labelKey_4, NumberKey_4, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_5 = lv_btn_create(scr, 168, 140, 68, 40, event_handler, ID_NUM_KEY5, &style_num_key_pre);
lv_obj_t *labelKey_5 = lv_label_create_empty(NumberKey_5);
lv_label_set_text(labelKey_5, machine_menu.key_5);
lv_obj_align(labelKey_5, NumberKey_5, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_6 = lv_btn_create(scr, 244, 140, 68, 40, event_handler, ID_NUM_KEY6, &style_num_key_pre);
lv_obj_t *labelKey_6 = lv_label_create_empty(NumberKey_6);
lv_label_set_text(labelKey_6, machine_menu.key_6);
lv_obj_align(labelKey_6, NumberKey_6, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_7 = lv_btn_create(scr, 92, 190, 68, 40, event_handler, ID_NUM_KEY7, &style_num_key_pre);
lv_obj_t *labelKey_7 = lv_label_create_empty(NumberKey_7);
lv_label_set_text(labelKey_7, machine_menu.key_7);
lv_obj_align(labelKey_7, NumberKey_7, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_8 = lv_btn_create(scr, 168, 190, 68, 40, event_handler, ID_NUM_KEY8, &style_num_key_pre);
lv_obj_t *labelKey_8 = lv_label_create_empty(NumberKey_8);
lv_label_set_text(labelKey_8, machine_menu.key_8);
lv_obj_align(labelKey_8, NumberKey_8, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_9 = lv_btn_create(scr, 244, 190, 68, 40, event_handler, ID_NUM_KEY9, &style_num_key_pre);
lv_obj_t *labelKey_9 = lv_label_create_empty(NumberKey_9);
lv_label_set_text(labelKey_9, machine_menu.key_9);
lv_obj_align(labelKey_9, NumberKey_9, LV_ALIGN_CENTER, 0, 0);
lv_obj_t *NumberKey_0 = lv_btn_create(scr, 92, 240, 68, 40, event_handler, ID_NUM_KEY0, &style_num_key_pre);
lv_obj_t *labelKey_0 = lv_label_create_empty(NumberKey_0);
lv_label_set_text(labelKey_0, machine_menu.key_0);
lv_obj_align(labelKey_0, NumberKey_0, LV_ALIGN_CENTER, 0, 0);
DRAW_NUMBER_KEY(1, 92, 90);
DRAW_NUMBER_KEY(2, 168, 90);
DRAW_NUMBER_KEY(3, 244, 90);
DRAW_NUMBER_KEY(4, 92, 140);
DRAW_NUMBER_KEY(5, 168, 140);
DRAW_NUMBER_KEY(6, 244, 140);
DRAW_NUMBER_KEY(7, 92, 190);
DRAW_NUMBER_KEY(8, 168, 190);
DRAW_NUMBER_KEY(9, 244, 190);
DRAW_NUMBER_KEY(0, 92, 240);
lv_obj_t *KeyBack = lv_btn_create(scr, 320, 90, 68, 40, event_handler, ID_NUM_BACK, &style_num_key_pre);
lv_obj_t *labelKeyBack = lv_label_create_empty(KeyBack);

@ -53,7 +53,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
switch (obj->mks_obj_id) {
case ID_MANUAL_POS_RETURN:
uiCfg.para_ui_page = false;
lv_clear_manual_level_pos_settings();
lv_clear_tramming_pos_settings();
draw_return_ui();
return;
case ID_MANUAL_POS_X1:
@ -88,46 +88,46 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
break;
case ID_MANUAL_POS_UP:
uiCfg.para_ui_page = false;
lv_clear_manual_level_pos_settings();
lv_draw_manual_level_pos_settings();
lv_clear_tramming_pos_settings();
lv_draw_tramming_pos_settings();
return;
case ID_MANUAL_POS_DOWN:
uiCfg.para_ui_page = true;
lv_clear_manual_level_pos_settings();
lv_draw_manual_level_pos_settings();
lv_clear_tramming_pos_settings();
lv_draw_tramming_pos_settings();
return;
}
lv_clear_manual_level_pos_settings();
lv_clear_tramming_pos_settings();
lv_draw_number_key();
}
void lv_draw_manual_level_pos_settings() {
void lv_draw_tramming_pos_settings() {
char buf2[50];
scr = lv_screen_create(MANUAL_LEVELING_POSIGION_UI, machine_menu.LevelingParaConfTitle);
if (!uiCfg.para_ui_page) {
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[0][1]);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.trammingPos[0][X_AXIS]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.trammingPos[0][Y_AXIS]);
lv_screen_menu_item_2_edit(scr, leveling_menu.position1, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MANUAL_POS_Y1, 0, buf2, ID_MANUAL_POS_X1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[1][0]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[1][1]);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.trammingPos[1][X_AXIS]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.trammingPos[1][Y_AXIS]);
lv_screen_menu_item_2_edit(scr, leveling_menu.position2, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_MANUAL_POS_Y2, 1, buf2, ID_MANUAL_POS_X2, public_buf_l);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[2][0]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[2][1]);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.trammingPos[2][X_AXIS]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.trammingPos[2][Y_AXIS]);
lv_screen_menu_item_2_edit(scr, leveling_menu.position3, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_MANUAL_POS_Y3, 2, buf2, ID_MANUAL_POS_X3, public_buf_l);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[3][0]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[3][1]);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.trammingPos[3][X_AXIS]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.trammingPos[3][Y_AXIS]);
lv_screen_menu_item_2_edit(scr, leveling_menu.position4, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_MANUAL_POS_Y4, 3, buf2, ID_MANUAL_POS_X4, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_MANUAL_POS_DOWN, true);
}
else {
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[4][0]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.levelingPos[4][1]);
sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.trammingPos[4][X_AXIS]);
sprintf_P(buf2, PSTR("%d"), gCfgItems.trammingPos[4][Y_AXIS]);
lv_screen_menu_item_2_edit(scr, leveling_menu.position4, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MANUAL_POS_Y5, 0, buf2, ID_MANUAL_POS_X5, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_MANUAL_POS_UP, true);
@ -136,7 +136,7 @@ void lv_draw_manual_level_pos_settings() {
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_MANUAL_POS_RETURN, true);
}
void lv_clear_manual_level_pos_settings() {
void lv_clear_tramming_pos_settings() {
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
#endif

@ -25,8 +25,8 @@
extern "C" { /* C-declarations for C++ */
#endif
extern void lv_draw_manual_level_pos_settings();
extern void lv_clear_manual_level_pos_settings();
extern void lv_draw_tramming_pos_settings();
extern void lv_clear_tramming_pos_settings();
#ifdef __cplusplus
} /* C-declarations for C++ */

@ -125,16 +125,16 @@ void gCfgItems_init() {
gCfgItems.pausePosX = -1;
gCfgItems.pausePosY = -1;
gCfgItems.pausePosZ = 5;
gCfgItems.levelingPos[0][0] = X_MIN_POS + 30;
gCfgItems.levelingPos[0][1] = Y_MIN_POS + 30;
gCfgItems.levelingPos[1][0] = X_MAX_POS - 30;
gCfgItems.levelingPos[1][1] = Y_MIN_POS + 30;
gCfgItems.levelingPos[2][0] = X_MAX_POS - 30;
gCfgItems.levelingPos[2][1] = Y_MAX_POS - 30;
gCfgItems.levelingPos[3][0] = X_MIN_POS + 30;
gCfgItems.levelingPos[3][1] = Y_MAX_POS - 30;
gCfgItems.levelingPos[4][0] = X_BED_SIZE / 2;
gCfgItems.levelingPos[4][1] = Y_BED_SIZE / 2;
gCfgItems.trammingPos[0][X_AXIS] = X_MIN_POS + 30;
gCfgItems.trammingPos[0][Y_AXIS] = Y_MIN_POS + 30;
gCfgItems.trammingPos[1][X_AXIS] = X_MAX_POS - 30;
gCfgItems.trammingPos[1][Y_AXIS] = Y_MIN_POS + 30;
gCfgItems.trammingPos[2][X_AXIS] = X_MAX_POS - 30;
gCfgItems.trammingPos[2][Y_AXIS] = Y_MAX_POS - 30;
gCfgItems.trammingPos[3][X_AXIS] = X_MIN_POS + 30;
gCfgItems.trammingPos[3][Y_AXIS] = Y_MAX_POS - 30;
gCfgItems.trammingPos[4][X_AXIS] = X_BED_SIZE / 2;
gCfgItems.trammingPos[4][Y_AXIS] = Y_BED_SIZE / 2;
gCfgItems.cloud_enable = false;
gCfgItems.wifi_mode_sel = STA_MODEL;
gCfgItems.fileSysType = FILE_SYS_SD;
@ -994,7 +994,7 @@ void clear_cur_ui() {
case LEVELING_SETTIGNS_UI: break;
case LEVELING_PARA_UI: lv_clear_level_settings(); break;
case DELTA_LEVELING_PARA_UI: break;
case MANUAL_LEVELING_POSIGION_UI: lv_clear_manual_level_pos_settings(); break;
case MANUAL_LEVELING_POSIGION_UI: lv_clear_tramming_pos_settings(); break;
case MAXFEEDRATE_UI: lv_clear_max_feedrate_settings(); break;
case STEPS_UI: lv_clear_step_settings(); break;
case ACCELERATION_UI: lv_clear_acceleration_settings(); break;
@ -1099,7 +1099,7 @@ void draw_return_ui() {
case LEVELING_SETTIGNS_UI: break;
case LEVELING_PARA_UI: lv_draw_level_settings(); break;
case DELTA_LEVELING_PARA_UI: break;
case MANUAL_LEVELING_POSIGION_UI: lv_draw_manual_level_pos_settings(); break;
case MANUAL_LEVELING_POSIGION_UI: lv_draw_tramming_pos_settings(); break;
case MAXFEEDRATE_UI: lv_draw_max_feedrate_settings(); break;
case STEPS_UI: lv_draw_step_settings(); break;
case ACCELERATION_UI: lv_draw_acceleration_settings(); break;

@ -69,7 +69,7 @@
#include "draw_max_feedrate_settings.h"
#include "draw_tmc_step_mode_settings.h"
#include "draw_level_settings.h"
#include "draw_manual_level_pos_settings.h"
#include "draw_tramming_pos_settings.h"
#include "draw_auto_level_offset_settings.h"
#include "draw_filament_change.h"
#include "draw_filament_settings.h"
@ -197,7 +197,7 @@ typedef struct {
uint8_t wifi_type;
bool cloud_enable,
encoder_enable;
int levelingPos[5][2];
int trammingPos[5][2]; // XY
int filamentchange_load_length,
filamentchange_load_speed,
filamentchange_unload_length,

@ -99,7 +99,7 @@
#define LEVELING_CONF_TITLE_EN "Machine Settings>Leveling settings"
#define LEVELING_PARA_CONF_EN "Leveling settings"
#define LEVELING_MANUAL_POS_EN "Manual leveling coordinate settings"
#define TRAMMING_POS_EN "Manual leveling coordinate settings"
#define LEVELING_AUTO_COMMAND_EN "AutoLeveling command settings"
#define LEVELING_AUTO_ZOFFSET_EN "Nozzle-to-probe offsets settings"

@ -283,7 +283,7 @@
#define LEVELING_CONF_TITLE_RU "Hастройки принтера>Hастройки уровня"
#define LEVELING_PARA_CONF_RU "настройки уровня"
#define LEVELING_MANUAL_POS_RU "настройки координат для уровня"
#define TRAMMING_POS_RU "настройки координат для уровня"
#define LEVELING_AUTO_COMMAND_RU "настройки комманд увтоуровня"
#define LEVELING_AUTO_ZOFFSET_RU "координаты смещения сопла"

@ -84,7 +84,7 @@
#define LEVELING_CONF_TITLE_CN "机器参数>调平设置"
#define LEVELING_PARA_CONF_CN "调平设置"
#define LEVELING_MANUAL_POS_CN "手动调平坐标设置"
#define TRAMMING_POS_CN "手动调平坐标设置"
#define LEVELING_AUTO_COMMAND_CN "自动调平指令设置"
#define LEVELING_AUTO_ZOFFSET_CN "挤出头与调平开关偏移设置"

@ -84,7 +84,7 @@
#define LEVELING_CONF_TITLE_T_CN "機器參數>調平設置"
#define LEVELING_PARA_CONF_T_CN "調平設置"
#define LEVELING_MANUAL_POS_T_CN "手動調平坐標設置"
#define TRAMMING_POS_T_CN "手動調平坐標設置"
#define LEVELING_AUTO_COMMAND_T_CN "自動調平指令設置"
#define LEVELING_AUTO_ZOFFSET_T_CN "擠出頭與調平開關偏移設置"

@ -119,7 +119,7 @@ void machine_setting_disp() {
machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_CN;
machine_menu.LevelingParaConf = LEVELING_PARA_CONF_CN;
machine_menu.LevelingManuPosConf = LEVELING_MANUAL_POS_CN;
machine_menu.TrammingPosConf = TRAMMING_POS_CN;
machine_menu.LevelingAutoCommandConf = LEVELING_AUTO_COMMAND_CN;
machine_menu.LevelingAutoZoffsetConf = LEVELING_AUTO_ZOFFSET_CN;
@ -347,7 +347,7 @@ void machine_setting_disp() {
machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_T_CN;
machine_menu.LevelingParaConf = LEVELING_PARA_CONF_T_CN;
machine_menu.LevelingManuPosConf = LEVELING_MANUAL_POS_T_CN;
machine_menu.TrammingPosConf = TRAMMING_POS_T_CN;
machine_menu.LevelingAutoCommandConf = LEVELING_AUTO_COMMAND_T_CN;
machine_menu.LevelingAutoZoffsetConf = LEVELING_AUTO_ZOFFSET_T_CN;
@ -576,7 +576,7 @@ void machine_setting_disp() {
machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_EN;
machine_menu.LevelingParaConf = LEVELING_PARA_CONF_EN;
machine_menu.LevelingManuPosConf = LEVELING_MANUAL_POS_EN;
machine_menu.TrammingPosConf = TRAMMING_POS_EN;
machine_menu.LevelingAutoCommandConf = LEVELING_AUTO_COMMAND_EN;
machine_menu.LevelingAutoZoffsetConf = LEVELING_AUTO_ZOFFSET_EN;
@ -1708,7 +1708,7 @@ void disp_language_init() {
machine_menu.LevelingParaConfTitle = LEVELING_CONF_TITLE_RU;
machine_menu.LevelingParaConf = LEVELING_PARA_CONF_RU;
machine_menu.LevelingManuPosConf = LEVELING_MANUAL_POS_RU;
machine_menu.TrammingPosConf = TRAMMING_POS_RU;
machine_menu.LevelingAutoCommandConf = LEVELING_AUTO_COMMAND_RU;
machine_menu.LevelingAutoZoffsetConf = LEVELING_AUTO_ZOFFSET_RU;

@ -103,7 +103,7 @@ typedef struct machine_common_disp{
const char *LevelingParaConfTitle;
const char *LevelingParaConf;
const char *LevelingManuPosConf;
const char *TrammingPosConf;
const char *LevelingAutoCommandConf;
const char *LevelingAutoZoffsetConf;

@ -296,8 +296,11 @@ static inline void _lcd_level_bed_corners_get_next_position() {
} while (good_points < nr_edge_points); // loop until all points within tolerance
TERN_(BLTOUCH_HS_MODE, do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP)); // Do clearance in HIGH SPEED MODE at the very end
TERN_(BLTOUCH_HS_MODE, bltouch.stow()); // Stow in HIGH SPEED MODE at the very end
#if ENABLED(BLTOUCH_HS_MODE)
// In HIGH SPEED MODE do clearance and stow at the very end
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP);
bltouch.stow();
#endif
ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
ui.set_selection(true);

Loading…
Cancel
Save