add $J for instant jog of one axis.
[clinton/Smoothieware.git] / src / modules / utils / simpleshell / SimpleShell.h
CommitLineData
df27a6a3 1/*
cd011f58
AW
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.
df27a6a3 5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
cd011f58
AW
6*/
7
be7f67cd 8#pragma once
0325af12 9
ba8da804
JM
10#include "Module.h"
11
7e81f138 12#include <functional>
ba8da804
JM
13#include <string>
14using std::string;
15
16class StreamOutput;
0325af12 17
9e403697
JM
18class SimpleShell : public Module
19{
20public:
21 SimpleShell() {}
22
23 void on_module_loaded();
24 void on_console_line_received( void *argument );
25 void on_gcode_received(void *argument);
26 void on_second_tick(void *);
5c051155 27 static bool parse_command(const char *cmd, string args, StreamOutput *stream);
8b261cdc 28 static void print_mem(StreamOutput *stream) { mem_command("", stream); }
37b7b898 29 static void version_command(string parameters, StreamOutput *stream );
9e403697
JM
30
31private:
18ca10a3
JM
32
33 void jog(string params, StreamOutput *stream);
34
7e81f138
JM
35 static void ls_command(string parameters, StreamOutput *stream );
36 static void cd_command(string parameters, StreamOutput *stream );
37 static void delete_file_command(string parameters, StreamOutput *stream );
38 static void pwd_command(string parameters, StreamOutput *stream );
39 static void cat_command(string parameters, StreamOutput *stream );
40 static void rm_command(string parameters, StreamOutput *stream );
6d877d9b 41 static void mv_command(string parameters, StreamOutput *stream );
04d608c4 42 static void mkdir_command(string parameters, StreamOutput *stream );
6d877d9b 43 static void upload_command(string parameters, StreamOutput *stream );
7e81f138
JM
44 static void break_command(string parameters, StreamOutput *stream );
45 static void reset_command(string parameters, StreamOutput *stream );
46 static void dfu_command(string parameters, StreamOutput *stream );
47 static void help_command(string parameters, StreamOutput *stream );
7e81f138
JM
48 static void get_command(string parameters, StreamOutput *stream );
49 static void set_temp_command(string parameters, StreamOutput *stream );
1f8dab1a 50 static void calc_thermistor_command( string parameters, StreamOutput *stream);
4c8f5447 51 static void print_thermistors_command( string parameters, StreamOutput *stream);
d55d551b 52 static void md5sum_command( string parameters, StreamOutput *stream);
6c0193b3 53 static void grblDP_command( string parameters, StreamOutput *stream);
4c8f5447 54
ae91dea4 55 static void switch_command(string parameters, StreamOutput *stream );
7e81f138
JM
56 static void mem_command(string parameters, StreamOutput *stream );
57
58 static void net_command( string parameters, StreamOutput *stream);
59
60 static void load_command( string parameters, StreamOutput *stream);
61 static void save_command( string parameters, StreamOutput *stream);
62
3704585b 63 static void remount_command( string parameters, StreamOutput *stream);
64
518b5c4c 65 static void test_command( string parameters, StreamOutput *stream);
7e81f138
JM
66
67 typedef void (*PFUNC)(string parameters, StreamOutput *stream);
9e403697 68 typedef struct {
7e81f138
JM
69 const char *command;
70 const PFUNC func;
71 } const ptentry_t;
9e403697 72
7e81f138
JM
73 static const ptentry_t commands_table[];
74 static int reset_delay_secs;
0325af12 75};