mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-07 10:18:40 +01:00
added patternstart to python (#1368)
* added patternstart to python * release notesg
This commit is contained in:
@@ -39,6 +39,8 @@ Experimental support for building the detector client (including python bindings
|
|||||||
|
|
||||||
Detector.pattern (python) accepts also a pattern object, not only a pattern file
|
Detector.pattern (python) accepts also a pattern object, not only a pattern file
|
||||||
|
|
||||||
|
added patternstart to python (ctb, xilinx_ctb , mythen3), only the detector class api was exposed (startPattern())
|
||||||
|
|
||||||
2 On-board Detector Server Compatibility
|
2 On-board Detector Server Compatibility
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
|
|||||||
@@ -3785,6 +3785,10 @@ class Detector(CppDetectorApi):
|
|||||||
"""
|
"""
|
||||||
return self.getPatterFileName()
|
return self.getPatterFileName()
|
||||||
|
|
||||||
|
def patternstart(self):
|
||||||
|
"""[Ctb][Mythen3][Xilinx Ctb] Starts pattern. """
|
||||||
|
self.startPattern()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def patioctrl(self):
|
def patioctrl(self):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from slsdet import Detector, detectorType
|
|||||||
|
|
||||||
@pytest.fixture(
|
@pytest.fixture(
|
||||||
scope="session",
|
scope="session",
|
||||||
params=['ctb', 'xilinx_ctb', 'mythen3']
|
params=['ctb', 'xilinx_ctb', 'mythen3', 'jungfrau']
|
||||||
)
|
)
|
||||||
def simulator(request):
|
def simulator(request):
|
||||||
"""Fixture to start the detector server once and clean up at the end."""
|
"""Fixture to start the detector server once and clean up at the end."""
|
||||||
@@ -382,4 +382,22 @@ def test_definelist_bit(simulator, request):
|
|||||||
d.define_bit(name="test_bit", addr=0x300, bit_position=1)
|
d.define_bit(name="test_bit", addr=0x300, bit_position=1)
|
||||||
assert "Bit Definitions only for CTB" in str(exc_info.value)
|
assert "Bit Definitions only for CTB" in str(exc_info.value)
|
||||||
|
|
||||||
|
Log(LogLevel.INFOGREEN, f"✅ {request.node.name} passed")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.withdetectorsimulators
|
||||||
|
def test_patternstart(simulator, request):
|
||||||
|
""" Test using patternstart for ctb, xilinx_ctb and mythen3."""
|
||||||
|
det_name = simulator
|
||||||
|
# setup
|
||||||
|
d = Detector()
|
||||||
|
d.hostname = f"localhost:{SERVER_START_PORTNO}"
|
||||||
|
|
||||||
|
if det_name in ['ctb', 'xilinx_ctb', 'mythen3']:
|
||||||
|
d.patternstart()
|
||||||
|
else:
|
||||||
|
with pytest.raises(Exception) as exc_info:
|
||||||
|
d.patternstart()
|
||||||
|
assert "not implemented" in str(exc_info.value)
|
||||||
|
|
||||||
Log(LogLevel.INFOGREEN, f"✅ {request.node.name} passed")
|
Log(LogLevel.INFOGREEN, f"✅ {request.node.name} passed")
|
||||||
Reference in New Issue
Block a user