Exemple #1
0
    def _interlock_layout(self):
        interlock_layout = QGridLayout()

        intlk_cnt = 8 if 'Sept' not in self._devname else 7
        for i in range(intlk_cnt):
            label = PyDMLabel(
                self, getattr(self, '_intlk' + str(i + 1) + '_lbcte_pv'))
            led = PyDMLed(self, getattr(self,
                                        '_intlk' + str(i + 1) + '_mon_pv'))
            led.onColor = led.LightGreen
            led.offColor = led.Red
            interlock_layout.addWidget(led, i, 0)
            interlock_layout.addWidget(label, i, 1)

        self.reset_bt = PyDMPushButton(parent=self,
                                       init_channel=self._reset_cmd_pv,
                                       pressValue=1)
        self.reset_bt.setIcon(qta.icon('fa5s.sync'))
        self.reset_bt.setObjectName('reset_bt')
        self.reset_bt.setStyleSheet(
            '#reset_bt{min-width:25px; max-width:25px; icon-size:20px;}')
        interlock_layout.addWidget(self.reset_bt,
                                   i + 1,
                                   0,
                                   1,
                                   2,
                                   alignment=Qt.AlignHCenter)

        return interlock_layout
Exemple #2
0
    def _setupUi(self):
        self._ld_stthw = QLabel('Hardware state', self)
        self._led_stthw = PyDMLedMultiChannel(
            self,
            channels2values={
                self.dev_pref.substitute(propty='StateHw-Mon'): {
                    'value': [0x4C, 0x3C],
                    'comp': 'in'
                }
            })  # in [Op, Ready]
        self._led_stthw.offColor = PyDMLed.Yellow
        self._led_stthw.onColor = PyDMLed.LightGreen
        self._led_stthw.setObjectName('led')
        self._led_stthw.setStyleSheet('#led{max-width: 1.29em;}')
        self._led_stthw.setSizePolicy(QSzPlcy.Maximum, QSzPlcy.Preferred)
        self._lb_stthw = PyDMLabel(
            self, self.dev_pref.substitute(propty='StateHw-Mon'))

        self._ld_sttsys = QLabel('System state', self)
        self._led_sttsys = PyDMLedMultiChannel(
            self,
            channels2values={
                self.dev_pref.substitute(propty='State-Mon'): {
                    'value': [1, 4],
                    'comp': 'in'
                }
            })  # in [Op, Standby]
        self._led_sttsys.offColor = PyDMLed.Yellow
        self._led_sttsys.onColor = PyDMLed.LightGreen
        self._led_sttsys.setObjectName('led')
        self._led_sttsys.setStyleSheet('#led{max-width: 1.29em;}')
        self._led_sttsys.setSizePolicy(QSzPlcy.Maximum, QSzPlcy.Preferred)
        self._lb_sttsys = PyDMLabel(
            self, self.dev_pref.substitute(propty='State-Mon'))

        self._ld_isopr = QLabel('Is operational', self)
        self._led_isopr = PyDMLed(
            self, self.dev_pref.substitute(propty='IsOperational-Mon'))
        self._led_isopr.offColor = PyDMLed.Red
        self._led_isopr.onColor = PyDMLed.LightGreen
        self._led_isopr.setStyleSheet('max-width: 1.29em;')
        self._led_isopr.setSizePolicy(QSzPlcy.Maximum, QSzPlcy.Preferred)

        lay_hwsys = QGridLayout(self)
        lay_hwsys.addWidget(
            QLabel('<h4>Hardware&&LowLevel</h4>',
                   self,
                   alignment=Qt.AlignCenter), 0, 0, 1, 3)
        lay_hwsys.addWidget(self._ld_stthw, 2, 0)
        lay_hwsys.addWidget(self._led_stthw, 2, 1)
        lay_hwsys.addWidget(self._lb_stthw, 2, 2)
        lay_hwsys.addWidget(self._ld_sttsys, 3, 0)
        lay_hwsys.addWidget(self._led_sttsys, 3, 1)
        lay_hwsys.addWidget(self._lb_sttsys, 3, 2)
        lay_hwsys.addWidget(self._ld_isopr, 4, 0)
        lay_hwsys.addWidget(self._led_isopr, 4, 1)
