From 2d0f34ff58ee04ce6d26a4ee86db5c10e161d3e0 Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 11:04:07 -0700 Subject: [PATCH] Fix update value --- conda.yml | 1 + .../pyrogue/pydm/data_plugins/rogue_plugin.py | 4 ++++ .../pydm/examples/rogue_plugin_test.ui | 23 +++++++++++++++---- .../pyrogue/pydm/tools/generic_file_tool.py | 2 +- python/pyrogue/pydm/tools/node_info_tool.py | 2 +- python/pyrogue/pydm/tools/read_node_tool.py | 2 +- .../pyrogue/pydm/tools/read_recursive_tool.py | 2 +- python/pyrogue/pydm/tools/write_node_tool.py | 2 +- .../pydm/tools/write_recursive_tool.py | 2 +- 9 files changed, 30 insertions(+), 10 deletions(-) diff --git a/conda.yml b/conda.yml index 9c1831db5..f7ea8c9f8 100644 --- a/conda.yml +++ b/conda.yml @@ -27,3 +27,4 @@ dependencies: - matplotlib - pytest - pytest-cov + - pyqt=5.12 diff --git a/python/pyrogue/pydm/data_plugins/rogue_plugin.py b/python/pyrogue/pydm/data_plugins/rogue_plugin.py index 17786ad59..a48156caf 100644 --- a/python/pyrogue/pydm/data_plugins/rogue_plugin.py +++ b/python/pyrogue/pydm/data_plugins/rogue_plugin.py @@ -115,6 +115,10 @@ def linkState(self, state): def _updateVariable(self,path,varValue): + + if self._index != -1: + varValue = self._node.getVariableValue(read=False, index=self._index) + if self._mode == 'name': self.new_value_signal[str].emit(self._node.name) elif self._mode == 'path': diff --git a/python/pyrogue/pydm/examples/rogue_plugin_test.ui b/python/pyrogue/pydm/examples/rogue_plugin_test.ui index 2d572a956..0e6be3dcb 100644 --- a/python/pyrogue/pydm/examples/rogue_plugin_test.ui +++ b/python/pyrogue/pydm/examples/rogue_plugin_test.ui @@ -19,7 +19,7 @@ - 4 + 0 @@ -34,6 +34,16 @@ + + + + + + + rogue://0/root.AxiVersion.TestListA/disp/3 + + + @@ -105,7 +115,7 @@ - {"name": "Axis 1", "orientation": "left", "label": "Test Plot Scatter", "minRange": -1.0, "maxRange": 1.0, "autoRange": true, "logMode": false} + {"name": "Axis 1", "orientation": "left", "label": "Test Plot Scatter", "minRange": -1.04, "maxRange": 1.04, "autoRange": true, "logMode": false} @@ -125,7 +135,7 @@ - {"name": "Axis 1", "orientation": "left", "label": "Test Plot Time", "minRange": -1.0, "maxRange": 1.0, "autoRange": true, "logMode": null} + {"name": "Axis 1", "orientation": "left", "label": "Test Plot Time", "minRange": -1.04, "maxRange": 1.04, "autoRange": true, "logMode": null} @@ -151,7 +161,7 @@ - {"name": "Axis 1", "orientation": "left", "label": "Test Array Waveform", "minRange": -1.0, "maxRange": 1.0, "autoRange": true, "logMode": false} + {"name": "Axis 1", "orientation": "left", "label": "Test Array Waveform", "minRange": -1.04, "maxRange": 1.04, "autoRange": true, "logMode": false} @@ -298,6 +308,11 @@
pydm.widgets.frame
1 + + PyDMLineEdit + QLineEdit +
pydm.widgets.line_edit
+
diff --git a/python/pyrogue/pydm/tools/generic_file_tool.py b/python/pyrogue/pydm/tools/generic_file_tool.py index 42df13c1d..259eaf19b 100644 --- a/python/pyrogue/pydm/tools/generic_file_tool.py +++ b/python/pyrogue/pydm/tools/generic_file_tool.py @@ -41,7 +41,7 @@ def __init__(self,save=False): ExternalTool.__init__(self, icon=icon, name=name, group=group, use_with_widgets=use_with_widgets) def call(self, channels, sender): - addr, port, path, mode = parseAddress(channels[0].address) + addr, port, path, mode, index = parseAddress(channels[0].address) self._client = VirtualClient(addr, port) node = self._client.root.getNode(path) diff --git a/python/pyrogue/pydm/tools/node_info_tool.py b/python/pyrogue/pydm/tools/node_info_tool.py index 02ecf5e36..5b83534ea 100644 --- a/python/pyrogue/pydm/tools/node_info_tool.py +++ b/python/pyrogue/pydm/tools/node_info_tool.py @@ -36,7 +36,7 @@ def __init__(self): ExternalTool.__init__(self, icon=icon, name=name, group=group, use_with_widgets=use_with_widgets) def call(self, channels, sender): - addr, port, path, mode = parseAddress(channels[0].address) + addr, port, path, mode, index = parseAddress(channels[0].address) self._client = VirtualClient(addr, port) node = self._client.root.getNode(path) diff --git a/python/pyrogue/pydm/tools/read_node_tool.py b/python/pyrogue/pydm/tools/read_node_tool.py index 15a384794..349145969 100644 --- a/python/pyrogue/pydm/tools/read_node_tool.py +++ b/python/pyrogue/pydm/tools/read_node_tool.py @@ -34,7 +34,7 @@ def __init__(self): ExternalTool.__init__(self, icon=icon, name=name, group=group, use_with_widgets=use_with_widgets) def call(self, channels, sender): - addr, port, path, mode = parseAddress(channels[0].address) + addr, port, path, mode, index = parseAddress(channels[0].address) self._client = VirtualClient(addr, port) node = self._client.root.getNode(path) diff --git a/python/pyrogue/pydm/tools/read_recursive_tool.py b/python/pyrogue/pydm/tools/read_recursive_tool.py index 6f429d3d9..feb6fd76f 100644 --- a/python/pyrogue/pydm/tools/read_recursive_tool.py +++ b/python/pyrogue/pydm/tools/read_recursive_tool.py @@ -34,7 +34,7 @@ def __init__(self): ExternalTool.__init__(self, icon=icon, name=name, group=group, use_with_widgets=use_with_widgets) def call(self, channels, sender): - addr, port, path, mode = parseAddress(channels[0].address) + addr, port, path, mode, index = parseAddress(channels[0].address) self._client = VirtualClient(addr, port) node = self._client.root.getNode(path) diff --git a/python/pyrogue/pydm/tools/write_node_tool.py b/python/pyrogue/pydm/tools/write_node_tool.py index 1c828bd26..25fda74bd 100644 --- a/python/pyrogue/pydm/tools/write_node_tool.py +++ b/python/pyrogue/pydm/tools/write_node_tool.py @@ -34,7 +34,7 @@ def __init__(self): ExternalTool.__init__(self, icon=icon, name=name, group=group, use_with_widgets=use_with_widgets) def call(self, channels, sender): - addr, port, path, mode = parseAddress(channels[0].address) + addr, port, path, mode, index = parseAddress(channels[0].address) self._client = VirtualClient(addr, port) node = self._client.root.getNode(path) diff --git a/python/pyrogue/pydm/tools/write_recursive_tool.py b/python/pyrogue/pydm/tools/write_recursive_tool.py index 382a07896..06f460d59 100644 --- a/python/pyrogue/pydm/tools/write_recursive_tool.py +++ b/python/pyrogue/pydm/tools/write_recursive_tool.py @@ -33,7 +33,7 @@ def __init__(self): ExternalTool.__init__(self, icon=icon, name=name, group=group, use_with_widgets=use_with_widgets) def call(self, channels, sender): - addr, port, path, mode = parseAddress(channels[0].address) + addr, port, path, mode, index = parseAddress(channels[0].address) self._client = VirtualClient(addr, port) node = self._client.root.getNode(path)