예제 #1
0
    def _specViewLayout(self):
        dev = self.device.substitute(dev='TuneProc')

        # Mode
        lbl_mode = QLabel('Mode', self)
        self.cb_mode = PyDMEnumComboBox(self,
                                        dev.substitute(propty='SpecMode-Sel'))
        self.lb_mode = PyDMLabel(self, dev.substitute(propty='SpecMode-Sts'))
        hbox_mode = QHBoxLayout()
        hbox_mode.addWidget(self.cb_mode)
        hbox_mode.addWidget(self.lb_mode)

        # Time window
        lbl_timewdw = QLabel('Time Window [ms]', self)
        self.le_timewdw = PyDMLineEdit(self,
                                       dev.substitute(propty='SpecTime-SP'))
        self.le_timewdw.precisionFromPV = True
        self.lb_timewdw = PyDMLabel(self, dev.substitute(propty='SpecTime-RB'))
        hbox_timewdw = QHBoxLayout()
        hbox_timewdw.addWidget(self.le_timewdw)
        hbox_timewdw.addWidget(self.lb_timewdw)

        lay = QFormLayout()
        lay.setLabelAlignment(Qt.AlignRight)
        lay.setFormAlignment(Qt.AlignCenter)
        lay.addRow(lbl_mode, hbox_mode)
        lay.addRow(lbl_timewdw, hbox_timewdw)
        return lay
예제 #2
0
파일: settings.py 프로젝트: lnls-sirius/hla
    def _setupConfigurationWidget(self):
        statebutton_Test = PyDMStateButton(
            self, self.dcct_prefix.substitute(propty='Test-Sel'))
        statebutton_Test.shape = 1
        statebutton_Test.setStyleSheet('min-width:6em; max-width:6em;')
        label_Test = PyDMLabel(self,
                               self.dcct_prefix.substitute(propty='Test-Sts'))
        hlay_test = QHBoxLayout()
        hlay_test.addWidget(statebutton_Test)
        hlay_test.addWidget(label_Test)

        self.bt_dl = PyDMPushButton(
            parent=self,
            pressValue=1,
            icon=qta.icon('fa5s.sync'),
            init_channel=self.dcct_prefix.substitute(propty='Download-Cmd'))
        self.bt_dl.setObjectName('bt_dl')
        self.bt_dl.setStyleSheet(
            '#bt_dl{min-width:25px; max-width:25px; icon-size:20px;}')

        gbox_test = QGroupBox('Configurations')
        lay = QFormLayout(gbox_test)
        lay.setLabelAlignment(Qt.AlignRight)
        lay.setFormAlignment(Qt.AlignCenter)
        lay.addRow('Enable test current: ', hlay_test)
        lay.addRow('Download Configurations: ', self.bt_dl)
        return gbox_test
예제 #3
0
    def _device(self, node, channel):
        attrs = ['name', 'path', 'description', 'hidden', 'groups']

        msgBox = QDialog()
        msgBox.setWindowTitle("Device Information For {}".format(node.name))
        msgBox.setMinimumWidth(400)

        vb = QVBoxLayout()
        msgBox.setLayout(vb)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vb.addLayout(fl)

        pb = QPushButton('Close')
        pb.pressed.connect(msgBox.close)
        vb.addWidget(pb)

        for a in attrs:
            le = QLineEdit()
            le.setReadOnly(True)
            le.setText(str(getattr(node,a)))
            fl.addRow(a,le)

        le = QLineEdit()
        le.setReadOnly(True)
        le.setText(channel.address)
        fl.addRow('PyDM Path',le)

        msgBox.exec()
예제 #4
0
    def _command(self, node, channel):
        attrs = ['name', 'path', 'description', 'hidden', 'groups', 'enum', 'typeStr', 'disp']

        if node.isinstance(pyrogue.RemoteCommand):
            attrs += ['offset', 'bitSize', 'bitOffset', 'varBytes']

        msgBox = QDialog()
        msgBox.setWindowTitle("Command Information For {}".format(node.name))
        msgBox.setMinimumWidth(400)

        vb = QVBoxLayout()
        msgBox.setLayout(vb)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vb.addLayout(fl)

        pb = QPushButton('Close')
        pb.pressed.connect(msgBox.close)
        vb.addWidget(pb)

        for a in attrs:
            le = QLineEdit()
            le.setReadOnly(True)
            le.setText(str(getattr(node,a)))
            fl.addRow(a,le)

        le = QLineEdit()
        le.setReadOnly(True)
        le.setText(channel.address)
        fl.addRow('PyDM Path',le)

        msgBox.exec()
예제 #5
0
    def _setupLEDLayout(self):
        label_LedPwrLvl = QLabel('Intensity [%]: ', self)
        hbox_LedPwrLvl = _create_propty_layout(parent=self,
                                               prefix=self.scrn_prefix,
                                               propty='LEDPwrLvl',
                                               propty_type='sprb')

        label_LedPwrScaleFactor = QLabel('Power Scale Factor: ', self)
        hbox_LedPwrScaleFactor = _create_propty_layout(
            parent=self,
            prefix=self.scrn_prefix,
            propty='LEDPwrScaleFactor',
            propty_type='sprb')

        label_LedThold = QLabel('Voltage Threshold [V]: ', self)
        hbox_LedThold = _create_propty_layout(parent=self,
                                              prefix=self.scrn_prefix,
                                              propty='LEDThold',
                                              propty_type='sprb')

        flay_LED = QFormLayout()
        flay_LED.addItem(
            QSpacerItem(1, 10, QSzPlcy.Fixed, QSzPlcy.MinimumExpanding))
        flay_LED.addRow(label_LedPwrLvl, hbox_LedPwrLvl)
        flay_LED.addRow(label_LedPwrScaleFactor, hbox_LedPwrScaleFactor)
        flay_LED.addRow(label_LedThold, hbox_LedThold)
        flay_LED.addItem(
            QSpacerItem(1, 10, QSzPlcy.Fixed, QSzPlcy.MinimumExpanding))
        flay_LED.setLabelAlignment(Qt.AlignRight)
        flay_LED.setFormAlignment(Qt.AlignCenter)
        return flay_LED
예제 #6
0
    def _statusWidget(self):
        label_Conn = QLabel('Connection:', self)
        hbox_Conn = create_propty_layout(parent=self,
                                         prefix=self.cam_prefix,
                                         propty='Connection',
                                         propty_type='mon')

        label_Temp = QLabel('Temperature State:', self)
        self.lb_Temp = PyDMLabel(self,
                                 self.cam_prefix.substitute(propty='Temp-Mon'))
        self.lb_Temp.setStyleSheet('min-width:7.1em; max-width:7.1em;')
        self.lb_Temp.setAlignment(Qt.AlignCenter)
        self.led_TempState = SiriusLedAlert(
            self, self.cam_prefix.substitute(propty='TempState-Mon'))
        self.led_TempState.setStyleSheet('min-width:1.29em; max-width:1.29em;')
        self.lb_TempState = PyDMLabel(
            self, self.cam_prefix.substitute(propty='TempState-Mon'))
        self.lb_TempState.setStyleSheet('min-width:2.5em; max-width:2.5em;')
        hbox_Temp = QHBoxLayout()
        hbox_Temp.addWidget(self.lb_Temp)
        hbox_Temp.addWidget(self.led_TempState)
        hbox_Temp.addWidget(self.lb_TempState)

        label_LastErr = QLabel('Last Error:', self)
        hbox_LastErr = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='LastErr',
                                            propty_type='mon',
                                            cmd={
                                                'label': 'Clear Last Error',
                                                'pressValue': 1,
                                                'name': 'ClearLastErr'
                                            })

        label_Reset = QLabel('Reset Camera:', self)
        self.pb_dtl = PyDMPushButton(
            label='',
            icon=qta.icon('fa5s.sync'),
            parent=self,
            pressValue=1,
            init_channel=self.cam_prefix.substitute(propty='Rst-Cmd'))
        self.pb_dtl.setObjectName('reset')
        self.pb_dtl.setStyleSheet(
            "#reset{min-width:25px; max-width:25px; icon-size:20px;}")

        wid = QWidget()
        flay = QFormLayout(wid)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignHCenter)
        flay.addRow(label_Conn, hbox_Conn)
        flay.addRow(label_Temp, hbox_Temp)
        flay.addRow(label_LastErr, hbox_LastErr)
        flay.addRow(label_Reset, self.pb_dtl)
        return wid
예제 #7
0
class FFTConfig(BaseWidget):
    def __init__(self,
                 parent=None,
                 prefix='',
                 bpm='',
                 data_prefix='ACQ',
                 position=True):
        super().__init__(parent=parent,
                         prefix=prefix,
                         bpm=bpm,
                         data_prefix=data_prefix)
        self.position = False
        self.setupui()

    def setupui(self):
        self.fl = QFormLayout(self)
        self.fl.setLabelAlignment(Qt.AlignVCenter)
        self._add_row('FFTData-RB.SPAN', 'Number of points')
        self._add_row('FFTData-RB.INDX', 'Start Index')
        self._add_row('FFTData-RB.MXIX', 'Maximum Index')
        self._add_row('FFTData-RB.WIND', 'Window type', enum=True)
        self._add_row('FFTData-RB.CDIR', 'Direction', enum=True)
        self._add_row('FFTData-RB.ASUB', 'Subtract Avg', enum=True)

        pb = PyDMPushButton(self, label='Calculate', pressValue=1)
        self._make_connections(pb, 'FFTData-RB.PROC')
        self.fl.addRow(pb)

    def _add_row(self, pv, label, enum=False):
        CLASS = PyDMEnumComboBox if enum else SiriusSpinbox
        wid = CLASS(self)
        self._make_connections(wid, pv)
        if not enum:
            wid.showStepExponent = False
        lab = QLabel(label)
        lab.setStyleSheet("""min-width:8em;""")
        self.fl.addRow(lab, wid)

    def _make_connections(self, wid, pv):
        if self.position:
            names = ('X', 'Y', 'Q', 'SUM')
        else:
            names = ('A', 'B', 'C', 'D')
        wid.channel = self.get_pvname(names[0] + pv)
        for name in names[1:]:
            chan = SiriusConnectionSignal(self.get_pvname(name + pv))
            wid.send_value_signal[int].connect(
                chan.send_value_signal[int].emit)
            wid.send_value_signal[float].connect(
                chan.send_value_signal[float].emit)
            chan.new_value_signal[int].connect(wid.channelValueChanged)
            chan.new_value_signal[float].connect(wid.channelValueChanged)
            self._chans.append(chan)
예제 #8
0
    def _setupPositionLayout(self):
        label_AcceptedErr = QLabel('Error Tolerance [mm]: ', self)
        hbox_AcceptedErr = _create_propty_layout(parent=self,
                                                 prefix=self.scrn_prefix,
                                                 propty='AcceptedErr',
                                                 propty_type='sprb')

        label_FluorScrnPos = QLabel('Fluorescent Screen Position [mm]: ', self)
        hbox_FluorScrnPos = _create_propty_layout(parent=self,
                                                  prefix=self.scrn_prefix,
                                                  propty='FluorScrnPos',
                                                  propty_type='sprb',
                                                  cmd={
                                                      'label': 'Get Position',
                                                      'pressValue': 1,
                                                      'name': 'GetFluorScrnPos'
                                                  })

        label_CalScrnPos = QLabel('Calibration Screen Position [mm]: ', self)
        hbox_CalScrnPos = _create_propty_layout(parent=self,
                                                prefix=self.scrn_prefix,
                                                propty='CalScrnPos',
                                                propty_type='sprb',
                                                cmd={
                                                    'label': 'Get Position',
                                                    'pressValue': 1,
                                                    'name': 'GetCalScrnPos'
                                                })

        label_NoneScrnPos = QLabel('Receded Screen Position [mm]: ', self)
        hbox_NoneScrnPos = _create_propty_layout(parent=self,
                                                 prefix=self.scrn_prefix,
                                                 propty='NoneScrnPos',
                                                 propty_type='sprb',
                                                 cmd={
                                                     'label': 'Get Position',
                                                     'pressValue': 1,
                                                     'name': 'GetNoneScrnPos'
                                                 })

        flay_pos = QFormLayout()
        flay_pos.addItem(
            QSpacerItem(1, 10, QSzPlcy.Fixed, QSzPlcy.MinimumExpanding))
        flay_pos.addRow(label_AcceptedErr, hbox_AcceptedErr)
        flay_pos.addRow(label_FluorScrnPos, hbox_FluorScrnPos)
        flay_pos.addRow(label_CalScrnPos, hbox_CalScrnPos)
        flay_pos.addRow(label_NoneScrnPos, hbox_NoneScrnPos)
        flay_pos.addItem(
            QSpacerItem(1, 10, QSzPlcy.Fixed, QSzPlcy.MinimumExpanding))
        flay_pos.setLabelAlignment(Qt.AlignRight)
        flay_pos.setFormAlignment(Qt.AlignCenter)
        return flay_pos
예제 #9
0
 def _configLayout(self):
     self.bt_rst = PyDMPushButton(
         parent=self,
         init_channel=self.device.substitute(propty='Rst-Cmd'),
         pressValue=1,
         icon=qta.icon('fa5s.sync'))
     self.bt_rst.setObjectName('bt_rst')
     self.bt_rst.setStyleSheet(
         '#bt_rst{min-width:25px; max-width:25px; icon-size:20px;}')
     lay = QFormLayout()
     lay.setLabelAlignment(Qt.AlignRight)
     lay.setFormAlignment(Qt.AlignCenter)
     lay.addRow('Restore Default', self.bt_rst)
     return lay
