示例#1
0
    def createChannelWidget(self, ch, daqName=None):
        conf = self.dev._DGConfig[ch]
        p = PlotWidget(self)

        units = ""
        if "units" in conf:
            units = conf["units"]

        # p.setAxisTitle(PlotWidget.yLeft, ch+units)
        p.setLabel("left", text=ch, units=units)
        # print "Plot label:", ch, units
        self.plots[ch] = p

        p.registerPlot(self.dev.name() + "." + ch)

        if conf["type"] in ["ao", "do"]:
            w = OutputChannelGui(self, ch, conf, p, self.dev, self.task, daqName)
            # QtCore.QObject.connect(w, QtCore.SIGNAL('sequenceChanged'), self.sequenceChanged)
            w.sigSequenceChanged.connect(self.sequenceChanged)
        elif conf["type"] in ["ai", "di"]:
            w = InputChannelGui(self, ch, conf, p, self.dev, self.task, daqName)
        else:
            raise Exception("Unrecognized device type '%s'" % conf["type"])
        # w.setUnits(units)
        self.channels[ch] = w

        return (w, p)
示例#2
0
    def addPlot(self, name=None, state=None):
        if name is None:
            name = 'Plot'
            i = 0
            while True:
                name2 = '%s_%03d' % (name, i)
                if name2 not in self.dockItems:
                    break
                i += 1
            name = name2
        
        p = PlotWidget(name=name)
        d = QtGui.QDockWidget(name)
        d.setObjectName(name)
        d.setWidget(p)
        
        if state is not None:
            p.restoreState(state)

        nodes = self.flowchart.nodes()
        #print name, nodes
        if name in nodes:
            node = nodes[name]
        else:
            node = self.flowchart.createNode('PlotWidget', name=name)
        node.setPlot(p)

        self.addDockWidget(QtCore.Qt.RightDockWidgetArea, d)
        item = ListItem(name, d)
        self.dockItems[name] = {'type': 'Plot', 'listItem': item, 'dock': d, 'widget': p, 'node': node}
        self.ui.dockList.addItem(item)
示例#3
0
文件: taskGUI.py 项目: ablot/acq4
 def createChannelWidget(self, ch, daqName=None):
     conf = self.dev._DGConfig[ch]
     p = PlotWidget(self)
     
     units = ''
     if 'units' in conf:
         units = conf['units']
         
     #p.setAxisTitle(PlotWidget.yLeft, ch+units)
     p.setLabel('left', text=ch, units=units)
     #print "Plot label:", ch, units
     self.plots[ch] = p
     
     p.registerPlot(self.dev.name() + '.' + ch)
     
     if conf['type'] in ['ao', 'do']:
         w = OutputChannelGui(self, ch, conf, p, self.dev, self.taskRunner, daqName)
         #QtCore.QObject.connect(w, QtCore.SIGNAL('sequenceChanged'), self.sequenceChanged)
         w.sigSequenceChanged.connect(self.sequenceChanged)
     elif conf['type'] in ['ai', 'di']:
         w = InputChannelGui(self, ch, conf, p, self.dev, self.taskRunner, daqName)
     else:
         raise Exception("Unrecognized device type '%s'" % conf['type'])
     # w.setUnits(units)
     self.channels[ch] = w
     
     return (w, p)
示例#4
0
    def createChannelWidget(self, ch, daqName=None):
        conf = self.dev._DGConfig[ch]
        p = PlotWidget(self)

        units = ''
        if 'units' in conf:
            units = conf['units']

        p.setLabel('left', text=ch, units=units)
        self.plots[ch] = p

        p.registerPlot(self.dev.name() + '.' + ch)

        if conf['type'] in ['ao', 'do']:
            w = OutputChannelGui(self, ch, conf, p, self.dev, self.taskRunner,
                                 daqName)
            w.sigSequenceChanged.connect(self.sequenceChanged)
        elif conf['type'] in ['ai', 'di']:
            w = InputChannelGui(self, ch, conf, p, self.dev, self.taskRunner,
                                daqName)
        else:
            raise Exception("Unrecognized device type '%s'" % conf['type'])
        self.channels[ch] = w

        return (w, p)
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(208, 349)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.rateAverageSpin = SpinBox(Form)
        self.rateAverageSpin.setObjectName("rateAverageSpin")
        self.gridLayout.addWidget(self.rateAverageSpin, 4, 1, 1, 1)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
        self.groupBox_2 = QtWidgets.QGroupBox(Form)
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.poisMaxCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.poisMaxCheck.setObjectName("poisMaxCheck")
        self.gridLayout_3.addWidget(self.poisMaxCheck, 2, 0, 1, 1)
        self.poisMaxAmpCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.poisMaxAmpCheck.setObjectName("poisMaxAmpCheck")
        self.gridLayout_3.addWidget(self.poisMaxAmpCheck, 3, 0, 1, 1)
        self.chargeTransferCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.chargeTransferCheck.setObjectName("chargeTransferCheck")
        self.gridLayout_3.addWidget(self.chargeTransferCheck, 0, 0, 1, 1)
        self.eventCountCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.eventCountCheck.setObjectName("eventCountCheck")
        self.gridLayout_3.addWidget(self.eventCountCheck, 1, 0, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 3, 0, 1, 2)
        self.groupBox = QtWidgets.QGroupBox(Form)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.excitatoryRadio = QtWidgets.QRadioButton(self.groupBox)
        self.excitatoryRadio.setObjectName("excitatoryRadio")
        self.gridLayout_2.addWidget(self.excitatoryRadio, 0, 0, 1, 1)
        self.fitErrorSpin = SpinBox(self.groupBox)
        self.fitErrorSpin.setObjectName("fitErrorSpin")
        self.gridLayout_2.addWidget(self.fitErrorSpin, 1, 1, 1, 1)
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
        self.inhibitoryRadio = QtWidgets.QRadioButton(self.groupBox)
        self.inhibitoryRadio.setObjectName("inhibitoryRadio")
        self.gridLayout_2.addWidget(self.inhibitoryRadio, 0, 1, 1, 1)
        self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 2)
        self.groupBox_3 = QtWidgets.QGroupBox(Form)
        self.groupBox_3.setObjectName("groupBox_3")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_3 = QtWidgets.QLabel(self.groupBox_3)
        self.label_3.setObjectName("label_3")
        self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1)
        self.thresholdSpin = SpinBox(self.groupBox_3)
        self.thresholdSpin.setObjectName("thresholdSpin")
        self.gridLayout_4.addWidget(self.thresholdSpin, 0, 1, 1, 1)
        self.detectionHistogram = PlotWidget(self.groupBox_3)
        self.detectionHistogram.setObjectName("detectionHistogram")
        self.gridLayout_4.addWidget(self.detectionHistogram, 1, 0, 1, 2)
        self.gridLayout.addWidget(self.groupBox_3, 5, 0, 1, 2)

        self.retranslateUi(Form)
        Qt.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = Qt.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.label.setText(_translate("Form", "Rate Average Window"))
        self.groupBox_2.setTitle(_translate("Form", "Detection Methods"))
        self.poisMaxCheck.setText(_translate("Form",
                                             "Poisson max probability"))
        self.poisMaxAmpCheck.setText(
            _translate("Form", "Poisson max + amplitude"))
        self.chargeTransferCheck.setText(
            _translate("Form", "Charge transfer z-score"))
        self.eventCountCheck.setText(_translate("Form", "Event Count"))
        self.groupBox.setTitle(_translate("Form", "Event Selection"))
        self.excitatoryRadio.setText(_translate("Form", "Excitatory"))
        self.label_2.setText(_translate("Form", "Fit Error Limit"))
        self.inhibitoryRadio.setText(_translate("Form", "Inhibitory"))
        self.label_3.setText(_translate("Form", "Detection Threshold"))