Exemple #3
0
    def _setupUi(self):
        self.scrn_view = SiriusScrnView(prefix=self._prefix, device=self._scrn)
        self.cb_scrntype = PyDMEnumComboBox(
            self, self._scrn_pref.substitute(propty='ScrnType-Sel'))
        self.l_scrntype = PyDMLabel(
            self, self._scrn_pref.substitute(propty='ScrnType-Sts'))
        self.led_scrntype = PyDMLed(
            self,
            self._scrn_pref.substitute(propty='ScrnType-Sts'),
            color_list=[
                PyDMLed.LightGreen, PyDMLed.Red, PyDMLed.Red, PyDMLed.Yellow
            ])
        self.led_scrntype.shape = 2

        lay = QGridLayout()
        lay.addWidget(
            QLabel('<h3>Screen View</h3>', self, alignment=Qt.AlignCenter), 0,
            0, 1, 4)
        lay.addItem(QSpacerItem(20, 20, QSzPlcy.Fixed, QSzPlcy.Fixed), 1, 0)
        lay.addWidget(
            QLabel('Select Screen Type: ', self, alignment=Qt.AlignRight), 2,
            0)
        lay.addWidget(self.cb_scrntype, 2, 1)
        lay.addWidget(self.l_scrntype, 2, 2)
        lay.addWidget(self.led_scrntype, 2, 3)

        lay.addItem(QSpacerItem(20, 40, QSzPlcy.Fixed, QSzPlcy.Fixed), 4, 0)
        lay.addWidget(self.scrn_view, 5, 0, 1, 4)
        self.setLayout(lay)
Exemple #4
0
    def _create_scrn_summwidget(self, scrn_device, scrn_idx):
        """Create and return a screen detail widget."""
        cb_scrn = QCheckBox(scrn_device.get_nickname(dev=True), self)
        self._scrns_sel_bg.addButton(cb_scrn)
        self._scrns_sel_bg.setId(cb_scrn, scrn_idx)
        if scrn_idx == self._currScrn:
            cb_scrn.setChecked(True)
        cb_scrn.clicked.connect(self._setScrnWidget)
        cb_scrn.setStyleSheet("""
            min-width:6.5em; max-width:6.5em; font-weight:bold;""")

        led_camenbl = SiriusLedState(
            self,
            scrn_device.substitute(prefix=self.prefix, propty='CamEnbl-Sts'))
        led_camenbl.setStyleSheet("min-width:3.2em; max-width:3.2em;")

        cb_scrntype = PyDMEnumComboBox(
            self,
            scrn_device.substitute(prefix=self.prefix, propty='ScrnType-Sel'))
        cb_scrntype.setSizePolicy(QSzPlcy.Minimum, QSzPlcy.Fixed)
        cb_scrntype.setStyleSheet("min-width:4.5em;max-width:4.5em;")

        lb_scrntype = PyDMLabel(
            self,
            scrn_device.substitute(prefix=self.prefix, propty='ScrnType-Sts'))
        lb_scrntype.setStyleSheet("min-width:4.5em; max-width:4.5em;")
        lb_scrntype.setAlignment(Qt.AlignCenter)

        led_scrntype = PyDMLed(self,
                               scrn_device.substitute(prefix=self.prefix,
                                                      propty='ScrnType-Sts'),
                               color_list=[
                                   PyDMLed.LightGreen, PyDMLed.Red,
                                   PyDMLed.Red, PyDMLed.Yellow
                               ])
        led_scrntype.shape = 2
        led_scrntype.setStyleSheet("""min-width:4.5em; max-width:4.5em;""")

        wid = QWidget()
        lay = QGridLayout(wid)
        lay.setAlignment(Qt.AlignCenter)
        lay.addWidget(cb_scrn, 1, 1)
        lay.addWidget(led_camenbl, 1, 2)
        lay.addWidget(cb_scrntype, 1, 3)
        lay.addWidget(lb_scrntype, 1, 4)
        lay.addWidget(led_scrntype, 2, 4)
        return wid
