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.

bio_main_menu.cpp 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*********************
  2. * bio_main_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 Theme;
  26. void MainMenu::onRedraw(draw_mode_t what) {
  27. #define GRID_ROWS 10
  28. #define GRID_COLS 2
  29. if (what & BACKGROUND) {
  30. CommandProcessor cmd;
  31. cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  32. .cmd(CLEAR(true,true,true))
  33. .tag(0);
  34. }
  35. if (what & FOREGROUND) {
  36. CommandProcessor cmd;
  37. cmd.cmd(COLOR_RGB(bg_text_enabled))
  38. .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_MAIN))
  39. .colors(normal_btn)
  40. .font(font_medium)
  41. .tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME))
  42. .tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER))
  43. .tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_RELEASE_XY_AXIS))
  44. .tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_AUTOLEVEL_X_AXIS))
  45. .tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE))
  46. .tag(7).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
  47. .tag(8).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
  48. .tag(9).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU))
  49. .colors(action_btn)
  50. .tag(1).button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
  51. }
  52. #undef GRID_COLS
  53. #undef GRID_ROWS
  54. }
  55. bool MainMenu::onTouchEnd(uint8_t tag) {
  56. using namespace ExtUI;
  57. const bool e_homed = isAxisPositionKnown(E0);
  58. switch (tag) {
  59. case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
  60. case 2: GOTO_SCREEN(BioConfirmHomeXYZ); break;
  61. case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? F("G0 E0 F120") : F("G112")); break;
  62. case 4: StatusScreen::unlockMotors(); break;
  63. case 5: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
  64. case 6: GOTO_SCREEN(TemperatureScreen); break;
  65. case 7: GOTO_SCREEN(InterfaceSettingsScreen); break;
  66. case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
  67. case 9: GOTO_SCREEN(AboutScreen); break;
  68. default:
  69. return false;
  70. }
  71. return true;
  72. }
  73. #endif // TOUCH_UI_FTDI_EVE