示例#6
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(307, 609)
        self.verticalLayout_2 = QtGui.QVBoxLayout(Form)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.splitter_4 = QtGui.QSplitter(Form)
        self.splitter_4.setOrientation(QtCore.Qt.Vertical)
        self.splitter_4.setObjectName(_fromUtf8("splitter_4"))
        self.splitter_2 = QtGui.QSplitter(self.splitter_4)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName(_fromUtf8("splitter_2"))
        self.layoutWidget = QtGui.QWidget(self.splitter_2)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.startBtn = QtGui.QPushButton(self.layoutWidget)
        self.startBtn.setCheckable(True)
        self.startBtn.setObjectName(_fromUtf8("startBtn"))
        self.horizontalLayout.addWidget(self.startBtn)
        self.recordBtn = QtGui.QPushButton(self.layoutWidget)
        self.recordBtn.setCheckable(True)
        self.recordBtn.setObjectName(_fromUtf8("recordBtn"))
        self.horizontalLayout.addWidget(self.recordBtn)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.modeLayout = QtGui.QVBoxLayout()
        self.modeLayout.setObjectName(_fromUtf8("modeLayout"))
        self.verticalLayout.addLayout(self.modeLayout)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label_4 = QtGui.QLabel(self.layoutWidget)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.horizontalLayout_2.addWidget(self.label_4)
        self.delayTimeSpin = SpinBox(self.layoutWidget)
        self.delayTimeSpin.setMinimum(1.0)
        self.delayTimeSpin.setMaximum(10000.0)
        self.delayTimeSpin.setSingleStep(1.0)
        self.delayTimeSpin.setObjectName(_fromUtf8("delayTimeSpin"))
        self.horizontalLayout_2.addWidget(self.delayTimeSpin)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_3 = QtGui.QLabel(self.layoutWidget)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.horizontalLayout_3.addWidget(self.label_3)
        self.pulseTimeSpin = SpinBox(self.layoutWidget)
        self.pulseTimeSpin.setSingleStep(1.0)
        self.pulseTimeSpin.setObjectName(_fromUtf8("pulseTimeSpin"))
        self.horizontalLayout_3.addWidget(self.pulseTimeSpin)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.label = QtGui.QLabel(self.layoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout_5.addWidget(self.label)
        self.cycleTimeSpin = SpinBox(self.layoutWidget)
        self.cycleTimeSpin.setSingleStep(1.0)
        self.cycleTimeSpin.setProperty("value", 0.2)
        self.cycleTimeSpin.setObjectName(_fromUtf8("cycleTimeSpin"))
        self.horizontalLayout_5.addWidget(self.cycleTimeSpin)
        self.verticalLayout.addLayout(self.horizontalLayout_5)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.label_2 = QtGui.QLabel(self.layoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout_4.addWidget(self.label_2)
        self.averageSpin = QtGui.QSpinBox(self.layoutWidget)
        self.averageSpin.setMinimum(1)
        self.averageSpin.setMaximum(100)
        self.averageSpin.setProperty("value", 1)
        self.averageSpin.setObjectName(_fromUtf8("averageSpin"))
        self.horizontalLayout_4.addWidget(self.averageSpin)
        self.verticalLayout.addLayout(self.horizontalLayout_4)
        spacerItem = QtGui.QSpacerItem(20, 13, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.tabWidget = QtGui.QTabWidget(self.layoutWidget)
        self.tabWidget.setObjectName(_fromUtf8("tabWidget"))
        self.verticalLayout.addWidget(self.tabWidget)
        self.splitter = QtGui.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.patchPlot = PlotWidget(self.splitter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.patchPlot.sizePolicy().hasHeightForWidth())
        self.patchPlot.setSizePolicy(sizePolicy)
        self.patchPlot.setObjectName(_fromUtf8("patchPlot"))
        self.commandPlot = PlotWidget(self.splitter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.commandPlot.sizePolicy().hasHeightForWidth())
        self.commandPlot.setSizePolicy(sizePolicy)
        self.commandPlot.setObjectName(_fromUtf8("commandPlot"))
        self.splitter_3 = QtGui.QSplitter(self.splitter_4)
        self.splitter_3.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_3.setObjectName(_fromUtf8("splitter_3"))
        self.widget = QtGui.QWidget(self.splitter_3)
        self.widget.setObjectName(_fromUtf8("widget"))
        self.gridLayout = QtGui.QGridLayout(self.widget)
        self.gridLayout.setMargin(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.restingPotentialLabel = QtGui.QLabel(self.widget)
        self.restingPotentialLabel.setMinimumSize(QtCore.QSize(140, 0))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.restingPotentialLabel.setFont(font)
        self.restingPotentialLabel.setAlignment(QtCore.Qt.AlignLeading
                                                | QtCore.Qt.AlignLeft
                                                | QtCore.Qt.AlignVCenter)
        self.restingPotentialLabel.setObjectName(
            _fromUtf8("restingPotentialLabel"))
        self.gridLayout.addWidget(self.restingPotentialLabel, 3, 1, 1, 1)
        self.fitErrorCheck = QtGui.QCheckBox(self.widget)
        self.fitErrorCheck.setObjectName(_fromUtf8("fitErrorCheck"))
        self.gridLayout.addWidget(self.fitErrorCheck, 6, 0, 1, 1)
        self.drawFitCheck = QtGui.QCheckBox(self.widget)
        self.drawFitCheck.setChecked(True)
        self.drawFitCheck.setObjectName(_fromUtf8("drawFitCheck"))
        self.gridLayout.addWidget(self.drawFitCheck, 0, 1, 1, 1)
        self.inputResistanceCheck = QtGui.QCheckBox(self.widget)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.inputResistanceCheck.setFont(font)
        self.inputResistanceCheck.setChecked(True)
        self.inputResistanceCheck.setObjectName(
            _fromUtf8("inputResistanceCheck"))
        self.gridLayout.addWidget(self.inputResistanceCheck, 1, 0, 1, 1)
        self.accessResistanceLabel = QtGui.QLabel(self.widget)
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.accessResistanceLabel.setFont(font)
        self.accessResistanceLabel.setAlignment(QtCore.Qt.AlignRight
                                                | QtCore.Qt.AlignTrailing
                                                | QtCore.Qt.AlignVCenter)
        self.accessResistanceLabel.setObjectName(
            _fromUtf8("accessResistanceLabel"))
        self.gridLayout.addWidget(self.accessResistanceLabel, 2, 1, 1, 1)
        self.inputResistanceLabel = QtGui.QLabel(self.widget)
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.inputResistanceLabel.setFont(font)
        self.inputResistanceLabel.setAlignment(QtCore.Qt.AlignRight
                                               | QtCore.Qt.AlignTrailing
                                               | QtCore.Qt.AlignVCenter)
        self.inputResistanceLabel.setObjectName(
            _fromUtf8("inputResistanceLabel"))
        self.gridLayout.addWidget(self.inputResistanceLabel, 1, 1, 1, 1)
        self.accessResistanceCheck = QtGui.QCheckBox(self.widget)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.accessResistanceCheck.setFont(font)
        self.accessResistanceCheck.setObjectName(
            _fromUtf8("accessResistanceCheck"))
        self.gridLayout.addWidget(self.accessResistanceCheck, 2, 0, 1, 1)
        self.restingCurrentLabel = QtGui.QLabel(self.widget)
        self.restingCurrentLabel.setMinimumSize(QtCore.QSize(120, 0))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.restingCurrentLabel.setFont(font)
        self.restingCurrentLabel.setAlignment(QtCore.Qt.AlignLeading
                                              | QtCore.Qt.AlignLeft
                                              | QtCore.Qt.AlignVCenter)
        self.restingCurrentLabel.setObjectName(
            _fromUtf8("restingCurrentLabel"))
        self.gridLayout.addWidget(self.restingCurrentLabel, 4, 1, 1, 1)
        self.capacitanceCheck = QtGui.QCheckBox(self.widget)
        self.capacitanceCheck.setObjectName(_fromUtf8("capacitanceCheck"))
        self.gridLayout.addWidget(self.capacitanceCheck, 5, 0, 1, 1)
        self.restingPotentialCheck = QtGui.QCheckBox(self.widget)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.restingPotentialCheck.setFont(font)
        self.restingPotentialCheck.setObjectName(
            _fromUtf8("restingPotentialCheck"))
        self.gridLayout.addWidget(self.restingPotentialCheck, 3, 0, 1, 1)
        self.restingCurrentCheck = QtGui.QCheckBox(self.widget)
        self.restingCurrentCheck.setObjectName(
            _fromUtf8("restingCurrentCheck"))
        self.gridLayout.addWidget(self.restingCurrentCheck, 4, 0, 1, 1)
        self.capacitanceLabel = QtGui.QLabel(self.widget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.capacitanceLabel.setFont(font)
        self.capacitanceLabel.setAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.capacitanceLabel.setObjectName(_fromUtf8("capacitanceLabel"))
        self.gridLayout.addWidget(self.capacitanceLabel, 5, 1, 1, 1)
        self.fitErrorLabel = QtGui.QLabel(self.widget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.fitErrorLabel.setFont(font)
        self.fitErrorLabel.setAlignment(QtCore.Qt.AlignRight
                                        | QtCore.Qt.AlignTrailing
                                        | QtCore.Qt.AlignVCenter)
        self.fitErrorLabel.setObjectName(_fromUtf8("fitErrorLabel"))
        self.gridLayout.addWidget(self.fitErrorLabel, 6, 1, 1, 1)
        self.resetBtn = QtGui.QToolButton(self.widget)
        self.resetBtn.setObjectName(_fromUtf8("resetBtn"))
        self.gridLayout.addWidget(self.resetBtn, 0, 0, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                        QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem1, 7, 1, 1, 1)
        self.layoutWidget1 = QtGui.QWidget(self.splitter_3)
        self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
        self.plotLayout = QtGui.QVBoxLayout(self.layoutWidget1)
        self.plotLayout.setSpacing(0)
        self.plotLayout.setMargin(0)
        self.plotLayout.setObjectName(_fromUtf8("plotLayout"))
        self.verticalLayout_2.addWidget(self.splitter_4)

        self.retranslateUi(Form)
        self.tabWidget.setCurrentIndex(-1)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#7
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(840, 504)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(4)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.gridLayout_4 = QtWidgets.QGridLayout(Form)
        self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
        self.gridLayout_4.setHorizontalSpacing(9)
        self.gridLayout_4.setVerticalSpacing(2)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
        self.gridLayout.setObjectName("gridLayout")
        self.cameraCombo = InterfaceCombo(Form)
        self.cameraCombo.setObjectName("cameraCombo")
        self.gridLayout.addWidget(self.cameraCombo, 0, 1, 1, 1)
        self.loadConfigBtn = QtWidgets.QPushButton(Form)
        self.loadConfigBtn.setObjectName("loadConfigBtn")
        self.gridLayout.addWidget(self.loadConfigBtn, 6, 0, 1, 2)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.laserCombo = InterfaceCombo(Form)
        self.laserCombo.setObjectName("laserCombo")
        self.gridLayout.addWidget(self.laserCombo, 1, 1, 1, 1)
        self.simulateShutterCheck = QtWidgets.QCheckBox(Form)
        self.simulateShutterCheck.setObjectName("simulateShutterCheck")
        self.gridLayout.addWidget(self.simulateShutterCheck, 2, 0, 1, 2)
        self.enablePosCtrlCheck = QtWidgets.QCheckBox(Form)
        self.enablePosCtrlCheck.setChecked(True)
        self.enablePosCtrlCheck.setObjectName("enablePosCtrlCheck")
        self.gridLayout.addWidget(self.enablePosCtrlCheck, 3, 0, 1, 2)
        self.enableScanProgCheck = QtWidgets.QCheckBox(Form)
        self.enableScanProgCheck.setChecked(True)
        self.enableScanProgCheck.setObjectName("enableScanProgCheck")
        self.gridLayout.addWidget(self.enableScanProgCheck, 4, 0, 1, 2)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
        self.gridLayout_4.addLayout(self.gridLayout, 0, 0, 2, 1)
        self.positionCtrlGroup = QtWidgets.QGroupBox(Form)
        self.positionCtrlGroup.setCheckable(False)
        self.positionCtrlGroup.setChecked(False)
        self.positionCtrlGroup.setObjectName("positionCtrlGroup")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.positionCtrlGroup)
        self.gridLayout_5.setContentsMargins(5, 5, 5, 5)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.showPosCtrlCheck = QtWidgets.QCheckBox(self.positionCtrlGroup)
        self.showPosCtrlCheck.setEnabled(True)
        self.showPosCtrlCheck.setChecked(True)
        self.showPosCtrlCheck.setObjectName("showPosCtrlCheck")
        self.gridLayout_5.addWidget(self.showPosCtrlCheck, 1, 0, 1, 1)
        self.spotDisplayGroup = GroupBox(self.positionCtrlGroup)
        self.spotDisplayGroup.setObjectName("spotDisplayGroup")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.spotDisplayGroup)
        self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.sizeFromCalibrationRadio = QtWidgets.QRadioButton(self.spotDisplayGroup)
        self.sizeFromCalibrationRadio.setChecked(True)
        self.sizeFromCalibrationRadio.setObjectName("sizeFromCalibrationRadio")
        self.gridLayout_2.addWidget(self.sizeFromCalibrationRadio, 0, 0, 1, 2)
        self.sizeCustomRadio = QtWidgets.QRadioButton(self.spotDisplayGroup)
        self.sizeCustomRadio.setObjectName("sizeCustomRadio")
        self.gridLayout_2.addWidget(self.sizeCustomRadio, 1, 0, 1, 1)
        self.sizeSpin = SpinBox(self.spotDisplayGroup)
        self.sizeSpin.setSuffix("")
        self.sizeSpin.setMinimum(0.0)
        self.sizeSpin.setMaximum(100000.0)
        self.sizeSpin.setSingleStep(1e-06)
        self.sizeSpin.setProperty("value", 0.0)
        self.sizeSpin.setObjectName("sizeSpin")
        self.gridLayout_2.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.showLastSpotCheck = QtWidgets.QCheckBox(self.spotDisplayGroup)
        self.showLastSpotCheck.setObjectName("showLastSpotCheck")
        self.gridLayout_2.addWidget(self.showLastSpotCheck, 2, 0, 1, 1)
        self.gridLayout_5.addWidget(self.spotDisplayGroup, 3, 0, 1, 1)
        self.spotSequenceGroup = GroupBox(self.positionCtrlGroup)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.spotSequenceGroup.sizePolicy().hasHeightForWidth())
        self.spotSequenceGroup.setSizePolicy(sizePolicy)
        self.spotSequenceGroup.setObjectName("spotSequenceGroup")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.spotSequenceGroup)
        self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
        self.gridLayout_3.setSpacing(3)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.minTimeSpin = SpinBox(self.spotSequenceGroup)
        self.minTimeSpin.setSuffix("")
        self.minTimeSpin.setDecimals(2)
        self.minTimeSpin.setMaximum(1000000.0)
        self.minTimeSpin.setObjectName("minTimeSpin")
        self.gridLayout_3.addWidget(self.minTimeSpin, 1, 1, 1, 1)
        self.timeLabel = QtWidgets.QLabel(self.spotSequenceGroup)
        self.timeLabel.setObjectName("timeLabel")
        self.gridLayout_3.addWidget(self.timeLabel, 4, 0, 1, 2)
        self.minDistSpin = SpinBox(self.spotSequenceGroup)
        self.minDistSpin.setSuffix("")
        self.minDistSpin.setMaximum(1000000.0)
        self.minDistSpin.setObjectName("minDistSpin")
        self.gridLayout_3.addWidget(self.minDistSpin, 2, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.spotSequenceGroup)
        self.label_3.setObjectName("label_3")
        self.gridLayout_3.addWidget(self.label_3, 1, 0, 1, 1)
        self.recomputeBtn = QtWidgets.QPushButton(self.spotSequenceGroup)
        self.recomputeBtn.setObjectName("recomputeBtn")
        self.gridLayout_3.addWidget(self.recomputeBtn, 5, 0, 1, 2)
        self.label_4 = QtWidgets.QLabel(self.spotSequenceGroup)
        self.label_4.setObjectName("label_4")
        self.gridLayout_3.addWidget(self.label_4, 2, 0, 1, 1)
        self.tdPlotWidget = PlotWidget(self.spotSequenceGroup)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tdPlotWidget.sizePolicy().hasHeightForWidth())
        self.tdPlotWidget.setSizePolicy(sizePolicy)
        self.tdPlotWidget.setMinimumSize(Qt.QSize(0, 100))
        self.tdPlotWidget.setMaximumSize(Qt.QSize(16777215, 100))
        self.tdPlotWidget.setObjectName("tdPlotWidget")
        self.gridLayout_3.addWidget(self.tdPlotWidget, 0, 0, 1, 2)
        self.gridLayout_5.addWidget(self.spotSequenceGroup, 2, 0, 1, 1)
        self.itemTree = ParameterTree(self.positionCtrlGroup)
        self.itemTree.setObjectName("itemTree")
        self.itemTree.headerItem().setText(0, "1")
        self.itemTree.header().setVisible(False)
        self.gridLayout_5.addWidget(self.itemTree, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.positionCtrlGroup, 0, 1, 2, 1)
        self.scanProgramGroup = QtWidgets.QGroupBox(Form)
        self.scanProgramGroup.setCheckable(False)
        self.scanProgramGroup.setChecked(False)
        self.scanProgramGroup.setObjectName("scanProgramGroup")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.scanProgramGroup)
        self.gridLayout_6.setContentsMargins(5, 5, 5, 5)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.gridLayout_9 = QtWidgets.QGridLayout()
        self.gridLayout_9.setObjectName("gridLayout_9")
        self.previewBtn = QtWidgets.QPushButton(self.scanProgramGroup)
        self.previewBtn.setCheckable(True)
        self.previewBtn.setObjectName("previewBtn")
        self.gridLayout_9.addWidget(self.previewBtn, 1, 0, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_9.addItem(spacerItem1, 1, 1, 1, 1)
        self.programPreviewSlider = QtWidgets.QSlider(self.scanProgramGroup)
        self.programPreviewSlider.setMaximum(999)
        self.programPreviewSlider.setProperty("value", 666)
        self.programPreviewSlider.setOrientation(Qt.Qt.Horizontal)
        self.programPreviewSlider.setTickPosition(QtWidgets.QSlider.TicksBelow)
        self.programPreviewSlider.setTickInterval(333)
        self.programPreviewSlider.setObjectName("programPreviewSlider")
        self.gridLayout_9.addWidget(self.programPreviewSlider, 1, 2, 1, 1)
        self.gridLayout_6.addLayout(self.gridLayout_9, 1, 0, 1, 1)
        self.scanProgramSplitter = QtWidgets.QSplitter(self.scanProgramGroup)
        self.scanProgramSplitter.setOrientation(Qt.Qt.Vertical)
        self.scanProgramSplitter.setObjectName("scanProgramSplitter")
        self.programTree = ParameterTree(self.scanProgramSplitter)
        self.programTree.setObjectName("programTree")
        self.programTree.headerItem().setText(0, "1")
        self.programTree.header().setVisible(False)
        self.programTimeline = PlotWidget(self.scanProgramSplitter)
        self.programTimeline.setObjectName("programTimeline")
        self.gridLayout_6.addWidget(self.scanProgramSplitter, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.scanProgramGroup, 1, 2, 1, 1)

        self.retranslateUi(Form)
        Qt.QMetaObject.connectSlotsByName(Form)
示例#8
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(840, 504)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(4)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.gridLayout_4 = QtWidgets.QGridLayout(Form)
        self.gridLayout_4.setContentsMargins(3, 3, 3, 3)
        self.gridLayout_4.setHorizontalSpacing(9)
        self.gridLayout_4.setVerticalSpacing(2)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
        self.gridLayout.setObjectName("gridLayout")
        self.cameraCombo = InterfaceCombo(Form)
        self.cameraCombo.setObjectName("cameraCombo")
        self.gridLayout.addWidget(self.cameraCombo, 0, 1, 1, 1)
        self.loadConfigBtn = QtWidgets.QPushButton(Form)
        self.loadConfigBtn.setObjectName("loadConfigBtn")
        self.gridLayout.addWidget(self.loadConfigBtn, 6, 0, 1, 2)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.laserCombo = InterfaceCombo(Form)
        self.laserCombo.setObjectName("laserCombo")
        self.gridLayout.addWidget(self.laserCombo, 1, 1, 1, 1)
        self.simulateShutterCheck = QtWidgets.QCheckBox(Form)
        self.simulateShutterCheck.setObjectName("simulateShutterCheck")
        self.gridLayout.addWidget(self.simulateShutterCheck, 2, 0, 1, 2)
        self.enablePosCtrlCheck = QtWidgets.QCheckBox(Form)
        self.enablePosCtrlCheck.setChecked(True)
        self.enablePosCtrlCheck.setObjectName("enablePosCtrlCheck")
        self.gridLayout.addWidget(self.enablePosCtrlCheck, 3, 0, 1, 2)
        self.enableScanProgCheck = QtWidgets.QCheckBox(Form)
        self.enableScanProgCheck.setChecked(True)
        self.enableScanProgCheck.setObjectName("enableScanProgCheck")
        self.gridLayout.addWidget(self.enableScanProgCheck, 4, 0, 1, 2)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
        self.gridLayout_4.addLayout(self.gridLayout, 0, 0, 2, 1)
        self.positionCtrlGroup = QtWidgets.QGroupBox(Form)
        self.positionCtrlGroup.setCheckable(False)
        self.positionCtrlGroup.setChecked(False)
        self.positionCtrlGroup.setObjectName("positionCtrlGroup")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.positionCtrlGroup)
        self.gridLayout_5.setContentsMargins(5, 5, 5, 5)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.showPosCtrlCheck = QtWidgets.QCheckBox(self.positionCtrlGroup)
        self.showPosCtrlCheck.setEnabled(True)
        self.showPosCtrlCheck.setChecked(True)
        self.showPosCtrlCheck.setObjectName("showPosCtrlCheck")
        self.gridLayout_5.addWidget(self.showPosCtrlCheck, 1, 0, 1, 1)
        self.spotDisplayGroup = GroupBox(self.positionCtrlGroup)
        self.spotDisplayGroup.setObjectName("spotDisplayGroup")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.spotDisplayGroup)
        self.gridLayout_2.setContentsMargins(3, 3, 3, 3)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.sizeFromCalibrationRadio = QtWidgets.QRadioButton(self.spotDisplayGroup)
        self.sizeFromCalibrationRadio.setChecked(True)
        self.sizeFromCalibrationRadio.setObjectName("sizeFromCalibrationRadio")
        self.gridLayout_2.addWidget(self.sizeFromCalibrationRadio, 0, 0, 1, 2)
        self.sizeCustomRadio = QtWidgets.QRadioButton(self.spotDisplayGroup)
        self.sizeCustomRadio.setObjectName("sizeCustomRadio")
        self.gridLayout_2.addWidget(self.sizeCustomRadio, 1, 0, 1, 1)
        self.sizeSpin = SpinBox(self.spotDisplayGroup)
        self.sizeSpin.setSuffix("")
        self.sizeSpin.setMinimum(0.0)
        self.sizeSpin.setMaximum(100000.0)
        self.sizeSpin.setSingleStep(1e-06)
        self.sizeSpin.setProperty("value", 0.0)
        self.sizeSpin.setObjectName("sizeSpin")
        self.gridLayout_2.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.showLastSpotCheck = QtWidgets.QCheckBox(self.spotDisplayGroup)
        self.showLastSpotCheck.setObjectName("showLastSpotCheck")
        self.gridLayout_2.addWidget(self.showLastSpotCheck, 2, 0, 1, 1)
        self.gridLayout_5.addWidget(self.spotDisplayGroup, 3, 0, 1, 1)
        self.spotSequenceGroup = GroupBox(self.positionCtrlGroup)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.spotSequenceGroup.sizePolicy().hasHeightForWidth())
        self.spotSequenceGroup.setSizePolicy(sizePolicy)
        self.spotSequenceGroup.setObjectName("spotSequenceGroup")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.spotSequenceGroup)
        self.gridLayout_3.setContentsMargins(3, 3, 3, 3)
        self.gridLayout_3.setSpacing(3)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.minTimeSpin = SpinBox(self.spotSequenceGroup)
        self.minTimeSpin.setSuffix("")
        self.minTimeSpin.setDecimals(2)
        self.minTimeSpin.setMaximum(1000000.0)
        self.minTimeSpin.setObjectName("minTimeSpin")
        self.gridLayout_3.addWidget(self.minTimeSpin, 1, 1, 1, 1)
        self.timeLabel = QtWidgets.QLabel(self.spotSequenceGroup)
        self.timeLabel.setObjectName("timeLabel")
        self.gridLayout_3.addWidget(self.timeLabel, 4, 0, 1, 2)
        self.minDistSpin = SpinBox(self.spotSequenceGroup)
        self.minDistSpin.setSuffix("")
        self.minDistSpin.setMaximum(1000000.0)
        self.minDistSpin.setObjectName("minDistSpin")
        self.gridLayout_3.addWidget(self.minDistSpin, 2, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(self.spotSequenceGroup)
        self.label_3.setObjectName("label_3")
        self.gridLayout_3.addWidget(self.label_3, 1, 0, 1, 1)
        self.recomputeBtn = QtWidgets.QPushButton(self.spotSequenceGroup)
        self.recomputeBtn.setObjectName("recomputeBtn")
        self.gridLayout_3.addWidget(self.recomputeBtn, 5, 0, 1, 2)
        self.label_4 = QtWidgets.QLabel(self.spotSequenceGroup)
        self.label_4.setObjectName("label_4")
        self.gridLayout_3.addWidget(self.label_4, 2, 0, 1, 1)
        self.tdPlotWidget = PlotWidget(self.spotSequenceGroup)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tdPlotWidget.sizePolicy().hasHeightForWidth())
        self.tdPlotWidget.setSizePolicy(sizePolicy)
        self.tdPlotWidget.setMinimumSize(Qt.QSize(0, 100))
        self.tdPlotWidget.setMaximumSize(Qt.QSize(16777215, 100))
        self.tdPlotWidget.setObjectName("tdPlotWidget")
        self.gridLayout_3.addWidget(self.tdPlotWidget, 0, 0, 1, 2)
        self.gridLayout_5.addWidget(self.spotSequenceGroup, 2, 0, 1, 1)
        self.itemTree = ParameterTree(self.positionCtrlGroup)
        self.itemTree.setObjectName("itemTree")
        self.itemTree.headerItem().setText(0, "1")
        self.itemTree.header().setVisible(False)
        self.gridLayout_5.addWidget(self.itemTree, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.positionCtrlGroup, 0, 1, 2, 1)
        self.scanProgramGroup = QtWidgets.QGroupBox(Form)
        self.scanProgramGroup.setCheckable(False)
        self.scanProgramGroup.setChecked(False)
        self.scanProgramGroup.setObjectName("scanProgramGroup")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.scanProgramGroup)
        self.gridLayout_6.setContentsMargins(5, 5, 5, 5)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.gridLayout_9 = QtWidgets.QGridLayout()
        self.gridLayout_9.setObjectName("gridLayout_9")
        self.previewBtn = QtWidgets.QPushButton(self.scanProgramGroup)
        self.previewBtn.setCheckable(True)
        self.previewBtn.setObjectName("previewBtn")
        self.gridLayout_9.addWidget(self.previewBtn, 1, 0, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_9.addItem(spacerItem1, 1, 1, 1, 1)
        self.programPreviewSlider = QtWidgets.QSlider(self.scanProgramGroup)
        self.programPreviewSlider.setMaximum(999)
        self.programPreviewSlider.setProperty("value", 666)
        self.programPreviewSlider.setOrientation(Qt.Qt.Horizontal)
        self.programPreviewSlider.setTickPosition(QtWidgets.QSlider.TicksBelow)
        self.programPreviewSlider.setTickInterval(333)
        self.programPreviewSlider.setObjectName("programPreviewSlider")
        self.gridLayout_9.addWidget(self.programPreviewSlider, 1, 2, 1, 1)
        self.gridLayout_6.addLayout(self.gridLayout_9, 1, 0, 1, 1)
        self.scanProgramSplitter = QtWidgets.QSplitter(self.scanProgramGroup)
        self.scanProgramSplitter.setOrientation(Qt.Qt.Vertical)
        self.scanProgramSplitter.setObjectName("scanProgramSplitter")
        self.programTree = ParameterTree(self.scanProgramSplitter)
        self.programTree.setObjectName("programTree")
        self.programTree.headerItem().setText(0, "1")
        self.programTree.header().setVisible(False)
        self.programTimeline = PlotWidget(self.scanProgramSplitter)
        self.programTimeline.setObjectName("programTimeline")
        self.gridLayout_6.addWidget(self.scanProgramSplitter, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.scanProgramGroup, 1, 2, 1, 1)

        self.retranslateUi(Form)
        Qt.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = Qt.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.cameraCombo.setToolTip(_translate("Form", "Selects the camera module to use with the scanner. This, along with the laser device, determines which calibration files will be used."))
        self.loadConfigBtn.setText(_translate("Form", "Load Last Config"))
        self.label.setText(_translate("Form", "Camera Module:"))
        self.label_2.setText(_translate("Form", "Laser Device:"))
        self.laserCombo.setToolTip(_translate("Form", "Selects the laser to be used."))
        self.simulateShutterCheck.setText(_translate("Form", "Simulate Shutter"))
        self.enablePosCtrlCheck.setText(_translate("Form", "Enable position controls"))
        self.enableScanProgCheck.setText(_translate("Form", "Enable scan programs"))
        self.positionCtrlGroup.setTitle(_translate("Form", "Position Controls"))
        self.showPosCtrlCheck.setToolTip(_translate("Form", "Hide all items from view."))
        self.showPosCtrlCheck.setText(_translate("Form", "Show position controls"))
        self.spotDisplayGroup.setTitle(_translate("Form", "Spot Display"))
        self.sizeFromCalibrationRadio.setToolTip(_translate("Form", "Causes target spots to be displayed at the size determined by the calibration file. Does not affect how data is collected."))
        self.sizeFromCalibrationRadio.setText(_translate("Form", "Use size from scanner calibration"))
        self.sizeCustomRadio.setToolTip(_translate("Form", "Lets the user change the display size of target spots. Does not change the way data is collected."))
        self.sizeCustomRadio.setText(_translate("Form", "Use custom size:"))
        self.sizeSpin.setToolTip(_translate("Form", "Specifies the display size of the target spots. Does not change the way data is collected."))
        self.showLastSpotCheck.setText(_translate("Form", "Show last spot"))
        self.spotSequenceGroup.setTitle(_translate("Form", "Spot Sequence"))
        self.minTimeSpin.setToolTip(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">When stimulating a sequence of points, this is the minimum amount of time that must pass before stimulating the same spot a second time. Points farther away will require smaller delays. Points farther than the minimum distance (specified below) will require no delay.</span></p></body></html>"))
        self.timeLabel.setText(_translate("Form", "Total Time:"))
        self.minDistSpin.setToolTip(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">When stimulating a sequence of points, this is the minimum distance between two spots such that no time delay is required between stimulating them. Points closer than this distance will require some delay, which is determined in part by the minimum time specified above.</span></p></body></html>"))
        self.label_3.setText(_translate("Form", "Minimum time"))
        self.recomputeBtn.setText(_translate("Form", "Recompute Order"))
        self.label_4.setText(_translate("Form", "Minimum distance"))
        self.scanProgramGroup.setTitle(_translate("Form", "Scan Program Controls"))
        self.previewBtn.setText(_translate("Form", "Preview"))
