My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

draw_wifi_tips.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <lv_conf.h>
  25. #include "tft_lvgl_configuration.h"
  26. #if ENABLED(MKS_WIFI_MODULE)
  27. #include "draw_ui.h"
  28. static lv_obj_t *scr;
  29. TIPS_TYPE wifi_tips_type;
  30. TIPS_DISP tips_disp;
  31. tips_menu_def tips_menu;
  32. void lv_draw_wifi_tips() {
  33. static lv_obj_t *text_tips, *wifi_name;
  34. scr = lv_screen_create(WIFI_TIPS_UI, "");
  35. wifi_name = lv_label_create(scr, (const char *)wifi_list.wifiName[wifi_list.nameIndex]);
  36. lv_obj_align(wifi_name, nullptr, LV_ALIGN_CENTER, 0, -20);
  37. text_tips = lv_label_create_empty(scr);
  38. if (wifi_tips_type == TIPS_TYPE_JOINING) {
  39. lv_label_set_text(text_tips, tips_menu.joining);
  40. lv_obj_align(text_tips, nullptr, LV_ALIGN_CENTER, 0, -60);
  41. }
  42. else if (wifi_tips_type == TIPS_TYPE_TAILED_JOIN) {
  43. lv_label_set_text(text_tips, tips_menu.failedJoin);
  44. lv_obj_align(text_tips, nullptr, LV_ALIGN_CENTER, 0, -60);
  45. }
  46. else if (wifi_tips_type == TIPS_TYPE_WIFI_CONECTED) {
  47. lv_label_set_text(text_tips, tips_menu.wifiConected);
  48. lv_obj_align(text_tips, nullptr, LV_ALIGN_CENTER, 0, -60);
  49. }
  50. tips_disp.timer = TIPS_TIMER_START;
  51. tips_disp.timer_count = 0;
  52. }
  53. void lv_clear_wifi_tips() { lv_obj_del(scr); }
  54. #endif // MKS_WIFI_MODULE
  55. #endif // HAS_TFT_LVGL_UI