From 3a5243e8e1cfc8dc713302e3602801ffd58525e2 Mon Sep 17 00:00:00 2001 From: Service Account for Jan Ilavsky Date: Tue, 14 Aug 2018 15:26:19 -0500 Subject: [PATCH] #73 wip --- profile_bluesky/startup/28-protection_plc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/profile_bluesky/startup/28-protection_plc.py b/profile_bluesky/startup/28-protection_plc.py index e0c6c3e0..de69864d 100644 --- a/profile_bluesky/startup/28-protection_plc.py +++ b/profile_bluesky/startup/28-protection_plc.py @@ -28,7 +28,7 @@ def wait_for_interlock(self, verbose=True): t0 = time.time() msg = "Waiting %g for PLC interlock, check limit switches" while not self.interlocked: - time.sleep(self.SLEEP_POLL_s) + yield from bps.sleep(self.SLEEP_POLL_s) if verbose: print(msg % time.time()-t0) @@ -39,8 +39,10 @@ def stop_if_tripped(self, verbose=True): # TODO: should be a Bluesky suspender print("Fix PLC protection before any move. Stopping now.") print("Call beamline scientists if you do not understand.") print("!!!!!! DO NOT TRY TO FIX YOURSELF !!!!!!") - ti_filter_shutter.close() - user_data.collection_in_progress.put(0) # notify the GUI and others + yield from bps.mv( + ti_filter_shutter, "close", + user_data.collection_in_progress, 0, # notify the GUI and others + ) plc_protect = PlcProtectionDevice('9idcLAX:plc:', name='plc_protect')