e0a658993d1153d485113e89243a75a32b4af8b7
[clinton/Smoothieware.git] / src / modules / communication / utils / Gcode.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
9 #ifndef GCODE_H
10 #define GCODE_H
11 #include <string>
12 using std::string;
13 #include "libs/StreamOutput.h"
14 // Object to represent a Gcode command
15 #include <stdlib.h>
16
17 class Gcode {
18 public:
19 Gcode(const string&, StreamOutput*);
20
21 bool has_letter ( char letter );
22
23 double get_value ( char letter );
24
25 double get_double ( char letter );
26 int get_int ( char letter );
27
28 int get_num_args();
29 void prepare_cached_values();
30
31 const string command;
32 double millimeters_of_travel;
33 bool call_on_gcode_execute_event_immediatly;
34 bool on_gcode_execute_event_called;
35
36 bool has_m;
37 bool has_g;
38 unsigned int m;
39 unsigned int g;
40
41 bool add_nl;
42
43 int queued;
44
45 StreamOutput* stream;
46 };
47 #endif