예제 #10
0
    def _setupImageCalibLayout(self):
        cam_prefix = SiriusPVName(self.scrn_prefix).substitute(dev='ScrnCam')

        label_ImgScaleFactorX = QLabel('Scale Factor X: ', self)
        hbox_ImgScaleFactorX = _create_propty_layout(parent=self,
                                                     prefix=cam_prefix,
                                                     propty='ScaleFactorX',
                                                     propty_type='sprb')

        label_ImgScaleFactorY = QLabel('Scale Factor Y: ', self)
        hbox_ImgScaleFactorY = _create_propty_layout(parent=self,
                                                     prefix=cam_prefix,
                                                     propty='ScaleFactorY',
                                                     propty_type='sprb')

        label_ImgCenterOffsetX = QLabel('Center Offset X [pixels]: ', self)
        hbox_ImgCenterOffsetX = _create_propty_layout(parent=self,
                                                      prefix=cam_prefix,
                                                      propty='CenterOffsetX',
                                                      propty_type='sprb')

        label_ImgCenterOffsetY = QLabel('Center Offset Y [pixels]: ', self)
        hbox_ImgCenterOffsetY = _create_propty_layout(parent=self,
                                                      prefix=cam_prefix,
                                                      propty='CenterOffsetY',
                                                      propty_type='sprb')

        label_ImgThetaOffset = QLabel('Theta Offset [pixels]: ', self)
        hbox_ImgThetaOffset = _create_propty_layout(parent=self,
                                                    prefix=cam_prefix,
                                                    propty='ThetaOffset',
                                                    propty_type='sprb')

        flay_Img = QFormLayout()
        flay_Img.addItem(
            QSpacerItem(1, 10, QSzPlcy.Fixed, QSzPlcy.MinimumExpanding))
        flay_Img.addRow(label_ImgScaleFactorX, hbox_ImgScaleFactorX)
        flay_Img.addRow(label_ImgScaleFactorY, hbox_ImgScaleFactorY)
        flay_Img.addRow(label_ImgCenterOffsetX, hbox_ImgCenterOffsetX)
        flay_Img.addRow(label_ImgCenterOffsetY, hbox_ImgCenterOffsetY)
        flay_Img.addRow(label_ImgThetaOffset, hbox_ImgThetaOffset)
        flay_Img.addItem(
            QSpacerItem(1, 10, QSzPlcy.Fixed, QSzPlcy.MinimumExpanding))
        flay_Img.setLabelAlignment(Qt.AlignRight)
        flay_Img.setFormAlignment(Qt.AlignCenter)
        return flay_Img