示例#9
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(703, 428)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(4)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.gridLayout_4 = QtGui.QGridLayout(Form)
        self.gridLayout_4.setMargin(3)
        self.gridLayout_4.setHorizontalSpacing(9)
        self.gridLayout_4.setVerticalSpacing(2)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.simulateShutterCheck = QtGui.QCheckBox(Form)
        self.simulateShutterCheck.setObjectName(_fromUtf8("simulateShutterCheck"))
        self.gridLayout.addWidget(self.simulateShutterCheck, 2, 0, 1, 2)
        self.groupBox = QtGui.QGroupBox(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setMinimumSize(QtCore.QSize(190, 210))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_3.setMargin(3)
        self.gridLayout_3.setSpacing(3)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.tdPlotWidget = PlotWidget(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tdPlotWidget.sizePolicy().hasHeightForWidth())
        self.tdPlotWidget.setSizePolicy(sizePolicy)
        self.tdPlotWidget.setObjectName(_fromUtf8("tdPlotWidget"))
        self.gridLayout_3.addWidget(self.tdPlotWidget, 0, 0, 1, 2)
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_3.addWidget(self.label_3, 1, 0, 1, 1)
        self.minTimeSpin = SpinBox(self.groupBox)
        self.minTimeSpin.setSuffix(_fromUtf8(""))
        self.minTimeSpin.setDecimals(2)
        self.minTimeSpin.setMaximum(1000000.0)
        self.minTimeSpin.setObjectName(_fromUtf8("minTimeSpin"))
        self.gridLayout_3.addWidget(self.minTimeSpin, 1, 1, 1, 1)
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout_3.addWidget(self.label_4, 2, 0, 1, 1)
        self.minDistSpin = SpinBox(self.groupBox)
        self.minDistSpin.setSuffix(_fromUtf8(""))
        self.minDistSpin.setMaximum(1000000.0)
        self.minDistSpin.setObjectName(_fromUtf8("minDistSpin"))
        self.gridLayout_3.addWidget(self.minDistSpin, 2, 1, 1, 1)
        self.recomputeBtn = QtGui.QPushButton(self.groupBox)
        self.recomputeBtn.setObjectName(_fromUtf8("recomputeBtn"))
        self.gridLayout_3.addWidget(self.recomputeBtn, 5, 0, 1, 2)
        self.timeLabel = QtGui.QLabel(self.groupBox)
        self.timeLabel.setObjectName(_fromUtf8("timeLabel"))
        self.gridLayout_3.addWidget(self.timeLabel, 4, 0, 1, 2)
        self.gridLayout.addWidget(self.groupBox, 5, 0, 1, 2)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_2.setMargin(3)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.sizeFromCalibrationRadio = QtGui.QRadioButton(self.groupBox_2)
        self.sizeFromCalibrationRadio.setChecked(True)
        self.sizeFromCalibrationRadio.setObjectName(_fromUtf8("sizeFromCalibrationRadio"))
        self.gridLayout_2.addWidget(self.sizeFromCalibrationRadio, 0, 0, 1, 2)
        self.sizeCustomRadio = QtGui.QRadioButton(self.groupBox_2)
        self.sizeCustomRadio.setObjectName(_fromUtf8("sizeCustomRadio"))
        self.gridLayout_2.addWidget(self.sizeCustomRadio, 1, 0, 1, 1)
        self.sizeSpin = SpinBox(self.groupBox_2)
        self.sizeSpin.setSuffix(_fromUtf8(""))
        self.sizeSpin.setMinimum(0.0)
        self.sizeSpin.setMaximum(100000.0)
        self.sizeSpin.setSingleStep(1e-06)
        self.sizeSpin.setProperty("value", 0.0)
        self.sizeSpin.setObjectName(_fromUtf8("sizeSpin"))
        self.gridLayout_2.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 4, 0, 1, 2)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 6, 0, 1, 1)
        self.laserCombo = InterfaceCombo(Form)
        self.laserCombo.setObjectName(_fromUtf8("laserCombo"))
        self.gridLayout.addWidget(self.laserCombo, 1, 1, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.cameraCombo = InterfaceCombo(Form)
        self.cameraCombo.setObjectName(_fromUtf8("cameraCombo"))
        self.gridLayout.addWidget(self.cameraCombo, 0, 1, 1, 1)
        self.loadConfigBtn = QtGui.QPushButton(Form)
        self.loadConfigBtn.setObjectName(_fromUtf8("loadConfigBtn"))
        self.gridLayout.addWidget(self.loadConfigBtn, 7, 0, 1, 2)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem1, 3, 0, 1, 1)
        self.gridLayout_4.addLayout(self.gridLayout, 0, 0, 2, 1)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_5.setMargin(5)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.itemTree = ParameterTree(self.groupBox_3)
        self.itemTree.setObjectName(_fromUtf8("itemTree"))
        self.itemTree.headerItem().setText(0, _fromUtf8("1"))
        self.itemTree.header().setVisible(False)
        self.gridLayout_5.addWidget(self.itemTree, 0, 0, 1, 1)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.hideCheck = QtGui.QCheckBox(self.groupBox_3)
        self.hideCheck.setEnabled(True)
        self.hideCheck.setChecked(False)
        self.hideCheck.setObjectName(_fromUtf8("hideCheck"))
        self.horizontalLayout_5.addWidget(self.hideCheck)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_5.addItem(spacerItem2)
        self.hideMarkerBtn = QtGui.QPushButton(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.hideMarkerBtn.sizePolicy().hasHeightForWidth())
        self.hideMarkerBtn.setSizePolicy(sizePolicy)
        self.hideMarkerBtn.setObjectName(_fromUtf8("hideMarkerBtn"))
        self.horizontalLayout_5.addWidget(self.hideMarkerBtn)
        self.gridLayout_5.addLayout(self.horizontalLayout_5, 1, 0, 1, 1)
        self.gridLayout_4.addWidget(self.groupBox_3, 0, 1, 2, 1)
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_6 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_6.setMargin(5)
        self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6"))
        self.gridLayout_9 = QtGui.QGridLayout()
        self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9"))
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.gridLayout_9.addItem(spacerItem3, 0, 0, 1, 1)
        self.previewBtn = QtGui.QPushButton(self.groupBox_4)
        self.previewBtn.setEnabled(False)
        self.previewBtn.setObjectName(_fromUtf8("previewBtn"))
        self.gridLayout_9.addWidget(self.previewBtn, 0, 1, 1, 1)
        self.gridLayout_6.addLayout(self.gridLayout_9, 1, 0, 1, 1)
        self.programTree = ParameterTree(self.groupBox_4)
        self.programTree.setObjectName(_fromUtf8("programTree"))
        self.programTree.headerItem().setText(0, _fromUtf8("1"))
        self.programTree.header().setVisible(False)
        self.gridLayout_6.addWidget(self.programTree, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.groupBox_4, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#10
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(315, 464)
        self.verticalLayout_2 = QtGui.QVBoxLayout(Form)
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.splitter_3 = QtGui.QSplitter(Form)
        self.splitter_3.setOrientation(QtCore.Qt.Vertical)
        self.splitter_3.setObjectName(_fromUtf8("splitter_3"))
        self.splitter_2 = QtGui.QSplitter(self.splitter_3)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName(_fromUtf8("splitter_2"))
        self.layoutWidget = QtGui.QWidget(self.splitter_2)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.groupBox_2 = QtGui.QGroupBox(self.layoutWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox_2.sizePolicy().hasHeightForWidth())
        self.groupBox_2.setSizePolicy(sizePolicy)
        self.groupBox_2.setTitle(_fromUtf8(""))
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_2.setMargin(0)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.vcPulseCheck = QtGui.QCheckBox(self.groupBox_2)
        self.vcPulseCheck.setChecked(True)
        self.vcPulseCheck.setObjectName(_fromUtf8("vcPulseCheck"))
        self.gridLayout_2.addWidget(self.vcPulseCheck, 2, 1, 1, 1)
        self.vcHoldCheck = QtGui.QCheckBox(self.groupBox_2)
        self.vcHoldCheck.setObjectName(_fromUtf8("vcHoldCheck"))
        self.gridLayout_2.addWidget(self.vcHoldCheck, 3, 1, 1, 1)
        self.icPulseCheck = QtGui.QCheckBox(self.groupBox_2)
        self.icPulseCheck.setChecked(True)
        self.icPulseCheck.setObjectName(_fromUtf8("icPulseCheck"))
        self.gridLayout_2.addWidget(self.icPulseCheck, 4, 1, 1, 1)
        self.icHoldCheck = QtGui.QCheckBox(self.groupBox_2)
        self.icHoldCheck.setObjectName(_fromUtf8("icHoldCheck"))
        self.gridLayout_2.addWidget(self.icHoldCheck, 6, 1, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.gridLayout_2.addItem(spacerItem, 7, 1, 1, 1)
        self.label = QtGui.QLabel(self.groupBox_2)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout_2.addWidget(self.label, 10, 0, 1, 2)
        self.label_3 = QtGui.QLabel(self.groupBox_2)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_2.addWidget(self.label_3, 9, 0, 1, 2)
        self.label_4 = QtGui.QLabel(self.groupBox_2)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout_2.addWidget(self.label_4, 8, 0, 1, 2)
        self.icModeRadio = QtGui.QRadioButton(self.groupBox_2)
        self.icModeRadio.setObjectName(_fromUtf8("icModeRadio"))
        self.gridLayout_2.addWidget(self.icModeRadio, 4, 0, 1, 1)
        self.vcModeRadio = QtGui.QRadioButton(self.groupBox_2)
        self.vcModeRadio.setChecked(True)
        self.vcModeRadio.setObjectName(_fromUtf8("vcModeRadio"))
        self.gridLayout_2.addWidget(self.vcModeRadio, 2, 0, 1, 1)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.startBtn = QtGui.QPushButton(self.groupBox_2)
        self.startBtn.setCheckable(True)
        self.startBtn.setObjectName(_fromUtf8("startBtn"))
        self.horizontalLayout.addWidget(self.startBtn)
        self.recordBtn = QtGui.QPushButton(self.groupBox_2)
        self.recordBtn.setCheckable(True)
        self.recordBtn.setObjectName(_fromUtf8("recordBtn"))
        self.horizontalLayout.addWidget(self.recordBtn)
        self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 3)
        self.icPulseSpin = SpinBox(self.groupBox_2)
        self.icPulseSpin.setObjectName(_fromUtf8("icPulseSpin"))
        self.gridLayout_2.addWidget(self.icPulseSpin, 4, 2, 1, 1)
        self.pulseTimeSpin = SpinBox(self.groupBox_2)
        self.pulseTimeSpin.setSingleStep(1.0)
        self.pulseTimeSpin.setObjectName(_fromUtf8("pulseTimeSpin"))
        self.gridLayout_2.addWidget(self.pulseTimeSpin, 9, 2, 1, 1)
        self.delayTimeSpin = SpinBox(self.groupBox_2)
        self.delayTimeSpin.setMinimum(1.0)
        self.delayTimeSpin.setMaximum(10000.0)
        self.delayTimeSpin.setSingleStep(1.0)
        self.delayTimeSpin.setObjectName(_fromUtf8("delayTimeSpin"))
        self.gridLayout_2.addWidget(self.delayTimeSpin, 8, 2, 1, 1)
        self.vcPulseSpin = SpinBox(self.groupBox_2)
        self.vcPulseSpin.setObjectName(_fromUtf8("vcPulseSpin"))
        self.gridLayout_2.addWidget(self.vcPulseSpin, 2, 2, 1, 1)
        self.icHoldSpin = SpinBox(self.groupBox_2)
        self.icHoldSpin.setObjectName(_fromUtf8("icHoldSpin"))
        self.gridLayout_2.addWidget(self.icHoldSpin, 5, 2, 2, 1)
        self.cycleTimeSpin = SpinBox(self.groupBox_2)
        self.cycleTimeSpin.setSingleStep(1.0)
        self.cycleTimeSpin.setProperty("value", 0.2)
        self.cycleTimeSpin.setObjectName(_fromUtf8("cycleTimeSpin"))
        self.gridLayout_2.addWidget(self.cycleTimeSpin, 10, 2, 1, 1)
        self.vcHoldSpin = SpinBox(self.groupBox_2)
        self.vcHoldSpin.setObjectName(_fromUtf8("vcHoldSpin"))
        self.gridLayout_2.addWidget(self.vcHoldSpin, 3, 2, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setContentsMargins(0, -1, -1, -1)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.bathModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.bathModeBtn.setObjectName(_fromUtf8("bathModeBtn"))
        self.horizontalLayout_2.addWidget(self.bathModeBtn)
        self.patchModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.patchModeBtn.setObjectName(_fromUtf8("patchModeBtn"))
        self.horizontalLayout_2.addWidget(self.patchModeBtn)
        self.cellModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.cellModeBtn.setObjectName(_fromUtf8("cellModeBtn"))
        self.horizontalLayout_2.addWidget(self.cellModeBtn)
        self.monitorModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.monitorModeBtn.setObjectName(_fromUtf8("monitorModeBtn"))
        self.horizontalLayout_2.addWidget(self.monitorModeBtn)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 3)
        self.label_2 = QtGui.QLabel(self.groupBox_2)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout_2.addWidget(self.label_2, 11, 0, 1, 1)
        self.averageSpin = QtGui.QSpinBox(self.groupBox_2)
        self.averageSpin.setMinimum(1)
        self.averageSpin.setMaximum(100)
        self.averageSpin.setProperty("value", 1)
        self.averageSpin.setObjectName(_fromUtf8("averageSpin"))
        self.gridLayout_2.addWidget(self.averageSpin, 11, 2, 1, 1)
        self.verticalLayout.addWidget(self.groupBox_2)
        self.groupBox = QtGui.QGroupBox(self.layoutWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setTitle(_fromUtf8(""))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout = QtGui.QGridLayout(self.groupBox)
        self.gridLayout.setMargin(0)
        self.gridLayout.setHorizontalSpacing(5)
        self.gridLayout.setVerticalSpacing(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.restingPotentialCheck = QtGui.QCheckBox(self.groupBox)
        self.restingPotentialCheck.setText(_fromUtf8(""))
        self.restingPotentialCheck.setObjectName(
            _fromUtf8("restingPotentialCheck"))
        self.gridLayout.addWidget(self.restingPotentialCheck, 3, 0, 1, 1)
        self.restingPotentialLabel = QtGui.QLabel(self.groupBox)
        self.restingPotentialLabel.setMinimumSize(QtCore.QSize(140, 0))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.restingPotentialLabel.setFont(font)
        self.restingPotentialLabel.setAlignment(QtCore.Qt.AlignRight
                                                | QtCore.Qt.AlignTrailing
                                                | QtCore.Qt.AlignVCenter)
        self.restingPotentialLabel.setObjectName(
            _fromUtf8("restingPotentialLabel"))
        self.gridLayout.addWidget(self.restingPotentialLabel, 3, 2, 1, 1)
        self.restingCurrentCheck = QtGui.QCheckBox(self.groupBox)
        self.restingCurrentCheck.setText(_fromUtf8(""))
        self.restingCurrentCheck.setObjectName(
            _fromUtf8("restingCurrentCheck"))
        self.gridLayout.addWidget(self.restingCurrentCheck, 4, 0, 1, 1)
        self.fitErrorCheck = QtGui.QCheckBox(self.groupBox)
        self.fitErrorCheck.setText(_fromUtf8(""))
        self.fitErrorCheck.setObjectName(_fromUtf8("fitErrorCheck"))
        self.gridLayout.addWidget(self.fitErrorCheck, 6, 0, 1, 1)
        self.fitErrorLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.fitErrorLabel.setFont(font)
        self.fitErrorLabel.setAlignment(QtCore.Qt.AlignRight
                                        | QtCore.Qt.AlignTrailing
                                        | QtCore.Qt.AlignVCenter)
        self.fitErrorLabel.setObjectName(_fromUtf8("fitErrorLabel"))
        self.gridLayout.addWidget(self.fitErrorLabel, 6, 2, 1, 1)
        self.drawFitCheck = QtGui.QCheckBox(self.groupBox)
        self.drawFitCheck.setChecked(True)
        self.drawFitCheck.setObjectName(_fromUtf8("drawFitCheck"))
        self.gridLayout.addWidget(self.drawFitCheck, 0, 2, 1, 1)
        self.accessResistanceLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.accessResistanceLabel.setFont(font)
        self.accessResistanceLabel.setAlignment(QtCore.Qt.AlignRight
                                                | QtCore.Qt.AlignTrailing
                                                | QtCore.Qt.AlignVCenter)
        self.accessResistanceLabel.setObjectName(
            _fromUtf8("accessResistanceLabel"))
        self.gridLayout.addWidget(self.accessResistanceLabel, 2, 2, 1, 1)
        self.inputResistanceLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.inputResistanceLabel.setFont(font)
        self.inputResistanceLabel.setAlignment(QtCore.Qt.AlignRight
                                               | QtCore.Qt.AlignTrailing
                                               | QtCore.Qt.AlignVCenter)
        self.inputResistanceLabel.setObjectName(
            _fromUtf8("inputResistanceLabel"))
        self.gridLayout.addWidget(self.inputResistanceLabel, 1, 2, 1, 1)
        self.accessResistanceCheck = QtGui.QCheckBox(self.groupBox)
        self.accessResistanceCheck.setText(_fromUtf8(""))
        self.accessResistanceCheck.setObjectName(
            _fromUtf8("accessResistanceCheck"))
        self.gridLayout.addWidget(self.accessResistanceCheck, 2, 0, 1, 1)
        self.restingCurrentLabel = QtGui.QLabel(self.groupBox)
        self.restingCurrentLabel.setMinimumSize(QtCore.QSize(120, 0))
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.restingCurrentLabel.setFont(font)
        self.restingCurrentLabel.setAlignment(QtCore.Qt.AlignRight
                                              | QtCore.Qt.AlignTrailing
                                              | QtCore.Qt.AlignVCenter)
        self.restingCurrentLabel.setObjectName(
            _fromUtf8("restingCurrentLabel"))
        self.gridLayout.addWidget(self.restingCurrentLabel, 4, 2, 1, 1)
        self.inputResistanceCheck = QtGui.QCheckBox(self.groupBox)
        self.inputResistanceCheck.setMaximumSize(QtCore.QSize(20, 16777215))
        self.inputResistanceCheck.setText(_fromUtf8(""))
        self.inputResistanceCheck.setChecked(True)
        self.inputResistanceCheck.setObjectName(
            _fromUtf8("inputResistanceCheck"))
        self.gridLayout.addWidget(self.inputResistanceCheck, 1, 0, 1, 1)
        self.capacitanceCheck = QtGui.QCheckBox(self.groupBox)
        self.capacitanceCheck.setText(_fromUtf8(""))
        self.capacitanceCheck.setObjectName(_fromUtf8("capacitanceCheck"))
        self.gridLayout.addWidget(self.capacitanceCheck, 5, 0, 1, 1)
        self.capacitanceLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setBold(False)
        font.setWeight(50)
        self.capacitanceLabel.setFont(font)
        self.capacitanceLabel.setAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.capacitanceLabel.setObjectName(_fromUtf8("capacitanceLabel"))
        self.gridLayout.addWidget(self.capacitanceLabel, 5, 2, 1, 1)
        self.label_5 = QtGui.QLabel(self.groupBox)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.gridLayout.addWidget(self.label_5, 1, 1, 1, 1)
        self.resetBtn = QtGui.QToolButton(self.groupBox)
        self.resetBtn.setObjectName(_fromUtf8("resetBtn"))
        self.gridLayout.addWidget(self.resetBtn, 0, 0, 1, 2)
        self.label_6 = QtGui.QLabel(self.groupBox)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.gridLayout.addWidget(self.label_6, 2, 1, 1, 1)
        self.label_7 = QtGui.QLabel(self.groupBox)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.gridLayout.addWidget(self.label_7, 3, 1, 1, 1)
        self.label_8 = QtGui.QLabel(self.groupBox)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.gridLayout.addWidget(self.label_8, 4, 1, 1, 1)
        self.label_9 = QtGui.QLabel(self.groupBox)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.gridLayout.addWidget(self.label_9, 5, 1, 1, 1)
        self.label_10 = QtGui.QLabel(self.groupBox)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.gridLayout.addWidget(self.label_10, 6, 1, 1, 1)
        self.verticalLayout.addWidget(self.groupBox)
        self.splitter = QtGui.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.patchPlot = PlotWidget(self.splitter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.patchPlot.sizePolicy().hasHeightForWidth())
        self.patchPlot.setSizePolicy(sizePolicy)
        self.patchPlot.setObjectName(_fromUtf8("patchPlot"))
        self.commandPlot = PlotWidget(self.splitter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.commandPlot.sizePolicy().hasHeightForWidth())
        self.commandPlot.setSizePolicy(sizePolicy)
        self.commandPlot.setObjectName(_fromUtf8("commandPlot"))
        self.layoutWidget1 = QtGui.QWidget(self.splitter_3)
        self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
        self.plotLayout = QtGui.QVBoxLayout(self.layoutWidget1)
        self.plotLayout.setSpacing(0)
        self.plotLayout.setMargin(0)
        self.plotLayout.setObjectName(_fromUtf8("plotLayout"))
        self.verticalLayout_2.addWidget(self.splitter_3)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#11
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(208, 349)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.rateAverageSpin = SpinBox(Form)
        self.rateAverageSpin.setObjectName(_fromUtf8("rateAverageSpin"))
        self.gridLayout.addWidget(self.rateAverageSpin, 4, 1, 1, 1)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.poisMaxCheck = QtGui.QCheckBox(self.groupBox_2)
        self.poisMaxCheck.setObjectName(_fromUtf8("poisMaxCheck"))
        self.gridLayout_3.addWidget(self.poisMaxCheck, 2, 0, 1, 1)
        self.poisMaxAmpCheck = QtGui.QCheckBox(self.groupBox_2)
        self.poisMaxAmpCheck.setObjectName(_fromUtf8("poisMaxAmpCheck"))
        self.gridLayout_3.addWidget(self.poisMaxAmpCheck, 3, 0, 1, 1)
        self.chargeTransferCheck = QtGui.QCheckBox(self.groupBox_2)
        self.chargeTransferCheck.setObjectName(_fromUtf8("chargeTransferCheck"))
        self.gridLayout_3.addWidget(self.chargeTransferCheck, 0, 0, 1, 1)
        self.eventCountCheck = QtGui.QCheckBox(self.groupBox_2)
        self.eventCountCheck.setObjectName(_fromUtf8("eventCountCheck"))
        self.gridLayout_3.addWidget(self.eventCountCheck, 1, 0, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 3, 0, 1, 2)
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.excitatoryRadio = QtGui.QRadioButton(self.groupBox)
        self.excitatoryRadio.setObjectName(_fromUtf8("excitatoryRadio"))
        self.gridLayout_2.addWidget(self.excitatoryRadio, 0, 0, 1, 1)
        self.fitErrorSpin = SpinBox(self.groupBox)
        self.fitErrorSpin.setObjectName(_fromUtf8("fitErrorSpin"))
        self.gridLayout_2.addWidget(self.fitErrorSpin, 1, 1, 1, 1)
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
        self.inhibitoryRadio = QtGui.QRadioButton(self.groupBox)
        self.inhibitoryRadio.setObjectName(_fromUtf8("inhibitoryRadio"))
        self.gridLayout_2.addWidget(self.inhibitoryRadio, 0, 1, 1, 1)
        self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 2)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.label_3 = QtGui.QLabel(self.groupBox_3)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1)
        self.thresholdSpin = SpinBox(self.groupBox_3)
        self.thresholdSpin.setObjectName(_fromUtf8("thresholdSpin"))
        self.gridLayout_4.addWidget(self.thresholdSpin, 0, 1, 1, 1)
        self.detectionHistogram = PlotWidget(self.groupBox_3)
        self.detectionHistogram.setObjectName(_fromUtf8("detectionHistogram"))
        self.gridLayout_4.addWidget(self.detectionHistogram, 1, 0, 1, 2)
        self.gridLayout.addWidget(self.groupBox_3, 5, 0, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(208, 349)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.rateAverageSpin = SpinBox(Form)
        self.rateAverageSpin.setObjectName("rateAverageSpin")
        self.gridLayout.addWidget(self.rateAverageSpin, 4, 1, 1, 1)
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
        self.groupBox_2 = QtWidgets.QGroupBox(Form)
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.poisMaxCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.poisMaxCheck.setObjectName("poisMaxCheck")
        self.gridLayout_3.addWidget(self.poisMaxCheck, 2, 0, 1, 1)
        self.poisMaxAmpCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.poisMaxAmpCheck.setObjectName("poisMaxAmpCheck")
        self.gridLayout_3.addWidget(self.poisMaxAmpCheck, 3, 0, 1, 1)
        self.chargeTransferCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.chargeTransferCheck.setObjectName("chargeTransferCheck")
        self.gridLayout_3.addWidget(self.chargeTransferCheck, 0, 0, 1, 1)
        self.eventCountCheck = QtWidgets.QCheckBox(self.groupBox_2)
        self.eventCountCheck.setObjectName("eventCountCheck")
        self.gridLayout_3.addWidget(self.eventCountCheck, 1, 0, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 3, 0, 1, 2)
        self.groupBox = QtWidgets.QGroupBox(Form)
        self.groupBox.setObjectName("groupBox")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.excitatoryRadio = QtWidgets.QRadioButton(self.groupBox)
        self.excitatoryRadio.setObjectName("excitatoryRadio")
        self.gridLayout_2.addWidget(self.excitatoryRadio, 0, 0, 1, 1)
        self.fitErrorSpin = SpinBox(self.groupBox)
        self.fitErrorSpin.setObjectName("fitErrorSpin")
        self.gridLayout_2.addWidget(self.fitErrorSpin, 1, 1, 1, 1)
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
        self.inhibitoryRadio = QtWidgets.QRadioButton(self.groupBox)
        self.inhibitoryRadio.setObjectName("inhibitoryRadio")
        self.gridLayout_2.addWidget(self.inhibitoryRadio, 0, 1, 1, 1)
        self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 2)
        self.groupBox_3 = QtWidgets.QGroupBox(Form)
        self.groupBox_3.setObjectName("groupBox_3")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_3 = QtWidgets.QLabel(self.groupBox_3)
        self.label_3.setObjectName("label_3")
        self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1)
        self.thresholdSpin = SpinBox(self.groupBox_3)
        self.thresholdSpin.setObjectName("thresholdSpin")
        self.gridLayout_4.addWidget(self.thresholdSpin, 0, 1, 1, 1)
        self.detectionHistogram = PlotWidget(self.groupBox_3)
        self.detectionHistogram.setObjectName("detectionHistogram")
        self.gridLayout_4.addWidget(self.detectionHistogram, 1, 0, 1, 2)
        self.gridLayout.addWidget(self.groupBox_3, 5, 0, 1, 2)

        self.retranslateUi(Form)
        Qt.QMetaObject.connectSlotsByName(Form)
