gcode: Reset extrude_factor and extruder position on a tool change

The extrude_factor and extruder position are specific to the current
extruder, so reset them to default values on a Tn command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-05-20 13:47:00 -04:00
parent 33c2c8f1bd
commit 61fbd193f9
1 changed files with 2 additions and 0 deletions

View File

@ -395,6 +395,8 @@ class GCodeParser:
raise error(str(e))
self.extruder = e
self.reset_last_position()
self.extrude_factor = 1.
self.base_position[3] = self.last_position[3]
self.run_script(self.extruder.get_activate_gcode(True))
def cmd_mux(self, params):
key, values = self.mux_commands[params['#command']]