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 #include "libs/Kernel.h"
9 #include "libs/SerialMessage.h"
11 #include "PanelScreen.h"
12 #include "ExtruderScreen.h"
13 #include "libs/nuts_bolts.h"
14 #include "libs/utils.h"
20 ExtruderScreen::ExtruderScreen()
24 void ExtruderScreen::on_enter()
26 this->panel
->enter_menu_mode();
27 this->panel
->setup_menu(3);
31 void ExtruderScreen::on_refresh()
33 if ( this->panel
->menu_change() ) {
36 if ( this->panel
->click() ) {
37 this->clicked_menu_entry(this->panel
->get_menu_current_line());
41 void ExtruderScreen::display_menu_line(uint16_t line
)
44 case 0: this->panel
->lcd
->printf("Back"); break;
45 case 1: this->panel
->lcd
->printf("Extrude 5mm"); break;
46 case 2: this->panel
->lcd
->printf("Retract 5mm"); break;
50 void ExtruderScreen::clicked_menu_entry(uint16_t line
)
53 case 0: this->panel
->enter_screen(this->parent
); return;
54 case 1: command
= "G91\nG1 E5\nG90"; break;
55 case 2: command
= "G91\nG1 E-5\nG90"; break;
59 // queuing commands needs to be done from main loop
60 void ExtruderScreen::on_main_loop()
62 if (this->command
.empty()) return;
63 send_command(this->command
.c_str());
64 this->command
.clear();