Пример #1
0
 def __init__(self, dev, taskRunner):
     DAQGenericTaskGui.__init__(self, dev, taskRunner, ownUi=False)  ## When initializing superclass, make sure it knows this class is creating the ui.
     
     self.ui = Ui_Form()
     self.ui.setupUi(self)
     self.stateGroup = pg.WidgetGroup(self) ## create state group before DAQ creates its own interface
     self.ui.horizSplitter.setStretchFactor(0, 0)
     self.ui.horizSplitter.setStretchFactor(1, 1)
     
     DAQGenericTaskGui.createChannelWidgets(self, self.ui.ctrlSplitter, self.ui.plotSplitter)
     self.ui.plotSplitter.setStretchFactor(0, 10)
     self.ui.plotSplitter.setStretchFactor(1, 1)
     self.ui.plotSplitter.setStretchFactor(2, 1)
     
     ## plots should not be storing more than one trace at a time.
     for p in self.plots.values():
         p.plotItem.ctrl.maxTracesCheck.setChecked(True)
         p.plotItem.ctrl.maxTracesSpin.setValue(1)
         p.plotItem.ctrl.forgetTracesCheck.setChecked(True)
     
     #self.stateGroup = WidgetGroup([
         #(self.ui.recordCheck, 'record'),
         #(self.ui.triggerCheck, 'trigger'),
         #(self.ui.displayCheck, 'display'),
         #(self.ui.recordExposeCheck, 'recordExposeChannel'),
         #(self.ui.splitter, 'splitter')
     #])
     
     conf = self.dev.camConfig
     #if 'exposeChannel' not in conf:
         #self.ui.exposureGroupBox.hide()
     #if 'triggerInChannel' not in conf:
         #self.ui.triggerGroupBox.hide()
     #if 'triggerOutChannel' not in conf:
         #self.ui.triggerCheck.hide()
         
     #self.exposeCurve = None
         
     tModes = self.dev.listParams('triggerMode')[0]
     #tModes.remove('Normal')
     #tModes = ['Normal'] + tModes
     for m in tModes:
         item = self.ui.triggerModeCombo.addItem(m)
     
     self.vLines = []
     if 'trigger' in self.plots:
         l = pg.InfiniteLine()
         self.vLines.append(l)
         self.plots['trigger'].addItem(self.vLines[0])
     if 'exposure' in self.plots:
         l = pg.InfiniteLine()
         self.vLines.append(l)
         self.plots['exposure'].addItem(self.vLines[1])
         
     self.frameTicks = pg.VTickGroup()
     self.frameTicks.setYRange([0.8, 1.0])
     
     self.ui.imageView.sigTimeChanged.connect(self.timeChanged)
     
     self.taskRunner.sigTaskPaused.connect(self.taskPaused)
Пример #2
0
 def taskSequenceStarted(self):
     DAQGenericTaskGui.taskSequenceStarted(self)
     if self.ui.releaseAfterRadio.isChecked():
         # For now, the task gui only changes triggerMode. If we allow
         # other parameters to be changed from here, then they will have to be added
         # to the list of parameters to push/pop
         self.dev.pushState('cam_proto_state', params=['triggerMode'])
Пример #3
0
 def handleResult(self, result, params):
     state = self.stateGroup.state()
     if state['displayCheck']:
         if result is None or len(result.frames()) == 0:
             print "No images returned from camera task."
             self.ui.imageView.clear()
         else:
             frameTimes, precise = result.frameTimes()
             if precise:
                 self.ui.imageView.setImage(result.asMetaArray(), xvals=frameTimes)
                 self.frameTicks.setXVals(frameTimes)
             else:
                 self.ui.imageView.setImage(result.asMetaArray())
             
     DAQGenericTaskGui.handleResult(self, result.daqResult(), params)
Пример #4
0
 def handleResult(self, result, params):
     #print result
     state = self.stateGroup.state()
     if state['displayCheck']:
         if result is None or len(result.frames()) == 0:
             print "No images returned from camera task."
             self.ui.imageView.clear()
         else:
             self.ui.imageView.setImage(result.asMetaArray())
             #print "  frame times:", list(result['frames'].xvals('Time'))
             frameTimes, precise = result.frameTimes()
             if precise:
                 self.frameTicks.setXVals(frameTimes)
             
     DAQGenericTaskGui.handleResult(self, result.daqResult(), params)
