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/>.
8 #ifndef MODIFYVALUESSCREEN_H
9 #define MODIFYVALUESSCREEN_H
11 #include "PanelScreen.h"
19 class ModifyValuesScreen
: public PanelScreen
22 ModifyValuesScreen(bool delete_on_exit
= false);
23 virtual ~ModifyValuesScreen();
29 void display_menu_line(uint16_t line
);
30 void clicked_menu_entry(uint16_t line
);
31 int idle_timeout_secs(){ return 60; }
33 typedef std::tuple
<char *, std::function
<float()>, std::function
<void(float)>, float, float, float> MenuItemType
;
34 void addMenuItem(const char *name
, std::function
<float()> getter
, std::function
<void(float)> setter
, float inc
= 1.0F
, float min
= NAN
, float max
= NAN
);
38 void addMenuItem(const MenuItemType
& item
);
41 float new_value
, min_value
, max_value
;
43 // name, getter function, setter function, increment
44 std::vector
<MenuItemType
> menu_items
;