Exemple #1
0
    def call(self, channels, sender):
        addr, port, path, mode = parseAddress(channels[0].address)
        self._client = VirtualClient(addr, port)
        node = self._client.root.getNode(path)

        dlg = QFileDialog()

        if self.save:
            dataFile = dlg.getSaveFileName(caption='Select Save File', filter='YAML Files(*.yml);;Data Files(*.dat);;CSV Files(*.csv);;Numpy Files(*.npy);;All Files(*.*)')
        else:
            dataFile = dlg.getOpenFileName(caption='Select Open File', filter='YAML Files(*.yml);;Data Files(*.dat);;CSV Files(*.csv);;Numpy Files(*.npy);;All Files(*.*)')

        # Detect QT5 return
        if isinstance(dataFile,tuple):
            dataFile = dataFile[0]

        if dataFile == '':
            logger.warning(f"Skipping empty file name for node {node.name}")

        if node.isinstance(pyrogue.BaseCommand):
            node.call(dataFile)

        elif node.isinstance(pyrogue.BaseVariable):
            if node.mode == 'RO':
                logger.warning(f"Can't set file to RO node: {node.name}")

            else:
                node.set(dataFile)
                node.get()

        else:
            logger.warning(f"File browser used with invalid node: {node.name}")
Exemple #2
0
    def call(self, channels, sender):
        addr, port, path, mode = parseAddress(channels[0].address)
        self._client = VirtualClient(addr, port)
        node = self._client.root.getNode(path)

        if node.isinstance(pyrogue.Device):
            self._device(node,channels[0])
        elif node.isinstance(pyrogue.BaseVariable):
            self._variable(node,channels[0])

        elif node.isinstance(pyrogue.BaseCommand):
            self._command(node,channels[0])
Exemple #3
0
    def call(self, channels, sender):
        addr, port, path, mode = parseAddress(channels[0].address)
        self._client = VirtualClient(addr, port)
        node = self._client.root.getNode(path)

        if node.isinstance(pyrogue.Device):
            node.WriteDevice(True)
        elif node.isinstance(pyrogue.BaseVariable):
            node.parent.WriteDevice(True)
        else:
            logger.warning("Invalid node for recursive write: {}".format(
                node.path))
Exemple #4
0
    def call(self, channels, sender):
        addr, port, path, mode = parseAddress(channels[0].address)
        self._client = VirtualClient(addr, port)
        node = self._client.root.getNode(path)

        if node.isinstance(pyrogue.Device):
            node.WriteDevice(False)

        elif node.isinstance(pyrogue.BaseCommand):
            logger.warning("Can't write to non variable: {}".format(node.path))

        elif node.isinstance(pyrogue.BaseVariable):
            if node.mode == 'RO':
                logger.warning("Can't write to read only variable: {}".format(
                    node.path))
            else:
                node.write()
        else:
            logger.warning("Invalid node for write: {}".format(node.path))