Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Candidate v6.4.1 #1022

Merged
merged 26 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5ac8cc2
Add index to variable value and pydm gui
slacrherbst Jul 28, 2024
18f3cf3
Fix block alignment
slacrherbst Jul 31, 2024
df8e60e
Remove debug statement
slacrherbst Jul 31, 2024
2d9b950
Remove debug statement
slacrherbst Jul 31, 2024
fccd475
Add set index
slacrherbst Jul 31, 2024
2d0f34f
Fix update value
slacrherbst Jul 31, 2024
bc0b026
Fix changes to test ui
slacrherbst Jul 31, 2024
460382d
Fix linter area
slacrherbst Jul 31, 2024
1de2807
Fix block size calculation
slacrherbst Jul 31, 2024
8418143
Fix logging
slacrherbst Jul 31, 2024
a3fff48
Merge pull request #1018 from slaclab/ESROGUE-680
slacrherbst Jul 31, 2024
820cd5e
Update template
slacrherbst Aug 9, 2024
28533bd
Update petalinux.rst
ruck314 Aug 16, 2024
7d23cc1
Fixed segment size calculation
slacrherbst Aug 17, 2024
38f9833
Fix linter error
slacrherbst Aug 17, 2024
659d646
Merge pull request #1019 from slaclab/ruck314-patch-1
ruck314 Aug 17, 2024
3893a14
Merge remote-tracking branch 'origin/pre-release' into update_template
slacrherbst Aug 17, 2024
1b6aebd
Merge pull request #1020 from slaclab/update_template
slacrherbst Aug 17, 2024
f1675cb
Merge remote-tracking branch 'origin/pre-release' into udp_segment_size
slacrherbst Aug 17, 2024
d19e4b2
Merge pull request #1021 from slaclab/udp_segment_size
slacrherbst Aug 17, 2024
f496299
Make status variable read-only
bengineerd Aug 27, 2024
156c650
Merge remote-tracking branch 'origin/pre-release' into block_alignment
bengineerd Aug 28, 2024
a3d3818
Merge pull request #1017 from slaclab/block_alignment
bengineerd Aug 28, 2024
df042a1
whitespace removal
ruck314 Aug 28, 2024
7dc70a1
Merge remote-tracking branch 'origin/pre-release' into data-receiver-ro
bengineerd Aug 28, 2024
5bbf5e6
Merge pull request #1023 from slaclab/data-receiver-ro
ruck314 Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions docs/src/installing/petalinux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ You will want to replace the file project-spec/meta-user/recipes-apps/rogue/rogu

.. code::

ROGUE_VERSION = "6.1.4"
ROGUE_MD5SUM = "659c7f5c894f6915e2bd15f922cdab3b"
ROGUE_VERSION = "6.4.0"
ROGUE_MD5SUM = "acbd2b178af84776efbd78cdf3f5db7d"

SUMMARY = "Recipe to build Rogue"
HOMEPAGE ="https://github.com/slaclab/rogue"
Expand Down Expand Up @@ -84,14 +84,14 @@ You will want to replace the file project-spec/meta-user/recipes-apps/rogue/rogu
install -m 0755 ${S}/python/rogue.so ${D}${PYTHON_SITEPACKAGES_DIR}
}

Update the ROGUE_VERSION line for an updated version when appropriate (min version is 6.1.3). You will need to first download the tar.gz file and compute the MD5SUM using the following commands if you update the ROGUE_VERSION line:
Update the ROGUE_VERSION line for an updated version when appropriate. You will need to first download the tar.gz file and compute the MD5SUM using the following commands if you update the ROGUE_VERSION line:

.. code::

> wget https://github.com/slaclab/rogue/archive/vx.x.x.tar.gz
> md5sum vx.x.x.tar.gz

If your rogue application requires additional python libraries you can add them to the DEPENDS += line in the above text.
RDEPENDS is the Runtime Dependencies. If your rogue application requires additional python libraries you can add them to the RDEPENDS += line in the above text.

