From afc51c97712fa37a915cb2cdcce24186230be147 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Tue, 25 Nov 2025 16:14:33 +0100 Subject: [PATCH 01/27] testing NFS deploy --- .gitea/workflows/rh8-local.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitea/workflows/rh8-local.yml diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml new file mode 100644 index 000000000..67a5b4e6a --- /dev/null +++ b/.gitea/workflows/rh8-local.yml @@ -0,0 +1,27 @@ +name: Build on local RHEL8 + +on: + push: + branches: + - dev/NFS_testing + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: "detectors-software-RH8" + steps: + - uses: actions/checkout@v4 + + - name: Build library + run: | + mkdir build && cd build + cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON + make -j 2 + + - name: Deploy to NFS + if: gitea.ref == 'refs/heads/dev/NFS_testing' + run: | + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware <<< $'put build/bin' \ No newline at end of file From 0ba9a269a1154dd11628e396dba5ebe37416e004 Mon Sep 17 00:00:00 2001 From: mbrueckner-psi Date: Tue, 25 Nov 2025 16:29:48 +0100 Subject: [PATCH 02/27] New this build bin path script (#1335) * better this_build_bin_path script * Put new values first in PATH and PYTHONPATH. Remove LD_LIBRARY_PATH --- this_build_bin_path.sh | 51 +++++++++++------------------------------- 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/this_build_bin_path.sh b/this_build_bin_path.sh index 8d0528673..843471320 100755 --- a/this_build_bin_path.sh +++ b/this_build_bin_path.sh @@ -1,39 +1,14 @@ -# SPDX-License-Identifier: LGPL-3.0-or-other -# Copyright (C) 2021 Contributors to the SLS Detector Package -#echo $# -#if [ $# = 0 ]; then -# f=$0 -#else -# f=$1 -#fi -#echo $f -if [ "x${BASH_ARGV[0]}" = "x" ]; then -#if [ "x$f" = "x" ]; then - if [ ! -f this_build_bin_path.sh ]; then - f=$0 - echo "aaaa" - #thispath=$(dirname ${BASH_ARGV[0]}) - thispath=$(dirname $f) - p=$(cd ${thispath};pwd); - THIS_PATH="$p/build/bin/" - # echo "ERROR: must cd where/this/package/is before calling this_path.sh" -# echo "Try sourcing it" - else - echo "bbb" - THIS_PATH="$PWD/build/bin/"; - fi -else - thispath=$(dirname ${BASH_ARGV[0]}) - p=$(cd ${thispath};pwd); - THIS_PATH="$p/build/bin/" - echo "ccc" -fi +#!/bin/bash - echo "this_path="$THIS_PATH - export PATH=$THIS_PATH:$PATH - export LD_LIBRARY_PATH=$THIS_PATH:$LD_LIBRARY_PATH - export PYTHONPATH=$THIS_PATH:$PYTHONPATH - - echo "path="$PATH - echo "ld_library_path="$LD_LIBRARY_PATH - echo "pythonpath="$PYTHON_PATH +# Since this script could be sourced, $0 is not sufficent, BASH_SOURCE[0] is necessary +SCRIPT_LOCATION="$(realpath ${BASH_SOURCE[0]})" +SCRIPT_LOCATION="$(dirname ${SCRIPT_LOCATION})" +BUILDBIN_LOCATION="${SCRIPT_LOCATION}/build/bin" + +if [ ! -d "${BUILDBIN_LOCATION}" ]; then + echo Cannot find path ${BUILDBIN_LOCATION} +else + echo Adding ${BUILDBIN_LOCATION} to PATH and PYTHONPATH + export PATH=${BUILDBIN_LOCATION}:${PATH} + export PYTHONPATH=${BUILDBIN_LOCATION}:${PYTHONPATH} +fi From 3ff199822d8998fa5e371839448ba82dc43b05b8 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Tue, 25 Nov 2025 16:37:42 +0100 Subject: [PATCH 03/27] change path to RH8 --- .gitea/workflows/rh8-local.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml index 67a5b4e6a..1dd5fccf8 100644 --- a/.gitea/workflows/rh8-local.yml +++ b/.gitea/workflows/rh8-local.yml @@ -21,7 +21,7 @@ jobs: cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON make -j 2 - - name: Deploy to NFS + - name: Deploy to NFS update server if: gitea.ref == 'refs/heads/dev/NFS_testing' run: | - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware <<< $'put build/bin' \ No newline at end of file + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin' \ No newline at end of file From f32fcf1e887e5b92546f22370a9bbc30f1838af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 25 Nov 2025 16:53:20 +0100 Subject: [PATCH 04/27] Using system libzmq in conda builds (#1327) * system (conda) libzmq * added python 3.14 and bumped cibuildwheel version --- .github/workflows/build_wheel.yml | 2 +- conda-recipes/python-client/conda_build_config.yaml | 4 +++- conda-recipes/python-client/meta.yaml | 8 ++++---- pyproject.toml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index f131e7775..05e4dc66c 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Build wheels - run: pipx run cibuildwheel==2.23.0 + run: pipx run cibuildwheel==3.2.1 - uses: actions/upload-artifact@v4 with: diff --git a/conda-recipes/python-client/conda_build_config.yaml b/conda-recipes/python-client/conda_build_config.yaml index 0c957b631..89a55b840 100644 --- a/conda-recipes/python-client/conda_build_config.yaml +++ b/conda-recipes/python-client/conda_build_config.yaml @@ -2,6 +2,8 @@ python: - 3.11 - 3.12 - 3.13 + - 3.14 + c_compiler: - gcc # [linux] @@ -13,4 +15,4 @@ cxx_compiler: - gxx # [linux] c_stdlib_version: # [linux] - - 2.17 # [linux] \ No newline at end of file + - 2.17 # [linux] diff --git a/conda-recipes/python-client/meta.yaml b/conda-recipes/python-client/meta.yaml index c86f401ef..d7411571e 100644 --- a/conda-recipes/python-client/meta.yaml +++ b/conda-recipes/python-client/meta.yaml @@ -9,11 +9,11 @@ package: build: number: 0 script: - - unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv # [not win] + - unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv --config-settings=cmake.define.SLS_USE_SYSTEM_ZMQ=ON # [not win] requirements: build: - - python {{python}} + - python - {{ compiler('c') }} - {{ stdlib("c") }} - {{ compiler('cxx') }} @@ -21,7 +21,7 @@ requirements: host: - cmake - ninja - - python {{python}} + - python - pip - scikit-build-core - pybind11 >=2.13.0 @@ -31,7 +31,7 @@ requirements: - catch2 run: - - python {{python}} + - python - numpy diff --git a/pyproject.toml b/pyproject.toml index 15833499c..dfe4e31cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ dependencies = [ [tool.cibuildwheel] before-all = "uname -a" -build = "cp{311,312,313}-manylinux_x86_64" +build = "cp{311,312,313,314}-manylinux_x86_64" [tool.scikit-build.build] verbose = true From 3285221e8af879ca14a9acbc56b8ec1e6ba42d0d Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Tue, 25 Nov 2025 17:56:20 +0100 Subject: [PATCH 05/27] added RH9 workflow --- .gitea/workflows/rh9-local.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitea/workflows/rh9-local.yml diff --git a/.gitea/workflows/rh9-local.yml b/.gitea/workflows/rh9-local.yml new file mode 100644 index 000000000..c7e437a49 --- /dev/null +++ b/.gitea/workflows/rh9-local.yml @@ -0,0 +1,27 @@ +name: Build on local RHEL9 + +on: + push: + branches: + - dev/NFS_testing + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: "detectors-software-RH9" + steps: + - uses: actions/checkout@v4 + + - name: Build library + run: | + mkdir build && cd build + cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON + make -j 2 + + - name: Deploy to NFS update server + if: gitea.ref == 'refs/heads/dev/NFS_testing' + run: | + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put build/bin' \ No newline at end of file From eea4dca449cb6a67e40addc814899e2dacb22301 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 26 Nov 2025 09:11:55 +0100 Subject: [PATCH 06/27] remove branch restrictions --- .gitea/workflows/rh8-local.yml | 4 +--- .gitea/workflows/rh9-local.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml index 1dd5fccf8..3f6fd5a07 100644 --- a/.gitea/workflows/rh8-local.yml +++ b/.gitea/workflows/rh8-local.yml @@ -2,8 +2,6 @@ name: Build on local RHEL8 on: push: - branches: - - dev/NFS_testing workflow_dispatch: permissions: @@ -22,6 +20,6 @@ jobs: make -j 2 - name: Deploy to NFS update server - if: gitea.ref == 'refs/heads/dev/NFS_testing' + if: gitea.ref == 'refs/heads/developer' run: | sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin' \ No newline at end of file diff --git a/.gitea/workflows/rh9-local.yml b/.gitea/workflows/rh9-local.yml index c7e437a49..cc50cafb9 100644 --- a/.gitea/workflows/rh9-local.yml +++ b/.gitea/workflows/rh9-local.yml @@ -2,8 +2,6 @@ name: Build on local RHEL9 on: push: - branches: - - dev/NFS_testing workflow_dispatch: permissions: @@ -22,6 +20,6 @@ jobs: make -j 2 - name: Deploy to NFS update server - if: gitea.ref == 'refs/heads/dev/NFS_testing' + if: gitea.ref == 'refs/heads/developer' run: | sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put build/bin' \ No newline at end of file From ec11ba5a54744db13fd6caab39f5a4bae78daf47 Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 14 Nov 2025 10:20:56 +0100 Subject: [PATCH 07/27] added typecaster for slsdefs::ROI and added setter and getter for ROI --- python/slsdet/detector.py | 22 ++ python/src/detector.cpp | 563 +++++++++++++++++++------------------- python/src/typecaster.h | 180 +++++++----- 3 files changed, 412 insertions(+), 353 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 1d62158cf..6601641c9 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -301,6 +301,28 @@ class Detector(CppDetectorApi): def rx_arping(self, value): ut.set_using_dict(self.setRxArping, value) + @property + def rx_roi(self): + """Gets the list of ROIs configured in the receiver. + + Note + ----- + 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. + """ + return self.getRxROI() #vector of Roi structs how represented? + + @rx_roi.setter + def rx_roi(self, rois): + """Sets the list of ROIs in the receiver. + + Note + ----- + Each ROI should be represented as a tuple of (x_start, y_start, x_end, y_end). \n + Example: [(0, 100, 50, 100)] \n + """ + self.setRxROI(rois) + @property @element diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 6c202eaba..4b41c636a 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -32,15 +32,15 @@ void init_det(py::module &m) { CppDetectorApi.def(py::init()); CppDetectorApi.def("loadConfig", - (void (Detector::*)(const std::string &)) & + (void(Detector::*)(const std::string &)) & Detector::loadConfig, py::arg()); CppDetectorApi.def("loadParameters", - (void (Detector::*)(const std::string &)) & + (void(Detector::*)(const std::string &)) & Detector::loadParameters, py::arg()); CppDetectorApi.def("loadParameters", - (void (Detector::*)(const std::vector &)) & + (void(Detector::*)(const std::vector &)) & Detector::loadParameters, py::arg()); CppDetectorApi.def( @@ -49,15 +49,15 @@ void init_det(py::module &m) { Detector::getHostname, py::arg() = Positions{}); CppDetectorApi.def("setHostname", - (void (Detector::*)(const std::vector &)) & + (void(Detector::*)(const std::vector &)) & Detector::setHostname, py::arg()); CppDetectorApi.def("setVirtualDetectorServers", - (void (Detector::*)(int, uint16_t)) & + (void(Detector::*)(int, uint16_t)) & Detector::setVirtualDetectorServers, py::arg(), py::arg()); CppDetectorApi.def("getShmId", - (int (Detector::*)() const) & Detector::getShmId); + (int(Detector::*)() const) & Detector::getShmId); CppDetectorApi.def("getPackageVersion", (std::string(Detector::*)() const) & Detector::getPackageVersion); CppDetectorApi.def("getClientVersion", (std::string(Detector::*)() const) & @@ -104,8 +104,8 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getDetectorType, py::arg() = Positions{}); - CppDetectorApi.def("size", (int (Detector::*)() const) & Detector::size); - CppDetectorApi.def("empty", (bool (Detector::*)() const) & Detector::empty); + CppDetectorApi.def("size", (int(Detector::*)() const) & Detector::size); + CppDetectorApi.def("empty", (bool(Detector::*)() const) & Detector::empty); CppDetectorApi.def("getModuleGeometry", (defs::xy(Detector::*)() const) & Detector::getModuleGeometry); CppDetectorApi.def("getModuleSize", @@ -122,7 +122,7 @@ void init_det(py::module &m) { CppDetectorApi.def("getDetectorSize", (defs::xy(Detector::*)() const) & Detector::getDetectorSize); CppDetectorApi.def("setDetectorSize", - (void (Detector::*)(const defs::xy)) & + (void(Detector::*)(const defs::xy)) & Detector::setDetectorSize, py::arg()); CppDetectorApi.def("getSettingsList", (std::vector( @@ -135,7 +135,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setSettings", - (void (Detector::*)(defs::detectorSettings, sls::Positions)) & + (void(Detector::*)(defs::detectorSettings, sls::Positions)) & Detector::setSettings, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getThresholdEnergy", @@ -147,16 +147,16 @@ void init_det(py::module &m) { (Result>(Detector::*)(sls::Positions) const) & Detector::getAllThresholdEnergy, py::arg() = Positions{}); - CppDetectorApi.def("setThresholdEnergy", - (void (Detector::*)(int, defs::detectorSettings, bool, - sls::Positions)) & - Detector::setThresholdEnergy, - py::arg(), py::arg() = defs::STANDARD, py::arg() = true, - py::arg() = Positions{}); CppDetectorApi.def( "setThresholdEnergy", - (void (Detector::*)(std::array, defs::detectorSettings, bool, - sls::Positions)) & + (void(Detector::*)(int, defs::detectorSettings, bool, sls::Positions)) & + Detector::setThresholdEnergy, + py::arg(), py::arg() = defs::STANDARD, py::arg() = true, + py::arg() = Positions{}); + CppDetectorApi.def( + "setThresholdEnergy", + (void(Detector::*)(std::array, defs::detectorSettings, bool, + sls::Positions)) & Detector::setThresholdEnergy, py::arg(), py::arg() = defs::STANDARD, py::arg() = true, py::arg() = Positions{}); @@ -167,17 +167,17 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setSettingsPath", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::setSettingsPath, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "loadTrimbits", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::loadTrimbits, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "saveTrimbits", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::saveTrimbits, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAllTrimbits", @@ -185,7 +185,7 @@ void init_det(py::module &m) { Detector::getAllTrimbits, py::arg() = Positions{}); CppDetectorApi.def("setAllTrimbits", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setAllTrimbits, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -194,14 +194,14 @@ void init_det(py::module &m) { Detector::getTrimEnergies, py::arg() = Positions{}); CppDetectorApi.def("setTrimEnergies", - (void (Detector::*)(std::vector, sls::Positions)) & + (void(Detector::*)(std::vector, sls::Positions)) & Detector::setTrimEnergies, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getGapPixelsinCallback", - (bool (Detector::*)() const) & + (bool(Detector::*)() const) & Detector::getGapPixelsinCallback); CppDetectorApi.def("setGapPixelsinCallback", - (void (Detector::*)(const bool)) & + (void(Detector::*)(const bool)) & Detector::setGapPixelsinCallback, py::arg()); CppDetectorApi.def("getFlipRows", @@ -209,7 +209,7 @@ void init_det(py::module &m) { Detector::getFlipRows, py::arg() = Positions{}); CppDetectorApi.def("setFlipRows", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setFlipRows, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaster", @@ -217,23 +217,23 @@ void init_det(py::module &m) { Detector::getMaster, py::arg() = Positions{}); CppDetectorApi.def("setMaster", - (void (Detector::*)(bool, int)) & Detector::setMaster, + (void(Detector::*)(bool, int)) & Detector::setMaster, py::arg(), py::arg()); CppDetectorApi.def("getSynchronization", (Result(Detector::*)(sls::Positions) const) & Detector::getSynchronization, py::arg() = Positions{}); - CppDetectorApi.def( - "setSynchronization", - (void (Detector::*)(bool)) & Detector::setSynchronization, py::arg()); + CppDetectorApi.def("setSynchronization", + (void(Detector::*)(bool)) & Detector::setSynchronization, + py::arg()); CppDetectorApi.def( "getBadChannels", - (void (Detector::*)(const std::string &, sls::Positions) const) & + (void(Detector::*)(const std::string &, sls::Positions) const) & Detector::getBadChannels, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setBadChannels", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::setBadChannels, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -243,12 +243,12 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setBadChannels", - (void (Detector::*)(const std::vector, sls::Positions)) & + (void(Detector::*)(const std::vector, sls::Positions)) & Detector::setBadChannels, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setBadChannels", - (void (Detector::*)(const std::vector>)) & + (void(Detector::*)(const std::vector>)) & Detector::setBadChannels, py::arg()); CppDetectorApi.def("getRow", @@ -256,7 +256,7 @@ void init_det(py::module &m) { Detector::getRow, py::arg() = Positions{}); CppDetectorApi.def("setRow", - (void (Detector::*)(const int, sls::Positions)) & + (void(Detector::*)(const int, sls::Positions)) & Detector::setRow, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getColumn", @@ -264,7 +264,7 @@ void init_det(py::module &m) { Detector::getColumn, py::arg() = Positions{}); CppDetectorApi.def("setColumn", - (void (Detector::*)(const int, sls::Positions)) & + (void(Detector::*)(const int, sls::Positions)) & Detector::setColumn, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("isVirtualDetectorServer", @@ -273,13 +273,13 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "registerAcquisitionFinishedCallback", - (void (Detector::*)(void (*)(double, int, void *), void *)) & + (void(Detector::*)(void (*)(double, int, void *), void *)) & Detector::registerAcquisitionFinishedCallback, py::arg(), py::arg()); CppDetectorApi.def("registerDataCallback", - (void (Detector::*)(void (*)(sls::detectorData *, - uint64_t, uint32_t, void *), - void *)) & + (void(Detector::*)(void (*)(sls::detectorData *, + uint64_t, uint32_t, void *), + void *)) & Detector::registerDataCallback, py::arg(), py::arg()); CppDetectorApi.def("getNumberOfFrames", @@ -288,13 +288,13 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setNumberOfFrames", - (void (Detector::*)(int64_t)) & Detector::setNumberOfFrames, py::arg()); + (void(Detector::*)(int64_t)) & Detector::setNumberOfFrames, py::arg()); CppDetectorApi.def("getNumberOfTriggers", (Result(Detector::*)(sls::Positions) const) & Detector::getNumberOfTriggers, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfTriggers", - (void (Detector::*)(int64_t)) & + (void(Detector::*)(int64_t)) & Detector::setNumberOfTriggers, py::arg()); CppDetectorApi.def("getExptime", @@ -302,7 +302,7 @@ void init_det(py::module &m) { Detector::getExptime, py::arg() = Positions{}); CppDetectorApi.def("setExptime", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setExptime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPeriod", @@ -310,7 +310,7 @@ void init_det(py::module &m) { Detector::getPeriod, py::arg() = Positions{}); CppDetectorApi.def("setPeriod", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setPeriod, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDelayAfterTrigger", @@ -318,7 +318,7 @@ void init_det(py::module &m) { Detector::getDelayAfterTrigger, py::arg() = Positions{}); CppDetectorApi.def("setDelayAfterTrigger", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setDelayAfterTrigger, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfFramesLeft", @@ -342,7 +342,7 @@ void init_det(py::module &m) { Detector::getDynamicRange, py::arg() = Positions{}); CppDetectorApi.def("setDynamicRange", - (void (Detector::*)(int)) & Detector::setDynamicRange, + (void(Detector::*)(int)) & Detector::setDynamicRange, py::arg()); CppDetectorApi.def("getDynamicRangeList", (std::vector(Detector::*)() const) & @@ -353,7 +353,7 @@ void init_det(py::module &m) { Detector::getTimingMode, py::arg() = Positions{}); CppDetectorApi.def("setTimingMode", - (void (Detector::*)(defs::timingMode, sls::Positions)) & + (void(Detector::*)(defs::timingMode, sls::Positions)) & Detector::setTimingMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTimingModeList", @@ -365,7 +365,7 @@ void init_det(py::module &m) { Detector::getReadoutSpeed, py::arg() = Positions{}); CppDetectorApi.def("setReadoutSpeed", - (void (Detector::*)(defs::speedLevel, sls::Positions)) & + (void(Detector::*)(defs::speedLevel, sls::Positions)) & Detector::setReadoutSpeed, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getReadoutSpeedList", @@ -376,7 +376,7 @@ void init_det(py::module &m) { Detector::getADCPhase, py::arg() = Positions{}); CppDetectorApi.def("setADCPhase", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setADCPhase, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaxADCPhaseShift", @@ -388,7 +388,7 @@ void init_det(py::module &m) { Detector::getADCPhaseInDegrees, py::arg() = Positions{}); CppDetectorApi.def("setADCPhaseInDegrees", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setADCPhaseInDegrees, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITPhase", @@ -396,7 +396,7 @@ void init_det(py::module &m) { Detector::getDBITPhase, py::arg() = Positions{}); CppDetectorApi.def("setDBITPhase", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setDBITPhase, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaxDBITPhaseShift", @@ -408,7 +408,7 @@ void init_det(py::module &m) { Detector::getDBITPhaseInDegrees, py::arg() = Positions{}); CppDetectorApi.def("setDBITPhaseInDegrees", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setDBITPhaseInDegrees, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getClockFrequency", @@ -420,7 +420,7 @@ void init_det(py::module &m) { Detector::getClockPhase, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setClockPhase", - (void (Detector::*)(int, int, sls::Positions)) & + (void(Detector::*)(int, int, sls::Positions)) & Detector::setClockPhase, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaxClockPhaseShift", @@ -432,7 +432,7 @@ void init_det(py::module &m) { Detector::getClockPhaseinDegrees, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setClockPhaseinDegrees", - (void (Detector::*)(int, int, sls::Positions)) & + (void(Detector::*)(int, int, sls::Positions)) & Detector::setClockPhaseinDegrees, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getClockDivider", @@ -440,7 +440,7 @@ void init_det(py::module &m) { Detector::getClockDivider, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setClockDivider", - (void (Detector::*)(int, int, sls::Positions)) & + (void(Detector::*)(int, int, sls::Positions)) & Detector::setClockDivider, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getHighVoltage", @@ -448,7 +448,7 @@ void init_det(py::module &m) { Detector::getHighVoltage, py::arg() = Positions{}); CppDetectorApi.def("setHighVoltage", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setHighVoltage, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPowerChip", @@ -456,7 +456,7 @@ void init_det(py::module &m) { Detector::getPowerChip, py::arg() = Positions{}); CppDetectorApi.def("setPowerChip", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setPowerChip, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getImageTestMode", @@ -464,7 +464,7 @@ void init_det(py::module &m) { Detector::getImageTestMode, py::arg() = Positions{}); CppDetectorApi.def("setImageTestMode", - (void (Detector::*)(const int, sls::Positions)) & + (void(Detector::*)(const int, sls::Positions)) & Detector::setImageTestMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTemperatureList", @@ -485,7 +485,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setDefaultDac", - (void (Detector::*)(defs::dacIndex, int, sls::Positions)) & + (void(Detector::*)(defs::dacIndex, int, sls::Positions)) & Detector::setDefaultDac, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -496,12 +496,12 @@ void init_det(py::module &m) { py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setDefaultDac", - (void (Detector::*)(defs::dacIndex, int, defs::detectorSettings, - sls::Positions)) & + (void(Detector::*)(defs::dacIndex, int, defs::detectorSettings, + sls::Positions)) & Detector::setDefaultDac, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("resetToDefaultDacs", - (void (Detector::*)(const bool, sls::Positions)) & + (void(Detector::*)(const bool, sls::Positions)) & Detector::resetToDefaultDacs, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -511,7 +511,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "setDAC", - (void (Detector::*)(defs::dacIndex, int, bool, sls::Positions)) & + (void(Detector::*)(defs::dacIndex, int, bool, sls::Positions)) & Detector::setDAC, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -521,7 +521,7 @@ void init_det(py::module &m) { py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setOnChipDAC", - (void (Detector::*)(defs::dacIndex, int, int, sls::Positions)) & + (void(Detector::*)(defs::dacIndex, int, int, sls::Positions)) & Detector::setOnChipDAC, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getExternalSignalFlags", @@ -531,7 +531,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setExternalSignalFlags", - (void (Detector::*)(int, defs::externalSignalFlag, sls::Positions)) & + (void(Detector::*)(int, defs::externalSignalFlag, sls::Positions)) & Detector::setExternalSignalFlags, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getParallelMode", @@ -539,7 +539,7 @@ void init_det(py::module &m) { Detector::getParallelMode, py::arg() = Positions{}); CppDetectorApi.def("setParallelMode", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setParallelMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getFilterResistor", @@ -547,7 +547,7 @@ void init_det(py::module &m) { Detector::getFilterResistor, py::arg() = Positions{}); CppDetectorApi.def("setFilterResistor", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setFilterResistor, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getCurrentSource", @@ -557,7 +557,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setCurrentSource", - (void (Detector::*)(defs::currentSrcParameters, sls::Positions)) & + (void(Detector::*)(defs::currentSrcParameters, sls::Positions)) & Detector::setCurrentSource, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITPipeline", @@ -565,7 +565,7 @@ void init_det(py::module &m) { Detector::getDBITPipeline, py::arg() = Positions{}); CppDetectorApi.def("setDBITPipeline", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setDBITPipeline, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getReadNRows", @@ -573,24 +573,24 @@ void init_det(py::module &m) { Detector::getReadNRows, py::arg() = Positions{}); CppDetectorApi.def("setReadNRows", - (void (Detector::*)(const int, sls::Positions)) & + (void(Detector::*)(const int, sls::Positions)) & Detector::setReadNRows, py::arg(), py::arg() = Positions{}); - CppDetectorApi.def("acquire", (void (Detector::*)()) & Detector::acquire); + CppDetectorApi.def("acquire", (void(Detector::*)()) & Detector::acquire); CppDetectorApi.def("clearAcquiringFlag", - (void (Detector::*)()) & Detector::clearAcquiringFlag); + (void(Detector::*)()) & Detector::clearAcquiringFlag); CppDetectorApi.def("startReceiver", - (void (Detector::*)()) & Detector::startReceiver); + (void(Detector::*)()) & Detector::startReceiver); CppDetectorApi.def("stopReceiver", - (void (Detector::*)()) & Detector::stopReceiver); + (void(Detector::*)()) & Detector::stopReceiver); CppDetectorApi.def("startDetector", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::startDetector, py::arg() = Positions{}); CppDetectorApi.def("startDetectorReadout", - (void (Detector::*)()) & Detector::startDetectorReadout); + (void(Detector::*)()) & Detector::startDetectorReadout); CppDetectorApi.def("stopDetector", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::stopDetector, py::arg() = Positions{}); CppDetectorApi.def( @@ -623,11 +623,11 @@ void init_det(py::module &m) { Detector::getNextFrameNumber, py::arg() = Positions{}); CppDetectorApi.def("setNextFrameNumber", - (void (Detector::*)(uint64_t, sls::Positions)) & + (void(Detector::*)(uint64_t, sls::Positions)) & Detector::setNextFrameNumber, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("sendSoftwareTrigger", - (void (Detector::*)(const bool, sls::Positions)) & + (void(Detector::*)(const bool, sls::Positions)) & Detector::sendSoftwareTrigger, py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -636,7 +636,7 @@ void init_det(py::module &m) { Detector::getScan, py::arg() = Positions{}); CppDetectorApi.def("setScan", - (void (Detector::*)(const defs::scanParameters)) & + (void(Detector::*)(const defs::scanParameters)) & Detector::setScan, py::arg()); CppDetectorApi.def( @@ -649,7 +649,7 @@ void init_det(py::module &m) { Detector::getNumberofUDPInterfaces, py::arg() = Positions{}); CppDetectorApi.def("setNumberofUDPInterfaces", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setNumberofUDPInterfaces, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSelectedUDPInterface", @@ -657,7 +657,7 @@ void init_det(py::module &m) { Detector::getSelectedUDPInterface, py::arg() = Positions{}); CppDetectorApi.def("selectUDPInterface", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::selectUDPInterface, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -666,7 +666,7 @@ void init_det(py::module &m) { Detector::getSourceUDPIP, py::arg() = Positions{}); CppDetectorApi.def("setSourceUDPIP", - (void (Detector::*)(const sls::IpAddr, sls::Positions)) & + (void(Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setSourceUDPIP, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -675,7 +675,7 @@ void init_det(py::module &m) { Detector::getSourceUDPIP2, py::arg() = Positions{}); CppDetectorApi.def("setSourceUDPIP2", - (void (Detector::*)(const sls::IpAddr, sls::Positions)) & + (void(Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setSourceUDPIP2, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -683,21 +683,19 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getSourceUDPMAC, py::arg() = Positions{}); - CppDetectorApi.def( - "setSourceUDPMAC", - (void (Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setSourceUDPMAC, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def("setSourceUDPMAC", + (void(Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setSourceUDPMAC, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getSourceUDPMAC2", (Result(Detector::*)(sls::Positions) const) & Detector::getSourceUDPMAC2, py::arg() = Positions{}); - CppDetectorApi.def( - "setSourceUDPMAC2", - (void (Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setSourceUDPMAC2, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def("setSourceUDPMAC2", + (void(Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setSourceUDPMAC2, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDestinationUDPList", (Result(Detector::*)( const uint32_t, sls::Positions) const) & @@ -705,7 +703,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setDestinationUDPList", - (void (Detector::*)(const sls::UdpDestination, const int)) & + (void(Detector::*)(const sls::UdpDestination, const int)) & Detector::setDestinationUDPList, py::arg(), py::arg()); CppDetectorApi.def("getNumberofUDPDestinations", @@ -713,7 +711,7 @@ void init_det(py::module &m) { Detector::getNumberofUDPDestinations, py::arg() = Positions{}); CppDetectorApi.def("clearUDPDestinations", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::clearUDPDestinations, py::arg() = Positions{}); CppDetectorApi.def("getFirstUDPDestination", @@ -721,7 +719,7 @@ void init_det(py::module &m) { Detector::getFirstUDPDestination, py::arg() = Positions{}); CppDetectorApi.def("setFirstUDPDestination", - (void (Detector::*)(const int, sls::Positions)) & + (void(Detector::*)(const int, sls::Positions)) & Detector::setFirstUDPDestination, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -730,7 +728,7 @@ void init_det(py::module &m) { Detector::getDestinationUDPIP, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPIP", - (void (Detector::*)(const sls::IpAddr, sls::Positions)) & + (void(Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setDestinationUDPIP, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -739,7 +737,7 @@ void init_det(py::module &m) { Detector::getDestinationUDPIP2, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPIP2", - (void (Detector::*)(const sls::IpAddr, sls::Positions)) & + (void(Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setDestinationUDPIP2, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -747,27 +745,25 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getDestinationUDPMAC, py::arg() = Positions{}); - CppDetectorApi.def( - "setDestinationUDPMAC", - (void (Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setDestinationUDPMAC, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def("setDestinationUDPMAC", + (void(Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setDestinationUDPMAC, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getDestinationUDPMAC2", (Result(Detector::*)(sls::Positions) const) & Detector::getDestinationUDPMAC2, py::arg() = Positions{}); - CppDetectorApi.def( - "setDestinationUDPMAC2", - (void (Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setDestinationUDPMAC2, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def("setDestinationUDPMAC2", + (void(Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setDestinationUDPMAC2, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDestinationUDPPort", (Result(Detector::*)(sls::Positions) const) & Detector::getDestinationUDPPort, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPPort", - (void (Detector::*)(uint16_t, int)) & + (void(Detector::*)(uint16_t, int)) & Detector::setDestinationUDPPort, py::arg(), py::arg() = -1); CppDetectorApi.def("getDestinationUDPPort2", @@ -775,15 +771,15 @@ void init_det(py::module &m) { Detector::getDestinationUDPPort2, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPPort2", - (void (Detector::*)(uint16_t, int)) & + (void(Detector::*)(uint16_t, int)) & Detector::setDestinationUDPPort2, py::arg(), py::arg() = -1); CppDetectorApi.def("reconfigureUDPDestination", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::reconfigureUDPDestination, py::arg() = Positions{}); CppDetectorApi.def("validateUDPConfiguration", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::validateUDPConfiguration, py::arg() = Positions{}); CppDetectorApi.def( @@ -796,7 +792,7 @@ void init_det(py::module &m) { Detector::getTenGiga, py::arg() = Positions{}); CppDetectorApi.def("setTenGiga", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setTenGiga, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTenGigaFlowControl", @@ -804,7 +800,7 @@ void init_det(py::module &m) { Detector::getTenGigaFlowControl, py::arg() = Positions{}); CppDetectorApi.def("setTenGigaFlowControl", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setTenGigaFlowControl, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelayFrame", @@ -812,7 +808,7 @@ void init_det(py::module &m) { Detector::getTransmissionDelayFrame, py::arg() = Positions{}); CppDetectorApi.def("setTransmissionDelayFrame", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setTransmissionDelayFrame, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelayLeft", @@ -820,7 +816,7 @@ void init_det(py::module &m) { Detector::getTransmissionDelayLeft, py::arg() = Positions{}); CppDetectorApi.def("setTransmissionDelayLeft", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setTransmissionDelayLeft, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelayRight", @@ -828,15 +824,15 @@ void init_det(py::module &m) { Detector::getTransmissionDelayRight, py::arg() = Positions{}); CppDetectorApi.def("setTransmissionDelayRight", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setTransmissionDelayRight, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelay", - (int (Detector::*)() const) & + (int(Detector::*)() const) & Detector::getTransmissionDelay); CppDetectorApi.def( "setTransmissionDelay", - (void (Detector::*)(int)) & Detector::setTransmissionDelay, py::arg()); + (void(Detector::*)(int)) & Detector::setTransmissionDelay, py::arg()); CppDetectorApi.def("getUseReceiverFlag", (Result(Detector::*)(sls::Positions) const) & Detector::getUseReceiverFlag, @@ -848,26 +844,26 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setRxHostname", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::setRxHostname, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setRxHostname", - (void (Detector::*)(const std::vector &)) & + (void(Detector::*)(const std::vector &)) & Detector::setRxHostname, py::arg()); CppDetectorApi.def("getRxPort", (Result(Detector::*)(sls::Positions) const) & Detector::getRxPort, py::arg() = Positions{}); - CppDetectorApi.def( - "setRxPort", (void (Detector::*)(uint16_t, int)) & Detector::setRxPort, - py::arg(), py::arg() = -1); + CppDetectorApi.def("setRxPort", + (void(Detector::*)(uint16_t, int)) & Detector::setRxPort, + py::arg(), py::arg() = -1); CppDetectorApi.def("getRxFifoDepth", (Result(Detector::*)(sls::Positions) const) & Detector::getRxFifoDepth, py::arg() = Positions{}); CppDetectorApi.def("setRxFifoDepth", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRxFifoDepth, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxSilentMode", @@ -875,7 +871,7 @@ void init_det(py::module &m) { Detector::getRxSilentMode, py::arg() = Positions{}); CppDetectorApi.def("setRxSilentMode", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setRxSilentMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -885,7 +881,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setRxFrameDiscardPolicy", - (void (Detector::*)(defs::frameDiscardPolicy, sls::Positions)) & + (void(Detector::*)(defs::frameDiscardPolicy, sls::Positions)) & Detector::setRxFrameDiscardPolicy, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPartialFramesPadding", @@ -893,7 +889,7 @@ void init_det(py::module &m) { Detector::getPartialFramesPadding, py::arg() = Positions{}); CppDetectorApi.def("setPartialFramesPadding", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setPartialFramesPadding, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxUDPSocketBufferSize", @@ -901,7 +897,7 @@ void init_det(py::module &m) { Detector::getRxUDPSocketBufferSize, py::arg() = Positions{}); CppDetectorApi.def("setRxUDPSocketBufferSize", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRxUDPSocketBufferSize, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxRealUDPSocketBufferSize", @@ -913,7 +909,7 @@ void init_det(py::module &m) { Detector::getRxLock, py::arg() = Positions{}); CppDetectorApi.def("setRxLock", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setRxLock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -931,7 +927,7 @@ void init_det(py::module &m) { Detector::getRxArping, py::arg() = Positions{}); CppDetectorApi.def("setRxArping", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setRxArping, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxROI", @@ -939,18 +935,18 @@ void init_det(py::module &m) { Detector::getRxROI, py::arg() = -1); CppDetectorApi.def("setRxROI", - (void (Detector::*)(const std::vector &)) & + (void(Detector::*)(const std::vector &)) & Detector::setRxROI, py::arg()); CppDetectorApi.def("clearRxROI", - (void (Detector::*)()) & Detector::clearRxROI); + (void(Detector::*)()) & Detector::clearRxROI); CppDetectorApi.def( "getFileFormat", (Result(Detector::*)(sls::Positions) const) & Detector::getFileFormat, py::arg() = Positions{}); CppDetectorApi.def("setFileFormat", - (void (Detector::*)(defs::fileFormat, sls::Positions)) & + (void(Detector::*)(defs::fileFormat, sls::Positions)) & Detector::setFileFormat, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -960,7 +956,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setFilePath", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::setFilePath, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -970,7 +966,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setFileNamePrefix", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::setFileNamePrefix, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAcquisitionIndex", @@ -978,7 +974,7 @@ void init_det(py::module &m) { Detector::getAcquisitionIndex, py::arg() = Positions{}); CppDetectorApi.def("setAcquisitionIndex", - (void (Detector::*)(int64_t, sls::Positions)) & + (void(Detector::*)(int64_t, sls::Positions)) & Detector::setAcquisitionIndex, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getFileWrite", @@ -986,20 +982,20 @@ void init_det(py::module &m) { Detector::getFileWrite, py::arg() = Positions{}); CppDetectorApi.def("setFileWrite", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setFileWrite, py::arg(), py::arg() = Positions{}); - CppDetectorApi.def("getMasterFileWrite", (bool (Detector::*)() const) & + CppDetectorApi.def("getMasterFileWrite", (bool(Detector::*)() const) & Detector::getMasterFileWrite); - CppDetectorApi.def( - "setMasterFileWrite", - (void (Detector::*)(bool)) & Detector::setMasterFileWrite, py::arg()); + CppDetectorApi.def("setMasterFileWrite", + (void(Detector::*)(bool)) & Detector::setMasterFileWrite, + py::arg()); CppDetectorApi.def("getFileOverWrite", (Result(Detector::*)(sls::Positions) const) & Detector::getFileOverWrite, py::arg() = Positions{}); CppDetectorApi.def("setFileOverWrite", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setFileOverWrite, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getFramesPerFile", @@ -1007,7 +1003,7 @@ void init_det(py::module &m) { Detector::getFramesPerFile, py::arg() = Positions{}); CppDetectorApi.def("setFramesPerFile", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setFramesPerFile, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqDataStream", @@ -1015,7 +1011,7 @@ void init_det(py::module &m) { Detector::getRxZmqDataStream, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqDataStream", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setRxZmqDataStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqFrequency", @@ -1023,7 +1019,7 @@ void init_det(py::module &m) { Detector::getRxZmqFrequency, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqFrequency", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRxZmqFrequency, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqTimer", @@ -1031,7 +1027,7 @@ void init_det(py::module &m) { Detector::getRxZmqTimer, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqTimer", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRxZmqTimer, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqStartingFrame", @@ -1039,7 +1035,7 @@ void init_det(py::module &m) { Detector::getRxZmqStartingFrame, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqStartingFrame", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRxZmqStartingFrame, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqPort", @@ -1047,7 +1043,7 @@ void init_det(py::module &m) { Detector::getRxZmqPort, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqPort", - (void (Detector::*)(uint16_t, int)) & + (void(Detector::*)(uint16_t, int)) & Detector::setRxZmqPort, py::arg(), py::arg() = -1); CppDetectorApi.def("getClientZmqPort", @@ -1055,7 +1051,7 @@ void init_det(py::module &m) { Detector::getClientZmqPort, py::arg() = Positions{}); CppDetectorApi.def("setClientZmqPort", - (void (Detector::*)(uint16_t, int)) & + (void(Detector::*)(uint16_t, int)) & Detector::setClientZmqPort, py::arg(), py::arg() = -1); CppDetectorApi.def( @@ -1064,27 +1060,27 @@ void init_det(py::module &m) { Detector::getClientZmqIp, py::arg() = Positions{}); CppDetectorApi.def("setClientZmqIp", - (void (Detector::*)(const sls::IpAddr, sls::Positions)) & + (void(Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setClientZmqIp, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getClientZmqHwm", - (int (Detector::*)() const) & Detector::getClientZmqHwm); + (int(Detector::*)() const) & Detector::getClientZmqHwm); CppDetectorApi.def( "setClientZmqHwm", - (void (Detector::*)(const int)) & Detector::setClientZmqHwm, py::arg()); + (void(Detector::*)(const int)) & Detector::setClientZmqHwm, py::arg()); CppDetectorApi.def("getRxZmqHwm", (Result(Detector::*)(sls::Positions) const) & Detector::getRxZmqHwm, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqHwm", - (void (Detector::*)(const int)) & Detector::setRxZmqHwm, + (void(Detector::*)(const int)) & Detector::setRxZmqHwm, py::arg()); CppDetectorApi.def("getSubExptime", (Result(Detector::*)(sls::Positions) const) & Detector::getSubExptime, py::arg() = Positions{}); CppDetectorApi.def("setSubExptime", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setSubExptime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSubDeadTime", @@ -1092,7 +1088,7 @@ void init_det(py::module &m) { Detector::getSubDeadTime, py::arg() = Positions{}); CppDetectorApi.def("setSubDeadTime", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setSubDeadTime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getOverFlowMode", @@ -1100,7 +1096,7 @@ void init_det(py::module &m) { Detector::getOverFlowMode, py::arg() = Positions{}); CppDetectorApi.def("setOverFlowMode", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setOverFlowMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRateCorrection", @@ -1108,11 +1104,11 @@ void init_det(py::module &m) { Detector::getRateCorrection, py::arg() = Positions{}); CppDetectorApi.def("setDefaultRateCorrection", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::setDefaultRateCorrection, py::arg() = Positions{}); CppDetectorApi.def("setRateCorrection", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setRateCorrection, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getInterruptSubframe", @@ -1120,7 +1116,7 @@ void init_det(py::module &m) { Detector::getInterruptSubframe, py::arg() = Positions{}); CppDetectorApi.def("setInterruptSubframe", - (void (Detector::*)(const bool, sls::Positions)) & + (void(Detector::*)(const bool, sls::Positions)) & Detector::setInterruptSubframe, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMeasuredPeriod", @@ -1136,7 +1132,7 @@ void init_det(py::module &m) { Detector::getActive, py::arg() = Positions{}); CppDetectorApi.def("setActive", - (void (Detector::*)(const bool, sls::Positions)) & + (void(Detector::*)(const bool, sls::Positions)) & Detector::setActive, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPartialReset", @@ -1144,19 +1140,19 @@ void init_det(py::module &m) { Detector::getPartialReset, py::arg() = Positions{}); CppDetectorApi.def("setPartialReset", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setPartialReset, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("pulsePixel", - (void (Detector::*)(int, defs::xy, sls::Positions)) & + (void(Detector::*)(int, defs::xy, sls::Positions)) & Detector::pulsePixel, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("pulsePixelNMove", - (void (Detector::*)(int, defs::xy, sls::Positions)) & + (void(Detector::*)(int, defs::xy, sls::Positions)) & Detector::pulsePixelNMove, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("pulseChip", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::pulseChip, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getQuad", @@ -1164,7 +1160,7 @@ void init_det(py::module &m) { Detector::getQuad, py::arg() = Positions{}); CppDetectorApi.def("setQuad", - (void (Detector::*)(const bool)) & Detector::setQuad, + (void(Detector::*)(const bool)) & Detector::setQuad, py::arg()); CppDetectorApi.def("getDataStream", (Result(Detector::*)(const defs::portPosition, @@ -1172,8 +1168,8 @@ void init_det(py::module &m) { Detector::getDataStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setDataStream", - (void (Detector::*)(const defs::portPosition, const bool, - sls::Positions)) & + (void(Detector::*)(const defs::portPosition, const bool, + sls::Positions)) & Detector::setDataStream, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTop", @@ -1181,7 +1177,7 @@ void init_det(py::module &m) { Detector::getTop, py::arg() = Positions{}); CppDetectorApi.def( - "setTop", (void (Detector::*)(bool, sls::Positions)) & Detector::setTop, + "setTop", (void(Detector::*)(bool, sls::Positions)) & Detector::setTop, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getChipVersion", (Result(Detector::*)(sls::Positions) const) & @@ -1192,7 +1188,7 @@ void init_det(py::module &m) { Detector::getThresholdTemperature, py::arg() = Positions{}); CppDetectorApi.def("setThresholdTemperature", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setThresholdTemperature, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTemperatureControl", @@ -1200,7 +1196,7 @@ void init_det(py::module &m) { Detector::getTemperatureControl, py::arg() = Positions{}); CppDetectorApi.def("setTemperatureControl", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setTemperatureControl, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTemperatureEvent", @@ -1208,7 +1204,7 @@ void init_det(py::module &m) { Detector::getTemperatureEvent, py::arg() = Positions{}); CppDetectorApi.def("resetTemperatureEvent", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::resetTemperatureEvent, py::arg() = Positions{}); CppDetectorApi.def("getAutoComparatorDisable", @@ -1216,7 +1212,7 @@ void init_det(py::module &m) { Detector::getAutoComparatorDisable, py::arg() = Positions{}); CppDetectorApi.def("setAutoComparatorDisable", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setAutoComparatorDisable, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getComparatorDisableTime", @@ -1224,7 +1220,7 @@ void init_det(py::module &m) { Detector::getComparatorDisableTime, py::arg() = Positions{}); CppDetectorApi.def("setComparatorDisableTime", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setComparatorDisableTime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfAdditionalStorageCells", @@ -1232,7 +1228,7 @@ void init_det(py::module &m) { Detector::getNumberOfAdditionalStorageCells, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfAdditionalStorageCells", - (void (Detector::*)(int)) & + (void(Detector::*)(int)) & Detector::setNumberOfAdditionalStorageCells, py::arg()); CppDetectorApi.def("getStorageCellStart", @@ -1240,7 +1236,7 @@ void init_det(py::module &m) { Detector::getStorageCellStart, py::arg() = Positions{}); CppDetectorApi.def("setStorageCellStart", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setStorageCellStart, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getStorageCellDelay", @@ -1248,7 +1244,7 @@ void init_det(py::module &m) { Detector::getStorageCellDelay, py::arg() = Positions{}); CppDetectorApi.def("setStorageCellDelay", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setStorageCellDelay, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getGainModeList", @@ -1261,7 +1257,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setGainMode", - (void (Detector::*)(const defs::gainMode, sls::Positions)) & + (void(Detector::*)(const defs::gainMode, sls::Positions)) & Detector::setGainMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfFilterCells", @@ -1269,7 +1265,7 @@ void init_det(py::module &m) { Detector::getNumberOfFilterCells, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfFilterCells", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setNumberOfFilterCells, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1279,7 +1275,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setPedestalMode", - (void (Detector::*)(const defs::pedestalParameters, sls::Positions)) & + (void(Detector::*)(const defs::pedestalParameters, sls::Positions)) & Detector::setPedestalMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1289,7 +1285,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setTimingInfoDecoder", - (void (Detector::*)(defs::timingInfoDecoder, sls::Positions)) & + (void(Detector::*)(defs::timingInfoDecoder, sls::Positions)) & Detector::setTimingInfoDecoder, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1299,7 +1295,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setCollectionMode", - (void (Detector::*)(defs::collectionMode, sls::Positions)) & + (void(Detector::*)(defs::collectionMode, sls::Positions)) & Detector::setCollectionMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfBursts", @@ -1308,13 +1304,13 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setNumberOfBursts", - (void (Detector::*)(int64_t)) & Detector::setNumberOfBursts, py::arg()); + (void(Detector::*)(int64_t)) & Detector::setNumberOfBursts, py::arg()); CppDetectorApi.def("getBurstPeriod", (Result(Detector::*)(sls::Positions) const) & Detector::getBurstPeriod, py::arg() = Positions{}); CppDetectorApi.def("setBurstPeriod", - (void (Detector::*)(sls::ns, sls::Positions)) & + (void(Detector::*)(sls::ns, sls::Positions)) & Detector::setBurstPeriod, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfBurstsLeft", @@ -1328,28 +1324,28 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setInjectChannel", - (void (Detector::*)(const int, const int, sls::Positions)) & + (void(Detector::*)(const int, const int, sls::Positions)) & Detector::setInjectChannel, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getVetoPhoton", - (void (Detector::*)(const int, const std::string &, sls::Positions)) & + (void(Detector::*)(const int, const std::string &, sls::Positions)) & Detector::getVetoPhoton, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoPhoton", - (void (Detector::*)(const int, const int, const int, - const std::string &, sls::Positions)) & + (void(Detector::*)(const int, const int, const int, const std::string &, + sls::Positions)) & Detector::setVetoPhoton, py::arg(), py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoReference", - (void (Detector::*)(const int, const int, sls::Positions)) & + (void(Detector::*)(const int, const int, sls::Positions)) & Detector::setVetoReference, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoFile", - (void (Detector::*)(const int, const std::string &, sls::Positions)) & + (void(Detector::*)(const int, const std::string &, sls::Positions)) & Detector::setVetoFile, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1358,7 +1354,7 @@ void init_det(py::module &m) { Detector::getBurstMode, py::arg() = Positions{}); CppDetectorApi.def("setBurstMode", - (void (Detector::*)(defs::burstMode, sls::Positions)) & + (void(Detector::*)(defs::burstMode, sls::Positions)) & Detector::setBurstMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getCDSGain", @@ -1366,7 +1362,7 @@ void init_det(py::module &m) { Detector::getCDSGain, py::arg() = Positions{}); CppDetectorApi.def("setCDSGain", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setCDSGain, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1376,7 +1372,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setTimingSource", - (void (Detector::*)(defs::timingSourceType, sls::Positions)) & + (void(Detector::*)(defs::timingSourceType, sls::Positions)) & Detector::setTimingSource, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getVeto", @@ -1384,7 +1380,7 @@ void init_det(py::module &m) { Detector::getVeto, py::arg() = Positions{}); CppDetectorApi.def("setVeto", - (void (Detector::*)(const bool, sls::Positions)) & + (void(Detector::*)(const bool, sls::Positions)) & Detector::setVeto, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1394,7 +1390,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setVetoStream", - (void (Detector::*)(const defs::streamingInterface, sls::Positions)) & + (void(Detector::*)(const defs::streamingInterface, sls::Positions)) & Detector::setVetoStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1405,8 +1401,8 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoAlgorithm", - (void (Detector::*)(const defs::vetoAlgorithm, - const defs::streamingInterface, sls::Positions)) & + (void(Detector::*)(const defs::vetoAlgorithm, + const defs::streamingInterface, sls::Positions)) & Detector::setVetoAlgorithm, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1416,7 +1412,7 @@ void init_det(py::module &m) { py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setADCConfiguration", - (void (Detector::*)(const int, const int, const int, sls::Positions)) & + (void(Detector::*)(const int, const int, const int, sls::Positions)) & Detector::setADCConfiguration, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getCounterMask", @@ -1424,7 +1420,7 @@ void init_det(py::module &m) { Detector::getCounterMask, py::arg() = Positions{}); CppDetectorApi.def("setCounterMask", - (void (Detector::*)(uint32_t, sls::Positions)) & + (void(Detector::*)(uint32_t, sls::Positions)) & Detector::setCounterMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfGates", @@ -1432,7 +1428,7 @@ void init_det(py::module &m) { Detector::getNumberOfGates, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfGates", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setNumberOfGates, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1441,7 +1437,7 @@ void init_det(py::module &m) { Detector::getExptime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setExptime", - (void (Detector::*)(int, sls::ns, sls::Positions)) & + (void(Detector::*)(int, sls::ns, sls::Positions)) & Detector::setExptime, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1455,7 +1451,7 @@ void init_det(py::module &m) { Detector::getGateDelay, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setGateDelay", - (void (Detector::*)(int, sls::ns, sls::Positions)) & + (void(Detector::*)(int, sls::ns, sls::Positions)) & Detector::setGateDelay, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1468,7 +1464,7 @@ void init_det(py::module &m) { Detector::getChipStatusRegister, py::arg() = Positions{}); CppDetectorApi.def("setGainCaps", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setGainCaps, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getGainCaps", @@ -1481,7 +1477,7 @@ void init_det(py::module &m) { Detector::getPolarity, py::arg() = Positions{}); CppDetectorApi.def("setPolarity", - (void (Detector::*)(defs::polarity, sls::Positions)) & + (void(Detector::*)(defs::polarity, sls::Positions)) & Detector::setPolarity, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getInterpolation", @@ -1489,7 +1485,7 @@ void init_det(py::module &m) { Detector::getInterpolation, py::arg() = Positions{}); CppDetectorApi.def("setInterpolation", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setInterpolation, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPumpProbe", @@ -1497,7 +1493,7 @@ void init_det(py::module &m) { Detector::getPumpProbe, py::arg() = Positions{}); CppDetectorApi.def("setPumpProbe", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setPumpProbe, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAnalogPulsing", @@ -1505,7 +1501,7 @@ void init_det(py::module &m) { Detector::getAnalogPulsing, py::arg() = Positions{}); CppDetectorApi.def("setAnalogPulsing", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setAnalogPulsing, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDigitalPulsing", @@ -1513,7 +1509,7 @@ void init_det(py::module &m) { Detector::getDigitalPulsing, py::arg() = Positions{}); CppDetectorApi.def("setDigitalPulsing", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setDigitalPulsing, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfAnalogSamples", @@ -1521,7 +1517,7 @@ void init_det(py::module &m) { Detector::getNumberOfAnalogSamples, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfAnalogSamples", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setNumberOfAnalogSamples, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getADCClock", @@ -1529,7 +1525,7 @@ void init_det(py::module &m) { Detector::getADCClock, py::arg() = Positions{}); CppDetectorApi.def("setADCClock", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setADCClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRUNClock", @@ -1537,7 +1533,7 @@ void init_det(py::module &m) { Detector::getRUNClock, py::arg() = Positions{}); CppDetectorApi.def("setRUNClock", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRUNClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSYNCClock", @@ -1557,7 +1553,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setPower", - (void (Detector::*)(defs::dacIndex, int, sls::Positions)) & + (void(Detector::*)(defs::dacIndex, int, sls::Positions)) & Detector::setPower, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getADCVpp", @@ -1565,7 +1561,7 @@ void init_det(py::module &m) { Detector::getADCVpp, py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def("setADCVpp", - (void (Detector::*)(int, bool, sls::Positions)) & + (void(Detector::*)(int, bool, sls::Positions)) & Detector::setADCVpp, py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def("getADCEnableMask", @@ -1573,7 +1569,7 @@ void init_det(py::module &m) { Detector::getADCEnableMask, py::arg() = Positions{}); CppDetectorApi.def("setADCEnableMask", - (void (Detector::*)(uint32_t, sls::Positions)) & + (void(Detector::*)(uint32_t, sls::Positions)) & Detector::setADCEnableMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTenGigaADCEnableMask", @@ -1581,7 +1577,7 @@ void init_det(py::module &m) { Detector::getTenGigaADCEnableMask, py::arg() = Positions{}); CppDetectorApi.def("setTenGigaADCEnableMask", - (void (Detector::*)(uint32_t, sls::Positions)) & + (void(Detector::*)(uint32_t, sls::Positions)) & Detector::setTenGigaADCEnableMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransceiverEnableMask", @@ -1589,7 +1585,7 @@ void init_det(py::module &m) { Detector::getTransceiverEnableMask, py::arg() = Positions{}); CppDetectorApi.def("setTransceiverEnableMask", - (void (Detector::*)(uint32_t, sls::Positions)) & + (void(Detector::*)(uint32_t, sls::Positions)) & Detector::setTransceiverEnableMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfDigitalSamples", @@ -1597,7 +1593,7 @@ void init_det(py::module &m) { Detector::getNumberOfDigitalSamples, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfDigitalSamples", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setNumberOfDigitalSamples, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfTransceiverSamples", @@ -1605,7 +1601,7 @@ void init_det(py::module &m) { Detector::getNumberOfTransceiverSamples, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfTransceiverSamples", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setNumberOfTransceiverSamples, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1614,7 +1610,7 @@ void init_det(py::module &m) { Detector::getReadoutMode, py::arg() = Positions{}); CppDetectorApi.def("setReadoutMode", - (void (Detector::*)(defs::readoutMode, sls::Positions)) & + (void(Detector::*)(defs::readoutMode, sls::Positions)) & Detector::setReadoutMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITClock", @@ -1622,7 +1618,7 @@ void init_det(py::module &m) { Detector::getDBITClock, py::arg() = Positions{}); CppDetectorApi.def("setDBITClock", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setDBITClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1645,7 +1641,7 @@ void init_det(py::module &m) { Detector::getExternalSamplingSource, py::arg() = Positions{}); CppDetectorApi.def("setExternalSamplingSource", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setExternalSamplingSource, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getExternalSampling", @@ -1653,7 +1649,7 @@ void init_det(py::module &m) { Detector::getExternalSampling, py::arg() = Positions{}); CppDetectorApi.def("setExternalSampling", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setExternalSampling, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1663,7 +1659,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setRxDbitList", - (void (Detector::*)(const std::vector &, sls::Positions)) & + (void(Detector::*)(const std::vector &, sls::Positions)) & Detector::setRxDbitList, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxDbitOffset", @@ -1671,7 +1667,7 @@ void init_det(py::module &m) { Detector::getRxDbitOffset, py::arg() = Positions{}); CppDetectorApi.def("setRxDbitOffset", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setRxDbitOffset, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxDbitReorder", @@ -1679,11 +1675,11 @@ void init_det(py::module &m) { Detector::getRxDbitReorder, py::arg() = Positions{}); CppDetectorApi.def("setRxDbitReorder", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setRxDbitReorder, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setDigitalIODelay", - (void (Detector::*)(uint64_t, int, sls::Positions)) & + (void(Detector::*)(uint64_t, int, sls::Positions)) & Detector::setDigitalIODelay, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getLEDEnable", @@ -1691,11 +1687,11 @@ void init_det(py::module &m) { Detector::getLEDEnable, py::arg() = Positions{}); CppDetectorApi.def("setLEDEnable", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setLEDEnable, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setDacNames", - (void (Detector::*)(const std::vector)) & + (void(Detector::*)(const std::vector)) & Detector::setDacNames, py::arg()); CppDetectorApi.def("getDacNames", @@ -1708,7 +1704,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setDacName", - (void (Detector::*)(const defs::dacIndex, const std::string &)) & + (void(Detector::*)(const defs::dacIndex, const std::string &)) & Detector::setDacName, py::arg(), py::arg()); CppDetectorApi.def("getDacName", @@ -1716,18 +1712,18 @@ void init_det(py::module &m) { Detector::getDacName, py::arg()); CppDetectorApi.def("setAdcNames", - (void (Detector::*)(const std::vector)) & + (void(Detector::*)(const std::vector)) & Detector::setAdcNames, py::arg()); CppDetectorApi.def("getAdcNames", (std::vector(Detector::*)() const) & Detector::getAdcNames); CppDetectorApi.def("getAdcIndex", - (int (Detector::*)(const std::string &) const) & + (int(Detector::*)(const std::string &) const) & Detector::getAdcIndex, py::arg()); CppDetectorApi.def("setAdcName", - (void (Detector::*)(const int, const std::string &)) & + (void(Detector::*)(const int, const std::string &)) & Detector::setAdcName, py::arg(), py::arg()); CppDetectorApi.def("getAdcName", @@ -1735,18 +1731,18 @@ void init_det(py::module &m) { Detector::getAdcName, py::arg()); CppDetectorApi.def("setSignalNames", - (void (Detector::*)(const std::vector)) & + (void(Detector::*)(const std::vector)) & Detector::setSignalNames, py::arg()); CppDetectorApi.def("getSignalNames", (std::vector(Detector::*)() const) & Detector::getSignalNames); CppDetectorApi.def("getSignalIndex", - (int (Detector::*)(const std::string &) const) & + (int(Detector::*)(const std::string &) const) & Detector::getSignalIndex, py::arg()); CppDetectorApi.def("setSignalName", - (void (Detector::*)(const int, const std::string &)) & + (void(Detector::*)(const int, const std::string &)) & Detector::setSignalName, py::arg(), py::arg()); CppDetectorApi.def("getSignalName", @@ -1754,7 +1750,7 @@ void init_det(py::module &m) { Detector::getSignalName, py::arg()); CppDetectorApi.def("setPowerNames", - (void (Detector::*)(const std::vector)) & + (void(Detector::*)(const std::vector)) & Detector::setPowerNames, py::arg()); CppDetectorApi.def("getPowerNames", @@ -1767,7 +1763,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setPowerName", - (void (Detector::*)(const defs::dacIndex, const std::string &)) & + (void(Detector::*)(const defs::dacIndex, const std::string &)) & Detector::setPowerName, py::arg(), py::arg()); CppDetectorApi.def("getPowerName", @@ -1775,7 +1771,7 @@ void init_det(py::module &m) { Detector::getPowerName, py::arg()); CppDetectorApi.def("setSlowADCNames", - (void (Detector::*)(const std::vector)) & + (void(Detector::*)(const std::vector)) & Detector::setSlowADCNames, py::arg()); CppDetectorApi.def("getSlowADCNames", @@ -1788,7 +1784,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setSlowADCName", - (void (Detector::*)(const defs::dacIndex, const std::string &)) & + (void(Detector::*)(const defs::dacIndex, const std::string &)) & Detector::setSlowADCName, py::arg(), py::arg()); CppDetectorApi.def("getSlowADCName", @@ -1796,7 +1792,7 @@ void init_det(py::module &m) { Detector::getSlowADCName, py::arg()); CppDetectorApi.def("configureTransceiver", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::configureTransceiver, py::arg() = Positions{}); CppDetectorApi.def( @@ -1806,20 +1802,20 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setPattern", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::setPattern, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setPattern", - (void (Detector::*)(const sls::Pattern &, sls::Positions)) & + (void(Detector::*)(const sls::Pattern &, sls::Positions)) & Detector::setPattern, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("savePattern", - (void (Detector::*)(const std::string &)) & + (void(Detector::*)(const std::string &)) & Detector::savePattern, py::arg()); CppDetectorApi.def("loadDefaultPattern", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::loadDefaultPattern, py::arg() = Positions{}); CppDetectorApi.def("getPatternIOControl", @@ -1827,7 +1823,7 @@ void init_det(py::module &m) { Detector::getPatternIOControl, py::arg() = Positions{}); CppDetectorApi.def("setPatternIOControl", - (void (Detector::*)(uint64_t, sls::Positions)) & + (void(Detector::*)(uint64_t, sls::Positions)) & Detector::setPatternIOControl, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternWord", @@ -1835,7 +1831,7 @@ void init_det(py::module &m) { Detector::getPatternWord, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWord", - (void (Detector::*)(int, uint64_t, sls::Positions)) & + (void(Detector::*)(int, uint64_t, sls::Positions)) & Detector::setPatternWord, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1844,7 +1840,7 @@ void init_det(py::module &m) { Detector::getPatternLoopAddresses, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternLoopAddresses", - (void (Detector::*)(int, int, int, sls::Positions)) & + (void(Detector::*)(int, int, int, sls::Positions)) & Detector::setPatternLoopAddresses, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); @@ -1853,7 +1849,7 @@ void init_det(py::module &m) { Detector::getPatternLoopCycles, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternLoopCycles", - (void (Detector::*)(int, int, sls::Positions)) & + (void(Detector::*)(int, int, sls::Positions)) & Detector::setPatternLoopCycles, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternWaitAddr", @@ -1861,7 +1857,7 @@ void init_det(py::module &m) { Detector::getPatternWaitAddr, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWaitAddr", - (void (Detector::*)(int, int, sls::Positions)) & + (void(Detector::*)(int, int, sls::Positions)) & Detector::setPatternWaitAddr, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1870,7 +1866,7 @@ void init_det(py::module &m) { Detector::getPatternWaitClocks, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWaitClocks", - (void (Detector::*)(int, uint64_t, sls::Positions)) & + (void(Detector::*)(int, uint64_t, sls::Positions)) & Detector::setPatternWaitClocks, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1879,7 +1875,7 @@ void init_det(py::module &m) { Detector::getPatternWaitInterval, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWaitInterval", - (void (Detector::*)(int, sls::ns, sls::Positions)) & + (void(Detector::*)(int, sls::ns, sls::Positions)) & Detector::setPatternWaitInterval, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternMask", @@ -1887,7 +1883,7 @@ void init_det(py::module &m) { Detector::getPatternMask, py::arg() = Positions{}); CppDetectorApi.def("setPatternMask", - (void (Detector::*)(uint64_t, sls::Positions)) & + (void(Detector::*)(uint64_t, sls::Positions)) & Detector::setPatternMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternBitMask", @@ -1895,11 +1891,11 @@ void init_det(py::module &m) { Detector::getPatternBitMask, py::arg() = Positions{}); CppDetectorApi.def("setPatternBitMask", - (void (Detector::*)(uint64_t, sls::Positions)) & + (void(Detector::*)(uint64_t, sls::Positions)) & Detector::setPatternBitMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("startPattern", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::startPattern, py::arg() = Positions{}); CppDetectorApi.def("getAdditionalJsonHeader", @@ -1909,8 +1905,8 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setAdditionalJsonHeader", - (void (Detector::*)(const std::map &, - sls::Positions)) & + (void(Detector::*)(const std::map &, + sls::Positions)) & Detector::setAdditionalJsonHeader, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAdditionalJsonParameter", @@ -1920,8 +1916,8 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setAdditionalJsonParameter", - (void (Detector::*)(const std::string &, const std::string &, - sls::Positions)) & + (void(Detector::*)(const std::string &, const std::string &, + sls::Positions)) & Detector::setAdditionalJsonParameter, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getADCPipeline", @@ -1929,35 +1925,35 @@ void init_det(py::module &m) { Detector::getADCPipeline, py::arg() = Positions{}); CppDetectorApi.def("setADCPipeline", - (void (Detector::*)(int, sls::Positions)) & + (void(Detector::*)(int, sls::Positions)) & Detector::setADCPipeline, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "programFPGA", - (void (Detector::*)(const std::string &, const bool, sls::Positions)) & + (void(Detector::*)(const std::string &, const bool, sls::Positions)) & Detector::programFPGA, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( - "resetFPGA", (void (Detector::*)(sls::Positions)) & Detector::resetFPGA, + "resetFPGA", (void(Detector::*)(sls::Positions)) & Detector::resetFPGA, py::arg() = Positions{}); CppDetectorApi.def( "updateDetectorServer", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::updateDetectorServer, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "updateKernel", - (void (Detector::*)(const std::string &, sls::Positions)) & + (void(Detector::*)(const std::string &, sls::Positions)) & Detector::updateKernel, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("rebootController", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::rebootController, py::arg() = Positions{}); CppDetectorApi.def( "updateFirmwareAndServer", - (void (Detector::*)(const std::string &, const std::string &, - sls::Positions)) & + (void(Detector::*)(const std::string &, const std::string &, + sls::Positions)) & Detector::updateFirmwareAndServer, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getUpdateMode", @@ -1965,7 +1961,7 @@ void init_det(py::module &m) { Detector::getUpdateMode, py::arg() = Positions{}); CppDetectorApi.def("setUpdateMode", - (void (Detector::*)(const bool, sls::Positions)) & + (void(Detector::*)(const bool, sls::Positions)) & Detector::setUpdateMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1975,17 +1971,17 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "writeRegister", - (void (Detector::*)(uint32_t, uint32_t, bool, sls::Positions)) & + (void(Detector::*)(uint32_t, uint32_t, bool, sls::Positions)) & Detector::writeRegister, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "setBit", - (void (Detector::*)(uint32_t, int, bool, sls::Positions)) & + (void(Detector::*)(uint32_t, int, bool, sls::Positions)) & Detector::setBit, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "clearBit", - (void (Detector::*)(uint32_t, int, bool, sls::Positions)) & + (void(Detector::*)(uint32_t, int, bool, sls::Positions)) & Detector::clearBit, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -1994,22 +1990,21 @@ void init_det(py::module &m) { Detector::getBit, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("executeFirmwareTest", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::executeFirmwareTest, py::arg() = Positions{}); CppDetectorApi.def("executeBusTest", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::executeBusTest, py::arg() = Positions{}); - CppDetectorApi.def( - "writeAdcRegister", - (void (Detector::*)(uint32_t, uint32_t, sls::Positions)) & - Detector::writeAdcRegister, - py::arg(), py::arg(), py::arg() = Positions{}); - CppDetectorApi.def("getInitialChecks", (bool (Detector::*)() const) & + CppDetectorApi.def("writeAdcRegister", + (void(Detector::*)(uint32_t, uint32_t, sls::Positions)) & + Detector::writeAdcRegister, + py::arg(), py::arg(), py::arg() = Positions{}); + CppDetectorApi.def("getInitialChecks", (bool(Detector::*)() const) & Detector::getInitialChecks); CppDetectorApi.def("setInitialChecks", - (void (Detector::*)(const bool)) & + (void(Detector::*)(const bool)) & Detector::setInitialChecks, py::arg()); CppDetectorApi.def("getADCInvert", @@ -2017,7 +2012,7 @@ void init_det(py::module &m) { Detector::getADCInvert, py::arg() = Positions{}); CppDetectorApi.def("setADCInvert", - (void (Detector::*)(uint32_t, sls::Positions)) & + (void(Detector::*)(uint32_t, sls::Positions)) & Detector::setADCInvert, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getControlPort", @@ -2025,7 +2020,7 @@ void init_det(py::module &m) { Detector::getControlPort, py::arg() = Positions{}); CppDetectorApi.def("setControlPort", - (void (Detector::*)(uint16_t, sls::Positions)) & + (void(Detector::*)(uint16_t, sls::Positions)) & Detector::setControlPort, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getStopPort", @@ -2033,7 +2028,7 @@ void init_det(py::module &m) { Detector::getStopPort, py::arg() = Positions{}); CppDetectorApi.def("setStopPort", - (void (Detector::*)(uint16_t, sls::Positions)) & + (void(Detector::*)(uint16_t, sls::Positions)) & Detector::setStopPort, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDetectorLock", @@ -2041,7 +2036,7 @@ void init_det(py::module &m) { Detector::getDetectorLock, py::arg() = Positions{}); CppDetectorApi.def("setDetectorLock", - (void (Detector::*)(bool, sls::Positions)) & + (void(Detector::*)(bool, sls::Positions)) & Detector::setDetectorLock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( diff --git a/python/src/typecaster.h b/python/src/typecaster.h index 6412afa72..b011cebda 100644 --- a/python/src/typecaster.h +++ b/python/src/typecaster.h @@ -1,11 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-other // Copyright (C) 2021 Contributors to the SLS Detector Package #pragma once -#include #include +#include -#include "sls/Result.h" #include "DurationWrapper.h" +#include "sls/Result.h" +#include "sls/sls_detector_defs.h" namespace py = pybind11; namespace pybind11 { @@ -14,84 +15,125 @@ template struct type_caster> : list_caster, Type> {}; - // Based on the typecaster in pybind11/chrono.h template <> struct type_caster { - public: - PYBIND11_TYPE_CASTER(std::chrono::nanoseconds, const_name("DurationWrapper")); + public: + PYBIND11_TYPE_CASTER(std::chrono::nanoseconds, + const_name("DurationWrapper")); - // signed 25 bits required by the standard. - using days = std::chrono::duration>; + // signed 25 bits required by the standard. + using days = std::chrono::duration>; - /** - * Conversion part 1 (Python->C++): convert a PyObject into std::chrono::nanoseconds - * try datetime.timedelta, floats and our DurationWrapper wrapper - */ + /** + * Conversion part 1 (Python->C++): convert a PyObject into + * std::chrono::nanoseconds try datetime.timedelta, floats and our + * DurationWrapper wrapper + */ - bool load(handle src, bool) { - using namespace std::chrono; + bool load(handle src, bool) { + using namespace std::chrono; - // Lazy initialise the PyDateTime import - if (!PyDateTimeAPI) { - PyDateTime_IMPORT; - } + // Lazy initialise the PyDateTime import + if (!PyDateTimeAPI) { + PyDateTime_IMPORT; + } - if (!src) { + if (!src) { + return false; + } + // If invoked with datetime.delta object, same as in chrono.h + if (PyDelta_Check(src.ptr())) { + value = duration_cast( + days(PyDateTime_DELTA_GET_DAYS(src.ptr())) + + seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr())) + + microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr())) + + ); + return true; + } + // If invoked with a float we assume it is seconds and convert, same as + // in chrono.h + if (PyFloat_Check(src.ptr())) { + value = duration_cast( + duration(PyFloat_AsDouble(src.ptr()))); + return true; + } + // If invoked with an int we assume it is nanoseconds and convert, same + // as in chrono.h + if (PyLong_Check(src.ptr())) { + value = duration_cast( + duration(PyLong_AsLongLong(src.ptr()))); + return true; + } + + // Lastly if we were actually called with a DurationWrapper object we + // get the number of nanoseconds and create a std::chrono::nanoseconds + // from it + py::object py_cls = + py::module::import("slsdet._slsdet").attr("DurationWrapper"); + if (py::isinstance(src, py_cls)) { + sls::DurationWrapper *cls = src.cast(); + value = nanoseconds(cls->count()); + return true; + } + + return false; + } + + /** + * Conversion part 2 (C++ -> Python) + * import the module to get a handle to the wrapped class + * Default construct an object of (wrapped) DurationWrapper + * set the count from chrono::nanoseconds and return + */ + static handle cast(std::chrono::nanoseconds src, + return_value_policy /* policy */, handle /* parent */) { + py::object py_cls = + py::module::import("slsdet._slsdet").attr("DurationWrapper"); + py::object *obj = new py::object; + *obj = py_cls(); + sls::DurationWrapper *dur = obj->cast(); + dur->set_count(src.count()); + return *obj; + } +}; + +// Type caster for sls::defs::ROI from tuple +template <> struct type_caster { + PYBIND11_TYPE_CASTER(sls::defs::ROI, _("Sequence[int, int, int, int]")); + + // convert c++ ROI to python tuple + static handle cast(const sls::defs::ROI &roi, return_value_policy, handle) { + return py::make_tuple(roi.xmin, roi.xmax, roi.ymin, roi.ymax).release(); + } + + // convert from python to c++ ROI + bool load(handle roi, bool /*allow implicit conversion*/) { + + // accept tuple, list, numpy array any sequence + py::sequence seq; + try { + seq = py::reinterpret_borrow(roi); + } catch (...) { + return false; + } + + if (seq.size() != 4) + return false; + // Check if each element is an int + for (auto item : seq) { + if (!py::isinstance(item)) { return false; } - // If invoked with datetime.delta object, same as in chrono.h - if (PyDelta_Check(src.ptr())) { - value = duration_cast( - days(PyDateTime_DELTA_GET_DAYS(src.ptr())) + - seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr())) + - microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr())) - - ); - return true; - } - // If invoked with a float we assume it is seconds and convert, same as in chrono.h - if (PyFloat_Check(src.ptr())) { - value = duration_cast(duration(PyFloat_AsDouble(src.ptr()))); - return true; - } - // If invoked with an int we assume it is nanoseconds and convert, same as in chrono.h - if (PyLong_Check(src.ptr())) { - value = duration_cast(duration(PyLong_AsLongLong(src.ptr()))); - return true; - } - - - // Lastly if we were actually called with a DurationWrapper object we get - // the number of nanoseconds and create a std::chrono::nanoseconds from it - py::object py_cls = py::module::import("slsdet._slsdet").attr("DurationWrapper"); - if (py::isinstance(src, py_cls)){ - sls::DurationWrapper *cls = src.cast(); - value = nanoseconds(cls->count()); - return true; - } - - - return false; - } - /** - * Conversion part 2 (C++ -> Python) - * import the module to get a handle to the wrapped class - * Default construct an object of (wrapped) DurationWrapper - * set the count from chrono::nanoseconds and return - */ - static handle cast(std::chrono::nanoseconds src, return_value_policy /* policy */, handle /* parent */) { - py::object py_cls = py::module::import("slsdet._slsdet").attr("DurationWrapper"); - py::object* obj = new py::object; - *obj = py_cls(); - sls::DurationWrapper *dur = obj->cast(); - dur->set_count(src.count()); - return *obj; - } - }; - - + value.xmin = seq[0].cast(); + value.xmax = seq[1].cast(); + value.ymin = seq[2].cast(); + value.ymax = seq[3].cast(); + return true; + } +}; } // namespace detail } // namespace pybind11 \ No newline at end of file From 925cd55b1c26c48a8383f4464e11b825b86b2904 Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 14 Nov 2025 11:12:34 +0100 Subject: [PATCH 08/27] API also allows single sequence for single ROI --- python/slsdet/detector.py | 12 +++++++++++- python/src/detector.cpp | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 6601641c9..dd854f6e8 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -24,6 +24,7 @@ import datetime as dt from functools import wraps from collections import namedtuple +from collections.abc import Sequence import socket import numpy as np @@ -321,7 +322,16 @@ class Detector(CppDetectorApi): Each ROI should be represented as a tuple of (x_start, y_start, x_end, y_end). \n Example: [(0, 100, 50, 100)] \n """ - self.setRxROI(rois) + # TODO: maybe better to accept py::object in setRxROI and handle there? + if not isinstance(rois, Sequence): + raise TypeError( + "setRxROI failed: expected a tuple/list of ints x_min, x_max, y_min, y_max " + "or a sequence of such." + ) + if(not isinstance(rois[0], Sequence)): + self.setRxROI([rois]) + else: + self.setRxROI(rois) @property diff --git a/python/src/detector.cpp b/python/src/detector.cpp index 4b41c636a..be166480f 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -938,6 +938,7 @@ void init_det(py::module &m) { (void(Detector::*)(const std::vector &)) & Detector::setRxROI, py::arg()); + CppDetectorApi.def("clearRxROI", (void(Detector::*)()) & Detector::clearRxROI); CppDetectorApi.def( From d4f80496236363a3cb18b02e060d663cbe05d218 Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 14 Nov 2025 12:29:42 +0100 Subject: [PATCH 09/27] added tests --- python/tests/test_pythonAPI.py | 26 ++++++++++++ tests/scripts/test_PythonAPI.py | 70 +++++++++++++++++++++++++++++++++ tests/scripts/test_roi.py | 43 ++------------------ tests/scripts/utils_for_test.py | 21 ++++++++-- 4 files changed, 117 insertions(+), 43 deletions(-) create mode 100644 python/tests/test_pythonAPI.py create mode 100644 tests/scripts/test_PythonAPI.py diff --git a/python/tests/test_pythonAPI.py b/python/tests/test_pythonAPI.py new file mode 100644 index 000000000..2e53d42cb --- /dev/null +++ b/python/tests/test_pythonAPI.py @@ -0,0 +1,26 @@ +import pytest + +from slsdet import Detector + +def test_rx_ROI(): + """ Test setting and getting rx_ROI property of Detector class. """ + + d = Detector() + d.rx_roi = (0, 10, 10, 20) + roi = d.rx_roi + assert roi == [(0, 10, 10, 20)] + + 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 + + roi = d.rx_roi + assert roi == [(0,10,0,20), (5,20,410,420)] + + d.clear_rx_roi() + roi = d.rx_roi + assert roi == [(-1,-1,-1,-1)] + + diff --git a/tests/scripts/test_PythonAPI.py b/tests/scripts/test_PythonAPI.py new file mode 100644 index 000000000..3b4c8ee99 --- /dev/null +++ b/tests/scripts/test_PythonAPI.py @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2021 Contributors to the SLS Detector Package + +''' +This file is used to start up simulators, receivers and test python API, tests are less exhaustive than C++ tests. +''' + +import traceback + +from utils_for_test import ( + Log, + LogLevel, + RuntimeException, + cleanup, + startProcessInBackground, + startReceiver, + startDetectorVirtualServer, + connectToVirtualServers, + loadConfig, + loadBasicSettings, + runProcessWithLogFile +) + +LOG_PREFIX_FNAME = '/tmp/slsDetectorPackage_virtual_PythonAPI_test' +MAIN_LOG_FNAME = LOG_PREFIX_FNAME + '_log.txt' +PYTHONAPI_TEST_FNAME = LOG_PREFIX_FNAME + '_results_' + +def startTests(fp): + servers = [ + 'moench', + ] + nmods = 2 + for server in servers: + for ninterfaces in range(1,2): + if ninterfaces == 2 and server != 'jungfrau' and server != 'moench': + continue + try: + msg = f'Starting Python API Tests for {server}' + if server == 'jungfrau' or server == 'moench': + msg += f' with {ninterfaces} interfaces' + Log(LogLevel.INFOBLUE, msg) + Log(LogLevel.INFOBLUE, msg, fp) + cleanup(fp) + startDetectorVirtualServer(server, nmods, fp) + startReceiver(nmods, fp) + d = loadConfig(name=server, log_file_fp=fp, num_mods=nmods, num_frames=1, num_interfaces=ninterfaces) + loadBasicSettings(name=server, d=d, fp=fp) + + fname = PYTHONAPI_TEST_FNAME + server + '.txt' + cmd = ['python', '-m', 'pytest', '../python/tests/test_pythonAPI.py'] + runProcessWithLogFile('Python API Tests for ' + server, cmd, fp, fname) + Log(LogLevel.INFO, '\n') + except Exception as e: + raise RuntimeException(f'Python API Tests failed') from e + + Log(LogLevel.INFOGREEN, 'Passed all Python API tests for server ' + str(servers) + '\n') + + +if __name__ == '__main__': + Log(LogLevel.INFOBLUE, '\nLog File: ' + MAIN_LOG_FNAME + '\n') + + with open(MAIN_LOG_FNAME, 'w') as fp: + try: + startTests(fp) + cleanup(fp) + except Exception as e: + with open(MAIN_LOG_FNAME, 'a') as fp_error: + traceback.print_exc(file=fp_error) + cleanup(fp) + Log(LogLevel.ERROR, f'Tests Failed.') \ No newline at end of file diff --git a/tests/scripts/test_roi.py b/tests/scripts/test_roi.py index ffb0ef686..17d35c56d 100644 --- a/tests/scripts/test_roi.py +++ b/tests/scripts/test_roi.py @@ -18,9 +18,11 @@ from utils_for_test import ( RuntimeException, cleanup, startProcessInBackground, + startReceiver, startDetectorVirtualServer, connectToVirtualServers, loadBasicSettings, + loadConfig, runProcessWithLogFile ) @@ -28,45 +30,6 @@ LOG_PREFIX_FNAME = '/tmp/slsDetectorPackage_virtual_roi_test' MAIN_LOG_FNAME = LOG_PREFIX_FNAME + '_log.txt' ROI_TEST_FNAME = LOG_PREFIX_FNAME + '_results_' -def startReceiver(num_mods, fp): - if num_mods == 1: - cmd = ['slsReceiver'] - else: - cmd = ['slsMultiReceiver', str(DEFAULT_TCP_RX_PORTNO), str(num_mods)] - # in 10.0.0 - #cmd = ['slsMultiReceiver', '-p', str(DEFAULT_TCP_RX_PORTNO), '-n', str(num_mods)] - startProcessInBackground(cmd, fp) - time.sleep(1) - - -def loadConfigForRoi(name, fp, num_mods = 1, num_interfaces = 1): - Log(LogLevel.INFO, 'Loading config') - Log(LogLevel.INFO, 'Loading config', fp) - try: - d = connectToVirtualServers(name, num_mods) - - if name == 'jungfrau' or name == 'moench': - d.numinterfaces = num_interfaces - - d.udp_dstport = DEFAULT_UDP_DST_PORTNO - if name == 'eiger' or name == 'jungfrau' or name == 'moench': - d.udp_dstport2 = DEFAULT_UDP_DST_PORTNO + 1 - - d.rx_hostname = 'localhost' - d.udp_dstip = 'auto' - if name != "eiger": - d.udp_srcip = 'auto' - if name == 'jungfrau' or name == 'moench': - d.udp_dstip2 = 'auto' - d.powerchip = 1 - - d.frames = 5 - - except Exception as e: - raise RuntimeException(f'Could not load config for {name}. Error: {str(e)}') from e - - return d - def startTestsForAll(fp): servers = [ 'eiger', @@ -89,7 +52,7 @@ def startTestsForAll(fp): cleanup(fp) startDetectorVirtualServer(server, nmods, fp) startReceiver(nmods, fp) - d = loadConfigForRoi(name=server, fp=fp, num_mods=nmods, num_interfaces=ninterfaces) + d = loadConfig(name=server, log_file_fp = fp, num_mods=nmods, num_frames=5, num_interfaces=ninterfaces) loadBasicSettings(name=server, d=d, fp=fp) fname = ROI_TEST_FNAME + server + '.txt' diff --git a/tests/scripts/utils_for_test.py b/tests/scripts/utils_for_test.py index 71a7ddde7..9f6a65ddc 100644 --- a/tests/scripts/utils_for_test.py +++ b/tests/scripts/utils_for_test.py @@ -193,14 +193,28 @@ def connectToVirtualServers(name, num_mods, ctb_object=False): return d +def startReceiver(num_mods, fp): + if num_mods == 1: + cmd = ['slsReceiver'] + else: + cmd = ['slsMultiReceiver', str(DEFAULT_TCP_RX_PORTNO), str(num_mods)] + # in 10.0.0 + #cmd = ['slsMultiReceiver', '-p', str(DEFAULT_TCP_RX_PORTNO), '-n', str(num_mods)] + startProcessInBackground(cmd, fp) + time.sleep(1) -def loadConfig(name, rx_hostname, settingsdir, fp, num_mods = 1, num_frames = 1): + +def loadConfig(name, rx_hostname = 'localhost', settingsdir = None, log_file_fp = None, num_mods = 1, num_frames = 1, num_interfaces = 1): Log(LogLevel.INFO, 'Loading config') - Log(LogLevel.INFO, 'Loading config', fp) + Log(LogLevel.INFO, 'Loading config', log_file_fp) try: d = connectToVirtualServers(name, num_mods) + + if name == 'jungfrau' or name == 'moench': + d.numinterfaces = num_interfaces + d.udp_dstport = DEFAULT_UDP_DST_PORTNO - if name == 'eiger': + if name == 'eiger' or name == 'jungfrau' or name == 'moench': d.udp_dstport2 = DEFAULT_UDP_DST_PORTNO + 1 d.rx_hostname = rx_hostname @@ -209,6 +223,7 @@ def loadConfig(name, rx_hostname, settingsdir, fp, num_mods = 1, num_frames = 1) d.udp_srcip = 'auto' if name == "jungfrau" or name == "moench" or name == "xilinx_ctb": + d.udp_dstip2 = 'auto' d.powerchip = 1 if name == "xilinx_ctb": From cad44943c3df962591c588ea3957696d12650315 Mon Sep 17 00:00:00 2001 From: Alice Date: Fri, 14 Nov 2025 14:51:09 +0100 Subject: [PATCH 10/27] wrapped virtual detector setup in a test fixture --- python/tests/conftest.py | 80 +++++++++++++++++++++++++++++++++ python/tests/test_pythonAPI.py | 6 ++- tests/scripts/test_PythonAPI.py | 70 ----------------------------- 3 files changed, 85 insertions(+), 71 deletions(-) create mode 100644 python/tests/conftest.py delete mode 100644 tests/scripts/test_PythonAPI.py diff --git a/python/tests/conftest.py b/python/tests/conftest.py new file mode 100644 index 000000000..515e86a51 --- /dev/null +++ b/python/tests/conftest.py @@ -0,0 +1,80 @@ +import pytest +import sys +import traceback + +from pathlib import Path + +current_dir = Path(__file__).resolve().parents[2] + +scripts_dir = current_dir / "tests" / "scripts" + +sys.path.append(str(scripts_dir)) + +print(sys.path) + +from utils_for_test import ( + Log, + LogLevel, + RuntimeException, + cleanup, + startProcessInBackground, + startReceiver, + startDetectorVirtualServer, + connectToVirtualServers, + loadConfig, + loadBasicSettings, + runProcessWithLogFile +) + +def pytest_addoption(parser): + parser.addoption( + "--with-detector-simulators", action="store_true", default=False, help="Run tests that require detector simulators" + ) + +def pytest_configure(config): + config.addinivalue_line("markers", "withdetectorsimulators: mark test as needing detector simulators to run") + +def pytest_collection_modifyitems(config, items): + if config.getoption("--with-detector-simulators"): + return + skip = pytest.mark.skip(reason="need --with-detector-simulators option to run") + for item in items: + if "withdetectorsimulators" in item.keywords: + item.add_marker(skip) + +@pytest.fixture +def test_with_simulators(): + """ Fixture to automatically setup virtual detector servers for testing. """ + + LOG_PREFIX_FNAME = '/tmp/slsDetectorPackage_virtual_PythonAPI_test' + MAIN_LOG_FNAME = LOG_PREFIX_FNAME + '_log.txt' + + with open(MAIN_LOG_FNAME, 'w') as fp: + try: + servers = ['moench'] + nmods = 2 + for server in servers: + for ninterfaces in range(1,2): + if ninterfaces == 2 and server != 'jungfrau' and server != 'moench': + continue + + msg = f'Starting Python API Tests for {server}' + + if server == 'jungfrau' or server == 'moench': + msg += f' with {ninterfaces} interfaces' + + Log(LogLevel.INFOBLUE, msg, fp) + cleanup(fp) + startDetectorVirtualServer(server, nmods, fp) + startReceiver(nmods, fp) + d = loadConfig(name=server, log_file_fp=fp, num_mods=nmods, num_frames=1, num_interfaces=ninterfaces) + loadBasicSettings(name=server, d=d, fp=fp) + yield # run test + cleanup(fp) # teardown + except Exception as e: + with open(MAIN_LOG_FNAME, 'a') as fp_error: + traceback.print_exc(file=fp_error) + Log(LogLevel.ERROR, f'Tests Failed.', fp) + cleanup(fp) + + diff --git a/python/tests/test_pythonAPI.py b/python/tests/test_pythonAPI.py index 2e53d42cb..21b5b1d8a 100644 --- a/python/tests/test_pythonAPI.py +++ b/python/tests/test_pythonAPI.py @@ -1,8 +1,12 @@ import pytest +import sys + +from conftest import test_with_simulators from slsdet import Detector -def test_rx_ROI(): +@pytest.mark.withdetectorsimulators +def test_rx_ROI(test_with_simulators): """ Test setting and getting rx_ROI property of Detector class. """ d = Detector() diff --git a/tests/scripts/test_PythonAPI.py b/tests/scripts/test_PythonAPI.py deleted file mode 100644 index 3b4c8ee99..000000000 --- a/tests/scripts/test_PythonAPI.py +++ /dev/null @@ -1,70 +0,0 @@ -# SPDX-License-Identifier: LGPL-3.0-or-other -# Copyright (C) 2021 Contributors to the SLS Detector Package - -''' -This file is used to start up simulators, receivers and test python API, tests are less exhaustive than C++ tests. -''' - -import traceback - -from utils_for_test import ( - Log, - LogLevel, - RuntimeException, - cleanup, - startProcessInBackground, - startReceiver, - startDetectorVirtualServer, - connectToVirtualServers, - loadConfig, - loadBasicSettings, - runProcessWithLogFile -) - -LOG_PREFIX_FNAME = '/tmp/slsDetectorPackage_virtual_PythonAPI_test' -MAIN_LOG_FNAME = LOG_PREFIX_FNAME + '_log.txt' -PYTHONAPI_TEST_FNAME = LOG_PREFIX_FNAME + '_results_' - -def startTests(fp): - servers = [ - 'moench', - ] - nmods = 2 - for server in servers: - for ninterfaces in range(1,2): - if ninterfaces == 2 and server != 'jungfrau' and server != 'moench': - continue - try: - msg = f'Starting Python API Tests for {server}' - if server == 'jungfrau' or server == 'moench': - msg += f' with {ninterfaces} interfaces' - Log(LogLevel.INFOBLUE, msg) - Log(LogLevel.INFOBLUE, msg, fp) - cleanup(fp) - startDetectorVirtualServer(server, nmods, fp) - startReceiver(nmods, fp) - d = loadConfig(name=server, log_file_fp=fp, num_mods=nmods, num_frames=1, num_interfaces=ninterfaces) - loadBasicSettings(name=server, d=d, fp=fp) - - fname = PYTHONAPI_TEST_FNAME + server + '.txt' - cmd = ['python', '-m', 'pytest', '../python/tests/test_pythonAPI.py'] - runProcessWithLogFile('Python API Tests for ' + server, cmd, fp, fname) - Log(LogLevel.INFO, '\n') - except Exception as e: - raise RuntimeException(f'Python API Tests failed') from e - - Log(LogLevel.INFOGREEN, 'Passed all Python API tests for server ' + str(servers) + '\n') - - -if __name__ == '__main__': - Log(LogLevel.INFOBLUE, '\nLog File: ' + MAIN_LOG_FNAME + '\n') - - with open(MAIN_LOG_FNAME, 'w') as fp: - try: - startTests(fp) - cleanup(fp) - except Exception as e: - with open(MAIN_LOG_FNAME, 'a') as fp_error: - traceback.print_exc(file=fp_error) - cleanup(fp) - Log(LogLevel.ERROR, f'Tests Failed.') \ No newline at end of file From e7f5a2aa11893bafc1ea0a24748c74ddb2c33684 Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 17 Nov 2025 09:37:58 +0100 Subject: [PATCH 11/27] added colorama in github workflows --- .github/workflows/cmake.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yaml b/.github/workflows/cmake.yaml index e924e0bdf..32aba389c 100644 --- a/.github/workflows/cmake.yaml +++ b/.github/workflows/cmake.yaml @@ -19,7 +19,7 @@ jobs: with: python-version: 3.12 cache: 'pip' - - run: pip install pytest numpy + - run: pip install pytest numpy colorama - uses: awalsh128/cache-apt-pkgs-action@latest with: From ae8c9175bf790c5495b66f29a030b398b99dca0c Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 17 Nov 2025 11:00:37 +0100 Subject: [PATCH 12/27] disable user id and port test --- slsReceiverSoftware/tests/test-Apps.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slsReceiverSoftware/tests/test-Apps.cpp b/slsReceiverSoftware/tests/test-Apps.cpp index 38bb3a02e..fbbd2ff96 100644 --- a/slsReceiverSoftware/tests/test-Apps.cpp +++ b/slsReceiverSoftware/tests/test-Apps.cpp @@ -138,7 +138,8 @@ TEST_CASE("Parse version and help", "[detector]") { } } -TEST_CASE("Parse port and uid", "[detector]") { +// TODO: fails on gitea CI due to uid issue, fix later +TEST_CASE("Parse port and uid", "[.failsongitea][detector]") { uid_t uid = getuid(); std::string uidStr = std::to_string(uid); uid_t invalidUid = uid + 1000; From c1e5cfa1019eb53c3f934c99dcb20410c6a9e2bc Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 19 Nov 2025 11:08:15 +0100 Subject: [PATCH 13/27] fixed virtual detector test scripts --- tests/scripts/test_frame_synchronizer.py | 2 +- tests/scripts/test_simulators.py | 2 +- tests/scripts/utils_for_test.py | 11 +++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/scripts/test_frame_synchronizer.py b/tests/scripts/test_frame_synchronizer.py index ba9bd7e67..6653c96cb 100644 --- a/tests/scripts/test_frame_synchronizer.py +++ b/tests/scripts/test_frame_synchronizer.py @@ -113,7 +113,7 @@ def startTestsForAll(args, fp): startDetectorVirtualServer(server, args.num_mods, fp) startFrameSynchronizerPullSocket(server, fp) startFrameSynchronizer(args.num_mods, fp) - d = loadConfig(name=server, rx_hostname=args.rx_hostname, settingsdir=args.settingspath, fp=fp, num_mods=args.num_mods, num_frames=args.num_frames) + d = loadConfig(name=server, rx_hostname=args.rx_hostname, settingsdir=args.settingspath, log_file_fp=fp, num_mods=args.num_mods, num_frames=args.num_frames) loadBasicSettings(name=server, d=d, fp=fp) acquire(fp, d) testFramesCaught(server, d, args.num_frames) diff --git a/tests/scripts/test_simulators.py b/tests/scripts/test_simulators.py index 9b535c29d..7aab1d958 100644 --- a/tests/scripts/test_simulators.py +++ b/tests/scripts/test_simulators.py @@ -63,7 +63,7 @@ def startCmdTestsForAll(args, fp): cleanup(fp) startDetectorVirtualServer(name=server, num_mods=num_mods, fp=fp) startReceiver(num_mods, fp) - d = loadConfig(name=server, rx_hostname=args.rx_hostname, settingsdir=args.settingspath, fp=fp, num_mods=num_mods) + d = loadConfig(name=server, rx_hostname=args.rx_hostname, settingsdir=args.settingspath, log_file_fp=fp, num_mods=num_mods) loadBasicSettings(name=server, d=d, fp=fp) runProcessWithLogFile('Cmd Tests (' + args.markers + ') for ' + server, cmd, fp, fname) except Exception as e: diff --git a/tests/scripts/utils_for_test.py b/tests/scripts/utils_for_test.py index 9f6a65ddc..ae9aa4559 100644 --- a/tests/scripts/utils_for_test.py +++ b/tests/scripts/utils_for_test.py @@ -16,7 +16,6 @@ SERVER_START_PORTNO=1900 init(autoreset=True) - class LogLevel(Enum): INFO = 0 INFORED = 1 @@ -229,11 +228,11 @@ def loadConfig(name, rx_hostname = 'localhost', settingsdir = None, log_file_fp if name == "xilinx_ctb": d.configureTransceiver() - if name == "eiger": - d.trimen = [4500, 5400, 6400] - d.settingspath = settingsdir + '/eiger/' - d.setThresholdEnergy(4500, detectorSettings.STANDARD) - + if settingsdir is not None and name in ['eiger', 'mythen3']: + d.settingspath = settingsdir + '/' + name + '/' + d.trimen = [4500, 5400, 6400] if name == 'eiger' else [4000, 6000, 8000, 12000] + d.setThresholdEnergy(4500, detectorSettings.STANDARD) + d.frames = num_frames except Exception as e: From 50448cefb4b7a3d86d2cb1de50c56893968ecc16 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 19 Nov 2025 11:37:47 +0100 Subject: [PATCH 14/27] Code Review --- RELEASE.txt | 29 +++++++++++++++++++++++++++++ python/slsdet/detector.py | 16 ++++++++++++---- python/tests/conftest.py | 4 ---- python/tests/test_pythonAPI.py | 4 ++-- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/RELEASE.txt b/RELEASE.txt index b56b0dacf..a879bea28 100644 --- a/RELEASE.txt +++ b/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 instead of the one included in our repo. +<<<<<<< HEAD:RELEASE.txt 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 ========================================== diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index dd854f6e8..3fd70224b 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -309,18 +309,23 @@ class Detector(CppDetectorApi): Note ----- 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? @rx_roi.setter 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 ----- - Each ROI should be represented as a tuple of (x_start, y_start, x_end, y_end). \n - Example: [(0, 100, 50, 100)] \n + Each ROI should be represented as a sequence of 4 ints (x_start, y_start, x_end, y_end). \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? if not isinstance(rois, Sequence): @@ -333,6 +338,9 @@ class Detector(CppDetectorApi): else: self.setRxROI(rois) + def rx_clearroi(self): + """Clears all the ROIs configured in the receiver.""" + self.clearRxROI() @property @element diff --git a/python/tests/conftest.py b/python/tests/conftest.py index 515e86a51..830d257dd 100644 --- a/python/tests/conftest.py +++ b/python/tests/conftest.py @@ -15,15 +15,11 @@ print(sys.path) from utils_for_test import ( Log, LogLevel, - RuntimeException, cleanup, - startProcessInBackground, startReceiver, startDetectorVirtualServer, - connectToVirtualServers, loadConfig, loadBasicSettings, - runProcessWithLogFile ) def pytest_addoption(parser): diff --git a/python/tests/test_pythonAPI.py b/python/tests/test_pythonAPI.py index 21b5b1d8a..f906c04a4 100644 --- a/python/tests/test_pythonAPI.py +++ b/python/tests/test_pythonAPI.py @@ -18,12 +18,12 @@ def test_rx_ROI(test_with_simulators): 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 assert roi == [(0,10,0,20), (5,20,410,420)] - d.clear_rx_roi() + d.rx_clearroi() roi = d.rx_roi assert roi == [(-1,-1,-1,-1)] From a5c661ce2231dba1005fdd1bea27288d6515add8 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 19 Nov 2025 12:21:18 +0100 Subject: [PATCH 15/27] another bug for xilinx in test script --- tests/scripts/utils_for_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/scripts/utils_for_test.py b/tests/scripts/utils_for_test.py index ae9aa4559..476bc9eda 100644 --- a/tests/scripts/utils_for_test.py +++ b/tests/scripts/utils_for_test.py @@ -218,11 +218,14 @@ def loadConfig(name, rx_hostname = 'localhost', settingsdir = None, log_file_fp d.rx_hostname = rx_hostname d.udp_dstip = 'auto' + if name != "eiger": d.udp_srcip = 'auto' - if name == "jungfrau" or name == "moench" or name == "xilinx_ctb": + if name == "jungfrau" or name == "moench": d.udp_dstip2 = 'auto' + + if name == "jungfrau" or name == "moench" or name == "xilinx_ctb": d.powerchip = 1 if name == "xilinx_ctb": From 08486b98128480828bf9671697931920621c1f35 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 19 Nov 2025 16:01:17 +0100 Subject: [PATCH 16/27] rx_roi also accepts sequence of 2 ints --- RELEASE.txt | 2 +- python/slsdet/detector.py | 3 ++- python/src/typecaster.h | 13 +++++++++---- python/tests/conftest.py | 13 +++++++++++-- python/tests/test_pythonAPI.py | 30 +++++++++++++++++++++++++++++- tests/scripts/utils_for_test.py | 3 ++- 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/RELEASE.txt b/RELEASE.txt index a879bea28..f1531e3c1 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -46,7 +46,7 @@ Experimental support for building the detector client (including python bindings 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) + * receiver ROI can be set from Python using command ``rx_roi``(it supports any sequence of four or two (for mythen3 and gotthard) 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`` diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 3fd70224b..36d9a13bd 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -324,8 +324,9 @@ class Detector(CppDetectorApi): Note ----- Each ROI should be represented as a sequence of 4 ints (x_start, y_start, x_end, y_end). \n + For mythen3 or gotthard2 pass a sequence of 2 ints (x_start, x_end) \n For multiple ROI's pass a sequence of sequence \n - Example: [[0, 100, 50, 100]] \n + Example: [[0, 100, 50, 100], [260, 270, 50,100]] \n """ # TODO: maybe better to accept py::object in setRxROI and handle there? if not isinstance(rois, Sequence): diff --git a/python/src/typecaster.h b/python/src/typecaster.h index b011cebda..e32591396 100644 --- a/python/src/typecaster.h +++ b/python/src/typecaster.h @@ -100,7 +100,8 @@ template <> struct type_caster { // Type caster for sls::defs::ROI from tuple template <> struct type_caster { - PYBIND11_TYPE_CASTER(sls::defs::ROI, _("Sequence[int, int, int, int]")); + PYBIND11_TYPE_CASTER(sls::defs::ROI, _("Sequence[int, int, int, int] or " + "Sequence[int, int]")); // convert c++ ROI to python tuple static handle cast(const sls::defs::ROI &roi, return_value_policy, handle) { @@ -118,7 +119,7 @@ template <> struct type_caster { return false; } - if (seq.size() != 4) + if (seq.size() != 4 && seq.size() != 2) return false; // Check if each element is an int for (auto item : seq) { @@ -129,8 +130,12 @@ template <> struct type_caster { value.xmin = seq[0].cast(); value.xmax = seq[1].cast(); - value.ymin = seq[2].cast(); - value.ymax = seq[3].cast(); + + if (seq.size() == 4) { + value.ymin = seq[2].cast(); + value.ymax = seq[3].cast(); + } + return true; } }; diff --git a/python/tests/conftest.py b/python/tests/conftest.py index 830d257dd..18c6bf174 100644 --- a/python/tests/conftest.py +++ b/python/tests/conftest.py @@ -38,8 +38,18 @@ def pytest_collection_modifyitems(config, items): if "withdetectorsimulators" in item.keywords: item.add_marker(skip) +#helper fixture for servers @pytest.fixture -def test_with_simulators(): +def servers(request): + try: + return request.param # comes from @pytest.mark.parametrize(..., indirect=True) + except AttributeError: + # fallback default if the test did not parametrize + return ['eiger', 'jungfrau', 'mythen3', 'gotthard2', 'ctb', 'moench', 'xilinx_ctb'] + return request.param + +@pytest.fixture +def test_with_simulators(servers): """ Fixture to automatically setup virtual detector servers for testing. """ LOG_PREFIX_FNAME = '/tmp/slsDetectorPackage_virtual_PythonAPI_test' @@ -47,7 +57,6 @@ def test_with_simulators(): with open(MAIN_LOG_FNAME, 'w') as fp: try: - servers = ['moench'] nmods = 2 for server in servers: for ninterfaces in range(1,2): diff --git a/python/tests/test_pythonAPI.py b/python/tests/test_pythonAPI.py index f906c04a4..9c9782801 100644 --- a/python/tests/test_pythonAPI.py +++ b/python/tests/test_pythonAPI.py @@ -6,8 +6,19 @@ from conftest import test_with_simulators from slsdet import Detector @pytest.mark.withdetectorsimulators +@pytest.mark.parametrize("servers", [["eiger"]], indirect=True) def test_rx_ROI(test_with_simulators): - """ Test setting and getting rx_ROI property of Detector class. """ + """ Test setting and getting rx_ROI property of Detector class for moench. """ + + d = Detector() + d.rx_roi = (0, 10, 10, 20) + roi = d.rx_roi + assert roi == [(0, 10, 10, 20)] + +@pytest.mark.withdetectorsimulators +@pytest.mark.parametrize("servers", [["moench"]], indirect=True) +def test_rx_ROI_moench(test_with_simulators, servers): + """ Test setting and getting rx_ROI property of Detector class for moench. """ d = Detector() d.rx_roi = (0, 10, 10, 20) @@ -27,4 +38,21 @@ def test_rx_ROI(test_with_simulators): roi = d.rx_roi assert roi == [(-1,-1,-1,-1)] +@pytest.mark.withdetectorsimulators +@pytest.mark.parametrize("servers", [["mythen3"]], indirect=True) +def test_rx_ROI_mythen(test_with_simulators, servers): + """ Test setting and getting rx_ROI property of Detector class for mythen. """ + + d = Detector() + d.rx_roi = (0, 10) + roi = d.rx_roi + assert roi == [(0, 10, -1, -1)] + + #d.rx_roi = [[5,15, 0, 1]] # not allowed for mythen3 + + d.rx_roi = [0,10, -1, -1] + + assert d.rx_roi == [(0,10,-1,-1)] + + diff --git a/tests/scripts/utils_for_test.py b/tests/scripts/utils_for_test.py index 476bc9eda..f73e819b8 100644 --- a/tests/scripts/utils_for_test.py +++ b/tests/scripts/utils_for_test.py @@ -217,6 +217,7 @@ def loadConfig(name, rx_hostname = 'localhost', settingsdir = None, log_file_fp d.udp_dstport2 = DEFAULT_UDP_DST_PORTNO + 1 d.rx_hostname = rx_hostname + d.udp_dstip = 'auto' if name != "eiger": @@ -235,7 +236,7 @@ def loadConfig(name, rx_hostname = 'localhost', settingsdir = None, log_file_fp d.settingspath = settingsdir + '/' + name + '/' d.trimen = [4500, 5400, 6400] if name == 'eiger' else [4000, 6000, 8000, 12000] d.setThresholdEnergy(4500, detectorSettings.STANDARD) - + d.frames = num_frames except Exception as e: From 30e82e474012777da8ee3ea43c6e1caebf4298a6 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 19 Nov 2025 17:19:51 +0100 Subject: [PATCH 17/27] removed tests for eiger --- python/tests/test_pythonAPI.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/python/tests/test_pythonAPI.py b/python/tests/test_pythonAPI.py index 9c9782801..3c5d40d9b 100644 --- a/python/tests/test_pythonAPI.py +++ b/python/tests/test_pythonAPI.py @@ -5,16 +5,6 @@ from conftest import test_with_simulators from slsdet import Detector -@pytest.mark.withdetectorsimulators -@pytest.mark.parametrize("servers", [["eiger"]], indirect=True) -def test_rx_ROI(test_with_simulators): - """ Test setting and getting rx_ROI property of Detector class for moench. """ - - d = Detector() - d.rx_roi = (0, 10, 10, 20) - roi = d.rx_roi - assert roi == [(0, 10, 10, 20)] - @pytest.mark.withdetectorsimulators @pytest.mark.parametrize("servers", [["moench"]], indirect=True) def test_rx_ROI_moench(test_with_simulators, servers): From 683accd9148cc17147e8e0edc1fdb58ad475a1b4 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 26 Nov 2025 14:04:55 +0100 Subject: [PATCH 18/27] fix unsuccesful merge in RELEASE.txt --- RELEASE.txt | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/RELEASE.txt b/RELEASE.txt index f1531e3c1..b56b0dacf 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -33,36 +33,7 @@ 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 instead of the one included in our repo. -<<<<<<< HEAD:RELEASE.txt 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 or two (for mythen3 and gotthard) 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 ========================================== From b90851a8552a2e5ce9c44bf94f4df483f06621ca Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 26 Nov 2025 14:15:04 +0100 Subject: [PATCH 19/27] clang-format 12 --- python/src/detector.cpp | 563 ++++++++++++++++++++-------------------- 1 file changed, 284 insertions(+), 279 deletions(-) diff --git a/python/src/detector.cpp b/python/src/detector.cpp index be166480f..c0fedc1b1 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -32,15 +32,15 @@ void init_det(py::module &m) { CppDetectorApi.def(py::init()); CppDetectorApi.def("loadConfig", - (void(Detector::*)(const std::string &)) & + (void (Detector::*)(const std::string &)) & Detector::loadConfig, py::arg()); CppDetectorApi.def("loadParameters", - (void(Detector::*)(const std::string &)) & + (void (Detector::*)(const std::string &)) & Detector::loadParameters, py::arg()); CppDetectorApi.def("loadParameters", - (void(Detector::*)(const std::vector &)) & + (void (Detector::*)(const std::vector &)) & Detector::loadParameters, py::arg()); CppDetectorApi.def( @@ -49,15 +49,15 @@ void init_det(py::module &m) { Detector::getHostname, py::arg() = Positions{}); CppDetectorApi.def("setHostname", - (void(Detector::*)(const std::vector &)) & + (void (Detector::*)(const std::vector &)) & Detector::setHostname, py::arg()); CppDetectorApi.def("setVirtualDetectorServers", - (void(Detector::*)(int, uint16_t)) & + (void (Detector::*)(int, uint16_t)) & Detector::setVirtualDetectorServers, py::arg(), py::arg()); CppDetectorApi.def("getShmId", - (int(Detector::*)() const) & Detector::getShmId); + (int (Detector::*)() const) & Detector::getShmId); CppDetectorApi.def("getPackageVersion", (std::string(Detector::*)() const) & Detector::getPackageVersion); CppDetectorApi.def("getClientVersion", (std::string(Detector::*)() const) & @@ -104,8 +104,8 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getDetectorType, py::arg() = Positions{}); - CppDetectorApi.def("size", (int(Detector::*)() const) & Detector::size); - CppDetectorApi.def("empty", (bool(Detector::*)() const) & Detector::empty); + CppDetectorApi.def("size", (int (Detector::*)() const) & Detector::size); + CppDetectorApi.def("empty", (bool (Detector::*)() const) & Detector::empty); CppDetectorApi.def("getModuleGeometry", (defs::xy(Detector::*)() const) & Detector::getModuleGeometry); CppDetectorApi.def("getModuleSize", @@ -122,7 +122,7 @@ void init_det(py::module &m) { CppDetectorApi.def("getDetectorSize", (defs::xy(Detector::*)() const) & Detector::getDetectorSize); CppDetectorApi.def("setDetectorSize", - (void(Detector::*)(const defs::xy)) & + (void (Detector::*)(const defs::xy)) & Detector::setDetectorSize, py::arg()); CppDetectorApi.def("getSettingsList", (std::vector( @@ -135,7 +135,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setSettings", - (void(Detector::*)(defs::detectorSettings, sls::Positions)) & + (void (Detector::*)(defs::detectorSettings, sls::Positions)) & Detector::setSettings, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getThresholdEnergy", @@ -147,16 +147,16 @@ void init_det(py::module &m) { (Result>(Detector::*)(sls::Positions) const) & Detector::getAllThresholdEnergy, py::arg() = Positions{}); + CppDetectorApi.def("setThresholdEnergy", + (void (Detector::*)(int, defs::detectorSettings, bool, + sls::Positions)) & + Detector::setThresholdEnergy, + py::arg(), py::arg() = defs::STANDARD, py::arg() = true, + py::arg() = Positions{}); CppDetectorApi.def( "setThresholdEnergy", - (void(Detector::*)(int, defs::detectorSettings, bool, sls::Positions)) & - Detector::setThresholdEnergy, - py::arg(), py::arg() = defs::STANDARD, py::arg() = true, - py::arg() = Positions{}); - CppDetectorApi.def( - "setThresholdEnergy", - (void(Detector::*)(std::array, defs::detectorSettings, bool, - sls::Positions)) & + (void (Detector::*)(std::array, defs::detectorSettings, bool, + sls::Positions)) & Detector::setThresholdEnergy, py::arg(), py::arg() = defs::STANDARD, py::arg() = true, py::arg() = Positions{}); @@ -167,17 +167,17 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setSettingsPath", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setSettingsPath, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "loadTrimbits", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::loadTrimbits, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "saveTrimbits", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::saveTrimbits, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAllTrimbits", @@ -185,7 +185,7 @@ void init_det(py::module &m) { Detector::getAllTrimbits, py::arg() = Positions{}); CppDetectorApi.def("setAllTrimbits", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setAllTrimbits, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -194,14 +194,14 @@ void init_det(py::module &m) { Detector::getTrimEnergies, py::arg() = Positions{}); CppDetectorApi.def("setTrimEnergies", - (void(Detector::*)(std::vector, sls::Positions)) & + (void (Detector::*)(std::vector, sls::Positions)) & Detector::setTrimEnergies, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getGapPixelsinCallback", - (bool(Detector::*)() const) & + (bool (Detector::*)() const) & Detector::getGapPixelsinCallback); CppDetectorApi.def("setGapPixelsinCallback", - (void(Detector::*)(const bool)) & + (void (Detector::*)(const bool)) & Detector::setGapPixelsinCallback, py::arg()); CppDetectorApi.def("getFlipRows", @@ -209,7 +209,7 @@ void init_det(py::module &m) { Detector::getFlipRows, py::arg() = Positions{}); CppDetectorApi.def("setFlipRows", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setFlipRows, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaster", @@ -217,23 +217,23 @@ void init_det(py::module &m) { Detector::getMaster, py::arg() = Positions{}); CppDetectorApi.def("setMaster", - (void(Detector::*)(bool, int)) & Detector::setMaster, + (void (Detector::*)(bool, int)) & Detector::setMaster, py::arg(), py::arg()); CppDetectorApi.def("getSynchronization", (Result(Detector::*)(sls::Positions) const) & Detector::getSynchronization, py::arg() = Positions{}); - CppDetectorApi.def("setSynchronization", - (void(Detector::*)(bool)) & Detector::setSynchronization, - py::arg()); + CppDetectorApi.def( + "setSynchronization", + (void (Detector::*)(bool)) & Detector::setSynchronization, py::arg()); CppDetectorApi.def( "getBadChannels", - (void(Detector::*)(const std::string &, sls::Positions) const) & + (void (Detector::*)(const std::string &, sls::Positions) const) & Detector::getBadChannels, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setBadChannels", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setBadChannels, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -243,12 +243,12 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setBadChannels", - (void(Detector::*)(const std::vector, sls::Positions)) & + (void (Detector::*)(const std::vector, sls::Positions)) & Detector::setBadChannels, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setBadChannels", - (void(Detector::*)(const std::vector>)) & + (void (Detector::*)(const std::vector>)) & Detector::setBadChannels, py::arg()); CppDetectorApi.def("getRow", @@ -256,7 +256,7 @@ void init_det(py::module &m) { Detector::getRow, py::arg() = Positions{}); CppDetectorApi.def("setRow", - (void(Detector::*)(const int, sls::Positions)) & + (void (Detector::*)(const int, sls::Positions)) & Detector::setRow, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getColumn", @@ -264,7 +264,7 @@ void init_det(py::module &m) { Detector::getColumn, py::arg() = Positions{}); CppDetectorApi.def("setColumn", - (void(Detector::*)(const int, sls::Positions)) & + (void (Detector::*)(const int, sls::Positions)) & Detector::setColumn, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("isVirtualDetectorServer", @@ -273,13 +273,13 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "registerAcquisitionFinishedCallback", - (void(Detector::*)(void (*)(double, int, void *), void *)) & + (void (Detector::*)(void (*)(double, int, void *), void *)) & Detector::registerAcquisitionFinishedCallback, py::arg(), py::arg()); CppDetectorApi.def("registerDataCallback", - (void(Detector::*)(void (*)(sls::detectorData *, - uint64_t, uint32_t, void *), - void *)) & + (void (Detector::*)(void (*)(sls::detectorData *, + uint64_t, uint32_t, void *), + void *)) & Detector::registerDataCallback, py::arg(), py::arg()); CppDetectorApi.def("getNumberOfFrames", @@ -288,13 +288,13 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setNumberOfFrames", - (void(Detector::*)(int64_t)) & Detector::setNumberOfFrames, py::arg()); + (void (Detector::*)(int64_t)) & Detector::setNumberOfFrames, py::arg()); CppDetectorApi.def("getNumberOfTriggers", (Result(Detector::*)(sls::Positions) const) & Detector::getNumberOfTriggers, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfTriggers", - (void(Detector::*)(int64_t)) & + (void (Detector::*)(int64_t)) & Detector::setNumberOfTriggers, py::arg()); CppDetectorApi.def("getExptime", @@ -302,7 +302,7 @@ void init_det(py::module &m) { Detector::getExptime, py::arg() = Positions{}); CppDetectorApi.def("setExptime", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setExptime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPeriod", @@ -310,7 +310,7 @@ void init_det(py::module &m) { Detector::getPeriod, py::arg() = Positions{}); CppDetectorApi.def("setPeriod", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setPeriod, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDelayAfterTrigger", @@ -318,7 +318,7 @@ void init_det(py::module &m) { Detector::getDelayAfterTrigger, py::arg() = Positions{}); CppDetectorApi.def("setDelayAfterTrigger", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setDelayAfterTrigger, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfFramesLeft", @@ -342,7 +342,7 @@ void init_det(py::module &m) { Detector::getDynamicRange, py::arg() = Positions{}); CppDetectorApi.def("setDynamicRange", - (void(Detector::*)(int)) & Detector::setDynamicRange, + (void (Detector::*)(int)) & Detector::setDynamicRange, py::arg()); CppDetectorApi.def("getDynamicRangeList", (std::vector(Detector::*)() const) & @@ -353,7 +353,7 @@ void init_det(py::module &m) { Detector::getTimingMode, py::arg() = Positions{}); CppDetectorApi.def("setTimingMode", - (void(Detector::*)(defs::timingMode, sls::Positions)) & + (void (Detector::*)(defs::timingMode, sls::Positions)) & Detector::setTimingMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTimingModeList", @@ -365,7 +365,7 @@ void init_det(py::module &m) { Detector::getReadoutSpeed, py::arg() = Positions{}); CppDetectorApi.def("setReadoutSpeed", - (void(Detector::*)(defs::speedLevel, sls::Positions)) & + (void (Detector::*)(defs::speedLevel, sls::Positions)) & Detector::setReadoutSpeed, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getReadoutSpeedList", @@ -376,7 +376,7 @@ void init_det(py::module &m) { Detector::getADCPhase, py::arg() = Positions{}); CppDetectorApi.def("setADCPhase", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setADCPhase, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaxADCPhaseShift", @@ -388,7 +388,7 @@ void init_det(py::module &m) { Detector::getADCPhaseInDegrees, py::arg() = Positions{}); CppDetectorApi.def("setADCPhaseInDegrees", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setADCPhaseInDegrees, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITPhase", @@ -396,7 +396,7 @@ void init_det(py::module &m) { Detector::getDBITPhase, py::arg() = Positions{}); CppDetectorApi.def("setDBITPhase", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setDBITPhase, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaxDBITPhaseShift", @@ -408,7 +408,7 @@ void init_det(py::module &m) { Detector::getDBITPhaseInDegrees, py::arg() = Positions{}); CppDetectorApi.def("setDBITPhaseInDegrees", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setDBITPhaseInDegrees, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getClockFrequency", @@ -420,7 +420,7 @@ void init_det(py::module &m) { Detector::getClockPhase, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setClockPhase", - (void(Detector::*)(int, int, sls::Positions)) & + (void (Detector::*)(int, int, sls::Positions)) & Detector::setClockPhase, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMaxClockPhaseShift", @@ -432,7 +432,7 @@ void init_det(py::module &m) { Detector::getClockPhaseinDegrees, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setClockPhaseinDegrees", - (void(Detector::*)(int, int, sls::Positions)) & + (void (Detector::*)(int, int, sls::Positions)) & Detector::setClockPhaseinDegrees, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getClockDivider", @@ -440,7 +440,7 @@ void init_det(py::module &m) { Detector::getClockDivider, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setClockDivider", - (void(Detector::*)(int, int, sls::Positions)) & + (void (Detector::*)(int, int, sls::Positions)) & Detector::setClockDivider, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getHighVoltage", @@ -448,7 +448,7 @@ void init_det(py::module &m) { Detector::getHighVoltage, py::arg() = Positions{}); CppDetectorApi.def("setHighVoltage", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setHighVoltage, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPowerChip", @@ -456,7 +456,7 @@ void init_det(py::module &m) { Detector::getPowerChip, py::arg() = Positions{}); CppDetectorApi.def("setPowerChip", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setPowerChip, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getImageTestMode", @@ -464,7 +464,7 @@ void init_det(py::module &m) { Detector::getImageTestMode, py::arg() = Positions{}); CppDetectorApi.def("setImageTestMode", - (void(Detector::*)(const int, sls::Positions)) & + (void (Detector::*)(const int, sls::Positions)) & Detector::setImageTestMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTemperatureList", @@ -485,7 +485,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setDefaultDac", - (void(Detector::*)(defs::dacIndex, int, sls::Positions)) & + (void (Detector::*)(defs::dacIndex, int, sls::Positions)) & Detector::setDefaultDac, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -496,12 +496,12 @@ void init_det(py::module &m) { py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setDefaultDac", - (void(Detector::*)(defs::dacIndex, int, defs::detectorSettings, - sls::Positions)) & + (void (Detector::*)(defs::dacIndex, int, defs::detectorSettings, + sls::Positions)) & Detector::setDefaultDac, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("resetToDefaultDacs", - (void(Detector::*)(const bool, sls::Positions)) & + (void (Detector::*)(const bool, sls::Positions)) & Detector::resetToDefaultDacs, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -511,7 +511,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "setDAC", - (void(Detector::*)(defs::dacIndex, int, bool, sls::Positions)) & + (void (Detector::*)(defs::dacIndex, int, bool, sls::Positions)) & Detector::setDAC, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -521,7 +521,7 @@ void init_det(py::module &m) { py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setOnChipDAC", - (void(Detector::*)(defs::dacIndex, int, int, sls::Positions)) & + (void (Detector::*)(defs::dacIndex, int, int, sls::Positions)) & Detector::setOnChipDAC, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getExternalSignalFlags", @@ -531,7 +531,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setExternalSignalFlags", - (void(Detector::*)(int, defs::externalSignalFlag, sls::Positions)) & + (void (Detector::*)(int, defs::externalSignalFlag, sls::Positions)) & Detector::setExternalSignalFlags, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getParallelMode", @@ -539,7 +539,7 @@ void init_det(py::module &m) { Detector::getParallelMode, py::arg() = Positions{}); CppDetectorApi.def("setParallelMode", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setParallelMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getFilterResistor", @@ -547,7 +547,7 @@ void init_det(py::module &m) { Detector::getFilterResistor, py::arg() = Positions{}); CppDetectorApi.def("setFilterResistor", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setFilterResistor, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getCurrentSource", @@ -557,7 +557,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setCurrentSource", - (void(Detector::*)(defs::currentSrcParameters, sls::Positions)) & + (void (Detector::*)(defs::currentSrcParameters, sls::Positions)) & Detector::setCurrentSource, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITPipeline", @@ -565,7 +565,7 @@ void init_det(py::module &m) { Detector::getDBITPipeline, py::arg() = Positions{}); CppDetectorApi.def("setDBITPipeline", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setDBITPipeline, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getReadNRows", @@ -573,24 +573,24 @@ void init_det(py::module &m) { Detector::getReadNRows, py::arg() = Positions{}); CppDetectorApi.def("setReadNRows", - (void(Detector::*)(const int, sls::Positions)) & + (void (Detector::*)(const int, sls::Positions)) & Detector::setReadNRows, py::arg(), py::arg() = Positions{}); - CppDetectorApi.def("acquire", (void(Detector::*)()) & Detector::acquire); + CppDetectorApi.def("acquire", (void (Detector::*)()) & Detector::acquire); CppDetectorApi.def("clearAcquiringFlag", - (void(Detector::*)()) & Detector::clearAcquiringFlag); + (void (Detector::*)()) & Detector::clearAcquiringFlag); CppDetectorApi.def("startReceiver", - (void(Detector::*)()) & Detector::startReceiver); + (void (Detector::*)()) & Detector::startReceiver); CppDetectorApi.def("stopReceiver", - (void(Detector::*)()) & Detector::stopReceiver); + (void (Detector::*)()) & Detector::stopReceiver); CppDetectorApi.def("startDetector", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::startDetector, py::arg() = Positions{}); CppDetectorApi.def("startDetectorReadout", - (void(Detector::*)()) & Detector::startDetectorReadout); + (void (Detector::*)()) & Detector::startDetectorReadout); CppDetectorApi.def("stopDetector", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::stopDetector, py::arg() = Positions{}); CppDetectorApi.def( @@ -623,11 +623,11 @@ void init_det(py::module &m) { Detector::getNextFrameNumber, py::arg() = Positions{}); CppDetectorApi.def("setNextFrameNumber", - (void(Detector::*)(uint64_t, sls::Positions)) & + (void (Detector::*)(uint64_t, sls::Positions)) & Detector::setNextFrameNumber, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("sendSoftwareTrigger", - (void(Detector::*)(const bool, sls::Positions)) & + (void (Detector::*)(const bool, sls::Positions)) & Detector::sendSoftwareTrigger, py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -636,7 +636,7 @@ void init_det(py::module &m) { Detector::getScan, py::arg() = Positions{}); CppDetectorApi.def("setScan", - (void(Detector::*)(const defs::scanParameters)) & + (void (Detector::*)(const defs::scanParameters)) & Detector::setScan, py::arg()); CppDetectorApi.def( @@ -649,7 +649,7 @@ void init_det(py::module &m) { Detector::getNumberofUDPInterfaces, py::arg() = Positions{}); CppDetectorApi.def("setNumberofUDPInterfaces", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setNumberofUDPInterfaces, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSelectedUDPInterface", @@ -657,7 +657,7 @@ void init_det(py::module &m) { Detector::getSelectedUDPInterface, py::arg() = Positions{}); CppDetectorApi.def("selectUDPInterface", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::selectUDPInterface, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -666,7 +666,7 @@ void init_det(py::module &m) { Detector::getSourceUDPIP, py::arg() = Positions{}); CppDetectorApi.def("setSourceUDPIP", - (void(Detector::*)(const sls::IpAddr, sls::Positions)) & + (void (Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setSourceUDPIP, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -675,7 +675,7 @@ void init_det(py::module &m) { Detector::getSourceUDPIP2, py::arg() = Positions{}); CppDetectorApi.def("setSourceUDPIP2", - (void(Detector::*)(const sls::IpAddr, sls::Positions)) & + (void (Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setSourceUDPIP2, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -683,19 +683,21 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getSourceUDPMAC, py::arg() = Positions{}); - CppDetectorApi.def("setSourceUDPMAC", - (void(Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setSourceUDPMAC, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def( + "setSourceUDPMAC", + (void (Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setSourceUDPMAC, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getSourceUDPMAC2", (Result(Detector::*)(sls::Positions) const) & Detector::getSourceUDPMAC2, py::arg() = Positions{}); - CppDetectorApi.def("setSourceUDPMAC2", - (void(Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setSourceUDPMAC2, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def( + "setSourceUDPMAC2", + (void (Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setSourceUDPMAC2, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDestinationUDPList", (Result(Detector::*)( const uint32_t, sls::Positions) const) & @@ -703,7 +705,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setDestinationUDPList", - (void(Detector::*)(const sls::UdpDestination, const int)) & + (void (Detector::*)(const sls::UdpDestination, const int)) & Detector::setDestinationUDPList, py::arg(), py::arg()); CppDetectorApi.def("getNumberofUDPDestinations", @@ -711,7 +713,7 @@ void init_det(py::module &m) { Detector::getNumberofUDPDestinations, py::arg() = Positions{}); CppDetectorApi.def("clearUDPDestinations", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::clearUDPDestinations, py::arg() = Positions{}); CppDetectorApi.def("getFirstUDPDestination", @@ -719,7 +721,7 @@ void init_det(py::module &m) { Detector::getFirstUDPDestination, py::arg() = Positions{}); CppDetectorApi.def("setFirstUDPDestination", - (void(Detector::*)(const int, sls::Positions)) & + (void (Detector::*)(const int, sls::Positions)) & Detector::setFirstUDPDestination, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -728,7 +730,7 @@ void init_det(py::module &m) { Detector::getDestinationUDPIP, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPIP", - (void(Detector::*)(const sls::IpAddr, sls::Positions)) & + (void (Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setDestinationUDPIP, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -737,7 +739,7 @@ void init_det(py::module &m) { Detector::getDestinationUDPIP2, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPIP2", - (void(Detector::*)(const sls::IpAddr, sls::Positions)) & + (void (Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setDestinationUDPIP2, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -745,25 +747,27 @@ void init_det(py::module &m) { (Result(Detector::*)(sls::Positions) const) & Detector::getDestinationUDPMAC, py::arg() = Positions{}); - CppDetectorApi.def("setDestinationUDPMAC", - (void(Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setDestinationUDPMAC, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def( + "setDestinationUDPMAC", + (void (Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setDestinationUDPMAC, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getDestinationUDPMAC2", (Result(Detector::*)(sls::Positions) const) & Detector::getDestinationUDPMAC2, py::arg() = Positions{}); - CppDetectorApi.def("setDestinationUDPMAC2", - (void(Detector::*)(const sls::MacAddr, sls::Positions)) & - Detector::setDestinationUDPMAC2, - py::arg(), py::arg() = Positions{}); + CppDetectorApi.def( + "setDestinationUDPMAC2", + (void (Detector::*)(const sls::MacAddr, sls::Positions)) & + Detector::setDestinationUDPMAC2, + py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDestinationUDPPort", (Result(Detector::*)(sls::Positions) const) & Detector::getDestinationUDPPort, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPPort", - (void(Detector::*)(uint16_t, int)) & + (void (Detector::*)(uint16_t, int)) & Detector::setDestinationUDPPort, py::arg(), py::arg() = -1); CppDetectorApi.def("getDestinationUDPPort2", @@ -771,15 +775,15 @@ void init_det(py::module &m) { Detector::getDestinationUDPPort2, py::arg() = Positions{}); CppDetectorApi.def("setDestinationUDPPort2", - (void(Detector::*)(uint16_t, int)) & + (void (Detector::*)(uint16_t, int)) & Detector::setDestinationUDPPort2, py::arg(), py::arg() = -1); CppDetectorApi.def("reconfigureUDPDestination", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::reconfigureUDPDestination, py::arg() = Positions{}); CppDetectorApi.def("validateUDPConfiguration", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::validateUDPConfiguration, py::arg() = Positions{}); CppDetectorApi.def( @@ -792,7 +796,7 @@ void init_det(py::module &m) { Detector::getTenGiga, py::arg() = Positions{}); CppDetectorApi.def("setTenGiga", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setTenGiga, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTenGigaFlowControl", @@ -800,7 +804,7 @@ void init_det(py::module &m) { Detector::getTenGigaFlowControl, py::arg() = Positions{}); CppDetectorApi.def("setTenGigaFlowControl", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setTenGigaFlowControl, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelayFrame", @@ -808,7 +812,7 @@ void init_det(py::module &m) { Detector::getTransmissionDelayFrame, py::arg() = Positions{}); CppDetectorApi.def("setTransmissionDelayFrame", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setTransmissionDelayFrame, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelayLeft", @@ -816,7 +820,7 @@ void init_det(py::module &m) { Detector::getTransmissionDelayLeft, py::arg() = Positions{}); CppDetectorApi.def("setTransmissionDelayLeft", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setTransmissionDelayLeft, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelayRight", @@ -824,15 +828,15 @@ void init_det(py::module &m) { Detector::getTransmissionDelayRight, py::arg() = Positions{}); CppDetectorApi.def("setTransmissionDelayRight", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setTransmissionDelayRight, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransmissionDelay", - (int(Detector::*)() const) & + (int (Detector::*)() const) & Detector::getTransmissionDelay); CppDetectorApi.def( "setTransmissionDelay", - (void(Detector::*)(int)) & Detector::setTransmissionDelay, py::arg()); + (void (Detector::*)(int)) & Detector::setTransmissionDelay, py::arg()); CppDetectorApi.def("getUseReceiverFlag", (Result(Detector::*)(sls::Positions) const) & Detector::getUseReceiverFlag, @@ -844,26 +848,26 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setRxHostname", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setRxHostname, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setRxHostname", - (void(Detector::*)(const std::vector &)) & + (void (Detector::*)(const std::vector &)) & Detector::setRxHostname, py::arg()); CppDetectorApi.def("getRxPort", (Result(Detector::*)(sls::Positions) const) & Detector::getRxPort, py::arg() = Positions{}); - CppDetectorApi.def("setRxPort", - (void(Detector::*)(uint16_t, int)) & Detector::setRxPort, - py::arg(), py::arg() = -1); + CppDetectorApi.def( + "setRxPort", (void (Detector::*)(uint16_t, int)) & Detector::setRxPort, + py::arg(), py::arg() = -1); CppDetectorApi.def("getRxFifoDepth", (Result(Detector::*)(sls::Positions) const) & Detector::getRxFifoDepth, py::arg() = Positions{}); CppDetectorApi.def("setRxFifoDepth", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxFifoDepth, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxSilentMode", @@ -871,7 +875,7 @@ void init_det(py::module &m) { Detector::getRxSilentMode, py::arg() = Positions{}); CppDetectorApi.def("setRxSilentMode", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setRxSilentMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -881,7 +885,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setRxFrameDiscardPolicy", - (void(Detector::*)(defs::frameDiscardPolicy, sls::Positions)) & + (void (Detector::*)(defs::frameDiscardPolicy, sls::Positions)) & Detector::setRxFrameDiscardPolicy, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPartialFramesPadding", @@ -889,7 +893,7 @@ void init_det(py::module &m) { Detector::getPartialFramesPadding, py::arg() = Positions{}); CppDetectorApi.def("setPartialFramesPadding", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setPartialFramesPadding, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxUDPSocketBufferSize", @@ -897,7 +901,7 @@ void init_det(py::module &m) { Detector::getRxUDPSocketBufferSize, py::arg() = Positions{}); CppDetectorApi.def("setRxUDPSocketBufferSize", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxUDPSocketBufferSize, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxRealUDPSocketBufferSize", @@ -909,7 +913,7 @@ void init_det(py::module &m) { Detector::getRxLock, py::arg() = Positions{}); CppDetectorApi.def("setRxLock", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setRxLock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -927,7 +931,7 @@ void init_det(py::module &m) { Detector::getRxArping, py::arg() = Positions{}); CppDetectorApi.def("setRxArping", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setRxArping, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxROI", @@ -935,19 +939,19 @@ void init_det(py::module &m) { Detector::getRxROI, py::arg() = -1); CppDetectorApi.def("setRxROI", - (void(Detector::*)(const std::vector &)) & + (void (Detector::*)(const std::vector &)) & Detector::setRxROI, py::arg()); CppDetectorApi.def("clearRxROI", - (void(Detector::*)()) & Detector::clearRxROI); + (void (Detector::*)()) & Detector::clearRxROI); CppDetectorApi.def( "getFileFormat", (Result(Detector::*)(sls::Positions) const) & Detector::getFileFormat, py::arg() = Positions{}); CppDetectorApi.def("setFileFormat", - (void(Detector::*)(defs::fileFormat, sls::Positions)) & + (void (Detector::*)(defs::fileFormat, sls::Positions)) & Detector::setFileFormat, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -957,7 +961,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setFilePath", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setFilePath, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -967,7 +971,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setFileNamePrefix", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setFileNamePrefix, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAcquisitionIndex", @@ -975,7 +979,7 @@ void init_det(py::module &m) { Detector::getAcquisitionIndex, py::arg() = Positions{}); CppDetectorApi.def("setAcquisitionIndex", - (void(Detector::*)(int64_t, sls::Positions)) & + (void (Detector::*)(int64_t, sls::Positions)) & Detector::setAcquisitionIndex, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getFileWrite", @@ -983,20 +987,20 @@ void init_det(py::module &m) { Detector::getFileWrite, py::arg() = Positions{}); CppDetectorApi.def("setFileWrite", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setFileWrite, py::arg(), py::arg() = Positions{}); - CppDetectorApi.def("getMasterFileWrite", (bool(Detector::*)() const) & + CppDetectorApi.def("getMasterFileWrite", (bool (Detector::*)() const) & Detector::getMasterFileWrite); - CppDetectorApi.def("setMasterFileWrite", - (void(Detector::*)(bool)) & Detector::setMasterFileWrite, - py::arg()); + CppDetectorApi.def( + "setMasterFileWrite", + (void (Detector::*)(bool)) & Detector::setMasterFileWrite, py::arg()); CppDetectorApi.def("getFileOverWrite", (Result(Detector::*)(sls::Positions) const) & Detector::getFileOverWrite, py::arg() = Positions{}); CppDetectorApi.def("setFileOverWrite", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setFileOverWrite, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getFramesPerFile", @@ -1004,7 +1008,7 @@ void init_det(py::module &m) { Detector::getFramesPerFile, py::arg() = Positions{}); CppDetectorApi.def("setFramesPerFile", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setFramesPerFile, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqDataStream", @@ -1012,7 +1016,7 @@ void init_det(py::module &m) { Detector::getRxZmqDataStream, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqDataStream", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setRxZmqDataStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqFrequency", @@ -1020,7 +1024,7 @@ void init_det(py::module &m) { Detector::getRxZmqFrequency, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqFrequency", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxZmqFrequency, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqTimer", @@ -1028,7 +1032,7 @@ void init_det(py::module &m) { Detector::getRxZmqTimer, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqTimer", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxZmqTimer, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqStartingFrame", @@ -1036,7 +1040,7 @@ void init_det(py::module &m) { Detector::getRxZmqStartingFrame, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqStartingFrame", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxZmqStartingFrame, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxZmqPort", @@ -1044,7 +1048,7 @@ void init_det(py::module &m) { Detector::getRxZmqPort, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqPort", - (void(Detector::*)(uint16_t, int)) & + (void (Detector::*)(uint16_t, int)) & Detector::setRxZmqPort, py::arg(), py::arg() = -1); CppDetectorApi.def("getClientZmqPort", @@ -1052,7 +1056,7 @@ void init_det(py::module &m) { Detector::getClientZmqPort, py::arg() = Positions{}); CppDetectorApi.def("setClientZmqPort", - (void(Detector::*)(uint16_t, int)) & + (void (Detector::*)(uint16_t, int)) & Detector::setClientZmqPort, py::arg(), py::arg() = -1); CppDetectorApi.def( @@ -1061,27 +1065,27 @@ void init_det(py::module &m) { Detector::getClientZmqIp, py::arg() = Positions{}); CppDetectorApi.def("setClientZmqIp", - (void(Detector::*)(const sls::IpAddr, sls::Positions)) & + (void (Detector::*)(const sls::IpAddr, sls::Positions)) & Detector::setClientZmqIp, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getClientZmqHwm", - (int(Detector::*)() const) & Detector::getClientZmqHwm); + (int (Detector::*)() const) & Detector::getClientZmqHwm); CppDetectorApi.def( "setClientZmqHwm", - (void(Detector::*)(const int)) & Detector::setClientZmqHwm, py::arg()); + (void (Detector::*)(const int)) & Detector::setClientZmqHwm, py::arg()); CppDetectorApi.def("getRxZmqHwm", (Result(Detector::*)(sls::Positions) const) & Detector::getRxZmqHwm, py::arg() = Positions{}); CppDetectorApi.def("setRxZmqHwm", - (void(Detector::*)(const int)) & Detector::setRxZmqHwm, + (void (Detector::*)(const int)) & Detector::setRxZmqHwm, py::arg()); CppDetectorApi.def("getSubExptime", (Result(Detector::*)(sls::Positions) const) & Detector::getSubExptime, py::arg() = Positions{}); CppDetectorApi.def("setSubExptime", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setSubExptime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSubDeadTime", @@ -1089,7 +1093,7 @@ void init_det(py::module &m) { Detector::getSubDeadTime, py::arg() = Positions{}); CppDetectorApi.def("setSubDeadTime", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setSubDeadTime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getOverFlowMode", @@ -1097,7 +1101,7 @@ void init_det(py::module &m) { Detector::getOverFlowMode, py::arg() = Positions{}); CppDetectorApi.def("setOverFlowMode", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setOverFlowMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRateCorrection", @@ -1105,11 +1109,11 @@ void init_det(py::module &m) { Detector::getRateCorrection, py::arg() = Positions{}); CppDetectorApi.def("setDefaultRateCorrection", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::setDefaultRateCorrection, py::arg() = Positions{}); CppDetectorApi.def("setRateCorrection", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setRateCorrection, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getInterruptSubframe", @@ -1117,7 +1121,7 @@ void init_det(py::module &m) { Detector::getInterruptSubframe, py::arg() = Positions{}); CppDetectorApi.def("setInterruptSubframe", - (void(Detector::*)(const bool, sls::Positions)) & + (void (Detector::*)(const bool, sls::Positions)) & Detector::setInterruptSubframe, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getMeasuredPeriod", @@ -1133,7 +1137,7 @@ void init_det(py::module &m) { Detector::getActive, py::arg() = Positions{}); CppDetectorApi.def("setActive", - (void(Detector::*)(const bool, sls::Positions)) & + (void (Detector::*)(const bool, sls::Positions)) & Detector::setActive, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPartialReset", @@ -1141,19 +1145,19 @@ void init_det(py::module &m) { Detector::getPartialReset, py::arg() = Positions{}); CppDetectorApi.def("setPartialReset", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setPartialReset, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("pulsePixel", - (void(Detector::*)(int, defs::xy, sls::Positions)) & + (void (Detector::*)(int, defs::xy, sls::Positions)) & Detector::pulsePixel, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("pulsePixelNMove", - (void(Detector::*)(int, defs::xy, sls::Positions)) & + (void (Detector::*)(int, defs::xy, sls::Positions)) & Detector::pulsePixelNMove, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("pulseChip", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::pulseChip, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getQuad", @@ -1161,7 +1165,7 @@ void init_det(py::module &m) { Detector::getQuad, py::arg() = Positions{}); CppDetectorApi.def("setQuad", - (void(Detector::*)(const bool)) & Detector::setQuad, + (void (Detector::*)(const bool)) & Detector::setQuad, py::arg()); CppDetectorApi.def("getDataStream", (Result(Detector::*)(const defs::portPosition, @@ -1169,8 +1173,8 @@ void init_det(py::module &m) { Detector::getDataStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setDataStream", - (void(Detector::*)(const defs::portPosition, const bool, - sls::Positions)) & + (void (Detector::*)(const defs::portPosition, const bool, + sls::Positions)) & Detector::setDataStream, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTop", @@ -1178,7 +1182,7 @@ void init_det(py::module &m) { Detector::getTop, py::arg() = Positions{}); CppDetectorApi.def( - "setTop", (void(Detector::*)(bool, sls::Positions)) & Detector::setTop, + "setTop", (void (Detector::*)(bool, sls::Positions)) & Detector::setTop, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getChipVersion", (Result(Detector::*)(sls::Positions) const) & @@ -1189,7 +1193,7 @@ void init_det(py::module &m) { Detector::getThresholdTemperature, py::arg() = Positions{}); CppDetectorApi.def("setThresholdTemperature", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setThresholdTemperature, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTemperatureControl", @@ -1197,7 +1201,7 @@ void init_det(py::module &m) { Detector::getTemperatureControl, py::arg() = Positions{}); CppDetectorApi.def("setTemperatureControl", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setTemperatureControl, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTemperatureEvent", @@ -1205,7 +1209,7 @@ void init_det(py::module &m) { Detector::getTemperatureEvent, py::arg() = Positions{}); CppDetectorApi.def("resetTemperatureEvent", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::resetTemperatureEvent, py::arg() = Positions{}); CppDetectorApi.def("getAutoComparatorDisable", @@ -1213,7 +1217,7 @@ void init_det(py::module &m) { Detector::getAutoComparatorDisable, py::arg() = Positions{}); CppDetectorApi.def("setAutoComparatorDisable", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setAutoComparatorDisable, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getComparatorDisableTime", @@ -1221,7 +1225,7 @@ void init_det(py::module &m) { Detector::getComparatorDisableTime, py::arg() = Positions{}); CppDetectorApi.def("setComparatorDisableTime", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setComparatorDisableTime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfAdditionalStorageCells", @@ -1229,7 +1233,7 @@ void init_det(py::module &m) { Detector::getNumberOfAdditionalStorageCells, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfAdditionalStorageCells", - (void(Detector::*)(int)) & + (void (Detector::*)(int)) & Detector::setNumberOfAdditionalStorageCells, py::arg()); CppDetectorApi.def("getStorageCellStart", @@ -1237,7 +1241,7 @@ void init_det(py::module &m) { Detector::getStorageCellStart, py::arg() = Positions{}); CppDetectorApi.def("setStorageCellStart", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setStorageCellStart, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getStorageCellDelay", @@ -1245,7 +1249,7 @@ void init_det(py::module &m) { Detector::getStorageCellDelay, py::arg() = Positions{}); CppDetectorApi.def("setStorageCellDelay", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setStorageCellDelay, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getGainModeList", @@ -1258,7 +1262,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setGainMode", - (void(Detector::*)(const defs::gainMode, sls::Positions)) & + (void (Detector::*)(const defs::gainMode, sls::Positions)) & Detector::setGainMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfFilterCells", @@ -1266,7 +1270,7 @@ void init_det(py::module &m) { Detector::getNumberOfFilterCells, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfFilterCells", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setNumberOfFilterCells, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1276,7 +1280,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setPedestalMode", - (void(Detector::*)(const defs::pedestalParameters, sls::Positions)) & + (void (Detector::*)(const defs::pedestalParameters, sls::Positions)) & Detector::setPedestalMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1286,7 +1290,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setTimingInfoDecoder", - (void(Detector::*)(defs::timingInfoDecoder, sls::Positions)) & + (void (Detector::*)(defs::timingInfoDecoder, sls::Positions)) & Detector::setTimingInfoDecoder, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1296,7 +1300,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setCollectionMode", - (void(Detector::*)(defs::collectionMode, sls::Positions)) & + (void (Detector::*)(defs::collectionMode, sls::Positions)) & Detector::setCollectionMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfBursts", @@ -1305,13 +1309,13 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setNumberOfBursts", - (void(Detector::*)(int64_t)) & Detector::setNumberOfBursts, py::arg()); + (void (Detector::*)(int64_t)) & Detector::setNumberOfBursts, py::arg()); CppDetectorApi.def("getBurstPeriod", (Result(Detector::*)(sls::Positions) const) & Detector::getBurstPeriod, py::arg() = Positions{}); CppDetectorApi.def("setBurstPeriod", - (void(Detector::*)(sls::ns, sls::Positions)) & + (void (Detector::*)(sls::ns, sls::Positions)) & Detector::setBurstPeriod, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfBurstsLeft", @@ -1325,28 +1329,28 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setInjectChannel", - (void(Detector::*)(const int, const int, sls::Positions)) & + (void (Detector::*)(const int, const int, sls::Positions)) & Detector::setInjectChannel, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "getVetoPhoton", - (void(Detector::*)(const int, const std::string &, sls::Positions)) & + (void (Detector::*)(const int, const std::string &, sls::Positions)) & Detector::getVetoPhoton, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoPhoton", - (void(Detector::*)(const int, const int, const int, const std::string &, - sls::Positions)) & + (void (Detector::*)(const int, const int, const int, + const std::string &, sls::Positions)) & Detector::setVetoPhoton, py::arg(), py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoReference", - (void(Detector::*)(const int, const int, sls::Positions)) & + (void (Detector::*)(const int, const int, sls::Positions)) & Detector::setVetoReference, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoFile", - (void(Detector::*)(const int, const std::string &, sls::Positions)) & + (void (Detector::*)(const int, const std::string &, sls::Positions)) & Detector::setVetoFile, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1355,7 +1359,7 @@ void init_det(py::module &m) { Detector::getBurstMode, py::arg() = Positions{}); CppDetectorApi.def("setBurstMode", - (void(Detector::*)(defs::burstMode, sls::Positions)) & + (void (Detector::*)(defs::burstMode, sls::Positions)) & Detector::setBurstMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getCDSGain", @@ -1363,7 +1367,7 @@ void init_det(py::module &m) { Detector::getCDSGain, py::arg() = Positions{}); CppDetectorApi.def("setCDSGain", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setCDSGain, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1373,7 +1377,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setTimingSource", - (void(Detector::*)(defs::timingSourceType, sls::Positions)) & + (void (Detector::*)(defs::timingSourceType, sls::Positions)) & Detector::setTimingSource, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getVeto", @@ -1381,7 +1385,7 @@ void init_det(py::module &m) { Detector::getVeto, py::arg() = Positions{}); CppDetectorApi.def("setVeto", - (void(Detector::*)(const bool, sls::Positions)) & + (void (Detector::*)(const bool, sls::Positions)) & Detector::setVeto, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1391,7 +1395,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setVetoStream", - (void(Detector::*)(const defs::streamingInterface, sls::Positions)) & + (void (Detector::*)(const defs::streamingInterface, sls::Positions)) & Detector::setVetoStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1402,8 +1406,8 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setVetoAlgorithm", - (void(Detector::*)(const defs::vetoAlgorithm, - const defs::streamingInterface, sls::Positions)) & + (void (Detector::*)(const defs::vetoAlgorithm, + const defs::streamingInterface, sls::Positions)) & Detector::setVetoAlgorithm, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1413,7 +1417,7 @@ void init_det(py::module &m) { py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setADCConfiguration", - (void(Detector::*)(const int, const int, const int, sls::Positions)) & + (void (Detector::*)(const int, const int, const int, sls::Positions)) & Detector::setADCConfiguration, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getCounterMask", @@ -1421,7 +1425,7 @@ void init_det(py::module &m) { Detector::getCounterMask, py::arg() = Positions{}); CppDetectorApi.def("setCounterMask", - (void(Detector::*)(uint32_t, sls::Positions)) & + (void (Detector::*)(uint32_t, sls::Positions)) & Detector::setCounterMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfGates", @@ -1429,7 +1433,7 @@ void init_det(py::module &m) { Detector::getNumberOfGates, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfGates", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setNumberOfGates, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1438,7 +1442,7 @@ void init_det(py::module &m) { Detector::getExptime, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setExptime", - (void(Detector::*)(int, sls::ns, sls::Positions)) & + (void (Detector::*)(int, sls::ns, sls::Positions)) & Detector::setExptime, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1452,7 +1456,7 @@ void init_det(py::module &m) { Detector::getGateDelay, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setGateDelay", - (void(Detector::*)(int, sls::ns, sls::Positions)) & + (void (Detector::*)(int, sls::ns, sls::Positions)) & Detector::setGateDelay, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1465,7 +1469,7 @@ void init_det(py::module &m) { Detector::getChipStatusRegister, py::arg() = Positions{}); CppDetectorApi.def("setGainCaps", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setGainCaps, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getGainCaps", @@ -1478,7 +1482,7 @@ void init_det(py::module &m) { Detector::getPolarity, py::arg() = Positions{}); CppDetectorApi.def("setPolarity", - (void(Detector::*)(defs::polarity, sls::Positions)) & + (void (Detector::*)(defs::polarity, sls::Positions)) & Detector::setPolarity, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getInterpolation", @@ -1486,7 +1490,7 @@ void init_det(py::module &m) { Detector::getInterpolation, py::arg() = Positions{}); CppDetectorApi.def("setInterpolation", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setInterpolation, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPumpProbe", @@ -1494,7 +1498,7 @@ void init_det(py::module &m) { Detector::getPumpProbe, py::arg() = Positions{}); CppDetectorApi.def("setPumpProbe", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setPumpProbe, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAnalogPulsing", @@ -1502,7 +1506,7 @@ void init_det(py::module &m) { Detector::getAnalogPulsing, py::arg() = Positions{}); CppDetectorApi.def("setAnalogPulsing", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setAnalogPulsing, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDigitalPulsing", @@ -1510,7 +1514,7 @@ void init_det(py::module &m) { Detector::getDigitalPulsing, py::arg() = Positions{}); CppDetectorApi.def("setDigitalPulsing", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setDigitalPulsing, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfAnalogSamples", @@ -1518,7 +1522,7 @@ void init_det(py::module &m) { Detector::getNumberOfAnalogSamples, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfAnalogSamples", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setNumberOfAnalogSamples, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getADCClock", @@ -1526,7 +1530,7 @@ void init_det(py::module &m) { Detector::getADCClock, py::arg() = Positions{}); CppDetectorApi.def("setADCClock", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setADCClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRUNClock", @@ -1534,7 +1538,7 @@ void init_det(py::module &m) { Detector::getRUNClock, py::arg() = Positions{}); CppDetectorApi.def("setRUNClock", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRUNClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSYNCClock", @@ -1554,7 +1558,7 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setPower", - (void(Detector::*)(defs::dacIndex, int, sls::Positions)) & + (void (Detector::*)(defs::dacIndex, int, sls::Positions)) & Detector::setPower, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getADCVpp", @@ -1562,7 +1566,7 @@ void init_det(py::module &m) { Detector::getADCVpp, py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def("setADCVpp", - (void(Detector::*)(int, bool, sls::Positions)) & + (void (Detector::*)(int, bool, sls::Positions)) & Detector::setADCVpp, py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def("getADCEnableMask", @@ -1570,7 +1574,7 @@ void init_det(py::module &m) { Detector::getADCEnableMask, py::arg() = Positions{}); CppDetectorApi.def("setADCEnableMask", - (void(Detector::*)(uint32_t, sls::Positions)) & + (void (Detector::*)(uint32_t, sls::Positions)) & Detector::setADCEnableMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTenGigaADCEnableMask", @@ -1578,7 +1582,7 @@ void init_det(py::module &m) { Detector::getTenGigaADCEnableMask, py::arg() = Positions{}); CppDetectorApi.def("setTenGigaADCEnableMask", - (void(Detector::*)(uint32_t, sls::Positions)) & + (void (Detector::*)(uint32_t, sls::Positions)) & Detector::setTenGigaADCEnableMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getTransceiverEnableMask", @@ -1586,7 +1590,7 @@ void init_det(py::module &m) { Detector::getTransceiverEnableMask, py::arg() = Positions{}); CppDetectorApi.def("setTransceiverEnableMask", - (void(Detector::*)(uint32_t, sls::Positions)) & + (void (Detector::*)(uint32_t, sls::Positions)) & Detector::setTransceiverEnableMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfDigitalSamples", @@ -1594,7 +1598,7 @@ void init_det(py::module &m) { Detector::getNumberOfDigitalSamples, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfDigitalSamples", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setNumberOfDigitalSamples, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getNumberOfTransceiverSamples", @@ -1602,7 +1606,7 @@ void init_det(py::module &m) { Detector::getNumberOfTransceiverSamples, py::arg() = Positions{}); CppDetectorApi.def("setNumberOfTransceiverSamples", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setNumberOfTransceiverSamples, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1611,7 +1615,7 @@ void init_det(py::module &m) { Detector::getReadoutMode, py::arg() = Positions{}); CppDetectorApi.def("setReadoutMode", - (void(Detector::*)(defs::readoutMode, sls::Positions)) & + (void (Detector::*)(defs::readoutMode, sls::Positions)) & Detector::setReadoutMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITClock", @@ -1619,7 +1623,7 @@ void init_det(py::module &m) { Detector::getDBITClock, py::arg() = Positions{}); CppDetectorApi.def("setDBITClock", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setDBITClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1642,7 +1646,7 @@ void init_det(py::module &m) { Detector::getExternalSamplingSource, py::arg() = Positions{}); CppDetectorApi.def("setExternalSamplingSource", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setExternalSamplingSource, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getExternalSampling", @@ -1650,7 +1654,7 @@ void init_det(py::module &m) { Detector::getExternalSampling, py::arg() = Positions{}); CppDetectorApi.def("setExternalSampling", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setExternalSampling, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1660,7 +1664,7 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setRxDbitList", - (void(Detector::*)(const std::vector &, sls::Positions)) & + (void (Detector::*)(const std::vector &, sls::Positions)) & Detector::setRxDbitList, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxDbitOffset", @@ -1668,7 +1672,7 @@ void init_det(py::module &m) { Detector::getRxDbitOffset, py::arg() = Positions{}); CppDetectorApi.def("setRxDbitOffset", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setRxDbitOffset, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxDbitReorder", @@ -1676,11 +1680,11 @@ void init_det(py::module &m) { Detector::getRxDbitReorder, py::arg() = Positions{}); CppDetectorApi.def("setRxDbitReorder", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setRxDbitReorder, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setDigitalIODelay", - (void(Detector::*)(uint64_t, int, sls::Positions)) & + (void (Detector::*)(uint64_t, int, sls::Positions)) & Detector::setDigitalIODelay, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getLEDEnable", @@ -1688,11 +1692,11 @@ void init_det(py::module &m) { Detector::getLEDEnable, py::arg() = Positions{}); CppDetectorApi.def("setLEDEnable", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setLEDEnable, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setDacNames", - (void(Detector::*)(const std::vector)) & + (void (Detector::*)(const std::vector)) & Detector::setDacNames, py::arg()); CppDetectorApi.def("getDacNames", @@ -1705,7 +1709,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setDacName", - (void(Detector::*)(const defs::dacIndex, const std::string &)) & + (void (Detector::*)(const defs::dacIndex, const std::string &)) & Detector::setDacName, py::arg(), py::arg()); CppDetectorApi.def("getDacName", @@ -1713,18 +1717,18 @@ void init_det(py::module &m) { Detector::getDacName, py::arg()); CppDetectorApi.def("setAdcNames", - (void(Detector::*)(const std::vector)) & + (void (Detector::*)(const std::vector)) & Detector::setAdcNames, py::arg()); CppDetectorApi.def("getAdcNames", (std::vector(Detector::*)() const) & Detector::getAdcNames); CppDetectorApi.def("getAdcIndex", - (int(Detector::*)(const std::string &) const) & + (int (Detector::*)(const std::string &) const) & Detector::getAdcIndex, py::arg()); CppDetectorApi.def("setAdcName", - (void(Detector::*)(const int, const std::string &)) & + (void (Detector::*)(const int, const std::string &)) & Detector::setAdcName, py::arg(), py::arg()); CppDetectorApi.def("getAdcName", @@ -1732,18 +1736,18 @@ void init_det(py::module &m) { Detector::getAdcName, py::arg()); CppDetectorApi.def("setSignalNames", - (void(Detector::*)(const std::vector)) & + (void (Detector::*)(const std::vector)) & Detector::setSignalNames, py::arg()); CppDetectorApi.def("getSignalNames", (std::vector(Detector::*)() const) & Detector::getSignalNames); CppDetectorApi.def("getSignalIndex", - (int(Detector::*)(const std::string &) const) & + (int (Detector::*)(const std::string &) const) & Detector::getSignalIndex, py::arg()); CppDetectorApi.def("setSignalName", - (void(Detector::*)(const int, const std::string &)) & + (void (Detector::*)(const int, const std::string &)) & Detector::setSignalName, py::arg(), py::arg()); CppDetectorApi.def("getSignalName", @@ -1751,7 +1755,7 @@ void init_det(py::module &m) { Detector::getSignalName, py::arg()); CppDetectorApi.def("setPowerNames", - (void(Detector::*)(const std::vector)) & + (void (Detector::*)(const std::vector)) & Detector::setPowerNames, py::arg()); CppDetectorApi.def("getPowerNames", @@ -1764,7 +1768,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setPowerName", - (void(Detector::*)(const defs::dacIndex, const std::string &)) & + (void (Detector::*)(const defs::dacIndex, const std::string &)) & Detector::setPowerName, py::arg(), py::arg()); CppDetectorApi.def("getPowerName", @@ -1772,7 +1776,7 @@ void init_det(py::module &m) { Detector::getPowerName, py::arg()); CppDetectorApi.def("setSlowADCNames", - (void(Detector::*)(const std::vector)) & + (void (Detector::*)(const std::vector)) & Detector::setSlowADCNames, py::arg()); CppDetectorApi.def("getSlowADCNames", @@ -1785,7 +1789,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setSlowADCName", - (void(Detector::*)(const defs::dacIndex, const std::string &)) & + (void (Detector::*)(const defs::dacIndex, const std::string &)) & Detector::setSlowADCName, py::arg(), py::arg()); CppDetectorApi.def("getSlowADCName", @@ -1793,7 +1797,7 @@ void init_det(py::module &m) { Detector::getSlowADCName, py::arg()); CppDetectorApi.def("configureTransceiver", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::configureTransceiver, py::arg() = Positions{}); CppDetectorApi.def( @@ -1803,20 +1807,20 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setPattern", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::setPattern, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setPattern", - (void(Detector::*)(const sls::Pattern &, sls::Positions)) & + (void (Detector::*)(const sls::Pattern &, sls::Positions)) & Detector::setPattern, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("savePattern", - (void(Detector::*)(const std::string &)) & + (void (Detector::*)(const std::string &)) & Detector::savePattern, py::arg()); CppDetectorApi.def("loadDefaultPattern", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::loadDefaultPattern, py::arg() = Positions{}); CppDetectorApi.def("getPatternIOControl", @@ -1824,7 +1828,7 @@ void init_det(py::module &m) { Detector::getPatternIOControl, py::arg() = Positions{}); CppDetectorApi.def("setPatternIOControl", - (void(Detector::*)(uint64_t, sls::Positions)) & + (void (Detector::*)(uint64_t, sls::Positions)) & Detector::setPatternIOControl, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternWord", @@ -1832,7 +1836,7 @@ void init_det(py::module &m) { Detector::getPatternWord, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWord", - (void(Detector::*)(int, uint64_t, sls::Positions)) & + (void (Detector::*)(int, uint64_t, sls::Positions)) & Detector::setPatternWord, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1841,7 +1845,7 @@ void init_det(py::module &m) { Detector::getPatternLoopAddresses, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternLoopAddresses", - (void(Detector::*)(int, int, int, sls::Positions)) & + (void (Detector::*)(int, int, int, sls::Positions)) & Detector::setPatternLoopAddresses, py::arg(), py::arg(), py::arg(), py::arg() = Positions{}); @@ -1850,7 +1854,7 @@ void init_det(py::module &m) { Detector::getPatternLoopCycles, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternLoopCycles", - (void(Detector::*)(int, int, sls::Positions)) & + (void (Detector::*)(int, int, sls::Positions)) & Detector::setPatternLoopCycles, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternWaitAddr", @@ -1858,7 +1862,7 @@ void init_det(py::module &m) { Detector::getPatternWaitAddr, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWaitAddr", - (void(Detector::*)(int, int, sls::Positions)) & + (void (Detector::*)(int, int, sls::Positions)) & Detector::setPatternWaitAddr, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1867,7 +1871,7 @@ void init_det(py::module &m) { Detector::getPatternWaitClocks, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWaitClocks", - (void(Detector::*)(int, uint64_t, sls::Positions)) & + (void (Detector::*)(int, uint64_t, sls::Positions)) & Detector::setPatternWaitClocks, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1876,7 +1880,7 @@ void init_det(py::module &m) { Detector::getPatternWaitInterval, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setPatternWaitInterval", - (void(Detector::*)(int, sls::ns, sls::Positions)) & + (void (Detector::*)(int, sls::ns, sls::Positions)) & Detector::setPatternWaitInterval, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternMask", @@ -1884,7 +1888,7 @@ void init_det(py::module &m) { Detector::getPatternMask, py::arg() = Positions{}); CppDetectorApi.def("setPatternMask", - (void(Detector::*)(uint64_t, sls::Positions)) & + (void (Detector::*)(uint64_t, sls::Positions)) & Detector::setPatternMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getPatternBitMask", @@ -1892,11 +1896,11 @@ void init_det(py::module &m) { Detector::getPatternBitMask, py::arg() = Positions{}); CppDetectorApi.def("setPatternBitMask", - (void(Detector::*)(uint64_t, sls::Positions)) & + (void (Detector::*)(uint64_t, sls::Positions)) & Detector::setPatternBitMask, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("startPattern", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::startPattern, py::arg() = Positions{}); CppDetectorApi.def("getAdditionalJsonHeader", @@ -1906,8 +1910,8 @@ void init_det(py::module &m) { py::arg() = Positions{}); CppDetectorApi.def( "setAdditionalJsonHeader", - (void(Detector::*)(const std::map &, - sls::Positions)) & + (void (Detector::*)(const std::map &, + sls::Positions)) & Detector::setAdditionalJsonHeader, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getAdditionalJsonParameter", @@ -1917,8 +1921,8 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "setAdditionalJsonParameter", - (void(Detector::*)(const std::string &, const std::string &, - sls::Positions)) & + (void (Detector::*)(const std::string &, const std::string &, + sls::Positions)) & Detector::setAdditionalJsonParameter, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getADCPipeline", @@ -1926,35 +1930,35 @@ void init_det(py::module &m) { Detector::getADCPipeline, py::arg() = Positions{}); CppDetectorApi.def("setADCPipeline", - (void(Detector::*)(int, sls::Positions)) & + (void (Detector::*)(int, sls::Positions)) & Detector::setADCPipeline, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "programFPGA", - (void(Detector::*)(const std::string &, const bool, sls::Positions)) & + (void (Detector::*)(const std::string &, const bool, sls::Positions)) & Detector::programFPGA, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def( - "resetFPGA", (void(Detector::*)(sls::Positions)) & Detector::resetFPGA, + "resetFPGA", (void (Detector::*)(sls::Positions)) & Detector::resetFPGA, py::arg() = Positions{}); CppDetectorApi.def( "updateDetectorServer", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::updateDetectorServer, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "updateKernel", - (void(Detector::*)(const std::string &, sls::Positions)) & + (void (Detector::*)(const std::string &, sls::Positions)) & Detector::updateKernel, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("rebootController", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::rebootController, py::arg() = Positions{}); CppDetectorApi.def( "updateFirmwareAndServer", - (void(Detector::*)(const std::string &, const std::string &, - sls::Positions)) & + (void (Detector::*)(const std::string &, const std::string &, + sls::Positions)) & Detector::updateFirmwareAndServer, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getUpdateMode", @@ -1962,7 +1966,7 @@ void init_det(py::module &m) { Detector::getUpdateMode, py::arg() = Positions{}); CppDetectorApi.def("setUpdateMode", - (void(Detector::*)(const bool, sls::Positions)) & + (void (Detector::*)(const bool, sls::Positions)) & Detector::setUpdateMode, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( @@ -1972,17 +1976,17 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "writeRegister", - (void(Detector::*)(uint32_t, uint32_t, bool, sls::Positions)) & + (void (Detector::*)(uint32_t, uint32_t, bool, sls::Positions)) & Detector::writeRegister, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "setBit", - (void(Detector::*)(uint32_t, int, bool, sls::Positions)) & + (void (Detector::*)(uint32_t, int, bool, sls::Positions)) & Detector::setBit, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "clearBit", - (void(Detector::*)(uint32_t, int, bool, sls::Positions)) & + (void (Detector::*)(uint32_t, int, bool, sls::Positions)) & Detector::clearBit, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -1991,21 +1995,22 @@ void init_det(py::module &m) { Detector::getBit, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("executeFirmwareTest", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::executeFirmwareTest, py::arg() = Positions{}); CppDetectorApi.def("executeBusTest", - (void(Detector::*)(sls::Positions)) & + (void (Detector::*)(sls::Positions)) & Detector::executeBusTest, py::arg() = Positions{}); - CppDetectorApi.def("writeAdcRegister", - (void(Detector::*)(uint32_t, uint32_t, sls::Positions)) & - Detector::writeAdcRegister, - py::arg(), py::arg(), py::arg() = Positions{}); - CppDetectorApi.def("getInitialChecks", (bool(Detector::*)() const) & + CppDetectorApi.def( + "writeAdcRegister", + (void (Detector::*)(uint32_t, uint32_t, sls::Positions)) & + Detector::writeAdcRegister, + py::arg(), py::arg(), py::arg() = Positions{}); + CppDetectorApi.def("getInitialChecks", (bool (Detector::*)() const) & Detector::getInitialChecks); CppDetectorApi.def("setInitialChecks", - (void(Detector::*)(const bool)) & + (void (Detector::*)(const bool)) & Detector::setInitialChecks, py::arg()); CppDetectorApi.def("getADCInvert", @@ -2013,7 +2018,7 @@ void init_det(py::module &m) { Detector::getADCInvert, py::arg() = Positions{}); CppDetectorApi.def("setADCInvert", - (void(Detector::*)(uint32_t, sls::Positions)) & + (void (Detector::*)(uint32_t, sls::Positions)) & Detector::setADCInvert, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getControlPort", @@ -2021,7 +2026,7 @@ void init_det(py::module &m) { Detector::getControlPort, py::arg() = Positions{}); CppDetectorApi.def("setControlPort", - (void(Detector::*)(uint16_t, sls::Positions)) & + (void (Detector::*)(uint16_t, sls::Positions)) & Detector::setControlPort, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getStopPort", @@ -2029,7 +2034,7 @@ void init_det(py::module &m) { Detector::getStopPort, py::arg() = Positions{}); CppDetectorApi.def("setStopPort", - (void(Detector::*)(uint16_t, sls::Positions)) & + (void (Detector::*)(uint16_t, sls::Positions)) & Detector::setStopPort, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDetectorLock", @@ -2037,7 +2042,7 @@ void init_det(py::module &m) { Detector::getDetectorLock, py::arg() = Positions{}); CppDetectorApi.def("setDetectorLock", - (void(Detector::*)(bool, sls::Positions)) & + (void (Detector::*)(bool, sls::Positions)) & Detector::setDetectorLock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def( From 0da80cd8983246dbbb8423216c422760f2f88b73 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Thu, 27 Nov 2025 10:43:51 +0100 Subject: [PATCH 20/27] local runners only for developer --- .gitea/workflows/rh8-local.yml | 2 ++ .gitea/workflows/rh9-local.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml index 3f6fd5a07..a99dd2b3b 100644 --- a/.gitea/workflows/rh8-local.yml +++ b/.gitea/workflows/rh8-local.yml @@ -2,6 +2,8 @@ name: Build on local RHEL8 on: push: + branches: + - developer workflow_dispatch: permissions: diff --git a/.gitea/workflows/rh9-local.yml b/.gitea/workflows/rh9-local.yml index cc50cafb9..62a27b32c 100644 --- a/.gitea/workflows/rh9-local.yml +++ b/.gitea/workflows/rh9-local.yml @@ -2,6 +2,8 @@ name: Build on local RHEL9 on: push: + branches: + - developer workflow_dispatch: permissions: From f14cfb0b31451a381c92552a5305ca05b172ea19 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Thu, 27 Nov 2025 15:21:34 +0100 Subject: [PATCH 21/27] deploy python ui --- .gitea/workflows/rh8-local.yml | 7 +++++-- .gitea/workflows/rh9-local.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml index a99dd2b3b..3566ff5cc 100644 --- a/.gitea/workflows/rh8-local.yml +++ b/.gitea/workflows/rh8-local.yml @@ -18,10 +18,13 @@ jobs: - name: Build library run: | mkdir build && cd build - cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON + cmake .. -DSLS_USE_PYTHON=ON make -j 2 + cd ../pyctbgui + make - name: Deploy to NFS update server if: gitea.ref == 'refs/heads/developer' run: | - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin' \ No newline at end of file + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin' + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put pyctbgui' \ No newline at end of file diff --git a/.gitea/workflows/rh9-local.yml b/.gitea/workflows/rh9-local.yml index 62a27b32c..c282e4228 100644 --- a/.gitea/workflows/rh9-local.yml +++ b/.gitea/workflows/rh9-local.yml @@ -18,10 +18,13 @@ jobs: - name: Build library run: | mkdir build && cd build - cmake .. -DSLS_USE_PYTHON=ON -DSLS_USE_TESTS=ON -DSLS_USE_SIMULATOR=ON + cmake -DSLS_USE_PYTHON=ON -DPython_EXECUTABLE=/usr/bin/python3.13 -DPython_INCLUDE_DIR=/usr/include/python3.13 -DPython_LIBRARY=/usr/lib64/libpython3.13.so .. make -j 2 + cd ../pyctbgui + make - name: Deploy to NFS update server if: gitea.ref == 'refs/heads/developer' run: | - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put build/bin' \ No newline at end of file + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put build/bin' + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put pyctbgui' \ No newline at end of file From 6d3922f4875d341616de48bf469fbec675edad01 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Thu, 27 Nov 2025 15:27:17 +0100 Subject: [PATCH 22/27] typo --- .gitea/workflows/rh8-local.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml index 3566ff5cc..1bea884cc 100644 --- a/.gitea/workflows/rh8-local.yml +++ b/.gitea/workflows/rh8-local.yml @@ -27,4 +27,4 @@ jobs: if: gitea.ref == 'refs/heads/developer' run: | sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put build/bin' - sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH9 <<< $'put pyctbgui' \ No newline at end of file + sftp -r gitea_runner@mpc2935:/slsDetectorSoftware/RH8 <<< $'put pyctbgui' \ No newline at end of file From 134137ead0ef836d9a28f69b6dd834bf42a57b88 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Thu, 27 Nov 2025 16:28:21 +0100 Subject: [PATCH 23/27] build RH8 in conda env --- .gitea/workflows/rh8-local.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/rh8-local.yml b/.gitea/workflows/rh8-local.yml index 1bea884cc..02067f5bb 100644 --- a/.gitea/workflows/rh8-local.yml +++ b/.gitea/workflows/rh8-local.yml @@ -17,7 +17,10 @@ jobs: - name: Build library run: | + source /home/gitea_runner/.bashrc + conda activate det mkdir build && cd build + conda activate det cmake .. -DSLS_USE_PYTHON=ON make -j 2 cd ../pyctbgui From 1c31a85a43743d51b348dcee01d9725f6d10b95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Wed, 3 Dec 2025 12:14:35 +0100 Subject: [PATCH 24/27] added function to remove duplicates, preserve order of dbit --- slsDetectorSoftware/src/Module.cpp | 10 +++---- slsSupportLib/include/sls/container_utils.h | 28 ++++++++++++++++++ slsSupportLib/tests/test-container_utils.cpp | 31 +++++++++++++++++++- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index a47eda649..8cde3f072 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -2568,17 +2568,15 @@ std::vector Module::getReceiverDbitList() const { void Module::setReceiverDbitList(std::vector list) { LOG(logDEBUG1) << "Setting Receiver Dbit List"; - if (list.size() > 64) { - throw RuntimeError("Dbit list size cannot be greater than 64\n"); - } + for (auto &it : list) { if (it < 0 || it > 63) { throw RuntimeError("Dbit list value must be between 0 and 63\n"); } } - std::sort(begin(list), end(list)); - auto last = std::unique(begin(list), end(list)); - list.erase(last, list.end()); + auto r = stableRemoveDuplicates(list); + if(r) + LOG(logWARNING) << "Removed duplicated from receiver dbit list"; StaticVector arg = list; sendToReceiver(F_SET_RECEIVER_DBIT_LIST, arg, nullptr); diff --git a/slsSupportLib/include/sls/container_utils.h b/slsSupportLib/include/sls/container_utils.h index ab234994b..a3de80e40 100644 --- a/slsSupportLib/include/sls/container_utils.h +++ b/slsSupportLib/include/sls/container_utils.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,10 @@ template bool hasDuplicates(Container c) { return pos != c.end(); // if we found something there are duplicates } +/** + * @brief Sorts the container and removes duplicated elements + * returns true if elements were removed otherwiese false + */ template typename std::enable_if::value, bool>::type removeDuplicates(T &c) { @@ -167,6 +172,29 @@ removeDuplicates(T &c) { return false; } +/** + * @brief Removed duplicated entries while preserving the oder + * returns true if elements were removed otherwiese false + */ +template +typename std::enable_if::value, bool>::type +stableRemoveDuplicates(T &c) { + auto containerSize = c.size(); + std::set seen; + c.erase( + std::remove_if(c.begin(), c.end(), + [&](const typename T::value_type& val) { + return !seen.insert(val).second; // erase if already seen + }), + c.end() + ); + if (c.size() != containerSize) { + return true; + } + return false; +} + + } // namespace sls #endif // CONTAINER_UTILS_H diff --git a/slsSupportLib/tests/test-container_utils.cpp b/slsSupportLib/tests/test-container_utils.cpp index d2db66c84..b43eaf814 100644 --- a/slsSupportLib/tests/test-container_utils.cpp +++ b/slsSupportLib/tests/test-container_utils.cpp @@ -153,13 +153,35 @@ TEST_CASE("check for duplicates in vector of pairs") { REQUIRE(hasDuplicates(vec) == true); } -TEST_CASE("remove duplicates from vector") { +TEST_CASE("sorts the vector and remove duplicates") { std::vector v{5, 6, 5, 3}; auto r = removeDuplicates(v); CHECK(r == true); // did indeed remove elements CHECK(v == std::vector{3, 5, 6}); } +TEST_CASE("remove duplicates but keep order") { + std::vector v{5, 6, 5, 3}; + auto r = stableRemoveDuplicates(v); + CHECK(r == true); // did indeed remove elements + CHECK(v == std::vector{5, 6, 3}); +} + +TEST_CASE("remove duplicates but keep order, all elements the same ") { + std::vector v{'c', 'c', 'c', 'c', 'c', 'c'}; + auto r = stableRemoveDuplicates(v); + CHECK(r == true); // did indeed remove elements + CHECK(v == std::vector{'c'}); +} + +TEST_CASE("remove duplicates but keep order, pattern ") { + std::vector v{8,1,2,8,8,3,2}; + auto r = stableRemoveDuplicates(v); + CHECK(r == true); // did indeed remove elements + CHECK(v == std::vector{8,1,2,3}); +} + + TEST_CASE("remove duplicated empty vector") { std::vector v; auto r = removeDuplicates(v); @@ -167,4 +189,11 @@ TEST_CASE("remove duplicated empty vector") { CHECK(v == std::vector{}); } +TEST_CASE("remove duplicated empty vector using stable version") { + std::vector v; + auto r = stableRemoveDuplicates(v); + CHECK(r == false); // no elements to remove + CHECK(v == std::vector{}); +} + } // namespace sls From 5409cec73eefaffa37bfa63d2e31924e904a4121 Mon Sep 17 00:00:00 2001 From: Alice Date: Thu, 4 Dec 2025 10:58:37 +0100 Subject: [PATCH 25/27] adapted test to test no reorder behavior --- .../tests/test-ArrangeDataBasedOnBitList.cpp | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/slsReceiverSoftware/tests/test-ArrangeDataBasedOnBitList.cpp b/slsReceiverSoftware/tests/test-ArrangeDataBasedOnBitList.cpp index e8b586184..db278658e 100644 --- a/slsReceiverSoftware/tests/test-ArrangeDataBasedOnBitList.cpp +++ b/slsReceiverSoftware/tests/test-ArrangeDataBasedOnBitList.cpp @@ -64,7 +64,8 @@ class DataProcessorTest : public DataProcessor { * num_transceiver_bytes = 2 both bytes have a value of 125 * num_digital_bytes is variable and is defined by number of samples * default num sample is 5 - * all bytes in digital data take a value of 255 + * all bytes in digital data take a value of 0xFF (alternating bits between 0, + * 1) */ class DataProcessorTestFixture { public: @@ -106,7 +107,7 @@ class DataProcessorTestFixture { num_random_offset_bytes); } - void set_data() { + void set_data(const std::bitset<8> pattern = 0xFF) { delete[] data; uint64_t max_bytes_per_bit = num_samples % 8 == 0 ? num_samples / 8 : num_samples / 8 + 1; @@ -118,7 +119,8 @@ class DataProcessorTestFixture { memset(data, dummy_value, num_analog_bytes); // set to dummy value memset(data + num_analog_bytes, 0, num_random_offset_bytes); // set to zero - memset(data + num_analog_bytes + num_random_offset_bytes, 0xFF, + memset(data + num_analog_bytes + num_random_offset_bytes, + static_cast(pattern.to_ulong()), num_digital_bytes); // all digital bits are one memset(data + num_digital_bytes + num_analog_bytes + num_random_offset_bytes, @@ -170,7 +172,7 @@ TEST_CASE_METHOD(DataProcessorTestFixture, "Remove Trailing Bits", TEST_CASE_METHOD(DataProcessorTestFixture, "Reorder all", "[.dataprocessor][.reorder]") { // parameters: num_samples, expected_num_digital_bytes, - // expected_digital_part + // expected_digital_part_for_each_bit auto parameters = GENERATE( std::make_tuple(5, 64, std::vector{0b00011111}), std::make_tuple(10, 2 * 64, std::vector{0xFF, 0b00000011}), @@ -264,11 +266,13 @@ TEST_CASE_METHOD(DataProcessorTestFixture, "Arrange bitlist with reorder false", // expected_digital_part auto parameters = GENERATE( std::make_tuple(5, std::vector{1, 4, 5}, 5, - std::vector{0b00000111}), + std::vector{0b00000010}), + std::make_tuple(5, std::vector{1, 5, 4}, 5, + std::vector{0b00000100}), std::make_tuple(5, std::vector{1, 5, 3, 7, 8, 50, 42, 60, 39}, 10, - std::vector{0xFF, 0b00000001}), + std::vector{0b11110000, 0b00000000}), std::make_tuple(5, std::vector{1, 5, 3, 7, 8, 50, 42, 60}, 5, - std::vector{0xFF})); + std::vector{0b11110000})); size_t num_samples, expected_num_digital_bytes; std::vector expected_digital_part; @@ -281,7 +285,7 @@ TEST_CASE_METHOD(DataProcessorTestFixture, "Arrange bitlist with reorder false", generaldata->SetCtbDbitReorder(false); set_num_samples(num_samples); - set_data(); + set_data(0b01010101); // set digital data to 0x55 to have alternating bits size_t expected_size = num_analog_bytes + num_transceiver_bytes + expected_num_digital_bytes; @@ -316,11 +320,15 @@ TEST_CASE_METHOD(DataProcessorTestFixture, "Arrange bitlist with reorder true", // expected_digital_part auto parameters = GENERATE( std::make_tuple(5, std::vector{1, 4, 5}, 3, - std::vector{0b00011111}), + std::vector{0x00, 0b00011111, 0x00}), + std::make_tuple(5, std::vector{1, 5, 4}, 3, + std::vector{0x00, 0x00, 0b00011111}), std::make_tuple(10, std::vector{1, 4, 5}, 6, - std::vector{0xFF, 0b00000011}), + std::vector{0x00, 0x00, 0b11111111, 0b00000011, + 0x00, 0x00}), std::make_tuple(8, std::vector{1, 5, 3, 7, 8, 50, 42, 60, 39}, 9, - std::vector{0xFF})); + std::vector{0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00})); size_t num_samples, expected_num_digital_bytes; std::vector expected_digital_part; @@ -333,7 +341,7 @@ TEST_CASE_METHOD(DataProcessorTestFixture, "Arrange bitlist with reorder true", generaldata->SetCtbDbitReorder(true); set_num_samples(num_samples); - set_data(); + set_data(0b01010101); size_t expected_size = num_analog_bytes + num_transceiver_bytes + expected_num_digital_bytes; @@ -343,11 +351,8 @@ TEST_CASE_METHOD(DataProcessorTestFixture, "Arrange bitlist with reorder true", memset(expected_data, dummy_value, num_analog_bytes); - for (size_t sample = 0; sample < bitlist.size(); ++sample) { - memcpy(expected_data + num_analog_bytes + - expected_digital_part.size() * sample, - expected_digital_part.data(), expected_digital_part.size()); - } + memcpy(expected_data + num_analog_bytes, expected_digital_part.data(), + expected_digital_part.size()); memset(expected_data + expected_num_digital_bytes + num_analog_bytes, dummy_value, num_transceiver_bytes); From 300a296c208fa69804848bbc5b46ac7d128be434 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 10 Dec 2025 16:21:00 +0100 Subject: [PATCH 26/27] updated release notes --- RELEASE.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE.txt b/RELEASE.txt index b56b0dacf..dd2dbabec 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1,7 +1,7 @@ SLS Detector Package Major Release x.x.x released on xx.xx.202x =============================================================== -This document describes the differences between vx.x.x and vx.0.2 +This document describes the differences between vx.x.x and v10.0.0 @@ -35,6 +35,8 @@ instead of the one included in our repo. Experimental support for building the detector client (including python bindings) on macOS +``rx_dbitlist`` keeps the order of the passed bit list + 2 On-board Detector Server Compatibility ========================================== From cfaaf5a9736439e089491b00cdfc8b8cc3904182 Mon Sep 17 00:00:00 2001 From: froejdh_e Date: Tue, 16 Dec 2025 16:35:53 +0100 Subject: [PATCH 27/27] removed depricated check, handle self assignment --- .clang-tidy | 1 - slsSupportLib/include/sls/sls_detector_defs.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 562531bd3..c35d81014 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -29,7 +29,6 @@ Checks: '*, -llvmlibc-*' HeaderFilterRegex: \.h -AnalyzeTemporaryDtors: false FormatStyle: none CheckOptions: - { key: readability-identifier-naming.NamespaceCase, value: lower_case } diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index d028d4238..192cbf3ce 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -804,6 +804,8 @@ typedef struct { } sls_detector_module &operator=(const sls_detector_module &other) { + if(this == &other) + return *this; delete[] dacs; delete[] chanregs; serialnumber = other.serialnumber;