|
OOFEM 3.0
|
The GCodeCommand class represents a single G-code command. More...
#include <GCodeCommand.h>
Public Member Functions | |
| GCodeCommand ()=default | |
| Default constructor for the GCodeCommand class. | |
| GCodeCommand (const std::string &cmd) | |
| Constructor for the GCodeCommand class. | |
| void | addParameter (char letter, const std::string &value) |
| Method to add a parameter to the G-code command. | |
| void | setCode (const std::string code) |
| Set the G-code command. | |
| std::string | getCode () const |
| Get the G-code command. | |
| std::map< char, std::string > | getParameters () const |
| Get the parameters associated with the G-code command. | |
| std::optional< std::string > | param_string (char paramLetter) const |
| Get the value of a parameter as a string. | |
| std::optional< int > | param_int (char paramLetter) const |
| Get the value of a parameter as an integer. | |
| std::optional< double > | param_double (char paramLetter) const |
| Get the value of a parameter as a double. | |
Private Attributes | |
| std::string | code |
| std::map< char, std::string > | parameters |
The GCodeCommand class represents a single G-code command.
Definition at line 15 of file GCodeCommand.h.
|
default |
Default constructor for the GCodeCommand class.
|
inline |
Constructor for the GCodeCommand class.
| cmd | The G-code command. |
Definition at line 27 of file GCodeCommand.h.
References code.
|
inline |
Method to add a parameter to the G-code command.
| letter | The parameter letter. |
| value | The parameter value. |
Definition at line 34 of file GCodeCommand.h.
References parameters.
Referenced by GCodeParser::parseLine().
|
inline |
Get the G-code command.
Definition at line 49 of file GCodeCommand.h.
References code.
Referenced by Printer::processCommand().
|
inline |
Get the parameters associated with the G-code command.
Definition at line 55 of file GCodeCommand.h.
References parameters.
|
inline |
Get the value of a parameter as a double.
| paramLetter | The parameter letter. |
Definition at line 99 of file GCodeCommand.h.
References param_string().
Referenced by Printer::handleG1Command().
|
inline |
Get the value of a parameter as an integer.
| paramLetter | The parameter letter. |
Definition at line 77 of file GCodeCommand.h.
References param_string().
|
inline |
Get the value of a parameter as a string.
| paramLetter | The parameter letter. |
Definition at line 62 of file GCodeCommand.h.
References parameters.
Referenced by param_double(), and param_int().
|
inline |
Set the G-code command.
| code | The G-code command. |
Definition at line 43 of file GCodeCommand.h.
References code.
Referenced by GCodeParser::parseLine().
|
private |
Definition at line 117 of file GCodeCommand.h.
Referenced by GCodeCommand(), getCode(), and setCode().
|
private |
Definition at line 118 of file GCodeCommand.h.
Referenced by addParameter(), getParameters(), and param_string().