My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

advanced_settings.cpp 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*************************
  2. * 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: <https://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #include "../screens.h"
  23. #ifdef FTDI_BIO_ADVANCED_SETTINGS_MENU
  24. using namespace FTDI;
  25. using namespace Theme;
  26. #define GRID_COLS 2
  27. #define GRID_ROWS 9
  28. void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
  29. if (what & BACKGROUND) {
  30. CommandProcessor cmd;
  31. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  32. .cmd(CLEAR(true,true,true));
  33. }
  34. if (what & FOREGROUND) {
  35. CommandProcessor cmd;
  36. cmd.colors(normal_btn)
  37. .font(Theme::font_medium)
  38. .tag(2) .button(BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
  39. .enabled(ENABLED(HAS_TRINAMIC_CONFIG))
  40. .tag(3) .button(BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
  41. .enabled(ENABLED(HAS_TRINAMIC_CONFIG))
  42. .tag(4) .button(BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
  43. .tag(5) .button(BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
  44. .enabled(ENABLED(HAS_MULTI_HOTEND))
  45. .tag(6) .button(BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
  46. .tag(7) .button(BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
  47. .tag(8) .button(BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MAX_SPEED))
  48. .tag(9) .button(BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
  49. .tag(10) .button(BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(TERN(HAS_JUNCTION_DEVIATION, MSG_JUNCTION_DEVIATION, MSG_JERK)))
  50. .enabled(ENABLED(BACKLASH_GCODE))
  51. .tag(11) .button(BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
  52. .enabled(ENABLED(LIN_ADVANCE))
  53. .tag(12) .button(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE))
  54. .tag(13) .button(BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE))
  55. .tag(14) .button(BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS))
  56. .colors(action_btn)
  57. .tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE));
  58. }
  59. }
  60. bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
  61. using namespace ExtUI;
  62. switch (tag) {
  63. case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
  64. case 2: GOTO_SCREEN(DisplayTuningScreen); break;
  65. #if HAS_TRINAMIC_CONFIG
  66. case 3: GOTO_SCREEN(StepperCurrentScreen); break;
  67. case 4: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
  68. #endif
  69. case 5: GOTO_SCREEN(EndstopStatesScreen); break;
  70. #if HAS_MULTI_HOTEND
  71. case 6: GOTO_SCREEN(NozzleOffsetScreen); break;
  72. #endif
  73. case 7: GOTO_SCREEN(StepsScreen); break;
  74. case 8: GOTO_SCREEN(MaxVelocityScreen); break;
  75. case 9: GOTO_SCREEN(DefaultAccelerationScreen); break;
  76. case 10: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break;
  77. #if ENABLED(BACKLASH_GCODE)
  78. case 11: GOTO_SCREEN(BacklashCompensationScreen); break;
  79. #endif
  80. #if ENABLED(LIN_ADVANCE)
  81. case 12: GOTO_SCREEN(LinearAdvanceScreen); break;
  82. #endif
  83. case 13: GOTO_SCREEN(InterfaceSettingsScreen); break;
  84. case 14: GOTO_SCREEN(RestoreFailsafeDialogBox); break;
  85. default: return false;
  86. }
  87. return true;
  88. }
  89. #endif // FTDI_BIO_ADVANCED_SETTINGS_MENU