To enable compilation and installation of the rogue package in your petalinux project execute the following command:

Expand Down
10 changes: 6 additions & 4 deletions python/pyrogue/_Variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def varUpdate(self,path,varValue):

class VariableValue(object):
""" """
def __init__(self, var, read=False):
self.value = var.get(read=read)
def __init__(self, var, read=False, index=-1):
self.value = var.get(read=read,index=index)
self.valueDisp = var.genDisp(self.value)
self.disp = var.disp
self.enum = var.enum
Expand Down Expand Up @@ -572,7 +572,7 @@ def write(self, *, verify=True, check=True):
pass

@pr.expose
def getVariableValue(self,read=True):
def getVariableValue(self,read=True,index=-1):
"""
Return the value after performing a read from hardware if applicable.
Hardware read is blocking. An error will result in a logged exception.
Expand All @@ -582,6 +582,8 @@ def getVariableValue(self,read=True):
----------
read : bool
(Default value = True)
index : int
(Default value = -1)

Returns
-------
Expand All @@ -590,7 +592,7 @@ def getVariableValue(self,read=True):
Listeners will be informed of the update.

"""
return VariableValue(self,read=read)
return VariableValue(self,read=read,index=index)

@pr.expose
def value(self, index=-1):
Expand Down
4 changes: 2 additions & 2 deletions python/pyrogue/protocols/_Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def __init__(self,*, port, host='127.0.0.1', jumbo=False, wait=True, packVer=1,

if server:
self._udp = rogue.protocols.udp.Server(port,jumbo)
self._rssi = rogue.protocols.rssi.Server(self._udp.maxPayload())
self._rssi = rogue.protocols.rssi.Server(self._udp.maxPayload()-8)
else:
self._udp = rogue.protocols.udp.Client(host,port,jumbo)
self._rssi = rogue.protocols.rssi.Client(self._udp.maxPayload())
self._rssi = rogue.protocols.rssi.Client(self._udp.maxPayload()-8)

if packVer == 2:
self._pack = rogue.protocols.packetizer.CoreV2(False,True,enSsi) # ibCRC = False, obCRC = True
Expand Down
21 changes: 13 additions & 8 deletions python/pyrogue/pydm/data_plugins/rogue_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@


def parseAddress(address):
# "rogue://index/<path>/<mode>"
# "rogue://index/<path>/<mode>/<index>"
# or
# "rogue://host:port/<path>/<mode>"
# Mode: 'Value', 'Disp', 'Name' or 'Path'
# "rogue://host:port/<path>/<mode>/<index>"
# Mode: 'value', 'disp', 'name' or 'path'
envList = os.getenv('ROGUE_SERVERS')

if envList is None:
Expand All @@ -58,12 +58,13 @@ def parseAddress(address):
port = int(data_server[1])
path = data[1]
mode = 'value' if (len(data) < 3) else data[2]
index = -1 if (len(data) < 4) else int(data[3])

return (host,port,path,mode)
return (host,port,path,mode,index)


def nodeFromAddress(address):
host, port, path, mode = parseAddress(address)
host, port, path, mode, index = parseAddress(address)
client = VirtualClient(host, port)
return client.root.getNode(path)

Expand All @@ -75,7 +76,7 @@ def __init__(self, channel, address, protocol=None, parent=None):

self.app = QApplication.instance()

self._host, self._port, self._path, self._mode = parseAddress(channel.address)
self._host, self._port, self._path, self._mode, self._index = parseAddress(channel.address)

self._cmd = False
self._int = False
Expand Down Expand Up @@ -114,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 Expand Up @@ -153,7 +158,7 @@ def put_value(self, new_value):
if self._cmd:
self._node.__call__(val)
else:
self._node.setDisp(val)
self._node.setDisp(val,index=self._index)


def add_listener(self, channel):
Expand Down Expand Up @@ -204,7 +209,7 @@ def add_listener(self, channel):
self.new_value_signal[str].emit(self._node.path)
else:
self.write_access_signal.emit(self._cmd or self._node.mode!='RO')
self._updateVariable(self._node.path,self._node.getVariableValue(read=False))
self._updateVariable(self._node.path,self._node.getVariableValue(read=False, index=self._index))

else:
self.new_value_signal[str].emit(self._node.name)
Expand Down
8 changes: 4 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 Down Expand Up @@ -105,7 +105,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 +125,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 +151,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
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
4 changes: 2 additions & 2 deletions src/rogue/interfaces/memory/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,14 @@ void rim::Block::addVariables(std::vector<rim::VariablePtr> variables) {
(*vit)->verifyEn_);
}