Exemple #5
0
    def _setupUi(self):
        self._ld_ilkistop = QLabel('Stop\n(Input)', self)
        self._led_ilkistop = PyDMLed(
            self, self.dev_pref.substitute(propty='IntlkInStop-Mon'))
        self._led_ilkistop.offColor = PyDMLed.LightGreen
        self._led_ilkistop.onColor = PyDMLed.Red
        self._lb_ilkistop = PyDMLabel(
            self, self.dev_pref.substitute(propty='IntlkInStop-Mon'))
        hbox_ilkistop = QHBoxLayout()
        hbox_ilkistop.addWidget(self._led_ilkistop)
        hbox_ilkistop.addWidget(self._lb_ilkistop)

        self._ld_ilkieopn = QLabel('Emergency Open Gap\n(Input)', self)
        self._led_ilkieopn = PyDMLed(
            self, self.dev_pref.substitute(propty='IntlkInEOpnGap-Mon'))
        self._led_ilkieopn.offColor = PyDMLed.LightGreen
        self._led_ilkieopn.onColor = PyDMLed.Red
        self._lb_ilkieopn = PyDMLabel(
            self, self.dev_pref.substitute(propty='IntlkInEOpnGap-Mon'))
        hbox_eopngap = QHBoxLayout()
        hbox_eopngap.addWidget(self._led_ilkieopn)
        hbox_eopngap.addWidget(self._lb_ilkieopn)

        self._ld_ilkogapopn = QLabel('Gap Opened\n(Output)', self)
        self._lb_ilkogapopn = PyDMLabel(
            self, self.dev_pref.substitute(propty='IntlkOutGapStt-Mon'))
        self._lb_ilkogapopn.setAlignment(Qt.AlignCenter)

        self._ld_ilkopwr = QLabel('Power Enabled\n(Output)', self)
        self._led_ilkopwr = PyDMLed(
            self, self.dev_pref.substitute(propty='IntlkOutPwrEnbld-Mon'))
        self._led_ilkopwr.offColor = PyDMLed.Red
        self._led_ilkopwr.onColor = PyDMLed.LightGreen

        lay = QGridLayout(self)
        lay.addWidget(
            QLabel('<h4>Interlock status</h4>', self,
                   alignment=Qt.AlignCenter), 0, 0, 1, 2)
        lay.addWidget(self._ld_ilkistop, 1, 0)
        lay.addLayout(hbox_ilkistop, 1, 1)
        lay.addWidget(self._ld_ilkieopn, 2, 0)
        lay.addLayout(hbox_eopngap, 2, 1)
        lay.addWidget(self._ld_ilkogapopn, 3, 0)
        lay.addWidget(self._lb_ilkogapopn, 3, 1)
        lay.addWidget(self._ld_ilkopwr, 4, 0)
        lay.addWidget(self._led_ilkopwr, 4, 1)
Exemple #6
0
    def _ctrlModeWidget(self):
        self._led_ctrlmode = PyDMLed(
            self, self.dev_pref.substitute(propty='IsRemote-Mon'))
        self._led_ctrlmode.offColor = PyDMLed.Red
        self._led_ctrlmode.onColor = PyDMLed.LightGreen
        self._lb_ctrlmode = PyDMLabel(
            self, self.dev_pref.substitute(propty='Interface-Mon'))

        gbox_ctrlmode = QGroupBox('Control Mode')
        lay_ctrlmode = QHBoxLayout(gbox_ctrlmode)
        lay_ctrlmode.setAlignment(Qt.AlignCenter)
        lay_ctrlmode.addWidget(self._led_ctrlmode)
        lay_ctrlmode.addWidget(self._lb_ctrlmode)
        return gbox_ctrlmode
