Commit | Line | Data |
---|---|---|
862fc625 | 1 | /* |
35089dc7 JM |
2 | This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). |
3 | Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
4 | Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
862fc625 | 5 | You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. |
35089dc7 JM |
6 | */ |
7 | ||
8 | #ifndef PANELSCREEN_H | |
9 | #define PANELSCREEN_H | |
10 | ||
7af0714f | 11 | #include <string> |
35089dc7 JM |
12 | |
13 | class Panel; | |
cee1bb2d | 14 | |
862fc625 JM |
15 | class PanelScreen |
16 | { | |
17 | public: | |
18 | PanelScreen(); | |
19 | virtual void on_refresh(); | |
20 | virtual void on_main_loop(); | |
862fc625 JM |
21 | PanelScreen *set_parent(PanelScreen *passed_parent); |
22 | virtual void on_enter(); | |
23 | // if you completely rewrite the screen do not clear it, this avoids flicker | |
24 | void refresh_screen(bool clear); | |
25 | void refresh_menu(bool clear); | |
ca6effd7 | 26 | void refresh_menu(void) { refresh_menu(true); }; |
862fc625 | 27 | virtual void display_menu_line(uint16_t line) = 0; |
5ff3e912 JM |
28 | // default idle timeout for a screen, each screen can override this |
29 | virtual int idle_timeout_secs(){ return 10; } | |
862fc625 | 30 | |
cee1bb2d | 31 | friend class Panel; |
862fc625 JM |
32 | protected: |
33 | void send_gcode(std::string g); | |
2fa50ca0 | 34 | void send_gcode(const char *gm_code, char parameter, float value); |
862fc625 | 35 | void send_command(const char *gcstr); |
cee1bb2d JM |
36 | |
37 | PanelScreen *parent; | |
35089dc7 JM |
38 | }; |
39 | ||
35089dc7 | 40 | #endif |