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.

temperature_screen.cpp 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*******************
  2. * boot_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)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. using namespace Theme;
  26. using namespace ExtUI;
  27. void TemperatureScreen::onRedraw(draw_mode_t what) {
  28. widgets_t w(what);
  29. w.precision(0).color(temp).units(GET_TEXT_F(MSG_UNITS_C));
  30. w.heading(GET_TEXT_F(MSG_TEMPERATURE));
  31. w.button(30, GET_TEXT_F(MSG_COOLDOWN));
  32. #ifndef NO_TOOLHEAD_HEATER_GCODE
  33. #if HOTENDS == 1
  34. w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0));
  35. #else
  36. w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE_0), getTargetTemp_celsius(E0));
  37. w.adjuster( 4, GET_TEXT_F(MSG_NOZZLE_1), getTargetTemp_celsius(E1));
  38. #if HOTENDS > 2
  39. w.adjuster( 6, GET_TEXT_F(MSG_NOZZLE_2), getTargetTemp_celsius(E2));
  40. #endif
  41. #if HOTENDS > 3
  42. w.adjuster( 8, GET_TEXT_F(MSG_NOZZLE_3), getTargetTemp_celsius(E3));
  43. #endif
  44. #endif
  45. #endif
  46. #if HAS_HEATED_BED
  47. w.adjuster( 20, GET_TEXT_F(MSG_BED), getTargetTemp_celsius(BED));
  48. #endif
  49. #if FAN_COUNT > 0
  50. w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT));
  51. w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0));
  52. #endif
  53. w.increments();
  54. }
  55. bool TemperatureScreen::onTouchHeld(uint8_t tag) {
  56. const float increment = getIncrement();
  57. switch (tag) {
  58. case 20: UI_DECREMENT(TargetTemp_celsius, BED); break;
  59. case 21: UI_INCREMENT(TargetTemp_celsius, BED); break;
  60. #ifndef NO_TOOLHEAD_HEATER_GCODE
  61. case 2: UI_DECREMENT(TargetTemp_celsius, E0); break;
  62. case 3: UI_INCREMENT(TargetTemp_celsius, E0); break;
  63. #endif
  64. #if HOTENDS > 1
  65. case 4: UI_DECREMENT(TargetTemp_celsius, E1); break;
  66. case 5: UI_INCREMENT(TargetTemp_celsius, E1); break;
  67. #endif
  68. #if HOTENDS > 2
  69. case 6: UI_DECREMENT(TargetTemp_celsius, E2); break;
  70. case 7: UI_INCREMENT(TargetTemp_celsius, E2); break;
  71. #endif
  72. #if HOTENDS > 3
  73. case 8: UI_DECREMENT(TargetTemp_celsius, E3); break;
  74. case 9: UI_INCREMENT(TargetTemp_celsius, E3); break;
  75. #endif
  76. #if FAN_COUNT > 0
  77. case 10: UI_DECREMENT(TargetFan_percent, FAN0); break;
  78. case 11: UI_INCREMENT(TargetFan_percent, FAN0); break;
  79. #endif
  80. case 30:
  81. #define _HOTEND_OFF(N) setTargetTemp_celsius(0,E##N);
  82. REPEAT(HOTENDS, _HOTEND_OFF);
  83. #if HAS_HEATED_BED
  84. setTargetTemp_celsius(0,BED);
  85. #endif
  86. #if FAN_COUNT > 0
  87. setTargetFan_percent(0,FAN0);
  88. #endif
  89. break;
  90. default:
  91. return false;
  92. }
  93. return true;
  94. }
  95. #endif // TOUCH_UI_FTDI_EVE