My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

main_menu.cpp 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*****************
  2. * main_menu.cpp *
  3. *****************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  7. * Written By Marcio Teixeira 2019 - Cocoa Press *
  8. * *
  9. * This program is free software: you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation, either version 3 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. * This program is distributed in the hope that it will be useful, *
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  17. * GNU General Public License for more details. *
  18. * *
  19. * To view a copy of the GNU General Public License, go to the following *
  20. * location: <http://www.gnu.org/licenses/>. *
  21. ****************************************************************************/
  22. #include "../config.h"
  23. #if ENABLED(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO)
  24. #include "screens.h"
  25. using namespace FTDI;
  26. using namespace Theme;
  27. void MainMenu::onRedraw(draw_mode_t what) {
  28. if (what & BACKGROUND) {
  29. CommandProcessor cmd;
  30. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  31. .cmd(CLEAR(true,true,true));
  32. }
  33. if (what & FOREGROUND) {
  34. CommandProcessor cmd;
  35. cmd.colors(normal_btn)
  36. .font(Theme::font_medium)
  37. #ifdef TOUCH_UI_PORTRAIT
  38. #define GRID_ROWS 8
  39. #define GRID_COLS 2
  40. .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME))
  41. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  42. .enabled(1)
  43. #else
  44. .enabled(0)
  45. #endif
  46. .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE))
  47. .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS))
  48. .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
  49. .tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE))
  50. #if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
  51. .enabled(1)
  52. #else
  53. .enabled(0)
  54. #endif
  55. .tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
  56. .tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
  57. #ifdef PRINTCOUNTER
  58. .enabled(1)
  59. #else
  60. .enabled(0)
  61. #endif
  62. .tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
  63. .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU))
  64. .colors(action_btn)
  65. .tag(1).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
  66. #undef GRID_COLS
  67. #undef GRID_ROWS
  68. #else
  69. #define GRID_ROWS 5
  70. #define GRID_COLS 2
  71. .tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME))
  72. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  73. .enabled(1)
  74. #else
  75. .enabled(0)
  76. #endif
  77. .tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE))
  78. .tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS))
  79. .tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
  80. .tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE))
  81. #if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
  82. .enabled(1)
  83. #else
  84. .enabled(0)
  85. #endif
  86. .tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
  87. .tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
  88. #ifdef PRINTCOUNTER
  89. .enabled(1)
  90. #else
  91. .enabled(0)
  92. #endif
  93. .tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
  94. .tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_MENU))
  95. .colors(action_btn)
  96. .tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
  97. #undef GRID_COLS
  98. #undef GRID_ROWS
  99. #endif
  100. }
  101. }
  102. bool MainMenu::onTouchEnd(uint8_t tag) {
  103. using namespace ExtUI;
  104. switch (tag) {
  105. case 1: GOTO_PREVIOUS(); break;
  106. case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break;
  107. #if ENABLED(NOZZLE_CLEAN_FEATURE)
  108. case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
  109. #endif
  110. case 4: GOTO_SCREEN(MoveAxisScreen); break;
  111. case 5: injectCommands_P(PSTR("M84")); break;
  112. case 6: GOTO_SCREEN(TemperatureScreen); break;
  113. case 7: GOTO_SCREEN(ChangeFilamentScreen); break;
  114. case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
  115. #if ENABLED(PRINTCOUNTER)
  116. case 9: GOTO_SCREEN(StatisticsScreen); break;
  117. #endif
  118. case 10: GOTO_SCREEN(AboutScreen); break;
  119. default:
  120. return false;
  121. }
  122. return true;
  123. }
  124. #endif // TOUCH_UI_FTDI_EVE