Пример #5
0
    def __init__(self, dev, taskRunner):
        DAQGenericTaskGui.__init__(
            self, dev, taskRunner, ownUi=False
        )  ## When initializing superclass, make sure it knows this class is creating the ui.

        self.ui = Ui_Form()
        self.ui.setupUi(self)
        self.stateGroup = pg.WidgetGroup(
            self)  ## create state group before DAQ creates its own interface
        self.ui.horizSplitter.setStretchFactor(0, 0)
        self.ui.horizSplitter.setStretchFactor(1, 1)

        DAQGenericTaskGui.createChannelWidgets(self, self.ui.ctrlSplitter,
                                               self.ui.plotSplitter)
        self.ui.plotSplitter.setStretchFactor(0, 10)
        self.ui.plotSplitter.setStretchFactor(1, 1)
        self.ui.plotSplitter.setStretchFactor(2, 1)

        ## plots should not be storing more than one trace at a time.
        for p in self.plots.values():
            p.plotItem.ctrl.maxTracesCheck.setChecked(True)
            p.plotItem.ctrl.maxTracesSpin.setValue(1)
            p.plotItem.ctrl.forgetTracesCheck.setChecked(True)

        conf = self.dev.camConfig

        tModes = self.dev.listParams('triggerMode')[0]
        for m in tModes:
            item = self.ui.triggerModeCombo.addItem(m)

        self.vLines = []
        if 'trigger' in self.plots:
            l = pg.InfiniteLine()
            self.vLines.append(l)
            self.plots['trigger'].addItem(l)
        if 'exposure' in self.plots:
            l = pg.InfiniteLine()
            self.vLines.append(l)
            self.plots['exposure'].addItem(l)

        self.frameTicks = pg.VTickGroup()
        self.frameTicks.setYRange([0.8, 1.0])

        self.ui.imageView.sigTimeChanged.connect(self.timeChanged)

        self.taskRunner.sigTaskPaused.connect(self.taskPaused)
Пример #6
0
    def generateTask(self, params=None):
        daqProt = DAQGenericTaskGui.generateTask(self, params)

        if params is None:
            params = {}
        state = self.currentState()
        task = {
            'record': state['recordCheck'],
            'triggerProtocol': state['triggerCheck'],
            'params': {
                'triggerMode': state['triggerModeCombo']
            }
        }
        task['channels'] = daqProt
        if state['releaseBetweenRadio']:
            task['pushState'] = None
            task['popState'] = None
        return task
Пример #7
0
 def generateTask(self, params=None):
     daqProt = DAQGenericTaskGui.generateTask(self, params)
     
     if params is None:
         params = {}
     state = self.currentState()
     task = {
         'record': state['recordCheck'],
         #'recordExposeChannel': state['recordExposeCheck'],
         'triggerProtocol': state['triggerCheck'],
         'params': {
             'triggerMode': state['triggerModeCombo']
         }
     }
     task['channels'] = daqProt
     if state['releaseBetweenRadio']:
         task['pushState'] = None
         task['popState'] = None
     return task
Пример #8
0
 def restoreState(self, state):
     self.stateGroup.setState(state)
     if 'daqState' in state:
         DAQGenericTaskGui.restoreState(self, state['daqState'])
Пример #9
0
 def restoreState(self, state):
     self.stateGroup.setState(state)
     if 'daqState' in state:
         DAQGenericTaskGui.restoreState(self, state['daqState'])
Пример #10
0
 def saveState(self):
     s = self.currentState()
     s['daqState'] = DAQGenericTaskGui.saveState(self)
     return s
Пример #11
0
 def quit(self):
     self.ui.imageView.close()
     DAQGenericTaskGui.quit(self)
Пример #12
0
 def taskFinished(self):
     DAQGenericTaskGui.taskFinished(self)
     if self.ui.releaseAfterRadio.isChecked():
         self.dev.popState('cam_proto_state')
Пример #13
0
 def taskSequenceStarted(self):
     DAQGenericTaskGui.taskSequenceStarted(self)
     if self.ui.releaseAfterRadio.isChecked():
         self.dev.pushState('cam_proto_state')
Пример #14
0
 def saveState(self):
     s = self.currentState()
     s['daqState'] = DAQGenericTaskGui.saveState(self)
     return s
Пример #15
0
 def quit(self):
     self.ui.imageView.close()
     DAQGenericTaskGui.quit(self)
Пример #16
0
 def taskSequenceStarted(self):
     DAQGenericTaskGui.taskSequenceStarted(self)
     if self.ui.releaseAfterRadio.isChecked():
         self.dev.pushState('cam_proto_state')
Пример #17
0
 def taskFinished(self):
     DAQGenericTaskGui.taskFinished(self)
     if self.ui.releaseAfterRadio.isChecked():
         self.dev.popState('cam_proto_state')