update firmware.bin
[clinton/Smoothieware.git] / src / modules / utils / panel / PanelScreen.h
1 /*
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.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8 #ifndef PANELSCREEN_H
9 #define PANELSCREEN_H
10
11 #include <string>
12
13 class Panel;
14
15 class PanelScreen
16 {
17 public:
18 PanelScreen();
19 virtual ~PanelScreen();
20
21 virtual void on_refresh();
22 virtual void on_main_loop();
23 PanelScreen *set_parent(PanelScreen *passed_parent);
24 virtual void on_enter();
25 virtual void on_exit(){};
26 // if you completely rewrite the screen do not clear it, this avoids flicker
27 void refresh_screen(bool clear);
28 void refresh_menu(bool clear);
29 void refresh_menu(void) { refresh_menu(true); };
30 virtual void display_menu_line(uint16_t line) = 0;
31 // default idle timeout for a screen, each screen can override this
32 virtual int idle_timeout_secs(){ return 10; }
33
34 friend class Panel;
35 protected:
36 void send_gcode(std::string g);
37 void send_gcode(const char *gm_code, char parameter, float value);
38 void send_command(const char *gcstr);
39
40 PanelScreen *parent;
41 };
42
43 #endif