Exemplo n.º 1
0
    def _setupTriggerWidget(self):
        self._ld_trigsts = QLabel('Status', self)
        self._led_trigsts = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-TriggerPS:status')

        self._ld_trigall = QLabel('Trigger Allow', self)
        self._led_trigall = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-TriggerPS:allow')

        self._ld_trigenbl = QLabel('Trigger', self)
        self._bt_trigenblsel = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-TriggerPS:enable')
        self._led_trigenblsts = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-TriggerPS:enablereal')

        wid = QGroupBox('Trigger', self)
        lay = QGridLayout(wid)
        lay.addWidget(self._ld_trigsts, 0, 0, 1, 2)
        lay.addWidget(self._led_trigsts, 1, 0, 1, 2)
        lay.addWidget(self._ld_trigall, 2, 0, 1, 2)
        lay.addWidget(self._led_trigall, 3, 0, 1, 2)
        lay.addWidget(self._ld_trigenbl, 4, 0, 1, 2)
        lay.addWidget(self._bt_trigenblsel, 5, 0)
        lay.addWidget(self._led_trigenblsts, 5, 1)
        return wid
Exemplo n.º 2
0
    def _setupHVPSWidget(self):
        self._ld_hvpsswtsel = QLabel('Switch', self)
        self._bt_hvpsswtsel = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-HVPS:switch')

        self._ld_hvpsswtsts = QLabel('Status', self)
        self._led_hvpsswtsts = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-HVPS:swstatus')

        self._ld_hvpsvoltsp = QLabel('Voltage SP [kV]', self)
        self._sb_hvpsvoltsp = SiriusSpinbox(
            self, self.prefix + self.dev_pref + ':EG-HVPS:voltoutsoft')
        self._sb_hvpsvoltsp.showStepExponent = False

        self._ld_hvpsvoltrb = QLabel('Voltage RB [kV]', self)
        self._lb_hvpsvoltrb = PyDMLabel(
            self, self.prefix + self.dev_pref + ':EG-HVPS:voltinsoft')

        self._ld_hvpsenblsel = QLabel('Enable')
        self._bt_hvpsenblsel = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-HVPS:enable')

        self._ld_hvpsenblsts = QLabel('Status')
        self._led_hvpsenblsts = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-HVPS:enstatus')

        self._ld_hvpscurrsp = QLabel('Current SP [mA]')
        self._sb_hvpscurrsp = SiriusSpinbox(
            self, self.prefix + self.dev_pref + ':EG-HVPS:currentoutsoft')
        self._sb_hvpscurrsp.showStepExponent = False

        self._ld_hvpscurrrb = QLabel('Current RB [mA]')
        self._lb_hvpscurrrb = PyDMLabel(
            self, self.prefix + self.dev_pref + ':EG-HVPS:currentinsoft')

        wid = QGroupBox('High Voltage Power Supply', self)
        lay = QGridLayout(wid)
        lay.addWidget(self._ld_hvpsswtsel, 0, 0)
        lay.addWidget(self._bt_hvpsswtsel, 1, 0)
        lay.addWidget(self._ld_hvpsswtsts, 0, 1)
        lay.addWidget(self._led_hvpsswtsts, 1, 1)
        lay.addWidget(self._ld_hvpsvoltsp, 0, 2)
        lay.addWidget(self._sb_hvpsvoltsp, 1, 2)
        lay.addWidget(self._ld_hvpsvoltrb, 0, 3)
        lay.addWidget(self._lb_hvpsvoltrb, 1, 3)
        lay.addItem(QSpacerItem(1, 15, QSzPlcy.Ignored, QSzPlcy.Fixed), 2, 0)
        lay.addWidget(self._ld_hvpsenblsel, 3, 0)
        lay.addWidget(self._bt_hvpsenblsel, 4, 0)
        lay.addWidget(self._ld_hvpsenblsts, 3, 1)
        lay.addWidget(self._led_hvpsenblsts, 4, 1)
        lay.addWidget(self._ld_hvpscurrsp, 3, 2)
        lay.addWidget(self._sb_hvpscurrsp, 4, 2)
        lay.addWidget(self._ld_hvpscurrrb, 3, 3)
        lay.addWidget(self._lb_hvpscurrrb, 4, 3)
        return wid
Exemplo n.º 3
0
    def _setupBiasPSWidget(self):
        self._ld_biasswtsel = QLabel('Switch', self)
        self._bt_biasswtsel = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-BiasPS:switch')

        self._ld_biasswtsts = QLabel('Status', self)
        self._led_biassswtsts = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-BiasPS:swstatus')

        self._ld_biasvoltsp = QLabel('Voltage SP [V]', self)
        self._sb_biasvoltsp = SiriusSpinbox(
            self, self.prefix + self.dev_pref + ':EG-BiasPS:voltoutsoft')
        self._sb_biasvoltsp.showStepExponent = False

        self._ld_biasvoltrb = QLabel('Voltage RB [V]', self)
        self._lb_biasvoltrb = PyDMLabel(
            self, self.prefix + self.dev_pref + ':EG-BiasPS:voltinsoft')

        self._ld_biascurrrb = QLabel('Current RB [A]', self)
        self._lb_biascurrrb = PyDMLabel(
            self, self.prefix + self.dev_pref + ':EG-BiasPS:currentinsoft')

        wid = QGroupBox('Bias Power Supply', self)
        lay = QGridLayout(wid)
        lay.addWidget(self._ld_biasswtsel, 0, 0)
        lay.addWidget(self._bt_biasswtsel, 1, 0)
        lay.addWidget(self._ld_biasswtsts, 0, 1)
        lay.addWidget(self._led_biassswtsts, 1, 1)
        lay.addWidget(self._ld_biasvoltsp, 0, 2)
        lay.addWidget(self._sb_biasvoltsp, 1, 2)
        lay.addWidget(self._ld_biasvoltrb, 0, 3)
        lay.addWidget(self._lb_biasvoltrb, 1, 3)
        lay.addWidget(self._ld_biascurrrb, 0, 4)
        lay.addWidget(self._lb_biascurrrb, 1, 4)
        return wid
Exemplo n.º 4
0
    def __init__(self, parent=None, prefix='', is_main=False):
        """Init."""
        super().__init__(parent)
        self.setObjectName('ITApp')

        ld_tienbl = QLabel('Enable Pulses', self, alignment=Qt.AlignCenter)
        bt_tienblsel = PyDMStateButton(
            self, prefix + 'IT-EGH:TI-TrigGen:ChanOut-Sel')
        led_tienblsts = SiriusLedState(
            self, prefix + 'IT-EGH:TI-TrigGen:ChanOut-Sts')

        lay = QGridLayout(self)
        lay.setAlignment(Qt.AlignCenter)
        lay.setContentsMargins(0, 0, 0, 0)

        glay = QGridLayout()
        glay.addWidget(ld_tienbl, 0, 0, 1, 2)
        glay.addWidget(bt_tienblsel, 1, 0)
        glay.addWidget(led_tienblsts, 1, 1)
        if not is_main:
            gbox = QGroupBox('Timing', self)
            gbox.setLayout(glay)
            lay.addWidget(gbox)
        else:
            lb_title = QLabel('<h3>IT - Timing</h3>',
                              self,
                              alignment=Qt.AlignCenter)
            lay.setHorizontalSpacing(15)
            lay.setVerticalSpacing(15)
            lay.addWidget(lb_title, 0, 0)
            lay.addLayout(glay, 1, 0)
Exemplo n.º 5
0
    def _beamLinesCtrlWidget(self):
        self._ld_blinesenbl = QLabel('Enable', self)
        self._sb_blinesenbl = PyDMStateButton(
            self, self.dev_pref.substitute(propty='BeamLineCtrlEnbl-Sel'))
        self._led_blinesenbl = SiriusLedState(
            self, self.dev_pref.substitute(propty='BeamLineCtrlEnbl-Sts'))
        self._ld_blinesmon = QLabel('Status', self)
        self._led_blinesmon = SiriusLedState(
            self, self.dev_pref.substitute(propty='BeamLineCtrl-Mon'))

        gbox_blines = QGroupBox('Beam Lines Control', self)
        lay_blines = QGridLayout(gbox_blines)
        lay_blines.addWidget(self._ld_blinesenbl, 0, 0)
        lay_blines.addWidget(self._sb_blinesenbl, 0, 1)
        lay_blines.addWidget(self._led_blinesenbl, 0, 2)
        lay_blines.addWidget(self._ld_blinesmon, 1, 0)
        lay_blines.addWidget(self._led_blinesmon, 1, 1, 1, 2)
        return gbox_blines