예제 #11
0
파일: details.py 프로젝트: lnls-sirius/hla
    def _setupUi(self):
        self.lb_circtin = PyDMLabel(
            self, self.prefix+self.chs['TL Sts']['Circ TIn'])
        self.lb_circtin.showUnits = True
        self.lb_circtin.setStyleSheet('qproperty-alignment: AlignLeft;')
        self.lb_circtout = PyDMLabel(
            self, self.prefix+self.chs['TL Sts']['Circ TOut'])
        self.lb_circtout.showUnits = True
        self.lb_circtout.setStyleSheet('qproperty-alignment: AlignLeft;')
        self.led_circarc = SiriusLedAlert(
            self, self.prefix+self.chs['TL Sts']['Circ Arc'])
        if self.section == 'SI':
            self.led_loadarc = SiriusLedAlert(
                self, self.prefix+self.chs['TL Sts']['Load Arc'])
        self.led_circflwrt = SiriusLedAlert(
            self, self.prefix+self.chs['TL Sts']['Circ FlwRt'])
        self.led_loadflwrt = SiriusLedAlert(
            self, self.prefix+self.chs['TL Sts']['Load FlwRt'])
        self.led_circintlkop = SiriusLedAlert(
            self, self.prefix+self.chs['TL Sts']['Circ Intlk'])

        lay = QFormLayout(self)
        lay.setLabelAlignment(Qt.AlignRight)
        lay.addRow(QLabel('<h4>Transm. Line - Detailed Status</h4>'))
        lay.addItem(QSpacerItem(0, 10, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow('Circulator T In: ', self.lb_circtin)
        lay.addRow('Circulator T Out: ', self.lb_circtout)
        lay.addItem(QSpacerItem(0, 10, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow('Circulator Arc Detector: ', self.led_circarc)
        if self.section == 'SI':
            lay.addRow('Load Arc Detector: ', self.led_loadarc)
        lay.addRow('Circulator Flow: ', self.led_circflwrt)
        lay.addRow('Load Flow: ', self.led_loadflwrt)
        lay.addRow('Circulator Intlk: ', self.led_circintlkop)

        self.setStyleSheet("""
            PyDMLabel{
                qproperty-alignment: AlignLeft;
            }
            QLed{
                max-width: 1.29em;
            }
            .QLabel{
                max-height:2em;
                qproperty-alignment: AlignRight;
            }""")
예제 #12
0
    def _kick_layout(self):
        self.kick_sp_widget = PyDMSpinboxScrollbar(self, self._kick_sp_pv)
        self.kick_rb_label = PyDMLabel(self, self._kick_rb_pv)
        self.kick_rb_label.showUnits = True
        self.kick_rb_label.precisionFromPV = True
        self.kick_mon_label = PyDMLabel(self, self._kick_mon_pv)
        self.kick_mon_label.showUnits = True
        self.kick_mon_label.precisionFromPV = True

        kick_layout = QFormLayout()
        kick_layout.setLabelAlignment(Qt.AlignRight)
        kick_layout.setFormAlignment(Qt.AlignHCenter)
        kick_layout.addRow('SP:', self.kick_sp_widget)
        kick_layout.addRow('RB:', self.kick_rb_label)
        kick_layout.addRow('Mon:', self.kick_mon_label)

        return kick_layout
예제 #13
0
    def _setupGeneralInfoLayout(self):
        label_MtrPrefix = QLabel('Motor Prefix: ', self)
        self.PyDMLabel_MtrPrefix = PyDMLabel(
            self, self.scrn_prefix.substitute(propty='MtrCtrlPrefix-Cte'))
        self.PyDMLabel_MtrPrefix.setStyleSheet(
            """max-width:14.20em; max-height:1.29em;""")

        label_CamPrefix = QLabel('Camera Prefix: ', self)
        self.PyDMLabel_CamPrefix = PyDMLabel(
            self, self.scrn_prefix.substitute(propty='CamPrefix-Cte'))
        self.PyDMLabel_CamPrefix.setStyleSheet(
            """max-width:14.20em; max-height:1.29em;""")

        flay = QFormLayout()
        flay.addRow(label_MtrPrefix, self.PyDMLabel_MtrPrefix)
        flay.addRow(label_CamPrefix, self.PyDMLabel_CamPrefix)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignCenter)
        return flay
예제 #14
0
파일: base.py 프로젝트: lnls-sirius/hla
    def _create_formlayout_groupbox(self, title, props):
        grpbx = CustomGroupBox(title, self)
        fbl = QFormLayout(grpbx)
        grpbx.layoutf = fbl
        fbl.setLabelAlignment(Qt.AlignVCenter)
        for prop in props:
            if len(prop) == 2:
                pv1, txt = prop
                isdata = True
            elif len(prop) == 3:
                pv1, txt, isdata = prop
            hbl = QHBoxLayout()
            not_enum = pv1.endswith('-SP')
            pv2 = pv1.replace('-SP', '-RB').replace('-Sel', '-Sts')
            if pv2 != pv1:
                if not_enum:
                    chan1 = self.get_pvname(pv1, is_data=isdata)
                    wid = SiriusSpinbox(self, init_channel=chan1)
                    wid.setStyleSheet("min-width:5em;")
                    wid.showStepExponent = False
                    wid.limitsFromChannel = False
                    pvn = self.data_prefix + pv1
                    wid.setMinimum(self.bpmdb[pvn].get('low', -1e10))
                    wid.setMaximum(self.bpmdb[pvn].get('high', 1e10))
                else:
                    wid = PyDMEnumComboBox(
                        self,
                        init_channel=self.get_pvname(pv1, is_data=isdata))
                    wid.setStyleSheet("min-width:5em;")
                wid.setObjectName(pv1.replace('-', ''))
                hbl.addWidget(wid)

            lab = SiriusLabel(
                self, init_channel=self.get_pvname(pv2, is_data=isdata))
            lab.setObjectName(pv2.replace('-', ''))
            lab.showUnits = True
            lab.setStyleSheet("min-width:5em;")
            hbl.addWidget(lab)
            lab = QLabel(txt)
            lab.setObjectName(pv1.split('-')[0])
            lab.setStyleSheet("min-width:8em;")
            fbl.addRow(lab, hbl)
        return grpbx
예제 #15
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(RunControl, self).connection_changed(connected)

        if not build:
            return

        self._node = nodeFromAddress(self.channel)
        self._path = self.channel

        vb = QVBoxLayout()
        self.setLayout(vb)

        gb = QGroupBox('Run Control ({})'.format(self._node.name))
        vb.addWidget(gb)

        vb = QVBoxLayout()
        gb.setLayout(vb)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vb.addLayout(fl)

        w = PyDMEnumComboBox(parent=None, init_channel=self._path + '.runRate')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = False
        fl.addRow('Run Rate:', w)

        hb = QHBoxLayout()
        vb.addLayout(hb)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        hb.addLayout(fl)

        w = PyDMEnumComboBox(parent=None,
                             init_channel=self._path + '.runState')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = False
        fl.addRow('Run State:', w)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        hb.addLayout(fl)

        w = PyDMLabel(parent=None, init_channel=self._path + '.runCount')
        w.showUnits = False
        w.precisionFromPV = True
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = False

        fl.addRow('Run Count:', w)
예제 #16
0
파일: settings.py 프로젝트: lnls-sirius/hla
    def _setupMeasSettingsWidget(self, mode):
        if mode == 'Normal':
            prefix = self.dcct_prefix
            visible = True
        elif mode == 'Fast':
            prefix = self.dcct_prefix.substitute(propty_name=mode)
            visible = False

        gbox_modesettings = QGroupBox(mode + ' Measurement Mode Settings',
                                      self)

        l_smpcnt = QLabel('Sample Count: ', self)
        spinbox_SampleCnt = PyDMSpinbox(
            self,
            prefix.substitute(propty=prefix.propty_name + 'SampleCnt-SP'))
        spinbox_SampleCnt.showStepExponent = False
        label_SampleCnt = PyDMLabel(
            self,
            prefix.substitute(propty=prefix.propty_name + 'SampleCnt-RB'))
        hlay_smpcnt = QHBoxLayout()
        hlay_smpcnt.addWidget(spinbox_SampleCnt)
        hlay_smpcnt.addWidget(label_SampleCnt)

        l_measperiod = QLabel('Period [s]: ', self)
        spinbox_MeasPeriod = PyDMSpinbox(
            self,
            prefix.substitute(propty=prefix.propty_name + 'MeasPeriod-SP'))
        spinbox_MeasPeriod.showStepExponent = False
        label_MeasPeriod = PyDMLabel(
            self,
            prefix.substitute(propty=prefix.propty_name + 'MeasPeriod-RB'))
        hlay_measperiod = QHBoxLayout()
        hlay_measperiod.addWidget(spinbox_MeasPeriod)
        hlay_measperiod.addWidget(label_MeasPeriod)

        l_measupdateperiod = QLabel('Measured Period [s]: ', self)
        label_MeasUpdatePeriod = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='MeasUpdatePeriod-Mon'))

        l_imped = QLabel('Impedance: ', self)
        enumcombobox_Imped = PyDMEnumComboBox(
            self, prefix.substitute(propty=prefix.propty_name + 'Imped-Sel'))
        label_Imped = PyDMLabel(
            self, prefix.substitute(propty=prefix.propty_name + 'Imped-Sts'))
        hlay_imped = QHBoxLayout()
        hlay_imped.addWidget(enumcombobox_Imped)
        hlay_imped.addWidget(label_Imped)

        l_offset = QLabel('Relative Offset Enable: ', self)
        statebutton_RelEnbl = PyDMStateButton(
            self, prefix.substitute(propty=prefix.propty_name + 'RelEnbl-Sel'))
        statebutton_RelEnbl.shape = 1
        statebutton_RelEnbl.setStyleSheet('min-width:6em; max-width:6em;')
        label_RelEnbl = PyDMLabel(
            self, prefix.substitute(propty=prefix.propty_name + 'RelEnbl-Sts'))
        hlay_offset = QHBoxLayout()
        hlay_offset.addWidget(statebutton_RelEnbl)
        hlay_offset.addWidget(label_RelEnbl)

        l_rellvl = QLabel('Relative Offset Level [V]: ', self)
        spinbox_RelLvl = PyDMSpinbox(
            self, prefix.substitute(propty=prefix.propty_name + 'RelLvl-SP'))
        spinbox_RelLvl.showStepExponent = False
        label_RelLvl = PyDMLabel(
            self, prefix.substitute(propty=prefix.propty_name + 'RelLvl-RB'))
        label_RelLvl.precisionFromPV = False
        label_RelLvl.precision = 9
        pushbutton_RelAcq = PyDMPushButton(
            parent=self,
            label='Acquire Offset',
            pressValue=1,
            init_channel=prefix.substitute(propty=prefix.propty_name +
                                           'RelAcq-Cmd'))
        pushbutton_RelAcq.setAutoDefault(False)
        pushbutton_RelAcq.setDefault(False)
        hlay_rellvl = QHBoxLayout()
        hlay_rellvl.addWidget(spinbox_RelLvl)
        hlay_rellvl.addWidget(label_RelLvl)
        hlay_rellvl.addWidget(pushbutton_RelAcq)

        flay_modesettings = QFormLayout()
        flay_modesettings.setLabelAlignment(Qt.AlignRight)
        flay_modesettings.setFormAlignment(Qt.AlignHCenter)
        flay_modesettings.addRow(l_smpcnt, hlay_smpcnt)
        flay_modesettings.addRow(l_measperiod, hlay_measperiod)
        flay_modesettings.addRow(l_measupdateperiod, label_MeasUpdatePeriod)
        flay_modesettings.addRow(l_imped, hlay_imped)
        flay_modesettings.addRow(l_offset, hlay_offset)
        flay_modesettings.addRow(l_rellvl, hlay_rellvl)

        if mode == 'Normal':
            l_linesync = QLabel('Line Synchronization: ', self)
            statebutton_LineSync = PyDMStateButton(
                self,
                prefix.substitute(propty=prefix.propty_name + 'LineSync-Sel'))
            statebutton_LineSync.shape = 1
            statebutton_LineSync.setStyleSheet('min-width:6em; max-width:6em;')
            label_LineSync = PyDMLabel(
                self,
                prefix.substitute(propty=prefix.propty_name + 'LineSync-Sts'))
            hlay_linesync = QHBoxLayout()
            hlay_linesync.addWidget(statebutton_LineSync)
            hlay_linesync.addWidget(label_LineSync)

            label_avg = QLabel('<h4>Average Filter</h4>', self)
            l_avgenbl = QLabel('Enable: ', self)
            statebutton_AvgFilterEnbl = PyDMStateButton(
                self,
                prefix.substitute(propty=prefix.propty_name +
                                  'AvgFilterEnbl-Sel'))
            statebutton_AvgFilterEnbl.shape = 1
            label_AvgFilterEnbl = PyDMLabel(
                self,
                prefix.substitute(propty=prefix.propty_name +
                                  'AvgFilterEnbl-Sts'))
            hlay_avgenbl = QHBoxLayout()
            hlay_avgenbl.addWidget(statebutton_AvgFilterEnbl)
            hlay_avgenbl.addWidget(label_AvgFilterEnbl)

            l_avgcnt = QLabel('Samples: ', self)
            spinbox_AvgFilterCount = PyDMSpinbox(
                self,
                prefix.substitute(propty=prefix.propty_name +
                                  'AvgFilterCnt-SP'))
            spinbox_AvgFilterCount.showStepExponent = False
            label_AvgFilterCount = PyDMLabel(
                self,
                prefix.substitute(propty=prefix.propty_name +
                                  'AvgFilterCnt-RB'))
            hlay_avgcnt = QHBoxLayout()
            hlay_avgcnt.addWidget(spinbox_AvgFilterCount)
            hlay_avgcnt.addWidget(label_AvgFilterCount)

            l_avgtyp = QLabel('Type: ', self)
            enumcombobox_AvgFilterTyp = PyDMEnumComboBox(
                self, self.dcct_prefix.substitute(propty='AvgFilterTyp-Sel'))
            label_AvgFilterTyp = PyDMLabel(
                self, self.dcct_prefix.substitute(propty='AvgFilterTyp-Sts'))
            hlay_avgtyp = QHBoxLayout()
            hlay_avgtyp.addWidget(enumcombobox_AvgFilterTyp)
            hlay_avgtyp.addWidget(label_AvgFilterTyp)

            l_avgwin = QLabel('Noise window size [%]: ', self)
            spinbox_AvgFilterWind = PyDMSpinbox(
                self,
                prefix.substitute(propty=prefix.propty_name +
                                  'AvgFilterWind-SP'))
            spinbox_AvgFilterWind.showStepExponent = False
            label_AvgFilterWind = PyDMLabel(
                self,
                prefix.substitute(propty=prefix.propty_name +
                                  'AvgFilterWind-RB'))
            hlay_avgwin = QHBoxLayout()
            hlay_avgwin.addWidget(spinbox_AvgFilterWind)
            hlay_avgwin.addWidget(label_AvgFilterWind)

            flay_modesettings.addRow(l_linesync, hlay_linesync)
            flay_modesettings.addRow(QLabel(''))
            flay_modesettings.addRow(label_avg)
            flay_modesettings.addRow(l_avgenbl, hlay_avgenbl)
            flay_modesettings.addRow(l_avgcnt, hlay_avgcnt)
            flay_modesettings.addRow(l_avgtyp, hlay_avgtyp)
            flay_modesettings.addRow(l_avgwin, hlay_avgwin)

        gbox_modesettings.setLayout(flay_modesettings)
        gbox_modesettings.setVisible(visible)
        gbox_modesettings.setStyleSheet("""
            PyDMSpinbox, PyDMLabel{
                min-width:6em; max-width:6em;
                qproperty-alignment: AlignCenter;}
            PyDMLedMultiChannel, PyDMStateButton, PyDMEnumComboBox{
                min-width:6em; max-width:6em;}""")
        return gbox_modesettings
예제 #17
0
파일: view.py 프로젝트: ethoeng/mantid
    def setupUI(self):
        width, height  = self.determine_dialog_dimensions()

        self.setMinimumSize(width, height)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.setWindowTitle("About Mantid Workbench")
        self.setStyleSheet(f"""QDialog {{
    background-color: rgb(190, 230, 190);
}}
QLabel{{
    font: {self.rescale_w(14)}px;
}}
QPushButton{{
    font: {self.rescale_w(14)}px;
}}
QCommandLinkButton{{
    font: {self.rescale_w(22)}px;
    background-color: rgba(255, 255, 255, 0);
    border-radius: {self.rescale_w(15)}px;
}}
QCommandLinkButton:hover {{
    background-color: rgba(45, 105, 45, 40);
}}""")

        # version label section at th etop
        parent_layout = QVBoxLayout()
        parent_layout.addSpacerItem(QSpacerItem(self.rescale_w(20),self.rescale_h(70),vPolicy=QSizePolicy.Fixed))
        self.lbl_version.setText("version ")
        self.lbl_version.setIndent(self.rescale_w(115))
        self.lbl_version.setStyleSheet(f"""color: rgb(215, 215, 215);
font: {self.rescale_w(28)}pt;
font-weight: bold;
font-size: {self.rescale_w(28)}px""")
        parent_layout.addWidget(self.lbl_version)
        parent_layout.addSpacerItem(QSpacerItem(self.rescale_w(20),self.rescale_h(40),
                                                vPolicy=QSizePolicy.MinimumExpanding))

        # split into the two columns
        two_box_layout = QHBoxLayout()
        # left side Welcome and Tutorial
        left_layout = QVBoxLayout()
        left_layout.setContentsMargins(self.rescale_w(5), 0, self.rescale_w(10), 0)
        left_layout.setSpacing(0)
        # welcome label
        lbl_welcome = QLabel()
        lbl_welcome.setStyleSheet(f"color: rgb(45, 105, 45); font-size: {self.rescale_w(28)}px;")
        lbl_welcome.setText("Welcome")
        left_layout.addWidget(lbl_welcome)
        # release notes
        self.setup_command_link_button(self.clb_release_notes, "Release Notes",
                                       ':/images/Notepad-Bloc-notes-icon-48x48.png')
        left_layout.addWidget(self.clb_release_notes)
        # sample datasets
        self.setup_command_link_button(self.clb_sample_datasets, "Sample Datasets",
                                       ':/images/download-icon-48x48.png')
        left_layout.addWidget(self.clb_sample_datasets)
        # Tutorials Label
        lbl_tutorials = QLabel()
        lbl_tutorials.setStyleSheet(f"color: rgb(45, 105, 45); font-size: {self.rescale_w(28)}px;")
        lbl_tutorials.setText("Tutorials")
        left_layout.addWidget(lbl_tutorials)
        # Mantid Introduction
        self.setup_command_link_button(self.clb_mantid_introduction, "Mantid Introduction",
                                       ':/images/Misc-Tutorial-icon-48x48.png')
        left_layout.addWidget(self.clb_mantid_introduction)
        # Introduction to python
        self.setup_command_link_button(self.clb_python_introduction, "Introduction to Python",
                                       ':/images/Python-icon-48x48.png')
        left_layout.addWidget(self.clb_python_introduction)
        # Python in Mantid
        self.setup_command_link_button(self.clb_python_in_mantid, "Python In Mantid",
                                       ':/images/Circle_cog_48x48.png')
        left_layout.addWidget(self.clb_python_in_mantid)
        # Extending Mantid with python
        self.setup_command_link_button(self.clb_extending_mantid, "Extending Mantid with Python",
                                       ':/images/Plugin-Python-icon-48x48.png')
        left_layout.addWidget(self.clb_extending_mantid)

        # right hand side Setup and facility icons
        right_layout = QVBoxLayout()
        right_layout.setSpacing(0)
        # personal setup
        grp_personal_setup = QGroupBox()
        grp_personal_setup.setStyleSheet(f"""QGroupBox {{
     border: {self.rescale_w(3)}px solid  rgb(38, 128, 20);;
     border-radius: {self.rescale_w(10)}px;
     background-color: rgb(240, 240, 240);
}}
QGroupBox QLabel{{
    font: {self.rescale_w(12)}px;
    color: rgb(121, 121, 121);
}}
QGroupBox QComboBox{{
    font: {self.rescale_w(12)}px;
}}
font: {self.rescale_w(12)}px;
""")
        grp_personal_setup_layout = QVBoxLayout()
        grp_personal_setup_layout.setContentsMargins(self.rescale_w(9),
                                                     self.rescale_h(1),
                                                     self.rescale_w(9),
                                                     self.rescale_h(9))
        grp_personal_setup_layout.setSpacing(0)
        grp_personal_setup.setLayout(grp_personal_setup_layout)
        lbl_personal_setup = QLabel()
        lbl_personal_setup.setStyleSheet(f"color: rgb(38, 128, 20);\nfont-size: {self.rescale_w(18)}px;")
        lbl_personal_setup.setText("Personal Setup")
        lbl_personal_setup.setAlignment(Qt.AlignHCenter)
        grp_personal_setup_layout.addWidget(lbl_personal_setup)
        personal_setup_form_layout = QFormLayout()
        personal_setup_form_layout.setHorizontalSpacing(self.rescale_w(5))
        personal_setup_form_layout.setVerticalSpacing(self.rescale_h(5))
        personal_setup_form_layout.setLabelAlignment(Qt.AlignRight)
        # default Facility
        lbl_default_facilty = QLabel()
        lbl_default_facilty.setText("Default Facility")
        personal_setup_form_layout.addRow(lbl_default_facilty, self.cb_facility)
        # default instrument
        lbl_default_instrument = QLabel()
        lbl_default_instrument.setText("Default Instrument")
        personal_setup_form_layout.addRow(lbl_default_instrument, self.cb_instrument)
        # Set Data Directories
        lbl_mud = QLabel()
        lbl_mud.setText("Set data directories")
        self.pb_manage_user_directories.setText("Manage User Directories")
        personal_setup_form_layout.addRow(lbl_mud, self.pb_manage_user_directories)
        # Usage data
        lbl_allow_usage_data = QLabel()
        lbl_allow_usage_data.setText("Report Usage Data")
        usagelayout = QHBoxLayout()
        usagelayout.setContentsMargins(0, 0, 0, 0)
        self.chk_allow_usage_data.setChecked(True)
        self.chk_allow_usage_data.setStyleSheet(f"padding: {self.rescale_w(4)}px;")
        usagelayout.addWidget(self.chk_allow_usage_data)
        usagelayout.addSpacerItem(QSpacerItem(self.rescale_w(40), self.rescale_h(20), hPolicy=QSizePolicy.Expanding))
        self.lbl_privacy_policy.setText(r'<html><head/><body><p>'
                                        r'<a href="https://www.mantidproject.org/MantidProject:Privacy_policy'
                                        r'#Usage_Data_recorded_in_Mantid">'
                                        r'<span style=" text-decoration: underline; color:#0000ff;">'
                                        r'Privacy Policy</span></a></p></body></html>')
        self.lbl_privacy_policy.setOpenExternalLinks(False)
        usagelayout.addWidget(self.lbl_privacy_policy)
        personal_setup_form_layout.addRow(lbl_allow_usage_data,usagelayout)
        grp_personal_setup_layout.addLayout(personal_setup_form_layout)
        right_layout.addWidget(grp_personal_setup)
        right_layout.addSpacerItem(QSpacerItem(self.rescale_w(20), self.rescale_h(40), vPolicy=QSizePolicy.Expanding))

        # facility icons
        # Row one
        icon_layout_top = QHBoxLayout()
        icon_layout_top.setContentsMargins(0, self.rescale_h(10), 0, 0)
        icon_layout_top.setSpacing(0)
        icon_layout_top.addWidget(self.create_label_with_image(112, 50, ':/images/ISIS_Logo_Transparent.gif'))
        icon_layout_top.addSpacerItem(QSpacerItem(self.rescale_w(10), self.rescale_h(20), hPolicy=QSizePolicy.Fixed))
        icon_layout_top.addWidget(self.create_label_with_image(94, 50, ':/images/ess_logo_transparent_small.png'))
        icon_layout_top.addSpacerItem(QSpacerItem(self.rescale_w(40), 20,hPolicy=QSizePolicy.Expanding))
        right_layout.addLayout(icon_layout_top)
        # Row two
        icon_layout_middle = QHBoxLayout()
        icon_layout_middle.setContentsMargins(0, self.rescale_h(10), 0, 0)
        icon_layout_middle.setSpacing(0)
        icon_layout_middle.addWidget(self.create_label_with_image(200, 30, ':/images/Ornl_hfir_sns_logo_small.png'))
        icon_layout_middle.addSpacerItem(QSpacerItem(self.rescale_w(40), self.rescale_h(20),
                                                     hPolicy=QSizePolicy.Expanding))
        right_layout.addLayout(icon_layout_middle)
        # Row three
        icon_layout_bottom = QHBoxLayout()
        icon_layout_bottom.setContentsMargins(0, self.rescale_h(10), 0, 0)
        icon_layout_bottom.setSpacing(0)
        icon_layout_bottom.addWidget(self.create_label_with_image(110, 40, ':/images/Tessella_Logo_Transparent.gif'))
        icon_layout_bottom.addSpacerItem(QSpacerItem(self.rescale_w(10), self.rescale_h(20), hPolicy=QSizePolicy.Fixed))
        icon_layout_bottom.addWidget(self.create_label_with_image(50, 50, ':/images/ILL_logo.png'))
        icon_layout_bottom.addSpacerItem(QSpacerItem(self.rescale_w(10), self.rescale_h(20), hPolicy=QSizePolicy.Fixed))
        icon_layout_bottom.addWidget(self.create_label_with_image(92, 50, ':/images/CSNS_Logo_Short.png'))
        icon_layout_bottom.addSpacerItem(QSpacerItem(self.rescale_w(40), self.rescale_h(20),
                                                     hPolicy=QSizePolicy.Expanding))
        right_layout.addLayout(icon_layout_bottom)

        # end the two box layout
        two_box_layout.addLayout(left_layout)
        two_box_layout.addLayout(right_layout)
        parent_layout.addLayout(two_box_layout)

        # footer
        footer_layout = QHBoxLayout()
        # do not show again
        do_not_show_layout = QVBoxLayout()
        do_not_show_layout.setContentsMargins(self.rescale_w(15), 0, 0, 0)
        do_not_show_layout.setSpacing(self.rescale_w(2))
        do_not_show_layout.addSpacerItem(QSpacerItem(1,self.rescale_h(1), vPolicy=QSizePolicy.Expanding))
        lbl_update = QLabel()
        lbl_update.setMinimumSize(self.rescale_w(400),0)
        lbl_update.setStyleSheet("color: rgb(25,125,25);")
        lbl_update.setText('You can revisit this dialog by selecting "About" on the Help menu.')
        lbl_update.setAlignment(Qt.AlignBottom)
        do_not_show_layout.addWidget(lbl_update)

        do_not_show_checkbox_layout = QHBoxLayout()
        self.chk_do_not_show_until_next_release.setChecked(True)
        do_not_show_checkbox_layout.addWidget(self.chk_do_not_show_until_next_release)
        do_not_show_checkbox_layout.addSpacerItem(QSpacerItem(self.rescale_w(10), self.rescale_h(2),
                                                              hPolicy=QSizePolicy.Fixed))
        lbl_do_not_show = QLabel()
        lbl_do_not_show.setStyleSheet("color: rgb(25,125,25);")
        lbl_do_not_show.setText('Do not show again until next release')
        do_not_show_checkbox_layout.addWidget(lbl_do_not_show)
        do_not_show_checkbox_layout.addSpacerItem(QSpacerItem(self.rescale_w(40),10, hPolicy=QSizePolicy.Expanding))
        do_not_show_layout.addLayout(do_not_show_checkbox_layout)
        footer_layout.addLayout(do_not_show_layout)

        # Close button
        close_button_layout = QVBoxLayout()
        close_button_layout.addSpacerItem(QSpacerItem(20,self.rescale_h(15), vPolicy=QSizePolicy.Expanding))
        self.pb_close.setText("Close")
        self.pb_close.setDefault(True)
        close_button_layout.addWidget(self.pb_close)
        footer_layout.addLayout(close_button_layout)
        footer_layout.addSpacerItem(QSpacerItem(self.rescale_w(100), self.rescale_h(20), hPolicy=QSizePolicy.Fixed))
        parent_layout.addLayout(footer_layout)
        self.setLayout(parent_layout)

        self.setAttribute(Qt.WA_DeleteOnClose, True)
예제 #18
0
파일: details.py 프로젝트: lnls-sirius/hla
    def _setupUi(self):
        lay_temp1 = QFormLayout()
        lay_temp1.setHorizontalSpacing(9)
        lay_temp1.setVerticalSpacing(9)
        lay_temp1.setLabelAlignment(Qt.AlignRight)
        lay_temp1.setFormAlignment(Qt.AlignTop)
        lb_temp1 = QLabel('Cell and Coupler\nTemperatures\nPT100', self)
        lb_temp1.setStyleSheet(
            'font-weight:bold; qproperty-alignment:AlignCenter;')
        lay_temp1.addRow(lb_temp1)
        lims = self.chs['Cav Sts']['Temp']['Cells Limits']
        tooltip = 'Interlock limits: \nMin: ' + str(lims[0]) + \
            '°C, Max: '+str(lims[1])+'°C'
        for idx, cell in enumerate(self.chs['Cav Sts']['Temp']['Cells']):
            lbl = PyDMLabel(self, self.prefix+cell[0])
            lbl.showUnits = True
            lbl.setStyleSheet('min-width:3.5em; max-width:3.5em;')
            led = PyDMLedMultiChannel(
                self,
                {self.prefix+cell[0]: {'comp': 'wt', 'value': lims},
                 self.prefix+cell[0].replace('T-Mon', 'TUp-Mon'): 0,
                 self.prefix+cell[0].replace('T-Mon', 'TDown-Mon'): 0})
            led.setToolTip(tooltip)
            hbox = QHBoxLayout()
            hbox.setAlignment(Qt.AlignLeft)
            hbox.addWidget(lbl)
            hbox.addWidget(led)
            lay_temp1.addRow('Cell '+str(idx + 1)+': ', hbox)
        ch_coup = self.chs['Cav Sts']['Temp']['Coupler'][0]
        lims_coup = self.chs['Cav Sts']['Temp']['Coupler Limits']
        lb_coup = PyDMLabel(self, self.prefix+ch_coup)
        lb_coup.setStyleSheet('min-width:3.5em; max-width:3.5em;')
        lb_coup.showUnits = True
        led_coup = PyDMLedMultiChannel(
            self,
            {self.prefix+ch_coup: {'comp': 'wt', 'value': lims_coup},
             self.prefix+ch_coup.replace('T-Mon', 'TUp-Mon'): 0,
             self.prefix+ch_coup.replace('T-Mon', 'TDown-Mon'): 0})
        led_coup.setToolTip(
            'Interlock limits: \n'
            'Min: '+str(lims_coup[0])+'°C, Max: '+str(lims_coup[1])+'°C')
        hb_coup = QHBoxLayout()
        hb_coup.setAlignment(Qt.AlignLeft)
        hb_coup.addWidget(lb_coup)
        hb_coup.addWidget(led_coup)
        lay_temp1.addRow('Coupler: ', hb_coup)

        lay_temp2 = QFormLayout()
        lay_temp2.setHorizontalSpacing(9)
        lay_temp2.setVerticalSpacing(9)
        lay_temp2.setLabelAlignment(Qt.AlignRight)
        lay_temp2.setFormAlignment(Qt.AlignTop | Qt.AlignHCenter)
        lb_temp2 = QLabel('Cell\nTemperatures\nThermostats', self)
        lb_temp2.setStyleSheet(
            'font-weight:bold; qproperty-alignment:AlignCenter;')
        lay_temp2.addRow(lb_temp2)
        for idx, cell in enumerate(self.chs['Cav Sts']['Temp']['Cells']):
            led = SiriusLedAlert(self)
            led.setToolTip('Interlock limits:\nMax: 60°C')
            led.channel = self.prefix+cell[0].replace('T-Mon', 'Tms-Mon')
            lay_temp2.addRow('Cell '+str(idx + 1)+': ', led)

        lay_dtemp = QFormLayout()
        lay_dtemp.setHorizontalSpacing(9)
        lay_dtemp.setVerticalSpacing(9)
        lay_dtemp.setLabelAlignment(Qt.AlignRight)
        lay_dtemp.setFormAlignment(Qt.AlignTop | Qt.AlignHCenter)
        lb_dtemp = QLabel('Disc\nTemperatures\nThermostats', self)
        lb_dtemp.setStyleSheet(
            'font-weight:bold; qproperty-alignment:AlignCenter;')
        lay_dtemp.addRow(lb_dtemp)
        for idx, disc in enumerate(self.chs['Cav Sts']['Temp']['Discs']):
            led = SiriusLedAlert(self)
            led.setToolTip('Interlock limits:\nMax: 60°C')
            led.channel = self.prefix+disc
            lay_dtemp.addRow('Disc '+str(idx)+': ', led)

        self.led_hdflwrt1 = SiriusLedAlert(
            self, self.prefix+self.chs['Cav Sts']['FlwRt'][0])
        self.led_hdflwrt2 = SiriusLedAlert(
            self, self.prefix+self.chs['Cav Sts']['FlwRt'][1])
        self.led_hdflwrt3 = SiriusLedAlert(
            self, self.prefix+self.chs['Cav Sts']['FlwRt'][2])
        lay_flwrt = QFormLayout()
        lay_flwrt.setHorizontalSpacing(9)
        lay_flwrt.setVerticalSpacing(9)
        lay_flwrt.setLabelAlignment(Qt.AlignRight)
        lay_flwrt.setFormAlignment(Qt.AlignTop)
        lb_flwrf = QLabel('Flow Switches', self)
        lb_flwrf.setStyleSheet(
            'font-weight:bold; qproperty-alignment:AlignCenter;')
        lay_flwrt.addRow(lb_flwrf)
        lay_flwrt.addRow('Flow Switch 1: ', self.led_hdflwrt1)
        lay_flwrt.addRow('Flow Switch 2: ', self.led_hdflwrt2)
        lay_flwrt.addRow('Flow Switch 3: ', self.led_hdflwrt3)

        self.led_couppressure = SiriusLedAlert(
            self, self.prefix+self.chs['Cav Sts']['Vac']['Coupler ok'])
        self.led_pressure = SiriusLedAlert(self)
        self.led_pressure.setToolTip('Interlock limits:\nMax: 5e-7mBar')
        self.led_pressure.channel = \
            self.prefix+self.chs['Cav Sts']['Vac']['Cells ok']
        lay_vac = QFormLayout()
        lay_vac.setHorizontalSpacing(9)
        lay_vac.setVerticalSpacing(9)
        lay_vac.setLabelAlignment(Qt.AlignRight)
        lay_vac.setFormAlignment(Qt.AlignTop)
        lb_vac = QLabel('Vacuum', self)
        lb_vac.setStyleSheet(
            'font-weight:bold; qproperty-alignment:AlignCenter;')
        lay_flwrt.addRow(lb_vac)
        lay_vac.addRow('Pressure Sensor: ', self.led_couppressure)
        lay_vac.addRow('Vacuum: ', self.led_pressure)

        lbl = QLabel('Cavity - Detailed Status', self)
        lbl.setStyleSheet(
            'font-weight:bold; qproperty-alignment:AlignCenter;')
        lay = QGridLayout(self)
        lay.setHorizontalSpacing(30)
        lay.setVerticalSpacing(20)
        lay.addWidget(lbl, 0, 0, 1, 4)
        lay.addLayout(lay_temp1, 1, 0, 2, 1)
        lay.addLayout(lay_temp2, 1, 1, 2, 1)
        lay.addLayout(lay_dtemp, 1, 2, 2, 1)
        lay.addLayout(lay_flwrt, 1, 3)
        lay.addLayout(lay_vac, 2, 3)

        self.setStyleSheet("""
            PyDMLabel{
                qproperty-alignment: AlignLeft;
            }
            QLed{
                max-width: 1.29em;
            }
            .QLabel{
                max-height:4em;
                qproperty-alignment: AlignRight;
            }""")
예제 #19
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(DataWriter, self).connection_changed(connected)

        if not build:
            return

        self._node = nodeFromAddress(self.channel)
        self._path = self.channel

        vb = QVBoxLayout()
        self.setLayout(vb)

        gb = QGroupBox('Data File Control ({}) '.format(self._node.name))
        vb.addWidget(gb)

        vb = QVBoxLayout()
        gb.setLayout(vb)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vb.addLayout(fl)

        self._dataFile = PyRogueLineEdit(parent=None,
                                         init_channel=self._path + '.DataFile')
        self._dataFile.alarmSensitiveContent = False
        self._dataFile.alarmSensitiveBorder = True
        fl.addRow('Data File:', self._dataFile)

        hb = QHBoxLayout()
        vb.addLayout(hb)

        self._browsebutton = QPushButton('Browse')
        self._browsebutton.clicked.connect(self._browse)
        hb.addWidget(self._browsebutton)

        self._autonamebutton = PyDMPushButton(label='Auto Name',
                                              pressValue=1,
                                              init_channel=self._path +
                                              '.AutoName')
        hb.addWidget(self._autonamebutton)

        self._openbutton = PyDMPushButton(label='Open',
                                          pressValue=1,
                                          init_channel=self._path + '.Open')
        self._openbutton.clicked.connect(self._openDataFile)
        hb.addWidget(self._openbutton)

        self._closebutton = PyDMPushButton(label='Close',
                                           pressValue=1,
                                           init_channel=self._path + '.Close')
        self._closebutton.check_enable_state = lambda: None
        self._closebutton.clicked.connect(self._closeDataFile)
        self._closebutton.setEnabled(False)
        hb.addWidget(self._closebutton)

        hb = QHBoxLayout()
        vb.addLayout(hb)

        vbl = QVBoxLayout()
        hb.addLayout(vbl)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vbl.addLayout(fl)

        w = PyRogueLineEdit(parent=None,
                            init_channel=self._path + '.BufferSize')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = True
        fl.addRow('Buffer Size:', w)

        w = PyDMLabel(parent=None, init_channel=self._path + '.IsOpen/disp')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = True
        fl.addRow('File Open:', w)

        w = PyDMLabel(parent=None, init_channel=self._path + '.CurrentSize')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = True
        fl.addRow('Current File Size:', w)

        vbr = QVBoxLayout()
        hb.addLayout(vbr)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vbr.addLayout(fl)

        w = PyRogueLineEdit(parent=None,
                            init_channel=self._path + '.MaxFileSize')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = True
        fl.addRow('Max Size:', w)

        w = PyDMLabel(parent=None, init_channel=self._path + '.FrameCount')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = True
        fl.addRow('Frame Count:', w)

        w = PyDMLabel(parent=None, init_channel=self._path + '.TotalSize')
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = True
        fl.addRow('Total File Size:', w)
예제 #20
0
    def _imgIntesityAndBGWidget(self):
        label_EnblAdjust = QLabel('Enable Scale and Offset Adjust:', self)
        hbox_EnblAdjust = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='EnblOffsetScale',
                                               propty_type='enbldisabl')

        label_AutoAdjust = QLabel('Automatic Intensity Adjust:', self)
        hbox_AutoAdjust = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='AutoOffsetScale',
                                               cmd={
                                                   'label': 'Auto Adjust',
                                                   'pressValue': 1,
                                                   'name': 'AutoOffsetScale'
                                               })

        label_PixelScale = QLabel('Pixel Scale:', self)
        hbox_PixelScale = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='PixelScale',
                                               propty_type='sprb',
                                               use_linedit=True)

        label_PixelOffset = QLabel('Pixel Offset:', self)
        hbox_PixelOffset = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='PixelOffset',
                                                propty_type='sprb',
                                                use_linedit=True)

        label_EnblLowClip = QLabel('Enable Low Cliping:', self)
        hbox_EnblLowClip = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='EnblLowClip',
                                                propty_type='enbldisabl')

        label_LowClip = QLabel('Minimum Intensity for Low Cliping:', self)
        hbox_LowClip = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='LowClip',
                                            propty_type='sprb',
                                            use_linedit=True)

        label_EnblHighClip = QLabel('Enable High Cliping:', self)
        hbox_EnblHighClip = create_propty_layout(parent=self,
                                                 prefix=self.cam_prefix,
                                                 propty='EnblHighClip',
                                                 propty_type='enbldisabl')

        label_HighClip = QLabel('Maximum Intensity for High Cliping:', self)
        hbox_HighClip = create_propty_layout(parent=self,
                                             prefix=self.cam_prefix,
                                             propty='HighClip',
                                             propty_type='sprb',
                                             use_linedit=True)

        label_EnblBG = QLabel('Enable BG Subtraction:', self)
        hbox_EnblBG = create_propty_layout(parent=self,
                                           prefix=self.cam_prefix,
                                           propty='EnblBGSubtraction',
                                           propty_type='enbldisabl')

        label_SaveBG = QLabel('Save BG:', self)
        hbox_SaveBG = create_propty_layout(parent=self,
                                           prefix=self.cam_prefix,
                                           propty='SaveBG',
                                           cmd={
                                               'label': 'Save',
                                               'pressValue': 1,
                                               'name': 'SaveBG'
                                           })

        label_ValidBG = QLabel('Is valid BG?', self)
        hbox_ValidBG = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='ValidBG',
                                            propty_type='mon')

        wid = QWidget()
        flay = QFormLayout(wid)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignHCenter)
        flay.addRow(label_EnblAdjust, hbox_EnblAdjust)
        flay.addRow(label_AutoAdjust, hbox_AutoAdjust)
        flay.addRow(label_PixelScale, hbox_PixelScale)
        flay.addRow(label_PixelOffset, hbox_PixelOffset)
        flay.addRow(label_EnblLowClip, hbox_EnblLowClip)
        flay.addRow(label_LowClip, hbox_LowClip)
        flay.addRow(label_EnblHighClip, hbox_EnblHighClip)
        flay.addRow(label_HighClip, hbox_HighClip)
        flay.addRow(label_EnblBG, hbox_EnblBG)
        flay.addRow(label_SaveBG, hbox_SaveBG)
        flay.addRow(label_ValidBG, hbox_ValidBG)
        return wid
