My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

bio_advanced_settings.cpp 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*****************************
  2. * bio_advanced_settings.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 Theme;
  26. void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
  27. if (what & BACKGROUND) {
  28. CommandProcessor cmd;
  29. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  30. .cmd(CLEAR(true,true,true));
  31. }
  32. if (what & FOREGROUND) {
  33. CommandProcessor cmd;
  34. cmd.colors(normal_btn)
  35. .font(Theme::font_medium)
  36. #define GRID_ROWS 9
  37. #define GRID_COLS 2
  38. .tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
  39. .enabled(
  40. #if HAS_TRINAMIC
  41. 1
  42. #endif
  43. )
  44. .tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
  45. .enabled(
  46. #if HAS_TRINAMIC
  47. 1
  48. #endif
  49. )
  50. .tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
  51. .tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
  52. .enabled(
  53. #if HOTENDS > 1
  54. 1
  55. #endif
  56. )
  57. .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
  58. .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
  59. .tag(8) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
  60. .tag(9) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
  61. #if DISABLED(CLASSIC_JERK)
  62. .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JUNCTION_DEVIATION))
  63. #else
  64. .tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
  65. #endif
  66. .enabled(
  67. #if ENABLED(BACKLASH_GCODE)
  68. 1
  69. #endif
  70. )
  71. .tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
  72. .enabled(
  73. #if ENABLED(LIN_ADVANCE)
  74. 1
  75. #endif
  76. )
  77. .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE))
  78. .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
  79. .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
  80. .colors(action_btn)
  81. .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
  82. #undef GRID_COLS
  83. #undef GRID_ROWS
  84. }
  85. }
  86. bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
  87. using namespace ExtUI;
  88. switch (tag) {
  89. case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
  90. case 2: GOTO_SCREEN(DisplayTuningScreen); break;
  91. #if HAS_TRINAMIC
  92. case 3: GOTO_SCREEN(StepperCurrentScreen); break;
  93. case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
  94. #endif
  95. case 5: GOTO_SCREEN(EndstopStatesScreen); break;
  96. #if HOTENDS > 1
  97. case 6: GOTO_SCREEN(NozzleOffsetScreen); break;
  98. #endif
  99. case 7: GOTO_SCREEN(StepsScreen); break;
  100. case 8: GOTO_SCREEN(MaxVelocityScreen); break;
  101. case 9: GOTO_SCREEN(DefaultAccelerationScreen); break;
  102. case 10:
  103. #if DISABLED(CLASSIC_JERK)
  104. GOTO_SCREEN(JunctionDeviationScreen);
  105. #else
  106. GOTO_SCREEN(JerkScreen);
  107. #endif
  108. break;
  109. #if ENABLED(BACKLASH_GCODE)
  110. case 11: GOTO_SCREEN(BacklashCompensationScreen); break;
  111. #endif
  112. #if ENABLED(LIN_ADVANCE)
  113. case 12: GOTO_SCREEN(LinearAdvanceScreen); break;
  114. #endif
  115. case 13: GOTO_SCREEN(InterfaceSettingsScreen); break;
  116. case 14: GOTO_SCREEN(RestoreFailsafeDialogBox); break;
  117. default:
  118. return false;
  119. }
  120. return true;
  121. }
  122. #endif // TOUCH_UI_FTDI_EVE