Exemplo n.º 6
0
    def _setupPulsePSWidget(self):
        self._ld_pulsemodsel = QLabel('Mode', self)
        self._ld_pulsemodsts = QLabel('Status', self)
        self._ld_pulseswtsel = QLabel('Switch', self)
        self._ld_pulseswtsts = QLabel('Status', self)
        self._ld_pulsesing = QLabel('Single', self)
        self._ld_pulsemult = QLabel('Multi', self)

        self._bt_pulsesingmod = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:singleselect')
        self._led_pulsesingmod = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:singleselstatus')
        self._bt_pulsesingswt = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:singleswitch')
        self._led_pulsesingswt = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:singleswstatus')

        self._bt_pulsemultmod = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:multiselect')
        self._led_pulsemultmod = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:multiselstatus')
        self._bt_pulsemultswt = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:multiswitch')
        self._led_pulsemultswt = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-PulsePS:multiswstatus')

        wid = QGroupBox('Pulse Power Supply', self)
        lay = QGridLayout(wid)
        lay.addWidget(self._ld_pulsemodsel, 0, 1)
        lay.addWidget(self._ld_pulsemodsts, 0, 2)
        lay.addWidget(self._ld_pulseswtsel, 0, 3)
        lay.addWidget(self._ld_pulseswtsts, 0, 4)
        lay.addWidget(self._ld_pulsesing, 1, 0)
        lay.addWidget(self._ld_pulsemult, 2, 0)
        lay.addWidget(self._bt_pulsesingmod, 1, 1)
        lay.addWidget(self._led_pulsesingmod, 1, 2)
        lay.addWidget(self._bt_pulsesingswt, 1, 3)
        lay.addWidget(self._led_pulsesingswt, 1, 4)
        lay.addWidget(self._bt_pulsemultmod, 2, 1)
        lay.addWidget(self._led_pulsemultmod, 2, 2)
        lay.addWidget(self._bt_pulsemultswt, 2, 3)
        lay.addWidget(self._led_pulsemultswt, 2, 4)
        return wid
Exemplo n.º 7
0
    def _pwrstate_layout(self):
        pwrstate_layout = QHBoxLayout()

        self.state_button = PyDMStateButton(parent=self,
                                            init_channel=self._pwrstate_sel_pv)
        self.state_led = SiriusLedState(self, self._pwrstate_sts_pv)

        pwrstate_layout.addWidget(self.state_button)
        pwrstate_layout.addWidget(self.state_led)

        return pwrstate_layout
Exemplo n.º 8
0
    def _setupSysStatusWidget(self):
        self._ld_sysexternal = QLabel('Ext. Intlk', self)
        self._led_sysexternal = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-External:status')

        self._ld_sysvalve = QLabel('Valve', self)
        self._led_sysvalve = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-Valve:status')

        self._ld_sysgate = QLabel('Gate', self)
        self._led_sysgate = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-Gate:status')

        self._ld_sysvac = QLabel('Vacuum', self)
        self._led_sysvac = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-Vacuum:status')

        self._ld_sysplc = QLabel('PLC', self)
        self._led_sysplc = SiriusLedState(
            self, self.prefix + self.dev_pref + ':EG-PLC:status')
        self._led_sysplc.offColor = SiriusLedState.Yellow

        self._ld_syssysstart = QLabel('System\nStart', self)
        self._bt_syssysstart = PyDMStateButton(
            self, self.prefix + self.dev_pref + ':EG-System:start')

        wid = QGroupBox('System Status', self)
        lay = QGridLayout(wid)
        lay.addWidget(self._ld_sysexternal, 0, 0)
        lay.addWidget(self._led_sysexternal, 0, 1)
        lay.addWidget(self._ld_sysvalve, 1, 0)
        lay.addWidget(self._led_sysvalve, 1, 1)
        lay.addWidget(self._ld_sysgate, 2, 0)
        lay.addWidget(self._led_sysgate, 2, 1)
        lay.addWidget(self._ld_sysvac, 3, 0)
        lay.addWidget(self._led_sysvac, 3, 1)
        lay.addWidget(self._ld_sysplc, 4, 0)
        lay.addWidget(self._led_sysplc, 4, 1)
        lay.addWidget(self._ld_syssysstart, 5, 0)
        lay.addWidget(self._bt_syssysstart, 5, 1)
        return wid
Exemplo n.º 9
0
    def _pulses_layout(self):
        pulses_layout = QHBoxLayout()

        self.pulses_state_button = PyDMStateButton(
            parent=self, init_channel=self._enablepulses_sel_pv)
        self.pulses_state_led = SiriusLedState(
            parent=self, init_channel=self._enablepulses_sts_pv)

        pulses_layout.addWidget(self.pulses_state_button)
        pulses_layout.addWidget(self.pulses_state_led)

        return pulses_layout
Exemplo n.º 10
0
    def get_selection_lists_widget(self, parent):
        """."""
        sel_wid = QWidget(parent)
        sel_lay = QHBoxLayout(sel_wid)

        icon = qta.icon('fa5s.hammer', color=get_appropriate_color(self.acc))
        Window = create_window_from_widget(
            SelectionMatrix, title='Corrs and BPMs selection', icon=icon)
        btn = QPushButton('', sel_wid)
        btn.setObjectName('btn')
        btn.setIcon(qta.icon('fa5s.tasks'))
        btn.setToolTip('Open window to select BPMs and correctors')
        btn.setStyleSheet(
            '#btn{min-width:3.8em; max-width:3.8em;\
            min-height:2em; max-height:2em; icon-size:25px;}')
        connect_window(
            btn, Window, None, device=self.device,
            prefix=self.prefix, acc=self.acc)
        sel_lay.addWidget(btn)

        lay = QVBoxLayout()
        sel_lay.addStretch()
        sel_lay.addLayout(lay)

        hlay = QHBoxLayout()
        lay.addLayout(hlay)
        hlay.addWidget(SiriusEnumComboBox(
            sel_wid, self.devpref.substitute(propty='RespMatMode-Sel')))
        hlay.addWidget(SiriusLabel(
            sel_wid, self.devpref.substitute(propty='RespMatMode-Sts')))

        if self.acc in {'SI', 'BO'}:
            hlay = QHBoxLayout()
            lay.addLayout(hlay)
            pdm_chbx = PyDMCheckbox(
                sel_wid, self.devpref.substitute(propty='RFEnbl-Sel'))
            pdm_chbx.setText('use RF')
            pdm_led = SiriusLedState(
                sel_wid, self.devpref.substitute(propty='RFEnbl-Sts'))
            hlay.addWidget(pdm_chbx)
            hlay.addWidget(pdm_led)

        btn = QPushButton('', sel_wid)
        btn.setToolTip('Visualize RespMat')
        btn.setIcon(qta.icon('mdi.chart-line'))
        btn.setObjectName('btn')
        btn.setStyleSheet('#btn{max-width:40px; icon-size:40px;}')
        connect_newprocess(
            btn, [f'sirius-hla-{self.acc.lower():s}-ap-sofb.py', '--matrix'])
        sel_lay.addWidget(btn)

        return sel_wid
Exemplo n.º 11
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
Exemplo n.º 12
0
    def _create_corr_summwidget(self, corr):
        """Create and return a corrector detail widget."""
        wid = QWidget()
        wid.setSizePolicy(QSzPlcy.Preferred, QSzPlcy.Maximum)
        lay = QGridLayout(wid)
        lay.setContentsMargins(0, 0, 0, 0)
        lay.setAlignment(Qt.AlignCenter)

        propty_sp = 'Current-SP' if corr.sec == 'LI' else 'Kick-SP'
        propty_mon = propty_sp.replace('SP', 'Mon')

        led = SiriusLedState(
            self, corr.substitute(prefix=self.prefix, propty='PwrState-Sts'))
        led.setStyleSheet("max-width:1.29em;")
        lay.addWidget(led, 1, 1)

        nickname = corr.get_nickname(sec=corr.sec == 'LI', dev=True)
        pb = QPushButton(nickname, self)
        if corr.dis == 'PU':
            util.connect_window(pb, PUDetailWindow, parent=self, devname=corr)
        else:
            util.connect_window(pb, PSDetailWindow, parent=self, psname=corr)
        pb.setStyleSheet("""
            min-width:6em; max-width:6em; min-height:1.29em;""")
        lay.addWidget(pb, 1, 2)

        sp_kick = PyDMSpinboxScrollbar(
            self, corr.substitute(prefix=self.prefix, propty=propty_sp))
        sp_kick.setStyleSheet("QDoubleSpinBox{min-width:4em; max-width:4em; }"
                              "QScrollBar{max-width:4em;}")
        sp_kick.spinbox.precisionFromPV = False
        sp_kick.spinbox.precision = 1
        sp_kick.scrollbar.limitsFromPV = True
        lay.addWidget(sp_kick, 1, 3, 2, 1)

        lb_kick = PyDMLabel(
            self, corr.substitute(prefix=self.prefix, propty=propty_mon))
        lb_kick.setStyleSheet("""
            min-width:5em; max-width:5em; min-height:1.29em;""")
        lb_kick.showUnits = True
        lb_kick.precisionFromPV = False
        lb_kick.precision = 1
        lb_kick.setAlignment(Qt.AlignCenter)
        lay.addWidget(lb_kick, 1, 4)
        return wid