예제 #21
0
    def _acquisitionWidget(self):
        label_CamEnbl = QLabel('Acquire Enable Status:', self)
        hbox_CamEnbl = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='Enbl',
                                            propty_type='enbldisabl')

        label_FrameCnt = QLabel('Frame Count:', self)
        hbox_FrameCnt = create_propty_layout(parent=self,
                                             prefix=self.cam_prefix,
                                             propty='FrameCnt',
                                             propty_type='mon')

        label_AcqMode = QLabel('Acquire Mode:', self)
        hbox_AcqMode = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='AcqMode',
                                            propty_type='enum')

        label_AcqPeriod = QLabel('Acquire Period [s]:', self)
        hbox_AcqPeriod = create_propty_layout(parent=self,
                                              prefix=self.cam_prefix,
                                              propty='AcqPeriod',
                                              propty_type='sprb')

        label_AcqPeriodLowLim = QLabel('Acquire Period Low Limit [s]:', self)
        hbox_AcqPeriodLowLim = create_propty_layout(parent=self,
                                                    prefix=self.cam_prefix,
                                                    propty='AcqPeriodLowLim',
                                                    propty_type='sprb')

        label_ExpMode = QLabel('Exposure Mode:', self)
        hbox_ExpMode = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='ExposureMode',
                                            propty_type='enum')

        label_ExpTime = QLabel('Exposure Time [us]:', self)
        hbox_ExpTime = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            propty='ExposureTime',
                                            propty_type='sprb')

        label_Gain = QLabel('Gain [dB]:', self)
        hbox_Gain = create_propty_layout(parent=self,
                                         prefix=self.cam_prefix,
                                         propty='Gain',
                                         propty_type='sprb',
                                         cmd={
                                             'label': '',
                                             'pressValue': 1,
                                             'width': '25',
                                             'height': '25',
                                             'icon': qta.icon('mdi.auto-fix'),
                                             'icon-size': '20',
                                             'toolTip': 'Auto Gain',
                                             'name': 'AutoGain'
                                         })

        label_TransformType = QLabel('Transform Type:', self)
        hbox_TransformType = create_propty_layout(parent=self,
                                                  prefix=self.cam_prefix,
                                                  propty='TransformType',
                                                  propty_type='enum')

        label_BlackLevel = QLabel('Black Level [gray va]:', self)
        hbox_BlackLevel = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='BlackLevel',
                                               propty_type='sprb')

        label_DebouncerPeriod = QLabel('Debouncer Period [us]:', self)
        hbox_DebouncerPeriod = create_propty_layout(parent=self,
                                                    prefix=self.cam_prefix,
                                                    propty='DebouncerPeriod',
                                                    propty_type='sprb')

        self.pb_advanced = QPushButton('Advanced', self)
        my_window = create_window_from_widget(
            BaslerCamAcqAdvSettings,
            is_main=False,
            title='Basler Camera Advanced Acquisition Settings')
        util.connect_window(self.pb_advanced,
                            my_window,
                            parent=self,
                            device=self.device,
                            prefix=self.prefix)
        hbox_adv = QHBoxLayout()
        hbox_adv.addWidget(self.pb_advanced, alignment=Qt.AlignRight)

        wid = QWidget()
        flay = QFormLayout(wid)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignHCenter)
        flay.addRow(label_CamEnbl, hbox_CamEnbl)
        flay.addRow(label_FrameCnt, hbox_FrameCnt)
        flay.addRow(label_AcqMode, hbox_AcqMode)
        flay.addRow(label_AcqPeriod, hbox_AcqPeriod)
        flay.addRow(label_AcqPeriodLowLim, hbox_AcqPeriodLowLim)
        flay.addRow(label_ExpMode, hbox_ExpMode)
        flay.addRow(label_ExpTime, hbox_ExpTime)
        flay.addRow(label_Gain, hbox_Gain)
        flay.addRow(label_BlackLevel, hbox_BlackLevel)
        flay.addRow(label_DebouncerPeriod, hbox_DebouncerPeriod)
        flay.addRow(label_TransformType, hbox_TransformType)
        flay.addRow(hbox_adv)
        return wid
