Ejemplo n.º 1
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(SystemLog, self).connection_changed(connected)

        if not build:
            return

        self._node = nodeFromAddress(self.channel)
        self._path = self.channel.replace('SystemLog', 'ClearLog')

        vb = QVBoxLayout()
        self.setLayout(vb)

        gb = QGroupBox('System Log (20 most recent entries)')
        vb.addWidget(gb)

        vb = QVBoxLayout()
        gb.setLayout(vb)

        self._systemLog = QTreeWidget()
        vb.addWidget(self._systemLog)

        self._systemLog.setColumnCount(2)
        self._systemLog.setHeaderLabels(['Field', 'Value'])
        self._systemLog.setColumnWidth(0, 200)

        self._pb = PyDMPushButton(label='Clear Log',
                                  pressValue=1,
                                  init_channel=self._path)
        vb.addWidget(self._pb)
Ejemplo n.º 2
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(SystemWindow, self).connection_changed(connected)

        if not build:
            return

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

        vb = QVBoxLayout()
        self.setLayout(vb)

        rc = RootControl(parent=None, init_channel=self._path)
        vb.addWidget(rc)

        for key, val in self._node.getNodes(typ=pyrogue.DataWriter).items():
            vb.addWidget(
                DataWriter(parent=None,
                           init_channel=self._path + '.' + val.name))

        for key, val in self._node.getNodes(typ=pyrogue.RunControl).items():
            vb.addWidget(
                RunControl(parent=None,
                           init_channel=self._path + '.' + val.name))

        sl = SystemLog(parent=None, init_channel=self._path + '.SystemLog')
        vb.addWidget(sl)
Ejemplo n.º 3
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(RunControl, self).connection_changed(connected)

        if not build:
            return

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

        vb = QVBoxLayout()
        self.setLayout(vb)

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

        vb = QVBoxLayout()
        gb.setLayout(vb)

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

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

        hb = QHBoxLayout()
        vb.addLayout(hb)

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

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

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

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

        fl.addRow('Run Count:', w)
Ejemplo n.º 4
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(DebugTree, self).connection_changed(connected)

        if not build:
            return

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

        vb = QVBoxLayout()
        self.setLayout(vb)

        self._tree = QTreeWidget()
        vb.addWidget(self._tree)

        self._tree.setColumnCount(5)
        self._tree.setHeaderLabels(
            ['Node', 'Mode', 'Type', 'Variable', 'Command', 'Units'])

        self._tree.itemExpanded.connect(self._expandCb)

        hb = QHBoxLayout()
        vb.addLayout(hb)

        if self._node.isinstance(pyrogue.Root):
            hb.addWidget(
                PyDMPushButton(label='Read All',
                               pressValue=True,
                               init_channel=self._path + '.ReadAll'))
        else:
            hb.addWidget(
                PyDMPushButton(label='Read Recursive',
                               pressValue=True,
                               init_channel=self._path + '.ReadDevice'))

        self.setUpdatesEnabled(False)
        DebugDev(path=self._path,
                 top=self,
                 parent=self._tree,
                 dev=self._node,
                 noExpand=False)
        self.setUpdatesEnabled(True)
Ejemplo n.º 5
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(Process, self).connection_changed(connected)

        if not build:
            return

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

        vb = QVBoxLayout()
        self.setLayout(vb)

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

        vb = QVBoxLayout()
        gb.setLayout(vb)

        hb = QHBoxLayout()
        vb.addLayout(hb)

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

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

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

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

        fl.addRow('Running:', w)

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

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

        fl.addRow('Progress:', w)

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

        fl.addRow('Message:', w)

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

        prc = nodeFromAddress(self.channel)

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

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

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

                fl.addRow(v.name + ':', w)
Ejemplo n.º 6
0
    def connection_changed(self, connected):
        build = (self._node is None) and (self._connected != connected
                                          and connected is True)
        super(DataWriter, self).connection_changed(connected)

        if not build:
            return

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

        vb = QVBoxLayout()
        self.setLayout(vb)

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

        vb = QVBoxLayout()
        gb.setLayout(vb)

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

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

        hb = QHBoxLayout()
        vb.addLayout(hb)

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

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

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

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

        hb = QHBoxLayout()
        vb.addLayout(hb)

        vbl = QVBoxLayout()
        hb.addLayout(vbl)

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

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

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

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

        vbr = QVBoxLayout()
        hb.addLayout(vbr)

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

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

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

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