Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Smoothie by
modules/communication/utils/Gcode.h@2:1df0b61d3b5a, 2014-02-28 (annotated)
- Committer:
- Michael J. Spencer
- Date:
- Fri Feb 28 18:52:52 2014 -0800
- Revision:
- 2:1df0b61d3b5a
- Parent:
- 0:31e91bb0ef3c
Update to latest Smoothie.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Michael J. Spencer |
2:1df0b61d3b5a | 1 | /* |
scachat | 0:31e91bb0ef3c | 2 | This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). |
scachat | 0:31e91bb0ef3c | 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. |
scachat | 0:31e91bb0ef3c | 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. |
Michael J. Spencer |
2:1df0b61d3b5a | 5 | You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. |
scachat | 0:31e91bb0ef3c | 6 | */ |
scachat | 0:31e91bb0ef3c | 7 | |
scachat | 0:31e91bb0ef3c | 8 | |
scachat | 0:31e91bb0ef3c | 9 | #ifndef GCODE_H |
scachat | 0:31e91bb0ef3c | 10 | #define GCODE_H |
scachat | 0:31e91bb0ef3c | 11 | #include <string> |
scachat | 0:31e91bb0ef3c | 12 | using std::string; |
scachat | 0:31e91bb0ef3c | 13 | #include "libs/StreamOutput.h" |
Michael J. Spencer |
2:1df0b61d3b5a | 14 | // Object to represent a Gcode command |
scachat | 0:31e91bb0ef3c | 15 | #include <stdlib.h> |
scachat | 0:31e91bb0ef3c | 16 | |
scachat | 0:31e91bb0ef3c | 17 | class Gcode { |
scachat | 0:31e91bb0ef3c | 18 | public: |
Michael J. Spencer |
2:1df0b61d3b5a | 19 | Gcode(const string&, StreamOutput*); |
Michael J. Spencer |
2:1df0b61d3b5a | 20 | Gcode(const Gcode& to_copy); |
Michael J. Spencer |
2:1df0b61d3b5a | 21 | Gcode& operator= (const Gcode& to_copy); |
Michael J. Spencer |
2:1df0b61d3b5a | 22 | |
Michael J. Spencer |
2:1df0b61d3b5a | 23 | bool has_letter ( char letter ); |
Michael J. Spencer |
2:1df0b61d3b5a | 24 | |
Michael J. Spencer |
2:1df0b61d3b5a | 25 | float get_value ( char letter ); |
Michael J. Spencer |
2:1df0b61d3b5a | 26 | |
Michael J. Spencer |
2:1df0b61d3b5a | 27 | float get_double ( char letter ); |
Michael J. Spencer |
2:1df0b61d3b5a | 28 | int get_int ( char letter ); |
Michael J. Spencer |
2:1df0b61d3b5a | 29 | |
Michael J. Spencer |
2:1df0b61d3b5a | 30 | int get_num_args(); |
Michael J. Spencer |
2:1df0b61d3b5a | 31 | void prepare_cached_values(); |
Michael J. Spencer |
2:1df0b61d3b5a | 32 | void mark_as_taken(); |
scachat | 0:31e91bb0ef3c | 33 | |
scachat | 0:31e91bb0ef3c | 34 | string command; |
Michael J. Spencer |
2:1df0b61d3b5a | 35 | float millimeters_of_travel; |
Michael J. Spencer |
2:1df0b61d3b5a | 36 | |
Michael J. Spencer |
2:1df0b61d3b5a | 37 | bool has_m; |
Michael J. Spencer |
2:1df0b61d3b5a | 38 | bool has_g; |
Michael J. Spencer |
2:1df0b61d3b5a | 39 | unsigned int m; |
Michael J. Spencer |
2:1df0b61d3b5a | 40 | unsigned int g; |
scachat | 0:31e91bb0ef3c | 41 | |
Michael J. Spencer |
2:1df0b61d3b5a | 42 | bool add_nl; |
scachat | 0:31e91bb0ef3c | 43 | StreamOutput* stream; |
Michael J. Spencer |
2:1df0b61d3b5a | 44 | |
Michael J. Spencer |
2:1df0b61d3b5a | 45 | string txt_after_ok; |
Michael J. Spencer |
2:1df0b61d3b5a | 46 | bool accepted_by_module; |
Michael J. Spencer |
2:1df0b61d3b5a | 47 | |
scachat | 0:31e91bb0ef3c | 48 | }; |
Michael J. Spencer |
2:1df0b61d3b5a | 49 | #endif |