예제 #22
0
    def _setupUi(self):
        cw = QWidget(self)
        self.setCentralWidget(cw)
        lay = QFormLayout(cw)
        lay.setLabelAlignment(Qt.AlignRight)
        lay.setFormAlignment(Qt.AlignCenter)

        # title
        self.title_label = QLabel('<h3>' + self.title + '<h3>',
                                  self,
                                  alignment=Qt.AlignCenter)
        self.title_label.setObjectName('title')
        pal = self.title_label.palette()
        pal.setColor(QPalette.Background, self.background)
        self.title_label.setAutoFillBackground(True)
        self.title_label.setPalette(pal)
        lay.addRow(self.title_label)

        label_enbl = QLabel('Enable: ', self)
        self.bt_enbl = PyDMStateButton(
            self,
            self.dev.substitute(propty='Enbl' + self.mtyp + 'Mark' + self.idx +
                                '-Sel'))
        self.bt_enbl.shape = 1
        self.led_enbl = SiriusLedState(
            self,
            self.dev.substitute(propty='Enbl' + self.mtyp + 'Mark' + self.idx +
                                '-Sts'))
        hbox_enbl = QHBoxLayout()
        hbox_enbl.addWidget(self.bt_enbl)
        hbox_enbl.addWidget(self.led_enbl)
        lay.addRow(label_enbl, hbox_enbl)

        label_enblautomax = QLabel('Auto Max Peak: ', self)
        ch_enblautomax = self.dev.substitute(propty='Enbl' + self.mtyp +
                                             'MaxAuto' + self.idx + '-Sel')
        self.enblAutoMaxChannel = SiriusConnectionSignal(ch_enblautomax)
        self.enblAutoMaxChannel.new_value_signal[int].connect(
            self._handle_values_visibility)
        self.bt_enblautomax = PyDMStateButton(self, ch_enblautomax)
        self.bt_enblautomax.shape = 1
        self.led_enblautomax = SiriusLedState(
            self,
            self.dev.substitute(propty='Enbl' + self.mtyp + 'MaxAuto' +
                                self.idx + '-Sts'))
        hbox_enblautomax = QHBoxLayout()
        hbox_enblautomax.addWidget(self.bt_enblautomax)
        hbox_enblautomax.addWidget(self.led_enblautomax)
        lay.addRow(label_enblautomax, hbox_enblautomax)

        label_x = QLabel(' X: ', self)
        self.sb_x = PyDMLineEdit(
            self,
            self.dev.substitute(propty=self.mtyp + 'MarkX' + self.idx + '-SP'))
        self.lb_x = PyDMLabel(
            self,
            self.dev.substitute(propty=self.mtyp + 'MarkX' + self.idx + '-RB'))
        hbox_x = QHBoxLayout()
        hbox_x.addWidget(self.sb_x)
        hbox_x.addWidget(self.lb_x)
        lay.addRow(label_x, hbox_x)

        label_y = QLabel(' Y: ', self)
        self.lb_y = PyDMLabel(
            self,
            self.dev.substitute(propty=self.mtyp + 'MarkY' + self.idx +
                                '-Mon'))
        hbox_y = QHBoxLayout()
        hbox_y.addWidget(self.lb_y)
        if self.mtyp == 'D':
            self.lb_dynamicY = PyDMLabel(
                self,
                self.dev.substitute(propty='DynamicDX' + self.idx + '-Mon'))
            self.lb_dynamicY.setVisible(False)
            hbox_y.addWidget(self.lb_dynamicY)
        lay.addRow(label_y, hbox_y)

        self.pb_max = PyDMPushButton(
            parent=self,
            label='Mark Max Peak',
            pressValue=1,
            init_channel=self.dev.substitute(propty=self.mtyp + 'MarkMax' +
                                             self.idx + '-Cmd'))
        self.pb_maxnext = PyDMPushButton(
            parent=self,
            label='Mark Max Next',
            pressValue=1,
            init_channel=self.dev.substitute(propty=self.mtyp + 'MarkMaxNext' +
                                             self.idx + '-Cmd'))
        self.pb_maxright = PyDMPushButton(
            parent=self,
            label='Mark Max Right',
            pressValue=1,
            init_channel=self.dev.substitute(
                propty=self.mtyp + 'MarkMaxRight' + self.idx + '-Cmd'))
        self.pb_maxleft = PyDMPushButton(
            parent=self,
            label='Mark Max Left',
            pressValue=1,
            init_channel=self.dev.substitute(propty=self.mtyp + 'MarkMaxLeft' +
                                             self.idx + '-Cmd'))
        vbox_cmd = QVBoxLayout()
        vbox_cmd.addWidget(self.pb_max)
        vbox_cmd.addWidget(self.pb_maxnext)
        vbox_cmd.addWidget(self.pb_maxright)
        vbox_cmd.addWidget(self.pb_maxleft)
        lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow(vbox_cmd)

        if self.mtyp == '' and self.idx == '1':
            lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))

            label_enblautomin = QLabel('Enable Auto Min: ', self)
            self.bt_enblautomin = PyDMStateButton(
                self, self.dev.substitute(propty='EnblMinAuto-Sel'))
            self.bt_enblautomin.shape = 1
            self.led_enblautomin = SiriusLedState(
                self, self.dev.substitute(propty='EnblMinAuto-Sts'))
            hbox_enblautomin = QHBoxLayout()
            hbox_enblautomin.addWidget(self.bt_enblautomin)
            hbox_enblautomin.addWidget(self.led_enblautomin)
            lay.addRow(label_enblautomin, hbox_enblautomin)

            label_enbllimit = QLabel('Enable Mark Limit: ', self)
            self.bt_enbllimit = PyDMStateButton(
                self, self.dev.substitute(propty='EnblMarkLimit-Sel'))
            self.bt_enbllimit.shape = 1
            self.led_enbllimit = SiriusLedState(
                self, self.dev.substitute(propty='EnblMarkLimit-Sts'))
            hbox_enbllimit = QHBoxLayout()
            hbox_enbllimit.addWidget(self.bt_enbllimit)
            hbox_enbllimit.addWidget(self.led_enbllimit)
            lay.addRow(label_enbllimit, hbox_enbllimit)

            label_limright = QLabel('Mark Limit Right: ', self)
            self.sb_limright = PyDMLineEdit(
                self, self.dev.substitute(propty='MarkLimitRight-SP'))
            self.lb_limright = PyDMLabel(
                self, self.dev.substitute(propty='MarkLimitRight-RB'))
            hbox_limright = QHBoxLayout()
            hbox_limright.addWidget(self.sb_limright)
            hbox_limright.addWidget(self.lb_limright)
            lay.addRow(label_limright, hbox_limright)

            label_limleft = QLabel('Mark Limit Left: ', self)
            self.sb_limleft = PyDMLineEdit(
                self, self.dev.substitute(propty='MarkLimitLeft-SP'))
            self.lb_limleft = PyDMLabel(
                self, self.dev.substitute(propty='MarkLimitLeft-RB'))
            hbox_limleft = QHBoxLayout()
            hbox_limleft.addWidget(self.sb_limleft)
            hbox_limleft.addWidget(self.lb_limleft)
            lay.addRow(label_limleft, hbox_limleft)

        self.setStyleSheet("""
            QLed{
                min-width:1.29em; max-width:1.29em;
            }
            #title {
                min-height:1.29em; max-height:1.29em;
                qproperty-alignment: "AlignVCenter | AlignHCenter";
            }
            PyDMLabel, PyDMSpinbox, PyDMEnumComboBox,
            PyDMStateButton{
                min-width:6em; max-width:6em;
            }""")
