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.

cocoa_press_move_e_screen.cpp 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*********************************
  2. * cocoa_press_move_e_screen.cpp *
  3. *********************************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  7. * Written By Marcio Teixeira 2019 - Cocoa Press *
  8. * *
  9. * This program is free software: you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation, either version 3 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. * This program is distributed in the hope that it will be useful, *
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  17. * GNU General Public License for more details. *
  18. * *
  19. * To view a copy of the GNU General Public License, go to the following *
  20. * location: <https://www.gnu.org/licenses/>. *
  21. ****************************************************************************/
  22. #include "../config.h"
  23. #include "screens.h"
  24. #include "screen_data.h"
  25. #ifdef FTDI_COCOA_MOVE_E_SCREEN
  26. using namespace FTDI;
  27. using namespace ExtUI;
  28. void MoveEScreen::onRedraw(draw_mode_t what) {
  29. widgets_t w(what);
  30. w.precision(1);
  31. w.units(GET_TEXT_F(MSG_UNITS_MM));
  32. w.heading( GET_TEXT_F(MSG_E_MOVE));
  33. w.color(Theme::e_axis);
  34. #if EXTRUDERS == 1
  35. w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E), screen_data.MoveAxis.e_rel[0], canMove(E0));
  36. #elif HAS_MULTI_EXTRUDER
  37. w.adjuster( 8, GET_TEXT_F(MSG_AXIS_E1), screen_data.MoveAxis.e_rel[0], canMove(E0));
  38. w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), screen_data.MoveAxis.e_rel[1], canMove(E1));
  39. #if EXTRUDERS > 2
  40. w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), screen_data.MoveAxis.e_rel[2], canMove(E2));
  41. #endif
  42. #if EXTRUDERS > 3
  43. w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), screen_data.MoveAxis.e_rel[3], canMove(E3));
  44. #endif
  45. #endif
  46. w.increments();
  47. }
  48. void MoveEScreen::onIdle() {
  49. if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
  50. onRefresh();
  51. refresh_timer.start();
  52. }
  53. BaseScreen::onIdle();
  54. }
  55. #endif // FTDI_COCOA_MOVE_E_SCREEN