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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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(TOUCH_UI_FTDI_EVE) && !defined(TOUCH_UI_LULZBOT_BIO)
  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 10
  39. #define GRID_COLS 2
  40. .enabled(
  41. #if HAS_BED_PROBE
  42. 1
  43. #endif
  44. )
  45. .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
  46. .enabled(
  47. #if HAS_CASE_LIGHT
  48. 1
  49. #endif
  50. )
  51. .tag(16).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
  52. .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
  53. .enabled(
  54. #if HAS_TRINAMIC_CONFIG
  55. 1
  56. #endif
  57. )
  58. .tag(13).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
  59. .enabled(
  60. #if HAS_TRINAMIC_CONFIG
  61. 1
  62. #endif
  63. )
  64. .tag(14).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
  65. .enabled(
  66. #if HOTENDS > 1
  67. 1
  68. #endif
  69. )
  70. .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
  71. .enabled(
  72. #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
  73. 1
  74. #endif
  75. )
  76. .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
  77. .tag(12).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
  78. .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
  79. .tag(9) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
  80. .tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
  81. .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
  82. .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
  83. #if DISABLED(CLASSIC_JERK)
  84. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
  85. #else
  86. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
  87. #endif
  88. .enabled(
  89. #if ENABLED(BACKLASH_GCODE)
  90. 1
  91. #endif
  92. )
  93. .tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
  94. .colors(action_btn)
  95. .tag(1) .button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
  96. #undef GRID_COLS
  97. #undef GRID_ROWS
  98. #else
  99. #define GRID_ROWS 6
  100. #define GRID_COLS 3
  101. .enabled(
  102. #if HAS_BED_PROBE
  103. 1
  104. #endif
  105. )
  106. .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
  107. .enabled(
  108. #if HAS_CASE_LIGHT
  109. 1
  110. #endif
  111. )
  112. .tag(16).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
  113. .enabled(1)
  114. .tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
  115. .enabled(
  116. #if HAS_TRINAMIC_CONFIG
  117. 1
  118. #endif
  119. )
  120. .tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
  121. .enabled(
  122. #if HAS_TRINAMIC_CONFIG
  123. 1
  124. #endif
  125. )
  126. .tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
  127. .enabled(
  128. #if ENABLED(BACKLASH_GCODE)
  129. 1
  130. #endif
  131. )
  132. .tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
  133. .enabled(
  134. #if HOTENDS > 1
  135. 1
  136. #endif
  137. )
  138. .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
  139. .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
  140. .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
  141. .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
  142. #if DISABLED(CLASSIC_JERK)
  143. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
  144. #else
  145. .tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
  146. #endif
  147. .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
  148. .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
  149. .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
  150. .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
  151. .colors(action_btn)
  152. .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
  153. #endif
  154. }
  155. }
  156. bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
  157. switch (tag) {
  158. case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
  159. #if HAS_BED_PROBE
  160. case 2: GOTO_SCREEN(ZOffsetScreen); break;
  161. #endif
  162. case 3: GOTO_SCREEN(StepsScreen); break;
  163. #if HOTENDS > 1
  164. case 4: GOTO_SCREEN(NozzleOffsetScreen); break;
  165. #endif
  166. case 5: GOTO_SCREEN(MaxVelocityScreen); break;
  167. case 6: GOTO_SCREEN(DefaultAccelerationScreen); break;
  168. case 7:
  169. #if DISABLED(CLASSIC_JERK)
  170. GOTO_SCREEN(JunctionDeviationScreen);
  171. #else
  172. GOTO_SCREEN(JerkScreen);
  173. #endif
  174. break;
  175. #if ENABLED(BACKLASH_GCODE)
  176. case 8: GOTO_SCREEN(BacklashCompensationScreen); break;
  177. #endif
  178. case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break;
  179. case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
  180. #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
  181. case 11: GOTO_SCREEN(FilamentMenu); break;
  182. #endif
  183. case 12: GOTO_SCREEN(EndstopStatesScreen); break;
  184. #if HAS_TRINAMIC_CONFIG
  185. case 13: GOTO_SCREEN(StepperCurrentScreen); break;
  186. case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
  187. #endif
  188. case 15: GOTO_SCREEN(DisplayTuningScreen); break;
  189. #if HAS_CASE_LIGHT
  190. case 16: GOTO_SCREEN(CaseLightScreen); break;
  191. #endif
  192. default: return false;
  193. }
  194. return true;
  195. }
  196. #endif // TOUCH_UI_FTDI_EVE