// List variables
// List variables
} else {
for (x = 0; x < (*vit)->numValues_; x++) {
// Variable allows overlaps, add to overlap enable mask
if ((*vit)->overlapEn_) {
setBits(oleMask, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_);

// Otherwise add to exclusive mask and check for existing mapping
// Otherwise add to exclusive mask and check for existing mapping
} else {
if (anyBits(excMask, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_))
throw(rogue::GeneralError::create(
Expand Down
4 changes: 2 additions & 2 deletions src/rogue/interfaces/memory/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void rim::Variable::shiftOffsetDown(uint32_t shift, uint32_t minSize) {
highTranByte_[0] = varBytes_ - 1;
staleHighByte_ = highTranByte_[0];

// List variable
// List variable
} else {
for (x = 0; x < numValues_; x++) {
lowTranByte_[x] =
Expand All @@ -487,7 +487,7 @@ void rim::Variable::shiftOffsetDown(uint32_t shift, uint32_t minSize) {
}

// Compute total bit range of accessed bytes
varBytes_ = highTranByte_[numValues_ - 1] - lowTranByte_[0] + 1;
varBytes_ = highTranByte_[numValues_ - 1] + 1;
staleHighByte_ = highTranByte_[numValues_ - 1];
}

Expand Down
2 changes: 1 addition & 1 deletion src/rogue/protocols/udp/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void rpu::Client::runThread(std::weak_ptr<int> lockPtr) {
if (res > 0) {
// Message was too big
if (res > avail) {
udpLog_->warning("Receive data was too large. Dropping.");
udpLog_->warning("Receive data was too large. Rx=%i, avail=%i Dropping.", res, avail);
} else {
buff->setPayload(res);
sendFrame(frame);
Expand Down
10 changes: 4 additions & 6 deletions templates/RogueConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ set(NO_PYTHON @NO_PYTHON@)
# Boost + Python
#####################################
if ( NOT NO_PYTHON )
# Search for newest version of Python3 first
set(Python3_FIND_STRATEGY "VERSION")

# Find newest python interpreter first
set(Python3_FIND_STRATEGY "LOCATION")
find_package(Python3 QUIET REQUIRED COMPONENTS Interpreter Development)

# Find Numpy
Expand All @@ -49,10 +50,6 @@ if ( NOT NO_PYTHON )
# Hint for boost on anaconda
if (DEFINED ENV{CONDA_PREFIX})
set(Boost_ROOT $ENV{CONDA_PREFIX})

# SLAC AFS custom path
elseif (DEFINED ENV{BOOST_PATH})
set(Boost_ROOT $ENV{BOOST_PATH})
endif()

# libboost_python3.7 style libraries
Expand Down Expand Up @@ -88,6 +85,7 @@ if ( NOT NO_PYTHON )
message("")
message(FATAL_ERROR "Failed to find boost libraries!")
endif()

else()
add_definitions( -DNO_PYTHON )
endif()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_list_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import numpy as np
import random

#rogue.Logging.setLevel(rogue.Logging.Warning)
#rogue.Logging.setLevel(rogue.Logging.Debug)
#import logging
#logger = logging.getLogger('pyrogue')
#logger.setLevel(logging.DEBUG)
Expand Down
Loading