示例#13
0
    def __init__(self, dev, task):
        DAQGenericTaskGui.__init__(self, dev, task, ownUi=False)
        
        self.ui = taskTemplate.Ui_Form()
        
        
        self.cache = {}
        
        self.layout = QtGui.QGridLayout()
        self.layout.setContentsMargins(0,0,0,0)
        self.setLayout(self.layout)
        
        self.splitter1 = QtGui.QSplitter()
        self.splitter1.setOrientation(QtCore.Qt.Horizontal)
        self.layout.addWidget(self.splitter1)
        
        self.ctrlLayout = QtGui.QVBoxLayout()
        wid1 = QtGui.QWidget()
        wid1.setLayout(self.ctrlLayout)
        self.plotSplitter = QtGui.QSplitter()
        self.plotSplitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter1.addWidget(wid1)
        self.splitter1.addWidget(self.plotSplitter)
        #wid = QtGui.QWidget()
        #hLayout = QtGui.QHBoxLayout()
        #wid.setLayout(hLayout)
        #self.ctrlLayout.addLayout(hLayout)
        wid2 = QtGui.QWidget()
        self.ui.setupUi(wid2)
        self.ctrlLayout.addWidget(wid2)

        if not self.dev.hasPowerIndicator:
            self.ui.checkPowerBtn.setEnabled(False)
            self.ui.checkPowerCheck.hide()
            self.ui.checkPowerCheck.setChecked(False)
        if not self.dev.hasTunableWavelength:
            self.ui.wavelengthWidget.hide()
        
        
        self.powerWidget, self.powerPlot = self.createChannelWidget('power', daqName=self.dev.getDAQName()[0])
        
        ## all we want is the function generator
        self.powerFnGenerator = self.powerWidget.ui.waveGeneratorWidget
        self.powerWidget.hide()
        self.ctrlLayout.addWidget(self.powerFnGenerator)
        self.powerFnGenerator.show()
        
        self.plotSplitter.addWidget(self.powerPlot)
        self.powerWidget.setMeta('y', units='W', siPrefix=True, dec=True, step=0.5, minStep=1e-3, limits=(0, None))
        self.powerWidget.setMeta('xy', units='J', siPrefix=True, dec=True, step=0.5, minStep=1e-6, limits=(0, None))
        self.powerWidget.setMeta('x', units='s', siPrefix=True, dec=True, step=0.5, minStep=1e-6, limits=(None, None))
        
        if self.dev.hasTriggerableShutter:
            #(self.shutterWidget, self.shutterPlot) = self.createChannelWidget('shutter')
            self.shutterPlot = PlotWidget(name='%s.shutter'%self.dev.name)
            self.shutterPlot.setLabel('left', text='Shutter')
            self.plotSplitter.addWidget(self.shutterPlot)
            #self.shutterPlot.hide()
        if self.dev.hasQSwitch:
            #self.qSwitchWidget, self.qSwitchPlot = self.createChannelWidget('qSwitch')
            self.qSwitchPlot = PlotWidget(name='%s.qSwitch'%self.dev.name)
            self.qSwitchPlot.setLabel('left', text='Q-Switch')
            self.plotSplitter.addWidget(self.qSwitchPlot)
            #self.qSwitchPlot.hide()
        if self.dev.hasPCell:
            #self.pCellWidget, self.pCellPlot = self.createChannelWidget('pCell')
            self.pCellPlot = PlotWidget(name='%s.pCell'%self.dev.name)
            self.pCellPlot.setLabel('left', text='Pockel Cell', units='V')
            self.plotSplitter.addWidget(self.pCellPlot)
            #self.pCellPlot.hide()
            
            
        ## catch self.powerWidget.sigDataChanged and connect it to functions that calculate and plot raw shutter and qswitch traces
        self.powerWidget.sigDataChanged.connect(self.powerCmdChanged)
        self.ui.checkPowerBtn.clicked.connect(self.dev.outputPower)
        self.dev.sigOutputPowerChanged.connect(self.laserPowerChanged)
        self.dev.sigSamplePowerChanged.connect(self.samplePowerChanged)
        
        
        self.dev.outputPower()
示例#14
0
class LaserTaskGui(DAQGenericTaskGui):
    def __init__(self, dev, task):
        DAQGenericTaskGui.__init__(self, dev, task, ownUi=False)
        
        self.ui = taskTemplate.Ui_Form()
        
        
        self.cache = {}
        
        self.layout = QtGui.QGridLayout()
        self.layout.setContentsMargins(0,0,0,0)
        self.setLayout(self.layout)
        
        self.splitter1 = QtGui.QSplitter()
        self.splitter1.setOrientation(QtCore.Qt.Horizontal)
        self.layout.addWidget(self.splitter1)
        
        self.ctrlLayout = QtGui.QVBoxLayout()
        wid1 = QtGui.QWidget()
        wid1.setLayout(self.ctrlLayout)
        self.plotSplitter = QtGui.QSplitter()
        self.plotSplitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter1.addWidget(wid1)
        self.splitter1.addWidget(self.plotSplitter)
        #wid = QtGui.QWidget()
        #hLayout = QtGui.QHBoxLayout()
        #wid.setLayout(hLayout)
        #self.ctrlLayout.addLayout(hLayout)
        wid2 = QtGui.QWidget()
        self.ui.setupUi(wid2)
        self.ctrlLayout.addWidget(wid2)

        if not self.dev.hasPowerIndicator:
            self.ui.checkPowerBtn.setEnabled(False)
            self.ui.checkPowerCheck.hide()
            self.ui.checkPowerCheck.setChecked(False)
        if not self.dev.hasTunableWavelength:
            self.ui.wavelengthWidget.hide()
        
        
        self.powerWidget, self.powerPlot = self.createChannelWidget('power', daqName=self.dev.getDAQName()[0])
        
        ## all we want is the function generator
        self.powerFnGenerator = self.powerWidget.ui.waveGeneratorWidget
        self.powerWidget.hide()
        self.ctrlLayout.addWidget(self.powerFnGenerator)
        self.powerFnGenerator.show()
        
        self.plotSplitter.addWidget(self.powerPlot)
        self.powerWidget.setMeta('y', units='W', siPrefix=True, dec=True, step=0.5, minStep=1e-3, limits=(0, None))
        self.powerWidget.setMeta('xy', units='J', siPrefix=True, dec=True, step=0.5, minStep=1e-6, limits=(0, None))
        self.powerWidget.setMeta('x', units='s', siPrefix=True, dec=True, step=0.5, minStep=1e-6, limits=(None, None))
        
        if self.dev.hasTriggerableShutter:
            #(self.shutterWidget, self.shutterPlot) = self.createChannelWidget('shutter')
            self.shutterPlot = PlotWidget(name='%s.shutter'%self.dev.name)
            self.shutterPlot.setLabel('left', text='Shutter')
            self.plotSplitter.addWidget(self.shutterPlot)
            #self.shutterPlot.hide()
        if self.dev.hasQSwitch:
            #self.qSwitchWidget, self.qSwitchPlot = self.createChannelWidget('qSwitch')
            self.qSwitchPlot = PlotWidget(name='%s.qSwitch'%self.dev.name)
            self.qSwitchPlot.setLabel('left', text='Q-Switch')
            self.plotSplitter.addWidget(self.qSwitchPlot)
            #self.qSwitchPlot.hide()
        if self.dev.hasPCell:
            #self.pCellWidget, self.pCellPlot = self.createChannelWidget('pCell')
            self.pCellPlot = PlotWidget(name='%s.pCell'%self.dev.name)
            self.pCellPlot.setLabel('left', text='Pockel Cell', units='V')
            self.plotSplitter.addWidget(self.pCellPlot)
            #self.pCellPlot.hide()
            
            
        ## catch self.powerWidget.sigDataChanged and connect it to functions that calculate and plot raw shutter and qswitch traces
        self.powerWidget.sigDataChanged.connect(self.powerCmdChanged)
        self.ui.checkPowerBtn.clicked.connect(self.dev.outputPower)
        self.dev.sigOutputPowerChanged.connect(self.laserPowerChanged)
        self.dev.sigSamplePowerChanged.connect(self.samplePowerChanged)
        
        
        self.dev.outputPower()
        
        
    def laserPowerChanged(self, power, valid):
        #samplePower = self.dev.samplePower(power)  ## we should get another signal for this later..
        #samplePower = power*self.dev.getParam('scopeTransmission')
            
        
        ## update label
        if power is None:
            self.ui.outputPowerLabel.setText("?")
        else:
            self.ui.outputPowerLabel.setText(siFormat(power, suffix='W'))
            
        if not valid:
            self.ui.outputPowerLabel.setStyleSheet("QLabel {color: #B00}")
        else:
            self.ui.outputPowerLabel.setStyleSheet("QLabel {color: #000}")
        

    
    def samplePowerChanged(self, power):
        if power is None:
            self.ui.samplePowerLabel.setText("?")
            return
        else:
            self.ui.samplePowerLabel.setText(siFormat(power, suffix='W'))

        if self.dev.hasPCell:
            raise Exception('stub')
        else:
            ## adjust length of pulse to correct for new power
            if self.ui.adjustLengthCheck.isChecked():
                en = {}
                for param in self.powerWidget.ui.waveGeneratorWidget.stimParams:
                    en[param.name()] = param['sum']
                self.powerWidget.setMeta('y', value=power, readonly=True)
                for param in self.powerWidget.ui.waveGeneratorWidget.stimParams:
                    param['sum'] = en[param.name()]
            else:
                self.powerWidget.setMeta('y', value=power, readonly=True)
    
    def saveState(self):
        """Return a dictionary representing the current state of the widget."""
        state = {}
        state['daqState'] = DAQGenericTaskGui.saveState(self)
        return state
        
    def restoreState(self, state):
        """Restore the state of the widget from a dictionary previously generated using saveState"""
        return DAQGenericTaskGui.restoreState(self, state['daqState'])
    
    def describe(self, params=None):
        state = self.saveState()
        ps = state['daqState']['channels']['power']
        desc = {'mode': 'power', 'command': ps['waveGeneratorWidget']}
        return desc
    
    def prepareTaskStart(self):
        ## check power before starting task.
        if self.ui.checkPowerCheck.isChecked():
            power, valid = self.dev.outputPower()  ## request current power from laser
            if power is None:
                raise HelpfulException("The current laser power for '%s' is unknown." % self.dev.name)
            if not valid:
                powerStr = siFormat(power, suffix='W')
                raise HelpfulException("The current laser power for '%s' (%s) is outside the expected range." % (self.dev.name, powerStr))
    
    def generateTask(self, params=None):
        """Return a cmd dictionary suitable for passing to LaserTask."""
        
        ## Params looks like: {'amp': 7} where 'amp' is the name of a sequence parameter, and 7 is the 7th value in the list of 'amp'
        for k,v in params.items():
            if k.startswith('power.'):
                del params[k]
                params[k[6:]] = v
        rate = self.powerWidget.rate
        wave = self.powerWidget.getSingleWave(params)
        rawCmds = self.getChannelCmds(wave, rate)
        #rawCmds = self.cache.get(id(wave), self.dev.getChannelCmds({'powerWaveform':wave}, rate)) ## returns {'shutter': array(...), 'qSwitch':array(..), 'pCell':array(...)}
        
        ### structure task in DAQGeneric-compatible way
        cmd = {}
        for k in rawCmds:
            cmd[k] = {}
            cmd[k]['command'] = rawCmds[k]
            
        cmd['powerWaveform'] = wave  ## just to allow the device task to store this data
        cmd['ignorePowerWaveform'] = True
        return  cmd
    
    def getChannelCmds(self, powerWave, rate):
        key = id(powerWave)
        if key in self.cache:
            rawCmds = self.cache[key]
        else:
            rawCmds = self.dev.getChannelCmds({'powerWaveform':powerWave}, rate) ## returns {'shutter': array(...), 'qSwitch':array(..), 'pCell':array(...)}
            self.cache[key] = rawCmds
        return rawCmds
        
    
    def powerCmdChanged(self):
        self.clearRawPlots()
        self.cache = {}
        rate = self.powerWidget.rate
        
        #### calculate, cache and display sequence waves for shutter/qSwitch/pCell
        params = {}
        ps = self.powerWidget.listSequence()
        for k in ps:
            params[k] = range(len(ps[k]))
        ## get power waveforms
        waves = []
        runSequence(lambda p: waves.append(self.powerWidget.getSingleWave(p)), params, params.keys()) ## appends waveforms for the entire parameter space to waves
        
        for w in waves:
            if w is not None:
                ## need to translate w into raw traces, plot them, and cache them (using id(w) as a key)
                rawWaves = self.getChannelCmds(w, rate)
                #rawWaves = self.dev.getChannelCmds({'powerWaveform':w}, rate) ## calculate raw waveforms for shutter/qSwitch/pCell from powerWaveform
                #self.cache[id(w)] = rawWaves ## cache the calculated waveforms
                self.plotRawCurves(rawWaves, color=QtGui.QColor(100, 100, 100)) ## plot the raw waveform in it's appropriate plot in grey
        
        ## calculate (or pull from cache) and display single-mode wave in red
        single = self.powerWidget.getSingleWave()
        if single is not None:
            #rawSingle = self.cache.get(id(single), self.dev.getChannelCmds({'powerWaveform':single}, rate))
            rawSingle = self.getChannelCmds(single, rate)
            self.plotRawCurves(rawSingle, color=QtGui.QColor(200, 100, 100))
    
                      
    def plotRawCurves(self, data, color=QtGui.QColor(100, 100, 100)):
        if 'shutter' in data:
            self.shutterPlot.plot(y=data['shutter'], x=self.powerWidget.timeVals, pen=QtGui.QPen(color))
        if 'qSwitch' in data:
            self.qSwitchPlot.plot(y=data['qSwitch'], x=self.powerWidget.timeVals, pen=QtGui.QPen(color))
        if 'pCell' in data:
            self.pCellPlot.plot(y=data['pCell'], x=self.powerWidget.timeVals, pen=QtGui.QPen(color))
      
    def clearRawPlots(self):
        for p in ['shutterPlot', 'qSwitchPlot', 'pCellPlot']:
            if hasattr(self, p):
                getattr(self, p).clear()
                
    def quit(self):
        self.dev.lastResult = None
        DAQGenericTaskGui.quit(self)
