From 8b0d90ba4d251bed03e408a2f7b58a0cbc9e3240 Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Thu, 15 Aug 2019 13:36:18 +0200 Subject: [PATCH] Closedown --- script/test/InterlockMotorGroup.py | 38 +++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/script/test/InterlockMotorGroup.py b/script/test/InterlockMotorGroup.py index e28a46d..427b946 100644 --- a/script/test/InterlockMotorGroup.py +++ b/script/test/InterlockMotorGroup.py @@ -1,10 +1,10 @@ - + class InterlockMotors (Interlock): def __init__(self): - Interlock.__init__(self, (delta, eta, chi, phi)) + Interlock.__init__(self, (mu, delta, gamma, eta)) - def check(self, (d,e,c, p)): - if e>=d: + def check(self, (m, d, g, e)): + if e>d: return False return True @@ -14,11 +14,33 @@ class InterlockFourcv (Interlock): Interlock.__init__(self, (fourcv,)) def check(self, (p,)): - d,e,c, p = p - if e>=d: + m, d, g, e = p + if d>m: + return False + return True + + +class InterlockFourcv (Interlock): + def __init__(self): + Interlock.__init__(self, (fourcv, mu, delta, gamma, eta)) + + def check(self, (p, m, d, g, e)): + + mg, dg, gg, eg = p + mv = mm, md, mg, me = m!=mg, d!=dg, g!=gg, e!=eg + nm = mv.count(True) + simult = nm > 1 + if simult: + m, d, g, e = p + + print m, d, g, e + if d>m: return False return True - -interlock1 = InterlockMotors() + + +#interlock1.close() +interlock2.close() +#interlock1 = InterlockMotors() interlock2 = InterlockFourcv() \ No newline at end of file