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

default_acceleration_screen.cpp 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /***********************************
  2. * default_acceleration_screen.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. #if ENABLED(TOUCH_UI_FTDI_EVE)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. using namespace Theme;
  27. void DefaultAccelerationScreen::onRedraw(draw_mode_t what) {
  28. widgets_t w(what);
  29. w.precision(0);
  30. w.units(GET_TEXT_F(MSG_UNITS_MM_S2));
  31. w.heading( GET_TEXT_F(MSG_ACCELERATION));
  32. w.color(other);
  33. w.adjuster( 2, GET_TEXT_F(MSG_ACCEL_PRINTING), getPrintingAcceleration_mm_s2() );
  34. w.adjuster( 4, GET_TEXT_F(MSG_ACCEL_TRAVEL), getTravelAcceleration_mm_s2() );
  35. w.adjuster( 6, GET_TEXT_F(MSG_ACCEL_RETRACT), getRetractAcceleration_mm_s2() );
  36. w.increments();
  37. w.button( 8, GET_TEXT_F(MSG_SET_MAXIMUM));
  38. }
  39. bool DefaultAccelerationScreen::onTouchHeld(uint8_t tag) {
  40. const float increment = getIncrement();
  41. switch (tag) {
  42. case 2: UI_DECREMENT(PrintingAcceleration_mm_s2); break;
  43. case 3: UI_INCREMENT(PrintingAcceleration_mm_s2); break;
  44. case 4: UI_DECREMENT(TravelAcceleration_mm_s2); break;
  45. case 5: UI_INCREMENT(TravelAcceleration_mm_s2); break;
  46. case 6: UI_DECREMENT(RetractAcceleration_mm_s2); break;
  47. case 7: UI_INCREMENT(RetractAcceleration_mm_s2); break;
  48. case 8: GOTO_SCREEN(MaxAccelerationScreen); break;
  49. default:
  50. return false;
  51. }
  52. SaveSettingsDialogBox::settingsChanged();
  53. return true;
  54. }
  55. #endif // TOUCH_UI_FTDI_EVE