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

display_tuning_screen.cpp 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*****************************
  2. * display_tuning_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: <http://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 Theme;
  26. void DisplayTuningScreen::onRedraw(draw_mode_t what) {
  27. widgets_t w(what);
  28. w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST);
  29. w.units(F(""));
  30. w.heading(GET_TEXT_F(MSG_DISPLAY_MENU));
  31. w.color(other);
  32. w.adjuster( 2, GET_TEXT_F(MSG_H_OFFSET), CLCD::mem_read_16(CLCD::REG::HOFFSET) );
  33. w.adjuster( 4, GET_TEXT_F(MSG_V_OFFSET), CLCD::mem_read_16(CLCD::REG::VOFFSET) );
  34. w.increments();
  35. w.heading( GET_TEXT_F(MSG_TOUCH_SCREEN));
  36. w.button(6, GET_TEXT_F(MSG_CALIBRATE));
  37. }
  38. bool DisplayTuningScreen::onTouchHeld(uint8_t tag) {
  39. #define REG_INCREMENT(a,i) CLCD::mem_write_16(CLCD::REG::a, CLCD::mem_read_16(CLCD::REG::a) + i)
  40. const float increment = getIncrement();
  41. switch (tag) {
  42. case 2: REG_INCREMENT(HOFFSET, -increment); break;
  43. case 3: REG_INCREMENT(HOFFSET, increment); break;
  44. case 4: REG_INCREMENT(VOFFSET, -increment); break;
  45. case 5: REG_INCREMENT(VOFFSET, increment); break;
  46. case 6: GOTO_SCREEN(TouchCalibrationScreen); break;
  47. default:
  48. return false;
  49. }
  50. SaveSettingsDialogBox::settingsChanged();
  51. return true;
  52. }
  53. #endif // TOUCH_UI_FTDI_EVE