예제 #23
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(Process, self).connection_changed(connected)

        if not build:
            return

        self._node = nodeFromAddress(self.channel)
        self._path = self.channel

        vb = QVBoxLayout()
        self.setLayout(vb)

        gb = QGroupBox('Process ({})'.format(self._node.name))
        vb.addWidget(gb)

        vb = QVBoxLayout()
        gb.setLayout(vb)

        hb = QHBoxLayout()
        vb.addLayout(hb)

        w = PyDMPushButton(label='Start',
                           pressValue=1,
                           init_channel=self._path + '.Start')
        hb.addWidget(w)

        w = PyDMPushButton(label='Stop',
                           pressValue=1,
                           init_channel=self._path + '.Stop')
        hb.addWidget(w)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        fl.setLabelAlignment(Qt.AlignRight)
        hb.addLayout(fl)

        w = PyRogueLineEdit(parent=None,
                            init_channel=self._path + '.Running/disp')
        w.showUnits = False
        w.precisionFromPV = False
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = False

        fl.addRow('Running:', w)

        fl = QFormLayout()
        fl.setRowWrapPolicy(QFormLayout.DontWrapRows)
        fl.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)
        fl.setLabelAlignment(Qt.AlignRight)
        vb.addLayout(fl)

        w = PyDMScaleIndicator(parent=None,
                               init_channel=self._path + '.Progress')
        w.showUnits = False
        w.precisionFromPV = True
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = False
        w.showValue = False
        w.showLimits = False
        w.showTicks = False
        w.barIndicator = True

        fl.addRow('Progress:', w)

        w = PyRogueLineEdit(parent=None,
                            init_channel=self._path + '.Message/disp')
        w.showUnits = False
        w.precisionFromPV = False
        w.alarmSensitiveContent = False
        w.alarmSensitiveBorder = False

        fl.addRow('Message:', w)

        # Auto add additional fields
        noAdd = ['enable', 'Start', 'Stop', 'Running', 'Progress', 'Message']

        prc = nodeFromAddress(self.channel)

        for k, v in prc.nodes.items():
            if v.name not in noAdd and not v.hidden:
                if v.disp == 'enum' and v.enum is not None and v.mode != 'RO' and v.typeStr != 'list':
                    w = PyDMEnumComboBox(parent=None,
                                         init_channel=self._path +
                                         '.{}'.format(v.name))
                    w.alarmSensitiveContent = False
                    w.alarmSensitiveBorder = True

                elif v.minimum is not None and v.maximum is not None and v.disp == '{}' and (
                        v.mode != 'RO' or v.isCommand):
                    w = PyDMSpinbox(parent=None,
                                    init_channel=self._path +
                                    '.{}'.format(v.name))
                    w.precision = 0
                    w.showUnits = False
                    w.precisionFromPV = False
                    w.alarmSensitiveContent = False
                    w.alarmSensitiveBorder = True
                    w.showStepExponent = False
                    w.writeOnPress = True

                elif v.mode == 'RO' and not v.isCommand:
                    w = PyDMLabel(parent=None,
                                  init_channel=self._path +
                                  '.{}/disp'.format(v.name))
                    w.showUnits = False
                    w.precisionFromPV = True
                    w.alarmSensitiveContent = False
                    w.alarmSensitiveBorder = True
                else:
                    w = PyRogueLineEdit(parent=None,
                                        init_channel=self._path +
                                        '.{}/disp'.format(v.name))
                    w.showUnits = False
                    w.precisionFromPV = True
                    w.alarmSensitiveContent = False
                    w.alarmSensitiveBorder = True

                fl.addRow(v.name + ':', w)
예제 #24
0
    def _roiLayout(self):
        # StartX
        lbl_roistartx = QLabel('Start X [MHz]', self)
        self.le_roistartx = PyDMLineEdit(
            self, self.device.substitute(propty='ROIOffsetX-SP'))
        self.le_roistartx.precisionFromPV = True
        self.lb_roistartx = PyDMLabel(
            self, self.device.substitute(propty='ROIOffsetX-RB'))
        hbox_roistartx = QHBoxLayout()
        hbox_roistartx.addWidget(self.le_roistartx)
        hbox_roistartx.addWidget(self.lb_roistartx)

        # Width
        lbl_roiwidth = QLabel('Width [MHz]', self)
        self.le_roiwidth = PyDMLineEdit(
            self, self.device.substitute(propty='ROIWidth-SP'))
        self.le_roiwidth.precisionFromPV = True
        self.lb_roiwidth = PyDMLabel(
            self, self.device.substitute(propty='ROIWidth-RB'))
        hbox_roiwidth = QHBoxLayout()
        hbox_roiwidth.addWidget(self.le_roiwidth)
        hbox_roiwidth.addWidget(self.lb_roiwidth)

        # StartY
        lbl_roistarty = QLabel('Start Y [ms]', self)
        self.le_roistarty = PyDMLineEdit(
            self, self.device.substitute(propty='ROIOffsetY-SP'))
        self.le_roistarty.precisionFromPV = True
        self.lb_roistarty = PyDMLabel(
            self, self.device.substitute(propty='ROIOffsetY-RB'))
        hbox_roistarty = QHBoxLayout()
        hbox_roistarty.addWidget(self.le_roistarty)
        hbox_roistarty.addWidget(self.lb_roistarty)

        # Height
        lbl_roiheight = QLabel('Height [ms]', self)
        self.le_roiheight = PyDMLineEdit(
            self, self.device.substitute(propty='ROIHeight-SP'))
        self.le_roiheight.precisionFromPV = True
        self.lb_roiheight = PyDMLabel(
            self, self.device.substitute(propty='ROIHeight-RB'))
        hbox_roiheight = QHBoxLayout()
        hbox_roiheight.addWidget(self.le_roiheight)
        hbox_roiheight.addWidget(self.lb_roiheight)

        # Auto adjust
        lbl_roiauto = QLabel('Auto Positioning', self)
        self.bt_roiauto = PyDMStateButton(
            self, self.device.substitute(propty='ROIAuto-Sel'))
        self.bt_roiauto.shape = 1
        self.led_roiauto = SiriusLedState(
            self, self.device.substitute(propty='ROIAuto-Sts'))
        hbox_roiauto = QHBoxLayout()
        hbox_roiauto.addWidget(self.bt_roiauto)
        hbox_roiauto.addWidget(self.led_roiauto)

        lay = QFormLayout()
        lay.setLabelAlignment(Qt.AlignRight)
        lay.setFormAlignment(Qt.AlignCenter)
        lay.addRow(lbl_roistartx, hbox_roistartx)
        lay.addRow(lbl_roiwidth, hbox_roiwidth)
        lay.addRow(lbl_roistarty, hbox_roistarty)
        lay.addRow(lbl_roiheight, hbox_roiheight)
        lay.addRow(lbl_roiauto, hbox_roiauto)
        return lay
예제 #25
0
    def _infoWidget(self):
        label_DevID = QLabel('Device ID:', self)
        hbox_DevID = create_propty_layout(parent=self,
                                          prefix=self.cam_prefix,
                                          width=15,
                                          propty='DeviceID',
                                          propty_type='cte')
        hbox_DevID.setAlignment(Qt.AlignLeft)

        label_DevVers = QLabel('Device Version:', self)
        hbox_DevVers = create_propty_layout(parent=self,
                                            prefix=self.cam_prefix,
                                            width=15,
                                            propty='DeviceVersion',
                                            propty_type='cte')
        hbox_DevVers.setAlignment(Qt.AlignLeft)

        label_DevModelName = QLabel('Device Model Name:', self)
        hbox_DevModelName = create_propty_layout(parent=self,
                                                 prefix=self.cam_prefix,
                                                 width=15,
                                                 propty='DeviceModelName',
                                                 propty_type='cte')
        hbox_DevModelName.setAlignment(Qt.AlignLeft)

        label_DevVendorName = QLabel('Device Vendor Name:', self)
        hbox_DevVendorName = create_propty_layout(parent=self,
                                                  prefix=self.cam_prefix,
                                                  width=15,
                                                  propty='DeviceVendorName',
                                                  propty_type='cte')
        hbox_DevVendorName.setAlignment(Qt.AlignLeft)

        label_DevFirmVers = QLabel('Firmware Version:', self)
        hbox_DevFirmVers = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                width=15,
                                                propty='DeviceFirmwareVersion',
                                                propty_type='cte')
        hbox_DevFirmVers.setAlignment(Qt.AlignLeft)

        label_SensorHeight = QLabel('Sensor Height [pixels]:', self)
        hbox_SensorHeight = create_propty_layout(parent=self,
                                                 prefix=self.cam_prefix,
                                                 width=15,
                                                 propty='SensorHeight',
                                                 propty_type='cte')
        hbox_SensorHeight.setAlignment(Qt.AlignLeft)

        label_SensorWidth = QLabel('Sensor Width [pixels]:', self)
        hbox_SensorWidth = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                width=15,
                                                propty='SensorWidth',
                                                propty_type='cte')
        hbox_SensorWidth.setAlignment(Qt.AlignLeft)

        wid = QWidget()
        flay = QFormLayout(wid)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignHCenter)
        flay.addRow(label_DevID, hbox_DevID)
        flay.addRow(label_DevVers, hbox_DevVers)
        flay.addRow(label_DevModelName, hbox_DevModelName)
        flay.addRow(label_DevVendorName, hbox_DevVendorName)
        flay.addRow(label_DevFirmVers, hbox_DevFirmVers)
        flay.addRow(label_SensorHeight, hbox_SensorHeight)
        flay.addRow(label_SensorWidth, hbox_SensorWidth)
        return wid
