mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-14 05:18:41 +01:00
Code Review
This commit is contained in:
29
RELEASE.txt
29
RELEASE.txt
@@ -33,7 +33,36 @@ against any of the libSls*.so libraries, you can enable this by passing
|
|||||||
Added SLS_USE_SYSTEM_ZMQ option (default OFF) to use the libzmq of the host
|
Added SLS_USE_SYSTEM_ZMQ option (default OFF) to use the libzmq of the host
|
||||||
instead of the one included in our repo.
|
instead of the one included in our repo.
|
||||||
|
|
||||||
|
<<<<<<< HEAD:RELEASE.txt
|
||||||
Experimental support for building the detector client (including python bindings) on macOS
|
Experimental support for building the detector client (including python bindings) on macOS
|
||||||
|
=======
|
||||||
|
1.1 Compilation Changes
|
||||||
|
========================
|
||||||
|
|
||||||
|
|
||||||
|
1.2 New or Changed Features
|
||||||
|
============================
|
||||||
|
|
||||||
|
Python
|
||||||
|
-------
|
||||||
|
|
||||||
|
* receiver ROI can be set from Python using command ``rx_roi``(it supports any sequence of four ints e.g. a tuple (xmin, xmax, ymin, ymax) or a sequence of such for multiple ROIS)
|
||||||
|
* one can clear all ROI's from Python using command ``rx_clearroi``
|
||||||
|
|
||||||
|
|
||||||
|
1.2.1 Breaking API
|
||||||
|
===================
|
||||||
|
|
||||||
|
|
||||||
|
1.2.2 Resolved or Changed Features
|
||||||
|
===================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1.2.3 New Features
|
||||||
|
===================
|
||||||
|
|
||||||
|
>>>>>>> c8d82909f (Code Review):RELEASE.md
|
||||||
|
|
||||||
2 On-board Detector Server Compatibility
|
2 On-board Detector Server Compatibility
|
||||||
==========================================
|
==========================================
|
||||||
|
|||||||
@@ -309,18 +309,23 @@ class Detector(CppDetectorApi):
|
|||||||
Note
|
Note
|
||||||
-----
|
-----
|
||||||
Each ROI is represented as a tuple of (x_start, y_start, x_end, y_end). \n
|
Each ROI is represented as a tuple of (x_start, y_start, x_end, y_end). \n
|
||||||
If no ROIs are configured, returns an empty list.
|
If no ROIs are configured, returns [[-1,-1,-1,-1]].
|
||||||
"""
|
"""
|
||||||
return self.getRxROI() #vector of Roi structs how represented?
|
return self.getRxROI() #vector of Roi structs how represented?
|
||||||
|
|
||||||
@rx_roi.setter
|
@rx_roi.setter
|
||||||
def rx_roi(self, rois):
|
def rx_roi(self, rois):
|
||||||
"""Sets the list of ROIs in the receiver.
|
"""
|
||||||
|
Sets the list of ROIs in the receiver.
|
||||||
|
Can only set multiple ROIs at multi module level without gap pixels. If more than 1 ROI per
|
||||||
|
UDP port, it will throw. Setting number of udp interfaces will clear the
|
||||||
|
roi. Cannot be set for CTB or Xilinx CTB.
|
||||||
|
|
||||||
Note
|
Note
|
||||||
-----
|
-----
|
||||||
Each ROI should be represented as a tuple of (x_start, y_start, x_end, y_end). \n
|
Each ROI should be represented as a sequence of 4 ints (x_start, y_start, x_end, y_end). \n
|
||||||
Example: [(0, 100, 50, 100)] \n
|
For multiple ROI's pass a sequence of sequence \n
|
||||||
|
Example: [[0, 100, 50, 100]] \n
|
||||||
"""
|
"""
|
||||||
# TODO: maybe better to accept py::object in setRxROI and handle there?
|
# TODO: maybe better to accept py::object in setRxROI and handle there?
|
||||||
if not isinstance(rois, Sequence):
|
if not isinstance(rois, Sequence):
|
||||||
@@ -333,6 +338,9 @@ class Detector(CppDetectorApi):
|
|||||||
else:
|
else:
|
||||||
self.setRxROI(rois)
|
self.setRxROI(rois)
|
||||||
|
|
||||||
|
def rx_clearroi(self):
|
||||||
|
"""Clears all the ROIs configured in the receiver."""
|
||||||
|
self.clearRxROI()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
|
|||||||
@@ -15,15 +15,11 @@ print(sys.path)
|
|||||||
from utils_for_test import (
|
from utils_for_test import (
|
||||||
Log,
|
Log,
|
||||||
LogLevel,
|
LogLevel,
|
||||||
RuntimeException,
|
|
||||||
cleanup,
|
cleanup,
|
||||||
startProcessInBackground,
|
|
||||||
startReceiver,
|
startReceiver,
|
||||||
startDetectorVirtualServer,
|
startDetectorVirtualServer,
|
||||||
connectToVirtualServers,
|
|
||||||
loadConfig,
|
loadConfig,
|
||||||
loadBasicSettings,
|
loadBasicSettings,
|
||||||
runProcessWithLogFile
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ def test_rx_ROI(test_with_simulators):
|
|||||||
|
|
||||||
assert d.rx_roi == [(5,15,15,25)]
|
assert d.rx_roi == [(5,15,15,25)]
|
||||||
|
|
||||||
d.rx_roi = [[0,10,0,20], [5,20,410,420]] #needs to be in second module
|
d.rx_roi = [[0,10,0,20], [5,20,410,420]]
|
||||||
|
|
||||||
roi = d.rx_roi
|
roi = d.rx_roi
|
||||||
assert roi == [(0,10,0,20), (5,20,410,420)]
|
assert roi == [(0,10,0,20), (5,20,410,420)]
|
||||||
|
|
||||||
d.clear_rx_roi()
|
d.rx_clearroi()
|
||||||
roi = d.rx_roi
|
roi = d.rx_roi
|
||||||
assert roi == [(-1,-1,-1,-1)]
|
assert roi == [(-1,-1,-1,-1)]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user