My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

backlash_compensation_screen.cpp 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. #ifdef BACKLASH_SMOOTHING_MM
  38. w.color(other).adjuster(8, GET_TEXT_F(MSG_BACKLASH_SMOOTHING), getBacklashSmoothing_mm());
  39. #endif
  40. w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT))
  41. .adjuster(10, GET_TEXT_F(MSG_BACKLASH_CORRECTION), getBacklashCorrection_percent());
  42. w.precision(2).increments();
  43. }
  44. bool BacklashCompensationScreen::onTouchHeld(uint8_t tag) {
  45. const float increment = getIncrement();
  46. switch (tag) {
  47. case 2: UI_DECREMENT(AxisBacklash_mm, X); break;
  48. case 3: UI_INCREMENT(AxisBacklash_mm, X); break;
  49. case 4: UI_DECREMENT(AxisBacklash_mm, Y); break;
  50. case 5: UI_INCREMENT(AxisBacklash_mm, Y); break;
  51. case 6: UI_DECREMENT(AxisBacklash_mm, Z); break;
  52. case 7: UI_INCREMENT(AxisBacklash_mm, Z); break;
  53. #ifdef BACKLASH_SMOOTHING_MM
  54. case 8: UI_DECREMENT(BacklashSmoothing_mm); break;
  55. case 9: UI_INCREMENT(BacklashSmoothing_mm); break;
  56. #endif
  57. case 10: UI_DECREMENT_BY(BacklashCorrection_percent, increment*100); break;
  58. case 11: UI_INCREMENT_BY(BacklashCorrection_percent, increment*100); break;
  59. #if ENABLED(CALIBRATION_GCODE)
  60. case 12: GOTO_SCREEN(ConfirmAutoCalibrationDialogBox); return true;
  61. #endif
  62. default:
  63. return false;
  64. }
  65. SaveSettingsDialogBox::settingsChanged();
  66. return true;
  67. }
  68. #endif // TOUCH_UI_FTDI_EVE