Compare commits

..

42 Commits

Author SHA1 Message Date
7044f7b085 Logger: handle situation when git sha1 is empty 2024-05-14 22:22:15 +02:00
165fe1a432 FPGA: build script is safe for situations when git is absent 2024-05-14 22:21:58 +02:00
ad2bc91582 Remove .gitmodules file 2024-05-14 21:53:43 +02:00
c1e9cc5d3c Update spdlog (working on better integration) 2024-05-14 21:51:17 +02:00
eb0e5daf8f catch2: download with CMake + update to recent Catch2 2024-05-14 21:31:34 +02:00
9f1b6a6e96 fast-feedback-indexer: download with CMake 2024-05-14 20:57:29 +02:00
81db3af275 slsDetectorPackage: download with CMake 2024-05-14 20:54:42 +02:00
8cd5787848 bitshuffle_hperf: put directly into the repository 2024-05-14 20:50:12 +02:00
ebd3628eab bitshuffle_hperf: put directly into the repository 2024-05-14 20:48:15 +02:00
e02f8692f9 zstd: built via cmake 2024-05-14 20:42:34 +02:00
f27126fa1f pistache: built via cmake 2024-05-14 20:36:50 +02:00
d2c5b9c038 tinycbor: internal to repository 2024-05-14 20:30:19 +02:00
ff191c8490 tinycbor: remove submodule 2024-05-14 20:28:43 +02:00
ced40a7170 PreviewImage: Add resolution ring (experimental) 2024-05-14 18:53:11 +02:00
37e825a018 FPGA: Spot finder masks module edges, improve testing in this regard 2024-05-14 18:01:40 +02:00
36257d7009 CI: Create release as part of CI - should be working now 2024-05-14 17:39:58 +02:00
786b28ed78 CI: Create release as part of CI (another try) 2024-05-14 17:21:22 +02:00
bd86809bdd CI: Create release as part of CI (another try) 2024-05-14 17:05:39 +02:00
af366acb08 CI: Create release as part of CI (another try) 2024-05-14 16:40:42 +02:00
4fe2904b47 CI: Create release as part of CI (try again) 2024-05-14 15:12:39 +02:00
c97749c16a CI: Create release as part of CI 2024-05-14 14:54:47 +02:00
bd43b09b4c Revert "CI: More serious test of package registry"
This reverts commit dcd6088afe.
2024-05-14 14:45:26 +02:00
dcd6088afe CI: More serious test of package registry 2024-05-14 14:39:26 +02:00
b4c26b036f CI: Try release pipeline with runner tag 2024-05-14 14:29:02 +02:00
b2a7dadef7 CI: Try release pipeline 2024-05-14 14:21:00 +02:00
5808d2c5bc VERSION: Add package version to git 2024-05-14 14:05:14 +02:00
c71728e16f Dockerfile: add comment for MAX IV 2024-05-14 13:49:42 +02:00
10b8398bd0 CI: test 2024-05-14 13:29:55 +02:00
9c1796a9e6 CMake: Remove ZeroMQ CMake module 2024-05-07 15:27:34 +02:00
3cbf675120 CI: Building HLS is NOT requirement to build firmware (it will fail anyway 2024-05-07 15:12:58 +02:00
1aa1da92ff CI: Fix FPGA .mcs name and FPGA build is optional if not required 2024-05-07 15:11:53 +02:00
07a1659e94 CI: Fix FPGA .mcs name 2024-05-07 15:09:53 +02:00
bc1285acc6 CI: FPGA HLS is built in parallel with 4 threads 2024-05-07 14:45:35 +02:00
c330a0ed81 CI: FPGA images are called jfjoch_fpga_{FLOW}.mcs 2024-05-07 14:43:30 +02:00
cdba3000d2 README.md: Linkt to broker/writer subdirectories 2024-05-07 14:34:24 +02:00
db47da3b6d README.md: Remove part on .mcs naming 2024-05-07 14:33:22 +02:00
d3420d7f0c CI: Fix driver artifact 2024-05-07 14:13:58 +02:00
975442f452 README.md: Remove CompressionBenchmark 2024-05-07 14:13:28 +02:00
4c87554233 nextgendcu/broker/README.md: Updates 2024-05-07 14:12:15 +02:00
b5da66baf6 CompressionBenchmark: Remove 2024-05-07 14:11:21 +02:00
69d34e22f7 CI: Update 2024-05-07 14:05:51 +02:00
89cf520e52 FPGAIntegrationTest: Truncate number of test images 2024-05-07 14:00:15 +02:00
1037 changed files with 57278 additions and 113945 deletions

View File

@@ -1,112 +0,0 @@
name: Build Packages
on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
workflow_dispatch:
jobs:
build-rpm:
name: build:rpm (${{ matrix.distro }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: jfjoch_rocky8
distro: rocky8
cmake_flags: -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON
- runner: jfjoch_rocky8
distro: rocky8_sls9
cmake_flags: -DJFJOCH_INSTALL_DRIVER_SOURCE=OFF -DJFJOCH_VIEWER_BUILD=OFF -DSLS9=ON
- runner: jfjoch_rocky9
distro: rocky9
cmake_flags: -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON
- runner: jfjoch_ubuntu2204
distro: ubuntu2204
cmake_flags: -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON
- runner: jfjoch_ubuntu2404
distro: ubuntu2404
cmake_flags: -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON
- runner: jfjoch_rocky8
distro: rocky8_nocuda
cmake_flags: -DJFJOCH_INSTALL_DRIVER_SOURCE=OFF -DJFJOCH_VIEWER_BUILD=OFF -DJFJOCH_USE_CUDA=OFF
steps:
- uses: actions/checkout@v4
- name: Build packages
shell: bash
run: |
mkdir -p build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} ..
ninja frontend
ninja -j16 package
shopt -s nullglob
files=( *.rpm *.deb )
if (( ${#files[@]} )); then
mv "${files[@]}" ..
else
echo "No packages found to move"
fi
python-client:
name: Generate python client
runs-on: jfjoch_rocky8
steps:
- uses: actions/checkout@v4
- name: Build python client
shell: bash
run: bash gen_python_client.sh
documentation:
name: Build documentation
runs-on: jfjoch_rocky8
steps:
- uses: actions/checkout@v4
- name: Build documentation
shell: bash
run: bash make_doc.sh
- name: Tag-only step
if: github.ref_type == 'tag'
shell: bash
run: echo "This runs only when the workflow is triggered by a tag"
gpu-test:
name: GPU test
runs-on: jfjoch_rocky8
container:
image: gitea.psi.ch/leonarski_f/jfjoch_rocky8:2509
options: --gpus all
steps:
- name: List GPUs
shell: bash
run: nvidia-smi
unit-tests:
name: Unit tests
runs-on: jfjoch_rocky8
container:
image: gitea.psi.ch/leonarski_f/jfjoch_rocky8:2509
options: --gpus all
timeout-minutes: 90
env:
CTEST_OUTPUT_ON_FAILURE: '1'
steps:
- uses: actions/checkout@v4
- name: Build tests
shell: bash
run: |
mkdir -p build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
ninja -j48 jfjoch_test jfjoch_hdf5_test
- name: Run unit tests
shell: bash
run: |
cd build/tests
./jfjoch_test
- name: Run hdf5 test
shell: bash
run: |
cd build/tools
./jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5

5
.gitignore vendored
View File

@@ -1,5 +0,0 @@
cmake-build-debug/
cmake-build-release/
build*/
python-client/
openapi-generator-cli.jar

View File

@@ -4,12 +4,10 @@ stages:
- synthesis
- release
variables:
CMAKE_PREFIX_PATH: /opt/qt6:/opt/eigen-3.4
build:x86:gcc-11:
build:x86:gcc:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
CC: gcc
CXX: g++
tags:
@@ -19,45 +17,14 @@ build:x86:gcc-11:
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-11/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
- make -j48
build:x86:gcc-12:
stage: build
variables:
CC: gcc
CXX: g++
tags:
- gcc
- x86
needs: []
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
- make -j48
build:x86:gcc-13:
stage: build
variables:
CC: gcc
CXX: g++
tags:
- gcc
- x86
needs: []
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-13/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j48
build:x86:gcc_writer:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
CC: gcc
CXX: g++
tags:
@@ -69,125 +36,93 @@ build:x86:gcc_writer:
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_WRITER_ONLY=ON ..
- make -j48
build:x86:gcc_nocuda:
stage: build
variables:
CC: gcc
CXX: g++
tags:
- gcc
- x86
needs: []
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_USE_CUDA=OFF ..
- make -j48
- make -j48 jfjoch
build:x86:driver:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
CC: gcc
CXX: g++
tags:
- gcc
- x86
needs: []
artifacts:
paths:
- "jfjoch_driver.tar.gz"
expire_in: 1 week
script:
- cd fpga/pcie_driver
- make
- bash pack.sh
- mv jfjoch_driver.tar.gz ../..
build:x86:python_client:
build:x86:vitis_hls:
stage: build
needs: []
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- python
- x86
needs: []
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- fpga/hls/*
- fpga/hdl/*
- fpga/scripts/*
- fpga/xdc/*
- fpga/microblaze/*
- fpga/include/jfjoch_fpga.h
script:
- bash gen_python_client.sh
artifacts:
paths:
- jfjoch_client-*whl
- jfjoch_client-*tar.gz
expire_in: 1 week
- source /opt/Xilinx/Vitis_HLS/2022.1/settings64.sh
- mkdir build
- cd build
- /usr/bin/cmake ..
- make hls
build:x86:frontend:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- x86
needs: []
script:
- mkdir build
- cd frontend_ui
- npm install
- npm run build
- cd build
- /usr/bin/cmake ..
- make frontend
- cd ../frontend/dist
- tar czf ../../jfjoch_frontend.tar.gz *
artifacts:
paths:
- jfjoch_frontend.tar.gz
expire_in: 1 week
build:x86:rpm:
stage: build
tags:
- x86
needs: []
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON ..
- make frontend
- make -j48 package
- mv *.rpm ..
artifacts:
paths:
- "*.rpm"
expire_in: 1 week
build:x86:sls9:rpm:
stage: build
tags:
- x86
needs: []
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=OFF -DJFJOCH_VIEWER_BUILD=OFF -DSLS9=ON ..
- make frontend
- make -j48 package
- mv *.rpm ..
artifacts:
paths:
- "*.rpm"
expire_in: 1 week
test:x86:gcc:
stage: test
timeout: 90m
variables:
GIT_SUBMODULE_STRATEGY: recursive
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
needs: ["build:x86:gcc"]
dependencies: []
tags:
- gcc
- x86
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/rh/gcc-toolset-12/enable
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j48 jfjoch_test jfjoch_hdf5_test
- make -j48 CatchTest HDF5DatasetWriteTest
- cd tests
- ./jfjoch_test -r junit -o report.xml
- ./CatchTest -r junit -o report.xml
- cd ../tools
- ./jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5
- ./HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5
artifacts:
expire_in: 1 week
reports:
@@ -197,79 +132,59 @@ test:x86:crystfel:
stage: test
timeout: 90m
variables:
GIT_SUBMODULE_STRATEGY: recursive
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
needs: ["build:x86:gcc"]
dependencies: []
tags:
- gcc
- x86
- crystfel
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/rh/gcc-toolset-12/enable
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j8 jfjoch_hdf5_test
- make -j8 HDF5DatasetWriteTest
- cd ../tests/crystfel
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 10
- HDF5DATASET_WRITE_TEST_IMAGES_PER_FILE=0 ../../build/tools/HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5 10
- indexamajig -i writing_test.lst -g jf4m.geom -o x.stream --indexing=xgandalf
test:x86:xds_durin:
stage: test
timeout: 90m
variables:
GIT_SUBMODULE_STRATEGY: recursive
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
needs: ["build:x86:gcc"]
dependencies: []
tags:
- gcc
- x86
- xds
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/rh/gcc-toolset-12/enable
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j8 jfjoch_hdf5_test
- make -j8 HDF5DatasetWriteTest
- cd ../tests/xds_durin
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
- xds_par |grep -a1 ISa |tail -n1
test:x86:xds_durin_new_hdf5_format:
stage: test
timeout: 90m
variables:
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
dependencies: []
tags:
- gcc
- x86
- xds
script:
- source /opt/rh/gcc-toolset-12/enable
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j8 jfjoch_hdf5_test
- cd ../tests/xds_durin
- HDF5MASTER_NEW_FORMAT=1 ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
- HDF5DATASET_WRITE_TEST_IMAGES_PER_FILE=0 ../../build/tools/HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5 25
- xds_par |grep -a1 ISa |tail -n1
test:x86:xds_neggia:
stage: test
timeout: 90m
variables:
GIT_SUBMODULE_STRATEGY: recursive
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
needs: ["build:x86:gcc"]
dependencies: []
tags:
- gcc
@@ -280,67 +195,56 @@ test:x86:xds_neggia:
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j8 jfjoch_hdf5_test
- make -j8 HDF5DatasetWriteTest
- cd ../tests/xds_neggia
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
- HDF5DATASET_WRITE_TEST_IMAGES_PER_FILE=0 ../../build/tools/HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5 25
- xds_par |grep -a1 ISa |tail -n1
test:x86:xia2.ssx:
stage: test
timeout: 90m
variables:
GIT_SUBMODULE_STRATEGY: recursive
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
needs: ["build:x86:gcc"]
dependencies: []
tags:
- gcc
- x86
- xds
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/rh/gcc-toolset-12/enable
- mkdir -p build
- mkdir -p dials_test
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j8 jfjoch_hdf5_test
- make -j8 HDF5DatasetWriteTest
- cd ../dials_test
- ../build/tools/jfjoch_hdf5_test ../tests/test_data/compression_benchmark.h5 100
- ../build/tools/HDF5DatasetWriteTest ../tests/test_data/compression_benchmark.h5 100
- source /usr/local/dials-v3-17-0/dials_env.sh
- xia2.ssx image=writing_test_master.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000
synthesis:hls:
synthesis:vivado_pcie_100g:
stage: synthesis
dependencies: []
variables:
GIT_SUBMODULE_STRATEGY: recursive
CC: gcc
CXX: g++
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^HLS/
tags:
- vivado
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
- mkdir -p build
- cd build
- /usr/bin/cmake ..
- make hls
needs: ["build:x86:gcc-12", "test:x86:gcc"]
synthesis:100g:
stage: synthesis
dependencies: []
retry: 2
variables:
CC: gcc
CXX: g++
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^100G/
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "push"
allow_failure: true
changes:
- fpga/hls/*
- fpga/hdl/*
- fpga/scripts/*
- fpga/xdc/*
- fpga/pcie_driver/jfjoch_fpga.h
- when: manual
allow_failure: true
tags:
- vivado
artifacts:
@@ -348,26 +252,35 @@ synthesis:100g:
- "jfjoch_fpga_pcie_100g.mcs"
expire_in: 1 week
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- touch jfjoch_fpga_pcie_100g.mcs
- mkdir -p build
- cd build
- /usr/bin/cmake ..
- make -j4 pcie_100g
- mv fpga/jfjoch_fpga_pcie_100g.mcs ..
needs: ["build:x86:gcc-12", "test:x86:gcc"]
needs: ["build:x86:gcc", "test:x86:gcc"]
synthesis:8x10g:
synthesis:vivado_pcie_8x10g:
stage: synthesis
dependencies: []
variables:
GIT_SUBMODULE_STRATEGY: recursive
CC: gcc
CXX: g++
retry: 2
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^8x10G/
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- fpga/hls/*
- fpga/hdl/*
- fpga/scripts/*
- fpga/xdc/*
- fpga/pcie_driver/jfjoch_fpga.h
allow_failure: true
- when: manual
allow_failure: true
tags:
- vivado
artifacts:
@@ -376,26 +289,35 @@ synthesis:8x10g:
expire_in: 1 week
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- touch jfjoch_fpga_pcie_8x10g.mcs
- mkdir -p build
- cd build
- /usr/bin/cmake ..
- make -j4 pcie_8x10g
- mv fpga/jfjoch_fpga_pcie_8x10g.mcs ..
needs: [ "build:x86:gcc-12", "test:x86:gcc" ]
needs: [ "build:x86:gcc", "test:x86:gcc" ]
release:
stage: release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
when: manual
tags:
- x86
- python
dependencies:
- synthesis:vivado_pcie_8x10g
- synthesis:vivado_pcie_100g
- build:x86:frontend
- build:x86:rpm
- build:x86:sls9:rpm
- build:x86:python_client
- build:x86:driver
script:
- bash gitlab_upload_release.sh
- export PACKAGE_VERSION=`head -n1 VERSION`
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION}"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_driver.tar.gz "${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_frontend.tar.gz "${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_8x10g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs"'
- >
release-cli create --name "Release $PACKAGE_VERSION" --tag-name $PACKAGE_VERSION
--assets-link "{\"name\":\"jfjoch_driver.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz\"}"
--assets-link "{\"name\":\"jfjoch_frontend.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz\"}"
--assets-link "{\"name\":\"jfjoch_fpga_pcie_8x10g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs\"}"
--assets-link "{\"name\":\"jfjoch_fpga_pcie_100g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs\"}"

40
.miv_gitlab-ci.yml Normal file
View File

@@ -0,0 +1,40 @@
stages:
- mirror
- build
- publish
mirror-psi:
stage: mirror
script:
- SOURCE_REPOSITORY=https://$PSI_PROJECT_GIT_USRNAME:$PSI_PROJECT_GIT_TOKEN@gitlab.psi.ch/jungfraujoch/nextgendcu.git
- DESTINATION_REPOSITORY=https://$MIV_PROJECT_GIT_USRNAME:$MIV_PROJECT_GIT_TOKEN@gitlab.maxiv.lu.se/jungfraujoch/nextgendcu.git
- GIT_USER_NAME=git
- GIT_USER_EMAIL=git@maxiv.lu.se
- rm -rf _mirror_repo_tmp
- git clone --mirror $SOURCE_REPOSITORY _mirror_repo_tmp
- cd _mirror_repo_tmp
- git config --local user.name "${GIT_USER_NAME}"
- git config --local user.email "${GIT_USER_EMAIL}"
- git remote remove origin
- git remote add origin $DESTINATION_REPOSITORY
- git push --prune --all
- git push --prune --tags
after_script:
- rm -rf _mirror_repo_tmp
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule" && $CI_PIPELINE_SOURCE != "trigger"'
when: never
- if: '$MODE != "sync"'
when: never
- when: always
include:
- project: 'kits-maxiv/cfg-maxiv-gitlabci'
file: '/Docker.gitlab-ci.yml'
variables:
DOCKER_REGISTRY: "harbor.maxiv.lu.se/daq"
GIT_SUBMODULE_STRATEGY: recursive

View File

@@ -1,30 +0,0 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt

View File

@@ -1,117 +1,53 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.19)
FILE(STRINGS VERSION JFJOCH_VERSION)
PROJECT(jfjoch VERSION 1.0.0 LANGUAGES C CXX)
SET(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
PROJECT(Jungfraujoch VERSION 1.0 LANGUAGES C CXX)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED True)
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-deprecated-enum-enum-conversion")
SET(CMAKE_C_FLAGS_RELEASE "-O3")
SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only")
SET(JFJOCH_INSTALL_DRIVER_SOURCE OFF CACHE BOOL "Install kernel driver source (ignored if building writer only; necessary for RPM building)")
SET(JFJOCH_USE_CUDA ON CACHE BOOL "Compile Jungfraujoch with CUDA")
SET(JFJOCH_VIEWER_BUILD OFF CACHE BOOL "Compile Jungfraujoch viewer")
OPTION(SLS9 "Build with sls_detector_package v9.2.0" OFF)
SET(BUILD_SHARED_LIBS OFF)
SET(BUILD_TESTING OFF)
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -Wno-deprecated-enum-enum-conversion")
SET(CMAKE_C_FLAGS_RELEASE "-O3 -march=native -mtune=native")
SET(ZSTD_LEGACY_SUPPORT OFF)
SET(ZSTD_MULTITHREAD_SUPPORT OFF)
SET(ZSTD_BUILD_PROGRAMS OFF)
SET(ZSTD_BUILD_SHARED OFF)
SET(SLS_USE_RECEIVER OFF)
SET(SLS_USE_RECEIVER_BINARIES OFF)
SET(SLS_BUILD_SHARED_LIBRARIES OFF)
SET(BUILD_FAST_INDEXER OFF)
SET(BUILD_FAST_INDEXER_STATIC ON)
SET(HDF5_ENABLE_SZIP_SUPPORT OFF)
SET(HDF5_ENABLE_SZIP_ENCODING OFF)
SET(HDF5_BUILD_EXAMPLES OFF)
SET(HDF5_BUILD_CPP_LIB OFF)
SET(HDF5_ENABLE_Z_LIB_SUPPORT OFF)
SET(HDF5_EXTERNALLY_CONFIGURED 1)
# TIFF
SET(jbig OFF)
SET(zstd OFF)
SET(lzma OFF)
SET(jpeg OFF)
SET(old-jpeg OFF)
# PNG
set(PNG_SHARED OFF)
set(PNG_STATIC ON)
set(PNG_EXECUTABLES OFF)
set(PNG_TESTS OFF)
INCLUDE(CheckLanguage)
CHECK_LANGUAGE(CUDA)
SET(CMAKE_CUDA_ARCHITECTURES 75 80 86 89) # T4, A100, RTX A4000, L4
SET(CMAKE_CUDA_ARCHITECTURES 70 75 80 86 89) # V100, T4, A100, RTX A4000, L4
SET(CMAKE_CUDA_STANDARD 17)
SET(CMAKE_CUDA_FLAGS_RELEASE "-O3")
SET(JFJOCH_CUDA_AVAILABLE OFF)
IF (CMAKE_CUDA_COMPILER)
IF (JFJOCH_USE_CUDA)
ENABLE_LANGUAGE(CUDA)
FIND_PACKAGE(CUDAToolkit REQUIRED)
SET(CMAKE_CUDA_RUNTIME_LIBRARY Static)
MESSAGE(STATUS "CUDA VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA)
FIND_LIBRARY(CUDART_LIBRARY cudart_static PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
SET(JFJOCH_CUDA_AVAILABLE ON)
ELSE()
MESSAGE(WARNING "CUDA Available, but disabled by user")
ENDIF()
ENABLE_LANGUAGE(CUDA)
MESSAGE(STATUS "CUDA VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA)
FIND_LIBRARY(CUDART_LIBRARY cudart_static PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
ENDIF()
SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only")
INCLUDE_DIRECTORIES(include)
INCLUDE(CheckIncludeFile)
#This is to supress error in TORCH
IF ((NOT EXISTS /usr/bin/python) AND (EXISTS /usr/bin/python3))
SET(PYTHON_EXECUTABLE /usr/bin/python3)
ENDIF()
FIND_PACKAGE(Torch HINTS /opt/libtorch/share/cmake/Torch/)
FIND_LIBRARY(NUMA_LIBRARY NAMES numa DOC "NUMA Library")
CHECK_INCLUDE_FILE(numaif.h HAS_NUMAIF)
CHECK_INCLUDE_FILE(numa.h HAS_NUMA_H)
include(FetchContent)
FetchContent_Declare(tiff
GIT_REPOSITORY https://github.com/fleon-psi/libtiff
GIT_TAG v4.6.0
EXCLUDE_FROM_ALL)
FetchContent_Declare(
png
GIT_REPOSITORY https://github.com/pnggroup/libpng
GIT_TAG v1.6.49
EXCLUDE_FROM_ALL
)
FetchContent_Declare(hdf5
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
GIT_TAG hdf5_1.14.5
GIT_SHALLOW 1
EXCLUDE_FROM_ALL)
SET(PISTACHE_USE_CONTENT_ENCODING_DEFLATE ON)
SET(PISTACHE_BUILD_TESTS OFF)
SET(PISTACHE_USE_SSL ON)
FetchContent_Declare(
pistache_http
GIT_REPOSITORY https://github.com/fleon-psi/pistache
GIT_TAG 280b0f6f28f81745870bccb31f4a3a59958807f6
EXCLUDE_FROM_ALL
GIT_TAG 51553b92cc7bb25ac792462722ddd4fae33d14b1
)
FetchContent_Declare(
@@ -119,44 +55,33 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/facebook/zstd
GIT_TAG 794ea1b0afca0f020f4e57b6732332231fb23c70
SOURCE_SUBDIR build/cmake
EXCLUDE_FROM_ALL
)
SET(SLS_DETECTOR_GIT_TAG "8.0.2")
IF(SLS9)
SET(SLS_DETECTOR_GIT_TAG "9.2.0")
ENDIF()
FetchContent_Declare(
sls_detector_package
GIT_REPOSITORY https://github.com/slsdetectorgroup/slsDetectorPackage
GIT_TAG ${SLS_DETECTOR_GIT_TAG}
GIT_REPOSITORY https://github.com/fleon-psi/slsDetectorPackage
GIT_TAG bae261433241ff2f458350e26ab026f00f01c427
)
FetchContent_Declare(
catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2
GIT_TAG 4e8d92b
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2 hdf5 tiff png)
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2)
ADD_SUBDIRECTORY(jungfrau)
ADD_SUBDIRECTORY(compression)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(writer)
ADD_SUBDIRECTORY(frame_serialize)
ADD_SUBDIRECTORY(reader)
ADD_SUBDIRECTORY(detector_control)
ADD_SUBDIRECTORY(image_puller)
ADD_SUBDIRECTORY(preview)
ADD_SUBDIRECTORY(symmetry)
ADD_SUBDIRECTORY(detector_control)
IF (JFJOCH_WRITER_ONLY)
MESSAGE(STATUS "Compiling HDF5 writer only")
SET(jfjoch_executables jfjoch_writer)
ELSE()
ADD_SUBDIRECTORY(image_pusher)
ADD_SUBDIRECTORY(broker)
ADD_SUBDIRECTORY(fpga)
ADD_SUBDIRECTORY(acquisition_device)
@@ -164,133 +89,18 @@ ELSE()
ADD_SUBDIRECTORY(image_analysis)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(preview)
ADD_SUBDIRECTORY(resonet)
SET(jfjoch_executables jfjoch_broker jfjoch_writer CatchTest CompressionBenchmark HDF5DatasetWriteTest jfjoch_udp_simulator sls_detector_put sls_detector_get)
ENDIF()
IF (JFJOCH_VIEWER_BUILD)
ADD_SUBDIRECTORY(viewer)
ENDIF()
ADD_CUSTOM_COMMAND(OUTPUT frontend_ui/build/index.html
COMMAND npm run build
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui)
ADD_CUSTOM_TARGET(frontend DEPENDS frontend_ui/build/index.html)
IF (NOT JFJOCH_WRITER_ONLY)
ADD_CUSTOM_COMMAND(OUTPUT frontend/dist/index.html
COMMAND npm install
COMMAND npm run build
COMMAND npm run redocly
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend)
ADD_CUSTOM_TARGET(frontend DEPENDS frontend/dist/index.html)
ADD_CUSTOM_TARGET(update_version
COMMAND bash update_version.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
IF (JFJOCH_INSTALL_DRIVER_SOURCE)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/
DESTINATION /usr/src/jfjoch-${JFJOCH_VERSION}
COMPONENT driver-dkms
FILES_MATCHING PATTERN "dkms.conf")
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/
DESTINATION /usr/src/jfjoch-${JFJOCH_VERSION}/src
COMPONENT driver-dkms
FILES_MATCHING PATTERN "*.c" PATTERN "*.h" PATTERN "Makefile")
ENDIF()
FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend/dist/)
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/frontend/dist/ DESTINATION share/jfjoch/frontend COMPONENT jfjoch )
ENDIF()
ADD_CUSTOM_TARGET(jfjoch DEPENDS ${jfjoch_executables})
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX /opt/jfjoch CACHE PATH "Default directory" FORCE)
SET(CMAKE_INSTALL_PREFIX /opt/jfjoch CACHE PATH "Default directory" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Set Package Name
# Initialize CPACK_COMPONENTS_ALL with common components
set(CPACK_COMPONENTS_ALL jfjoch writer)
if (SLS9)
set(CPACK_PACKAGE_NAME "jfjoch-slsdet9")
else()
set(CPACK_PACKAGE_NAME "jfjoch")
endif()
# Add optional components
if (JFJOCH_INSTALL_DRIVER_SOURCE)
list(APPEND CPACK_COMPONENTS_ALL driver-dkms)
else()
set(CPACK_COMPONENTS_ALL jfjoch writer)
endif()
if (JFJOCH_VIEWER_BUILD)
list(APPEND CPACK_COMPONENTS_ALL viewer)
endif()
# Common metadata
set(CPACK_PACKAGE_CONTACT "Filip Leonarski <filip.leonarski@psi.ch>")
set(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
set(CPACK_PACKAGE_VERSION ${JFJOCH_VERSION})
# OS-aware packaging: DEB on Debian/Ubuntu, RPM on RHEL/Rocky
if (EXISTS "/etc/debian_version")
set(CPACK_PACKAGE_LICENSE "GPL-3.0-only")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
# Debian/Ubuntu: .deb with components
set(CPACK_GENERATOR "DEB")
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_MAIN_COMPONENT jfjoch)
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
# Enable automatic shlib dependency discovery
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
# Optional DEB metadata (tune as needed)
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
# set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://example.org/jfjoch")
# DKMS component (maps from RPM settings)
if (JFJOCH_INSTALL_DRIVER_SOURCE)
# Dependencies and arch for the DKMS component
# Note: component name "driver-dkms" maps to variable suffix "DRIVER_DKMS"
set(CPACK_DEBIAN_DRIVER_DKMS_PACKAGE_DEPENDS "dkms, gcc, bash, sed")
set(CPACK_DEBIAN_DRIVER_DKMS_PACKAGE_ARCHITECTURE "all")
# Provide Debian control scripts (postinst/prerm).
# We rename existing scripts to Debian control names at configure time.
set(_dkms_ctrl_dir "${CMAKE_CURRENT_BINARY_DIR}/cpack-debian-driver-dkms")
file(MAKE_DIRECTORY "${_dkms_ctrl_dir}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh
${_dkms_ctrl_dir}/postinst COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh
${_dkms_ctrl_dir}/prerm COPYONLY)
set(CPACK_DEBIAN_DRIVER_DKMS_PACKAGE_CONTROL_EXTRA
"${_dkms_ctrl_dir}/postinst;${_dkms_ctrl_dir}/prerm")
endif()
elseif (EXISTS "/etc/redhat-release")
# RHEL/Rocky: .rpm with components (original behavior)
set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_RPM_MAIN_COMPONENT jfjoch)
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_VERSION ${JFJOCH_VERSION})
set(CPACK_RPM_PACKAGE_RELEASE 1)
set(CPACK_RPM_PACKAGE_SUMMARY "Jungfraujoch data acquisition system")
set(CPACK_RPM_PACKAGE_DESCRIPTION "Jungfraujoch")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
/usr/src /usr/share /usr/share/dbus-1 /usr/share/dbus-1/services)
# DKMS component scripts and requirements for RPM
if (JFJOCH_INSTALL_DRIVER_SOURCE)
set(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed")
set(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch")
set(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE
${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh)
set(CPACK_RPM_DRIVER-DKMS_PRE_UNINSTALL_SCRIPT_FILE
${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh)
endif()
else()
# Fallback if OS is unknown
set(CPACK_GENERATOR "TGZ")
endif()
INCLUDE(CPack)

View File

@@ -1,4 +1,16 @@
# Contributing
We actively welcome community contributions.
Please contact [Filip Leonarski](mailto:filip.leonarski@psi.ch), if you like to contribute to the project.
We actively welcome community contributions, please use a pull request feature.
To accept contributions into our codebase we need to have Contributor License Agreement (CLA) with you or your employer.
The CLA is necessary because you own the copyright to your changes, even after your contribution becomes part of our codebase.
Since Jungfraujoch development is supported by commercialization grant from the Innosuisse agency, which allows PSI to carry the development.
In return for the Innosuisse support, we need to allow our commercial partner (DECTRIS) to use the code without restrictions,
and we have to ensure community contributions don't violate this requirement.
The obligation applies only if your contributions are merged into PSI codebase.
If you like to make a bigger contribution, like for example new data analysis method beyond what is available currently,
please also contact us beforehand to figure out best licensing strategy.
Please contact [Filip Leonarski](mailto:filip.leonarski@psi.ch) for details.

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
# MAX IV docker config
FROM harbor.maxiv.lu.se/dockerhub/library/ubuntu:22.04
RUN set -ex; \
apt-get update; \
apt-get install -y pkg-config git cmake make g++ libhdf5-dev libczmq-dev;\
rm -rf /var/lib/apt/lists/*
COPY . /usr/src/nextgendcu
RUN set -ex; \
cd /usr/src/nextgendcu; \
mkdir build; \
cd build; \
cmake -DJFJOCH_WRITER_ONLY=ON .. ;\
make -j8 install;
ENTRYPOINT ["/opt/jfjoch/bin/jfjoch_writer"]

685
LICENSE
View File

@@ -1,685 +0,0 @@
Jungfraujoch software is licensed with GPLv3 license.
Jungfraujoch FPGA is licensed with CERN OHL-S license (see fpga/LICENSE).
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================
As a special exception, we specifically permit linking Jungfraujoch code with Nvidia CUDA libraries.
We also permit to link Jungfraujoch software (GPLv3) with Jungfraujoch high-level synthesis code (CERN OHL 2.0) for the purpose
of simulating FPGA design on CPU.

145
README.md
View File

@@ -1,6 +1,145 @@
# Jungfraujoch
Application to receive data from the PSI JUNGFRAU and EIGER detectors.
Application to receive data from the JUNGFRAU detector.
All documentation is now placed in [docs/](docs/) subdirectory and for the current version hosted on
[Jungfraujoch Read The Docs page](https://jungfraujoch.readthedocs.io).
Citation: F. Leonarski, M. Bruckner, C. Lopez-Cuenca, A. Mozzanica, H.-C. Stadler, Z. Matej, A. Castellane, B. Mesnet, J. Wojdyla, B. Schmitt and M. Wang "Jungfraujoch: hardware-accelerated data-acquisition system for kilohertz pixel-array X-ray detectors" (2023), J. Synchrotron Rad., 30, 227-234 [doi:10.1107/S1600577522010268](https://doi.org/10.1107/S1600577522010268).
The project is supported by :
* Innosuisse via Innovation Project "NextGenDCU high data rate acquisition system for X-ray detectors in structural biology applications" (101.535.1 IP-ENG; Apr 2023 - Sep 2025).
* ETH Domain via Open Research Data Contribute project (Jan - Dec 2023)
## License
Operating Jungfraujoch requires license from the Paul Scherrer Institute.
Sharing the code requires explicit permission from the Paul Scherrer Institute.
## Hardware requirements
1. JUNGFRAU detector (optimally 4M with 2 kHz enabled read-out boards)
2. Server system with AMD/Xilinx Alveo U55C cards and optionally Nvidia GPUs
At the moment only U55C card is supported by Jungfraujoch.
Nvidia L4 GPU is recommended and used for performance tuning.
## FPGA bitstream
Instructions see [here](fpga/README.md)
## Software
Recommended operating system is Red Hat Enterprise Linux (RHEL) / Rocky Linux versions 8 and 9 (both are tested on a regular basis).
Running Jungfraujoch on Red Hat Enterprise Linux 7 is currently not tested and not recommended,
but likely possible with providing multiple packages from external repositories.
There are some limited tests with recent Ubuntu and Fedora distributions, though these are not systematic.
Other linux platforms should work, but no tests were done so far.
### Dependencies
Required:
* C++20 compiler and C++20 standard library; recommended GCC 11+ or clang 14+ (Intel OneAPI, AMD AOCC)
* CMake version 3.21 or newer + GNU make tool
* HDF5 library version 1.10 or newer
* TIFF library (with C++ headers)
* JPEG library (turbo-jpeg is also OK)
Optional:
* CUDA compiler version 11 or newer - required for MX indexing and ML resolution estimation
* NUMA library - to pin threads to nodes/CPUs
* Node.js - to make frontend
* libtorch - for resolution estimation using model from Stanford - see below
Automatically downloaded by CMake:
* SLS Detector Package - see [github.com/slsdetectorgroup/slsDetectorPackage](https://github.com/slsdetectorgroup/slsDetectorPackage)
* Zstandard (Facebook) - see [github.com/facebook/zstd](https://github.com/facebook/zstd)
* Pistache webserver - see [github.com/pistacheio/pistache](https://github.com/pistacheio/pistache)
* Fast feedback indexer (Hans-Christian Stadler, PSI) - see [github.com/paulscherrerinstitute/fast-feedback-indexer](https://github.com/paulscherrerinstitute/fast-feedback-indexer)
* Catch2 testing library - see [github.com/catchorg/Catch2](https://github.com/catchorg/Catch2)
Please follow the link provided above to check for LICENSE file
Directly included in the repository:
* JSON parser/writer from N. Lohmann - see [github.com/nlohmann/json](https://github.com/nlohmann/json)
* Xilinx arbitrary precision arithmetic headers - see [github.com/Xilinx/HLS_arbitrary_Precision_Types](https://github.com/Xilinx/HLS_arbitrary_Precision_Types)
* Bitshuffle filter from K. Masui - see [github.com/kiyo-masui/bitshuffle](https://github.com/kiyo-masui/bitshuffle)
* Fast replacement for Bitshuffle pre-compression filter (Kal Cutter, DECTRIS) - see [github.com/kalcutter/bitshuffle](https://github.com/kalcutter/bitshuffle)
* Tinycbor (Intel) - see [github.com/intel/tinycbor](https://github.com/intel/tinycbor)
* LZ4 compression by Y.Collet - see [github.com/lz4/lz4](https://github.com/lz4/lz4)
* Spdlog logging library - see [github.com/gabime/spdlog](https://github.com/gabime/spdlog)
* ZeroMQ library (through slsDetectorPackage) - see [github.com/zeromq/libzmq](https://github.com/zeromq/libzmq)
For license check LICENSE file in respective directory
### Software components
* `jfjoch_broker` in `broker` - main service running on the Jungfraujoch server, responsible for control of the detector and data acquisition;
Example configuration `jfjoch_broker` for the modules is given in configuration files present in `etc` directory. See [details](broker/README.md).
* `jfjoch_writer` in `writer` - HDF5 writer; HDF5 writer is designed to work on the same or separate server system. It has rather limited requirements in terms of performance and memory.
The goal is to separate data acquisition node with custom FPGA hardware and file system node with stronger security/stability requirements. See [details](writer/README.md).
### Compilation
Use the following commands:
```
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make jfjoch
```
### Compilation (writer only)
In most use cases it is better to have a separate machine, with access to distributed file system, for writing.
Such machine needs only a HDF5 writer service with fewer dependencies. For compilation use the following commands:
```
git submodule update --init --recursive
mkdir build
cd build
cmake -DJFJOCH_WRITER_ONLY=ON ..
make jfjoch
```
## Versions
**FPGA release** is as hexadecimal number indicted in the [jfjoch_fpga.h](fpga/pcie_driver/jfjoch_fpga.h) as JFJOCH_FPGA_RELEASE constant. This number indicated breaking changes in the FPGA firmware interface.
FPGA release has to be consistent between FPGA firmware, kernel driver and `jfjoch_broker` - both kernel driver and software won't work in case of version mismatch.
Commits to `main` branch with the same FPGA release version are OK to mix between components.
## Web Frontend
Jungfraujoch is equipped with React-based web frontend for user-friendly experience. Frontend has the following options:
* Presenting current state of the detector
* Plotting results of online quality calculations
* Showing live view images from the detector
* JUNGFRAU calibration numbers
* Configuring the detector, as well as pedestal/initialization operations
Frontend is written in TypeScript. For details see [frontend_ui/](frontend_ui) directory.
Jungfraujoch Cmake scripts have an option to start frontend build with the following command:
```
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make frontend
```
Contrary to standard CMake way, frontend will be built in "source" `frontend_ui/build` directory, not in `build/` subdirectory.
## Tests
Automated test routine is then accessible as `tests/CatchTest`. There are also benchmark routines:
* `HDF5DatasetWriteTest` to measure HDF5 dataset writing speed (single threaded)
* `jfjoch_spot_finding_test` to apply spot finding and indexing routines in Jungfraujoch to an example dataset - this is equivalent to FPGA spot finding algorithm, but NOT performance equivalent as it is particularly not-efficient
* `jfjoch_action_test` to test quality/performance of FPGA card(s) and software routines
In addition, tests are executed to verify that datasets written by Jungfraujoch are readable with XDS Durin plugin, XDS Neggia plygin and CrystFEL.
Input files for these programs are placed in `xds_durin`, `xds_neggia` and `crystfel` folders. See `.gitlab-ci.yml` for details.
## Resolution estimation
Resolution estimation can be done with a recent deep learning model by D. Mendez et al.
(see [Acta Cryst D, 80, 26-43](https://doi.org/10.1107/S2059798323010586)), adapted to Jungfraujoch.
Model used in the original paper is located in the [resonet/](resonet) directory, after converting to TorchScript format.
To use the feature it is necessary to install [libtorch](https://pytorch.org/) library, preferably in `/opt/libtorch` location. The C++11 ABI version needs to be chosen.
For RHEL 8 systems, please download older version 2.1.0, as version 2.2.0 requires newer `glibc` library than available with the operating system.
Version 2.1.0 can be downloaded with the following command:
```
wget https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0%2Bcu121.zip
```

View File

@@ -1 +1 @@
1.0.0-rc.80
1.0.0-test5

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include <thread>
@@ -11,7 +10,7 @@ AcquisitionCounters::AcquisitionCounters()
total_packets(0), expected_frames(0), acquisition_finished(false) {}
void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_t data_stream) {
std::unique_lock ul(m);
std::unique_lock<std::shared_mutex> ul(m);
acquisition_finished = false;
slowest_frame_number = 0;
@@ -22,7 +21,7 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_
(experiment.GetDetectorMode() == DetectorMode::PedestalG2))
expected_frames = experiment.GetFrameNum();
else
expected_frames = experiment.GetFrameNum() / experiment.GetFPGASummation();
expected_frames = experiment.GetImageNum();
nmodules = experiment.GetModulesNum(data_stream);
if (nmodules > max_modules)
@@ -36,18 +35,22 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_
saved_completions = std::vector<Completion>(expected_frames * nmodules);
packets_per_module = std::vector<uint64_t>(nmodules);
total_packets = 0;
expected_packets_per_module = 512 * experiment.GetFPGASummation();
if (experiment.GetBitDepthReadout() == 32)
bytes_per_packet = 4096LU;
else if (experiment.GetBitDepthReadout() == 8)
bytes_per_packet = 1024LU; // Need to seriously refactor, to have expected_packets_per_module specific for detector
else
bytes_per_packet = 2048LU;
expected_packets_per_module = 256 * experiment.GetSummation();
}
void AcquisitionCounters::UpdateCounters(const Completion *c) {
std::unique_lock ul(m);
std::unique_lock<std::shared_mutex> ul(m);
if (c->pedestal) {
if (c->module_number >= nmodules)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"UpdateCounters wrong module number: " + std::to_string(c->module_number) + " for pedestal SC" + std::to_string(c->frame_number));
if (c->frame_number >= 16)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"UpdateCounters pedestal frame number is out of bounds for storage cells");
handle_for_pedestal.at(c->frame_number * nmodules + c->module_number) = c->handle;
return;
}
if (c->module_number >= nmodules)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
@@ -71,9 +74,6 @@ void AcquisitionCounters::UpdateCounters(const Completion *c) {
fastest_frame_number = c->frame_number;
}
if (fastest_frame_number - slowest_frame_number > ThresholdFramesLost)
slowest_frame_number = fastest_frame_number - ThresholdFramesLost;
packets_collected.at(c->frame_number * nmodules + c->module_number) = c->packet_count;
handle_for_frame.at(c->frame_number * nmodules + c->module_number) = c->handle;
saved_completions.at(c->frame_number * nmodules + c->module_number) = *c;
@@ -86,7 +86,7 @@ void AcquisitionCounters::UpdateCounters(const Completion *c) {
}
void AcquisitionCounters::SetAcquisitionFinished() {
std::unique_lock ul(m);
std::unique_lock<std::shared_mutex> ul(m);
acquisition_finished = true;
data_updated.notify_all();
}
@@ -103,7 +103,7 @@ uint64_t AcquisitionCounters::GetBufferHandle(size_t frame, uint16_t module_numb
}
uint64_t AcquisitionCounters::GetBufferHandleAndClear(size_t frame, uint16_t module_number) {
std::unique_lock ul(m);
std::unique_lock<std::shared_mutex> ul(m);
if (frame >= expected_frames)
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
"GetBufferHandleAndClear Wrong frame number: " + std::to_string(frame));
@@ -117,7 +117,7 @@ uint64_t AcquisitionCounters::GetBufferHandleAndClear(size_t frame, uint16_t mod
}
uint64_t AcquisitionCounters::GetPedestalBufferHandle(size_t storage_cell, uint16_t module_number) const {
std::unique_lock ul(m);
std::unique_lock<std::shared_mutex> ul(m);
if (storage_cell >= 16)
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
"GetBufferHandleAndClear Wrong frame number: " + std::to_string(storage_cell));
@@ -145,8 +145,6 @@ uint64_t AcquisitionCounters::GetFastestFrameNumber() const {
void AcquisitionCounters::WaitForFrame(size_t curr_frame, uint16_t module_number) const {
uint64_t slowest_head_tmp = (module_number == UINT16_MAX) ? GetSlowestFrameNumber() : GetCurrFrameNumber(module_number);
if (curr_frame == 0)
curr_frame = 1; // Cannot wait for frame 0, as this is initial value of slowest frame number, so waiting for frame 1 in this case
while (!acquisition_finished && (slowest_head_tmp < curr_frame)) {
std::this_thread::sleep_for(std::chrono::microseconds(100));
slowest_head_tmp = (module_number == UINT16_MAX) ? GetSlowestFrameNumber() : GetCurrFrameNumber(module_number);
@@ -160,8 +158,7 @@ int64_t AcquisitionCounters::CalculateDelay(size_t curr_frame, uint16_t module_n
slowest_head_tmp = GetSlowestFrameNumber();
else
slowest_head_tmp = GetCurrFrameNumber(module_number);
if (slowest_head_tmp < curr_frame)
return 0;
return slowest_head_tmp - curr_frame;
}
@@ -200,7 +197,7 @@ uint64_t AcquisitionCounters::GetTotalPackets() const {
}
uint64_t AcquisitionCounters::GetTotalPackets(uint16_t module_number) const {
std::unique_lock ul(m);
std::unique_lock<std::shared_mutex> ul(m);
if (module_number >= nmodules)
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
@@ -209,22 +206,14 @@ uint64_t AcquisitionCounters::GetTotalPackets(uint16_t module_number) const {
return packets_per_module[module_number];
}
uint64_t AcquisitionCounters::GetExpectedPacketsPerImage() const {
return expected_packets_per_module * nmodules;
uint64_t AcquisitionCounters::GetExpectedPackets() const {
return GetExpectedPacketsPerModule() * nmodules;
}
uint64_t AcquisitionCounters::GetTotalExpectedPackets() const {
return GetTotalExpectedPacketsPerModule() * nmodules;
}
uint64_t AcquisitionCounters::GetTotalExpectedPacketsPerModule() const {
uint64_t AcquisitionCounters::GetExpectedPacketsPerModule() const {
return expected_frames * expected_packets_per_module;
}
uint64_t AcquisitionCounters::GetModuleNumber() const {
return nmodules;
}
uint64_t AcquisitionCounters::GetBytesReceived() const {
return GetTotalPackets() * bytes_per_packet;
}

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_ACQUISITIONCOUNTERS_H
#define JUNGFRAUJOCH_ACQUISITIONCOUNTERS_H
@@ -18,6 +17,7 @@
class AcquisitionCounters {
uint16_t expected_packets_per_module;
constexpr static const uint64_t max_modules = 32;
mutable std::shared_mutex m;
mutable std::condition_variable_any data_updated;
@@ -36,11 +36,9 @@ class AcquisitionCounters {
bool acquisition_finished;
uint64_t expected_frames;
uint64_t nmodules = max_modules;
uint64_t bytes_per_packet;
public:
static constexpr const uint64_t HandleNotFound = UINT64_MAX;
constexpr static const uint64_t ThresholdFramesLost = 50;
AcquisitionCounters();
void Reset(const DiffractionExperiment &experiment, uint16_t data_stream);
@@ -63,11 +61,9 @@ public:
uint64_t GetTotalPackets() const;
uint64_t GetTotalPackets(uint16_t module_number) const;
uint64_t GetBytesReceived() const;
uint64_t GetTotalExpectedPackets() const;
uint64_t GetTotalExpectedPacketsPerModule() const;
uint64_t GetExpectedPacketsPerImage() const;
uint64_t GetExpectedPackets() const;
uint64_t GetExpectedPacketsPerModule() const;
uint64_t GetModuleNumber() const;
};

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifdef JFJOCH_USE_NUMA
#include <numaif.h>
@@ -9,6 +8,7 @@
#include <thread>
#include <fstream>
#include <cmath>
#include <sstream>
#include "../common/JFJochException.h"
#include "AcquisitionDevice.h"
@@ -53,7 +53,7 @@ void AcquisitionDevice::StartAction(const DiffractionExperiment &experiment, uin
"Number of modules exceeds max possible for FPGA"));
counters.Reset(experiment, data_stream);
expected_frames = experiment.GetFrameNum() / experiment.GetFPGASummation();
expected_frames = experiment.GetFrameNum() / experiment.GetSummation();
// Ensure internal WR queue is empty
work_request_queue.Clear();
@@ -75,7 +75,7 @@ void AcquisitionDevice::StartAction(const DiffractionExperiment &experiment, uin
RunInternalGenerator(experiment);
}
void AcquisitionDevice::WaitForActionComplete() {
void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
auto c = work_completion_queue.GetBlocking();
while (c.type != Completion::Type::End) {
@@ -92,8 +92,9 @@ void AcquisitionDevice::WaitForActionComplete() {
c.module_number = output->module_statistics.module_number;
c.packet_count = output->module_statistics.packet_count;
c.frame_number = output->module_statistics.frame_number;
c.pedestal = output->module_statistics.pedestal;
if (c.frame_number >= expected_frames) {
if ((c.frame_number >= expected_frames) && !c.pedestal) {
Cancel();
// this frame is not of any interest, therefore its location can be immediately released
SendWorkRequest(c.handle);
@@ -103,8 +104,13 @@ void AcquisitionDevice::WaitForActionComplete() {
logger->Error("Completion with wrong module number data stream {} completion frame number {} module {} handle {}",
data_stream, c.frame_number, c.module_number, c.handle);
SendWorkRequest(c.handle);
} else if (c.frame_number < counters.GetSlowestFrameNumber()) {
// Module is falling behind, needs to return the handle then
} else if (pedestal_mode && !c.pedestal) {
try {
counters.UpdateCounters(&c);
} catch (const JFJochException &e) {
if (logger)
logger->ErrorException(e);
}
SendWorkRequest(c.handle);
} else {
try {
@@ -135,7 +141,7 @@ void AcquisitionDevice::SendWorkRequest(uint32_t handle) {
}
uint64_t AcquisitionDevice::GetBytesReceived() const {
return counters.GetBytesReceived();
return counters.GetTotalPackets() * 4096LU;
}
const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t frame_number, uint16_t module_number) const {
@@ -146,6 +152,14 @@ const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t frame_number, uint
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Frame not collected");
}
const DeviceOutput *AcquisitionDevice::GetDeviceOutputPedestal(size_t storage_cell, uint16_t module_number) const {
auto handle = counters.GetPedestalBufferHandle(storage_cell, module_number);
if (handle != HandleNotValid)
return GetDeviceOutput(handle);
else
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Frame not collected");
}
const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t handle) const {
if (handle >= buffer_device.size())
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Handle outside of range");
@@ -172,69 +186,16 @@ void AcquisitionDevice::InitializeSpotFinderResolutionMap(const float *data, siz
void AcquisitionDevice::InitializeROIMap(const uint16_t *map, size_t module_number) {}
void AcquisitionDevice::InitializePixelMask(const uint32_t *module_mask, size_t module_number) {}
void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment, const std::vector<uint16_t>& roi_map) {
if (roi_map.size() != experiment.GetXPixelsNumConv() * experiment.GetYPixelsNumConv())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Mismatch in array size");
void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment) {
std::vector<uint16_t> tmp(RAW_MODULE_SIZE);
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++) {
ConvertedToRawGeometry(experiment, offset + m, tmp.data(), roi_map.data());
experiment.ExportROIMap(tmp.data(), offset + m);
InitializeROIMap(tmp.data(), m);
}
}
void AcquisitionDevice::InitializeEmptyPixelMask(const DiffractionExperiment &experiment) {
std::vector<uint32_t> empty_mask(RAW_MODULE_SIZE);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++)
InitializePixelMask(empty_mask.data(), m);
}
void AcquisitionDevice::InitializeDataProcessing(const DiffractionExperiment &experiment,
const AzimuthalIntegration &azint) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
if (experiment.IsGeometryTransformed()) {
std::vector<float> tmp1(RAW_MODULE_SIZE);
std::vector<uint16_t> tmp2(RAW_MODULE_SIZE);
for (int m = 0; m < modules; m++) {
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Corrections().data());
ConvertedToRawGeometry(experiment, offset + m, tmp2.data(), azint.GetPixelToBin().data());
InitializeIntegrationMap(tmp2.data(), tmp1.data(), m);
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Resolution().data());
InitializeSpotFinderResolutionMap(tmp1.data(), m);
}
} else {
for (int m = 0; m < modules; m++) {
InitializeIntegrationMap(azint.GetPixelToBin().data() + (offset + m) * RAW_MODULE_SIZE,
azint.Corrections().data() + (offset + m) * RAW_MODULE_SIZE,
m);
InitializeSpotFinderResolutionMap(azint.Resolution().data() + (m + offset) * RAW_MODULE_SIZE,
m);
}
}
}
void AcquisitionDevice::InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
std::vector<uint32_t> tmp(RAW_MODULE_SIZE);
for (int m = 0; m < modules; m++) {
ConvertedToRawGeometry(experiment, offset + m, tmp.data(), mask.GetMask().data());
InitializePixelMask(tmp.data(), m);
}
}
void AcquisitionDevice::MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node) {
try {
for (int i = 0; i < c2h_buffer_count; i++)
@@ -293,7 +254,7 @@ AcquisitionDeviceStatistics AcquisitionDevice::GetStatistics() const {
ret.bytes_received = GetBytesReceived();
ret.start_timestamp = start_time.time_since_epoch().count();
ret.end_timestamp = end_time.time_since_epoch().count();
ret.packets_expected = counters.GetTotalExpectedPackets();
ret.packets_expected = counters.GetExpectedPackets();
ret.good_packets = counters.GetTotalPackets();
for (int i = 0; i < counters.GetModuleNumber(); i++)
@@ -311,6 +272,10 @@ void AcquisitionDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) {
ipv4_addr = ipv4_addr_network_order;
}
void AcquisitionDevice::SetMACAddress(uint64_t mac_addr_network_order) {
mac_addr = mac_addr_network_order;
}
AcquisitionDeviceNetConfig AcquisitionDevice::GetNetConfig() const {
return {
.mac_addr = GetMACAddress(),
@@ -319,11 +284,18 @@ AcquisitionDeviceNetConfig AcquisitionDevice::GetNetConfig() const {
};
}
void AcquisitionDevice::SetDefaultDataSource(AcquisitionDeviceSource id) {
}
AcquisitionDeviceSource AcquisitionDevice::GetDataSource() {
return AcquisitionDeviceSource::NONE;
}
void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experiment) {
FrameGeneratorConfig config{};
config.frames = experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1;
config.modules = experiment.GetModulesNum(data_stream);
config.data_stream = data_stream;
config.pulse_id = INT_PKT_GEN_BUNCHID;
config.exptime = INT_PKT_GEN_EXPTTIME;
config.debug = INT_PKT_GEN_DEBUG;
@@ -336,10 +308,7 @@ void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experi
break;
case DetectorType::EIGER:
config.detector_type = SLS_DETECTOR_TYPE_EIGER;
config.eiger_bit_depth = experiment.GetBitDepthReadout();
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Detector not supported");
}
HW_RunInternalGenerator(config);
}

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_ACQUISITIONDEVICE_H
#define JUNGFRAUJOCH_ACQUISITIONDEVICE_H
@@ -12,7 +11,6 @@
#include "../common/Definitions.h"
#include "../common/DiffractionExperiment.h"
#include "../common/Logger.h"
#include "../common/PixelMask.h"
#include "../common/ThreadSafeFIFO.h"
#include "../jungfrau/JFCalibration.h"
@@ -21,7 +19,6 @@
#include "Completion.h"
#include "../fpga/pcie_driver/jfjoch_fpga.h"
#include "../common/NetworkAddressConvert.h"
#include "../common/AzimuthalIntegration.h"
struct AcquisitionDeviceStatistics {
uint64_t good_packets;
@@ -34,6 +31,8 @@ struct AcquisitionDeviceStatistics {
std::vector<uint64_t> packets_received_per_module;
};
enum class AcquisitionDeviceSource {NETWORK, FRAME_GENERATOR, NONE};
class AcquisitionDevice {
std::chrono::time_point<std::chrono::system_clock> start_time;
std::chrono::time_point<std::chrono::system_clock> end_time;
@@ -76,7 +75,7 @@ public:
void StartAction(const DiffractionExperiment &experiment, uint32_t optional_flags = 0);
void PrepareAction(const DiffractionExperiment &experiment);
void WaitForActionComplete();
void WaitForActionComplete(bool pedestal_mode = false);
virtual void Cancel() = 0;
void EnableLogging(Logger *logger);
@@ -88,6 +87,7 @@ public:
virtual DeviceStatus GetDeviceStatus() const;
AcquisitionDeviceStatistics GetStatistics() const;
const DeviceOutput *GetDeviceOutput(size_t frame_number, uint16_t module_number) const;
const DeviceOutput *GetDeviceOutputPedestal(size_t frame_number, uint16_t module_number) const;
void FrameBufferRelease(size_t frame_number, uint16_t module_number);
// Calibration
@@ -97,21 +97,20 @@ public:
virtual void InitializeIntegrationMap(const uint16_t *map, const float *weights, size_t module_number);
virtual void InitializeSpotFinderResolutionMap(const float *data, size_t module_number);
virtual void InitializeROIMap(const uint16_t *map, size_t module_number);
void InitializeEmptyPixelMask(const DiffractionExperiment &experiment); // Empty Mask
void InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask_raw);
virtual void InitializePixelMask(const uint32_t *module_mask, size_t module_number);
void InitializeROIMap(const DiffractionExperiment& experiment, const std::vector<uint16_t>& raw_roi_map);
void InitializeDataProcessing(const DiffractionExperiment &experiment, const AzimuthalIntegration& azint);
void InitializeROIMap(const DiffractionExperiment &experiment);
const AcquisitionCounters& Counters() const;
void SetSpotFinderParameters(const SpotFindingSettings &settings);
virtual std::string GetIPv4Address() const;
virtual void SetIPv4Address(uint32_t ipv4_addr_network_order);
virtual void SetMACAddress(uint64_t mac_addr_network_order);
virtual std::string GetMACAddress() const;
virtual uint16_t GetUDPPort() const;
virtual int32_t GetNUMANode() const;
virtual void SetInternalGeneratorFrame(const uint16_t *input, size_t module_number) {}
virtual void SetDefaultDataSource(AcquisitionDeviceSource id);
virtual AcquisitionDeviceSource GetDataSource();
AcquisitionDeviceNetConfig GetNetConfig() const;

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include "AcquisitionDeviceGroup.h"
#include "PCIExpressDevice.h"
@@ -21,11 +20,8 @@ void AcquisitionDeviceGroup::Add(std::unique_ptr<AcquisitionDevice> &&device) {
aq_devices.emplace_back(std::move(device));
}
void AcquisitionDeviceGroup::AddPCIeDevice(const std::string &device_name, std::optional<uint32_t> ipv4_addr) {
auto tmp = std::make_unique<PCIExpressDevice>(aq_devices.size(), device_name);
if (ipv4_addr.has_value())
tmp->SetIPv4Address(ipv4_addr.value());
aq_devices.emplace_back(std::move(tmp));
void AcquisitionDeviceGroup::AddPCIeDevice(const std::string &device_name) {
aq_devices.emplace_back(std::make_unique<PCIExpressDevice>(aq_devices.size(), device_name));
}
void AcquisitionDeviceGroup::AddHLSDevice(int64_t buffer_size_modules) {
@@ -39,14 +35,12 @@ std::vector<AcquisitionDeviceNetConfig> AcquisitionDeviceGroup::GetNetworkConfig
return ret;
}
void AcquisitionDeviceGroup::SetDefaultDataSource(AcquisitionDeviceSource id) {
for (auto &i: aq_devices)
i->SetDefaultDataSource(id);
}
void AcquisitionDeviceGroup::EnableLogging(Logger *logger) {
for (auto &i: aq_devices)
i->EnableLogging(logger);
}
std::vector<DeviceStatus> AcquisitionDeviceGroup::GetDeviceStatus() const {
std::vector<DeviceStatus> ret;
for (auto &i: aq_devices)
ret.emplace_back(i->GetDeviceStatus());
return ret;
}
}

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_ACQUISITIONDEVICEGROUP_H
#define JUNGFRAUJOCH_ACQUISITIONDEVICEGROUP_H
@@ -14,10 +13,10 @@ public:
AcquisitionDevice& operator[](int idx);
size_t size();
void Add(std::unique_ptr<AcquisitionDevice> &&device);
void AddPCIeDevice(const std::string &device_name, std::optional<uint32_t> ipv4_addr = {});
void AddPCIeDevice(const std::string &device_name);
void AddHLSDevice(int64_t buffer_size_modules);
std::vector<AcquisitionDeviceNetConfig> GetNetworkConfig();
std::vector<DeviceStatus> GetDeviceStatus() const;
void SetDefaultDataSource(AcquisitionDeviceSource id);
void EnableLogging(Logger *logger);
};

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include "Completion.h"
#include "../common/Definitions.h"

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_COMPLETION_H
#define JUNGFRAUJOCH_COMPLETION_H
@@ -18,6 +17,7 @@ struct Completion {
uint16_t packet_count;
uint16_t data_collection_id;
uint16_t module_number;
bool pedestal;
};
Completion parse_hw_completion(uint32_t hw_input);

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include <random>
#include "FPGAAcquisitionDevice.h"
@@ -20,6 +19,8 @@ void FPGAAcquisitionDevice::Finalize() {
while (!HW_IsIdle())
std::this_thread::sleep_for(std::chrono::milliseconds(1));
SetDataSource(default_data_source);
}
void FPGAAcquisitionDevice::ReadWorkCompletionThread() {
@@ -136,14 +137,6 @@ void FPGAAcquisitionDevice::InitializeROIMap(const uint16_t *map, size_t module_
LoadCalibration(0);
}
void FPGAAcquisitionDevice::InitializePixelMask(const uint32_t *module_mask, size_t module_number) {
memcpy(buffer_device[0]->pixels, module_mask, RAW_MODULE_SIZE * sizeof(uint32_t));
buffer_device[0]->module_statistics.module_number = module_number;
buffer_device[0]->module_statistics.load_calibration_destination = LOAD_CALIBRATION_DEST_PXL_MASK;
LoadCalibration(0);
}
void FPGAAcquisitionDevice::InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
@@ -224,12 +217,26 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
job.energy_kev = x.GetPhotonEnergyForConversion_keV();
job.nstorage_cells = x.GetStorageCellNumber() - 1;
job.mode = data_collection_id << 16;
job.nsummation = x.GetFPGASummation() - 1;
job.data_stream = data_stream;
job.nsummation = x.GetSummation() - 1;
expected_descriptors_per_module = DMA_DESCRIPTORS_PER_MODULE;
if (x.IsJungfrauConvPhotonCnt())
switch (x.GetDetectorMode()) {
case DetectorMode::Conversion:
case DetectorMode::Raw:
break;
case DetectorMode::PedestalG0:
job.mode |= MODE_PEDESTAL_G0;
break;
case DetectorMode::PedestalG1:
job.mode |= MODE_PEDESTAL_G1;
break;
case DetectorMode::PedestalG2:
job.mode |= MODE_PEDESTAL_G2;
break;
}
if (x.IsConversionOnFPGA())
job.mode |= MODE_CONV;
if (x.IsFixedGainG1())
@@ -238,28 +245,8 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
if (!x.IsPixelSigned())
job.mode |= MODE_UNSIGNED;
if (x.GetEigerBitDepth() == 32)
job.mode |= MODE_EIGER_32BIT;
else if (x.GetEigerBitDepth() == 8)
job.mode |= MODE_EIGER_8BIT;
if (x.GetByteDepthFPGA() == 4)
job.mode |= MODE_32BIT_OUTPUT;
if (x.GetByteDepthFPGA() == 1)
job.mode |= MODE_8BIT_OUTPUT;
if (x.IsApplyPixelMask())
job.mode |= MODE_APPLY_PIXEL_MASK;
if (x.GetLossyCompressionPoisson()) {
job.mode |= MODE_SQROOT;
job.sqrtmult = x.GetLossyCompressionPoisson().value();
}
if (x.GetPixelValueLowThreshold()) {
job.mode |= MODE_THRESHOLD;
job.pxlthreshold = x.GetPixelValueLowThreshold().value();
}
if (x.GetPixelDepth() == 4)
job.mode |= MODE_32BIT;
}
void FPGAAcquisitionDevice::Start(const DiffractionExperiment &experiment, uint32_t flag) {
@@ -267,6 +254,11 @@ void FPGAAcquisitionDevice::Start(const DiffractionExperiment &experiment, uint3
throw(JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
"Hardware action running prior to start of data acquisition"));
if (experiment.IsUsingInternalPacketGen())
SetDataSource(AcquisitionDeviceSource::FRAME_GENERATOR);
else
SetDataSource(default_data_source);
DataCollectionConfig cfg_in{}, cfg_out{};
FillActionRegister(experiment, cfg_in);
@@ -295,10 +287,40 @@ FPGAAcquisitionDevice::FPGAAcquisitionDevice(uint16_t data_stream)
internal_pkt_gen_frame(RAW_MODULE_SIZE * MAX_MODULES_FPGA) {
}
AcquisitionDeviceSource FPGAAcquisitionDevice::GetDataSource() {
switch (HW_GetDataSource()) {
case STREAM_MERGE_SRC_NETWORK:
return AcquisitionDeviceSource::NETWORK;
case STREAM_MERGE_SRC_FRAME_GEN:
return AcquisitionDeviceSource::FRAME_GENERATOR;
default:
return AcquisitionDeviceSource::NONE;
}
}
void FPGAAcquisitionDevice::SetDefaultDataSource(AcquisitionDeviceSource id) {
default_data_source = id;
SetDataSource(id);
}
void FPGAAcquisitionDevice::SetDataSource(AcquisitionDeviceSource id) {
switch (id) {
case AcquisitionDeviceSource::NETWORK:
HW_SetDataSource(STREAM_MERGE_SRC_NETWORK);
break;
case AcquisitionDeviceSource::FRAME_GENERATOR:
HW_SetDataSource(STREAM_MERGE_SRC_FRAME_GEN);
break;
case AcquisitionDeviceSource::NONE:
HW_SetDataSource(STREAM_MERGE_SRC_NONE);
break;
}
}
uint32_t FPGAAcquisitionDevice::GetExpectedDescriptorsPerModule() const {
return expected_descriptors_per_module;
}
void FPGAAcquisitionDevice::LoadCalibration(uint32_t handle) {
HW_LoadCalibration(LoadCalibrationConfig{.handle = handle});
}
}

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_FPGAACQUISITIONDEVICE_H
#define JUNGFRAUJOCH_FPGAACQUISITIONDEVICE_H
@@ -11,6 +10,7 @@ class FPGAAcquisitionDevice : public AcquisitionDevice {
uint16_t data_collection_id = 0;
uint32_t expected_descriptors_per_module = 1;
AcquisitionDeviceSource default_data_source = AcquisitionDeviceSource::NETWORK;
virtual void FPGA_StartAction(const DiffractionExperiment &experiment) = 0;
virtual void FPGA_EndAction() = 0;
@@ -33,11 +33,17 @@ class FPGAAcquisitionDevice : public AcquisitionDevice {
void LoadCalibration(uint32_t handle);
virtual bool HW_ReadMailbox(uint32_t *values) = 0;
virtual bool HW_SendWorkRequest(uint32_t handle) = 0;
virtual void HW_SetDataSource(uint32_t val) = 0;
virtual uint32_t HW_GetDataSource() = 0;
void StartSendingWorkRequests() override;
void Start(const DiffractionExperiment &experiment, uint32_t flag) override;
void SetDataSource(AcquisitionDeviceSource id); // doesn't change default data
protected:
std::vector<uint16_t> internal_pkt_gen_frame;
explicit FPGAAcquisitionDevice(uint16_t data_stream);
virtual void HW_GetEnvParams(DeviceStatus *status) const {
memset(status, 0, sizeof(DeviceStatus));
}
public:
void InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) override;
void InitializeIntegrationMap(const DiffractionExperiment &experiment, const std::vector<uint16_t> &v,
@@ -45,8 +51,10 @@ public:
void InitializeIntegrationMap(const uint16_t *map, const float *weights, size_t module_number) override;
void InitializeSpotFinderResolutionMap(const float *data, size_t module_number) override;
void InitializeROIMap(const uint16_t *map, size_t module_number) override;
void InitializePixelMask(const uint32_t *module_mask, size_t module_number) override;
void SetInternalGeneratorFrame(const uint16_t *input, size_t module_number) override;
AcquisitionDeviceSource GetDataSource() override;
void SetDefaultDataSource(AcquisitionDeviceSource id) override;
uint32_t GetExpectedDescriptorsPerModule() const override;
};

View File

@@ -1,10 +1,42 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include "HLSSimulatedDevice.h"
#include <bitset>
#include <arpa/inet.h>
#include "../fpga/hls/datamover_model.h"
#include "../fpga/hls/hls_jfjoch.h"
uint16_t checksum(const uint16_t *addr, size_t count) {
/* Compute Internet Checksum for "count" bytes
* beginning at location "addr".
*/
long sum = 0;
for (int i = 0; i < count / 2; i++)
sum += addr[i];
/* Add left-over byte, if any */
if (count % 2 == 1)
sum += ((uint8_t *) addr)[count / 2];
/* Fold 32-bit sum to 16 bits */
while (sum>>16)
sum = (sum & 0xffff) + (sum >> 16);
return ~sum;
}
HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node)
: FPGAAcquisitionDevice(data_stream) {
: FPGAAcquisitionDevice(data_stream),
datamover_in(Direction::Input, nullptr),
datamover_out(Direction::Output, nullptr),
datamover_out_hbm_0(Direction::Output, (char *) hbm.data()),
datamover_out_hbm_1(Direction::Output, (char *) hbm.data()),
datamover_in_hbm_0(Direction::Input, (char *) hbm.data()),
datamover_in_hbm_1(Direction::Input, (char *) hbm.data()),
idle(true), hbm(hbm_if_size / 32 * hbm_if_count),
dma_address_table(65536) {
mac_addr = 0xCCAA11223344;
ipv4_addr = 0x0132010A;
@@ -12,16 +44,75 @@ HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buf
MapBuffersStandard(in_frame_buffer_size_modules, numa_node);
device = std::make_unique<HLSDevice>(buffer_device);
auto in_mem_location32 = (uint32_t *) dma_address_table.data();
for (int i = 0; i < buffer_device.size(); i++) {
in_mem_location32[2 * i ] = ((uint64_t) buffer_device[i]) & UINT32_MAX;
in_mem_location32[2 * i + 1] = ((uint64_t) buffer_device[i]) >> 32;
}
}
void HLSSimulatedDevice::CreateFinalPacket(const DiffractionExperiment& experiment) {
device->CreateFinalPacket();
CreateJFPacket(experiment, UINT64_MAX, 0, 0, nullptr, false);
}
void HLSSimulatedDevice::SendPacket(char *buffer, int len, uint8_t user) {
auto obuff = (ap_uint<512> *)buffer;
for (int i = 0; i < (len + 63) / 64; i++) {
packet_512_t packet_in;
if (i == (len + 63) / 64 - 1) packet_in.last = 1;
else packet_in.last = 0;
packet_in.keep = 0xFFFFFFFFFFFFFFFF;
packet_in.user = user;
packet_in.data = obuff[i];
din_eth.write(packet_in);
}
}
void HLSSimulatedDevice::CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet,
uint32_t module_number, const uint16_t *data, int8_t adjust_axis, uint8_t user) {
device->CreateJFPacket(frame_number, eth_packet, module_number, data, adjust_axis, user);
char buff[256*64];
memset(buff, 0, 256*64);
auto packet = (jf_raw_packet *)buff;
packet->ether_type = htons(0x0800);
packet->sour_mac[0] = 0x00; // module 0
uint64_t tmp_mac = mac_addr;
for (int i = 0; i < 6; i++)
packet->dest_mac[i] = (tmp_mac >> (8*i)) % 256;
uint32_t half_module = 2 * module_number | ((eth_packet >= 64) ? 1 : 0);
packet->ipv4_header_h = htons(0x4500); // Big endian in IP header!
packet->ipv4_header_total_length = htons(8268); // Big endian in IP header!
packet->ipv4_header_dest_ip = ipv4_addr;
packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, half_module);
packet->ipv4_header_ttl_protocol = htons(0x0011);
packet->ipv4_header_checksum = checksum( (uint16_t *) &packet->ipv4_header_h, 20); // checksum is already in network order
packet->udp_dest_port = htons(GetUDPPort()); // module number
packet->udp_sour_port = htons(0xDFAC);
packet->udp_length = htons(8248);
// JF headers are little endian
packet->jf.detectortype = SLS_DETECTOR_TYPE_JUNGFRAU;
packet->jf.timestamp = 0xABCDEF0000FEDCBAL;
packet->jf.bunchid = 0x1234567898765431L;
packet->jf.row = half_module;
packet->jf.column = 0;
packet->jf.framenum = frame_number;
packet->jf.packetnum = eth_packet % 64;
if (data != nullptr) {
for (int i = 0; i < 4096; i++)
packet->jf.data[i] = data[i];
}
packet->udp_checksum = htons(checksum( (uint16_t *) (buff+42), 8192+48));
SendPacket(buff, (130+adjust_axis)*64, user);
}
void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames,
@@ -35,75 +126,635 @@ void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment
void HLSSimulatedDevice::CreateEIGERPacket(const DiffractionExperiment &experiment, uint64_t frame_number,
uint32_t eth_packet, uint32_t module_number, uint32_t col, uint32_t row,
const uint16_t *data) {
device->CreateEIGERPacket(frame_number, eth_packet, module_number, col, row, data);
char buff[256*64];
memset(buff, 0, 256*64);
auto packet = (eiger_raw_packet *)buff;
packet->ether_type = htons(0x0800);
packet->sour_mac[0] = 0x00; // module 0
uint64_t tmp_mac = mac_addr;
for (int i = 0; i < 6; i++)
packet->dest_mac[i] = (tmp_mac >> (8*i)) % 256;
packet->ipv4_header_h = htons(0x4500); // Big endian in IP header!
packet->ipv4_header_total_length = htons(4172); // Big endian in IP header!
packet->ipv4_header_dest_ip = ipv4_addr;
packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, 0);
packet->ipv4_header_ttl_protocol = htons(0x0011);
packet->ipv4_header_checksum = checksum( (uint16_t *) &packet->ipv4_header_h, 20); // checksum is already in network order
packet->udp_dest_port = htons(GetUDPPort()); // module number
packet->udp_sour_port = htons(0xDFAC);
packet->udp_length = htons(4152);
// JF headers are little endian
packet->eiger.detectortype = SLS_DETECTOR_TYPE_EIGER;
packet->eiger.timestamp = 0xABCDEF0000FEDCBAL;
packet->eiger.bunchid = 0x1234567898765431L;
packet->eiger.row = (2 * module_number) | (row % 2);
packet->eiger.column = col % 2;
packet->eiger.framenum = frame_number;
packet->eiger.packetnum = eth_packet % 64;
if (data != nullptr) {
for (int i = 0; i < 2048; i++)
packet->eiger.data[i] = data[i];
}
packet->udp_checksum = htons(checksum( (uint16_t *) (buff+42), 4096+48));
SendPacket(buff, 66*64, 0);
}
AXI_STREAM & HLSSimulatedDevice::OutputStream() {
return dout_eth;
}
void HLSSimulatedDevice::HW_ReadActionRegister(DataCollectionConfig *job) {
device->HW_ReadActionRegister(job);
memcpy(job, &cfg, sizeof(DataCollectionConfig));
}
void HLSSimulatedDevice::HW_WriteActionRegister(const DataCollectionConfig *job) {
device->HW_WriteActionRegister(job);
memcpy(&cfg, job, sizeof(DataCollectionConfig));
}
void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
device->FPGA_StartAction();
if (action_thread.joinable())
action_thread.join();
run_counter += 1;
run_data_collection = 1;
cancel_data_collection = 0;
idle = false;
while (!din_frame_generator.empty())
din_frame_generator.read();
datamover_out.ClearCompletedDescriptors();
action_thread = std::thread(&HLSSimulatedDevice::HLSMainThread, this );
}
void HLSSimulatedDevice::FrameGeneratorFuture(FrameGeneratorConfig config) {
frame_generator(din_frame_generator,
hbm.data(),
hbm.data(),
hbm_if_size,
mac_addr,
ipv4_addr,
cancel_data_collection,
config);
}
void HLSSimulatedDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) {
device->HW_RunInternalGenerator(config);
frame_generator_future = std::async(std::launch::async, &HLSSimulatedDevice::FrameGeneratorFuture, this, config);
}
void HLSSimulatedDevice::FPGA_EndAction() {
device->FPGA_EndAction();
if (action_thread.joinable())
action_thread.join();
}
HLSSimulatedDevice::~HLSSimulatedDevice() {
if (action_thread.joinable())
action_thread.join();
}
bool HLSSimulatedDevice::HW_ReadMailbox(uint32_t *values) {
return device->HW_ReadMailbox(values);
std::unique_lock<std::mutex> ul(completion_mutex);
ap_uint<32> tmp;
bool ret = completion_stream.read_nb(tmp);
values[0] = tmp;
// equivalent to driver functionality
if (ret) {
uint32_t data_collection_id = (values[0] >> 16) & 0xFFFF;
uint32_t handle = values[0] & 0xFFFF;
if (handle == HANDLE_START)
completion_count = 0;
else if ((handle != HANDLE_END) && (data_collection_id != DATA_COLLECTION_ID_PURGE)) {
completion_count++;
while (completion_count * DMA_DESCRIPTORS_PER_MODULE > datamover_out.GetCompletedDescriptors())
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
return ret;
}
void HLSSimulatedDevice::Cancel() {
device->Cancel();
cancel_data_collection = 1;
}
bool HLSSimulatedDevice::HW_IsIdle() const {
return device->HW_IsIdle();
return idle && datamover_out.IsIdle();
}
bool HLSSimulatedDevice::HW_SendWorkRequest(uint32_t handle) {
return device->HW_SendWorkRequest(handle);
work_request_stream.write(handle);
return true;
}
inline uint32_t float2uint(float f) {
float_uint32 fu;
fu.f = f;
return fu.u;
}
void HLSSimulatedDevice::HLSMainThread() {
ap_uint<1> clear_counters = 0;
uint64_t packets_processed;
std::vector<std::thread> hls_cores;
STREAM_512 ip1, udp1, udp2, icmp1, arp1;
STREAM_512 network0;
STREAM_768 stream_768_0;
STREAM_768 stream_768_1;
STREAM_768 stream_768_2;
STREAM_768 stream_768_3;
STREAM_768 stream_768_4;
STREAM_768 stream_768_5;
STREAM_512 data_0;
hls::stream<ap_axiu<512, 1, 1, 1>, 2> data_1;
hls::stream<ap_axiu<512, 1, 1, 1>, 2> data_2;
STREAM_512 data_3;
STREAM_512 data_4;
STREAM_512 data_5;
STREAM_512 data_6;
STREAM_512 data_7;
STREAM_512 data_8;
STREAM_512 data_9;
STREAM_512 data_10;
STREAM_512 data_12;
STREAM_512 data_13;
hls::stream<axis_addr> addr0;
hls::stream<axis_addr> addr1;
hls::stream<axis_addr> addr2;
hls::stream<axis_addr> addr3;
hls::stream<axis_completion> axi_compl[12];
hls::stream<ap_uint<16>> hbm_handles;
hls::stream<ap_uint<512>> adu_histo_result;
hls::stream<ap_axiu<64,1,1,1>> integration_result_0;
hls::stream<ap_uint<512>> integration_result_1;
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_0;
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_1;
hls::stream<ap_uint<32>> spot_finder_conn_0;
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_2;
hls::stream<ap_uint<512>> spot_finder_result_3;
hls::stream<ap_uint<32>> spot_finder_mask_0;
hls::stream<ap_uint<256>> roi_calc_result_0;
hls::stream<ap_uint<UDP_METADATA_STREAM_WIDTH> > udp_metadata;
volatile ap_uint<1> idle_data_collection = 1;
ap_uint<1> load_to_hbm_idle;
ap_uint<1> save_to_hbm_idle;
ap_uint<1> integration_idle;
ap_uint<1> stream_conv_idle;
ap_uint<1> frame_summation_idle;
volatile bool done = false;
volatile bool udp_done = false; // done AND udp_idle
volatile bool sls_done = false; // done AND sls_idle
// Sent gratuitous ARP message
arp(arp1, dout_eth, mac_addr, ipv4_addr, 1, 1);
Logger logger_hls("HLS");
volatile rcv_state_t state = RCV_INIT;
// Start data collection
data_collection_fsm(data_0, data_1,
addr0, addr1,
run_data_collection,
cancel_data_collection,
idle_data_collection,
cfg.mode,
float2uint(cfg.energy_kev),
cfg.nframes,
cfg.nmodules,
cfg.nstorage_cells,
cfg.nsummation , state);
run_data_collection = 0;
data_collection_fsm(data_0, data_1,
addr0, addr1,
run_data_collection,
cancel_data_collection,
idle_data_collection,
cfg.mode,
float2uint(cfg.energy_kev),
cfg.nframes,
cfg.nmodules,
cfg.nstorage_cells,
cfg.nsummation, state);
hls_cores.emplace_back([&] {
while (!udp_done) {
if (din_eth.empty() && din_frame_generator.empty())
std::this_thread::sleep_for(std::chrono::microseconds(10));
else
stream_merge(din_eth, din_frame_generator, network0, data_source);
}
logger_hls.Info("Stream_merge done");
});
hls_cores.emplace_back([&] {
while (!udp_done) {
if (network0.empty())
std::this_thread::sleep_for(std::chrono::microseconds(10));
else
ethernet(network0, ip1, arp1, mac_addr, eth_packets, clear_counters);
}
logger_hls.Info("ethernet done");
});
hls_cores.emplace_back([&] {
while (!udp_done) {
if (ip1.empty())
std::this_thread::sleep_for(std::chrono::microseconds(10));
else
ipv4(ip1, udp1, icmp1, ipv4_addr);
}
logger_hls.Info("ipv4 done");
});
hls_cores.emplace_back([&] {
ap_uint<1> udp_idle = 1;
while (!done || !udp_idle) {
if (udp1.empty())
std::this_thread::sleep_for(std::chrono::microseconds(10));
else
udp(udp1, udp2, udp_metadata, udp_packets, clear_counters, udp_idle);
}
udp_done = true;
logger_hls.Info("udp done");
});
hls_cores.emplace_back([&] {
ap_uint<1> sls_idle = 1;
while (!done || !sls_idle) {
if (udp2.empty())
std::this_thread::sleep_for(std::chrono::microseconds (10));
else
sls_detector(udp2, udp_metadata, data_0, addr0, sls_packets, udp_eth_err, udp_len_err, current_pulse_id,
clear_counters, sls_idle);
}
sls_done = true;
logger_hls.Info("sls_detector done");
});
// 1. Parse incoming UDP packets
hls_cores.emplace_back([&] {
while ((state != RCV_WAIT_FOR_START) || (idle_data_collection.read() == 0) || (!data_0.empty())) {
data_collection_fsm(data_0, data_1,
addr0, addr1,
run_data_collection,
cancel_data_collection,
idle_data_collection,
cfg.mode,
float2uint(cfg.energy_kev),
cfg.nframes,
cfg.nmodules,
cfg.nstorage_cells,
cfg.nsummation,
state);
}
done = true;
logger_hls.Info("data collection done");
});
// 2. Cache images in HBM
hls_cores.emplace_back([&] { save_to_hbm(addr1, axi_compl[0], hbm_handles,
datamover_out_hbm_0.GetCtrlStream(),
datamover_out_hbm_1.GetCtrlStream(),
save_to_hbm_idle,
hbm_if_size);});
hls_cores.emplace_back([&] { save_to_hbm_data(data_1,
data_3,
datamover_out_hbm_0.GetDataStream(),
datamover_out_hbm_1.GetDataStream());});
hls_cores.emplace_back([&] {frame_summation_reorder_compl(data_3, data_4, axi_compl[0], axi_compl[1]);});
hls_cores.emplace_back([&] { load_from_hbm(data_4, data_5, axi_compl[1], axi_compl[2], hbm_handles,
datamover_in_hbm_0.GetDataStream(), datamover_in_hbm_1.GetDataStream(),
datamover_in_hbm_0.GetCtrlStream(), datamover_in_hbm_1.GetCtrlStream(),
load_to_hbm_idle, hbm_if_size);});
hls_cores.emplace_back([&] { pedestal(data_5, data_6, axi_compl[2], axi_compl[3],
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm_if_size);});
// 3. Calculate histogram of ADU values
hls_cores.emplace_back([&] { adu_histo(data_6, data_7, adu_histo_result, axi_compl[3], axi_compl[4]);});
// 4. Mask missing pixels
hls_cores.emplace_back([&] { mask_missing(data_7, data_8, axi_compl[4], axi_compl[5]);});
// 5. Handle EIGER packets properly
hls_cores.emplace_back([&] { eiger_reorder(data_8, data_9, axi_compl[5], axi_compl[6]);});
// 6. Apply pedestal & gain corrections
hls_cores.emplace_back([&] { jf_conversion(data_9, stream_768_0,
axi_compl[6], axi_compl[7],
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm.data(),
hbm_if_size); });
// 7. Frame summation
hls_cores.emplace_back([&] { frame_summation(stream_768_0, stream_768_1, axi_compl[7], axi_compl[8], frame_summation_idle);});
// 8. Integration of pixels
hls_cores.emplace_back([&] { integration(stream_768_1, stream_768_2, integration_result_0, axi_compl[8], axi_compl[9],
hbm.data(), hbm.data(), hbm.data(), hbm.data(), integration_idle, hbm_if_size);});
hls_cores.emplace_back([&] { axis_64_to_512(integration_result_0, integration_result_1);});
// 9. Spot finding
ap_uint<32> tmp_snr_threshold = float2uint(spot_finder_parameters.snr_threshold);
ap_uint<32> min_d = float2uint(spot_finder_parameters.min_d);
ap_uint<32> max_d = float2uint(spot_finder_parameters.max_d);
ap_int<32> tmp_count_threshold = spot_finder_parameters.count_threshold;
ap_uint<32> min_pix_per_spot = spot_finder_parameters.min_pix_per_spot;
hls_cores.emplace_back([&] {
spot_finder_mask(stream_768_2,
stream_768_3,
spot_finder_mask_0,
axi_compl[9],
axi_compl[10],
hbm.data(),
hbm.data(),
min_d,
max_d,
hbm_if_size);
logger_hls.Info("spot_finder_mask done");
});
hls_cores.emplace_back([&] {
spot_finder(stream_768_3, spot_finder_mask_0, stream_768_4, spot_finder_result_0, tmp_count_threshold, tmp_snr_threshold);
logger_hls.Info("spot_finder done");
});
hls_cores.emplace_back([&] {
spot_finder_connectivity(spot_finder_result_0,
spot_finder_result_1,
spot_finder_conn_0);
logger_hls.Info("spot_finder_connectivity done");
});
hls_cores.emplace_back([&] {
spot_finder_merge(spot_finder_result_1,
spot_finder_conn_0,
spot_finder_result_2,
min_pix_per_spot);
logger_hls.Info("spot_finder_merge done");
});
hls_cores.emplace_back([&] {
axis_32_to_512(spot_finder_result_2, spot_finder_result_3);
logger_hls.Info("axis_32_to_512 done");
});
hls_cores.emplace_back([&] {
roi_calc(stream_768_4,
stream_768_5,
roi_calc_result_0,
axi_compl[10],
axi_compl[11],
hbm.data(),
hbm.data(),
hbm_if_size);
logger_hls.Info("roi_calc done");
});
// 10. Reduce/extend 24-bit stream
hls_cores.emplace_back([&] { stream_24bit_conv(stream_768_5, data_12, stream_conv_idle);});
// 11. Prepare data to write to host memory
hls_cores.emplace_back([&] {
ap_uint<3> state;
host_writer(data_12, adu_histo_result, integration_result_1, spot_finder_result_3, roi_calc_result_0,
axi_compl[11], datamover_out.GetDataStream(),
datamover_out.GetCtrlStream(), work_request_stream, completion_stream,
dma_address_table.data(), packets_processed, host_writer_idle, cancel_data_collection, state);
logger_hls.Info("host_writer done");
});
for (auto &i : hls_cores)
i.join();
if (frame_generator_future.valid())
frame_generator_future.get();
// reset static counter
arp(arp1, dout_eth, mac_addr, ipv4_addr, 0, 1);
try {
while (!din_eth.empty())
din_eth.read();
if (!addr1.empty())
throw std::runtime_error("Addr1 queue not empty");
if (!addr2.empty())
throw std::runtime_error("Addr2 queue not empty");
if (!addr3.empty())
throw std::runtime_error("Addr3 queue not empty");
if (!data_1.empty())
throw std::runtime_error("data_1 queue not empty");
if (!data_2.empty())
throw std::runtime_error("data_2 queue not empty");
if (!data_3.empty())
throw std::runtime_error("data_3 queue not empty");
if (!data_4.empty())
throw std::runtime_error("data_4 queue not empty");
if (!data_5.empty())
throw std::runtime_error("data_5 queue not empty");
if (!data_7.empty())
throw std::runtime_error("data_7 queue not empty");
if (!data_8.empty())
throw std::runtime_error("data_8 queue not empty");
if (!data_9.empty())
throw std::runtime_error("data_9 queue not empty");
if (!data_10.empty())
throw std::runtime_error("data_10 queue not empty");
if (!data_12.empty())
throw std::runtime_error("data_12 queue not empty");
if (!data_13.empty())
throw std::runtime_error("data_13 queue not empty");
for (auto &c: axi_compl) {
if (!c.empty())
throw std::runtime_error("Compl queue not empty");
}
if (!stream_768_0.empty())
throw std::runtime_error("stream_768_0 queue not empty");
if (!stream_768_1.empty())
throw std::runtime_error("stream_768_1 queue not empty");
if (!stream_768_2.empty())
throw std::runtime_error("stream_768_2 queue not empty");
if (!stream_768_3.empty())
throw std::runtime_error("stream_768_3 queue not empty");
if (!stream_768_4.empty())
throw std::runtime_error("stream_768_4 queue not empty");
if (!hbm_handles.empty())
throw std::runtime_error("Handles queue not empty");
if (!integration_result_0.empty())
throw std::runtime_error("Integration result queue not empty");
if (!integration_result_1.empty())
throw std::runtime_error("Integration result queue not empty");
if (!datamover_in.GetDataStream().empty())
throw std::runtime_error("Datamover queue is not empty");
while (!datamover_out.IsIdle())
std::this_thread::sleep_for(std::chrono::milliseconds(100));
} catch (const std::runtime_error &e) {
if (logger)
logger->ErrorException(e);
throw e;
}
if (logger)
logger->Info("Packets Eth {} UDP {} SLS {} Proc {}", eth_packets, udp_packets, sls_packets, packets_processed);
idle = true;
}
DataCollectionStatus HLSSimulatedDevice::GetDataCollectionStatus() const {
return device->GetDataCollectionStatus();
DataCollectionStatus status{};
union {
uint64_t u64;
double d;
} pulse_id_conv;
pulse_id_conv.u64 = current_pulse_id;
status.ctrl_reg = ap_uint<1>(host_writer_idle) ? (1 << 4) : 0;
status.max_modules = max_modules;
status.hbm_size_bytes = hbm_if_size;
status.run_counter = run_counter;
status.current_pulseid = pulse_id_conv.d;
status.packets_udp = udp_packets;
status.packets_eth = eth_packets;
status.packets_sls = sls_packets;
return status;
}
void HLSSimulatedDevice::HW_LoadCalibration(const LoadCalibrationConfig &config) {
device->HW_LoadCalibration(config);
int ret = load_calibration(hbm.data(), hbm.data(),
config,
hbm_if_size,
datamover_in.GetCtrlStream(),
datamover_in.GetDataStream(),
dma_address_table.data());
if (ret)
throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
"Error in loading calibration " + std::to_string(ret));
if (!datamover_in.GetDataStream().empty())
throw std::runtime_error("Datamover queue is not empty");
}
void HLSSimulatedDevice::HW_SetSpotFinderParameters(const SpotFinderParameters &params) {
device->HW_SetSpotFinderParameters(params);
spot_finder_parameters = params;
}
void HLSSimulatedDevice::HW_SetDataSource(uint32_t val) {
data_source = val;
}
uint32_t HLSSimulatedDevice::HW_GetDataSource() {
return data_source;
}
void HLSSimulatedDevice::CreateXfelBunchIDPacket(double pulse_id, uint32_t event_code) {
device->CreateXfelBunchIDPacket(pulse_id, event_code);
union {
uint64_t u64;
double d;
} pulse_id_conv;
pulse_id_conv.d = pulse_id;
bunchid_raw_packet packet{};
packet.ether_type = htons(0x0800);
for (int i = 0; i < 6; i++)
packet.dest_mac[i] = 0xFF;
packet.ipv4_header_h = htons(0x4500); // Big endian in IP header!
packet.ipv4_header_total_length = htons(sizeof(bunchid_payload) + 8 + 20); // Big endian in IP header!
packet.ipv4_header_dest_ip = UINT32_MAX;
packet.ipv4_header_ttl_protocol = htons(0x0011);
packet.ipv4_header_checksum = checksum( (uint16_t *) &packet.ipv4_header_h, 20); // checksum is already in network order
packet.udp_length = htons(sizeof(bunchid_payload) + 8);
packet.payload.magicn[0] = BUNCHID_MAGICN;
packet.payload.magicn[1] = BUNCHID_MAGICN;
packet.payload.magicn[2] = BUNCHID_MAGICN;
packet.payload.bunchid_msb[0] = (pulse_id_conv.u64 >> 32) & UINT32_MAX;
packet.payload.bunchid_msb[1] = (pulse_id_conv.u64 >> 32) & UINT32_MAX;
packet.payload.bunchid_lsb[0] = pulse_id_conv.u64 & UINT32_MAX;
packet.payload.bunchid_lsb[1] = pulse_id_conv.u64 & UINT32_MAX;
packet.payload.montrig = event_code;
SendPacket((char *) &packet, sizeof(bunchid_raw_packet));
}
DeviceStatus HLSSimulatedDevice::GetDeviceStatus() const {
DeviceStatus status{};
strncpy(status.serial_number, "HLS1", sizeof(status.device_number));
strncpy(status.device_number, "HLS device", sizeof(status.device_number));
status.fpga_default_mac_addr = mac_addr;
status.eth_link_count = 1;
status.eth_link_status = 1;
status.packets_sls = device->GetSLSPackets();
status.packets_udp = device->GetUDPPackets();
status.hbm_0_temp_C = 0;
status.hbm_1_temp_C = 0;
status.fpga_temp_C = 0;
return status;
}

View File

@@ -1,18 +1,65 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_HLSSIMULATEDDEVICE_H
#define JUNGFRAUJOCH_HLSSIMULATEDDEVICE_H
#include <thread>
#include "../fpga/hls/hls_jfjoch.h"
#include "../fpga/hls/datamover_model.h"
#include "../common/DiffractionExperiment.h"
#include "../fpga/hls_simulation/HLSDevice.h"
#include "FPGAAcquisitionDevice.h"
#include "../jungfrau/sls_packet.h"
uint16_t checksum(const uint16_t *addr, size_t count);
class HLSSimulatedDevice : public FPGAAcquisitionDevice {
std::unique_ptr<HLSDevice> device;
AXI_STREAM din_eth;
AXI_STREAM din_frame_generator;
AXI_STREAM dout_eth;
uint32_t run_counter = 0;
ap_uint<2> data_source = STREAM_MERGE_SRC_NETWORK;
SpotFinderParameters spot_finder_parameters;
uint64_t current_pulse_id = 0;
DataCollectionConfig cfg;
volatile bool idle;
constexpr static const size_t hbm_if_count = 32;
constexpr static const size_t hbm_if_size = 32*1024*1024LU;
std::vector<ap_uint<256>> hbm;
hls::stream<ap_uint<32> > work_request_stream;
hls::stream<ap_uint<32> > completion_stream;
std::mutex completion_mutex;
uint32_t completion_count;
std::thread action_thread;
std::future<void> frame_generator_future;
Datamover<512> datamover_in;
Datamover<512> datamover_out;
Datamover<256> datamover_in_hbm_0;
Datamover<256> datamover_in_hbm_1;
Datamover<256, 16> datamover_out_hbm_0;
Datamover<256, 16> datamover_out_hbm_1;
ap_uint<1> run_data_collection;
ap_uint<1> cancel_data_collection;
volatile ap_uint<1> host_writer_idle;
std::vector<uint64_t> dma_address_table;
uint64_t eth_packets = 0;
uint64_t icmp_packets = 0;
uint64_t udp_packets = 0;
uint64_t sls_packets = 0;
uint32_t udp_len_err = 0;
uint32_t udp_eth_err = 0;
void HW_ReadActionRegister(DataCollectionConfig *job) override;
void HW_WriteActionRegister(const DataCollectionConfig *job) override;
@@ -24,10 +71,15 @@ class HLSSimulatedDevice : public FPGAAcquisitionDevice {
bool HW_SendWorkRequest(uint32_t handle) override;
void HW_LoadCalibration(const LoadCalibrationConfig &config) override;
void HW_SetSpotFinderParameters(const SpotFinderParameters &params) override;
uint32_t HW_GetDataSource() override;
void HW_SetDataSource(uint32_t val) override;
void HW_RunInternalGenerator(const FrameGeneratorConfig &config) override;
void FrameGeneratorFuture(FrameGeneratorConfig config);
void HLSMainThread();
public:
HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node = -1);
~HLSSimulatedDevice() override = default;
~HLSSimulatedDevice() override;
void SendPacket(char *buffer, int len, uint8_t user = 0);
void CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet,
uint32_t module_number, const uint16_t *data, int8_t adjust_axis = 0, uint8_t user = 0);
void CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames,
@@ -38,8 +90,8 @@ public:
void CreateXfelBunchIDPacket(double bunchid, uint32_t event_code);
void CreateFinalPacket(const DiffractionExperiment& experiment);
DataCollectionStatus GetDataCollectionStatus() const override;
AXI_STREAM &OutputStream();
void Cancel() override;
DeviceStatus GetDeviceStatus() const override;
};

View File

@@ -1,21 +1,18 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include "PCIExpressDevice.h"
#include "../common/NetworkAddressConvert.h"
#define PCI_EXCEPT(x) try {x;} catch (const std::exception &e) { throw PCIeDeviceException(e.what()); }
PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, uint16_t pci_slot) :
PCIExpressDevice(data_stream, "/dev/jfjoch" + std::to_string(pci_slot)) {}
PCIExpressDevice::PCIExpressDevice(uint16_t data_stream) :
PCIExpressDevice(data_stream, "/dev/jfjoch" + std::to_string(data_stream)) {}
PCIExpressDevice(data_stream, "/dev/jfjoch" + std::to_string(data_stream)) {}
PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, const std::string &device_name)
: FPGAAcquisitionDevice(data_stream), dev(device_name, true) {
: FPGAAcquisitionDevice(data_stream), dev(device_name, true) {
DataCollectionStatus status;
PCI_EXCEPT(status = dev.GetDataCollectionStatus())
DataCollectionStatus status = dev.GetDataCollectionStatus();
max_modules = status.max_modules;
if (max_modules == 0)
@@ -34,88 +31,94 @@ PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, const std::string &devi
}
bool PCIExpressDevice::HW_ReadMailbox(uint32_t *values) {
PCI_EXCEPT(return dev.ReadWorkCompletion(values);)
return dev.ReadWorkCompletion(values);
}
void PCIExpressDevice::Cancel() {
PCI_EXCEPT(dev.Cancel();)
dev.Cancel();
}
bool PCIExpressDevice::HW_SendWorkRequest(uint32_t handle) {
PCI_EXCEPT(return dev.SendWorkRequest(handle);)
return dev.SendWorkRequest(handle);
}
void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
PCI_EXCEPT(dev.Start();)
dev.Start();
}
void PCIExpressDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) {
PCI_EXCEPT(dev.RunFrameGenerator(config);)
dev.RunFrameGenerator(config);
}
void PCIExpressDevice::FPGA_EndAction() {
PCI_EXCEPT(dev.End();)
dev.End();
}
bool PCIExpressDevice::HW_IsIdle() const {
PCI_EXCEPT(return dev.IsIdle();)
return dev.IsIdle();
}
void PCIExpressDevice::HW_WriteActionRegister(const DataCollectionConfig *config) {
PCI_EXCEPT(dev.SetConfig(*config);)
dev.SetConfig(*config);
}
void PCIExpressDevice::HW_ReadActionRegister(DataCollectionConfig *config) {
PCI_EXCEPT(*config = dev.GetConfig();)
*config = dev.GetConfig();
}
std::string PCIExpressDevice::GetMACAddress() const {
PCI_EXCEPT(return MacAddressToStr(dev.GetMACAddress());)
return MacAddressToStr(dev.GetMACAddress());
}
void PCIExpressDevice::SetMACAddress(uint64_t mac_addr_network_order) {
dev.SetMACAddress(mac_addr_network_order);
}
void PCIExpressDevice::HW_GetEnvParams(DeviceStatus *status) const {
*status = dev.GetDeviceStatus();
}
uint32_t PCIExpressDevice::GetNumKernelBuffers() const {
PCI_EXCEPT(return dev.GetBufferCount();)
return dev.GetBufferCount();
}
int32_t PCIExpressDevice::GetNUMANode() const {
PCI_EXCEPT(return dev.GetNumaNode();)
return dev.GetNumaNode();
}
void PCIExpressDevice::SetDefaultMAC() {
dev.SetDefaultMACAddress();
}
void PCIExpressDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) {
PCI_EXCEPT(
// Configure all links with the same IPv4 address
auto dev_status = dev.GetDeviceStatus();
for (int i = 0; i < dev_status.eth_link_count; i++)
dev.SetIPv4Address(ipv4_addr_network_order, i);
dev.SetIPv4Address(ipv4_addr_network_order, NET_IF_FRAME_GENERATOR);
)
dev.SetIPv4Address(ipv4_addr_network_order);
}
std::string PCIExpressDevice::GetIPv4Address() const {
PCI_EXCEPT(
return IPv4AddressToStr(dev.GetIPv4Address());
)
}
void PCIExpressDevice::HW_SetSpotFinderParameters(const SpotFinderParameters &params) {
PCI_EXCEPT(
dev.SetSpotFinderParameters(params);
)
dev.SetSpotFinderParameters(params);
}
DeviceStatus PCIExpressDevice::GetDeviceStatus() const {
PCI_EXCEPT(
return dev.GetDeviceStatus();
)
return dev.GetDeviceStatus();
}
DataCollectionStatus PCIExpressDevice::GetDataCollectionStatus() const {
PCI_EXCEPT(
return dev.GetDataCollectionStatus();
)
return dev.GetDataCollectionStatus();
}
uint32_t PCIExpressDevice::HW_GetDataSource() {
return dev.GetDataSource();
}
void PCIExpressDevice::HW_SetDataSource(uint32_t val) {
return dev.SetDataSource(val);
}
void PCIExpressDevice::HW_LoadCalibration(const LoadCalibrationConfig &config) {
PCI_EXCEPT(dev.LoadCalibration(config);)
dev.LoadCalibration(config);
}

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
#define JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
@@ -18,6 +17,8 @@ class PCIExpressDevice : public FPGAAcquisitionDevice {
void HW_WriteActionRegister(const DataCollectionConfig *job) override;
void HW_ReadActionRegister(DataCollectionConfig *job) override;
void HW_SetSpotFinderParameters(const SpotFinderParameters &params) override;
uint32_t HW_GetDataSource() override;
void HW_SetDataSource(uint32_t val) override;
void FPGA_EndAction() override;
uint32_t GetNumKernelBuffers() const;
void HW_RunInternalGenerator(const FrameGeneratorConfig &config) override;
@@ -27,8 +28,12 @@ public:
PCIExpressDevice(uint16_t data_stream, const std::string &device_name);
void Cancel() override;
void HW_GetEnvParams(DeviceStatus *status) const override;
int32_t GetNUMANode() const override;
void SetMACAddress(uint64_t mac_addr_network_order) override;
void SetDefaultMAC();
void SetIPv4Address(uint32_t ipv4_addr_network_order) override;
std::string GetMACAddress() const override;

View File

@@ -8,15 +8,11 @@ TARGET_INCLUDE_DIRECTORIES(JFJochAPI PUBLIC gen/model gen/api)
ADD_LIBRARY(JFJochBroker STATIC
JFJochStateMachine.cpp JFJochStateMachine.h
JFJochServices.cpp JFJochServices.h
JFJochBrokerHttp.cpp JFJochBrokerHttp.h JFJochBrokerParser.cpp JFJochBrokerParser.h
OpenAPIConvert.h
OpenAPIConvert.cpp)
JFJochBrokerHttp.cpp JFJochBrokerHttp.h JFJochBrokerParser.cpp JFJochBrokerParser.h)
TARGET_LINK_LIBRARIES(JFJochBroker JFJochReceiver JFJochDetector JFJochCommon JFJochAPI JFJochPreview)
ADD_EXECUTABLE(jfjoch_broker jfjoch_broker.cpp)
TARGET_LINK_LIBRARIES(jfjoch_broker JFJochBroker)
INSTALL(TARGETS jfjoch_broker RUNTIME COMPONENT jfjoch)
INSTALL(FILES redoc-static.html DESTINATION jfjoch/frontend COMPONENT jfjoch )
INSTALL(TARGETS jfjoch_broker RUNTIME)

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
// Using OpenAPI licensed with Apache License 2.0
#ifndef JUNGFRAUJOCH_JFJOCHBROKERHTTP_H
@@ -18,15 +17,7 @@
class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
Logger logger{"JFJochBroker"};
JFJochServices services {logger};
void config_image_format_get(Pistache::Http::ResponseWriter &response) override;
void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings,
Pistache::Http::ResponseWriter &response) override;
void fpga_status_get(Pistache::Http::ResponseWriter &response) override;
JFJochStateMachine state_machine;
JFJochStateMachine state_machine {services, logger};
std::string frontend_directory;
void config_detector_get(Pistache::Http::ResponseWriter &response) override;
@@ -34,10 +25,10 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings,
Pistache::Http::ResponseWriter &response) override;
void config_azim_int_get(Pistache::Http::ResponseWriter &response) override;
void config_rad_int_get(Pistache::Http::ResponseWriter &response) override;
void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &radIntSettings,
Pistache::Http::ResponseWriter &response) override;
void config_rad_int_put(const org::openapitools::server::model::Rad_int_settings &radIntSettings,
Pistache::Http::ResponseWriter &response) override;
void config_select_detector_get(Pistache::Http::ResponseWriter &response) override;
@@ -51,6 +42,41 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings,
Pistache::Http::ResponseWriter &response) override;
void GenericPlot(PlotType plot_type,
const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response);
void plot_bkg_estimate_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_error_pixel_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_image_collection_efficiency_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_indexing_rate_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_receiver_delay_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_max_count_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_sum_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_spot_count_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_strong_pixel_get(const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response) override;
void plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) override;
void plot_rad_int_get(Pistache::Http::ResponseWriter &response) override;
void plot_rad_int_per_file_get(Pistache::Http::ResponseWriter &response) override;
void plot_resolution_estimate_histogram_get(Pistache::Http::ResponseWriter &response) override;
void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override;
void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) override;
@@ -66,16 +92,26 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void status_get(Pistache::Http::ResponseWriter &response) override;
void wait_till_done_post(const std::optional<int32_t> &timeoutMs, Pistache::Http::ResponseWriter &response) override;
void wait_till_done_post(Pistache::Http::ResponseWriter &response) override;
void trigger_post(Pistache::Http::ResponseWriter &response) override;
void pedestal_post(Pistache::Http::ResponseWriter &response) override;
void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) override;
void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel,
const std::optional<int32_t> &sc,
Pistache::Http::ResponseWriter &response) override;
void config_roi_get(Pistache::Http::ResponseWriter &response) override;
void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions,
void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) override;
void preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings,
Pistache::Http::ResponseWriter &response) override;
void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) override;
void roi_box_get(Pistache::Http::ResponseWriter &response) override;
void roi_box_put(const org::openapitools::server::model::Roi_box_list &roiBoxList,
Pistache::Http::ResponseWriter &response) override;
void roi_circle_get(Pistache::Http::ResponseWriter &response) override;
void roi_circle_put(const org::openapitools::server::model::Roi_circle_list &roiCircleList,
Pistache::Http::ResponseWriter &response) override;
void config_internal_generator_image_put(const Pistache::Rest::Request &request,
@@ -84,106 +120,21 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void xfel_event_code_get(Pistache::Http::ResponseWriter &response) override;
void xfel_pulse_id_get(Pistache::Http::ResponseWriter &response) override;
void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_tiff_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
void config_instrument_get(Pistache::Http::ResponseWriter &response) override;
void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata,
Pistache::Http::ResponseWriter &response) override;
void GetStaticFile(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception &ex) const noexcept override;
template <class T>
void ProcessOutput(const T& output, Pistache::Http::ResponseWriter &response, bool compression = false) {
void ProcessOutput(const T& output, Pistache::Http::ResponseWriter &response) {
std::stringstream s;
if(!output.validate(s)) {
logger.Error(s.str());
response.send(Pistache::Http::Code::Internal_Server_Error, s.str(), MIME(Text, Plain));
}
nlohmann::json j = output;
if (compression)
response.setCompression(Pistache::Http::Header::Encoding::Deflate);
nlohmann::json j;
to_json(j, output);
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
}
void version_get(Pistache::Http::ResponseWriter &response) override;
void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) override;
void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) override;
void statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) override;
void config_zeromq_preview_get(Pistache::Http::ResponseWriter &response) override;
void
config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings,
Pistache::Http::ResponseWriter &response) override;
void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) override;
void config_zeromq_metadata_put(
const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings,
Pistache::Http::ResponseWriter &response) override;
void config_mask_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_cbor_get(const std::optional<int64_t> &id,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_jpeg_get(const std::optional<int64_t> &id,
const std::optional<bool> &showUserMask,
const std::optional<bool> &showRoi,
const std::optional<bool> &showSpots,
const std::optional<bool> &showBeamCenter,
const std::optional<float> &saturation,
const std::optional<int64_t> &jpegQuality,
const std::optional<float> &showResRing,
const std::optional<std::string> &color,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_png_get(const std::optional<int64_t> &id,
const std::optional<bool> &showUserMask,
const std::optional<bool> &showRoi,
const std::optional<bool> &showSpots,
const std::optional<bool> &showBeamCenter,
const std::optional<float> &saturation,
const std::optional<int64_t> &jpegQuality,
const std::optional<float> &showResRing,
const std::optional<std::string> &color,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) override;
void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) override;
void image_buffer_status_get(Pistache::Http::ResponseWriter &response) override;
void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
const std::optional<bool> &compression, const std::optional<float> &fill,
const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit,
Pistache::Http::ResponseWriter &response) override;
void config_indexing_get(Pistache::Http::ResponseWriter &response) override;
void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings,
Pistache::Http::ResponseWriter &response) override;
void result_scan_get(Pistache::Http::ResponseWriter &response) override;
public:
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
void AddDetectorSetup(const DetectorSetup &setup);
@@ -192,12 +143,6 @@ public:
JFJochBrokerHttp& FrontendDirectory(const std::string &directory);
~JFJochBrokerHttp() override = default;
private:
void config_file_writer_get(Pistache::Http::ResponseWriter &response) override;
void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings,
Pistache::Http::ResponseWriter &response) override;
};

View File

@@ -1,236 +1,394 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include "JFJochBrokerParser.h"
#include "../common/NetworkAddressConvert.h"
#include "../image_pusher/ZMQStream2Pusher.h"
#include "../image_pusher/CBORFilePusher.h"
#include "../image_pusher/HDF5FilePusher.h"
#include "OpenAPIConvert.h"
#include "Detector_type.h"
#include "../image_pusher/NonePusher.h"
DetectorGeometryModular ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j) {
auto s = j.getStandardGeometry();
return DetectorGeometryModular(s.getNmodules(), s.getModulesInRow(), s.getGapX(), s.getGapY(), false);
inline bool CHECK_ARRAY(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_array())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be array");
return true;
} else
return false;
}
DetectorModuleGeometry::Direction Convert(const org::openapitools::server::model::Detector_module_direction& d) {
switch (d.getValue()) {
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::XP:
return DetectorModuleGeometry::Direction::Xpos;
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::XN:
return DetectorModuleGeometry::Direction::Xneg;
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::YP:
return DetectorModuleGeometry::Direction::Ypos;
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::YN:
return DetectorModuleGeometry::Direction::Yneg;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid detector direction");
}
inline bool CHECK_OBJECT(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_object())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be object");
return true;
} else
return false;
}
DetectorType Convert(const org::openapitools::server::model::Detector_type &d) {
switch (d.getValue()) {
case org::openapitools::server::model::Detector_type::eDetector_type::EIGER:
return DetectorType::EIGER;
case org::openapitools::server::model::Detector_type::eDetector_type::JUNGFRAU:
return DetectorType::JUNGFRAU;
case org::openapitools::server::model::Detector_type::eDetector_type::DECTRIS:
return DetectorType::DECTRIS;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid detector type");
}
inline int64_t GET_I64(const nlohmann::json &j, const std::string& tag, int64_t def) {
if (j.contains(tag)) {
if (!j[tag].is_number_integer())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
try {
return j[tag].get<int64_t>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
return def;
}
DetectorGeometryModular ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j) {
std::vector<DetectorModuleGeometry> modules;
for (const auto &iter: j.getCustomGeometry()) {
auto fast = Convert(iter.getFastAxis());
auto slow = Convert(iter.getSlowAxis());
modules.emplace_back(iter.getX0(), iter.getY0(), fast, slow);
}
return DetectorGeometryModular(modules, false);
inline int32_t GET_I32(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_number_integer())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
try {
return j[tag].get<int32_t>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
}
DetectorGeometryModular ParseDetectorGeometry(const org::openapitools::server::model::Detector &d) {
if (d.standardGeometryIsSet() && d.customGeometryIsSet())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Need to set EITHER standard or custom geometry");
if (d.standardGeometryIsSet())
return ParseStandardDetectorGeometry(d);
else if (d.customGeometryIsSet())
return ParseCustomDetectorGeometry(d);
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Need to set EITHER standard or custom geometry");
inline int32_t GET_I32(const nlohmann::json &j, const std::string& tag, int32_t def) {
if (j.contains(tag)) {
if (!j[tag].is_number_integer())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
try {
return j[tag].get<int32_t>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
return def;
}
DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detector &d) {
DetectorType detector_type = Convert(d.getType());
inline float GET_FLOAT(const nlohmann::json &j, const std::string& tag, float def) {
if (j.contains(tag)) {
if (!j[tag].is_number())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be float");
try {
return j[tag].get<float>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
return def;
}
if (detector_type == DetectorType::DECTRIS) {
std::string hostname;
if (d.getHostname().size() > 1)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"DECTRIS detector requires single hostname (or none)");
else if (d.getHostname().size() == 1)
hostname = d.getHostname()[0];
inline bool GET_BOOL(const nlohmann::json &j, const std::string& tag, bool def) {
if (j.contains(tag)) {
if (!j[tag].is_boolean())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
try {
return j[tag].get<bool>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
return def;
}
DetectorSetup setup = DetDECTRIS(1,1, d.getDescription(), hostname);
inline std::string GET_STR(const nlohmann::json &j, const std::string& tag, const std::string& def) {
if (j.contains(tag)) {
if (!j[tag].is_string())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be string");
try {
return j[tag].get<std::string>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
return def;
}
if (d.roiModeIsSet())
setup.DECTRISROI(d.getRoiMode());
inline std::string GET_STR(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_string())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be string");
try {
return j[tag].get<std::string>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
}
return setup;
}
inline int64_t GET_I64(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_number_integer())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
try {
return j[tag].get<int64_t>();
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
}
DetectorGeometryModular geom = ParseDetectorGeometry(d);
if (d.isMirrorY())
geom.VerticalFlip();
inline std::vector<std::string> GET_STR_ARR(const nlohmann::json &j, const std::string& tag) {
std::vector<std::string> ret;
DetectorSetup setup(geom, detector_type, d.getDescription(), d.getHostname());
auto calib = d.getCalibrationFile();
if (!calib.empty()) {
switch (detector_type) {
case DetectorType::EIGER:
setup.SetTrimFiles(calib);
break;
case DetectorType::JUNGFRAU:
setup.LoadGain(calib);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Detector type not supported");
if (CHECK_ARRAY(j, tag)) {
try {
for (const auto &iter: j[tag])
ret.push_back(iter.get<std::string>());
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
}
return ret;
}
switch (detector_type) {
case DetectorType::EIGER:
case DetectorType::JUNGFRAU:
setup.PixelSize_um(75.0f);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Detector type not supported");
inline std::vector<std::int64_t> GET_I64_ARR(const nlohmann::json &j, const std::string& tag) {
std::vector<std::int64_t> ret;
if (CHECK_ARRAY(j, tag)) {
try {
for (const auto &iter: j[tag])
ret.push_back(iter.get<int64_t>());
} catch (std::exception &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
}
}
if (d.highVoltageVIsSet())
setup.HighVoltage(d.getHighVoltageV());
return ret;
}
setup.UDPInterfaceCount(d.getUdpInterfaceCount())
.SensorThickness_um(d.getSensorThicknessUm())
// .PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
.SensorMaterial(d.getSensorMaterial())
.SerialNumber(d.getSerialNumber())
.ModuleSync(d.isModuleSync());
DetectorModuleGeometry::Direction GET_DIRECTION(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (!j[tag].is_string())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be string");
if (j[tag] == "Xp")
return DetectorModuleGeometry::Direction::Xpos;
if (j[tag] == "Xn")
return DetectorModuleGeometry::Direction::Xneg;
if (j[tag] == "Yp")
return DetectorModuleGeometry::Direction::Ypos;
if (j[tag] == "Yn")
return DetectorModuleGeometry::Direction::Yneg;
else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Allowed values for direction: Xp, Xn, Yp, Yn");
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
}
if (d.readoutTimeUsIsSet())
setup.ReadOutTime(std::chrono::microseconds(d.getReadoutTimeUs()));
inline int64_t TimeToUs(const std::string &unit) {
if ((unit == "us") || unit.empty()) return 1L;
else if (unit == "ms") return 1000L;
else if ((unit == "s") || (unit == "sec")) return 1000*1000L;
else
throw JFJochException(JFJochExceptionCategory::WrongUnit,
"Only us, ms and s (or sec) are viable units for time");
}
if (d.baseDataIpv4AddressIsSet())
setup.BaseIPv4Addr(d.getBaseDataIpv4Address());
if (d.txDelayIsSet())
setup.TxDelay(d.getTxDelay());
inline std::chrono::microseconds GET_TIME(const nlohmann::json &j, const std::string& tag) {
if (j.contains(tag)) {
if (j[tag].is_number())
return std::chrono::microseconds (std::lround(j[tag].get<double>() * 1000.0 * 1000.0));
else if (j[tag].is_string()) {
std::string::size_type pos;
auto text = j[tag].get<std::string>();
if (d.minimumCountTimeUsIsSet())
setup.MinCountTime(std::chrono::microseconds(d.getMinimumCountTimeUs()));
// Check if floating point
pos = text.find_first_of('.');
if (pos != std::string::npos)
throw JFJochException(JFJochExceptionCategory::WrongNumber,
"Time must be provided as <integer> {s|ms|us|Hz} - no floating point allowed");
if (d.minimumFrameTimeUsIsSet())
setup.MinFrameTime(std::chrono::microseconds(d.getMinimumFrameTimeUs()));
// Convert integer part
int64_t val = std::stol(text, &pos);
if (pos == 0)
throw JFJochException(JFJochExceptionCategory::WrongNumber,
"Time must be provided as <integer> {s|ms|us|Hz}");
if (d.defaultSettingsIsSet())
setup.DefaultSettings(Convert(d.getDefaultSettings()));
pos = text.find_first_not_of(' ', pos);
if (pos != std::string::npos) {
if (text.substr(pos) == "Hz")
val = 1000*1000L / val;
else
val *= TimeToUs(text.substr(pos));
}
return std::chrono::microseconds(val);
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be number in seconds or string with time units s|ms|us");
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
}
if (d.tempThresoldDegCIsSet())
setup.TempThreshold_degC(d.getTempThresoldDegC());
DetectorGeometry ParseStandardDetectorGeometry(const nlohmann::json &j) {
int32_t nmodules = GET_I64(j, "nmodules");
int32_t gap_x = GET_I64(j, "gap_x", 8);
int32_t gap_y = GET_I64(j, "gap_y", 36);
int32_t h_stacking = GET_I64(j, "horizontal_stacking", 2);
bool mirror_y = GET_BOOL(j, "mirror_y", true);
return {nmodules, h_stacking, gap_x, gap_y, mirror_y};
}
DetectorGeometry ParseCustomDetectorGeometry(const nlohmann::json &j, bool mirror_y) {
std::vector<DetectorModuleGeometry> modules;
for (const auto &iter: j) {
if (!iter.is_object())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"custom_geometry element must be JSON object");
int64_t x0 = GET_I64(iter, "x0");
int64_t y0 = GET_I64(iter, "y0");
auto fast = GET_DIRECTION(iter, "fast_axis");
auto slow = GET_DIRECTION(iter, "slow_axis");
modules.emplace_back(x0, y0, fast, slow);
}
return {modules, mirror_y};
}
DetectorGeometry ParseDetectorGeometry(const nlohmann::json &j) {
if (CHECK_OBJECT(j, "standard_geometry"))
return ParseStandardDetectorGeometry(j["standard_geometry"]);
else if (CHECK_ARRAY(j, "custom_geometry")) {
return ParseCustomDetectorGeometry(j["custom_geometry"], GET_BOOL(j, "custom_geometry_mirror_y", false));
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"It is compulsory to have either standard_detector or custom_detector declared.");
}
DetectorSetup ParseDetectorSetup(const nlohmann::json &j) {
if (!j.is_object())
throw JFJochException(JFJochExceptionCategory::JSON, "Expecting JSON object for detector setup");
DetectorGeometry geom = ParseDetectorGeometry(j);
std::string description = GET_STR(j, "description");
auto module_hostname = GET_STR_ARR(j, "module_hostname");
DetectorType detector_type;
const std::string detector_type_str = GET_STR(j, "type", "jungfrau");
if (detector_type_str == "jungfrau")
detector_type = DetectorType::JUNGFRAU;
else if (detector_type_str == "eiger")
detector_type = DetectorType::EIGER;
else
throw JFJochException(JFJochExceptionCategory::JSON, "type must be \"jungfrau\" or \"eiger\" ");
DetectorSetup setup(geom, detector_type, description, module_hostname);
if (detector_type == DetectorType::JUNGFRAU) {
auto gain_files = GET_STR_ARR(j, "gain_files");
if (!gain_files.empty())
setup.LoadGain(gain_files);
} else if (detector_type == DetectorType::EIGER) {
auto trim_files = GET_STR_ARR(j, "trim_files");
if (!trim_files.empty())
setup.SetTrimFiles(trim_files);
}
if (j.contains("high_voltage"))
setup.HighVoltage(GET_I32(j,"high_voltage"));
setup.UDPInterfaceCount(GET_I64(j, "udp_interface_count", 2))
.SensorThickness_um(GET_FLOAT(j, "sensor_thickness_um", 320.0f))
.PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
.SensorMaterial(GET_STR(j, "sensor_material", "Si"));
if (j.contains("tx_delay"))
setup.TxDelay(GET_I64_ARR(j, "tx_delay"));
return setup;
}
void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_settings &j, DiffractionExperiment &experiment) {
if (j.instrumentIsSet())
experiment.ImportInstrumentMetadata(Convert(j.getInstrument()));
if (j.fileWriterIsSet())
experiment.ImportFileWriterSettings(Convert(j.getFileWriter()));
if (j.detectorSettingsIsSet())
experiment.ImportDetectorSettings(Convert(j.getDetectorSettings()));
if (j.azimIntIsSet())
experiment.ImportAzimuthalIntegrationSettings(Convert(j.getAzimInt()));
if (j.imageFormatIsSet())
experiment.ImportImageFormatSettings(Convert(j.getImageFormat()));
if (j.indexingIsSet())
experiment.ImportIndexingSettings(Convert(j.getIndexing()));
void ParseDetectorSetup(const nlohmann::json &j, const std::string& tag, JFJochBrokerHttp& broker) {
if (CHECK_ARRAY(j, tag)) {
for (const auto &iter : j[tag])
broker.AddDetectorSetup(ParseDetectorSetup(iter));
} else
throw JFJochException(JFJochExceptionCategory::JSON, "Detector setup not found");
}
std::unique_ptr<ImagePusher> ParseZMQImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
if (!j.zeromqIsSet())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "ZeroMQ settings must be provided");
void ParseFacilityConfiguration(const nlohmann::json &input, const std::string& tag, DiffractionExperiment &experiment) {
if (CHECK_OBJECT(input, tag)) {
auto j = input[tag];
experiment.SourceName(GET_STR(j, "source_name"));
experiment.SourceNameShort(GET_STR(j, "source_name_short"));
experiment.InstrumentName(GET_STR(j, "instrument_name"));
experiment.InstrumentNameShort(GET_STR(j, "instrument_name_short"));
std::optional<int32_t> send_buffer_size;
if (j.getZeromq().sendBufferSizeIsSet())
send_buffer_size = j.getZeromq().getSendBufferSize();
experiment.PulsedSource(GET_BOOL(j, "pulsed_source", false));
std::optional<int32_t> send_watermark;
if (j.getZeromq().sendWatermarkIsSet())
send_watermark = j.getZeromq().getSendWatermark();
auto tmp = std::make_unique<ZMQStream2Pusher>(j.getZeromq().getImageSocket(),
send_watermark,
send_buffer_size);
if (j.getZeromq().writerNotificationSocketIsSet())
tmp->WriterNotificationSocket(j.getZeromq().getWriterNotificationSocket());
return std::move(tmp);
}
std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
switch (j.getImagePusher().getValue()) {
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::ZEROMQ:
return ParseZMQImagePusher(j);
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::HDF5:
return std::make_unique<HDF5FilePusher>();
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::NONE:
return std::make_unique<NonePusher>();
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::CBOR:
return std::make_unique<CBORFilePusher>();
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Invalid value");
}
}
void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_settings &input,
AcquisitionDeviceGroup &aq_devices) {
if (!input.pcieIsSet())
aq_devices.AddHLSDevice(256);
else for (auto &p: input.getPcie()) {
std::optional<uint32_t> ipv4_addr = {};
if (p.ipv4IsSet())
ipv4_addr = IPv4AddressFromStr(p.getIpv4());
aq_devices.AddPCIeDevice(p.getBlk(), ipv4_addr);
if (j.contains("omega_axis")) {
if (j["omega_axis"].is_array() && (j["omega_axis"].size() == 3))
experiment.DefaultOmegaAxis(Coord(j["omega_axis"][0].get<float>(),
j["omega_axis"][1].get<float>(),
j["omega_axis"][2].get<float>()));
else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"omega_axis must be float array of 3");
}
experiment.NeuralNetModelPath(GET_STR(j, "neural_net_model", ""));
if (j.contains("pedestal_g0_frames"))
experiment.PedestalG0Frames(GET_I64(j, "pedestal_g0_frames"));
if (j.contains("pedestal_g1_frames"))
experiment.PedestalG1Frames(GET_I64(j, "pedestal_g1_frames"));
if (j.contains("pedestal_g2_frames"))
experiment.PedestalG2Frames(GET_I64(j, "pedestal_g2_frames"));
if (j.contains("detector_trigger_delay_us"))
experiment.DetectorDelay(GET_TIME(j, "detector_trigger_delay_us"));
experiment.FrameTime(GET_TIME(j, "frame_time_us"), GET_TIME(j, "count_time_us"));
if (j.contains("preview_period_us"))
experiment.PreviewPeriod(GET_TIME(j, "preview_period_us"));
experiment.UseInternalPacketGenerator(GET_BOOL(j, "internal_frame_generator", false));
if (experiment.IsUsingInternalPacketGen())
experiment.ConversionOnFPGA(false);
experiment.IPv4BaseAddr(GET_STR(j, "detector_ipv4"));
} else
throw JFJochException(JFJochExceptionCategory::JSON, "Default configuration not found");
}
void ParseReceiverSettings(const org::openapitools::server::model::Jfjoch_settings &input, JFJochReceiverService &service) {
std::string numa_policy = input.getNumaPolicy();
if (!numa_policy.empty())
service.NUMAPolicy(numa_policy);
void ParseAcquisitionDeviceGroup(const nlohmann::json &input, const std::string& tag,
AcquisitionDeviceGroup &aq_devices) {
if (CHECK_OBJECT(input, tag)) {
const auto &j = input[tag];
// Using default in case
service.NumThreads(input.getReceiverThreads());
std::string dev_type = GET_STR(j, "type");
if (input.zeromqPreviewIsSet()) {
service.PreviewSocket(input.getZeromqPreview().getSocketAddress());
service.PreviewSocketSettings(Convert(input.getZeromqPreview()));
}
if (dev_type == "pcie") {
std::vector<std::string> devices = GET_STR_ARR(j, "devices");
if (devices.empty())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"At least one PCIe device must be provided");
for (auto &d: devices)
aq_devices.AddPCIeDevice(d);
} else if (dev_type == "hls") {
int64_t buffer_size = GET_I64(j, "buffer_size", 1024);
if ((buffer_size < 16) || (buffer_size > 65536))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Buffer size must be in range 16-65536");
aq_devices.AddHLSDevice(buffer_size);
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Device type unknown");
aq_devices.SetDefaultDataSource(AcquisitionDeviceSource::NETWORK);
std::vector<std::string> ipv4_addr = GET_STR_ARR(j, "ipv4_addr");
if (ipv4_addr.size() != aq_devices.size())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch between number of devices and number of IPv4 addresses");
for (int i = 0; i < ipv4_addr.size(); i++)
aq_devices[i].SetIPv4Address(IPv4AddressFromStr(ipv4_addr[i]));
if (input.zeromqMetadataIsSet()) {
service.MetadataSocket(input.getZeromqMetadata().getSocketAddress());
service.MetadataSocketSettings(Convert(input.getZeromqMetadata()));
}
}
std::vector<std::string> ParseStringArray(const nlohmann::json &input, const std::string& tag) {
return GET_STR_ARR(input, tag);
}
std::string ParseString(const nlohmann::json &input, const std::string& tag, const std::string &def) {
return GET_STR(input, tag, def);
}
int64_t ParseInt64(const nlohmann::json &input, const std::string& tag, int64_t def) {
return GET_I64(input, tag, def);
}
int32_t ParseInt32(const nlohmann::json &input, const std::string& tag, int32_t def) {
return GET_I32(input, tag, def);
}

View File

@@ -1,25 +1,24 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
#define JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
#include <nlohmann/json.hpp>
#include "../common/DiffractionExperiment.h"
#include "JFJochBrokerHttp.h"
#include "../acquisition_device/AcquisitionDeviceGroup.h"
#include "../image_pusher/ImagePusher.h"
#include "../receiver/JFJochReceiverService.h"
#include "gen/model/Jfjoch_settings.h"
DetectorGeometryModular ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j);
DetectorGeometryModular ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j);
DetectorGeometryModular ParseDetectorGeometry(const org::openapitools::server::model::Detector &j);
DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detector &j);
DetectorGeometry ParseStandardDetectorGeometry(const nlohmann::json &j);
DetectorGeometry ParseCustomDetectorGeometry(const nlohmann::json &j);
DetectorGeometry ParseDetectorGeometry(const nlohmann::json &j);
DetectorSetup ParseDetectorSetup(const nlohmann::json &j);
void ParseDetectorSetup(const nlohmann::json &j, const std::string& tag, JFJochBrokerHttp& broker);
void ParseFacilityConfiguration(const nlohmann::json &j, const std::string& tag, DiffractionExperiment &experiment);
void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_settings &j, DiffractionExperiment &experiment);
std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::model::Jfjoch_settings &j);
void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_settings &input, AcquisitionDeviceGroup &aq_devices);
void ParseReceiverSettings(const org::openapitools::server::model::Jfjoch_settings &input, JFJochReceiverService &service);
void ParseAcquisitionDeviceGroup(const nlohmann::json &input, const std::string& tag, AcquisitionDeviceGroup &aq_devices);
std::vector<std::string> ParseStringArray(const nlohmann::json &input, const std::string& tag);
std::string ParseString(const nlohmann::json &input, const std::string& tag, const std::string& def);
int64_t ParseInt64(const nlohmann::json &input, const std::string& tag, int64_t def);
int32_t ParseInt32(const nlohmann::json &input, const std::string& tag, int32_t def);
#endif //JUNGFRAUJOCH_JFJOCHBROKERPARSER_H

View File

@@ -1,26 +1,19 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#include "JFJochServices.h"
#include "../common/JFJochException.h"
#include "../detector_control/SLSDetectorWrapper.h"
#include "../detector_control/DectrisDetectorWrapper.h"
JFJochServices::JFJochServices(Logger &in_logger) : logger(in_logger) {}
void JFJochServices::Start(const DiffractionExperiment& experiment,
const PixelMask &pixel_mask,
const JFCalibration &calibration) {
void JFJochServices::Start(const DiffractionExperiment& experiment, const JFCalibration &calibration) {
logger.Info("Measurement start for: {}", experiment.GetFilePrefix());
cannot_stop_detector = false;
if (receiver != nullptr) {
logger.Info(" ... receiver start");
if (experiment.IsJungfrauConvPhotonCnt())
receiver->Start(experiment, pixel_mask, &calibration);
if (experiment.GetDetectorMode() == DetectorMode::Conversion)
receiver->Start(experiment, &calibration);
else
receiver->Start(experiment, pixel_mask, nullptr);
receiver->Start(experiment, nullptr);
if (detector && !experiment.IsUsingInternalPacketGen()) {
logger.Info(" ... detector start");
@@ -36,21 +29,16 @@ void JFJochServices::Off() {
detector->Deactivate();
}
void JFJochServices::On(DiffractionExperiment &x) {
void JFJochServices::On(const DiffractionExperiment &x) {
if (x.IsUsingInternalPacketGen() || (receiver == nullptr)) {
detector.reset();
} else {
logger.Info("Detector on");
switch (x.GetDetectorType()) {
case DetectorType::EIGER:
case DetectorType::JUNGFRAU:
detector = std::make_unique<SLSDetectorWrapper>();
break;
case DetectorType::DECTRIS:
detector = std::make_unique<DectrisDetectorWrapper>();
break;
}
if (!detector)
detector = std::make_unique<DetectorWrapper>();
detector->Initialize(x, receiver->GetNetworkConfig());
logger.Info(" ... done");
}
}
@@ -60,35 +48,35 @@ JFJochServicesOutput JFJochServices::Stop() {
std::unique_ptr<JFJochException> exception;
bool detector_error = false;
if (receiver != nullptr) {
try {
if (detector) {
logger.Info("Wait for detector idle");
logger.Info("Wait for detector done");
DetectorState state = detector->GetState();
while ((!cannot_stop_detector)
&& ((state == DetectorState::WAITING) || (state == DetectorState::BUSY))) {
while ((state == DetectorState::WAITING) || (state == DetectorState::BUSY)) {
// check detector state every 5 ms
std::this_thread::sleep_for(std::chrono::milliseconds(5));
state = detector->GetState();
}
if (state == DetectorState::IDLE) {
logger.Info(" ... detector idle");
receiver->Cancel(true); // cancel silently
} else {
if (state == DetectorState::ERROR) {
logger.Error(" ... detector in error state");
receiver->Cancel(false);
detector_error = true;
} else if (state == DetectorState::IDLE) {
receiver->Cancel(true); // cancel silently
}
}
logger.Info("Wait for receiver done");
ret.receiver_output = receiver->Stop();
if (ret.receiver_output.status.compressed_ratio)
logger.Info(" ... Receiver efficiency: {} % Max delay: {} Compression ratio {}x",
static_cast<int>(ret.receiver_output.efficiency * 100.0),
ret.receiver_output.status.max_receive_delay.value_or(0),
static_cast<int>(std::round(ret.receiver_output.status.compressed_ratio.value_or(1))));
static_cast<int>(ret.receiver_output.efficiency * 100.0),
ret.receiver_output.status.max_receive_delay,
static_cast<int>(std::round(ret.receiver_output.status.compressed_ratio.value())));
else
logger.Info(" ... Receiver efficiency: {} % Max delay: {}",
static_cast<int>(ret.receiver_output.efficiency * 100.0),
ret.receiver_output.status.max_receive_delay);
if (ret.receiver_output.efficiency < 1.0) {
for (int i = 0; i < ret.receiver_output.received_packets.size(); i++) {
@@ -112,23 +100,15 @@ JFJochServicesOutput JFJochServices::Stop() {
if (exception)
throw JFJochException(*exception);
if (detector_error)
throw JFJochException(JFJochExceptionCategory::Detector, "Error in detector operation");
return ret;
}
void JFJochServices::Cancel() {
if (detector) {
// Best effort - if detector cannot be stopped, this is OK, important to still stop receiver
try {
if (receiver != nullptr) {
if (detector)
detector->Stop();
} catch (...) {
cannot_stop_detector = true;
}
}
if (receiver != nullptr)
receiver->Cancel(false);
}
}
JFJochServices &JFJochServices::Receiver(JFJochReceiverService *input) {
@@ -136,22 +116,21 @@ JFJochServices &JFJochServices::Receiver(JFJochReceiverService *input) {
return *this;
}
std::optional<JFJochReceiverStatus> JFJochServices::GetReceiverStatus() const {
std::optional<JFJochReceiverStatus> JFJochServices::GetReceiverStatus() {
if (receiver == nullptr)
return {};
return receiver->GetStatus();
}
std::optional<float> JFJochServices::GetReceiverProgress() const {
if (receiver == nullptr)
return {};
return receiver->GetProgress();
}
MultiLinePlot JFJochServices::GetPlots(const PlotRequest &request) {
if (receiver == nullptr)
return {};
return receiver->GetDataProcessingPlot(request);
try {
return receiver->GetDataProcessingPlot(request);
} catch (...) {
return {};
}
}
void JFJochServices::SetSpotFindingSettings(const SpotFindingSettings &settings) {
@@ -171,16 +150,16 @@ std::optional<DetectorStatus> JFJochServices::GetDetectorStatus() const {
return {};
}
std::string JFJochServices::GetPreviewJPEG(const PreviewImageSettings &settings, int64_t image_number) const {
std::string JFJochServices::GetPreviewJPEG(const PreviewJPEGSettings &settings) const {
if (receiver != nullptr)
return receiver->GetJPEGFromBuffer(settings, image_number);
return receiver->GetJPEG(settings);
else
return {};
}
std::string JFJochServices::GetPreviewTIFF(int64_t image_number) const {
std::string JFJochServices::GetPreviewTIFF(bool calibration) const {
if (receiver != nullptr)
return receiver->GetTIFFFromBuffer(image_number);
return receiver->GetTIFF(calibration);
else
return "";
}
@@ -206,64 +185,3 @@ void JFJochServices::GetXFELEventCode(std::vector<uint64_t> &v) const {
if (receiver)
receiver->GetXFELPulseID(v);
}
std::vector<DeviceStatus> JFJochServices::GetDeviceStatus() const {
std::vector<DeviceStatus> ret;
if (receiver)
ret = receiver->GetDeviceStatus();
return ret;
}
ZMQPreviewSettings JFJochServices::GetPreviewSocketSettings() {
if (receiver)
return receiver->GetPreviewSocketSettings();
return {};
}
ZMQMetadataSettings JFJochServices::GetMetadataSocketSettings() {
if (receiver)
return receiver->GetMetadataSocketSettings();
return {};
}
void JFJochServices::SetPreviewSocketSettings(const ZMQPreviewSettings &input) {
if (receiver)
receiver->PreviewSocketSettings(input);
}
void JFJochServices::SetMetadataSocketSettings(const ZMQMetadataSettings &input) {
if (receiver)
receiver->MetadataSocketSettings(input);
}
void JFJochServices::GetStartMessageFromBuffer(std::vector<uint8_t> &v) {
if (receiver)
return receiver->GetStartMessageFromBuffer(v);
}
bool JFJochServices::GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number) {
if (receiver)
return receiver->GetImageFromBuffer(v, image_number);
return false;
}
ImageBufferStatus JFJochServices::GetImageBufferStatus() const {
if (receiver)
return receiver->GetImageBufferStatus();
else return ImageBufferStatus{.total_slots = 0, .available_slots = 0};
}
void JFJochServices::ClearImageBuffer() const {
if (receiver)
receiver->ClearImageBuffer();
}
void JFJochServices::LoadDetectorPixelMask(PixelMask &mask) {
if (detector)
detector->LoadPixelMask(mask);
}
void JFJochServices::SetupIndexing(const IndexingSettings &input) {
if (receiver)
receiver->Indexing(input);
}

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_JFJOCHSERVICES_H
#define JUNGFRAUJOCH_JFJOCHSERVICES_H
@@ -18,16 +17,13 @@ class JFJochServices {
JFJochReceiverService *receiver = nullptr;
std::unique_ptr<DetectorWrapper> detector;
volatile bool cannot_stop_detector = false;
Logger &logger;
public:
explicit JFJochServices(Logger &in_logger);
void On(DiffractionExperiment& experiment);
void On(const DiffractionExperiment& experiment);
void Off();
void ConfigureDetector(const DiffractionExperiment& experiment);
void Start(const DiffractionExperiment& experiment,
const PixelMask &pixel_mask,
const JFCalibration &calibration);
void Start(const DiffractionExperiment& experiment, const JFCalibration &calibration);
JFJochServicesOutput Stop();
void Cancel();
void Trigger();
@@ -35,8 +31,7 @@ public:
void LoadInternalGeneratorImage(const DiffractionExperiment &experiment,
const std::vector<uint16_t> &image,
uint64_t image_number);
std::optional<JFJochReceiverStatus> GetReceiverStatus() const;
std::optional<float> GetReceiverProgress() const;
std::optional<JFJochReceiverStatus> GetReceiverStatus();
MultiLinePlot GetPlots(const PlotRequest &request);
void SetSpotFindingSettings(const SpotFindingSettings &settings);
@@ -44,28 +39,11 @@ public:
std::optional<DetectorStatus> GetDetectorStatus() const;
std::string GetPreviewJPEG(const PreviewImageSettings &settings, int64_t image_number) const;
std::string GetPreviewTIFF(int64_t image_number) const;
std::string GetPreviewJPEG(const PreviewJPEGSettings &settings) const;
std::string GetPreviewTIFF(bool calibration) const;
void GetXFELPulseID(std::vector<uint64_t> &v) const;
void GetXFELEventCode(std::vector<uint64_t> &v) const;
std::vector<DeviceStatus> GetDeviceStatus() const;
void SetPreviewSocketSettings(const ZMQPreviewSettings &input);
ZMQPreviewSettings GetPreviewSocketSettings();
void SetMetadataSocketSettings(const ZMQMetadataSettings &input);
ZMQMetadataSettings GetMetadataSocketSettings();
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
bool GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number = -1);
ImageBufferStatus GetImageBufferStatus() const;
void ClearImageBuffer() const;
void LoadDetectorPixelMask(PixelMask &mask);
void SetupIndexing(const IndexingSettings& input);
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,4 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (2019-2023) Paul Scherrer Institute
#ifndef JUNGFRAUJOCH_JFJOCHSTATEMACHINE_H
#define JUNGFRAUJOCH_JFJOCHSTATEMACHINE_H
@@ -19,26 +18,16 @@
enum class JFJochState {Inactive, Idle, Measuring, Error, Busy, Pedestal};
struct BrokerStatus {
JFJochState state = JFJochState::Inactive;
JFJochState broker_state;
std::optional<float> progress;
std::optional<std::string> message;
enum class MessageSeverity {Error, Info, Warning, Success} message_severity = MessageSeverity::Error;
int64_t gpu_count;
std::optional<float> indexing_rate;
};
struct DetectorListElement {
std::string description;
std::string serial_number;
std::string base_ipv4_addr;
int64_t udp_interface_count;
int64_t nmodules;
int64_t width;
int64_t height;
std::chrono::microseconds readout_time;
std::chrono::microseconds min_frame_time;
std::chrono::microseconds min_count_time;
DetectorType detector_type;
float pixel_size_mm;
};
struct DetectorList {
@@ -48,9 +37,6 @@ struct DetectorList {
struct MeasurementStatistics {
std::string file_prefix;
std::string experiment_group;
int64_t run_number;
int64_t images_expected;
int64_t images_collected;
int64_t images_sent;
@@ -60,7 +46,7 @@ struct MeasurementStatistics {
std::optional<float> compression_ratio;
bool cancelled;
std::optional<int64_t> max_receive_delay;
int64_t max_receive_delay;
std::optional<float> indexing_rate;
@@ -70,94 +56,86 @@ struct MeasurementStatistics {
std::optional<float> bkg_estimate;
std::optional<std::pair<float, float>> beam_center_drift_pxl;
};
std::string unit_cell;
struct DetectorSettings {
int64_t frame_time_us;
std::optional<int64_t> count_time_us;
std::optional<float> error_pixels;
std::optional<float> saturated_pixels;
std::optional<float> roi_beam_npixel;
std::optional<float> roi_beam_sum;
int64_t storage_cell_count;
bool use_internal_packet_generator;
bool collect_raw_data;
bool use_gain_hg0;
bool fixed_gain_g1;
std::optional<int64_t> pedestal_g0_frames;
std::optional<int64_t> pedestal_g1_frames;
std::optional<int64_t> pedestal_g2_frames;
std::optional<int64_t> storage_cell_delay_ns;
std::optional<int64_t> detector_delay_ns;
std::optional<int64_t> internal_packet_generator_images;
};
struct RadialIntegrationSettings {
bool solid_angle_correction;
std::optional<float> polarization_factor;
float high_q_recipA;
float low_q_recipA;
float q_spacing;
};
class JFJochStateMachine {
Logger &logger;
JFJochServices &services;
std::future<void> measurement;
// assuming immutable during normal operation
std::vector<DetectorSetup> detector_setup;
std::vector<JFModuleGainCalibration> gain_calibration;
mutable std::mutex experiment_detector_settings_mutex;
mutable std::mutex experiment_azimuthal_integration_settings_mutex;
mutable std::mutex experiment_instrument_metadata_mutex;
mutable std::mutex experiment_image_format_settings_mutex;
mutable std::mutex experiment_file_writer_settings_mutex;
mutable std::mutex experiment_indexing_settings_mutex;
DiffractionExperiment experiment;
// mutex m is protecting:
mutable std::mutex m;
std::condition_variable c;
volatile JFJochState state = JFJochState::Inactive; // state should not be set directly, but through SetState function
// mutex m is protecting:
DiffractionExperiment experiment;
volatile JFJochState state = JFJochState::Inactive;
volatile bool cancel_sequence = false;
std::unique_ptr<JFCalibration> calibration;
PixelMask pixel_mask;
int64_t current_detector_setup; // Lock only on change
std::optional<ScanResult> scan_result;
std::vector<JFModuleGainCalibration> gain_calibration;
std::vector<DetectorSetup> detector_setup;
int64_t current_detector_setup;
std::future<void> measurement;
mutable std::mutex calibration_statistics_mutex;
std::vector<JFCalibrationModuleStatistics> calibration_statistics;
mutable std::mutex last_receiver_output_mutex;
std::optional<MeasurementStatistics> measurement_statistics;
void SetFullMeasurementOutput(const JFJochServicesOutput &output);
void ClearMeasurementStatistics();
void ClearAndSetMeasurementStatistics();
mutable std::mutex data_processing_settings_mutex;
SpotFindingSettings data_processing_settings;
mutable std::mutex pixel_mask_statistics_mutex;
PixelMaskStatistics pixel_mask_statistics;
mutable std::mutex broker_status_mutex;
BrokerStatus broker_status;
mutable std::mutex roi_mutex;
ROIDefinition roi;
bool indexing_possible;
bool resolution_estimate_possible;
const int32_t gpu_count;
void UpdatePixelMaskStatistics(const PixelMaskStatistics &input);
// Private functions assume that lock m is acquired
void SetState(JFJochState curr_state,
const std::optional<std::string> &message = {},
BrokerStatus::MessageSeverity message_severity = BrokerStatus::MessageSeverity::Info);
void MeasurementThread();
void PedestalThread(std::unique_lock<std::mutex> ul);
void InitializeThread(std::unique_lock<std::mutex> ul);
bool ImportPedestalG1G2(const JFJochReceiverOutput &receiver_output, size_t gain_level, size_t storage_cell = 0);
bool ImportPedestalG0(const JFJochReceiverOutput &receiver_output);
bool IsRunning() const; // Is state Busy/Pedestal/Measure
void ResetError() noexcept;
std::optional<std::string> CheckError();
void TakePedestalInternalAll(std::unique_lock<std::mutex> &ul);
void TakePedestalInternalG0(std::unique_lock<std::mutex> &ul);
void TakePedestalInternalG1(std::unique_lock<std::mutex> &ul, int32_t storage_cell = 0);
void TakePedestalInternalG2(std::unique_lock<std::mutex> &ul, int32_t storage_cell = 0);
bool ImportDetectorSettings(const DetectorSettings& input);
void UpdateROIDefinition();
public:
JFJochStateMachine(const DiffractionExperiment& experiment,
JFJochServices &in_services,
Logger &logger);
JFJochStateMachine(JFJochServices &in_services, Logger &logger);
~JFJochStateMachine();
void Initialize();
void Pedestal();
void Deactivate();
void Start(const DatasetSettings& settings);
BrokerStatus WaitTillMeasurementDone();
BrokerStatus WaitTillMeasurementDone(std::chrono::milliseconds timeout);
void WaitTillMeasurementDone();
JFJochState WaitTillMeasurementDone(std::chrono::milliseconds timeout);
void Trigger();
void Cancel();
@@ -167,17 +145,6 @@ public:
DetectorSettings GetDetectorSettings() const;
void LoadDetectorSettings(const DetectorSettings& settings);
InstrumentMetadata GetInstrumentMetadata() const;
void LoadInstrumentMetadata(const InstrumentMetadata& settings);
FileWriterSettings GetFileWriterSettings() const;
void LoadFileWriterSettings(const FileWriterSettings& settings);
ImageFormatSettings GetImageFormatSettings() const;
void LoadImageFormatSettings(const ImageFormatSettings& settings);
void RawImageFormatSettings();
void ConvImageFormatSettings();
// return by value to ensure thread safety
std::optional<MeasurementStatistics> GetMeasurementStatistics() const;
std::vector<JFCalibrationModuleStatistics> GetCalibrationStatistics() const;
@@ -188,60 +155,36 @@ public:
void SetSpotFindingSettings(const SpotFindingSettings& settings);
SpotFindingSettings GetSpotFindingSettings() const;
JFJochState GetState() const;
void AddDetectorSetup(const DetectorSetup& setup);
DetectorList GetDetectorsList() const;
void SelectDetector(int64_t id);
std::optional<DetectorStatus> GetDetectorStatus() const;
void SetRadialIntegrationSettings(const AzimuthalIntegrationSettings& settings);
AzimuthalIntegrationSettings GetRadialIntegrationSettings() const;
void SetRadialIntegrationSettings(const RadialIntegrationSettings& settings);
RadialIntegrationSettings GetRadialIntegrationSettings() const;
std::string GetPreviewJPEG(const PreviewImageSettings& settings, int64_t image_number) const;
std::string GetPreviewTIFF(int64_t image_number) const;
std::string GetPreviewJPEG(const PreviewJPEGSettings& settings) const;
std::string GetPreviewTIFF(bool calibration) const;
std::string GetPedestalTIFF(size_t gain_level, size_t sc) const;
void LoadInternalGeneratorImage(const void *data, size_t size, uint64_t image_number);
void LoadInternalGeneratorImageTIFF(const std::string &s, uint64_t image_number);
// Not thread safe - only for configuration in serial context
DiffractionExperiment Experiment();
DiffractionExperiment& NotThreadSafe_Experiment();
// Function for debug only - UNSAFE for real operation
void DebugOnly_SetState(JFJochState state,
const std::optional<std::string> &message = {},
BrokerStatus::MessageSeverity message_severity = BrokerStatus::MessageSeverity::Info);
void DebugOnly_SetState(JFJochState state);
void SetROIDefinition(const ROIDefinition& input);
ROIDefinition GetROIDefintion() const;
void SetBoxROI(const std::vector<ROIBox>& input);
void SetCircleROI(const std::vector<ROICircle>& input);
std::vector<ROIBox> GetBoxROI() const;
std::vector<ROICircle> GetCircleROI() const;
std::vector<uint64_t> GetXFELPulseID() const;
std::vector<uint64_t> GetXFELEventCode() const;
std::string GetFullPixelMaskTIFF() const;
std::string GetUserPixelMaskTIFF() const;
std::vector<uint32_t> GetFullPixelMask() const;
std::vector<uint32_t> GetUserPixelMask() const;
void SetUserPixelMask(const std::vector<uint32_t> &v);
std::vector<DeviceStatus> GetDeviceStatus() const;
void SetPreviewSocketSettings(const ZMQPreviewSettings &input);
ZMQPreviewSettings GetPreviewSocketSettings();
void SetMetadataSocketSettings(const ZMQMetadataSettings &input);
ZMQMetadataSettings GetMetadataSocketSettings();
void SetIndexingSettings(const IndexingSettings &input);
IndexingSettings GetIndexingSettings() const;
PixelMaskStatistics GetPixelMaskStatistics() const;
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
void GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number = -1);
ImageBufferStatus GetImageBufferStatus() const;
void ClearImageBuffer() const;
void AddDetectorSetup(const DetectorSetup& setup); // Not thread safe, only during setup
std::optional<ScanResult> GetScanResult() const;
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,91 +0,0 @@
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#ifndef JFJOCH_OPENAPICONVERT_H
#define JFJOCH_OPENAPICONVERT_H
#include "gen/model/Spot_finding_settings.h"
#include "gen/model/Measurement_statistics.h"
#include "gen/model/Detector_settings.h"
#include "gen/model/Broker_status.h"
#include "gen/model/Calibration_statistics_inner.h"
#include "gen/model/Instrument_metadata.h"
#include "gen/model/Detector_list.h"
#include "gen/model/Detector_status.h"
#include "gen/model/Plots.h"
#include "gen/model/Azim_int_settings.h"
#include "gen/model/Roi_definitions.h"
#include "gen/model/Image_format_settings.h"
#include "gen/model/Dataset_settings.h"
#include "gen/model/Fpga_status_inner.h"
#include "gen/model/Pixel_mask_statistics.h"
#include "gen/model/Zeromq_preview_settings.h"
#include "gen/model/Zeromq_metadata_settings.h"
#include "gen/model/File_writer_settings.h"
#include "gen/model/Image_buffer_status.h"
#include "gen/model/Rotation_axis.h"
#include "gen/model/Grid_scan.h"
#include "gen/model/Indexing_settings.h"
#include "gen/model/Scan_result.h"
#include "../common/JFJochMessages.h"
#include "../common/DatasetSettings.h"
#include "../common/ImageFormatSettings.h"
#include "../image_analysis/spot_finding/SpotFindingSettings.h"
#include "JFJochStateMachine.h"
#include "../common/DetectorSettings.h"
#include "../jungfrau/JFCalibration.h"
#include "../common/InstrumentMetadata.h"
#include "../common/ScanResult.h"
SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input);
org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input);
IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input);
org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input);
org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input);
DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input);
org::openapitools::server::model::Detector_settings Convert(const DetectorSettings &input);
org::openapitools::server::model::Broker_status Convert(const BrokerStatus& input);
org::openapitools::server::model::Calibration_statistics_inner Convert(const JFCalibrationModuleStatistics& input);
std::vector<org::openapitools::server::model::Calibration_statistics_inner> Convert(const std::vector<JFCalibrationModuleStatistics>& input);
org::openapitools::server::model::Instrument_metadata Convert(const InstrumentMetadata& input);
InstrumentMetadata Convert(const org::openapitools::server::model::Instrument_metadata &input);
org::openapitools::server::model::File_writer_settings Convert(const FileWriterSettings& input);
FileWriterSettings Convert(const org::openapitools::server::model::File_writer_settings &input);
org::openapitools::server::model::Detector_status Convert(const DetectorStatus &input);
org::openapitools::server::model::Detector_list Convert(const DetectorList &input);
org::openapitools::server::model::Plots Convert(const MultiLinePlot& input);
AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azim_int_settings& input);
org::openapitools::server::model::Azim_int_settings Convert(const AzimuthalIntegrationSettings& settings);
ROIDefinition Convert(const org::openapitools::server::model::Roi_definitions& input);
org::openapitools::server::model::Roi_definitions Convert(const ROIDefinition &input);
ImageFormatSettings Convert(const org::openapitools::server::model::Image_format_settings& input);
org::openapitools::server::model::Image_format_settings Convert(const ImageFormatSettings& input);
GoniometerAxis Convert(const org::openapitools::server::model::Rotation_axis& input);
GridScanSettings Convert(const org::openapitools::server::model::Grid_scan& input);
DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input);
std::vector<org::openapitools::server::model::Fpga_status_inner> Convert(const std::vector<DeviceStatus> &input);
org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input);
org::openapitools::server::model::Image_buffer_status Convert(const ImageBufferStatus& input);
org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPreviewSettings& settings);
ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_preview_settings& input);
org::openapitools::server::model::Zeromq_metadata_settings Convert(const ZMQMetadataSettings& settings);
ZMQMetadataSettings Convert(const org::openapitools::server::model::Zeromq_metadata_settings& input);
org::openapitools::server::model::File_writer_format Convert(FileWriterFormat input);
FileWriterFormat Convert(const org::openapitools::server::model::File_writer_format& input);
PlotType ConvertPlotType(const std::optional<std::string>& input);
ColorScaleEnum ConvertColorScale(const std::optional<std::string>& input);
org::openapitools::server::model::Scan_result Convert(const ScanResult& input);
#endif //JFJOCH_OPENAPICONVERT_H

58
broker/README.md Normal file
View File

@@ -0,0 +1,58 @@
# Jungfraujoch service (jfjoch_broker)
'jfjoch_broker' is the main service for the Jungfraujoch application. It is responsible for:
* Providing user interface via HTTP and OpenAPI
* Configuring FPGA firmware
* Building images from FPGA output and forwarding the results over ZeroMQ
Description of OpenAPI is presented in the `redoc-static.html` file.
Due to limitations of GitLab/GitHub the file cannot be viewed directly from the repository, but needs to be downloaded.
## Broker configuration
'jfjoch_broker' requires JSON configuration files. At the moment the format of the configuration file is not properly documented.
Till this happens, it is recommended to go through example files in the [etc/](../etc/).
## Setting up a local test for Jungfraujoch
For development, it is possible to setup a local installation of Jungfraujoch.
This will work without FPGA installed in the computer and allows to test Jungfraujoch software layer, including
ZeroMQ streaming and file writing.
The workflow simulates FPGA behavior, by running high-level synthesis code on the CPU - the performance is therefore
very low, as fixed-point calculations have large performance penalty on CPU. In the CPU simulation mode, one can simulate
using only a single FPGA device.
To run the test:
### Compile Jungfraujoch with frontend
```
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make jfjoch
make frontend
```
### Start services
Start broker:
```
cd build/broker
./jfjoch_broker ../../etc/broker_local.json 5232
```
Start writer:
```
cd build/writer
./jfjoch_writer tcp://127.0.0.1:5500
```
### Run tests
To run test a Python script is provided:
```
cd tests/test_data
python jfjoch_broker_test.py
```
The script will initialize Jungfraujoch, import test image and start data collection.
### Expected result
You can observe online data analysis by opening the following web page: [http://localhost:5232](http://localhost:5232).
Also in the `build/writer` subdirectory a dataset with images should be written.

View File

@@ -1,39 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiBase.h
*
* Generalization of the Api classes
*/
#ifndef ApiBase_H_
#define ApiBase_H_
#include <pistache/router.h>
#include <memory>
namespace org::openapitools::server::api
{
class ApiBase {
public:
explicit ApiBase(const std::shared_ptr<Pistache::Rest::Router>& rtr) : router(rtr) {};
virtual ~ApiBase() = default;
virtual void init() = 0;
protected:
const std::shared_ptr<Pistache::Rest::Router> router;
};
} // namespace org::openapitools::server::api
#endif /* ApiBase_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -19,8 +19,6 @@
#define DefaultApi_H_
#include "ApiBase.h"
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
@@ -28,7 +26,6 @@
#include <optional>
#include <utility>
#include "Azim_int_settings.h"
#include "Broker_status.h"
#include "Calibration_statistics_inner.h"
#include "Dataset_settings.h"
@@ -37,31 +34,23 @@
#include "Detector_settings.h"
#include "Detector_status.h"
#include "Error_message.h"
#include "File_writer_settings.h"
#include "Fpga_status_inner.h"
#include "Image_buffer_status.h"
#include "Image_format_settings.h"
#include "Indexing_settings.h"
#include "Instrument_metadata.h"
#include "Jfjoch_statistics.h"
#include "Measurement_statistics.h"
#include "Plots.h"
#include "Roi_definitions.h"
#include "Scan_result.h"
#include "Preview_settings.h"
#include "Rad_int_settings.h"
#include "Roi_box_list.h"
#include "Roi_circle_list.h"
#include "Spot_finding_settings.h"
#include "Zeromq_metadata_settings.h"
#include "Zeromq_preview_settings.h"
#include <string>
#include <vector>
namespace org::openapitools::server::api
{
class DefaultApi : public ApiBase {
class DefaultApi {
public:
explicit DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr);
~DefaultApi() override = default;
void init() override;
virtual ~DefaultApi() = default;
void init();
static const std::string base;
@@ -69,71 +58,54 @@ private:
void setupRoutes();
void cancel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_azim_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_file_writer_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_file_writer_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_conversion_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_raw_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_indexing_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_indexing_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_instrument_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_roi_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_roi_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_rad_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_rad_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_select_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_user_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_user_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_user_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_zeromq_metadata_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_zeromq_metadata_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_zeromq_preview_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_zeromq_preview_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void fpga_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_clear_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_png_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_bkg_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_error_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_image_collection_efficiency_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_indexing_rate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_indexing_rate_per_file_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_rad_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_rad_int_per_file_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_receiver_delay_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_receiver_free_send_buffers_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_resolution_estimate_histogram_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_sum_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_spot_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_strong_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_calibration_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_jpeg_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_plot_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void result_scan_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void roi_box_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void roi_box_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void roi_circle_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void roi_circle_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_data_collection_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void trigger_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void version_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void wait_till_done_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void xfel_event_code_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void xfel_pulse_id_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void default_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
/// <summary>
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
/// May be overridden to return custom error formats. This is called inside a catch block.
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
/// </summary>
virtual void handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
const std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
@@ -142,13 +114,6 @@ private:
/// </summary>
virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(const std::exception& ex) const noexcept;
/// <summary>
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
/// May be overridden to return custom error formats. This is called inside a catch block.
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
/// </summary>
virtual void handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
/// <summary>
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
/// May be overridden to return custom error formats. This is called inside a catch block.
@@ -164,21 +129,6 @@ private:
/// </remarks>
virtual void cancel_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get azimuthal integration configuration
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_azim_int_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Configure azimuthal integration
/// </summary>
/// <remarks>
/// Can be done when detector is Inactive or Idle
/// </remarks>
/// <param name="azimIntSettings"> (optional)</param>
virtual void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &azimIntSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get detector configuration
/// </summary>
/// <remarks>
@@ -194,80 +144,6 @@ private:
/// <param name="detectorSettings"> (optional)</param>
virtual void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get file writer settings
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_file_writer_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Change file writer settings
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
/// <param name="fileWriterSettings"> (optional)</param>
virtual void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Configure format for data collection with full conversion
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
virtual void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get image output format
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_image_format_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Change image output format
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
/// <param name="imageFormatSettings"> (optional)</param>
virtual void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Configure format for raw data collection
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
virtual void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get indexing configuration
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_indexing_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Change indexing algorithm settings
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
/// <param name="indexingSettings"> (optional)</param>
virtual void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get instrument metadata
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_instrument_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Change instrument metadata
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
/// <param name="instrumentMetadata"> (optional)</param>
virtual void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Load binary image for internal FPGA generator
/// </summary>
/// <remarks>
@@ -275,41 +151,20 @@ private:
/// </remarks>
virtual void config_internal_generator_image_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Load TIFF image for internal FPGA generator
/// Get radial integration configuration
/// </summary>
/// <remarks>
/// Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).
/// Can be done anytime
/// </remarks>
virtual void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
virtual void config_rad_int_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get mask of the detector (binary)
/// Configure radial integration
/// </summary>
/// <remarks>
/// Detector must be Initialized. Get full pixel mask of the detector. See NXmx standard for meaning of pixel values.
/// Can be done when detector is Inactive or Idle
/// </remarks>
virtual void config_mask_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get mask of the detector (TIFF)
/// </summary>
/// <remarks>
/// Should be in &#x60;Idle&#x60; state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values
/// </remarks>
virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get ROI definitions
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void config_roi_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Upload ROI definitions
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="roiDefinitions"> (optional)</param>
virtual void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions, Pistache::Http::ResponseWriter &response) = 0;
/// <param name="radIntSettings"> (optional)</param>
virtual void config_rad_int_put(const org::openapitools::server::model::Rad_int_settings &radIntSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// List available detectors
/// </summary>
@@ -341,64 +196,6 @@ private:
/// <param name="spotFindingSettings"> (optional)</param>
virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Detector must be Initialized. Get user mask of the detector (binary)
/// </summary>
/// <remarks>
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
/// </remarks>
virtual void config_user_mask_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Upload user mask of the detector (binary)
/// </summary>
/// <remarks>
/// Should be in &#x60;Idle&#x60; state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don&#39;t need to be assigned value. Mask is expected as binary array (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration.
/// </remarks>
virtual void config_user_mask_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Detector must be Initialized. Get user mask of the detector (TIFF)
/// </summary>
/// <remarks>
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
/// </remarks>
virtual void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Upload user mask of the detector
/// </summary>
/// <remarks>
/// Should be in &#x60;Idle&#x60; state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don&#39;t need to be assigned value. Mask is expected as TIFF (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images.
/// </remarks>
virtual void config_user_mask_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get ZeroMQ metadata socket settings
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Set ZeroMQ metadata settings
/// </summary>
/// <remarks>
/// Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request.
/// </remarks>
/// <param name="zeromqMetadataSettings"> (optional)</param>
virtual void config_zeromq_metadata_put(const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get ZeroMQ preview settings
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void config_zeromq_preview_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Set ZeroMQ preview settings
/// </summary>
/// <remarks>
/// Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. Options set with this PUT request have no effect on HTTP based preview.
/// </remarks>
/// <param name="zeromqPreviewSettings"> (optional)</param>
virtual void config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Prepare detector to turn off
/// </summary>
/// <remarks>
@@ -413,82 +210,6 @@ private:
/// </remarks>
virtual void detector_status_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get status of FPGA devices
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void fpga_status_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Clear image buffer
/// </summary>
/// <remarks>
/// Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data.
/// </remarks>
virtual void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get image message in CBOR format
/// </summary>
/// <remarks>
/// Contains full image data and metadata. The image must come from the latest data collection.
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
virtual void image_buffer_image_cbor_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get preview image in JPEG format using custom settings
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
/// <param name="showUserMask">Show user mask (optional, default to false)</param>
/// <param name="showRoi">Show ROI areas on the image (optional, default to false)</param>
/// <param name="showSpots">Show spot finding results on the image (optional, default to true)</param>
/// <param name="showBeamCenter">Show beam center on the image (optional, default to true)</param>
/// <param name="saturation">Saturation value to set contrast in the preview image (optional, default to 10.0f)</param>
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to &quot;indigo&quot;)</param>
virtual void image_buffer_image_jpeg_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get preview image in PNG format using custom settings
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
/// <param name="showUserMask">Show user mask (optional, default to false)</param>
/// <param name="showRoi">Show ROI areas on the image (optional, default to false)</param>
/// <param name="showSpots">Show spot finding results on the image (optional, default to true)</param>
/// <param name="showBeamCenter">Show beam center on the image (optional, default to true)</param>
/// <param name="saturation">Saturation value to set contrast in the preview image (optional, default to 10.0f)</param>
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to &quot;indigo&quot;)</param>
virtual void image_buffer_image_png_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get preview image in TIFF format
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
virtual void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Start message in CBOR format
/// </summary>
/// <remarks>
/// Contains metadata for a dataset (e.g., experimental geometry)
/// </remarks>
virtual void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get status of the image buffers
/// </summary>
/// <remarks>
/// Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor.
/// </remarks>
virtual void image_buffer_status_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Initialize detector and data acquisition
/// </summary>
/// <remarks>
@@ -503,7 +224,152 @@ private:
/// </remarks>
virtual void pedestal_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get pedestal in TIFF format
/// Generate background estimate plot
/// </summary>
/// <remarks>
/// Mean intensity for d &#x3D; 3 - 5 A per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_bkg_estimate_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate error pixels plot
/// </summary>
/// <remarks>
/// Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_error_pixel_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate image collection efficiency plot
/// </summary>
/// <remarks>
/// Ratio of collected and expected packets per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_image_collection_efficiency_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate indexing rate plot
/// </summary>
/// <remarks>
/// Image indexing rate; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_indexing_rate_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate indexing rate per file
/// </summary>
/// <remarks>
/// Indexing rate per each of data files; useful for example for time resolved data
/// </remarks>
virtual void plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate radial integration profile
/// </summary>
/// <remarks>
/// Generate average radial integration profile
/// </remarks>
virtual void plot_rad_int_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate radial integration profiles per file
/// </summary>
/// <remarks>
/// Radial integration plots for both the whole dataset and per file; useful for time-resolved measurements
/// </remarks>
virtual void plot_rad_int_per_file_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate receiver delay plot
/// </summary>
/// <remarks>
/// Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_receiver_delay_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate receiver free send buffer plot
/// </summary>
/// <remarks>
/// Amount of send buffers available during frame processing - used for internal debugging; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate resolution estimate histogram
/// </summary>
/// <remarks>
/// Generate histogram of crystal resolutions from 1.0 to 5.0 A based on ML model
/// </remarks>
virtual void plot_resolution_estimate_histogram_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI max count
/// </summary>
/// <remarks>
/// Max count of ROI per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_roi_max_count_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate ROI sum plot
/// </summary>
/// <remarks>
/// Sum of ROI rectangle per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_roi_sum_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI valid pixels
/// </summary>
/// <remarks>
/// Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate spot count plot
/// </summary>
/// <remarks>
/// Number of spots per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_spot_count_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate strong pixels plot
/// </summary>
/// <remarks>
/// Count of strong pixels per image (from spot finding); binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
virtual void plot_strong_pixel_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format for calibration with PyFAI/Dioptas
/// </summary>
/// <remarks>
/// Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction
/// </remarks>
virtual void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in JPEG format using default settings
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in JPEG format using custom settings
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="previewSettings"> (optional)</param>
virtual void preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get pedestal G0 in TIFF format
/// </summary>
/// <remarks>
///
@@ -512,30 +378,40 @@ private:
/// <param name="sc">Storage cell number (optional, default to 0)</param>
virtual void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel, const std::optional<int32_t> &sc, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate 1D plot from Jungfraujoch
/// Get box ROIs
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="type">Type of requested plot</param>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to false)</param>
/// <param name="fill">Fill value for elements that were missed during data collection (optional, default to 0.0f)</param>
/// <param name="experimentalCoord">If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored (optional, default to false)</param>
/// <param name="azintUnit">Unit used for azim int. (optional, default to &quot;Q_recipA&quot;)</param>
virtual void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning, const std::optional<bool> &compression, const std::optional<float> &fill, const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit, Pistache::Http::ResponseWriter &response) = 0;
virtual void roi_box_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get full scan result
/// Upload box ROIs
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void result_scan_get(Pistache::Http::ResponseWriter &response) = 0;
/// <param name="roiBoxList"> (optional)</param>
virtual void roi_box_put(const org::openapitools::server::model::Roi_box_list &roiBoxList, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get circular ROI
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void roi_circle_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Upload circular ROI
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="roiCircleList"> (optional)</param>
virtual void roi_circle_put(const org::openapitools::server::model::Roi_circle_list &roiCircleList, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Start detector
/// </summary>
/// <remarks>
/// Start data acquisition. Detector must be in &#x60;Idle&#x60; state. Doesn&#39;t run calibration procedure. When the function returns, detector is ready to accept soft/TTL triggers.
/// Start data acquisition. Detector must be in &#x60;Idle&#x60; state. Doesn&#39;t run calibration procedure. This is async function - one needs to use &#x60;POST /wait_till_done&#x60; to ensure operation is done.
/// </remarks>
/// <param name="datasetSettings"> (optional)</param>
virtual void start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings, Pistache::Http::ResponseWriter &response) = 0;
@@ -554,14 +430,6 @@ private:
/// </remarks>
virtual void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get general statistics
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to false)</param>
virtual void statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Jungfraujoch status
/// </summary>
/// <remarks>
@@ -576,20 +444,12 @@ private:
/// </remarks>
virtual void trigger_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Jungfraujoch version of jfjoch_broker
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void version_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Wait for acquisition done
/// </summary>
/// <remarks>
/// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.
/// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a long period of time, the procedure is provided with a timeout of 5 seconds.
/// </remarks>
/// <param name="timeout">Timeout in seconds (0 &#x3D;&#x3D; immediate response) (optional, default to 60)</param>
virtual void wait_till_done_post(const std::optional<int32_t> &timeout, Pistache::Http::ResponseWriter &response) = 0;
virtual void wait_till_done_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Return XFEL event codes for the current data acquisition
/// </summary>

View File

@@ -1,195 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Azim_int_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Azim_int_settings::Azim_int_settings()
{
m_Polarization_corr = true;
m_Solid_angle_corr = true;
m_High_q_recipA = 0.0f;
m_Low_q_recipA = 0.0f;
m_Q_spacing = 0.0f;
m_Azimuthal_bins = 1L;
m_Azimuthal_binsIsSet = false;
}
void Azim_int_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Azim_int_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Azim_int_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Azim_int_settings" : pathPrefix;
if (azimuthalBinsIsSet())
{
const int64_t& value = m_Azimuthal_bins;
const std::string currentValuePath = _pathPrefix + ".azimuthalBins";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 256ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 256;";
}
}
return success;
}
bool Azim_int_settings::operator==(const Azim_int_settings& rhs) const
{
return
(isPolarizationCorr() == rhs.isPolarizationCorr())
&&
(isSolidAngleCorr() == rhs.isSolidAngleCorr())
&&
(getHighQRecipA() == rhs.getHighQRecipA())
&&
(getLowQRecipA() == rhs.getLowQRecipA())
&&
(getQSpacing() == rhs.getQSpacing())
&&
((!azimuthalBinsIsSet() && !rhs.azimuthalBinsIsSet()) || (azimuthalBinsIsSet() && rhs.azimuthalBinsIsSet() && getAzimuthalBins() == rhs.getAzimuthalBins()))
;
}
bool Azim_int_settings::operator!=(const Azim_int_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Azim_int_settings& o)
{
j = nlohmann::json::object();
j["polarization_corr"] = o.m_Polarization_corr;
j["solid_angle_corr"] = o.m_Solid_angle_corr;
j["high_q_recipA"] = o.m_High_q_recipA;
j["low_q_recipA"] = o.m_Low_q_recipA;
j["q_spacing"] = o.m_Q_spacing;
if(o.azimuthalBinsIsSet())
j["azimuthal_bins"] = o.m_Azimuthal_bins;
}
void from_json(const nlohmann::json& j, Azim_int_settings& o)
{
j.at("polarization_corr").get_to(o.m_Polarization_corr);
j.at("solid_angle_corr").get_to(o.m_Solid_angle_corr);
j.at("high_q_recipA").get_to(o.m_High_q_recipA);
j.at("low_q_recipA").get_to(o.m_Low_q_recipA);
j.at("q_spacing").get_to(o.m_Q_spacing);
if(j.find("azimuthal_bins") != j.end())
{
j.at("azimuthal_bins").get_to(o.m_Azimuthal_bins);
o.m_Azimuthal_binsIsSet = true;
}
}
bool Azim_int_settings::isPolarizationCorr() const
{
return m_Polarization_corr;
}
void Azim_int_settings::setPolarizationCorr(bool const value)
{
m_Polarization_corr = value;
}
bool Azim_int_settings::isSolidAngleCorr() const
{
return m_Solid_angle_corr;
}
void Azim_int_settings::setSolidAngleCorr(bool const value)
{
m_Solid_angle_corr = value;
}
float Azim_int_settings::getHighQRecipA() const
{
return m_High_q_recipA;
}
void Azim_int_settings::setHighQRecipA(float const value)
{
m_High_q_recipA = value;
}
float Azim_int_settings::getLowQRecipA() const
{
return m_Low_q_recipA;
}
void Azim_int_settings::setLowQRecipA(float const value)
{
m_Low_q_recipA = value;
}
float Azim_int_settings::getQSpacing() const
{
return m_Q_spacing;
}
void Azim_int_settings::setQSpacing(float const value)
{
m_Q_spacing = value;
}
int64_t Azim_int_settings::getAzimuthalBins() const
{
return m_Azimuthal_bins;
}
void Azim_int_settings::setAzimuthalBins(int64_t const value)
{
m_Azimuthal_bins = value;
m_Azimuthal_binsIsSet = true;
}
bool Azim_int_settings::azimuthalBinsIsSet() const
{
return m_Azimuthal_binsIsSet;
}
void Azim_int_settings::unsetAzimuthal_bins()
{
m_Azimuthal_binsIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,113 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Azim_int_settings.h
*
*
*/
#ifndef Azim_int_settings_H_
#define Azim_int_settings_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Azim_int_settings
{
public:
Azim_int_settings();
virtual ~Azim_int_settings() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Azim_int_settings& rhs) const;
bool operator!=(const Azim_int_settings& rhs) const;
/////////////////////////////////////////////
/// Azim_int_settings members
/// <summary>
/// Apply polarization correction for azimuthal integration (polarization factor must be configured in dataset settings)
/// </summary>
bool isPolarizationCorr() const;
void setPolarizationCorr(bool const value);
/// <summary>
/// Apply solid angle correction for azimuthal integration
/// </summary>
bool isSolidAngleCorr() const;
void setSolidAngleCorr(bool const value);
/// <summary>
///
/// </summary>
float getHighQRecipA() const;
void setHighQRecipA(float const value);
/// <summary>
///
/// </summary>
float getLowQRecipA() const;
void setLowQRecipA(float const value);
/// <summary>
///
/// </summary>
float getQSpacing() const;
void setQSpacing(float const value);
/// <summary>
/// Numer of azimuthal (phi) bins; 1 &#x3D; standard 1D azimuthal integration
/// </summary>
int64_t getAzimuthalBins() const;
void setAzimuthalBins(int64_t const value);
bool azimuthalBinsIsSet() const;
void unsetAzimuthal_bins();
friend void to_json(nlohmann::json& j, const Azim_int_settings& o);
friend void from_json(const nlohmann::json& j, Azim_int_settings& o);
protected:
bool m_Polarization_corr;
bool m_Solid_angle_corr;
float m_High_q_recipA;
float m_Low_q_recipA;
float m_Q_spacing;
int64_t m_Azimuthal_bins;
bool m_Azimuthal_binsIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Azim_int_settings_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -24,12 +24,8 @@ Broker_status::Broker_status()
m_State = "";
m_Progress = 0.0f;
m_ProgressIsSet = false;
m_Message = "";
m_MessageIsSet = false;
m_Message_severity = "error";
m_Message_severityIsSet = false;
m_Gpu_count = 0;
m_Gpu_countIsSet = false;
m_Indexing_rate = 0.0f;
m_Indexing_rateIsSet = false;
}
@@ -71,7 +67,26 @@ bool Broker_status::validate(std::stringstream& msg, const std::string& pathPref
}
}
if (indexingRateIsSet())
{
const float& value = m_Indexing_rate;
const std::string currentValuePath = _pathPrefix + ".indexingRate";
if (value < static_cast<float>(0.0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.0;";
}
if (value > static_cast<float>(1.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 1.0;";
}
}
return success;
}
@@ -87,13 +102,7 @@ bool Broker_status::operator==(const Broker_status& rhs) const
((!progressIsSet() && !rhs.progressIsSet()) || (progressIsSet() && rhs.progressIsSet() && getProgress() == rhs.getProgress())) &&
((!messageIsSet() && !rhs.messageIsSet()) || (messageIsSet() && rhs.messageIsSet() && getMessage() == rhs.getMessage())) &&
((!messageSeverityIsSet() && !rhs.messageSeverityIsSet()) || (messageSeverityIsSet() && rhs.messageSeverityIsSet() && getMessageSeverity() == rhs.getMessageSeverity())) &&
((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount()))
((!indexingRateIsSet() && !rhs.indexingRateIsSet()) || (indexingRateIsSet() && rhs.indexingRateIsSet() && getIndexingRate() == rhs.getIndexingRate()))
;
}
@@ -105,16 +114,12 @@ bool Broker_status::operator!=(const Broker_status& rhs) const
void to_json(nlohmann::json& j, const Broker_status& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["state"] = o.m_State;
if(o.progressIsSet())
j["progress"] = o.m_Progress;
if(o.messageIsSet())
j["message"] = o.m_Message;
if(o.messageSeverityIsSet())
j["message_severity"] = o.m_Message_severity;
if(o.gpuCountIsSet())
j["gpu_count"] = o.m_Gpu_count;
if(o.indexingRateIsSet())
j["indexing_rate"] = o.m_Indexing_rate;
}
@@ -126,20 +131,10 @@ void from_json(const nlohmann::json& j, Broker_status& o)
j.at("progress").get_to(o.m_Progress);
o.m_ProgressIsSet = true;
}
if(j.find("message") != j.end())
if(j.find("indexing_rate") != j.end())
{
j.at("message").get_to(o.m_Message);
o.m_MessageIsSet = true;
}
if(j.find("message_severity") != j.end())
{
j.at("message_severity").get_to(o.m_Message_severity);
o.m_Message_severityIsSet = true;
}
if(j.find("gpu_count") != j.end())
{
j.at("gpu_count").get_to(o.m_Gpu_count);
o.m_Gpu_countIsSet = true;
j.at("indexing_rate").get_to(o.m_Indexing_rate);
o.m_Indexing_rateIsSet = true;
}
}
@@ -169,56 +164,22 @@ void Broker_status::unsetProgress()
{
m_ProgressIsSet = false;
}
std::string Broker_status::getMessage() const
float Broker_status::getIndexingRate() const
{
return m_Message;
return m_Indexing_rate;
}
void Broker_status::setMessage(std::string const& value)
void Broker_status::setIndexingRate(float const value)
{
m_Message = value;
m_MessageIsSet = true;
m_Indexing_rate = value;
m_Indexing_rateIsSet = true;
}
bool Broker_status::messageIsSet() const
bool Broker_status::indexingRateIsSet() const
{
return m_MessageIsSet;
return m_Indexing_rateIsSet;
}
void Broker_status::unsetMessage()
void Broker_status::unsetIndexing_rate()
{
m_MessageIsSet = false;
}
std::string Broker_status::getMessageSeverity() const
{
return m_Message_severity;
}
void Broker_status::setMessageSeverity(std::string const& value)
{
m_Message_severity = value;
m_Message_severityIsSet = true;
}
bool Broker_status::messageSeverityIsSet() const
{
return m_Message_severityIsSet;
}
void Broker_status::unsetMessage_severity()
{
m_Message_severityIsSet = false;
}
int32_t Broker_status::getGpuCount() const
{
return m_Gpu_count;
}
void Broker_status::setGpuCount(int32_t const value)
{
m_Gpu_count = value;
m_Gpu_countIsSet = true;
}
bool Broker_status::gpuCountIsSet() const
{
return m_Gpu_countIsSet;
}
void Broker_status::unsetGpu_count()
{
m_Gpu_countIsSet = false;
m_Indexing_rateIsSet = false;
}

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -64,47 +64,29 @@ public:
std::string getState() const;
void setState(std::string const& value);
/// <summary>
/// Progress of data collection (only available if receiving is running)
///
/// </summary>
float getProgress() const;
void setProgress(float const value);
bool progressIsSet() const;
void unsetProgress();
/// <summary>
/// Message to display besides state of the jfjoch_broker; mostly used for errors and warnings This matters especially for async functions (start/initialize), where API won&#39;t return reason for the error during async operation.
///
/// </summary>
std::string getMessage() const;
void setMessage(std::string const& value);
bool messageIsSet() const;
void unsetMessage();
/// <summary>
/// Level of the message to display
/// </summary>
std::string getMessageSeverity() const;
void setMessageSeverity(std::string const& value);
bool messageSeverityIsSet() const;
void unsetMessage_severity();
/// <summary>
/// Number of installed GPUs
/// </summary>
int32_t getGpuCount() const;
void setGpuCount(int32_t const value);
bool gpuCountIsSet() const;
void unsetGpu_count();
float getIndexingRate() const;
void setIndexingRate(float const value);
bool indexingRateIsSet() const;
void unsetIndexing_rate();
friend void to_json(nlohmann::json& j, const Broker_status& o);
friend void from_json(const nlohmann::json& j, Broker_status& o);
friend void to_json(nlohmann::json& j, const Broker_status& o);
friend void from_json(const nlohmann::json& j, Broker_status& o);
protected:
std::string m_State;
float m_Progress;
bool m_ProgressIsSet;
std::string m_Message;
bool m_MessageIsSet;
std::string m_Message_severity;
bool m_Message_severityIsSet;
int32_t m_Gpu_count;
bool m_Gpu_countIsSet;
float m_Indexing_rate;
bool m_Indexing_rateIsSet;
};

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -98,7 +98,7 @@ bool Calibration_statistics_inner::operator!=(const Calibration_statistics_inner
void to_json(nlohmann::json& j, const Calibration_statistics_inner& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["module_number"] = o.m_Module_number;
j["storage_cell_number"] = o.m_Storage_cell_number;
j["pedestal_g0_mean"] = o.m_Pedestal_g0_mean;

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -103,8 +103,8 @@ public:
int64_t getMaskedPixels() const;
void setMaskedPixels(int64_t const value);
friend void to_json(nlohmann::json& j, const Calibration_statistics_inner& o);
friend void from_json(const nlohmann::json& j, Calibration_statistics_inner& o);
friend void to_json(nlohmann::json& j, const Calibration_statistics_inner& o);
friend void from_json(const nlohmann::json& j, Calibration_statistics_inner& o);
protected:
int64_t m_Module_number;

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -19,11 +19,9 @@
#define Dataset_settings_H_
#include "Grid_scan.h"
#include <nlohmann/json.hpp>
#include "Rotation_axis.h"
#include "Unit_cell.h"
#include <string>
#include "Dataset_settings_unit_cell.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
@@ -77,12 +75,12 @@ public:
bool ntriggerIsSet() const;
void unsetNtrigger();
/// <summary>
/// Image time. If not provided (or zero value) the frame time is assumed as default. For JUNGFRAU image time must be multiple of frame time and max value is 256 * frame_time. In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells and if raw data are saved.
/// FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified. Frame summation factor applies only to conversion mode (assumed as 1 for raw data). In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells (assumed as 1).
/// </summary>
int64_t getImageTimeUs() const;
void setImageTimeUs(int64_t const value);
bool imageTimeUsIsSet() const;
void unsetImage_time_us();
int64_t getSummation() const;
void setSummation(int64_t const value);
bool summationIsSet() const;
void unsetSummation();
/// <summary>
/// /entry/detector/beam_center_x in NXmx Beam center in X direction [pixels]
/// </summary>
@@ -99,10 +97,10 @@ public:
float getDetectorDistanceMm() const;
void setDetectorDistanceMm(float const value);
/// <summary>
/// Used to calculate /entry/beam/incident_wavelength in NXmx Incident particle (photon, electron) energy in keV
/// Used to calculate /entry/beam/incident_wavelength in NXmx Incident photon energy in keV
/// </summary>
float getIncidentEnergyKeV() const;
void setIncidentEnergyKeV(float const value);
float getPhotonEnergyKeV() const;
void setPhotonEnergyKeV(float const value);
/// <summary>
/// Prefix for filenames. If left empty, no file will be saved.
/// </summary>
@@ -118,7 +116,7 @@ public:
bool imagesPerFileIsSet() const;
void unsetImages_per_file();
/// <summary>
/// Number of space group for the crystal. Currently used solely as metadata, not relevant for image processing done in Jungfraujoch.
///
/// </summary>
int64_t getSpaceGroupNumber() const;
void setSpaceGroupNumber(int64_t const value);
@@ -129,10 +127,15 @@ public:
/// </summary>
std::string getSampleName() const;
void setSampleName(std::string const& value);
bool sampleNameIsSet() const;
void unsetSample_name();
/// <summary>
/// Compression type for the images transferred over ZeroMQ and saved to HDF5 file.
/// FPGA output data type
/// </summary>
std::string getFpgaOutput() const;
void setFpgaOutput(std::string const& value);
bool fpgaOutputIsSet() const;
void unsetFpga_output();
/// <summary>
///
/// </summary>
std::string getCompression() const;
void setCompression(std::string const& value);
@@ -155,32 +158,32 @@ public:
/// <summary>
///
/// </summary>
org::openapitools::server::model::Rotation_axis getGoniometer() const;
void setGoniometer(org::openapitools::server::model::Rotation_axis const& value);
bool goniometerIsSet() const;
void unsetGoniometer();
org::openapitools::server::model::Rotation_axis getOmega() const;
void setOmega(org::openapitools::server::model::Rotation_axis const& value);
bool omegaIsSet() const;
void unsetOmega();
/// <summary>
///
/// Header appendix, added as user_data to start message
/// </summary>
org::openapitools::server::model::Grid_scan getGridScan() const;
void setGridScan(org::openapitools::server::model::Grid_scan const& value);
bool gridScanIsSet() const;
void unsetGrid_scan();
/// <summary>
/// Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) In general, it is not saved in HDF5 file. However, if values are placed in \&quot;hdf5\&quot; object, &#x60;jfjoch_writer&#x60; will write them in /entry/data of the HDF5 file. This applies solely to string and number (double floating-point). No arrays/sub-objects is allowed. For example {\&quot;hdf5\&quot;: {\&quot;val1\&quot;:1, \&quot;val2\&quot;:\&quot;xyz\&quot;}}, will write /entry/user/val1 and /entry/user/val2.
/// </summary>
nlohmann::json getHeaderAppendix() const;
void setHeaderAppendix(nlohmann::json const& value);
std::string getHeaderAppendix() const;
void setHeaderAppendix(std::string const& value);
bool headerAppendixIsSet() const;
void unsetHeader_appendix();
/// <summary>
/// Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON) Not saved in HDF5 file
/// Image appendix, added as user_data to image message
/// </summary>
nlohmann::json getImageAppendix() const;
void setImageAppendix(nlohmann::json const& value);
std::string getImageAppendix() const;
void setImageAppendix(std::string const& value);
bool imageAppendixIsSet() const;
void unsetImage_appendix();
/// <summary>
/// For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts
/// </summary>
float getPhotonEnergyMultiplier() const;
void setPhotonEnergyMultiplier(float const value);
bool photonEnergyMultiplierIsSet() const;
void unsetPhoton_energy_multiplier();
/// <summary>
/// Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability.
/// </summary>
float getDataReductionFactorSerialmx() const;
@@ -188,134 +191,29 @@ public:
bool dataReductionFactorSerialmxIsSet() const;
void unsetData_reduction_factor_serialmx();
/// <summary>
/// Set all counts lower than the value to zero. When the value is set, negative numbers other than error pixel value are always set to zero. Setting to zero is equivalent to turning the option off.
/// </summary>
int64_t getPixelValueLowThreshold() const;
void setPixelValueLowThreshold(int64_t const value);
bool pixelValueLowThresholdIsSet() const;
void unsetPixel_value_low_threshold();
/// <summary>
/// Number of run within an experimental session. Transferred over CBOR stream as \&quot;series ID\&quot;, though not saved in HDF5 file. It is highly recommended to keep this number unique for each data collection during experimental series. If not provided, the number will be automatically incremented.
/// </summary>
int64_t getRunNumber() const;
void setRunNumber(int64_t const value);
bool runNumberIsSet() const;
void unsetRun_number();
/// <summary>
/// Unique ID of run. Transferred over CBOR stream as \&quot;unique series ID\&quot;, though not saved in HDF5 file. It is highly recommended to keep this name unique for each data collection during experimental series. If not provided, the name will be automatically generated as number + colon + file_prefix.
/// </summary>
std::string getRunName() const;
void setRunName(std::string const& value);
bool runNameIsSet() const;
void unsetRun_name();
/// <summary>
/// Name of group owning the data (e.g. p-group or proposal number). Transferred over CBOR stream, though not saved in HDF5 file.
/// </summary>
std::string getExperimentGroup() const;
void setExperimentGroup(std::string const& value);
bool experimentGroupIsSet() const;
void unsetExperiment_group();
/// <summary>
/// Enable lossy compression of pixel values that preserves Poisson statistics. Requires to provide a numerical factor SQ. Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer. Compression is turned off if the value is missing or it is set to zero.
/// </summary>
int64_t getPoissonCompression() const;
void setPoissonCompression(int64_t const value);
bool poissonCompressionIsSet() const;
void unsetPoisson_compression();
/// <summary>
/// Write NXmx formatted HDF5 master file. Recommended to use for macromolecular crystallography experiments and to turn off for other experiments.
/// </summary>
bool isWriteNxmxHdf5Master() const;
void setWriteNxmxHdf5Master(bool const value);
bool writeNxmxHdf5MasterIsSet() const;
void unsetWrite_nxmx_hdf5_master();
/// <summary>
/// Forward image calibration (at the moment pedestal and pedestal RMS for JUNGFRAU) using the ZeroMQ stream to writer. If parameter is not provided calibration will be saved only if more than 4 images are recorded.
/// </summary>
bool isSaveCalibration() const;
void setSaveCalibration(bool const value);
bool saveCalibrationIsSet() const;
void unsetSave_calibration();
/// <summary>
/// Polarization factor for integration; 1.0 is horizontal polarization; -1.0 is vertical polarization
/// </summary>
float getPolarizationFactor() const;
void setPolarizationFactor(float const value);
bool polarizationFactorIsSet() const;
void unsetPolarization_factor();
/// <summary>
/// Ring current at the beginning of the data collection
/// </summary>
float getRingCurrentMA() const;
void setRingCurrentMA(float const value);
bool ringCurrentMAIsSet() const;
void unsetRing_current_mA();
/// <summary>
/// Sample temperature in Kelvin
/// </summary>
float getSampleTemperatureK() const;
void setSampleTemperatureK(float const value);
bool sampleTemperatureKIsSet() const;
void unsetSample_temperature_K();
/// <summary>
/// PONI angle rot1 (see PyFAI documentation for details) in radians
/// </summary>
float getPoniRot1Rad() const;
void setPoniRot1Rad(float const value);
bool poniRot1RadIsSet() const;
void unsetPoni_rot1_rad();
/// <summary>
/// PONI angle rot2 (see PyFAI documentation for details) in radians
/// </summary>
float getPoniRot2Rad() const;
void setPoniRot2Rad(float const value);
bool poniRot2RadIsSet() const;
void unsetPoni_rot2_rad();
/// <summary>
/// PONI angle rot3 (see PyFAI documentation for details) in radians
/// </summary>
float getPoniRot3Rad() const;
void setPoniRot3Rad(float const value);
bool poniRot3RadIsSet() const;
void unsetPoni_rot3_rad();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Unit_cell getUnitCell() const;
void setUnitCell(org::openapitools::server::model::Unit_cell const& value);
org::openapitools::server::model::Dataset_settings_unit_cell getUnitCell() const;
void setUnitCell(org::openapitools::server::model::Dataset_settings_unit_cell const& value);
bool unitCellIsSet() const;
void unsetUnit_cell();
/// <summary>
/// Enable spot finding and save spots
/// </summary>
bool isSpotFinding() const;
void setSpotFinding(bool const value);
bool spotFindingIsSet() const;
void unsetSpot_finding();
/// <summary>
/// Maximum number of spots that are saved/used for indexing; spots with highest intensity are selected
/// </summary>
int32_t getMaxSpotCount() const;
void setMaxSpotCount(int32_t const value);
bool maxSpotCountIsSet() const;
void unsetMax_spot_count();
friend void to_json(nlohmann::json& j, const Dataset_settings& o);
friend void from_json(const nlohmann::json& j, Dataset_settings& o);
friend void to_json(nlohmann::json& j, const Dataset_settings& o);
friend void from_json(const nlohmann::json& j, Dataset_settings& o);
protected:
int64_t m_Images_per_trigger;
bool m_Images_per_triggerIsSet;
int64_t m_Ntrigger;
bool m_NtriggerIsSet;
int64_t m_Image_time_us;
bool m_Image_time_usIsSet;
int64_t m_Summation;
bool m_SummationIsSet;
float m_Beam_x_pxl;
float m_Beam_y_pxl;
float m_Detector_distance_mm;
float m_Incident_energy_keV;
float m_Photon_energy_keV;
std::string m_File_prefix;
bool m_File_prefixIsSet;
@@ -324,55 +222,27 @@ protected:
int64_t m_Space_group_number;
bool m_Space_group_numberIsSet;
std::string m_Sample_name;
bool m_Sample_nameIsSet;
std::string m_Fpga_output;
bool m_Fpga_outputIsSet;
std::string m_Compression;
bool m_CompressionIsSet;
float m_Total_flux;
bool m_Total_fluxIsSet;
float m_Transmission;
bool m_TransmissionIsSet;
org::openapitools::server::model::Rotation_axis m_Goniometer;
bool m_GoniometerIsSet;
org::openapitools::server::model::Grid_scan m_Grid_scan;
bool m_Grid_scanIsSet;
nlohmann::json m_Header_appendix;
org::openapitools::server::model::Rotation_axis m_Omega;
bool m_OmegaIsSet;
std::string m_Header_appendix;
bool m_Header_appendixIsSet;
nlohmann::json m_Image_appendix;
std::string m_Image_appendix;
bool m_Image_appendixIsSet;
float m_Photon_energy_multiplier;
bool m_Photon_energy_multiplierIsSet;
float m_Data_reduction_factor_serialmx;
bool m_Data_reduction_factor_serialmxIsSet;
int64_t m_Pixel_value_low_threshold;
bool m_Pixel_value_low_thresholdIsSet;
int64_t m_Run_number;
bool m_Run_numberIsSet;
std::string m_Run_name;
bool m_Run_nameIsSet;
std::string m_Experiment_group;
bool m_Experiment_groupIsSet;
int64_t m_Poisson_compression;
bool m_Poisson_compressionIsSet;
bool m_Write_nxmx_hdf5_master;
bool m_Write_nxmx_hdf5_masterIsSet;
bool m_Save_calibration;
bool m_Save_calibrationIsSet;
float m_Polarization_factor;
bool m_Polarization_factorIsSet;
float m_Ring_current_mA;
bool m_Ring_current_mAIsSet;
float m_Sample_temperature_K;
bool m_Sample_temperature_KIsSet;
float m_Poni_rot1_rad;
bool m_Poni_rot1_radIsSet;
float m_Poni_rot2_rad;
bool m_Poni_rot2_radIsSet;
float m_Poni_rot3_rad;
bool m_Poni_rot3_radIsSet;
org::openapitools::server::model::Unit_cell m_Unit_cell;
org::openapitools::server::model::Dataset_settings_unit_cell m_Unit_cell;
bool m_Unit_cellIsSet;
bool m_Spot_finding;
bool m_Spot_findingIsSet;
int32_t m_Max_spot_count;
bool m_Max_spot_countIsSet;
};

View File

@@ -0,0 +1,133 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Dataset_settings_roi_sum_area.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Dataset_settings_roi_sum_area::Dataset_settings_roi_sum_area()
{
m_X_min = 0L;
m_X_max = 0L;
m_Y_min = 0L;
m_Y_max = 0L;
}
void Dataset_settings_roi_sum_area::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Dataset_settings_roi_sum_area::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Dataset_settings_roi_sum_area::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Dataset_settings_roi_sum_area" : pathPrefix;
return success;
}
bool Dataset_settings_roi_sum_area::operator==(const Dataset_settings_roi_sum_area& rhs) const
{
return
(getXMin() == rhs.getXMin())
&&
(getXMax() == rhs.getXMax())
&&
(getYMin() == rhs.getYMin())
&&
(getYMax() == rhs.getYMax())
;
}
bool Dataset_settings_roi_sum_area::operator!=(const Dataset_settings_roi_sum_area& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Dataset_settings_roi_sum_area& o)
{
j = nlohmann::json();
j["x_min"] = o.m_X_min;
j["x_max"] = o.m_X_max;
j["y_min"] = o.m_Y_min;
j["y_max"] = o.m_Y_max;
}
void from_json(const nlohmann::json& j, Dataset_settings_roi_sum_area& o)
{
j.at("x_min").get_to(o.m_X_min);
j.at("x_max").get_to(o.m_X_max);
j.at("y_min").get_to(o.m_Y_min);
j.at("y_max").get_to(o.m_Y_max);
}
int64_t Dataset_settings_roi_sum_area::getXMin() const
{
return m_X_min;
}
void Dataset_settings_roi_sum_area::setXMin(int64_t const value)
{
m_X_min = value;
}
int64_t Dataset_settings_roi_sum_area::getXMax() const
{
return m_X_max;
}
void Dataset_settings_roi_sum_area::setXMax(int64_t const value)
{
m_X_max = value;
}
int64_t Dataset_settings_roi_sum_area::getYMin() const
{
return m_Y_min;
}
void Dataset_settings_roi_sum_area::setYMin(int64_t const value)
{
m_Y_min = value;
}
int64_t Dataset_settings_roi_sum_area::getYMax() const
{
return m_Y_max;
}
void Dataset_settings_roi_sum_area::setYMax(int64_t const value)
{
m_Y_max = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,97 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Dataset_settings_roi_sum_area.h
*
* Rectangle for ROI summation
*/
#ifndef Dataset_settings_roi_sum_area_H_
#define Dataset_settings_roi_sum_area_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Rectangle for ROI summation
/// </summary>
class Dataset_settings_roi_sum_area
{
public:
Dataset_settings_roi_sum_area();
virtual ~Dataset_settings_roi_sum_area() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Dataset_settings_roi_sum_area& rhs) const;
bool operator!=(const Dataset_settings_roi_sum_area& rhs) const;
/////////////////////////////////////////////
/// Dataset_settings_roi_sum_area members
/// <summary>
///
/// </summary>
int64_t getXMin() const;
void setXMin(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getXMax() const;
void setXMax(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getYMin() const;
void setYMin(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getYMax() const;
void setYMax(int64_t const value);
friend void to_json(nlohmann::json& j, const Dataset_settings_roi_sum_area& o);
friend void from_json(const nlohmann::json& j, Dataset_settings_roi_sum_area& o);
protected:
int64_t m_X_min;
int64_t m_X_max;
int64_t m_Y_min;
int64_t m_Y_max;
};
} // namespace org::openapitools::server::model
#endif /* Dataset_settings_roi_sum_area_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -11,7 +11,7 @@
*/
#include "Unit_cell.h"
#include "Dataset_settings_unit_cell.h"
#include "Helpers.h"
#include <sstream>
@@ -19,7 +19,7 @@
namespace org::openapitools::server::model
{
Unit_cell::Unit_cell()
Dataset_settings_unit_cell::Dataset_settings_unit_cell()
{
m_a = 0.0f;
m_b = 0.0f;
@@ -30,7 +30,7 @@ Unit_cell::Unit_cell()
}
void Unit_cell::validate() const
void Dataset_settings_unit_cell::validate() const
{
std::stringstream msg;
if (!validate(msg))
@@ -39,15 +39,15 @@ void Unit_cell::validate() const
}
}
bool Unit_cell::validate(std::stringstream& msg) const
bool Dataset_settings_unit_cell::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Unit_cell::validate(std::stringstream& msg, const std::string& pathPrefix) const
bool Dataset_settings_unit_cell::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Unit_cell" : pathPrefix;
const std::string _pathPrefix = pathPrefix.empty() ? "Dataset_settings_unit_cell" : pathPrefix;
@@ -152,7 +152,7 @@ bool Unit_cell::validate(std::stringstream& msg, const std::string& pathPrefix)
return success;
}
bool Unit_cell::operator==(const Unit_cell& rhs) const
bool Dataset_settings_unit_cell::operator==(const Dataset_settings_unit_cell& rhs) const
{
return
@@ -178,14 +178,14 @@ bool Unit_cell::operator==(const Unit_cell& rhs) const
;
}
bool Unit_cell::operator!=(const Unit_cell& rhs) const
bool Dataset_settings_unit_cell::operator!=(const Dataset_settings_unit_cell& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Unit_cell& o)
void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["a"] = o.m_a;
j["b"] = o.m_b;
j["c"] = o.m_c;
@@ -195,7 +195,7 @@ void to_json(nlohmann::json& j, const Unit_cell& o)
}
void from_json(const nlohmann::json& j, Unit_cell& o)
void from_json(const nlohmann::json& j, Dataset_settings_unit_cell& o)
{
j.at("a").get_to(o.m_a);
j.at("b").get_to(o.m_b);
@@ -206,51 +206,51 @@ void from_json(const nlohmann::json& j, Unit_cell& o)
}
float Unit_cell::getA() const
float Dataset_settings_unit_cell::getA() const
{
return m_a;
}
void Unit_cell::setA(float const value)
void Dataset_settings_unit_cell::setA(float const value)
{
m_a = value;
}
float Unit_cell::getB() const
float Dataset_settings_unit_cell::getB() const
{
return m_b;
}
void Unit_cell::setB(float const value)
void Dataset_settings_unit_cell::setB(float const value)
{
m_b = value;
}
float Unit_cell::getC() const
float Dataset_settings_unit_cell::getC() const
{
return m_c;
}
void Unit_cell::setC(float const value)
void Dataset_settings_unit_cell::setC(float const value)
{
m_c = value;
}
float Unit_cell::getAlpha() const
float Dataset_settings_unit_cell::getAlpha() const
{
return m_Alpha;
}
void Unit_cell::setAlpha(float const value)
void Dataset_settings_unit_cell::setAlpha(float const value)
{
m_Alpha = value;
}
float Unit_cell::getBeta() const
float Dataset_settings_unit_cell::getBeta() const
{
return m_Beta;
}
void Unit_cell::setBeta(float const value)
void Dataset_settings_unit_cell::setBeta(float const value)
{
m_Beta = value;
}
float Unit_cell::getGamma() const
float Dataset_settings_unit_cell::getGamma() const
{
return m_Gamma;
}
void Unit_cell::setGamma(float const value)
void Dataset_settings_unit_cell::setGamma(float const value)
{
m_Gamma = value;
}

View File

@@ -0,0 +1,111 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Dataset_settings_unit_cell.h
*
* Units of angstrom and degree
*/
#ifndef Dataset_settings_unit_cell_H_
#define Dataset_settings_unit_cell_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Units of angstrom and degree
/// </summary>
class Dataset_settings_unit_cell
{
public:
Dataset_settings_unit_cell();
virtual ~Dataset_settings_unit_cell() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Dataset_settings_unit_cell& rhs) const;
bool operator!=(const Dataset_settings_unit_cell& rhs) const;
/////////////////////////////////////////////
/// Dataset_settings_unit_cell members
/// <summary>
///
/// </summary>
float getA() const;
void setA(float const value);
/// <summary>
///
/// </summary>
float getB() const;
void setB(float const value);
/// <summary>
///
/// </summary>
float getC() const;
void setC(float const value);
/// <summary>
///
/// </summary>
float getAlpha() const;
void setAlpha(float const value);
/// <summary>
///
/// </summary>
float getBeta() const;
void setBeta(float const value);
/// <summary>
///
/// </summary>
float getGamma() const;
void setGamma(float const value);
friend void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o);
friend void from_json(const nlohmann::json& j, Dataset_settings_unit_cell& o);
protected:
float m_a;
float m_b;
float m_c;
float m_Alpha;
float m_Beta;
float m_Gamma;
};
} // namespace org::openapitools::server::model
#endif /* Dataset_settings_unit_cell_H_ */

View File

@@ -1,889 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Detector::Detector()
{
m_Description = "";
m_Serial_number = "Unknown";
m_Serial_numberIsSet = false;
m_TypeIsSet = false;
m_High_voltage_V = 0L;
m_High_voltage_VIsSet = false;
m_Udp_interface_count = 1L;
m_Udp_interface_countIsSet = false;
m_Module_sync = true;
m_Module_syncIsSet = false;
m_Sensor_thickness_um = 320.0f;
m_Sensor_thickness_umIsSet = false;
m_Readout_time_us = 0L;
m_Readout_time_usIsSet = false;
m_Minimum_count_time_us = 0L;
m_Minimum_count_time_usIsSet = false;
m_Minimum_frame_time_us = 0L;
m_Minimum_frame_time_usIsSet = false;
m_Calibration_fileIsSet = false;
m_HostnameIsSet = false;
m_Sensor_material = "Si";
m_Sensor_materialIsSet = false;
m_Tx_delayIsSet = false;
m_Base_data_ipv4_address = "";
m_Base_data_ipv4_addressIsSet = false;
m_Standard_geometryIsSet = false;
m_Custom_geometryIsSet = false;
m_Roi_mode = "";
m_Roi_modeIsSet = false;
m_Mirror_y = true;
m_Mirror_yIsSet = false;
m_Temp_thresold_degC = 55L;
m_Temp_thresold_degCIsSet = false;
m_Default_settingsIsSet = false;
}
void Detector::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector" : pathPrefix;
/* Description */ {
const std::string& value = m_Description;
const std::string currentValuePath = _pathPrefix + ".description";
if (value.length() < 1)
{
success = false;
msg << currentValuePath << ": must be at least 1 characters long;";
}
}
if (serialNumberIsSet())
{
const std::string& value = m_Serial_number;
const std::string currentValuePath = _pathPrefix + ".serialNumber";
if (value.length() < 1)
{
success = false;
msg << currentValuePath << ": must be at least 1 characters long;";
}
}
if (highVoltageVIsSet())
{
const int64_t& value = m_High_voltage_V;
const std::string currentValuePath = _pathPrefix + ".highVoltageV";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 200ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 200;";
}
}
if (udpInterfaceCountIsSet())
{
const int64_t& value = m_Udp_interface_count;
const std::string currentValuePath = _pathPrefix + ".udpInterfaceCount";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 2ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 2;";
}
}
if (sensorThicknessUmIsSet())
{
const float& value = m_Sensor_thickness_um;
const std::string currentValuePath = _pathPrefix + ".sensorThicknessUm";
if (value < static_cast<float>(0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (readoutTimeUsIsSet())
{
const int64_t& value = m_Readout_time_us;
const std::string currentValuePath = _pathPrefix + ".readoutTimeUs";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
if (minimumCountTimeUsIsSet())
{
const int64_t& value = m_Minimum_count_time_us;
const std::string currentValuePath = _pathPrefix + ".minimumCountTimeUs";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (minimumFrameTimeUsIsSet())
{
const int64_t& value = m_Minimum_frame_time_us;
const std::string currentValuePath = _pathPrefix + ".minimumFrameTimeUs";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (calibrationFileIsSet())
{
const std::vector<std::string>& value = m_Calibration_file;
const std::string currentValuePath = _pathPrefix + ".calibrationFile";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const std::string& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
if (hostnameIsSet())
{
const std::vector<std::string>& value = m_Hostname;
const std::string currentValuePath = _pathPrefix + ".hostname";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const std::string& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
if (txDelayIsSet())
{
const std::vector<int64_t>& value = m_Tx_delay;
const std::string currentValuePath = _pathPrefix + ".txDelay";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const int64_t& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
if (customGeometryIsSet())
{
const std::vector<org::openapitools::server::model::Detector_module>& value = m_Custom_geometry;
const std::string currentValuePath = _pathPrefix + ".customGeometry";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Detector_module& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".customGeometry") && success;
i++;
}
}
}
if (tempThresoldDegCIsSet())
{
const int64_t& value = m_Temp_thresold_degC;
const std::string currentValuePath = _pathPrefix + ".tempThresoldDegC";
if (value < 40ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 40;";
}
if (value > 70ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 70;";
}
}
return success;
}
bool Detector::operator==(const Detector& rhs) const
{
return
(getDescription() == rhs.getDescription())
&&
((!serialNumberIsSet() && !rhs.serialNumberIsSet()) || (serialNumberIsSet() && rhs.serialNumberIsSet() && getSerialNumber() == rhs.getSerialNumber())) &&
((!typeIsSet() && !rhs.typeIsSet()) || (typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType())) &&
((!highVoltageVIsSet() && !rhs.highVoltageVIsSet()) || (highVoltageVIsSet() && rhs.highVoltageVIsSet() && getHighVoltageV() == rhs.getHighVoltageV())) &&
((!udpInterfaceCountIsSet() && !rhs.udpInterfaceCountIsSet()) || (udpInterfaceCountIsSet() && rhs.udpInterfaceCountIsSet() && getUdpInterfaceCount() == rhs.getUdpInterfaceCount())) &&
((!moduleSyncIsSet() && !rhs.moduleSyncIsSet()) || (moduleSyncIsSet() && rhs.moduleSyncIsSet() && isModuleSync() == rhs.isModuleSync())) &&
((!sensorThicknessUmIsSet() && !rhs.sensorThicknessUmIsSet()) || (sensorThicknessUmIsSet() && rhs.sensorThicknessUmIsSet() && getSensorThicknessUm() == rhs.getSensorThicknessUm())) &&
((!readoutTimeUsIsSet() && !rhs.readoutTimeUsIsSet()) || (readoutTimeUsIsSet() && rhs.readoutTimeUsIsSet() && getReadoutTimeUs() == rhs.getReadoutTimeUs())) &&
((!minimumCountTimeUsIsSet() && !rhs.minimumCountTimeUsIsSet()) || (minimumCountTimeUsIsSet() && rhs.minimumCountTimeUsIsSet() && getMinimumCountTimeUs() == rhs.getMinimumCountTimeUs())) &&
((!minimumFrameTimeUsIsSet() && !rhs.minimumFrameTimeUsIsSet()) || (minimumFrameTimeUsIsSet() && rhs.minimumFrameTimeUsIsSet() && getMinimumFrameTimeUs() == rhs.getMinimumFrameTimeUs())) &&
((!calibrationFileIsSet() && !rhs.calibrationFileIsSet()) || (calibrationFileIsSet() && rhs.calibrationFileIsSet() && getCalibrationFile() == rhs.getCalibrationFile())) &&
((!hostnameIsSet() && !rhs.hostnameIsSet()) || (hostnameIsSet() && rhs.hostnameIsSet() && getHostname() == rhs.getHostname())) &&
((!sensorMaterialIsSet() && !rhs.sensorMaterialIsSet()) || (sensorMaterialIsSet() && rhs.sensorMaterialIsSet() && getSensorMaterial() == rhs.getSensorMaterial())) &&
((!txDelayIsSet() && !rhs.txDelayIsSet()) || (txDelayIsSet() && rhs.txDelayIsSet() && getTxDelay() == rhs.getTxDelay())) &&
((!baseDataIpv4AddressIsSet() && !rhs.baseDataIpv4AddressIsSet()) || (baseDataIpv4AddressIsSet() && rhs.baseDataIpv4AddressIsSet() && getBaseDataIpv4Address() == rhs.getBaseDataIpv4Address())) &&
((!standardGeometryIsSet() && !rhs.standardGeometryIsSet()) || (standardGeometryIsSet() && rhs.standardGeometryIsSet() && getStandardGeometry() == rhs.getStandardGeometry())) &&
((!customGeometryIsSet() && !rhs.customGeometryIsSet()) || (customGeometryIsSet() && rhs.customGeometryIsSet() && getCustomGeometry() == rhs.getCustomGeometry())) &&
((!roiModeIsSet() && !rhs.roiModeIsSet()) || (roiModeIsSet() && rhs.roiModeIsSet() && getRoiMode() == rhs.getRoiMode())) &&
((!mirrorYIsSet() && !rhs.mirrorYIsSet()) || (mirrorYIsSet() && rhs.mirrorYIsSet() && isMirrorY() == rhs.isMirrorY())) &&
((!tempThresoldDegCIsSet() && !rhs.tempThresoldDegCIsSet()) || (tempThresoldDegCIsSet() && rhs.tempThresoldDegCIsSet() && getTempThresoldDegC() == rhs.getTempThresoldDegC())) &&
((!defaultSettingsIsSet() && !rhs.defaultSettingsIsSet()) || (defaultSettingsIsSet() && rhs.defaultSettingsIsSet() && getDefaultSettings() == rhs.getDefaultSettings()))
;
}
bool Detector::operator!=(const Detector& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector& o)
{
j = nlohmann::json::object();
j["description"] = o.m_Description;
if(o.serialNumberIsSet())
j["serial_number"] = o.m_Serial_number;
if(o.typeIsSet())
j["type"] = o.m_Type;
if(o.highVoltageVIsSet())
j["high_voltage_V"] = o.m_High_voltage_V;
if(o.udpInterfaceCountIsSet())
j["udp_interface_count"] = o.m_Udp_interface_count;
if(o.moduleSyncIsSet())
j["module_sync"] = o.m_Module_sync;
if(o.sensorThicknessUmIsSet())
j["sensor_thickness_um"] = o.m_Sensor_thickness_um;
if(o.readoutTimeUsIsSet())
j["readout_time_us"] = o.m_Readout_time_us;
if(o.minimumCountTimeUsIsSet())
j["minimum_count_time_us"] = o.m_Minimum_count_time_us;
if(o.minimumFrameTimeUsIsSet())
j["minimum_frame_time_us"] = o.m_Minimum_frame_time_us;
if(o.calibrationFileIsSet() || !o.m_Calibration_file.empty())
j["calibration_file"] = o.m_Calibration_file;
if(o.hostnameIsSet() || !o.m_Hostname.empty())
j["hostname"] = o.m_Hostname;
if(o.sensorMaterialIsSet())
j["sensor_material"] = o.m_Sensor_material;
if(o.txDelayIsSet() || !o.m_Tx_delay.empty())
j["tx_delay"] = o.m_Tx_delay;
if(o.baseDataIpv4AddressIsSet())
j["base_data_ipv4_address"] = o.m_Base_data_ipv4_address;
if(o.standardGeometryIsSet())
j["standard_geometry"] = o.m_Standard_geometry;
if(o.customGeometryIsSet() || !o.m_Custom_geometry.empty())
j["custom_geometry"] = o.m_Custom_geometry;
if(o.roiModeIsSet())
j["roi_mode"] = o.m_Roi_mode;
if(o.mirrorYIsSet())
j["mirror_y"] = o.m_Mirror_y;
if(o.tempThresoldDegCIsSet())
j["temp_thresold_degC"] = o.m_Temp_thresold_degC;
if(o.defaultSettingsIsSet())
j["default_settings"] = o.m_Default_settings;
}
void from_json(const nlohmann::json& j, Detector& o)
{
j.at("description").get_to(o.m_Description);
if(j.find("serial_number") != j.end())
{
j.at("serial_number").get_to(o.m_Serial_number);
o.m_Serial_numberIsSet = true;
}
if(j.find("type") != j.end())
{
j.at("type").get_to(o.m_Type);
o.m_TypeIsSet = true;
}
if(j.find("high_voltage_V") != j.end())
{
j.at("high_voltage_V").get_to(o.m_High_voltage_V);
o.m_High_voltage_VIsSet = true;
}
if(j.find("udp_interface_count") != j.end())
{
j.at("udp_interface_count").get_to(o.m_Udp_interface_count);
o.m_Udp_interface_countIsSet = true;
}
if(j.find("module_sync") != j.end())
{
j.at("module_sync").get_to(o.m_Module_sync);
o.m_Module_syncIsSet = true;
}
if(j.find("sensor_thickness_um") != j.end())
{
j.at("sensor_thickness_um").get_to(o.m_Sensor_thickness_um);
o.m_Sensor_thickness_umIsSet = true;
}
if(j.find("readout_time_us") != j.end())
{
j.at("readout_time_us").get_to(o.m_Readout_time_us);
o.m_Readout_time_usIsSet = true;
}
if(j.find("minimum_count_time_us") != j.end())
{
j.at("minimum_count_time_us").get_to(o.m_Minimum_count_time_us);
o.m_Minimum_count_time_usIsSet = true;
}
if(j.find("minimum_frame_time_us") != j.end())
{
j.at("minimum_frame_time_us").get_to(o.m_Minimum_frame_time_us);
o.m_Minimum_frame_time_usIsSet = true;
}
if(j.find("calibration_file") != j.end())
{
j.at("calibration_file").get_to(o.m_Calibration_file);
o.m_Calibration_fileIsSet = true;
}
if(j.find("hostname") != j.end())
{
j.at("hostname").get_to(o.m_Hostname);
o.m_HostnameIsSet = true;
}
if(j.find("sensor_material") != j.end())
{
j.at("sensor_material").get_to(o.m_Sensor_material);
o.m_Sensor_materialIsSet = true;
}
if(j.find("tx_delay") != j.end())
{
j.at("tx_delay").get_to(o.m_Tx_delay);
o.m_Tx_delayIsSet = true;
}
if(j.find("base_data_ipv4_address") != j.end())
{
j.at("base_data_ipv4_address").get_to(o.m_Base_data_ipv4_address);
o.m_Base_data_ipv4_addressIsSet = true;
}
if(j.find("standard_geometry") != j.end())
{
j.at("standard_geometry").get_to(o.m_Standard_geometry);
o.m_Standard_geometryIsSet = true;
}
if(j.find("custom_geometry") != j.end())
{
j.at("custom_geometry").get_to(o.m_Custom_geometry);
o.m_Custom_geometryIsSet = true;
}
if(j.find("roi_mode") != j.end())
{
j.at("roi_mode").get_to(o.m_Roi_mode);
o.m_Roi_modeIsSet = true;
}
if(j.find("mirror_y") != j.end())
{
j.at("mirror_y").get_to(o.m_Mirror_y);
o.m_Mirror_yIsSet = true;
}
if(j.find("temp_thresold_degC") != j.end())
{
j.at("temp_thresold_degC").get_to(o.m_Temp_thresold_degC);
o.m_Temp_thresold_degCIsSet = true;
}
if(j.find("default_settings") != j.end())
{
j.at("default_settings").get_to(o.m_Default_settings);
o.m_Default_settingsIsSet = true;
}
}
std::string Detector::getDescription() const
{
return m_Description;
}
void Detector::setDescription(std::string const& value)
{
m_Description = value;
}
std::string Detector::getSerialNumber() const
{
return m_Serial_number;
}
void Detector::setSerialNumber(std::string const& value)
{
m_Serial_number = value;
m_Serial_numberIsSet = true;
}
bool Detector::serialNumberIsSet() const
{
return m_Serial_numberIsSet;
}
void Detector::unsetSerial_number()
{
m_Serial_numberIsSet = false;
}
org::openapitools::server::model::Detector_type Detector::getType() const
{
return m_Type;
}
void Detector::setType(org::openapitools::server::model::Detector_type const& value)
{
m_Type = value;
m_TypeIsSet = true;
}
bool Detector::typeIsSet() const
{
return m_TypeIsSet;
}
void Detector::unsetType()
{
m_TypeIsSet = false;
}
int64_t Detector::getHighVoltageV() const
{
return m_High_voltage_V;
}
void Detector::setHighVoltageV(int64_t const value)
{
m_High_voltage_V = value;
m_High_voltage_VIsSet = true;
}
bool Detector::highVoltageVIsSet() const
{
return m_High_voltage_VIsSet;
}
void Detector::unsetHigh_voltage_V()
{
m_High_voltage_VIsSet = false;
}
int64_t Detector::getUdpInterfaceCount() const
{
return m_Udp_interface_count;
}
void Detector::setUdpInterfaceCount(int64_t const value)
{
m_Udp_interface_count = value;
m_Udp_interface_countIsSet = true;
}
bool Detector::udpInterfaceCountIsSet() const
{
return m_Udp_interface_countIsSet;
}
void Detector::unsetUdp_interface_count()
{
m_Udp_interface_countIsSet = false;
}
bool Detector::isModuleSync() const
{
return m_Module_sync;
}
void Detector::setModuleSync(bool const value)
{
m_Module_sync = value;
m_Module_syncIsSet = true;
}
bool Detector::moduleSyncIsSet() const
{
return m_Module_syncIsSet;
}
void Detector::unsetModule_sync()
{
m_Module_syncIsSet = false;
}
float Detector::getSensorThicknessUm() const
{
return m_Sensor_thickness_um;
}
void Detector::setSensorThicknessUm(float const value)
{
m_Sensor_thickness_um = value;
m_Sensor_thickness_umIsSet = true;
}
bool Detector::sensorThicknessUmIsSet() const
{
return m_Sensor_thickness_umIsSet;
}
void Detector::unsetSensor_thickness_um()
{
m_Sensor_thickness_umIsSet = false;
}
int64_t Detector::getReadoutTimeUs() const
{
return m_Readout_time_us;
}
void Detector::setReadoutTimeUs(int64_t const value)
{
m_Readout_time_us = value;
m_Readout_time_usIsSet = true;
}
bool Detector::readoutTimeUsIsSet() const
{
return m_Readout_time_usIsSet;
}
void Detector::unsetReadout_time_us()
{
m_Readout_time_usIsSet = false;
}
int64_t Detector::getMinimumCountTimeUs() const
{
return m_Minimum_count_time_us;
}
void Detector::setMinimumCountTimeUs(int64_t const value)
{
m_Minimum_count_time_us = value;
m_Minimum_count_time_usIsSet = true;
}
bool Detector::minimumCountTimeUsIsSet() const
{
return m_Minimum_count_time_usIsSet;
}
void Detector::unsetMinimum_count_time_us()
{
m_Minimum_count_time_usIsSet = false;
}
int64_t Detector::getMinimumFrameTimeUs() const
{
return m_Minimum_frame_time_us;
}
void Detector::setMinimumFrameTimeUs(int64_t const value)
{
m_Minimum_frame_time_us = value;
m_Minimum_frame_time_usIsSet = true;
}
bool Detector::minimumFrameTimeUsIsSet() const
{
return m_Minimum_frame_time_usIsSet;
}
void Detector::unsetMinimum_frame_time_us()
{
m_Minimum_frame_time_usIsSet = false;
}
std::vector<std::string> Detector::getCalibrationFile() const
{
return m_Calibration_file;
}
void Detector::setCalibrationFile(std::vector<std::string> const& value)
{
m_Calibration_file = value;
m_Calibration_fileIsSet = true;
}
bool Detector::calibrationFileIsSet() const
{
return m_Calibration_fileIsSet;
}
void Detector::unsetCalibration_file()
{
m_Calibration_fileIsSet = false;
}
std::vector<std::string> Detector::getHostname() const
{
return m_Hostname;
}
void Detector::setHostname(std::vector<std::string> const& value)
{
m_Hostname = value;
m_HostnameIsSet = true;
}
bool Detector::hostnameIsSet() const
{
return m_HostnameIsSet;
}
void Detector::unsetHostname()
{
m_HostnameIsSet = false;
}
std::string Detector::getSensorMaterial() const
{
return m_Sensor_material;
}
void Detector::setSensorMaterial(std::string const& value)
{
m_Sensor_material = value;
m_Sensor_materialIsSet = true;
}
bool Detector::sensorMaterialIsSet() const
{
return m_Sensor_materialIsSet;
}
void Detector::unsetSensor_material()
{
m_Sensor_materialIsSet = false;
}
std::vector<int64_t> Detector::getTxDelay() const
{
return m_Tx_delay;
}
void Detector::setTxDelay(std::vector<int64_t> const value)
{
m_Tx_delay = value;
m_Tx_delayIsSet = true;
}
bool Detector::txDelayIsSet() const
{
return m_Tx_delayIsSet;
}
void Detector::unsetTx_delay()
{
m_Tx_delayIsSet = false;
}
std::string Detector::getBaseDataIpv4Address() const
{
return m_Base_data_ipv4_address;
}
void Detector::setBaseDataIpv4Address(std::string const& value)
{
m_Base_data_ipv4_address = value;
m_Base_data_ipv4_addressIsSet = true;
}
bool Detector::baseDataIpv4AddressIsSet() const
{
return m_Base_data_ipv4_addressIsSet;
}
void Detector::unsetBase_data_ipv4_address()
{
m_Base_data_ipv4_addressIsSet = false;
}
org::openapitools::server::model::Standard_detector_geometry Detector::getStandardGeometry() const
{
return m_Standard_geometry;
}
void Detector::setStandardGeometry(org::openapitools::server::model::Standard_detector_geometry const& value)
{
m_Standard_geometry = value;
m_Standard_geometryIsSet = true;
}
bool Detector::standardGeometryIsSet() const
{
return m_Standard_geometryIsSet;
}
void Detector::unsetStandard_geometry()
{
m_Standard_geometryIsSet = false;
}
std::vector<org::openapitools::server::model::Detector_module> Detector::getCustomGeometry() const
{
return m_Custom_geometry;
}
void Detector::setCustomGeometry(std::vector<org::openapitools::server::model::Detector_module> const& value)
{
m_Custom_geometry = value;
m_Custom_geometryIsSet = true;
}
bool Detector::customGeometryIsSet() const
{
return m_Custom_geometryIsSet;
}
void Detector::unsetCustom_geometry()
{
m_Custom_geometryIsSet = false;
}
std::string Detector::getRoiMode() const
{
return m_Roi_mode;
}
void Detector::setRoiMode(std::string const& value)
{
m_Roi_mode = value;
m_Roi_modeIsSet = true;
}
bool Detector::roiModeIsSet() const
{
return m_Roi_modeIsSet;
}
void Detector::unsetRoi_mode()
{
m_Roi_modeIsSet = false;
}
bool Detector::isMirrorY() const
{
return m_Mirror_y;
}
void Detector::setMirrorY(bool const value)
{
m_Mirror_y = value;
m_Mirror_yIsSet = true;
}
bool Detector::mirrorYIsSet() const
{
return m_Mirror_yIsSet;
}
void Detector::unsetMirror_y()
{
m_Mirror_yIsSet = false;
}
int64_t Detector::getTempThresoldDegC() const
{
return m_Temp_thresold_degC;
}
void Detector::setTempThresoldDegC(int64_t const value)
{
m_Temp_thresold_degC = value;
m_Temp_thresold_degCIsSet = true;
}
bool Detector::tempThresoldDegCIsSet() const
{
return m_Temp_thresold_degCIsSet;
}
void Detector::unsetTemp_thresold_degC()
{
m_Temp_thresold_degCIsSet = false;
}
org::openapitools::server::model::Detector_settings Detector::getDefaultSettings() const
{
return m_Default_settings;
}
void Detector::setDefaultSettings(org::openapitools::server::model::Detector_settings const& value)
{
m_Default_settings = value;
m_Default_settingsIsSet = true;
}
bool Detector::defaultSettingsIsSet() const
{
return m_Default_settingsIsSet;
}
void Detector::unsetDefault_settings()
{
m_Default_settingsIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,262 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector.h
*
*
*/
#ifndef Detector_H_
#define Detector_H_
#include "Detector_type.h"
#include <string>
#include "Detector_settings.h"
#include <vector>
#include "Standard_detector_geometry.h"
#include "Detector_module.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector
{
public:
Detector();
virtual ~Detector() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector& rhs) const;
bool operator!=(const Detector& rhs) const;
/////////////////////////////////////////////
/// Detector members
/// <summary>
///
/// </summary>
std::string getDescription() const;
void setDescription(std::string const& value);
/// <summary>
///
/// </summary>
std::string getSerialNumber() const;
void setSerialNumber(std::string const& value);
bool serialNumberIsSet() const;
void unsetSerial_number();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_type getType() const;
void setType(org::openapitools::server::model::Detector_type const& value);
bool typeIsSet() const;
void unsetType();
/// <summary>
///
/// </summary>
int64_t getHighVoltageV() const;
void setHighVoltageV(int64_t const value);
bool highVoltageVIsSet() const;
void unsetHigh_voltage_V();
/// <summary>
///
/// </summary>
int64_t getUdpInterfaceCount() const;
void setUdpInterfaceCount(int64_t const value);
bool udpInterfaceCountIsSet() const;
void unsetUdp_interface_count();
/// <summary>
/// Use module 0 as master for timing. Only applies to JUNGFRAU detector (this cannot be turned off for EIGER).
/// </summary>
bool isModuleSync() const;
void setModuleSync(bool const value);
bool moduleSyncIsSet() const;
void unsetModule_sync();
/// <summary>
///
/// </summary>
float getSensorThicknessUm() const;
void setSensorThicknessUm(float const value);
bool sensorThicknessUmIsSet() const;
void unsetSensor_thickness_um();
/// <summary>
/// Minimum difference between frame time and count time in microseconds Defaults are 3 us for EIGER and 20 us for JUNGFRAU
/// </summary>
int64_t getReadoutTimeUs() const;
void setReadoutTimeUs(int64_t const value);
bool readoutTimeUsIsSet() const;
void unsetReadout_time_us();
/// <summary>
/// Minimum count time available for the detector.
/// </summary>
int64_t getMinimumCountTimeUs() const;
void setMinimumCountTimeUs(int64_t const value);
bool minimumCountTimeUsIsSet() const;
void unsetMinimum_count_time_us();
/// <summary>
/// Minimum frame time available for the detector.
/// </summary>
int64_t getMinimumFrameTimeUs() const;
void setMinimumFrameTimeUs(int64_t const value);
bool minimumFrameTimeUsIsSet() const;
void unsetMinimum_frame_time_us();
/// <summary>
/// Can be empty for all detectors - default calibration used. For JUNGFRAU: list of gain files, one entry per module. For EIGER: one directory (with detector settings) or list of trim bit files, one entry per half-module.
/// </summary>
std::vector<std::string> getCalibrationFile() const;
void setCalibrationFile(std::vector<std::string> const& value);
bool calibrationFileIsSet() const;
void unsetCalibration_file();
/// <summary>
/// Hostname for detector module. One entry per module One entry per module. Either empty or number of module entries.
/// </summary>
std::vector<std::string> getHostname() const;
void setHostname(std::vector<std::string> const& value);
bool hostnameIsSet() const;
void unsetHostname();
/// <summary>
///
/// </summary>
std::string getSensorMaterial() const;
void setSensorMaterial(std::string const& value);
bool sensorMaterialIsSet() const;
void unsetSensor_material();
/// <summary>
///
/// </summary>
std::vector<int64_t> getTxDelay() const;
void setTxDelay(std::vector<int64_t> const value);
bool txDelayIsSet() const;
void unsetTx_delay();
/// <summary>
///
/// </summary>
std::string getBaseDataIpv4Address() const;
void setBaseDataIpv4Address(std::string const& value);
bool baseDataIpv4AddressIsSet() const;
void unsetBase_data_ipv4_address();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Standard_detector_geometry getStandardGeometry() const;
void setStandardGeometry(org::openapitools::server::model::Standard_detector_geometry const& value);
bool standardGeometryIsSet() const;
void unsetStandard_geometry();
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Detector_module> getCustomGeometry() const;
void setCustomGeometry(std::vector<org::openapitools::server::model::Detector_module> const& value);
bool customGeometryIsSet() const;
void unsetCustom_geometry();
/// <summary>
/// ROI setting for DECTRIS detectors
/// </summary>
std::string getRoiMode() const;
void setRoiMode(std::string const& value);
bool roiModeIsSet() const;
void unsetRoi_mode();
/// <summary>
/// Mirror detector in Y direction to account for MX convention of (0,0) point in top left corner
/// </summary>
bool isMirrorY() const;
void setMirrorY(bool const value);
bool mirrorYIsSet() const;
void unsetMirror_y();
/// <summary>
/// Temperature threshold for JUNGFRAU detector modules
/// </summary>
int64_t getTempThresoldDegC() const;
void setTempThresoldDegC(int64_t const value);
bool tempThresoldDegCIsSet() const;
void unsetTemp_thresold_degC();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_settings getDefaultSettings() const;
void setDefaultSettings(org::openapitools::server::model::Detector_settings const& value);
bool defaultSettingsIsSet() const;
void unsetDefault_settings();
friend void to_json(nlohmann::json& j, const Detector& o);
friend void from_json(const nlohmann::json& j, Detector& o);
protected:
std::string m_Description;
std::string m_Serial_number;
bool m_Serial_numberIsSet;
org::openapitools::server::model::Detector_type m_Type;
bool m_TypeIsSet;
int64_t m_High_voltage_V;
bool m_High_voltage_VIsSet;
int64_t m_Udp_interface_count;
bool m_Udp_interface_countIsSet;
bool m_Module_sync;
bool m_Module_syncIsSet;
float m_Sensor_thickness_um;
bool m_Sensor_thickness_umIsSet;
int64_t m_Readout_time_us;
bool m_Readout_time_usIsSet;
int64_t m_Minimum_count_time_us;
bool m_Minimum_count_time_usIsSet;
int64_t m_Minimum_frame_time_us;
bool m_Minimum_frame_time_usIsSet;
std::vector<std::string> m_Calibration_file;
bool m_Calibration_fileIsSet;
std::vector<std::string> m_Hostname;
bool m_HostnameIsSet;
std::string m_Sensor_material;
bool m_Sensor_materialIsSet;
std::vector<int64_t> m_Tx_delay;
bool m_Tx_delayIsSet;
std::string m_Base_data_ipv4_address;
bool m_Base_data_ipv4_addressIsSet;
org::openapitools::server::model::Standard_detector_geometry m_Standard_geometry;
bool m_Standard_geometryIsSet;
std::vector<org::openapitools::server::model::Detector_module> m_Custom_geometry;
bool m_Custom_geometryIsSet;
std::string m_Roi_mode;
bool m_Roi_modeIsSet;
bool m_Mirror_y;
bool m_Mirror_yIsSet;
int64_t m_Temp_thresold_degC;
bool m_Temp_thresold_degCIsSet;
org::openapitools::server::model::Detector_settings m_Default_settings;
bool m_Default_settingsIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Detector_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -47,14 +47,14 @@ bool Detector_list::validate(std::stringstream& msg, const std::string& pathPref
/* Detectors */ {
const std::vector<org::openapitools::server::model::Detector_list_element>& value = m_Detectors;
const std::vector<org::openapitools::server::model::Detector_list_detectors_inner>& value = m_Detectors;
const std::string currentValuePath = _pathPrefix + ".detectors";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Detector_list_element& value : value)
for (const org::openapitools::server::model::Detector_list_detectors_inner& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
@@ -90,7 +90,7 @@ bool Detector_list::operator!=(const Detector_list& rhs) const
void to_json(nlohmann::json& j, const Detector_list& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["detectors"] = o.m_Detectors;
j["current_id"] = o.m_Current_id;
@@ -103,11 +103,11 @@ void from_json(const nlohmann::json& j, Detector_list& o)
}
std::vector<org::openapitools::server::model::Detector_list_element> Detector_list::getDetectors() const
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> Detector_list::getDetectors() const
{
return m_Detectors;
}
void Detector_list::setDetectors(std::vector<org::openapitools::server::model::Detector_list_element> const& value)
void Detector_list::setDetectors(std::vector<org::openapitools::server::model::Detector_list_detectors_inner> const& value)
{
m_Detectors = value;
}

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -19,7 +19,7 @@
#define Detector_list_H_
#include "Detector_list_element.h"
#include "Detector_list_detectors_inner.h"
#include <vector>
#include <nlohmann/json.hpp>
@@ -62,18 +62,18 @@ public:
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Detector_list_element> getDetectors() const;
void setDetectors(std::vector<org::openapitools::server::model::Detector_list_element> const& value);
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> getDetectors() const;
void setDetectors(std::vector<org::openapitools::server::model::Detector_list_detectors_inner> const& value);
/// <summary>
///
/// </summary>
int64_t getCurrentId() const;
void setCurrentId(int64_t const value);
friend void to_json(nlohmann::json& j, const Detector_list& o);
friend void from_json(const nlohmann::json& j, Detector_list& o);
friend void to_json(nlohmann::json& j, const Detector_list& o);
friend void from_json(const nlohmann::json& j, Detector_list& o);
protected:
std::vector<org::openapitools::server::model::Detector_list_element> m_Detectors;
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> m_Detectors;
int64_t m_Current_id;

View File

@@ -0,0 +1,161 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_list_detectors_inner.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Detector_list_detectors_inner::Detector_list_detectors_inner()
{
m_Id = 0L;
m_Description = "";
m_Nmodules = 0L;
m_Width = 0L;
m_Height = 0L;
}
void Detector_list_detectors_inner::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_list_detectors_inner::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_list_detectors_inner::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_list_detectors_inner" : pathPrefix;
/* Id */ {
const int64_t& value = m_Id;
const std::string currentValuePath = _pathPrefix + ".id";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
bool Detector_list_detectors_inner::operator==(const Detector_list_detectors_inner& rhs) const
{
return
(getId() == rhs.getId())
&&
(getDescription() == rhs.getDescription())
&&
(getNmodules() == rhs.getNmodules())
&&
(getWidth() == rhs.getWidth())
&&
(getHeight() == rhs.getHeight())
;
}
bool Detector_list_detectors_inner::operator!=(const Detector_list_detectors_inner& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o)
{
j = nlohmann::json();
j["id"] = o.m_Id;
j["description"] = o.m_Description;
j["nmodules"] = o.m_Nmodules;
j["width"] = o.m_Width;
j["height"] = o.m_Height;
}
void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o)
{
j.at("id").get_to(o.m_Id);
j.at("description").get_to(o.m_Description);
j.at("nmodules").get_to(o.m_Nmodules);
j.at("width").get_to(o.m_Width);
j.at("height").get_to(o.m_Height);
}
int64_t Detector_list_detectors_inner::getId() const
{
return m_Id;
}
void Detector_list_detectors_inner::setId(int64_t const value)
{
m_Id = value;
}
std::string Detector_list_detectors_inner::getDescription() const
{
return m_Description;
}
void Detector_list_detectors_inner::setDescription(std::string const& value)
{
m_Description = value;
}
int64_t Detector_list_detectors_inner::getNmodules() const
{
return m_Nmodules;
}
void Detector_list_detectors_inner::setNmodules(int64_t const value)
{
m_Nmodules = value;
}
int64_t Detector_list_detectors_inner::getWidth() const
{
return m_Width;
}
void Detector_list_detectors_inner::setWidth(int64_t const value)
{
m_Width = value;
}
int64_t Detector_list_detectors_inner::getHeight() const
{
return m_Height;
}
void Detector_list_detectors_inner::setHeight(int64_t const value)
{
m_Height = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,105 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_list_detectors_inner.h
*
*
*/
#ifndef Detector_list_detectors_inner_H_
#define Detector_list_detectors_inner_H_
#include <string>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_list_detectors_inner
{
public:
Detector_list_detectors_inner();
virtual ~Detector_list_detectors_inner() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_list_detectors_inner& rhs) const;
bool operator!=(const Detector_list_detectors_inner& rhs) const;
/////////////////////////////////////////////
/// Detector_list_detectors_inner members
/// <summary>
///
/// </summary>
int64_t getId() const;
void setId(int64_t const value);
/// <summary>
///
/// </summary>
std::string getDescription() const;
void setDescription(std::string const& value);
/// <summary>
///
/// </summary>
int64_t getNmodules() const;
void setNmodules(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getWidth() const;
void setWidth(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getHeight() const;
void setHeight(int64_t const value);
friend void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o);
friend void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o);
protected:
int64_t m_Id;
std::string m_Description;
int64_t m_Nmodules;
int64_t m_Width;
int64_t m_Height;
};
} // namespace org::openapitools::server::model
#endif /* Detector_list_detectors_inner_H_ */

View File

@@ -1,302 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_list_element.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Detector_list_element::Detector_list_element()
{
m_Id = 0L;
m_Description = "";
m_Serial_number = "";
m_Base_ipv4_addr = "";
m_Udp_interface_count = 0L;
m_Nmodules = 0L;
m_Width = 0L;
m_Height = 0L;
m_Pixel_size_mm = 0.0f;
m_Pixel_size_mmIsSet = false;
m_Readout_time_us = 0L;
m_Min_frame_time_us = 0L;
m_Min_count_time_us = 0L;
m_TypeIsSet = false;
}
void Detector_list_element::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_list_element::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_list_element::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_list_element" : pathPrefix;
/* Id */ {
const int64_t& value = m_Id;
const std::string currentValuePath = _pathPrefix + ".id";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
bool Detector_list_element::operator==(const Detector_list_element& rhs) const
{
return
(getId() == rhs.getId())
&&
(getDescription() == rhs.getDescription())
&&
(getSerialNumber() == rhs.getSerialNumber())
&&
(getBaseIpv4Addr() == rhs.getBaseIpv4Addr())
&&
(getUdpInterfaceCount() == rhs.getUdpInterfaceCount())
&&
(getNmodules() == rhs.getNmodules())
&&
(getWidth() == rhs.getWidth())
&&
(getHeight() == rhs.getHeight())
&&
((!pixelSizeMmIsSet() && !rhs.pixelSizeMmIsSet()) || (pixelSizeMmIsSet() && rhs.pixelSizeMmIsSet() && getPixelSizeMm() == rhs.getPixelSizeMm())) &&
(getReadoutTimeUs() == rhs.getReadoutTimeUs())
&&
(getMinFrameTimeUs() == rhs.getMinFrameTimeUs())
&&
(getMinCountTimeUs() == rhs.getMinCountTimeUs())
&&
((!typeIsSet() && !rhs.typeIsSet()) || (typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType()))
;
}
bool Detector_list_element::operator!=(const Detector_list_element& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_list_element& o)
{
j = nlohmann::json::object();
j["id"] = o.m_Id;
j["description"] = o.m_Description;
j["serial_number"] = o.m_Serial_number;
j["base_ipv4_addr"] = o.m_Base_ipv4_addr;
j["udp_interface_count"] = o.m_Udp_interface_count;
j["nmodules"] = o.m_Nmodules;
j["width"] = o.m_Width;
j["height"] = o.m_Height;
if(o.pixelSizeMmIsSet())
j["pixel_size_mm"] = o.m_Pixel_size_mm;
j["readout_time_us"] = o.m_Readout_time_us;
j["min_frame_time_us"] = o.m_Min_frame_time_us;
j["min_count_time_us"] = o.m_Min_count_time_us;
if(o.typeIsSet())
j["type"] = o.m_Type;
}
void from_json(const nlohmann::json& j, Detector_list_element& o)
{
j.at("id").get_to(o.m_Id);
j.at("description").get_to(o.m_Description);
j.at("serial_number").get_to(o.m_Serial_number);
j.at("base_ipv4_addr").get_to(o.m_Base_ipv4_addr);
j.at("udp_interface_count").get_to(o.m_Udp_interface_count);
j.at("nmodules").get_to(o.m_Nmodules);
j.at("width").get_to(o.m_Width);
j.at("height").get_to(o.m_Height);
if(j.find("pixel_size_mm") != j.end())
{
j.at("pixel_size_mm").get_to(o.m_Pixel_size_mm);
o.m_Pixel_size_mmIsSet = true;
}
j.at("readout_time_us").get_to(o.m_Readout_time_us);
j.at("min_frame_time_us").get_to(o.m_Min_frame_time_us);
j.at("min_count_time_us").get_to(o.m_Min_count_time_us);
if(j.find("type") != j.end())
{
j.at("type").get_to(o.m_Type);
o.m_TypeIsSet = true;
}
}
int64_t Detector_list_element::getId() const
{
return m_Id;
}
void Detector_list_element::setId(int64_t const value)
{
m_Id = value;
}
std::string Detector_list_element::getDescription() const
{
return m_Description;
}
void Detector_list_element::setDescription(std::string const& value)
{
m_Description = value;
}
std::string Detector_list_element::getSerialNumber() const
{
return m_Serial_number;
}
void Detector_list_element::setSerialNumber(std::string const& value)
{
m_Serial_number = value;
}
std::string Detector_list_element::getBaseIpv4Addr() const
{
return m_Base_ipv4_addr;
}
void Detector_list_element::setBaseIpv4Addr(std::string const& value)
{
m_Base_ipv4_addr = value;
}
int64_t Detector_list_element::getUdpInterfaceCount() const
{
return m_Udp_interface_count;
}
void Detector_list_element::setUdpInterfaceCount(int64_t const value)
{
m_Udp_interface_count = value;
}
int64_t Detector_list_element::getNmodules() const
{
return m_Nmodules;
}
void Detector_list_element::setNmodules(int64_t const value)
{
m_Nmodules = value;
}
int64_t Detector_list_element::getWidth() const
{
return m_Width;
}
void Detector_list_element::setWidth(int64_t const value)
{
m_Width = value;
}
int64_t Detector_list_element::getHeight() const
{
return m_Height;
}
void Detector_list_element::setHeight(int64_t const value)
{
m_Height = value;
}
float Detector_list_element::getPixelSizeMm() const
{
return m_Pixel_size_mm;
}
void Detector_list_element::setPixelSizeMm(float const value)
{
m_Pixel_size_mm = value;
m_Pixel_size_mmIsSet = true;
}
bool Detector_list_element::pixelSizeMmIsSet() const
{
return m_Pixel_size_mmIsSet;
}
void Detector_list_element::unsetPixel_size_mm()
{
m_Pixel_size_mmIsSet = false;
}
int64_t Detector_list_element::getReadoutTimeUs() const
{
return m_Readout_time_us;
}
void Detector_list_element::setReadoutTimeUs(int64_t const value)
{
m_Readout_time_us = value;
}
int64_t Detector_list_element::getMinFrameTimeUs() const
{
return m_Min_frame_time_us;
}
void Detector_list_element::setMinFrameTimeUs(int64_t const value)
{
m_Min_frame_time_us = value;
}
int64_t Detector_list_element::getMinCountTimeUs() const
{
return m_Min_count_time_us;
}
void Detector_list_element::setMinCountTimeUs(int64_t const value)
{
m_Min_count_time_us = value;
}
org::openapitools::server::model::Detector_type Detector_list_element::getType() const
{
return m_Type;
}
void Detector_list_element::setType(org::openapitools::server::model::Detector_type const& value)
{
m_Type = value;
m_TypeIsSet = true;
}
bool Detector_list_element::typeIsSet() const
{
return m_TypeIsSet;
}
void Detector_list_element::unsetType()
{
m_TypeIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,166 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_list_element.h
*
*
*/
#ifndef Detector_list_element_H_
#define Detector_list_element_H_
#include "Detector_type.h"
#include <string>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_list_element
{
public:
Detector_list_element();
virtual ~Detector_list_element() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_list_element& rhs) const;
bool operator!=(const Detector_list_element& rhs) const;
/////////////////////////////////////////////
/// Detector_list_element members
/// <summary>
///
/// </summary>
int64_t getId() const;
void setId(int64_t const value);
/// <summary>
///
/// </summary>
std::string getDescription() const;
void setDescription(std::string const& value);
/// <summary>
///
/// </summary>
std::string getSerialNumber() const;
void setSerialNumber(std::string const& value);
/// <summary>
///
/// </summary>
std::string getBaseIpv4Addr() const;
void setBaseIpv4Addr(std::string const& value);
/// <summary>
/// Number of UDP interfaces per detector module
/// </summary>
int64_t getUdpInterfaceCount() const;
void setUdpInterfaceCount(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getNmodules() const;
void setNmodules(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getWidth() const;
void setWidth(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getHeight() const;
void setHeight(int64_t const value);
/// <summary>
///
/// </summary>
float getPixelSizeMm() const;
void setPixelSizeMm(float const value);
bool pixelSizeMmIsSet() const;
void unsetPixel_size_mm();
/// <summary>
///
/// </summary>
int64_t getReadoutTimeUs() const;
void setReadoutTimeUs(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getMinFrameTimeUs() const;
void setMinFrameTimeUs(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getMinCountTimeUs() const;
void setMinCountTimeUs(int64_t const value);
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_type getType() const;
void setType(org::openapitools::server::model::Detector_type const& value);
bool typeIsSet() const;
void unsetType();
friend void to_json(nlohmann::json& j, const Detector_list_element& o);
friend void from_json(const nlohmann::json& j, Detector_list_element& o);
protected:
int64_t m_Id;
std::string m_Description;
std::string m_Serial_number;
std::string m_Base_ipv4_addr;
int64_t m_Udp_interface_count;
int64_t m_Nmodules;
int64_t m_Width;
int64_t m_Height;
float m_Pixel_size_mm;
bool m_Pixel_size_mmIsSet;
int64_t m_Readout_time_us;
int64_t m_Min_frame_time_us;
int64_t m_Min_count_time_us;
org::openapitools::server::model::Detector_type m_Type;
bool m_TypeIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Detector_list_element_H_ */

View File

@@ -1,131 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_module.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Detector_module::Detector_module()
{
m_X0 = 0.0;
m_Y0 = 0.0;
}
void Detector_module::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_module::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_module::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_module" : pathPrefix;
return success;
}
bool Detector_module::operator==(const Detector_module& rhs) const
{
return
(getX0() == rhs.getX0())
&&
(getY0() == rhs.getY0())
&&
(getFastAxis() == rhs.getFastAxis())
&&
(getSlowAxis() == rhs.getSlowAxis())
;
}
bool Detector_module::operator!=(const Detector_module& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_module& o)
{
j = nlohmann::json::object();
j["x0"] = o.m_X0;
j["y0"] = o.m_Y0;
j["fast_axis"] = o.m_Fast_axis;
j["slow_axis"] = o.m_Slow_axis;
}
void from_json(const nlohmann::json& j, Detector_module& o)
{
j.at("x0").get_to(o.m_X0);
j.at("y0").get_to(o.m_Y0);
j.at("fast_axis").get_to(o.m_Fast_axis);
j.at("slow_axis").get_to(o.m_Slow_axis);
}
double Detector_module::getX0() const
{
return m_X0;
}
void Detector_module::setX0(double const value)
{
m_X0 = value;
}
double Detector_module::getY0() const
{
return m_Y0;
}
void Detector_module::setY0(double const value)
{
m_Y0 = value;
}
org::openapitools::server::model::Detector_module_direction Detector_module::getFastAxis() const
{
return m_Fast_axis;
}
void Detector_module::setFastAxis(org::openapitools::server::model::Detector_module_direction const& value)
{
m_Fast_axis = value;
}
org::openapitools::server::model::Detector_module_direction Detector_module::getSlowAxis() const
{
return m_Slow_axis;
}
void Detector_module::setSlowAxis(org::openapitools::server::model::Detector_module_direction const& value)
{
m_Slow_axis = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,98 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_module.h
*
*
*/
#ifndef Detector_module_H_
#define Detector_module_H_
#include "Detector_module_direction.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_module
{
public:
Detector_module();
virtual ~Detector_module() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_module& rhs) const;
bool operator!=(const Detector_module& rhs) const;
/////////////////////////////////////////////
/// Detector_module members
/// <summary>
///
/// </summary>
double getX0() const;
void setX0(double const value);
/// <summary>
///
/// </summary>
double getY0() const;
void setY0(double const value);
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_module_direction getFastAxis() const;
void setFastAxis(org::openapitools::server::model::Detector_module_direction const& value);
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_module_direction getSlowAxis() const;
void setSlowAxis(org::openapitools::server::model::Detector_module_direction const& value);
friend void to_json(nlohmann::json& j, const Detector_module& o);
friend void from_json(const nlohmann::json& j, Detector_module& o);
protected:
double m_X0;
double m_Y0;
org::openapitools::server::model::Detector_module_direction m_Fast_axis;
org::openapitools::server::model::Detector_module_direction m_Slow_axis;
};
} // namespace org::openapitools::server::model
#endif /* Detector_module_H_ */

View File

@@ -1,128 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_module_direction.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Detector_module_direction::Detector_module_direction()
{
}
void Detector_module_direction::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_module_direction::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_module_direction::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_module_direction" : pathPrefix;
if (m_value == Detector_module_direction::eDetector_module_direction::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Detector_module_direction::operator==(const Detector_module_direction& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Detector_module_direction::operator!=(const Detector_module_direction& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_module_direction& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Detector_module_direction::eDetector_module_direction::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Detector_module_direction::eDetector_module_direction::XP:
j = "Xp";
break;
case Detector_module_direction::eDetector_module_direction::XN:
j = "Xn";
break;
case Detector_module_direction::eDetector_module_direction::YP:
j = "Yp";
break;
case Detector_module_direction::eDetector_module_direction::YN:
j = "Yn";
break;
}
}
void from_json(const nlohmann::json& j, Detector_module_direction& o)
{
auto s = j.get<std::string>();
if (s == "Xp") {
o.setValue(Detector_module_direction::eDetector_module_direction::XP);
}
else if (s == "Xn") {
o.setValue(Detector_module_direction::eDetector_module_direction::XN);
}
else if (s == "Yp") {
o.setValue(Detector_module_direction::eDetector_module_direction::YP);
}
else if (s == "Yn") {
o.setValue(Detector_module_direction::eDetector_module_direction::YN);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Detector_module_direction::eDetector_module_direction";
throw std::invalid_argument(ss.str());
}
}
Detector_module_direction::eDetector_module_direction Detector_module_direction::getValue() const
{
return m_value;
}
void Detector_module_direction::setValue(Detector_module_direction::eDetector_module_direction value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,81 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_module_direction.h
*
*
*/
#ifndef Detector_module_direction_H_
#define Detector_module_direction_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_module_direction
{
public:
Detector_module_direction();
virtual ~Detector_module_direction() = default;
enum class eDetector_module_direction {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
XP,
XN,
YP,
YN
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_module_direction& rhs) const;
bool operator!=(const Detector_module_direction& rhs) const;
/////////////////////////////////////////////
/// Detector_module_direction members
Detector_module_direction::eDetector_module_direction getValue() const;
void setValue(Detector_module_direction::eDetector_module_direction value);
friend void to_json(nlohmann::json& j, const Detector_module_direction& o);
friend void from_json(const nlohmann::json& j, Detector_module_direction& o);
protected:
Detector_module_direction::eDetector_module_direction m_value = Detector_module_direction::eDetector_module_direction::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Detector_module_direction_H_ */

View File

@@ -1,122 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_power_state.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Detector_power_state::Detector_power_state()
{
}
void Detector_power_state::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_power_state::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_power_state::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_power_state" : pathPrefix;
if (m_value == Detector_power_state::eDetector_power_state::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Detector_power_state::operator==(const Detector_power_state& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Detector_power_state::operator!=(const Detector_power_state& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_power_state& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Detector_power_state::eDetector_power_state::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Detector_power_state::eDetector_power_state::POWERON:
j = "PowerOn";
break;
case Detector_power_state::eDetector_power_state::POWEROFF:
j = "PowerOff";
break;
case Detector_power_state::eDetector_power_state::PARTIAL:
j = "Partial";
break;
}
}
void from_json(const nlohmann::json& j, Detector_power_state& o)
{
auto s = j.get<std::string>();
if (s == "PowerOn") {
o.setValue(Detector_power_state::eDetector_power_state::POWERON);
}
else if (s == "PowerOff") {
o.setValue(Detector_power_state::eDetector_power_state::POWEROFF);
}
else if (s == "Partial") {
o.setValue(Detector_power_state::eDetector_power_state::PARTIAL);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Detector_power_state::eDetector_power_state";
throw std::invalid_argument(ss.str());
}
}
Detector_power_state::eDetector_power_state Detector_power_state::getValue() const
{
return m_value;
}
void Detector_power_state::setValue(Detector_power_state::eDetector_power_state value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,80 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_power_state.h
*
* Power on of ASICs
*/
#ifndef Detector_power_state_H_
#define Detector_power_state_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Power on of ASICs
/// </summary>
class Detector_power_state
{
public:
Detector_power_state();
virtual ~Detector_power_state() = default;
enum class eDetector_power_state {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
POWERON,
POWEROFF,
PARTIAL
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_power_state& rhs) const;
bool operator!=(const Detector_power_state& rhs) const;
/////////////////////////////////////////////
/// Detector_power_state members
Detector_power_state::eDetector_power_state getValue() const;
void setValue(Detector_power_state::eDetector_power_state value);
friend void to_json(nlohmann::json& j, const Detector_power_state& o);
friend void from_json(const nlohmann::json& j, Detector_power_state& o);
protected:
Detector_power_state::eDetector_power_state m_value = Detector_power_state::eDetector_power_state::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Detector_power_state_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -66,7 +66,7 @@ bool Detector_selection::operator!=(const Detector_selection& rhs) const
void to_json(nlohmann::json& j, const Detector_selection& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["id"] = o.m_Id;
}

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -63,8 +63,8 @@ public:
int64_t getId() const;
void setId(int64_t const value);
friend void to_json(nlohmann::json& j, const Detector_selection& o);
friend void from_json(const nlohmann::json& j, Detector_selection& o);
friend void to_json(nlohmann::json& j, const Detector_selection& o);
friend void from_json(const nlohmann::json& j, Detector_selection& o);
protected:
int64_t m_Id;

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -24,33 +24,28 @@ Detector_settings::Detector_settings()
m_Frame_time_us = 0L;
m_Count_time_us = 0L;
m_Count_time_usIsSet = false;
m_Storage_cell_count = 1L;
m_Storage_cell_countIsSet = false;
m_Internal_frame_generator = false;
m_Internal_frame_generatorIsSet = false;
m_Internal_frame_generator_images = 1L;
m_Internal_frame_generator_imagesIsSet = false;
m_Detector_trigger_delay_ns = 0L;
m_Detector_trigger_delay_nsIsSet = false;
m_TimingIsSet = false;
m_Eiger_threshold_keV = 0.0f;
m_Eiger_threshold_keVIsSet = false;
m_Eiger_bit_depth = 0L;
m_Eiger_bit_depthIsSet = false;
m_Jungfrau_pedestal_g0_frames = 2000L;
m_Jungfrau_pedestal_g0_framesIsSet = false;
m_Jungfrau_pedestal_g1_frames = 300L;
m_Jungfrau_pedestal_g1_framesIsSet = false;
m_Jungfrau_pedestal_g2_frames = 300L;
m_Jungfrau_pedestal_g2_framesIsSet = false;
m_Jungfrau_pedestal_min_image_count = 128L;
m_Jungfrau_pedestal_min_image_countIsSet = false;
m_Jungfrau_storage_cell_count = 1L;
m_Jungfrau_storage_cell_countIsSet = false;
m_Jungfrau_storage_cell_delay_ns = 5000L;
m_Jungfrau_storage_cell_delay_nsIsSet = false;
m_Jungfrau_fixed_gain_g1 = false;
m_Jungfrau_fixed_gain_g1IsSet = false;
m_Jungfrau_use_gain_hg0 = false;
m_Jungfrau_use_gain_hg0IsSet = false;
m_Collect_raw_data = false;
m_Collect_raw_dataIsSet = false;
m_Pedestal_g0_frames = 0L;
m_Pedestal_g0_framesIsSet = false;
m_Pedestal_g1_frames = 0L;
m_Pedestal_g1_framesIsSet = false;
m_Pedestal_g2_frames = 0L;
m_Pedestal_g2_framesIsSet = false;
m_Storage_cell_delay_us = 0.0f;
m_Storage_cell_delay_usIsSet = false;
m_Detector_trigger_delay_us = 0.0f;
m_Detector_trigger_delay_usIsSet = false;
m_Fixed_gain_g1 = false;
m_Fixed_gain_g1IsSet = false;
m_Use_gain_hg0 = false;
m_Use_gain_hg0IsSet = false;
}
@@ -80,126 +75,18 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
const std::string currentValuePath = _pathPrefix + ".frameTimeUs";
if (value < 1ll)
if (value < 450ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
if (internalFrameGeneratorImagesIsSet())
{
const int64_t& value = m_Internal_frame_generator_images;
const std::string currentValuePath = _pathPrefix + ".internalFrameGeneratorImages";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 64ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 64;";
}
}
if (detectorTriggerDelayNsIsSet())
{
const int64_t& value = m_Detector_trigger_delay_ns;
const std::string currentValuePath = _pathPrefix + ".detectorTriggerDelayNs";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
msg << currentValuePath << ": must be greater than or equal to 450;";
}
}
if (eigerThresholdKeVIsSet())
if (storageCellCountIsSet())
{
const float& value = m_Eiger_threshold_keV;
const std::string currentValuePath = _pathPrefix + ".eigerThresholdKeV";
if (value < static_cast<float>(1.0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1.0;";
}
if (value > static_cast<float>(100.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 100.0;";
}
}
if (jungfrauPedestalG0FramesIsSet())
{
const int64_t& value = m_Jungfrau_pedestal_g0_frames;
const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalG0Frames";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (jungfrauPedestalG1FramesIsSet())
{
const int64_t& value = m_Jungfrau_pedestal_g1_frames;
const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalG1Frames";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (jungfrauPedestalG2FramesIsSet())
{
const int64_t& value = m_Jungfrau_pedestal_g2_frames;
const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalG2Frames";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (jungfrauPedestalMinImageCountIsSet())
{
const int64_t& value = m_Jungfrau_pedestal_min_image_count;
const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalMinImageCount";
if (value < 32ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 32;";
}
}
if (jungfrauStorageCellCountIsSet())
{
const int64_t& value = m_Jungfrau_storage_cell_count;
const std::string currentValuePath = _pathPrefix + ".jungfrauStorageCellCount";
const int64_t& value = m_Storage_cell_count;
const std::string currentValuePath = _pathPrefix + ".storageCellCount";
if (value < 1ll)
@@ -214,21 +101,68 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
}
}
if (jungfrauStorageCellDelayNsIsSet())
if (internalFrameGeneratorImagesIsSet())
{
const int64_t& value = m_Jungfrau_storage_cell_delay_ns;
const std::string currentValuePath = _pathPrefix + ".jungfrauStorageCellDelayNs";
const int64_t& value = m_Internal_frame_generator_images;
const std::string currentValuePath = _pathPrefix + ".internalFrameGeneratorImages";
if (value < 2100ll)
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 2100;";
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 128ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 128;";
}
}
if (pedestalG0FramesIsSet())
{
const int64_t& value = m_Pedestal_g0_frames;
const std::string currentValuePath = _pathPrefix + ".pedestalG0Frames";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (pedestalG1FramesIsSet())
{
const int64_t& value = m_Pedestal_g1_frames;
const std::string currentValuePath = _pathPrefix + ".pedestalG1Frames";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (pedestalG2FramesIsSet())
{
const int64_t& value = m_Pedestal_g2_frames;
const std::string currentValuePath = _pathPrefix + ".pedestalG2Frames";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
@@ -244,46 +178,37 @@ bool Detector_settings::operator==(const Detector_settings& rhs) const
((!countTimeUsIsSet() && !rhs.countTimeUsIsSet()) || (countTimeUsIsSet() && rhs.countTimeUsIsSet() && getCountTimeUs() == rhs.getCountTimeUs())) &&
((!storageCellCountIsSet() && !rhs.storageCellCountIsSet()) || (storageCellCountIsSet() && rhs.storageCellCountIsSet() && getStorageCellCount() == rhs.getStorageCellCount())) &&
((!internalFrameGeneratorIsSet() && !rhs.internalFrameGeneratorIsSet()) || (internalFrameGeneratorIsSet() && rhs.internalFrameGeneratorIsSet() && isInternalFrameGenerator() == rhs.isInternalFrameGenerator())) &&
((!internalFrameGeneratorImagesIsSet() && !rhs.internalFrameGeneratorImagesIsSet()) || (internalFrameGeneratorImagesIsSet() && rhs.internalFrameGeneratorImagesIsSet() && getInternalFrameGeneratorImages() == rhs.getInternalFrameGeneratorImages())) &&
((!detectorTriggerDelayNsIsSet() && !rhs.detectorTriggerDelayNsIsSet()) || (detectorTriggerDelayNsIsSet() && rhs.detectorTriggerDelayNsIsSet() && getDetectorTriggerDelayNs() == rhs.getDetectorTriggerDelayNs())) &&
((!collectRawDataIsSet() && !rhs.collectRawDataIsSet()) || (collectRawDataIsSet() && rhs.collectRawDataIsSet() && isCollectRawData() == rhs.isCollectRawData())) &&
((!timingIsSet() && !rhs.timingIsSet()) || (timingIsSet() && rhs.timingIsSet() && getTiming() == rhs.getTiming())) &&
((!pedestalG0FramesIsSet() && !rhs.pedestalG0FramesIsSet()) || (pedestalG0FramesIsSet() && rhs.pedestalG0FramesIsSet() && getPedestalG0Frames() == rhs.getPedestalG0Frames())) &&
((!eigerThresholdKeVIsSet() && !rhs.eigerThresholdKeVIsSet()) || (eigerThresholdKeVIsSet() && rhs.eigerThresholdKeVIsSet() && getEigerThresholdKeV() == rhs.getEigerThresholdKeV())) &&
((!pedestalG1FramesIsSet() && !rhs.pedestalG1FramesIsSet()) || (pedestalG1FramesIsSet() && rhs.pedestalG1FramesIsSet() && getPedestalG1Frames() == rhs.getPedestalG1Frames())) &&
((!eigerBitDepthIsSet() && !rhs.eigerBitDepthIsSet()) || (eigerBitDepthIsSet() && rhs.eigerBitDepthIsSet() && getEigerBitDepth() == rhs.getEigerBitDepth())) &&
((!pedestalG2FramesIsSet() && !rhs.pedestalG2FramesIsSet()) || (pedestalG2FramesIsSet() && rhs.pedestalG2FramesIsSet() && getPedestalG2Frames() == rhs.getPedestalG2Frames())) &&
((!jungfrauPedestalG0FramesIsSet() && !rhs.jungfrauPedestalG0FramesIsSet()) || (jungfrauPedestalG0FramesIsSet() && rhs.jungfrauPedestalG0FramesIsSet() && getJungfrauPedestalG0Frames() == rhs.getJungfrauPedestalG0Frames())) &&
((!storageCellDelayUsIsSet() && !rhs.storageCellDelayUsIsSet()) || (storageCellDelayUsIsSet() && rhs.storageCellDelayUsIsSet() && getStorageCellDelayUs() == rhs.getStorageCellDelayUs())) &&
((!jungfrauPedestalG1FramesIsSet() && !rhs.jungfrauPedestalG1FramesIsSet()) || (jungfrauPedestalG1FramesIsSet() && rhs.jungfrauPedestalG1FramesIsSet() && getJungfrauPedestalG1Frames() == rhs.getJungfrauPedestalG1Frames())) &&
((!detectorTriggerDelayUsIsSet() && !rhs.detectorTriggerDelayUsIsSet()) || (detectorTriggerDelayUsIsSet() && rhs.detectorTriggerDelayUsIsSet() && getDetectorTriggerDelayUs() == rhs.getDetectorTriggerDelayUs())) &&
((!jungfrauPedestalG2FramesIsSet() && !rhs.jungfrauPedestalG2FramesIsSet()) || (jungfrauPedestalG2FramesIsSet() && rhs.jungfrauPedestalG2FramesIsSet() && getJungfrauPedestalG2Frames() == rhs.getJungfrauPedestalG2Frames())) &&
((!fixedGainG1IsSet() && !rhs.fixedGainG1IsSet()) || (fixedGainG1IsSet() && rhs.fixedGainG1IsSet() && isFixedGainG1() == rhs.isFixedGainG1())) &&
((!jungfrauPedestalMinImageCountIsSet() && !rhs.jungfrauPedestalMinImageCountIsSet()) || (jungfrauPedestalMinImageCountIsSet() && rhs.jungfrauPedestalMinImageCountIsSet() && getJungfrauPedestalMinImageCount() == rhs.getJungfrauPedestalMinImageCount())) &&
((!jungfrauStorageCellCountIsSet() && !rhs.jungfrauStorageCellCountIsSet()) || (jungfrauStorageCellCountIsSet() && rhs.jungfrauStorageCellCountIsSet() && getJungfrauStorageCellCount() == rhs.getJungfrauStorageCellCount())) &&
((!jungfrauStorageCellDelayNsIsSet() && !rhs.jungfrauStorageCellDelayNsIsSet()) || (jungfrauStorageCellDelayNsIsSet() && rhs.jungfrauStorageCellDelayNsIsSet() && getJungfrauStorageCellDelayNs() == rhs.getJungfrauStorageCellDelayNs())) &&
((!jungfrauFixedGainG1IsSet() && !rhs.jungfrauFixedGainG1IsSet()) || (jungfrauFixedGainG1IsSet() && rhs.jungfrauFixedGainG1IsSet() && isJungfrauFixedGainG1() == rhs.isJungfrauFixedGainG1())) &&
((!jungfrauUseGainHg0IsSet() && !rhs.jungfrauUseGainHg0IsSet()) || (jungfrauUseGainHg0IsSet() && rhs.jungfrauUseGainHg0IsSet() && isJungfrauUseGainHg0() == rhs.isJungfrauUseGainHg0()))
((!useGainHg0IsSet() && !rhs.useGainHg0IsSet()) || (useGainHg0IsSet() && rhs.useGainHg0IsSet() && isUseGainHg0() == rhs.isUseGainHg0()))
;
}
@@ -295,38 +220,32 @@ bool Detector_settings::operator!=(const Detector_settings& rhs) const
void to_json(nlohmann::json& j, const Detector_settings& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["frame_time_us"] = o.m_Frame_time_us;
if(o.countTimeUsIsSet())
j["count_time_us"] = o.m_Count_time_us;
if(o.storageCellCountIsSet())
j["storage_cell_count"] = o.m_Storage_cell_count;
if(o.internalFrameGeneratorIsSet())
j["internal_frame_generator"] = o.m_Internal_frame_generator;
if(o.internalFrameGeneratorImagesIsSet())
j["internal_frame_generator_images"] = o.m_Internal_frame_generator_images;
if(o.detectorTriggerDelayNsIsSet())
j["detector_trigger_delay_ns"] = o.m_Detector_trigger_delay_ns;
if(o.timingIsSet())
j["timing"] = o.m_Timing;
if(o.eigerThresholdKeVIsSet())
j["eiger_threshold_keV"] = o.m_Eiger_threshold_keV;
if(o.eigerBitDepthIsSet())
j["eiger_bit_depth"] = o.m_Eiger_bit_depth;
if(o.jungfrauPedestalG0FramesIsSet())
j["jungfrau_pedestal_g0_frames"] = o.m_Jungfrau_pedestal_g0_frames;
if(o.jungfrauPedestalG1FramesIsSet())
j["jungfrau_pedestal_g1_frames"] = o.m_Jungfrau_pedestal_g1_frames;
if(o.jungfrauPedestalG2FramesIsSet())
j["jungfrau_pedestal_g2_frames"] = o.m_Jungfrau_pedestal_g2_frames;
if(o.jungfrauPedestalMinImageCountIsSet())
j["jungfrau_pedestal_min_image_count"] = o.m_Jungfrau_pedestal_min_image_count;
if(o.jungfrauStorageCellCountIsSet())
j["jungfrau_storage_cell_count"] = o.m_Jungfrau_storage_cell_count;
if(o.jungfrauStorageCellDelayNsIsSet())
j["jungfrau_storage_cell_delay_ns"] = o.m_Jungfrau_storage_cell_delay_ns;
if(o.jungfrauFixedGainG1IsSet())
j["jungfrau_fixed_gain_g1"] = o.m_Jungfrau_fixed_gain_g1;
if(o.jungfrauUseGainHg0IsSet())
j["jungfrau_use_gain_hg0"] = o.m_Jungfrau_use_gain_hg0;
if(o.collectRawDataIsSet())
j["collect_raw_data"] = o.m_Collect_raw_data;
if(o.pedestalG0FramesIsSet())
j["pedestal_g0_frames"] = o.m_Pedestal_g0_frames;
if(o.pedestalG1FramesIsSet())
j["pedestal_g1_frames"] = o.m_Pedestal_g1_frames;
if(o.pedestalG2FramesIsSet())
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
if(o.storageCellDelayUsIsSet())
j["storage_cell_delay_us"] = o.m_Storage_cell_delay_us;
if(o.detectorTriggerDelayUsIsSet())
j["detector_trigger_delay_us"] = o.m_Detector_trigger_delay_us;
if(o.fixedGainG1IsSet())
j["fixed_gain_g1"] = o.m_Fixed_gain_g1;
if(o.useGainHg0IsSet())
j["use_gain_hg0"] = o.m_Use_gain_hg0;
}
@@ -338,6 +257,11 @@ void from_json(const nlohmann::json& j, Detector_settings& o)
j.at("count_time_us").get_to(o.m_Count_time_us);
o.m_Count_time_usIsSet = true;
}
if(j.find("storage_cell_count") != j.end())
{
j.at("storage_cell_count").get_to(o.m_Storage_cell_count);
o.m_Storage_cell_countIsSet = true;
}
if(j.find("internal_frame_generator") != j.end())
{
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
@@ -348,65 +272,45 @@ void from_json(const nlohmann::json& j, Detector_settings& o)
j.at("internal_frame_generator_images").get_to(o.m_Internal_frame_generator_images);
o.m_Internal_frame_generator_imagesIsSet = true;
}
if(j.find("detector_trigger_delay_ns") != j.end())
if(j.find("collect_raw_data") != j.end())
{
j.at("detector_trigger_delay_ns").get_to(o.m_Detector_trigger_delay_ns);
o.m_Detector_trigger_delay_nsIsSet = true;
j.at("collect_raw_data").get_to(o.m_Collect_raw_data);
o.m_Collect_raw_dataIsSet = true;
}
if(j.find("timing") != j.end())
if(j.find("pedestal_g0_frames") != j.end())
{
j.at("timing").get_to(o.m_Timing);
o.m_TimingIsSet = true;
j.at("pedestal_g0_frames").get_to(o.m_Pedestal_g0_frames);
o.m_Pedestal_g0_framesIsSet = true;
}
if(j.find("eiger_threshold_keV") != j.end())
if(j.find("pedestal_g1_frames") != j.end())
{
j.at("eiger_threshold_keV").get_to(o.m_Eiger_threshold_keV);
o.m_Eiger_threshold_keVIsSet = true;
j.at("pedestal_g1_frames").get_to(o.m_Pedestal_g1_frames);
o.m_Pedestal_g1_framesIsSet = true;
}
if(j.find("eiger_bit_depth") != j.end())
if(j.find("pedestal_g2_frames") != j.end())
{
j.at("eiger_bit_depth").get_to(o.m_Eiger_bit_depth);
o.m_Eiger_bit_depthIsSet = true;
j.at("pedestal_g2_frames").get_to(o.m_Pedestal_g2_frames);
o.m_Pedestal_g2_framesIsSet = true;
}
if(j.find("jungfrau_pedestal_g0_frames") != j.end())
if(j.find("storage_cell_delay_us") != j.end())
{
j.at("jungfrau_pedestal_g0_frames").get_to(o.m_Jungfrau_pedestal_g0_frames);
o.m_Jungfrau_pedestal_g0_framesIsSet = true;
j.at("storage_cell_delay_us").get_to(o.m_Storage_cell_delay_us);
o.m_Storage_cell_delay_usIsSet = true;
}
if(j.find("jungfrau_pedestal_g1_frames") != j.end())
if(j.find("detector_trigger_delay_us") != j.end())
{
j.at("jungfrau_pedestal_g1_frames").get_to(o.m_Jungfrau_pedestal_g1_frames);
o.m_Jungfrau_pedestal_g1_framesIsSet = true;
j.at("detector_trigger_delay_us").get_to(o.m_Detector_trigger_delay_us);
o.m_Detector_trigger_delay_usIsSet = true;
}
if(j.find("jungfrau_pedestal_g2_frames") != j.end())
if(j.find("fixed_gain_g1") != j.end())
{
j.at("jungfrau_pedestal_g2_frames").get_to(o.m_Jungfrau_pedestal_g2_frames);
o.m_Jungfrau_pedestal_g2_framesIsSet = true;
j.at("fixed_gain_g1").get_to(o.m_Fixed_gain_g1);
o.m_Fixed_gain_g1IsSet = true;
}
if(j.find("jungfrau_pedestal_min_image_count") != j.end())
if(j.find("use_gain_hg0") != j.end())
{
j.at("jungfrau_pedestal_min_image_count").get_to(o.m_Jungfrau_pedestal_min_image_count);
o.m_Jungfrau_pedestal_min_image_countIsSet = true;
}
if(j.find("jungfrau_storage_cell_count") != j.end())
{
j.at("jungfrau_storage_cell_count").get_to(o.m_Jungfrau_storage_cell_count);
o.m_Jungfrau_storage_cell_countIsSet = true;
}
if(j.find("jungfrau_storage_cell_delay_ns") != j.end())
{
j.at("jungfrau_storage_cell_delay_ns").get_to(o.m_Jungfrau_storage_cell_delay_ns);
o.m_Jungfrau_storage_cell_delay_nsIsSet = true;
}
if(j.find("jungfrau_fixed_gain_g1") != j.end())
{
j.at("jungfrau_fixed_gain_g1").get_to(o.m_Jungfrau_fixed_gain_g1);
o.m_Jungfrau_fixed_gain_g1IsSet = true;
}
if(j.find("jungfrau_use_gain_hg0") != j.end())
{
j.at("jungfrau_use_gain_hg0").get_to(o.m_Jungfrau_use_gain_hg0);
o.m_Jungfrau_use_gain_hg0IsSet = true;
j.at("use_gain_hg0").get_to(o.m_Use_gain_hg0);
o.m_Use_gain_hg0IsSet = true;
}
}
@@ -436,6 +340,23 @@ void Detector_settings::unsetCount_time_us()
{
m_Count_time_usIsSet = false;
}
int64_t Detector_settings::getStorageCellCount() const
{
return m_Storage_cell_count;
}
void Detector_settings::setStorageCellCount(int64_t const value)
{
m_Storage_cell_count = value;
m_Storage_cell_countIsSet = true;
}
bool Detector_settings::storageCellCountIsSet() const
{
return m_Storage_cell_countIsSet;
}
void Detector_settings::unsetStorage_cell_count()
{
m_Storage_cell_countIsSet = false;
}
bool Detector_settings::isInternalFrameGenerator() const
{
return m_Internal_frame_generator;
@@ -470,209 +391,141 @@ void Detector_settings::unsetInternal_frame_generator_images()
{
m_Internal_frame_generator_imagesIsSet = false;
}
int64_t Detector_settings::getDetectorTriggerDelayNs() const
bool Detector_settings::isCollectRawData() const
{
return m_Detector_trigger_delay_ns;
return m_Collect_raw_data;
}
void Detector_settings::setDetectorTriggerDelayNs(int64_t const value)
void Detector_settings::setCollectRawData(bool const value)
{
m_Detector_trigger_delay_ns = value;
m_Detector_trigger_delay_nsIsSet = true;
m_Collect_raw_data = value;
m_Collect_raw_dataIsSet = true;
}
bool Detector_settings::detectorTriggerDelayNsIsSet() const
bool Detector_settings::collectRawDataIsSet() const
{
return m_Detector_trigger_delay_nsIsSet;
return m_Collect_raw_dataIsSet;
}
void Detector_settings::unsetDetector_trigger_delay_ns()
void Detector_settings::unsetCollect_raw_data()
{
m_Detector_trigger_delay_nsIsSet = false;
m_Collect_raw_dataIsSet = false;
}
org::openapitools::server::model::Detector_timing Detector_settings::getTiming() const
int64_t Detector_settings::getPedestalG0Frames() const
{
return m_Timing;
return m_Pedestal_g0_frames;
}
void Detector_settings::setTiming(org::openapitools::server::model::Detector_timing const& value)
void Detector_settings::setPedestalG0Frames(int64_t const value)
{
m_Timing = value;
m_TimingIsSet = true;
m_Pedestal_g0_frames = value;
m_Pedestal_g0_framesIsSet = true;
}
bool Detector_settings::timingIsSet() const
bool Detector_settings::pedestalG0FramesIsSet() const
{
return m_TimingIsSet;
return m_Pedestal_g0_framesIsSet;
}
void Detector_settings::unsetTiming()
void Detector_settings::unsetPedestal_g0_frames()
{
m_TimingIsSet = false;
m_Pedestal_g0_framesIsSet = false;
}
float Detector_settings::getEigerThresholdKeV() const
int64_t Detector_settings::getPedestalG1Frames() const
{
return m_Eiger_threshold_keV;
return m_Pedestal_g1_frames;
}
void Detector_settings::setEigerThresholdKeV(float const value)
void Detector_settings::setPedestalG1Frames(int64_t const value)
{
m_Eiger_threshold_keV = value;
m_Eiger_threshold_keVIsSet = true;
m_Pedestal_g1_frames = value;
m_Pedestal_g1_framesIsSet = true;
}
bool Detector_settings::eigerThresholdKeVIsSet() const
bool Detector_settings::pedestalG1FramesIsSet() const
{
return m_Eiger_threshold_keVIsSet;
return m_Pedestal_g1_framesIsSet;
}
void Detector_settings::unsetEiger_threshold_keV()
void Detector_settings::unsetPedestal_g1_frames()
{
m_Eiger_threshold_keVIsSet = false;
m_Pedestal_g1_framesIsSet = false;
}
int64_t Detector_settings::getEigerBitDepth() const
int64_t Detector_settings::getPedestalG2Frames() const
{
return m_Eiger_bit_depth;
return m_Pedestal_g2_frames;
}
void Detector_settings::setEigerBitDepth(int64_t const value)
void Detector_settings::setPedestalG2Frames(int64_t const value)
{
m_Eiger_bit_depth = value;
m_Eiger_bit_depthIsSet = true;
m_Pedestal_g2_frames = value;
m_Pedestal_g2_framesIsSet = true;
}
bool Detector_settings::eigerBitDepthIsSet() const
bool Detector_settings::pedestalG2FramesIsSet() const
{
return m_Eiger_bit_depthIsSet;
return m_Pedestal_g2_framesIsSet;
}
void Detector_settings::unsetEiger_bit_depth()
void Detector_settings::unsetPedestal_g2_frames()
{
m_Eiger_bit_depthIsSet = false;
m_Pedestal_g2_framesIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalG0Frames() const
float Detector_settings::getStorageCellDelayUs() const
{
return m_Jungfrau_pedestal_g0_frames;
return m_Storage_cell_delay_us;
}
void Detector_settings::setJungfrauPedestalG0Frames(int64_t const value)
void Detector_settings::setStorageCellDelayUs(float const value)
{
m_Jungfrau_pedestal_g0_frames = value;
m_Jungfrau_pedestal_g0_framesIsSet = true;
m_Storage_cell_delay_us = value;
m_Storage_cell_delay_usIsSet = true;
}
bool Detector_settings::jungfrauPedestalG0FramesIsSet() const
bool Detector_settings::storageCellDelayUsIsSet() const
{
return m_Jungfrau_pedestal_g0_framesIsSet;
return m_Storage_cell_delay_usIsSet;
}
void Detector_settings::unsetJungfrau_pedestal_g0_frames()
void Detector_settings::unsetStorage_cell_delay_us()
{
m_Jungfrau_pedestal_g0_framesIsSet = false;
m_Storage_cell_delay_usIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalG1Frames() const
float Detector_settings::getDetectorTriggerDelayUs() const
{
return m_Jungfrau_pedestal_g1_frames;
return m_Detector_trigger_delay_us;
}
void Detector_settings::setJungfrauPedestalG1Frames(int64_t const value)
void Detector_settings::setDetectorTriggerDelayUs(float const value)
{
m_Jungfrau_pedestal_g1_frames = value;
m_Jungfrau_pedestal_g1_framesIsSet = true;
m_Detector_trigger_delay_us = value;
m_Detector_trigger_delay_usIsSet = true;
}
bool Detector_settings::jungfrauPedestalG1FramesIsSet() const
bool Detector_settings::detectorTriggerDelayUsIsSet() const
{
return m_Jungfrau_pedestal_g1_framesIsSet;
return m_Detector_trigger_delay_usIsSet;
}
void Detector_settings::unsetJungfrau_pedestal_g1_frames()
void Detector_settings::unsetDetector_trigger_delay_us()
{
m_Jungfrau_pedestal_g1_framesIsSet = false;
m_Detector_trigger_delay_usIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalG2Frames() const
bool Detector_settings::isFixedGainG1() const
{
return m_Jungfrau_pedestal_g2_frames;
return m_Fixed_gain_g1;
}
void Detector_settings::setJungfrauPedestalG2Frames(int64_t const value)
void Detector_settings::setFixedGainG1(bool const value)
{
m_Jungfrau_pedestal_g2_frames = value;
m_Jungfrau_pedestal_g2_framesIsSet = true;
m_Fixed_gain_g1 = value;
m_Fixed_gain_g1IsSet = true;
}
bool Detector_settings::jungfrauPedestalG2FramesIsSet() const
bool Detector_settings::fixedGainG1IsSet() const
{
return m_Jungfrau_pedestal_g2_framesIsSet;
return m_Fixed_gain_g1IsSet;
}
void Detector_settings::unsetJungfrau_pedestal_g2_frames()
void Detector_settings::unsetFixed_gain_g1()
{
m_Jungfrau_pedestal_g2_framesIsSet = false;
m_Fixed_gain_g1IsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalMinImageCount() const
bool Detector_settings::isUseGainHg0() const
{
return m_Jungfrau_pedestal_min_image_count;
return m_Use_gain_hg0;
}
void Detector_settings::setJungfrauPedestalMinImageCount(int64_t const value)
void Detector_settings::setUseGainHg0(bool const value)
{
m_Jungfrau_pedestal_min_image_count = value;
m_Jungfrau_pedestal_min_image_countIsSet = true;
m_Use_gain_hg0 = value;
m_Use_gain_hg0IsSet = true;
}
bool Detector_settings::jungfrauPedestalMinImageCountIsSet() const
bool Detector_settings::useGainHg0IsSet() const
{
return m_Jungfrau_pedestal_min_image_countIsSet;
return m_Use_gain_hg0IsSet;
}
void Detector_settings::unsetJungfrau_pedestal_min_image_count()
void Detector_settings::unsetUse_gain_hg0()
{
m_Jungfrau_pedestal_min_image_countIsSet = false;
}
int64_t Detector_settings::getJungfrauStorageCellCount() const
{
return m_Jungfrau_storage_cell_count;
}
void Detector_settings::setJungfrauStorageCellCount(int64_t const value)
{
m_Jungfrau_storage_cell_count = value;
m_Jungfrau_storage_cell_countIsSet = true;
}
bool Detector_settings::jungfrauStorageCellCountIsSet() const
{
return m_Jungfrau_storage_cell_countIsSet;
}
void Detector_settings::unsetJungfrau_storage_cell_count()
{
m_Jungfrau_storage_cell_countIsSet = false;
}
int64_t Detector_settings::getJungfrauStorageCellDelayNs() const
{
return m_Jungfrau_storage_cell_delay_ns;
}
void Detector_settings::setJungfrauStorageCellDelayNs(int64_t const value)
{
m_Jungfrau_storage_cell_delay_ns = value;
m_Jungfrau_storage_cell_delay_nsIsSet = true;
}
bool Detector_settings::jungfrauStorageCellDelayNsIsSet() const
{
return m_Jungfrau_storage_cell_delay_nsIsSet;
}
void Detector_settings::unsetJungfrau_storage_cell_delay_ns()
{
m_Jungfrau_storage_cell_delay_nsIsSet = false;
}
bool Detector_settings::isJungfrauFixedGainG1() const
{
return m_Jungfrau_fixed_gain_g1;
}
void Detector_settings::setJungfrauFixedGainG1(bool const value)
{
m_Jungfrau_fixed_gain_g1 = value;
m_Jungfrau_fixed_gain_g1IsSet = true;
}
bool Detector_settings::jungfrauFixedGainG1IsSet() const
{
return m_Jungfrau_fixed_gain_g1IsSet;
}
void Detector_settings::unsetJungfrau_fixed_gain_g1()
{
m_Jungfrau_fixed_gain_g1IsSet = false;
}
bool Detector_settings::isJungfrauUseGainHg0() const
{
return m_Jungfrau_use_gain_hg0;
}
void Detector_settings::setJungfrauUseGainHg0(bool const value)
{
m_Jungfrau_use_gain_hg0 = value;
m_Jungfrau_use_gain_hg0IsSet = true;
}
bool Detector_settings::jungfrauUseGainHg0IsSet() const
{
return m_Jungfrau_use_gain_hg0IsSet;
}
void Detector_settings::unsetJungfrau_use_gain_hg0()
{
m_Jungfrau_use_gain_hg0IsSet = false;
m_Use_gain_hg0IsSet = false;
}

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -19,7 +19,6 @@
#define Detector_settings_H_
#include "Detector_timing.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
@@ -59,18 +58,25 @@ public:
/// Detector_settings members
/// <summary>
/// Interval between consecutive frames. This is internal frame time for the JUNGFRAU detector, image time has to be integer multiply of this number. For EIGER detector this is default frame time, not used otherwise
/// Interval between consecutive frames.
/// </summary>
int64_t getFrameTimeUs() const;
void setFrameTimeUs(int64_t const value);
/// <summary>
/// Integration time of the detector. If not provided count time will be set to maximum value for a given frame time.
/// Integration time of the detector. If not provided count time will be set to maximum value for a given frame time.
/// </summary>
int64_t getCountTimeUs() const;
void setCountTimeUs(int64_t const value);
bool countTimeUsIsSet() const;
void unsetCount_time_us();
/// <summary>
///
/// </summary>
int64_t getStorageCellCount() const;
void setStorageCellCount(int64_t const value);
bool storageCellCountIsSet() const;
void unsetStorage_cell_count();
/// <summary>
/// Use internal frame generator in FPGA instead of getting data from a real detector
/// </summary>
bool isInternalFrameGenerator() const;
@@ -78,132 +84,98 @@ public:
bool internalFrameGeneratorIsSet() const;
void unsetInternal_frame_generator();
/// <summary>
/// Number of images stored in the internal frame generator.
///
/// </summary>
int64_t getInternalFrameGeneratorImages() const;
void setInternalFrameGeneratorImages(int64_t const value);
bool internalFrameGeneratorImagesIsSet() const;
void unsetInternal_frame_generator_images();
/// <summary>
/// Delay between TTL trigger and acquisition start [ns]
/// Turn off conversion of pixel read-out to photon count
/// </summary>
int64_t getDetectorTriggerDelayNs() const;
void setDetectorTriggerDelayNs(int64_t const value);
bool detectorTriggerDelayNsIsSet() const;
void unsetDetector_trigger_delay_ns();
bool isCollectRawData() const;
void setCollectRawData(bool const value);
bool collectRawDataIsSet() const;
void unsetCollect_raw_data();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_timing getTiming() const;
void setTiming(org::openapitools::server::model::Detector_timing const& value);
bool timingIsSet() const;
void unsetTiming();
/// <summary>
/// Threshold for the EIGER detector. If value is provided, it will be used for all subsequent acquisitions, irrespective of beam energy. If value is not provided, threshold will be determined on start of acquisition as half of incident energy. This might lead to increased start time.
/// </summary>
float getEigerThresholdKeV() const;
void setEigerThresholdKeV(float const value);
bool eigerThresholdKeVIsSet() const;
void unsetEiger_threshold_keV();
/// <summary>
/// Bit depth of EIGER read-out. If value is not provided bit depth is adjusted automatically based on the image time.
/// </summary>
int64_t getEigerBitDepth() const;
void setEigerBitDepth(int64_t const value);
bool eigerBitDepthIsSet() const;
void unsetEiger_bit_depth();
int64_t getPedestalG0Frames() const;
void setPedestalG0Frames(int64_t const value);
bool pedestalG0FramesIsSet() const;
void unsetPedestal_g0_frames();
/// <summary>
///
/// </summary>
int64_t getJungfrauPedestalG0Frames() const;
void setJungfrauPedestalG0Frames(int64_t const value);
bool jungfrauPedestalG0FramesIsSet() const;
void unsetJungfrau_pedestal_g0_frames();
int64_t getPedestalG1Frames() const;
void setPedestalG1Frames(int64_t const value);
bool pedestalG1FramesIsSet() const;
void unsetPedestal_g1_frames();
/// <summary>
///
/// </summary>
int64_t getJungfrauPedestalG1Frames() const;
void setJungfrauPedestalG1Frames(int64_t const value);
bool jungfrauPedestalG1FramesIsSet() const;
void unsetJungfrau_pedestal_g1_frames();
int64_t getPedestalG2Frames() const;
void setPedestalG2Frames(int64_t const value);
bool pedestalG2FramesIsSet() const;
void unsetPedestal_g2_frames();
/// <summary>
///
/// Delay between two storage cells [us]
/// </summary>
int64_t getJungfrauPedestalG2Frames() const;
void setJungfrauPedestalG2Frames(int64_t const value);
bool jungfrauPedestalG2FramesIsSet() const;
void unsetJungfrau_pedestal_g2_frames();
float getStorageCellDelayUs() const;
void setStorageCellDelayUs(float const value);
bool storageCellDelayUsIsSet() const;
void unsetStorage_cell_delay_us();
/// <summary>
/// Minimum number of collected images for pedestal to consider it viable
/// Delay between TTL trigger and acquisition start [us]
/// </summary>
int64_t getJungfrauPedestalMinImageCount() const;
void setJungfrauPedestalMinImageCount(int64_t const value);
bool jungfrauPedestalMinImageCountIsSet() const;
void unsetJungfrau_pedestal_min_image_count();
/// <summary>
///
/// </summary>
int64_t getJungfrauStorageCellCount() const;
void setJungfrauStorageCellCount(int64_t const value);
bool jungfrauStorageCellCountIsSet() const;
void unsetJungfrau_storage_cell_count();
/// <summary>
/// Delay between two storage cells [ns]
/// </summary>
int64_t getJungfrauStorageCellDelayNs() const;
void setJungfrauStorageCellDelayNs(int64_t const value);
bool jungfrauStorageCellDelayNsIsSet() const;
void unsetJungfrau_storage_cell_delay_ns();
float getDetectorTriggerDelayUs() const;
void setDetectorTriggerDelayUs(float const value);
bool detectorTriggerDelayUsIsSet() const;
void unsetDetector_trigger_delay_us();
/// <summary>
/// Fix gain to G1 (can be useful for storage cells)
/// </summary>
bool isJungfrauFixedGainG1() const;
void setJungfrauFixedGainG1(bool const value);
bool jungfrauFixedGainG1IsSet() const;
void unsetJungfrau_fixed_gain_g1();
bool isFixedGainG1() const;
void setFixedGainG1(bool const value);
bool fixedGainG1IsSet() const;
void unsetFixed_gain_g1();
/// <summary>
/// Use high G0 (for low energy applications)
/// </summary>
bool isJungfrauUseGainHg0() const;
void setJungfrauUseGainHg0(bool const value);
bool jungfrauUseGainHg0IsSet() const;
void unsetJungfrau_use_gain_hg0();
bool isUseGainHg0() const;
void setUseGainHg0(bool const value);
bool useGainHg0IsSet() const;
void unsetUse_gain_hg0();
friend void to_json(nlohmann::json& j, const Detector_settings& o);
friend void from_json(const nlohmann::json& j, Detector_settings& o);
friend void to_json(nlohmann::json& j, const Detector_settings& o);
friend void from_json(const nlohmann::json& j, Detector_settings& o);
protected:
int64_t m_Frame_time_us;
int64_t m_Count_time_us;
bool m_Count_time_usIsSet;
int64_t m_Storage_cell_count;
bool m_Storage_cell_countIsSet;
bool m_Internal_frame_generator;
bool m_Internal_frame_generatorIsSet;
int64_t m_Internal_frame_generator_images;
bool m_Internal_frame_generator_imagesIsSet;
int64_t m_Detector_trigger_delay_ns;
bool m_Detector_trigger_delay_nsIsSet;
org::openapitools::server::model::Detector_timing m_Timing;
bool m_TimingIsSet;
float m_Eiger_threshold_keV;
bool m_Eiger_threshold_keVIsSet;
int64_t m_Eiger_bit_depth;
bool m_Eiger_bit_depthIsSet;
int64_t m_Jungfrau_pedestal_g0_frames;
bool m_Jungfrau_pedestal_g0_framesIsSet;
int64_t m_Jungfrau_pedestal_g1_frames;
bool m_Jungfrau_pedestal_g1_framesIsSet;
int64_t m_Jungfrau_pedestal_g2_frames;
bool m_Jungfrau_pedestal_g2_framesIsSet;
int64_t m_Jungfrau_pedestal_min_image_count;
bool m_Jungfrau_pedestal_min_image_countIsSet;
int64_t m_Jungfrau_storage_cell_count;
bool m_Jungfrau_storage_cell_countIsSet;
int64_t m_Jungfrau_storage_cell_delay_ns;
bool m_Jungfrau_storage_cell_delay_nsIsSet;
bool m_Jungfrau_fixed_gain_g1;
bool m_Jungfrau_fixed_gain_g1IsSet;
bool m_Jungfrau_use_gain_hg0;
bool m_Jungfrau_use_gain_hg0IsSet;
bool m_Collect_raw_data;
bool m_Collect_raw_dataIsSet;
int64_t m_Pedestal_g0_frames;
bool m_Pedestal_g0_framesIsSet;
int64_t m_Pedestal_g1_frames;
bool m_Pedestal_g1_framesIsSet;
int64_t m_Pedestal_g2_frames;
bool m_Pedestal_g2_framesIsSet;
float m_Storage_cell_delay_us;
bool m_Storage_cell_delay_usIsSet;
float m_Detector_trigger_delay_us;
bool m_Detector_trigger_delay_usIsSet;
bool m_Fixed_gain_g1;
bool m_Fixed_gain_g1IsSet;
bool m_Use_gain_hg0;
bool m_Use_gain_hg0IsSet;
};

View File

@@ -1,134 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_state.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Detector_state::Detector_state()
{
}
void Detector_state::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_state::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_state::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_state" : pathPrefix;
if (m_value == Detector_state::eDetector_state::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Detector_state::operator==(const Detector_state& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Detector_state::operator!=(const Detector_state& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_state& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Detector_state::eDetector_state::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Detector_state::eDetector_state::IDLE:
j = "Idle";
break;
case Detector_state::eDetector_state::WAITING:
j = "Waiting";
break;
case Detector_state::eDetector_state::BUSY:
j = "Busy";
break;
case Detector_state::eDetector_state::ERROR:
j = "Error";
break;
case Detector_state::eDetector_state::NOT_CONNECTED:
j = "Not connected";
break;
}
}
void from_json(const nlohmann::json& j, Detector_state& o)
{
auto s = j.get<std::string>();
if (s == "Idle") {
o.setValue(Detector_state::eDetector_state::IDLE);
}
else if (s == "Waiting") {
o.setValue(Detector_state::eDetector_state::WAITING);
}
else if (s == "Busy") {
o.setValue(Detector_state::eDetector_state::BUSY);
}
else if (s == "Error") {
o.setValue(Detector_state::eDetector_state::ERROR);
}
else if (s == "Not connected") {
o.setValue(Detector_state::eDetector_state::NOT_CONNECTED);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Detector_state::eDetector_state";
throw std::invalid_argument(ss.str());
}
}
Detector_state::eDetector_state Detector_state::getValue() const
{
return m_value;
}
void Detector_state::setValue(Detector_state::eDetector_state value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,82 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_state.h
*
* Current state of the detector
*/
#ifndef Detector_state_H_
#define Detector_state_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Current state of the detector
/// </summary>
class Detector_state
{
public:
Detector_state();
virtual ~Detector_state() = default;
enum class eDetector_state {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
IDLE,
WAITING,
BUSY,
ERROR,
NOT_CONNECTED
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_state& rhs) const;
bool operator!=(const Detector_state& rhs) const;
/////////////////////////////////////////////
/// Detector_state members
Detector_state::eDetector_state getValue() const;
void setValue(Detector_state::eDetector_state value);
friend void to_json(nlohmann::json& j, const Detector_state& o);
friend void from_json(const nlohmann::json& j, Detector_state& o);
protected:
Detector_state::eDetector_state m_value = Detector_state::eDetector_state::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Detector_state_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -21,6 +21,8 @@ namespace org::openapitools::server::model
Detector_status::Detector_status()
{
m_State = "";
m_Powerchip = "";
m_Server_version = "";
m_Number_of_triggers_left = 0L;
@@ -124,7 +126,7 @@ bool Detector_status::operator!=(const Detector_status& rhs) const
void to_json(nlohmann::json& j, const Detector_status& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["state"] = o.m_State;
j["powerchip"] = o.m_Powerchip;
j["server_version"] = o.m_Server_version;
@@ -145,19 +147,19 @@ void from_json(const nlohmann::json& j, Detector_status& o)
}
org::openapitools::server::model::Detector_state Detector_status::getState() const
std::string Detector_status::getState() const
{
return m_State;
}
void Detector_status::setState(org::openapitools::server::model::Detector_state const& value)
void Detector_status::setState(std::string const& value)
{
m_State = value;
}
org::openapitools::server::model::Detector_power_state Detector_status::getPowerchip() const
std::string Detector_status::getPowerchip() const
{
return m_Powerchip;
}
void Detector_status::setPowerchip(org::openapitools::server::model::Detector_power_state const& value)
void Detector_status::setPowerchip(std::string const& value)
{
m_Powerchip = value;
}

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -19,9 +19,7 @@
#define Detector_status_H_
#include "Detector_state.h"
#include <string>
#include "Detector_power_state.h"
#include <vector>
#include <nlohmann/json.hpp>
@@ -62,15 +60,15 @@ public:
/// Detector_status members
/// <summary>
///
/// Current state of the detector
/// </summary>
org::openapitools::server::model::Detector_state getState() const;
void setState(org::openapitools::server::model::Detector_state const& value);
std::string getState() const;
void setState(std::string const& value);
/// <summary>
///
/// Power on of ASICs
/// </summary>
org::openapitools::server::model::Detector_power_state getPowerchip() const;
void setPowerchip(org::openapitools::server::model::Detector_power_state const& value);
std::string getPowerchip() const;
void setPowerchip(std::string const& value);
/// <summary>
/// Detector server (on read-out boards) version
/// </summary>
@@ -92,12 +90,12 @@ public:
std::vector<int64_t> getHighVoltageV() const;
void setHighVoltageV(std::vector<int64_t> const value);
friend void to_json(nlohmann::json& j, const Detector_status& o);
friend void from_json(const nlohmann::json& j, Detector_status& o);
friend void to_json(nlohmann::json& j, const Detector_status& o);
friend void from_json(const nlohmann::json& j, Detector_status& o);
protected:
org::openapitools::server::model::Detector_state m_State;
std::string m_State;
org::openapitools::server::model::Detector_power_state m_Powerchip;
std::string m_Powerchip;
std::string m_Server_version;

View File

@@ -1,128 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_timing.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Detector_timing::Detector_timing()
{
}
void Detector_timing::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_timing::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_timing::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_timing" : pathPrefix;
if (m_value == Detector_timing::eDetector_timing::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Detector_timing::operator==(const Detector_timing& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Detector_timing::operator!=(const Detector_timing& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_timing& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Detector_timing::eDetector_timing::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Detector_timing::eDetector_timing::AUTO:
j = "auto";
break;
case Detector_timing::eDetector_timing::TRIGGER:
j = "trigger";
break;
case Detector_timing::eDetector_timing::BURST:
j = "burst";
break;
case Detector_timing::eDetector_timing::GATED:
j = "gated";
break;
}
}
void from_json(const nlohmann::json& j, Detector_timing& o)
{
auto s = j.get<std::string>();
if (s == "auto") {
o.setValue(Detector_timing::eDetector_timing::AUTO);
}
else if (s == "trigger") {
o.setValue(Detector_timing::eDetector_timing::TRIGGER);
}
else if (s == "burst") {
o.setValue(Detector_timing::eDetector_timing::BURST);
}
else if (s == "gated") {
o.setValue(Detector_timing::eDetector_timing::GATED);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Detector_timing::eDetector_timing";
throw std::invalid_argument(ss.str());
}
}
Detector_timing::eDetector_timing Detector_timing::getValue() const
{
return m_value;
}
void Detector_timing::setValue(Detector_timing::eDetector_timing value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,81 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_timing.h
*
*
*/
#ifndef Detector_timing_H_
#define Detector_timing_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_timing
{
public:
Detector_timing();
virtual ~Detector_timing() = default;
enum class eDetector_timing {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
AUTO,
TRIGGER,
BURST,
GATED
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_timing& rhs) const;
bool operator!=(const Detector_timing& rhs) const;
/////////////////////////////////////////////
/// Detector_timing members
Detector_timing::eDetector_timing getValue() const;
void setValue(Detector_timing::eDetector_timing value);
friend void to_json(nlohmann::json& j, const Detector_timing& o);
friend void from_json(const nlohmann::json& j, Detector_timing& o);
protected:
Detector_timing::eDetector_timing m_value = Detector_timing::eDetector_timing::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Detector_timing_H_ */

View File

@@ -1,122 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Detector_type.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Detector_type::Detector_type()
{
}
void Detector_type::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_type::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_type::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_type" : pathPrefix;
if (m_value == Detector_type::eDetector_type::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Detector_type::operator==(const Detector_type& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Detector_type::operator!=(const Detector_type& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_type& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Detector_type::eDetector_type::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Detector_type::eDetector_type::EIGER:
j = "EIGER";
break;
case Detector_type::eDetector_type::JUNGFRAU:
j = "JUNGFRAU";
break;
case Detector_type::eDetector_type::DECTRIS:
j = "DECTRIS";
break;
}
}
void from_json(const nlohmann::json& j, Detector_type& o)
{
auto s = j.get<std::string>();
if (s == "EIGER") {
o.setValue(Detector_type::eDetector_type::EIGER);
}
else if (s == "JUNGFRAU") {
o.setValue(Detector_type::eDetector_type::JUNGFRAU);
}
else if (s == "DECTRIS") {
o.setValue(Detector_type::eDetector_type::DECTRIS);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Detector_type::eDetector_type";
throw std::invalid_argument(ss.str());
}
}
Detector_type::eDetector_type Detector_type::getValue() const
{
return m_value;
}
void Detector_type::setValue(Detector_type::eDetector_type value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,80 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Detector_type.h
*
*
*/
#ifndef Detector_type_H_
#define Detector_type_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_type
{
public:
Detector_type();
virtual ~Detector_type() = default;
enum class eDetector_type {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
EIGER,
JUNGFRAU,
DECTRIS
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Detector_type& rhs) const;
bool operator!=(const Detector_type& rhs) const;
/////////////////////////////////////////////
/// Detector_type members
Detector_type::eDetector_type getValue() const;
void setValue(Detector_type::eDetector_type value);
friend void to_json(nlohmann::json& j, const Detector_type& o);
friend void from_json(const nlohmann::json& j, Detector_type& o);
protected:
Detector_type::eDetector_type m_value = Detector_type::eDetector_type::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Detector_type_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -70,7 +70,7 @@ bool Error_message::operator!=(const Error_message& rhs) const
void to_json(nlohmann::json& j, const Error_message& o)
{
j = nlohmann::json::object();
j = nlohmann::json();
j["msg"] = o.m_Msg;
j["reason"] = o.m_Reason;

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -69,8 +69,8 @@ public:
std::string getReason() const;
void setReason(std::string const& value);
friend void to_json(nlohmann::json& j, const Error_message& o);
friend void from_json(const nlohmann::json& j, Error_message& o);
friend void to_json(nlohmann::json& j, const Error_message& o);
friend void from_json(const nlohmann::json& j, Error_message& o);
protected:
std::string m_Msg;

View File

@@ -1,134 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "File_writer_format.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
File_writer_format::File_writer_format()
{
}
void File_writer_format::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool File_writer_format::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool File_writer_format::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "File_writer_format" : pathPrefix;
if (m_value == File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool File_writer_format::operator==(const File_writer_format& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool File_writer_format::operator!=(const File_writer_format& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const File_writer_format& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case File_writer_format::eFile_writer_format::NONE:
j = "None";
break;
case File_writer_format::eFile_writer_format::NXMXLEGACY:
j = "NXmxLegacy";
break;
case File_writer_format::eFile_writer_format::NXMXVDS:
j = "NXmxVDS";
break;
case File_writer_format::eFile_writer_format::CBF:
j = "CBF";
break;
case File_writer_format::eFile_writer_format::TIFF:
j = "TIFF";
break;
}
}
void from_json(const nlohmann::json& j, File_writer_format& o)
{
auto s = j.get<std::string>();
if (s == "None") {
o.setValue(File_writer_format::eFile_writer_format::NONE);
}
else if (s == "NXmxLegacy") {
o.setValue(File_writer_format::eFile_writer_format::NXMXLEGACY);
}
else if (s == "NXmxVDS") {
o.setValue(File_writer_format::eFile_writer_format::NXMXVDS);
}
else if (s == "CBF") {
o.setValue(File_writer_format::eFile_writer_format::CBF);
}
else if (s == "TIFF") {
o.setValue(File_writer_format::eFile_writer_format::TIFF);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " File_writer_format::eFile_writer_format";
throw std::invalid_argument(ss.str());
}
}
File_writer_format::eFile_writer_format File_writer_format::getValue() const
{
return m_value;
}
void File_writer_format::setValue(File_writer_format::eFile_writer_format value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,82 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* File_writer_format.h
*
* None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
*/
#ifndef File_writer_format_H_
#define File_writer_format_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
/// </summary>
class File_writer_format
{
public:
File_writer_format();
virtual ~File_writer_format() = default;
enum class eFile_writer_format {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
NONE,
NXMXLEGACY,
NXMXVDS,
CBF,
TIFF
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const File_writer_format& rhs) const;
bool operator!=(const File_writer_format& rhs) const;
/////////////////////////////////////////////
/// File_writer_format members
File_writer_format::eFile_writer_format getValue() const;
void setValue(File_writer_format::eFile_writer_format value);
friend void to_json(nlohmann::json& j, const File_writer_format& o);
friend void from_json(const nlohmann::json& j, File_writer_format& o);
protected:
File_writer_format::eFile_writer_format m_value = File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* File_writer_format_H_ */

View File

@@ -1,134 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "File_writer_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
File_writer_settings::File_writer_settings()
{
m_Overwrite = false;
m_OverwriteIsSet = false;
m_FormatIsSet = false;
}
void File_writer_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool File_writer_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool File_writer_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "File_writer_settings" : pathPrefix;
return success;
}
bool File_writer_settings::operator==(const File_writer_settings& rhs) const
{
return
((!overwriteIsSet() && !rhs.overwriteIsSet()) || (overwriteIsSet() && rhs.overwriteIsSet() && isOverwrite() == rhs.isOverwrite())) &&
((!formatIsSet() && !rhs.formatIsSet()) || (formatIsSet() && rhs.formatIsSet() && getFormat() == rhs.getFormat()))
;
}
bool File_writer_settings::operator!=(const File_writer_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const File_writer_settings& o)
{
j = nlohmann::json::object();
if(o.overwriteIsSet())
j["overwrite"] = o.m_Overwrite;
if(o.formatIsSet())
j["format"] = o.m_Format;
}
void from_json(const nlohmann::json& j, File_writer_settings& o)
{
if(j.find("overwrite") != j.end())
{
j.at("overwrite").get_to(o.m_Overwrite);
o.m_OverwriteIsSet = true;
}
if(j.find("format") != j.end())
{
j.at("format").get_to(o.m_Format);
o.m_FormatIsSet = true;
}
}
bool File_writer_settings::isOverwrite() const
{
return m_Overwrite;
}
void File_writer_settings::setOverwrite(bool const value)
{
m_Overwrite = value;
m_OverwriteIsSet = true;
}
bool File_writer_settings::overwriteIsSet() const
{
return m_OverwriteIsSet;
}
void File_writer_settings::unsetOverwrite()
{
m_OverwriteIsSet = false;
}
org::openapitools::server::model::File_writer_format File_writer_settings::getFormat() const
{
return m_Format;
}
void File_writer_settings::setFormat(org::openapitools::server::model::File_writer_format const& value)
{
m_Format = value;
m_FormatIsSet = true;
}
bool File_writer_settings::formatIsSet() const
{
return m_FormatIsSet;
}
void File_writer_settings::unsetFormat()
{
m_FormatIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,88 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* File_writer_settings.h
*
*
*/
#ifndef File_writer_settings_H_
#define File_writer_settings_H_
#include "File_writer_format.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class File_writer_settings
{
public:
File_writer_settings();
virtual ~File_writer_settings() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const File_writer_settings& rhs) const;
bool operator!=(const File_writer_settings& rhs) const;
/////////////////////////////////////////////
/// File_writer_settings members
/// <summary>
/// Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.
/// </summary>
bool isOverwrite() const;
void setOverwrite(bool const value);
bool overwriteIsSet() const;
void unsetOverwrite();
/// <summary>
///
/// </summary>
org::openapitools::server::model::File_writer_format getFormat() const;
void setFormat(org::openapitools::server::model::File_writer_format const& value);
bool formatIsSet() const;
void unsetFormat();
friend void to_json(nlohmann::json& j, const File_writer_settings& o);
friend void from_json(const nlohmann::json& j, File_writer_settings& o);
protected:
bool m_Overwrite;
bool m_OverwriteIsSet;
org::openapitools::server::model::File_writer_format m_Format;
bool m_FormatIsSet;
};
} // namespace org::openapitools::server::model
#endif /* File_writer_settings_H_ */

View File

@@ -1,273 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Fpga_status_inner.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Fpga_status_inner::Fpga_status_inner()
{
m_Pci_dev_id = "";
m_Serial_number = "";
m_Fw_version = "";
m_Base_mac_addr = "";
m_Eth_link_count = 0L;
m_Eth_link_status = 0L;
m_Power_usage_W = 0.0f;
m_Fpga_temp_C = 0.0f;
m_Hbm_temp_C = 0.0f;
m_Packets_udp = 0L;
m_Packets_sls = 0L;
m_Idle = false;
m_Pcie_link_speed = 0L;
m_Pcie_link_width = 0L;
}
void Fpga_status_inner::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Fpga_status_inner::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Fpga_status_inner::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Fpga_status_inner" : pathPrefix;
return success;
}
bool Fpga_status_inner::operator==(const Fpga_status_inner& rhs) const
{
return
(getPciDevId() == rhs.getPciDevId())
&&
(getSerialNumber() == rhs.getSerialNumber())
&&
(getFwVersion() == rhs.getFwVersion())
&&
(getBaseMacAddr() == rhs.getBaseMacAddr())
&&
(getEthLinkCount() == rhs.getEthLinkCount())
&&
(getEthLinkStatus() == rhs.getEthLinkStatus())
&&
(getPowerUsageW() == rhs.getPowerUsageW())
&&
(getFpgaTempC() == rhs.getFpgaTempC())
&&
(getHbmTempC() == rhs.getHbmTempC())
&&
(getPacketsUdp() == rhs.getPacketsUdp())
&&
(getPacketsSls() == rhs.getPacketsSls())
&&
(isIdle() == rhs.isIdle())
&&
(getPcieLinkSpeed() == rhs.getPcieLinkSpeed())
&&
(getPcieLinkWidth() == rhs.getPcieLinkWidth())
;
}
bool Fpga_status_inner::operator!=(const Fpga_status_inner& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Fpga_status_inner& o)
{
j = nlohmann::json::object();
j["pci_dev_id"] = o.m_Pci_dev_id;
j["serial_number"] = o.m_Serial_number;
j["fw_version"] = o.m_Fw_version;
j["base_mac_addr"] = o.m_Base_mac_addr;
j["eth_link_count"] = o.m_Eth_link_count;
j["eth_link_status"] = o.m_Eth_link_status;
j["power_usage_W"] = o.m_Power_usage_W;
j["fpga_temp_C"] = o.m_Fpga_temp_C;
j["hbm_temp_C"] = o.m_Hbm_temp_C;
j["packets_udp"] = o.m_Packets_udp;
j["packets_sls"] = o.m_Packets_sls;
j["idle"] = o.m_Idle;
j["pcie_link_speed"] = o.m_Pcie_link_speed;
j["pcie_link_width"] = o.m_Pcie_link_width;
}
void from_json(const nlohmann::json& j, Fpga_status_inner& o)
{
j.at("pci_dev_id").get_to(o.m_Pci_dev_id);
j.at("serial_number").get_to(o.m_Serial_number);
j.at("fw_version").get_to(o.m_Fw_version);
j.at("base_mac_addr").get_to(o.m_Base_mac_addr);
j.at("eth_link_count").get_to(o.m_Eth_link_count);
j.at("eth_link_status").get_to(o.m_Eth_link_status);
j.at("power_usage_W").get_to(o.m_Power_usage_W);
j.at("fpga_temp_C").get_to(o.m_Fpga_temp_C);
j.at("hbm_temp_C").get_to(o.m_Hbm_temp_C);
j.at("packets_udp").get_to(o.m_Packets_udp);
j.at("packets_sls").get_to(o.m_Packets_sls);
j.at("idle").get_to(o.m_Idle);
j.at("pcie_link_speed").get_to(o.m_Pcie_link_speed);
j.at("pcie_link_width").get_to(o.m_Pcie_link_width);
}
std::string Fpga_status_inner::getPciDevId() const
{
return m_Pci_dev_id;
}
void Fpga_status_inner::setPciDevId(std::string const& value)
{
m_Pci_dev_id = value;
}
std::string Fpga_status_inner::getSerialNumber() const
{
return m_Serial_number;
}
void Fpga_status_inner::setSerialNumber(std::string const& value)
{
m_Serial_number = value;
}
std::string Fpga_status_inner::getFwVersion() const
{
return m_Fw_version;
}
void Fpga_status_inner::setFwVersion(std::string const& value)
{
m_Fw_version = value;
}
std::string Fpga_status_inner::getBaseMacAddr() const
{
return m_Base_mac_addr;
}
void Fpga_status_inner::setBaseMacAddr(std::string const& value)
{
m_Base_mac_addr = value;
}
int64_t Fpga_status_inner::getEthLinkCount() const
{
return m_Eth_link_count;
}
void Fpga_status_inner::setEthLinkCount(int64_t const value)
{
m_Eth_link_count = value;
}
int64_t Fpga_status_inner::getEthLinkStatus() const
{
return m_Eth_link_status;
}
void Fpga_status_inner::setEthLinkStatus(int64_t const value)
{
m_Eth_link_status = value;
}
float Fpga_status_inner::getPowerUsageW() const
{
return m_Power_usage_W;
}
void Fpga_status_inner::setPowerUsageW(float const value)
{
m_Power_usage_W = value;
}
float Fpga_status_inner::getFpgaTempC() const
{
return m_Fpga_temp_C;
}
void Fpga_status_inner::setFpgaTempC(float const value)
{
m_Fpga_temp_C = value;
}
float Fpga_status_inner::getHbmTempC() const
{
return m_Hbm_temp_C;
}
void Fpga_status_inner::setHbmTempC(float const value)
{
m_Hbm_temp_C = value;
}
int64_t Fpga_status_inner::getPacketsUdp() const
{
return m_Packets_udp;
}
void Fpga_status_inner::setPacketsUdp(int64_t const value)
{
m_Packets_udp = value;
}
int64_t Fpga_status_inner::getPacketsSls() const
{
return m_Packets_sls;
}
void Fpga_status_inner::setPacketsSls(int64_t const value)
{
m_Packets_sls = value;
}
bool Fpga_status_inner::isIdle() const
{
return m_Idle;
}
void Fpga_status_inner::setIdle(bool const value)
{
m_Idle = value;
}
int64_t Fpga_status_inner::getPcieLinkSpeed() const
{
return m_Pcie_link_speed;
}
void Fpga_status_inner::setPcieLinkSpeed(int64_t const value)
{
m_Pcie_link_speed = value;
}
int64_t Fpga_status_inner::getPcieLinkWidth() const
{
return m_Pcie_link_width;
}
void Fpga_status_inner::setPcieLinkWidth(int64_t const value)
{
m_Pcie_link_width = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,168 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Fpga_status_inner.h
*
*
*/
#ifndef Fpga_status_inner_H_
#define Fpga_status_inner_H_
#include <string>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Fpga_status_inner
{
public:
Fpga_status_inner();
virtual ~Fpga_status_inner() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Fpga_status_inner& rhs) const;
bool operator!=(const Fpga_status_inner& rhs) const;
/////////////////////////////////////////////
/// Fpga_status_inner members
/// <summary>
///
/// </summary>
std::string getPciDevId() const;
void setPciDevId(std::string const& value);
/// <summary>
///
/// </summary>
std::string getSerialNumber() const;
void setSerialNumber(std::string const& value);
/// <summary>
///
/// </summary>
std::string getFwVersion() const;
void setFwVersion(std::string const& value);
/// <summary>
///
/// </summary>
std::string getBaseMacAddr() const;
void setBaseMacAddr(std::string const& value);
/// <summary>
///
/// </summary>
int64_t getEthLinkCount() const;
void setEthLinkCount(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getEthLinkStatus() const;
void setEthLinkStatus(int64_t const value);
/// <summary>
///
/// </summary>
float getPowerUsageW() const;
void setPowerUsageW(float const value);
/// <summary>
///
/// </summary>
float getFpgaTempC() const;
void setFpgaTempC(float const value);
/// <summary>
///
/// </summary>
float getHbmTempC() const;
void setHbmTempC(float const value);
/// <summary>
///
/// </summary>
int64_t getPacketsUdp() const;
void setPacketsUdp(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getPacketsSls() const;
void setPacketsSls(int64_t const value);
/// <summary>
///
/// </summary>
bool isIdle() const;
void setIdle(bool const value);
/// <summary>
/// PCIe link speed measured by generation (expected value is 4 &#x3D;&#x3D; PCIe Gen4)
/// </summary>
int64_t getPcieLinkSpeed() const;
void setPcieLinkSpeed(int64_t const value);
/// <summary>
/// PCIe link width (expected value is 8 &#x3D;&#x3D; x8)
/// </summary>
int64_t getPcieLinkWidth() const;
void setPcieLinkWidth(int64_t const value);
friend void to_json(nlohmann::json& j, const Fpga_status_inner& o);
friend void from_json(const nlohmann::json& j, Fpga_status_inner& o);
protected:
std::string m_Pci_dev_id;
std::string m_Serial_number;
std::string m_Fw_version;
std::string m_Base_mac_addr;
int64_t m_Eth_link_count;
int64_t m_Eth_link_status;
float m_Power_usage_W;
float m_Fpga_temp_C;
float m_Hbm_temp_C;
int64_t m_Packets_udp;
int64_t m_Packets_sls;
bool m_Idle;
int64_t m_Pcie_link_speed;
int64_t m_Pcie_link_width;
};
} // namespace org::openapitools::server::model
#endif /* Fpga_status_inner_H_ */

View File

@@ -1,122 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Geom_refinement_algorithm.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Geom_refinement_algorithm::Geom_refinement_algorithm()
{
}
void Geom_refinement_algorithm::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Geom_refinement_algorithm::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Geom_refinement_algorithm::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Geom_refinement_algorithm" : pathPrefix;
if (m_value == Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Geom_refinement_algorithm::operator==(const Geom_refinement_algorithm& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Geom_refinement_algorithm::operator!=(const Geom_refinement_algorithm& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Geom_refinement_algorithm& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTER:
j = "BeamCenter";
break;
case Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTERSYMMETRY:
j = "BeamCenterSymmetry";
break;
case Geom_refinement_algorithm::eGeom_refinement_algorithm::NONE:
j = "None";
break;
}
}
void from_json(const nlohmann::json& j, Geom_refinement_algorithm& o)
{
auto s = j.get<std::string>();
if (s == "BeamCenter") {
o.setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTER);
}
else if (s == "BeamCenterSymmetry") {
o.setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTERSYMMETRY);
}
else if (s == "None") {
o.setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm::NONE);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Geom_refinement_algorithm::eGeom_refinement_algorithm";
throw std::invalid_argument(ss.str());
}
}
Geom_refinement_algorithm::eGeom_refinement_algorithm Geom_refinement_algorithm::getValue() const
{
return m_value;
}
void Geom_refinement_algorithm::setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,80 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Geom_refinement_algorithm.h
*
* Selection of an post-indexing detector geometry refinement algorithm used by Jungfraujoch. This option is using non-linear least squares optimization to find unit cell and beam center. BeamCenterSymmetry is adding constraints for high-symmetry space groups: orthorhombic, tetragonal, cubic, and hexagonal. For the moment we recommend to use BeamCenterSymmetry only if unit cell is provided, given that the algorithm is not guessing centering properly at the moment.
*/
#ifndef Geom_refinement_algorithm_H_
#define Geom_refinement_algorithm_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Selection of an post-indexing detector geometry refinement algorithm used by Jungfraujoch. This option is using non-linear least squares optimization to find unit cell and beam center. BeamCenterSymmetry is adding constraints for high-symmetry space groups: orthorhombic, tetragonal, cubic, and hexagonal. For the moment we recommend to use BeamCenterSymmetry only if unit cell is provided, given that the algorithm is not guessing centering properly at the moment.
/// </summary>
class Geom_refinement_algorithm
{
public:
Geom_refinement_algorithm();
virtual ~Geom_refinement_algorithm() = default;
enum class eGeom_refinement_algorithm {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
BEAMCENTER,
BEAMCENTERSYMMETRY,
NONE
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Geom_refinement_algorithm& rhs) const;
bool operator!=(const Geom_refinement_algorithm& rhs) const;
/////////////////////////////////////////////
/// Geom_refinement_algorithm members
Geom_refinement_algorithm::eGeom_refinement_algorithm getValue() const;
void setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm value);
friend void to_json(nlohmann::json& j, const Geom_refinement_algorithm& o);
friend void from_json(const nlohmann::json& j, Geom_refinement_algorithm& o);
protected:
Geom_refinement_algorithm::eGeom_refinement_algorithm m_value = Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Geom_refinement_algorithm_H_ */

View File

@@ -1,191 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Grid_scan.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Grid_scan::Grid_scan()
{
m_N_fast = 0L;
m_Step_x_um = 0.0f;
m_Step_y_um = 0.0f;
m_Vertical = false;
m_VerticalIsSet = false;
m_Snake = false;
m_SnakeIsSet = false;
}
void Grid_scan::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Grid_scan::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Grid_scan::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan" : pathPrefix;
/* N_fast */ {
const int64_t& value = m_N_fast;
const std::string currentValuePath = _pathPrefix + ".nFast";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
return success;
}
bool Grid_scan::operator==(const Grid_scan& rhs) const
{
return
(getNFast() == rhs.getNFast())
&&
(getStepXUm() == rhs.getStepXUm())
&&
(getStepYUm() == rhs.getStepYUm())
&&
((!verticalIsSet() && !rhs.verticalIsSet()) || (verticalIsSet() && rhs.verticalIsSet() && isVertical() == rhs.isVertical())) &&
((!snakeIsSet() && !rhs.snakeIsSet()) || (snakeIsSet() && rhs.snakeIsSet() && isSnake() == rhs.isSnake()))
;
}
bool Grid_scan::operator!=(const Grid_scan& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Grid_scan& o)
{
j = nlohmann::json::object();
j["n_fast"] = o.m_N_fast;
j["step_x_um"] = o.m_Step_x_um;
j["step_y_um"] = o.m_Step_y_um;
if(o.verticalIsSet())
j["vertical"] = o.m_Vertical;
if(o.snakeIsSet())
j["snake"] = o.m_Snake;
}
void from_json(const nlohmann::json& j, Grid_scan& o)
{
j.at("n_fast").get_to(o.m_N_fast);
j.at("step_x_um").get_to(o.m_Step_x_um);
j.at("step_y_um").get_to(o.m_Step_y_um);
if(j.find("vertical") != j.end())
{
j.at("vertical").get_to(o.m_Vertical);
o.m_VerticalIsSet = true;
}
if(j.find("snake") != j.end())
{
j.at("snake").get_to(o.m_Snake);
o.m_SnakeIsSet = true;
}
}
int64_t Grid_scan::getNFast() const
{
return m_N_fast;
}
void Grid_scan::setNFast(int64_t const value)
{
m_N_fast = value;
}
float Grid_scan::getStepXUm() const
{
return m_Step_x_um;
}
void Grid_scan::setStepXUm(float const value)
{
m_Step_x_um = value;
}
float Grid_scan::getStepYUm() const
{
return m_Step_y_um;
}
void Grid_scan::setStepYUm(float const value)
{
m_Step_y_um = value;
}
bool Grid_scan::isVertical() const
{
return m_Vertical;
}
void Grid_scan::setVertical(bool const value)
{
m_Vertical = value;
m_VerticalIsSet = true;
}
bool Grid_scan::verticalIsSet() const
{
return m_VerticalIsSet;
}
void Grid_scan::unsetVertical()
{
m_VerticalIsSet = false;
}
bool Grid_scan::isSnake() const
{
return m_Snake;
}
void Grid_scan::setSnake(bool const value)
{
m_Snake = value;
m_SnakeIsSet = true;
}
bool Grid_scan::snakeIsSet() const
{
return m_SnakeIsSet;
}
void Grid_scan::unsetSnake()
{
m_SnakeIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,108 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Grid_scan.h
*
* Definition of a grid scan (mutually exclusive with &#x60;rotation_axis&#x60;)
*/
#ifndef Grid_scan_H_
#define Grid_scan_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Definition of a grid scan (mutually exclusive with &#x60;rotation_axis&#x60;)
/// </summary>
class Grid_scan
{
public:
Grid_scan();
virtual ~Grid_scan() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Grid_scan& rhs) const;
bool operator!=(const Grid_scan& rhs) const;
/////////////////////////////////////////////
/// Grid_scan members
/// <summary>
/// Number of elements in the fast direction
/// </summary>
int64_t getNFast() const;
void setNFast(int64_t const value);
/// <summary>
/// Step in grid along the fast direction. Can be negative. Positive number: left to right Negative number: right to left
/// </summary>
float getStepXUm() const;
void setStepXUm(float const value);
/// <summary>
/// Step in grid along the slow direction. Can be negative. Positive number: top to bottom Negative number: bottom to top
/// </summary>
float getStepYUm() const;
void setStepYUm(float const value);
/// <summary>
/// If disabled: fast direction &#x3D; X, slow direction &#x3D; Y If enabled: fast direction &#x3D; Y, slow direction &#x3D; X
/// </summary>
bool isVertical() const;
void setVertical(bool const value);
bool verticalIsSet() const;
void unsetVertical();
/// <summary>
/// Flip fast direction for every second row
/// </summary>
bool isSnake() const;
void setSnake(bool const value);
bool snakeIsSet() const;
void unsetSnake();
friend void to_json(nlohmann::json& j, const Grid_scan& o);
friend void from_json(const nlohmann::json& j, Grid_scan& o);
protected:
int64_t m_N_fast;
float m_Step_x_um;
float m_Step_y_um;
bool m_Vertical;
bool m_VerticalIsSet;
bool m_Snake;
bool m_SnakeIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Grid_scan_H_ */

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech

View File

@@ -1,9 +1,9 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
* Jungfraujoch Broker Web API
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
* The version of the OpenAPI document: 1.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -23,7 +23,6 @@
#include <sstream>
#include <vector>
#include <map>
#include <set>
namespace org::openapitools::server::helpers
{
@@ -93,15 +92,6 @@ namespace org::openapitools::server::helpers
return true;
}
/// <summary>
/// Determine if the given set<T> only has unique elements.
/// </summary>
template <typename T>
bool hasOnlyUniqueItems(const std::set<T>&)
{
return true;
}
std::string toStringValue(const std::string &value);
std::string toStringValue(const int32_t value);
std::string toStringValue(const int64_t value);

View File

@@ -1,195 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Image_buffer_status.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Image_buffer_status::Image_buffer_status()
{
m_Min_image_number = 0L;
m_Max_image_number = 0L;
m_Total_slots = 0L;
m_Available_slots = 0L;
}
void Image_buffer_status::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Image_buffer_status::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Image_buffer_status::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Image_buffer_status" : pathPrefix;
/* Min_image_number */ {
const int64_t& value = m_Min_image_number;
const std::string currentValuePath = _pathPrefix + ".minImageNumber";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Max_image_number */ {
const int64_t& value = m_Max_image_number;
const std::string currentValuePath = _pathPrefix + ".maxImageNumber";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Image_numbers */ {
const std::vector<int64_t>& value = m_Image_numbers;
const std::string currentValuePath = _pathPrefix + ".imageNumbers";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const int64_t& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
return success;
}
bool Image_buffer_status::operator==(const Image_buffer_status& rhs) const
{
return
(getMinImageNumber() == rhs.getMinImageNumber())
&&
(getMaxImageNumber() == rhs.getMaxImageNumber())
&&
(getImageNumbers() == rhs.getImageNumbers())
&&
(getTotalSlots() == rhs.getTotalSlots())
&&
(getAvailableSlots() == rhs.getAvailableSlots())
;
}
bool Image_buffer_status::operator!=(const Image_buffer_status& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Image_buffer_status& o)
{
j = nlohmann::json::object();
j["min_image_number"] = o.m_Min_image_number;
j["max_image_number"] = o.m_Max_image_number;
j["image_numbers"] = o.m_Image_numbers;
j["total_slots"] = o.m_Total_slots;
j["available_slots"] = o.m_Available_slots;
}
void from_json(const nlohmann::json& j, Image_buffer_status& o)
{
j.at("min_image_number").get_to(o.m_Min_image_number);
j.at("max_image_number").get_to(o.m_Max_image_number);
j.at("image_numbers").get_to(o.m_Image_numbers);
j.at("total_slots").get_to(o.m_Total_slots);
j.at("available_slots").get_to(o.m_Available_slots);
}
int64_t Image_buffer_status::getMinImageNumber() const
{
return m_Min_image_number;
}
void Image_buffer_status::setMinImageNumber(int64_t const value)
{
m_Min_image_number = value;
}
int64_t Image_buffer_status::getMaxImageNumber() const
{
return m_Max_image_number;
}
void Image_buffer_status::setMaxImageNumber(int64_t const value)
{
m_Max_image_number = value;
}
std::vector<int64_t> Image_buffer_status::getImageNumbers() const
{
return m_Image_numbers;
}
void Image_buffer_status::setImageNumbers(std::vector<int64_t> const value)
{
m_Image_numbers = value;
}
int64_t Image_buffer_status::getTotalSlots() const
{
return m_Total_slots;
}
void Image_buffer_status::setTotalSlots(int64_t const value)
{
m_Total_slots = value;
}
int64_t Image_buffer_status::getAvailableSlots() const
{
return m_Available_slots;
}
void Image_buffer_status::setAvailableSlots(int64_t const value)
{
m_Available_slots = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,105 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Image_buffer_status.h
*
*
*/
#ifndef Image_buffer_status_H_
#define Image_buffer_status_H_
#include <vector>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Image_buffer_status
{
public:
Image_buffer_status();
virtual ~Image_buffer_status() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Image_buffer_status& rhs) const;
bool operator!=(const Image_buffer_status& rhs) const;
/////////////////////////////////////////////
/// Image_buffer_status members
/// <summary>
/// Smallest image number available in the buffer
/// </summary>
int64_t getMinImageNumber() const;
void setMinImageNumber(int64_t const value);
/// <summary>
/// Largest image number available in the buffer
/// </summary>
int64_t getMaxImageNumber() const;
void setMaxImageNumber(int64_t const value);
/// <summary>
/// Image numbers currently present in the buffer.
/// </summary>
std::vector<int64_t> getImageNumbers() const;
void setImageNumbers(std::vector<int64_t> const value);
/// <summary>
/// Number of slots in the image buffer. This number, compared to number of images in data collection and frame rate will determine \&quot;retention\&quot; rate of the image buffer.
/// </summary>
int64_t getTotalSlots() const;
void setTotalSlots(int64_t const value);
/// <summary>
/// Slots available for the data collection
/// </summary>
int64_t getAvailableSlots() const;
void setAvailableSlots(int64_t const value);
friend void to_json(nlohmann::json& j, const Image_buffer_status& o);
friend void from_json(const nlohmann::json& j, Image_buffer_status& o);
protected:
int64_t m_Min_image_number;
int64_t m_Max_image_number;
std::vector<int64_t> m_Image_numbers;
int64_t m_Total_slots;
int64_t m_Available_slots;
};
} // namespace org::openapitools::server::model
#endif /* Image_buffer_status_H_ */

View File

@@ -1,339 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Image_format_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Image_format_settings::Image_format_settings()
{
m_Summation = false;
m_Geometry_transform = false;
m_Jungfrau_conversion = false;
m_Jungfrau_conversion_factor_keV = 0.0f;
m_Jungfrau_conversion_factor_keVIsSet = false;
m_Bit_depth_image = 0L;
m_Bit_depth_imageIsSet = false;
m_Signed_output = false;
m_Signed_outputIsSet = false;
m_Mask_module_edges = true;
m_Mask_chip_edges = true;
m_Jungfrau_mask_pixels_without_g0 = true;
m_Jungfrau_mask_pixels_without_g0IsSet = false;
m_Apply_mask = false;
m_Jungfrau_pedestal_g0_rms_limit = 100L;
m_Jungfrau_pedestal_g0_rms_limitIsSet = false;
}
void Image_format_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Image_format_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Image_format_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Image_format_settings" : pathPrefix;
if (jungfrauConversionFactorKeVIsSet())
{
const float& value = m_Jungfrau_conversion_factor_keV;
const std::string currentValuePath = _pathPrefix + ".jungfrauConversionFactorKeV";
if (value < static_cast<float>(0.001))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.001;";
}
if (value > static_cast<float>(500.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 500.0;";
}
}
if (jungfrauPedestalG0RmsLimitIsSet())
{
const int64_t& value = m_Jungfrau_pedestal_g0_rms_limit;
const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalG0RmsLimit";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
bool Image_format_settings::operator==(const Image_format_settings& rhs) const
{
return
(isSummation() == rhs.isSummation())
&&
(isGeometryTransform() == rhs.isGeometryTransform())
&&
(isJungfrauConversion() == rhs.isJungfrauConversion())
&&
((!jungfrauConversionFactorKeVIsSet() && !rhs.jungfrauConversionFactorKeVIsSet()) || (jungfrauConversionFactorKeVIsSet() && rhs.jungfrauConversionFactorKeVIsSet() && getJungfrauConversionFactorKeV() == rhs.getJungfrauConversionFactorKeV())) &&
((!bitDepthImageIsSet() && !rhs.bitDepthImageIsSet()) || (bitDepthImageIsSet() && rhs.bitDepthImageIsSet() && getBitDepthImage() == rhs.getBitDepthImage())) &&
((!signedOutputIsSet() && !rhs.signedOutputIsSet()) || (signedOutputIsSet() && rhs.signedOutputIsSet() && isSignedOutput() == rhs.isSignedOutput())) &&
(isMaskModuleEdges() == rhs.isMaskModuleEdges())
&&
(isMaskChipEdges() == rhs.isMaskChipEdges())
&&
((!jungfrauMaskPixelsWithoutG0IsSet() && !rhs.jungfrauMaskPixelsWithoutG0IsSet()) || (jungfrauMaskPixelsWithoutG0IsSet() && rhs.jungfrauMaskPixelsWithoutG0IsSet() && isJungfrauMaskPixelsWithoutG0() == rhs.isJungfrauMaskPixelsWithoutG0())) &&
(isApplyMask() == rhs.isApplyMask())
&&
((!jungfrauPedestalG0RmsLimitIsSet() && !rhs.jungfrauPedestalG0RmsLimitIsSet()) || (jungfrauPedestalG0RmsLimitIsSet() && rhs.jungfrauPedestalG0RmsLimitIsSet() && getJungfrauPedestalG0RmsLimit() == rhs.getJungfrauPedestalG0RmsLimit()))
;
}
bool Image_format_settings::operator!=(const Image_format_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Image_format_settings& o)
{
j = nlohmann::json::object();
j["summation"] = o.m_Summation;
j["geometry_transform"] = o.m_Geometry_transform;
j["jungfrau_conversion"] = o.m_Jungfrau_conversion;
if(o.jungfrauConversionFactorKeVIsSet())
j["jungfrau_conversion_factor_keV"] = o.m_Jungfrau_conversion_factor_keV;
if(o.bitDepthImageIsSet())
j["bit_depth_image"] = o.m_Bit_depth_image;
if(o.signedOutputIsSet())
j["signed_output"] = o.m_Signed_output;
j["mask_module_edges"] = o.m_Mask_module_edges;
j["mask_chip_edges"] = o.m_Mask_chip_edges;
if(o.jungfrauMaskPixelsWithoutG0IsSet())
j["jungfrau_mask_pixels_without_g0"] = o.m_Jungfrau_mask_pixels_without_g0;
j["apply_mask"] = o.m_Apply_mask;
if(o.jungfrauPedestalG0RmsLimitIsSet())
j["jungfrau_pedestal_g0_rms_limit"] = o.m_Jungfrau_pedestal_g0_rms_limit;
}
void from_json(const nlohmann::json& j, Image_format_settings& o)
{
j.at("summation").get_to(o.m_Summation);
j.at("geometry_transform").get_to(o.m_Geometry_transform);
j.at("jungfrau_conversion").get_to(o.m_Jungfrau_conversion);
if(j.find("jungfrau_conversion_factor_keV") != j.end())
{
j.at("jungfrau_conversion_factor_keV").get_to(o.m_Jungfrau_conversion_factor_keV);
o.m_Jungfrau_conversion_factor_keVIsSet = true;
}
if(j.find("bit_depth_image") != j.end())
{
j.at("bit_depth_image").get_to(o.m_Bit_depth_image);
o.m_Bit_depth_imageIsSet = true;
}
if(j.find("signed_output") != j.end())
{
j.at("signed_output").get_to(o.m_Signed_output);
o.m_Signed_outputIsSet = true;
}
j.at("mask_module_edges").get_to(o.m_Mask_module_edges);
j.at("mask_chip_edges").get_to(o.m_Mask_chip_edges);
if(j.find("jungfrau_mask_pixels_without_g0") != j.end())
{
j.at("jungfrau_mask_pixels_without_g0").get_to(o.m_Jungfrau_mask_pixels_without_g0);
o.m_Jungfrau_mask_pixels_without_g0IsSet = true;
}
j.at("apply_mask").get_to(o.m_Apply_mask);
if(j.find("jungfrau_pedestal_g0_rms_limit") != j.end())
{
j.at("jungfrau_pedestal_g0_rms_limit").get_to(o.m_Jungfrau_pedestal_g0_rms_limit);
o.m_Jungfrau_pedestal_g0_rms_limitIsSet = true;
}
}
bool Image_format_settings::isSummation() const
{
return m_Summation;
}
void Image_format_settings::setSummation(bool const value)
{
m_Summation = value;
}
bool Image_format_settings::isGeometryTransform() const
{
return m_Geometry_transform;
}
void Image_format_settings::setGeometryTransform(bool const value)
{
m_Geometry_transform = value;
}
bool Image_format_settings::isJungfrauConversion() const
{
return m_Jungfrau_conversion;
}
void Image_format_settings::setJungfrauConversion(bool const value)
{
m_Jungfrau_conversion = value;
}
float Image_format_settings::getJungfrauConversionFactorKeV() const
{
return m_Jungfrau_conversion_factor_keV;
}
void Image_format_settings::setJungfrauConversionFactorKeV(float const value)
{
m_Jungfrau_conversion_factor_keV = value;
m_Jungfrau_conversion_factor_keVIsSet = true;
}
bool Image_format_settings::jungfrauConversionFactorKeVIsSet() const
{
return m_Jungfrau_conversion_factor_keVIsSet;
}
void Image_format_settings::unsetJungfrau_conversion_factor_keV()
{
m_Jungfrau_conversion_factor_keVIsSet = false;
}
int64_t Image_format_settings::getBitDepthImage() const
{
return m_Bit_depth_image;
}
void Image_format_settings::setBitDepthImage(int64_t const value)
{
m_Bit_depth_image = value;
m_Bit_depth_imageIsSet = true;
}
bool Image_format_settings::bitDepthImageIsSet() const
{
return m_Bit_depth_imageIsSet;
}
void Image_format_settings::unsetBit_depth_image()
{
m_Bit_depth_imageIsSet = false;
}
bool Image_format_settings::isSignedOutput() const
{
return m_Signed_output;
}
void Image_format_settings::setSignedOutput(bool const value)
{
m_Signed_output = value;
m_Signed_outputIsSet = true;
}
bool Image_format_settings::signedOutputIsSet() const
{
return m_Signed_outputIsSet;
}
void Image_format_settings::unsetSigned_output()
{
m_Signed_outputIsSet = false;
}
bool Image_format_settings::isMaskModuleEdges() const
{
return m_Mask_module_edges;
}
void Image_format_settings::setMaskModuleEdges(bool const value)
{
m_Mask_module_edges = value;
}
bool Image_format_settings::isMaskChipEdges() const
{
return m_Mask_chip_edges;
}
void Image_format_settings::setMaskChipEdges(bool const value)
{
m_Mask_chip_edges = value;
}
bool Image_format_settings::isJungfrauMaskPixelsWithoutG0() const
{
return m_Jungfrau_mask_pixels_without_g0;
}
void Image_format_settings::setJungfrauMaskPixelsWithoutG0(bool const value)
{
m_Jungfrau_mask_pixels_without_g0 = value;
m_Jungfrau_mask_pixels_without_g0IsSet = true;
}
bool Image_format_settings::jungfrauMaskPixelsWithoutG0IsSet() const
{
return m_Jungfrau_mask_pixels_without_g0IsSet;
}
void Image_format_settings::unsetJungfrau_mask_pixels_without_g0()
{
m_Jungfrau_mask_pixels_without_g0IsSet = false;
}
bool Image_format_settings::isApplyMask() const
{
return m_Apply_mask;
}
void Image_format_settings::setApplyMask(bool const value)
{
m_Apply_mask = value;
}
int64_t Image_format_settings::getJungfrauPedestalG0RmsLimit() const
{
return m_Jungfrau_pedestal_g0_rms_limit;
}
void Image_format_settings::setJungfrauPedestalG0RmsLimit(int64_t const value)
{
m_Jungfrau_pedestal_g0_rms_limit = value;
m_Jungfrau_pedestal_g0_rms_limitIsSet = true;
}
bool Image_format_settings::jungfrauPedestalG0RmsLimitIsSet() const
{
return m_Jungfrau_pedestal_g0_rms_limitIsSet;
}
void Image_format_settings::unsetJungfrau_pedestal_g0_rms_limit()
{
m_Jungfrau_pedestal_g0_rms_limitIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,156 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Image_format_settings.h
*
*
*/
#ifndef Image_format_settings_H_
#define Image_format_settings_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Image_format_settings
{
public:
Image_format_settings();
virtual ~Image_format_settings() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Image_format_settings& rhs) const;
bool operator!=(const Image_format_settings& rhs) const;
/////////////////////////////////////////////
/// Image_format_settings members
/// <summary>
/// Enable summation of images to a given image_time If disabled images are saved according to original detector speed, but image count is adjusted
/// </summary>
bool isSummation() const;
void setSummation(bool const value);
/// <summary>
/// Place module read-out into their location on composed detector and extend multipixels
/// </summary>
bool isGeometryTransform() const;
void setGeometryTransform(bool const value);
/// <summary>
/// Convert pixel value in ADU to photon counts/energy Only affects JUNGFRAU detector
/// </summary>
bool isJungfrauConversion() const;
void setJungfrauConversion(bool const value);
/// <summary>
/// Used to convert energy deposited into pixel to counts If not provided incident_energy_keV is used
/// </summary>
float getJungfrauConversionFactorKeV() const;
void setJungfrauConversionFactorKeV(float const value);
bool jungfrauConversionFactorKeVIsSet() const;
void unsetJungfrau_conversion_factor_keV();
/// <summary>
/// Bit depth of resulting image (it doesn&#39;t affect the detector read-out value) If not provided value is adjusted automatically
/// </summary>
int64_t getBitDepthImage() const;
void setBitDepthImage(int64_t const value);
bool bitDepthImageIsSet() const;
void unsetBit_depth_image();
/// <summary>
/// Controls if pixels have signed output If not provided value is adjusted automatically
/// </summary>
bool isSignedOutput() const;
void setSignedOutput(bool const value);
bool signedOutputIsSet() const;
void unsetSigned_output();
/// <summary>
/// Mask 1 pixel on the module boundary
/// </summary>
bool isMaskModuleEdges() const;
void setMaskModuleEdges(bool const value);
/// <summary>
/// Mask multipixels on chip boundary
/// </summary>
bool isMaskChipEdges() const;
void setMaskChipEdges(bool const value);
/// <summary>
/// JUNGFRAU: mask pixels that don&#39;t operate in G0, but do operate in G1 and G1. This should be turned off for cases, where detector is operated at room temperature with long exposure time.
/// </summary>
bool isJungfrauMaskPixelsWithoutG0() const;
void setJungfrauMaskPixelsWithoutG0(bool const value);
bool jungfrauMaskPixelsWithoutG0IsSet() const;
void unsetJungfrau_mask_pixels_without_g0();
/// <summary>
/// Masked pixels are set to special value in the images produced by Jungfraujoch
/// </summary>
bool isApplyMask() const;
void setApplyMask(bool const value);
/// <summary>
/// Pixels with pedestal G0 RMS above the threshold are marked as masked pixels
/// </summary>
int64_t getJungfrauPedestalG0RmsLimit() const;
void setJungfrauPedestalG0RmsLimit(int64_t const value);
bool jungfrauPedestalG0RmsLimitIsSet() const;
void unsetJungfrau_pedestal_g0_rms_limit();
friend void to_json(nlohmann::json& j, const Image_format_settings& o);
friend void from_json(const nlohmann::json& j, Image_format_settings& o);
protected:
bool m_Summation;
bool m_Geometry_transform;
bool m_Jungfrau_conversion;
float m_Jungfrau_conversion_factor_keV;
bool m_Jungfrau_conversion_factor_keVIsSet;
int64_t m_Bit_depth_image;
bool m_Bit_depth_imageIsSet;
bool m_Signed_output;
bool m_Signed_outputIsSet;
bool m_Mask_module_edges;
bool m_Mask_chip_edges;
bool m_Jungfrau_mask_pixels_without_g0;
bool m_Jungfrau_mask_pixels_without_g0IsSet;
bool m_Apply_mask;
int64_t m_Jungfrau_pedestal_g0_rms_limit;
bool m_Jungfrau_pedestal_g0_rms_limitIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Image_format_settings_H_ */

View File

@@ -1,128 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Image_pusher_type.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Image_pusher_type::Image_pusher_type()
{
}
void Image_pusher_type::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Image_pusher_type::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Image_pusher_type::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Image_pusher_type" : pathPrefix;
if (m_value == Image_pusher_type::eImage_pusher_type::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Image_pusher_type::operator==(const Image_pusher_type& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Image_pusher_type::operator!=(const Image_pusher_type& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Image_pusher_type& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Image_pusher_type::eImage_pusher_type::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Image_pusher_type::eImage_pusher_type::ZEROMQ:
j = "ZeroMQ";
break;
case Image_pusher_type::eImage_pusher_type::HDF5:
j = "HDF5";
break;
case Image_pusher_type::eImage_pusher_type::CBOR:
j = "CBOR";
break;
case Image_pusher_type::eImage_pusher_type::NONE:
j = "None";
break;
}
}
void from_json(const nlohmann::json& j, Image_pusher_type& o)
{
auto s = j.get<std::string>();
if (s == "ZeroMQ") {
o.setValue(Image_pusher_type::eImage_pusher_type::ZEROMQ);
}
else if (s == "HDF5") {
o.setValue(Image_pusher_type::eImage_pusher_type::HDF5);
}
else if (s == "CBOR") {
o.setValue(Image_pusher_type::eImage_pusher_type::CBOR);
}
else if (s == "None") {
o.setValue(Image_pusher_type::eImage_pusher_type::NONE);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Image_pusher_type::eImage_pusher_type";
throw std::invalid_argument(ss.str());
}
}
Image_pusher_type::eImage_pusher_type Image_pusher_type::getValue() const
{
return m_value;
}
void Image_pusher_type::setValue(Image_pusher_type::eImage_pusher_type value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,81 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Image_pusher_type.h
*
*
*/
#ifndef Image_pusher_type_H_
#define Image_pusher_type_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Image_pusher_type
{
public:
Image_pusher_type();
virtual ~Image_pusher_type() = default;
enum class eImage_pusher_type {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
ZEROMQ,
HDF5,
CBOR,
NONE
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Image_pusher_type& rhs) const;
bool operator!=(const Image_pusher_type& rhs) const;
/////////////////////////////////////////////
/// Image_pusher_type members
Image_pusher_type::eImage_pusher_type getValue() const;
void setValue(Image_pusher_type::eImage_pusher_type value);
friend void to_json(nlohmann::json& j, const Image_pusher_type& o);
friend void from_json(const nlohmann::json& j, Image_pusher_type& o);
protected:
Image_pusher_type::eImage_pusher_type m_value = Image_pusher_type::eImage_pusher_type::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Image_pusher_type_H_ */

View File

@@ -1,128 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Indexing_algorithm.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Indexing_algorithm::Indexing_algorithm()
{
}
void Indexing_algorithm::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Indexing_algorithm::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Indexing_algorithm::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_algorithm" : pathPrefix;
if (m_value == Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Indexing_algorithm::operator==(const Indexing_algorithm& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Indexing_algorithm::operator!=(const Indexing_algorithm& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Indexing_algorithm& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Indexing_algorithm::eIndexing_algorithm::FFBIDX:
j = "FFBIDX";
break;
case Indexing_algorithm::eIndexing_algorithm::FFT:
j = "FFT";
break;
case Indexing_algorithm::eIndexing_algorithm::AUTO:
j = "Auto";
break;
case Indexing_algorithm::eIndexing_algorithm::NONE:
j = "None";
break;
}
}
void from_json(const nlohmann::json& j, Indexing_algorithm& o)
{
auto s = j.get<std::string>();
if (s == "FFBIDX") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::FFBIDX);
}
else if (s == "FFT") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::FFT);
}
else if (s == "Auto") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::AUTO);
}
else if (s == "None") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::NONE);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Indexing_algorithm::eIndexing_algorithm";
throw std::invalid_argument(ss.str());
}
}
Indexing_algorithm::eIndexing_algorithm Indexing_algorithm::getValue() const
{
return m_value;
}
void Indexing_algorithm::setValue(Indexing_algorithm::eIndexing_algorithm value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,81 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
*
* The version of the OpenAPI document: 1.0.0-rc.80
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Indexing_algorithm.h
*
* Selection of an indexing algorithm used by Jungfraujoch
*/
#ifndef Indexing_algorithm_H_
#define Indexing_algorithm_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Selection of an indexing algorithm used by Jungfraujoch
/// </summary>
class Indexing_algorithm
{
public:
Indexing_algorithm();
virtual ~Indexing_algorithm() = default;
enum class eIndexing_algorithm {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
FFBIDX,
FFT,
AUTO,
NONE
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Indexing_algorithm& rhs) const;
bool operator!=(const Indexing_algorithm& rhs) const;
/////////////////////////////////////////////
/// Indexing_algorithm members
Indexing_algorithm::eIndexing_algorithm getValue() const;
void setValue(Indexing_algorithm::eIndexing_algorithm value);
friend void to_json(nlohmann::json& j, const Indexing_algorithm& o);
friend void from_json(const nlohmann::json& j, Indexing_algorithm& o);
protected:
Indexing_algorithm::eIndexing_algorithm m_value = Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Indexing_algorithm_H_ */

Some files were not shown because too many files have changed in this diff Show More