gcode: Remove unneeded base_xpos variables from get_status()
Convert the only user of base_zpos to use gcode_position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
c0daf43d2f
commit
2d5f9b6cda
|
@ -13,6 +13,7 @@ class TuningTower:
|
||||||
self.normal_transform = None
|
self.normal_transform = None
|
||||||
self.last_position = [0., 0., 0., 0.]
|
self.last_position = [0., 0., 0., 0.]
|
||||||
self.last_z = self.start = self.factor = self.band = 0.
|
self.last_z = self.start = self.factor = self.band = 0.
|
||||||
|
self.last_command_value = None
|
||||||
self.command_fmt = ""
|
self.command_fmt = ""
|
||||||
# Register command
|
# Register command
|
||||||
self.gcode = self.printer.lookup_object("gcode")
|
self.gcode = self.printer.lookup_object("gcode")
|
||||||
|
@ -35,6 +36,7 @@ class TuningTower:
|
||||||
self.command_fmt = "%s %s=%%.9f" % (command, parameter)
|
self.command_fmt = "%s %s=%%.9f" % (command, parameter)
|
||||||
self.normal_transform = self.gcode.set_move_transform(self, force=True)
|
self.normal_transform = self.gcode.set_move_transform(self, force=True)
|
||||||
self.last_z = -99999999.9
|
self.last_z = -99999999.9
|
||||||
|
self.last_command_value = None
|
||||||
self.get_position()
|
self.get_position()
|
||||||
gcmd.respond_info("Starting tuning test (start=%.6f factor=%.6f)"
|
gcmd.respond_info("Starting tuning test (start=%.6f factor=%.6f)"
|
||||||
% (self.start, self.factor))
|
% (self.start, self.factor))
|
||||||
|
@ -57,11 +59,11 @@ class TuningTower:
|
||||||
self.end_test()
|
self.end_test()
|
||||||
else:
|
else:
|
||||||
# Process update
|
# Process update
|
||||||
z_offset = self.gcode.get_status()['base_zpos']
|
gcode_z = self.gcode.get_status()['gcode_position'].z
|
||||||
oldval = self.calc_value(self.last_z - z_offset)
|
newval = self.calc_value(gcode_z)
|
||||||
newval = self.calc_value(z - z_offset)
|
|
||||||
self.last_z = z
|
self.last_z = z
|
||||||
if newval != oldval:
|
if newval != self.last_command_value:
|
||||||
|
self.last_command_value = newval
|
||||||
self.gcode.run_script_from_command(self.command_fmt
|
self.gcode.run_script_from_command(self.command_fmt
|
||||||
% (newval,))
|
% (newval,))
|
||||||
# Forward move to actual handler
|
# Forward move to actual handler
|
||||||
|
|
|
@ -187,10 +187,6 @@ class GCodeParser:
|
||||||
'last_ypos': self.last_position[1],
|
'last_ypos': self.last_position[1],
|
||||||
'last_zpos': self.last_position[2],
|
'last_zpos': self.last_position[2],
|
||||||
'last_epos': self.last_position[3],
|
'last_epos': self.last_position[3],
|
||||||
'base_xpos': self.base_position[0],
|
|
||||||
'base_ypos': self.base_position[1],
|
|
||||||
'base_zpos': self.base_position[2],
|
|
||||||
'base_epos': self.base_position[3],
|
|
||||||
'homing_origin': homing.Coord(*self.homing_position),
|
'homing_origin': homing.Coord(*self.homing_position),
|
||||||
'gcode_position': homing.Coord(*move_position),
|
'gcode_position': homing.Coord(*move_position),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue