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)
|
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()
|
axis = axis.lower()
|
||||||
state = self.ctrl.state
|
state = self.ctrl.state
|
||||||
|
|
||||||
@@ -364,6 +364,7 @@ class Mach(Comm):
|
|||||||
self.mdi('G92%s%f' % (axis, position))
|
self.mdi('G92%s%f' % (axis, position))
|
||||||
|
|
||||||
#storing the offset to config
|
#storing the offset to config
|
||||||
|
if set_config is not None:
|
||||||
self.ctrl.config.set('axes', {'offset_' + axis : state.get(axis + 'p')})
|
self.ctrl.config.set('axes', {'offset_' + axis : state.get(axis + 'p')})
|
||||||
self.log.info('set_position: {} = {} '.format(axis, state.get(axis + 'p')))
|
self.log.info('set_position: {} = {} '.format(axis, state.get(axis + 'p')))
|
||||||
|
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ class StepHandler(bbctrl.APIHandler):
|
|||||||
|
|
||||||
class PositionHandler(bbctrl.APIHandler):
|
class PositionHandler(bbctrl.APIHandler):
|
||||||
def put_ok(self, axis):
|
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):
|
class OverrideFeedHandler(bbctrl.APIHandler):
|
||||||
|
|||||||
Reference in New Issue
Block a user