def __init__(self, parent=None) -> None: super(PumpControl, self).__init__(parent) self.ui: Ui_main = self.window().ui port = self.find_com_port() self._context_depth = 0 logging.debug("initialize pump") try: chain = pumpy.Chain(port) self._pump = pumpy.Microliter(chain, name='Pump') except Exception as ex: self._pump = None logging.warning('Pump Error:' + str(ex)) self.worker: Worker = Worker(None)
import pumpy chain = pumpy.Chain('COM1') p11 = pumpy.Pump(chain,address=1,verbose=True) # Pump 11 phd = pumpy.PHD2000(chain,address=4,verbose=True) # PHD2000 p11.setdiameter(25) phd.setdiameter(24) p11.setflowrate(2000) phd.setflowrate(600) p11.settargetvolume(200) p11.infuse() phd.infuse() p11.waituntiltarget() phd.stop() phd.withdraw() p11.withdraw() p11.waituntiltarget() phd.stop() phd.settargetvolume(100) phd.infuse() phd.waituntiltarget()
# Pusher def push(message): conn = httplib.HTTPSConnection("api.pushover.net:443") conn.request( "POST", "/1/messages.json", urllib.urlencode({ "token": pushover_app_key, "user": pushover_user_key, "message": message, }), {"Content-type": "application/x-www-form-urlencoded"}) conn.getresponse() logging.basicConfig(level=logging.INFO) chain = pumpy.Chain('../../../../../dev/ttyUSB0') bufferPump = pumpy.PHD2000(chain, address=1, name="Buffer") # PHD2000 dosePump = pumpy.PHD2000(chain, address=12, name="Dose") # special pump #Experimental Setup #Set flow rate for whole experiment globalFlowRate = 100 doseList = [ 0.00, 10.00, 20.00, 30.00, 40.00, 50.00, 60.00, 70.00, 80.00, 90.00, 100.00 ] # Set diameters BD plastpak 10mL bufferPump.setdiameter(14.5) dosePump.setdiameter(14.5)
import logging import pumpy logging.basicConfig(level=logging.INFO) chain = pumpy.Chain('/dev/tty.usbserial-FTWOFH91A') p11 = pumpy.Pump(chain, address=1) p11.setdiameter(10) p11.setflowrate(2000) p11.settargetvolume(200) p11.infuse() p11.waituntiltarget() p11.withdraw() p11.waituntiltarget() phd = pumpy.PHD2000(chain, address=4) phd.setdiameter(24) phd.setflowrate(600) phd.infuse() phd.stop() phd.withdraw() phd.stop() phd.settargetvolume(100) phd.infuse() phd.waituntiltarget() chain.close()