🎨 Fix up MKS UI defines

This commit is contained in:
Scott Lahteine 2021-10-17 18:11:16 -05:00 committed by Scott Lahteine
parent f80bcdcc5c
commit 01a0f3a8cf
26 changed files with 123 additions and 129 deletions

View File

@ -110,38 +110,53 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_acceleration_settings() {
scr = lv_screen_create(ACCELERATION_UI, machine_menu.AccelerationConfTitle);
lv_coord_t y = PARA_UI_POS_Y;
if (!uiCfg.para_ui_page) {
dtostrf(planner.settings.acceleration, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_PRINT, 0, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_PRINT, 0, public_buf_l);
y += PARA_UI_POS_Y;
dtostrf(planner.settings.retract_acceleration, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_RETRA, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_RETRA, 1, public_buf_l);
y += PARA_UI_POS_Y;
dtostrf(planner.settings.travel_acceleration, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l);
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[X_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.X_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_ACCE_X, 3, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.X_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_X, 3, 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_ACCE_DOWN, true);
}
else {
#if HAS_Y_AXIS
itoa(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_Y, 0, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_Y, 0, public_buf_l);
#endif
#if HAS_Z_AXIS
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_Z, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_Z, 1, public_buf_l);
#endif
#if HAS_HOTEND
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[E_AXIS], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.E0_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_E0, 2, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.E0_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_E0, 2, public_buf_l);
#endif
#if ENABLED(DISTINCT_E_FACTORS)
y += PARA_UI_POS_Y;
itoa(planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)], public_buf_l, 10);
lv_screen_menu_item_1_edit(scr, machine_menu.E1_Acceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_ACCE_E1, 3, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.E1_Acceleration, PARA_UI_POS_X, y, event_handler, ID_ACCE_E1, 3, public_buf_l);
#endif
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_ACCE_UP, true);
}
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ACCE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_ACCE_RETURN, true);
}
void lv_clear_acceleration_settings() {

View File

@ -84,7 +84,7 @@ void lv_draw_advance_settings() {
index++;
#endif
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_ADVANCE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_ADVANCE_RETURN, true);
}
void lv_clear_advance_settings() {

View File

@ -77,7 +77,7 @@ void lv_draw_auto_level_offset_settings() {
dtostrf(TERN0(HAS_PROBE_XY_OFFSET, probe.offset.z), 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.Zoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_OFFSET_Z, 2, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_OFFSET_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_OFFSET_RETURN, true);
}
void lv_clear_auto_level_offset_settings() {

View File

@ -45,14 +45,14 @@ static lv_obj_t *scr;
static lv_obj_t *labelV, *buttonV, *zOffsetText;
enum {
ID_BABY_STEP_X_P = 1,
ID_BABY_STEP_X_N,
ID_BABY_STEP_Y_P,
ID_BABY_STEP_Y_N,
ID_BABY_STEP_Z_P,
ID_BABY_STEP_Z_N,
ID_BABY_STEP_DIST,
ID_BABY_STEP_RETURN
ID_BABYSTEP_X_P = 1,
ID_BABYSTEP_X_N,
ID_BABYSTEP_Y_P,
ID_BABYSTEP_Y_N,
ID_BABYSTEP_Z_P,
ID_BABYSTEP_Z_N,
ID_BABYSTEP_DIST,
ID_BABYSTEP_RETURN
};
static float babystep_dist = 0.01;
@ -63,37 +63,37 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
char baby_buf[30] = { 0 };
char str_1[16];
switch (obj->mks_obj_id) {
case ID_BABY_STEP_X_P:
case ID_BABYSTEP_X_P:
sprintf_P(baby_buf, PSTR("M290 X%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_X_N:
case ID_BABYSTEP_X_N:
sprintf_P(baby_buf, PSTR("M290 X%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Y_P:
case ID_BABYSTEP_Y_P:
sprintf_P(baby_buf, PSTR("M290 Y%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Y_N:
case ID_BABYSTEP_Y_N:
sprintf_P(baby_buf, PSTR("M290 Y%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Z_P:
case ID_BABYSTEP_Z_P:
sprintf_P(baby_buf, PSTR("M290 Z%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_Z_N:
case ID_BABYSTEP_Z_N:
sprintf_P(baby_buf, PSTR("M290 Z%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now(F(baby_buf));
has_adjust_z = 1;
break;
case ID_BABY_STEP_DIST:
case ID_BABYSTEP_DIST:
if (ABS((int)(100 * babystep_dist)) == 1)
babystep_dist = 0.05;
else if (ABS((int)(100 * babystep_dist)) == 5)
@ -102,7 +102,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
babystep_dist = 0.01;
disp_baby_step_dist();
break;
case ID_BABY_STEP_RETURN:
case ID_BABYSTEP_RETURN:
if (has_adjust_z == 1) {
TERN_(EEPROM_SETTINGS, (void)settings.save());
has_adjust_z = 0;
@ -114,21 +114,21 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
}
void lv_draw_baby_stepping() {
scr = lv_screen_create(BABY_STEP_UI);
lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_BABY_STEP_X_P);
lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_X_N);
lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABY_STEP_Y_P);
lv_big_button_create(scr, "F:/bmp_yDec.bin", move_menu.y_dec, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Y_N);
lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABY_STEP_Z_P);
lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_Z_N);
buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABY_STEP_DIST);
scr = lv_screen_create(BABYSTEP_UI);
lv_big_button_create(scr, "F:/bmp_xAdd.bin", move_menu.x_add, INTERVAL_V, titleHeight, event_handler, ID_BABYSTEP_X_P);
lv_big_button_create(scr, "F:/bmp_xDec.bin", move_menu.x_dec, INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_X_N);
lv_big_button_create(scr, "F:/bmp_yAdd.bin", move_menu.y_add, BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_BABYSTEP_Y_P);
lv_big_button_create(scr, "F:/bmp_yDec.bin", move_menu.y_dec, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_Y_N);
lv_big_button_create(scr, "F:/bmp_zAdd.bin", move_menu.z_add, BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_BABYSTEP_Z_P);
lv_big_button_create(scr, "F:/bmp_zDec.bin", move_menu.z_dec, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_Z_N);
buttonV = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_BABYSTEP_DIST);
labelV = lv_label_create_empty(buttonV);
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable)
lv_group_add_obj(g, buttonV);
#endif
lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABY_STEP_RETURN);
lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_BABYSTEP_RETURN);
disp_baby_step_dist();

View File

@ -70,7 +70,7 @@ void lv_draw_eeprom_settings() {
scr = lv_screen_create(EEPROM_SETTINGS_UI);
lv_screen_menu_item(scr, eeprom_menu.revert, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_EEPROM_REVERT, 0);
lv_screen_menu_item(scr, eeprom_menu.store, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_EEPROM_STORE, 1);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_EEPROM_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_EEPROM_RETURN, true);
}
void lv_clear_eeprom_settings() {

View File

@ -58,7 +58,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_encoder_settings() {
scr = lv_screen_create(ENCODER_SETTINGS_UI, machine_menu.EncoderConfTitle);
buttonEncoderState = lv_screen_menu_item_onoff(scr, machine_menu.EncoderConfText, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ENCODER_STATE, 0, gCfgItems.encoder_enable);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_ENCODER_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_ENCODER_RETURN, true);
}
void lv_clear_encoder_settings() {

View File

@ -114,7 +114,7 @@ void lv_draw_filament_settings() {
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_FILAMENT_SET_UP, true);
}
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_FILAMENT_SET_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_FILAMENT_SET_RETURN, true);
}
void lv_clear_filament_settings() {

View File

@ -96,7 +96,7 @@ void lv_draw_gcode(bool clear) {
outL = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2, "Result:");
outV = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, (const char*)public_buf);
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_GCODE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_GCODE_RETURN, true);
}
void lv_clear_gcode() {

View File

@ -92,7 +92,7 @@ void lv_draw_homing_sensitivity_settings() {
lv_screen_menu_item_1_edit(scr, machine_menu.Z2_Sensitivity, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_SENSITIVITY_Z2, 3, public_buf_l);
#endif
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_SENSITIVITY_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_SENSITIVITY_RETURN, true);
}
void lv_clear_homing_sensitivity_settings() {

View File

@ -86,7 +86,7 @@ void lv_draw_jerk_settings() {
dtostrf(planner.max_jerk[E_AXIS], 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_JERK_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_JERK_RETURN, true);
}
void lv_clear_jerk_settings() {

View File

@ -88,22 +88,22 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
if (!txt) return;
// Do the corresponding action according to the text of the button
if (strcmp(txt, "abc") == 0) {
if (strcmp_P(txt, PSTR("abc")) == 0) {
lv_btnm_set_map(kb, kb_map_lc);
lv_btnm_set_ctrl_map(kb, kb_ctrl_lc_map);
return;
}
else if (strcmp(txt, "ABC") == 0) {
else if (strcmp_P(txt, PSTR("ABC")) == 0) {
lv_btnm_set_map(kb, kb_map_uc);
lv_btnm_set_ctrl_map(kb, kb_ctrl_uc_map);
return;
}
else if (strcmp(txt, "1#") == 0) {
else if (strcmp_P(txt, PSTR("1#")) == 0) {
lv_btnm_set_map(kb, kb_map_spec);
lv_btnm_set_ctrl_map(kb, kb_ctrl_spec_map);
return;
}
else if (strcmp(txt, LV_SYMBOL_CLOSE) == 0) {
else if (strcmp_P(txt, PSTR(LV_SYMBOL_CLOSE)) == 0) {
if (kb->event_cb != lv_kb_def_event_cb) {
lv_clear_keyboard();
draw_return_ui();
@ -115,7 +115,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
}
return;
}
else if (strcmp(txt, LV_SYMBOL_OK) == 0) {
else if (strcmp_P(txt, PSTR(LV_SYMBOL_OK)) == 0) {
if (kb->event_cb != lv_kb_def_event_cb) {
const char * ret_ta_txt = lv_ta_get_text(ext->ta);
switch (keyboard_value) {
@ -183,15 +183,15 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
// Add the characters to the text area if set
if (!ext->ta) return;
if (strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0)
if (strcmp_P(txt, PSTR("Enter")) == 0 || strcmp_P(txt, PSTR(LV_SYMBOL_NEW_LINE)) == 0)
lv_ta_add_char(ext->ta, '\n');
else if (strcmp(txt, LV_SYMBOL_LEFT) == 0)
else if (strcmp_P(txt, PSTR(LV_SYMBOL_LEFT)) == 0)
lv_ta_cursor_left(ext->ta);
else if (strcmp(txt, LV_SYMBOL_RIGHT) == 0)
else if (strcmp_P(txt, PSTR(LV_SYMBOL_RIGHT)) == 0)
lv_ta_cursor_right(ext->ta);
else if (strcmp(txt, LV_SYMBOL_BACKSPACE) == 0)
else if (strcmp_P(txt, PSTR(LV_SYMBOL_BACKSPACE)) == 0)
lv_ta_del_char(ext->ta);
else if (strcmp(txt, "+/-") == 0) {
else if (strcmp_P(txt, PSTR("+/-")) == 0) {
uint16_t cur = lv_ta_get_cursor_pos(ext->ta);
const char * ta_txt = lv_ta_get_text(ext->ta);
if (ta_txt[0] == '-') {

View File

@ -68,7 +68,7 @@ void lv_draw_level_settings() {
#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);
#endif
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_LEVEL_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_LEVEL_RETURN, true);
}
void lv_clear_level_settings() {

View File

@ -72,7 +72,7 @@ void lv_draw_machine_para() {
lv_screen_menu_item(scr, MachinePara_menu.MotorSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PARA_MOTOR, 1);
lv_screen_menu_item(scr, MachinePara_menu.leveling, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PARA_LEVEL, 2);
lv_screen_menu_item(scr, MachinePara_menu.AdvanceSetting, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_PARA_ADVANCE, 3);
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_PARA_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_PARA_RETURN, true);
}
void lv_clear_machine_para() {

View File

@ -41,36 +41,28 @@ enum {
static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (event != LV_EVENT_RELEASED) return;
clear_cur_ui();
switch (obj->mks_obj_id) {
case ID_MACHINE_RETURN:
lv_clear_machine_settings();
draw_return_ui();
break;
case ID_MACHINE_ACCELERATION:
lv_clear_machine_settings();
lv_draw_acceleration_settings();
break;
case ID_MACHINE_FEEDRATE:
lv_clear_machine_settings();
lv_draw_max_feedrate_settings();
break;
case ID_MACHINE_RETURN: draw_return_ui(); break;
case ID_MACHINE_ACCELERATION: lv_draw_acceleration_settings(); break;
case ID_MACHINE_FEEDRATE: lv_draw_max_feedrate_settings(); break;
#if HAS_CLASSIC_JERK
case ID_MACHINE_JERK:
lv_clear_machine_settings();
lv_draw_jerk_settings();
break;
case ID_MACHINE_JERK: lv_draw_jerk_settings(); break;
#endif
}
}
void lv_draw_machine_settings() {
scr = lv_screen_create(MACHINE_SETTINGS_UI, machine_menu.MachineConfigTitle);
lv_screen_menu_item(scr, machine_menu.AccelerationConf, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_MACHINE_ACCELERATION, 0);
lv_screen_menu_item(scr, machine_menu.MaxFeedRateConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_MACHINE_FEEDRATE, 1);
lv_coord_t y = PARA_UI_POS_Y;
lv_screen_menu_item(scr, machine_menu.AccelerationConf, PARA_UI_POS_X, y, event_handler, ID_MACHINE_ACCELERATION, 0);
y += PARA_UI_POS_Y;
lv_screen_menu_item(scr, machine_menu.MaxFeedRateConf, PARA_UI_POS_X, y, event_handler, ID_MACHINE_FEEDRATE, 1);
#if HAS_CLASSIC_JERK
lv_screen_menu_item(scr, machine_menu.JerkConf, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_MACHINE_JERK, 2);
y += PARA_UI_POS_Y;
lv_screen_menu_item(scr, machine_menu.JerkConf, PARA_UI_POS_X, y, event_handler, ID_MACHINE_JERK, 2);
#endif
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_MACHINE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_MACHINE_RETURN, true);
}
void lv_clear_machine_settings() {

View File

@ -105,7 +105,7 @@ void lv_draw_max_feedrate_settings() {
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_FEED_UP, true);
}
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_FEED_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_FEED_RETURN, true);
}
void lv_clear_max_feedrate_settings() {

View File

@ -86,7 +86,7 @@ void lv_draw_motor_settings() {
index++;
#endif
#endif
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_MOTOR_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_MOTOR_RETURN, true);
}
void lv_clear_motor_settings() {

View File

@ -72,7 +72,7 @@ void lv_draw_pause_position() {
dtostrf(gCfgItems.pausePosZ, 1, 1, public_buf_l);
lv_screen_menu_item_1_edit(scr, machine_menu.zPos, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PAUSE_Z, 2, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_PAUSE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_PAUSE_RETURN, true);
}
void lv_clear_pause_position() {

View File

@ -188,7 +188,7 @@ void disp_add_dec() {
}
void lv_draw_preHeat() {
scr = lv_screen_create(PRE_HEAT_UI);
scr = lv_screen_create(PREHEAT_UI);
// Create image buttons
disp_add_dec();

View File

@ -104,7 +104,7 @@ void lv_draw_step_settings() {
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_STEP_UP, true);
}
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_STEP_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_STEP_RETURN, true);
}
void lv_clear_step_settings() {

View File

@ -54,29 +54,19 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
draw_return_ui();
return;
#if AXIS_IS_TMC(X)
case ID_TMC_CURRENT_X:
value = Xcurrent;
break;
case ID_TMC_CURRENT_X: value = Xcurrent; break;
#endif
#if AXIS_IS_TMC(Y)
case ID_TMC_CURRENT_Y:
value = Ycurrent;
break;
case ID_TMC_CURRENT_Y: value = Ycurrent; break;
#endif
#if AXIS_IS_TMC(Z)
case ID_TMC_CURRENT_Z:
value = Zcurrent;
break;
case ID_TMC_CURRENT_Z: value = Zcurrent; break;
#endif
#if AXIS_IS_TMC(E0)
case ID_TMC_CURRENT_E0:
value = E0current;
break;
case ID_TMC_CURRENT_E0: value = E0current; break;
#endif
#if AXIS_IS_TMC(E1)
case ID_TMC_CURRENT_E1:
value = E1current;
break;
case ID_TMC_CURRENT_E1: value = E1current; break;
#endif
case ID_TMC_CURRENT_UP:
@ -143,7 +133,7 @@ void lv_draw_tmc_current_settings() {
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_TMC_CURRENT_UP, true);
}
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_TMC_CURRENT_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_TMC_CURRENT_RETURN, true);
}
void lv_clear_tmc_current_settings() {

View File

@ -122,7 +122,7 @@ void lv_draw_tmc_step_mode_settings() {
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_TMC_MODE_UP, true);
}
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_TMC_MODE_RETURN, true);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_TMC_MODE_RETURN, true);
}
void lv_clear_tmc_step_mode_settings() {

View File

@ -105,7 +105,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_tramming_pos_settings() {
char buf2[50];
scr = lv_screen_create(MANUAL_LEVELING_POSIGION_UI, machine_menu.LevelingParaConfTitle);
scr = lv_screen_create(MANUAL_LEVELING_POSITION_UI, machine_menu.LevelingParaConfTitle);
if (!uiCfg.para_ui_page) {
itoa(gCfgItems.trammingPos[0].x, public_buf_l, 10);
@ -134,7 +134,7 @@ void lv_draw_tramming_pos_settings() {
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);
}
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);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACK_POS_X + 10, PARA_UI_BACK_POS_Y, event_handler, ID_MANUAL_POS_RETURN, true);
}
void lv_clear_tramming_pos_settings() {

View File

@ -475,7 +475,7 @@ char *getDispText(int index) {
case EXTRUSION_UI: strcpy(public_buf_l, extrude_menu.title); break;
case CHANGE_SPEED_UI: strcpy(public_buf_l, speed_menu.title); break;
case FAN_UI: strcpy(public_buf_l, fan_menu.title); break;
case PRE_HEAT_UI:
case PREHEAT_UI:
switch (disp_state_stack._disp_state[disp_state_stack._disp_index]) {
case OPERATE_UI: strcpy(public_buf_l, preheat_menu.adjust_title);
default: strcpy(public_buf_l, preheat_menu.title); break;
@ -500,7 +500,7 @@ char *getDispText(int index) {
case TOOL_UI: strcpy(public_buf_l, tool_menu.title); break;
case WIFI_LIST_UI: TERN_(MKS_WIFI_MODULE, strcpy(public_buf_l, list_menu.title)); break;
case MACHINE_PARA_UI: strcpy(public_buf_l, MachinePara_menu.title); break;
case BABY_STEP_UI: strcpy(public_buf_l, operation_menu.babystep); break;
case BABYSTEP_UI: strcpy(public_buf_l, operation_menu.babystep); break;
case EEPROM_SETTINGS_UI: strcpy(public_buf_l, eeprom_menu.title); break;
case MEDIA_SELECT_UI: strcpy(public_buf_l, media_select_menu.title); break;
default: break;
@ -742,7 +742,7 @@ void GUI_RefreshPage() {
disp_hotend_temp();
}
break;
case PRE_HEAT_UI:
case PREHEAT_UI:
if (temps_update_flag) {
temps_update_flag = false;
disp_desire_temp();
@ -864,7 +864,7 @@ void GUI_RefreshPage() {
break;
#endif
case BABY_STEP_UI:
case BABYSTEP_UI:
if (temps_update_flag) {
temps_update_flag = false;
disp_z_offset_value();
@ -888,7 +888,7 @@ void clear_cur_ui() {
case OPERATE_UI: lv_clear_operation(); break;
case PAUSE_UI: break;
case EXTRUSION_UI: lv_clear_extrusion(); break;
case PRE_HEAT_UI: lv_clear_preHeat(); break;
case PREHEAT_UI: lv_clear_preHeat(); break;
case CHANGE_SPEED_UI: lv_clear_change_speed(); break;
case FAN_UI: lv_clear_fan(); break;
case SET_UI: lv_clear_set(); break;
@ -929,15 +929,14 @@ void clear_cur_ui() {
case MACHINE_SETTINGS_UI: lv_clear_machine_settings(); break;
case TEMPERATURE_SETTINGS_UI: break;
case MOTOR_SETTINGS_UI: lv_clear_motor_settings(); break;
case MACHINETYPE_UI: break;
case MACHINE_TYPE_UI: break;
case STROKE_UI: break;
case HOME_DIR_UI: break;
case ENDSTOP_TYPE_UI: break;
case FILAMENT_SETTINGS_UI: break;
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_tramming_pos_settings(); break;
case MANUAL_LEVELING_POSITION_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;
@ -950,7 +949,7 @@ void clear_cur_ui() {
case DOUBLE_Z_UI: break;
case ENABLE_INVERT_UI: break;
case NUMBER_KEY_UI: lv_clear_number_key(); break;
case BABY_STEP_UI: lv_clear_baby_stepping(); break;
case BABYSTEP_UI: lv_clear_baby_stepping(); break;
case PAUSE_POS_UI: lv_clear_pause_position(); break;
#if HAS_TRINAMIC_CONFIG
case TMC_CURRENT_UI: lv_clear_tmc_current_settings(); break;
@ -997,7 +996,7 @@ void draw_return_ui() {
case OPERATE_UI: lv_draw_operation(); break;
case PAUSE_UI: break;
case EXTRUSION_UI: lv_draw_extrusion(); break;
case PRE_HEAT_UI: lv_draw_preHeat(); break;
case PREHEAT_UI: lv_draw_preHeat(); break;
case CHANGE_SPEED_UI: lv_draw_change_speed(); break;
case FAN_UI: lv_draw_fan(); break;
case SET_UI: lv_draw_set(); break;
@ -1037,15 +1036,14 @@ void draw_return_ui() {
case MACHINE_SETTINGS_UI: lv_draw_machine_settings(); break;
case TEMPERATURE_SETTINGS_UI: break;
case MOTOR_SETTINGS_UI: lv_draw_motor_settings(); break;
case MACHINETYPE_UI: break;
case MACHINE_TYPE_UI: break;
case STROKE_UI: break;
case HOME_DIR_UI: break;
case ENDSTOP_TYPE_UI: break;
case FILAMENT_SETTINGS_UI: lv_draw_filament_settings(); break;
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_tramming_pos_settings(); break;
case MANUAL_LEVELING_POSITION_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;
@ -1061,7 +1059,7 @@ void draw_return_ui() {
case ENABLE_INVERT_UI: break;
case NUMBER_KEY_UI: lv_draw_number_key(); break;
case DIALOG_UI: break;
case BABY_STEP_UI: lv_draw_baby_stepping(); break;
case BABYSTEP_UI: lv_draw_baby_stepping(); break;
case PAUSE_POS_UI: lv_draw_pause_position(); break;
#if HAS_TRINAMIC_CONFIG
case TMC_CURRENT_UI: lv_draw_tmc_current_settings(); break;

View File

@ -143,8 +143,8 @@
#define PARA_UI_ARROW_V 12
#define PARA_UI_BACL_POS_X 400
#define PARA_UI_BACL_POS_Y 270
#define PARA_UI_BACK_POS_X 400
#define PARA_UI_BACK_POS_Y 270
#define PARA_UI_TURN_PAGE_POS_X 320
#define PARA_UI_TURN_PAGE_POS_Y 270
@ -270,7 +270,7 @@ typedef enum {
PAUSE_UI,
EXTRUSION_UI,
FAN_UI,
PRE_HEAT_UI,
PREHEAT_UI,
CHANGE_SPEED_UI,
TEMP_UI,
SET_UI,
@ -304,15 +304,14 @@ typedef enum {
MACHINE_SETTINGS_UI,
TEMPERATURE_SETTINGS_UI,
MOTOR_SETTINGS_UI,
MACHINETYPE_UI,
MACHINE_TYPE_UI,
STROKE_UI,
HOME_DIR_UI,
ENDSTOP_TYPE_UI,
FILAMENT_SETTINGS_UI,
LEVELING_SETTIGNS_UI,
LEVELING_PARA_UI,
DELTA_LEVELING_PARA_UI,
MANUAL_LEVELING_POSIGION_UI,
MANUAL_LEVELING_POSITION_UI,
MAXFEEDRATE_UI,
STEPS_UI,
ACCELERATION_UI,
@ -325,7 +324,7 @@ typedef enum {
DOUBLE_Z_UI,
ENABLE_INVERT_UI,
NUMBER_KEY_UI,
BABY_STEP_UI,
BABYSTEP_UI,
ERROR_MESSAGE_UI,
PAUSE_POS_UI,
TMC_CURRENT_UI,
@ -336,7 +335,7 @@ typedef enum {
ENCODER_SETTINGS_UI,
TOUCH_CALIBRATION_UI,
GCODE_UI,
MEDIA_SELECT_UI,
MEDIA_SELECT_UI
} DISP_STATE;
typedef struct {

View File

@ -130,7 +130,7 @@ void lv_draw_wifi_settings() {
lv_obj_t *buttonConfig = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_WIFI_CONFIG);
lv_obj_t *labelConfig = lv_label_create_empty(buttonConfig);
lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_WIFI_RETURN);
lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_back70x40.bin", PARA_UI_BACK_POS_X, PARA_UI_BACK_POS_Y, event_handler, ID_WIFI_RETURN);
lv_obj_t *label_Back = lv_label_create_empty(buttonBack);
if (gCfgItems.multiple_language) {

View File

@ -2026,12 +2026,12 @@ void get_wifi_commands() {
#if DISABLED(EMERGENCY_PARSER)
// Process critical commands early
if (strcmp(command, "M108") == 0) {
if (strcmp_P(command, PSTR("M108")) == 0) {
wait_for_heatup = false;
TERN_(HAS_LCD_MENU, wait_for_user = false);
}
if (strcmp(command, "M112") == 0) kill(FPSTR(M112_KILL_STR), nullptr, true);
if (strcmp(command, "M410") == 0) quickstop_stepper();
if (strcmp_P(command, PSTR("M112")) == 0) kill(FPSTR(M112_KILL_STR), nullptr, true);
if (strcmp_P(command, PSTR("M410")) == 0) quickstop_stepper();
#endif
// Add the command to the queue