Example #1
0
    def _init_ui(self):
        # Widgets
        self._txt_x = NumericalAttributeLineEdit(self._class.x)
        self._txt_y = NumericalAttributeLineEdit(self._class.y)
        self._txt_z = NumericalAttributeLineEdit(self._class.z)
        self._txt_r = NumericalAttributeLineEdit(self._class.r)
        self._txt_t = NumericalAttributeLineEdit(self._class.t)

        # Layouts
        if self._inline:
            layout = QVBoxLayout()

            layout_xyz = QHBoxLayout()
            layout_xyz.addWidget(QLabel('X'))
            layout_xyz.addWidget(self._txt_x)
            layout_xyz.addWidget(QLabel('Y'))
            layout_xyz.addWidget(self._txt_y)
            layout_xyz.addWidget(QLabel('Z'))
            layout_xyz.addWidget(self._txt_z)

            layout_rt = QHBoxLayout()
            layout_rt.addWidget(QLabel('R'))
            layout_rt.addWidget(self._txt_r)
            layout_rt.addWidget(QLabel('T'))
            layout_rt.addWidget(self._txt_t)

            layout.addLayout(layout_xyz)
            layout.addLayout(layout_rt)
        else:
            layout = _ConditionWidget._init_ui(self)
            layout.addRow('X', self._txt_x)
            layout.addRow('Y', self._txt_y)
            layout.addRow('Z', self._txt_z)
            layout.addRow('R', self._txt_r)
            layout.addRow('T', self._txt_t)

        # Signals
        self._txt_x.textEdited.connect(self.edited)
        self._txt_y.textEdited.connect(self.edited)
        self._txt_z.textEdited.connect(self.edited)
        self._txt_r.textEdited.connect(self.edited)
        self._txt_t.textEdited.connect(self.edited)

        return layout
Example #2
0
    def _voltage_layout(self):
        voltage_layout = QVBoxLayout()

        self.voltage_sp_widget = PyDMSpinboxScrollbar(self,
                                                      self._voltage_sp_pv)
        self.voltage_rb_label = PyDMLabel(self, self._voltage_rb_pv)
        self.voltage_rb_label.showUnits = True
        self.voltage_rb_label.precisionFromPV = True
        self.voltage_mon_label = PyDMLabel(self, self._voltage_mon_pv)
        self.voltage_mon_label.showUnits = True
        self.voltage_mon_label.precisionFromPV = True

        voltage_layout = QFormLayout()
        voltage_layout.setLabelAlignment(Qt.AlignRight)
        voltage_layout.setFormAlignment(Qt.AlignHCenter)
        voltage_layout.addRow('SP:', self.voltage_sp_widget)
        voltage_layout.addRow('RB:', self.voltage_rb_label)
        voltage_layout.addRow('Mon:', self.voltage_mon_label)

        return voltage_layout