Compare commits

..

40 Commits

Author SHA1 Message Date
bebcc634da Merge branch '2411-1.0.0-rc.24-fixes' into 'main'
Fix to CI (no new release)

See merge request jungfraujoch/nextgendcu!98
2024-11-17 15:47:52 +01:00
b56d3a1461 FIX CI 2024-11-17 15:45:15 +01:00
6912541107 Merge branch '2410-new-fpga-release' into 'main'
version 1.0.0-rc.24

See merge request jungfraujoch/nextgendcu!97
2024-11-17 14:55:09 +01:00
adc13ff33e version 1.0.0-rc.24 2024-11-17 14:55:09 +01:00
aeeae33ad9 Merge branch '2410-python-client-build' into 'main'
Python client is built in CI (no new release)

See merge request jungfraujoch/nextgendcu!96
2024-10-23 21:13:22 +02:00
24bb82c8f7 Python client is built in CI (no new release) 2024-10-23 21:13:22 +02:00
b32a37da32 Merge branch '2410-ci-git-psi-ch-fix' into 'main'
Fix for pipeline (no new release!)

See merge request jungfraujoch/nextgendcu!95
2024-10-23 20:05:05 +02:00
631a9d5312 Fix for pipeline (no new release!) 2024-10-23 20:05:05 +02:00
89b692551b Merge branch '2410-count-time-error' into 'main'
Version 1.0.0-rc.23

See merge request jungfraujoch/nextgendcu!94
2024-10-23 19:03:09 +02:00
4e57c3cda4 Version 1.0.0-rc.23 2024-10-23 19:03:09 +02:00
c0fd38880c Merge branch '2410-raw-data-fix' into 'main'
Fix seg fault with raw data

See merge request jungfraujoch/nextgendcu!93
2024-10-23 16:20:48 +02:00
5034121c0b Fix seg fault with raw data + improve data processing settings display in Frontend 2024-10-23 16:20:48 +02:00
72e3aae608 Merge branch '2410-1.0.0-rc.21' into 'main'
version 1.0.0-rc.21

See merge request jungfraujoch/nextgendcu!92
2024-10-23 10:16:37 +02:00
36e3a59802 version 1.0.0-rc.21 2024-10-23 10:16:37 +02:00
950c580558 Merge branch '2410-release-fix' into 'main'
CI: Remove FPGA build from CI

See merge request jungfraujoch/nextgendcu!91
2024-10-22 08:52:07 +02:00
3c556c69c5 CI: Remove FPGA build from CI 2024-10-22 08:18:55 +02:00
0f6d02a878 Merge branch '2410-rx19-fixes' into 'main'
version 1.0.0-rc.20

See merge request jungfraujoch/nextgendcu!90
2024-10-21 13:30:56 +02:00
40c1e3d49f version 1.0.0-rc.20 2024-10-21 13:30:56 +02:00
abf7072ee1 Merge branch '2410-rc.18-quick-fixes' into 'main'
version 1.0.0-rc.19

See merge request jungfraujoch/nextgendcu!89
2024-10-18 20:17:29 +02:00
2e62cb1738 version 1.0.0-rc.19 2024-10-18 20:17:29 +02:00
e6eb7af5ae Merge branch '2410-1.0.0.rc-18.fixes' into 'main'
Fixes to version 1.0.0-rc.18

See merge request jungfraujoch/nextgendcu!88
2024-10-17 16:29:39 +02:00
c9eb2ca65d Fixes to version 1.0.0-rc.18 2024-10-17 16:29:38 +02:00
3d9c93c32a Merge branch '2410-1.0.0-rc.18' into 'main'
version 1.0.0-rc.18

See merge request jungfraujoch/nextgendcu!87
2024-10-16 19:52:01 +02:00
1d7e5f173d version 1.0.0-rc.18 2024-10-16 19:52:01 +02:00
bc8afdcb55 Merge branch '2410-fpga-8x10g' into 'main'
Fixes to 8x10g FPGA image and frontend

