improvements in magfiels/ips_mercury
- read voltage - fix a bug with ._init name conflict
This commit is contained in:
@ -89,6 +89,10 @@ class HasConvergence:
|
||||
"""to be called from write_target"""
|
||||
self.convergence_state.start(self.state_approach)
|
||||
|
||||
def interrupt_state(self):
|
||||
"""to be called from stop"""
|
||||
self.convergence_state.start(self.state_instable)
|
||||
|
||||
def state_approach(self, state):
|
||||
"""approaching, checking progress (busy)"""
|
||||
state.spent_inside = 0
|
||||
@ -157,3 +161,10 @@ class HasConvergence:
|
||||
else:
|
||||
state.spent_inside = max(0, state.spent_inside - state.delta())
|
||||
return Retry()
|
||||
|
||||
def state_interrupt(self, state):
|
||||
self.status = IDLE, 'stopped' # stop called
|
||||
return self.state_instable
|
||||
|
||||
def stop(self):
|
||||
self.convergence_state.start(self.state_interrupt)
|
||||
|
Reference in New Issue
Block a user