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

feedrate_percent_screen.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*******************************
  2. * feedrate_percent_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. #include "../screens.h"
  23. #ifdef FTDI_FEEDRATE_PERCENT_SCREEN
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. void FeedratePercentScreen::onRedraw(draw_mode_t what) {
  27. widgets_t w(what);
  28. w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT));
  29. w.heading(GET_TEXT_F(MSG_PRINT_SPEED));
  30. w.adjuster(4, GET_TEXT_F(MSG_SPEED), getFeedrate_percent());
  31. w.increments();
  32. }
  33. bool FeedratePercentScreen::onTouchHeld(uint8_t tag) {
  34. const float increment = getIncrement();
  35. switch (tag) {
  36. case 4: UI_DECREMENT(Feedrate_percent); break;
  37. case 5: UI_INCREMENT(Feedrate_percent); break;
  38. default:
  39. return false;
  40. }
  41. return true;
  42. }
  43. #endif // FTDI_FEEDRATE_PERCENT_SCREEN