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.

change_filament_screen.h 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /****************************
  2. * change_filament_screen.h *
  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. #pragma once
  22. #define FTDI_CHANGE_FILAMENT_SCREEN
  23. #define FTDI_CHANGE_FILAMENT_SCREEN_CLASS ChangeFilamentScreen
  24. struct ChangeFilamentScreenData {
  25. uint8_t e_tag, t_tag, repeat_tag;
  26. ExtUI::extruder_t saved_extruder;
  27. #if FILAMENT_UNLOAD_PURGE_LENGTH > 0
  28. bool need_purge;
  29. #endif
  30. };
  31. class ChangeFilamentScreen : public BaseScreen, public CachedScreen<CHANGE_FILAMENT_SCREEN_CACHE> {
  32. private:
  33. static uint8_t getSoftenTemp();
  34. static ExtUI::extruder_t getExtruder();
  35. static void drawTempGradient(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
  36. static void doPurge();
  37. public:
  38. static uint32_t getWarmColor(uint16_t temp, uint16_t cool, uint16_t low, uint16_t med, uint16_t high);
  39. static void onEntry();
  40. static void onExit();
  41. static void onRedraw(draw_mode_t);
  42. static bool onTouchStart(uint8_t tag);
  43. static bool onTouchEnd(uint8_t tag);
  44. static bool onTouchHeld(uint8_t tag);
  45. static void onIdle();
  46. };