diff --git a/.gitea/workflows/docker-rh8-build-rpm.yml b/.gitea/workflows/docker-rh8-build-rpm.yml new file mode 100644 index 000000000..8ac0aa501 --- /dev/null +++ b/.gitea/workflows/docker-rh8-build-rpm.yml @@ -0,0 +1,97 @@ +name: Build RPMs on RHEL8 docker image + +on: + workflow_dispatch: + inputs: + deploy: + description: "Upload the RPMs to the Gitea package registry" + type: boolean + default: false + +permissions: + contents: read + +jobs: + build: + runs-on: "ubuntu-latest" + container: + image: gitea.psi.ch/detectors/rhel8-detectors-dev + steps: + - name: Clone repository + run: | + git lfs install --skip-smudge + echo Cloning ${{ github.ref_name }} + git clone https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git --branch=${{ github.ref_name }} . + + - name: Install build dependencies + run: | + dnf -y install rpm-build qt5-qtbase-devel qt5-qtsvg-devel \ + libpng-devel zlib-devel expat-devel libtiff-devel + + - name: Build with versioned binaries + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSLS_USE_GUI=ON \ + -DSLS_USE_MOENCH=ON \ + -DSLS_INSTALL_VERSIONED_BINARIES=ON + cmake --build build -j 2 + + - name: Build RPMs + run: | + cpack --config build/CPackConfig.cmake -G RPM \ + -D 'CPACK_COMPONENTS_ALL=cli;receiver;zmq;gui' -B build/rpms + + - name: Inspect RPMs + run: | + for rpm in build/rpms/*.rpm; do + echo "::group::$rpm" + rpm -qpi "$rpm" + rpm -qpl "$rpm" + rpm -qpR "$rpm" + echo "::endgroup::" + done + + - name: Install RPMs and check versioned binaries + run: | + VERSION=$(cat VERSION) + dnf -y install build/rpms/*.rpm + for component in cli receiver zmq gui; do + rpm -q slsdetectorpackage-${VERSION}-${component} + done + for exe in sls_detector_get sls_detector_put slsReceiver \ + slsMultiReceiver slsFrameSynchronizer moench03ZmqProcess slsDetectorGui; do + test -x /usr/bin/${exe}-${VERSION} + test ! -e /usr/bin/${exe} + done + sls_detector_get-${VERSION} --version + slsReceiver-${VERSION} --version + + - name: Upload RPMs to Gitea + if: ${{ inputs.deploy }} + env: + SERVICE: ${{ secrets.SERVICE }} + run: | + url=https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/el8 + upload() { + curl --silent --show-error --output /tmp/upload-response \ + --write-out "%{http_code}" \ + --user "detectors-gitea:${SERVICE}" \ + --upload-file "$1" "$url/upload" + } + for rpm in build/rpms/*.rpm; do + echo "Uploading $rpm" + code=$(upload "$rpm") + if [ "$code" = 409 ]; then + echo "Already in the registry, replacing" + curl --silent --show-error --fail -X DELETE \ + --user "detectors-gitea:${SERVICE}" \ + "$url/package/$(rpm -qp --queryformat '%{NAME}/%{VERSION}-%{RELEASE}/%{ARCH}' "$rpm")" + code=$(upload "$rpm") + fi + if [ "$code" != 201 ]; then + echo "Upload failed with HTTP $code" + cat /tmp/upload-response + exit 1 + fi + done diff --git a/.gitea/workflows/docker-rh9-build-rpm.yml b/.gitea/workflows/docker-rh9-build-rpm.yml new file mode 100644 index 000000000..09778b0f0 --- /dev/null +++ b/.gitea/workflows/docker-rh9-build-rpm.yml @@ -0,0 +1,93 @@ +name: Build RPMs on RHEL9 docker image + +on: + workflow_dispatch: + inputs: + deploy: + description: "Upload the RPMs to the Gitea package registry" + type: boolean + default: false + +permissions: + contents: read + +jobs: + build: + runs-on: "ubuntu-latest" + container: + image: gitea.psi.ch/detectors/rhel9-detectors-dev + steps: + - uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + dnf -y install rpm-build qt5-qtbase-devel qt5-qtsvg-devel \ + libpng-devel zlib-devel expat-devel libtiff-devel + + - name: Build with versioned binaries + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSLS_USE_GUI=ON \ + -DSLS_USE_MOENCH=ON \ + -DSLS_INSTALL_VERSIONED_BINARIES=ON + cmake --build build -j 2 + + - name: Build RPMs + run: | + cpack --config build/CPackConfig.cmake -G RPM \ + -D 'CPACK_COMPONENTS_ALL=cli;receiver;zmq;gui' -B build/rpms + + - name: Inspect RPMs + run: | + for rpm in build/rpms/*.rpm; do + echo "::group::$rpm" + rpm -qpi "$rpm" + rpm -qpl "$rpm" + rpm -qpR "$rpm" + echo "::endgroup::" + done + + - name: Install RPMs and check versioned binaries + run: | + VERSION=$(cat VERSION) + dnf -y install build/rpms/*.rpm + for component in cli receiver zmq gui; do + rpm -q slsdetectorpackage-${VERSION}-${component} + done + for exe in sls_detector_get sls_detector_put slsReceiver \ + slsMultiReceiver slsFrameSynchronizer moench03ZmqProcess slsDetectorGui; do + test -x /usr/bin/${exe}-${VERSION} + test ! -e /usr/bin/${exe} + done + sls_detector_get-${VERSION} --version + slsReceiver-${VERSION} --version + + - name: Upload RPMs to Gitea + if: ${{ inputs.deploy }} + env: + SERVICE: ${{ secrets.SERVICE }} + run: | + url=https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/el9 + upload() { + curl --silent --show-error --output /tmp/upload-response \ + --write-out "%{http_code}" \ + --user "detectors-gitea:${SERVICE}" \ + --upload-file "$1" "$url/upload" + } + for rpm in build/rpms/*.rpm; do + echo "Uploading $rpm" + code=$(upload "$rpm") + if [ "$code" = 409 ]; then + echo "Already in the registry, replacing" + curl --silent --show-error --fail -X DELETE \ + --user "detectors-gitea:${SERVICE}" \ + "$url/package/$(rpm -qp --queryformat '%{NAME}/%{VERSION}-%{RELEASE}/%{ARCH}' "$rpm")" + code=$(upload "$rpm") + fi + if [ "$code" != 201 ]; then + echo "Upload failed with HTTP $code" + cat /tmp/upload-response + exit 1 + fi + done diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index 458084c0a..237d0af7b 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -26,9 +26,9 @@ jobs: build-and-deploy: strategy: matrix: - patform: [ubuntu-latest] + platform: [ubuntu-latest] python-version: ["3.12"] - runs-on: ${{ matrix.patform }} + runs-on: ${{ matrix.platform }} defaults: run: @@ -74,24 +74,31 @@ jobs: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSLS_BUILD_DOCS=ON -DSLS_USE_HDF5=ON -DSLS_USE_PYTHON=ON .. make -j4 make docs - - # Update main index if this is a release - - name: Update version index + + + - name: Render Documentation index if: github.event_name == 'release' run: | - python docs/main_index/render_main_index.py \ - --version "${{ steps.version.outputs.version }}" \ - --date "$(date +'%d.%m.%Y')" - + gh release list --json tagName,publishedAt > releases.json + python docs/main_index/render_main_index.py --json_releases releases.json --new_version ${{ steps.version.outputs.version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout gh-pages uses: actions/checkout@v6 with: ref: gh-pages path: gh-pages + + - name: Copy documentation to versioned folder for developer branch + if: github.event_name == 'push' && github.ref == 'refs/heads/developer' + run: | + VERSION="${{ steps.version.outputs.version }}" + mkdir -p "gh-pages/${VERSION}" + cp -r build/docs/html/. "gh-pages/${VERSION}/" - - name: Copy documentation and Release notes to versioned folder - if: github.event_name == 'release' || (github.event_name == 'push') + if: github.event_name == 'release' run: | VERSION="${{ steps.version.outputs.version }}" mkdir -p "gh-pages/${VERSION}" diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ea532cee..c5a9cd54c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ endif() include(cmake/project_version.cmake) include(cmake/SlsAddFlag.cmake) include(cmake/helpers.cmake) +include(cmake/SlsInstallExecutable.cmake) find_package(Threads REQUIRED) @@ -219,7 +220,6 @@ option(SLS_BUILD_SHARED_LIBRARIES "Build shared libaries" OFF) option(SLS_USE_TEXTCLIENT "Text Client" ON) option(SLS_USE_DETECTOR "Detector libs" ON) option(SLS_USE_RECEIVER "Receiver" ON) -option(SLS_USE_SERVER "Server" ON) option(SLS_USE_RECEIVER_BINARIES "Receiver binaries" ON) option(SLS_USE_GUI "GUI" OFF) option(SLS_USE_SIMULATOR "Simulator" OFF) @@ -235,7 +235,7 @@ option(SLS_DEVEL_HEADERS "install headers for devel" OFF) option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF) option(SLS_USE_JUNGFRAU "compile post processing for Jungfrau" OFF) option(SLS_USE_MATTERHORN "compile matterhorn server" OFF) -option(SLS_INSTALL_VERSIONED_BINARIES "Add version number to binaries on install" OFF) #Needed for multi version RPM +option(SLS_INSTALL_VERSIONED_BINARIES "Add version number to installed executables and RPM package names" OFF) option(SLS_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) #Convenience option to switch off defaults when building Moench binaries only @@ -258,7 +258,6 @@ if(SLS_BUILD_ONLY_MATTERHORN) set(SLS_USE_DETECTOR ON CACHE BOOL "Disabled for MATTERHORN_ONLY" FORCE) set(SLS_USE_RECEIVER OFF CACHE BOOL "Disabled for MATTERHORN_ONLY" FORCE) set(SLS_USE_RECEIVER_BINARIES OFF CACHE BOOL "Disabled for MATTERHORN_ONLY" FORCE) - set(SLS_USE_SERVER ON CACHE BOOL "Enable building cpp server" FORCE) set(SLS_USE_MATTERHORN ON CACHE BOOL "Enable Matterhorn" FORCE) endif() @@ -438,11 +437,6 @@ if (SLS_USE_DETECTOR OR SLS_USE_TEXTCLIENT) add_subdirectory(slsDetectorSoftware) endif() -# TODO refactor with simulators -if (SLS_USE_SERVER) - add_subdirectory(slsDetectorServers/slsDetectorServer_cpp) -endif() - if (SLS_USE_RECEIVER) add_subdirectory(slsReceiverSoftware) endif (SLS_USE_RECEIVER) @@ -452,14 +446,10 @@ if (SLS_USE_GUI) add_subdirectory(slsDetectorGui) endif (SLS_USE_GUI) -if (SLS_USE_SIMULATOR) +if (SLS_USE_SIMULATOR OR SLS_USE_MATTERHORN) add_subdirectory(slsDetectorServers) -endif (SLS_USE_SIMULATOR) +endif (SLS_USE_SIMULATOR OR SLS_USE_MATTERHORN) -# cant add_subdirectory twice -if (SLS_USE_MATTERHORN AND !SLS_USE_SIMULATOR) - add_subdirectory(slsDetectorServers/matterhornServer) -endif() if (SLS_USE_PYTHON) find_package (Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED) @@ -531,14 +521,18 @@ set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "DAQ software for PSI developed detectors") # RPM-specific settings +string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME) +if(SLS_INSTALL_VERSIONED_BINARIES) + string(APPEND CPACK_RPM_PACKAGE_NAME "-${PROJECT_VERSION}") +endif() set(CPACK_GENERATOR "RPM") -set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_FILE_NAME + "${PROJECT_NAME_LOWER}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm") set(CPACK_RPM_PACKAGE_LICENSE "LGPL-3.0") set(CPACK_RPM_PACKAGE_GROUP "Applications/System") set(CPACK_RPM_PACKAGE_RELEASE 1) # Adds %{?dist} to the RPM Release field set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) -set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") set(CPACK_RPM_COMPONENT_INSTALL ON) @@ -548,4 +542,10 @@ set(CPACK_RPM_GUI_PACKAGE_REQUIRES #control which RPMs are generated set(CPACK_COMPONENTS_ALL cli receiver zmq gui) -include(CPack) \ No newline at end of file +# Keep the project version only once in filenames; RPM expands its metadata. +foreach(component IN LISTS CPACK_COMPONENTS_ALL) + string(TOUPPER "${component}" component_upper) + set(CPACK_RPM_${component_upper}_FILE_NAME + "${PROJECT_NAME_LOWER}-${component}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm") +endforeach() +include(CPack) diff --git a/cmake/SlsInstallExecutable.cmake b/cmake/SlsInstallExecutable.cmake new file mode 100644 index 000000000..e8704d1ea --- /dev/null +++ b/cmake/SlsInstallExecutable.cmake @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2026 Contributors to the SLS Detector Package + +function(sls_install_executable target) + cmake_parse_arguments(ARG "" "DESTINATION;COMPONENT;EXPORT" "" ${ARGN}) + if(NOT ARG_DESTINATION) + set(ARG_DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif() + + set(install_args DESTINATION "${ARG_DESTINATION}") + if(ARG_COMPONENT) + list(APPEND install_args COMPONENT "${ARG_COMPONENT}") + endif() + + if(SLS_INSTALL_VERSIONED_BINARIES) + install(PROGRAMS "$" + ${install_args} + RENAME "$-${PROJECT_VERSION}${CMAKE_EXECUTABLE_SUFFIX}" + ) + else() + set(export_args) + if(ARG_EXPORT) + list(APPEND export_args EXPORT "${ARG_EXPORT}") + endif() + install(TARGETS ${target} + ${export_args} + RUNTIME ${install_args} + ) + endif() +endfunction() diff --git a/docs/main_index/index.html.j2 b/docs/main_index/index.html.j2 index baf5c8dfd..96ac8a674 100644 --- a/docs/main_index/index.html.j2 +++ b/docs/main_index/index.html.j2 @@ -99,9 +99,8 @@ {% for v in versions %} -{# Check if version >= 10.0.0 for .md vs .txt #} {% set version_parts = v["version"].split('.') | map('int') | list %} -{% set is_new_format = (version_parts[0] > 10) or (version_parts[0] == 10 and version_parts[1] > 0 and version_parts[2] > 0) %} +{% set is_new_format = (version_parts[0] > 10) or (version_parts[0] == 10 and (version_parts[1] > 0 or version_parts[2] > 0)) %} {% set release_ext = '.md' if is_new_format else '.txt' %}

{{ v["version"] }}

@@ -151,10 +150,8 @@ -ery(function () { -hinxRtdTheme.Navigation.enable(true); - - \ No newline at end of file + + + diff --git a/docs/main_index/render_main_index.py b/docs/main_index/render_main_index.py index d2bbb2780..ce0c1ffff 100644 --- a/docs/main_index/render_main_index.py +++ b/docs/main_index/render_main_index.py @@ -1,98 +1,101 @@ """ -Render the index HTML from a Jinja2 template with version data. -Can also add new versions to the YAML data file. +Render the index HTML from a Jinja2 template with release data. + +The release data is a JSON list as produced by + gh release list --json tagName,publishedAt Usage: - # Just render from existing data - python render_main_index.py --template main_index.html.j2 --output main_index.html --data versions.yaml - - # Add a new version and render - python render_main_index.py --data versions.yaml --add-version 10.1.0 --type Minor --date "15.10.2025" --template main_index.html.j2 --output main_index.html + python render_main_index.py --data releases.json --template index.html.j2 --output index.html """ import argparse +import json from pathlib import Path from jinja2 import Template -import yaml import os +from datetime import date SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -def load_versions(data_path: Path): - """Load version data from YAML file.""" - with open(data_path, 'r') as f: - data = yaml.safe_load(f) - return data['versions'] +MIN_VERSION = (5, 0, 0) # releases older than this are not listed +MIN_DOCS_VERSION = (9, 0, 0) # releases older than this have no docs -def save_versions(data_path: Path, versions): - """Save version data to YAML file.""" - data = { - 'versions': versions - } - with open(data_path, 'w') as f: - yaml.dump(data, f, default_flow_style=False, sort_keys=False) - print(f"✓ Saved version data to {data_path}") +def parse_version(tag: str): + """Return (major, minor, patch) for a tag like '10.0.1', or None for e.g. '7.0.0.rc1'.""" + parts = tag.split('.') + if len(parts) != 3 or not all(p.isdigit() for p in parts): + return None + return tuple(int(p) for p in parts) -def extract_release_type(version: str) -> str: - """Extract release type from version string.""" - parts = version.split('.') - if len(parts) != 3: - return "Unknown" - major, minor, patch = map(int, parts) - if minor == 0 and patch == 0: - return "Major" - elif patch == 0: - return "Minor" - else: + +def release_type(version): + """Derive the release type from the version number.""" + _, minor, patch = version + if patch != 0: return "Bug Fix" + if minor != 0: + return "Minor" + return "Major" -def add_version(data_path: Path, version: str, release_type: str, date: str, has_docs: bool = True): - """Add a new version to the YAML data file.""" - versions = load_versions(data_path) - - # Add to table (check if not already present) - new_entry = { - 'version': version, - 'type': release_type, - 'date': date, - 'has_docs': has_docs - } - versions.insert(0, new_entry) - - print(f"✓ Added version {new_entry} to version data") - - save_versions(data_path, versions) +def read_release_json(data_path: Path): + """Load release data from JSON file, newest version first.""" + with open(data_path, 'r') as f: + releases = json.load(f) + versions = [] + for release in releases: + version = parse_version(release['tagName']) + if version is None or version < MIN_VERSION: + continue + versions.append({ + 'version': release['tagName'], + 'type': release_type(version), + 'date': release['publishedAt'].split('T')[0], + 'has_docs': version >= MIN_DOCS_VERSION, + '_key': version, + }) -def render_template(template_path: Path, output_path: Path, data_path: Path): + versions.sort(key=lambda v: v['_key'], reverse=True) + return versions + +def render_template(template_path: Path, output_path: Path, versions : list): """Render the Jinja2 template with version data.""" - versions = load_versions(data_path) - + with open(template_path, 'r') as f: template = Template(f.read()) - + html = template.render( versions=versions ) - + with open(output_path, 'w') as f: f.write(html) - + print(f"✓ Rendered {output_path}") +def add_version(version: str, versions : list): + """Add a version to the versions dict if it is not already present.""" + tuple_version = parse_version(version) + if version not in versions: + versions.insert(0,{ + 'version': version, + 'type': release_type(tuple_version), + 'date': date.today().strftime("%Y-%m-%d"), + 'has_docs': tuple_version >= MIN_DOCS_VERSION, + '_key': tuple_version, + }) + + versions.sort(key=lambda v: v['_key'], reverse=True) def main(): - parser = argparse.ArgumentParser(description='Manage versions and render main index HTML') - parser.add_argument('--data', type=Path, default=Path(SCRIPT_DIR + "/versions.yaml"), - help='Path to versions YAML data file') - - # Options for adding a new version - parser.add_argument('--version', type=str, - help='new version (e.g., 10.1.0)') - parser.add_argument('--date', type=str, - help='Release date (e.g., 15.10.2025)') + parser = argparse.ArgumentParser(description='Render main index HTML from release data') + parser.add_argument('--json_releases', type=Path, + help='Path to releases JSON data file') + parser.add_argument('--new_version', type=str, + help='New version to add to the releases data') + # Options for rendering parser.add_argument('--template', type=Path, default=Path(SCRIPT_DIR + "/index.html.j2"), help='Path to Jinja2 template file') @@ -100,17 +103,15 @@ def main(): help='Path to output HTML file') args = parser.parse_args() - - # Add new version if requested - if args.version: - if not args.date: - parser.error("--version requires --date") - release_type = extract_release_type(args.version) - add_version(args.data, args.version, release_type, args.date, has_docs=True) - + + versions = read_release_json(args.json_releases) + + if args.new_version: + add_version(args.new_version, versions) + # Render template if requested if args.template and args.output: - render_template(args.template, args.output, args.data) + render_template(args.template, args.output, versions) elif args.template or args.output: parser.error("--template and --output must be used together") diff --git a/docs/main_index/versions.yaml b/docs/main_index/versions.yaml deleted file mode 100644 index 7f46d545e..000000000 --- a/docs/main_index/versions.yaml +++ /dev/null @@ -1,77 +0,0 @@ -versions: -- version: 10.0.0 - type: Major - date: 10.09.2025 - has_docs: true -- version: 9.2.0 - type: Minor - date: 02.06.2025 - has_docs: true -- version: 9.1.1 - type: Bug Fix - date: 22.05.2025 - has_docs: true -- version: 9.1.0 - type: Minor - date: 28.03.2025 - has_docs: true -- version: 9.0.0 - type: Major - date: 26.11.2024 - has_docs: true -- version: 8.0.2 - type: Bug Fix - date: 18.09.2024 - has_docs: false -- version: 8.0.1 - type: Bug Fix - date: 16.01.2024 - has_docs: false -- version: 8.0.0 - type: Major - date: 13.11.2023 - has_docs: false -- version: 7.0.3 - type: Bug Fix - date: 14.11.2023 - has_docs: false -- version: 7.0.2 - type: Bug Fix - date: 12.07.2023 - has_docs: false -- version: 7.0.1 - type: Bug Fix - date: 24.03.2023 - has_docs: false -- version: 7.0.0 - type: Major - date: 24.02.2023 - has_docs: false -- version: 6.1.2 - type: Bug Fix - date: 25.11.2022 - has_docs: false -- version: 6.1.1 - type: Bug Fix - date: 04.01.2022 - has_docs: false -- version: 6.1.0 - type: Minor - date: 25.11.2021 - has_docs: false -- version: 6.0.0 - type: Major - date: 20.10.2021 - has_docs: false -- version: 5.1.0 - type: Minor - date: 22.03.2021 - has_docs: false -- version: 5.0.1 - type: Bug Fix - date: 25.11.2020 - has_docs: false -- version: 5.0.0 - type: Major - date: 18.11.2020 - has_docs: false \ No newline at end of file diff --git a/docs/src/installation.rst b/docs/src/installation.rst index 926248843..43506b25d 100644 --- a/docs/src/installation.rst +++ b/docs/src/installation.rst @@ -240,6 +240,52 @@ Example cmake options Comment For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmk script option to hint library location. ` +3.2.3. Build RPM packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +CPack builds separate RPMs for the command line tools (``cli``), receiver +executables (``receiver``), Moench processing tools (``zmq``), and GUI (``gui``). +Install ``rpm-build`` and the dependencies for the selected features, and build +on the target distribution or a matching container. + +For example, to package the command line tools, receiver and GUI: + +.. code-block:: bash + + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr -DSLS_USE_GUI=ON \ + -DSLS_INSTALL_VERSIONED_BINARIES=ON + cmake --build build -j4 + cpack --config build/CPackConfig.cmake -G RPM \ + -D 'CPACK_COMPONENTS_ALL=cli;receiver;gui' -B build + +Select only components enabled in the build. Add ``-DSLS_USE_MOENCH=ON`` and +the ``zmq`` component to package the Moench tools. + +``SLS_INSTALL_VERSIONED_BINARIES=ON`` includes the project version in the RPM +package names, for example ``slsdetectorpackage-10.1.0-cli`` and +``slsdetectorpackage-10.1.0-gui``. Installed executables also receive a version +suffix, such as ``sls_detector_get-10.1.0`` and ``slsDetectorGui-10.1.0``. This +allows RPMs for different project versions to be installed side by side. +RPM revisions of the same project version retain the same package names and +can be upgraded normally. + +RPM filenames include the version once, for example +``slsdetectorpackage-cli-10.1.0-1.fc44.x86_64.rpm``. The package's internal name +remains ``slsdetectorpackage-10.1.0-cli`` and its RPM version remains ``10.1.0``. + +The option also applies to Jungfrau processing tools and virtual detector +servers installed with ``cmake --install``. These are outside the current RPM +component selection. Executables in the build directory keep their original +names. With the option set to ``OFF`` (the default), installed executables and +RPM package names omit the project version. + +The RPM components contain executables; Python bindings, libraries and headers +are not included. A full ``cmake --install`` still installs libraries and +headers at their usual paths, so use separate prefixes for full installations +of different versions. + + 3.3. Build on old distributions using conda ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/etc/update_version.py b/etc/update_version.py index b3878b18e..f312c276c 100644 --- a/etc/update_version.py +++ b/etc/update_version.py @@ -2,6 +2,7 @@ # Copyright (C) 2021 Contributors to the SLS Detector Package """ Script to update VERSION file with semantic versioning if provided as an argument, or with 0.0.0 if no argument is provided. +Script also updates VERSION in RELEASE.md and adds the new version to version.yaml """ import sys @@ -32,7 +33,7 @@ def write_version_to_file(version): version_file_path = Path(SCRIPT_DIR / "VERSION") with open(version_file_path, "w") as version_file: version_file.write(version) - print(f"Version {version} written to VERSION file.") + print(f"✓ Version {version} written to VERSION file.") def extract_release_type(version: str) -> str: @@ -59,9 +60,11 @@ def get_previous_version(data_path: Path, version : str) -> str: return prev_version + def main(): parser = argparse.ArgumentParser(description='Update version release notes') parser.add_argument('--version', required=True, type=str, help='version to write to VERSION file') + parser.add_argument('--prev_version', required=False, type=str, help='previous version to write to RELEASE.md file') parser.add_argument('--update_version_only', action="store_true", help='Only update version in VERSION file, do not generate release notes') args = parser.parse_args() @@ -69,8 +72,12 @@ def main(): write_version_to_file(version) if not args.update_version_only: + + if args.prev_version is None: + raise ValueError("Previous version must be provided when generating release notes. Use --prev_version to specify the previous version.") + release_type = extract_release_type(version) - prev_version = get_previous_version(ROOT_DIR / "docs/main_index/versions.yaml", version) + prev_version = args.prev_version # Read template template = Path(ROOT_DIR / "RELEASE.md").read_text() @@ -83,7 +90,7 @@ def main(): # Write output Path(ROOT_DIR / "RELEASE.md").write_text(output) - print(f"Generated RELEASE.md for version {version}") + print(f"✓ Generated RELEASE.md for version {version}") # Main script if __name__ == "__main__": diff --git a/pyctbgui/pyctbgui/services/Plot.py b/pyctbgui/pyctbgui/services/Plot.py index 688265484..de455720a 100644 --- a/pyctbgui/pyctbgui/services/Plot.py +++ b/pyctbgui/pyctbgui/services/Plot.py @@ -125,7 +125,7 @@ class PlotTab(QtWidgets.QWidget): nMaxX = lambda : self.transceiverTab.nTransceiverCols for index, image_view in enumerate(self.transceiverTab.transceiverImageViews): - frame = lambda : image_view.getImageItem().image + frame = lambda image_view=image_view: image_view.getImageItem().image image_view.scene.sigMouseMoved.connect(partial(self.showPlotValues, image_view, nMaxX, nMaxY, frame)) image_view.getHistogramWidget().item.sigLevelChangeFinished.connect(partial(self.handleHistogramChange, image_view)) diff --git a/python/scripts/generate_functions.py b/python/scripts/generate_functions.py index ab57f740f..b312f9b92 100644 --- a/python/scripts/generate_functions.py +++ b/python/scripts/generate_functions.py @@ -7,6 +7,9 @@ to be installed. When the Detector API is updated this file should be run manually. + +Tested with libclang 17-23. The output is formatted with +clang-format 17. """ import os from clang import cindex @@ -38,11 +41,11 @@ def find_libclang(): """Find libclang in the current Conda/Mamba environment.""" conda_prefix = os.environ.get("CONDA_PREFIX") if conda_prefix: - lib_dir = os.path.join(conda_prefix, "lib") - # Look for libclang*.so files - for f in os.listdir(lib_dir): - if f.startswith("libclang") and f.endswith(".so"): - return os.path.join(lib_dir, f) + # Match the name exactly, lib also holds libclang-cpp and libclang_rt.* + for name in ("libclang.so", "libclang.dylib"): + path = os.path.join(conda_prefix, "lib", name) + if os.path.exists(path): + return path # fallback: system-wide search path = ctypes.util.find_library("clang") @@ -52,7 +55,7 @@ def find_libclang(): raise FileNotFoundError("libclang not found in CONDA_PREFIX or system paths.") -def check_libclang_version(required="12"): +def check_libclang_version(supported): # Use already-loaded libclang, or let cindex resolve it lib = ctypes.CDLL(cindex.Config.library_file or ctypes.util.find_library("clang")) @@ -63,11 +66,13 @@ def check_libclang_version(required="12"): # Parse and check version match = re.search(r"version\s+(\d+)", version_str) - if not match or match.group(1) != required: - msg = red(f"libclang version {match.group(1) if match else '?'} found, but version {required} required. Bye!") + version = int(match.group(1)) if match else None + if version not in supported: + versions = ", ".join(str(v) for v in supported) + msg = red(f"libclang version {version or '?'} found, but one of {versions} required. Bye!") print(msg) sys.exit(1) - msg = green(f"Found libclang version {required}") + msg = green(f"Found libclang version {version}") print(msg) @@ -95,8 +100,25 @@ def check_for_compile_commands_json(path): print(msg) +def check_for_parse_errors(tu): + # Types that libclang fails to parse silently turn into int. Errors without + # a location come from compiler flags that clang does not know and are harmless + errors = [ + d + for d in tu.diagnostics + if d.severity >= cindex.Diagnostic.Error and d.location.file + ] + if errors: + print(red("FAILED")) + for d in errors: + print(red(f"{d.location.file}:{d.location.line}: {d.spelling}")) + print(red("Errors while parsing, the generated types can't be trusted. Bye!")) + sys.exit(1) + + default_build_path = "/home/l_frojdh/sls/build/" fpath = "../../slsDetectorSoftware/src/Detector.cpp" +supported_libclang_versions = (17, 18, 19, 20, 21, 22, 23) m = [] @@ -118,13 +140,64 @@ def get_arguments(node): return args +def qualified_name(decl): + """Name of a declaration including its enclosing scopes, e.g. sls::Positions""" + parts = [] + while decl is not None and decl.kind != cindex.CursorKind.TRANSLATION_UNIT: + if decl.spelling: + parts.append(decl.spelling) + decl = decl.semantic_parent + return "::".join(reversed(parts)) + + +def referenced_types(node): + """Declarations of the types named in the return type of a method or in a parameter""" + for child in node.get_children(): + if child.kind == cindex.CursorKind.TYPE_REF: + yield child.referenced + elif node.kind == child.kind == cindex.CursorKind.PARM_DECL: + # parameters of a function pointer + yield from referenced_types(child) + + +def type_spelling(node, type): + """ + Spelling of the return type of a method or the type of a parameter. + + libclang gives a type name as it is written in the source (Positions). + The generated file is outside the sls namespace, so we look up the + declarations and add the scope ourselves (sls::Positions). Names already + written with a scope (defs::xy) are left as they are. + """ + spelling = type.spelling + for decl in referenced_types(node): + unqualified = rf"(?()); 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( @@ -53,15 +53,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) & @@ -108,8 +108,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", @@ -126,7 +126,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( @@ -139,7 +139,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", @@ -151,16 +151,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{}); @@ -171,17 +171,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", @@ -189,7 +189,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( @@ -198,14 +198,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", @@ -213,7 +213,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", @@ -221,23 +221,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( @@ -247,12 +247,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", @@ -260,7 +260,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", @@ -268,7 +268,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", @@ -277,13 +277,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", @@ -292,13 +292,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", @@ -306,7 +306,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", @@ -314,7 +314,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", @@ -322,7 +322,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", @@ -346,7 +346,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) & @@ -357,7 +357,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", @@ -369,7 +369,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", @@ -380,7 +380,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", @@ -392,7 +392,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", @@ -400,7 +400,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", @@ -412,7 +412,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", @@ -424,7 +424,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", @@ -436,7 +436,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", @@ -444,7 +444,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", @@ -452,7 +452,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", @@ -460,7 +460,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", @@ -468,7 +468,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", @@ -489,7 +489,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( @@ -500,12 +500,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( @@ -515,7 +515,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( @@ -525,7 +525,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", @@ -535,7 +535,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", @@ -543,7 +543,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", @@ -551,7 +551,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", @@ -561,7 +561,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", @@ -569,7 +569,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", @@ -577,24 +577,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( @@ -627,11 +627,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( @@ -640,7 +640,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( @@ -653,7 +653,7 @@ void init_det(py::module &m) { Detector::getNumberofUDPInterfaces, py::arg() = Positions{}); CppDetectorApi.def("setNumberofUDPInterfaces", - (void (Detector::*)(int)) & + (void(Detector::*)(int)) & Detector::setNumberofUDPInterfaces, py::arg()); CppDetectorApi.def("getSelectedUDPInterface", @@ -661,7 +661,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( @@ -670,7 +670,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( @@ -679,7 +679,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( @@ -687,21 +687,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) & @@ -709,7 +707,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", @@ -717,7 +715,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", @@ -725,7 +723,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( @@ -734,7 +732,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( @@ -743,7 +741,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( @@ -751,27 +749,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", @@ -779,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( @@ -800,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", @@ -808,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", @@ -816,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", @@ -824,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", @@ -832,23 +828,23 @@ 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("getUDPDataStream", (Result(Detector::*)(const defs::portPosition, sls::Positions) const) & Detector::getUDPDataStream, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("setUDPDataStream", - (void (Detector::*)(const defs::portPosition, const bool, - sls::Positions)) & + (void(Detector::*)(const defs::portPosition, const bool, + sls::Positions)) & Detector::setUDPDataStream, py::arg(), py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRxDisabledUDPPortIndices", @@ -868,26 +864,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", @@ -895,7 +891,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( @@ -905,7 +901,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", @@ -913,7 +909,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", @@ -921,7 +917,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", @@ -933,7 +929,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( @@ -951,7 +947,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", @@ -959,18 +955,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( @@ -980,7 +976,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( @@ -990,7 +986,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", @@ -998,7 +994,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", @@ -1006,20 +1002,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", @@ -1027,7 +1023,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", @@ -1035,7 +1031,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", @@ -1043,7 +1039,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", @@ -1051,7 +1047,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", @@ -1059,7 +1055,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", @@ -1067,7 +1063,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", @@ -1075,7 +1071,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( @@ -1084,23 +1080,23 @@ 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("streamRxDummyHeader", - (void (Detector::*)(sls::Positions) const) & + (void(Detector::*)(sls::Positions) const) & Detector::streamRxDummyHeader, py::arg() = Positions{}); CppDetectorApi.def("getSubExptime", @@ -1108,7 +1104,7 @@ void init_det(py::module &m) { 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", @@ -1116,7 +1112,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", @@ -1124,7 +1120,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", @@ -1132,11 +1128,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", @@ -1144,7 +1140,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", @@ -1160,7 +1156,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", @@ -1168,19 +1164,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", @@ -1188,14 +1184,14 @@ 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("getTop", (Result(Detector::*)(sls::Positions) const) & 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", @@ -1207,7 +1203,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", @@ -1215,7 +1211,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", @@ -1223,7 +1219,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", @@ -1231,7 +1227,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", @@ -1239,7 +1235,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", @@ -1247,7 +1243,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", @@ -1255,7 +1251,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", @@ -1263,7 +1259,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", @@ -1276,7 +1272,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", @@ -1284,7 +1280,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( @@ -1294,7 +1290,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( @@ -1304,7 +1300,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( @@ -1314,7 +1310,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", @@ -1323,13 +1319,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", @@ -1343,28 +1339,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( @@ -1373,7 +1369,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", @@ -1381,7 +1377,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( @@ -1391,7 +1387,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", @@ -1399,7 +1395,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( @@ -1409,7 +1405,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( @@ -1420,8 +1416,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( @@ -1431,7 +1427,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", @@ -1439,7 +1435,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", @@ -1447,7 +1443,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( @@ -1456,12 +1452,12 @@ 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( "getExptimeForAllGates", - (Result>(Detector::*)(sls::Positions) const) & + (Result>(Detector::*)(sls::Positions) const) & Detector::getExptimeForAllGates, py::arg() = Positions{}); CppDetectorApi.def( @@ -1470,12 +1466,12 @@ 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( "getGateDelayForAllGates", - (Result>(Detector::*)(sls::Positions) const) & + (Result>(Detector::*)(sls::Positions) const) & Detector::getGateDelayForAllGates, py::arg() = Positions{}); CppDetectorApi.def("getChipStatusRegister", @@ -1483,7 +1479,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", @@ -1496,7 +1492,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", @@ -1504,7 +1500,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", @@ -1512,7 +1508,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", @@ -1520,7 +1516,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", @@ -1528,7 +1524,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", @@ -1536,7 +1532,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", @@ -1544,7 +1540,7 @@ void init_det(py::module &m) { Detector::getADCClock, py::arg() = Positions{}); CppDetectorApi.def("setADCClock", - (void (Detector::*)(defs::Hz, sls::Positions)) & + (void(Detector::*)(defs::Hz, sls::Positions)) & Detector::setADCClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getRUNClock", @@ -1552,7 +1548,7 @@ void init_det(py::module &m) { Detector::getRUNClock, py::arg() = Positions{}); CppDetectorApi.def("setRUNClock", - (void (Detector::*)(defs::Hz, sls::Positions)) & + (void(Detector::*)(defs::Hz, sls::Positions)) & Detector::setRUNClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getDBITClock", @@ -1560,7 +1556,7 @@ void init_det(py::module &m) { Detector::getDBITClock, py::arg() = Positions{}); CppDetectorApi.def("setDBITClock", - (void (Detector::*)(defs::Hz, sls::Positions)) & + (void(Detector::*)(defs::Hz, sls::Positions)) & Detector::setDBITClock, py::arg(), py::arg() = Positions{}); CppDetectorApi.def("getSYNCClock", @@ -1571,35 +1567,35 @@ void init_det(py::module &m) { (std::vector(Detector::*)() const) & Detector::getPowerList); CppDetectorApi.def("getPowerDAC", - (int (Detector::*)(defs::powerIndex) const) & + (int(Detector::*)(defs::powerIndex) const) & Detector::getPowerDAC, py::arg()); CppDetectorApi.def("setPowerDAC", - (void (Detector::*)(defs::powerIndex, int)) & + (void(Detector::*)(defs::powerIndex, int)) & Detector::setPowerDAC, py::arg(), py::arg()); CppDetectorApi.def("isPowerEnabled", - (bool (Detector::*)(defs::powerIndex) const) & + (bool(Detector::*)(defs::powerIndex) const) & Detector::isPowerEnabled, py::arg()); CppDetectorApi.def( "setPowerEnabled", - (void (Detector::*)(const std::vector &, bool)) & + (void(Detector::*)(const std::vector &, bool)) & Detector::setPowerEnabled, py::arg(), py::arg()); CppDetectorApi.def("getMeasuredPower", - (int (Detector::*)(defs::powerIndex) const) & + (int(Detector::*)(defs::powerIndex) const) & Detector::getMeasuredPower, py::arg()); CppDetectorApi.def("getMeasuredCurrent", - (int (Detector::*)(defs::powerIndex) const) & + (int(Detector::*)(defs::powerIndex) const) & Detector::getMeasuredCurrent, py::arg()); CppDetectorApi.def("getVoltageLimit", - (int (Detector::*)() const) & Detector::getVoltageLimit); + (int(Detector::*)() const) & Detector::getVoltageLimit); CppDetectorApi.def( "setVoltageLimit", - (void (Detector::*)(const int)) & Detector::setVoltageLimit, py::arg()); + (void(Detector::*)(const int)) & Detector::setVoltageLimit, py::arg()); CppDetectorApi.def("getSlowADCList", (std::vector(Detector::*)() const) & Detector::getSlowADCList); @@ -1613,7 +1609,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", @@ -1621,7 +1617,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", @@ -1629,7 +1625,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", @@ -1637,7 +1633,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", @@ -1645,7 +1641,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", @@ -1653,7 +1649,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( @@ -1662,7 +1658,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("getExternalSamplingSource", @@ -1670,7 +1666,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", @@ -1678,7 +1674,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( @@ -1688,7 +1684,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", @@ -1696,7 +1692,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", @@ -1704,11 +1700,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", @@ -1716,11 +1712,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", @@ -1733,7 +1729,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", @@ -1741,18 +1737,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", @@ -1760,18 +1756,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", @@ -1779,7 +1775,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", @@ -1792,7 +1788,7 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def( "setPowerName", - (void (Detector::*)(const defs::powerIndex, const std::string &)) & + (void(Detector::*)(const defs::powerIndex, const std::string &)) & Detector::setPowerName, py::arg(), py::arg()); CppDetectorApi.def( @@ -1801,7 +1797,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", @@ -1814,7 +1810,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", @@ -1822,19 +1818,19 @@ void init_det(py::module &m) { Detector::getSlowADCName, py::arg()); CppDetectorApi.def("getRegisterDefinitionsCount", - (int (Detector::*)() const) & + (int(Detector::*)() const) & Detector::getRegisterDefinitionsCount); CppDetectorApi.def( "setRegisterDefinition", - (void (Detector::*)(const std::string &, sls::RegisterAddress)) & + (void(Detector::*)(const std::string &, sls::RegisterAddress)) & Detector::setRegisterDefinition, py::arg(), py::arg()); CppDetectorApi.def("hasRegisterDefinition", - (bool (Detector::*)(const std::string &) const) & + (bool(Detector::*)(const std::string &) const) & Detector::hasRegisterDefinition, py::arg()); CppDetectorApi.def("hasRegisterDefinition", - (bool (Detector::*)(sls::RegisterAddress) const) & + (bool(Detector::*)(sls::RegisterAddress) const) & Detector::hasRegisterDefinition, py::arg()); CppDetectorApi.def( @@ -1847,31 +1843,32 @@ void init_det(py::module &m) { Detector::getRegisterName, py::arg()); CppDetectorApi.def("clearRegisterDefinitions", - (void (Detector::*)()) & + (void(Detector::*)()) & Detector::clearRegisterDefinitions); CppDetectorApi.def( "setRegisterDefinitions", - (void (Detector::*)(const std::map &)) & + (void(Detector::*)( + const std::map &)) & Detector::setRegisterDefinitions, py::arg()); CppDetectorApi.def( "getRegisterDefinitions", - (std::map(Detector::*)() const) & + (std::map(Detector::*)() const) & Detector::getRegisterDefinitions); CppDetectorApi.def("getBitDefinitionsCount", - (int (Detector::*)() const) & + (int(Detector::*)() const) & Detector::getBitDefinitionsCount); CppDetectorApi.def( "setBitDefinition", - (void (Detector::*)(const std::string &, sls::BitAddress)) & + (void(Detector::*)(const std::string &, sls::BitAddress)) & Detector::setBitDefinition, py::arg(), py::arg()); CppDetectorApi.def("hasBitDefinition", - (bool (Detector::*)(const std::string &) const) & + (bool(Detector::*)(const std::string &) const) & Detector::hasBitDefinition, py::arg()); CppDetectorApi.def("hasBitDefinition", - (bool (Detector::*)(sls::BitAddress) const) & + (bool(Detector::*)(sls::BitAddress) const) & Detector::hasBitDefinition, py::arg()); CppDetectorApi.def("toRegisterNameBitString", @@ -1888,17 +1885,18 @@ void init_det(py::module &m) { Detector::getBitName, py::arg()); CppDetectorApi.def("clearBitDefinitions", - (void (Detector::*)()) & Detector::clearBitDefinitions); + (void(Detector::*)()) & Detector::clearBitDefinitions); CppDetectorApi.def( "setBitDefinitions", - (void (Detector::*)(const std::map &)) & + (void(Detector::*)(const std::map &)) & Detector::setBitDefinitions, py::arg()); - CppDetectorApi.def("getBitDefinitions", (std::map( - Detector::*)() const) & - Detector::getBitDefinitions); + CppDetectorApi.def( + "getBitDefinitions", + (std::map(Detector::*)() const) & + Detector::getBitDefinitions); CppDetectorApi.def("configureTransceiver", - (void (Detector::*)(sls::Positions)) & + (void(Detector::*)(sls::Positions)) & Detector::configureTransceiver, py::arg() = Positions{}); CppDetectorApi.def( @@ -1908,20 +1906,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", @@ -1929,7 +1927,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", @@ -1937,7 +1935,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( @@ -1946,7 +1944,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{}); @@ -1955,7 +1953,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", @@ -1963,7 +1961,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( @@ -1972,7 +1970,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( @@ -1981,7 +1979,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", @@ -1989,7 +1987,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", @@ -1997,11 +1995,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", @@ -2011,8 +2009,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", @@ -2022,8 +2020,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", @@ -2031,35 +2029,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", @@ -2067,7 +2065,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("readRegister", @@ -2077,18 +2075,18 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "writeRegister", - (void (Detector::*)(sls::RegisterAddress, sls::RegisterValue, bool, - sls::Positions)) & + (void(Detector::*)(sls::RegisterAddress, sls::RegisterValue, bool, + sls::Positions)) & Detector::writeRegister, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "setBit", - (void (Detector::*)(sls::BitAddress, bool, sls::Positions)) & + (void(Detector::*)(sls::BitAddress, bool, sls::Positions)) & Detector::setBit, py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "clearBit", - (void (Detector::*)(sls::BitAddress, bool, sls::Positions)) & + (void(Detector::*)(sls::BitAddress, bool, sls::Positions)) & Detector::clearBit, py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -2103,18 +2101,18 @@ void init_det(py::module &m) { py::arg(), py::arg() = Positions{}); CppDetectorApi.def( "writeRegister", - (void (Detector::*)(const std::string &, sls::RegisterValue, bool, - sls::Positions)) & + (void(Detector::*)(const std::string &, sls::RegisterValue, bool, + sls::Positions)) & Detector::writeRegister, py::arg(), py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "setBit", - (void (Detector::*)(const std::string &, bool, sls::Positions)) & + (void(Detector::*)(const std::string &, bool, sls::Positions)) & Detector::setBit, py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( "clearBit", - (void (Detector::*)(const std::string &, bool, sls::Positions)) & + (void(Detector::*)(const std::string &, bool, sls::Positions)) & Detector::clearBit, py::arg(), py::arg() = false, py::arg() = Positions{}); CppDetectorApi.def( @@ -2129,17 +2127,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( @@ -2148,22 +2146,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", @@ -2171,7 +2168,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", @@ -2179,7 +2176,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", @@ -2187,7 +2184,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", @@ -2195,7 +2192,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/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt b/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt index dc0f0690f..6f1fa6fd1 100644 --- a/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt +++ b/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt @@ -92,7 +92,5 @@ foreach(exe ${JUNGFRAU_EXECUTABLES}) set_property(TARGET ${exe} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() - + sls_install_executable(${exe} DESTINATION bin) endforeach(exe ${JUNGFRAU_EXECUTABLES}) - -install(TARGETS ${JUNGFRAU_EXECUTABLES} DESTINATION bin) \ No newline at end of file diff --git a/slsDetectorCalibration/moenchExecutables/CMakeLists.txt b/slsDetectorCalibration/moenchExecutables/CMakeLists.txt index 55faa558d..8379f5eb9 100644 --- a/slsDetectorCalibration/moenchExecutables/CMakeLists.txt +++ b/slsDetectorCalibration/moenchExecutables/CMakeLists.txt @@ -92,19 +92,6 @@ foreach(exe ${MOENCH_EXECUTABLES}) set_property(TARGET ${exe} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() - # Mainly for RPMs to enable side by side installations of different versions - if(SLS_INSTALL_VERSIONED_BINARIES) - install(PROGRAMS "$" - DESTINATION bin - RENAME "$-${PROJECT_VERSION}" - COMPONENT zmq - ) - else() - install(TARGETS ${exe} - DESTINATION bin - COMPONENT zmq - ) - endif() + sls_install_executable(${exe} DESTINATION bin COMPONENT zmq) endforeach(exe ${MOENCH_EXECUTABLES}) - diff --git a/slsDetectorGui/CMakeLists.txt b/slsDetectorGui/CMakeLists.txt index 992bfe3ef..b78ccdd95 100755 --- a/slsDetectorGui/CMakeLists.txt +++ b/slsDetectorGui/CMakeLists.txt @@ -119,8 +119,4 @@ if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE) set_property(TARGET slsDetectorGui PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() -install(TARGETS slsDetectorGui - # EXPORT "${TARGETS_EXPORT_NAME}" #do not export gui - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT gui -) - +sls_install_executable(slsDetectorGui COMPONENT gui) diff --git a/slsDetectorServers/CMakeLists.txt b/slsDetectorServers/CMakeLists.txt index 3a04f2bf9..2aafa0a78 100644 --- a/slsDetectorServers/CMakeLists.txt +++ b/slsDetectorServers/CMakeLists.txt @@ -8,12 +8,19 @@ install(TARGETS slsProjectCSettings ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) -add_subdirectory(ctbDetectorServer) -add_subdirectory(xilinx_ctbDetectorServer) -add_subdirectory(eigerDetectorServer) -add_subdirectory(jungfrauDetectorServer) -add_subdirectory(mythen3DetectorServer) -add_subdirectory(gotthard2DetectorServer) -add_subdirectory(moenchDetectorServer) -add_subdirectory(matterhornServer) +add_subdirectory(slsDetectorServer_cpp) + +if(SLS_USE_SIMULATOR) + add_subdirectory(ctbDetectorServer) + add_subdirectory(xilinx_ctbDetectorServer) + add_subdirectory(eigerDetectorServer) + add_subdirectory(jungfrauDetectorServer) + add_subdirectory(mythen3DetectorServer) + add_subdirectory(gotthard2DetectorServer) + add_subdirectory(moenchDetectorServer) +endif() + +if(SLS_USE_MATTERHORN OR SLS_USE_SIMULATOR) + add_subdirectory(matterhornServer) +endif() \ No newline at end of file diff --git a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt index 1a9c4b5af..438930ffa 100644 --- a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt @@ -44,6 +44,4 @@ set_target_properties(ctbDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS ctbDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(ctbDetectorServer_virtual) diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 33f95fd42..cabf6f09f 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -2629,13 +2629,10 @@ void *start_timer(void *arg) { int packetsPerFrame = ceil((double)imageSize / (double)dataSize); // Generate Data - char *imageData = (char *)malloc(imageSize); - memset(imageData, 0, imageSize); - + char *imageData = (char *)calloc(imageSize, 1); if (imageData == NULL) { - LOG(logERROR, ("Can not allocate image Data RAM." - "Probable cause: Memory Leak.\n")); - return NULL; + LOG(logERROR, ("Could not allocate memory for virtual image\n")); + exit(EXIT_FAILURE); } /* for (int i = 0; i < imageSize; i += sizeof(uint16_t)) { diff --git a/slsDetectorServers/eigerDetectorServer/CMakeLists.txt b/slsDetectorServers/eigerDetectorServer/CMakeLists.txt index dd0404aac..5abe8bdf8 100644 --- a/slsDetectorServers/eigerDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/eigerDetectorServer/CMakeLists.txt @@ -38,9 +38,7 @@ set_target_properties(eigerDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS eigerDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(eigerDetectorServer_virtual) configure_file(config_eiger.txt ${CMAKE_BINARY_DIR}/bin/config_eiger.txt COPYONLY) diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index c204a1221..0b22df2be 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -2783,8 +2783,11 @@ void *start_timer(void *arg) { npixelsx, databytes)); // Generate data - char imageData[databytes * 2]; - memset(imageData, 0, databytes * 2); + char *imageData = (char *)calloc(databytes * 2, 1); + if (imageData == NULL) { + LOG(logERROR, ("Could not allocate memory for virtual image\n")); + exit(EXIT_FAILURE); + } { int npixels = NCHAN * NCHIP; const int pixelsPerPacket = (double)datasize / bytesPerPixel; @@ -3014,6 +3017,7 @@ void *start_timer(void *arg) { } setNextFrameNumber(frameNr + numFrames); } + free(imageData); closeUDPSocket(0); closeUDPSocket(1); diff --git a/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt b/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt index 7a5201c0e..be01f273f 100644 --- a/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt @@ -39,9 +39,7 @@ set_target_properties(gotthard2DetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS gotthard2DetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(gotthard2DetectorServer_virtual) configure_file(config_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/config_gotthard2.txt COPYONLY) configure_file(detid_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/detid_gotthard2.txt COPYONLY) diff --git a/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt b/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt index 678cea963..55ff80edc 100644 --- a/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt @@ -41,9 +41,8 @@ set_target_properties(jungfrauDetectorServer_virtual PROPERTIES #target_compile_options(jungfrauDetectorServer_virtual PRIVATE -m32) #target_link_options(jungfrauDetectorServer_virtual PRIVATE -m32) -install(TARGETS jungfrauDetectorServer_virtual +sls_install_executable(jungfrauDetectorServer_virtual EXPORT "${TARGETS_EXPORT_NAME}" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) configure_file(config_jungfrau.txt ${CMAKE_BINARY_DIR}/bin/config_jungfrau.txt COPYONLY) diff --git a/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h b/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h index 6ea71da55..6a16724a1 100644 --- a/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/jungfrauDetectorServer/RegisterDefs.h @@ -301,7 +301,8 @@ #define CONFIG_V12_STRG_CLL_OFST (0) #define CONFIG_V12_STRG_CLL_MSK (0x0000FFFF << CONFIG_V12_STRG_CLL_OFST) - +#define CONFIG_V12_RST_STP_RDCTN_OFST (18) +#define CONFIG_V12_RST_STP_RDCTN_MSK (0x00000001 << CONFIG_V12_RST_STP_RDCTN_OFST) // CSM mode = high current (100%), low current (16%) #define CONFIG_V11_CRRNT_SRC_LOW_OFST (19) #define CONFIG_V11_CRRNT_SRC_LOW_MSK (0x00000001 << CONFIG_V11_CRRNT_SRC_LOW_OFST) @@ -412,6 +413,10 @@ #define DAQ_CRRNT_SRC_CLMN_SLCT_OFST (20) #define DAQ_CRRNT_SRC_CLMN_SLCT_MSK (0x0000003F << DAQ_CRRNT_SRC_CLMN_SLCT_OFST) #define DAQ_GAIN_MODE_MASK (DAQ_FRCE_SWTCH_GAIN_MSK | DAQ_FIX_GAIN_MSK | DAQ_CMP_RST_MSK) +#define DAQ_CDS_BYPASS_OFST (28) +#define DAQ_CDS_BYPASS_MSK (0x00000001 << DAQ_CDS_BYPASS_OFST) +#define DAQ_CDS_RESET_OFST (29) +#define DAQ_CDS_RESET_MSK (0x00000001 << DAQ_CDS_RESET_OFST) /** Chip Power Register */ #define CHIP_POWER_REG (0x5E << MEM_MAP_SHIFT) @@ -494,8 +499,8 @@ Time before end of exposure when comparator is disabled */ // tDS = (DST + 1) * 25ns #define ASIC_CTRL_DS_TMR_OFST (8) #define ASIC_CTRL_DS_TMR_MSK (0x000000FF << ASIC_CTRL_DS_TMR_OFST) -#define ASIC_CTRL_DS_TMR_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK) -#define ASIC_CTRL_DS_TMR_CHIP1_1_VAL ((0xFF << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK) +#define ASIC_CTRL_DS_TMR_LOW_RES_VAL ((0x1F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK) +#define ASIC_CTRL_DS_TMR_HIGH_RES_VAL ((0x5F << ASIC_CTRL_DS_TMR_OFST) & ASIC_CTRL_DS_TMR_MSK) /* ADC 0 Deserializer Control */ #define ADC_DSRLZR_0_REG (0xF0 << MEM_MAP_SHIFT) diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 362047d64..4f6b9ee94 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index 706778402..7ccc5baa4 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -49,9 +49,15 @@ enum detectorSettings thisSettings = UNINITIALIZED; static enum CHIPINDEX chipIndex = v1_0; int highvoltage = 0; int dacValues[NDAC] = {}; -int defaultDacValues[] = DEFAULT_DAC_VALS; -int defaultDacValue_G0[] = SPECIAL_DEFAULT_DYNAMIC_GAIN_VALS; -int defaultDacValue_HG0[] = SPECIAL_DEFAULT_DYNAMICHG0_GAIN_VALS; +int defaultDacValues[NDAC] = DEFAULT_DAC_VALS; + +static int defaultDacList_G0[NSPECIALDACS] = SPECIAL_DEFAULT_DYNAMIC_GAIN_VALS; +static int defaultDacList_HG0[NSPECIALDACS] = + SPECIAL_DEFAULT_DYNAMICHG0_GAIN_VALS; +static int defaultDacList_v1_2[NSPECIALDACS] = SPECIAL_DEFAULT_V1_2_GAIN_VALS; +int *defaultDacValue_G0 = defaultDacList_G0; +int *defaultDacValue_HG0 = defaultDacList_HG0; + int32_t clkPhase[NUM_CLOCKS] = {}; int detPos[4] = {}; bool chipConfigured = false; @@ -67,6 +73,7 @@ bool has_current_src_normal = false; bool has_current_src_64bit_selection = false; bool has_current_src_reverse_bits_selection = false; bool has_storage_start_in_chip_config = false; +bool has_step_reduction = false; int isInitCheckDone() { return initCheckDone; } @@ -406,6 +413,8 @@ int setChipIndex(enum CHIPINDEX ind, char *mess) { return setChipVersionInFPGA(mess); } +enum CHIPINDEX getChipIndex() { return chipIndex; } + int validateChipIndex(enum CHIPINDEX ind, char *mess) { if (ind < 0 || ind >= NUM_CHIP_INDICES) { sprintf(mess, "Invalid chip index %d. Options: %s\n", (int)ind, @@ -437,6 +446,9 @@ void setChipIndexAllowedFeatures() { has_current_src_64bit_selection = false; has_current_src_reverse_bits_selection = false; has_storage_start_in_chip_config = false; + has_step_reduction = false; + defaultDacValue_G0 = defaultDacList_G0; + defaultDacValue_HG0 = defaultDacList_HG0; break; case v1_1: has_configure_chip = true; @@ -447,6 +459,9 @@ void setChipIndexAllowedFeatures() { has_current_src_64bit_selection = true; has_current_src_reverse_bits_selection = true; has_storage_start_in_chip_config = true; + has_step_reduction = false; + defaultDacValue_G0 = defaultDacList_G0; + defaultDacValue_HG0 = defaultDacList_HG0; break; case v1_2_NORMAL: case v1_2_LOW_NOISE: @@ -459,6 +474,9 @@ void setChipIndexAllowedFeatures() { has_current_src_64bit_selection = true; has_current_src_reverse_bits_selection = false; has_storage_start_in_chip_config = true; + has_step_reduction = true; + defaultDacValue_G0 = defaultDacList_v1_2; + defaultDacValue_HG0 = defaultDacList_v1_2; break; default: LOG(logERROR, ("Unknown chip index %d\n", (int)chipIndex)); @@ -617,6 +635,9 @@ void setupDetector() { clkPhase[i] = 0; } chipConfigured = false; + defaultDacValue_G0 = defaultDacList_G0; + defaultDacValue_HG0 = defaultDacList_HG0; + #ifdef VIRTUAL if (isControlServer) { sharedMemory_setStatus(IDLE); @@ -700,6 +721,10 @@ void setupDetector() { return; setGainMode(DEFAULT_GAINMODE); + autoCompDisable(DEFAULT_AUTO_COMP_DISABLE); + setComparatorDisableTime(chipIndex == v1_0 ? DEFAULT_COMP_DISABLE_TIME_v1_0 + : DEFAULT_COMP_DISABLE_TIME); + setNumFrames(DEFAULT_NUM_FRAMES); setNumTriggers(DEFAULT_NUM_CYCLES); setExpTime(DEFAULT_EXPTIME); @@ -725,6 +750,8 @@ void setupDetector() { setFilterResistor(DEFAULT_FILTER_RESISTOR); if (hasFilterCellsFeature()) setNumberOfFilterCells(DEFAULT_FILTER_CELL); + if (hasStepReductionFeature()) + enableStepReduction(); if (!isHardwareVersion_1_0()) { setFlipRows(DEFAULT_FLIP_ROWS); @@ -2225,6 +2252,8 @@ bool hasStorageCellStartInChipConfig() { return has_storage_start_in_chip_config; } +bool hasStepReductionFeature() { return has_step_reduction; } + bool isChipConfigured() { return chipConfigured; } void configureChip() { @@ -2292,16 +2321,31 @@ int64_t getComparatorDisableTime() { } void configureASICTimer() { + configureAsicPrechargeTimer(); + configureAsicDSTimer(); +} + +void configureAsicPrechargeTimer() { bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_PRCHRG_TMR_MSK) | ASIC_CTRL_PRCHRG_TMR_VAL); + uint32_t retval = ((bus_r(ASIC_CTRL_REG) & ASIC_CTRL_PRCHRG_TMR_MSK) >> + ASIC_CTRL_PRCHRG_TMR_OFST); + LOG(logINFO, ("Configured ASIC Precharge Timer [0x%x]\n", retval)); +} - uint32_t val = ASIC_CTRL_DS_TMR_CHIP1_1_VAL; - // TODO: value of chipindex v1_2 value to be decided. - if (chipIndex == v1_0) { - val = ASIC_CTRL_DS_TMR_VAL; +void configureAsicDSTimer() { + // chipv1.0 => always low res val + // chipv1.1+ => depending on res filter + uint32_t val = ASIC_CTRL_DS_TMR_LOW_RES_VAL; + if (chipIndex != v1_0 && getFilterResistor() == 1) { + val = ASIC_CTRL_DS_TMR_HIGH_RES_VAL; } bus_w(ASIC_CTRL_REG, (bus_r(ASIC_CTRL_REG) & ~ASIC_CTRL_DS_TMR_MSK) | val); - LOG(logINFO, ("Configured ASIC Timer [0x%x]\n", bus_r(ASIC_CTRL_REG))); + uint32_t retval = ((bus_r(ASIC_CTRL_REG) & ASIC_CTRL_DS_TMR_MSK) >> + ASIC_CTRL_DS_TMR_OFST); + LOG(logINFO, ("Configured ASIC DS Timer [0x%x]\n", retval)); + + LOG(logINFO, ("asic reg:0x%x\n", bus_r(ASIC_CTRL_REG))); } int setReadoutSpeed(int val) { @@ -2652,22 +2696,26 @@ int getFilterResistor() { } int setFilterResistor(int value) { + if (value != 0 && value != 1) { + LOG(logERROR, ("Invalid value for Filter Resistor: %d\n", value)); + return FAIL; + } + // lower resistor if (value == 0) { LOG(logINFO, ("Setting Lower Filter Resistor\n")); bus_w(CONFIG_V11_REG, bus_r(CONFIG_V11_REG) | CONFIG_V11_FLTR_RSSTR_SMLR_MSK); - return OK; } // higher resistor else if (value == 1) { LOG(logINFO, ("Setting Higher Filter Resistor\n")); bus_w(CONFIG_V11_REG, bus_r(CONFIG_V11_REG) & ~CONFIG_V11_FLTR_RSSTR_SMLR_MSK); - return OK; } - LOG(logERROR, ("Could not set Filter Resistor. Invalid value %d\n", value)); - return FAIL; + + configureAsicDSTimer(); + return OK; } int getNumberOfFilterCells() { @@ -2681,8 +2729,8 @@ int getNumberOfFilterCells() { // flip all contents of register //TODO FIRMWARE FIX regval ^= BIT32_MASK; #endif - uint32_t retval = - (regval & CONFIG_V11_FLTR_CLL_MSK) >> CONFIG_V11_FLTR_CLL_OFST; + uint32_t retval = (regval & CONFIG_V11_STATUS_FLTR_CLL_MSK) >> + CONFIG_V11_STATUS_FLTR_CLL_OFST; // count number of bits = which icell return (__builtin_popcount(retval)); } @@ -2919,6 +2967,11 @@ void setPedestalMode(int enable, uint8_t frames, uint16_t loops) { } } +void enableStepReduction() { + LOG(logINFO, ("Enabling step reduction\n")); + bus_w(CONFIG_V11_REG, bus_r(CONFIG_V11_REG) | CONFIG_V12_RST_STP_RDCTN_MSK); +} + int setTimingInfoDecoder(enum timingInfoDecoder val) { switch (val) { case SWISSFEL: @@ -2962,11 +3015,17 @@ int getElectronCollectionMode() { void setElectronCollectionMode(int enable) { LOG(logINFO, ("Setting Collection Mode to %s\n", enable == 0 ? "Hole" : "Electron")); + + uint32_t val = bus_r(DAQ_REG); + uint32_t mask = + DAQ_ELCTRN_CLLCTN_MDE_MSK | DAQ_CDS_BYPASS_MSK | DAQ_CDS_RESET_MSK; if (enable) { - bus_w(DAQ_REG, bus_r(DAQ_REG) | DAQ_ELCTRN_CLLCTN_MDE_MSK); + val |= mask; + LOG(logINFO, ("\tCDS reset and bypassed\n")); } else { - bus_w(DAQ_REG, bus_r(DAQ_REG) & ~DAQ_ELCTRN_CLLCTN_MDE_MSK); + val &= ~mask; } + bus_w(DAQ_REG, val); configureChip(); } @@ -3070,16 +3129,19 @@ void *start_timer(void *arg) { const int maxRows = MAX_ROWS_PER_READOUT; int readNRows = getReadNRows(); if (readNRows == -1) { - LOG(logERROR, - ("number of rows is -1. Assuming no partial readout (#rows).\n")); + LOG(logERROR, ("number of rows is -1. Assuming no partial readout " + "(#rows).\n")); readNRows = MAX_ROWS_PER_READOUT; } const int packetsPerFrame = ((maxPacketsPerFrame / 2) * readNRows) / (maxRows / 2); // Generate data - char imageData[DATA_BYTES]; - memset(imageData, 0, DATA_BYTES); + char *imageData = (char *)calloc(DATA_BYTES, 1); + if (imageData == NULL) { + LOG(logERROR, ("Could not allocate memory for virtual image\n")); + exit(EXIT_FAILURE); + } { const int npixels = (NCHAN * NCHIP); const int pixelsPerPacket = dataSize / NUM_BYTES_PER_PIXEL; @@ -3252,6 +3314,7 @@ void *start_timer(void *arg) { } setNextFrameNumber(frameNr + numFrames); } + free(imageData); closeUDPSocket(0); if (numInterfaces == 2) { @@ -3300,7 +3363,8 @@ int softwareTrigger(int block) { LOG(logINFO, ("Sending Software Trigger\n")); bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_SOFTWARE_TRIGGER_MSK); bus_w(CONTROL_REG, bus_r(CONTROL_REG) & ~CONTROL_SOFTWARE_TRIGGER_MSK); - // wait to make sure its out of this state and even 'wait for start frame' + // wait to make sure its out of this state and even 'wait for start + // frame' usleep(100); #ifndef VIRTUAL diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.h b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.h index 64bd7f71e..e65ed3d37 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.h +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.h @@ -63,6 +63,7 @@ int setChipVersionIntFromConfigFile(int val, char *mess); // for backward compatibility int setChipVersionStringFromConfigFile(char *cval, char *mess); int setChipIndex(enum CHIPINDEX ind, char *mess); +enum CHIPINDEX getChipIndex(); int validateChipIndex(enum CHIPINDEX ind, char *mess); void setChipIndexAllowedFeatures(); int setChipVersionInFPGA(char *mess); @@ -189,12 +190,15 @@ bool hasCurrentSourceNormalFeature(); bool hasCurrentSource64BitSelectionFeature(); bool hasCurrentSourceReverseBitsSelectionFeature(); bool hasStorageCellStartInChipConfig(); +bool hasStepReductionFeature(); bool isChipConfigured(); void configureChip(); int autoCompDisable(int on); int setComparatorDisableTime(int64_t val); int64_t getComparatorDisableTime(); void configureASICTimer(); +void configureAsicPrechargeTimer(); +void configureAsicDSTimer(); int setReadoutSpeed(int val); int getReadoutSpeed(int *retval); int setPhase(enum CLKINDEX ind, int val, int degrees); @@ -220,6 +224,7 @@ uint64_t getSelectCurrentSource(); int getPedestalMode(); void getPedestalParameters(uint8_t *frames, uint16_t *loops); void setPedestalMode(int enable, uint8_t frames, uint16_t loops); +void enableStepReduction(); int setTimingInfoDecoder(enum timingInfoDecoder val); int getTimingInfoDecoder(enum timingInfoDecoder *retval); int getElectronCollectionMode(); diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h index aaf8fd7fc..98e474212 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h @@ -37,6 +37,9 @@ #define CONFIG_FILE ("config_jungfrau.txt") /** Default Parameters */ +#define DEFAULT_AUTO_COMP_DISABLE (0) +#define DEFAULT_COMP_DISABLE_TIME_v1_0 (5 * 1000) // 5us +#define DEFAULT_COMP_DISABLE_TIME (2 * 1000) // 2us #define DEFAULT_NUM_FRAMES (100 * 1000 * 1000) #define DEFAULT_STARTING_FRAME_NUMBER (1) #define DEFAULT_NUM_CYCLES (1) @@ -55,7 +58,7 @@ #define DEFAULT_STRG_CLL_STRT_CHIP11 (0x3) #define DEFAULT_STRG_CLL_DLY (0) #define DEFAULT_FLIP_ROWS (0) -#define DEFAULT_FILTER_RESISTOR (1) // higher resistor +#define DEFAULT_FILTER_RESISTOR (0) // lower resistor #define DEFAULT_FILTER_CELL (0) #define DEFAULT_PEDESTAL_MODE (0) #define DEFAULT_PEDESTAL_FRAMES (1) @@ -236,6 +239,8 @@ enum MASTERINDEX { MASTER_HARDWARE, OW_MASTER, OW_SLAVE }; { 1450, 480, 420 } #define SPECIAL_DEFAULT_DYNAMICHG0_GAIN_VALS \ { 1550, 450, 620 } +#define SPECIAL_DEFAULT_V1_2_GAIN_VALS \ + { 1500, 480, 460 } enum NETWORKINDEX { TXN_FRAME, FLOWCTRL_10G }; enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; diff --git a/slsDetectorServers/matterhornServer/CMakeLists.txt b/slsDetectorServers/matterhornServer/CMakeLists.txt index 34d539b08..e0a55f5e6 100644 --- a/slsDetectorServers/matterhornServer/CMakeLists.txt +++ b/slsDetectorServers/matterhornServer/CMakeLists.txt @@ -41,9 +41,7 @@ if(SLS_USE_SIMULATOR) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) - install(TARGETS matterhornDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) + sls_install_executable(matterhornDetectorServer_virtual) endif() # maybe better to have a else if build with simulators on one always uses the virtual server in MatterhornApp if(SLS_USE_MATTERHORN) @@ -91,9 +89,7 @@ if(SLS_USE_MATTERHORN) RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY} ) - install(TARGETS matterhornDetectorServer - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) + sls_install_executable(matterhornDetectorServer) endif() if(SLS_USE_TESTS) diff --git a/slsDetectorServers/matterhornServer/src/BaseMatterhornServerImpl.hpp b/slsDetectorServers/matterhornServer/src/BaseMatterhornServerImpl.hpp index 9d0e45d22..8131d7658 100644 --- a/slsDetectorServers/matterhornServer/src/BaseMatterhornServerImpl.hpp +++ b/slsDetectorServers/matterhornServer/src/BaseMatterhornServerImpl.hpp @@ -21,6 +21,8 @@ class BaseMatterhornServerImpl : public DetectorServerImpl< is_stop_server::value> { public: + using BaseServerImpl = + DetectorServerImpl::value>; BaseMatterhornServerImpl(); ~BaseMatterhornServerImpl() = default; @@ -93,7 +95,7 @@ void BaseMatterhornServerImpl::setupDetector() { // TODO: extend try { // stop server does not talk to the board - if constexpr (!this->stop_server) { + if constexpr (!BaseServerImpl::stop_server) { set_num_frames(1); set_num_triggers(1); set_counter_mask(0xF); // enable counter all counters by default diff --git a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt index dc664d7e4..2ee45681b 100644 --- a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt @@ -37,9 +37,8 @@ set_target_properties(moenchDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS moenchDetectorServer_virtual +sls_install_executable(moenchDetectorServer_virtual EXPORT "${TARGETS_EXPORT_NAME}" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) configure_file(detid_moench.txt ${CMAKE_BINARY_DIR}/bin/detid_moench.txt COPYONLY) diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index 509c92a15..1b9d7b343 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -1972,8 +1972,11 @@ void *start_timer(void *arg) { ((maxPacketsPerFrame / 2) * readNRows) / (maxRows / 2); // Generate data - char imageData[DATA_BYTES]; - memset(imageData, 0, DATA_BYTES); + char *imageData = (char *)calloc(DATA_BYTES, 1); + if (imageData == NULL) { + LOG(logERROR, ("Could not allocate memory for virtual image\n")); + exit(EXIT_FAILURE); + } { const int npixels = (NCHAN * NCHIP); const int pixelsPerPacket = dataSize / NUM_BYTES_PER_PIXEL; @@ -2101,6 +2104,7 @@ void *start_timer(void *arg) { } setNextFrameNumber(frameNr + numFrames); } + free(imageData); closeUDPSocket(0); if (numInterfaces == 2) { diff --git a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt index 10cffa217..6a942ddb4 100644 --- a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt @@ -41,9 +41,7 @@ set_target_properties(mythen3DetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS mythen3DetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(mythen3DetectorServer_virtual) configure_file(DefaultPattern_mythen3.txt ${CMAKE_BINARY_DIR}/bin/DefaultPattern_mythen3.txt COPYONLY) configure_file(detid_mythen3.txt ${CMAKE_BINARY_DIR}/bin/detid_mythen3.txt COPYONLY) diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 1d6b51aef..cac509a27 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -2277,7 +2277,7 @@ int set_num_additional_storage_cells(int file_des) { #else // only set if (Server_VerifyLock() == OK) { - if (!hasStorageCellsFeature()) { + if (!hasStorageCellsFeature() || getChipIndex() > v1_1) { ret = FAIL; sprintf(mess, "Cannot set addl. number of storage cells for this " "chip version\n"); diff --git a/slsDetectorServers/slsDetectorServer_cpp/src/DetectorServerImpl.cpp b/slsDetectorServers/slsDetectorServer_cpp/src/DetectorServerImpl.cpp index 959fa2080..abc47935f 100644 --- a/slsDetectorServers/slsDetectorServer_cpp/src/DetectorServerImpl.cpp +++ b/slsDetectorServers/slsDetectorServer_cpp/src/DetectorServerImpl.cpp @@ -5,9 +5,6 @@ namespace sls { -template class DetectorServerImpl; // forward declare -template class DetectorServerImpl; // forward declare - template DetectorServerImpl::DetectorServerImpl() { udpDetails[0].srcport = DEFAULT_UDP_SRC_PORTNO; @@ -114,4 +111,9 @@ DetectorServerImpl::get_detector_setup_status() const { return detectorSetupStatus; } +template class DetectorServerImpl; // explicit instantiation for stop + // server +template class DetectorServerImpl; // explicit instantiation for control + // server + } // namespace sls \ No newline at end of file diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt index 284c9b6fc..2fee93ca8 100644 --- a/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt @@ -41,9 +41,7 @@ set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS xilinx_ctbDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(xilinx_ctbDetectorServer_virtual) configure_file(chip_config_xilinx.txt ${CMAKE_BINARY_DIR}/bin/chip_config_xilinx.txt COPYONLY) configure_file(reset_chip_xilinx.txt ${CMAKE_BINARY_DIR}/bin/reset_chip_xilinx.txt COPYONLY) diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/xilinx_ctbDetectorServer/slsDetectorFunctionList.c index 573b68b48..d72fc5f74 100644 --- a/slsDetectorServers/xilinx_ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/xilinx_ctbDetectorServer/slsDetectorFunctionList.c @@ -1601,11 +1601,10 @@ void *start_timer(void *arg) { packetSize, packetsPerFrame)); // Generate Data - char *imageData = (char *)malloc(imageSize); - memset(imageData, 0, imageSize); + char *imageData = (char *)calloc(imageSize, 1); if (imageData == NULL) { - LOG(logERROR, ("Can not allocate image.\n")); - return NULL; + LOG(logERROR, ("Could not allocate memory for virtual image\n")); + exit(EXIT_FAILURE); } for (int i = 0; i < imageSize; i += sizeof(uint16_t)) { *((uint16_t *)(imageData + i)) = i; @@ -1672,6 +1671,8 @@ void *start_timer(void *arg) { } } setNextFrameNumber(frameNr + numFrames); + free(imageData); + closeUDPSocket(0); sharedMemory_setStatus(IDLE); diff --git a/slsDetectorSoftware/CMakeLists.txt b/slsDetectorSoftware/CMakeLists.txt index 472205230..bccb64498 100755 --- a/slsDetectorSoftware/CMakeLists.txt +++ b/slsDetectorSoftware/CMakeLists.txt @@ -109,21 +109,9 @@ if(SLS_USE_TEXTCLIENT) set_property(TARGET ${val1} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() - # Mainly for RPMs to enable side by side installations of different versions - if(SLS_INSTALL_VERSIONED_BINARIES) - install(PROGRAMS "$" - DESTINATION bin - RENAME "$-${PROJECT_VERSION}" - COMPONENT cli - ) - else() - install(TARGETS ${val1} - DESTINATION bin - COMPONENT cli - ) - endif() + sls_install_executable(${val1} DESTINATION bin COMPONENT cli) endforeach() - + endif(SLS_USE_TEXTCLIENT) diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp index 08bb564b0..19fdbad66 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp @@ -277,8 +277,8 @@ TEST_CASE("extrastoragecells", "[.detectorintegration]") { auto det_type = det.getDetectorType().squash(); if (det_type == defs::JUNGFRAU) { auto chipVersion = chipVersionToX10(det.getChipVersion().squash()); - // chip version 1.0 and 1.2 - if (chipVersion == 10 || chipVersion == 12) { + // currently only chip version 1.0, later firmware for 1.2 + if (chipVersion == 10) { //} || chipVersion == 12) { auto prev_val = det.getNumberOfAdditionalStorageCells().tsquash( "inconsistent #additional storage cells to test"); { diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index be56105b5..8c00cd8eb 100755 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -173,22 +173,12 @@ if (SLS_USE_RECEIVER_BINARIES) slsMultiReceiver slsFrameSynchronizer ) - if(SLS_INSTALL_VERSIONED_BINARIES) - message(STATUS "Versioned binaries will be installed") - foreach(target IN LISTS SLS_RECEIVER_BINARIES) - install(PROGRAMS "$" - DESTINATION ${CMAKE_INSTALL_BINDIR} - RENAME "$-${PROJECT_VERSION}" - COMPONENT receiver - ) - endforeach() - else() - install(TARGETS ${SLS_RECEIVER_BINARIES} + foreach(target IN LISTS SLS_RECEIVER_BINARIES) + sls_install_executable(${target} EXPORT "${TARGETS_EXPORT_NAME}" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT receiver ) - endif() + endforeach() diff --git a/slsReceiverSoftware/src/Fifo.cpp b/slsReceiverSoftware/src/Fifo.cpp index 1bec44e12..6740c8ae2 100644 --- a/slsReceiverSoftware/src/Fifo.cpp +++ b/slsReceiverSoftware/src/Fifo.cpp @@ -81,7 +81,10 @@ void Fifo::DestroyFifos() { fifoStream = nullptr; } -void Fifo::FreeAddress(char *&address) { fifoFree->push(address); } +void Fifo::FreeAddress(char *&address) { + std::lock_guard lock(fifoFreeMutex); + fifoFree->push(address); +} void Fifo::GetNewAddress(char *&address) { int temp = fifoFree->getDataValue(); diff --git a/slsReceiverSoftware/src/Fifo.h b/slsReceiverSoftware/src/Fifo.h index 729ce368b..fe9f3cf1e 100644 --- a/slsReceiverSoftware/src/Fifo.h +++ b/slsReceiverSoftware/src/Fifo.h @@ -16,6 +16,7 @@ #include "sls/sls_detector_defs.h" #include +#include namespace sls { @@ -52,6 +53,9 @@ class Fifo : private virtual slsDetectorDefs { int fifoDepth; std::atomic status_fifoBound; std::atomic status_fifoFree; + /** fifoFree has several producers, CircularFifo allows only one. + * Aligned to avoid false sharing with the members above */ + alignas(128) std::mutex fifoFreeMutex; }; } // namespace sls diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 73955104c..7828cff07 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -8,6 +8,6 @@ #define APIMOENCH "0.0.0 0x260424" #define APIEIGER "0.0.0 0x260807" #define APIXILINXCTB "0.0.0 0x260813" -#define APIJUNGFRAU "0.0.0 0x260902" +#define APIJUNGFRAU "0.0.0 0x261002" #define APIMYTHEN3 "0.0.0 0x260506" #define APIMATTERHORN "0.0.0 0x260529"