Exemple #7
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
Exemple #8
0
    def _setupUi(self):
        self._ld_almaxctrl = QLabel('<h4>Axis Control</h4>', self)

        self._ld_almflag = QLabel('Flag', self)
        self._lb_almflag = PyDMLabel(
            self, self.dev_pref.substitute(propty='AlrmPhase-Mon'))

        self._ld_almeid = QLabel('Error ID Code', self)
        self._lb_almeid = PyDMLabel(
            self, self.dev_pref.substitute(propty='AlrmPhaseErrID-Mon'))

        self._ld_almsttdw = QLabel('State DWord', self)
        self._lb_almsttdw = PyDMLabel(
            self, self.dev_pref.substitute(propty='AlrmPhaseSttDW-Mon'))

        self._ld_almsttcode = QLabel('State Code', self)
        self._lb_almsttcode = PyDMLabel(
            self, self.dev_pref.substitute(propty='AlrmPhaseStt-Mon'))

        self._ld_almrack = QLabel('<h4>Rack</h4>', self)

        self._ld_almestop = QLabel('E-Stop button pressed', self)
        self._led_almestop = PyDMLed(
            self, self.dev_pref.substitute(propty='AlrmRackEStop-Mon'))
        self._led_almestop.offColor = PyDMLed.LightGreen
        self._led_almestop.onColor = PyDMLed.Red

        self._ld_almkillpres = QLabel('Kill switch pressed', self)
        self._led_almkillpres = PyDMLed(
            self, self.dev_pref.substitute(propty='AlrmRackKill-Mon'))
        self._led_almkillpres.offColor = PyDMLed.LightGreen
        self._led_almkillpres.onColor = PyDMLed.Red

        self._ld_almkilldsbl = QLabel('Kill switches disabled', self)
        self._led_almkilldsbl = PyDMLed(
            self, self.dev_pref.substitute(propty='AlrmRackKillDsbld-Mon'))
        self._led_almkilldsbl.offColor = PyDMLed.LightGreen
        self._led_almkilldsbl.onColor = PyDMLed.Red

        self._ld_almpwrdsbl = QLabel('Power disabled', self)
        self._led_almpwrdsbl = PyDMLed(
            self, self.dev_pref.substitute(propty='AlrmRackPwrDsbld-Mon'))
        self._led_almpwrdsbl.offColor = PyDMLed.LightGreen
        self._led_almpwrdsbl.onColor = PyDMLed.Red

        lay = QGridLayout(self)
        lay.addWidget(
            QLabel('<h4>Alarms</h4>', self, alignment=Qt.AlignCenter), 0, 0, 1,
            2)
        lay.addWidget(self._ld_almaxctrl, 1, 0, 1, 2)
        lay.addWidget(self._ld_almflag, 2, 0)
        lay.addWidget(self._lb_almflag, 2, 1)
        lay.addWidget(self._ld_almeid, 3, 0)
        lay.addWidget(self._lb_almeid, 3, 1)
        lay.addWidget(self._ld_almsttdw, 4, 0)
        lay.addWidget(self._lb_almsttdw, 4, 1)
        lay.addWidget(self._ld_almsttcode, 5, 0)
        lay.addWidget(self._lb_almsttcode, 5, 1)
        lay.addItem(QSpacerItem(1, 10, QSzPlcy.Ignored, QSzPlcy.Fixed), 6, 0)
        lay.addWidget(self._ld_almrack, 7, 0, 1, 2)
        lay.addWidget(self._ld_almestop, 8, 0)
        lay.addWidget(self._led_almestop, 8, 1)
        lay.addWidget(self._ld_almkillpres, 9, 0)
        lay.addWidget(self._led_almkillpres, 9, 1)
        lay.addWidget(self._ld_almkilldsbl, 10, 0)
        lay.addWidget(self._led_almkilldsbl, 10, 1)
        lay.addWidget(self._ld_almpwrdsbl, 11, 0)
        lay.addWidget(self._led_almpwrdsbl, 11, 1)
