Esempio n. 1
0
    def __init__(self, parent=None, args=[], macros=None):
        super(TableDisplay, self).__init__(parent=parent,
                                           args=args,
                                           macros=macros)

        table_batch = len(devices) * 8  # if len(devices) * 8 < 30 else 30

        horizontal_header_labels = [
            'Channel Name', 'Device Name', 'Device Alpha', 'Temperature',
            'Temperature Raw'
        ]

        self.tdc = MBTempTableDataController(
            self.table,
            devices=devices,
            table_batch=table_batch,
            horizontal_header_labels=horizontal_header_labels)

        self.tfFilter.editingFinished.connect(
            lambda: self.filter(self.tfFilter.text()))

        self.btnNavLeft.clicked.connect(lambda: self.update_navbar(False))
        self.btnNavLeft.setIcon(IconFont().icon('arrow-left'))
        self.btnNavRight.clicked.connect(lambda: self.update_navbar(True))
        self.btnNavRight.setIcon(IconFont().icon('arrow-right'))
        PyDMApplication.instance().hide_nav_bar = True
Esempio n. 2
0
    def __init__(self, parent=None, args=None, macros=None):
        super(MKS, self).__init__(parent=parent,
                                  args=args,
                                  macros=macros,
                                  ui_filename=MKS_MAIN_UI)
        self.caput_lock = threading.RLock()
        self.caput_enable = True

        table_batch = 0
        for device in DEVICES:
            if not device.enable:
                continue
            for channel in device.channels:
                if not channel.enable or CH_REG.match(channel.prefix[-3:]):
                    continue
                table_batch += 1

        horizontal_header_labels = [tc.value for tc in TableColumn]
        self.tdc = MKSTableDataController(
            self.table,
            devices=DEVICES,
            table_batch=table_batch,
            horizontal_header_labels=horizontal_header_labels,
        )

        self.tfFilter.editingFinished.connect(
            lambda: self.filter(self.tfFilter.text()))

        self.btnNavLeft.clicked.connect(lambda: self.update_navbar(False))
        self.btnNavLeft.setIcon(IconFont().icon("arrow-left"))
        self.btnNavRight.clicked.connect(lambda: self.update_navbar(True))
        self.btnNavRight.setIcon(IconFont().icon("arrow-right"))

        self.checkBoxAlarm: QCheckBox
        self.checkBoxUnit: QCheckBox
        self.checkBoxProtect: QCheckBox
        self.checkBoxRelay1: QCheckBox
        self.checkBoxRelay5: QCheckBox
        self.checkBoxRelay7: QCheckBox
        self.checkBoxRelayPirani: QCheckBox

        self.checkBoxAlarm.stateChanged.connect(self.displayColumns)
        self.checkBoxUnit.stateChanged.connect(self.displayColumns)
        self.checkBoxProtect.stateChanged.connect(self.displayColumns)
        self.checkBoxRelay1.stateChanged.connect(self.displayColumns)
        self.checkBoxRelay5.stateChanged.connect(self.displayColumns)
        self.checkBoxRelay7.stateChanged.connect(self.displayColumns)
        self.checkBoxRelayPirani.stateChanged.connect(self.displayColumns)

        self.checkBoxAlarm.setCheckState(2)
        self.checkBoxUnit.setCheckState(2)
        self.checkBoxProtect.setCheckState(2)
        self.checkBoxRelay1.setCheckState(0)
        self.checkBoxRelay5.setCheckState(0)
        self.checkBoxRelay7.setCheckState(0)
        self.checkBoxRelayPirani.setCheckState(0)

        for i in range(6, 16):
            self.table.setColumnHidden(i, True)
