storing in config only from user input
This commit is contained in:
@@ -355,7 +355,7 @@ class Mach(Comm):
|
||||
self.ctrl.state.set('optional_pause', enable)
|
||||
|
||||
|
||||
def set_position(self, axis, position):
|
||||
def set_position(self, axis, position, set_config = None):
|
||||
axis = axis.lower()
|
||||
state = self.ctrl.state
|
||||
|
||||
@@ -364,8 +364,9 @@ class Mach(Comm):
|
||||
self.mdi('G92%s%f' % (axis, position))
|
||||
|
||||
#storing the offset to config
|
||||
self.ctrl.config.set('axes', {'offset_' + axis : state.get(axis + 'p')})
|
||||
self.log.info('set_position: {} = {} '.format(axis, state.get(axis + 'p')))
|
||||
if set_config is not None:
|
||||
self.ctrl.config.set('axes', {'offset_' + axis : state.get(axis + 'p')})
|
||||
self.log.info('set_position: {} = {} '.format(axis, state.get(axis + 'p')))
|
||||
|
||||
elif state.is_axis_enabled(axis):
|
||||
if self._get_cycle() != 'idle' and not self._is_paused():
|
||||
|
||||
@@ -481,7 +481,7 @@ class StepHandler(bbctrl.APIHandler):
|
||||
|
||||
class PositionHandler(bbctrl.APIHandler):
|
||||
def put_ok(self, axis):
|
||||
self.get_ctrl().mach.set_position(axis, float(self.json['position']))
|
||||
self.get_ctrl().mach.set_position(axis, float(self.json['position']), True)
|
||||
|
||||
|
||||
class OverrideFeedHandler(bbctrl.APIHandler):
|
||||
|
||||
Reference in New Issue
Block a user