Exemple #9
0
class APUHardLLDetails(SiriusDialog):
    """APU Hardware and LowLevel Details Dialog."""
    def __init__(self, parent=None, prefix='', device=''):
        super().__init__(parent)
        self._prefix = prefix
        self._device = _PVName(device)
        self.dev_pref = self._device.substitute(prefix=prefix)
        self.setObjectName('IDApp')
        self.setWindowTitle(device + ' Hardware and LowLevel Details')
        self._setupUi()

    def _setupUi(self):
        self._ld_stthw = QLabel('Hardware state', self)
        self._led_stthw = PyDMLedMultiChannel(
            self,
            channels2values={
                self.dev_pref.substitute(propty='StateHw-Mon'): {
                    'value': [0x4C, 0x3C],
                    'comp': 'in'
                }
            })  # in [Op, Ready]
        self._led_stthw.offColor = PyDMLed.Yellow
        self._led_stthw.onColor = PyDMLed.LightGreen
        self._led_stthw.setObjectName('led')
        self._led_stthw.setStyleSheet('#led{max-width: 1.29em;}')
        self._led_stthw.setSizePolicy(QSzPlcy.Maximum, QSzPlcy.Preferred)
        self._lb_stthw = PyDMLabel(
            self, self.dev_pref.substitute(propty='StateHw-Mon'))

        self._ld_sttsys = QLabel('System state', self)
        self._led_sttsys = PyDMLedMultiChannel(
            self,
            channels2values={
                self.dev_pref.substitute(propty='State-Mon'): {
                    'value': [1, 4],
                    'comp': 'in'
                }
            })  # in [Op, Standby]
        self._led_sttsys.offColor = PyDMLed.Yellow
        self._led_sttsys.onColor = PyDMLed.LightGreen
        self._led_sttsys.setObjectName('led')
        self._led_sttsys.setStyleSheet('#led{max-width: 1.29em;}')
        self._led_sttsys.setSizePolicy(QSzPlcy.Maximum, QSzPlcy.Preferred)
        self._lb_sttsys = PyDMLabel(
            self, self.dev_pref.substitute(propty='State-Mon'))

        self._ld_isopr = QLabel('Is operational', self)
        self._led_isopr = PyDMLed(
            self, self.dev_pref.substitute(propty='IsOperational-Mon'))
        self._led_isopr.offColor = PyDMLed.Red
        self._led_isopr.onColor = PyDMLed.LightGreen
        self._led_isopr.setStyleSheet('max-width: 1.29em;')
        self._led_isopr.setSizePolicy(QSzPlcy.Maximum, QSzPlcy.Preferred)

        lay_hwsys = QGridLayout(self)
        lay_hwsys.addWidget(
            QLabel('<h4>Hardware&&LowLevel</h4>',
                   self,
                   alignment=Qt.AlignCenter), 0, 0, 1, 3)
        lay_hwsys.addWidget(self._ld_stthw, 2, 0)
        lay_hwsys.addWidget(self._led_stthw, 2, 1)
        lay_hwsys.addWidget(self._lb_stthw, 2, 2)
        lay_hwsys.addWidget(self._ld_sttsys, 3, 0)
        lay_hwsys.addWidget(self._led_sttsys, 3, 1)
        lay_hwsys.addWidget(self._lb_sttsys, 3, 2)
        lay_hwsys.addWidget(self._ld_isopr, 4, 0)
        lay_hwsys.addWidget(self._led_isopr, 4, 1)