Esempio n. 3
0
    def setup_icons(self):
        REFRESH_ICON = IconFont().icon('refresh')
        # Overview
        self.btnSstate.setIcon(REFRESH_ICON)
        self.btnSCtrlMode.setIcon(REFRESH_ICON)
        self.btnMState.setIcon(REFRESH_ICON)
        self.btnMCtrlMode.setIcon(REFRESH_ICON)
        self.btnActIFace.setIcon(REFRESH_ICON)

        self.btnSave.setIcon(IconFont().icon('download'))
        self.btnClear.setIcon(IconFont().icon('eraser'))

        # Module
        self.btnMMV.setIcon(REFRESH_ICON)
        self.btnMMC.setIcon(REFRESH_ICON)
        self.btnMMinC.setIcon(REFRESH_ICON)
        self.btnMMP.setIcon(REFRESH_ICON)
        self.btnMMinV.setIcon(REFRESH_ICON)
        self.btnMMinP.setIcon(REFRESH_ICON)
        self.btnMRes.setIcon(REFRESH_ICON)
        self.btnNomDCV.setIcon(REFRESH_ICON)
        self.btnDCV.setIcon(REFRESH_ICON)
        self.btnMOV.setIcon(REFRESH_ICON)
        self.btnMOC.setIcon(REFRESH_ICON)
        self.btnMOP.setIcon(REFRESH_ICON)

        self.btnMVPRb.setIcon(REFRESH_ICON)
        self.btnMVLQ4Rb.setIcon(REFRESH_ICON)
        self.btnMCPRb.setIcon(REFRESH_ICON)
        self.btnMCQLRb.setIcon(REFRESH_ICON)
        self.btnMPPRb.setIcon(REFRESH_ICON)
        self.btnMPLQRb.setIcon(REFRESH_ICON)
        self.btnMRPRb.setIcon(REFRESH_ICON)

        # System
        self.PyDMPushButton_17.setIcon(REFRESH_ICON)
        self.PyDMPushButton_18.setIcon(REFRESH_ICON)
        self.PyDMPushButton_19.setIcon(REFRESH_ICON)
        self.PyDMPushButton_20.setIcon(REFRESH_ICON)
        self.PyDMPushButton_21.setIcon(REFRESH_ICON)
        self.PyDMPushButton_22.setIcon(REFRESH_ICON)
        self.PyDMPushButton_23.setIcon(REFRESH_ICON)
        self.PyDMPushButton_28.setIcon(REFRESH_ICON)
        self.PyDMPushButton_29.setIcon(REFRESH_ICON)
        self.PyDMPushButton_45.setIcon(REFRESH_ICON)
        self.PyDMPushButton_46.setIcon(REFRESH_ICON)
        self.PyDMPushButton_47.setIcon(REFRESH_ICON)
        self.PyDMPushButton_48.setIcon(REFRESH_ICON)
        self.PyDMPushButton_49.setIcon(REFRESH_ICON)
        self.PyDMPushButton_57.setIcon(REFRESH_ICON)
        self.PyDMPushButton_71.setIcon(REFRESH_ICON)
        self.PyDMPushButton_73.setIcon(REFRESH_ICON)

        # Advanced
        self.PyDMPushButton_41.setIcon(REFRESH_ICON)
        self.PyDMPushButton_50.setIcon(REFRESH_ICON)
        self.PyDMPushButton_51.setIcon(REFRESH_ICON)
        self.PyDMPushButton_52.setIcon(REFRESH_ICON)
Esempio n. 4
0
    def __init__(self, parent=None, args=None, macros=None):
        super(TableDisplay, self).__init__(parent=parent,
                                           args=args,
                                           macros=macros)

        table_batch = 0
        for device in DEVICES:
            if not device.enable:
                continue
            for channel in device.channels:
                if not channel.enable:
                    continue
                table_batch += 1

        horizontal_header_labels = [
            "Channel Name",
            "Device Name",
            "Device Alpha",
            "Temperature",
        ]
        # "Temperature Raw",]

        self.tdc = MBTempTableDataController(
            self.table,
            devices=DEVICES,
            table_batch=table_batch,
            horizontal_header_labels=horizontal_header_labels,
        )

        self.tfFilter.editingFinished.connect(
            lambda: self.filter(self.tfFilter.text()))

        self.TempMax.valueChanged.connect(
            lambda: self.tdc.update_TempMaxMin(Maximum=self.TempMax.value()))

        self.TempMin.valueChanged.connect(
            lambda: self.tdc.update_TempMaxMin(Minimum=self.TempMin.value()))

        self.btnNavLeft.clicked.connect(lambda: self.update_navbar(False))
        self.btnNavLeft.setIcon(IconFont().icon("arrow-left"))
        self.btnNavRight.clicked.connect(lambda: self.update_navbar(True))
        self.btnNavRight.setIcon(IconFont().icon("arrow-right"))
        PyDMApplication.instance().hide_nav_bar = True