See merge request jungfraujoch/nextgendcu!86
2024-10-16 09:12:24 +02:00
4ae0668f2f Fixes to 8x10g FPGA image and frontend 2024-10-16 09:12:24 +02:00
4cf20ae71b Merge branch '2410-rc.17-fixes' into 'main'
xbflash.qspi: Add tool from Xilinx to flash cards (it is a nightmare to...

See merge request jungfraujoch/nextgendcu!85
2024-10-15 09:27:22 +02:00
c7d255de6f xbflash.qspi: Add tool from Xilinx to flash cards (it is a nightmare to... 2024-10-15 09:27:22 +02:00
7cc6f4508a Merge branch '2410-1.0.0-rc.17-2' into 'main'
version 1.0.0-rc.17

See merge request jungfraujoch/nextgendcu!84
2024-10-14 15:03:38 +02:00
ce19996874 version 1.0.0-rc.17 2024-10-14 15:03:38 +02:00
ad579f5d22 Merge branch '2410-pistache-version' into 'main'
version1.0.0-rc.16 fixes

See merge request jungfraujoch/nextgendcu!83
2024-10-11 16:43:06 +02:00
26408608d4 version1.0.0-rc.16 fixes 2024-10-11 16:43:06 +02:00
e92169a244 Merge branch '2410-1.0.0-rc.16-fixes' into 'main'
version1.0.0-rc.16 fixes

See merge request jungfraujoch/nextgendcu!82
2024-10-11 13:21:26 +02:00
6aa43e6b7e version1.0.0-rc.16 fixes 2024-10-11 13:21:26 +02:00
2203513ffb Merge branch '2410-1.0.0-rc.16' into 'main'
version 1.0.0-rc.16

See merge request jungfraujoch/nextgendcu!81
2024-10-11 11:11:37 +02:00
b605b95127 version 1.0.0-rc.16 2024-10-11 11:11:37 +02:00
040c43084e Merge branch '2410-eiger-test' into 'main'
version 1.0.0-rc.15

See merge request jungfraujoch/nextgendcu!80
2024-10-08 21:04:09 +02:00
95eaad3d35 version 1.0.0-rc.15 2024-10-08 21:04:09 +02:00
7a23eade30 Merge branch '2410-pedestal-no-window' into 'main'
version 1.0.0-rc.14

See merge request jungfraujoch/nextgendcu!79
2024-10-07 11:56:40 +02:00
3be959f272 version 1.0.0-rc.14 2024-10-07 11:56:40 +02:00
513 changed files with 21261 additions and 28137 deletions

2
.gitignore vendored
View File

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

View File

@@ -16,7 +16,7 @@ build:x86:gcc:
script:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j48
@@ -45,37 +45,22 @@ build:x86:driver:
- 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:vitis_hls:
build:x86:python_client:
stage: build
tags:
- 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
tags:
- python
script:
- source /opt/Xilinx/Vitis_HLS/2022.1/settings64.sh
- mkdir build
- cd build
- /usr/bin/cmake ..
- make hls
- bash gen_python_client.sh
artifacts:
paths:
- jfjoch_client-*whl
- jfjoch-client-*tar.gz
expire_in: 1 week
build:x86:frontend:
stage: build
@@ -103,7 +88,7 @@ build:x86:rpm:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release ..
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=ON ..
- make frontend
- make -j48 package
- mv *.rpm ..
@@ -125,7 +110,7 @@ test:x86:gcc:
- 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 ..
@@ -153,7 +138,7 @@ test:x86:crystfel:
- 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 ..
@@ -176,7 +161,7 @@ test:x86:xds_durin:
- 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 ..
@@ -222,7 +207,7 @@ test:x86:xia2.ssx:
- 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
@@ -233,34 +218,45 @@ test:x86:xia2.ssx:
- 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:vivado_pcie_100g:
synthesis:hls:
stage: synthesis
dependencies: []
variables:
CC: gcc
CXX: g++
rules:
- 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
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
allow_failure: true
- if: $CI_COMMIT_MESSAGE =~ /^HLS/
tags:
- vivado
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- mkdir -p build
- cd build
- /usr/bin/cmake ..
- make hls
needs: ["build:x86:gcc", "test:x86:gcc"]
synthesis:100g:
stage: synthesis
dependencies: []
retry: 2
variables:
CC: gcc
CXX: g++
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
tags:
- vivado
artifacts:
paths:
- "jfjoch_fpga_pcie_100g.mcs"
expire_in: 1 week
script:
- source /opt/rh/gcc-toolset-12/enable
- 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 ..
@@ -268,61 +264,18 @@ synthesis:vivado_pcie_100g:
- mv fpga/jfjoch_fpga_pcie_100g.mcs ..
needs: ["build:x86:gcc", "test:x86:gcc"]
synthesis:vivado_pcie_100g_anlt:
synthesis:8x10g:
stage: synthesis
dependencies: []
variables:
CC: gcc
CXX: g++
rules:
- 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
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
retry: 2
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
tags:
- vivado
retry: 2
artifacts:
paths:
- "jfjoch_fpga_pcie_100g_anlt.mcs"
expire_in: 1 week
script:
- 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_anlt
- mv fpga/jfjoch_fpga_pcie_100g_anlt.mcs ..
needs: ["build:x86:gcc", "test:x86:gcc"]
synthesis:vivado_pcie_8x10g:
stage: synthesis
dependencies: []
variables:
CC: gcc
CXX: g++
rules:
- 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
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
allow_failure: true
tags:
- vivado
retry: 2
artifacts:
paths:
- "jfjoch_fpga_pcie_8x10g.mcs"
@@ -330,7 +283,6 @@ synthesis:vivado_pcie_8x10g:
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- touch jfjoch_fpga_pcie_8x10g.mcs
- mkdir -p build
- cd build
- /usr/bin/cmake ..
@@ -345,138 +297,10 @@ release:
when: manual
tags:
- x86
dependencies:
- synthesis:vivado_pcie_8x10g
- synthesis:vivado_pcie_100g
- synthesis:vivado_pcie_100g_anlt
- build:x86:frontend
- build:x86:driver
- build:x86:rpm
script:
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
- '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_100g_anlt.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g_anlt.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_SEM" --tag-name $PACKAGE_VERSION_SEM
--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\"}"
--assets-link "{\"name\":\"jfjoch_fpga_pcie_100g_anlt.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g_anlt.mcs\"}"
--assets-link "{\"name\":\"jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
--assets-link "{\"name\":\"jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
--assets-link "{\"name\":\"jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"link_type\":\"package\"}"
release_no_fpga:
stage: release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
tags:
- x86
- python
dependencies:
- build:x86:frontend
- build:x86:driver
- build:x86:rpm
- build:x86:python_client
script:
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
- '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"'
- >
release-cli create --name "Release $PACKAGE_VERSION_SEM" --tag-name $PACKAGE_VERSION_SEM
--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-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
--assets-link "{\"name\":\"jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
--assets-link "{\"name\":\"jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"link_type\":\"package\"}"
--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\"}"
--assets-link "{\"name\":\"jfjoch_fpga_pcie_100g_anlt.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g_anlt.mcs\"}"
upload_fpga_100g:
stage: release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
when: manual
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- fpga/hls/*
- fpga/hdl/*
- fpga/scripts/*
- fpga/xdc/*
- fpga/pcie_driver/jfjoch_fpga.h
when: manual
tags:
- x86
dependencies:
- synthesis:vivado_pcie_100g
script:
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs"'
upload_fpga_8x10g:
stage: release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
when: manual
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- fpga/hls/*
- fpga/hdl/*
- fpga/scripts/*
- fpga/xdc/*
- fpga/pcie_driver/jfjoch_fpga.h
when: manual
tags:
- x86
dependencies:
- synthesis:vivado_pcie_8x10g
script:
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_8x10g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs"'
upload_fpga_100g_anlt:
stage: release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
when: manual
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- fpga/hls/*
- fpga/hdl/*
- fpga/scripts/*
- fpga/xdc/*
- fpga/pcie_driver/jfjoch_fpga.h
when: manual
tags:
- x86
dependencies:
- synthesis:vivado_pcie_100g_anlt
script:
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g_anlt.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g_anlt.mcs"'
- bash gitlab_upload_release.sh

View File

@@ -1,42 +0,0 @@
stages:
- mirror
- build
- publish
mirror-psi:
stage: mirror
tags:
- docker-shared
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

@@ -8,8 +8,8 @@ SET(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED True)
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(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-deprecated-enum-enum-conversion")
SET(CMAKE_C_FLAGS_RELEASE "-O3")
SET(BUILD_SHARED_LIBS OFF)
SET(BUILD_TESTING OFF)
@@ -36,6 +36,8 @@ SET(HDF5_EXTERNALLY_CONFIGURED 1)
SET(jbig OFF)
SET(zstd OFF)
SET(lzma OFF)
SET(jpeg OFF)
SET(old-jpeg OFF)
INCLUDE(CheckLanguage)
CHECK_LANGUAGE(CUDA)
@@ -51,7 +53,8 @@ IF (CMAKE_CUDA_COMPILER)
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")
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)")
INCLUDE_DIRECTORIES(include)
INCLUDE(CheckIncludeFile)
@@ -73,10 +76,13 @@ FetchContent_Declare(hdf5
GIT_SHALLOW 1
EXCLUDE_FROM_ALL)
SET(PISTACHE_USE_CONTENT_ENCODING_DEFLATE ON)
SET(PISTACHE_BUILD_TESTS OFF)
FetchContent_Declare(
pistache_http
GIT_REPOSITORY https://github.com/fleon-psi/pistache
GIT_TAG 51553b92cc7bb25ac792462722ddd4fae33d14b1
GIT_TAG 784955df8bbef471924d1631606f0f2a2f93d570
EXCLUDE_FROM_ALL
)
@@ -90,8 +96,8 @@ FetchContent_Declare(
FetchContent_Declare(
sls_detector_package
GIT_REPOSITORY https://github.com/fleon-psi/slsDetectorPackage
GIT_TAG bae261433241ff2f458350e26ab026f00f01c427
GIT_REPOSITORY https://github.com/slsdetectorgroup/slsDetectorPackage
GIT_TAG 8.0.2
)
FetchContent_Declare(
@@ -136,16 +142,17 @@ IF (NOT JFJOCH_WRITER_ONLY)
COMMAND bash update_version.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
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")
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()
@@ -156,8 +163,17 @@ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Set Package Name
set(CPACK_PACKAGE_NAME "jfjoch")
IF (JFJOCH_INSTALL_DRIVER_SOURCE)
SET(CPACK_COMPONENTS_ALL jfjoch writer driver-dkms)
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)
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src)
ELSE()
SET(CPACK_COMPONENTS_ALL jfjoch writer)
ENDIF()
SET(CPACK_COMPONENTS_ALL jfjoch writer driver-dkms)
SET(CPACK_GENERATOR RPM)
SET(CPACK_RPM_COMPONENT_INSTALL ON)
SET(CPACK_RPM_MAIN_COMPONENT jfjoch)
@@ -167,11 +183,6 @@ 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_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)
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src)
# Set The Vendor Name
SET(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")

6
LICENSE Normal file
View File

@@ -0,0 +1,6 @@
Operating Jungfraujoch requires license from the Paul Scherrer Institute.
Specifically, non-profit research facilities operating PSI JUNGFRAU and PSI EIGER detectors are granted the license to use the
code and binary images within their facilities, as well as to modify the code according to their needs.
Sharing the code requires explicit permission from the Paul Scherrer Institute.

130
README.md
View File

@@ -2,132 +2,4 @@
Application to receive data from the PSI JUNGFRAU and EIGER detectors.
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)
* AMD University Program with donation of licenses of Ethernet IP cores and Vivado software
## License
Operating Jungfraujoch requires license from the Paul Scherrer Institute.
Sharing the code requires explicit permission from the Paul Scherrer Institute.
## Hardware requirements
1. PSI JUNGFRAU or EIGER detector
2. Server system with AMD/Xilinx Alveo U55C cards and optionally Nvidia GPUs
At the moment only AMD Alveo U55C card is supported by Jungfraujoch.
Nvidia L4 GPU is recommended for indexing and used for performance tuning.
## FPGA bitstream
Instructions see [here](fpga/README.md)
## Detector
Jungfraujoch supports PSI JUNGFRAU and EIGER detectors. Jungfruajoch controls the detector via statically compiled `slsDetectorPackage` into its source code.
It is important that detector firmware has to match `slsDetectorPackage` version used in Jungfraujoch (8.0.2 at the moment).
See [PSI Detector group website](https://www.psi.ch/en/lxn/software-releases) for details.
## 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
* JPEG library (turbo-jpeg is also OK)
Optional:
* CUDA compiler version 11 or newer - required for MX fast feedback indexer
* NUMA library - to pin threads to nodes/CPUs
* Node.js - to make frontend
Automatically downloaded by CMake and statically linked:
* 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)
* HDF5 library - see [github.com/HDFGroup/hdf5](https://github.com/HDFGroup/hdf5)
* TIFF library - see [gitlab.com/libtiff/libtiff](https://gitlab.com/libtiff/libtiff)
Please follow the link provided above to check for LICENSE file. Building code with dependencies above requires access from the build system to github.com.
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:
```
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:
```
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/](frontend) directory.
Jungfraujoch Cmake scripts have an option to start frontend build with the following command:
```
mkdir build
cd build
cmake ..
make frontend
```
Contrary to standard CMake way, frontend will be built in "source" `frontend/build` directory, not in `build/` subdirectory.
## Tests
Automated test routine is then accessible as `tests/jfjoch_test`. 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.
All documentation is now placed in [docs/](docs/) subdirectory.

View File

@@ -1 +1 @@
1.0.0-rc.13
1.0.0-rc.24

View File

@@ -21,7 +21,7 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_
(experiment.GetDetectorMode() == DetectorMode::PedestalG2))
expected_frames = experiment.GetFrameNum();
else
expected_frames = experiment.GetImageNum();
expected_frames = experiment.GetFrameNum() / experiment.GetFPGASummation();
nmodules = experiment.GetModulesNum(data_stream);
if (nmodules > max_modules)
@@ -35,23 +35,19 @@ 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 = 256 * experiment.GetSummation();
expected_packets_per_module = 512 * experiment.GetFPGASummation();
if (experiment.GetByteDepthReadout() == 4)
bytes_per_packet = 4096LU;
else if (experiment.GetByteDepthReadout() == 1)
bytes_per_packet = 1024LU; // Need to seriously refactor, to have expected_packets_per_module specific for detector
else
bytes_per_packet = 2048LU;
}
void AcquisitionCounters::UpdateCounters(const Completion *c) {
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,
"UpdateCounters wrong module number: " + std::to_string(c->module_number) + " for frame " + std::to_string(c->frame_number) +
@@ -145,6 +141,8 @@ 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);
@@ -158,7 +156,8 @@ 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;
}
@@ -217,3 +216,7 @@ uint64_t AcquisitionCounters::GetExpectedPacketsPerModule() const {
uint64_t AcquisitionCounters::GetModuleNumber() const {
return nmodules;
}
uint64_t AcquisitionCounters::GetBytesReceived() const {
return GetTotalPackets() * bytes_per_packet;
}

View File

@@ -36,6 +36,7 @@ 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;
@@ -61,6 +62,7 @@ public:
uint64_t GetTotalPackets() const;
uint64_t GetTotalPackets(uint16_t module_number) const;
uint64_t GetBytesReceived() const;
uint64_t GetExpectedPackets() const;
uint64_t GetExpectedPacketsPerModule() const;

View File

@@ -8,7 +8,6 @@
#include <thread>
#include <fstream>
#include <cmath>
#include <sstream>
#include "../common/JFJochException.h"
#include "AcquisitionDevice.h"
@@ -53,7 +52,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.GetSummation();
expected_frames = experiment.GetFrameNum() / experiment.GetFPGASummation();
// Ensure internal WR queue is empty
work_request_queue.Clear();
@@ -75,7 +74,7 @@ void AcquisitionDevice::StartAction(const DiffractionExperiment &experiment, uin
RunInternalGenerator(experiment);
}
void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
void AcquisitionDevice::WaitForActionComplete() {
auto c = work_completion_queue.GetBlocking();
while (c.type != Completion::Type::End) {
@@ -92,9 +91,8 @@ void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
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) && !c.pedestal) {
if (c.frame_number >= expected_frames) {
Cancel();
// this frame is not of any interest, therefore its location can be immediately released
SendWorkRequest(c.handle);
@@ -104,14 +102,6 @@ void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
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 (pedestal_mode && !c.pedestal) {
try {
counters.UpdateCounters(&c);
} catch (const JFJochException &e) {
if (logger)
logger->ErrorException(e);
}
SendWorkRequest(c.handle);
} else {
try {
counters.UpdateCounters(&c);
@@ -141,7 +131,7 @@ void AcquisitionDevice::SendWorkRequest(uint32_t handle) {
}
uint64_t AcquisitionDevice::GetBytesReceived() const {
return counters.GetTotalPackets() * 4096LU;
return counters.GetBytesReceived();
}
const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t frame_number, uint16_t module_number) const {
@@ -152,14 +142,6 @@ 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");
@@ -186,6 +168,8 @@ 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) {
std::vector<uint16_t> tmp(RAW_MODULE_SIZE);
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
@@ -196,6 +180,13 @@ void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment
}
}
void AcquisitionDevice::InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++)
InitializePixelMask(mask.GetMaskRaw().data() + RAW_MODULE_SIZE * (offset + m), m);
}
void AcquisitionDevice::MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node) {
try {
for (int i = 0; i < c2h_buffer_count; i++)
@@ -280,14 +271,6 @@ 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;
@@ -304,6 +287,7 @@ void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experi
break;
case DetectorType::EIGER:
config.detector_type = SLS_DETECTOR_TYPE_EIGER;
config.eiger_bit_depth = experiment.GetByteDepthReadout() * 8;
break;
}
HW_RunInternalGenerator(config);

View File

@@ -11,6 +11,7 @@
#include "../common/Definitions.h"
#include "../common/DiffractionExperiment.h"
#include "../common/Logger.h"
#include "../common/PixelMask.h"
#include "../common/ThreadSafeFIFO.h"
#include "../jungfrau/JFCalibration.h"
@@ -31,8 +32,6 @@ 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;
@@ -75,7 +74,7 @@ public:
void StartAction(const DiffractionExperiment &experiment, uint32_t optional_flags = 0);
void PrepareAction(const DiffractionExperiment &experiment);
void WaitForActionComplete(bool pedestal_mode = false);
void WaitForActionComplete();
virtual void Cancel() = 0;
void EnableLogging(Logger *logger);
@@ -87,7 +86,6 @@ 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,6 +95,8 @@ 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 InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask);
virtual void InitializePixelMask(const uint32_t *module_mask, size_t module_number);
void InitializeROIMap(const DiffractionExperiment &experiment);
const AcquisitionCounters& Counters() const;
@@ -108,8 +108,6 @@ public:
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

@@ -38,11 +38,6 @@ 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);

View File

@@ -17,7 +17,6 @@ public:
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

@@ -17,7 +17,6 @@ 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

@@ -19,8 +19,6 @@ void FPGAAcquisitionDevice::Finalize() {
while (!HW_IsIdle())
std::this_thread::sleep_for(std::chrono::milliseconds(1));
SetDataSource(default_data_source);
}
void FPGAAcquisitionDevice::ReadWorkCompletionThread() {
@@ -137,6 +135,14 @@ 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);
@@ -217,7 +223,7 @@ 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.GetSummation() - 1;
job.nsummation = x.GetFPGASummation() - 1;
expected_descriptors_per_module = DMA_DESCRIPTORS_PER_MODULE;
@@ -230,8 +236,18 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
if (!x.IsPixelSigned())
job.mode |= MODE_UNSIGNED;
if (x.GetByteDepthImage() == 4)
job.mode |= MODE_32BIT;
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;
@@ -249,11 +265,6 @@ 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);
@@ -282,40 +293,10 @@ 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

@@ -10,7 +10,6 @@ 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,17 +32,11 @@ 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,
@@ -51,10 +44,8 @@ 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

@@ -19,12 +19,12 @@ HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buf
}
void HLSSimulatedDevice::CreateFinalPacket(const DiffractionExperiment& experiment) {
device->CreateFinalPacket(experiment);
device->CreateFinalPacket();
}
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(experiment, frame_number, eth_packet, module_number, data, adjust_axis, user);
device->CreateJFPacket(frame_number, eth_packet, module_number, data, adjust_axis, user);
}
void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames,
@@ -38,7 +38,7 @@ 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(experiment, frame_number, eth_packet, module_number, col, row, data);
device->CreateEIGERPacket(frame_number, eth_packet, module_number, col, row, data);
}
void HLSSimulatedDevice::HW_ReadActionRegister(DataCollectionConfig *job) {
@@ -50,7 +50,7 @@ void HLSSimulatedDevice::HW_WriteActionRegister(const DataCollectionConfig *job)
}
void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
device->FPGA_StartAction(experiment);
device->FPGA_StartAction();
}
void HLSSimulatedDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) {
@@ -91,14 +91,22 @@ void HLSSimulatedDevice::HW_SetSpotFinderParameters(const SpotFinderParameters &
device->HW_SetSpotFinderParameters(params);
}
void HLSSimulatedDevice::HW_SetDataSource(uint32_t val) {
device->HW_SetDataSource(val);
}
uint32_t HLSSimulatedDevice::HW_GetDataSource() {
return device->HW_GetDataSource();
}
void HLSSimulatedDevice::CreateXfelBunchIDPacket(double pulse_id, uint32_t event_code) {
device->CreateXfelBunchIDPacket(pulse_id, event_code);
}
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

@@ -6,7 +6,7 @@
#include <thread>
#include "../common/DiffractionExperiment.h"
#include "../fpga/hls/HLSDevice.h"
#include "../fpga/hls_simulation/HLSDevice.h"
#include "FPGAAcquisitionDevice.h"
@@ -23,8 +23,6 @@ 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;
public:
HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node = -1);
@@ -40,6 +38,7 @@ public:
void CreateFinalPacket(const DiffractionExperiment& experiment);
DataCollectionStatus GetDataCollectionStatus() const override;
void Cancel() override;
DeviceStatus GetDeviceStatus() const override;
};

View File

@@ -2,17 +2,19 @@
#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 = dev.GetDataCollectionStatus();
DataCollectionStatus status;
PCI_EXCEPT(status = dev.GetDataCollectionStatus())
max_modules = status.max_modules;
if (max_modules == 0)
@@ -31,90 +33,88 @@ PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, const std::string &devi
}
bool PCIExpressDevice::HW_ReadMailbox(uint32_t *values) {
return dev.ReadWorkCompletion(values);
PCI_EXCEPT(return dev.ReadWorkCompletion(values);)
}
void PCIExpressDevice::Cancel() {
dev.Cancel();
PCI_EXCEPT(dev.Cancel();)
}
bool PCIExpressDevice::HW_SendWorkRequest(uint32_t handle) {
return dev.SendWorkRequest(handle);
PCI_EXCEPT(return dev.SendWorkRequest(handle);)
}
void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
dev.Start();
PCI_EXCEPT(dev.Start();)
}
void PCIExpressDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) {
dev.RunFrameGenerator(config);
PCI_EXCEPT(dev.RunFrameGenerator(config);)
}
void PCIExpressDevice::FPGA_EndAction() {
dev.End();
PCI_EXCEPT(dev.End();)
}
bool PCIExpressDevice::HW_IsIdle() const {
return dev.IsIdle();
PCI_EXCEPT(return dev.IsIdle();)
}
void PCIExpressDevice::HW_WriteActionRegister(const DataCollectionConfig *config) {
dev.SetConfig(*config);
PCI_EXCEPT(dev.SetConfig(*config);)
}
void PCIExpressDevice::HW_ReadActionRegister(DataCollectionConfig *config) {
*config = dev.GetConfig();
PCI_EXCEPT(*config = dev.GetConfig();)
}
std::string PCIExpressDevice::GetMACAddress() const {
return MacAddressToStr(dev.GetMACAddress());
}
void PCIExpressDevice::HW_GetEnvParams(DeviceStatus *status) const {
*status = dev.GetDeviceStatus();
PCI_EXCEPT(return MacAddressToStr(dev.GetMACAddress());)
}
uint32_t PCIExpressDevice::GetNumKernelBuffers() const {
return dev.GetBufferCount();
PCI_EXCEPT(return dev.GetBufferCount();)
}
int32_t PCIExpressDevice::GetNUMANode() const {
return dev.GetNumaNode();
PCI_EXCEPT(return dev.GetNumaNode();)
}
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);
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);
)
}
std::string PCIExpressDevice::GetIPv4Address() const {
PCI_EXCEPT(
return IPv4AddressToStr(dev.GetIPv4Address());
)
}
void PCIExpressDevice::HW_SetSpotFinderParameters(const SpotFinderParameters &params) {
dev.SetSpotFinderParameters(params);
PCI_EXCEPT(
dev.SetSpotFinderParameters(params);
)
}
DeviceStatus PCIExpressDevice::GetDeviceStatus() const {
return dev.GetDeviceStatus();
PCI_EXCEPT(
return dev.GetDeviceStatus();
)
}
DataCollectionStatus PCIExpressDevice::GetDataCollectionStatus() const {
return dev.GetDataCollectionStatus();
}
uint32_t PCIExpressDevice::HW_GetDataSource() {
return dev.GetDataSource();
}
void PCIExpressDevice::HW_SetDataSource(uint32_t val) {
return dev.SetDataSource(val);
PCI_EXCEPT(
return dev.GetDataCollectionStatus();
)
}
void PCIExpressDevice::HW_LoadCalibration(const LoadCalibrationConfig &config) {
dev.LoadCalibration(config);
PCI_EXCEPT(dev.LoadCalibration(config);)
}

View File

@@ -17,8 +17,6 @@ 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;
@@ -28,8 +26,6 @@ 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 SetIPv4Address(uint32_t ipv4_addr_network_order) override;

View File

@@ -6,6 +6,7 @@
#include "gen/model/Error_message.h"
#include "../common/GitInfo.h"
#include "OpenAPIConvert.h"
#include "../preview/JFJochTIFF.h"
JFJochBrokerHttp::JFJochBrokerHttp(const DiffractionExperiment &experiment, std::shared_ptr<Pistache::Rest::Router> &rtr)
: DefaultApi(rtr) {
@@ -44,6 +45,8 @@ void JFJochBrokerHttp::initialize_post(Pistache::Http::ResponseWriter &response)
void JFJochBrokerHttp::start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings,
Pistache::Http::ResponseWriter &response) {
nlohmann::json j = datasetSettings;
logger.Info("Start {}", j.dump());
state_machine.Start(Convert(datasetSettings));
response.send(Pistache::Http::Code::Ok);
}
@@ -137,31 +140,15 @@ void JFJochBrokerHttp::config_spot_finding_put(
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::IndexingRatePerTimePoint, 0, response);
}
void JFJochBrokerHttp::plot_azim_int_get(Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::RadInt, 0, response);
}
void JFJochBrokerHttp::plot_azim_int_per_file_get(Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::RadIntPerTimePoint, 0, response);
void JFJochBrokerHttp::plot_azim_int_get(const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::AzInt, 0, compression, response);
}
void JFJochBrokerHttp::statistics_calibration_get(Pistache::Http::ResponseWriter &response) {
auto calib = state_machine.GetCalibrationStatistics();
nlohmann::json j;
for (const auto &i: calib) {
auto output = Convert(i);
std::stringstream s;
assert(output.validate(s));
nlohmann::json j_elem;
to_json(j_elem, output);
j.push_back(j_elem);
}
for (const auto &d: Convert(state_machine.GetCalibrationStatistics()))
j.push_back(d);
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
}
@@ -353,7 +340,10 @@ void JFJochBrokerHttp::preview_pedestal_tiff_get(const std::optional<int32_t> &g
}
void JFJochBrokerHttp::GenericPlot(PlotType plot_type, const std::optional<int32_t> &binning,
const std::optional<bool>& in_compression,
Pistache::Http::ResponseWriter &response) {
bool compression = !in_compression.has_value() || in_compression.value();
PlotRequest req{.type = plot_type, .binning = 0};
if (binning) {
if (binning.value() < 0)
@@ -362,77 +352,124 @@ void JFJochBrokerHttp::GenericPlot(PlotType plot_type, const std::optional<int32
req.binning = binning.value();
}
auto plot = state_machine.GetPlots(req);
ProcessOutput(Convert(plot), response);
ProcessOutput(Convert(plot), response, compression);
}
void JFJochBrokerHttp::plot_bkg_estimate_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::BkgEstimate, binning, response);
GenericPlot(PlotType::BkgEstimate, binning, compression, response);
}
void JFJochBrokerHttp::plot_error_pixel_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ErrorPixels, binning, response);
GenericPlot(PlotType::ErrorPixels, binning, compression, response);
}
void JFJochBrokerHttp::plot_image_collection_efficiency_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ImageCollectionEfficiency, binning, response);
GenericPlot(PlotType::ImageCollectionEfficiency, binning, compression, response);
}
void JFJochBrokerHttp::plot_indexing_rate_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::IndexingRate, binning, response);
GenericPlot(PlotType::IndexingRate, binning, compression, response);
}
void JFJochBrokerHttp::plot_receiver_delay_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ReceiverDelay, binning, response);
GenericPlot(PlotType::ReceiverDelay, binning, compression, response);
}
void JFJochBrokerHttp::plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ReceiverFreeSendBuf, binning, response);
GenericPlot(PlotType::ReceiverFreeSendBuf, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_max_count_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIMaxCount, binning, response);
GenericPlot(PlotType::ROIMaxCount, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_sum_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROISum, binning, response);
GenericPlot(PlotType::ROISum, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_valid_pixels_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIPixels, binning, response);
GenericPlot(PlotType::ROIPixels, binning, compression, response);
}
void JFJochBrokerHttp::plot_spot_count_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::SpotCount, binning, response);
GenericPlot(PlotType::SpotCount, binning, compression, response);
}
void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::StrongPixels, binning, response);
GenericPlot(PlotType::StrongPixels, binning, compression, response);
}
void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetFullPixelMaskTIFF();
auto s = state_machine.GetFullPixelMaskTIFF();
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
}
void JFJochBrokerHttp::config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetUserPixelMaskTIFF();
auto s = state_machine.GetUserPixelMaskTIFF();
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
}
void JFJochBrokerHttp::config_user_mask_tiff_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) {
state_machine.SetUserPixelMask(request.body());
uint32_t cols, lines;
auto v = ReadTIFFFromString32(request.body(), cols, lines);
state_machine.SetUserPixelMask(v);
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::config_mask_get(Pistache::Http::ResponseWriter &response) {
const auto v = state_machine.GetFullPixelMask();
response.send(Pistache::Http::Code::Ok,
reinterpret_cast<const char *>(v.data()),
v.size() * sizeof(uint32_t),
Pistache::Http::Mime::MediaType::fromString("application/octet-stream"));
}
void JFJochBrokerHttp::config_user_mask_get(Pistache::Http::ResponseWriter &response) {
const auto v = state_machine.GetUserPixelMask();
response.send(Pistache::Http::Code::Ok,
reinterpret_cast<const char *>(v.data()),
v.size() * sizeof(uint32_t),
Pistache::Http::Mime::MediaType::fromString("application/octet-stream"));
}
void JFJochBrokerHttp::config_user_mask_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) {
if (request.body().empty()) {
response.send(Pistache::Http::Code::Bad_Request, "Request body cannot be empty");
return;
}
if (request.body().size() % 4 != 0) {
response.send(Pistache::Http::Code::Bad_Request, "Request has to be 32-bit");
return;
}
std::vector<uint32_t> v(request.body().size() / 4);
memcpy(v.data(), request.body().data(), request.body().size());
state_machine.SetUserPixelMask(v);
response.send(Pistache::Http::Code::Ok);
}
@@ -477,3 +514,49 @@ void JFJochBrokerHttp::fpga_status_get(Pistache::Http::ResponseWriter &response)
j.push_back(d);
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
}
void JFJochBrokerHttp::statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) {
org::openapitools::server::model::Jfjoch_statistics statistics;
auto data_collection_statistics = state_machine.GetMeasurementStatistics();
if (data_collection_statistics)
statistics.setMeasurement(Convert(data_collection_statistics.value()));
statistics.setFpga(Convert(state_machine.GetDeviceStatus()));
statistics.setCalibration(Convert(state_machine.GetCalibrationStatistics()));
statistics.setBroker(Convert(state_machine.GetStatus()));
auto det_status = state_machine.GetDetectorStatus();
if (det_status.has_value())
statistics.setDetector(Convert(det_status.value()));
statistics.setDetectorSettings(Convert(state_machine.GetDetectorSettings()));
statistics.setDetectorList(Convert(state_machine.GetDetectorsList()));
statistics.setDataProcessingSettings(Convert(state_machine.GetSpotFindingSettings()));
statistics.setInstrumentMetadata(Convert(state_machine.GetInstrumentMetadata()));
statistics.setImageFormatSettings(Convert(state_machine.GetImageFormatSettings()));
statistics.setPixelMask(Convert(state_machine.GetPixelMaskStatistics()));
auto zeromq_prev = state_machine.GetPreviewSocketSettings();
if (!zeromq_prev.address.empty())
statistics.setZeromqPreview(Convert(zeromq_prev));
nlohmann::json j = statistics;
if (!compression.has_value() || compression.value())
response.setCompression(Pistache::Http::Header::Encoding::Deflate);
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
}
void JFJochBrokerHttp::config_zeromq_preview_get(Pistache::Http::ResponseWriter &response) {
ProcessOutput(Convert(state_machine.GetPreviewSocketSettings()), response);
}
void JFJochBrokerHttp::config_zeromq_preview_put(
const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings,
Pistache::Http::ResponseWriter &response) {
state_machine.SetPreviewSocketSettings(Convert(zeromqPreviewSettings));
response.send(Pistache::Http::Code::Ok);
}

View File

@@ -51,37 +51,34 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
Pistache::Http::ResponseWriter &response) override;
void GenericPlot(PlotType plot_type,
const std::optional<int32_t> &binning,
Pistache::Http::ResponseWriter &response);
const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
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,
void plot_bkg_estimate_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_error_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_image_collection_efficiency_get(const std::optional<int32_t> &binning,
void plot_image_collection_efficiency_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_indexing_rate_get(const std::optional<int32_t> &binning,
void plot_indexing_rate_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_receiver_delay_get(const std::optional<int32_t> &binning,
void plot_receiver_delay_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning,
void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_max_count_get(const std::optional<int32_t> &binning,
void plot_roi_max_count_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_sum_get(const std::optional<int32_t> &binning,
void plot_roi_sum_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning,
void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_spot_count_get(const std::optional<int32_t> &binning,
void plot_spot_count_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_strong_pixel_get(const std::optional<int32_t> &binning,
void plot_strong_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) override;
void plot_azim_int_get(Pistache::Http::ResponseWriter &response) override;
void plot_azim_int_per_file_get(Pistache::Http::ResponseWriter &response) override;
void plot_azim_int_get(const std::optional<bool>& compression, Pistache::Http::ResponseWriter &response) override;
void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override;
@@ -145,7 +142,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
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) {
void ProcessOutput(const T& output, Pistache::Http::ResponseWriter &response, bool compression = false) {
std::stringstream s;
if(!output.validate(s)) {
logger.Error(s.str());
@@ -153,6 +150,8 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
}
nlohmann::json j = output;
if (compression)
response.setCompression(Pistache::Http::Header::Encoding::Deflate);
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
}
@@ -162,6 +161,21 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
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_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;
public:
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
void AddDetectorSetup(const DetectorSetup &setup);

View File

@@ -7,6 +7,7 @@
#include "../image_pusher/HDF5FilePusher.h"
#include "OpenAPIConvert.h"
#include "Detector_type.h"
#include "../image_pusher/NonePusher.h"
DetectorGeometry ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j) {
auto s = j.getStandardGeometry();
@@ -88,7 +89,9 @@ DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detecto
.SensorThickness_um(d.getSensorThicknessUm())
// .PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
.SensorMaterial(d.getSensorMaterial())
.SerialNumber(d.getSerialNumber());
.SerialNumber(d.getSerialNumber())
.ModuleSync(d.isModuleSync());
if (d.baseDataIpv4AddressIsSet())
setup.BaseIPv4Addr(d.getBaseDataIpv4Address());
if (d.txDelayIsSet())
@@ -114,11 +117,18 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s
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");
auto tmp = std::make_unique<ZMQStream2Pusher>(j.getZeromq().getImageSocket(),
j.getZeromq().getSendWatermark());
if (j.getZeromq().previewSocketIsSet())
tmp->PreviewSocket(j.getZeromq().getPreviewSocket());
std::optional<int32_t> send_buffer_size;
if (j.getZeromq().sendBufferSizeIsSet())
send_buffer_size = j.getZeromq().getSendBufferSize();
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());
@@ -132,7 +142,7 @@ std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::m
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 {};
return std::make_unique<NonePusher>();
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::CBOR:
return std::make_unique<CBORFilePusher>();
default:
@@ -151,3 +161,17 @@ void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_
aq_devices.AddPCIeDevice(p.getBlk(), ipv4_addr);
}
}
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);
// Using default in case
service.NumThreads(input.getReceiverThreads());
if (input.zeromqPreviewIsSet()) {
service.PreviewSocket(input.getZeromqPreview().getSocketAddress());
service.PreviewSocketSettings(Convert(input.getZeromqPreview()));
}
}

View File

@@ -6,7 +6,7 @@
#include "../common/DiffractionExperiment.h"
#include "../acquisition_device/AcquisitionDeviceGroup.h"
#include "../image_pusher/ImagePusher.h"
#include "../receiver/JFJochReceiverService.h"
#include "gen/model/Jfjoch_settings.h"
DetectorGeometry ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j);
@@ -19,5 +19,6 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s
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);
#endif //JUNGFRAUJOCH_JFJOCHBROKERPARSER_H

View File

@@ -118,12 +118,18 @@ JFJochServices &JFJochServices::Receiver(JFJochReceiverService *input) {
return *this;
}
std::optional<JFJochReceiverStatus> JFJochServices::GetReceiverStatus() {
std::optional<JFJochReceiverStatus> JFJochServices::GetReceiverStatus() const {
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 {};
@@ -193,4 +199,16 @@ std::vector<DeviceStatus> JFJochServices::GetDeviceStatus() const {
if (receiver)
ret = receiver->GetDeviceStatus();
return ret;
}
}
ZMQPreviewSettings JFJochServices::GetPreviewSocketSettings() {
if (receiver)
return receiver->GetPreviewSocketSettings();
else
return {};
}
void JFJochServices::SetPreviewSocketSettings(const ZMQPreviewSettings &input) {
if (receiver)
receiver->PreviewSocketSettings(input);
}

View File

@@ -33,7 +33,8 @@ public:
void LoadInternalGeneratorImage(const DiffractionExperiment &experiment,
const std::vector<uint16_t> &image,
uint64_t image_number);
std::optional<JFJochReceiverStatus> GetReceiverStatus();
std::optional<JFJochReceiverStatus> GetReceiverStatus() const;
std::optional<float> GetReceiverProgress() const;
MultiLinePlot GetPlots(const PlotRequest &request);
void SetSpotFindingSettings(const SpotFindingSettings &settings);
@@ -48,6 +49,9 @@ public:
void GetXFELEventCode(std::vector<uint64_t> &v) const;
std::vector<DeviceStatus> GetDeviceStatus() const;
void SetPreviewSocketSettings(const ZMQPreviewSettings &input);
ZMQPreviewSettings GetPreviewSocketSettings();
};

View File

@@ -10,7 +10,7 @@ JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_l
logger(in_logger),
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()),
pixel_mask(experiment) {
SupressTIFFErrors();
}
bool JFJochStateMachine::ImportPedestalG0(const JFJochReceiverOutput &receiver_output) {
@@ -46,6 +46,13 @@ bool JFJochStateMachine::ImportPedestalG1G2(const JFJochReceiverOutput &receiver
}
void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &ul) {
if (experiment.GetDetectorSetup().GetDetectorType() == DetectorType::EIGER) {
logger.Info("EIGER configuration");
services.ConfigureDetector(experiment);
logger.Info(" ... done ");
return;
}
calibration = std::make_unique<JFCalibration>(experiment);
if (!gain_calibration.empty()) {
@@ -54,7 +61,7 @@ void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &u
for (int i = 0; i < gain_calibration.size(); i++)
calibration->GainCalibration(i) = gain_calibration[i];
}
cancel_sequence = false;
logger.Info("Pedestal sequence started");
@@ -68,7 +75,8 @@ void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &u
}
}
services.ConfigureDetector(experiment);
pixel_mask.LoadDetectorBadPixelMask(calibration->CalculateMask());
pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get());
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
} catch (const std::exception &e) {
logger.Error("Pedestal sequence error {}", e.what());
state = JFJochState::Error;
@@ -111,7 +119,6 @@ void JFJochStateMachine::TakePedestalInternalG0(std::unique_lock<std::mutex> &ul
auto pedestal_output = services.Stop();
ul.lock();
SetFullMeasurementOutput(pedestal_output);
if (ImportPedestalG0(pedestal_output.receiver_output))
state = JFJochState::Idle;
else
@@ -150,7 +157,6 @@ void JFJochStateMachine::TakePedestalInternalG1(std::unique_lock<std::mutex> &ul
auto pedestal_output = services.Stop();
ul.lock();
SetFullMeasurementOutput(pedestal_output);
if (ImportPedestalG1G2(pedestal_output.receiver_output, 1, storage_cell))
state = JFJochState::Idle;
else
@@ -189,7 +195,6 @@ void JFJochStateMachine::TakePedestalInternalG2(std::unique_lock<std::mutex> &ul
auto pedestal_output = services.Stop();
ul.lock();
SetFullMeasurementOutput(pedestal_output);
if (ImportPedestalG1G2(pedestal_output.receiver_output, 2, storage_cell))
state = JFJochState::Idle;
else
@@ -211,7 +216,6 @@ void JFJochStateMachine::Initialize() {
state = JFJochState::Busy;
ClearMeasurementStatistics();
measurement = std::async(std::launch::async, &JFJochStateMachine::InitializeThread, this, std::move(ul));
}
@@ -256,8 +260,6 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) {
experiment.ImportDatasetSettings(settings);
ClearAndSetMeasurementStatistics();
cancel_sequence = false;
if (experiment.GetStorageCellNumber() == 1)
experiment.StorageCellStart(15);
@@ -280,10 +282,19 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) {
}
}
void JFJochStateMachine::UpdatePixelMaskStatistics(const PixelMaskStatistics &input) {
std::unique_lock ul(pixel_mask_statistics_mutex);
pixel_mask_statistics = input;
}
PixelMaskStatistics JFJochStateMachine::GetPixelMaskStatistics() const {
std::unique_lock ul(pixel_mask_statistics_mutex);
return pixel_mask_statistics;
}
void JFJochStateMachine::MeasurementThread() {
try {
auto tmp_output = services.Stop();
SetFullMeasurementOutput(tmp_output);
{
std::unique_lock<std::mutex> ul(m);
state = JFJochState::Idle;
@@ -329,10 +340,8 @@ JFJochStateMachine::~JFJochStateMachine() {
} catch (...) {}
}
void JFJochStateMachine::SetFullMeasurementOutput(const JFJochServicesOutput &output) {
std::unique_lock<std::mutex> ul(last_receiver_output_mutex);
MeasurementStatistics tmp{}; // reset last measurement statistics
std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistics() const {
MeasurementStatistics tmp{};
tmp.file_prefix = experiment.GetFilePrefix();
tmp.run_number = experiment.GetRunNumber();
@@ -344,59 +353,8 @@ void JFJochStateMachine::SetFullMeasurementOutput(const JFJochServicesOutput &ou
tmp.images_expected = experiment.GetImageNum();
tmp.unit_cell = experiment.GetUnitCellString();
tmp.compression_ratio = output.receiver_output.status.compressed_ratio;
tmp.collection_efficiency = output.receiver_output.efficiency;
tmp.images_collected = output.receiver_output.status.images_collected;
tmp.images_sent = output.receiver_output.status.images_sent;
tmp.images_skipped = output.receiver_output.status.images_skipped;
tmp.cancelled = output.receiver_output.status.cancelled;
tmp.max_image_number_sent = output.receiver_output.status.max_image_number_sent;
tmp.max_receive_delay = output.receiver_output.status.max_receive_delay;
tmp.indexing_rate = output.receiver_output.status.indexing_rate;
tmp.bkg_estimate = output.receiver_output.status.bkg_estimate;
measurement_statistics = tmp;
}
void JFJochStateMachine::ClearAndSetMeasurementStatistics() {
std::unique_lock<std::mutex> ul(last_receiver_output_mutex);
MeasurementStatistics tmp{};
tmp.file_prefix = experiment.GetFilePrefix();
tmp.run_number = experiment.GetRunNumber();
tmp.experiment_group = experiment.GetExperimentGroup();
tmp.detector_height = experiment.GetXPixelsNum();
tmp.detector_width = experiment.GetYPixelsNum();
tmp.detector_pixel_depth = experiment.GetByteDepthImage();
tmp.images_expected = experiment.GetImageNum();
tmp.unit_cell = experiment.GetUnitCellString();
measurement_statistics = tmp;
}
void JFJochStateMachine::ClearMeasurementStatistics() {
std::unique_lock<std::mutex> ul(last_receiver_output_mutex);
measurement_statistics.reset();
}
std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistics() const {
auto rcv_status = services.GetReceiverStatus();
if (rcv_status) {
MeasurementStatistics tmp;
tmp.file_prefix = experiment.GetFilePrefix();
tmp.run_number = experiment.GetRunNumber();
tmp.experiment_group = experiment.GetExperimentGroup();
tmp.detector_width = experiment.GetXPixelsNum();
tmp.detector_height = experiment.GetYPixelsNum();
tmp.detector_pixel_depth = experiment.GetByteDepthImage();
tmp.images_expected = experiment.GetImageNum();
tmp.unit_cell = experiment.GetUnitCellString();
tmp.compression_ratio = rcv_status->compressed_ratio;
tmp.images_collected = rcv_status->images_collected;
tmp.images_sent = rcv_status->images_sent;
@@ -406,11 +364,9 @@ std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistic
tmp.max_receive_delay = rcv_status->max_receive_delay;
tmp.indexing_rate = rcv_status->indexing_rate;
tmp.bkg_estimate = rcv_status->bkg_estimate;
return tmp;
} else {
std::unique_lock<std::mutex> ul(last_receiver_output_mutex);
return measurement_statistics;
tmp.collection_efficiency = rcv_status->efficiency;
}
return tmp;
}
std::vector<JFCalibrationModuleStatistics> JFJochStateMachine::GetCalibrationStatistics() const {
@@ -423,22 +379,26 @@ void JFJochStateMachine::SetCalibrationStatistics(const std::vector<JFCalibratio
calibration_statistics = input;
}
DetectorSettings JFJochStateMachine::GetDetectorSettings() const {
std::unique_lock<std::mutex> ul(m);
std::unique_lock<std::mutex> ul(experiment_detector_settings_mutex);
return experiment.GetDetectorSettings();
}
void JFJochStateMachine::ImportDetectorSettings(const DetectorSettings &input) {
std::unique_lock<std::mutex> ul(experiment_detector_settings_mutex);
experiment.ImportDetectorSettings(input);
}
void JFJochStateMachine::LoadDetectorSettings(const DetectorSettings &settings) {
std::unique_lock<std::mutex> ul(m);
switch (state) {
case JFJochState::Inactive:
case JFJochState::Error:
experiment.ImportDetectorSettings(settings);
ImportDetectorSettings(settings);
break;
case JFJochState::Idle:
state = JFJochState::Busy;
experiment.ImportDetectorSettings(settings);
ImportDetectorSettings(settings);
measurement = std::async(std::launch::async, &JFJochStateMachine::PedestalThread, this, std::move(ul));
break;
case JFJochState::Measuring:
@@ -454,16 +414,8 @@ DiffractionExperiment &JFJochStateMachine::NotThreadSafe_Experiment() {
BrokerStatus JFJochStateMachine::GetStatus() const {
BrokerStatus ret{};
ret.broker_state = state;
try {
auto rcv_status = services.GetReceiverStatus();
if (rcv_status) {
ret.progress = rcv_status.value().progress;
ret.indexing_rate = rcv_status.value().indexing_rate;
}
} catch (JFJochException &e) {} // ignore exception in getting receiver status (don't really care, e.g. if receiver is down)
ret.progress = services.GetReceiverProgress();
return ret;
}
@@ -494,7 +446,7 @@ void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) {
experiment.Detector(setup);
gain_calibration = setup.GetGainCalibration();
current_detector_setup = 0;
pixel_mask = PixelMask(setup);
pixel_mask = PixelMask(experiment);
}
detector_setup.emplace_back(setup);
}
@@ -535,7 +487,7 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
try {
experiment.Detector(detector_setup[id]);
gain_calibration = detector_setup[id].GetGainCalibration();
pixel_mask = PixelMask(detector_setup[id]);
pixel_mask = PixelMask(experiment);
state = JFJochState::Inactive;
current_detector_setup = id;
} catch (JFJochException &e) {
@@ -710,16 +662,25 @@ std::string JFJochStateMachine::GetUserPixelMaskTIFF() const {
sizeof(uint32_t), false);
}
void JFJochStateMachine::SetUserPixelMask(const std::string &s) {
std::vector<uint32_t> JFJochStateMachine::GetFullPixelMask() const {
std::unique_lock<std::mutex> ul(m);
return pixel_mask.GetMask(experiment);
}
std::vector<uint32_t> JFJochStateMachine::GetUserPixelMask() const {
std::unique_lock<std::mutex> ul(m);
return pixel_mask.GetUserMask(experiment);
}
void JFJochStateMachine::SetUserPixelMask(const std::vector<uint32_t> &v) {
std::unique_lock<std::mutex> ul(m);
if (state != JFJochState::Idle)
throw WrongDAQStateException ("User mask can be only modified in Idle state");
try {
uint32_t cols, lines;
auto v = ReadTIFFFromString32(s, cols, lines);
pixel_mask.LoadUserMask(experiment, v);
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
} catch (const JFJochException &e) {
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Problem handling user mask " + std::string(e.what()));
@@ -752,6 +713,8 @@ void JFJochStateMachine::LoadImageFormatSettings(const ImageFormatSettings &sett
throw WrongDAQStateException ("Cannot change instrument metadata during data collection");
experiment.ImportImageFormatSettings(settings);
pixel_mask.Update(settings);
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
}
void JFJochStateMachine::RawImageFormatSettings() {
@@ -774,4 +737,12 @@ void JFJochStateMachine::ConvImageFormatSettings() {
std::vector<DeviceStatus> JFJochStateMachine::GetDeviceStatus() const {
return services.GetDeviceStatus();
}
}
void JFJochStateMachine::SetPreviewSocketSettings(const ZMQPreviewSettings &input) {
services.SetPreviewSocketSettings(input);
}
ZMQPreviewSettings JFJochStateMachine::GetPreviewSocketSettings() {
return services.GetPreviewSocketSettings();
}

View File

@@ -20,7 +20,6 @@ enum class JFJochState {Inactive, Idle, Measuring, Error, Busy, Pedestal};
struct BrokerStatus {
JFJochState broker_state;
std::optional<float> progress;
std::optional<float> indexing_rate;
};
struct DetectorListElement {
@@ -70,11 +69,13 @@ class JFJochStateMachine {
Logger &logger;
JFJochServices &services;
mutable std::mutex experiment_detector_settings_mutex;
DiffractionExperiment experiment;
mutable std::mutex m;
std::condition_variable c;
// mutex m is protecting:
DiffractionExperiment experiment;
volatile JFJochState state = JFJochState::Inactive;
volatile bool cancel_sequence = false;
std::unique_ptr<JFCalibration> calibration;
@@ -89,15 +90,14 @@ class JFJochStateMachine {
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;
void UpdatePixelMaskStatistics(const PixelMaskStatistics &input);
// Private functions assume that lock m is acquired
void MeasurementThread();
void PedestalThread(std::unique_lock<std::mutex> ul);
@@ -110,6 +110,7 @@ class JFJochStateMachine {
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);
void ImportDetectorSettings(const DetectorSettings& input);
public:
JFJochStateMachine(JFJochServices &in_services, Logger &logger);
~JFJochStateMachine();
@@ -181,8 +182,17 @@ public:
std::string GetFullPixelMaskTIFF() const;
std::string GetUserPixelMaskTIFF() const;
void SetUserPixelMask(const std::string &v);
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();
PixelMaskStatistics GetPixelMaskStatistics() const;
};

View File

@@ -73,9 +73,49 @@ org::openapitools::server::model::Measurement_statistics Convert(const Measureme
ret.setBkgEstimate(input.bkg_estimate.value());
ret.setUnitCell(input.unit_cell);
ret.setRunNumber(input.run_number);
return ret;
}
DetectorTiming Convert(const org::openapitools::server::model::Detector_timing& input) {
switch (input.getValue()) {
case org::openapitools::server::model::Detector_timing::eDetector_timing::AUTO:
return DetectorTiming::Auto;
case org::openapitools::server::model::Detector_timing::eDetector_timing::TRIGGER:
return DetectorTiming::Trigger;
case org::openapitools::server::model::Detector_timing::eDetector_timing::BURST:
return DetectorTiming::Burst;
case org::openapitools::server::model::Detector_timing::eDetector_timing::GATED:
return DetectorTiming::Gated;
default:
case org::openapitools::server::model::Detector_timing::eDetector_timing::INVALID_VALUE_OPENAPI_GENERATED:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid input");
}
}
org::openapitools::server::model::Detector_timing Convert(DetectorTiming input) {
org::openapitools::server::model::Detector_timing val;
switch (input) {
case DetectorTiming::Auto:
val.setValue(org::openapitools::server::model::Detector_timing::eDetector_timing::AUTO);
break;
case DetectorTiming::Trigger:
val.setValue(org::openapitools::server::model::Detector_timing::eDetector_timing::TRIGGER);
break;
case DetectorTiming::Burst:
val.setValue(org::openapitools::server::model::Detector_timing::eDetector_timing::BURST);
break;
case DetectorTiming::Gated:
val.setValue(org::openapitools::server::model::Detector_timing::eDetector_timing::GATED);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid input");
}
return val;
}
DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input) {
DetectorSettings ret{};
@@ -85,20 +125,31 @@ DetectorSettings Convert(const org::openapitools::server::model::Detector_settin
else
ret.FrameTime(std::chrono::microseconds(input.getFrameTimeUs()));
ret.StorageCells(input.getStorageCellCount());
ret.StorageCellDelay(std::chrono::nanoseconds(input.getStorageCellDelayNs()));
ret.FixGainG1(input.isFixedGainG1());
ret.UseGainHG0(input.isUseGainHg0());
ret.InternalGeneratorEnable(input.isInternalFrameGenerator());
ret.InternalGeneratorImages(input.getInternalFrameGeneratorImages());
ret.PedestalG0Frames(input.getPedestalG0Frames());
ret.PedestalG1Frames(input.getPedestalG1Frames());
ret.PedestalG2Frames(input.getPedestalG2Frames());
ret.PedestalG0RMSLimit(input.getPedestalG0RmsLimit());
ret.DetectorDelay(std::chrono::nanoseconds(input.getDetectorTriggerDelayNs()));
ret.StorageCells(input.getJungfrauStorageCellCount());
ret.StorageCellDelay(std::chrono::nanoseconds(input.getJungfrauStorageCellDelayNs()));
ret.FixGainG1(input.isJungfrauFixedGainG1());
ret.UseGainHG0(input.isJungfrauUseGainHg0());
ret.PedestalG0Frames(input.getJungfrauPedestalG0Frames());
ret.PedestalG1Frames(input.getJungfrauPedestalG1Frames());
ret.PedestalG2Frames(input.getJungfrauPedestalG2Frames());
ret.PedestalMinImageCount(input.getJungfrauPedestalMinImageCount());
if (input.eigerBitDepthIsSet())
ret.EigerBitDepth(input.getEigerBitDepth());
if (input.eigerThresholdKeVIsSet())
ret.EigerThreshold_keV(input.getEigerThresholdKeV());
if (input.timingIsSet())
ret.Timing(Convert(input.getTiming()));
else
ret.Timing(DetectorTiming::Trigger);
return ret;
}
@@ -108,20 +159,26 @@ org::openapitools::server::model::Detector_settings Convert(const DetectorSettin
ret.setFrameTimeUs(input.GetFrameTime().count());
if (input.GetCountTime().has_value())
ret.setCountTimeUs(input.GetCountTime()->count());
ret.setStorageCellCount(input.GetStorageCells());
ret.setInternalFrameGenerator(input.IsInternalGeneratorEnable());
ret.setFixedGainG1(input.IsFixGainG1());
ret.setUseGainHg0(input.IsUseGainHG0());
ret.setPedestalG0Frames(input.GetPedestalG0Frames());
ret.setPedestalG1Frames(input.GetPedestalG1Frames());
ret.setPedestalG2Frames(input.GetPedestalG2Frames());
ret.setStorageCellDelayNs(input.GetStorageCellDelay().count());
ret.setDetectorTriggerDelayNs(input.GetDetectorDelay().count());
ret.setInternalFrameGeneratorImages(input.GetInternalGeneratorImages());
ret.setPedestalG0RmsLimit(input.GetPedestalG0RMSLimit());
ret.setInternalFrameGenerator(input.IsInternalGeneratorEnable());
ret.setJungfrauStorageCellCount(input.GetStorageCells());
ret.setJungfrauFixedGainG1(input.IsFixGainG1());
ret.setJungfrauUseGainHg0(input.IsUseGainHG0());
ret.setJungfrauPedestalG0Frames(input.GetPedestalG0Frames());
ret.setJungfrauPedestalG1Frames(input.GetPedestalG1Frames());
ret.setJungfrauPedestalG2Frames(input.GetPedestalG2Frames());
ret.setJungfrauPedestalMinImageCount(input.GetPedestalMinImageCount());
ret.setJungfrauStorageCellDelayNs(input.GetStorageCellDelay().count());
if (input.GetEigerThreshold_keV().has_value())
ret.setEigerThresholdKeV(input.GetEigerThreshold_keV().value());
if (input.GetEigerBitDepth().has_value())
ret.setEigerBitDepth(input.GetEigerBitDepth().value());
ret.setTiming(Convert(input.GetTiming()));
return ret;
}
@@ -150,8 +207,6 @@ org::openapitools::server::model::Broker_status Convert(const BrokerStatus& inpu
}
if (input.progress.has_value())
ret.setProgress(input.progress.value());
if (input.indexing_rate.has_value() && (input.indexing_rate >= 0.0))
ret.setIndexingRate(input.indexing_rate.value());
return ret;
}
@@ -172,6 +227,14 @@ org::openapitools::server::model::Calibration_statistics_inner Convert(const JFC
return output;
}
std::vector<org::openapitools::server::model::Calibration_statistics_inner> Convert(const std::vector<JFCalibrationModuleStatistics>& input) {
std::vector<org::openapitools::server::model::Calibration_statistics_inner> ret;
for (const auto &i: input)
ret.push_back(Convert(i));
return ret;
}
org::openapitools::server::model::Instrument_metadata Convert(const InstrumentMetadata& input) {
org::openapitools::server::model::Instrument_metadata output;
output.setInstrumentName(input.GetInstrumentName());
@@ -190,38 +253,55 @@ InstrumentMetadata Convert(const org::openapitools::server::model::Instrument_me
return output;
}
org::openapitools::server::model::Detector_state Convert(DetectorState input) {
org::openapitools::server::model::Detector_state ret;
switch (input) {
case DetectorState::IDLE:
ret.setValue(org::openapitools::server::model::Detector_state::eDetector_state::IDLE);
break;
case DetectorState::ERROR:
ret.setValue(org::openapitools::server::model::Detector_state::eDetector_state::ERROR);
break;
case DetectorState::BUSY:
ret.setValue(org::openapitools::server::model::Detector_state::eDetector_state::BUSY);
break;
case DetectorState::WAITING:
ret.setValue(org::openapitools::server::model::Detector_state::eDetector_state::WAITING);
break;
default:
case DetectorState::NOT_CONNECTED:
ret.setValue(org::openapitools::server::model::Detector_state::eDetector_state::NOT_CONNECTED);
break;
}
return ret;
}
org::openapitools::server::model::Detector_power_state Convert(DetectorPowerState input) {
org::openapitools::server::model::Detector_power_state ret;
switch (input) {
case DetectorPowerState::ON:
ret.setValue(org::openapitools::server::model::Detector_power_state::eDetector_power_state::POWERON);
break;
case DetectorPowerState::PARTIAL:
ret.setValue(org::openapitools::server::model::Detector_power_state::eDetector_power_state::PARTIAL);
break;
default:
case DetectorPowerState::OFF:
ret.setValue(org::openapitools::server::model::Detector_power_state::eDetector_power_state::POWEROFF);
break;
}
return ret;
}
org::openapitools::server::model::Detector_status Convert(const DetectorStatus &input) {
org::openapitools::server::model::Detector_status output;
output.setServerVersion(input.detector_server_version);
output.setNumberOfTriggersLeft(input.remaining_triggers);
output.setFpgaTempDegC(input.temperature_fpga_degC);
output.setHighVoltageV(input.high_voltage_V);
switch (input.power_state) {
case DetectorPowerState::ON:
output.setPowerchip("PowerOn");
break;
case DetectorPowerState::OFF:
output.setPowerchip("PowerOff");
break;
case DetectorPowerState::PARTIAL:
output.setPowerchip("Partial");
break;
}
switch (input.detector_state) {
case DetectorState::IDLE:
output.setState("Idle");
break;
case DetectorState::ERROR:
output.setState("Error");
break;
case DetectorState::BUSY:
output.setState("Busy");
break;
case DetectorState::WAITING:
output.setState("Waiting");
break;
}
output.setPowerchip(Convert(input.power_state));
output.setState(Convert(input.detector_state));
return output;
}
@@ -346,6 +426,9 @@ ImageFormatSettings Convert(const org::openapitools::server::model::Image_format
ret.JungfrauConversion(input.isJungfrauConversion());
ret.MaskChipEdges(input.isMaskChipEdges());
ret.MaskModuleEdges(input.isMaskModuleEdges());
ret.ApplyPixelMask(input.isApplyMask());
ret.PedestalG0RMSLimit(input.getJungfrauPedestalG0RmsLimit());
ret.MaskPixelsWithoutG0(input.isJungfrauMaskPixelsWithoutG0());
if (input.signedOutputIsSet())
ret.PixelSigned(input.isSignedOutput());
if (input.jungfrauConversionFactorKeVIsSet())
@@ -362,6 +445,9 @@ org::openapitools::server::model::Image_format_settings Convert(const ImageForma
ret.setJungfrauConversion(input.IsJungfrauConversion());
ret.setMaskChipEdges(input.IsMaskChipEdges());
ret.setMaskModuleEdges(input.IsMaskModuleEdges());
ret.setApplyMask(input.IsApplyPixelMask());
ret.setJungfrauMaskPixelsWithoutG0(input.IsMaskPixelsWithoutG0());
ret.setJungfrauPedestalG0RmsLimit(input.GetPedestalG0RMSLimit());
if (input.IsPixelSigned().has_value())
ret.setSignedOutput(input.IsPixelSigned().value());
if (input.GetJungfrauConvFactor_keV().has_value())
@@ -463,13 +549,49 @@ std::vector<org::openapitools::server::model::Fpga_status_inner> Convert(const s
std::vector<org::openapitools::server::model::Fpga_status_inner> ret;
for (const auto &d: input) {
org::openapitools::server::model::Fpga_status_inner tmp;
tmp.setPciDevId(d.device_number);
tmp.setSerialNumber(d.serial_number);
tmp.setFwVersion(d.fpga_firmware_version);
tmp.setBaseMacAddr(MacAddressToStr(d.fpga_default_mac_addr));
tmp.setPacketsSls(d.packets_sls);
tmp.setPacketsUdp(d.packets_udp);
tmp.setEthLinkCount(d.eth_link_count);
tmp.setEthLinkStatus(d.eth_link_status);
tmp.setFpgaTempC(static_cast<float>(d.fpga_temp_C));
tmp.setHbmTempC(static_cast<float>(d.hbm_0_temp_C));
tmp.setPowerUsageW(static_cast<float>(d.fpga_pcie_12V_I_mA * d.fpga_pcie_12V_V_mV + d.fpga_pcie_3p3V_I_mA
* d.fpga_pcie_3p3V_V_mV) / (1000.0f * 1000.0f));
tmp.setIdle(d.idle);
ret.emplace_back(std::move(tmp));
}
return ret;
}
ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_preview_settings &input) {
ZMQPreviewSettings ret;
if (input.isEnabled())
ret.period = std::chrono::milliseconds(input.getPeriodMs());
else
ret.period = {};
ret.send_start_message = input.isSendStartMessage();
ret.address = "";
return ret;
}
org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPreviewSettings &settings) {
org::openapitools::server::model::Zeromq_preview_settings ret;
ret.setEnabled(settings.period.has_value());
if (settings.period.has_value())
ret.setPeriodMs(settings.period.value().count() / 1000);
ret.setSocketAddress(settings.address);
ret.setSendStartMessage(settings.send_start_message);
return ret;
}
org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input) {
org::openapitools::server::model::Pixel_mask_statistics ret;
ret.setUserMask(input.user_mask);
ret.setWrongGain(input.wrong_gain);
ret.setTooHighPedestalRms(input.too_high_pedestal_rms);
return ret;
}

View File

@@ -20,6 +20,7 @@
#include "gen/model/Preview_settings.h"
#include "gen/model/Dataset_settings.h"
#include "gen/model/Fpga_status_inner.h"
#include "gen/model/Pixel_mask_statistics.h"
#include "../common/DatasetSettings.h"
#include "../common/ImageFormatSettings.h"
@@ -28,6 +29,7 @@
#include "../common/DetectorSettings.h"
#include "../jungfrau/JFCalibration.h"
#include "../common/InstrumentMetadata.h"
#include "Zeromq_preview_settings.h"
SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input);
org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input);
@@ -38,6 +40,7 @@ DetectorSettings Convert(const org::openapitools::server::model::Detector_settin
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);
@@ -55,5 +58,9 @@ ImageFormatSettings Convert(const org::openapitools::server::model::Image_format
org::openapitools::server::model::Image_format_settings Convert(const ImageFormatSettings& 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::Zeromq_preview_settings Convert(const ZMQPreviewSettings& settings);
ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_preview_settings& input);
#endif //JFJOCH_OPENAPICONVERT_H

View File

@@ -1,66 +0,0 @@
# 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
## External interfaces
Broker operates three external interfaces.
**Data interface** ZeroMQ PULL socket with CBOR serialization is used to send images, metadata and processing results for writing or downstream
processing. See [here](../frame_serialize/README.md) for description of the format.
**Preview interface** as above, but limited to subset of frames (1 image/s by default).
**Configuration, status and results** HTTP/REST interface described in the OpenAPI format.
Description of the API 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. The file is described by OpenAPI structure `jfjoch_settings` defined in [jfjoch_api.yaml](jfjoch_api.yaml) file.
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
```
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,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -46,25 +46,28 @@ void DefaultApi::setupRoutes() {
Routes::Put(*router, base + "/config/instrument", Routes::bind(&DefaultApi::config_instrument_put_handler, this));
Routes::Put(*router, base + "/config/internal_generator_image", Routes::bind(&DefaultApi::config_internal_generator_image_put_handler, this));
Routes::Put(*router, base + "/config/internal_generator_image.tiff", Routes::bind(&DefaultApi::config_internal_generator_image_tiff_put_handler, this));
Routes::Get(*router, base + "/config/mask", Routes::bind(&DefaultApi::config_mask_get_handler, this));
Routes::Get(*router, base + "/config/mask.tiff", Routes::bind(&DefaultApi::config_mask_tiff_get_handler, this));
Routes::Get(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_get_handler, this));
Routes::Put(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_put_handler, this));
Routes::Get(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_get_handler, this));
Routes::Put(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_put_handler, this));
Routes::Get(*router, base + "/config/user_mask", Routes::bind(&DefaultApi::config_user_mask_get_handler, this));
Routes::Put(*router, base + "/config/user_mask", Routes::bind(&DefaultApi::config_user_mask_put_handler, this));
Routes::Get(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_get_handler, this));
Routes::Put(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_put_handler, this));
Routes::Get(*router, base + "/config/zeromq_preview", Routes::bind(&DefaultApi::config_zeromq_preview_get_handler, this));
Routes::Put(*router, base + "/config/zeromq_preview", Routes::bind(&DefaultApi::config_zeromq_preview_put_handler, this));
Routes::Post(*router, base + "/deactivate", Routes::bind(&DefaultApi::deactivate_post_handler, this));
Routes::Get(*router, base + "/detector/status", Routes::bind(&DefaultApi::detector_status_get_handler, this));
Routes::Get(*router, base + "/fpga_status", Routes::bind(&DefaultApi::fpga_status_get_handler, this));
Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this));
Routes::Post(*router, base + "/pedestal", Routes::bind(&DefaultApi::pedestal_post_handler, this));
Routes::Get(*router, base + "/plot/azim_int", Routes::bind(&DefaultApi::plot_azim_int_get_handler, this));
Routes::Get(*router, base + "/plot/azim_int_per_file", Routes::bind(&DefaultApi::plot_azim_int_per_file_get_handler, this));
Routes::Get(*router, base + "/plot/bkg_estimate", Routes::bind(&DefaultApi::plot_bkg_estimate_get_handler, this));
Routes::Get(*router, base + "/plot/error_pixel", Routes::bind(&DefaultApi::plot_error_pixel_get_handler, this));
Routes::Get(*router, base + "/plot/image_collection_efficiency", Routes::bind(&DefaultApi::plot_image_collection_efficiency_get_handler, this));
Routes::Get(*router, base + "/plot/indexing_rate", Routes::bind(&DefaultApi::plot_indexing_rate_get_handler, this));
Routes::Get(*router, base + "/plot/indexing_rate_per_file", Routes::bind(&DefaultApi::plot_indexing_rate_per_file_get_handler, this));
Routes::Get(*router, base + "/plot/receiver_delay", Routes::bind(&DefaultApi::plot_receiver_delay_get_handler, this));
Routes::Get(*router, base + "/plot/receiver_free_send_buffers", Routes::bind(&DefaultApi::plot_receiver_free_send_buffers_get_handler, this));
Routes::Get(*router, base + "/plot/roi_max_count", Routes::bind(&DefaultApi::plot_roi_max_count_get_handler, this));
@@ -84,6 +87,7 @@ void DefaultApi::setupRoutes() {
Routes::Post(*router, base + "/start", Routes::bind(&DefaultApi::start_post_handler, this));
Routes::Get(*router, base + "/statistics/calibration", Routes::bind(&DefaultApi::statistics_calibration_get_handler, this));
Routes::Get(*router, base + "/statistics/data_collection", Routes::bind(&DefaultApi::statistics_data_collection_get_handler, this));
Routes::Get(*router, base + "/statistics", Routes::bind(&DefaultApi::statistics_get_handler, this));
Routes::Get(*router, base + "/status", Routes::bind(&DefaultApi::status_get_handler, this));
Routes::Post(*router, base + "/trigger", Routes::bind(&DefaultApi::trigger_post_handler, this));
Routes::Get(*router, base + "/version", Routes::bind(&DefaultApi::version_get_handler, this));
@@ -417,6 +421,25 @@ void DefaultApi::config_internal_generator_image_tiff_put_handler(const Pistache
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->config_mask_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
@@ -536,6 +559,43 @@ void DefaultApi::config_spot_finding_put_handler(const Pistache::Rest::Request &
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_user_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->config_user_mask_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_user_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
try {
this->config_user_mask_put(request, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_user_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
@@ -573,6 +633,56 @@ void DefaultApi::config_user_mask_tiff_put_handler(const Pistache::Rest::Request
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_zeromq_preview_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->config_zeromq_preview_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_zeromq_preview_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the body param
Zeromq_preview_settings zeromqPreviewSettings;
try {
nlohmann::json::parse(request.body()).get_to(zeromqPreviewSettings);
zeromqPreviewSettings.validate();
} catch (std::exception &e) {
this->handleParsingException(e, response);
return;
}
try {
this->config_zeromq_preview_put(zeromqPreviewSettings, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::deactivate_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
@@ -669,31 +779,22 @@ void DefaultApi::pedestal_post_handler(const Pistache::Rest::Request &, Pistache
}
}
void DefaultApi::plot_azim_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
void DefaultApi::plot_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
try {
this->plot_azim_int_get(response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
// Getting the query params
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_azim_int_per_file_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->plot_azim_int_per_file_get(response);
this->plot_azim_int_get(compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -720,9 +821,17 @@ void DefaultApi::plot_bkg_estimate_get_handler(const Pistache::Rest::Request &re
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_bkg_estimate_get(binning, response);
this->plot_bkg_estimate_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -749,9 +858,17 @@ void DefaultApi::plot_error_pixel_get_handler(const Pistache::Rest::Request &req
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_error_pixel_get(binning, response);
this->plot_error_pixel_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -778,9 +895,17 @@ void DefaultApi::plot_image_collection_efficiency_get_handler(const Pistache::Re
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_image_collection_efficiency_get(binning, response);
this->plot_image_collection_efficiency_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -807,28 +932,17 @@ void DefaultApi::plot_indexing_rate_get_handler(const Pistache::Rest::Request &r
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_indexing_rate_get(binning, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_indexing_rate_per_file_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->plot_indexing_rate_per_file_get(response);
this->plot_indexing_rate_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -855,9 +969,17 @@ void DefaultApi::plot_receiver_delay_get_handler(const Pistache::Rest::Request &
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_receiver_delay_get(binning, response);
this->plot_receiver_delay_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -884,9 +1006,17 @@ void DefaultApi::plot_receiver_free_send_buffers_get_handler(const Pistache::Res
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_receiver_free_send_buffers_get(binning, response);
this->plot_receiver_free_send_buffers_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -913,9 +1043,17 @@ void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &r
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_roi_max_count_get(binning, response);
this->plot_roi_max_count_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -942,9 +1080,17 @@ void DefaultApi::plot_roi_sum_get_handler(const Pistache::Rest::Request &request
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_roi_sum_get(binning, response);
this->plot_roi_sum_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -971,9 +1117,17 @@ void DefaultApi::plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_roi_valid_pixels_get(binning, response);
this->plot_roi_valid_pixels_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -1000,9 +1154,17 @@ void DefaultApi::plot_spot_count_get_handler(const Pistache::Rest::Request &requ
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_spot_count_get(binning, response);
this->plot_spot_count_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -1029,9 +1191,17 @@ void DefaultApi::plot_strong_pixel_get_handler(const Pistache::Rest::Request &re
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_strong_pixel_get(binning, response);
this->plot_strong_pixel_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
@@ -1338,6 +1508,35 @@ void DefaultApi::statistics_data_collection_get_handler(const Pistache::Rest::Re
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::statistics_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->statistics_get(compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -40,12 +40,14 @@
#include "Fpga_status_inner.h"
#include "Image_format_settings.h"
#include "Instrument_metadata.h"
#include "Jfjoch_statistics.h"
#include "Measurement_statistics.h"
#include "Plots.h"
#include "Preview_settings.h"
#include "Roi_box_list.h"
#include "Roi_circle_list.h"
#include "Spot_finding_settings.h"
#include "Zeromq_preview_settings.h"
#include <string>
#include <vector>
@@ -76,25 +78,28 @@ private:
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_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_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 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_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_azim_int_per_file_get_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_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_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -114,6 +119,7 @@ private:
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);
@@ -246,7 +252,14 @@ private:
/// </remarks>
virtual void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get mask of the detector
/// Get mask of the detector (binary)
/// </summary>
/// <remarks>
/// Get full pixel mask of the detector See NXmx standard for meaning of pixel values
/// </remarks>
virtual void config_mask_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get mask of the detector (TIFF)
/// </summary>
/// <remarks>
/// Get full pixel mask of the detector See NXmx standard for meaning of pixel values
@@ -283,7 +296,21 @@ 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>
/// Get user mask of the detector
/// 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>
/// 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
@@ -297,6 +324,21 @@ private:
/// </remarks>
virtual void config_user_mask_tiff_put(const Pistache::Rest::Request &request, 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>
@@ -337,14 +379,8 @@ private:
/// <remarks>
/// Generate average radial integration profile
/// </remarks>
virtual void plot_azim_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_azim_int_per_file_get(Pistache::Http::ResponseWriter &response) = 0;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_azim_int_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate background estimate plot
/// </summary>
@@ -352,7 +388,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_bkg_estimate_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate error pixels plot
/// </summary>
@@ -360,7 +397,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_error_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate image collection efficiency plot
/// </summary>
@@ -368,7 +406,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_image_collection_efficiency_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate indexing rate plot
/// </summary>
@@ -376,14 +415,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_indexing_rate_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate receiver delay plot
/// </summary>
@@ -391,7 +424,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_receiver_delay_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate receiver free send buffer plot
/// </summary>
@@ -399,7 +433,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI max count
/// </summary>
@@ -407,7 +442,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_max_count_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate ROI sum plot
/// </summary>
@@ -415,7 +451,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_sum_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI valid pixels
/// </summary>
@@ -423,7 +460,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate spot count plot
/// </summary>
@@ -431,7 +469,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_spot_count_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate strong pixels plot
/// </summary>
@@ -439,7 +478,8 @@ private:
/// 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;
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_strong_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format for calibration with PyFAI/Dioptas
/// </summary>
@@ -470,7 +510,7 @@ private:
/// </remarks>
virtual void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get pedestal G0 in TIFF format
/// Get pedestal in TIFF format
/// </summary>
/// <remarks>
///
@@ -531,6 +571,14 @@ 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 true)</param>
virtual void statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Jungfraujoch status
/// </summary>
/// <remarks>
@@ -555,7 +603,7 @@ private:
/// 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 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.
/// </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;

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,8 +24,6 @@ Broker_status::Broker_status()
m_State = "";
m_Progress = 0.0f;
m_ProgressIsSet = false;
m_Indexing_rate = 0.0f;
m_Indexing_rateIsSet = false;
}
@@ -55,25 +53,6 @@ bool Broker_status::validate(std::stringstream& msg, const std::string& pathPref
const std::string currentValuePath = _pathPrefix + ".progress";
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;";
}
}
if (indexingRateIsSet())
{
const float& value = m_Indexing_rate;
const std::string currentValuePath = _pathPrefix + ".indexingRate";
if (value < static_cast<float>(0.0))
{
success = false;
@@ -99,10 +78,7 @@ bool Broker_status::operator==(const Broker_status& rhs) const
&&
((!progressIsSet() && !rhs.progressIsSet()) || (progressIsSet() && rhs.progressIsSet() && getProgress() == rhs.getProgress())) &&
((!indexingRateIsSet() && !rhs.indexingRateIsSet()) || (indexingRateIsSet() && rhs.indexingRateIsSet() && getIndexingRate() == rhs.getIndexingRate()))
((!progressIsSet() && !rhs.progressIsSet()) || (progressIsSet() && rhs.progressIsSet() && getProgress() == rhs.getProgress()))
;
}
@@ -118,8 +94,6 @@ void to_json(nlohmann::json& j, const Broker_status& o)
j["state"] = o.m_State;
if(o.progressIsSet())
j["progress"] = o.m_Progress;
if(o.indexingRateIsSet())
j["indexing_rate"] = o.m_Indexing_rate;
}
@@ -131,11 +105,6 @@ 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("indexing_rate") != j.end())
{
j.at("indexing_rate").get_to(o.m_Indexing_rate);
o.m_Indexing_rateIsSet = true;
}
}
@@ -164,23 +133,6 @@ void Broker_status::unsetProgress()
{
m_ProgressIsSet = false;
}
float Broker_status::getIndexingRate() const
{
return m_Indexing_rate;
}
void Broker_status::setIndexingRate(float const value)
{
m_Indexing_rate = value;
m_Indexing_rateIsSet = true;
}
bool Broker_status::indexingRateIsSet() const
{
return m_Indexing_rateIsSet;
}
void Broker_status::unsetIndexing_rate()
{
m_Indexing_rateIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -64,19 +64,12 @@ 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>
///
/// </summary>
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);
@@ -85,8 +78,6 @@ protected:
float m_Progress;
bool m_ProgressIsSet;
float m_Indexing_rate;
bool m_Indexing_rateIsSet;
};

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -117,7 +117,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);
@@ -131,7 +131,7 @@ public:
bool sampleNameIsSet() const;
void unsetSample_name();
/// <summary>
///
/// Compression type for the images transferred over ZeroMQ and saved to HDF5 file.
/// </summary>
std::string getCompression() const;
void setCompression(std::string const& value);
@@ -159,14 +159,14 @@ public:
bool goniometerIsSet() const;
void unsetGoniometer();
/// <summary>
/// Header appendix, added as user_data/user to start message (can be any valid JSON)
/// 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);
bool headerAppendixIsSet() const;
void unsetHeader_appendix();
/// <summary>
/// Image appendix, added as user_data to image message (can be any valid JSON)
/// Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON) Not saved in HDF5 file
/// </summary>
nlohmann::json getImageAppendix() const;
void setImageAppendix(nlohmann::json const& value);

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -12,7 +12,7 @@
/*
* Dataset_settings_unit_cell.h
*
* Units of angstrom and degree
* Unit cell parameters. Necessary to run indexing. Units of angstrom and degree
*/
#ifndef Dataset_settings_unit_cell_H_
@@ -25,7 +25,7 @@ namespace org::openapitools::server::model
{
/// <summary>
/// Units of angstrom and degree
/// Unit cell parameters. Necessary to run indexing. Units of angstrom and degree
/// </summary>
class Dataset_settings_unit_cell
{

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,6 +28,8 @@ Detector::Detector()
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_Calibration_fileIsSet = false;
@@ -129,7 +131,7 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
}
}
if (sensorThicknessUmIsSet())
{
const float& value = m_Sensor_thickness_um;
@@ -252,6 +254,9 @@ bool Detector::operator==(const Detector& rhs) const
((!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())) &&
@@ -297,6 +302,8 @@ void to_json(nlohmann::json& j, const Detector& o)
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.calibrationFileIsSet() || !o.m_Calibration_file.empty())
@@ -337,6 +344,11 @@ void from_json(const nlohmann::json& j, Detector& o)
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);
@@ -452,6 +464,23 @@ 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;

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -94,6 +94,13 @@ public:
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;
@@ -170,6 +177,8 @@ protected:
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;
std::vector<std::string> m_Calibration_file;

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -26,7 +26,6 @@ Detector_list_detectors_inner::Detector_list_detectors_inner()
m_Serial_number = "";
m_Base_ipv4_addr = "";
m_Udp_interface_count = 0L;
m_Udp_interface_countIsSet = false;
m_Nmodules = 0L;
m_Width = 0L;
m_Height = 0L;
@@ -87,8 +86,8 @@ bool Detector_list_detectors_inner::operator==(const Detector_list_detectors_inn
(getBaseIpv4Addr() == rhs.getBaseIpv4Addr())
&&
((!udpInterfaceCountIsSet() && !rhs.udpInterfaceCountIsSet()) || (udpInterfaceCountIsSet() && rhs.udpInterfaceCountIsSet() && getUdpInterfaceCount() == rhs.getUdpInterfaceCount())) &&
(getUdpInterfaceCount() == rhs.getUdpInterfaceCount())
&&
(getNmodules() == rhs.getNmodules())
&&
@@ -114,8 +113,7 @@ void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o)
j["description"] = o.m_Description;
j["serial_number"] = o.m_Serial_number;
j["base_ipv4_addr"] = o.m_Base_ipv4_addr;
if(o.udpInterfaceCountIsSet())
j["udp_interface_count"] = o.m_Udp_interface_count;
j["udp_interface_count"] = o.m_Udp_interface_count;
j["nmodules"] = o.m_Nmodules;
j["width"] = o.m_Width;
j["height"] = o.m_Height;
@@ -128,11 +126,7 @@ void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o)
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);
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;
}
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);
@@ -178,15 +172,6 @@ int64_t Detector_list_detectors_inner::getUdpInterfaceCount() const
void Detector_list_detectors_inner::setUdpInterfaceCount(int64_t const value)
{
m_Udp_interface_count = value;
m_Udp_interface_countIsSet = true;
}
bool Detector_list_detectors_inner::udpInterfaceCountIsSet() const
{
return m_Udp_interface_countIsSet;
}
void Detector_list_detectors_inner::unsetUdp_interface_count()
{
m_Udp_interface_countIsSet = false;
}
int64_t Detector_list_detectors_inner::getNmodules() const
{

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -83,8 +83,6 @@ public:
/// </summary>
int64_t getUdpInterfaceCount() const;
void setUdpInterfaceCount(int64_t const value);
bool udpInterfaceCountIsSet() const;
void unsetUdp_interface_count();
/// <summary>
///
/// </summary>
@@ -113,7 +111,7 @@ protected:
std::string m_Base_ipv4_addr;
int64_t m_Udp_interface_count;
bool m_Udp_interface_countIsSet;
int64_t m_Nmodules;
int64_t m_Width;

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,122 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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

@@ -0,0 +1,80 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,21 +24,33 @@ 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_Internal_frame_generator = false;
m_Internal_frame_generatorIsSet = false;
m_Internal_frame_generator_images = 1L;
m_Pedestal_g0_frames = 2000L;
m_Pedestal_g1_frames = 300L;
m_Pedestal_g2_frames = 300L;
m_Pedestal_g0_rms_limit = 100L;
m_Pedestal_window_size = 128L;
m_Storage_cell_delay_ns = 5000L;
m_Internal_frame_generator_imagesIsSet = false;
m_Detector_trigger_delay_ns = 0L;
m_Detector_trigger_delay_nsIsSet = false;
m_Fixed_gain_g1 = false;
m_Fixed_gain_g1IsSet = false;
m_Use_gain_hg0 = false;
m_Use_gain_hg0IsSet = 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;
}
@@ -75,28 +87,9 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
}
}
/* Storage_cell_count */ {
const int64_t& value = m_Storage_cell_count;
const std::string currentValuePath = _pathPrefix + ".storageCellCount";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 16ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 16;";
}
}
/* Internal_frame_generator_images */ {
if (internalFrameGeneratorImagesIsSet())
{
const int64_t& value = m_Internal_frame_generator_images;
const std::string currentValuePath = _pathPrefix + ".internalFrameGeneratorImages";
@@ -106,94 +99,10 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 128ll)
if (value > 64ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 128;";
}
}
/* Pedestal_g0_frames */ {
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;";
}
}
/* Pedestal_g1_frames */ {
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;";
}
}
/* Pedestal_g2_frames */ {
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;";
}
}
/* Pedestal_g0_rms_limit */ {
const int64_t& value = m_Pedestal_g0_rms_limit;
const std::string currentValuePath = _pathPrefix + ".pedestalG0RmsLimit";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Pedestal_window_size */ {
const int64_t& value = m_Pedestal_window_size;
const std::string currentValuePath = _pathPrefix + ".pedestalWindowSize";
if (value < 32ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 32;";
}
}
/* Storage_cell_delay_ns */ {
const int64_t& value = m_Storage_cell_delay_ns;
const std::string currentValuePath = _pathPrefix + ".storageCellDelayNs";
if (value < 2100ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 2100;";
msg << currentValuePath << ": must be less than or equal to 64;";
}
}
@@ -211,6 +120,114 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
}
}
if (eigerThresholdKeVIsSet())
{
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";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > 16ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 16;";
}
}
if (jungfrauStorageCellDelayNsIsSet())
{
const int64_t& value = m_Jungfrau_storage_cell_delay_ns;
const std::string currentValuePath = _pathPrefix + ".jungfrauStorageCellDelayNs";
if (value < 2100ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 2100;";
}
}
return success;
}
@@ -226,41 +243,47 @@ bool Detector_settings::operator==(const Detector_settings& rhs) const
((!countTimeUsIsSet() && !rhs.countTimeUsIsSet()) || (countTimeUsIsSet() && rhs.countTimeUsIsSet() && getCountTimeUs() == rhs.getCountTimeUs())) &&
(getStorageCellCount() == rhs.getStorageCellCount())
&&
(isInternalFrameGenerator() == rhs.isInternalFrameGenerator())
&&
((!internalFrameGeneratorIsSet() && !rhs.internalFrameGeneratorIsSet()) || (internalFrameGeneratorIsSet() && rhs.internalFrameGeneratorIsSet() && isInternalFrameGenerator() == rhs.isInternalFrameGenerator())) &&
(getInternalFrameGeneratorImages() == rhs.getInternalFrameGeneratorImages())
&&
(getPedestalG0Frames() == rhs.getPedestalG0Frames())
&&
(getPedestalG1Frames() == rhs.getPedestalG1Frames())
&&
(getPedestalG2Frames() == rhs.getPedestalG2Frames())
&&
(getPedestalG0RmsLimit() == rhs.getPedestalG0RmsLimit())
&&
(getPedestalWindowSize() == rhs.getPedestalWindowSize())
&&
(getStorageCellDelayNs() == rhs.getStorageCellDelayNs())
&&
((!internalFrameGeneratorImagesIsSet() && !rhs.internalFrameGeneratorImagesIsSet()) || (internalFrameGeneratorImagesIsSet() && rhs.internalFrameGeneratorImagesIsSet() && getInternalFrameGeneratorImages() == rhs.getInternalFrameGeneratorImages())) &&
((!detectorTriggerDelayNsIsSet() && !rhs.detectorTriggerDelayNsIsSet()) || (detectorTriggerDelayNsIsSet() && rhs.detectorTriggerDelayNsIsSet() && getDetectorTriggerDelayNs() == rhs.getDetectorTriggerDelayNs())) &&
((!fixedGainG1IsSet() && !rhs.fixedGainG1IsSet()) || (fixedGainG1IsSet() && rhs.fixedGainG1IsSet() && isFixedGainG1() == rhs.isFixedGainG1())) &&
((!timingIsSet() && !rhs.timingIsSet()) || (timingIsSet() && rhs.timingIsSet() && getTiming() == rhs.getTiming())) &&
((!useGainHg0IsSet() && !rhs.useGainHg0IsSet()) || (useGainHg0IsSet() && rhs.useGainHg0IsSet() && isUseGainHg0() == rhs.isUseGainHg0()))
((!eigerThresholdKeVIsSet() && !rhs.eigerThresholdKeVIsSet()) || (eigerThresholdKeVIsSet() && rhs.eigerThresholdKeVIsSet() && getEigerThresholdKeV() == rhs.getEigerThresholdKeV())) &&
((!eigerBitDepthIsSet() && !rhs.eigerBitDepthIsSet()) || (eigerBitDepthIsSet() && rhs.eigerBitDepthIsSet() && getEigerBitDepth() == rhs.getEigerBitDepth())) &&
((!jungfrauPedestalG0FramesIsSet() && !rhs.jungfrauPedestalG0FramesIsSet()) || (jungfrauPedestalG0FramesIsSet() && rhs.jungfrauPedestalG0FramesIsSet() && getJungfrauPedestalG0Frames() == rhs.getJungfrauPedestalG0Frames())) &&
((!jungfrauPedestalG1FramesIsSet() && !rhs.jungfrauPedestalG1FramesIsSet()) || (jungfrauPedestalG1FramesIsSet() && rhs.jungfrauPedestalG1FramesIsSet() && getJungfrauPedestalG1Frames() == rhs.getJungfrauPedestalG1Frames())) &&
((!jungfrauPedestalG2FramesIsSet() && !rhs.jungfrauPedestalG2FramesIsSet()) || (jungfrauPedestalG2FramesIsSet() && rhs.jungfrauPedestalG2FramesIsSet() && getJungfrauPedestalG2Frames() == rhs.getJungfrauPedestalG2Frames())) &&
((!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()))
;
}
@@ -276,21 +299,34 @@ void to_json(nlohmann::json& j, const Detector_settings& o)
j["frame_time_us"] = o.m_Frame_time_us;
if(o.countTimeUsIsSet())
j["count_time_us"] = o.m_Count_time_us;
j["storage_cell_count"] = o.m_Storage_cell_count;
j["internal_frame_generator"] = o.m_Internal_frame_generator;
j["internal_frame_generator_images"] = o.m_Internal_frame_generator_images;
j["pedestal_g0_frames"] = o.m_Pedestal_g0_frames;
j["pedestal_g1_frames"] = o.m_Pedestal_g1_frames;
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
j["pedestal_g0_rms_limit"] = o.m_Pedestal_g0_rms_limit;
j["pedestal_window_size"] = o.m_Pedestal_window_size;
j["storage_cell_delay_ns"] = o.m_Storage_cell_delay_ns;
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.fixedGainG1IsSet())
j["fixed_gain_g1"] = o.m_Fixed_gain_g1;
if(o.useGainHg0IsSet())
j["use_gain_hg0"] = o.m_Use_gain_hg0;
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;
}
@@ -302,29 +338,75 @@ 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;
}
j.at("storage_cell_count").get_to(o.m_Storage_cell_count);
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
j.at("internal_frame_generator_images").get_to(o.m_Internal_frame_generator_images);
j.at("pedestal_g0_frames").get_to(o.m_Pedestal_g0_frames);
j.at("pedestal_g1_frames").get_to(o.m_Pedestal_g1_frames);
j.at("pedestal_g2_frames").get_to(o.m_Pedestal_g2_frames);
j.at("pedestal_g0_rms_limit").get_to(o.m_Pedestal_g0_rms_limit);
j.at("pedestal_window_size").get_to(o.m_Pedestal_window_size);
j.at("storage_cell_delay_ns").get_to(o.m_Storage_cell_delay_ns);
if(j.find("internal_frame_generator") != j.end())
{
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
o.m_Internal_frame_generatorIsSet = true;
}
if(j.find("internal_frame_generator_images") != j.end())
{
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())
{
j.at("detector_trigger_delay_ns").get_to(o.m_Detector_trigger_delay_ns);
o.m_Detector_trigger_delay_nsIsSet = true;
}
if(j.find("fixed_gain_g1") != j.end())
if(j.find("timing") != j.end())
{
j.at("fixed_gain_g1").get_to(o.m_Fixed_gain_g1);
o.m_Fixed_gain_g1IsSet = true;
j.at("timing").get_to(o.m_Timing);
o.m_TimingIsSet = true;
}
if(j.find("use_gain_hg0") != j.end())
if(j.find("eiger_threshold_keV") != j.end())
{
j.at("use_gain_hg0").get_to(o.m_Use_gain_hg0);
o.m_Use_gain_hg0IsSet = true;
j.at("eiger_threshold_keV").get_to(o.m_Eiger_threshold_keV);
o.m_Eiger_threshold_keVIsSet = true;
}
if(j.find("eiger_bit_depth") != j.end())
{
j.at("eiger_bit_depth").get_to(o.m_Eiger_bit_depth);
o.m_Eiger_bit_depthIsSet = true;
}
if(j.find("jungfrau_pedestal_g0_frames") != j.end())
{
j.at("jungfrau_pedestal_g0_frames").get_to(o.m_Jungfrau_pedestal_g0_frames);
o.m_Jungfrau_pedestal_g0_framesIsSet = true;
}
if(j.find("jungfrau_pedestal_g1_frames") != j.end())
{
j.at("jungfrau_pedestal_g1_frames").get_to(o.m_Jungfrau_pedestal_g1_frames);
o.m_Jungfrau_pedestal_g1_framesIsSet = true;
}
if(j.find("jungfrau_pedestal_g2_frames") != j.end())
{
j.at("jungfrau_pedestal_g2_frames").get_to(o.m_Jungfrau_pedestal_g2_frames);
o.m_Jungfrau_pedestal_g2_framesIsSet = true;
}
if(j.find("jungfrau_pedestal_min_image_count") != 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;
}
}
@@ -354,14 +436,6 @@ 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;
}
bool Detector_settings::isInternalFrameGenerator() const
{
return m_Internal_frame_generator;
@@ -369,6 +443,15 @@ bool Detector_settings::isInternalFrameGenerator() const
void Detector_settings::setInternalFrameGenerator(bool const value)
{
m_Internal_frame_generator = value;
m_Internal_frame_generatorIsSet = true;
}
bool Detector_settings::internalFrameGeneratorIsSet() const
{
return m_Internal_frame_generatorIsSet;
}
void Detector_settings::unsetInternal_frame_generator()
{
m_Internal_frame_generatorIsSet = false;
}
int64_t Detector_settings::getInternalFrameGeneratorImages() const
{
@@ -377,54 +460,15 @@ int64_t Detector_settings::getInternalFrameGeneratorImages() const
void Detector_settings::setInternalFrameGeneratorImages(int64_t const value)
{
m_Internal_frame_generator_images = value;
m_Internal_frame_generator_imagesIsSet = true;
}
int64_t Detector_settings::getPedestalG0Frames() const
bool Detector_settings::internalFrameGeneratorImagesIsSet() const
{
return m_Pedestal_g0_frames;
return m_Internal_frame_generator_imagesIsSet;
}
void Detector_settings::setPedestalG0Frames(int64_t const value)
void Detector_settings::unsetInternal_frame_generator_images()
{
m_Pedestal_g0_frames = value;
}
int64_t Detector_settings::getPedestalG1Frames() const
{
return m_Pedestal_g1_frames;
}
void Detector_settings::setPedestalG1Frames(int64_t const value)
{
m_Pedestal_g1_frames = value;
}
int64_t Detector_settings::getPedestalG2Frames() const
{
return m_Pedestal_g2_frames;
}
void Detector_settings::setPedestalG2Frames(int64_t const value)
{
m_Pedestal_g2_frames = value;
}
int64_t Detector_settings::getPedestalG0RmsLimit() const
{
return m_Pedestal_g0_rms_limit;
}
void Detector_settings::setPedestalG0RmsLimit(int64_t const value)
{
m_Pedestal_g0_rms_limit = value;
}
int64_t Detector_settings::getPedestalWindowSize() const
{
return m_Pedestal_window_size;
}
void Detector_settings::setPedestalWindowSize(int64_t const value)
{
m_Pedestal_window_size = value;
}
int64_t Detector_settings::getStorageCellDelayNs() const
{
return m_Storage_cell_delay_ns;
}
void Detector_settings::setStorageCellDelayNs(int64_t const value)
{
m_Storage_cell_delay_ns = value;
m_Internal_frame_generator_imagesIsSet = false;
}
int64_t Detector_settings::getDetectorTriggerDelayNs() const
{
@@ -443,39 +487,192 @@ void Detector_settings::unsetDetector_trigger_delay_ns()
{
m_Detector_trigger_delay_nsIsSet = false;
}
bool Detector_settings::isFixedGainG1() const
org::openapitools::server::model::Detector_timing Detector_settings::getTiming() const
{
return m_Fixed_gain_g1;
return m_Timing;
}
void Detector_settings::setFixedGainG1(bool const value)
void Detector_settings::setTiming(org::openapitools::server::model::Detector_timing const& value)
{
m_Fixed_gain_g1 = value;
m_Fixed_gain_g1IsSet = true;
m_Timing = value;
m_TimingIsSet = true;
}
bool Detector_settings::fixedGainG1IsSet() const
bool Detector_settings::timingIsSet() const
{
return m_Fixed_gain_g1IsSet;
return m_TimingIsSet;
}
void Detector_settings::unsetFixed_gain_g1()
void Detector_settings::unsetTiming()
{
m_Fixed_gain_g1IsSet = false;
m_TimingIsSet = false;
}
bool Detector_settings::isUseGainHg0() const
float Detector_settings::getEigerThresholdKeV() const
{
return m_Use_gain_hg0;
return m_Eiger_threshold_keV;
}
void Detector_settings::setUseGainHg0(bool const value)
void Detector_settings::setEigerThresholdKeV(float const value)
{
m_Use_gain_hg0 = value;
m_Use_gain_hg0IsSet = true;
m_Eiger_threshold_keV = value;
m_Eiger_threshold_keVIsSet = true;
}
bool Detector_settings::useGainHg0IsSet() const
bool Detector_settings::eigerThresholdKeVIsSet() const
{
return m_Use_gain_hg0IsSet;
return m_Eiger_threshold_keVIsSet;
}
void Detector_settings::unsetUse_gain_hg0()
void Detector_settings::unsetEiger_threshold_keV()
{
m_Use_gain_hg0IsSet = false;
m_Eiger_threshold_keVIsSet = false;
}
int64_t Detector_settings::getEigerBitDepth() const
{
return m_Eiger_bit_depth;
}
void Detector_settings::setEigerBitDepth(int64_t const value)
{
m_Eiger_bit_depth = value;
m_Eiger_bit_depthIsSet = true;
}
bool Detector_settings::eigerBitDepthIsSet() const
{
return m_Eiger_bit_depthIsSet;
}
void Detector_settings::unsetEiger_bit_depth()
{
m_Eiger_bit_depthIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalG0Frames() const
{
return m_Jungfrau_pedestal_g0_frames;
}
void Detector_settings::setJungfrauPedestalG0Frames(int64_t const value)
{
m_Jungfrau_pedestal_g0_frames = value;
m_Jungfrau_pedestal_g0_framesIsSet = true;
}
bool Detector_settings::jungfrauPedestalG0FramesIsSet() const
{
return m_Jungfrau_pedestal_g0_framesIsSet;
}
void Detector_settings::unsetJungfrau_pedestal_g0_frames()
{
m_Jungfrau_pedestal_g0_framesIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalG1Frames() const
{
return m_Jungfrau_pedestal_g1_frames;
}
void Detector_settings::setJungfrauPedestalG1Frames(int64_t const value)
{
m_Jungfrau_pedestal_g1_frames = value;
m_Jungfrau_pedestal_g1_framesIsSet = true;
}
bool Detector_settings::jungfrauPedestalG1FramesIsSet() const
{
return m_Jungfrau_pedestal_g1_framesIsSet;
}
void Detector_settings::unsetJungfrau_pedestal_g1_frames()
{
m_Jungfrau_pedestal_g1_framesIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalG2Frames() const
{
return m_Jungfrau_pedestal_g2_frames;
}
void Detector_settings::setJungfrauPedestalG2Frames(int64_t const value)
{
m_Jungfrau_pedestal_g2_frames = value;
m_Jungfrau_pedestal_g2_framesIsSet = true;
}
bool Detector_settings::jungfrauPedestalG2FramesIsSet() const
{
return m_Jungfrau_pedestal_g2_framesIsSet;
}
void Detector_settings::unsetJungfrau_pedestal_g2_frames()
{
m_Jungfrau_pedestal_g2_framesIsSet = false;
}
int64_t Detector_settings::getJungfrauPedestalMinImageCount() const
{
return m_Jungfrau_pedestal_min_image_count;
}
void Detector_settings::setJungfrauPedestalMinImageCount(int64_t const value)
{
m_Jungfrau_pedestal_min_image_count = value;
m_Jungfrau_pedestal_min_image_countIsSet = true;
}
bool Detector_settings::jungfrauPedestalMinImageCountIsSet() const
{
return m_Jungfrau_pedestal_min_image_countIsSet;
}
void Detector_settings::unsetJungfrau_pedestal_min_image_count()
{
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;
}

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,6 +19,7 @@
#define Detector_settings_H_
#include "Detector_timing.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
@@ -58,62 +59,31 @@ public:
/// Detector_settings members
/// <summary>
/// Interval between consecutive frames.
/// 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
/// </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);
/// <summary>
/// Use internal frame generator in FPGA instead of getting data from a real detector
/// </summary>
bool isInternalFrameGenerator() const;
void setInternalFrameGenerator(bool const value);
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);
/// <summary>
///
/// </summary>
int64_t getPedestalG0Frames() const;
void setPedestalG0Frames(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getPedestalG1Frames() const;
void setPedestalG1Frames(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getPedestalG2Frames() const;
void setPedestalG2Frames(int64_t const value);
/// <summary>
/// Pixels with pedestal G0 RMS above the threshold are marked as masked pixels
/// </summary>
int64_t getPedestalG0RmsLimit() const;
void setPedestalG0RmsLimit(int64_t const value);
/// <summary>
/// Running average window size for pedestal calculations
/// </summary>
int64_t getPedestalWindowSize() const;
void setPedestalWindowSize(int64_t const value);
/// <summary>
/// Delay between two storage cells [ns]
/// </summary>
int64_t getStorageCellDelayNs() const;
void setStorageCellDelayNs(int64_t const value);
bool internalFrameGeneratorImagesIsSet() const;
void unsetInternal_frame_generator_images();
/// <summary>
/// Delay between TTL trigger and acquisition start [ns]
/// </summary>
@@ -122,19 +92,82 @@ public:
bool detectorTriggerDelayNsIsSet() const;
void unsetDetector_trigger_delay_ns();
/// <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();
/// <summary>
///
/// </summary>
int64_t getJungfrauPedestalG0Frames() const;
void setJungfrauPedestalG0Frames(int64_t const value);
bool jungfrauPedestalG0FramesIsSet() const;
void unsetJungfrau_pedestal_g0_frames();
/// <summary>
///
/// </summary>
int64_t getJungfrauPedestalG1Frames() const;
void setJungfrauPedestalG1Frames(int64_t const value);
bool jungfrauPedestalG1FramesIsSet() const;
void unsetJungfrau_pedestal_g1_frames();
/// <summary>
///
/// </summary>
int64_t getJungfrauPedestalG2Frames() const;
void setJungfrauPedestalG2Frames(int64_t const value);
bool jungfrauPedestalG2FramesIsSet() const;
void unsetJungfrau_pedestal_g2_frames();
/// <summary>
/// Minimum number of collected images for pedestal to consider it viable
/// </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();
/// <summary>
/// Fix gain to G1 (can be useful for storage cells)
/// </summary>
bool isFixedGainG1() const;
void setFixedGainG1(bool const value);
bool fixedGainG1IsSet() const;
void unsetFixed_gain_g1();
bool isJungfrauFixedGainG1() const;
void setJungfrauFixedGainG1(bool const value);
bool jungfrauFixedGainG1IsSet() const;
void unsetJungfrau_fixed_gain_g1();
/// <summary>
/// Use high G0 (for low energy applications)
/// </summary>
bool isUseGainHg0() const;
void setUseGainHg0(bool const value);
bool useGainHg0IsSet() const;
void unsetUse_gain_hg0();
bool isJungfrauUseGainHg0() const;
void setJungfrauUseGainHg0(bool const value);
bool jungfrauUseGainHg0IsSet() const;
void unsetJungfrau_use_gain_hg0();
friend void to_json(nlohmann::json& j, const Detector_settings& o);
friend void from_json(const nlohmann::json& j, Detector_settings& o);
@@ -143,30 +176,34 @@ protected:
int64_t m_Count_time_us;
bool m_Count_time_usIsSet;
int64_t m_Storage_cell_count;
bool m_Internal_frame_generator;
bool m_Internal_frame_generatorIsSet;
int64_t m_Internal_frame_generator_images;
int64_t m_Pedestal_g0_frames;
int64_t m_Pedestal_g1_frames;
int64_t m_Pedestal_g2_frames;
int64_t m_Pedestal_g0_rms_limit;
int64_t m_Pedestal_window_size;
int64_t m_Storage_cell_delay_ns;
bool m_Internal_frame_generator_imagesIsSet;
int64_t m_Detector_trigger_delay_ns;
bool m_Detector_trigger_delay_nsIsSet;
bool m_Fixed_gain_g1;
bool m_Fixed_gain_g1IsSet;
bool m_Use_gain_hg0;
bool m_Use_gain_hg0IsSet;
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;
};

View File

@@ -0,0 +1,134 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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

@@ -0,0 +1,82 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,8 +21,6 @@ namespace org::openapitools::server::model
Detector_status::Detector_status()
{
m_State = "";
m_Powerchip = "";
m_Server_version = "";
m_Number_of_triggers_left = 0L;
@@ -147,19 +145,19 @@ void from_json(const nlohmann::json& j, Detector_status& o)
}
std::string Detector_status::getState() const
org::openapitools::server::model::Detector_state Detector_status::getState() const
{
return m_State;
}
void Detector_status::setState(std::string const& value)
void Detector_status::setState(org::openapitools::server::model::Detector_state const& value)
{
m_State = value;
}
std::string Detector_status::getPowerchip() const
org::openapitools::server::model::Detector_power_state Detector_status::getPowerchip() const
{
return m_Powerchip;
}
void Detector_status::setPowerchip(std::string const& value)
void Detector_status::setPowerchip(org::openapitools::server::model::Detector_power_state const& value)
{
m_Powerchip = value;
}

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,7 +19,9 @@
#define Detector_status_H_
#include "Detector_state.h"
#include <string>
#include "Detector_power_state.h"
#include <vector>
#include <nlohmann/json.hpp>
@@ -60,15 +62,15 @@ public:
/// Detector_status members
/// <summary>
/// Current state of the detector
///
/// </summary>
std::string getState() const;
void setState(std::string const& value);
org::openapitools::server::model::Detector_state getState() const;
void setState(org::openapitools::server::model::Detector_state const& value);
/// <summary>
/// Power on of ASICs
///
/// </summary>
std::string getPowerchip() const;
void setPowerchip(std::string const& value);
org::openapitools::server::model::Detector_power_state getPowerchip() const;
void setPowerchip(org::openapitools::server::model::Detector_power_state const& value);
/// <summary>
/// Detector server (on read-out boards) version
/// </summary>
@@ -93,9 +95,9 @@ public:
friend void to_json(nlohmann::json& j, const Detector_status& o);
friend void from_json(const nlohmann::json& j, Detector_status& o);
protected:
std::string m_State;
org::openapitools::server::model::Detector_state m_State;
std::string m_Powerchip;
org::openapitools::server::model::Detector_power_state m_Powerchip;
std::string m_Server_version;

View File

@@ -0,0 +1,128 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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

@@ -0,0 +1,81 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,16 +21,18 @@ 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_countIsSet = false;
m_Eth_link_status = 0L;
m_Eth_link_statusIsSet = false;
m_Power_usage_W = 0.0f;
m_Power_usage_WIsSet = false;
m_Fpga_temp_C = 0.0f;
m_Fpga_temp_CIsSet = false;
m_Hbm_temp_C = 0.0f;
m_Hbm_temp_CIsSet = false;
m_Packets_udp = 0L;
m_Packets_sls = 0L;
m_Idle = false;
}
@@ -53,7 +55,7 @@ bool Fpga_status_inner::validate(std::stringstream& msg, const std::string& path
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Fpga_status_inner" : pathPrefix;
return success;
}
@@ -62,20 +64,41 @@ bool Fpga_status_inner::operator==(const Fpga_status_inner& rhs) const
return
(getPciDevId() == rhs.getPciDevId())
&&
((!ethLinkCountIsSet() && !rhs.ethLinkCountIsSet()) || (ethLinkCountIsSet() && rhs.ethLinkCountIsSet() && getEthLinkCount() == rhs.getEthLinkCount())) &&
(getSerialNumber() == rhs.getSerialNumber())
&&
(getFwVersion() == rhs.getFwVersion())
&&
((!ethLinkStatusIsSet() && !rhs.ethLinkStatusIsSet()) || (ethLinkStatusIsSet() && rhs.ethLinkStatusIsSet() && getEthLinkStatus() == rhs.getEthLinkStatus())) &&
(getBaseMacAddr() == rhs.getBaseMacAddr())
&&
(getEthLinkCount() == rhs.getEthLinkCount())
&&
((!powerUsageWIsSet() && !rhs.powerUsageWIsSet()) || (powerUsageWIsSet() && rhs.powerUsageWIsSet() && getPowerUsageW() == rhs.getPowerUsageW())) &&
(getEthLinkStatus() == rhs.getEthLinkStatus())
&&
(getPowerUsageW() == rhs.getPowerUsageW())
&&
((!fpgaTempCIsSet() && !rhs.fpgaTempCIsSet()) || (fpgaTempCIsSet() && rhs.fpgaTempCIsSet() && getFpgaTempC() == rhs.getFpgaTempC())) &&
(getFpgaTempC() == rhs.getFpgaTempC())
&&
(getHbmTempC() == rhs.getHbmTempC())
&&
(getPacketsUdp() == rhs.getPacketsUdp())
&&
(getPacketsSls() == rhs.getPacketsSls())
&&
(isIdle() == rhs.isIdle())
((!hbmTempCIsSet() && !rhs.hbmTempCIsSet()) || (hbmTempCIsSet() && rhs.hbmTempCIsSet() && getHbmTempC() == rhs.getHbmTempC()))
;
}
@@ -88,49 +111,70 @@ bool Fpga_status_inner::operator!=(const Fpga_status_inner& rhs) const
void to_json(nlohmann::json& j, const Fpga_status_inner& o)
{
j = nlohmann::json::object();
if(o.ethLinkCountIsSet())
j["eth_link_count"] = o.m_Eth_link_count;
if(o.ethLinkStatusIsSet())
j["eth_link_status"] = o.m_Eth_link_status;
if(o.powerUsageWIsSet())
j["power_usage_W"] = o.m_Power_usage_W;
if(o.fpgaTempCIsSet())
j["fpga_temp_C"] = o.m_Fpga_temp_C;
if(o.hbmTempCIsSet())
j["hbm_temp_C"] = o.m_Hbm_temp_C;
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;
}
void from_json(const nlohmann::json& j, Fpga_status_inner& o)
{
if(j.find("eth_link_count") != j.end())
{
j.at("eth_link_count").get_to(o.m_Eth_link_count);
o.m_Eth_link_countIsSet = true;
}
if(j.find("eth_link_status") != j.end())
{
j.at("eth_link_status").get_to(o.m_Eth_link_status);
o.m_Eth_link_statusIsSet = true;
}
if(j.find("power_usage_W") != j.end())
{
j.at("power_usage_W").get_to(o.m_Power_usage_W);
o.m_Power_usage_WIsSet = true;
}
if(j.find("fpga_temp_C") != j.end())
{
j.at("fpga_temp_C").get_to(o.m_Fpga_temp_C);
o.m_Fpga_temp_CIsSet = true;
}
if(j.find("hbm_temp_C") != j.end())
{
j.at("hbm_temp_C").get_to(o.m_Hbm_temp_C);
o.m_Hbm_temp_CIsSet = true;
}
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);
}
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;
@@ -138,15 +182,6 @@ int64_t Fpga_status_inner::getEthLinkCount() const
void Fpga_status_inner::setEthLinkCount(int64_t const value)
{
m_Eth_link_count = value;
m_Eth_link_countIsSet = true;
}
bool Fpga_status_inner::ethLinkCountIsSet() const
{
return m_Eth_link_countIsSet;
}
void Fpga_status_inner::unsetEth_link_count()
{
m_Eth_link_countIsSet = false;
}
int64_t Fpga_status_inner::getEthLinkStatus() const
{
@@ -155,15 +190,6 @@ int64_t Fpga_status_inner::getEthLinkStatus() const
void Fpga_status_inner::setEthLinkStatus(int64_t const value)
{
m_Eth_link_status = value;
m_Eth_link_statusIsSet = true;
}
bool Fpga_status_inner::ethLinkStatusIsSet() const
{
return m_Eth_link_statusIsSet;
}
void Fpga_status_inner::unsetEth_link_status()
{
m_Eth_link_statusIsSet = false;
}
float Fpga_status_inner::getPowerUsageW() const
{
@@ -172,15 +198,6 @@ float Fpga_status_inner::getPowerUsageW() const
void Fpga_status_inner::setPowerUsageW(float const value)
{
m_Power_usage_W = value;
m_Power_usage_WIsSet = true;
}
bool Fpga_status_inner::powerUsageWIsSet() const
{
return m_Power_usage_WIsSet;
}
void Fpga_status_inner::unsetPower_usage_W()
{
m_Power_usage_WIsSet = false;
}
float Fpga_status_inner::getFpgaTempC() const
{
@@ -189,15 +206,6 @@ float Fpga_status_inner::getFpgaTempC() const
void Fpga_status_inner::setFpgaTempC(float const value)
{
m_Fpga_temp_C = value;
m_Fpga_temp_CIsSet = true;
}
bool Fpga_status_inner::fpgaTempCIsSet() const
{
return m_Fpga_temp_CIsSet;
}
void Fpga_status_inner::unsetFpga_temp_C()
{
m_Fpga_temp_CIsSet = false;
}
float Fpga_status_inner::getHbmTempC() const
{
@@ -206,15 +214,30 @@ float Fpga_status_inner::getHbmTempC() const
void Fpga_status_inner::setHbmTempC(float const value)
{
m_Hbm_temp_C = value;
m_Hbm_temp_CIsSet = true;
}
bool Fpga_status_inner::hbmTempCIsSet() const
int64_t Fpga_status_inner::getPacketsUdp() const
{
return m_Hbm_temp_CIsSet;
return m_Packets_udp;
}
void Fpga_status_inner::unsetHbm_temp_C()
void Fpga_status_inner::setPacketsUdp(int64_t const value)
{
m_Hbm_temp_CIsSet = false;
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;
}

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,6 +19,7 @@
#define Fpga_status_inner_H_
#include <string>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
@@ -57,55 +58,94 @@ public:
/////////////////////////////////////////////
/// 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);
bool ethLinkCountIsSet() const;
void unsetEth_link_count();
/// <summary>
///
/// </summary>
int64_t getEthLinkStatus() const;
void setEthLinkStatus(int64_t const value);
bool ethLinkStatusIsSet() const;
void unsetEth_link_status();
/// <summary>
///
/// </summary>
float getPowerUsageW() const;
void setPowerUsageW(float const value);
bool powerUsageWIsSet() const;
void unsetPower_usage_W();
/// <summary>
///
/// </summary>
float getFpgaTempC() const;
void setFpgaTempC(float const value);
bool fpgaTempCIsSet() const;
void unsetFpga_temp_C();
/// <summary>
///
/// </summary>
float getHbmTempC() const;
void setHbmTempC(float const value);
bool hbmTempCIsSet() const;
void unsetHbm_temp_C();
/// <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);
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;
bool m_Eth_link_countIsSet;
int64_t m_Eth_link_status;
bool m_Eth_link_statusIsSet;
float m_Power_usage_W;
bool m_Power_usage_WIsSet;
float m_Fpga_temp_C;
bool m_Fpga_temp_CIsSet;
float m_Hbm_temp_C;
bool m_Hbm_temp_CIsSet;
int64_t m_Packets_udp;
int64_t m_Packets_sls;
bool m_Idle;
};

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -32,6 +32,11 @@ Image_format_settings::Image_format_settings()
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;
}
@@ -73,7 +78,21 @@ bool Image_format_settings::validate(std::stringstream& msg, const std::string&
}
}
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;
}
@@ -104,8 +123,17 @@ bool Image_format_settings::operator==(const Image_format_settings& rhs) const
&&
(isMaskChipEdges() == rhs.isMaskChipEdges())
&&
((!jungfrauMaskPixelsWithoutG0IsSet() && !rhs.jungfrauMaskPixelsWithoutG0IsSet()) || (jungfrauMaskPixelsWithoutG0IsSet() && rhs.jungfrauMaskPixelsWithoutG0IsSet() && isJungfrauMaskPixelsWithoutG0() == rhs.isJungfrauMaskPixelsWithoutG0())) &&
(isApplyMask() == rhs.isApplyMask())
&&
((!jungfrauPedestalG0RmsLimitIsSet() && !rhs.jungfrauPedestalG0RmsLimitIsSet()) || (jungfrauPedestalG0RmsLimitIsSet() && rhs.jungfrauPedestalG0RmsLimitIsSet() && getJungfrauPedestalG0RmsLimit() == rhs.getJungfrauPedestalG0RmsLimit()))
;
}
@@ -128,6 +156,11 @@ void to_json(nlohmann::json& j, const Image_format_settings& o)
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;
}
@@ -153,6 +186,17 @@ void from_json(const nlohmann::json& j, Image_format_settings& o)
}
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;
}
}
@@ -247,6 +291,48 @@ 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,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -80,7 +80,7 @@ public:
bool jungfrauConversionFactorKeVIsSet() const;
void unsetJungfrau_conversion_factor_keV();
/// <summary>
/// Bit depth of resulting image (it doesn&#39;t affect the original detector value) If not provided value is adjusted automatically
/// 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);
@@ -103,6 +103,25 @@ public:
/// </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);
@@ -123,6 +142,12 @@ protected:
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;
};

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -34,6 +34,7 @@ Jfjoch_settings::Jfjoch_settings()
m_Numa_policy = "";
m_Numa_policyIsSet = false;
m_Frontend_directory = "";
m_Zeromq_previewIsSet = false;
}
@@ -110,11 +111,6 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
success = false;
msg << currentValuePath << ": must be greater than or equal to 128;";
}
if (value > 16384)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 16384;";
}
}
@@ -136,7 +132,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
}
}
return success;
}
@@ -179,8 +175,11 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
&&
(getImagePusher() == rhs.getImagePusher())
&&
((!zeromqPreviewIsSet() && !rhs.zeromqPreviewIsSet()) || (zeromqPreviewIsSet() && rhs.zeromqPreviewIsSet() && getZeromqPreview() == rhs.getZeromqPreview()))
;
}
@@ -213,6 +212,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o)
j["numa_policy"] = o.m_Numa_policy;
j["frontend_directory"] = o.m_Frontend_directory;
j["image_pusher"] = o.m_Image_pusher;
if(o.zeromqPreviewIsSet())
j["zeromq_preview"] = o.m_Zeromq_preview;
}
@@ -266,6 +267,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
}
j.at("frontend_directory").get_to(o.m_Frontend_directory);
j.at("image_pusher").get_to(o.m_Image_pusher);
if(j.find("zeromq_preview") != j.end())
{
j.at("zeromq_preview").get_to(o.m_Zeromq_preview);
o.m_Zeromq_previewIsSet = true;
}
}
@@ -446,6 +452,23 @@ void Jfjoch_settings::setImagePusher(org::openapitools::server::model::Image_pus
{
m_Image_pusher = value;
}
org::openapitools::server::model::Zeromq_preview_settings Jfjoch_settings::getZeromqPreview() const
{
return m_Zeromq_preview;
}
void Jfjoch_settings::setZeromqPreview(org::openapitools::server::model::Zeromq_preview_settings const& value)
{
m_Zeromq_preview = value;
m_Zeromq_previewIsSet = true;
}
bool Jfjoch_settings::zeromqPreviewIsSet() const
{
return m_Zeromq_previewIsSet;
}
void Jfjoch_settings::unsetZeromq_preview()
{
m_Zeromq_previewIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -20,6 +20,7 @@
#include "Detector.h"
#include "Zeromq_preview_settings.h"
#include "Image_pusher_type.h"
#include "Pcie_devices_inner.h"
#include <string>
@@ -145,6 +146,13 @@ public:
/// </summary>
org::openapitools::server::model::Image_pusher_type getImagePusher() const;
void setImagePusher(org::openapitools::server::model::Image_pusher_type const& value);
/// <summary>
///
/// </summary>
org::openapitools::server::model::Zeromq_preview_settings getZeromqPreview() const;
void setZeromqPreview(org::openapitools::server::model::Zeromq_preview_settings const& value);
bool zeromqPreviewIsSet() const;
void unsetZeromq_preview();
friend void to_json(nlohmann::json& j, const Jfjoch_settings& o);
friend void from_json(const nlohmann::json& j, Jfjoch_settings& o);
@@ -173,6 +181,8 @@ protected:
org::openapitools::server::model::Image_pusher_type m_Image_pusher;
org::openapitools::server::model::Zeromq_preview_settings m_Zeromq_preview;
bool m_Zeromq_previewIsSet;
};

View File

@@ -0,0 +1,455 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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 "Jfjoch_statistics.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Jfjoch_statistics::Jfjoch_statistics()
{
m_DetectorIsSet = false;
m_Detector_listIsSet = false;
m_Detector_settingsIsSet = false;
m_Image_format_settingsIsSet = false;
m_Instrument_metadataIsSet = false;
m_Data_processing_settingsIsSet = false;
m_MeasurementIsSet = false;
m_BrokerIsSet = false;
m_FpgaIsSet = false;
m_CalibrationIsSet = false;
m_Zeromq_previewIsSet = false;
m_Pixel_maskIsSet = false;
}
void Jfjoch_statistics::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Jfjoch_statistics::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Jfjoch_statistics" : pathPrefix;
if (fpgaIsSet())
{
const std::vector<org::openapitools::server::model::Fpga_status_inner>& value = m_Fpga;
const std::string currentValuePath = _pathPrefix + ".fpga";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Fpga_status_inner& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".fpga") && success;
i++;
}
}
}
if (calibrationIsSet())
{
const std::vector<org::openapitools::server::model::Calibration_statistics_inner>& value = m_Calibration;
const std::string currentValuePath = _pathPrefix + ".calibration";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Calibration_statistics_inner& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".calibration") && success;
i++;
}
}
}
return success;
}
bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const
{
return
((!detectorIsSet() && !rhs.detectorIsSet()) || (detectorIsSet() && rhs.detectorIsSet() && getDetector() == rhs.getDetector())) &&
((!detectorListIsSet() && !rhs.detectorListIsSet()) || (detectorListIsSet() && rhs.detectorListIsSet() && getDetectorList() == rhs.getDetectorList())) &&
((!detectorSettingsIsSet() && !rhs.detectorSettingsIsSet()) || (detectorSettingsIsSet() && rhs.detectorSettingsIsSet() && getDetectorSettings() == rhs.getDetectorSettings())) &&
((!imageFormatSettingsIsSet() && !rhs.imageFormatSettingsIsSet()) || (imageFormatSettingsIsSet() && rhs.imageFormatSettingsIsSet() && getImageFormatSettings() == rhs.getImageFormatSettings())) &&
((!instrumentMetadataIsSet() && !rhs.instrumentMetadataIsSet()) || (instrumentMetadataIsSet() && rhs.instrumentMetadataIsSet() && getInstrumentMetadata() == rhs.getInstrumentMetadata())) &&
((!dataProcessingSettingsIsSet() && !rhs.dataProcessingSettingsIsSet()) || (dataProcessingSettingsIsSet() && rhs.dataProcessingSettingsIsSet() && getDataProcessingSettings() == rhs.getDataProcessingSettings())) &&
((!measurementIsSet() && !rhs.measurementIsSet()) || (measurementIsSet() && rhs.measurementIsSet() && getMeasurement() == rhs.getMeasurement())) &&
((!brokerIsSet() && !rhs.brokerIsSet()) || (brokerIsSet() && rhs.brokerIsSet() && getBroker() == rhs.getBroker())) &&
((!fpgaIsSet() && !rhs.fpgaIsSet()) || (fpgaIsSet() && rhs.fpgaIsSet() && getFpga() == rhs.getFpga())) &&
((!calibrationIsSet() && !rhs.calibrationIsSet()) || (calibrationIsSet() && rhs.calibrationIsSet() && getCalibration() == rhs.getCalibration())) &&
((!zeromqPreviewIsSet() && !rhs.zeromqPreviewIsSet()) || (zeromqPreviewIsSet() && rhs.zeromqPreviewIsSet() && getZeromqPreview() == rhs.getZeromqPreview())) &&
((!pixelMaskIsSet() && !rhs.pixelMaskIsSet()) || (pixelMaskIsSet() && rhs.pixelMaskIsSet() && getPixelMask() == rhs.getPixelMask()))
;
}
bool Jfjoch_statistics::operator!=(const Jfjoch_statistics& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Jfjoch_statistics& o)
{
j = nlohmann::json::object();
if(o.detectorIsSet())
j["detector"] = o.m_Detector;
if(o.detectorListIsSet())
j["detector_list"] = o.m_Detector_list;
if(o.detectorSettingsIsSet())
j["detector_settings"] = o.m_Detector_settings;
if(o.imageFormatSettingsIsSet())
j["image_format_settings"] = o.m_Image_format_settings;
if(o.instrumentMetadataIsSet())
j["instrument_metadata"] = o.m_Instrument_metadata;
if(o.dataProcessingSettingsIsSet())
j["data_processing_settings"] = o.m_Data_processing_settings;
if(o.measurementIsSet())
j["measurement"] = o.m_Measurement;
if(o.brokerIsSet())
j["broker"] = o.m_Broker;
if(o.fpgaIsSet() || !o.m_Fpga.empty())
j["fpga"] = o.m_Fpga;
if(o.calibrationIsSet() || !o.m_Calibration.empty())
j["calibration"] = o.m_Calibration;
if(o.zeromqPreviewIsSet())
j["zeromq_preview"] = o.m_Zeromq_preview;
if(o.pixelMaskIsSet())
j["pixel_mask"] = o.m_Pixel_mask;
}
void from_json(const nlohmann::json& j, Jfjoch_statistics& o)
{
if(j.find("detector") != j.end())
{
j.at("detector").get_to(o.m_Detector);
o.m_DetectorIsSet = true;
}
if(j.find("detector_list") != j.end())
{
j.at("detector_list").get_to(o.m_Detector_list);
o.m_Detector_listIsSet = true;
}
if(j.find("detector_settings") != j.end())
{
j.at("detector_settings").get_to(o.m_Detector_settings);
o.m_Detector_settingsIsSet = true;
}
if(j.find("image_format_settings") != j.end())
{
j.at("image_format_settings").get_to(o.m_Image_format_settings);
o.m_Image_format_settingsIsSet = true;
}
if(j.find("instrument_metadata") != j.end())
{
j.at("instrument_metadata").get_to(o.m_Instrument_metadata);
o.m_Instrument_metadataIsSet = true;
}
if(j.find("data_processing_settings") != j.end())
{
j.at("data_processing_settings").get_to(o.m_Data_processing_settings);
o.m_Data_processing_settingsIsSet = true;
}
if(j.find("measurement") != j.end())
{
j.at("measurement").get_to(o.m_Measurement);
o.m_MeasurementIsSet = true;
}
if(j.find("broker") != j.end())
{
j.at("broker").get_to(o.m_Broker);
o.m_BrokerIsSet = true;
}
if(j.find("fpga") != j.end())
{
j.at("fpga").get_to(o.m_Fpga);
o.m_FpgaIsSet = true;
}
if(j.find("calibration") != j.end())
{
j.at("calibration").get_to(o.m_Calibration);
o.m_CalibrationIsSet = true;
}
if(j.find("zeromq_preview") != j.end())
{
j.at("zeromq_preview").get_to(o.m_Zeromq_preview);
o.m_Zeromq_previewIsSet = true;
}
if(j.find("pixel_mask") != j.end())
{
j.at("pixel_mask").get_to(o.m_Pixel_mask);
o.m_Pixel_maskIsSet = true;
}
}
org::openapitools::server::model::Detector_status Jfjoch_statistics::getDetector() const
{
return m_Detector;
}
void Jfjoch_statistics::setDetector(org::openapitools::server::model::Detector_status const& value)
{
m_Detector = value;
m_DetectorIsSet = true;
}
bool Jfjoch_statistics::detectorIsSet() const
{
return m_DetectorIsSet;
}
void Jfjoch_statistics::unsetDetector()
{
m_DetectorIsSet = false;
}
org::openapitools::server::model::Detector_list Jfjoch_statistics::getDetectorList() const
{
return m_Detector_list;
}
void Jfjoch_statistics::setDetectorList(org::openapitools::server::model::Detector_list const& value)
{
m_Detector_list = value;
m_Detector_listIsSet = true;
}
bool Jfjoch_statistics::detectorListIsSet() const
{
return m_Detector_listIsSet;
}
void Jfjoch_statistics::unsetDetector_list()
{
m_Detector_listIsSet = false;
}
org::openapitools::server::model::Detector_settings Jfjoch_statistics::getDetectorSettings() const
{
return m_Detector_settings;
}
void Jfjoch_statistics::setDetectorSettings(org::openapitools::server::model::Detector_settings const& value)
{
m_Detector_settings = value;
m_Detector_settingsIsSet = true;
}
bool Jfjoch_statistics::detectorSettingsIsSet() const
{
return m_Detector_settingsIsSet;
}
void Jfjoch_statistics::unsetDetector_settings()
{
m_Detector_settingsIsSet = false;
}
org::openapitools::server::model::Image_format_settings Jfjoch_statistics::getImageFormatSettings() const
{
return m_Image_format_settings;
}
void Jfjoch_statistics::setImageFormatSettings(org::openapitools::server::model::Image_format_settings const& value)
{
m_Image_format_settings = value;
m_Image_format_settingsIsSet = true;
}
bool Jfjoch_statistics::imageFormatSettingsIsSet() const
{
return m_Image_format_settingsIsSet;
}
void Jfjoch_statistics::unsetImage_format_settings()
{
m_Image_format_settingsIsSet = false;
}
org::openapitools::server::model::Instrument_metadata Jfjoch_statistics::getInstrumentMetadata() const
{
return m_Instrument_metadata;
}
void Jfjoch_statistics::setInstrumentMetadata(org::openapitools::server::model::Instrument_metadata const& value)
{
m_Instrument_metadata = value;
m_Instrument_metadataIsSet = true;
}
bool Jfjoch_statistics::instrumentMetadataIsSet() const
{
return m_Instrument_metadataIsSet;
}
void Jfjoch_statistics::unsetInstrument_metadata()
{
m_Instrument_metadataIsSet = false;
}
org::openapitools::server::model::Spot_finding_settings Jfjoch_statistics::getDataProcessingSettings() const
{
return m_Data_processing_settings;
}
void Jfjoch_statistics::setDataProcessingSettings(org::openapitools::server::model::Spot_finding_settings const& value)
{
m_Data_processing_settings = value;
m_Data_processing_settingsIsSet = true;
}
bool Jfjoch_statistics::dataProcessingSettingsIsSet() const
{
return m_Data_processing_settingsIsSet;
}
void Jfjoch_statistics::unsetData_processing_settings()
{
m_Data_processing_settingsIsSet = false;
}
org::openapitools::server::model::Measurement_statistics Jfjoch_statistics::getMeasurement() const
{
return m_Measurement;
}
void Jfjoch_statistics::setMeasurement(org::openapitools::server::model::Measurement_statistics const& value)
{
m_Measurement = value;
m_MeasurementIsSet = true;
}
bool Jfjoch_statistics::measurementIsSet() const
{
return m_MeasurementIsSet;
}
void Jfjoch_statistics::unsetMeasurement()
{
m_MeasurementIsSet = false;
}
org::openapitools::server::model::Broker_status Jfjoch_statistics::getBroker() const
{
return m_Broker;
}
void Jfjoch_statistics::setBroker(org::openapitools::server::model::Broker_status const& value)
{
m_Broker = value;
m_BrokerIsSet = true;
}
bool Jfjoch_statistics::brokerIsSet() const
{
return m_BrokerIsSet;
}
void Jfjoch_statistics::unsetBroker()
{
m_BrokerIsSet = false;
}
std::vector<org::openapitools::server::model::Fpga_status_inner> Jfjoch_statistics::getFpga() const
{
return m_Fpga;
}
void Jfjoch_statistics::setFpga(std::vector<org::openapitools::server::model::Fpga_status_inner> const& value)
{
m_Fpga = value;
m_FpgaIsSet = true;
}
bool Jfjoch_statistics::fpgaIsSet() const
{
return m_FpgaIsSet;
}
void Jfjoch_statistics::unsetFpga()
{
m_FpgaIsSet = false;
}
std::vector<org::openapitools::server::model::Calibration_statistics_inner> Jfjoch_statistics::getCalibration() const
{
return m_Calibration;
}
void Jfjoch_statistics::setCalibration(std::vector<org::openapitools::server::model::Calibration_statistics_inner> const& value)
{
m_Calibration = value;
m_CalibrationIsSet = true;
}
bool Jfjoch_statistics::calibrationIsSet() const
{
return m_CalibrationIsSet;
}
void Jfjoch_statistics::unsetCalibration()
{
m_CalibrationIsSet = false;
}
org::openapitools::server::model::Zeromq_preview_settings Jfjoch_statistics::getZeromqPreview() const
{
return m_Zeromq_preview;
}
void Jfjoch_statistics::setZeromqPreview(org::openapitools::server::model::Zeromq_preview_settings const& value)
{
m_Zeromq_preview = value;
m_Zeromq_previewIsSet = true;
}
bool Jfjoch_statistics::zeromqPreviewIsSet() const
{
return m_Zeromq_previewIsSet;
}
void Jfjoch_statistics::unsetZeromq_preview()
{
m_Zeromq_previewIsSet = false;
}
org::openapitools::server::model::Pixel_mask_statistics Jfjoch_statistics::getPixelMask() const
{
return m_Pixel_mask;
}
void Jfjoch_statistics::setPixelMask(org::openapitools::server::model::Pixel_mask_statistics const& value)
{
m_Pixel_mask = value;
m_Pixel_maskIsSet = true;
}
bool Jfjoch_statistics::pixelMaskIsSet() const
{
return m_Pixel_maskIsSet;
}
void Jfjoch_statistics::unsetPixel_mask()
{
m_Pixel_maskIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,190 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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.
*/
/*
* Jfjoch_statistics.h
*
* Pool statistics for Jungfraujoch to reduce transfers between frontend and jfjoch_broker
*/
#ifndef Jfjoch_statistics_H_
#define Jfjoch_statistics_H_
#include "Calibration_statistics_inner.h"
#include "Broker_status.h"
#include "Pixel_mask_statistics.h"
#include "Measurement_statistics.h"
#include "Spot_finding_settings.h"
#include "Zeromq_preview_settings.h"
#include "Detector_list.h"
#include "Image_format_settings.h"
#include "Detector_settings.h"
#include <vector>
#include "Detector_status.h"
#include "Fpga_status_inner.h"
#include "Instrument_metadata.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Pool statistics for Jungfraujoch to reduce transfers between frontend and jfjoch_broker
/// </summary>
class Jfjoch_statistics
{
public:
Jfjoch_statistics();
virtual ~Jfjoch_statistics() = 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 Jfjoch_statistics& rhs) const;
bool operator!=(const Jfjoch_statistics& rhs) const;
/////////////////////////////////////////////
/// Jfjoch_statistics members
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_status getDetector() const;
void setDetector(org::openapitools::server::model::Detector_status const& value);
bool detectorIsSet() const;
void unsetDetector();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_list getDetectorList() const;
void setDetectorList(org::openapitools::server::model::Detector_list const& value);
bool detectorListIsSet() const;
void unsetDetector_list();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_settings getDetectorSettings() const;
void setDetectorSettings(org::openapitools::server::model::Detector_settings const& value);
bool detectorSettingsIsSet() const;
void unsetDetector_settings();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Image_format_settings getImageFormatSettings() const;
void setImageFormatSettings(org::openapitools::server::model::Image_format_settings const& value);
bool imageFormatSettingsIsSet() const;
void unsetImage_format_settings();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Instrument_metadata getInstrumentMetadata() const;
void setInstrumentMetadata(org::openapitools::server::model::Instrument_metadata const& value);
bool instrumentMetadataIsSet() const;
void unsetInstrument_metadata();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Spot_finding_settings getDataProcessingSettings() const;
void setDataProcessingSettings(org::openapitools::server::model::Spot_finding_settings const& value);
bool dataProcessingSettingsIsSet() const;
void unsetData_processing_settings();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Measurement_statistics getMeasurement() const;
void setMeasurement(org::openapitools::server::model::Measurement_statistics const& value);
bool measurementIsSet() const;
void unsetMeasurement();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Broker_status getBroker() const;
void setBroker(org::openapitools::server::model::Broker_status const& value);
bool brokerIsSet() const;
void unsetBroker();
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Fpga_status_inner> getFpga() const;
void setFpga(std::vector<org::openapitools::server::model::Fpga_status_inner> const& value);
bool fpgaIsSet() const;
void unsetFpga();
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Calibration_statistics_inner> getCalibration() const;
void setCalibration(std::vector<org::openapitools::server::model::Calibration_statistics_inner> const& value);
bool calibrationIsSet() const;
void unsetCalibration();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Zeromq_preview_settings getZeromqPreview() const;
void setZeromqPreview(org::openapitools::server::model::Zeromq_preview_settings const& value);
bool zeromqPreviewIsSet() const;
void unsetZeromq_preview();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Pixel_mask_statistics getPixelMask() const;
void setPixelMask(org::openapitools::server::model::Pixel_mask_statistics const& value);
bool pixelMaskIsSet() const;
void unsetPixel_mask();
friend void to_json(nlohmann::json& j, const Jfjoch_statistics& o);
friend void from_json(const nlohmann::json& j, Jfjoch_statistics& o);
protected:
org::openapitools::server::model::Detector_status m_Detector;
bool m_DetectorIsSet;
org::openapitools::server::model::Detector_list m_Detector_list;
bool m_Detector_listIsSet;
org::openapitools::server::model::Detector_settings m_Detector_settings;
bool m_Detector_settingsIsSet;
org::openapitools::server::model::Image_format_settings m_Image_format_settings;
bool m_Image_format_settingsIsSet;
org::openapitools::server::model::Instrument_metadata m_Instrument_metadata;
bool m_Instrument_metadataIsSet;
org::openapitools::server::model::Spot_finding_settings m_Data_processing_settings;
bool m_Data_processing_settingsIsSet;
org::openapitools::server::model::Measurement_statistics m_Measurement;
bool m_MeasurementIsSet;
org::openapitools::server::model::Broker_status m_Broker;
bool m_BrokerIsSet;
std::vector<org::openapitools::server::model::Fpga_status_inner> m_Fpga;
bool m_FpgaIsSet;
std::vector<org::openapitools::server::model::Calibration_statistics_inner> m_Calibration;
bool m_CalibrationIsSet;
org::openapitools::server::model::Zeromq_preview_settings m_Zeromq_preview;
bool m_Zeromq_previewIsSet;
org::openapitools::server::model::Pixel_mask_statistics m_Pixel_mask;
bool m_Pixel_maskIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Jfjoch_statistics_H_ */

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,206 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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 "Pixel_mask_statistics.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Pixel_mask_statistics::Pixel_mask_statistics()
{
m_User_mask = 0L;
m_User_maskIsSet = false;
m_Too_high_pedestal_rms = 0L;
m_Too_high_pedestal_rmsIsSet = false;
m_Wrong_gain = 0L;
m_Wrong_gainIsSet = false;
}
void Pixel_mask_statistics::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Pixel_mask_statistics::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Pixel_mask_statistics::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Pixel_mask_statistics" : pathPrefix;
if (userMaskIsSet())
{
const int64_t& value = m_User_mask;
const std::string currentValuePath = _pathPrefix + ".userMask";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (tooHighPedestalRmsIsSet())
{
const int64_t& value = m_Too_high_pedestal_rms;
const std::string currentValuePath = _pathPrefix + ".tooHighPedestalRms";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (wrongGainIsSet())
{
const int64_t& value = m_Wrong_gain;
const std::string currentValuePath = _pathPrefix + ".wrongGain";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
bool Pixel_mask_statistics::operator==(const Pixel_mask_statistics& rhs) const
{
return
((!userMaskIsSet() && !rhs.userMaskIsSet()) || (userMaskIsSet() && rhs.userMaskIsSet() && getUserMask() == rhs.getUserMask())) &&
((!tooHighPedestalRmsIsSet() && !rhs.tooHighPedestalRmsIsSet()) || (tooHighPedestalRmsIsSet() && rhs.tooHighPedestalRmsIsSet() && getTooHighPedestalRms() == rhs.getTooHighPedestalRms())) &&
((!wrongGainIsSet() && !rhs.wrongGainIsSet()) || (wrongGainIsSet() && rhs.wrongGainIsSet() && getWrongGain() == rhs.getWrongGain()))
;
}
bool Pixel_mask_statistics::operator!=(const Pixel_mask_statistics& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Pixel_mask_statistics& o)
{
j = nlohmann::json::object();
if(o.userMaskIsSet())
j["user_mask"] = o.m_User_mask;
if(o.tooHighPedestalRmsIsSet())
j["too_high_pedestal_rms"] = o.m_Too_high_pedestal_rms;
if(o.wrongGainIsSet())
j["wrong_gain"] = o.m_Wrong_gain;
}
void from_json(const nlohmann::json& j, Pixel_mask_statistics& o)
{
if(j.find("user_mask") != j.end())
{
j.at("user_mask").get_to(o.m_User_mask);
o.m_User_maskIsSet = true;
}
if(j.find("too_high_pedestal_rms") != j.end())
{
j.at("too_high_pedestal_rms").get_to(o.m_Too_high_pedestal_rms);
o.m_Too_high_pedestal_rmsIsSet = true;
}
if(j.find("wrong_gain") != j.end())
{
j.at("wrong_gain").get_to(o.m_Wrong_gain);
o.m_Wrong_gainIsSet = true;
}
}
int64_t Pixel_mask_statistics::getUserMask() const
{
return m_User_mask;
}
void Pixel_mask_statistics::setUserMask(int64_t const value)
{
m_User_mask = value;
m_User_maskIsSet = true;
}
bool Pixel_mask_statistics::userMaskIsSet() const
{
return m_User_maskIsSet;
}
void Pixel_mask_statistics::unsetUser_mask()
{
m_User_maskIsSet = false;
}
int64_t Pixel_mask_statistics::getTooHighPedestalRms() const
{
return m_Too_high_pedestal_rms;
}
void Pixel_mask_statistics::setTooHighPedestalRms(int64_t const value)
{
m_Too_high_pedestal_rms = value;
m_Too_high_pedestal_rmsIsSet = true;
}
bool Pixel_mask_statistics::tooHighPedestalRmsIsSet() const
{
return m_Too_high_pedestal_rmsIsSet;
}
void Pixel_mask_statistics::unsetToo_high_pedestal_rms()
{
m_Too_high_pedestal_rmsIsSet = false;
}
int64_t Pixel_mask_statistics::getWrongGain() const
{
return m_Wrong_gain;
}
void Pixel_mask_statistics::setWrongGain(int64_t const value)
{
m_Wrong_gain = value;
m_Wrong_gainIsSet = true;
}
bool Pixel_mask_statistics::wrongGainIsSet() const
{
return m_Wrong_gainIsSet;
}
void Pixel_mask_statistics::unsetWrong_gain()
{
m_Wrong_gainIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,96 @@
/**
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.24
* 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.
*/
/*
* Pixel_mask_statistics.h
*
*
*/
#ifndef Pixel_mask_statistics_H_
#define Pixel_mask_statistics_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Pixel_mask_statistics
{
public:
Pixel_mask_statistics();
virtual ~Pixel_mask_statistics() = 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 Pixel_mask_statistics& rhs) const;
bool operator!=(const Pixel_mask_statistics& rhs) const;
/////////////////////////////////////////////
/// Pixel_mask_statistics members
/// <summary>
/// Number of pixels masked using the user mask
/// </summary>
int64_t getUserMask() const;
void setUserMask(int64_t const value);
bool userMaskIsSet() const;
void unsetUser_mask();
/// <summary>
/// Number of pixels with G0 pedestal RMS higher than provided threshold
/// </summary>
int64_t getTooHighPedestalRms() const;
void setTooHighPedestalRms(int64_t const value);
bool tooHighPedestalRmsIsSet() const;
void unsetToo_high_pedestal_rms();
/// <summary>
/// Number of pixels that show wrong gain level during the pedestal procedure
/// </summary>
int64_t getWrongGain() const;
void setWrongGain(int64_t const value);
bool wrongGainIsSet() const;
void unsetWrong_gain();
friend void to_json(nlohmann::json& j, const Pixel_mask_statistics& o);
friend void from_json(const nlohmann::json& j, Pixel_mask_statistics& o);
protected:
int64_t m_User_mask;
bool m_User_maskIsSet;
int64_t m_Too_high_pedestal_rms;
bool m_Too_high_pedestal_rmsIsSet;
int64_t m_Wrong_gain;
bool m_Wrong_gainIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Pixel_mask_statistics_H_ */

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,8 +1,8 @@
/**
* Jungfraujoch
* Jungfraujoch Broker Web API
* 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.
*
* The version of the OpenAPI document: 1.0.0-rc.13
* The version of the OpenAPI document: 1.0.0-rc.24
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

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