示例#15
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(267, 343)
        self.verticalLayout_2 = QtGui.QVBoxLayout(Form)
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.splitter_3 = QtGui.QSplitter(Form)
        self.splitter_3.setOrientation(QtCore.Qt.Vertical)
        self.splitter_3.setObjectName(_fromUtf8("splitter_3"))
        self.splitter_2 = QtGui.QSplitter(self.splitter_3)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName(_fromUtf8("splitter_2"))
        self.layoutWidget = QtGui.QWidget(self.splitter_2)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.groupBox_2 = QtGui.QGroupBox(self.layoutWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
        self.groupBox_2.setSizePolicy(sizePolicy)
        self.groupBox_2.setTitle(_fromUtf8(""))
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_2.setMargin(0)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.vcPulseCheck = QtGui.QCheckBox(self.groupBox_2)
        self.vcPulseCheck.setChecked(True)
        self.vcPulseCheck.setObjectName(_fromUtf8("vcPulseCheck"))
        self.gridLayout_2.addWidget(self.vcPulseCheck, 2, 1, 1, 1)
        self.vcHoldCheck = QtGui.QCheckBox(self.groupBox_2)
        self.vcHoldCheck.setObjectName(_fromUtf8("vcHoldCheck"))
        self.gridLayout_2.addWidget(self.vcHoldCheck, 3, 1, 1, 1)
        self.icPulseCheck = QtGui.QCheckBox(self.groupBox_2)
        self.icPulseCheck.setChecked(True)
        self.icPulseCheck.setObjectName(_fromUtf8("icPulseCheck"))
        self.gridLayout_2.addWidget(self.icPulseCheck, 4, 1, 1, 1)
        self.icHoldCheck = QtGui.QCheckBox(self.groupBox_2)
        self.icHoldCheck.setObjectName(_fromUtf8("icHoldCheck"))
        self.gridLayout_2.addWidget(self.icHoldCheck, 6, 1, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout_2.addItem(spacerItem, 7, 1, 1, 1)
        self.label = QtGui.QLabel(self.groupBox_2)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout_2.addWidget(self.label, 10, 0, 1, 2)
        self.label_3 = QtGui.QLabel(self.groupBox_2)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_2.addWidget(self.label_3, 9, 0, 1, 2)
        self.label_4 = QtGui.QLabel(self.groupBox_2)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout_2.addWidget(self.label_4, 8, 0, 1, 2)
        self.icModeRadio = QtGui.QRadioButton(self.groupBox_2)
        self.icModeRadio.setObjectName(_fromUtf8("icModeRadio"))
        self.gridLayout_2.addWidget(self.icModeRadio, 4, 0, 1, 1)
        self.vcModeRadio = QtGui.QRadioButton(self.groupBox_2)
        self.vcModeRadio.setChecked(True)
        self.vcModeRadio.setObjectName(_fromUtf8("vcModeRadio"))
        self.gridLayout_2.addWidget(self.vcModeRadio, 2, 0, 1, 1)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.startBtn = QtGui.QPushButton(self.groupBox_2)
        self.startBtn.setCheckable(True)
        self.startBtn.setObjectName(_fromUtf8("startBtn"))
        self.horizontalLayout.addWidget(self.startBtn)
        self.recordBtn = QtGui.QPushButton(self.groupBox_2)
        self.recordBtn.setCheckable(True)
        self.recordBtn.setObjectName(_fromUtf8("recordBtn"))
        self.horizontalLayout.addWidget(self.recordBtn)
        self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 3)
        self.icPulseSpin = SpinBox(self.groupBox_2)
        self.icPulseSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.icPulseSpin.setObjectName(_fromUtf8("icPulseSpin"))
        self.gridLayout_2.addWidget(self.icPulseSpin, 4, 2, 1, 1)
        self.pulseTimeSpin = SpinBox(self.groupBox_2)
        self.pulseTimeSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.pulseTimeSpin.setSingleStep(1.0)
        self.pulseTimeSpin.setObjectName(_fromUtf8("pulseTimeSpin"))
        self.gridLayout_2.addWidget(self.pulseTimeSpin, 9, 2, 1, 1)
        self.delayTimeSpin = SpinBox(self.groupBox_2)
        self.delayTimeSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.delayTimeSpin.setMinimum(1.0)
        self.delayTimeSpin.setMaximum(10000.0)
        self.delayTimeSpin.setSingleStep(1.0)
        self.delayTimeSpin.setObjectName(_fromUtf8("delayTimeSpin"))
        self.gridLayout_2.addWidget(self.delayTimeSpin, 8, 2, 1, 1)
        self.vcPulseSpin = SpinBox(self.groupBox_2)
        self.vcPulseSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.vcPulseSpin.setObjectName(_fromUtf8("vcPulseSpin"))
        self.gridLayout_2.addWidget(self.vcPulseSpin, 2, 2, 1, 1)
        self.icHoldSpin = SpinBox(self.groupBox_2)
        self.icHoldSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.icHoldSpin.setObjectName(_fromUtf8("icHoldSpin"))
        self.gridLayout_2.addWidget(self.icHoldSpin, 5, 2, 2, 1)
        self.cycleTimeSpin = SpinBox(self.groupBox_2)
        self.cycleTimeSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.cycleTimeSpin.setSingleStep(1.0)
        self.cycleTimeSpin.setProperty("value", 0.2)
        self.cycleTimeSpin.setObjectName(_fromUtf8("cycleTimeSpin"))
        self.gridLayout_2.addWidget(self.cycleTimeSpin, 10, 2, 1, 1)
        self.vcHoldSpin = SpinBox(self.groupBox_2)
        self.vcHoldSpin.setMaximumSize(QtCore.QSize(70, 16777215))
        self.vcHoldSpin.setObjectName(_fromUtf8("vcHoldSpin"))
        self.gridLayout_2.addWidget(self.vcHoldSpin, 3, 2, 1, 1)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setContentsMargins(0, -1, -1, -1)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.bathModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.bathModeBtn.setObjectName(_fromUtf8("bathModeBtn"))
        self.horizontalLayout_2.addWidget(self.bathModeBtn)
        self.patchModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.patchModeBtn.setObjectName(_fromUtf8("patchModeBtn"))
        self.horizontalLayout_2.addWidget(self.patchModeBtn)
        self.cellModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.cellModeBtn.setObjectName(_fromUtf8("cellModeBtn"))
        self.horizontalLayout_2.addWidget(self.cellModeBtn)
        self.monitorModeBtn = QtGui.QToolButton(self.groupBox_2)
        self.monitorModeBtn.setObjectName(_fromUtf8("monitorModeBtn"))
        self.horizontalLayout_2.addWidget(self.monitorModeBtn)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 3)
        self.label_2 = QtGui.QLabel(self.groupBox_2)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout_2.addWidget(self.label_2, 11, 0, 1, 1)
        self.averageSpin = QtGui.QSpinBox(self.groupBox_2)
        self.averageSpin.setMinimum(1)
        self.averageSpin.setMaximum(100)
        self.averageSpin.setProperty("value", 1)
        self.averageSpin.setObjectName(_fromUtf8("averageSpin"))
        self.gridLayout_2.addWidget(self.averageSpin, 11, 2, 1, 1)
        self.verticalLayout.addWidget(self.groupBox_2)
        self.groupBox = QtGui.QGroupBox(self.layoutWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setTitle(_fromUtf8(""))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.formLayout = QtGui.QFormLayout(self.groupBox)
        self.formLayout.setMargin(0)
        self.formLayout.setSpacing(0)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.resetBtn = QtGui.QToolButton(self.groupBox)
        self.resetBtn.setObjectName(_fromUtf8("resetBtn"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.resetBtn)
        self.inputResistanceCheck = QtGui.QCheckBox(self.groupBox)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.inputResistanceCheck.setFont(font)
        self.inputResistanceCheck.setChecked(True)
        self.inputResistanceCheck.setObjectName(_fromUtf8("inputResistanceCheck"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.inputResistanceCheck)
        self.inputResistanceLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.inputResistanceLabel.setFont(font)
        self.inputResistanceLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.inputResistanceLabel.setObjectName(_fromUtf8("inputResistanceLabel"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.inputResistanceLabel)
        self.accessResistanceCheck = QtGui.QCheckBox(self.groupBox)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.accessResistanceCheck.setFont(font)
        self.accessResistanceCheck.setObjectName(_fromUtf8("accessResistanceCheck"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.accessResistanceCheck)
        self.accessResistanceLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.accessResistanceLabel.setFont(font)
        self.accessResistanceLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.accessResistanceLabel.setObjectName(_fromUtf8("accessResistanceLabel"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.accessResistanceLabel)
        self.restingPotentialCheck = QtGui.QCheckBox(self.groupBox)
        font = QtGui.QFont()
        font.setPointSize(11)
        self.restingPotentialCheck.setFont(font)
        self.restingPotentialCheck.setObjectName(_fromUtf8("restingPotentialCheck"))
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.restingPotentialCheck)
        self.restingPotentialLabel = QtGui.QLabel(self.groupBox)
        self.restingPotentialLabel.setMinimumSize(QtCore.QSize(140, 0))
        font = QtGui.QFont()
        font.setPointSize(11)
        font.setBold(True)
        font.setWeight(75)
        self.restingPotentialLabel.setFont(font)
        self.restingPotentialLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.restingPotentialLabel.setObjectName(_fromUtf8("restingPotentialLabel"))
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.restingPotentialLabel)
        self.restingCurrentCheck = QtGui.QCheckBox(self.groupBox)
        self.restingCurrentCheck.setObjectName(_fromUtf8("restingCurrentCheck"))
        self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.restingCurrentCheck)
        self.restingCurrentLabel = QtGui.QLabel(self.groupBox)
        self.restingCurrentLabel.setMinimumSize(QtCore.QSize(120, 0))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.restingCurrentLabel.setFont(font)
        self.restingCurrentLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.restingCurrentLabel.setObjectName(_fromUtf8("restingCurrentLabel"))
        self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.restingCurrentLabel)
        self.capacitanceCheck = QtGui.QCheckBox(self.groupBox)
        self.capacitanceCheck.setObjectName(_fromUtf8("capacitanceCheck"))
        self.formLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.capacitanceCheck)
        self.capacitanceLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.capacitanceLabel.setFont(font)
        self.capacitanceLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.capacitanceLabel.setObjectName(_fromUtf8("capacitanceLabel"))
        self.formLayout.setWidget(5, QtGui.QFormLayout.FieldRole, self.capacitanceLabel)
        self.fitErrorCheck = QtGui.QCheckBox(self.groupBox)
        self.fitErrorCheck.setObjectName(_fromUtf8("fitErrorCheck"))
        self.formLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.fitErrorCheck)
        self.fitErrorLabel = QtGui.QLabel(self.groupBox)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.fitErrorLabel.setFont(font)
        self.fitErrorLabel.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.fitErrorLabel.setObjectName(_fromUtf8("fitErrorLabel"))
        self.formLayout.setWidget(6, QtGui.QFormLayout.FieldRole, self.fitErrorLabel)
        self.drawFitCheck = QtGui.QCheckBox(self.groupBox)
        self.drawFitCheck.setChecked(True)
        self.drawFitCheck.setObjectName(_fromUtf8("drawFitCheck"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.drawFitCheck)
        self.verticalLayout.addWidget(self.groupBox)
        self.splitter = QtGui.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.patchPlot = PlotWidget(self.splitter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.patchPlot.sizePolicy().hasHeightForWidth())
        self.patchPlot.setSizePolicy(sizePolicy)
        self.patchPlot.setObjectName(_fromUtf8("patchPlot"))
        self.commandPlot = PlotWidget(self.splitter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.commandPlot.sizePolicy().hasHeightForWidth())
        self.commandPlot.setSizePolicy(sizePolicy)
        self.commandPlot.setObjectName(_fromUtf8("commandPlot"))
        self.layoutWidget1 = QtGui.QWidget(self.splitter_3)
        self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
        self.plotLayout = QtGui.QVBoxLayout(self.layoutWidget1)
        self.plotLayout.setSpacing(0)
        self.plotLayout.setMargin(0)
        self.plotLayout.setObjectName(_fromUtf8("plotLayout"))
        self.verticalLayout_2.addWidget(self.splitter_3)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#16
0
    def __init__(self, dev, taskRunner):
        DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False)

        self.ui = taskTemplate.Ui_Form()

        self.cache = {}

        self.layout = QtGui.QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        self.splitter1 = QtGui.QSplitter()
        self.splitter1.setOrientation(QtCore.Qt.Horizontal)
        self.layout.addWidget(self.splitter1)

        self.ctrlLayout = QtGui.QVBoxLayout()
        wid1 = QtGui.QWidget()
        wid1.setLayout(self.ctrlLayout)
        self.plotSplitter = QtGui.QSplitter()
        self.plotSplitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter1.addWidget(wid1)
        self.splitter1.addWidget(self.plotSplitter)
        #wid = QtGui.QWidget()
        #hLayout = QtGui.QHBoxLayout()
        #wid.setLayout(hLayout)
        #self.ctrlLayout.addLayout(hLayout)
        wid2 = QtGui.QWidget()
        self.ui.setupUi(wid2)
        self.ctrlLayout.addWidget(wid2)

        if not self.dev.hasPowerIndicator:
            self.ui.checkPowerBtn.setEnabled(False)
            self.ui.checkPowerCheck.hide()
            self.ui.checkPowerCheck.setChecked(False)
        if not self.dev.hasTunableWavelength:
            self.ui.wavelengthWidget.hide()

        self.powerWidget, self.powerPlot = self.createChannelWidget(
            'power', daqName=self.dev.getDAQName()[0])

        ## all we want is the function generator
        self.powerFnGenerator = self.powerWidget.ui.waveGeneratorWidget
        self.powerWidget.hide()
        self.ctrlLayout.addWidget(self.powerFnGenerator)
        self.powerFnGenerator.show()

        self.plotSplitter.addWidget(self.powerPlot)
        self.powerWidget.setMeta('y',
                                 units='W',
                                 siPrefix=True,
                                 dec=True,
                                 step=0.5,
                                 minStep=1e-3,
                                 limits=(0, None))
        self.powerWidget.setMeta('xy',
                                 units='J',
                                 siPrefix=True,
                                 dec=True,
                                 step=0.5,
                                 minStep=1e-6,
                                 limits=(0, None))
        self.powerWidget.setMeta('x',
                                 units='s',
                                 siPrefix=True,
                                 dec=True,
                                 step=0.5,
                                 minStep=1e-6,
                                 limits=(None, None))

        if self.dev.hasTriggerableShutter:
            #(self.shutterWidget, self.shutterPlot) = self.createChannelWidget('shutter')
            self.shutterPlot = PlotWidget(name='%s.shutter' % self.dev.name)
            self.shutterPlot.setLabel('left', text='Shutter')
            self.plotSplitter.addWidget(self.shutterPlot)
            #self.shutterPlot.hide()
        if self.dev.hasQSwitch:
            #self.qSwitchWidget, self.qSwitchPlot = self.createChannelWidget('qSwitch')
            self.qSwitchPlot = PlotWidget(name='%s.qSwitch' % self.dev.name)
            self.qSwitchPlot.setLabel('left', text='Q-Switch')
            self.plotSplitter.addWidget(self.qSwitchPlot)
            #self.qSwitchPlot.hide()
        if self.dev.hasPCell:
            #self.pCellWidget, self.pCellPlot = self.createChannelWidget('pCell')
            self.pCellPlot = PlotWidget(name='%s.pCell' % self.dev.name)
            self.pCellPlot.setLabel('left', text='Pockel Cell', units='V')
            self.plotSplitter.addWidget(self.pCellPlot)
            #self.pCellPlot.hide()

        ## catch self.powerWidget.sigDataChanged and connect it to functions that calculate and plot raw shutter and qswitch traces
        self.powerWidget.sigDataChanged.connect(self.powerCmdChanged)
        self.ui.checkPowerBtn.clicked.connect(self.dev.outputPower)
        self.dev.sigOutputPowerChanged.connect(self.laserPowerChanged)
        self.dev.sigSamplePowerChanged.connect(self.samplePowerChanged)

        self.dev.outputPower()
