Skip to content

Commit

Permalink
allow stopping the syringe on the move
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelk committed Nov 2, 2015
1 parent 8620f62 commit 99ce453
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion instrumentino/instrumentino/controllers/labsmith_eib/labsmith_comps.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 99ce453

Please sign in to comment.