Esempio n. 1
0
 def __init__(self, dev, taskRunner, ivModes):
     DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False)
     
     self.ivModes = ivModes
     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.splitter2 = QtGui.QSplitter()
     self.splitter2.setOrientation(QtCore.Qt.Vertical)
     self.modeCombo = QtGui.QComboBox()
     self.splitter2.addWidget(self.modeCombo)
     self.modeCombo.addItems(self.dev.listModes())
     
     self.splitter3 = QtGui.QSplitter()
     self.splitter3.setOrientation(QtCore.Qt.Vertical)
     
     (w1, p1) = self.createChannelWidget('primary')
     (w2, p2) = self.createChannelWidget('command')
     
     self.cmdWidget = w2
     self.inputWidget = w1
     self.cmdPlot = p2
     self.inputPlot = p1
     
     #self.ctrlWidget = QtGui.QWidget()
     #self.ctrl = Ui_protoCtrl()
     #self.ctrl.setupUi(self.ctrlWidget)
     #self.splitter2.addWidget(self.ctrlWidget)
     
     self.splitter1.addWidget(self.splitter2)
     self.splitter1.addWidget(self.splitter3)
     self.splitter2.addWidget(w1)
     self.splitter2.addWidget(w2)
     self.splitter3.addWidget(p1)
     self.splitter3.addWidget(p2)
     self.splitter1.setSizes([100, 500])
     
     self.stateGroup = WidgetGroup([
         (self.splitter1, 'splitter1'),
         (self.splitter2, 'splitter2'),
         (self.splitter3, 'splitter3'),
     ])
     
     self.modeCombo.currentIndexChanged.connect(self.modeChanged)
     self.modeChanged()
Esempio n. 2
0
 def __init__(self, dev, task):
     DAQGenericTaskGui.__init__(self, dev, task, ownUi=False)
     
     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.splitter2 = QtGui.QSplitter()
     self.splitter2.setOrientation(QtCore.Qt.Vertical)
     self.modeCombo = QtGui.QComboBox()
     self.splitter2.addWidget(self.modeCombo)
     self.modeCombo.addItems(self.dev.listModes())
     
     self.splitter3 = QtGui.QSplitter()
     self.splitter3.setOrientation(QtCore.Qt.Vertical)
     
     (w1, p1) = self.createChannelWidget('primary')
     (w2, p2) = self.createChannelWidget('command')
     
     self.cmdWidget = w2
     self.inputWidget = w1
     self.cmdPlot = p2
     self.inputPlot = p1
     
     #self.ctrlWidget = QtGui.QWidget()
     #self.ctrl = Ui_protoCtrl()
     #self.ctrl.setupUi(self.ctrlWidget)
     #self.splitter2.addWidget(self.ctrlWidget)
     
     self.splitter1.addWidget(self.splitter2)
     self.splitter1.addWidget(self.splitter3)
     self.splitter2.addWidget(w1)
     self.splitter2.addWidget(w2)
     self.splitter3.addWidget(p1)
     self.splitter3.addWidget(p2)
     
     self.stateGroup = WidgetGroup([
         (self.splitter1, 'splitter1'),
         (self.splitter2, 'splitter2'),
         (self.splitter3, 'splitter3'),
     ])
     
     self.modeCombo.currentIndexChanged.connect(self.modeChanged)
     self.modeChanged()
Esempio n. 3
0
 def restoreState(self, state):
     """Restore the state of the widget from a dictionary previously generated using saveState"""
     self.modeCombo.setCurrentIndex(self.modeCombo.findText(state['mode']))
     #self.ctrl.holdingCheck.setChecked(state['holdingEnabled'])
     #if state['holdingEnabled']:
     #    self.ctrl.holdingSpin.setValue(state['holding'])
     return DAQGenericTaskGui.restoreState(self, state['daqState'])
Esempio n. 4
0
 def restoreState(self, state):
     """Restore the state of the widget from a dictionary previously generated using saveState"""
     self.modeCombo.setCurrentIndex(self.modeCombo.findText(state["mode"]))
     # self.ctrl.holdingCheck.setChecked(state['holdingEnabled'])
     # if state['holdingEnabled']:
     #    self.ctrl.holdingSpin.setValue(state['holding'])
     return DAQGenericTaskGui.restoreState(self, state["daqState"])
Esempio n. 5
0
    def __init__(self, dev, taskRunner):
        DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False)

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

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

        self.splitter2 = Qt.QSplitter()
        self.splitter2.setOrientation(Qt.Qt.Vertical)
        self.modeCombo = Qt.QComboBox()
        self.splitter2.addWidget(self.modeCombo)
        self.modeCombo.addItems(self.dev.listModes())

        self.splitter3 = Qt.QSplitter()
        self.splitter3.setOrientation(Qt.Qt.Vertical)

        (w1, p1) = self.createChannelWidget('primary')
        (w2, p2) = self.createChannelWidget('command')

        self.cmdWidget = w2
        self.inputWidget = w1
        self.cmdPlot = p2
        self.inputPlot = p1
        self.cmdWidget.setMeta('x', siPrefix=True, suffix='s', dec=True)
        self.cmdWidget.setMeta('y', siPrefix=True, dec=True)

        self.splitter1.addWidget(self.splitter2)
        self.splitter1.addWidget(self.splitter3)
        self.splitter2.addWidget(w1)
        self.splitter2.addWidget(w2)
        self.splitter3.addWidget(p1)
        self.splitter3.addWidget(p2)
        self.splitter1.setSizes([100, 500])

        self.stateGroup = WidgetGroup([
            (self.splitter1, 'splitter1'),
            (self.splitter2, 'splitter2'),
            (self.splitter3, 'splitter3'),
        ])

        self.modeCombo.currentIndexChanged.connect(self.modeChanged)
        self.modeChanged()
