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])