Esempio n. 5
0
    def __init__(self, parent=None, args=None, macros=None):
        super(DevicePreview, self).__init__(parent=parent, args=args, macros=macros)
        self.btn1.filenames = [DEVICE_MENU]
        self.btn1.setIcon(IconFont().icon("edit"))

        if macros:
            if macros.get("A") == MKS_SENSOR_COLD_CATHODE:
                self.PyDMLabel_2.hide()
                self.label_2.hide()

            if macros.get("B") == MKS_SENSOR_COLD_CATHODE:
                self.PyDMLabel_4.hide()
                self.label_4.hide()

            if macros.get("C") == MKS_SENSOR_COLD_CATHODE:
                self.PyDMLabel_6.hide()
                self.label_6.hide()
Esempio n. 6
0
    def __init__(self, parent=None, args=[], macros=None):
        super(DevicePreview, self).__init__(parent=parent,
                                            args=args,
                                            macros=macros)
        self.btn1.filenames = [DEVICE_MENU]
        self.btn1.setIcon(IconFont().icon('edit'))

        if macros:
            if macros.get('A') == COLD_CATHODE:
                self.PyDMLabel_2.hide()
                self.label_2.hide()

            if macros.get('B') == COLD_CATHODE:
                self.PyDMLabel_4.hide()
                self.label_4.hide()

            if macros.get('C') == COLD_CATHODE:
                self.PyDMLabel_6.hide()
                self.label_6.hide()
Esempio n. 7
0
    def __init__(self, parent=None, **kwargs):
        super(PCDSSymbolBase, self).__init__(parent=parent, **kwargs)
        self._expert_display = None
        self.interlock = None
        self._channels_prefix = None
        self._rotate_icon = False

        self._show_icon = True
        self._show_status_tooltip = True
        self._icon_size = -1
        self._icon = None

        self._icon_cursor = self.setCursor(
            QCursor(IconFont().icon("file").pixmap(16, 16))
        )

        self._expert_ophyd_class = self.EXPERT_OPHYD_CLASS or ""

        self.interlock = QFrame(self)
        self.interlock.setObjectName("interlock")
        self.interlock.setSizePolicy(QSizePolicy.Expanding,
                                     QSizePolicy.Expanding)

        self.controls_frame = QFrame(self)
        self.controls_frame.setObjectName("controls")
        self.controls_frame.setSizePolicy(QSizePolicy.Maximum,
                                          QSizePolicy.Maximum)
        self.setLayout(QVBoxLayout())
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().addWidget(self.interlock)
        if not hasattr(self, '_controls_location'):
            self._controls_location = ContentLocation.Bottom
        self.setup_icon()
        self.assemble_layout()
        self.update_status_tooltip()
Esempio n. 8
0
    def __init__(self, parent=None, args=[], macros=None):
        super(UHV, self).__init__(parent=parent, args=args, macros=macros)

        table_batch = 600

        horizontal_header_labels = [
            'Channel Name',  # 0
            'Device Name',  # 1
            'Fan Temperature',  # 2
            'Autostart',  # 3
            'Pressure',  # 4
            'Unit',  # 5
            'Voltage',  # 6
            'Current',  # 7
            'Temperature',  # 8
            'Error Code Mon LSB',  # 9
            'HV State',  # 10
            'Power Max',  # 11
            'V Target',  # 12
            'I Protect',  # 13
            'Setpoint',  # 14
            'Details'
        ]
        # self.tdc = UHVDataController(self.table)
        self.tdc = UHVDataController(
            self.table,
            devices=devices,
            table_batch=table_batch,
            horizontal_header_labels=horizontal_header_labels)

        self.chAlarms.stateChanged.connect(
            lambda: self.showHideColumn(ALARM, self.chAlarms))
        self.chCurrent.stateChanged.connect(
            lambda: self.showHideColumn(CURRENT, self.chCurrent))
        self.chPressure.stateChanged.connect(
            lambda: self.showHideColumn(PRESSURE, self.chPressure))
        self.chVoltage.stateChanged.connect(
            lambda: self.showHideColumn(VOLTAGE, self.chVoltage))
        self.chTemperature.stateChanged.connect(
            lambda: self.showHideColumn(TEMPERATURE, self.chTemperature))
        self.chFanTemperature.stateChanged.connect(lambda: self.showHideColumn(
            FAN_TEMPERATURE, self.chFanTemperature))
        self.chDeviceName.stateChanged.connect(
            lambda: self.showHideColumn(DEVICE_NAME, self.chDeviceName))
        self.chDeviceName.stateChanged.connect(
            lambda: self.showHideColumn(DEVICE_NAME, self.chDeviceName))
        self.chChConfig.stateChanged.connect(
            lambda: self.showHideColumn(CH_CONFIG, self.chChConfig))
        self.chAutostart.stateChanged.connect(
            lambda: self.showHideColumn(AUTOSTART, self.chAutostart))

        self.tfFilter.editingFinished.connect(
            lambda: self.filter(self.tfFilter.text()))

        self.btnNavLeft.clicked.connect(lambda: self.update_navbar(False))
        self.btnNavLeft.setIcon(IconFont().icon('arrow-left'))
        self.btnNavRight.clicked.connect(lambda: self.update_navbar(True))
        self.btnNavRight.setIcon(IconFont().icon('arrow-right'))

        self.showHideColumn(ALARM, False)
        self.showHideColumn(CURRENT, False)
        self.showHideColumn(VOLTAGE, False)
        self.showHideColumn(TEMPERATURE, False)
        self.showHideColumn(FAN_TEMPERATURE, False)
        self.showHideColumn(CH_CONFIG, False)
        self.showHideColumn(CH_CONFIG, False)
        self.showHideColumn(AUTOSTART, False)