Esempio n. 6
0
 def saveState(self):
     """Return a dictionary representing the current state of the widget."""
     state = {}
     state['daqState'] = DAQGenericTaskGui.saveState(self)
     state['mode'] = self.getMode()
     #state['holdingEnabled'] = self.ctrl.holdingCheck.isChecked()
     #state['holding'] = self.ctrl.holdingSpin.value()
     return state
Esempio n. 7
0
 def __init__(self, dev, taskRunner):
     DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False)
     
     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.splitter2 = QtGui.QSplitter()
     self.splitter2.setOrientation(QtCore.Qt.Vertical)
     self.modeCombo = QtGui.QComboBox()
     self.splitter2.addWidget(self.modeCombo)
     self.modeCombo.addItems(self.dev.listModes())
     
     self.splitter3 = QtGui.QSplitter()
     self.splitter3.setOrientation(QtCore.Qt.Vertical)
     
     (w1, p1) = self.createChannelWidget('primary')
     (w2, p2) = self.createChannelWidget('command')
     
     self.cmdWidget = w2
     self.inputWidget = w1
     self.cmdPlot = p2
     self.inputPlot = p1
     self.cmdWidget.setMeta('x', siPrefix=True, suffix='s', dec=True)
     self.cmdWidget.setMeta('y', siPrefix=True, dec=True)
     
     self.splitter1.addWidget(self.splitter2)
     self.splitter1.addWidget(self.splitter3)
     self.splitter2.addWidget(w1)
     self.splitter2.addWidget(w2)
     self.splitter3.addWidget(p1)
     self.splitter3.addWidget(p2)
     self.splitter1.setSizes([100, 500])
     
     self.stateGroup = WidgetGroup([
         (self.splitter1, 'splitter1'),
         (self.splitter2, 'splitter2'),
         (self.splitter3, 'splitter3'),
     ])
     
     self.modeCombo.currentIndexChanged.connect(self.modeChanged)
     self.modeChanged()
Esempio n. 8
0
 def saveState(self):
     """Return a dictionary representing the current state of the widget."""
     state = {}
     state['daqState'] = DAQGenericTaskGui.saveState(self)
     state['mode'] = self.getMode()
     #state['holdingEnabled'] = self.ctrl.holdingCheck.isChecked()
     #state['holding'] = self.ctrl.holdingSpin.value()
     return state
Esempio n. 9
0
 def generateTask(self, params=None):
     daqTask = DAQGenericTaskGui.generateTask(self, params)
     
     task = {
         'mode': self.getMode(),
         'daqProtocol': daqTask
     }
     
         
     return task
Esempio n. 10
0
 def generateTask(self, params=None):
     daqTask = DAQGenericTaskGui.generateTask(self, params)
     
     task = {
         'mode': self.getMode(),
         'daqProtocol': daqTask
     }
     
         
     return task
Esempio n. 11
0
 def restoreState(self, state):
     """Restore the state of the widget from a dictionary previously generated using saveState"""
     #print 'state: ', state
     #print 'DaqGeneric : ', dir(DAQGenericTaskGui)
     if 'mode' in state:
         self.modeCombo.setCurrentIndex(self.modeCombo.findText(state['mode']))
     #self.ctrl.holdingCheck.setChecked(state['holdingEnabled'])
     #if state['holdingEnabled']:
     #    self.ctrl.holdingSpin.setValue(state['holding'])
     if 'daqState' in state:
         return DAQGenericTaskGui.restoreState(self, state['daqState'])
     else:
         return None
Esempio n. 12
0
 def restoreState(self, state):
     """Restore the state of the widget from a dictionary previously generated using saveState"""
     #print 'state: ', state
     #print 'DaqGeneric : ', dir(DAQGenericTaskGui)
     if 'mode' in state:
         self.modeCombo.setCurrentIndex(
             self.modeCombo.findText(state['mode']))
     #self.ctrl.holdingCheck.setChecked(state['holdingEnabled'])
     #if state['holdingEnabled']:
     #    self.ctrl.holdingSpin.setValue(state['holding'])
     if 'daqState' in state:
         return DAQGenericTaskGui.restoreState(self, state['daqState'])
     else:
         return None
Esempio n. 13
0
 def saveState(self):
     """Return a dictionary representing the current state of the widget."""
     state = {}
     state['daqState'] = DAQGenericTaskGui.saveState(self)
     return state
Esempio n. 14
0
 def restoreState(self, state):
     """Restore the state of the widget from a dictionary previously generated using saveState"""
     return DAQGenericTaskGui.restoreState(self, state['daqState'])
Esempio n. 15
0
    def generateTask(self, params=None):
        daqTask = DAQGenericTaskGui.generateTask(self, params)

        task = {"mode": self.getMode(), "daqProtocol": daqTask}

        return task
Esempio n. 16
0
 def quit(self):
     self.dev.lastResult = None
     DAQGenericTaskGui.quit(self)
Esempio n. 17
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()
Esempio n. 18
0
 def quit(self):
     self.dev.lastResult = None
     DAQGenericTaskGui.quit(self)
Esempio n. 19
0
 def restoreState(self, state):
     """Restore the state of the widget from a dictionary previously generated using saveState"""
     return DAQGenericTaskGui.restoreState(self, state['daqState'])
Esempio n. 20
0
 def saveState(self):
     """Return a dictionary representing the current state of the widget."""
     state = {}
     state['daqState'] = DAQGenericTaskGui.saveState(self)
     return state
Esempio n. 21
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()