예제 #26
0
    def _ROIWidget(self):
        label_MaxWidth = QLabel('Maximum Width [pixels]:', self)
        self.PyDMLabel_MaxWidth = PyDMLabel(
            self, self.cam_prefix.substitute(propty='SensorWidth-Cte'))
        self.PyDMLabel_MaxWidth.setStyleSheet(
            """max-width:7.10em; max-height:1.29em;""")

        label_MaxHeight = QLabel('Maximum Height [pixels]:', self)
        self.PyDMLabel_MaxHeight = PyDMLabel(
            self, self.cam_prefix.substitute(propty='SensorHeight-Cte'))
        self.PyDMLabel_MaxHeight.setStyleSheet(
            """max-width:7.10em; max-height:1.29em;""")

        label_ROIWidth = QLabel('Width [pixels]:', self)
        hbox_ROIWidth = create_propty_layout(parent=self,
                                             prefix=self.cam_prefix,
                                             propty='AOIWidth',
                                             propty_type='sprb')

        label_ROIHeight = QLabel('Heigth [pixels]:', self)
        hbox_ROIHeight = create_propty_layout(parent=self,
                                              prefix=self.cam_prefix,
                                              propty='AOIHeight',
                                              propty_type='sprb')

        label_ROIOffsetX = QLabel('Offset X [pixels]:', self)
        hbox_ROIOffsetX = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='AOIOffsetX',
                                               propty_type='sprb')

        label_ROIOffsetY = QLabel('Offset Y [pixels]:', self)
        hbox_ROIOffsetY = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='AOIOffsetY',
                                               propty_type='sprb')

        label_AutoCenterX = QLabel('Auto Center X:', self)
        hbox_AutoCenterX = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='AOIAutoCenterX',
                                                propty_type='offon')

        label_AutoCenterY = QLabel('Auto Center Y:', self)
        hbox_AutoCenterY = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='AOIAutoCenterY',
                                                propty_type='offon')

        wid = QWidget()
        flay = QFormLayout(wid)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignHCenter)
        flay.addRow(label_MaxWidth, self.PyDMLabel_MaxWidth)
        flay.addRow(label_MaxHeight, self.PyDMLabel_MaxHeight)
        flay.addRow(label_ROIWidth, hbox_ROIWidth)
        flay.addRow(label_ROIHeight, hbox_ROIHeight)
        flay.addRow(label_ROIOffsetX, hbox_ROIOffsetX)
        flay.addRow(label_ROIOffsetY, hbox_ROIOffsetY)
        flay.addRow(label_AutoCenterX, hbox_AutoCenterX)
        flay.addRow(label_AutoCenterY, hbox_AutoCenterY)
        return wid
예제 #27
0
    def _measLayout(self):
        # Acquisition
        lbl_acq = QLabel('Acquisition', self)
        self.bt_acq = PyDMStateButton(
            self, self.device.substitute(propty='SpecAnaGetSpec-Sel'))
        self.bt_acq.shape = 1
        self.led_acq = SiriusLedState(
            self, self.device.substitute(propty='SpecAnaGetSpec-Sts'))
        hbox_acq = QHBoxLayout()
        hbox_acq.addWidget(self.bt_acq)
        hbox_acq.addWidget(self.led_acq)

        # Excitation
        lbl_drive = QLabel('Excitation', self)
        self.bt_drive = PyDMStateButton(
            self, self.device.substitute(propty='Enbl-Sel'))
        self.bt_drive.shape = 1
        value = 0b111 if self.section == 'BO' else 1
        self.led_drive = PyDMLedMultiChannel(
            parent=self,
            channels2values={self.device.substitute(propty='Enbl-Sts'): value})
        self.led_drive.setOffColor(PyDMLed.DarkGreen)
        hbox_drive = QHBoxLayout()
        hbox_drive.addWidget(self.bt_drive)
        hbox_drive.addWidget(self.led_drive)

        # Excitation Status Detailed
        gbox_enblsts = QGridLayout()
        lbl_enblsts = QLabel('Excitation\nEnable Status\nDetailed',
                             self,
                             alignment=Qt.AlignVCenter | Qt.AlignRight)
        if self.section == 'BO':
            # # Carrier Generator
            self.led_carrier = SiriusLedState(
                self, self.device.substitute(propty='EnblCarrierGen-Sts'))
            gbox_enblsts.addWidget(self.led_carrier, 0, 0)
            gbox_enblsts.addWidget(QLabel('Carrier Generator'), 0, 1)
            # # Noise Generator
            self.led_noise = SiriusLedState(
                self, self.device.substitute(propty='EnblNoiseGen-Sts'))
            gbox_enblsts.addWidget(self.led_noise, 1, 0)
            gbox_enblsts.addWidget(QLabel('Noise Generator'), 1, 1)
        else:
            # # Noise Generator
            self.led_trkgen = SiriusLedState(
                self, self.device.substitute(propty='SpecAnaTrkGen-Sts'))
            gbox_enblsts.addWidget(self.led_trkgen, 1, 0)
            gbox_enblsts.addWidget(QLabel('Tracking Generator'), 1, 1)
        # # Amplifier
        self.led_amp = SiriusLedState(
            self, self.device.substitute(propty='EnblAmp-Sts'))
        gbox_enblsts.addWidget(self.led_amp, 2, 0)
        gbox_enblsts.addWidget(QLabel('Amplifier'), 2, 1)

        if self.section == 'BO':
            # Frame Count
            lbl_acqcnt = QLabel('Frame Count', self)
            dev = self.device.substitute(dev='TuneProc')
            self.lb_acqcnt = PyDMLabel(self,
                                       dev.substitute(propty='FrameCount-Mon'))
            self.lb_acqcnt.setAlignment(Qt.AlignCenter)
            self.led_acqcnt = PyDMLedMultiChannel(parent=self)
            self.trigNrPulseChannel = SiriusConnectionSignal(
                self.trigger.substitute(prefix=self.prefix,
                                        propty='NrPulses-RB'))
            self.trigNrPulseChannel.new_value_signal[int].connect(
                self._updateNrAcq)
            hbox_acqcnt = QHBoxLayout()
            hbox_acqcnt.addWidget(self.lb_acqcnt)
            hbox_acqcnt.addWidget(self.led_acqcnt)

        # Nr. Samples p/ spec
        lbl_nrsmp = QLabel('Nr. Samples p/ Spec.', self)
        self.lb_nrsmp = PyDMLabel(parent=self,
                                  init_channel=self.device.substitute(
                                      dev='TuneProc',
                                      propty_name='SwePts',
                                      propty_suffix='RB'))

        if self.section == 'SI':
            # Acquisition Time
            lbl_acqtime = QLabel('Acq. Time', self)
            self.cb_acqtime = PyDMEnumComboBox(
                parent=self,
                init_channel=self.device.substitute(dev='TuneProc',
                                                    propty_name='Trace',
                                                    propty_suffix='Mon',
                                                    field='SCAN'))

            # Sweep time
            lbl_swetime = QLabel('Sweep Time [ms]', self)
            self.lb_swetime = PyDMLabel(parent=self,
                                        init_channel=self.device.substitute(
                                            dev='TuneProc',
                                            propty_name='SweTime',
                                            propty_suffix='Mon'))

        # Span
        lbl_span = QLabel('Span [kHz]', self)
        self.le_span = PyDMLineEdit(self,
                                    self.device.substitute(propty='Span-SP'))
        self.le_span.precisionFromPV = True
        self.lb_span = PyDMLabel(self,
                                 self.device.substitute(propty='Span-RB'))
        hbox_span = QHBoxLayout()
        hbox_span.addWidget(self.le_span)
        hbox_span.addWidget(self.lb_span)

        # RBW
        lbl_rbw = QLabel('RBW', self)
        if self.section == 'BO':
            self.cb_rbw = PyDMEnumComboBox(
                self, self.device.substitute(propty='SpecAnaRBW-Sel'))
        else:
            items = [
                '1 Hz', '2 Hz', '3 Hz', '5 Hz', '10 Hz', '20 Hz', '30 Hz',
                '50 Hz', '100 Hz', '200 Hz', '300 Hz', '500 Hz', '1 kHz',
                '2 kHz', '3 kHz', '5 kHz', '6.25 kHz', '10 kHz', '20 kHz',
                '30 kHz', '50 kHz', '100 kHz', '200 kHz', '300 kHz', '500 kHz',
                '1 MHz', '2 MHz', '3 MHz', '5 MHz', '10 MHz'
            ]
            self.cb_rbw = SiriusStringComboBox(
                self,
                self.device.substitute(propty='SpecAnaRBW-Sel'),
                items=items)
        self.lb_rbw = PyDMLabel(
            self, self.device.substitute(propty='SpecAnaRBW-Sts'))
        hbox_rbw = QHBoxLayout()
        hbox_rbw.addWidget(self.cb_rbw)
        hbox_rbw.addWidget(self.lb_rbw)

        # Harmonic
        lbl_h = QLabel('Harmonic (n)', self)
        self.sb_h = PyDMSpinbox(self, self.device.substitute(propty='RevN-SP'))
        self.sb_h.showStepExponent = False
        self.sb_h.precisionFromPV = True
        self.lb_h = PyDMLabel(self, self.device.substitute(propty='RevN-RB'))
        hbox_h = QHBoxLayout()
        hbox_h.addWidget(self.sb_h)
        hbox_h.addWidget(self.lb_h)

        # Harmonic Frequency
        lbl_Fh = QLabel('Harm. Freq. [kHz]', self)
        self.lb_Fh = PyDMLabel(parent=self)
        self.lb_Fh.setToolTip('Frf/(h*n)')
        self.lb_Fh.channel = self.device.substitute(propty='FreqRevN-Mon')

        # Frequency Offset
        lbl_foff = QLabel('Frequency Offset [kHz]', self)
        self.sb_foff = PyDMSpinbox(self,
                                   self.device.substitute(propty='FreqOff-SP'))
        self.sb_foff.showStepExponent = False
        self.sb_foff.precisionFromPV = True
        self.lb_foff = PyDMLabel(self,
                                 self.device.substitute(propty='FreqOff-RB'))
        hbox_foff = QHBoxLayout()
        hbox_foff.addWidget(self.sb_foff)
        hbox_foff.addWidget(self.lb_foff)

        # Center Frequency
        lbl_Fc = QLabel('Center Frequency [MHz]', self)
        self.le_Fc = PyDMLineEdit(
            self, self.device.substitute(propty='CenterFreq-SP'))
        self.le_Fc.precisionFromPV = True
        self.lb_Fc = PyDMLabel(self,
                               self.device.substitute(propty='CenterFreq-RB'))
        hbox_Fc = QHBoxLayout()
        hbox_Fc.addWidget(self.le_Fc)
        hbox_Fc.addWidget(self.lb_Fc)

        # Lock Center Freq.
        lbl_autoFc = QLabel('Lock Center Frequency ', self)
        self.bt_autoFc = PyDMStateButton(
            self, self.device.substitute(propty='CenterFreqAuto-Sel'))
        self.bt_autoFc.shape = 1
        self.led_autoFc = SiriusLedState(
            self, self.device.substitute(propty='CenterFreqAuto-Sts'))
        hbox_autoFc = QHBoxLayout()
        hbox_autoFc.addWidget(self.bt_autoFc)
        hbox_autoFc.addWidget(self.led_autoFc)

        # Amplifier Gain
        lbl_drivegain = QLabel('Amplifier Gain [dB]', self)
        self.sb_drivegain = PyDMSpinbox(
            self, self.device.substitute(propty='AmpGain-SP'))
        self.sb_drivegain.showStepExponent = False
        self.sb_drivegain.precisionFromPV = True
        self.lb_drivegain = PyDMLabel(
            self, self.device.substitute(propty='AmpGain-RB'))
        hbox_drivegain = QHBoxLayout()
        hbox_drivegain.addWidget(self.sb_drivegain)
        hbox_drivegain.addWidget(self.lb_drivegain)

        if self.section == 'BO':
            # Auto Configure Excitation
            lbl_driveauto = QLabel('Auto Config. Excit.', self)
            self.bt_driveauto = PyDMStateButton(
                self, self.device.substitute(propty='DriveAuto-Sel'))
            self.bt_driveauto.shape = 1
            self.led_driveauto = SiriusLedState(
                self, self.device.substitute(propty='DriveAuto-Sts'))
            hbox_driveauto = QHBoxLayout()
            hbox_driveauto.addWidget(self.bt_driveauto)
            hbox_driveauto.addWidget(self.led_driveauto)

            # Noise Amplitude
            lbl_noiseamp = QLabel('Noise Amplitude [V]', self)
            self.sb_noiseamp = PyDMSpinbox(
                self, self.device.substitute(propty='NoiseAmpl-SP'))
            self.sb_noiseamp.showStepExponent = False
            self.sb_noiseamp.precisionFromPV = True
            self.lb_noiseamp = PyDMLabel(
                self, self.device.substitute(propty='NoiseAmpl-RB'))
            hbox_noiseamp = QHBoxLayout()
            hbox_noiseamp.addWidget(self.sb_noiseamp)
            hbox_noiseamp.addWidget(self.lb_noiseamp)
        else:
            # Noise Amplitude
            lbl_trkgenlvl = QLabel('Trk. Gen. Power [dBm]', self)
            self.sb_trkgenlvl = PyDMLineEdit(
                self, self.device.substitute(propty='SpecAnaTrkGenLvl-SP'))
            self.lb_trkgenlvl = PyDMLabel(
                self, self.device.substitute(propty='SpecAnaTrkGenLvl-RB'))
            hbox_trkgenlvl = QHBoxLayout()
            hbox_trkgenlvl.addWidget(self.sb_trkgenlvl)
            hbox_trkgenlvl.addWidget(self.lb_trkgenlvl)

            # Spectrum Acquisition
            lbl_getspec = QLabel('Spectrum Acq.', self)
            self.cb_getspec = PyDMStateButton(
                parent=self,
                init_channel=self.device.substitute(dev='TuneProc',
                                                    propty_name='GetSpectrum',
                                                    propty_suffix='Sel'))
            self.cb_getspec.shape = 1
            self.lb_getspec = PyDMLed(parent=self,
                                      init_channel=self.device.substitute(
                                          dev='TuneProc',
                                          propty_name='GetSpectrum',
                                          propty_suffix='Sts'))
            hbox_getspec = QHBoxLayout()
            hbox_getspec.addWidget(self.cb_getspec)
            hbox_getspec.addWidget(self.lb_getspec)

        lay = QFormLayout()
        lay.setLabelAlignment(Qt.AlignRight)
        lay.setFormAlignment(Qt.AlignCenter)
        lay.addRow(lbl_acq, hbox_acq)
        lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow(lbl_drive, hbox_drive)
        lay.addRow(lbl_enblsts, gbox_enblsts)
        if self.section == 'BO':
            lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
            lay.addRow(lbl_acqcnt, hbox_acqcnt)
        lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow(lbl_nrsmp, self.lb_nrsmp)
        if self.section == 'SI':
            lay.addRow(lbl_acqtime, self.cb_acqtime)
            lay.addRow(lbl_swetime, self.lb_swetime)
        lay.addRow(lbl_span, hbox_span)
        lay.addRow(lbl_rbw, hbox_rbw)
        lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow(lbl_h, hbox_h)
        lay.addRow(lbl_Fh, self.lb_Fh)
        lay.addRow(lbl_foff, hbox_foff)
        lay.addRow(lbl_Fc, hbox_Fc)
        lay.addRow(lbl_autoFc, hbox_autoFc)
        lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
        lay.addRow(lbl_drivegain, hbox_drivegain)
        if self.section == 'BO':
            lay.addRow(lbl_driveauto, hbox_driveauto)
            lay.addRow(lbl_noiseamp, hbox_noiseamp)
        else:
            lay.addRow(lbl_trkgenlvl, hbox_trkgenlvl)
            lay.addItem(QSpacerItem(1, 6, QSzPlcy.Ignored, QSzPlcy.Fixed))
            lay.addRow(lbl_getspec, hbox_getspec)
        return lay
