|
Information Operating
Derivative |
PluginsThe pump interface as well as the controller interface has been moved to plugins in order to allow maximum flexibility. Pump Plugin InterfaceNOTE: subject to change!
class Pump:
""" The Pump driver
"""
def __init__(self,cparams,logfiles,pparams,cport,pport):
"""
cparams: a dictionary containing all controller parametrs from
config.ini
logfiles: deprecated
pparams: a dictionary containing all pump parameters from config.ini
cport: an open serial port object for controlling the controller board,
which may or may not have the pump attached depending on the
hardware.
pport: an open serial port object for controlling the pump. may go
unused (eg 3d printed pump is controlled from cport)
NOTE: cport and pport also have thread locks associated with them
(named .lock). they should only be used with their lock.
"""
def withdraw(self, volume):
""" Instruct the pump to withrdraw volume units.
"""
def dispense(self,volume):
""" Instruct the pump to dispese volume units.
"""
self.withdraw(-volume)
def waitForPumping(self):
""" Block until pumping is done
"""
Control Algorithm InterfaceTODO: document
class State:
""" The state variable for the control function.
This does not need to adhere to any proper interface although a
readable __str__() method is highly recommended to allow for debugging.
"""
def __init__(self):
def __str__(self):
def computeControl(self,od,z=None,chamber=0,time=0.0):
""" Controller function
self: self refers to the main controller object that contains
all state such as the parameters file. computeControl should never write
to any members of self
od: current od of the camber
chamber: the chamber number indexed from zero
time: the current time since start up.
Returns: a tuple (list of dilution values for this chamber, state object)
"""
return (u,z)
|