示例#17
0
class LaserTaskGui(DAQGenericTaskGui):
    def __init__(self, dev, taskRunner):
        DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False)

        self.ui = taskTemplate.Ui_Form()

        self.cache = {}

        self.layout = QtGui.QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        self.splitter1 = QtGui.QSplitter()
        self.splitter1.setOrientation(QtCore.Qt.Horizontal)
        self.layout.addWidget(self.splitter1)

        self.ctrlLayout = QtGui.QVBoxLayout()
        wid1 = QtGui.QWidget()
        wid1.setLayout(self.ctrlLayout)
        self.plotSplitter = QtGui.QSplitter()
        self.plotSplitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter1.addWidget(wid1)
        self.splitter1.addWidget(self.plotSplitter)
        #wid = QtGui.QWidget()
        #hLayout = QtGui.QHBoxLayout()
        #wid.setLayout(hLayout)
        #self.ctrlLayout.addLayout(hLayout)
        wid2 = QtGui.QWidget()
        self.ui.setupUi(wid2)
        self.ctrlLayout.addWidget(wid2)

        if not self.dev.hasPowerIndicator:
            self.ui.checkPowerBtn.setEnabled(False)
            self.ui.checkPowerCheck.hide()
            self.ui.checkPowerCheck.setChecked(False)
        if not self.dev.hasTunableWavelength:
            self.ui.wavelengthWidget.hide()

        self.powerWidget, self.powerPlot = self.createChannelWidget(
            'power', daqName=self.dev.getDAQName()[0])

        ## all we want is the function generator
        self.powerFnGenerator = self.powerWidget.ui.waveGeneratorWidget
        self.powerWidget.hide()
        self.ctrlLayout.addWidget(self.powerFnGenerator)
        self.powerFnGenerator.show()

        self.plotSplitter.addWidget(self.powerPlot)
        self.powerWidget.setMeta('y',
                                 units='W',
                                 siPrefix=True,
                                 dec=True,
                                 step=0.5,
                                 minStep=1e-3,
                                 limits=(0, None))
        self.powerWidget.setMeta('xy',
                                 units='J',
                                 siPrefix=True,
                                 dec=True,
                                 step=0.5,
                                 minStep=1e-6,
                                 limits=(0, None))
        self.powerWidget.setMeta('x',
                                 units='s',
                                 siPrefix=True,
                                 dec=True,
                                 step=0.5,
                                 minStep=1e-6,
                                 limits=(None, None))

        if self.dev.hasTriggerableShutter:
            #(self.shutterWidget, self.shutterPlot) = self.createChannelWidget('shutter')
            self.shutterPlot = PlotWidget(name='%s.shutter' % self.dev.name)
            self.shutterPlot.setLabel('left', text='Shutter')
            self.plotSplitter.addWidget(self.shutterPlot)
            #self.shutterPlot.hide()
        if self.dev.hasQSwitch:
            #self.qSwitchWidget, self.qSwitchPlot = self.createChannelWidget('qSwitch')
            self.qSwitchPlot = PlotWidget(name='%s.qSwitch' % self.dev.name)
            self.qSwitchPlot.setLabel('left', text='Q-Switch')
            self.plotSplitter.addWidget(self.qSwitchPlot)
            #self.qSwitchPlot.hide()
        if self.dev.hasPCell:
            #self.pCellWidget, self.pCellPlot = self.createChannelWidget('pCell')
            self.pCellPlot = PlotWidget(name='%s.pCell' % self.dev.name)
            self.pCellPlot.setLabel('left', text='Pockel Cell', units='V')
            self.plotSplitter.addWidget(self.pCellPlot)
            #self.pCellPlot.hide()

        ## catch self.powerWidget.sigDataChanged and connect it to functions that calculate and plot raw shutter and qswitch traces
        self.powerWidget.sigDataChanged.connect(self.powerCmdChanged)
        self.ui.checkPowerBtn.clicked.connect(self.dev.outputPower)
        self.dev.sigOutputPowerChanged.connect(self.laserPowerChanged)
        self.dev.sigSamplePowerChanged.connect(self.samplePowerChanged)

        self.dev.outputPower()

    def laserPowerChanged(self, power, valid):
        #samplePower = self.dev.samplePower(power)  ## we should get another signal for this later..
        #samplePower = power*self.dev.getParam('scopeTransmission')

        ## update label
        if power is None:
            self.ui.outputPowerLabel.setText("?")
        else:
            self.ui.outputPowerLabel.setText(siFormat(power, suffix='W'))

        if not valid:
            self.ui.outputPowerLabel.setStyleSheet("QLabel {color: #B00}")
        else:
            self.ui.outputPowerLabel.setStyleSheet("QLabel {color: #000}")

    def samplePowerChanged(self, power):
        if power is None:
            self.ui.samplePowerLabel.setText("?")
            return
        else:
            self.ui.samplePowerLabel.setText(siFormat(power, suffix='W'))

        if self.dev.hasPCell:
            raise Exception('stub')
        else:
            ## adjust length of pulse to correct for new power
            if self.ui.adjustLengthCheck.isChecked():
                en = {}
                for param in self.powerWidget.ui.waveGeneratorWidget.stimParams:
                    en[param.name()] = param['sum']
                self.powerWidget.setMeta('y', value=power, readonly=True)
                for param in self.powerWidget.ui.waveGeneratorWidget.stimParams:
                    param['sum'] = en[param.name()]
            else:
                self.powerWidget.setMeta('y', value=power, readonly=True)

    def saveState(self):
        """Return a dictionary representing the current state of the widget."""
        state = {}
        state['daqState'] = DAQGenericTaskGui.saveState(self)
        return state

    def restoreState(self, state):
        """Restore the state of the widget from a dictionary previously generated using saveState"""
        return DAQGenericTaskGui.restoreState(self, state['daqState'])

    def describe(self, params=None):
        state = self.saveState()
        ps = state['daqState']['channels']['power']
        desc = {'mode': 'power', 'command': ps['waveGeneratorWidget']}
        return desc

    def prepareTaskStart(self):
        ## check power before starting task.
        if self.ui.checkPowerCheck.isChecked():
            power = self.dev.outputPower()  ## request current power from laser
            valid = self.dev.checkPowerValidity(power)
            if power is None:
                raise HelpfulException(
                    "The current laser power for '%s' is unknown." %
                    self.dev.name)
            if not valid:
                powerStr = siFormat(power, suffix='W')
                raise HelpfulException(
                    "The current laser power for '%s' (%s) is outside the expected range."
                    % (self.dev.name(), powerStr))

    def generateTask(self, params=None):
        """Return a cmd dictionary suitable for passing to LaserTask."""

        ## Params looks like: {'amp': 7} where 'amp' is the name of a sequence parameter, and 7 is the 7th value in the list of 'amp'
        for k, v in params.items():
            if k.startswith('power.'):
                del params[k]
                params[k[6:]] = v
        rate = self.powerWidget.rate
        wave = self.powerWidget.getSingleWave(params)
        rawCmds = self.getChannelCmds(wave, rate)
        #rawCmds = self.cache.get(id(wave), self.dev.getChannelCmds({'powerWaveform':wave}, rate)) ## returns {'shutter': array(...), 'qSwitch':array(..), 'pCell':array(...)}

        ### structure task in DAQGeneric-compatible way
        cmd = {}
        for k in rawCmds:
            cmd[k] = {}
            cmd[k]['command'] = rawCmds[k]

        cmd['powerWaveform'] = wave  ## just to allow the device task to store this data
        cmd['ignorePowerWaveform'] = True
        return cmd

    def getChannelCmds(self, powerWave, rate):
        key = id(powerWave)
        if key in self.cache:
            rawCmds = self.cache[key]
        else:
            rawCmds = self.dev.getChannelCmds(
                {'powerWaveform': powerWave}, rate
            )  ## returns {'shutter': array(...), 'qSwitch':array(..), 'pCell':array(...)}
            self.cache[key] = rawCmds
        return rawCmds

    def powerCmdChanged(self):
        self.clearRawPlots()
        self.cache = {}
        rate = self.powerWidget.rate

        #### calculate, cache and display sequence waves for shutter/qSwitch/pCell
        params = {}
        ps = self.powerWidget.listSequence()
        for k in ps:
            params[k] = range(len(ps[k]))
        ## get power waveforms
        waves = []
        runSequence(
            lambda p: waves.append(self.powerWidget.getSingleWave(p)), params,
            params.keys(
            ))  ## appends waveforms for the entire parameter space to waves

        for w in waves:
            if w is not None:
                ## need to translate w into raw traces, plot them, and cache them (using id(w) as a key)
                rawWaves = self.getChannelCmds(w, rate)
                #rawWaves = self.dev.getChannelCmds({'powerWaveform':w}, rate) ## calculate raw waveforms for shutter/qSwitch/pCell from powerWaveform
                #self.cache[id(w)] = rawWaves ## cache the calculated waveforms
                self.plotRawCurves(
                    rawWaves, color=QtGui.QColor(100, 100, 100)
                )  ## plot the raw waveform in it's appropriate plot in grey

        ## calculate (or pull from cache) and display single-mode wave in red
        single = self.powerWidget.getSingleWave()
        if single is not None:
            #rawSingle = self.cache.get(id(single), self.dev.getChannelCmds({'powerWaveform':single}, rate))
            rawSingle = self.getChannelCmds(single, rate)
            self.plotRawCurves(rawSingle, color=QtGui.QColor(200, 100, 100))

    def plotRawCurves(self, data, color=QtGui.QColor(100, 100, 100)):
        if 'shutter' in data:
            self.shutterPlot.plot(y=data['shutter'],
                                  x=self.powerWidget.timeVals,
                                  pen=QtGui.QPen(color))
        if 'qSwitch' in data:
            self.qSwitchPlot.plot(y=data['qSwitch'],
                                  x=self.powerWidget.timeVals,
                                  pen=QtGui.QPen(color))
        if 'pCell' in data:
            self.pCellPlot.plot(y=data['pCell'],
                                x=self.powerWidget.timeVals,
                                pen=QtGui.QPen(color))

    def clearRawPlots(self):
        for p in ['shutterPlot', 'qSwitchPlot', 'pCellPlot']:
            if hasattr(self, p):
                getattr(self, p).clear()

    def quit(self):
        self.dev.lastResult = None
        DAQGenericTaskGui.quit(self)