Exemplo n.º 13
0
 def create_pair_butled(self, parent, pvname, device=None, is_vert=False):
     """."""
     device = device or self.device
     basename = _PVName(device).substitute(prefix=self.prefix,
                                           propty_name=pvname)
     wid = QWidget(parent)
     if is_vert:
         lay = QVBoxLayout(wid)
     else:
         lay = QHBoxLayout(wid)
     lay.setContentsMargins(0, 0, 0, 0)
     spnt = PyDMStateButton(wid, basename.substitute(propty_suffix='Sel'))
     rdb = SiriusLedState(wid, basename.substitute(propty_suffix='Sts'))
     lay.addWidget(spnt)
     lay.addWidget(rdb)
     wid.sp_wid = spnt
     wid.rb_wid = spnt
     return wid
Exemplo n.º 14
0
    def _setupUi(self):
        pref = _PVName('LI-Glob:AP-MeasEnergy').substitute(prefix=self.prefix)
        self.plt_energy = SiriusTimePlot(
            self,
            init_y_channels=[pref.substitute(propty='Energy-Mon')],
            background=QColor('white'))
        self.plt_energy.setLabel('left', text='Energy [MeV]')
        self.plt_energy.setShowXGrid(True)
        self.plt_energy.setShowYGrid(True)
        c = self.plt_energy.curveAtIndex(0)
        c.color = QColor('blue')
        c.symbol = c.symbols['Circle']
        c.symbolSize = 10
        c.lineWidth = 3
        c.data_changed.connect(self._update_energy_stats)
        self.plt_energy.setTimeSpan(100)

        self.plt_spread = SiriusTimePlot(
            self,
            init_y_channels=[pref.substitute(propty='Spread-Mon')],
            background=QColor('white'))
        self.plt_spread.setLabel('left', text='Spread [%]')
        self.plt_spread.setShowXGrid(True)
        self.plt_spread.setShowYGrid(True)
        c = self.plt_spread.curveAtIndex(0)
        c.color = QColor('red')
        c.symbol = c.symbols['Circle']
        c.symbolSize = 10
        c.lineWidth = 3
        c.data_changed.connect(self._update_spread_stats)
        self.plt_spread.setTimeSpan(100)

        gb_ctrl = QGroupBox('Control', self)
        hl_ctrl = QHBoxLayout(gb_ctrl)

        vl = QVBoxLayout()
        wid = QWidget(gb_ctrl)
        wid.setLayout(QHBoxLayout())
        btn = PyDMStateButton(gb_ctrl,
                              pref.substitute(propty='MeasureCtrl-Sel'))
        led = SiriusLedState(gb_ctrl,
                             pref.substitute(propty='MeasureCtrl-Sts'))
        wid.layout().addWidget(btn)
        wid.layout().addWidget(led)
        vl.addWidget(QLabel('Start/Stop Acq.', gb_ctrl))
        vl.addWidget(wid)
        hl_ctrl.addLayout(vl)

        vl = QVBoxLayout()
        wid = QWidget(gb_ctrl)
        wid.setLayout(QHBoxLayout())
        spnbox = SiriusSpinbox(
            wid,
            _PVName('LI-01:PS-Spect:Current-SP').substitute(
                prefix=self.prefix))
        lbl = SiriusLabel(
            wid,
            _PVName('LI-01:PS-Spect:Current-Mon').substitute(
                prefix=self.prefix))
        spnbox.showStepExponent = False
        wid.layout().addWidget(spnbox)
        wid.layout().addWidget(lbl)
        vl.addWidget(QLabel('Spectrometer Current [A]', gb_ctrl))
        vl.addWidget(wid)
        hl_ctrl.addLayout(vl)

        gb_ener = QGroupBox('Properties', self)
        fl_ener = QFormLayout(gb_ener)

        wid = QWidget(gb_ener)
        wid.setLayout(QHBoxLayout())
        self.lb_ave_en = QLabel('0.000', wid)
        self.lb_std_en = QLabel('0.000', wid)
        wid.layout().addWidget(self.lb_ave_en)
        wid.layout().addWidget(
            QLabel('<html><head/><body><p>&#177;</p></body></html>', wid))
        wid.layout().addWidget(self.lb_std_en)
        fl_ener.addRow('Energy [MeV]', wid)

        wid = QWidget(gb_ener)
        wid.setLayout(QHBoxLayout())
        self.lb_ave_sp = QLabel('0.000', wid)
        self.lb_std_sp = QLabel('0.000', wid)
        wid.layout().addWidget(self.lb_ave_sp)
        wid.layout().addWidget(
            QLabel('<html><head/><body><p>&#177;</p></body></html>', wid))
        wid.layout().addWidget(self.lb_std_sp)
        fl_ener.addRow('Spread [%]', wid)

        hl_span = QHBoxLayout()
        hl_span.setSpacing(0)
        self.spbox_npoints = QSpinBoxPlus(self)
        self.spbox_npoints.setKeyboardTracking(False)
        self.spbox_npoints.setMinimum(10)
        self.spbox_npoints.setMaximum(200000)
        self.spbox_npoints.setValue(100)
        self.spbox_npoints.editingFinished.connect(self.nrpoints_edited)
        hl_span.addWidget(QLabel('Choose TimeSpan [s]:', self))
        hl_span.addWidget(self.spbox_npoints)
        self.pb_reset_data = QPushButton('Reset Data', self)
        self.pb_reset_data.clicked.connect(self.pb_reset_data_clicked)
        hl_span.addWidget(self.pb_reset_data)

        self.plt_image = SiriusProcessImage(self, device=pref)

        gb_trig = QGroupBox('Trigger', self)
        hbl = QHBoxLayout(gb_trig)
        hbl.addWidget(
            HLTriggerSimple(parent=self,
                            device='LI-Fam:TI-Scrn',
                            prefix=self.prefix))
        gb_trig.setLayout(hbl)

        gl = QGridLayout(self)
        gl.addLayout(hl_span, 0, 0, 1, 2)
        gl.addWidget(self.plt_image, 0, 2, 3, 1)
        gl.addWidget(self.plt_energy, 1, 0, 1, 2)
        gl.addWidget(self.plt_spread, 2, 0, 1, 2)
        gl.addWidget(gb_ctrl, 3, 0)
        gl.addWidget(gb_ener, 3, 1)
        gl.addWidget(gb_trig, 3, 2)
        gl.setColumnStretch(0, 3)
        gl.setColumnStretch(1, 2)
        gl.setColumnStretch(2, 3)
