Brought back the metric and imperial state variables.
This commit is contained in:
@@ -71,6 +71,7 @@ class Ctrl(object):
|
||||
def configure(self):
|
||||
# Indirectly configures state via calls to config() and the AVR
|
||||
self.config.reload()
|
||||
self.state.init()
|
||||
|
||||
def ready(self):
|
||||
# This is used to synchronize the start of the preplanner
|
||||
|
||||
@@ -419,3 +419,12 @@ class State(object):
|
||||
if switch[1:] == '-max':
|
||||
return self.get_axis_switch(switch[0], 'max')
|
||||
raise Exception('Unsupported switch "%s"' % switch)
|
||||
|
||||
def init(self):
|
||||
# Init machine units
|
||||
metric = self.ctrl.config.get('units', 'METRIC').upper() == 'METRIC'
|
||||
self.log.info('INIT Metric %d' % metric)
|
||||
if not 'metric' in self.vars:
|
||||
self.set('metric', metric)
|
||||
if not 'imperial' in self.vars:
|
||||
self.set('imperial', not metric)
|
||||
|
||||
Reference in New Issue
Block a user