gcode: Split G0/G1 command handling to new gcode_move class

Split up the main GCodeParser class into GCodeDispatch and GCodeMove
classes.  The GCodeMove class is now available using the "gcode_move"
printer object name.  This split simplifies the gcode.py code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2020-08-05 11:43:45 -04:00
parent cd7c1b8e68
commit 4c5e93d51d
15 changed files with 219 additions and 194 deletions

View File

@@ -73,7 +73,7 @@ gcode:
[gcode_macro TEST_expression]
gcode:
{% if printer.gcode.gcode_position.x != 0.0 %}
{% if printer.gcode_move.gcode_position.x != 0.0 %}
M112
{% else %}
{ action_respond_info("TEST_expression") }
@@ -108,7 +108,7 @@ gcode:
[gcode_macro TEST_in]
gcode:
{% if "abc" in printer or "gcode" not in printer %}
{% if "abc" in printer or "toolhead" not in printer %}
M112
{% endif %}