예제 #28
0
    def _setupUi(self):
        label = QLabel('<h3>' + self.device +
                       ' Advanced Acquisition Settings</h3>',
                       self,
                       alignment=Qt.AlignHCenter)
        label.setStyleSheet('max-height:1.29em;')

        label_DataType = QLabel('Data Type:', self)
        hbox_DataType = create_propty_layout(parent=self,
                                             prefix=self.cam_prefix,
                                             propty='DataType',
                                             propty_type='enum')

        label_BwAssigned = QLabel('Band Width Assigned [bytes]:', self)
        hbox_BwAssigned = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='BwAssigned',
                                               propty_type='mon')

        label_BwReserve = QLabel('Band Width Reserved [%]:', self)
        hbox_BwReserve = create_propty_layout(parent=self,
                                              prefix=self.cam_prefix,
                                              propty='BwReserve',
                                              propty_type='sprb')

        label_BwReserveAccum = QLabel('Band Width Reserved Accum. [%]:', self)
        hbox_BwReserveAccum = create_propty_layout(parent=self,
                                                   prefix=self.cam_prefix,
                                                   propty='BwReserveAccum',
                                                   propty_type='sprb')

        label_CurrentThroughput = QLabel('Current Throughput [bytes/s]:', self)
        hbox_CurrentThroughput = create_propty_layout(
            parent=self,
            prefix=self.cam_prefix,
            propty='CurrentThroughput',
            propty_type='mon')

        label_MaxThroughput = QLabel('Maximum Throughput [bytes/s]:', self)
        hbox_MaxThroughput = create_propty_layout(parent=self,
                                                  prefix=self.cam_prefix,
                                                  propty='MaxThroughput',
                                                  propty_type='mon')

        label_FrameMaxJitter = QLabel('Frame Max Jitter [8 ns]:', self)
        hbox_FrameMaxJitter = create_propty_layout(parent=self,
                                                   prefix=self.cam_prefix,
                                                   propty='FrameMaxJitter',
                                                   propty_type='mon')

        label_PacketSize = QLabel('Packet Size [bytes]:', self)
        hbox_PacketSize = create_propty_layout(parent=self,
                                               prefix=self.cam_prefix,
                                               propty='PacketSize',
                                               propty_type='sprb')

        label_PayloadSize = QLabel('Payload Size [bytes]:', self)
        hbox_PayloadSize = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='PayloadSize',
                                                propty_type='mon')

        label_InterPacketDelay = QLabel('Inter Packet Delay [8 ns]:', self)
        hbox_InterPacketDelay = create_propty_layout(parent=self,
                                                     prefix=self.cam_prefix,
                                                     propty='InterPacketDelay',
                                                     propty_type='sprb')

        label_ReadoutTime = QLabel('Readout Time [us]:', self)
        hbox_ReadoutTime = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='ReadoutTime',
                                                propty_type='mon')

        label_ResultFrameRate = QLabel('Result Frame Rate:', self)
        hbox_ResultFrameRate = create_propty_layout(parent=self,
                                                    prefix=self.cam_prefix,
                                                    propty='ResultFrameRate',
                                                    propty_type='mon')

        label_TransmDelay = QLabel('Inter Frame Delay [8 ns]:', self)
        hbox_TransmDelay = create_propty_layout(parent=self,
                                                prefix=self.cam_prefix,
                                                propty='TransmDelay',
                                                propty_type='sprb')

        flay = QFormLayout(self)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignHCenter)
        flay.addRow(label)
        flay.addRow(label_DataType, hbox_DataType)
        flay.addRow(label_BwAssigned, hbox_BwAssigned)
        flay.addRow(label_BwReserve, hbox_BwReserve)
        flay.addRow(label_BwReserveAccum, hbox_BwReserveAccum)
        flay.addRow(label_CurrentThroughput, hbox_CurrentThroughput)
        flay.addRow(label_MaxThroughput, hbox_MaxThroughput)
        flay.addRow(label_FrameMaxJitter, hbox_FrameMaxJitter)
        flay.addRow(label_PacketSize, hbox_PacketSize)
        flay.addRow(label_PayloadSize, hbox_PayloadSize)
        flay.addRow(label_InterPacketDelay, hbox_InterPacketDelay)
        flay.addRow(label_ReadoutTime, hbox_ReadoutTime)
        flay.addRow(label_ResultFrameRate, hbox_ResultFrameRate)
        flay.addRow(label_TransmDelay, hbox_TransmDelay)
예제 #29
0
파일: main.py 프로젝트: lnls-sirius/hla
    def _calibrationgridLayout(self):
        self.checkBox_showgrid = QCheckBox('Show', self)
        self.checkBox_showgrid.setEnabled(False)
        self.checkBox_showgrid.setStyleSheet("""
            min-width:4em; max-width:4em;
            min-height:1.29em; max-height:1.29em;""")
        self.checkBox_showgrid.toggled.connect(
            self.image_view.showCalibrationGrid)
        self.pushbutton_savegrid = QPushButton('Save', self)
        self.pushbutton_savegrid.setEnabled(False)
        self.pushbutton_savegrid.setStyleSheet("""
            min-width:4em; max-width:4em;
            min-height:1.29em; max-height:1.29em;""")
        self.pushbutton_savegrid.clicked.connect(self._saveCalibrationGrid)
        self.pushbutton_loadgrid = QPushButton('Load', self)
        self.pushbutton_loadgrid.setStyleSheet("""
            min-width:4em; max-width:4em;
            min-height:1.29em; max-height:1.29em;""")
        self.pushbutton_loadgrid.clicked.connect(self._loadCalibrationGrid)
        hbox_grid = QHBoxLayout()
        hbox_grid.addWidget(self.checkBox_showgrid)
        hbox_grid.addWidget(self.pushbutton_savegrid)
        hbox_grid.addWidget(self.pushbutton_loadgrid)

        lb = QLabel('Show levels <')
        lb.setStyleSheet("min-width:7em;max-width:7em;")
        self.spinbox_gridfilterfactor = QSpinBoxPlus()
        self.spinbox_gridfilterfactor.setMaximum(100)
        self.spinbox_gridfilterfactor.setMinimum(0)
        self.spinbox_gridfilterfactor.setValue(
            self.image_view.calibration_grid_filterfactor)
        self.spinbox_gridfilterfactor.editingFinished.connect(
            self._setCalibrationGridFilterFactor)
        self.spinbox_gridfilterfactor.setStyleSheet("""
            min-width:4em; max-width:4em;""")
        hbox_filter = QHBoxLayout()
        hbox_filter.setSpacing(0)
        hbox_filter.addWidget(lb)
        hbox_filter.addWidget(self.spinbox_gridfilterfactor)
        hbox_filter.addWidget(QLabel(' %'))

        lb = QLabel('Remove border: ')
        lb.setStyleSheet("min-width:7em;max-width:7em;")
        self.spinbox_removeborder = QSpinBoxPlus()
        self.spinbox_removeborder.setMaximum(512)
        self.spinbox_removeborder.setMinimum(0)
        self.spinbox_removeborder.setValue(
            self.image_view.calibration_grid_removeborder)
        self.spinbox_removeborder.editingFinished.connect(
            self._setCalibrationGridBorder2Remove)
        self.spinbox_removeborder.setStyleSheet("""
            min-width:4em; max-width:4em;""")
        hbox_remove = QHBoxLayout()
        hbox_remove.setSpacing(0)
        hbox_remove.addWidget(lb)
        hbox_remove.addWidget(self.spinbox_removeborder)
        hbox_remove.addWidget(QLabel(' px'))

        hbox_EnblLED = _create_propty_layout(parent=self,
                                             prefix=self.scrn_prefix,
                                             propty='EnblLED',
                                             propty_type='enbldisabl',
                                             width=4.68)

        lay = QFormLayout()
        lay.addItem(QSpacerItem(1, 10, QSzPlcy.Ignored, QSzPlcy.Preferred))
        lay.addRow('  Grid: ', hbox_grid)
        lay.addItem(QSpacerItem(1, 10, QSzPlcy.Ignored, QSzPlcy.Preferred))
        lay.addRow('  ', hbox_filter)
        lay.addRow('  ', hbox_remove)
        lay.addItem(QSpacerItem(1, 20, QSzPlcy.Ignored, QSzPlcy.Preferred))
        lay.addRow('  LED: ', hbox_EnblLED)
        lay.addItem(QSpacerItem(1, 10, QSzPlcy.Ignored, QSzPlcy.Preferred))
        lay.setLabelAlignment(Qt.AlignRight)
        lay.setFormAlignment(Qt.AlignCenter)
        return lay
예제 #30
0
    def __init__(self,
                 parent,
                 device='',
                 prefix='',
                 delay=True,
                 duration=False,
                 nrpulses=False,
                 src=False):
        super().__init__(parent, device, prefix)
        flay = QFormLayout(self)
        flay.setLabelAlignment(Qt.AlignRight)
        flay.setFormAlignment(Qt.AlignCenter)

        l_TIstatus = QLabel('Status: ', self)
        ledmulti_TIStatus = PyDMLedMultiChannel(
            parent=self,
            channels2values={
                self.get_pvname('State-Sts'): 1,
                self.get_pvname('Status-Mon'): 0
            })
        ledmulti_TIStatus.setStyleSheet(
            "min-width:1.29em; max-width:1.29em;"
            "min-height:1.29em; max-height:1.29em;")
        pb_trgdetails = QPushButton(qta.icon('fa5s.ellipsis-h'), '', self)
        pb_trgdetails.setToolTip('Open details')
        pb_trgdetails.setObjectName('detail')
        pb_trgdetails.setStyleSheet(
            "#detail{min-width:25px; max-width:25px; icon-size:20px;}")
        trg_w = create_window_from_widget(HLTriggerDetailed,
                                          title=device + ' Detailed Settings',
                                          is_main=True)
        connect_window(pb_trgdetails,
                       trg_w,
                       parent=None,
                       device=self.device,
                       prefix=self.prefix)
        hlay_TIstatus = QHBoxLayout()
        hlay_TIstatus.addWidget(ledmulti_TIStatus)
        hlay_TIstatus.addWidget(pb_trgdetails)
        flay.addRow(l_TIstatus, hlay_TIstatus)

        if delay:
            l_delay = QLabel('Delay [us]: ', self)
            l_delay.setStyleSheet("min-width:5em;")
            hlay_delay = self._create_propty_layout(propty='Delay-SP')
            flay.addRow(l_delay, hlay_delay)

        if duration:
            l_duration = QLabel('Duration [us]: ', self)
            l_duration.setStyleSheet("min-width:5em;")
            hlay_duration = self._create_propty_layout(propty='Duration-SP')
            flay.addRow(l_duration, hlay_duration)

        if nrpulses:
            l_nrpulses = QLabel('Nr Pulses: ', self)
            l_nrpulses.setStyleSheet("min-width:5em;")
            hlay_nrpulses = self._create_propty_layout(propty='NrPulses-SP')
            flay.addRow(l_nrpulses, hlay_nrpulses)

        if src:
            l_src = QLabel('Source: ', self)
            l_src.setStyleSheet("min-width:5em;")
            hlay_src = self._create_propty_layout(propty='Src-Sel')
            flay.addRow(l_src, hlay_src)