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.

stepper_bump_sensitivity_screen.cpp 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**************************************
  2. * stepper_bump_sensiivity_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) && HAS_TRINAMIC
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. using namespace Theme;
  27. void StepperBumpSensitivityScreen::onRedraw(draw_mode_t what) {
  28. widgets_t w(what);
  29. w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST);
  30. w.heading( GET_TEXT_F(MSG_TMC_HOMING_THRS));
  31. w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_AXIS_X), getTMCBumpSensitivity(X),
  32. #if X_SENSORLESS
  33. true
  34. #else
  35. false
  36. #endif
  37. );
  38. w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AXIS_Y), getTMCBumpSensitivity(Y),
  39. #if Y_SENSORLESS
  40. true
  41. #else
  42. false
  43. #endif
  44. );
  45. w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AXIS_Z), getTMCBumpSensitivity(Z),
  46. #if Z_SENSORLESS
  47. true
  48. #else
  49. false
  50. #endif
  51. );
  52. w.increments();
  53. }
  54. bool StepperBumpSensitivityScreen::onTouchHeld(uint8_t tag) {
  55. const float increment = getIncrement();
  56. switch (tag) {
  57. case 2: UI_DECREMENT(TMCBumpSensitivity, X ); break;
  58. case 3: UI_INCREMENT(TMCBumpSensitivity, X ); break;
  59. case 4: UI_DECREMENT(TMCBumpSensitivity, Y ); break;
  60. case 5: UI_INCREMENT(TMCBumpSensitivity, Y ); break;
  61. case 6: UI_DECREMENT(TMCBumpSensitivity, Z ); break;
  62. case 7: UI_INCREMENT(TMCBumpSensitivity, Z ); break;
  63. default:
  64. return false;
  65. }
  66. SaveSettingsDialogBox::settingsChanged();
  67. return true;
  68. }
  69. #endif // TOUCH_UI_FTDI_EVE && HAS_TRINAMIC