Esempio n. 9
0
    def __init__(self, parent=None, args=None, macros=None):
        super(UHV, self).__init__(parent=parent,
                                  args=args,
                                  macros=macros,
                                  ui_filename=AGILENT_MAIN_UI)
        horizontal_header_labels = [
            "Channel Name",  # 0
            "Device Name",  # 1
            "Fan Temperature",  # 2
            "Autostart",  # 3
            "Pressure",  # 4
            "Unit",  # 5
            "Voltage",  # 6
            "Current",  # 7
            "Temperature",  # 8
            "Error Code Mon LSB",  # 9
            "HV State",  # 10
            "Power Max",  # 11
            "V Target",  # 12
            "I Protect",  # 13
            "Setpoint",  # 14
            "Details",
        ]
        table_batch = 0
        for device in DEVICES:
            if not device.enable:
                continue
            for channel in device.channels:
                if not channel.enable or CH_REG.match(channel.prefix[-3:]):
                    continue
                table_batch += 1
        self.tdc = UHVDataController(
            self.table,
            devices=DEVICES,
            table_batch=table_batch,
            horizontal_header_labels=horizontal_header_labels,
        )

        self.chAlarms.stateChanged.connect(
            lambda: self.showHideColumn(ALARM, self.chAlarms))
        self.chCurrent.stateChanged.connect(
            lambda: self.showHideColumn(CURRENT, self.chCurrent))
        self.chPressure.stateChanged.connect(
            lambda: self.showHideColumn(PRESSURE, self.chPressure))
        self.chVoltage.stateChanged.connect(
            lambda: self.showHideColumn(VOLTAGE, self.chVoltage))
        self.chTemperature.stateChanged.connect(
            lambda: self.showHideColumn(TEMPERATURE, self.chTemperature))
        self.chFanTemperature.stateChanged.connect(lambda: self.showHideColumn(
            FAN_TEMPERATURE, self.chFanTemperature))
        self.chDeviceName.stateChanged.connect(
            lambda: self.showHideColumn(DEVICE_NAME, self.chDeviceName))
        self.chDeviceName.stateChanged.connect(
            lambda: self.showHideColumn(DEVICE_NAME, self.chDeviceName))
        self.chChConfig.stateChanged.connect(
            lambda: self.showHideColumn(CH_CONFIG, self.chChConfig))
        self.chAutostart.stateChanged.connect(
            lambda: self.showHideColumn(AUTOSTART, self.chAutostart))

        self.tfFilter.editingFinished.connect(
            lambda: self.filter(self.tfFilter.text()))

        self.btnNavLeft.clicked.connect(lambda: self.update_navbar(False))
        self.btnNavLeft.setIcon(IconFont().icon("arrow-left"))
        self.btnNavRight.clicked.connect(lambda: self.update_navbar(True))
        self.btnNavRight.setIcon(IconFont().icon("arrow-right"))

        self.showHideColumn(ALARM, False)
        self.showHideColumn(CURRENT, False)
        self.showHideColumn(VOLTAGE, False)
        self.showHideColumn(TEMPERATURE, False)
        self.showHideColumn(FAN_TEMPERATURE, False)
        self.showHideColumn(CH_CONFIG, False)
        self.showHideColumn(CH_CONFIG, False)
        self.showHideColumn(AUTOSTART, False)