From 7b4cc97cbbe494aaaaaaa4c7def11f9def0775ef Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Thu, 22 Aug 2019 10:45:11 +0200 Subject: [PATCH] Closedown --- script/geometry/fourcv.py | 1 + script/local.py | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/script/geometry/fourcv.py b/script/geometry/fourcv.py index ec2a7b2..a61b349 100644 --- a/script/geometry/fourcv.py +++ b/script/geometry/fourcv.py @@ -1,4 +1,5 @@ run("diffutils") +clear_interlocks() #alpha, delta, gamma, omegaV setup_diff(fourcv, energy, ("mu", "delta", "gam", "eta"), simultaneous_move=True) diff --git a/script/local.py b/script/local.py index c1a5620..97256ed 100644 --- a/script/local.py +++ b/script/local.py @@ -11,18 +11,20 @@ import json # Interlocks ################################################################################################### -class InterlockFourcv (Interlock): - def __init__(self): - Interlock.__init__(self, (fourcv, alpha, delta, gamma, omegaV)) - def check(self, (p, a, d, g, o)): - if fourcv.isStartingSimultaneousMove(): - a, d, g, o = p - if a>g: - return False - return True - -#interlock1 = InterlockFourcv() +INTERLOCKS = [] + +def clear_interlocks(): + for interlock in INTERLOCKS: + try: + interlock.close() + except: + pass + INTERLOCKS = [] + +def add_interlock(interlock): + INTERLOCKS.append(interlock) + ################################################################################################### # Hardware