From 99ce453cb08d76f1c80973420a77ff348b79cd13 Mon Sep 17 00:00:00 2001 From: yoelk Date: Mon, 2 Nov 2015 11:53:53 +0100 Subject: [PATCH] allow stopping the syringe on the move --- .../controllers/labsmith_eib/labsmith_comps.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) mode change 100644 => 100755 instrumentino/instrumentino/controllers/labsmith_eib/labsmith_comps.py diff --git a/instrumentino/instrumentino/controllers/labsmith_eib/labsmith_comps.py b/instrumentino/instrumentino/controllers/labsmith_eib/labsmith_comps.py old mode 100644 new mode 100755 index 0253a94..4db6170 --- a/instrumentino/instrumentino/controllers/labsmith_eib/labsmith_comps.py +++ b/instrumentino/instrumentino/controllers/labsmith_eib/labsmith_comps.py @@ -128,21 +128,30 @@ def MoveSyringeToPosition(self, pos): eib = self.GetController() thread = Thread(target=eib.DLL.MoveSyringeToPosition, args=(eib.syringePumps[self.address], c_int(pos))) thread.start() + while thread.isAlive(): + if cfg.userStopped: + self.StopSyringe() thread.join() def MoveSyringeToVolumePercent(self, percent, maxVolume): eib = self.GetController() thread = Thread(target=eib.DLL.MoveSyringeToVolume, args=(eib.syringePumps[self.address], c_double(percent / 100 * maxVolume))) thread.start() + while thread.isAlive(): + if cfg.userStopped: + self.StopSyringe() thread.join() def MoveSyringeToVolume(self, volume): eib = self.GetController() thread = Thread(target=eib.DLL.MoveSyringeToVolume, args=(eib.syringePumps[self.address], c_double(volume))) thread.start() + while thread.isAlive(): + if cfg.userStopped: + self.StopSyringe() thread.join() - def StopSyringe(self, address): + def StopSyringe(self): eib = self.GetController() eib.accessSemaphore.acquire(True) eib.DLL.StopSyringe(eib.syringePumps[self.address])