My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

draw_manual_level_pos_settings.cpp 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../../../../inc/MarlinConfigPre.h"
  23. #if HAS_TFT_LVGL_UI
  24. #include "draw_ui.h"
  25. #include <lv_conf.h>
  26. #include "../../../../module/planner.h"
  27. #include "../../../../inc/MarlinConfig.h"
  28. extern lv_group_t * g;
  29. static lv_obj_t * scr;
  30. #define ID_MANUAL_POS_RETURN 1
  31. #define ID_MANUAL_POS_X1 2
  32. #define ID_MANUAL_POS_Y1 3
  33. #define ID_MANUAL_POS_X2 4
  34. #define ID_MANUAL_POS_Y2 5
  35. #define ID_MANUAL_POS_X3 6
  36. #define ID_MANUAL_POS_Y3 7
  37. #define ID_MANUAL_POS_X4 8
  38. #define ID_MANUAL_POS_Y4 9
  39. #define ID_MANUAL_POS_X5 10
  40. #define ID_MANUAL_POS_Y5 11
  41. #define ID_MANUAL_POS_DOWN 12
  42. #define ID_MANUAL_POS_UP 13
  43. static void event_handler(lv_obj_t * obj, lv_event_t event) {
  44. switch (obj->mks_obj_id) {
  45. case ID_MANUAL_POS_RETURN:
  46. if (event == LV_EVENT_CLICKED) {
  47. }
  48. else if (event == LV_EVENT_RELEASED) {
  49. uiCfg.para_ui_page = 0;
  50. lv_clear_manual_level_pos_settings();
  51. draw_return_ui();
  52. }
  53. break;
  54. case ID_MANUAL_POS_X1:
  55. if (event == LV_EVENT_CLICKED) {
  56. }
  57. else if (event == LV_EVENT_RELEASED) {
  58. value = level_pos_x1;
  59. lv_clear_manual_level_pos_settings();
  60. lv_draw_number_key();
  61. }
  62. break;
  63. case ID_MANUAL_POS_Y1:
  64. if (event == LV_EVENT_CLICKED) {
  65. }
  66. else if (event == LV_EVENT_RELEASED) {
  67. value = level_pos_y1;
  68. lv_clear_manual_level_pos_settings();
  69. lv_draw_number_key();
  70. }
  71. break;
  72. case ID_MANUAL_POS_X2:
  73. if (event == LV_EVENT_CLICKED) {
  74. }
  75. else if (event == LV_EVENT_RELEASED) {
  76. value = level_pos_x2;
  77. lv_clear_manual_level_pos_settings();
  78. lv_draw_number_key();
  79. }
  80. break;
  81. case ID_MANUAL_POS_Y2:
  82. if (event == LV_EVENT_CLICKED) {
  83. }
  84. else if (event == LV_EVENT_RELEASED) {
  85. value = level_pos_y2;
  86. lv_clear_manual_level_pos_settings();
  87. lv_draw_number_key();
  88. }
  89. break;
  90. case ID_MANUAL_POS_X3:
  91. if (event == LV_EVENT_CLICKED) {
  92. }
  93. else if (event == LV_EVENT_RELEASED) {
  94. value = level_pos_x3;
  95. lv_clear_manual_level_pos_settings();
  96. lv_draw_number_key();
  97. }
  98. break;
  99. case ID_MANUAL_POS_Y3:
  100. if (event == LV_EVENT_CLICKED) {
  101. }
  102. else if (event == LV_EVENT_RELEASED) {
  103. value = level_pos_y3;
  104. lv_clear_manual_level_pos_settings();
  105. lv_draw_number_key();
  106. }
  107. break;
  108. case ID_MANUAL_POS_X4:
  109. if (event == LV_EVENT_CLICKED) {
  110. }
  111. else if (event == LV_EVENT_RELEASED) {
  112. value = level_pos_x4;
  113. lv_clear_manual_level_pos_settings();
  114. lv_draw_number_key();
  115. }
  116. break;
  117. case ID_MANUAL_POS_Y4:
  118. if (event == LV_EVENT_CLICKED) {
  119. }
  120. else if (event == LV_EVENT_RELEASED) {
  121. value = level_pos_y4;
  122. lv_clear_manual_level_pos_settings();
  123. lv_draw_number_key();
  124. }
  125. break;
  126. case ID_MANUAL_POS_X5:
  127. if (event == LV_EVENT_CLICKED) {
  128. }
  129. else if (event == LV_EVENT_RELEASED) {
  130. value = level_pos_y5;
  131. lv_clear_manual_level_pos_settings();
  132. lv_draw_number_key();
  133. }
  134. break;
  135. case ID_MANUAL_POS_Y5:
  136. if (event == LV_EVENT_CLICKED) {
  137. }
  138. else if (event == LV_EVENT_RELEASED) {
  139. value = level_pos_y5;
  140. lv_clear_manual_level_pos_settings();
  141. lv_draw_number_key();
  142. }
  143. break;
  144. case ID_MANUAL_POS_UP:
  145. if (event == LV_EVENT_CLICKED) {
  146. }
  147. else if (event == LV_EVENT_RELEASED) {
  148. uiCfg.para_ui_page = 0;
  149. lv_clear_manual_level_pos_settings();
  150. lv_draw_manual_level_pos_settings();
  151. }
  152. break;
  153. case ID_MANUAL_POS_DOWN:
  154. if (event == LV_EVENT_CLICKED) {
  155. }
  156. else if (event == LV_EVENT_RELEASED) {
  157. uiCfg.para_ui_page = 1;
  158. lv_clear_manual_level_pos_settings();
  159. lv_draw_manual_level_pos_settings();
  160. }
  161. break;
  162. }
  163. }
  164. void lv_draw_manual_level_pos_settings(void) {
  165. lv_obj_t *buttonBack = NULL, *label_Back = NULL, *buttonTurnPage = NULL, *labelTurnPage = NULL;
  166. lv_obj_t *labelPoint1Text = NULL, *buttonX1Value = NULL, *labelX1Value = NULL;
  167. lv_obj_t *buttonY1Value = NULL, *labelY1Value = NULL;
  168. lv_obj_t *labelPoint2Text = NULL, *buttonX2Value = NULL, *labelX2Value = NULL;
  169. lv_obj_t *buttonY2Value = NULL, *labelY2Value = NULL;
  170. lv_obj_t *labelPoint3Text = NULL, *buttonX3Value = NULL, *labelX3Value = NULL;
  171. lv_obj_t *buttonY3Value = NULL, *labelY3Value = NULL;
  172. lv_obj_t *labelPoint4Text = NULL, *buttonX4Value = NULL, *labelX4Value = NULL;
  173. lv_obj_t *buttonY4Value = NULL, *labelY4Value = NULL;
  174. lv_obj_t *labelPoint5Text = NULL, *buttonX5Value = NULL, *labelX5Value = NULL;
  175. lv_obj_t *buttonY5Value = NULL, *labelY5Value = NULL;
  176. lv_obj_t * line1 = NULL, * line2 = NULL, * line3 = NULL, * line4 = NULL;
  177. if (disp_state_stack._disp_state[disp_state_stack._disp_index] != MANUAL_LEVELING_POSIGION_UI) {
  178. disp_state_stack._disp_index++;
  179. disp_state_stack._disp_state[disp_state_stack._disp_index] = MANUAL_LEVELING_POSIGION_UI;
  180. }
  181. disp_state = MANUAL_LEVELING_POSIGION_UI;
  182. scr = lv_obj_create(NULL, NULL);
  183. lv_obj_set_style(scr, &tft_style_scr);
  184. lv_scr_load(scr);
  185. lv_obj_clean(scr);
  186. lv_obj_t * title = lv_label_create(scr, NULL);
  187. lv_obj_set_style(title, &tft_style_label_rel);
  188. lv_obj_set_pos(title, TITLE_XPOS, TITLE_YPOS);
  189. lv_label_set_text(title, machine_menu.LevelingParaConfTitle);
  190. lv_refr_now(lv_refr_get_disp_refreshing());
  191. if (uiCfg.para_ui_page != 1) {
  192. labelPoint1Text = lv_label_create(scr, NULL);
  193. lv_obj_set_style(labelPoint1Text, &tft_style_label_rel);
  194. lv_obj_set_pos(labelPoint1Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10);
  195. lv_label_set_text(labelPoint1Text, leveling_menu.position1);
  196. buttonX1Value = lv_btn_create(scr, NULL);
  197. lv_obj_set_pos(buttonX1Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2);
  198. lv_obj_set_size(buttonX1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  199. lv_obj_set_event_cb_mks(buttonX1Value, event_handler, ID_MANUAL_POS_X1, NULL, 0);
  200. lv_btn_set_style(buttonX1Value, LV_BTN_STYLE_REL, &style_para_value);
  201. lv_btn_set_style(buttonX1Value, LV_BTN_STYLE_PR, &style_para_value);
  202. labelX1Value = lv_label_create(buttonX1Value, NULL);
  203. buttonY1Value = lv_btn_create(scr, NULL);
  204. lv_obj_set_pos(buttonY1Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2);
  205. lv_obj_set_size(buttonY1Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  206. lv_obj_set_event_cb_mks(buttonY1Value, event_handler, ID_MANUAL_POS_Y1, NULL, 0);
  207. lv_btn_set_style(buttonY1Value, LV_BTN_STYLE_REL, &style_para_value);
  208. lv_btn_set_style(buttonY1Value, LV_BTN_STYLE_PR, &style_para_value);
  209. labelY1Value = lv_label_create(buttonY1Value, NULL);
  210. line1 = lv_line_create(scr, NULL);
  211. lv_ex_line(line1, line_points[0]);
  212. labelPoint2Text = lv_label_create(scr, NULL);
  213. lv_obj_set_style(labelPoint2Text, &tft_style_label_rel);
  214. lv_obj_set_pos(labelPoint2Text, PARA_UI_POS_X, PARA_UI_POS_Y * 2 + 10);
  215. lv_label_set_text(labelPoint2Text, leveling_menu.position2);
  216. buttonX2Value = lv_btn_create(scr, NULL);
  217. lv_obj_set_pos(buttonX2Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2);
  218. lv_obj_set_size(buttonX2Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  219. lv_obj_set_event_cb_mks(buttonX2Value, event_handler, ID_MANUAL_POS_X2, NULL, 0);
  220. lv_btn_set_style(buttonX2Value, LV_BTN_STYLE_REL, &style_para_value);
  221. lv_btn_set_style(buttonX2Value, LV_BTN_STYLE_PR, &style_para_value);
  222. labelX2Value = lv_label_create(buttonX2Value, NULL);
  223. buttonY2Value = lv_btn_create(scr, NULL);
  224. lv_obj_set_pos(buttonY2Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 2 + PARA_UI_VALUE_V_2);
  225. lv_obj_set_size(buttonY2Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  226. lv_obj_set_event_cb_mks(buttonY2Value, event_handler, ID_MANUAL_POS_Y2, NULL, 0);
  227. lv_btn_set_style(buttonY2Value, LV_BTN_STYLE_REL, &style_para_value);
  228. lv_btn_set_style(buttonY2Value, LV_BTN_STYLE_PR, &style_para_value);
  229. labelY2Value = lv_label_create(buttonY2Value, NULL);
  230. line2 = lv_line_create(scr, NULL);
  231. lv_ex_line(line2, line_points[1]);
  232. labelPoint3Text = lv_label_create(scr, NULL);
  233. lv_obj_set_style(labelPoint3Text, &tft_style_label_rel);
  234. lv_obj_set_pos(labelPoint3Text, PARA_UI_POS_X, PARA_UI_POS_Y * 3 + 10);
  235. lv_label_set_text(labelPoint3Text, leveling_menu.position3);
  236. buttonX3Value = lv_btn_create(scr, NULL);
  237. lv_obj_set_pos(buttonX3Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2);
  238. lv_obj_set_size(buttonX3Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  239. lv_obj_set_event_cb_mks(buttonX3Value, event_handler, ID_MANUAL_POS_X3, NULL, 0);
  240. lv_btn_set_style(buttonX3Value, LV_BTN_STYLE_REL, &style_para_value);
  241. lv_btn_set_style(buttonX3Value, LV_BTN_STYLE_PR, &style_para_value);
  242. labelX3Value = lv_label_create(buttonX3Value, NULL);
  243. buttonY3Value = lv_btn_create(scr, NULL);
  244. lv_obj_set_pos(buttonY3Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 3 + PARA_UI_VALUE_V_2);
  245. lv_obj_set_size(buttonY3Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  246. lv_obj_set_event_cb_mks(buttonY3Value, event_handler, ID_MANUAL_POS_Y3, NULL, 0);
  247. lv_btn_set_style(buttonY3Value, LV_BTN_STYLE_REL, &style_para_value);
  248. lv_btn_set_style(buttonY3Value, LV_BTN_STYLE_PR, &style_para_value);
  249. labelY3Value = lv_label_create(buttonY3Value, NULL);
  250. line3 = lv_line_create(scr, NULL);
  251. lv_ex_line(line3, line_points[2]);
  252. labelPoint4Text = lv_label_create(scr, NULL);
  253. lv_obj_set_style(labelPoint4Text, &tft_style_label_rel);
  254. lv_obj_set_pos(labelPoint4Text, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10);
  255. lv_label_set_text(labelPoint4Text, leveling_menu.position4);
  256. buttonX4Value = lv_btn_create(scr, NULL);
  257. lv_obj_set_pos(buttonX4Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2);
  258. lv_obj_set_size(buttonX4Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  259. lv_obj_set_event_cb_mks(buttonX4Value, event_handler, ID_MANUAL_POS_X4, NULL, 0);
  260. lv_btn_set_style(buttonX4Value, LV_BTN_STYLE_REL, &style_para_value);
  261. lv_btn_set_style(buttonX4Value, LV_BTN_STYLE_PR, &style_para_value);
  262. labelX4Value = lv_label_create(buttonX4Value, NULL);
  263. buttonY4Value = lv_btn_create(scr, NULL);
  264. lv_obj_set_pos(buttonY4Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_VALUE_V_2);
  265. lv_obj_set_size(buttonY4Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  266. lv_obj_set_event_cb_mks(buttonY4Value, event_handler, ID_MANUAL_POS_Y4, NULL, 0);
  267. lv_btn_set_style(buttonY4Value, LV_BTN_STYLE_REL, &style_para_value);
  268. lv_btn_set_style(buttonY4Value, LV_BTN_STYLE_PR, &style_para_value);
  269. labelY4Value = lv_label_create(buttonY4Value, NULL);
  270. line4 = lv_line_create(scr, NULL);
  271. lv_ex_line(line4, line_points[3]);
  272. buttonTurnPage = lv_btn_create(scr, NULL);
  273. lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_MANUAL_POS_DOWN, NULL, 0);
  274. lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back);
  275. lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back);
  276. #if HAS_ROTARY_ENCODER
  277. if (gCfgItems.encoder_enable) {
  278. lv_group_add_obj(g, buttonX1Value);
  279. lv_group_add_obj(g, buttonY1Value);
  280. lv_group_add_obj(g, buttonX2Value);
  281. lv_group_add_obj(g, buttonY2Value);
  282. lv_group_add_obj(g, buttonX3Value);
  283. lv_group_add_obj(g, buttonY3Value);
  284. lv_group_add_obj(g, buttonX4Value);
  285. lv_group_add_obj(g, buttonY4Value);
  286. lv_group_add_obj(g, buttonTurnPage);
  287. }
  288. #endif
  289. }
  290. else {
  291. labelPoint5Text = lv_label_create(scr, NULL);
  292. lv_obj_set_style(labelPoint5Text, &tft_style_label_rel);
  293. lv_obj_set_pos(labelPoint5Text, PARA_UI_POS_X, PARA_UI_POS_Y + 10);
  294. lv_label_set_text(labelPoint5Text, leveling_menu.position5);
  295. buttonX5Value = lv_btn_create(scr, NULL);
  296. lv_obj_set_pos(buttonX5Value, PARA_UI_VALUE_POS_X_2, PARA_UI_POS_Y + PARA_UI_VALUE_V_2);
  297. lv_obj_set_size(buttonX5Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  298. lv_obj_set_event_cb_mks(buttonX5Value, event_handler, ID_MANUAL_POS_X5, NULL, 0);
  299. lv_btn_set_style(buttonX5Value, LV_BTN_STYLE_REL, &style_para_value);
  300. lv_btn_set_style(buttonX5Value, LV_BTN_STYLE_PR, &style_para_value);
  301. labelX5Value = lv_label_create(buttonX5Value, NULL);
  302. buttonY5Value = lv_btn_create(scr, NULL);
  303. lv_obj_set_pos(buttonY5Value, PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V_2);
  304. lv_obj_set_size(buttonY5Value, PARA_UI_VALUE_BTN_X_SIZE, PARA_UI_VALUE_BTN_Y_SIZE);
  305. lv_obj_set_event_cb_mks(buttonY5Value, event_handler, ID_MANUAL_POS_Y5, NULL, 0);
  306. lv_btn_set_style(buttonY5Value, LV_BTN_STYLE_REL, &style_para_value);
  307. lv_btn_set_style(buttonY5Value, LV_BTN_STYLE_PR, &style_para_value);
  308. labelY5Value = lv_label_create(buttonY5Value, NULL);
  309. line1 = lv_line_create(scr, NULL);
  310. lv_ex_line(line1, line_points[0]);
  311. buttonTurnPage = lv_btn_create(scr, NULL);
  312. lv_obj_set_event_cb_mks(buttonTurnPage, event_handler, ID_MANUAL_POS_UP, NULL, 0);
  313. lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_REL, &style_para_back);
  314. lv_btn_set_style(buttonTurnPage, LV_BTN_STYLE_PR, &style_para_back);
  315. #if HAS_ROTARY_ENCODER
  316. if (gCfgItems.encoder_enable) {
  317. lv_group_add_obj(g, buttonX5Value);
  318. lv_group_add_obj(g, buttonY5Value);
  319. lv_group_add_obj(g, buttonTurnPage);
  320. }
  321. #endif
  322. }
  323. lv_obj_set_pos(buttonTurnPage, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y);
  324. lv_obj_set_size(buttonTurnPage, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE);
  325. labelTurnPage = lv_label_create(buttonTurnPage, NULL);
  326. buttonBack = lv_btn_create(scr, NULL);
  327. lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_MANUAL_POS_RETURN, NULL, 0);
  328. lv_btn_set_style(buttonBack, LV_BTN_STYLE_REL, &style_para_back);
  329. lv_btn_set_style(buttonBack, LV_BTN_STYLE_PR, &style_para_back);
  330. lv_obj_set_pos(buttonBack, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y);
  331. lv_obj_set_size(buttonBack, PARA_UI_BACK_BTN_X_SIZE, PARA_UI_BACK_BTN_Y_SIZE);
  332. label_Back = lv_label_create(buttonBack, NULL);
  333. #if HAS_ROTARY_ENCODER
  334. if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack);
  335. #endif
  336. if (gCfgItems.multiple_language) {
  337. if (uiCfg.para_ui_page != 1) {
  338. ZERO(public_buf_l);
  339. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][0]);
  340. lv_label_set_text(labelX1Value, public_buf_l);
  341. lv_obj_align(labelX1Value, buttonX1Value, LV_ALIGN_CENTER, 0, 0);
  342. ZERO(public_buf_l);
  343. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[0][1]);
  344. lv_label_set_text(labelY1Value, public_buf_l);
  345. lv_obj_align(labelY1Value, buttonY1Value, LV_ALIGN_CENTER, 0, 0);
  346. ZERO(public_buf_l);
  347. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[1][0]);
  348. lv_label_set_text(labelX2Value, public_buf_l);
  349. lv_obj_align(labelX2Value, buttonX2Value, LV_ALIGN_CENTER, 0, 0);
  350. ZERO(public_buf_l);
  351. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[1][1]);
  352. lv_label_set_text(labelY2Value, public_buf_l);
  353. lv_obj_align(labelY2Value, buttonY2Value, LV_ALIGN_CENTER, 0, 0);
  354. ZERO(public_buf_l);
  355. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[2][0]);
  356. lv_label_set_text(labelX3Value, public_buf_l);
  357. lv_obj_align(labelX3Value, buttonX3Value, LV_ALIGN_CENTER, 0, 0);
  358. ZERO(public_buf_l);
  359. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[2][1]);
  360. lv_label_set_text(labelY3Value, public_buf_l);
  361. lv_obj_align(labelY3Value, buttonY3Value, LV_ALIGN_CENTER, 0, 0);
  362. ZERO(public_buf_l);
  363. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[3][0]);
  364. lv_label_set_text(labelX4Value, public_buf_l);
  365. lv_obj_align(labelX4Value, buttonX4Value, LV_ALIGN_CENTER, 0, 0);
  366. ZERO(public_buf_l);
  367. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[3][1]);
  368. lv_label_set_text(labelY4Value, public_buf_l);
  369. lv_obj_align(labelY4Value, buttonY4Value, LV_ALIGN_CENTER, 0, 0);
  370. lv_label_set_text(labelTurnPage, machine_menu.next);
  371. lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0);
  372. }
  373. else {
  374. ZERO(public_buf_l);
  375. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[4][0]);
  376. lv_label_set_text(labelX5Value, public_buf_l);
  377. lv_obj_align(labelX5Value, buttonX5Value, LV_ALIGN_CENTER, 0, 0);
  378. ZERO(public_buf_l);
  379. sprintf_P(public_buf_l, PSTR("%d"), gCfgItems.levelingPos[4][1]);
  380. lv_label_set_text(labelY5Value, public_buf_l);
  381. lv_obj_align(labelY5Value, buttonY5Value, LV_ALIGN_CENTER, 0, 0);
  382. lv_label_set_text(labelTurnPage, machine_menu.previous);
  383. lv_obj_align(labelTurnPage, buttonTurnPage, LV_ALIGN_CENTER, 0, 0);
  384. }
  385. lv_label_set_text(label_Back, common_menu.text_back);
  386. lv_obj_align(label_Back, buttonBack, LV_ALIGN_CENTER, 0, 0);
  387. }
  388. }
  389. void lv_clear_manual_level_pos_settings() {
  390. #if HAS_ROTARY_ENCODER
  391. if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
  392. #endif
  393. lv_obj_del(scr);
  394. }
  395. #endif // HAS_TFT_LVGL_UI