Exemplo n.º 15
0
    def _setupUi(self):
        label = QLabel('<h3>' + self._title + '</h3>',
                       self,
                       alignment=Qt.AlignCenter)

        self._process_image = SiriusProcessImage(self,
                                                 device=self._device_analysis,
                                                 orientation='H',
                                                 convertion_set=False)
        self._process_image.image_view.colorMapMax = 2**16 - 1

        # IOC control
        gbox_ctrl = QGroupBox('Analysis Control')
        lay_ctrl = QGridLayout(gbox_ctrl)

        self._ld_enbl = QLabel('Start/Stop: ')
        self._sb_enbl = PyDMStateButton(
            gbox_ctrl, self._device_analysis + ':MeasureCtrl-Sel')
        self._lb_enbl = PyDMLabel(gbox_ctrl,
                                  self._device_analysis + ':MeasureCtrl-Sts')

        self._ld_rate = QLabel('Acq. Rate: ')
        self._sb_rate = SiriusSpinbox(
            gbox_ctrl, self._device_analysis + ':MeasureRate-SP')
        self._sb_rate.showStepExponent = False
        self._lb_rate = PyDMLabel(gbox_ctrl,
                                  self._device_analysis + ':MeasureRate-RB')

        self._ld_tgtx = QLabel('Target X: ')
        self._sb_tgtx = SiriusSpinbox(gbox_ctrl,
                                      self._device_analysis + ':TargetPosX-SP')
        self._sb_tgtx.showStepExponent = False
        self._lb_tgtx = PyDMLabel(gbox_ctrl,
                                  self._device_analysis + ':TargetPosX-RB')

        self._ld_tgty = QLabel('Target Y: ')
        self._sb_tgty = SiriusSpinbox(gbox_ctrl,
                                      self._device_analysis + ':TargetPosY-SP')
        self._sb_tgty.showStepExponent = False
        self._lb_tgty = PyDMLabel(gbox_ctrl,
                                  self._device_analysis + ':TargetPosY-RB')

        lay_ctrl.setAlignment(Qt.AlignTop)
        lay_ctrl.addWidget(self._ld_enbl, 0, 0, 2, 1)
        lay_ctrl.addWidget(self._sb_enbl, 0, 1)
        lay_ctrl.addWidget(self._lb_enbl, 1, 1)
        lay_ctrl.addWidget(self._ld_rate, 2, 0, 2, 1)
        lay_ctrl.addWidget(self._sb_rate, 2, 1)
        lay_ctrl.addWidget(self._lb_rate, 3, 1)
        lay_ctrl.addWidget(self._ld_tgtx, 4, 0, 2, 1)
        lay_ctrl.addWidget(self._sb_tgtx, 4, 1)
        lay_ctrl.addWidget(self._lb_tgtx, 5, 1)
        lay_ctrl.addWidget(self._ld_tgty, 6, 0, 2, 1)
        lay_ctrl.addWidget(self._sb_tgty, 6, 1)
        lay_ctrl.addWidget(self._lb_tgty, 7, 1)

        gbox_sofb = QGroupBox('SOFB Bump [urad]')
        lay_sofb = QGridLayout(gbox_sofb)

        ldx = QLabel('X:')
        ldy = QLabel('Y:')
        ldd = QLabel('Delta')
        lda = QLabel('Applied')
        pre = self._device_analysis
        lb_dbmpx = SiriusLabel(gbox_sofb, pre + ':NeededDeltaBumpX-Mon')
        lb_dbmpy = SiriusLabel(gbox_sofb, pre + ':NeededDeltaBumpY-Mon')
        lb_bmpx = SiriusLabel(gbox_sofb, pre + ':AppliedBumpX-Mon')
        lb_bmpy = SiriusLabel(gbox_sofb, pre + ':AppliedBumpY-Mon')
        pb_app = PyDMPushButton(gbox_sofb,
                                'Apply',
                                pressValue=1,
                                init_channel=pre + ':ApplyBump-Cmd')
        pb_app.showConfirmDialog = True
        pb_app.confirmMessage = \
            'This action will change the reference orbit used in SOFB.\n' +\
            pb_app.confirmMessage
        lb_app = PyDMLabel(gbox_sofb, init_channel=pre + ':ApplyStatus-Mon')

        lay_sofb.setAlignment(Qt.AlignTop)
        lay_sofb.addWidget(ldd, 0, 1, alignment=Qt.AlignCenter)
        lay_sofb.addWidget(lda, 0, 2, alignment=Qt.AlignCenter)
        lay_sofb.addWidget(ldx, 1, 0, alignment=Qt.AlignLeft)
        lay_sofb.addWidget(ldy, 2, 0, alignment=Qt.AlignLeft)
        lay_sofb.addWidget(lb_dbmpx, 1, 1)
        lay_sofb.addWidget(lb_dbmpy, 2, 1)
        lay_sofb.addWidget(lb_bmpx, 1, 2)
        lay_sofb.addWidget(lb_bmpy, 2, 2)
        hbl = QHBoxLayout()
        hbl.addStretch()
        hbl.addWidget(pb_app)
        hbl.addWidget(lb_app)
        hbl.addStretch()
        lay_sofb.addLayout(hbl, 3, 0, 1, 3)
        lay_sofb.setRowStretch(4, 5)

        # Camera Acquisition Status
        gbox_acqsett = QGroupBox('Camera Acquisition Statuses')
        lay_acqsett = QGridLayout(gbox_acqsett)

        self._ld_acqtime = QLabel('Acquire Time: ')
        self._sb_acqtime = SiriusSpinbox(
            gbox_ctrl, self._device_cam + ':cam1:AcquireTime')
        self._sb_acqtime.showStepExponent = False
        self._sb_acqtime.limitsFromChannel = False
        self._sb_acqtime.setRange(0.001, 10)
        self._lb_acqtime = PyDMLabel(
            gbox_acqsett, self._device_cam + ':cam1:AcquireTime_RBV')
        self._lb_acqtime.showUnits = True

        self._ld_acqperd = QLabel('Acquire Period: ')
        self._sb_acqperd = SiriusSpinbox(
            gbox_ctrl, self._device_cam + ':cam1:AcquirePeriod')
        self._sb_acqperd.showStepExponent = False
        self._sb_acqperd.limitsFromChannel = False
        self._sb_acqperd.setRange(0.001, 10)
        self._lb_acqperd = PyDMLabel(
            gbox_acqsett, self._device_cam + ':cam1:AcquirePeriod_RBV')
        self._lb_acqperd.showUnits = True

        self._ld_numimgs = QLabel('# Images: ')
        self._lb_numimgs = PyDMLabel(gbox_acqsett,
                                     self._device_cam + ':cam1:NumImages_RBV')

        self._ld_imgmode = QLabel('Image Mode: ')
        self._lb_imgmode = PyDMLabel(gbox_acqsett,
                                     self._device_cam + ':cam1:ImageMode_RBV')

        self._ld_acqsts = QLabel('Acquire Status: ')
        self._pb_acqsts = PyDMStateButton(gbox_acqsett,
                                          self._device_cam + ':cam1:Acquire')
        self._lb_acqsts = SiriusLedState(
            gbox_acqsett, self._device_cam + ':cam1:Acquire_RBV')

        self._ld_capsts = QLabel('Capture Status: ')
        self._pb_capsts = PyDMStateButton(gbox_acqsett,
                                          self._device_cam + ':HDF1:Capture')
        self._lb_capsts = SiriusLedState(
            gbox_acqsett, self._device_cam + ':HDF1:Capture_RBV')

        lay_acqsett.addWidget(self._ld_acqtime, 0, 0, 2, 1)
        lay_acqsett.addWidget(self._sb_acqtime, 0, 1)
        lay_acqsett.addWidget(self._lb_acqtime, 1, 1)
        lay_acqsett.addWidget(self._ld_acqperd, 2, 0, 2, 1)
        lay_acqsett.addWidget(self._sb_acqperd, 2, 1)
        lay_acqsett.addWidget(self._lb_acqperd, 3, 1)
        lay_acqsett.addWidget(self._ld_acqsts, 4, 0, 2, 1)
        lay_acqsett.addWidget(self._pb_acqsts, 4, 1)
        lay_acqsett.addWidget(self._lb_acqsts, 5, 1)
        lay_acqsett.addWidget(self._ld_capsts, 6, 0, 2, 1)
        lay_acqsett.addWidget(self._pb_capsts, 6, 1)
        lay_acqsett.addWidget(self._lb_capsts, 7, 1)
        lay_acqsett.addWidget(self._ld_numimgs, 8, 0)
        lay_acqsett.addWidget(self._lb_numimgs, 8, 1)
        lay_acqsett.addWidget(self._ld_imgmode, 9, 0)
        lay_acqsett.addWidget(self._lb_imgmode, 9, 1)
        lay_acqsett.setRowStretch(10, 20)

        self.cw = QWidget()
        self.cw.setStyleSheet('PyDMLabel{qproperty-alignment: AlignCenter;}')
        lay = QGridLayout(self.cw)
        lay.addWidget(label, 0, 0, 1, 3)
        lay.addWidget(self._process_image, 1, 0, 2, 1)
        lay.addWidget(gbox_ctrl, 1, 1)
        lay.addWidget(gbox_sofb, 2, 1)
        lay.addWidget(gbox_acqsett, 1, 2, 2, 1)
        lay.setColumnStretch(0, 7)
        lay.setColumnStretch(1, 2)
        self.setCentralWidget(self.cw)
