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.

advanced_settings_menu.cpp 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /*****************************
  2. * advance_settings_menu.cpp *
  3. *****************************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  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. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <http://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #if ENABLED(LULZBOT_TOUCH_UI) && !defined(LULZBOT_USE_BIOPRINTER_UI)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. using namespace Theme;
  27. void AdvancedSettingsMenu::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 9
  39. #define GRID_COLS 2
  40. #if HAS_BED_PROBE
  41. .enabled(1)
  42. #else
  43. .enabled(0)
  44. #endif
  45. .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(ZPROBE_ZOFFSET))
  46. .enabled(1)
  47. .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(STEPS_PER_MM))
  48. #if HAS_TRINAMIC
  49. .enabled(1)
  50. #else
  51. .enabled(0)
  52. #endif
  53. .tag(13).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MOTOR_CURRENT))
  54. #if HAS_TRINAMIC
  55. .enabled(1)
  56. #else
  57. .enabled(0)
  58. #endif
  59. .tag(14).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(HOME_SENSE))
  60. #if HOTENDS > 1
  61. .enabled(1)
  62. #else
  63. .enabled(0)
  64. #endif
  65. .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(TOOL_OFFSETS))
  66. #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
  67. .enabled(1)
  68. #else
  69. .enabled(0)
  70. #endif
  71. .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(FILAMENT))
  72. .tag(12).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(ENDSTOPS))
  73. .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(DISPLAY_MENU))
  74. .tag(9) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(INTERFACE_SETTINGS))
  75. .tag(10).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(RESTORE_DEFAULTS))
  76. .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(VELOCITY))
  77. .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(ACCELERATION))
  78. #if DISABLED(CLASSIC_JERK)
  79. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(JUNC_DEVIATION))
  80. #else
  81. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(JERK))
  82. #endif
  83. #if ENABLED(BACKLASH_GCODE)
  84. .enabled(1)
  85. #else
  86. .enabled(0)
  87. #endif
  88. .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(BACKLASH))
  89. .colors(action_btn)
  90. .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(BACK));
  91. #undef GRID_COLS
  92. #undef GRID_ROWS
  93. #else
  94. #define GRID_ROWS 6
  95. #define GRID_COLS 3
  96. #if HAS_BED_PROBE
  97. .enabled(1)
  98. #else
  99. .enabled(0)
  100. #endif
  101. .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,2), GET_TEXT_F(ZPROBE_ZOFFSET))
  102. .enabled(1)
  103. .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(STEPS_PER_MM))
  104. #if HAS_TRINAMIC
  105. .enabled(1)
  106. #else
  107. .enabled(0)
  108. #endif
  109. .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXT_F(MOTOR_CURRENT))
  110. #if HAS_TRINAMIC
  111. .enabled(1)
  112. #else
  113. .enabled(0)
  114. #endif
  115. .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXT_F(HOME_SENSE))
  116. #if ENABLED(BACKLASH_GCODE)
  117. .enabled(1)
  118. #else
  119. .enabled(0)
  120. #endif
  121. .tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(BACKLASH))
  122. #if HOTENDS > 1
  123. .enabled(1)
  124. #else
  125. .enabled(0)
  126. #endif
  127. .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(TOOL_OFFSETS))
  128. .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(ENDSTOPS))
  129. .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(VELOCITY))
  130. .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(ACCELERATION))
  131. #if DISABLED(CLASSIC_JERK)
  132. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(JUNC_DEVIATION))
  133. #else
  134. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(JERK))
  135. #endif
  136. .tag(11).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(FILAMENT))
  137. .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(DISPLAY_MENU))
  138. .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(INTERFACE_SETTINGS))
  139. .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(RESTORE_DEFAULTS))
  140. .colors(action_btn)
  141. .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), GET_TEXT_F(BACK));
  142. #endif
  143. }
  144. }
  145. bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
  146. switch (tag) {
  147. case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
  148. #if HAS_BED_PROBE
  149. case 2: GOTO_SCREEN(ZOffsetScreen); break;
  150. #endif
  151. case 3: GOTO_SCREEN(StepsScreen); break;
  152. #if HOTENDS > 1
  153. case 4: GOTO_SCREEN(NozzleOffsetScreen); break;
  154. #endif
  155. case 5: GOTO_SCREEN(MaxVelocityScreen); break;
  156. case 6: GOTO_SCREEN(DefaultAccelerationScreen); break;
  157. case 7:
  158. #if DISABLED(CLASSIC_JERK)
  159. GOTO_SCREEN(JunctionDeviationScreen);
  160. #else
  161. GOTO_SCREEN(JerkScreen);
  162. #endif
  163. break;
  164. #if ENABLED(BACKLASH_GCODE)
  165. case 8: GOTO_SCREEN(BacklashCompensationScreen); break;
  166. #endif
  167. case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break;
  168. case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
  169. #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
  170. case 11: GOTO_SCREEN(FilamentMenu); break;
  171. #endif
  172. case 12: GOTO_SCREEN(EndstopStatesScreen); break;
  173. #if HAS_TRINAMIC
  174. case 13: GOTO_SCREEN(StepperCurrentScreen); break;
  175. case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
  176. #endif
  177. case 15: GOTO_SCREEN(DisplayTuningScreen); break;
  178. default: return false;
  179. }
  180. return true;
  181. }
  182. #endif // LULZBOT_TOUCH_UI