def setup(self): """ user interface definition """ self.setWindowTitle('Visualization ' + self.cameraType + " " + self.ccdName + ' v.' + self.version) hbox1 = QHBoxLayout() # horizontal layout pour run snap stop self.sizebuttonMax = 30 self.sizebuttonMin = 30 self.runButton = QToolButton(self) self.runButton.setMaximumWidth(self.sizebuttonMax) self.runButton.setMinimumWidth(self.sizebuttonMax) self.runButton.setMaximumHeight(self.sizebuttonMax) self.runButton.setMinimumHeight(self.sizebuttonMax) self.runButton.setStyleSheet( "QToolButton:!pressed{border-image: url(%s);background-color: transparent ;border-color: green;}" "QToolButton:pressed{image: url(%s);background-color: gray ;border-color: gray}" % (self.iconPlay, self.iconPlay)) self.snapButton = QToolButton(self) self.snapButton.setPopupMode(0) menu = QMenu() #menu.addAction('acq',self.oneImage) menu.addAction('set nb of shot', self.nbShotAction) self.snapButton.setMenu(menu) self.snapButton.setMaximumWidth(self.sizebuttonMax) self.snapButton.setMinimumWidth(self.sizebuttonMax) self.snapButton.setMaximumHeight(self.sizebuttonMax) self.snapButton.setMinimumHeight(self.sizebuttonMax) self.snapButton.setStyleSheet( "QToolButton:!pressed{border-image: url(%s);background-color: transparent ;border-color: green;}" "QToolButton:pressed{image: url(%s);background-color: gray ;border-color: gray}" % (self.iconSnap, self.iconSnap)) self.stopButton = QToolButton(self) self.stopButton.setMaximumWidth(self.sizebuttonMax) self.stopButton.setMinimumWidth(self.sizebuttonMax) self.stopButton.setMaximumHeight(self.sizebuttonMax) self.stopButton.setMinimumHeight(self.sizebuttonMax) self.stopButton.setStyleSheet( "QToolButton:!pressed{border-image: url(%s);background-color: gray ;border-color: gray;}" "QToolButton:pressed{image: url(%s);background-color: gray ;border-color: gray}" % (self.iconStop, self.iconStop)) self.stopButton.setEnabled(False) hbox1.addWidget(self.runButton) hbox1.addWidget(self.snapButton) hbox1.addWidget(self.stopButton) hbox1.setSizeConstraint(QtGui.QLayout.SetFixedSize) hbox1.setContentsMargins(0, 10, 0, 10) self.widgetControl = QWidget(self) self.widgetControl.setLayout(hbox1) self.dockControl = QDockWidget(self) self.dockControl.setWidget(self.widgetControl) self.dockControl.resize(80, 80) self.trigg = QComboBox() self.trigg.setMaximumWidth(80) self.trigg.addItem('OFF') self.trigg.addItem('ON') self.trigg.setStyleSheet('font :bold 10pt;color: white') self.labelTrigger = QLabel('Trigger') self.labelTrigger.setMaximumWidth(70) self.labelTrigger.setStyleSheet('font :bold 10pt') self.itrig = self.trigg.currentIndex() hbox2 = QHBoxLayout() hbox2.setSizeConstraint(QtGui.QLayout.SetFixedSize) hbox2.setContentsMargins(5, 15, 0, 0) hbox2.addWidget(self.labelTrigger) hbox2.addWidget(self.trigg) self.widgetTrig = QWidget(self) self.widgetTrig.setLayout(hbox2) self.dockTrig = QDockWidget(self) self.dockTrig.setWidget(self.widgetTrig) self.labelExp = QLabel('Exposure (ms)') self.labelExp.setStyleSheet('font :bold 10pt') self.labelExp.setMaximumWidth(140) self.labelExp.setAlignment(Qt.AlignCenter) self.hSliderShutter = QSlider(Qt.Horizontal) self.hSliderShutter.setMaximumWidth(80) self.shutterBox = QSpinBox() self.shutterBox.setStyleSheet('font :bold 8pt') self.shutterBox.setMaximumWidth(120) hboxShutter = QHBoxLayout() hboxShutter.setContentsMargins(5, 0, 0, 0) hboxShutter.setSpacing(10) vboxShutter = QVBoxLayout() vboxShutter.setSpacing(0) vboxShutter.addWidget(self.labelExp) #,Qt.AlignLef) hboxShutter.addWidget(self.hSliderShutter) hboxShutter.addWidget(self.shutterBox) vboxShutter.addLayout(hboxShutter) vboxShutter.setSizeConstraint(QtGui.QLayout.SetFixedSize) vboxShutter.setContentsMargins(5, 5, 0, 0) self.widgetShutter = QWidget(self) self.widgetShutter.setLayout(vboxShutter) self.dockShutter = QDockWidget(self) self.dockShutter.setWidget(self.widgetShutter) self.labelGain = QLabel('Gain') self.labelGain.setStyleSheet('font :bold 10pt') self.labelGain.setMaximumWidth(120) self.labelGain.setAlignment(Qt.AlignCenter) self.hSliderGain = QSlider(Qt.Horizontal) self.hSliderGain.setMaximumWidth(80) self.gainBox = QSpinBox() self.gainBox.setMaximumWidth(60) self.gainBox.setStyleSheet('font :bold 8pt') self.gainBox.setMaximumWidth(120) hboxGain = QHBoxLayout() hboxGain.setContentsMargins(5, 0, 0, 0) hboxGain.setSpacing(10) vboxGain = QVBoxLayout() vboxGain.setSpacing(0) vboxGain.addWidget(self.labelGain) hboxGain.addWidget(self.hSliderGain) hboxGain.addWidget(self.gainBox) vboxGain.addLayout(hboxGain) vboxGain.setSizeConstraint(QtGui.QLayout.SetFixedSize) vboxGain.setContentsMargins(5, 5, 0, 0) self.widgetGain = QWidget(self) self.widgetGain.setLayout(vboxGain) self.dockGain = QDockWidget(self) self.dockGain.setWidget(self.widgetGain) # self.TrigSoft=QPushButton('Trig Soft',self) # self.TrigSoft.setMaximumWidth(100) # self.vbox1.addWidget(self.TrigSoft) # self.vbox1.addStretch(1) # self.cameraWidget.setLayout(self.vbox1) # self.cameraWidget.setMinimumSize(150,200) # self.cameraWidget.setMaximumSize(200,900) hMainLayout = QHBoxLayout() if self.light == False: #from visu.visual2 import SEE from visu import SEE2 self.visualisation = SEE2( name=self.nbcam, **self.kwds ) ## Widget for visualisation and tools self.confVisu permet d'avoir plusieurs camera et donc plusieurs fichier ini de visualisation self.visualisation.setWindowTitle('Visualization ' + self.cameraType + " " + self.ccdName + ' v.' + self.version) if self.separate == True: print('ici') self.vbox2 = QVBoxLayout() self.vbox2.addWidget(self.visualisation) if self.aff == 'left': hMainLayout.addLayout(self.vbox2) hMainLayout.addWidget(self.cameraWidget) else: hMainLayout.addWidget(self.cameraWidget) hMainLayout.addLayout(self.vbox2) else: self.dockControl.setTitleBarWidget( QWidget()) # to avoid tittle #self.dockControl.setFeatures(QDockWidget.DockWidgetMovable) self.visualisation.addDockWidget(Qt.TopDockWidgetArea, self.dockControl) self.dockTrig.setTitleBarWidget(QWidget()) self.visualisation.addDockWidget(Qt.TopDockWidgetArea, self.dockTrig) self.dockShutter.setTitleBarWidget(QWidget()) self.visualisation.addDockWidget(Qt.TopDockWidgetArea, self.dockShutter) self.dockGain.setTitleBarWidget(QWidget()) self.visualisation.addDockWidget(Qt.TopDockWidgetArea, self.dockGain) hMainLayout.addWidget(self.visualisation) self.scanWidget = SCAN(mot0='CAM_Foc', motorTypeName0='RSAI') hMainLayout.addChildLayout(self.scanWidget) else: from visu import SEELIGHT self.visualisation = SEELIGHT(confpath=self.confPath, name=self.nbcam, **self.kwds) self.visualisation.hbox0.addWidget(self.cameraWidget) hMainLayout.addWidget(self.visualisation) self.setLayout(hMainLayout) self.setContentsMargins(0, 0, 0, 0)