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.

backlash_compensation_screen.cpp 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /************************************
  2. * backlash_compensation_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 BOTH(TOUCH_UI_FTDI_EVE, BACKLASH_GCODE)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. using namespace Theme;
  27. void BacklashCompensationScreen::onRedraw(draw_mode_t what) {
  28. widgets_t w(what);
  29. w.precision(2).units( GET_TEXT_F(MSG_UNITS_MM));
  30. w.heading( GET_TEXT_F(MSG_BACKLASH));
  31. w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), getAxisBacklash_mm(X));
  32. w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), getAxisBacklash_mm(Y));
  33. w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), getAxisBacklash_mm(Z));
  34. #if ENABLED(CALIBRATION_GCODE)
  35. w.button(12, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY));
  36. #endif
  37. w.color(other).adjuster(8, GET_TEXT_F(MSG_SMOOTHING), getBacklashSmoothing_mm());
  38. w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT))
  39. .adjuster(10, GET_TEXT_F(MSG_CORRECTION), getBacklashCorrection_percent());
  40. w.precision(2).increments();
  41. }
  42. bool BacklashCompensationScreen::onTouchHeld(uint8_t tag) {
  43. const float increment = getIncrement();
  44. switch (tag) {
  45. case 2: UI_DECREMENT(AxisBacklash_mm, X); break;
  46. case 3: UI_INCREMENT(AxisBacklash_mm, X); break;
  47. case 4: UI_DECREMENT(AxisBacklash_mm, Y); break;
  48. case 5: UI_INCREMENT(AxisBacklash_mm, Y); break;
  49. case 6: UI_DECREMENT(AxisBacklash_mm, Z); break;
  50. case 7: UI_INCREMENT(AxisBacklash_mm, Z); break;
  51. case 8: UI_DECREMENT(BacklashSmoothing_mm); break;
  52. case 9: UI_INCREMENT(BacklashSmoothing_mm); break;
  53. case 10: UI_DECREMENT_BY(BacklashCorrection_percent, increment*100); break;
  54. case 11: UI_INCREMENT_BY(BacklashCorrection_percent, increment*100); break;
  55. #if ENABLED(CALIBRATION_GCODE)
  56. case 12: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true;
  57. #endif
  58. default:
  59. return false;
  60. }
  61. SaveSettingsDialogBox::settingsChanged();
  62. return true;
  63. }
  64. #endif // TOUCH_UI_FTDI_EVE