My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

spinner_dialog_box.cpp 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**************************
  2. * spinner_dialog_box.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. #include "screen_data.h"
  25. using namespace FTDI;
  26. using namespace ExtUI;
  27. void SpinnerDialogBox::onRedraw(draw_mode_t) {
  28. }
  29. void SpinnerDialogBox::show(const progmem_str message) {
  30. drawMessage(message);
  31. drawSpinner();
  32. storeBackground();
  33. screen_data.SpinnerDialogBox.auto_hide = false;
  34. }
  35. void SpinnerDialogBox::hide() {
  36. CommandProcessor cmd;
  37. cmd.stop().execute();
  38. }
  39. void SpinnerDialogBox::enqueueAndWait_P(const progmem_str commands) {
  40. enqueueAndWait_P(GET_TEXT_F(MSG_PLEASE_WAIT), commands);
  41. }
  42. void SpinnerDialogBox::enqueueAndWait_P(const progmem_str message, const progmem_str commands) {
  43. show(message);
  44. GOTO_SCREEN(SpinnerDialogBox);
  45. ExtUI::injectCommands_P((const char*)commands);
  46. screen_data.SpinnerDialogBox.auto_hide = true;
  47. }
  48. void SpinnerDialogBox::onIdle() {
  49. reset_menu_timeout();
  50. if (screen_data.SpinnerDialogBox.auto_hide && !commandsInQueue()) {
  51. screen_data.SpinnerDialogBox.auto_hide = false;
  52. hide();
  53. GOTO_PREVIOUS();
  54. }
  55. }
  56. #endif // TOUCH_UI_FTDI_EVE