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.

max_acceleration_screen.cpp 3.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*******************************
  2. * max_acceleration_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(LULZBOT_TOUCH_UI)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace ExtUI;
  26. using namespace Theme;
  27. void MaxAccelerationScreen::onRedraw(draw_mode_t what) {
  28. widgets_t w(what);
  29. w.precision(0);
  30. w.units(GET_TEXTF(UNITS_MM_S2));
  31. w.heading(GET_TEXTF(ACCELERATION));
  32. w.color(x_axis) .adjuster( 2, GET_TEXTF(AMAX_X), getAxisMaxAcceleration_mm_s2(X) );
  33. w.color(y_axis) .adjuster( 4, GET_TEXTF(AMAX_Y), getAxisMaxAcceleration_mm_s2(Y) );
  34. w.color(z_axis) .adjuster( 6, GET_TEXTF(AMAX_Z), getAxisMaxAcceleration_mm_s2(Z) );
  35. #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
  36. w.color(e_axis).adjuster( 8, GET_TEXTF(AMAX_E1), getAxisMaxAcceleration_mm_s2(E0) );
  37. #elif EXTRUDERS > 1
  38. w.color(e_axis).adjuster( 8, GET_TEXTF(AMAX_E1), getAxisMaxAcceleration_mm_s2(E0) );
  39. w.color(e_axis).adjuster(10, GET_TEXTF(AMAX_E2), getAxisMaxAcceleration_mm_s2(E1) );
  40. #if EXTRUDERS > 2
  41. w.color(e_axis).adjuster(12, GET_TEXTF(AMAX_E3), getAxisMaxAcceleration_mm_s2(E2) );
  42. #endif
  43. #if EXTRUDERS > 3
  44. w.color(e_axis).adjuster(14, GET_TEXTF(AMAX_E4), getAxisMaxAcceleration_mm_s2(E3) );
  45. #endif
  46. #endif
  47. w.increments();
  48. }
  49. bool MaxAccelerationScreen::onTouchHeld(uint8_t tag) {
  50. const float increment = getIncrement();
  51. switch (tag) {
  52. case 2: UI_DECREMENT(AxisMaxAcceleration_mm_s2, X ); break;
  53. case 3: UI_INCREMENT(AxisMaxAcceleration_mm_s2, X ); break;
  54. case 4: UI_DECREMENT(AxisMaxAcceleration_mm_s2, Y ); break;
  55. case 5: UI_INCREMENT(AxisMaxAcceleration_mm_s2, Y ); break;
  56. case 6: UI_DECREMENT(AxisMaxAcceleration_mm_s2, Z ); break;
  57. case 7: UI_INCREMENT(AxisMaxAcceleration_mm_s2, Z ); break;
  58. case 8: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E0); break;
  59. case 9: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E0); break;
  60. #if EXTRUDERS > 1 && ENABLED(DISTINCT_E_FACTORS)
  61. case 10: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E1); break;
  62. case 11: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E1); break;
  63. #endif
  64. #if EXTRUDERS > 2 && ENABLED(DISTINCT_E_FACTORS)
  65. case 12: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E2); break;
  66. case 13: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E2); break;
  67. #endif
  68. #if EXTRUDERS > 3 && ENABLED(DISTINCT_E_FACTORS)
  69. case 14: UI_DECREMENT(AxisMaxAcceleration_mm_s2, E3); break;
  70. case 15: UI_INCREMENT(AxisMaxAcceleration_mm_s2, E3); break;
  71. #endif
  72. default:
  73. return false;
  74. }
  75. return true;
  76. }
  77. #endif // LULZBOT_TOUCH_UI