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 4.2KB

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