示例#18
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(302, 110)
        Form.setAutoFillBackground(True)
        self.verticalLayout_3 = QtGui.QVBoxLayout(Form)
        self.verticalLayout_3.setSpacing(0)
        self.verticalLayout_3.setMargin(0)
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.splitter_2 = QtGui.QSplitter(Form)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName(_fromUtf8("splitter_2"))
        self.layoutWidget = QtGui.QWidget(self.splitter_2)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.gridLayout_2 = QtGui.QGridLayout()
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.frame_2 = QtGui.QFrame(self.layoutWidget)
        self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
        self.frame_2.setObjectName(_fromUtf8("frame_2"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.frame_2)
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setMargin(0)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.icModeRadio = QtGui.QRadioButton(self.frame_2)
        self.icModeRadio.setObjectName(_fromUtf8("icModeRadio"))
        self.horizontalLayout_2.addWidget(self.icModeRadio)
        self.i0ModeRadio = QtGui.QRadioButton(self.frame_2)
        self.i0ModeRadio.setChecked(True)
        self.i0ModeRadio.setObjectName(_fromUtf8("i0ModeRadio"))
        self.horizontalLayout_2.addWidget(self.i0ModeRadio)
        self.vcModeRadio = QtGui.QRadioButton(self.frame_2)
        self.vcModeRadio.setObjectName(_fromUtf8("vcModeRadio"))
        self.horizontalLayout_2.addWidget(self.vcModeRadio)
        self.horizontalLayout_6 = QtGui.QHBoxLayout()
        self.horizontalLayout_6.setSpacing(0)
        self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
        self.holdingCheck = QtGui.QCheckBox(self.frame_2)
        self.holdingCheck.setObjectName(_fromUtf8("holdingCheck"))
        self.horizontalLayout_6.addWidget(self.holdingCheck)
        self.holdingSpin = SpinBox(self.frame_2)
        self.holdingSpin.setEnabled(False)
        self.holdingSpin.setMinimum(-1000000.0)
        self.holdingSpin.setMaximum(1000000.0)
        self.holdingSpin.setObjectName(_fromUtf8("holdingSpin"))
        self.horizontalLayout_6.addWidget(self.holdingSpin)
        self.horizontalLayout_2.addLayout(self.horizontalLayout_6)
        self.gridLayout_2.addWidget(self.frame_2, 0, 0, 1, 2)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.primarySignalCheck = QtGui.QCheckBox(self.layoutWidget)
        self.primarySignalCheck.setObjectName(_fromUtf8("primarySignalCheck"))
        self.gridLayout.addWidget(self.primarySignalCheck, 0, 0, 1, 1)
        self.secondarySignalCheck = QtGui.QCheckBox(self.layoutWidget)
        self.secondarySignalCheck.setObjectName(_fromUtf8("secondarySignalCheck"))
        self.gridLayout.addWidget(self.secondarySignalCheck, 1, 0, 1, 1)
        self.primarySignalCombo = QtGui.QComboBox(self.layoutWidget)
        self.primarySignalCombo.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(2)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.primarySignalCombo.sizePolicy().hasHeightForWidth())
        self.primarySignalCombo.setSizePolicy(sizePolicy)
        self.primarySignalCombo.setMinimumSize(QtCore.QSize(40, 0))
        self.primarySignalCombo.setObjectName(_fromUtf8("primarySignalCombo"))
        self.primarySignalCombo.addItem(_fromUtf8(""))
        self.gridLayout.addWidget(self.primarySignalCombo, 0, 1, 1, 1)
        self.secondarySignalCombo = QtGui.QComboBox(self.layoutWidget)
        self.secondarySignalCombo.setEnabled(False)
        self.secondarySignalCombo.setMinimumSize(QtCore.QSize(40, 0))
        self.secondarySignalCombo.setObjectName(_fromUtf8("secondarySignalCombo"))
        self.secondarySignalCombo.addItem(_fromUtf8(""))
        self.gridLayout.addWidget(self.secondarySignalCombo, 1, 1, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 2, 1)
        self.horizontalLayout_7 = QtGui.QHBoxLayout()
        self.horizontalLayout_7.setSpacing(0)
        self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
        self.secondaryGainCheck = QtGui.QCheckBox(self.layoutWidget)
        self.secondaryGainCheck.setObjectName(_fromUtf8("secondaryGainCheck"))
        self.horizontalLayout_7.addWidget(self.secondaryGainCheck)
        self.secondaryGainSpin = QtGui.QSpinBox(self.layoutWidget)
        self.secondaryGainSpin.setEnabled(False)
        self.secondaryGainSpin.setMaximum(100000)
        self.secondaryGainSpin.setObjectName(_fromUtf8("secondaryGainSpin"))
        self.horizontalLayout_7.addWidget(self.secondaryGainSpin)
        self.gridLayout_2.addLayout(self.horizontalLayout_7, 2, 1, 1, 1)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setSpacing(0)
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.primaryGainCheck = QtGui.QCheckBox(self.layoutWidget)
        self.primaryGainCheck.setObjectName(_fromUtf8("primaryGainCheck"))
        self.horizontalLayout_5.addWidget(self.primaryGainCheck)
        self.primaryGainSpin = QtGui.QSpinBox(self.layoutWidget)
        self.primaryGainSpin.setEnabled(False)
        self.primaryGainSpin.setMaximum(100000)
        self.primaryGainSpin.setObjectName(_fromUtf8("primaryGainSpin"))
        self.horizontalLayout_5.addWidget(self.primaryGainSpin)
        self.gridLayout_2.addLayout(self.horizontalLayout_5, 1, 1, 1, 1)
        self.verticalLayout_2.addLayout(self.gridLayout_2)
        self.frame = QtGui.QFrame(self.layoutWidget)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.verticalLayout = QtGui.QVBoxLayout(self.frame)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.waveGeneratorLabel = QtGui.QLabel(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.waveGeneratorLabel.sizePolicy().hasHeightForWidth())
        self.waveGeneratorLabel.setSizePolicy(sizePolicy)
        self.waveGeneratorLabel.setObjectName(_fromUtf8("waveGeneratorLabel"))
        self.verticalLayout.addWidget(self.waveGeneratorLabel)
        self.waveGeneratorWidget = StimGenerator(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.waveGeneratorWidget.sizePolicy().hasHeightForWidth())
        self.waveGeneratorWidget.setSizePolicy(sizePolicy)
        self.waveGeneratorWidget.setObjectName(_fromUtf8("waveGeneratorWidget"))
        self.verticalLayout.addWidget(self.waveGeneratorWidget)
        self.verticalLayout_2.addWidget(self.frame)
        self.splitter = QtGui.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.topPlotWidget = PlotWidget(self.splitter)
        self.topPlotWidget.setObjectName(_fromUtf8("topPlotWidget"))
        self.bottomPlotWidget = PlotWidget(self.splitter)
        self.bottomPlotWidget.setObjectName(_fromUtf8("bottomPlotWidget"))
        self.verticalLayout_3.addWidget(self.splitter_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#19
0
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(330, 97)
        Form.setAutoFillBackground(True)
        self.verticalLayout_3 = QtGui.QVBoxLayout(Form)
        self.verticalLayout_3.setSpacing(0)
        self.verticalLayout_3.setMargin(0)
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.splitter_2 = QtGui.QSplitter(Form)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName(_fromUtf8("splitter_2"))
        self.layoutWidget = QtGui.QWidget(self.splitter_2)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.gridLayout_2 = QtGui.QGridLayout()
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.frame_2 = QtGui.QFrame(self.layoutWidget)
        self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
        self.frame_2.setObjectName(_fromUtf8("frame_2"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.frame_2)
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setMargin(0)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.vcModeRadio = QtGui.QRadioButton(self.frame_2)
        self.vcModeRadio.setObjectName(_fromUtf8("vcModeRadio"))
        self.horizontalLayout_2.addWidget(self.vcModeRadio)
        self.i0ModeRadio = QtGui.QRadioButton(self.frame_2)
        self.i0ModeRadio.setChecked(True)
        self.i0ModeRadio.setObjectName(_fromUtf8("i0ModeRadio"))
        self.horizontalLayout_2.addWidget(self.i0ModeRadio)
        self.icModeRadio = QtGui.QRadioButton(self.frame_2)
        self.icModeRadio.setObjectName(_fromUtf8("icModeRadio"))
        self.horizontalLayout_2.addWidget(self.icModeRadio)
        self.horizontalLayout_6 = QtGui.QHBoxLayout()
        self.horizontalLayout_6.setSpacing(0)
        self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
        self.holdingCheck = QtGui.QCheckBox(self.frame_2)
        self.holdingCheck.setObjectName(_fromUtf8("holdingCheck"))
        self.horizontalLayout_6.addWidget(self.holdingCheck)
        self.holdingSpin = SpinBox(self.frame_2)
        self.holdingSpin.setEnabled(False)
        self.holdingSpin.setMinimum(-1000000.0)
        self.holdingSpin.setMaximum(1000000.0)
        self.holdingSpin.setObjectName(_fromUtf8("holdingSpin"))
        self.horizontalLayout_6.addWidget(self.holdingSpin)
        self.horizontalLayout_2.addLayout(self.horizontalLayout_6)
        self.gridLayout_2.addWidget(self.frame_2, 0, 0, 1, 2)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.primarySignalCheck = QtGui.QCheckBox(self.layoutWidget)
        self.primarySignalCheck.setObjectName(_fromUtf8("primarySignalCheck"))
        self.gridLayout.addWidget(self.primarySignalCheck, 0, 0, 1, 1)
        self.secondarySignalCheck = QtGui.QCheckBox(self.layoutWidget)
        self.secondarySignalCheck.setObjectName(_fromUtf8("secondarySignalCheck"))
        self.gridLayout.addWidget(self.secondarySignalCheck, 1, 0, 1, 1)
        self.primarySignalCombo = QtGui.QComboBox(self.layoutWidget)
        self.primarySignalCombo.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(2)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.primarySignalCombo.sizePolicy().hasHeightForWidth())
        self.primarySignalCombo.setSizePolicy(sizePolicy)
        self.primarySignalCombo.setMinimumSize(QtCore.QSize(40, 0))
        self.primarySignalCombo.setObjectName(_fromUtf8("primarySignalCombo"))
        self.primarySignalCombo.addItem(_fromUtf8(""))
        self.gridLayout.addWidget(self.primarySignalCombo, 0, 1, 1, 1)
        self.secondarySignalCombo = QtGui.QComboBox(self.layoutWidget)
        self.secondarySignalCombo.setEnabled(False)
        self.secondarySignalCombo.setMinimumSize(QtCore.QSize(40, 0))
        self.secondarySignalCombo.setObjectName(_fromUtf8("secondarySignalCombo"))
        self.secondarySignalCombo.addItem(_fromUtf8(""))
        self.gridLayout.addWidget(self.secondarySignalCombo, 1, 1, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 2, 1)
        self.horizontalLayout_7 = QtGui.QHBoxLayout()
        self.horizontalLayout_7.setSpacing(0)
        self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
        self.secondaryGainCheck = QtGui.QCheckBox(self.layoutWidget)
        self.secondaryGainCheck.setObjectName(_fromUtf8("secondaryGainCheck"))
        self.horizontalLayout_7.addWidget(self.secondaryGainCheck)
        self.secondaryGainSpin = QtGui.QSpinBox(self.layoutWidget)
        self.secondaryGainSpin.setEnabled(False)
        self.secondaryGainSpin.setMaximum(100000)
        self.secondaryGainSpin.setObjectName(_fromUtf8("secondaryGainSpin"))
        self.horizontalLayout_7.addWidget(self.secondaryGainSpin)
        self.gridLayout_2.addLayout(self.horizontalLayout_7, 2, 1, 1, 1)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setSpacing(0)
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.primaryGainCheck = QtGui.QCheckBox(self.layoutWidget)
        self.primaryGainCheck.setObjectName(_fromUtf8("primaryGainCheck"))
        self.horizontalLayout_5.addWidget(self.primaryGainCheck)
        self.primaryGainSpin = QtGui.QSpinBox(self.layoutWidget)
        self.primaryGainSpin.setEnabled(False)
        self.primaryGainSpin.setMaximum(100000)
        self.primaryGainSpin.setObjectName(_fromUtf8("primaryGainSpin"))
        self.horizontalLayout_5.addWidget(self.primaryGainSpin)
        self.gridLayout_2.addLayout(self.horizontalLayout_5, 1, 1, 1, 1)
        self.verticalLayout_2.addLayout(self.gridLayout_2)
        self.frame = QtGui.QFrame(self.layoutWidget)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.verticalLayout = QtGui.QVBoxLayout(self.frame)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.waveGeneratorLabel = QtGui.QLabel(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.waveGeneratorLabel.sizePolicy().hasHeightForWidth())
        self.waveGeneratorLabel.setSizePolicy(sizePolicy)
        self.waveGeneratorLabel.setObjectName(_fromUtf8("waveGeneratorLabel"))
        self.verticalLayout.addWidget(self.waveGeneratorLabel)
        self.waveGeneratorWidget = StimGenerator(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.waveGeneratorWidget.sizePolicy().hasHeightForWidth())
        self.waveGeneratorWidget.setSizePolicy(sizePolicy)
        self.waveGeneratorWidget.setObjectName(_fromUtf8("waveGeneratorWidget"))
        self.verticalLayout.addWidget(self.waveGeneratorWidget)
        self.verticalLayout_2.addWidget(self.frame)
        self.splitter = QtGui.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.topPlotWidget = PlotWidget(self.splitter)
        self.topPlotWidget.setObjectName(_fromUtf8("topPlotWidget"))
        self.bottomPlotWidget = PlotWidget(self.splitter)
        self.bottomPlotWidget.setObjectName(_fromUtf8("bottomPlotWidget"))
        self.verticalLayout_3.addWidget(self.splitter_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
示例#20
0
    def __init__(self, dm, config):
        clampName = config['clampDev']
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle(clampName)
        self.startTime = None
        self.redrawCommand = 1

        self.analysisItems = {
            'inputResistance': u'Ω',
            'accessResistance': u'Ω',
            'capacitance': 'F',
            'restingPotential': 'V',
            'restingCurrent': 'A',
            'fitError': ''
        }

        self.params = {
            'mode': 'vc',
            'rate': config.get('sampleRate', 100000),
            'downsample': config.get('downsample', 3),
            'cycleTime': .2,
            'recordTime': 0.1,
            'delayTime': 0.03,
            'pulseTime': 0.05,
            'icPulse': -30e-12,
            'vcPulse': -10e-3,
            'icHolding': 0,
            'vcHolding': -65e-3,
            'icHoldingEnabled': False,
            'icPulseEnabled': True,
            'vcHoldingEnabled': False,
            'vcPulseEnabled': True,
            'drawFit': True,
            'average': 1,
        }

        self.paramLock = Mutex(QtCore.QMutex.Recursive)

        self.manager = dm
        self.clampName = clampName
        self.thread = PatchThread(self)
        self.cw = QtGui.QWidget()
        self.setCentralWidget(self.cw)
        self.ui = Ui_Form()
        self.ui.setupUi(self.cw)
        #self.logBtn = LogButton("Log")
        #self.statusBar().addPermanentWidget(self.logBtn)
        self.setStatusBar(StatusBar())

        self.stateFile = os.path.join('modules', self.clampName + '_ui.cfg')
        uiState = Manager.getManager().readConfigFile(self.stateFile)
        if 'geometry' in uiState:
            geom = QtCore.QRect(*uiState['geometry'])
            self.setGeometry(geom)
        if 'window' in uiState:
            ws = QtCore.QByteArray.fromPercentEncoding(uiState['window'])
            self.restoreState(ws)

        self.ui.splitter_2.setSizes([self.width() / 4, self.width() * 3. / 4.])
        self.ui.splitter.setStretchFactor(0, 30)
        self.ui.splitter.setStretchFactor(1, 10)

        self.plots = {}
        for k in self.analysisItems:
            p = PlotWidget()
            p.setLabel('left', text=k, units=self.analysisItems[k])
            self.ui.plotLayout.addWidget(p)
            self.plots[k] = p
        irp = self.plots['inputResistance']
        irp.setLogMode(y=True, x=False)
        irp.setYRange(6, 11)

        self.ui.icPulseSpin.setOpts(dec=True,
                                    step=1,
                                    minStep=1e-12,
                                    bounds=[None, None],
                                    siPrefix=True,
                                    suffix='A')
        self.ui.vcPulseSpin.setOpts(dec=True,
                                    step=1,
                                    minStep=1e-3,
                                    bounds=[None, None],
                                    siPrefix=True,
                                    suffix='V')
        self.ui.icHoldSpin.setOpts(dec=True,
                                   step=1,
                                   minStep=1e-12,
                                   bounds=[None, None],
                                   siPrefix=True,
                                   suffix='A')
        self.ui.vcHoldSpin.setOpts(dec=True,
                                   step=1,
                                   minStep=1e-3,
                                   bounds=[None, None],
                                   siPrefix=True,
                                   suffix='V')
        self.ui.cycleTimeSpin.setOpts(dec=True,
                                      step=1,
                                      minStep=1e-6,
                                      bounds=[0, None],
                                      siPrefix=True,
                                      suffix='s')
        self.ui.pulseTimeSpin.setOpts(dec=True,
                                      step=1,
                                      minStep=1e-6,
                                      bounds=[0, 1.],
                                      siPrefix=True,
                                      suffix='s')
        self.ui.delayTimeSpin.setOpts(dec=True,
                                      step=1,
                                      minStep=1e-6,
                                      bounds=[0, 1.],
                                      siPrefix=True,
                                      suffix='s')

        self.stateGroup = WidgetGroup([
            (self.ui.icPulseSpin, 'icPulse'),
            (self.ui.vcPulseSpin, 'vcPulse'),
            (self.ui.icHoldSpin, 'icHolding'),
            (self.ui.vcHoldSpin, 'vcHolding'),
            (self.ui.icPulseCheck, 'icPulseEnabled'),
            (self.ui.vcPulseCheck, 'vcPulseEnabled'),
            (self.ui.icHoldCheck, 'icHoldingEnabled'),
            (self.ui.vcHoldCheck, 'vcHoldingEnabled'),
            (self.ui.cycleTimeSpin, 'cycleTime'),
            (self.ui.pulseTimeSpin, 'pulseTime'),
            (self.ui.delayTimeSpin, 'delayTime'),
            (self.ui.drawFitCheck, 'drawFit'),
            (self.ui.averageSpin, 'average'),
        ])
        self.stateGroup.setState(self.params)

        self.ui.patchPlot.setLabel('left', text='Primary', units='A')
        self.patchCurve = self.ui.patchPlot.plot(
            pen=QtGui.QPen(QtGui.QColor(200, 200, 200)))
        self.patchFitCurve = self.ui.patchPlot.plot(
            pen=QtGui.QPen(QtGui.QColor(0, 100, 200)))
        self.ui.commandPlot.setLabel('left', text='Command', units='V')
        self.commandCurve = self.ui.commandPlot.plot(
            pen=QtGui.QPen(QtGui.QColor(200, 200, 200)))

        self.ui.startBtn.clicked.connect(self.startClicked)
        self.ui.recordBtn.clicked.connect(self.recordClicked)
        self.ui.bathModeBtn.clicked.connect(self.bathMode)
        self.ui.patchModeBtn.clicked.connect(self.patchMode)
        self.ui.cellModeBtn.clicked.connect(self.cellMode)
        self.ui.monitorModeBtn.clicked.connect(self.monitorMode)
        self.ui.resetBtn.clicked.connect(self.resetClicked)
        self.thread.finished.connect(self.threadStopped)
        self.thread.sigNewFrame.connect(self.handleNewFrame)
        self.ui.vcModeRadio.toggled.connect(self.updateParams)
        self.stateGroup.sigChanged.connect(self.updateParams)

        ## Configure analysis plots, curves, and data arrays
        self.analysisCurves = {}
        self.analysisData = {'time': []}
        for n in self.analysisItems:
            w = getattr(self.ui, n + 'Check')
            w.clicked.connect(self.showPlots)
            p = self.plots[n]
            self.analysisCurves[n] = p.plot(
                pen=QtGui.QPen(QtGui.QColor(200, 200, 200)))
            for suf in ['', 'Std']:
                self.analysisData[n + suf] = []
        self.showPlots()
        self.updateParams()
        self.show()
        self.bathMode()
示例#21
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(208, 349)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.rateAverageSpin = SpinBox(Form)
        self.rateAverageSpin.setObjectName(_fromUtf8("rateAverageSpin"))
        self.gridLayout.addWidget(self.rateAverageSpin, 4, 1, 1, 1)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 4, 0, 1, 1)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.poisMaxCheck = QtGui.QCheckBox(self.groupBox_2)
        self.poisMaxCheck.setObjectName(_fromUtf8("poisMaxCheck"))
        self.gridLayout_3.addWidget(self.poisMaxCheck, 2, 0, 1, 1)
        self.poisMaxAmpCheck = QtGui.QCheckBox(self.groupBox_2)
        self.poisMaxAmpCheck.setObjectName(_fromUtf8("poisMaxAmpCheck"))
        self.gridLayout_3.addWidget(self.poisMaxAmpCheck, 3, 0, 1, 1)
        self.chargeTransferCheck = QtGui.QCheckBox(self.groupBox_2)
        self.chargeTransferCheck.setObjectName(_fromUtf8("chargeTransferCheck"))
        self.gridLayout_3.addWidget(self.chargeTransferCheck, 0, 0, 1, 1)
        self.eventCountCheck = QtGui.QCheckBox(self.groupBox_2)
        self.eventCountCheck.setObjectName(_fromUtf8("eventCountCheck"))
        self.gridLayout_3.addWidget(self.eventCountCheck, 1, 0, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 3, 0, 1, 2)
        self.groupBox = QtGui.QGroupBox(Form)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.excitatoryRadio = QtGui.QRadioButton(self.groupBox)
        self.excitatoryRadio.setObjectName(_fromUtf8("excitatoryRadio"))
        self.gridLayout_2.addWidget(self.excitatoryRadio, 0, 0, 1, 1)
        self.fitErrorSpin = SpinBox(self.groupBox)
        self.fitErrorSpin.setObjectName(_fromUtf8("fitErrorSpin"))
        self.gridLayout_2.addWidget(self.fitErrorSpin, 1, 1, 1, 1)
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
        self.inhibitoryRadio = QtGui.QRadioButton(self.groupBox)
        self.inhibitoryRadio.setObjectName(_fromUtf8("inhibitoryRadio"))
        self.gridLayout_2.addWidget(self.inhibitoryRadio, 0, 1, 1, 1)
        self.gridLayout.addWidget(self.groupBox, 2, 0, 1, 2)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.label_3 = QtGui.QLabel(self.groupBox_3)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1)
        self.thresholdSpin = SpinBox(self.groupBox_3)
        self.thresholdSpin.setObjectName(_fromUtf8("thresholdSpin"))
        self.gridLayout_4.addWidget(self.thresholdSpin, 0, 1, 1, 1)
        self.detectionHistogram = PlotWidget(self.groupBox_3)
        self.detectionHistogram.setObjectName(_fromUtf8("detectionHistogram"))
        self.gridLayout_4.addWidget(self.detectionHistogram, 1, 0, 1, 2)
        self.gridLayout.addWidget(self.groupBox_3, 5, 0, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        Form.setWindowTitle(_translate("Form", "Form", None))
        self.label.setText(_translate("Form", "Rate Average Window", None))
        self.groupBox_2.setTitle(_translate("Form", "Detection Methods", None))
        self.poisMaxCheck.setText(_translate("Form", "Poisson max probability", None))
        self.poisMaxAmpCheck.setText(_translate("Form", "Poisson max + amplitude", None))
        self.chargeTransferCheck.setText(_translate("Form", "Charge transfer z-score", None))
        self.eventCountCheck.setText(_translate("Form", "Event Count", None))
        self.groupBox.setTitle(_translate("Form", "Event Selection", None))
        self.excitatoryRadio.setText(_translate("Form", "Excitatory", None))
        self.label_2.setText(_translate("Form", "Fit Error Limit", None))
        self.inhibitoryRadio.setText(_translate("Form", "Inhibitory", None))
        self.label_3.setText(_translate("Form", "Detection Threshold", None))
示例#22
0
文件: PatchWindow.py 项目: ablot/acq4
    def __init__(self, dm, clampName, modes):
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle(clampName)
        self.startTime = None
        self.redrawCommand = 1
        
        self.analysisItems = {
            'inputResistance': u'Ω', 
            'accessResistance': u'Ω',
            'capacitance': 'F',
            'restingPotential': 'V', 
            'restingCurrent': 'A', 
            'fitError': ''
        }
        
        self.params = modes.pop('default')
        self.modes = modes
        self.stylesheet = {}
        
        self.paramLock = Mutex(QtCore.QMutex.Recursive)
        
        self.manager = dm
        self.clampName = clampName
        self.thread = PatchThread(self)
        self.cw = QtGui.QWidget()
        self.setCentralWidget(self.cw)
        self.ui = Ui_Form()
        self.ui.setupUi(self.cw)
        self.setStatusBar(StatusBar())
        
        # Create one button for each configured mode
        row = None
        self.modeRows = []
        rowLen = 0
        def mkModeCallback(name):
            return lambda: self.setMode(name)
        
        for modeName, mode in modes.items():
            if modeName == 'default':
                continue
            if row is None:
                row = QtGui.QWidget()
                layout = QtGui.QHBoxLayout()
                row.setLayout(layout)
                self.ui.modeLayout.addWidget(row)
                self.modeRows.append(row)
            btn = QtGui.QPushButton(modeName)
            layout.addWidget(btn)
            rowLen += btn.sizeHint().width()
            if rowLen > 200:
                row = None
                rowLen = 0
            btn.clicked.connect(mkModeCallback(modeName))

        self.stateFile = os.path.join('modules', self.clampName + '_ui.cfg')
        uiState = Manager.getManager().readConfigFile(self.stateFile)
        if 'geometry' in uiState:
            geom = QtCore.QRect(*uiState['geometry'])
            self.setGeometry(geom)
        if 'window' in uiState:
            ws = QtCore.QByteArray.fromPercentEncoding(uiState['window'])
            self.restoreState(ws)
            
        self.ui.splitter_2.setSizes([self.width()/4, self.width()*3./4.])


        self.plots = {}
        for k in self.analysisItems:
            p = PlotWidget()
            p.setLabel('left', text=k, units=self.analysisItems[k])
            self.ui.plotLayout.addWidget(p)
            self.plots[k] = p
        
        self.ui.icPulseSpin.setOpts(dec=True, step=1, minStep=1e-12, bounds=[None,None], siPrefix=True, suffix='A')
        self.ui.vcPulseSpin.setOpts(dec=True, step=1, minStep=1e-3, bounds=[None,None], siPrefix=True, suffix='V')
        self.ui.icHoldSpin.setOpts(dec=True, step=1, minStep=1e-12, bounds=[None,None], siPrefix=True, suffix='A')
        self.ui.vcHoldSpin.setOpts(dec=True, step=1, minStep=1e-3, bounds=[None,None], siPrefix=True, suffix='V')
        self.ui.cycleTimeSpin.setOpts(dec=True, step=1, minStep=1e-6, bounds=[0,None], siPrefix=True, suffix='s')
        self.ui.pulseTimeSpin.setOpts(dec=True, step=1, minStep=1e-6, bounds=[0,1.], siPrefix=True, suffix='s')
        self.ui.delayTimeSpin.setOpts(dec=True, step=1, minStep=1e-6, bounds=[0,1.], siPrefix=True, suffix='s')
        
        
        self.stateGroup = WidgetGroup([
            (self.ui.icPulseSpin, 'icPulse'),
            (self.ui.vcPulseSpin, 'vcPulse'),
            (self.ui.icHoldSpin, 'icHolding'),
            (self.ui.vcHoldSpin, 'vcHolding'),
            (self.ui.icPulseCheck, 'icPulseEnabled'),
            (self.ui.vcPulseCheck, 'vcPulseEnabled'),
            (self.ui.icHoldCheck, 'icHoldingEnabled'),
            (self.ui.vcHoldCheck, 'vcHoldingEnabled'),
            (self.ui.cycleTimeSpin, 'cycleTime'),
            (self.ui.pulseTimeSpin, 'pulseTime'),
            (self.ui.delayTimeSpin, 'delayTime'),
            (self.ui.drawFitCheck, 'drawFit'),
            (self.ui.averageSpin, 'average'),
        ])
        self.stateGroup.setState(self.params)
        
        self.ui.patchPlot.setLabel('left', text='Primary', units='A')
        self.patchCurve = self.ui.patchPlot.plot(pen=QtGui.QPen(QtGui.QColor(200,200,200)))
        self.patchFitCurve = self.ui.patchPlot.plot(pen=QtGui.QPen(QtGui.QColor(0,100,200)))
        self.ui.commandPlot.setLabel('left', text='Command', units='V')
        self.commandCurve = self.ui.commandPlot.plot(pen=QtGui.QPen(QtGui.QColor(200,200,200)))
        
        self.ui.startBtn.clicked.connect(self.startClicked)
        self.ui.recordBtn.clicked.connect(self.recordClicked)
        self.ui.resetBtn.clicked.connect(self.resetClicked)
        self.thread.finished.connect(self.threadStopped)
        self.thread.sigNewFrame.connect(self.handleNewFrame)
        self.ui.vcModeRadio.toggled.connect(self.updateParams)
        self.stateGroup.sigChanged.connect(self.updateParams)
                
        ## Configure analysis plots, curves, and data arrays
        self.analysisCurves = {}
        self.analysisData = {'time': []}
        for n in self.analysisItems:
            w = getattr(self.ui, n+'Check')
            w.clicked.connect(self.showPlots)
            p = self.plots[n]
            self.analysisCurves[n] = p.plot(pen=QtGui.QPen(QtGui.QColor(200,200,200)))
            for suf in ['', 'Std']:
                self.analysisData[n+suf] = []
        self.showPlots()
        self.updateParams()
        self.show()
示例#23
0
文件: PatchWindow.py 项目: hiuwo/acq4
    def __init__(self, dm, clampName):
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle(clampName)
        self.startTime = None
        self.redrawCommand = 1
        
        self.analysisItems = {
            'inputResistance': u'Ω', 
            'accessResistance': u'Ω',
            'capacitance': 'F',
            'restingPotential': 'V', 
            'restingCurrent': 'A', 
            'fitError': ''
        }
        
        self.params = {
            'mode': 'vc',
            'rate': 400000,
            'downsample': 10,
            'cycleTime': .2,
            'recordTime': 0.1,
            'delayTime': 0.03,
            'pulseTime': 0.05,
            'icPulse': -30e-12,
            'vcPulse': -10e-3,
            'icHolding': 0,
            'vcHolding': -65e-3,
            'icHoldingEnabled': False,
            'icPulseEnabled': True,
            'vcHoldingEnabled': False,
            'vcPulseEnabled': True,
            'drawFit': True,
            'average': 1,
        }
        
        
        self.paramLock = Mutex(QtCore.QMutex.Recursive)

        self.manager = dm
        self.clampName = clampName
        self.thread = PatchThread(self)
        self.cw = QtGui.QWidget()
        self.setCentralWidget(self.cw)
        self.ui = Ui_Form()
        self.ui.setupUi(self.cw)
        #self.logBtn = LogButton("Log")
        #self.statusBar().addPermanentWidget(self.logBtn)
        self.setStatusBar(StatusBar())

        self.stateFile = os.path.join('modules', self.clampName + '_ui.cfg')
        uiState = Manager.getManager().readConfigFile(self.stateFile)
        if 'geometry' in uiState:
            geom = QtCore.QRect(*uiState['geometry'])
            self.setGeometry(geom)
        if 'window' in uiState:
            ws = QtCore.QByteArray.fromPercentEncoding(uiState['window'])
            self.restoreState(ws)
            
        self.ui.splitter_2.setSizes([self.width()/4, self.width()*3./4.])


        self.plots = {}
        for k in self.analysisItems:
            p = PlotWidget()
            p.setLabel('left', text=k, units=self.analysisItems[k])
            self.ui.plotLayout.addWidget(p)
            self.plots[k] = p
        #irp = self.plots['inputResistance']
        #irp.setManualYScale()
        #irp.setYLog(True)
        #irp.setYRange(1e6, 1e11)
            
        
        self.ui.icPulseSpin.setOpts(dec=True, step=1, minStep=1e-12, bounds=[None,None], siPrefix=True, suffix='A')
        self.ui.vcPulseSpin.setOpts(dec=True, step=1, minStep=1e-3, bounds=[None,None], siPrefix=True, suffix='V')
        self.ui.icHoldSpin.setOpts(dec=True, step=1, minStep=1e-12, bounds=[None,None], siPrefix=True, suffix='A')
        self.ui.vcHoldSpin.setOpts(dec=True, step=1, minStep=1e-3, bounds=[None,None], siPrefix=True, suffix='V')
        self.ui.cycleTimeSpin.setOpts(dec=True, step=1, minStep=1e-6, bounds=[0,None], siPrefix=True, suffix='s')
        self.ui.pulseTimeSpin.setOpts(dec=True, step=1, minStep=1e-6, bounds=[0,1.], siPrefix=True, suffix='s')
        self.ui.delayTimeSpin.setOpts(dec=True, step=1, minStep=1e-6, bounds=[0,1.], siPrefix=True, suffix='s')
        
        
        self.stateGroup = WidgetGroup([
            (self.ui.icPulseSpin, 'icPulse'),
            (self.ui.vcPulseSpin, 'vcPulse'),
            (self.ui.icHoldSpin, 'icHolding'),
            (self.ui.vcHoldSpin, 'vcHolding'),
            (self.ui.icPulseCheck, 'icPulseEnabled'),
            (self.ui.vcPulseCheck, 'vcPulseEnabled'),
            (self.ui.icHoldCheck, 'icHoldingEnabled'),
            (self.ui.vcHoldCheck, 'vcHoldingEnabled'),
            (self.ui.cycleTimeSpin, 'cycleTime'),
            (self.ui.pulseTimeSpin, 'pulseTime'),
            (self.ui.delayTimeSpin, 'delayTime'),
            (self.ui.drawFitCheck, 'drawFit'),
            (self.ui.averageSpin, 'average'),
        ])
        self.stateGroup.setState(self.params)
        
        self.ui.patchPlot.setLabel('left', text='Primary', units='A')
        self.patchCurve = self.ui.patchPlot.plot(pen=QtGui.QPen(QtGui.QColor(200, 200, 200)))
        self.patchFitCurve = self.ui.patchPlot.plot(pen=QtGui.QPen(QtGui.QColor(0, 100, 200)))
        self.ui.commandPlot.setLabel('left', text='Command', units='V')
        self.commandCurve = self.ui.commandPlot.plot(pen=QtGui.QPen(QtGui.QColor(200, 200, 200)))
        
        self.ui.startBtn.clicked.connect(self.startClicked)
        self.ui.recordBtn.clicked.connect(self.recordClicked)
        self.ui.bathModeBtn.clicked.connect(self.bathMode)
        self.ui.patchModeBtn.clicked.connect(self.patchMode)
        self.ui.cellModeBtn.clicked.connect(self.cellMode)
        self.ui.monitorModeBtn.clicked.connect(self.monitorMode)
        self.ui.resetBtn.clicked.connect(self.resetClicked)
        self.thread.finished.connect(self.threadStopped)
        self.thread.sigNewFrame.connect(self.handleNewFrame)
        self.ui.vcModeRadio.toggled.connect(self.updateParams)
        self.stateGroup.sigChanged.connect(self.updateParams)
                
        ## Configure analysis plots, curves, and data arrays
        self.analysisCurves = {}
        self.analysisData = {'time': []}
        for n in self.analysisItems:
            w = getattr(self.ui, n+'Check')
            w.clicked.connect(self.showPlots)
            p = self.plots[n]
            self.analysisCurves[n] = p.plot(pen=QtGui.QPen(QtGui.QColor(200, 200, 200)))
            for suf in ['', 'Std']:
                self.analysisData[n+suf] = []
        self.showPlots()
        self.updateParams()
        self.show()
        self.bathMode()
示例#24
0
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(703, 428)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(4)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.gridLayout_4 = QtGui.QGridLayout(Form)
        self.gridLayout_4.setMargin(3)
        self.gridLayout_4.setHorizontalSpacing(9)
        self.gridLayout_4.setVerticalSpacing(2)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.simulateShutterCheck = QtGui.QCheckBox(Form)
        self.simulateShutterCheck.setObjectName(_fromUtf8("simulateShutterCheck"))
        self.gridLayout.addWidget(self.simulateShutterCheck, 2, 0, 1, 2)
        self.groupBox = QtGui.QGroupBox(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setMinimumSize(QtCore.QSize(190, 210))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_3 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_3.setMargin(3)
        self.gridLayout_3.setSpacing(3)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.tdPlotWidget = PlotWidget(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tdPlotWidget.sizePolicy().hasHeightForWidth())
        self.tdPlotWidget.setSizePolicy(sizePolicy)
        self.tdPlotWidget.setObjectName(_fromUtf8("tdPlotWidget"))
        self.gridLayout_3.addWidget(self.tdPlotWidget, 0, 0, 1, 2)
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout_3.addWidget(self.label_3, 1, 0, 1, 1)
        self.minTimeSpin = SpinBox(self.groupBox)
        self.minTimeSpin.setSuffix(_fromUtf8(""))
        self.minTimeSpin.setDecimals(2)
        self.minTimeSpin.setMaximum(1000000.0)
        self.minTimeSpin.setObjectName(_fromUtf8("minTimeSpin"))
        self.gridLayout_3.addWidget(self.minTimeSpin, 1, 1, 1, 1)
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.gridLayout_3.addWidget(self.label_4, 2, 0, 1, 1)
        self.minDistSpin = SpinBox(self.groupBox)
        self.minDistSpin.setSuffix(_fromUtf8(""))
        self.minDistSpin.setMaximum(1000000.0)
        self.minDistSpin.setObjectName(_fromUtf8("minDistSpin"))
        self.gridLayout_3.addWidget(self.minDistSpin, 2, 1, 1, 1)
        self.recomputeBtn = QtGui.QPushButton(self.groupBox)
        self.recomputeBtn.setObjectName(_fromUtf8("recomputeBtn"))
        self.gridLayout_3.addWidget(self.recomputeBtn, 5, 0, 1, 2)
        self.timeLabel = QtGui.QLabel(self.groupBox)
        self.timeLabel.setObjectName(_fromUtf8("timeLabel"))
        self.gridLayout_3.addWidget(self.timeLabel, 4, 0, 1, 2)
        self.gridLayout.addWidget(self.groupBox, 5, 0, 1, 2)
        self.groupBox_2 = QtGui.QGroupBox(Form)
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2)
        self.gridLayout_2.setMargin(3)
        self.gridLayout_2.setSpacing(0)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.sizeFromCalibrationRadio = QtGui.QRadioButton(self.groupBox_2)
        self.sizeFromCalibrationRadio.setChecked(True)
        self.sizeFromCalibrationRadio.setObjectName(_fromUtf8("sizeFromCalibrationRadio"))
        self.gridLayout_2.addWidget(self.sizeFromCalibrationRadio, 0, 0, 1, 2)
        self.sizeCustomRadio = QtGui.QRadioButton(self.groupBox_2)
        self.sizeCustomRadio.setObjectName(_fromUtf8("sizeCustomRadio"))
        self.gridLayout_2.addWidget(self.sizeCustomRadio, 1, 0, 1, 1)
        self.sizeSpin = SpinBox(self.groupBox_2)
        self.sizeSpin.setSuffix(_fromUtf8(""))
        self.sizeSpin.setMinimum(0.0)
        self.sizeSpin.setMaximum(100000.0)
        self.sizeSpin.setSingleStep(1e-06)
        self.sizeSpin.setProperty("value", 0.0)
        self.sizeSpin.setObjectName(_fromUtf8("sizeSpin"))
        self.gridLayout_2.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.gridLayout.addWidget(self.groupBox_2, 4, 0, 1, 2)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 6, 0, 1, 1)
        self.laserCombo = InterfaceCombo(Form)
        self.laserCombo.setObjectName(_fromUtf8("laserCombo"))
        self.gridLayout.addWidget(self.laserCombo, 1, 1, 1, 1)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
        self.cameraCombo = InterfaceCombo(Form)
        self.cameraCombo.setObjectName(_fromUtf8("cameraCombo"))
        self.gridLayout.addWidget(self.cameraCombo, 0, 1, 1, 1)
        self.loadConfigBtn = QtGui.QPushButton(Form)
        self.loadConfigBtn.setObjectName(_fromUtf8("loadConfigBtn"))
        self.gridLayout.addWidget(self.loadConfigBtn, 7, 0, 1, 2)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem1, 3, 0, 1, 1)
        self.gridLayout_4.addLayout(self.gridLayout, 0, 0, 2, 1)
        self.groupBox_3 = QtGui.QGroupBox(Form)
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.gridLayout_5 = QtGui.QGridLayout(self.groupBox_3)
        self.gridLayout_5.setMargin(5)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.itemTree = ParameterTree(self.groupBox_3)
        self.itemTree.setObjectName(_fromUtf8("itemTree"))
        self.itemTree.headerItem().setText(0, _fromUtf8("1"))
        self.itemTree.header().setVisible(False)
        self.gridLayout_5.addWidget(self.itemTree, 0, 0, 1, 1)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.hideCheck = QtGui.QCheckBox(self.groupBox_3)
        self.hideCheck.setEnabled(True)
        self.hideCheck.setChecked(False)
        self.hideCheck.setObjectName(_fromUtf8("hideCheck"))
        self.horizontalLayout_5.addWidget(self.hideCheck)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_5.addItem(spacerItem2)
        self.hideMarkerBtn = QtGui.QPushButton(self.groupBox_3)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.hideMarkerBtn.sizePolicy().hasHeightForWidth())
        self.hideMarkerBtn.setSizePolicy(sizePolicy)
        self.hideMarkerBtn.setObjectName(_fromUtf8("hideMarkerBtn"))
        self.horizontalLayout_5.addWidget(self.hideMarkerBtn)
        self.gridLayout_5.addLayout(self.horizontalLayout_5, 1, 0, 1, 1)
        self.gridLayout_4.addWidget(self.groupBox_3, 0, 1, 2, 1)
        self.groupBox_4 = QtGui.QGroupBox(Form)
        self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
        self.gridLayout_6 = QtGui.QGridLayout(self.groupBox_4)
        self.gridLayout_6.setMargin(5)
        self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6"))
        self.gridLayout_9 = QtGui.QGridLayout()
        self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9"))
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.gridLayout_9.addItem(spacerItem3, 0, 0, 1, 1)
        self.previewBtn = QtGui.QPushButton(self.groupBox_4)
        self.previewBtn.setEnabled(False)
        self.previewBtn.setObjectName(_fromUtf8("previewBtn"))
        self.gridLayout_9.addWidget(self.previewBtn, 0, 1, 1, 1)
        self.gridLayout_6.addLayout(self.gridLayout_9, 1, 0, 1, 1)
        self.programTree = ParameterTree(self.groupBox_4)
        self.programTree.setObjectName(_fromUtf8("programTree"))
        self.programTree.headerItem().setText(0, _fromUtf8("1"))
        self.programTree.header().setVisible(False)
        self.gridLayout_6.addWidget(self.programTree, 0, 0, 1, 1)
        self.gridLayout_4.addWidget(self.groupBox_4, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        Form.setWindowTitle(_translate("Form", "Form", None))
        self.simulateShutterCheck.setText(_translate("Form", "Simulate Shutter", None))
        self.groupBox.setTitle(_translate("Form", "Spot Sequence", None))
        self.label_3.setText(_translate("Form", "Minimum time", None))
        self.minTimeSpin.setToolTip(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">When stimulating a sequence of points, this is the minimum amount of time that must pass before stimulating the same spot a second time. Points farther away will require smaller delays. Points farther than the minimum distance (specified below) will require no delay.</span></p></body></html>", None))
        self.label_4.setText(_translate("Form", "Minimum distance", None))
        self.minDistSpin.setToolTip(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">When stimulating a sequence of points, this is the minimum distance between two spots such that no time delay is required between stimulating them. Points closer than this distance will require some delay, which is determined in part by the minimum time specified above.</span></p></body></html>", None))
        self.recomputeBtn.setText(_translate("Form", "Recompute Order", None))
        self.timeLabel.setText(_translate("Form", "Total Time:", None))
        self.groupBox_2.setTitle(_translate("Form", "Spot Display Size", None))
        self.sizeFromCalibrationRadio.setToolTip(_translate("Form", "Causes target spots to be displayed at the size determined by the calibration file. Does not affect how data is collected.", None))
        self.sizeFromCalibrationRadio.setText(_translate("Form", "Use size from calibration", None))
        self.sizeCustomRadio.setToolTip(_translate("Form", "Lets the user change the display size of target spots. Does not change the way data is collected.", None))
        self.sizeCustomRadio.setText(_translate("Form", "Use custom size:", None))
        self.sizeSpin.setToolTip(_translate("Form", "Specifies the display size of the target spots. Does not change the way data is collected.", None))
        self.label.setText(_translate("Form", "Camera Module:", None))
        self.laserCombo.setToolTip(_translate("Form", "Selects the laser to be used.", None))
        self.label_2.setText(_translate("Form", "Laser Device:", None))
        self.cameraCombo.setToolTip(_translate("Form", "Selects the camera module to use with the scanner. This, along with the laser device, determines which calibration files will be used.", None))
        self.loadConfigBtn.setText(_translate("Form", "Load Last Config", None))
        self.groupBox_3.setTitle(_translate("Form", "Position Control Items", None))
        self.hideCheck.setToolTip(_translate("Form", "Hide all items from view.", None))
        self.hideCheck.setText(_translate("Form", "Hide items", None))
        self.hideMarkerBtn.setText(_translate("Form", "Hide Spot Marker", None))
        self.groupBox_4.setTitle(_translate("Form", "Program Controls", None))
        self.previewBtn.setText(_translate("Form", "Preview", None))