Exemplo n.º 16
0
 def fillWidget(self, name):
     if name in self.filled_widgets:
         return
     if name == 'detail':
         self.detail_bt = QPushButton(self)
         if self._name.dev == 'DCLink':
             self.detail_bt.setIcon(qta.icon('fa5s.list-ul'))
             self.detail_bt.setToolTip(self._name)
         else:
             self.detail_bt.setText(self._name)
         self.detail_wid.layout().addWidget(self.detail_bt)
     elif name == 'bbb' and self._bbb_name:
         self.bbb_lb = QLabel(self._bbb_name, self)
         self.bbb_wid.layout().addWidget(self.bbb_lb)
     elif name == 'udc' and self._udc_name:
         self.udc_lb = QLabel(self._udc_name, self)
         self.udc_wid.layout().addWidget(self.udc_lb)
     elif name == 'opmode' and self._has_opmode:
         opmode_list = list()
         if 'Voltage' not in self._analog_name:
             self.opmode_cb = SiriusEnumComboBox(self, self._opmode_sel)
             opmode_list.append(self.opmode_cb)
         self.opmode_lb = PyDMLabel(self, self._opmode_sts)
         opmode_list.append(self.opmode_lb)
         for wid in opmode_list:
             self.opmode_wid.layout().addWidget(wid)
     elif name == 'ctrlmode' and self._has_ctrlmode:
         self.ctrlmode_lb = PyDMLabel(self, self._ctrlmode_sts)
         self.ctrlmode_wid.layout().addWidget(self.ctrlmode_lb)
     elif name == 'state' and self._has_pwrstate:
         self.state_bt = PyDMStateButton(self, self._pwrstate_sel)
         self.state_led = SiriusLedState(self, self._pwrstate_sts)
         self.state_wid.layout().addWidget(self.state_bt)
         self.state_wid.layout().addWidget(self.state_led)
     elif name == 'pulse' and self._is_pulsed:
         self.pulse_bt = PyDMStateButton(self, self._pulse_sel)
         self.pulse_led = SiriusLedState(self, self._pulse_sts)
         self.pulse_wid.layout().addWidget(self.pulse_bt)
         self.pulse_wid.layout().addWidget(self.pulse_led)
     elif name == 'intlk':
         if self._is_pulsed:
             self.intlk_led = PyDMLedMultiChannel(
                 self, channels2values={ch: 1
                                        for ch in self._intlk})
             self.intlk_wid.layout().addWidget(self.intlk_led)
         elif self._is_linac:
             if IsLinacSpect.match(self.devname):
                 self.intlk_led = LISpectIntlkLed(self)
             else:
                 self.intlk_led = PyDMLedMultiChannel(self,
                                                      channels2values={
                                                          self._intlk: {
                                                              'value':
                                                              _PS_LI_INTLK,
                                                              'comp': 'lt'
                                                          }
                                                      })
             self.intlk_wid.layout().addWidget(self.intlk_led)
         elif self._is_regatron:
             if not self._is_reg_slave:
                 self.generr_led = SiriusLedAlert(self, self._generr)
                 self.genwrn_led = SiriusLedAlert(self, self._genwrn)
                 self.intlk_wid.layout().addWidget(self.generr_led)
                 self.intlk_wid.layout().addWidget(self.genwrn_led)
         elif self._is_fofb:
             self.intlk_led = PyDMLedMultiChannel(
                 self, channels2values={ch: 1
                                        for ch in self._intlk})
             self.intlk_wid.layout().addWidget(self.intlk_led)
         else:
             self.soft_intlk_led = SiriusLedAlert(self, self._soft_intlk)
             self.hard_intlk_led = SiriusLedAlert(self, self._hard_intlk)
             self.intlk_wid.layout().addWidget(self.soft_intlk_led)
             self.intlk_wid.layout().addWidget(self.hard_intlk_led)
     elif name == 'conn' and self._is_linac:
         self.conn_led = PyDMLedMultiChannel(
             self, channels2values={self._conn: 0})
         self.conn_wid.layout().addWidget(self.conn_led)
     elif name == 'reset' and self._has_reset:
         self.reset_bt = PyDMPushButton(parent=self,
                                        init_channel=self._reset_intlk,
                                        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;}')
         self.reset_wid.layout().addWidget(self.reset_bt)
     elif name == 'ctrlloop' and self._has_ctrlloop:
         if self._is_fofb:
             self.ctrlloop_bt = PyDMStateButton(self, self._ctrlloop_sel)
         else:
             self.ctrlloop_bt = PyDMStateButton(self,
                                                self._ctrlloop_sel,
                                                invert=True)
         self.ctrlloop_lb = PyDMLabel(self, self._ctrlloop_sts)
         self.ctrlloop_wid.layout().addWidget(self.ctrlloop_bt)
         self.ctrlloop_wid.layout().addWidget(self.ctrlloop_lb)
     elif name == 'wfmupdate' and self._has_wfmupdt:
         self.wfmupdate_bt = PyDMStateButton(self, self._wfmupdate_sel)
         self.wfmupdate_led = SiriusLedState(self, self._wfmupdate_sts)
         self.wfmupdate_wid.layout().addWidget(self.wfmupdate_bt)
         self.wfmupdate_wid.layout().addWidget(self.wfmupdate_led)
     elif name == 'updparms' and self._has_parmupdt:
         self.updparms_bt = PyDMPushButton(parent=self,
                                           init_channel=self._updparms_cmd,
                                           pressValue=1)
         self.updparms_bt.setIcon(qta.icon('fa5s.redo-alt'))
         self.updparms_bt.setObjectName('updparms_bt')
         self.updparms_bt.setStyleSheet(
             '#updparms_bt{min-width:25px;max-width:25px;icon-size:20px;}')
         self.updparms_wid.layout().addWidget(self.updparms_bt)
     elif name == 'setpoint' and self._has_analsp:
         self.setpoint = PyDMSpinboxScrollbar(self, self._analog_sp)
         if self._is_fofb:
             self.setpoint.spinbox.precisionFromPV = False
             self.setpoint.spinbox.precision = 6
         self.setpoint_wid.layout().addWidget(self.setpoint)
     elif name == 'readback' and self._has_analrb:
         self.readback = PyDMLabel(self, self._analog_rb)
         if self._is_fofb:
             self.readback.precisionFromPV = False
             self.readback.precision = 6
         self.readback_wid.layout().addWidget(self.readback)
     elif name == 'monitor' and self._has_analmon:
         self.monitor = PyDMLabel(self, self._analog_mon)
         self.monitor_wid.layout().addWidget(self.monitor)
     elif name == 'strength_sp' and self._has_strength:
         self.strength_sp_le = PyDMSpinboxScrollbar(self, self._strength_sp)
         self.strength_sp_wid.layout().addWidget(self.strength_sp_le)
     elif name == 'strength_rb' and self._has_strength:
         self.strength_rb_lb = PyDMLabel(parent=self,
                                         init_channel=self._strength_rb)
         self.strength_rb_lb.showUnits = True
         self.strength_rb_wid.layout().addWidget(self.strength_rb_lb)
     elif name == 'strength_mon' and self._has_strength_mon:
         self.strength_mon_lb = PyDMLabel(parent=self,
                                          init_channel=self._strength_mon)
         self.strength_mon_lb.showUnits = True
         self.strength_mon_wid.layout().addWidget(self.strength_mon_lb)
     elif name == 'trim' and self._has_trim:
         self.trim_bt = QPushButton(qta.icon('fa5s.angle-right'), '', self)
         self.trim_wid.layout().addWidget(self.trim_bt)
     self.filled_widgets.add(name)
