Skip to content

Commit

Permalink
Fix update value
Browse files Browse the repository at this point in the history
  • Loading branch information
slacrherbst committed Jul 31, 2024
1 parent fccd475 commit 2d0f34f
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 10 deletions.
1 change: 1 addition & 0 deletions conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ dependencies:
- matplotlib
- pytest
- pytest-cov
- pyqt=5.12
4 changes: 4 additions & 0 deletions python/pyrogue/pydm/data_plugins/rogue_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
23 changes: 19 additions & 4 deletions python/pyrogue/pydm/examples/rogue_plugin_test.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_6">
<property name="sizePolicy">
Expand All @@ -34,6 +34,16 @@
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="PyDMLineEdit" name="PyDMLineEdit">
<property name="toolTip">
<string/>
</property>
<property name="channel" stdset="0">
<string>rogue://0/root.AxiVersion.TestListA/disp/3</string>
</property>
</widget>
</item>
<item>
<widget class="DebugTree" name="DebugTree_2">
<property name="sizePolicy">
Expand Down Expand Up @@ -105,7 +115,7 @@
</property>
<property name="yAxes">
<stringlist>
<string>{&quot;name&quot;: &quot;Axis 1&quot;, &quot;orientation&quot;: &quot;left&quot;, &quot;label&quot;: &quot;Test Plot Scatter&quot;, &quot;minRange&quot;: -1.0, &quot;maxRange&quot;: 1.0, &quot;autoRange&quot;: true, &quot;logMode&quot;: false}</string>
<string>{&quot;name&quot;: &quot;Axis 1&quot;, &quot;orientation&quot;: &quot;left&quot;, &quot;label&quot;: &quot;Test Plot Scatter&quot;, &quot;minRange&quot;: -1.04, &quot;maxRange&quot;: 1.04, &quot;autoRange&quot;: true, &quot;logMode&quot;: false}</string>
</stringlist>
</property>
<property name="curves">
Expand All @@ -125,7 +135,7 @@
</property>
<property name="yAxes">
<stringlist>
<string>{&quot;name&quot;: &quot;Axis 1&quot;, &quot;orientation&quot;: &quot;left&quot;, &quot;label&quot;: &quot;Test Plot Time&quot;, &quot;minRange&quot;: -1.0, &quot;maxRange&quot;: 1.0, &quot;autoRange&quot;: true, &quot;logMode&quot;: null}</string>
<string>{&quot;name&quot;: &quot;Axis 1&quot;, &quot;orientation&quot;: &quot;left&quot;, &quot;label&quot;: &quot;Test Plot Time&quot;, &quot;minRange&quot;: -1.04, &quot;maxRange&quot;: 1.04, &quot;autoRange&quot;: true, &quot;logMode&quot;: null}</string>
</stringlist>
</property>
<property name="curves">
Expand All @@ -151,7 +161,7 @@
</property>
<property name="yAxes">
<stringlist>
<string>{&quot;name&quot;: &quot;Axis 1&quot;, &quot;orientation&quot;: &quot;left&quot;, &quot;label&quot;: &quot;Test Array Waveform&quot;, &quot;minRange&quot;: -1.0, &quot;maxRange&quot;: 1.0, &quot;autoRange&quot;: true, &quot;logMode&quot;: false}</string>
<string>{&quot;name&quot;: &quot;Axis 1&quot;, &quot;orientation&quot;: &quot;left&quot;, &quot;label&quot;: &quot;Test Array Waveform&quot;, &quot;minRange&quot;: -1.04, &quot;maxRange&quot;: 1.04, &quot;autoRange&quot;: true, &quot;logMode&quot;: false}</string>
</stringlist>
</property>
<property name="curves">
Expand Down Expand Up @@ -298,6 +308,11 @@
<header>pydm.widgets.frame</header>
<container>1</container>
</customwidget>
<customwidget>
<class>PyDMLineEdit</class>
<extends>QLineEdit</extends>
<header>pydm.widgets.line_edit</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/pydm/tools/generic_file_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/pydm/tools/node_info_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/pydm/tools/read_node_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/pydm/tools/read_recursive_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/pydm/tools/write_node_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/pydm/tools/write_recursive_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 2d0f34f

Please sign in to comment.