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.

kill_screen.cpp 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*******************
  2. * kill_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_KILL_SCREEN
  24. using namespace FTDI;
  25. #define GRID_COLS 4
  26. #define GRID_ROWS 8
  27. // The kill screen is an oddball that happens after Marlin has killed the events
  28. // loop. So we only have a show() method rather than onRedraw(). The KillScreen
  29. // should not be used as a model for other UI screens as it is an exception.
  30. void KillScreen::show(const char *message) {
  31. CommandProcessor cmd;
  32. cmd.cmd(CMD_DLSTART)
  33. .cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  34. .cmd(CLEAR(true,true,true))
  35. .tag(0);
  36. cmd.font(Theme::font_large)
  37. .cmd(COLOR_RGB(Theme::bg_text_enabled))
  38. .text(BTN_POS(1,2), BTN_SIZE(4,1), message)
  39. .text(BTN_POS(1,3), BTN_SIZE(4,1), GET_TEXT_F(MSG_HALTED))
  40. .text(BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_PLEASE_RESET));
  41. cmd.cmd(DL::DL_DISPLAY)
  42. .cmd(CMD_SWAP)
  43. .execute();
  44. InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, PLAY_SYNCHRONOUS);
  45. }
  46. #endif // FTDI_KILL_SCREEN