def createController(): """Initialize controller.""" config = ctrlr.Config("amtron", "CS400") if not config.nodes: config.nodes, config.names = (["ai0"], ["CS400"]) if config.virtual: driver = VirtualAmtronInstrument() iface = AmtronController.virtualInstrumentController(config, driver) else: driver = AmtronDaq(drv.Serial(config.port), "Circat1") iface = AmtronController(config, driver) iface.addCommand(driver.temperature.voltage.ai, "temperature / C", poll=True, log=True) iface.addCommand(driver.pid.setpoint, "setpoint / C", log=True, specialColumn="programmable") iface.addCommand(driver.laser.control.total_power, "power / W", poll=True, log=True) iface.addCommand(driver.pid.proportional, "PID P", hide=True, specialColumn="pidp") iface.addCommand(driver.pid.integral_time, "PID I", hide=True, specialColumn="pidi") iface.addCommand(driver.pid.derivative_time, "PID D", hide=True, specialColumn="pidd") iface.addCommand(driver.laser.command.laser_state, "power", hide=True, poll=True, specialColumn="laserpower") iface.addCommand(driver.laser.command.gate_state, "gate", hide=True, poll=True, specialColumn="lasergate") iface.addCommand(driver.laser.interface.pilot_laser_state, "pilot", hide=True, poll=False, specialColumn="pilotlaser") iface.populate() return iface
def createController(): # Parse the commandline arguments: args = ctrlr.Config("watlow") # Create an driver instance: driver = Series982(drv.Serial(args.port)) # Create an interface instance: iface = ctrlr.Controller(driver, u"Watlow") # Add commands, create new columns in the `driver table`: iface.addCommand(driver.temperature1, "TC sample", poll=True, log=True) iface.addCommand(driver.temperature2, "TC heater", poll=True, log=True) iface.addCommand(driver.setpoint, "setpoint", log=True, specialColumn="programmable") iface.addCommand(driver.power, "output", poll=True, log=True) iface.addCommand(driver.operation.pid.a1.gain, "PID P", hide=True, specialColumn="pidp") iface.addCommand(driver.operation.pid.a1.integral, "PID I", hide=True, specialColumn="pidi") iface.addCommand(driver.operation.pid.a1.derivative, "PID D", hide=True, specialColumn="pidd") # Add at least one node: iface.addNode(0, u"Watlow") # Fill the table with a call to `populate` iface.populate() return iface
def createController(): """Initialize controller.""" config = ctrlr.Config("deltaelektronika", "SM-700") if not config.nodes: config.nodes, config.names = ([1], ["SM700"]) if config.virtual: driver = virtual.VirtualInstrument() iface = ctrlr.virtualInstrumentController(config, driver) else: driver = delta.Sm700Series(drv.Serial(config.port)) iface = ctrlr.Controller(config, driver) iface.addCommand(driver.source.voltage, "Voltage", poll=True, log=True) iface.addCommand(driver.source.current, "Current", poll=True, log=True) iface.populate() return iface
def createController(): """Initialize controller.""" config = ctrlr.Config("fluke", "18x") if not config.nodes: config.nodes, config.names = ([0], ["Fluke 18x"]) if config.virtual: driver = virtual.VirtualInstrument() iface = ctrlr.Controller.virtualInstrumentController(config, driver) iface.programPool.default_factory = ctrlr.SetpointRampProgram else: driver = fluke.Fluke18x(drv.Serial(config.port)) iface = ctrlr.Controller(config, driver) iface.addCommand(driver.measure, "Measure", poll=True, log=True) iface.addCommand(driver.unit, "Unit", poll=True) iface.populate() return iface
def createController(): """Initialize controller.""" config = ctrlr.Config("daq") if not config.nodes: config.nodes = range(20) config.names = ["V%i" % node for node in config.nodes] if config.virtual: driver = VirtualDaq(config.port) else: driver = daq.Daq(config.port) iface = ctrlr.Controller(config, driver) iface.addCommand(driver.digitalIO.state, "state") iface.editorPrototype.default_factory=ValveButton iface.ui.driverView.setItemDelegateForColumn( 0, ctrlr.ButtonDelegate(ValveButton(), iface.ui.driverView)) iface.ui.driverView.setEditTriggers( QtGui.QAbstractItemView.SelectedClicked | QtGui.QAbstractItemView.CurrentChanged) iface.populate() return iface
def createController(): """Initialize controller.""" config = ctrlr.Config("watlow") if not config.nodes: config.nodes = [None] if config.virtual: driver = virtual.VirtualInstrument() driver.setup = drv.Subsystem(driver) driver.setup.setProtocol(drv.ObjectWrapperProtocol(_VirtualRamping())) driver.setup.global_ = drv.Subsystem(driver.setup) driver.setup.global_.ramp_init = Cmd("ramp_init") driver.setup.global_.ramp_rate = Cmd("ramp_rate") iface = WatlowController.virtualInstrumentController(config, driver) else: driver = Series988(drv.Serial(config.port)) iface = WatlowController(config, driver) iface.addCommand(driver.temperature1, "TC sample", poll=True, log=True) iface.addCommand(driver.temperature2, "TC heater", poll=True, log=True) iface.addCommand(driver.setpoint, "setpoint", log=True, specialColumn="programmable") iface.addCommand(driver.power, "output", poll=True, log=True) iface.addCommand(driver.operation.pid.a1.gain, "PID P", hide=True, specialColumn="pidp") iface.addCommand(driver.operation.pid.a1.integral, "PID I", hide=True, specialColumn="pidi") iface.addCommand(driver.operation.pid.a1.derivative, "PID D", hide=True, specialColumn="pidd") iface.addCommand(driver.setup.global_.ramp_init, "ramp_init", hide=True, specialColumn="rampinit") iface.addCommand(driver.setup.global_.ramp_rate, "ramp_rate", hide=True, specialColumn="ramprate") iface.editorPrototype.default_factory=QtGui.QSpinBox # Make sure we can read the rate driver.setup.global_.ramp_init.write(1) iface.populate() return iface
def createController(): """Initialize controller.""" config = ctrlr.Config("deltaelektronika", "Delta-Fluke") if not config.nodes: config.nodes, config.names = ([1], ["DeltaFluke"]) fluke_serial = drv.Serial(config.port) delta_serial = drv.Serial("COM1") driver = DeltaFluke(fluke_serial, delta_serial) iface = ctrlr.Controller(config, driver) iface.addCommand(driver.fluke.measure, "Temperature", poll=True, log=True) iface.addCommand(driver.pid.setpoint, "Setpoint", log=True, specialColumn="programmable") iface.addCommand(driver.delta.source.voltage, "Voltage", poll=True, log=True) iface.addCommand(driver.delta.source.current, "Current", poll=True, log=True) iface.addCommand(driver.pid.proportional, u"PID P", hide=True, specialColumn="pidp") iface.addCommand(driver.pid.integral_time, u"PID I", hide=True, specialColumn="pidi") iface.addCommand(driver.pid.derivative_time, u"PID D", hide=True, specialColumn="pidd") iface.populate() return iface
def createController(): """Initialize controller.""" config = ctrlr.Config("pfeiffer", "Multigauge") if not config.nodes: config.nodes = range(6) if not config.nodes: config.nodes = range(1, 7) config.names = ["G%i" % node for node in config.nodes] if config.virtual: driver = virtual.VirtualInstrument() iface = ctrlr.Controller.virtualInstrumentController(config, driver) iface.programPool.default_factory = ctrlr.SetpointRampProgram else: driver = Maxigauge(drv.Serial(config.port)) iface = ctrlr.Controller(config, driver) iface.editorPrototype.default_factory = ctrlr.ScientificSpinBox iface.addCommand(driver.gauge.pressure, u"pressure", poll=True, log=True) iface.ui.driverView.setItemDelegateForColumn( 0, ctrlr.FormatTextDelegate("%.2e")) iface.populate() return iface