Exemplo n.º 17
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
Exemplo n.º 18
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
Exemplo n.º 19
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;
            }""")
Exemplo n.º 20
0
    def _setupUi(self):
        self._lb_bl = QLabel('<h4>' + self._beamline + '</h4>',
                             self,
                             alignment=Qt.AlignCenter)

        self._pb_dev = QPushButton(self._device, self)
        connect_newprocess(
            self._pb_dev,
            ['sirius-hla-si-id-control.py', '-dev', self._device])

        self._sb_phs = PyDMSpinbox(self,
                                   self.dev_pref.substitute(propty='Phase-SP'))
        self._sb_phs.showStepExponent = False
        self._lb_phs = PyDMLabel(self,
                                 self.dev_pref.substitute(propty='Phase-Mon'))

        self._sb_kx = PyDMSpinbox(self,
                                  self.dev_pref.substitute(propty='Kx-SP'))
        self._sb_kx.showStepExponent = False
        self._lb_kx = PyDMLabel(self,
                                self.dev_pref.substitute(propty='Kx-Mon'))

        self._sb_phsspd = PyDMSpinbox(
            self, self.dev_pref.substitute(propty='PhaseSpeed-SP'))
        self._sb_phsspd.showStepExponent = False
        self._lb_phsspd = PyDMLabel(
            self, self.dev_pref.substitute(propty='PhaseSpeed-Mon'))

        self._pb_start = PyDMPushButton(self,
                                        label='',
                                        icon=qta.icon('fa5s.play'))
        self._pb_start.setToolTip(
            'Start automatic motion towards previously entered setpoint.')
        self._pb_start.channel = self.dev_pref.substitute(propty='DevCtrl-Cmd')
        self._pb_start.pressValue = 3  # Start
        self._pb_start.setObjectName('Start')
        self._pb_start.setStyleSheet(
            '#Start{min-width:30px; max-width:30px; icon-size:25px;}')

        self._pb_stop = PyDMPushButton(self,
                                       label='',
                                       icon=qta.icon('fa5s.stop'))
        self._pb_stop.setToolTip('Stop all motion, lock all brakes.')
        self._pb_stop.channel = self.dev_pref.substitute(propty='DevCtrl-Cmd')
        self._pb_stop.pressValue = 1  # Stop
        self._pb_stop.setObjectName('Stop')
        self._pb_stop.setStyleSheet(
            '#Stop{min-width:30px; max-width:30px; icon-size:25px;}')

        self._led_ismov = SiriusLedState(
            self, self.dev_pref.substitute(propty='Moving-Mon'))

        self._led_status = PyDMLedMultiChannel(
            self, {
                self.dev_pref.substitute(propty='Alarm-Mon'): 0,
                self.dev_pref.substitute(propty='IntlkInStop-Mon'): 0,
                self.dev_pref.substitute(propty='IntlkInEOpnGap-Mon'): 0,
                self.dev_pref.substitute(propty='IntlkOutPwrEnbld-Mon'): 1,
                self.dev_pref.substitute(propty='IsOperational-Mon'): 1
            })

        self._sb_blenbl = PyDMStateButton(
            self, self.dev_pref.substitute(propty='BeamLineCtrlEnbl-Sel'))
        self._led_blenbl = SiriusLedState(
            self, self.dev_pref.substitute(propty='BeamLineCtrlEnbl-Sts'))

        self._led_blmon = SiriusLedState(
            self, self.dev_pref.substitute(propty='BeamLineCtrl-Mon'))

        self.widgets = {
            'Beamline': ([
                self._lb_bl,
            ], 'v'),
            'Device': ([
                self._pb_dev,
            ], 'v'),
            'Alarms': ([
                self._led_status,
            ], 'v'),
            'Phase': ([self._sb_phs, self._lb_phs], 'v'),
            'Kx': ([self._sb_kx, self._lb_kx], 'v'),
            'Phase Speed': ([self._sb_phsspd, self._lb_phsspd], 'v'),
            'Start': ([
                self._pb_start,
            ], 'v'),
            'Stop': ([
                self._pb_stop,
            ], 'v'),
            'Moving': ([
                self._led_ismov,
            ], 'v'),
            'BeamLine Enable': ([self._sb_blenbl, self._led_blenbl], 'h'),
            'Beamline Control': ([
                self._led_blmon,
            ], 'v'),
        }

        layout = QHBoxLayout(self)
        for name, size in self.widgets_widths:
            objname = name.replace(' ', '')
            group = self.widgets[name]
            items, ori = group

            widget = QWidget(self)
            lay = QVBoxLayout() if ori == 'v' else QHBoxLayout()
            lay.setContentsMargins(0, 0, 0, 0)
            lay.setAlignment(Qt.AlignCenter)
            lay.setSpacing(0)
            widget.setLayout(lay)

            for item in items:
                lay.addWidget(item)

            widget.setObjectName(objname)
            widget.setStyleSheet(
                '#' + objname +
                '{{min-width:{0}em; max-width:{0}em;}}'.format(str(size)))
            layout.addWidget(widget)
Exemplo n.º 21
0
    def _mainControlsWidget(self):
        self._ld_phs = QLabel('Phase [mm]', self)
        self._sb_phs = PyDMSpinbox(self,
                                   self.dev_pref.substitute(propty='Phase-SP'))
        self._sb_phs.showStepExponent = False
        self._lb_phs = PyDMLabel(self,
                                 self.dev_pref.substitute(propty='Phase-Mon'))

        self._ld_kx = QLabel('Kx', self)
        self._sb_kx = PyDMSpinbox(self,
                                  self.dev_pref.substitute(propty='Kx-SP'))
        self._sb_kx.showStepExponent = False
        self._lb_kx = PyDMLabel(self,
                                self.dev_pref.substitute(propty='Kx-Mon'))

        self._ld_phsspd = QLabel('Phase Speed\n[mm/s]', self)
        self._sb_phsspd = PyDMSpinbox(
            self, self.dev_pref.substitute(propty='PhaseSpeed-SP'))
        self._sb_phsspd.showStepExponent = False
        self._lb_phsspd = PyDMLabel(
            self, self.dev_pref.substitute(propty='PhaseSpeed-Mon'))

        self._ld_ismov = QLabel('Motion', self)
        self._pb_start = PyDMPushButton(self,
                                        label='',
                                        icon=qta.icon('fa5s.play'))
        self._pb_start.setToolTip(
            'Start automatic motion towards previously entered setpoint.')
        self._pb_start.channel = self.dev_pref.substitute(propty='DevCtrl-Cmd')
        self._pb_start.pressValue = 3  # Start
        self._pb_start.setObjectName('Start')
        self._pb_start.setStyleSheet(
            '#Start{min-width:30px; max-width:30px; icon-size:25px;}')
        self._pb_stop = PyDMPushButton(self,
                                       label='',
                                       icon=qta.icon('fa5s.stop'))
        self._pb_stop.setToolTip('Stop all motion, lock all brakes.')
        self._pb_stop.channel = self.dev_pref.substitute(propty='DevCtrl-Cmd')
        self._pb_stop.pressValue = 1  # Stop
        self._pb_stop.setObjectName('Stop')
        self._pb_stop.setStyleSheet(
            '#Stop{min-width:30px; max-width:30px; icon-size:25px;}')
        self._led_ismov = SiriusLedState(self, self.dev_pref + ':Moving-Mon')
        self._led_motenbl = SiriusLedState(
            self, self.dev_pref.substitute(propty='MotorsEnbld-Mon'))
        hbox_motion = QHBoxLayout()
        hbox_motion.setSpacing(15)
        hbox_motion.addWidget(self._pb_start)
        hbox_motion.addWidget(self._pb_stop)
        hbox_motion.addWidget(self._led_ismov)
        hbox_motion.addWidget(self._led_motenbl)

        gbox_main = QGroupBox('Main Controls', self)
        lay_main = QGridLayout(gbox_main)
        lay_main.addWidget(self._ld_phs, 0, 0)
        lay_main.addWidget(self._sb_phs, 0, 1)
        lay_main.addWidget(self._lb_phs, 0, 2)
        lay_main.addWidget(self._ld_kx, 1, 0)
        lay_main.addWidget(self._sb_kx, 1, 1)
        lay_main.addWidget(self._lb_kx, 1, 2)
        lay_main.addWidget(self._ld_phsspd, 2, 0)
        lay_main.addWidget(self._sb_phsspd, 2, 1)
        lay_main.addWidget(self._lb_phsspd, 2, 2)
        lay_main.addItem(QSpacerItem(1, 10, QSzPlcy.Ignored, QSzPlcy.Fixed), 3,
                         0)
        lay_main.addWidget(self._ld_ismov, 4, 0)
        lay_main.addLayout(hbox_motion, 4, 1, 1, 2)
        return gbox_main
Exemplo n.º 22
0
    def _setupCurrentSettingsWidget(self):
        self._ld_storedebeam = QLabel('Stored EBeam?', self)
        self._ld_storedebeam.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                          | Qt.AlignVCenter)
        self._led_storedebeam = SiriusLedState(
            self, self.devname.substitute(propty='StoredEBeam-Mon'))

        self._ld_dcctfault = QLabel('DCCT Fault Check:', self)
        self._ld_dcctfault.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                        | Qt.AlignVCenter)
        self._bt_dcctfault = PyDMStateButton(
            self, self.devname.substitute(propty='DCCTFltCheck-Sel'))
        self._bt_dcctfault.shape = PyDMStateButton.Rounded
        self._led_dcctfault = SiriusLedState(
            self, self.devname.substitute(propty='DCCTFltCheck-Sts'))

        self._ld_seldcct = QLabel('Select DCCT:', self)
        self._ld_seldcct.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                      | Qt.AlignVCenter)
        self._cb_seldcct = PyDMEnumComboBox(
            self, self.devname.substitute(propty='DCCT-Sel'))
        self._lb_seldcct = PyDMLabel(
            self, self.devname.substitute(propty='DCCT-Sts'))
        self._lb_seldcct.setAlignment(Qt.AlignCenter)
        self._lb_seldcct.precision = 0

        self._led_dcct13c4 = SiriusLedAlert(
            self,
            _PVName('SI-13C4:DI-DCCT:ReliableMeas-Mon').substitute(
                prefix=self.prefix))
        self._lb_dcct13c4 = QLabel('DCCT 13C4', self)
        self._lb_dcct13c4.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                       | Qt.AlignVCenter)
        self._pb_13c4_detail = QPushButton(self)
        self._pb_13c4_detail.setObjectName('DCCT13C4_dtl')
        self._pb_13c4_detail.setStyleSheet(
            "#DCCT13C4_dtl{min-width:25px; max-width:25px; icon-size:20px;}")
        self._pb_13c4_detail.setIcon(qta.icon('fa5s.ellipsis-h'))
        connect_window(self._pb_13c4_detail,
                       DCCTMain,
                       self,
                       prefix=self.prefix,
                       device='SI-13C4:DI-DCCT')
        hlay_dcct13c4 = QHBoxLayout()
        hlay_dcct13c4.addItem(
            QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum))
        hlay_dcct13c4.addWidget(self._led_dcct13c4)
        hlay_dcct13c4.addWidget(self._lb_dcct13c4)
        hlay_dcct13c4.addItem(
            QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum))
        hlay_dcct13c4.addWidget(self._pb_13c4_detail)
        hlay_dcct13c4.addItem(
            QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum))

        self._led_dcct14c4 = SiriusLedAlert(
            self,
            _PVName('SI-14C4:DI-DCCT:ReliableMeas-Mon').substitute(
                prefix=self.prefix))
        self._lb_dcct14c4 = QLabel('DCCT 14C4', self)
        self._lb_dcct14c4.setAlignment(Qt.AlignRight | Qt.AlignTrailing
                                       | Qt.AlignVCenter)
        self._pb_14c4_detail = QPushButton(self)
        self._pb_14c4_detail.setObjectName('DCCT14C4_dtl')
        self._pb_14c4_detail.setStyleSheet(
            "#DCCT14C4_dtl{min-width:25px; max-width:25px; icon-size:20px;}")
        self._pb_14c4_detail.setIcon(qta.icon('fa5s.ellipsis-h'))
        connect_window(self._pb_14c4_detail,
                       DCCTMain,
                       self,
                       prefix=self.prefix,
                       device='SI-14C4:DI-DCCT')
        hlay_dcct14c4 = QHBoxLayout()
        hlay_dcct14c4.addItem(
            QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum))
        hlay_dcct14c4.addWidget(self._led_dcct14c4)
        hlay_dcct14c4.addWidget(self._lb_dcct14c4)
        hlay_dcct14c4.addItem(
            QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum))
        hlay_dcct14c4.addWidget(self._pb_14c4_detail)
        hlay_dcct14c4.addItem(
            QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum))

        gbox = QGroupBox('Current Settings and Status', self)
        lay = QGridLayout(gbox)
        lay.addWidget(self._ld_storedebeam, 0, 0)
        lay.addWidget(self._led_storedebeam, 0, 1)
        lay.addWidget(self._ld_dcctfault, 1, 0)
        lay.addWidget(self._bt_dcctfault, 1, 1)
        lay.addWidget(self._led_dcctfault, 1, 2)
        lay.addWidget(self._ld_seldcct, 2, 0)
        lay.addWidget(self._cb_seldcct, 2, 1)
        lay.addWidget(self._lb_seldcct, 2, 2)
        lay.addItem(QSpacerItem(1, 1, QSzPlcy.Expanding, QSzPlcy.Minimum), 3,
                    0)
        lay.addLayout(hlay_dcct13c4, 4, 0, 1, 3)
        lay.addLayout(hlay_dcct14c4, 5, 0, 1, 3)
        lay.setColumnStretch(0, 2)
        lay.setColumnStretch(1, 1)
        lay.setColumnStretch(2, 1)
        return gbox
Exemplo n.º 23
0
    def _setupUi(self):
        lay = QVBoxLayout()
        lay.addWidget(
            QLabel('<h3>Settings</h3>',
                   self,
                   alignment=Qt.AlignHCenter | Qt.AlignBottom))
        lay.setStretch(0, 1)

        # Measure
        l_reliablemeas = QLabel('Reliability: ')
        self.led_ReliableMeas = SiriusLedAlert(
            self, self.dcct_prefix.substitute(propty='ReliableMeas-Mon'))

        l_curr = QLabel('Current [mA]: ', self, alignment=Qt.AlignRight)
        self.label_current = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='Current-Mon'))
        self.led_StoredEBeam = SiriusLedState(
            self, self.dcct_prefix.substitute(propty='StoredEBeam-Mon'))
        hlay_current = QHBoxLayout()
        hlay_current.addWidget(self.label_current)
        hlay_current.addWidget(self.led_StoredEBeam)

        l_enbl = QLabel('Enable:', self)
        self.pydmstatebutton_Enbl = PyDMStateButton(
            self, self.dcct_prefix.substitute(propty='Enbl-Sel'))
        self.pydmstatebutton_Enbl.shape = 1
        self.led_Enbl = SiriusLedState(
            self, self.dcct_prefix.substitute(propty='Enbl-Sts'))
        hlay_enbl = QHBoxLayout()
        hlay_enbl.addWidget(self.pydmstatebutton_Enbl)
        hlay_enbl.addWidget(self.led_Enbl)

        l_meastrig = QLabel('Trigger Source:', self)
        self.pydmenumcombobox_MeasTrg = PyDMEnumComboBox(
            self, self.dcct_prefix.substitute(propty='MeasTrg-Sel'))
        self.pydmlabel_MeasTrg = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='MeasTrg-Sts'))
        hlay_meastrig = QHBoxLayout()
        hlay_meastrig.addWidget(self.pydmenumcombobox_MeasTrg)
        hlay_meastrig.addWidget(self.pydmlabel_MeasTrg)

        if 'SI' in self.device:
            l_range = QLabel('Range: ', self)
            self.pydmenumcombobox_Range = PyDMEnumComboBox(
                self, self.dcct_prefix.substitute(propty='Range-Sel'))
            self.pydmlabel_Range = PyDMLabel(
                self, self.dcct_prefix.substitute(propty='Range-Sts'))
            hlay_range = QHBoxLayout()
            hlay_range.addWidget(self.pydmenumcombobox_Range)
            hlay_range.addWidget(self.pydmlabel_Range)
            hlay_range.setContentsMargins(0, 0, 0, 0)

        l_measmode = QLabel('Mode: ', self)
        self.pydmenumcombobox_MeasMode = PyDMEnumComboBox(
            self, self.dcct_prefix.substitute(propty='MeasMode-Sel'))
        self.pydmlabel_MeasMode = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='MeasMode-Sts'))
        hlay_measmode = QHBoxLayout()
        hlay_measmode.addWidget(self.pydmenumcombobox_MeasMode)
        hlay_measmode.addWidget(self.pydmlabel_MeasMode)
        hlay_measmode.setContentsMargins(0, 0, 0, 0)

        glay_mode = QGridLayout()
        self.normalmode_widget = self._setupMeasSettingsWidget('Normal')
        self.fastmode_widget = self._setupMeasSettingsWidget('Fast')
        glay_mode.addWidget(self.normalmode_widget, 0, 0)
        glay_mode.addWidget(self.fastmode_widget, 0, 0)
        glay_mode.setContentsMargins(0, 0, 0, 0)
        self.mode_channel = SiriusConnectionSignal(
            self.dcct_prefix.substitute(propty='MeasMode-Sel'))
        self.mode_channel.new_value_signal.connect(self._showMeasModeSettings)

        # Details
        self.pb_details = QPushButton(qta.icon('fa5s.ellipsis-h'), '', self)
        self.pb_details.setToolTip('Open details')
        self.pb_details.setObjectName('detail')
        self.pb_details.setStyleSheet(
            "#detail{min-width:25px; max-width:25px; icon-size:20px;}")
        detail_window = create_window_from_widget(DCCTSettingsDetails,
                                                  title=self.device +
                                                  ' Settings Details')
        _hlautil.connect_window(self.pb_details,
                                detail_window,
                                self,
                                prefix=self.prefix,
                                device=self.device)

        gbox_gen = QGroupBox('Measure')
        glay_gen = QGridLayout(gbox_gen)
        glay_gen.setAlignment(Qt.AlignVCenter)
        glay_gen.addWidget(l_curr, 0, 0)
        glay_gen.addLayout(hlay_current, 0, 1)
        glay_gen.addWidget(l_reliablemeas, 1, 0)
        glay_gen.addWidget(self.led_ReliableMeas, 1, 1, alignment=Qt.AlignLeft)
        glay_gen.addWidget(l_enbl, 2, 0)
        glay_gen.addLayout(hlay_enbl, 2, 1)
        glay_gen.addWidget(l_meastrig, 3, 0)
        glay_gen.addLayout(hlay_meastrig, 3, 1)
        if 'SI' in self.device:
            glay_gen.addWidget(l_range, 4, 0)
            glay_gen.addLayout(hlay_range, 4, 1)
        glay_gen.addWidget(l_measmode, 5, 0)
        glay_gen.addLayout(hlay_measmode, 5, 1)
        glay_gen.addLayout(glay_mode, 6, 0, 1, 2)
        glay_gen.addWidget(self.pb_details,
                           7,
                           0,
                           1,
                           2,
                           alignment=Qt.AlignRight)
        gbox_gen.setStyleSheet("""
            .QLabel{
                qproperty-alignment: 'AlignVCenter | AlignRight';
                min-width: 6em;}
            PyDMLed{
                min-width: 6em;}""")
        lay.addWidget(gbox_gen)
        lay.setStretch(1, 7)

        # Trigger
        self.trigger_widget = QGroupBox('Trigger')
        hbl = QHBoxLayout(self.trigger_widget)
        hbl.addWidget(
            HLTriggerSimple(self.trigger_widget,
                            device=self.device.substitute(dis='TI'),
                            prefix=self.prefix))
        lay.addWidget(self.trigger_widget)
        lay.setStretch(2, 3)

        self.setLayout(lay)
        self.setStyleSheet("""
            QSpinBox, QComboBox, QPushButton,
            PyDMSpinbox, PyDMEnumComboBox, PyDMLabel{
                min-width:6em; max-width:6em;}
            .QLabel{max-height:1.5em;}""")
Exemplo n.º 24
0
    def setupui(self):
        vbl = QVBoxLayout(self)
        lab = QLabel('<h2>' + self.bpm + ' Settings</h2>')
        lab.setAlignment(Qt.AlignCenter)
        vbl.addWidget(lab)
        vbl.addSpacing(10)

        hbl = QHBoxLayout()
        hbl.setSpacing(15)
        hbl.addStretch()
        grpbx = CustomGroupBox('Status', self)
        gdl = QGridLayout(grpbx)
        props = (('asyn.CNCT', 'Connected'), ('asyn.ENBL', 'Enabled'),
                 ('RFFEasyn.CNCT', 'RFFE Connected'),
                 ('RFFEasyn.ENBL', 'RFFE Enabled'), ('ADCAD9510PllStatus-Mon',
                                                     'Clock Synched'))
        for i, prop in enumerate(props):
            led = SiriusLedState(grpbx, init_channel=self.get_pvname(prop[0]))
            led.setOffColor(led.Red)
            lab = QLabel(prop[1], grpbx)
            gdl.addWidget(led, i, 0)
            gdl.addWidget(lab, i, 1)
        hbl.addWidget(grpbx)
        hbl.addStretch()

        grpbx = CustomGroupBox('Advanced Settings', self)
        vbl2 = QVBoxLayout(grpbx)
        vbl2.setSpacing(10)
        pbt = QPushButton('Software')
        Window = create_window_from_widget(AdvancedSettings,
                                           title=self.bpm +
                                           ': Advanced Settings')
        util.connect_window(pbt,
                            Window,
                            parent=grpbx,
                            prefix=self.prefix,
                            bpm=self.bpm)
        vbl2.addWidget(pbt)
        pbt = QPushButton('Hardware')
        Window = create_window_from_widget(HardwareSettings,
                                           title=self.bpm +
                                           ': Hardware Settings')
        util.connect_window(pbt,
                            Window,
                            parent=grpbx,
                            prefix=self.prefix,
                            bpm=self.bpm)
        vbl2.addWidget(pbt)
        hbl.addWidget(grpbx)
        hbl.addStretch()
        vbl.addItem(hbl)
        vbl.addSpacing(20)
        vbl.addStretch()

        grpbx = self._create_formlayout_groupbox(
            'Offset Parameters', (('PosQOffset-SP', 'Offset PosQ'),
                                  ('PosXOffset-SP', 'Offset PosX'),
                                  ('PosYOffset-SP', 'Offset PosY')))
        vbl.addWidget(grpbx)
        vbl.addSpacing(20)
        vbl.addStretch()
        grpbx = self._create_formlayout_groupbox('Gain Parameters',
                                                 (('PosKq-SP', 'Gain PosQ'),
                                                  ('PosKsum-SP', 'Gain Sum'),
                                                  ('PosKx-SP', 'Gain PosX'),
                                                  ('PosKy-SP', 'Gain PosY')))
        vbl.addWidget(grpbx)
        vbl.addSpacing(20)
        vbl.addStretch()
        grpbx = self._create_formlayout_groupbox(
            'Informations', (('INFOHarmonicNumber-SP', 'Harmonic Number'),
                             ('INFOFOFBRate-SP', 'FOFB Rate'),
                             ('INFOMONITRate-SP', 'Monitor Rate'),
                             ('INFOTBTRate-SP', 'TbT Rate'),
                             ('RFFEAtt-SP', 'RFFE Attenuation')))
        vbl.addWidget(grpbx)
        vbl.addSpacing(20)
        vbl.addStretch()
Exemplo n.º 25
0
    def _setupGeneralSettingsWidget(self):
        gbox_generalsettings = QGroupBox('General Measurement Settings', self)

        l_enbl = QLabel('Enable:', self)
        self.pydmstatebutton_Enbl = PyDMStateButton(
            self, self.dcct_prefix.substitute(propty='Enbl-Sel'))
        self.pydmstatebutton_Enbl.shape = 1
        self.led_Enbl = SiriusLedState(
            self, self.dcct_prefix.substitute(propty='Enbl-Sts'))
        hlay_enbl = QHBoxLayout()
        hlay_enbl.addWidget(self.pydmstatebutton_Enbl)
        hlay_enbl.addWidget(self.led_Enbl)

        l_meastrig = QLabel('Trigger Source: ', self)
        self.pydmenumcombobox_MeasTrg = PyDMEnumComboBox(
            self, self.dcct_prefix.substitute(propty='MeasTrg-Sel'))
        self.pydmlabel_MeasTrg = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='MeasTrg-Sts'))
        hlay_meastrig = QHBoxLayout()
        hlay_meastrig.addWidget(self.pydmenumcombobox_MeasTrg)
        hlay_meastrig.addWidget(self.pydmlabel_MeasTrg)

        l_trigmiss = QLabel('Trigger Is Missing?', self)
        self.led_TrgMiss = SiriusLedAlert(
            self, self.dcct_prefix.substitute(propty='TrgIsMissing-Mon'))
        hlay_trigmiss = QHBoxLayout()
        hlay_trigmiss.addWidget(self.led_TrgMiss)
        hlay_trigmiss.setAlignment(Qt.AlignLeft)

        l_range = QLabel('Range: ', self)
        self.pydmenumcombobox_Range = PyDMEnumComboBox(
            self, self.dcct_prefix.substitute(propty='Range-Sel'))
        self.pydmlabel_Range = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='Range-Sts'))
        hlay_range = QHBoxLayout()
        hlay_range.addWidget(self.pydmenumcombobox_Range)
        hlay_range.addWidget(self.pydmlabel_Range)

        l_lowlimenbl = QLabel('Low Beam Current Detection: ', self)
        self.pydmstatebutton_LowLimEnbl = PyDMStateButton(
            self, self.dcct_prefix.substitute(propty='LowLimEnbl-Sel'))
        self.pydmstatebutton_LowLimEnbl.shape = 1
        self.pydmlabel_LowLimEnbl = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='LowLimEnbl-Sts'))
        hlay_lowlimenbl = QHBoxLayout()
        hlay_lowlimenbl.addWidget(self.pydmstatebutton_LowLimEnbl)
        hlay_lowlimenbl.addWidget(self.pydmlabel_LowLimEnbl)

        l_currthold = QLabel('Current Threshold [mA]: ', self)
        self.pydmspinbox_CurrThold = PyDMSpinbox(
            self, self.dcct_prefix.substitute(propty='CurrThold-SP'))
        self.pydmspinbox_CurrThold.showStepExponent = False
        self.pydmlabel_CurrThold = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='CurrThold-RB'))
        hlay_currthold = QHBoxLayout()
        hlay_currthold.addWidget(self.pydmspinbox_CurrThold)
        hlay_currthold.addWidget(self.pydmlabel_CurrThold)

        l_hfreject = QLabel('High Frequency Rejection: ', self)
        self.pydmstatebutton_HFReject = PyDMStateButton(
            self, self.dcct_prefix.substitute(propty='HFReject-Sel'))
        self.pydmstatebutton_HFReject.shape = 1
        self.pydmlabel_HFReject = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='HFReject-Sts'))
        hlay_hfreject = QHBoxLayout()
        hlay_hfreject.addWidget(self.pydmstatebutton_HFReject)
        hlay_hfreject.addWidget(self.pydmlabel_HFReject)

        l_measmode = QLabel('Mode: ', self)
        self.pydmenumcombobox_MeasMode = PyDMEnumComboBox(
            self, self.dcct_prefix.substitute(propty='MeasMode-Sel'))
        self.pydmlabel_MeasMode = PyDMLabel(
            self, self.dcct_prefix.substitute(propty='MeasMode-Sts'))
        hlay_measmode = QHBoxLayout()
        hlay_measmode.addWidget(self.pydmenumcombobox_MeasMode)
        hlay_measmode.addWidget(self.pydmlabel_MeasMode)

        flay_generalsettings = QFormLayout()
        flay_generalsettings.setLabelAlignment(Qt.AlignRight)
        flay_generalsettings.setFormAlignment(Qt.AlignCenter)
        flay_generalsettings.addRow(l_enbl, hlay_enbl)
        flay_generalsettings.addRow(l_meastrig, hlay_meastrig)
        flay_generalsettings.addRow(l_trigmiss, hlay_trigmiss)
        flay_generalsettings.addRow(l_range, hlay_range)
        flay_generalsettings.addItem(
            QSpacerItem(1, 10, QSzPly.Ignored, QSzPly.Preferred))
        flay_generalsettings.addRow(l_lowlimenbl, hlay_lowlimenbl)
        flay_generalsettings.addRow(l_currthold, hlay_currthold)
        flay_generalsettings.addRow(l_hfreject, hlay_hfreject)
        flay_generalsettings.addItem(
            QSpacerItem(1, 10, QSzPly.Ignored, QSzPly.Preferred))
        flay_generalsettings.addRow(l_measmode, hlay_measmode)
        gbox_generalsettings.setLayout(flay_generalsettings)
        return gbox_generalsettings