updating in mach

This commit is contained in:
sanjayk03-dev
2024-07-08 17:35:51 +05:30
parent 3cbaedf905
commit 9a2457d0f3
2 changed files with 18 additions and 13 deletions

View File

@@ -358,7 +358,7 @@ class Mach(Comm):
def set_position(self, axis, position):
axis = axis.lower()
state = self.ctrl.state
# config = self.ctrl.config
config = self.ctrl.config
if state.is_axis_homed(axis):
# If homed, change the offset rather than the absolute position
@@ -374,9 +374,13 @@ class Mach(Comm):
# json_data = config.values
# axes = json_data.setdefault('axes', {})
# axes[axis] = { 'abs' : target, 'off' : state.get('offset_' + axis)}
self.mlog.info('target ' + target)
self.mlog.info('state.get ' + state.get('offset_' + axis))
self.mlog.info('target ' + str(target))
self.mlog.info('state.get ' + str(state.get('offset_' + axis)))
state.set(axis + 'p', target)
if 'axes' in config.values:
config.values['axes'][axis] = { 'abs' : target, 'off' : state.get('offset_' + axis) }
else:
config.values['axes'] = { axis : { 'abs' : target, 'off' : state.get('offset_' + axis) } }
super().queue_command(Cmd.set_axis(axis, target))