Commit d99ced2a authored by Emmanuel Papillon's avatar Emmanuel Papillon
Browse files

debug on blcheck

parent db341841
......@@ -31,10 +31,9 @@ class BLCheckTask:
def check(self):
pass
class BLCheckFE(BLCheckTask):
class BLCheckUSM(BLCheckTask):
def init(self, config):
self.machinfo = config.get("machinfo")
self.frontend = config.get("frontend")
def check(self):
all_machinfo = self.machinfo.all_information
......@@ -43,12 +42,20 @@ class BLCheckFE(BLCheckTask):
srmode = all_machinfo["SR_Mode"]
if srmode != "USM":
raise NotInUSMMode()
class BLCheckFE(BLCheckTask):
def init(self, config):
self.machinfo = config.get("machinfo")
self.frontend = config.get("frontend")
def check(self):
all_machinfo = self.machinfo.all_information
# check FE auto mode
feauto = all_machinfo["Automatic_Mode"]
if feauto is False:
self.machinfo.automatic_mode = True
gevent.sleep(5.)
gevent.sleep(8.)
else:
fetime = all_machinfo["Auto_Mode_Time"]
if fetime < 24 * 60 * 60:
......@@ -61,9 +68,16 @@ class BLCheckFE(BLCheckTask):
class BLCheckBSH(BLCheckTask):
def init(self, config):
self.shutter = config.get("shutter")
self.valves = config.get("valves")
self.valves = config.get("valves", [])
def check(self):
# check valves are opened
for valve in self.valves:
if valve.is_closed:
valve.open()
if valve.is_closed:
raise BLCheckError(f"Cannot open valve [{valve.name}]")
# check shutter is opened
state = self.shutter.state
if state == TangoShutterState.DISABLE:
......@@ -73,6 +87,11 @@ class BLCheckBSH(BLCheckTask):
if self.shutter.is_closed:
raise BLCheckError(f"Cannot open shutter [{self.shutter.name}]")
class BLCheckValves(BLCheckTask):
def init(self, config):
self.valves = config.get("valves")
def check(self):
# check valves are opened
for valve in self.valves:
if valve.is_closed:
......@@ -89,8 +108,9 @@ class BLCheckIDPos(BLCheckTask):
if not "READY" in motor.state:
user_warning(f"{motor.name} not READY, cannot check position.")
elif not math.isnan(motor._set_position) and \
abs(motor.position - motor._set_position) < 0.01:
abs(motor.position - motor._set_position) > 0.01:
motor.move(motor._set_position)
gevent.sleep(1.)
class BLCheckChainPreset(ChainPreset):
def __init__(self, blcheck_master):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment