fix leftover status imports
Change-Id: I8d26ff2082f7b407040d2eb2467ad8c32f325ba9 Reviewed-on: https://forge.frm2.tum.de/review/18212 Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
parent
81202a9998
commit
82caa33a5e
@ -26,7 +26,6 @@ from time import sleep
|
|||||||
|
|
||||||
from secop.modules import Module, Readable, Writable, Drivable, Param
|
from secop.modules import Module, Readable, Writable, Drivable, Param
|
||||||
from secop.lib import mkthread
|
from secop.lib import mkthread
|
||||||
from secop.protocol import status
|
|
||||||
from secop.datatypes import FloatRange
|
from secop.datatypes import FloatRange
|
||||||
|
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ class SimDrivable(SimBase, Drivable):
|
|||||||
def sim(self):
|
def sim(self):
|
||||||
while self._value == self.target:
|
while self._value == self.target:
|
||||||
sleep(0.3)
|
sleep(0.3)
|
||||||
self.status = status.BUSY, 'MOVING'
|
self.status = self.Status.BUSY, 'MOVING'
|
||||||
speed = 0
|
speed = 0
|
||||||
if 'ramp' in self.parameters:
|
if 'ramp' in self.parameters:
|
||||||
speed = self.ramp / 60. # ramp is per minute!
|
speed = self.ramp / 60. # ramp is per minute!
|
||||||
@ -127,4 +126,4 @@ class SimDrivable(SimBase, Drivable):
|
|||||||
else:
|
else:
|
||||||
self._value = self.target
|
self._value = self.target
|
||||||
sleep(0.3)
|
sleep(0.3)
|
||||||
self.status = status.OK, ''
|
self.status = self.Status.OK, ''
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
from secop.lib.sequence import SequencerMixin, Step
|
from secop.lib.sequence import SequencerMixin, Step
|
||||||
from secop.protocol import status
|
|
||||||
from secop.datatypes import StringType, TupleOf, FloatRange, ArrayOf, StructOf
|
from secop.datatypes import StringType, TupleOf, FloatRange, ArrayOf, StructOf
|
||||||
from secop.errors import DisabledError, ConfigError
|
from secop.errors import DisabledError, ConfigError
|
||||||
from secop.modules import Param, Drivable
|
from secop.modules import Param, Drivable
|
||||||
@ -217,11 +216,11 @@ class GarfieldMagnet(SequencerMixin, Drivable):
|
|||||||
def read_hw_status(self, maxage=0):
|
def read_hw_status(self, maxage=0):
|
||||||
# called from SequencerMixin.read_status if no sequence is running
|
# called from SequencerMixin.read_status if no sequence is running
|
||||||
if self._enable.value == 'Off':
|
if self._enable.value == 'Off':
|
||||||
return status.WARN, 'Disabled'
|
return self.Status.WARN, 'Disabled'
|
||||||
if self._enable.read_status(maxage)[0] != status.OK:
|
if self._enable.read_status(maxage)[0] != self.Status.OK:
|
||||||
return self._enable.status
|
return self._enable.status
|
||||||
if self._polswitch.value in ['0', 0]:
|
if self._polswitch.value in ['0', 0]:
|
||||||
return status.OK, 'Shorted, ' + self._currentsource.status[1]
|
return self.Status.OK, 'Shorted, ' + self._currentsource.status[1]
|
||||||
if self._symmetry.value in ['short', 0]:
|
if self._symmetry.value in ['short', 0]:
|
||||||
return self._currentsource.status[
|
return self._currentsource.status[
|
||||||
0], 'Shorted, ' + self._currentsource.status[1]
|
0], 'Shorted, ' + self._currentsource.status[1]
|
||||||
@ -282,7 +281,7 @@ class GarfieldMagnet(SequencerMixin, Drivable):
|
|||||||
|
|
||||||
def _recover(self, store):
|
def _recover(self, store):
|
||||||
# check for interlock
|
# check for interlock
|
||||||
if self._currentsource.read_status(0)[0] != status.ERROR:
|
if self._currentsource.read_status(0)[0] != self.Status.ERROR:
|
||||||
return
|
return
|
||||||
# recover from interlock
|
# recover from interlock
|
||||||
ramp = self._currentsource.ramp
|
ramp = self._currentsource.ramp
|
||||||
@ -316,7 +315,7 @@ class GarfieldMagnet(SequencerMixin, Drivable):
|
|||||||
self._currentsource.window = max(store.old_window, 10)
|
self._currentsource.window = max(store.old_window, 10)
|
||||||
|
|
||||||
def _set_polarity(self, store, target):
|
def _set_polarity(self, store, target):
|
||||||
if self._polswitch.read_status(0)[0] == status.BUSY:
|
if self._polswitch.read_status(0)[0] == self.Status.BUSY:
|
||||||
return True
|
return True
|
||||||
if int(self._polswitch.value) == int(target):
|
if int(self._polswitch.value) == int(target):
|
||||||
return False # done with this step
|
return False # done with this step
|
||||||
|
Loading…
x
Reference in New Issue
Block a user