My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

max_velocity_screen.cpp 3.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #include "../screens.h"
  23. #ifdef FTDI_MAX_VELOCITY_SCREEN
  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_MAX_SPEED));
  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 HAS_MULTI_EXTRUDER
  39. w.heading(GET_TEXT_F(MSG_VMAX_E));
  40. w.color(e_axis) .adjuster( 8, F(STR_E0), getAxisMaxFeedrate_mm_s(E0) );
  41. w.color(e_axis) .adjuster( 10, F(STR_E1), getAxisMaxFeedrate_mm_s(E1) );
  42. #if EXTRUDERS > 2
  43. w.color(e_axis).adjuster( 12, F(STR_E2), getAxisMaxFeedrate_mm_s(E2) );
  44. #if EXTRUDERS > 3
  45. w.color(e_axis).adjuster( 14, F(STR_E3), getAxisMaxFeedrate_mm_s(E3) );
  46. #endif
  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
  61. case 8: UI_DECREMENT(AxisMaxFeedrate_mm_s, E0); break;
  62. case 9: UI_INCREMENT(AxisMaxFeedrate_mm_s, E0); break;
  63. #if DISTINCT_E > 1
  64. case 10: UI_DECREMENT(AxisMaxFeedrate_mm_s, E1); break;
  65. case 11: UI_INCREMENT(AxisMaxFeedrate_mm_s, E1); break;
  66. #if DISTINCT_E > 2
  67. case 12: UI_DECREMENT(AxisMaxFeedrate_mm_s, E2); break;
  68. case 13: UI_INCREMENT(AxisMaxFeedrate_mm_s, E2); break;
  69. #if DISTINCT_E > 3
  70. case 14: UI_DECREMENT(AxisMaxFeedrate_mm_s, E3); break;
  71. case 15: UI_INCREMENT(AxisMaxFeedrate_mm_s, E3); break;
  72. #endif
  73. #endif
  74. #endif
  75. #endif
  76. default: return false;
  77. }
  78. SaveSettingsDialogBox::settingsChanged();
  79. return true;
  80. }
  81. #endif // FTDI_MAX_VELOCITY_SCREEN