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_velocity_screen.cpp 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /***************************
  2. * max_velocity_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: <https://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 ExtUI;
  26. using namespace Theme;
  27. void MaxVelocityScreen::onRedraw(draw_mode_t what) {
  28. using namespace ExtUI;
  29. widgets_t w(what);
  30. w.precision(0);
  31. w.units(GET_TEXT_F(MSG_UNITS_MM_S));
  32. w.heading( GET_TEXT_F(MSG_VELOCITY));
  33. w.color(x_axis) .adjuster( 2, GET_TEXT_F(MSG_VMAX_X), getAxisMaxFeedrate_mm_s(X) );
  34. w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_VMAX_Y), getAxisMaxFeedrate_mm_s(Y) );
  35. w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) );
  36. #if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
  37. w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E), getAxisMaxFeedrate_mm_s(E0) );
  38. #elif EXTRUDERS > 1
  39. w.heading(GET_TEXT_F(MSG_VMAX_E));
  40. w.color(e_axis) .adjuster( 8, F(LCD_STR_E0), getAxisMaxFeedrate_mm_s(E0) );
  41. w.color(e_axis) .adjuster( 10, F(LCD_STR_E1), getAxisMaxFeedrate_mm_s(E1) );
  42. #if EXTRUDERS > 2
  43. w.color(e_axis).adjuster( 12, F(LCD_STR_E2), getAxisMaxFeedrate_mm_s(E2) );
  44. #endif
  45. #if EXTRUDERS > 3
  46. w.color(e_axis).adjuster( 14, F(LCD_STR_E3), getAxisMaxFeedrate_mm_s(E3) );
  47. #endif
  48. #endif
  49. w.increments();
  50. }
  51. bool MaxVelocityScreen::onTouchHeld(uint8_t tag) {
  52. const float increment = getIncrement();
  53. switch (tag) {
  54. case 2: UI_DECREMENT(AxisMaxFeedrate_mm_s, X); break;
  55. case 3: UI_INCREMENT(AxisMaxFeedrate_mm_s, X); break;
  56. case 4: UI_DECREMENT(AxisMaxFeedrate_mm_s, Y); break;
  57. case 5: UI_INCREMENT(AxisMaxFeedrate_mm_s, Y); break;
  58. case 6: UI_DECREMENT(AxisMaxFeedrate_mm_s, Z); break;
  59. case 7: UI_INCREMENT(AxisMaxFeedrate_mm_s, Z); break;
  60. #if DISTINCT_E > 0
  61. case 8: UI_DECREMENT(AxisMaxFeedrate_mm_s, E0); break;
  62. case 9: UI_INCREMENT(AxisMaxFeedrate_mm_s, E0); break;
  63. #endif
  64. #if DISTINCT_E > 1
  65. case 10: UI_DECREMENT(AxisMaxFeedrate_mm_s, E1); break;
  66. case 11: UI_INCREMENT(AxisMaxFeedrate_mm_s, E1); break;
  67. #endif
  68. #if DISTINCT_E > 2
  69. case 12: UI_DECREMENT(AxisMaxFeedrate_mm_s, E2); break;
  70. case 13: UI_INCREMENT(AxisMaxFeedrate_mm_s, E2); break;
  71. #endif
  72. #if DISTINCT_E > 3
  73. case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break;
  74. case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break;
  75. #endif
  76. default:
  77. return false;
  78. }
  79. SaveSettingsDialogBox::settingsChanged();
  80. return true;
  81. }
  82. #endif // TOUCH_UI_FTDI_EVE