Compare commits
144
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6136f858af | ||
|
|
75e401f0e5 | ||
|
|
c49bd2ac3b | ||
|
|
ef52dac2ee | ||
|
|
90e804acd7 | ||
|
|
ea575f790a | ||
|
|
cc3eb8352c | ||
|
|
75de40f52b | ||
|
|
fc68a9baed | ||
|
|
75f1c5f954 | ||
|
|
caef26873e | ||
|
|
7d34e8a049 | ||
|
|
6e0bb971ac | ||
|
|
87fde1b32e | ||
|
|
d760b12a18 | ||
|
|
239a441ee6 | ||
|
|
4878318c27 | ||
|
|
230480e390 | ||
|
|
c981e1b91c | ||
|
|
c1c170112c | ||
|
|
bb9f5c715f | ||
|
|
4a852b4d6b | ||
|
|
81bd9a06a1 | ||
|
|
6133da1377 | ||
|
|
2ab9deb20b | ||
|
|
166fcdb68f | ||
|
|
928789a67c | ||
|
|
64002f1e29 | ||
|
|
3036b1d37f | ||
|
|
f3e0a15d26 | ||
|
|
32b681e591 | ||
|
|
1ab257af6c | ||
|
|
07fe4dd3bb | ||
|
|
1c4dfd03e2 | ||
|
|
27496b8207 | ||
|
|
e2b240356c | ||
|
|
a0a659a02c | ||
|
|
36d0507758 | ||
|
|
b02c412d59 | ||
|
|
d1a4c19ef3 | ||
|
|
59911788d7 | ||
|
|
c8bbf8a186 | ||
|
|
68d121ab3a | ||
|
|
6d08310622 | ||
|
|
31a357fa57 | ||
|
|
06949caf1a | ||
|
|
9bc71cfddc | ||
|
|
224cc8b89c | ||
|
|
05410d7cb3 | ||
|
|
d53e93023b | ||
|
|
f44c6520a8 | ||
|
|
ddcc24fba8 | ||
|
|
a6b5cb5629 | ||
|
|
95acf3aba3 | ||
|
|
33aeb64e4c | ||
|
|
5c38b2bfe8 | ||
|
|
808691251e | ||
|
|
d634491885 | ||
|
|
8e65e8bf25 | ||
|
|
5d81af1c88 | ||
|
|
4dbbf0e365 | ||
|
|
8b356a7001 | ||
|
|
effe97a970 | ||
|
|
189f84be53 | ||
|
|
dba07eae26 | ||
|
|
b2abb0f92b | ||
|
|
58144995e0 | ||
|
|
0b480f762c | ||
|
|
08d49baa29 | ||
|
|
fb9462f67b | ||
|
|
7951e59359 | ||
|
|
061152279c | ||
|
|
6524365ffa | ||
|
|
c44a07aac2 | ||
|
|
e69b836317 | ||
|
|
14f5051692 | ||
|
|
fae0d06500 | ||
|
|
a48d8fb5b9 | ||
|
|
dc4a1ee9e6 | ||
|
|
99b7dc07f7 | ||
|
|
79c3b3c5ea | ||
|
|
27c4a426a2 | ||
|
|
9d3e3944a3 | ||
|
|
5bb8898a0e | ||
|
|
961d6b42a0 | ||
|
|
7c31e9d35d | ||
|
|
53dfb83459 | ||
|
|
21bac6169f | ||
|
|
4315517bfb | ||
|
|
4b9b0dfe8b | ||
|
|
6385d8cd6a | ||
|
|
660d2abad1 | ||
|
|
c0bd8e1215 | ||
|
|
c218661553 | ||
|
|
5d9d2de4a4 | ||
|
|
3ded4cd3ce | ||
|
|
7106bd80e9 | ||
|
|
e8cc528714 | ||
|
|
caf2a9de4f | ||
|
|
0e31023da0 | ||
|
|
418d4957cf | ||
|
|
39367f7080 | ||
|
|
3c17ce3b0b | ||
|
|
8c8be007ce | ||
|
|
20cd8dc4ac | ||
|
|
a7c92923ec | ||
|
|
ea1a9bc68a | ||
|
|
e7a89e1209 | ||
|
|
a19531ba70 | ||
|
|
c936e9bab7 | ||
|
|
7e6f1933d2 | ||
|
|
a0fee8aec0 | ||
|
|
e36bac7589 | ||
|
|
c67337cfe1 | ||
|
|
6c88c6902e | ||
|
|
dba807fadd | ||
|
|
4e3b54f0b0 | ||
|
|
bb32f27635 | ||
|
|
06978efe6b | ||
|
|
fa95858008 | ||
|
|
f98402043b | ||
|
|
20973792e4 | ||
|
|
764ca111e2 | ||
|
|
a32cec3404 | ||
|
|
4189fa3e3c | ||
|
|
51cbef4c84 | ||
|
|
d42c606e5d | ||
|
|
3955ddb257 | ||
|
|
54264a435a | ||
|
|
06c5b9cf7f | ||
|
|
5a6227230a | ||
|
|
be6d8ad0f5 | ||
|
|
c56d9bc1db | ||
|
|
6966461da7 | ||
|
|
1ba456308d | ||
|
|
0aac045d3d | ||
|
|
2980badaeb | ||
|
|
4da526c51b | ||
|
|
b8a252adaa | ||
|
|
0b5f28f50d | ||
|
|
02039b9f1c | ||
|
|
e4ec9fb38f | ||
|
|
3c67b5a900 | ||
|
|
fbaf15aa07 |
@@ -0,0 +1,5 @@
|
||||
*.mcs filter=lfs diff=lfs merge=lfs -text
|
||||
*.mcs.gz filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
# Large reference datasets for the [large] Catch tests (git-LFS; may not be pulled in CI).
|
||||
tests/data/*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
@@ -0,0 +1,374 @@
|
||||
name: Build Packages
|
||||
|
||||
env:
|
||||
MARCH_CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-march=x86-64-v3" -DCMAKE_C_FLAGS="-march=x86-64-v3"'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
create_release:
|
||||
type: boolean
|
||||
description: 'Create release'
|
||||
required: false
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Unit tests
|
||||
runs-on: jfjoch_rocky8
|
||||
if: github.ref_type != 'tag' && github.ref_type != 'workflow_dispatch'
|
||||
container:
|
||||
image: gitea.psi.ch/leonarski_f/jfjoch_rocky8:2511
|
||||
options: --gpus all
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
CTEST_OUTPUT_ON_FAILURE: '1'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Configure auth and fetch LFS
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.PIP_REPOSITORY_API_TOKEN }}
|
||||
run: |
|
||||
git lfs install --local
|
||||
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader)
|
||||
git config --local --unset http.${{ github.server_url }}/.extraheader
|
||||
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
||||
git lfs pull
|
||||
- name: Build tests
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ env.MARCH_CMAKE_FLAGS }} ..
|
||||
ninja -j48 jfjoch_test jfjoch_hdf5_test jfjoch_hdf5_enospc_test enospc_shim
|
||||
- name: Run unit tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/tests
|
||||
./jfjoch_test
|
||||
- name: HDF5 ENOSPC test
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/tests
|
||||
LD_PRELOAD=./enospc_shim.so ./jfjoch_hdf5_enospc_test HDF5File_enospc
|
||||
LD_PRELOAD=./enospc_shim.so ./jfjoch_hdf5_enospc_test FileWriter_enospc
|
||||
- name: Run hdf5 test
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/tools
|
||||
./jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5
|
||||
build-rpm:
|
||||
name: build:rpm (${{ matrix.distro }})
|
||||
if: github.ref_type != 'workflow_dispatch'
|
||||
runs-on: ${{ matrix.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: jfjoch_rocky8
|
||||
distro: rocky8
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=ON
|
||||
pkg_glob: "*.rpm"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/rpm/centos/el8/slsdet8-cuda12/upload
|
||||
- runner: jfjoch_rocky8
|
||||
distro: rocky8_sls9
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=ON -DSLS9=ON
|
||||
pkg_glob: "*.rpm"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/rpm/centos/el8/slsdet9-cuda12/upload
|
||||
- runner: jfjoch_rocky8
|
||||
distro: rocky8_nocuda
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=OFF
|
||||
pkg_glob: "*.rpm"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/rpm/centos/el8/slsdet8-nocuda/upload
|
||||
- runner: jfjoch_rocky9
|
||||
distro: rocky9
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=ON
|
||||
pkg_glob: "*.rpm"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/rpm/centos/el9/slsdet8-cuda13/upload
|
||||
- runner: jfjoch_rocky9
|
||||
distro: rocky9_sls9
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=ON -DSLS9=ON
|
||||
pkg_glob: "*.rpm"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/rpm/centos/el9/slsdet9-cuda13/upload
|
||||
- runner: jfjoch_rocky9
|
||||
distro: rocky9_nocuda
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=OFF
|
||||
pkg_glob: "*.rpm"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/rpm/centos/el9/slsdet8-nocuda/upload
|
||||
- runner: jfjoch_ubuntu2204
|
||||
distro: ubuntu2204
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=ON
|
||||
pkg_glob: "*.deb"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/debian/pool/jammy/cuda13/upload
|
||||
- runner: jfjoch_ubuntu2204
|
||||
distro: ubuntu2204_nocuda
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=OFF
|
||||
pkg_glob: "*.deb"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/debian/pool/jammy/nocuda/upload
|
||||
- runner: jfjoch_ubuntu2404
|
||||
distro: ubuntu2404
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=ON
|
||||
pkg_glob: "*.deb"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/debian/pool/noble/cuda13/upload
|
||||
- runner: jfjoch_ubuntu2404
|
||||
distro: ubuntu2404_nocuda
|
||||
cmake_flags: -DJFJOCH_USE_CUDA=OFF
|
||||
pkg_glob: "*.deb"
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/debian/pool/noble/nocuda/upload
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup build (cmake)
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON ${{ env.MARCH_CMAKE_FLAGS }} -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} ..
|
||||
- name: Build packages
|
||||
shell: bash
|
||||
run: |
|
||||
cd build
|
||||
ninja frontend
|
||||
ninja -j16 package
|
||||
- name: Upload packages
|
||||
if: github.ref_type == 'tag'
|
||||
shell: bash
|
||||
env:
|
||||
TOKEN: ${{ secrets.PIP_REPOSITORY_API_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd build
|
||||
shopt -s nullglob
|
||||
files=(${{ matrix.pkg_glob }})
|
||||
if [ ${#files[@]} -eq 0 ]; then
|
||||
echo "No package files found for pattern: ${{ matrix.pkg_glob }}"
|
||||
exit 1
|
||||
fi
|
||||
url="${{ matrix.upload_url }}"
|
||||
if [[ "$url" == *"/rpm/"* ]]; then
|
||||
url="${url}?sign=true"
|
||||
fi
|
||||
for file in "${files[@]}"; do
|
||||
echo "Uploading $file -> $url"
|
||||
curl --fail --user __token__:"$TOKEN" --upload-file "$file" "$url"
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
if [ "${{ matrix.distro }}" = "rocky8_nocuda" ]; then
|
||||
for file in build/jfjoch-viewer*.rpm build/jfjoch-writer*rpm build/xds-plugin/libjfjoch_xds_plugin.so.*; do
|
||||
python3 gitea_upload_file.py "$file"
|
||||
done
|
||||
elif [ "${{ matrix.distro }}" = "rocky9_nocuda" ]; then
|
||||
for file in build/jfjoch-viewer*.rpm build/jfjoch-writer*rpm; do
|
||||
python3 gitea_upload_file.py "$file"
|
||||
done
|
||||
elif [ "${{ matrix.distro }}" = "ubuntu2204_nocuda" ]; then
|
||||
for file in build/jfjoch*viewer*.deb build/jfjoch*writer*.deb; do
|
||||
python3 gitea_upload_file.py "$file"
|
||||
done
|
||||
fi
|
||||
dials-test:
|
||||
name: DIALS test
|
||||
runs-on: jfjoch_rocky9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build processing test
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ env.MARCH_CMAKE_FLAGS }} ..
|
||||
ninja -j16 jfjoch_hdf5_test
|
||||
- name: Run DIALS processing on legacy format
|
||||
shell: bash
|
||||
run: |
|
||||
source /opt/dials-v3-27-0/dials_env.sh
|
||||
mkdir -p test01
|
||||
cd test01
|
||||
../build/tools/jfjoch_hdf5_test ../tests/test_data/compression_benchmark.h5 -n100 -o legacy
|
||||
xia2.ssx image=legacy_master.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000
|
||||
- name: Run DIALS processing on VDS (master + 4 linked image files)
|
||||
shell: bash
|
||||
run: |
|
||||
source /opt/dials-v3-27-0/dials_env.sh
|
||||
mkdir -p test02
|
||||
cd test02
|
||||
../build/tools/jfjoch_hdf5_test ../tests/test_data/compression_benchmark.h5 -n100 -f25 -V -o vds
|
||||
xia2.ssx image=vds_master.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000
|
||||
- name: Run DIALS processing on single file format
|
||||
shell: bash
|
||||
run: |
|
||||
source /opt/dials-v3-27-0/dials_env.sh
|
||||
mkdir -p test03
|
||||
cd test03
|
||||
../build/tools/jfjoch_hdf5_test ../tests/test_data/compression_benchmark.h5 -n100 -S -o single
|
||||
xia2.ssx image=single.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000
|
||||
xds-durin-test:
|
||||
name: XDS test (durin plugin)
|
||||
runs-on: jfjoch_rocky9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build processing test
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ env.MARCH_CMAKE_FLAGS }} ..
|
||||
ninja -j16 jfjoch_hdf5_test
|
||||
- name: Run XDS with Durin and legacy HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds_durin
|
||||
rm -rf *.h5 *.LP *.HKL
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -f10
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
- name: Run XDS with Durin and VDS HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds_durin
|
||||
rm -rf *.h5 *.LP *.HKL
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -f10 -V
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
- name: Run XDS with Durin and integrated HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds_durin
|
||||
rm -rf *.h5 *.LP *.HKL
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -S
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
xds-test:
|
||||
name: XDS test (JFJoch plugin)
|
||||
runs-on: jfjoch_rocky9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build processing test
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ env.MARCH_CMAKE_FLAGS }} ..
|
||||
ninja -j16 jfjoch_hdf5_test
|
||||
ninja -j16 jfjoch_xds_plugin
|
||||
- name: Run XDS with legacy HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -f10
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
- name: Run XDS with VDS HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds
|
||||
rm -f *.h5 *.LP *.HKL
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -f10 -V
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
- name: Run XDS with single HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds
|
||||
rm -f *.h5 *.LP *.HKL
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -S
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
xds-neggia-test:
|
||||
name: XDS test (neggia plugin)
|
||||
runs-on: jfjoch_rocky9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build processing test
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ${{ env.MARCH_CMAKE_FLAGS }} ..
|
||||
ninja -j16 jfjoch_hdf5_test
|
||||
- name: Run XDS with Neggia and legacy HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds_neggia
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -f10
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
- name: Run XDS with Neggia and single HDF5 format
|
||||
shell: bash
|
||||
run: |
|
||||
cd tests/xds_neggia
|
||||
rm -f *.h5 *.LP *.HKL
|
||||
../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 -n25 -S
|
||||
/opt/xds/xds_par
|
||||
test -f IDXREF.LP
|
||||
python-client:
|
||||
name: Generate python client
|
||||
runs-on: jfjoch_rocky8
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build python client
|
||||
shell: bash
|
||||
run: bash gen_python_client.sh
|
||||
- name: Upload Package to Gitea PyPI
|
||||
if: github.ref_type == 'tag'
|
||||
run: |
|
||||
twine upload -u __token__ -p ${{ secrets.CI_PYPI_TOKEN }} --skip-existing dist/*
|
||||
twine upload -u __token__ -p ${{ secrets.PIP_REPOSITORY_API_TOKEN }} --repository-url https://gitea.psi.ch/api/packages/mx/pypi dist/*
|
||||
documentation:
|
||||
name: Build documentation
|
||||
runs-on: jfjoch_rocky8
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build documentation
|
||||
shell: bash
|
||||
run: bash make_doc.sh
|
||||
- name: Upload documentation
|
||||
if: github.ref_type == 'tag'
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global user.email "filip.leonarski@psi.ch"
|
||||
git config --global user.name "Filip Leonarski (Gitea)"
|
||||
git checkout --orphan gitea-pages
|
||||
git reset --hard
|
||||
# Remove everything except .git and public
|
||||
git clean -fdx -e public -e .git
|
||||
|
||||
# Move public contents to root and remove the now-empty public dir
|
||||
shopt -s dotglob nullglob
|
||||
mv public/* .
|
||||
rm -rf public
|
||||
git add .
|
||||
git commit -m "Deploy site"
|
||||
git push -f https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git gitea-pages
|
||||
create-release:
|
||||
name: Create release
|
||||
runs-on: jfjoch_rocky8
|
||||
if: github.event_name == 'workflow_dispatch' && (github.event.inputs.create_release == 'true' || github.event.inputs.create_release == true)
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: 'true' # Optional; should be the default
|
||||
- name: Configure auth and fetch LFS
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.PIP_REPOSITORY_API_TOKEN }}
|
||||
run: |
|
||||
git lfs install --local
|
||||
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader)
|
||||
git config --local --unset http.${{ github.server_url }}/.extraheader
|
||||
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
||||
git lfs pull
|
||||
- name: Create release
|
||||
env:
|
||||
TOKEN: ${{ secrets.PIP_REPOSITORY_API_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
python3 gitea_create_release.py
|
||||
+44
-20
@@ -5,23 +5,8 @@ stages:
|
||||
- release
|
||||
|
||||
variables:
|
||||
CMAKE_PREFIX_PATH: /opt/qt6
|
||||
|
||||
build:x86:gcc-11:
|
||||
stage: build
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-11/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
|
||||
- make -j48
|
||||
PKG_CONFIG_PATH: /opt/openssl-3.5.4/lib/pkgconfig:/opt/openssl-3.5.4/lib64/pkgconfig
|
||||
CMAKE_PREFIX_PATH: /opt/qt-6.9.0-static:/opt/eigen-3.4
|
||||
|
||||
build:x86:gcc-12:
|
||||
stage: build
|
||||
@@ -109,8 +94,8 @@ build:x86:python_client:
|
||||
- bash gen_python_client.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- jfjoch_client-*whl
|
||||
- jfjoch_client-*tar.gz
|
||||
- dist/jfjoch_client-*whl
|
||||
- dist/jfjoch_client-*tar.gz
|
||||
expire_in: 1 week
|
||||
|
||||
build:x86:frontend:
|
||||
@@ -145,7 +130,44 @@ build:x86:rpm:
|
||||
- mv *.rpm ..
|
||||
artifacts:
|
||||
paths:
|
||||
- "*.rpm"
|
||||
- "jfjoch-*.rpm"
|
||||
expire_in: 1 week
|
||||
|
||||
build:x86:rpm_nocuda:
|
||||
stage: build
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON -DJFJOCH_USE_CUDA=OFF ..
|
||||
- make frontend
|
||||
- make -j48 package
|
||||
- mv *.rpm ..
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch-viewer*.rpm"
|
||||
expire_in: 1 week
|
||||
|
||||
|
||||
build:x86:sls9:rpm:
|
||||
stage: build
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=OFF -DJFJOCH_VIEWER_BUILD=OFF -DSLS9=ON ..
|
||||
- make frontend
|
||||
- make -j48 package
|
||||
- mv *.rpm ..
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch-slsdet9*.rpm"
|
||||
expire_in: 1 week
|
||||
|
||||
test:x86:gcc:
|
||||
@@ -377,6 +399,8 @@ release:
|
||||
dependencies:
|
||||
- build:x86:frontend
|
||||
- build:x86:rpm
|
||||
- build:x86:rpm_nocuda
|
||||
- build:x86:sls9:rpm
|
||||
- build:x86:python_client
|
||||
script:
|
||||
- bash gitlab_upload_release.sh
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## What this is
|
||||
|
||||
Jungfraujoch is the data-acquisition and analysis system for the PSI JUNGFRAU and EIGER
|
||||
X-ray detectors. It receives detector data, runs it through an FPGA-accelerated pipeline
|
||||
(spot finding, azimuthal/ROI integration, compression), streams images out over ZeroMQ for
|
||||
writing to HDF5, and runs crystallographic analysis (indexing, integration, scaling/merging).
|
||||
Most authoritative documentation lives in `docs/` and on Read The Docs
|
||||
(https://jungfraujoch.readthedocs.io). When changing CLI behaviour, the program's own
|
||||
usage message is the source of truth, not the docs.
|
||||
|
||||
## Build
|
||||
|
||||
Out-of-source CMake build, C++20, heavy use of `FetchContent` (spdlog, zstd, HDF5,
|
||||
slsDetectorPackage, Catch2, cpp-httplib, libzmq, Ceres, fast-feedback-indexer are downloaded
|
||||
and statically linked — the **first configure needs network access** and is slow).
|
||||
|
||||
```
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc) jfjoch_broker # the main service; build other targets by name
|
||||
```
|
||||
|
||||
Key CMake options:
|
||||
- `JFJOCH_USE_CUDA` (default ON) — GPU path. Needs CUDA ≥ 12.8. Provides the `ffbidx` and `fft`
|
||||
GPU indexers; without it only the CPU `fftw` indexer is available (requires FFTW at configure
|
||||
time, auto-detected). CUDA absence is not a build error.
|
||||
- `JFJOCH_WRITER_ONLY` (default OFF) — builds only the HDF5 writer; skips broker, FPGA,
|
||||
receiver, analysis, tests, frontend.
|
||||
- `JFJOCH_VIEWER_BUILD` (default OFF) — builds the Qt6 `jfjoch_viewer` desktop app.
|
||||
- `SLS9` (default OFF) — build against slsDetectorPackage 9.2.0 instead of 8.0.2.
|
||||
|
||||
The frontend is a separate custom target: `make frontend` (runs `npm ci && npm run build` in
|
||||
`frontend/`). It is not built by default unless installing.
|
||||
|
||||
## Test
|
||||
|
||||
Tests use **Catch2** and are collected into a single binary `tests/jfjoch_test`.
|
||||
|
||||
```
|
||||
make -j$(nproc) jfjoch_test
|
||||
cd tests
|
||||
./jfjoch_test # all tests
|
||||
./jfjoch_test "<test name>" # one test case (exact name in TEST_CASE)
|
||||
./jfjoch_test "[tag]" # by tag
|
||||
./jfjoch_test -r junit -o report.xml
|
||||
```
|
||||
|
||||
`make jfjoch_hdf5_test` builds the HDF5 write-speed benchmark, also used by CI to produce files
|
||||
that are validated against XDS (Durin/Neggia) and CrystFEL.
|
||||
|
||||
Lint config is `.clang-tidy` (broad `*` check set with many exceptions; namespaces lower_case,
|
||||
classes CamelCase, global constants UPPER_CASE).
|
||||
|
||||
## Code style
|
||||
|
||||
The overriding principle is **simple, readable code** — favour the smallest, most direct
|
||||
implementation that a reader can verify at a glance. Extra abstraction, speculative guards, and
|
||||
clever-but-dense constructs are treated as actively harmful, not as polish. When torn between a
|
||||
tidy abstraction and a flat, obvious version, pick the obvious one.
|
||||
|
||||
This matters most in `image_analysis/pixel_refinement/` (e.g. `PixelRefine.cpp`), which is an
|
||||
experimental prototype where readability is how the physics gets verified — keep it especially
|
||||
plain. **Do not add defensive/unrequested code** (extra validation, rejection heuristics, "just in
|
||||
case" branches) without asking first; if a guard isn't clearly needed, leave it out.
|
||||
|
||||
Match the surrounding code's idiom, naming, and comment density rather than importing a different
|
||||
style.
|
||||
|
||||
## Local end-to-end run (no detector / no FPGA)
|
||||
|
||||
The FPGA HLS logic can be simulated on the CPU (`HLSSimulatedDevice`), so the full software
|
||||
stack runs without hardware (slowly — fixed-point math on CPU). See
|
||||
`docs/JFJOCH_BROKER.md` for the canonical walkthrough.
|
||||
|
||||
```
|
||||
cd build/broker
|
||||
./jfjoch_broker ../../etc/broker_local.json 5232 # config JSON + HTTP port
|
||||
# then, separately:
|
||||
cd tests/test_data && python jfjoch_broker_test.py # feeds a test image, starts collection
|
||||
# observe at http://localhost:5232 ; HDF5 is written under build/broker
|
||||
```
|
||||
|
||||
`etc/broker_local.json`, `broker_eiger.json`, `broker_crmx.json` are example broker configs
|
||||
(schema = `jfjoch_settings` in `broker/jfjoch_api.yaml`).
|
||||
|
||||
## Architecture
|
||||
|
||||
**Data flow (online):** detector → FPGA acquisition (`fpga/`, `acquisition_device/`) →
|
||||
`receiver/` builds full images from per-module FPGA output → `image_pusher/` streams CBOR-encoded
|
||||
images over ZeroMQ → `jfjoch_writer` (`writer/`) consumes the stream and writes NXmx HDF5. The
|
||||
broker also emits a low-rate preview stream and a metadata stream (`preview/`).
|
||||
|
||||
**Writer file split:** one acquisition produces one `_master.h5` plus many `_data_NNNNNN.h5`
|
||||
files. Dataset-wide metadata (geometry, detector config, ROI/azimuthal definitions — anything
|
||||
fixed for the whole run) is written to the **master** file in `writer/HDF5NXmx.cpp` (the `NXmx`
|
||||
class). Per-image arrays (one entry per frame) are written to the **data** files by the
|
||||
`HDF5DataFilePlugin` subclasses in `writer/`. Put shared metadata in `NXmx`, not in a data-file
|
||||
plugin.
|
||||
|
||||
The HDF5 master/data layout is one of three `FileWriterFormat`s (`common/JFJochMessages.h`),
|
||||
all NXmx: **`NXmxLegacy`** (master + `_data_NNNNNN.h5` joined by external links),
|
||||
**`NXmxVDS`** (master + data joined by HDF5 virtual datasets — the default), and
|
||||
**`NXmxIntegrated`** (a single self-contained file, no separate data files). Per-image plugins
|
||||
must work for all three; with `NXmxIntegrated` "master" and "data" are the same file.
|
||||
|
||||
**Two acquisition workflows:** the FPGA-accelerated path (JUNGFRAU at PSI; FPGA does masking,
|
||||
summation, spot finding, ROI/azimuthal integration, compression) and the DECTRIS SIMPLON path
|
||||
(EIGER), which has no FPGA — masking/ROI/azimuthal analysis then runs on CPU through the shared
|
||||
`image_analysis/` library. Treat ROI and azimuthal features as available in **both** workflows,
|
||||
not FPGA-only.
|
||||
|
||||
**`jfjoch_broker`** (`broker/`) is the central online service: HTTP/REST + OpenAPI control plane,
|
||||
FPGA configuration, image building, ZeroMQ output. `JFJochStateMachine` drives acquisition state;
|
||||
`JFJochServices` wires the pieces; `OpenAPIConvert`/`JFJochBrokerParser` translate between the
|
||||
generated API model and internal types.
|
||||
|
||||
**Three analysis frontends share one analysis library** (`image_analysis/`, built as
|
||||
`JFJochImageAnalysis`):
|
||||
- `jfjoch_broker` — online, real-time (FPGA + GPU).
|
||||
- `jfjoch_viewer` — interactive Qt desktop (`viewer/`), results not persisted.
|
||||
- `jfjoch_process` (`tools/jfjoch_process.cpp`) — offline batch over a stored HDF5; writes
|
||||
`_process.h5` and `.mtz`/`.cif`/`.hkl`. `jfjoch_scale` re-scales/merges already-integrated data.
|
||||
|
||||
**`image_analysis/` pipeline** (subdirs): `spot_finding`, `indexing` (`ffbidx`/`fft` GPU,
|
||||
`fftw` CPU), `lattice_search`, `geom_refinement`, `pixel_refinement`, `bragg_prediction`,
|
||||
`bragg_integration`, `rotation_indexer`, `azint`, `roi`, `scale_merge`. Least-squares refinement
|
||||
uses **Ceres** (fetched, built with miniglog, no MKL, CXX_THREADS). `ffbidx` needs a known cell
|
||||
(`-C`) and suits sparse serial stills; `fft`/`fftw` index de novo and suit strong rotation data.
|
||||
|
||||
**FPGA** (`fpga/`): `hls/` is the Vitis HLS source (image-analysis kernels), `hls_simulation/`
|
||||
runs that same HLS on CPU for hardware-free testing, `host_library/` is the host-side driver,
|
||||
`pcie_driver/` is the kernel module. The HLS algorithms are documented in
|
||||
`docs/FPGA_DATA_ANALYSIS.md`.
|
||||
|
||||
**Detector control** (`detector_control/`): wrappers for SLS (JUNGFRAU) and DECTRIS SIMPLON
|
||||
(EIGER). **`jungfrau/`**: JUNGFRAU ADU→energy gain/pedestal calibration.
|
||||
|
||||
**Other libs:** `common/` (geometry, diffraction experiment, image buffer, CUDA wrappers — the
|
||||
shared core, linked nearly everywhere), `compression/` (zstd + bitshuffle + sqrt lossy),
|
||||
`frame_serialize/` (CBOR stream codec), `gemmi_gph/` (vendored GEMMI for MTZ/XDS_ASCII I/O),
|
||||
`xds-plugin/` (XDS HDF5 read plugin).
|
||||
|
||||
## Portability (jfjoch_viewer)
|
||||
|
||||
Cross-platform support is a goal **only for `jfjoch_viewer` and its dependency tree** — keep that
|
||||
code, and any shared library it transitively links (`common/`, `image_analysis/`, `reader/`,
|
||||
`gemmi_gph/`, etc.), **MSVC-compatible** so the viewer can build on Windows. The rest of the
|
||||
project (broker, receiver, FPGA host, detector control, …) is Linux-only and does not need to be
|
||||
portable; don't constrain it for portability's sake.
|
||||
|
||||
- **Windows/MSVC** is the primary portability target. The end goal is a Windows viewer built
|
||||
with **MSVC *and* CUDA** (`JFJOCH_USE_CUDA=ON`): GPU processing is a wanted feature, not
|
||||
optional, so the intended Windows config is the full GPU path (`ffbidx`, GPU `fft`), not a
|
||||
CPU-only fallback. MSVC is required regardless, because CUDA on Windows requires it. Avoid
|
||||
GCC/Clang-only extensions, POSIX-only APIs, and other non-MSVC constructs in viewer-reachable
|
||||
code, and keep CUDA-reachable viewer code (`ffbidx`, GPU indexers) MSVC-buildable too.
|
||||
- **macOS** is a nice-to-have for the viewer. It rules out CUDA, so anything the viewer depends on
|
||||
must also have a working CPU-only / non-CUDA path (the `JFJOCH_USE_CUDA=OFF`, `fftw`-indexer
|
||||
configuration). This non-CUDA path must keep working, but it is the macOS fallback — *not* the
|
||||
intended Windows configuration.
|
||||
|
||||
A self-contained Windows build still needs a few dependencies that the Linux build picks up from
|
||||
the system and that are **not** auto-provided via `FetchContent` (besides Qt, supplied
|
||||
externally): **ZLIB** (pulled by hdf5/libtiff/gemmi/libzmq — a bundled zlib-ng in `ZLIB_COMPAT`
|
||||
mode is the intended fix, presented as the `ZLIB::ZLIB` target so the scattered
|
||||
`find_package(ZLIB)` calls resolve), **libjpeg-turbo** (used by `preview/`; upstream discourages
|
||||
`add_subdirectory`, so bring it in via `ExternalProject`), and **Eigen** (header-only; needed by
|
||||
Ceres, by the analysis libs directly, and by `ffbidx` under CUDA — fetch it and point Ceres'
|
||||
internal `find_package(Eigen3)` at it). Wire each guarded so the Linux build, which finds these on
|
||||
the system, stays unchanged.
|
||||
|
||||
## OpenAPI is the single source of truth
|
||||
|
||||
`broker/jfjoch_api.yaml` defines the entire REST API **and the shared data schemas**. From it,
|
||||
`update_version.sh` regenerates three clients — **do not hand-edit generated code**:
|
||||
- C++ server model → `broker/gen/` (cpp-pistache-server generator; compiled as `JFJochAPI`).
|
||||
- Python client → `python-client/` (and `gen_python_client.sh`, published as PyPI `jfjoch-client`).
|
||||
- TypeScript frontend client → `frontend/src/client/` (hey-api `openapi-ts`, `npm run openapi`).
|
||||
|
||||
When you change `jfjoch_api.yaml`, regenerate the relevant client(s); for a version bump run
|
||||
`update_version.sh` (also rewrites `VERSION`, `frontend/src/version.ts`, and the Redoc html).
|
||||
|
||||
## Frontend
|
||||
|
||||
React 19 + TypeScript + MUI + Vite (`frontend/`). Data layer is generated from the OpenAPI spec
|
||||
(`@hey-api/openapi-ts` → fetch client + TanStack Query hooks + zod schemas). Scripts:
|
||||
`npm start` (dev server), `npm run build` (tsc + vite), `npm run openapi` (regen client),
|
||||
`npm run redocly4broker` (regen `broker/redoc-static.html`).
|
||||
+372
-115
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.19)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.26)
|
||||
|
||||
FILE(STRINGS VERSION JFJOCH_VERSION)
|
||||
|
||||
@@ -8,14 +8,25 @@ SET(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-deprecated-enum-enum-conversion")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-O3")
|
||||
|
||||
SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only")
|
||||
SET(JFJOCH_INSTALL_DRIVER_SOURCE OFF CACHE BOOL "Install kernel driver source (ignored if building writer only; necessary for RPM building)")
|
||||
SET(JFJOCH_USE_CUDA ON CACHE BOOL "Compile Jungfraujoch with CUDA")
|
||||
SET(JFJOCH_VIEWER_BUILD OFF CACHE BOOL "Compile Jungfraujoch viewer")
|
||||
|
||||
# Only the viewer (and its portable dependency tree) is supported on Windows and macOS -- the
|
||||
# broker/receiver/FPGA/writer server stack is Linux-only. Force viewer-only on those platforms so a
|
||||
# plain configure builds the right subset; on Linux it remains a user-togglable option.
|
||||
IF (WIN32 OR APPLE)
|
||||
SET(JFJOCH_VIEWER_ONLY ON CACHE BOOL "Compile only jfjoch_viewer and its dependencies" FORCE)
|
||||
ELSE()
|
||||
SET(JFJOCH_VIEWER_ONLY OFF CACHE BOOL "Compile only jfjoch_viewer and its dependencies")
|
||||
ENDIF()
|
||||
|
||||
SET (ZLIB_USE_STATIC_LIBS TRUE)
|
||||
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
|
||||
OPTION(SLS9 "Build with sls_detector_package v9.2.0" OFF)
|
||||
|
||||
SET(BUILD_SHARED_LIBS OFF)
|
||||
SET(BUILD_TESTING OFF)
|
||||
@@ -32,82 +43,78 @@ SET(SLS_BUILD_SHARED_LIBRARIES OFF)
|
||||
SET(BUILD_FAST_INDEXER OFF)
|
||||
SET(BUILD_FAST_INDEXER_STATIC ON)
|
||||
|
||||
SET(HDF5_ENABLE_SZIP_SUPPORT OFF)
|
||||
SET(HDF5_ENABLE_SZIP_ENCODING OFF)
|
||||
SET(HDF5_BUILD_EXAMPLES OFF)
|
||||
SET(HDF5_BUILD_CPP_LIB OFF)
|
||||
SET(HDF5_ENABLE_Z_LIB_SUPPORT OFF)
|
||||
SET(HDF5_EXTERNALLY_CONFIGURED 1)
|
||||
|
||||
# TIFF
|
||||
SET(jbig OFF)
|
||||
SET(zstd OFF)
|
||||
SET(lzma OFF)
|
||||
SET(jpeg OFF)
|
||||
SET(old-jpeg OFF)
|
||||
|
||||
# PNG
|
||||
set(PNG_SHARED OFF)
|
||||
set(PNG_STATIC ON)
|
||||
set(PNG_EXECUTABLES OFF)
|
||||
set(PNG_TESTS OFF)
|
||||
|
||||
INCLUDE(CheckLanguage)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
|
||||
# Locate nvcc ourselves when it isn't already pinned (-DCMAKE_CUDA_COMPILER / $CUDACXX). CHECK_LANGUAGE
|
||||
# below only searches PATH, which is missed routinely on Windows and intermittently on Linux; the
|
||||
# standard CUDA install locations (CUDA_PATH on Windows, /usr/local/cuda on Linux) cover both, so the
|
||||
# compiler need not be passed by hand. Only set it when actually found, leaving CHECK_LANGUAGE to run
|
||||
# its normal detection otherwise.
|
||||
IF (JFJOCH_USE_CUDA AND NOT CMAKE_CUDA_COMPILER AND NOT DEFINED ENV{CUDACXX})
|
||||
FIND_PROGRAM(_jfjoch_nvcc nvcc
|
||||
HINTS ENV CUDA_PATH ENV CUDA_HOME ENV CUDA_ROOT /usr/local/cuda /opt/cuda
|
||||
PATH_SUFFIXES bin)
|
||||
IF (_jfjoch_nvcc)
|
||||
SET(CMAKE_CUDA_COMPILER "${_jfjoch_nvcc}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
CHECK_LANGUAGE(CUDA)
|
||||
|
||||
SET(CMAKE_CUDA_ARCHITECTURES 70 75 80 86 89) # V100, T4, A100, RTX A4000, L4
|
||||
SET(CMAKE_CUDA_STANDARD 17)
|
||||
SET(CMAKE_CUDA_FLAGS_RELEASE "-O3")
|
||||
SET(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 120) # T4, A100, RTX A4000, L4
|
||||
SET(CMAKE_CUDA_STANDARD 20)
|
||||
SET(CMAKE_CUDA_STANDARD_REQUIRED True)
|
||||
SET(CMAKE_CUDA_FLAGS_RELEASE "-O3 -lineinfo")
|
||||
SET(CMAKE_CUDA_RUNTIME_LIBRARY Static)
|
||||
|
||||
SET(JFJOCH_CUDA_AVAILABLE OFF)
|
||||
|
||||
IF (CMAKE_CUDA_COMPILER)
|
||||
IF (JFJOCH_USE_CUDA)
|
||||
ENABLE_LANGUAGE(CUDA)
|
||||
FIND_PACKAGE(CUDAToolkit REQUIRED)
|
||||
MESSAGE(STATUS "CUDA VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
|
||||
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA)
|
||||
FIND_LIBRARY(CUDART_LIBRARY cudart_static PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
|
||||
SET(JFJOCH_CUDA_AVAILABLE ON)
|
||||
IF (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.8")
|
||||
FIND_PACKAGE(CUDAToolkit REQUIRED)
|
||||
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA)
|
||||
SET(JFJOCH_CUDA_AVAILABLE ON)
|
||||
# Blackwell GB10 (DGX Spark) is sm_121, only known to nvcc >= 12.9; add it there so the
|
||||
# binary launches natively on Spark (the list above tops out at sm_120 and embeds no PTX).
|
||||
IF (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.9")
|
||||
LIST(APPEND CMAKE_CUDA_ARCHITECTURES 121)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
MESSAGE(WARNING "CUDA older than 12.8 not supported")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
MESSAGE(WARNING "CUDA Available, but disabled by user")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(include)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
|
||||
FIND_LIBRARY(NUMA_LIBRARY NAMES numa DOC "NUMA Library")
|
||||
CHECK_INCLUDE_FILE(numaif.h HAS_NUMAIF)
|
||||
CHECK_INCLUDE_FILE(numa.h HAS_NUMA_H)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(tiff
|
||||
GIT_REPOSITORY https://github.com/fleon-psi/libtiff
|
||||
GIT_TAG v4.6.0
|
||||
EXCLUDE_FROM_ALL)
|
||||
SET(HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
|
||||
SET(HDF5_ENABLE_SZIP_ENCODING OFF CACHE BOOL "" FORCE)
|
||||
SET(HDF5_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
SET(HDF5_BUILD_CPP_LIB OFF CACHE BOOL "" FORCE)
|
||||
SET(HDF5_ENABLE_ZLIB_SUPPORT ON CACHE BOOL "" FORCE)
|
||||
SET(HDF5_EXTERNALLY_CONFIGURED 1 CACHE BOOL "" FORCE)
|
||||
|
||||
SET(SPDLOG_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
SET(SPDLOG_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
SET(SPDLOG_BUILD_BENCH OFF CACHE BOOL "" FORCE)
|
||||
set(SPDLOG_BUILD_SHARED OFF CACHE BOOL "" FORCE)
|
||||
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
SET(HTTPLIB_USE_NON_BLOCKING_GETADDRINFO OFF CACHE BOOL "" FORCE)
|
||||
SET(HTTPLIB_REQUIRE_ZLIB ON CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_Declare(
|
||||
png
|
||||
GIT_REPOSITORY https://github.com/pnggroup/libpng
|
||||
GIT_TAG v1.6.49
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_Declare(hdf5
|
||||
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
|
||||
GIT_TAG hdf5_1.14.5
|
||||
GIT_SHALLOW 1
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
SET(PISTACHE_USE_CONTENT_ENCODING_DEFLATE ON)
|
||||
SET(PISTACHE_BUILD_TESTS OFF)
|
||||
|
||||
FetchContent_Declare(
|
||||
pistache_http
|
||||
GIT_REPOSITORY https://github.com/fleon-psi/pistache
|
||||
GIT_TAG 280b0f6f28f81745870bccb31f4a3a59958807f6
|
||||
spdlog
|
||||
GIT_REPOSITORY https://github.com/gabime/spdlog.git
|
||||
GIT_TAG v1.17.0
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
@@ -119,53 +126,199 @@ FetchContent_Declare(
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_Declare(hdf5
|
||||
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
|
||||
GIT_TAG hdf5_2.1.0
|
||||
GIT_SHALLOW 1
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
SET(SLS_DETECTOR_GIT_TAG "8.0.2")
|
||||
IF(SLS9)
|
||||
SET(SLS_DETECTOR_GIT_TAG "9.2.0")
|
||||
ENDIF()
|
||||
|
||||
FetchContent_Declare(
|
||||
sls_detector_package
|
||||
GIT_REPOSITORY https://github.com/slsdetectorgroup/slsDetectorPackage
|
||||
GIT_TAG 8.0.2
|
||||
GIT_TAG ${SLS_DETECTOR_GIT_TAG}
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2
|
||||
GIT_TAG 4e8d92b
|
||||
GIT_TAG v3.13.0
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2 hdf5 tiff png)
|
||||
FetchContent_Declare(
|
||||
httplib
|
||||
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
|
||||
GIT_TAG v0.39.0
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
# httplib enables Brotli content-encoding whenever it finds system Brotli; we don't use it
|
||||
# (gzip/zlib is enough for the broker), so disable it to avoid linking libbrotli.
|
||||
SET(HTTPLIB_USE_BROTLI_IF_AVAILABLE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
ADD_SUBDIRECTORY(jungfrau)
|
||||
ADD_SUBDIRECTORY(compression)
|
||||
ADD_SUBDIRECTORY(common)
|
||||
ADD_SUBDIRECTORY(writer)
|
||||
ADD_SUBDIRECTORY(frame_serialize)
|
||||
ADD_SUBDIRECTORY(reader)
|
||||
ADD_SUBDIRECTORY(detector_control)
|
||||
ADD_SUBDIRECTORY(image_puller)
|
||||
ADD_SUBDIRECTORY(preview)
|
||||
# ZeroMQ (libzmq): fetch it here, at the top level, so that THIS project - not
|
||||
# slsDetectorPackage - controls the version. slsDetectorPackage bundles its own libzmq
|
||||
# archive, but only populates it behind `if(NOT libzmq_POPULATED)`; by making libzmq
|
||||
# available before sls below, sls reuses this copy and a single libzmq-static target is
|
||||
# built (no duplicate target / double-symbol clash). A future viewer-only / Windows build
|
||||
# (which does not build sls) fetches the same libzmq standalone.
|
||||
SET(BUILD_SHARED OFF CACHE BOOL "" FORCE) # libzmq: static only (matches sls)
|
||||
SET(BUILD_TESTS OFF CACHE BOOL "" FORCE) # libzmq: no test build
|
||||
SET(WITH_PERF_TOOL OFF CACHE BOOL "" FORCE) # libzmq: no perf tools
|
||||
SET(WITH_DOCS OFF CACHE BOOL "" FORCE) # libzmq: no docs
|
||||
SET(ENABLE_CPACK OFF CACHE BOOL "" FORCE) # libzmq: no CPack injection
|
||||
FetchContent_Declare(
|
||||
libzmq
|
||||
GIT_REPOSITORY https://github.com/zeromq/libzmq.git
|
||||
GIT_TAG v4.3.5
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
IF (JFJOCH_WRITER_ONLY)
|
||||
MESSAGE(STATUS "Compiling HDF5 writer only")
|
||||
# CMake >= 4.0 (e.g. the 4.x bundled with Visual Studio 2026) makes any
|
||||
# cmake_minimum_required(VERSION < 3.5) a fatal error. Some fetched dependencies still
|
||||
# declare such old floors (libzmq: 3.0.2), so raise the policy-version floor for the
|
||||
# FetchContent subprojects. Ignored (harmless) on CMake < 3.30, which lacks this variable.
|
||||
SET(CMAKE_POLICY_VERSION_MINIMUM 3.5)
|
||||
|
||||
# libzmq must be made available BEFORE sls_detector_package for the override above to take effect.
|
||||
FetchContent_MakeAvailable(libzmq)
|
||||
IF (JFJOCH_VIEWER_ONLY)
|
||||
# A viewer-only build still needs zstd/hdf5/spdlog/httplib (JFJochReader uses httplib).
|
||||
# Only sls_detector_package (detector) and catch2 (tests) are not built here -- and sls
|
||||
# in particular does not configure under MSVC -- so skip just those two.
|
||||
FetchContent_MakeAvailable(zstd hdf5 spdlog httplib)
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(image_pusher)
|
||||
ADD_SUBDIRECTORY(broker)
|
||||
ADD_SUBDIRECTORY(fpga)
|
||||
ADD_SUBDIRECTORY(acquisition_device)
|
||||
ADD_SUBDIRECTORY(receiver)
|
||||
FetchContent_MakeAvailable(zstd sls_detector_package catch2 hdf5 spdlog httplib)
|
||||
ENDIF()
|
||||
|
||||
# libtiff (used by JFJochPreview in every build mode): build it ourselves. Its C++ binding
|
||||
# (tiffxx) is packaged inconsistently across distros (missing on Rocky 9) and absent on
|
||||
# Windows. Library only; the SET()s below are libtiff's own codec/tool switches.
|
||||
# We only need DEFLATE (zlib) + the internal LZW codec, matching what Python tifffile writes
|
||||
# by default. The remaining codecs default to ON whenever their library is found on the build
|
||||
# host, so each must be explicitly turned OFF to keep the dependency set minimal -- otherwise
|
||||
# webp pulls in libwebp + libsharpyuv and lerc pulls in libLerc.
|
||||
SET(jbig OFF)
|
||||
SET(zstd OFF)
|
||||
SET(lzma OFF)
|
||||
SET(jpeg OFF)
|
||||
SET(old-jpeg OFF)
|
||||
SET(webp OFF)
|
||||
SET(lerc OFF)
|
||||
SET(tiff-tools OFF)
|
||||
SET(tiff-tests OFF)
|
||||
FetchContent_Declare(tiff
|
||||
GIT_REPOSITORY https://gitlab.com/libtiff/libtiff.git
|
||||
GIT_TAG v4.7.1
|
||||
EXCLUDE_FROM_ALL)
|
||||
FetchContent_MakeAvailable(tiff)
|
||||
|
||||
# FFTW single precision (target fftw3f): the CPU fallback indexer, enables JFJOCH_USE_FFTW.
|
||||
# Built from the release tarball -- the git repo ships no pre-generated codelets (needs the
|
||||
# OCaml genfft).
|
||||
SET(ENABLE_FLOAT ON CACHE BOOL "" FORCE)
|
||||
SET(BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
# SIMD codelets are runtime-dispatched (cpuid), so enabling AVX2 does NOT require an AVX2 CPU
|
||||
# -- FFTW falls back at runtime. The codelet sets are arch-specific, so guard by processor:
|
||||
# x86 gets SSE2/AVX/AVX2, aarch64 (e.g. Grace on DGX Spark) gets NEON; other arches build scalar.
|
||||
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64")
|
||||
SET(ENABLE_SSE2 ON CACHE BOOL "" FORCE)
|
||||
SET(ENABLE_AVX ON CACHE BOOL "" FORCE)
|
||||
SET(ENABLE_AVX2 ON CACHE BOOL "" FORCE)
|
||||
ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
||||
SET(ENABLE_NEON ON CACHE BOOL "" FORCE)
|
||||
ENDIF()
|
||||
FetchContent_Declare(fftw
|
||||
URL https://www.fftw.org/fftw-3.3.10.tar.gz
|
||||
URL_HASH SHA256=56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467
|
||||
EXCLUDE_FROM_ALL)
|
||||
FetchContent_MakeAvailable(fftw)
|
||||
# FFTW exposes fftw3.h only via $<INSTALL_INTERFACE:include>, so consuming fftw3f straight from
|
||||
# the build tree (FetchContent) leaves the header unreachable. On Linux a system-installed
|
||||
# fftw3.h masks this; on Windows it does not. Add the source-tree api/ dir for build-tree use.
|
||||
TARGET_INCLUDE_DIRECTORIES(fftw3f INTERFACE $<BUILD_INTERFACE:${fftw_SOURCE_DIR}/api>)
|
||||
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_FFTW)
|
||||
|
||||
# Eigen is an EXTERNAL dependency (like ZLIB), resolved by find_package(Eigen3) in the subdirectories
|
||||
# that need it (image_analysis, and transitively Ceres and ffbidx). It is deliberately NOT vendored
|
||||
# via FetchContent: declaring Eigen with OVERRIDE_FIND_PACKAGE makes the CMake bundled with Visual
|
||||
# Studio (cmake 4.x "-msvc") intermittently SEGFAULT during configure. The fault is in CMake's own
|
||||
# FetchContent variable-stack cleanup, reached when Ceres' find_package(Eigen3) resolves the override
|
||||
# through a nested FetchContent_MakeAvailable -- ~1 in 3 fresh configures, and 100% with Ceres CUDA on.
|
||||
# Stock Kitware CMake runs the identical scripts fine, so it is a bug in the VS-bundled cmake binary;
|
||||
# providing Eigen externally avoids that code path entirely and is stable (verified, both Ceres CUDA
|
||||
# on and off). Provide it via the system package on Linux (eigen3-devel / libeigen3-dev) or a build
|
||||
# prefix on Windows (point CMAKE_PREFIX_PATH / Eigen3_DIR at it), exactly as for ZLIB.
|
||||
|
||||
# getopt/getopt_long shim for Windows: the MSVC CRT has no <getopt.h>. Vendored OpenBSD/NetBSD
|
||||
# implementation (BSD-licensed). Built only on Windows and defined here, before the subdirectories,
|
||||
# so the portable CLI tools in tools/ can link it. A no-op on Linux/macOS, where getopt lives in
|
||||
# libc (macOS uses the system getopt even though it is also a forced viewer-only platform).
|
||||
IF (WIN32)
|
||||
ADD_LIBRARY(wingetopt STATIC tools/wingetopt/getopt.c tools/wingetopt/getopt.h)
|
||||
TARGET_INCLUDE_DIRECTORIES(wingetopt PUBLIC tools/wingetopt)
|
||||
ENDIF()
|
||||
|
||||
IF (JFJOCH_VIEWER_ONLY)
|
||||
# Minimal subtree: jfjoch_viewer and only the libraries it transitively links.
|
||||
# (broker here provides JFJochAPI only; its service targets are gated out.)
|
||||
ADD_SUBDIRECTORY(jungfrau)
|
||||
ADD_SUBDIRECTORY(compression)
|
||||
ADD_SUBDIRECTORY(common)
|
||||
ADD_SUBDIRECTORY(gemmi_gph)
|
||||
ADD_SUBDIRECTORY(frame_serialize)
|
||||
ADD_SUBDIRECTORY(preview)
|
||||
ADD_SUBDIRECTORY(writer)
|
||||
ADD_SUBDIRECTORY(image_analysis)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
ENDIF()
|
||||
|
||||
IF (JFJOCH_VIEWER_BUILD)
|
||||
ADD_SUBDIRECTORY(broker)
|
||||
ADD_SUBDIRECTORY(reader)
|
||||
ADD_SUBDIRECTORY(process)
|
||||
ADD_SUBDIRECTORY(viewer)
|
||||
ADD_SUBDIRECTORY(tools) # builds only the portable analysis tools (process/scale/azint/extract_hkl)
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(jungfrau)
|
||||
ADD_SUBDIRECTORY(compression)
|
||||
ADD_SUBDIRECTORY(common)
|
||||
ADD_SUBDIRECTORY(writer)
|
||||
ADD_SUBDIRECTORY(frame_serialize)
|
||||
ADD_SUBDIRECTORY(reader)
|
||||
ADD_SUBDIRECTORY(detector_control)
|
||||
ADD_SUBDIRECTORY(image_puller)
|
||||
ADD_SUBDIRECTORY(preview)
|
||||
ADD_SUBDIRECTORY(gemmi_gph)
|
||||
ADD_SUBDIRECTORY(xds-plugin)
|
||||
|
||||
IF (JFJOCH_WRITER_ONLY)
|
||||
MESSAGE(STATUS "Compiling HDF5 writer only")
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(image_pusher)
|
||||
ADD_SUBDIRECTORY(broker)
|
||||
ADD_SUBDIRECTORY(fpga)
|
||||
ADD_SUBDIRECTORY(acquisition_device)
|
||||
ADD_SUBDIRECTORY(receiver)
|
||||
ADD_SUBDIRECTORY(image_analysis)
|
||||
ADD_SUBDIRECTORY(process)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
ENDIF()
|
||||
|
||||
IF (JFJOCH_VIEWER_BUILD)
|
||||
ADD_SUBDIRECTORY(viewer)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF (NOT JFJOCH_WRITER_ONLY)
|
||||
IF (NOT JFJOCH_WRITER_ONLY AND NOT JFJOCH_VIEWER_ONLY)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT frontend/dist/index.html
|
||||
COMMAND npm install
|
||||
COMMAND npm ci
|
||||
COMMAND npm run build
|
||||
COMMAND npm run licenses # write dist/THIRD_PARTY_LICENSES.txt (npm deps attribution)
|
||||
COMMAND npm run redocly
|
||||
COMMAND npm run docs # bundle Sphinx docs into dist/docs (served at /frontend/docs)
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend)
|
||||
ADD_CUSTOM_TARGET(frontend DEPENDS frontend/dist/index.html)
|
||||
|
||||
@@ -189,44 +342,148 @@ IF (NOT JFJOCH_WRITER_ONLY)
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
SET(CMAKE_INSTALL_PREFIX /opt/jfjoch CACHE PATH "Default directory" FORCE)
|
||||
SET(CMAKE_INSTALL_PREFIX /opt/jfjoch CACHE PATH "Default directory" FORCE)
|
||||
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
||||
# Set Package Name
|
||||
# Initialize CPACK_COMPONENTS_ALL with common components
|
||||
SET(CPACK_COMPONENTS_ALL jfjoch writer)
|
||||
SET(CPACK_PACKAGE_NAME "jfjoch")
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src /usr/share /usr/share/dbus-1 /usr/share/dbus-1/services)
|
||||
|
||||
IF (JFJOCH_INSTALL_DRIVER_SOURCE)
|
||||
LIST(APPEND CPACK_COMPONENTS_ALL 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)
|
||||
ELSE()
|
||||
SET(CPACK_COMPONENTS_ALL jfjoch writer)
|
||||
ENDIF()
|
||||
# Select the components to package based on build mode
|
||||
if (JFJOCH_VIEWER_ONLY)
|
||||
set(CPACK_COMPONENTS_ALL viewer)
|
||||
else()
|
||||
set(CPACK_COMPONENTS_ALL jfjoch writer)
|
||||
if (JFJOCH_INSTALL_DRIVER_SOURCE)
|
||||
list(APPEND CPACK_COMPONENTS_ALL driver-dkms)
|
||||
endif()
|
||||
if (JFJOCH_VIEWER_BUILD)
|
||||
list(APPEND CPACK_COMPONENTS_ALL viewer)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF (JFJOCH_VIEWER_BUILD)
|
||||
LIST(APPEND CPACK_COMPONENTS_ALL viewer)
|
||||
ENDIF()
|
||||
# Common metadata
|
||||
set(CPACK_PACKAGE_CONTACT "Filip Leonarski <filip.leonarski@psi.ch>")
|
||||
set(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
|
||||
set(CPACK_PACKAGE_VERSION ${JFJOCH_VERSION})
|
||||
|
||||
SET(CPACK_GENERATOR RPM)
|
||||
SET(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
SET(CPACK_RPM_MAIN_COMPONENT jfjoch)
|
||||
SET(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
|
||||
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
SET(CPACK_RPM_PACKAGE_VERSION ${JFJOCH_VERSION})
|
||||
SET(CPACK_RPM_PACKAGE_RELEASE 1)
|
||||
SET(CPACK_RPM_PACKAGE_SUMMARY "Jungfraujoch data acquisition system")
|
||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION "Jungfraujoch")
|
||||
# OS-aware packaging: DragNDrop (.dmg) on macOS, NSIS installer on Windows, DEB on Debian/Ubuntu,
|
||||
# RPM on RHEL/Rocky. macOS/Windows are checked first because the /etc/* probes below are Linux-only.
|
||||
if (APPLE)
|
||||
# .dmg containing jfjoch_viewer.app (Qt runtime already deployed into the bundle).
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
elseif (WIN32)
|
||||
# NSIS installer .exe (Qt runtime deployed next to the binary by windeployqt).
|
||||
set(CPACK_GENERATOR "NSIS")
|
||||
|
||||
SET(CPACK_PACKAGE_CONTACT "Filip Leonarski <filip.leonarski@psi.ch>")
|
||||
# Set The Vendor Name
|
||||
SET(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
|
||||
# GPLv3 text shown as the click-through license page of the installer.
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
|
||||
# Set The License Information
|
||||
SET(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
|
||||
# Branding is split across three CPack knobs so the CUDA/CPU variant surfaces exactly where we
|
||||
# want it and nowhere else:
|
||||
# - Install folder + Start Menu group come from CPACK_PACKAGE_INSTALL_DIRECTORY and
|
||||
# CPACK_NSIS_PACKAGE_NAME (the latter feeds $(^Name), the Start Menu group's default folder).
|
||||
# Both stay plain "Jungfraujoch", so the Start Menu group carries no variant tag and the two
|
||||
# builds install to the same place (CUDA is a strict superset -- they replace, not coexist).
|
||||
# - CPACK_NSIS_DISPLAY_NAME is the Add/Remove Programs entry -- tagged "(CUDA)"/"(CPU)".
|
||||
# - CPACK_PACKAGE_FILE_NAME is the installer .exe filename -- tagged "-cuda<major>"/"-cpu", so
|
||||
# the (much larger) CUDA download is self-identifying, with the CUDA major version baked in.
|
||||
# The tag follows JFJOCH_CUDA_AVAILABLE automatically; CUDAToolkit_VERSION_MAJOR is set whenever
|
||||
# it is ON (find_package(CUDAToolkit) ran in the same guard above).
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Jungfraujoch")
|
||||
set(CPACK_NSIS_PACKAGE_NAME "Jungfraujoch")
|
||||
if (JFJOCH_CUDA_AVAILABLE)
|
||||
set(CPACK_NSIS_DISPLAY_NAME "Jungfraujoch (CUDA)")
|
||||
set(CPACK_PACKAGE_FILE_NAME "jfjoch-${JFJOCH_VERSION}-win64-cuda${CUDAToolkit_VERSION_MAJOR}")
|
||||
else()
|
||||
set(CPACK_NSIS_DISPLAY_NAME "Jungfraujoch (CPU)")
|
||||
set(CPACK_PACKAGE_FILE_NAME "jfjoch-${JFJOCH_VERSION}-win64-cpu")
|
||||
endif()
|
||||
|
||||
# Start Menu shortcut for the viewer ("<exe basename>;<label>"). The shortcut and the
|
||||
# Add/Remove Programs entry both use the .exe's embedded icon.
|
||||
set(CPACK_PACKAGE_EXECUTABLES "jfjoch_viewer;Jungfraujoch Viewer")
|
||||
# Forward slash on purpose: CPack writes this value verbatim into CPackConfig.cmake, and a
|
||||
# backslash there ("bin\jfjoch...") is an invalid escape that cmake 4.x (CMP0010 strict, e.g. the
|
||||
# VS-bundled cmake) rejects when cpack re-parses it. Windows accepts the forward slash at runtime.
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin/jfjoch_viewer.exe")
|
||||
elseif (EXISTS "/etc/debian_version")
|
||||
set(CPACK_PACKAGE_LICENSE "GPL-3.0-only")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
|
||||
# Debian/Ubuntu: .deb with components
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||
set(CPACK_DEBIAN_MAIN_COMPONENT broker)
|
||||
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
||||
|
||||
# Enable automatic shlib dependency discovery
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
|
||||
# Optional DEB metadata (tune as needed)
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
|
||||
# set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://example.org/jfjoch")
|
||||
|
||||
# DKMS component (maps from RPM settings)
|
||||
if (JFJOCH_INSTALL_DRIVER_SOURCE)
|
||||
# Dependencies and arch for the DKMS component
|
||||
# Note: component name "driver-dkms" maps to variable suffix "DRIVER_DKMS"
|
||||
set(CPACK_DEBIAN_DRIVER_DKMS_PACKAGE_DEPENDS "dkms, gcc, bash, sed")
|
||||
set(CPACK_DEBIAN_DRIVER_DKMS_PACKAGE_ARCHITECTURE "all")
|
||||
|
||||
# Provide Debian control scripts (postinst/prerm).
|
||||
# We rename existing scripts to Debian control names at configure time.
|
||||
set(_dkms_ctrl_dir "${CMAKE_CURRENT_BINARY_DIR}/cpack-debian-driver-dkms")
|
||||
file(MAKE_DIRECTORY "${_dkms_ctrl_dir}")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh
|
||||
${_dkms_ctrl_dir}/postinst COPYONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh
|
||||
${_dkms_ctrl_dir}/prerm COPYONLY)
|
||||
set(CPACK_DEBIAN_DRIVER_DKMS_PACKAGE_CONTROL_EXTRA
|
||||
"${_dkms_ctrl_dir}/postinst;${_dkms_ctrl_dir}/prerm")
|
||||
endif()
|
||||
|
||||
elseif (EXISTS "/etc/redhat-release")
|
||||
# RHEL/Rocky: .rpm with components (original behavior)
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
set(CPACK_RPM_MAIN_COMPONENT jfjoch)
|
||||
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
|
||||
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
set(CPACK_RPM_PACKAGE_VERSION ${JFJOCH_VERSION})
|
||||
set(CPACK_RPM_PACKAGE_RELEASE 1)
|
||||
set(CPACK_RPM_PACKAGE_SUMMARY "Jungfraujoch data acquisition system")
|
||||
set(CPACK_RPM_PACKAGE_DESCRIPTION "Jungfraujoch")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
|
||||
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
|
||||
/usr/src /usr/share /usr/share/dbus-1 /usr/share/dbus-1/services /usr/share/pixmaps /usr/share/applications)
|
||||
|
||||
# DKMS component scripts and requirements for RPM
|
||||
if (JFJOCH_INSTALL_DRIVER_SOURCE)
|
||||
set(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed")
|
||||
set(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch")
|
||||
set(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh)
|
||||
set(CPACK_RPM_DRIVER-DKMS_PRE_UNINSTALL_SCRIPT_FILE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh)
|
||||
endif()
|
||||
else()
|
||||
# Fallback if OS is unknown
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
endif()
|
||||
|
||||
|
||||
# Ship the license notices (top-level LICENSE, the third-party manifest, and the verbatim
|
||||
# license texts) with every package variant, under share/doc/jfjoch. Installed per component so
|
||||
# the file lands in whichever component package(s) the current build mode produces.
|
||||
SET(JFJOCH_NOTICE_FILES
|
||||
${CMAKE_SOURCE_DIR}/LICENSE
|
||||
${CMAKE_SOURCE_DIR}/THIRD_PARTY_NOTICES.md)
|
||||
FOREACH(_component IN LISTS CPACK_COMPONENTS_ALL)
|
||||
INSTALL(FILES ${JFJOCH_NOTICE_FILES}
|
||||
DESTINATION share/doc/jfjoch COMPONENT ${_component})
|
||||
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses/
|
||||
DESTINATION share/doc/jfjoch/licenses COMPONENT ${_component}
|
||||
PATTERN "COLLECT.sh" EXCLUDE)
|
||||
ENDFOREACH()
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
@@ -679,7 +679,10 @@ Public License instead of this License. But first, please read
|
||||
|
||||
================
|
||||
|
||||
As a special exception, we specifically permit linking Jungfraujoch code with Nvidia CUDA libraries.
|
||||
As a special exception, we specifically permit linking Jungfraujoch code with Nvidia CUDA libraries and Intel MKL.
|
||||
|
||||
We also permit to link Jungfraujoch software (GPLv3) with Jungfraujoch high-level synthesis code (CERN OHL 2.0) for the purpose
|
||||
of simulating FPGA design on CPU.
|
||||
|
||||
If OpenAPI definition file (jfjoch_api.yaml) is solely used to generate client code or to interact with the Jungfraujoch
|
||||
API it may be distributed under terms of your choosing without being subject to GPL requirements.
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
# Third-party software notices
|
||||
|
||||
Jungfraujoch is licensed under **GPL-3.0** (see [`LICENSE`](LICENSE)); the FPGA design is
|
||||
licensed under **CERN-OHL-S-2.0** (see [`fpga/LICENSE`](fpga/LICENSE)). It builds on a number of
|
||||
third-party components, acknowledged below as required by their licenses.
|
||||
|
||||
This file is the human-readable manifest. The verbatim license texts live in the
|
||||
[`licenses/`](licenses/) directory (regenerate with `bash licenses/COLLECT.sh`). The frontend's
|
||||
bundled JavaScript dependencies are listed separately in
|
||||
`frontend/dist/THIRD_PARTY_LICENSES.txt`, generated at build time (`npm run licenses`).
|
||||
|
||||
All licenses below are GPL-3.0-compatible.
|
||||
|
||||
## Fetched at build time and statically linked into the C++ binaries
|
||||
|
||||
These are downloaded by CMake (`FetchContent` / `ExternalProject`) during the first configure and
|
||||
linked into the Jungfraujoch executables.
|
||||
|
||||
| Component | Version | Copyright | License (SPDX) | License text |
|
||||
|---|---|---|---|---|
|
||||
| [spdlog](https://github.com/gabime/spdlog) | 1.17.0 | Gabi Melman | MIT | [spdlog.txt](licenses/spdlog.txt) |
|
||||
| [Zstandard](https://github.com/facebook/zstd) | (pinned) | Meta Platforms, Inc. | BSD-3-Clause | [zstd.txt](licenses/zstd.txt) |
|
||||
| [HDF5](https://github.com/HDFGroup/hdf5) | 2.1.0 | The HDF Group; UIUC | BSD-3-Clause-style | [hdf5.txt](licenses/hdf5.txt) |
|
||||
| [slsDetectorPackage](https://github.com/slsdetectorgroup/slsDetectorPackage) | 8.0.2 / 9.2.0 | PSI | LGPL-3.0-or-later | [LGPL](licenses/slsDetectorPackage-LGPL-3.0.txt), [GPL](licenses/slsDetectorPackage-GPL-3.0.txt) |
|
||||
| [cpp-httplib](https://github.com/yhirose/cpp-httplib) | 0.39.0 | Yuji Hirose | MIT | [cpp-httplib.txt](licenses/cpp-httplib.txt) |
|
||||
| [libzmq (ZeroMQ)](https://github.com/zeromq/libzmq) | 4.3.5 | iMatix and contributors | MPL-2.0 | [libzmq.txt](licenses/libzmq.txt) |
|
||||
| [libtiff](https://gitlab.com/libtiff/libtiff) | 4.7.1 | Sam Leffler; SGI | libtiff (BSD-like) | [libtiff.txt](licenses/libtiff.txt) |
|
||||
| [FFTW](https://www.fftw.org/) | 3.3.10 | Matteo Frigo; MIT | GPL-2.0-or-later | [fftw.txt](licenses/fftw.txt) |
|
||||
| [Ceres Solver](https://github.com/ceres-solver/ceres-solver) | (pinned) | Google Inc. and contributors | BSD-3-Clause | [ceres-solver.txt](licenses/ceres-solver.txt) |
|
||||
| [fast-feedback-indexer](https://github.com/paulscherrerinstitute/fast-feedback-indexer) | (pinned) | PSI | BSD-3-Clause | [fast-feedback-indexer.txt](licenses/fast-feedback-indexer.txt) |
|
||||
| [libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo) | (pinned) | D. R. Commander and others; IJG | IJG + BSD-3-Clause + Zlib | [libjpeg-turbo.txt](licenses/libjpeg-turbo.txt) |
|
||||
| [Catch2](https://github.com/catchorg/Catch2) | 3.13.0 | Catch2 Authors | BSL-1.0 | [catch2.txt](licenses/catch2.txt) |
|
||||
|
||||
Catch2 is used only to build the test binary (`jfjoch_test`) and is not part of any shipped
|
||||
artifact; it is listed here for completeness.
|
||||
|
||||
## Vendored directly in the repository
|
||||
|
||||
These are copied into the source tree (see the path) rather than fetched.
|
||||
|
||||
| Component | Path | Copyright | License (SPDX) | License text |
|
||||
|---|---|---|---|---|
|
||||
| [nlohmann/json](https://github.com/nlohmann/json) | `include/nlohmann/` | Niels Lohmann | MIT | [nlohmann-json.txt](licenses/nlohmann-json.txt) |
|
||||
| [Macaron Base64](https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594) | `include/base64/` | tomykaira | MIT | [base64-macaron.txt](licenses/base64-macaron.txt) |
|
||||
| [TinyCBOR](https://github.com/intel/tinycbor) | `frame_serialize/tinycbor/` | Intel Corporation | MIT | [tinycbor.txt](licenses/tinycbor.txt) |
|
||||
| [Bitshuffle](https://github.com/kiyo-masui/bitshuffle) | `compression/bitshuffle/` | Kiyoshi Masui | MIT | [bitshuffle.txt](licenses/bitshuffle.txt) |
|
||||
| [Bitshuffle (h-perf)](https://github.com/kalcutter/bitshuffle) | `compression/bitshuffle_hperf/` | Kal Cutter (DECTRIS) | Apache-2.0 | [bitshuffle-hperf.txt](licenses/bitshuffle-hperf.txt) |
|
||||
| [LZ4](https://github.com/lz4/lz4) | `compression/lz4/` | Yann Collet | BSD-2-Clause | [lz4.txt](licenses/lz4.txt) |
|
||||
| [HLS arbitrary-precision types](https://github.com/Xilinx/HLS_arbitrary_Precision_Types) | `fpga/include/` | Xilinx, Inc. | Apache-2.0 | [xilinx-hls-headers.txt](licenses/xilinx-hls-headers.txt) |
|
||||
| [GEMMI](https://github.com/project-gemmi/gemmi) | `gemmi_gph/` | Global Phasing Ltd. | MPL-2.0 | [gemmi.txt](licenses/gemmi.txt) |
|
||||
| [xbflash.qspi](https://github.com/Xilinx/XRT) | `tools/xbflash.qspi/` | Xilinx / AMD | Apache-2.0 | [xbflash-qspi.txt](licenses/xbflash-qspi.txt) |
|
||||
| [wingetopt](https://github.com/alex85k/wingetopt) | `tools/wingetopt/` | Todd C. Miller; The NetBSD Foundation | ISC AND BSD-2-Clause | [wingetopt.txt](licenses/wingetopt.txt) |
|
||||
|
||||
## Runtime libraries and SDKs (shipped in binaries, not in the source tree)
|
||||
|
||||
| Component | Used by | License | Notice |
|
||||
|---|---|---|---|
|
||||
| [Qt 6](https://www.qt.io/) | `jfjoch_viewer` | LGPL-3.0 | [notice](licenses/Qt6-NOTICE.txt), [LGPL-3.0](licenses/Qt6-LGPL-3.0.txt) |
|
||||
| [NVIDIA CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) (cudart, cuFFT) | CUDA builds | NVIDIA CUDA EULA | [notice](licenses/NVIDIA-CUDA-NOTICE.txt), [EULA](licenses/NVIDIA-CUDA-EULA.txt) |
|
||||
| [zlib](https://zlib.net/) | everywhere (compression) | Zlib | [zlib.txt](licenses/zlib.txt) |
|
||||
| [Eigen](https://gitlab.com/libeigen/eigen) | analysis libs, Ceres, ffbidx (header-only) | MPL-2.0 (+ BSD parts) | [eigen.txt](licenses/eigen.txt), [README](licenses/eigen-README.txt) |
|
||||
|
||||
## Frontend (npm) dependencies
|
||||
|
||||
The React/TypeScript frontend (`frontend/`) bundles a large transitive tree of npm packages,
|
||||
overwhelmingly MIT/ISC/BSD/Apache-2.0 licensed. Their full notices are generated automatically:
|
||||
|
||||
```
|
||||
cd frontend && npm run licenses # writes dist/THIRD_PARTY_LICENSES.txt
|
||||
```
|
||||
|
||||
The generated file is produced as part of the `frontend` build target and installed alongside the
|
||||
served frontend, so the shipped web UI carries its own attribution.
|
||||
|
||||
## Notes on weak-copyleft and attribution-sensitive components
|
||||
|
||||
* **MPL-2.0** (Eigen, GEMMI, libzmq): file-level copyleft. GEMMI is vendored in `gemmi_gph/` in
|
||||
trimmed form; libzmq is fetched at build time; Eigen is provided externally (header-only). The
|
||||
corresponding source is available from each project upstream.
|
||||
* **FFTW** is GPL-2.0-or-later — compatible with, and absorbed by, this project's GPL-3.0 license.
|
||||
* **Apache-2.0** components: where upstream ships a `NOTICE` file, it is reproduced in the
|
||||
corresponding `licenses/` text.
|
||||
* **Qt (LGPL-3.0)** and **NVIDIA CUDA (EULA)** carry redistribution conditions beyond a copyright
|
||||
notice; see their dedicated notice files. The verbatim LGPL-3.0 and CUDA EULA texts are bundled
|
||||
(`licenses/Qt6-LGPL-3.0.txt`, `licenses/NVIDIA-CUDA-EULA.txt`); the CUDA EULA is the one shipped
|
||||
with CUDA Toolkit 12.8 — replace it if you build against a different toolkit version.
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "../common/JFJochException.h"
|
||||
|
||||
AcquisitionCounters::AcquisitionCounters()
|
||||
: curr_frame_number(max_modules, 0), slowest_frame_number(0), fastest_frame_number(0),
|
||||
total_packets(0), expected_frames(0), acquisition_finished(false) {}
|
||||
: total_packets(0), slowest_frame_number(0), fastest_frame_number(0),
|
||||
curr_frame_number(max_modules, 0), acquisition_finished(false), expected_frames(0) {}
|
||||
|
||||
void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_t data_stream) {
|
||||
std::unique_lock ul(m);
|
||||
@@ -31,9 +31,7 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_
|
||||
curr_frame_number[i] = 0;
|
||||
|
||||
handle_for_frame = std::vector<uint64_t>(expected_frames * nmodules, HandleNotFound);
|
||||
handle_for_pedestal = std::vector<uint64_t>(nmodules * 16, HandleNotFound); // 16 = storage cells
|
||||
packets_collected = std::vector<uint16_t>(expected_frames * nmodules);
|
||||
saved_completions = std::vector<Completion>(expected_frames * nmodules);
|
||||
packets_per_module = std::vector<uint64_t>(nmodules);
|
||||
total_packets = 0;
|
||||
expected_packets_per_module = 512 * experiment.GetFPGASummation();
|
||||
@@ -56,32 +54,30 @@ void AcquisitionCounters::UpdateCounters(const Completion *c) {
|
||||
if (c->frame_number >= expected_frames)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"UpdateCounters frame number is out of bounds");
|
||||
else {
|
||||
if (curr_frame_number.at(c->module_number) < c->frame_number)
|
||||
curr_frame_number.at(c->module_number) = c->frame_number;
|
||||
|
||||
if (c->frame_number > slowest_frame_number) {
|
||||
slowest_frame_number = curr_frame_number[0];
|
||||
for (int i = 1; i < nmodules; i++)
|
||||
if (curr_frame_number[i] < slowest_frame_number)
|
||||
slowest_frame_number = curr_frame_number[i];
|
||||
}
|
||||
if (curr_frame_number.at(c->module_number) < c->frame_number)
|
||||
curr_frame_number.at(c->module_number) = c->frame_number;
|
||||
|
||||
if (c->frame_number > fastest_frame_number) {
|
||||
fastest_frame_number = c->frame_number;
|
||||
}
|
||||
|
||||
if (fastest_frame_number - slowest_frame_number > ThresholdFramesLost)
|
||||
slowest_frame_number = fastest_frame_number - ThresholdFramesLost;
|
||||
|
||||
packets_collected.at(c->frame_number * nmodules + c->module_number) = c->packet_count;
|
||||
handle_for_frame.at(c->frame_number * nmodules + c->module_number) = c->handle;
|
||||
saved_completions.at(c->frame_number * nmodules + c->module_number) = *c;
|
||||
|
||||
total_packets += c->packet_count;
|
||||
packets_per_module[c->module_number] += c->packet_count;
|
||||
if (c->frame_number > slowest_frame_number) {
|
||||
slowest_frame_number = curr_frame_number[0];
|
||||
for (int i = 1; i < nmodules; i++)
|
||||
if (curr_frame_number[i] < slowest_frame_number)
|
||||
slowest_frame_number = curr_frame_number[i];
|
||||
}
|
||||
|
||||
if (c->frame_number > fastest_frame_number) {
|
||||
fastest_frame_number = c->frame_number;
|
||||
}
|
||||
|
||||
if (fastest_frame_number - slowest_frame_number > ThresholdFramesLost)
|
||||
slowest_frame_number = fastest_frame_number - ThresholdFramesLost;
|
||||
|
||||
packets_collected.at(c->frame_number * nmodules + c->module_number) = c->packet_count;
|
||||
handle_for_frame.at(c->frame_number * nmodules + c->module_number) = c->handle;
|
||||
|
||||
total_packets += c->packet_count;
|
||||
packets_per_module[c->module_number] += c->packet_count;
|
||||
|
||||
data_updated.notify_all();
|
||||
}
|
||||
|
||||
@@ -92,6 +88,7 @@ void AcquisitionCounters::SetAcquisitionFinished() {
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetBufferHandle(size_t frame, uint16_t module_number) const {
|
||||
std::shared_lock sl(m);
|
||||
if (frame >= expected_frames)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"GetBufferHandle Wrong frame number: " + std::to_string(frame));
|
||||
@@ -116,60 +113,54 @@ uint64_t AcquisitionCounters::GetBufferHandleAndClear(size_t frame, uint16_t mod
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetPedestalBufferHandle(size_t storage_cell, uint16_t module_number) const {
|
||||
std::unique_lock ul(m);
|
||||
if (storage_cell >= 16)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"GetBufferHandleAndClear Wrong frame number: " + std::to_string(storage_cell));
|
||||
if (module_number >= nmodules)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"GetBufferHandleAndClear Wrong module number: " + std::to_string(module_number)
|
||||
+ " for SC " + std::to_string(storage_cell));
|
||||
return handle_for_pedestal.at(storage_cell * nmodules + module_number);
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetCurrFrameNumber(uint16_t module_number) const {
|
||||
if (module_number >= max_modules)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"GetCurrFrameNumber Wrong module number: " + std::to_string(module_number));
|
||||
std::shared_lock sl(m);
|
||||
return curr_frame_number[module_number];
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetSlowestFrameNumber() const {
|
||||
std::shared_lock sl(m);
|
||||
return slowest_frame_number;
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetFastestFrameNumber() const {
|
||||
std::shared_lock sl(m);
|
||||
return fastest_frame_number;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
curr_frame = 1; // Cannot wait for frame 0, as this is initial value
|
||||
|
||||
std::shared_lock sl(m);
|
||||
data_updated.wait(sl, [&] {
|
||||
const uint64_t head = (module_number == UINT16_MAX)
|
||||
? slowest_frame_number
|
||||
: curr_frame_number.at(module_number);
|
||||
return acquisition_finished || (head >= curr_frame);
|
||||
});
|
||||
}
|
||||
|
||||
int64_t AcquisitionCounters::CalculateDelay(size_t curr_frame, uint16_t module_number) const {
|
||||
uint64_t slowest_head_tmp;
|
||||
|
||||
if (module_number == UINT16_MAX)
|
||||
slowest_head_tmp = GetSlowestFrameNumber();
|
||||
else
|
||||
slowest_head_tmp = GetCurrFrameNumber(module_number);
|
||||
if (slowest_head_tmp < curr_frame)
|
||||
std::shared_lock sl(m);
|
||||
const uint64_t head = (module_number == UINT16_MAX)
|
||||
? slowest_frame_number
|
||||
: curr_frame_number.at(module_number);
|
||||
if (head < curr_frame)
|
||||
return 0;
|
||||
return slowest_head_tmp - curr_frame;
|
||||
return static_cast<int64_t>(head - curr_frame);
|
||||
}
|
||||
|
||||
bool AcquisitionCounters::IsAcquisitionFinished() const {
|
||||
std::shared_lock sl(m);
|
||||
return acquisition_finished;
|
||||
}
|
||||
|
||||
bool AcquisitionCounters::IsFullModuleCollected(size_t frame, uint16_t module_number) const {
|
||||
std::shared_lock sl(m);
|
||||
if (frame >= expected_frames)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"IsFullModuleCollected Wrong frame number: " + std::to_string(frame));
|
||||
@@ -183,6 +174,7 @@ bool AcquisitionCounters::IsFullModuleCollected(size_t frame, uint16_t module_nu
|
||||
}
|
||||
|
||||
bool AcquisitionCounters::IsAnyPacketCollected(size_t frame, uint16_t module_number) const {
|
||||
std::shared_lock sl(m);
|
||||
if (frame >= expected_frames)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"IsFullModuleCollected Wrong frame number: " + std::to_string(frame));
|
||||
@@ -196,11 +188,12 @@ bool AcquisitionCounters::IsAnyPacketCollected(size_t frame, uint16_t module_num
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetTotalPackets() const {
|
||||
std::shared_lock sl(m);
|
||||
return total_packets;
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetTotalPackets(uint16_t module_number) const {
|
||||
std::unique_lock ul(m);
|
||||
std::shared_lock sl(m);
|
||||
|
||||
if (module_number >= nmodules)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
@@ -218,13 +211,16 @@ uint64_t AcquisitionCounters::GetTotalExpectedPackets() const {
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetTotalExpectedPacketsPerModule() const {
|
||||
std::shared_lock sl(m);
|
||||
return expected_frames * expected_packets_per_module;
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetModuleNumber() const {
|
||||
std::shared_lock sl(m);
|
||||
return nmodules;
|
||||
}
|
||||
|
||||
uint64_t AcquisitionCounters::GetBytesReceived() const {
|
||||
return GetTotalPackets() * bytes_per_packet;
|
||||
std::shared_lock sl(m);
|
||||
return total_packets * bytes_per_packet;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_ACQUISITIONCOUNTERS_H
|
||||
#define JUNGFRAUJOCH_ACQUISITIONCOUNTERS_H
|
||||
#pragma once
|
||||
|
||||
#include <condition_variable>
|
||||
#include <shared_mutex>
|
||||
@@ -16,17 +15,14 @@
|
||||
// so uses mutex to ensure consistency
|
||||
|
||||
class AcquisitionCounters {
|
||||
uint16_t expected_packets_per_module;
|
||||
uint32_t expected_packets_per_module;
|
||||
constexpr static const uint64_t max_modules = 32;
|
||||
mutable std::shared_mutex m;
|
||||
mutable std::condition_variable_any data_updated;
|
||||
|
||||
std::vector<uint64_t> handle_for_frame;
|
||||
std::vector<uint64_t> handle_for_pedestal;
|
||||
std::vector<uint16_t> packets_collected;
|
||||
|
||||
std::vector<Completion> saved_completions;
|
||||
|
||||
uint64_t total_packets;
|
||||
std::vector<uint64_t> packets_per_module;
|
||||
|
||||
@@ -56,7 +52,6 @@ public:
|
||||
void WaitForFrame(size_t curr_frame, uint16_t module_number = UINT16_MAX) const;
|
||||
int64_t CalculateDelay(size_t curr_frame, uint16_t module_number = UINT16_MAX) const; // mutex acquired indirectly
|
||||
uint64_t GetBufferHandle(size_t frame, uint16_t module_number) const;
|
||||
uint64_t GetPedestalBufferHandle(size_t storage_cell, uint16_t module_number) const;
|
||||
bool IsFullModuleCollected(size_t frame, uint16_t module_number) const;
|
||||
bool IsAnyPacketCollected(size_t frame, uint16_t module_number) const;
|
||||
bool IsAcquisitionFinished() const;
|
||||
@@ -71,6 +66,3 @@ public:
|
||||
|
||||
uint64_t GetModuleNumber() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_ACQUISITIONCOUNTERS_H
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifdef JFJOCH_USE_NUMA
|
||||
#include <numaif.h>
|
||||
#endif
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <thread>
|
||||
#include <fstream>
|
||||
#include <cmath>
|
||||
@@ -14,24 +9,6 @@
|
||||
#include "AcquisitionDevice.h"
|
||||
#include "../common/NetworkAddressConvert.h"
|
||||
|
||||
void *mmap_acquisition_buffer(size_t size, int16_t numa_node) {
|
||||
void *ret = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (ret == MAP_FAILED) {
|
||||
throw JFJochException(JFJochExceptionCategory::MemAllocFailed, "frame_buffer");
|
||||
}
|
||||
#ifdef JFJOCH_USE_NUMA
|
||||
if (numa_node >= 0) {
|
||||
unsigned long nodemask = 1L << numa_node;;
|
||||
if (numa_node > sizeof(nodemask)*8)
|
||||
throw JFJochException(JFJochExceptionCategory::MemAllocFailed, "Mask too small for NUMA node");
|
||||
if (mbind(ret, size, MPOL_BIND, &nodemask, sizeof(nodemask)*8, MPOL_MF_STRICT) == -1)
|
||||
throw JFJochException(JFJochExceptionCategory::MemAllocFailed, "Cannot apply NUMA policy");
|
||||
}
|
||||
#endif
|
||||
memset(ret, 0, size);
|
||||
return ret;
|
||||
}
|
||||
|
||||
AcquisitionDevice::AcquisitionDevice(uint16_t in_data_stream) {
|
||||
logger = nullptr;
|
||||
data_stream = in_data_stream;
|
||||
@@ -81,44 +58,47 @@ void AcquisitionDevice::WaitForActionComplete() {
|
||||
while (c.type != Completion::Type::End) {
|
||||
DeviceOutput* output;
|
||||
|
||||
bool skip_analysis = false;
|
||||
|
||||
try {
|
||||
output = GetDeviceOutput(c.handle);
|
||||
} catch (const JFJochException &e) {
|
||||
if (logger)
|
||||
logger->ErrorException(e);
|
||||
continue;
|
||||
skip_analysis = true;
|
||||
}
|
||||
|
||||
c.module_number = output->module_statistics.module_number;
|
||||
c.packet_count = output->module_statistics.packet_count;
|
||||
c.frame_number = output->module_statistics.frame_number;
|
||||
if (!skip_analysis) {
|
||||
c.module_number = output->module_statistics.module_number;
|
||||
c.packet_count = output->module_statistics.packet_count;
|
||||
c.frame_number = output->module_statistics.frame_number;
|
||||
|
||||
if (c.frame_number >= expected_frames) {
|
||||
Cancel();
|
||||
// this frame is not of any interest, therefore its location can be immediately released
|
||||
SendWorkRequest(c.handle);
|
||||
} else if (c.module_number >= max_modules) {
|
||||
// Module number out of bounds, don't process
|
||||
if (logger != nullptr)
|
||||
logger->Error("Completion with wrong module number data stream {} completion frame number {} module {} handle {}",
|
||||
data_stream, c.frame_number, c.module_number, c.handle);
|
||||
SendWorkRequest(c.handle);
|
||||
} else if (c.frame_number < counters.GetSlowestFrameNumber()) {
|
||||
// Module is falling behind, needs to return the handle then
|
||||
SendWorkRequest(c.handle);
|
||||
} else {
|
||||
try {
|
||||
counters.UpdateCounters(&c);
|
||||
} catch (const JFJochException &e) {
|
||||
if (logger)
|
||||
logger->ErrorException(e);
|
||||
if (c.frame_number >= expected_frames) {
|
||||
Cancel();
|
||||
// this frame is not of any interest, therefore its location can be immediately released
|
||||
SendWorkRequest(c.handle);
|
||||
} else if (c.module_number >= max_modules) {
|
||||
// Module number out of bounds, don't process
|
||||
if (logger != nullptr)
|
||||
logger->Error("Completion with wrong module number data stream {} completion frame number {} module {} handle {}",
|
||||
data_stream, c.frame_number, c.module_number, c.handle);
|
||||
SendWorkRequest(c.handle);
|
||||
} else if (c.frame_number < counters.GetSlowestFrameNumber()) {
|
||||
// Module is falling behind, needs to return the handle then
|
||||
SendWorkRequest(c.handle);
|
||||
} else {
|
||||
try {
|
||||
counters.UpdateCounters(&c);
|
||||
} catch (const JFJochException &e) {
|
||||
if (logger)
|
||||
logger->ErrorException(e);
|
||||
SendWorkRequest(c.handle);
|
||||
}
|
||||
}
|
||||
if (logger != nullptr)
|
||||
logger->Debug("Data stream {} completion frame number {} module {} handle {}",
|
||||
data_stream, c.frame_number, c.module_number, c.handle);
|
||||
}
|
||||
if (logger != nullptr)
|
||||
logger->Debug("Data stream {} completion frame number {} module {} handle {}",
|
||||
data_stream, c.frame_number, c.module_number, c.handle);
|
||||
|
||||
c = work_completion_queue.GetBlocking();
|
||||
}
|
||||
counters.SetAcquisitionFinished();
|
||||
@@ -197,27 +177,35 @@ void AcquisitionDevice::InitializeEmptyPixelMask(const DiffractionExperiment &ex
|
||||
|
||||
|
||||
void AcquisitionDevice::InitializeDataProcessing(const DiffractionExperiment &experiment,
|
||||
const AzimuthalIntegration &azint) {
|
||||
const AzimuthalIntegrationMapping &azint) {
|
||||
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
|
||||
size_t modules = experiment.GetModulesNum(data_stream);
|
||||
|
||||
// When azimuthal integration is forced onto the CPU, the FPGA must not bin pixels
|
||||
// (the integration map can address more bins than the FPGA supports); the CPU path
|
||||
// computes the profile from the assembled image instead.
|
||||
const bool load_integration_map = !experiment.GetAzimuthalIntegrationSettings().IsForceCPUinFPGAWorkflow();
|
||||
|
||||
if (experiment.IsGeometryTransformed()) {
|
||||
std::vector<float> tmp1(RAW_MODULE_SIZE);
|
||||
std::vector<uint16_t> tmp2(RAW_MODULE_SIZE);
|
||||
|
||||
for (int m = 0; m < modules; m++) {
|
||||
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Corrections().data());
|
||||
ConvertedToRawGeometry(experiment, offset + m, tmp2.data(), azint.GetPixelToBin().data());
|
||||
InitializeIntegrationMap(tmp2.data(), tmp1.data(), m);
|
||||
if (load_integration_map) {
|
||||
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Corrections().data());
|
||||
ConvertedToRawGeometry(experiment, offset + m, tmp2.data(), azint.GetPixelToBin().data());
|
||||
InitializeIntegrationMap(tmp2.data(), tmp1.data(), m);
|
||||
}
|
||||
|
||||
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Resolution().data());
|
||||
InitializeSpotFinderResolutionMap(tmp1.data(), m);
|
||||
}
|
||||
} else {
|
||||
for (int m = 0; m < modules; m++) {
|
||||
InitializeIntegrationMap(azint.GetPixelToBin().data() + (offset + m) * RAW_MODULE_SIZE,
|
||||
azint.Corrections().data() + (offset + m) * RAW_MODULE_SIZE,
|
||||
m);
|
||||
if (load_integration_map)
|
||||
InitializeIntegrationMap(azint.GetPixelToBin().data() + (offset + m) * RAW_MODULE_SIZE,
|
||||
azint.Corrections().data() + (offset + m) * RAW_MODULE_SIZE,
|
||||
m);
|
||||
InitializeSpotFinderResolutionMap(azint.Resolution().data() + (m + offset) * RAW_MODULE_SIZE,
|
||||
m);
|
||||
}
|
||||
@@ -235,21 +223,6 @@ void AcquisitionDevice::InitializePixelMask(const DiffractionExperiment &experim
|
||||
}
|
||||
}
|
||||
|
||||
void AcquisitionDevice::MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node) {
|
||||
try {
|
||||
for (int i = 0; i < c2h_buffer_count; i++)
|
||||
buffer_device.emplace_back((DeviceOutput *) mmap_acquisition_buffer(FPGA_BUFFER_LOCATION_SIZE, numa_node));
|
||||
} catch (const JFJochException &e) {
|
||||
UnmapBuffers();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void AcquisitionDevice::UnmapBuffers() {
|
||||
for (auto &i: buffer_device)
|
||||
if (i != nullptr) munmap(i, FPGA_BUFFER_LOCATION_SIZE);
|
||||
}
|
||||
|
||||
void AcquisitionDevice::FrameBufferRelease(size_t frame_number, uint16_t module_number) {
|
||||
auto handle = counters.GetBufferHandleAndClear(frame_number, module_number);
|
||||
if (handle != AcquisitionCounters::HandleNotFound)
|
||||
@@ -291,8 +264,8 @@ DeviceStatus AcquisitionDevice::GetDeviceStatus() const {
|
||||
AcquisitionDeviceStatistics AcquisitionDevice::GetStatistics() const {
|
||||
AcquisitionDeviceStatistics ret{};
|
||||
ret.bytes_received = GetBytesReceived();
|
||||
ret.start_timestamp = start_time.time_since_epoch().count();
|
||||
ret.end_timestamp = end_time.time_since_epoch().count();
|
||||
ret.start_timestamp = std::chrono::system_clock::to_time_t(start_time);
|
||||
ret.end_timestamp = std::chrono::system_clock::to_time_t(end_time);
|
||||
ret.packets_expected = counters.GetTotalExpectedPackets();
|
||||
ret.good_packets = counters.GetTotalPackets();
|
||||
|
||||
@@ -323,6 +296,7 @@ void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experi
|
||||
FrameGeneratorConfig config{};
|
||||
config.frames = experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1;
|
||||
config.modules = experiment.GetModulesNum(data_stream);
|
||||
config.data_stream = data_stream;
|
||||
config.pulse_id = INT_PKT_GEN_BUNCHID;
|
||||
config.exptime = INT_PKT_GEN_EXPTTIME;
|
||||
config.debug = INT_PKT_GEN_DEBUG;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_ACQUISITIONDEVICE_H
|
||||
#define JUNGFRAUJOCH_ACQUISITIONDEVICE_H
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
@@ -21,7 +20,7 @@
|
||||
#include "Completion.h"
|
||||
#include "../fpga/pcie_driver/jfjoch_fpga.h"
|
||||
#include "../common/NetworkAddressConvert.h"
|
||||
#include "../common/AzimuthalIntegration.h"
|
||||
#include "../common/AzimuthalIntegrationMapping.h"
|
||||
|
||||
struct AcquisitionDeviceStatistics {
|
||||
uint64_t good_packets;
|
||||
@@ -50,6 +49,9 @@ protected:
|
||||
ThreadSafeFIFO<Completion> work_completion_queue;
|
||||
ThreadSafeFIFO<WorkRequest> work_request_queue;
|
||||
|
||||
// Non-owning view of the per-buffer addresses. Each device subclass owns the backing memory
|
||||
// and its lifecycle: PCIExpressDevice mmap's/munmap's kernel DMA buffers, HLSSimulatedDevice
|
||||
// points these at plain heap buffers it owns.
|
||||
std::vector<DeviceOutput *> buffer_device;
|
||||
Logger *logger;
|
||||
|
||||
@@ -59,8 +61,6 @@ protected:
|
||||
uint32_t ipv4_addr;
|
||||
explicit AcquisitionDevice(uint16_t data_stream);
|
||||
|
||||
void UnmapBuffers();
|
||||
void MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node);
|
||||
const DeviceOutput *GetDeviceOutput(size_t handle) const;
|
||||
DeviceOutput *GetDeviceOutput(size_t handle);
|
||||
virtual void HW_RunInternalGenerator(const FrameGeneratorConfig& config) = 0;
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
static constexpr const uint64_t HandleNotValid = UINT64_MAX;
|
||||
|
||||
virtual ~AcquisitionDevice() { UnmapBuffers(); };
|
||||
virtual ~AcquisitionDevice() = default;
|
||||
|
||||
void StartAction(const DiffractionExperiment &experiment, uint32_t optional_flags = 0);
|
||||
void PrepareAction(const DiffractionExperiment &experiment);
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
void InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask_raw);
|
||||
virtual void InitializePixelMask(const uint32_t *module_mask, size_t module_number);
|
||||
void InitializeROIMap(const DiffractionExperiment& experiment, const std::vector<uint16_t>& raw_roi_map);
|
||||
void InitializeDataProcessing(const DiffractionExperiment &experiment, const AzimuthalIntegration& azint);
|
||||
void InitializeDataProcessing(const DiffractionExperiment &experiment, const AzimuthalIntegrationMapping& azint);
|
||||
|
||||
const AcquisitionCounters& Counters() const;
|
||||
|
||||
@@ -119,5 +119,3 @@ public:
|
||||
void RunInternalGenerator(const DiffractionExperiment& experiment);
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_ACQUISITIONDEVICE_H
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_ACQUISITIONDEVICEGROUP_H
|
||||
#define JUNGFRAUJOCH_ACQUISITIONDEVICEGROUP_H
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "AcquisitionDevice.h"
|
||||
@@ -20,5 +19,3 @@ public:
|
||||
std::vector<DeviceStatus> GetDeviceStatus() const;
|
||||
void EnableLogging(Logger *logger);
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_ACQUISITIONDEVICEGROUP_H
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_COMPLETION_H
|
||||
#define JUNGFRAUJOCH_COMPLETION_H
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -21,5 +20,3 @@ struct Completion {
|
||||
};
|
||||
|
||||
Completion parse_hw_completion(uint32_t hw_input);
|
||||
|
||||
#endif //JUNGFRAUJOCH_COMPLETION_H
|
||||
|
||||
@@ -123,7 +123,7 @@ void FPGAAcquisitionDevice::InitializeIntegrationMap(const uint16_t *map, const
|
||||
}
|
||||
|
||||
void FPGAAcquisitionDevice::SetInternalGeneratorFrame(const uint16_t *input, size_t module_number) {
|
||||
memcpy(buffer_device[0], input, RAW_MODULE_SIZE * sizeof(uint16_t));
|
||||
memcpy(buffer_device[0]->pixels, input, RAW_MODULE_SIZE * sizeof(uint16_t));
|
||||
buffer_device[0]->module_statistics.module_number = module_number;
|
||||
buffer_device[0]->module_statistics.load_calibration_destination = LOAD_CALIBRATION_DEST_FRAME_GEN;
|
||||
LoadCalibration(0);
|
||||
@@ -225,6 +225,7 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
|
||||
job.nstorage_cells = x.GetStorageCellNumber() - 1;
|
||||
job.mode = data_collection_id << 16;
|
||||
job.nsummation = x.GetFPGASummation() - 1;
|
||||
job.data_stream = data_stream;
|
||||
|
||||
expected_descriptors_per_module = DMA_DESCRIPTORS_PER_MODULE;
|
||||
|
||||
@@ -255,10 +256,15 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
|
||||
job.sqrtmult = x.GetLossyCompressionPoisson().value();
|
||||
}
|
||||
|
||||
if (x.GetPixelValueLowThreshold()) {
|
||||
job.mode |= MODE_THRESHOLD;
|
||||
job.pxlthreshold = x.GetPixelValueLowThreshold().value();
|
||||
}
|
||||
if (x.GetPixelValueLowThreshold())
|
||||
job.pxlthreshold_min = x.GetPixelValueLowThreshold().value();
|
||||
else
|
||||
job.pxlthreshold_min = INT32_MIN;
|
||||
|
||||
if (x.GetPixelValueHighThreshold())
|
||||
job.pxlthreshold_max = x.GetPixelValueHighThreshold().value();
|
||||
else
|
||||
job.pxlthreshold_max = INT32_MIN;
|
||||
}
|
||||
|
||||
void FPGAAcquisitionDevice::Start(const DiffractionExperiment &experiment, uint32_t flag) {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_FPGAACQUISITIONDEVICE_H
|
||||
#define JUNGFRAUJOCH_FPGAACQUISITIONDEVICE_H
|
||||
#pragma once
|
||||
|
||||
#include "AcquisitionDevice.h"
|
||||
#include "../fpga/pcie_driver/jfjoch_fpga.h"
|
||||
@@ -26,7 +25,7 @@ class FPGAAcquisitionDevice : public AcquisitionDevice {
|
||||
void ReadWorkCompletionThread();
|
||||
|
||||
std::future<void> send_work_request_future;
|
||||
volatile bool stop_work_requests = false;
|
||||
std::atomic<bool> stop_work_requests = false;
|
||||
void SendWorkRequestThread();
|
||||
|
||||
virtual void HW_LoadCalibration(const LoadCalibrationConfig &config) = 0;
|
||||
@@ -49,5 +48,3 @@ public:
|
||||
void SetInternalGeneratorFrame(const uint16_t *input, size_t module_number) override;
|
||||
uint32_t GetExpectedDescriptorsPerModule() const override;
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_FPGAACQUISITIONDEVICE_H
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
|
||||
#include "HLSSimulatedDevice.h"
|
||||
|
||||
HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node)
|
||||
HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules)
|
||||
: FPGAAcquisitionDevice(data_stream) {
|
||||
mac_addr = 0xCCAA11223344;
|
||||
ipv4_addr = 0x0132010A;
|
||||
|
||||
max_modules = MAX_MODULES_FPGA;
|
||||
|
||||
if (data_stream != 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"HLS simulation can only work with 1 data_stream, due to use of static variables");
|
||||
MapBuffersStandard(in_frame_buffer_size_modules, numa_node);
|
||||
|
||||
buffers.reserve(in_frame_buffer_size_modules);
|
||||
for (size_t i = 0; i < in_frame_buffer_size_modules; i++) {
|
||||
buffers.push_back(std::make_unique<FrameBuffer>()); // zero-initialised, 64-byte aligned
|
||||
buffer_device.push_back(reinterpret_cast<DeviceOutput *>(buffers.back().get()));
|
||||
}
|
||||
|
||||
device = std::make_unique<HLSDevice>(buffer_device);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_HLSSIMULATEDDEVICE_H
|
||||
#define JUNGFRAUJOCH_HLSSIMULATEDDEVICE_H
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
|
||||
@@ -12,6 +11,13 @@
|
||||
#include "FPGAAcquisitionDevice.h"
|
||||
|
||||
class HLSSimulatedDevice : public FPGAAcquisitionDevice {
|
||||
// Owns the simulated frame buffers. Plain heap (this path is not performance-critical, so no
|
||||
// NUMA placement and no mmap), but page-aligned (4 KiB) to match the real device's kernel DMA
|
||||
// buffers - more than enough for the data path's alignment needs (AXI datamover 64 B,
|
||||
// FPGAIntegrationTest 128 B). Declared before `device` so the buffers outlive the HLSDevice
|
||||
// action thread that writes into them; buffer_device points into these.
|
||||
struct alignas(4096) FrameBuffer { uint8_t data[FPGA_BUFFER_LOCATION_SIZE]; };
|
||||
std::vector<std::unique_ptr<FrameBuffer>> buffers;
|
||||
std::unique_ptr<HLSDevice> device;
|
||||
|
||||
void HW_ReadActionRegister(DataCollectionConfig *job) override;
|
||||
@@ -26,7 +32,7 @@ class HLSSimulatedDevice : public FPGAAcquisitionDevice {
|
||||
void HW_SetSpotFinderParameters(const SpotFinderParameters ¶ms) 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);
|
||||
HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules);
|
||||
~HLSSimulatedDevice() override = default;
|
||||
void CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet,
|
||||
uint32_t module_number, const uint16_t *data, int8_t adjust_axis = 0, uint8_t user = 0);
|
||||
@@ -41,6 +47,3 @@ public:
|
||||
void Cancel() override;
|
||||
DeviceStatus GetDeviceStatus() const override;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_HLSSIMULATEDDEVICE_H
|
||||
|
||||
@@ -33,6 +33,15 @@ PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, const std::string &devi
|
||||
}
|
||||
}
|
||||
|
||||
PCIExpressDevice::~PCIExpressDevice() {
|
||||
UnmapBuffers();
|
||||
}
|
||||
|
||||
void PCIExpressDevice::UnmapBuffers() {
|
||||
for (auto &buf: buffer_device)
|
||||
if (buf != nullptr) dev.UnmapKernelBuffer(buf);
|
||||
}
|
||||
|
||||
bool PCIExpressDevice::HW_ReadMailbox(uint32_t *values) {
|
||||
PCI_EXCEPT(return dev.ReadWorkCompletion(values);)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|
||||
#define JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|
||||
#pragma once
|
||||
|
||||
#include "FPGAAcquisitionDevice.h"
|
||||
#include "../fpga/host_library/JungfraujochDevice.h"
|
||||
@@ -21,10 +20,12 @@ class PCIExpressDevice : public FPGAAcquisitionDevice {
|
||||
void FPGA_EndAction() override;
|
||||
uint32_t GetNumKernelBuffers() const;
|
||||
void HW_RunInternalGenerator(const FrameGeneratorConfig &config) override;
|
||||
void UnmapBuffers();
|
||||
public:
|
||||
explicit PCIExpressDevice(uint16_t data_stream);
|
||||
PCIExpressDevice(uint16_t data_stream, uint16_t pci_slot);
|
||||
PCIExpressDevice(uint16_t data_stream, const std::string &device_name);
|
||||
~PCIExpressDevice() override;
|
||||
|
||||
void Cancel() override;
|
||||
int32_t GetNUMANode() const override;
|
||||
@@ -36,5 +37,3 @@ public:
|
||||
DeviceStatus GetDeviceStatus() const override;
|
||||
DataCollectionStatus GetDataCollectionStatus() const override;
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_PCIEXPRESSDEVICE_H
|
||||
|
||||
+25
-21
@@ -1,22 +1,26 @@
|
||||
AUX_SOURCE_DIRECTORY(gen/model MODEL_SOURCES)
|
||||
|
||||
ADD_LIBRARY(JFJochAPI STATIC ${MODEL_SOURCES} gen/api/DefaultApi.cpp gen/api/DefaultApi.h)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochAPI pistache_static)
|
||||
TARGET_INCLUDE_DIRECTORIES(JFJochAPI PUBLIC gen/model gen/api)
|
||||
|
||||
ADD_LIBRARY(JFJochBroker STATIC
|
||||
JFJochStateMachine.cpp JFJochStateMachine.h
|
||||
JFJochServices.cpp JFJochServices.h
|
||||
JFJochBrokerHttp.cpp JFJochBrokerHttp.h JFJochBrokerParser.cpp JFJochBrokerParser.h
|
||||
OpenAPIConvert.h
|
||||
OpenAPIConvert.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochBroker JFJochReceiver JFJochDetector JFJochCommon JFJochAPI JFJochPreview)
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_broker jfjoch_broker.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_broker JFJochBroker)
|
||||
|
||||
INSTALL(TARGETS jfjoch_broker RUNTIME COMPONENT jfjoch)
|
||||
|
||||
# OpenAPI definition
|
||||
INSTALL(FILES redoc-static.html DESTINATION jfjoch/frontend COMPONENT jfjoch )
|
||||
|
||||
# OpenAPI model
|
||||
AUX_SOURCE_DIRECTORY(gen/model MODEL_SOURCES)
|
||||
ADD_LIBRARY(JFJochAPI STATIC ${MODEL_SOURCES})
|
||||
TARGET_INCLUDE_DIRECTORIES(JFJochAPI PUBLIC gen/model)
|
||||
|
||||
# The broker service pulls in the receiver/detector stack. A viewer-only build
|
||||
# needs JFJochAPI (the shared OpenAPI model, above) but none of this machinery.
|
||||
IF (NOT JFJOCH_VIEWER_ONLY)
|
||||
# Jungfraujoch Broker (abstract from HTTP service)
|
||||
ADD_LIBRARY(JFJochBroker STATIC
|
||||
JFJochStateMachine.cpp JFJochStateMachine.h
|
||||
JFJochServices.cpp JFJochServices.h
|
||||
JFJochBrokerParser.cpp JFJochBrokerParser.h
|
||||
OpenAPIConvert.h OpenAPIConvert.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochBroker JFJochReceiver JFJochDetector JFJochCommon JFJochAPI JFJochPreview)
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_broker jfjoch_broker.cpp JFJochBrokerHttp.cpp JFJochBrokerHttp.h)
|
||||
|
||||
TARGET_LINK_LIBRARIES(jfjoch_broker JFJochBroker httplib::httplib ${CMAKE_DL_LIBS})
|
||||
TARGET_INCLUDE_DIRECTORIES(jfjoch_broker PUBLIC gen/api)
|
||||
INSTALL(TARGETS jfjoch_broker RUNTIME COMPONENT jfjoch)
|
||||
ENDIF()
|
||||
|
||||
+686
-364
File diff suppressed because it is too large
Load Diff
+163
-169
@@ -1,203 +1,197 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Using OpenAPI licensed with Apache License 2.0
|
||||
#pragma once
|
||||
|
||||
#ifndef JUNGFRAUJOCH_JFJOCHBROKERHTTP_H
|
||||
#define JUNGFRAUJOCH_JFJOCHBROKERHTTP_H
|
||||
#include <httplib.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <pistache/endpoint.h>
|
||||
#include <pistache/router.h>
|
||||
#include <pistache/client.h>
|
||||
#include <pistache/http.h>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "../common/Logger.h"
|
||||
#include "JFJochServices.h"
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "gen/api/DefaultApi.h"
|
||||
#include "OpenAPIConvert.h"
|
||||
|
||||
#include "gen/model/Azim_int_settings.h"
|
||||
#include "gen/model/Broker_status.h"
|
||||
#include "gen/model/Dark_mask_settings.h"
|
||||
#include "gen/model/Dataset_settings.h"
|
||||
#include "gen/model/Detector_selection.h"
|
||||
#include "gen/model/Detector_settings.h"
|
||||
#include "gen/model/Detector_status.h"
|
||||
#include "gen/model/Error_message.h"
|
||||
#include "gen/model/File_writer_settings.h"
|
||||
#include "gen/model/Image_buffer_status.h"
|
||||
#include "gen/model/Image_format_settings.h"
|
||||
#include "gen/model/Image_pusher_status.h"
|
||||
#include "gen/model/Indexing_settings.h"
|
||||
#include "gen/model/Instrument_metadata.h"
|
||||
#include "gen/model/Jfjoch_statistics.h"
|
||||
#include "gen/model/Plots.h"
|
||||
#include "gen/model/Roi_definitions.h"
|
||||
#include "gen/model/Scan_result.h"
|
||||
#include "gen/model/Spot_finding_settings.h"
|
||||
#include "gen/model/Zeromq_metadata_settings.h"
|
||||
#include "gen/model/Zeromq_preview_settings.h"
|
||||
|
||||
class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
class JFJochBrokerHttp {
|
||||
Logger logger{"JFJochBroker"};
|
||||
JFJochServices services {logger};
|
||||
|
||||
void config_image_format_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void fpga_status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
JFJochServices services{logger};
|
||||
JFJochStateMachine state_machine;
|
||||
std::string frontend_directory;
|
||||
|
||||
void config_detector_get(Pistache::Http::ResponseWriter &response) override;
|
||||
static void send_plain(httplib::Response &res, int code, const std::string &body) {
|
||||
res.status = code;
|
||||
res.set_content(body, "text/plain");
|
||||
}
|
||||
|
||||
void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_azim_int_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &radIntSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_select_detector_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_select_detector_put(const org::openapitools::server::model::Detector_selection &detectorSelection,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void detector_status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_spot_finding_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void cancel_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void deactivate_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void initialize_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void wait_till_done_post(const std::optional<int32_t> &timeoutMs, Pistache::Http::ResponseWriter &response) override;
|
||||
void trigger_post(Pistache::Http::ResponseWriter &response) override;
|
||||
void pedestal_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel,
|
||||
const std::optional<int32_t> &sc,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_roi_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_internal_generator_image_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void xfel_event_code_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void xfel_pulse_id_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_instrument_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void GetStaticFile(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception &ex) const noexcept override;
|
||||
|
||||
template <class T>
|
||||
void ProcessOutput(const T& output, Pistache::Http::ResponseWriter &response, bool compression = false) {
|
||||
template<class T>
|
||||
void ProcessOutput(const T &output, httplib::Response &response) {
|
||||
std::stringstream s;
|
||||
if(!output.validate(s)) {
|
||||
if (!output.validate(s)) {
|
||||
logger.Error(s.str());
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, s.str(), MIME(Text, Plain));
|
||||
response.status = 500;
|
||||
response.set_content(s.str(), "text/plain");
|
||||
return;
|
||||
}
|
||||
|
||||
nlohmann::json j = output;
|
||||
if (compression)
|
||||
response.setCompression(Pistache::Http::Header::Encoding::Deflate);
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
response.status = 200;
|
||||
response.set_content(j.dump(), "application/json");
|
||||
}
|
||||
|
||||
void version_get(Pistache::Http::ResponseWriter &response) override;
|
||||
std::pair<int, std::string> handleParsingException(const std::exception &ex) const noexcept;
|
||||
std::pair<int, std::string> handleOperationException(const std::exception &ex) const noexcept;
|
||||
|
||||
void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) override;
|
||||
void register_routes(httplib::Server &server);
|
||||
|
||||
void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) override;
|
||||
void cancel_post(httplib::Response &response);
|
||||
void deactivate_post(httplib::Response &response);
|
||||
void initialize_post(httplib::Response &response);
|
||||
|
||||
void statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) override;
|
||||
void start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings,
|
||||
httplib::Response &response);
|
||||
void status_get(httplib::Response &response);
|
||||
void wait_till_done_post(const std::optional<int32_t> &timeout, httplib::Response &response);
|
||||
void wait_until_running_post(const std::optional<int32_t> &timeout, httplib::Response &response);
|
||||
|
||||
void config_zeromq_preview_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void trigger_post(httplib::Response &response);
|
||||
void pedestal_post(httplib::Response &response);
|
||||
|
||||
void
|
||||
config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
void config_detector_get(httplib::Response &response);
|
||||
void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void config_azim_int_get(httplib::Response &response);
|
||||
void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &azimIntSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_zeromq_metadata_put(
|
||||
const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
void config_select_detector_get(httplib::Response &response);
|
||||
void config_select_detector_put(const org::openapitools::server::model::Detector_selection &detectorSelection,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_mask_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void config_spot_finding_get(httplib::Response &response);
|
||||
void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_user_mask_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_image_cbor_get(const std::optional<int64_t> &id,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
void image_buffer_image_jpeg_get(const std::optional<int64_t> &id,
|
||||
const std::optional<bool> &showUserMask,
|
||||
const std::optional<bool> &showRoi,
|
||||
const std::optional<bool> &showSpots,
|
||||
const std::optional<bool> &showBeamCenter,
|
||||
const std::optional<float> &saturation,
|
||||
const std::optional<int64_t> &jpegQuality,
|
||||
const std::optional<float> &showResRing,
|
||||
const std::optional<std::string> &color,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
void image_buffer_image_png_get(const std::optional<int64_t> &id,
|
||||
const std::optional<bool> &showUserMask,
|
||||
const std::optional<bool> &showRoi,
|
||||
const std::optional<bool> &showSpots,
|
||||
const std::optional<bool> &showBeamCenter,
|
||||
const std::optional<float> &saturation,
|
||||
const std::optional<int64_t> &jpegQuality,
|
||||
const std::optional<float> &showResRing,
|
||||
const std::optional<std::string> &color,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
|
||||
const std::optional<bool> &compression, const std::optional<bool> &experimentalCoord,
|
||||
const std::optional<std::string> &azintUnit, Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_indexing_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void result_scan_get(Pistache::Http::ResponseWriter &response) override;
|
||||
public:
|
||||
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
|
||||
void AddDetectorSetup(const DetectorSetup &setup);
|
||||
JFJochServices& Services();
|
||||
|
||||
JFJochBrokerHttp& FrontendDirectory(const std::string &directory);
|
||||
|
||||
~JFJochBrokerHttp() override = default;
|
||||
|
||||
private:
|
||||
void config_file_writer_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void statistics_calibration_get(httplib::Response &response);
|
||||
void statistics_data_collection_get(httplib::Response &response);
|
||||
|
||||
void config_file_writer_get(httplib::Response &response);
|
||||
void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
httplib::Response &response);
|
||||
|
||||
void config_image_format_get(httplib::Response &response);
|
||||
void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings,
|
||||
httplib::Response &response);
|
||||
void config_image_format_conversion_post(httplib::Response &response);
|
||||
void config_image_format_raw_post(httplib::Response &response);
|
||||
|
||||
void fpga_status_get(httplib::Response &response);
|
||||
|
||||
void statistics_get(httplib::Response &response);
|
||||
|
||||
void config_zeromq_preview_get(httplib::Response &response);
|
||||
void config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_zeromq_metadata_get(httplib::Response &response);
|
||||
void config_zeromq_metadata_put(const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_internal_generator_image_put(const std::optional<int64_t> &id,
|
||||
const httplib::Request &request,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_internal_generator_image_tiff_put(const std::optional<int64_t> &id,
|
||||
const httplib::Request &request,
|
||||
httplib::Response &response);
|
||||
|
||||
void image_buffer_clear_post(httplib::Response &response);
|
||||
void image_buffer_image_cbor_get(const std::optional<int64_t> &id, httplib::Response &response);
|
||||
void image_buffer_image_jpeg_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask,
|
||||
const std::optional<bool> &showRoi, const std::optional<bool> &showSpots,
|
||||
const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation,
|
||||
const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing,
|
||||
const std::optional<std::string> &color, const std::optional<bool> &showResEst,
|
||||
httplib::Response &response);
|
||||
void image_buffer_image_tiff_get(const std::optional<int64_t> &id, httplib::Response &response);
|
||||
void image_buffer_start_cbor_get(httplib::Response &response);
|
||||
void image_buffer_status_get(httplib::Response &response);
|
||||
|
||||
void detector_status_get(httplib::Response &response);
|
||||
void image_pusher_status_get(httplib::Response &response);
|
||||
|
||||
void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel, const std::optional<int32_t> &sc,
|
||||
httplib::Response &response);
|
||||
void preview_plot_bin_get(const std::optional<std::string> &type, const std::optional<std::string> &roi,
|
||||
httplib::Response &response);
|
||||
void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
|
||||
const std::optional<float> &fill,
|
||||
const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_mask_get(httplib::Response &response);
|
||||
void config_mask_tiff_get(httplib::Response &response);
|
||||
void config_user_mask_get(httplib::Response &response);
|
||||
void config_user_mask_put(const httplib::Request &request, httplib::Response &response);
|
||||
void config_user_mask_tiff_get(httplib::Response &response);
|
||||
void config_user_mask_tiff_put(const httplib::Request &request, httplib::Response &response);
|
||||
|
||||
void config_roi_get(httplib::Response &response);
|
||||
void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions,
|
||||
httplib::Response &response);
|
||||
|
||||
void result_scan_get(httplib::Response &response);
|
||||
void version_get(httplib::Response &response);
|
||||
|
||||
void config_instrument_get(httplib::Response &response);
|
||||
void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_indexing_get(httplib::Response &response);
|
||||
void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void config_dark_mask_get(httplib::Response &response);
|
||||
void config_dark_mask_put(const org::openapitools::server::model::Dark_mask_settings &darkMaskSettings,
|
||||
httplib::Response &response);
|
||||
|
||||
void xfel_event_code_get(httplib::Response &response);
|
||||
void xfel_pulse_id_get(httplib::Response &response);
|
||||
|
||||
public:
|
||||
JFJochBrokerHttp(const DiffractionExperiment &experiment,
|
||||
const SpotFindingSettings &spot_finding_settings);
|
||||
|
||||
void AddDetectorSetup(const DetectorSetup &setup);
|
||||
JFJochServices &Services();
|
||||
JFJochBrokerHttp &FrontendDirectory(const std::string &directory);
|
||||
void attach(httplib::Server &server);
|
||||
|
||||
~JFJochBrokerHttp() = default;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHBROKERHTTP_H
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
#include "OpenAPIConvert.h"
|
||||
#include "Detector_type.h"
|
||||
#include "../image_pusher/NonePusher.h"
|
||||
#include "../image_pusher/TCPStreamPusher.h"
|
||||
|
||||
DetectorGeometryModular ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j) {
|
||||
auto s = j.getStandardGeometry();
|
||||
return DetectorGeometryModular(s.getNmodules(), s.getModulesInRow(), s.getGapX(), s.getGapY(), false);
|
||||
return DetectorGeometryModular(s.getNmodules(), s.getModulesInRow(), s.getGapX(), s.getGapY(), j.isMirrorY());
|
||||
}
|
||||
|
||||
DetectorModuleGeometry::Direction Convert(const org::openapitools::server::model::Detector_module_direction& d) {
|
||||
@@ -50,7 +51,7 @@ DetectorGeometryModular ParseCustomDetectorGeometry(const org::openapitools::ser
|
||||
auto slow = Convert(iter.getSlowAxis());
|
||||
modules.emplace_back(iter.getX0(), iter.getY0(), fast, slow);
|
||||
}
|
||||
return DetectorGeometryModular(modules, false);
|
||||
return DetectorGeometryModular(modules, j.isMirrorY());
|
||||
}
|
||||
|
||||
|
||||
@@ -86,16 +87,19 @@ DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detecto
|
||||
}
|
||||
|
||||
DetectorGeometryModular geom = ParseDetectorGeometry(d);
|
||||
if (d.isMirrorY())
|
||||
geom.VerticalFlip();
|
||||
|
||||
DetectorSetup setup(geom, detector_type, d.getDescription(), d.getHostname());
|
||||
|
||||
auto calib = d.getCalibrationFile();
|
||||
auto trim_energies = d.getTrimEnergiesEV();
|
||||
if (!calib.empty()) {
|
||||
switch (detector_type) {
|
||||
case DetectorType::EIGER:
|
||||
setup.SetTrimFiles(calib);
|
||||
if (trim_energies.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Trimming energies not provided");
|
||||
setup.TrimEnergies_eV(trim_energies);
|
||||
break;
|
||||
case DetectorType::JUNGFRAU:
|
||||
setup.LoadGain(calib);
|
||||
@@ -125,19 +129,25 @@ DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detecto
|
||||
.SerialNumber(d.getSerialNumber())
|
||||
.ModuleSync(d.isModuleSync());
|
||||
|
||||
if (d.readoutTimeUsIsSet())
|
||||
setup.ReadOutTime(std::chrono::microseconds(d.getReadoutTimeUs()));
|
||||
if (d.readoutTimeNsIsSet())
|
||||
setup.ReadOutTime(std::chrono::nanoseconds(d.getReadoutTimeNs()));
|
||||
|
||||
if (d.baseDataIpv4AddressIsSet())
|
||||
setup.BaseIPv4Addr(d.getBaseDataIpv4Address());
|
||||
if (d.txDelayIsSet())
|
||||
setup.TxDelay(d.getTxDelay());
|
||||
|
||||
if (d.minimumCountTimeUsIsSet())
|
||||
setup.MinCountTime(std::chrono::microseconds(d.getMinimumCountTimeUs()));
|
||||
if (d.minCountTimeNsIsSet())
|
||||
setup.MinCountTime(std::chrono::nanoseconds(d.getMinCountTimeNs()));
|
||||
|
||||
if (d.minimumFrameTimeUsIsSet())
|
||||
setup.MinFrameTime(std::chrono::microseconds(d.getMinimumFrameTimeUs()));
|
||||
if (d.minFrameTimeNsIsSet())
|
||||
setup.MinFrameTime(std::chrono::nanoseconds(d.getMinFrameTimeNs()));
|
||||
|
||||
if (d.defaultSettingsIsSet())
|
||||
setup.DefaultSettings(Convert(d.getDefaultSettings()));
|
||||
|
||||
if (d.tempThresoldDegCIsSet())
|
||||
setup.TempThreshold_degC(d.getTempThresoldDegC());
|
||||
|
||||
return setup;
|
||||
}
|
||||
@@ -160,6 +170,9 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s
|
||||
|
||||
if (j.indexingIsSet())
|
||||
experiment.ImportIndexingSettings(Convert(j.getIndexing()));
|
||||
|
||||
if (j.darkMaskIsSet())
|
||||
experiment.ImportDarkMaskSettings(Convert(j.getDarkMask()));
|
||||
}
|
||||
|
||||
std::unique_ptr<ImagePusher> ParseZMQImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
|
||||
@@ -183,10 +196,31 @@ std::unique_ptr<ImagePusher> ParseZMQImagePusher(const org::openapitools::server
|
||||
return std::move(tmp);
|
||||
}
|
||||
|
||||
std::unique_ptr<ImagePusher> ParseTCPImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
|
||||
if (!j.tcpIsSet())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "TCP/IP Socket settings must be provided");
|
||||
|
||||
std::optional<int32_t> send_buffer_size;
|
||||
if (j.getTcp().sendBufferSizeIsSet())
|
||||
send_buffer_size = j.getTcp().getSendBufferSize();
|
||||
|
||||
auto tmp = std::make_unique<TCPStreamPusher>(j.getTcp().getImageSocket(), j.getTcp().getNwriters(), send_buffer_size);
|
||||
|
||||
// Optional liveness/backpressure tuning; unset -> keep the pusher's built-in defaults.
|
||||
if (j.getTcp().peerLivenessTimeoutMsIsSet() && j.getTcp().getPeerLivenessTimeoutMs() > 0)
|
||||
tmp->SetPeerLivenessTimeout(std::chrono::milliseconds(j.getTcp().getPeerLivenessTimeoutMs()));
|
||||
if (j.getTcp().maxBackpressureTimeoutMsIsSet() && j.getTcp().getMaxBackpressureTimeoutMs() > 0)
|
||||
tmp->SetMaxBackpressureTimeout(std::chrono::milliseconds(j.getTcp().getMaxBackpressureTimeoutMs()));
|
||||
|
||||
return std::move(tmp);
|
||||
}
|
||||
|
||||
std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
|
||||
switch (j.getImagePusher().getValue()) {
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::ZEROMQ:
|
||||
return ParseZMQImagePusher(j);
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::TCP:
|
||||
return ParseTCPImagePusher(j);
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::HDF5:
|
||||
return std::make_unique<HDF5FilePusher>();
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::NONE:
|
||||
@@ -211,10 +245,6 @@ void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
@@ -228,3 +258,9 @@ void ParseReceiverSettings(const org::openapitools::server::model::Jfjoch_settin
|
||||
service.MetadataSocketSettings(Convert(input.getZeromqMetadata()));
|
||||
}
|
||||
}
|
||||
|
||||
SpotFindingSettings ParseSpotFindingSettings(const org::openapitools::server::model::Jfjoch_settings &input) {
|
||||
if (input.spotFindingIsSet())
|
||||
return Convert(input.getSpotFinding());
|
||||
return SpotFindingSettings();
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
|
||||
#define JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
|
||||
#pragma once
|
||||
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "../acquisition_device/AcquisitionDeviceGroup.h"
|
||||
@@ -21,5 +20,4 @@ std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::m
|
||||
|
||||
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
|
||||
SpotFindingSettings ParseSpotFindingSettings(const org::openapitools::server::model::Jfjoch_settings &input);
|
||||
|
||||
+92
-35
@@ -10,21 +10,22 @@ JFJochServices::JFJochServices(Logger &in_logger) : logger(in_logger) {}
|
||||
|
||||
void JFJochServices::Start(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration &calibration) {
|
||||
const JFCalibration *calibration) {
|
||||
logger.Info("Measurement start for: {}", experiment.GetFilePrefix());
|
||||
|
||||
cannot_stop_detector = false;
|
||||
|
||||
if (receiver != nullptr) {
|
||||
logger.Info(" ... receiver start");
|
||||
if (experiment.IsJungfrauConvPhotonCnt())
|
||||
receiver->Start(experiment, pixel_mask, &calibration);
|
||||
else
|
||||
receiver->Start(experiment, pixel_mask, nullptr);
|
||||
|
||||
if (detector && !experiment.IsUsingInternalPacketGen()) {
|
||||
logger.Info(" ... detector start");
|
||||
detector->Start(experiment);
|
||||
if (image_puller)
|
||||
image_puller->ResumeAndClear();
|
||||
receiver->Start(experiment, pixel_mask, calibration, image_puller);
|
||||
{
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector && !experiment.IsUsingInternalPacketGen()) {
|
||||
logger.Info(" ... detector start");
|
||||
detector->Start(experiment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,25 +33,43 @@ void JFJochServices::Start(const DiffractionExperiment& experiment,
|
||||
}
|
||||
|
||||
void JFJochServices::Off() {
|
||||
if (detector)
|
||||
detector->Deactivate();
|
||||
image_puller.reset();
|
||||
|
||||
std::unique_ptr<DetectorWrapper> old_detector;
|
||||
{
|
||||
std::unique_lock ul(detector_mutex);
|
||||
old_detector = std::move(detector);
|
||||
}
|
||||
if (old_detector) {
|
||||
old_detector->Deactivate();
|
||||
// destroyed here, outside lock
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochServices::On(DiffractionExperiment &x) {
|
||||
if (x.IsUsingInternalPacketGen() || (receiver == nullptr)) {
|
||||
std::unique_lock ul(detector_mutex);
|
||||
detector.reset();
|
||||
} else {
|
||||
logger.Info("Detector on");
|
||||
std::unique_ptr<DetectorWrapper> new_detector;
|
||||
switch (x.GetDetectorType()) {
|
||||
case DetectorType::EIGER:
|
||||
case DetectorType::JUNGFRAU:
|
||||
detector = std::make_unique<SLSDetectorWrapper>();
|
||||
new_detector = std::make_unique<SLSDetectorWrapper>();
|
||||
image_puller.reset();
|
||||
break;
|
||||
case DetectorType::DECTRIS:
|
||||
detector = std::make_unique<DectrisDetectorWrapper>();
|
||||
new_detector = std::make_unique<DectrisDetectorWrapper>();
|
||||
image_puller = std::make_shared<ZMQImagePuller>(x.GetDetectorSetup().GetDECTRISStream2Addr());
|
||||
image_puller->Suspend();
|
||||
break;
|
||||
}
|
||||
detector->Initialize(x, receiver->GetNetworkConfig());
|
||||
new_detector->Initialize(x, receiver->GetNetworkConfig());
|
||||
{
|
||||
std::unique_lock ul(detector_mutex);
|
||||
detector = std::move(new_detector);
|
||||
}
|
||||
logger.Info(" ... done");
|
||||
}
|
||||
}
|
||||
@@ -64,26 +83,32 @@ JFJochServicesOutput JFJochServices::Stop() {
|
||||
|
||||
if (receiver != nullptr) {
|
||||
try {
|
||||
if (detector) {
|
||||
logger.Info("Wait for detector idle");
|
||||
DetectorState state = detector->GetState();
|
||||
while ((!cannot_stop_detector)
|
||||
&& ((state == DetectorState::WAITING) || (state == DetectorState::BUSY))) {
|
||||
// check detector state every 5 ms
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
state = detector->GetState();
|
||||
}
|
||||
if (state == DetectorState::IDLE) {
|
||||
logger.Info(" ... detector idle");
|
||||
receiver->Cancel(true); // cancel silently
|
||||
} else {
|
||||
logger.Error(" ... detector in error state");
|
||||
receiver->Cancel(false);
|
||||
detector_error = true;
|
||||
{
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector) {
|
||||
logger.Info("Wait for detector idle");
|
||||
DetectorState state = detector->GetState();
|
||||
while ((!cannot_stop_detector)
|
||||
&& ((state == DetectorState::WAITING) || (state == DetectorState::BUSY))) {
|
||||
// check detector state every 5 ms
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
state = detector->GetState();
|
||||
}
|
||||
if (state == DetectorState::IDLE) {
|
||||
logger.Info(" ... detector idle");
|
||||
receiver->Cancel(true); // cancel silently
|
||||
} else {
|
||||
logger.Error(" ... detector in error state");
|
||||
receiver->Cancel(false);
|
||||
detector_error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.Info("Wait for receiver done");
|
||||
ret.receiver_output = receiver->Stop();
|
||||
if (image_puller)
|
||||
image_puller->Suspend();
|
||||
|
||||
logger.Info(" ... Receiver efficiency: {} % Max delay: {} Compression ratio {}x",
|
||||
static_cast<int>(ret.receiver_output.efficiency * 100.0),
|
||||
@@ -97,11 +122,19 @@ JFJochServicesOutput JFJochServices::Stop() {
|
||||
ret.receiver_output.received_packets[i], ret.receiver_output.expected_packets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// A writer that broke mid-run (e.g. a lost connection) leaves a truncated file.
|
||||
// Surface that as a failed acquisition instead of silently reporting success.
|
||||
if (!ret.receiver_output.writer_err.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::FileWriteError,
|
||||
"Writer error, written data may be incomplete: "
|
||||
+ ret.receiver_output.writer_err);
|
||||
|
||||
logger.Info(" ... finished with success");
|
||||
} catch (const JFJochException &e) {
|
||||
logger.Error(" ... finished with error {}", e.what());
|
||||
exception = std::make_unique<JFJochException>(e);
|
||||
}
|
||||
logger.Info("Receiver finished with success");
|
||||
} else {
|
||||
logger.Info("No receiver - sleeping for 30 seconds");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
@@ -119,6 +152,7 @@ JFJochServicesOutput JFJochServices::Stop() {
|
||||
}
|
||||
|
||||
void JFJochServices::Cancel() {
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector) {
|
||||
// Best effort - if detector cannot be stopped, this is OK, important to still stop receiver
|
||||
try {
|
||||
@@ -154,21 +188,27 @@ MultiLinePlot JFJochServices::GetPlots(const PlotRequest &request) {
|
||||
return receiver->GetDataProcessingPlot(request);
|
||||
}
|
||||
|
||||
void JFJochServices::GetPlotRaw(std::vector<float> &v, PlotType type, const std::string &roi) {
|
||||
if (receiver != nullptr)
|
||||
receiver->GetPlotRaw(v, type, roi);
|
||||
}
|
||||
|
||||
void JFJochServices::SetSpotFindingSettings(const SpotFindingSettings &settings) {
|
||||
if (receiver)
|
||||
receiver->SetSpotFindingSettings(settings);
|
||||
}
|
||||
|
||||
void JFJochServices::Trigger() {
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector && (receiver != nullptr))
|
||||
detector->Trigger();
|
||||
}
|
||||
|
||||
std::optional<DetectorStatus> JFJochServices::GetDetectorStatus() const {
|
||||
if (detector)
|
||||
std::shared_lock ul(detector_mutex, std::defer_lock);
|
||||
if (ul.try_lock_for(std::chrono::milliseconds(500)) && detector)
|
||||
return detector->GetStatus();
|
||||
else
|
||||
return {};
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string JFJochServices::GetPreviewJPEG(const PreviewImageSettings &settings, int64_t image_number) const {
|
||||
@@ -186,6 +226,7 @@ std::string JFJochServices::GetPreviewTIFF(int64_t image_number) const {
|
||||
}
|
||||
|
||||
void JFJochServices::ConfigureDetector(const DiffractionExperiment &experiment) {
|
||||
std::unique_lock ul(detector_mutex); // While configuring detector ensure exclusive access (even though pointer is not modified here)
|
||||
if (detector)
|
||||
detector->Configure(experiment);
|
||||
}
|
||||
@@ -204,7 +245,7 @@ void JFJochServices::GetXFELPulseID(std::vector<uint64_t> &v) const {
|
||||
|
||||
void JFJochServices::GetXFELEventCode(std::vector<uint64_t> &v) const {
|
||||
if (receiver)
|
||||
receiver->GetXFELPulseID(v);
|
||||
receiver->GetXFELEventCode(v);
|
||||
}
|
||||
|
||||
std::vector<DeviceStatus> JFJochServices::GetDeviceStatus() const {
|
||||
@@ -259,6 +300,22 @@ void JFJochServices::ClearImageBuffer() const {
|
||||
}
|
||||
|
||||
void JFJochServices::LoadDetectorPixelMask(PixelMask &mask) {
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector)
|
||||
detector->LoadPixelMask(mask);
|
||||
}
|
||||
|
||||
void JFJochServices::SetupIndexing(const IndexingSettings &input) {
|
||||
if (receiver)
|
||||
receiver->Indexing(input);
|
||||
}
|
||||
|
||||
ImagePusherStatus JFJochServices::GetImagePusherStatus() const {
|
||||
if (receiver)
|
||||
return receiver->GetImagePusherStatus();
|
||||
return {
|
||||
.pusher_type = ImagePusherType::None,
|
||||
.address = {},
|
||||
.connected_writers = 0
|
||||
};
|
||||
}
|
||||
|
||||
+12
-6
@@ -1,9 +1,9 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_JFJOCHSERVICES_H
|
||||
#define JUNGFRAUJOCH_JFJOCHSERVICES_H
|
||||
#pragma once
|
||||
|
||||
#include <shared_mutex>
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "../jungfrau/JFCalibration.h"
|
||||
#include "../common/Logger.h"
|
||||
@@ -15,10 +15,13 @@ struct JFJochServicesOutput {
|
||||
};
|
||||
|
||||
class JFJochServices {
|
||||
mutable std::shared_timed_mutex detector_mutex;
|
||||
|
||||
JFJochReceiverService *receiver = nullptr;
|
||||
std::unique_ptr<DetectorWrapper> detector;
|
||||
std::shared_ptr<ZMQImagePuller> image_puller;
|
||||
|
||||
volatile bool cannot_stop_detector = false;
|
||||
std::atomic<bool> cannot_stop_detector = false;
|
||||
Logger &logger;
|
||||
public:
|
||||
explicit JFJochServices(Logger &in_logger);
|
||||
@@ -27,7 +30,7 @@ public:
|
||||
void ConfigureDetector(const DiffractionExperiment& experiment);
|
||||
void Start(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration &calibration);
|
||||
const JFCalibration *calibration = nullptr);
|
||||
JFJochServicesOutput Stop();
|
||||
void Cancel();
|
||||
void Trigger();
|
||||
@@ -38,6 +41,7 @@ public:
|
||||
std::optional<JFJochReceiverStatus> GetReceiverStatus() const;
|
||||
std::optional<float> GetReceiverProgress() const;
|
||||
MultiLinePlot GetPlots(const PlotRequest &request);
|
||||
void GetPlotRaw(std::vector<float> &v, PlotType type, const std::string &roi);
|
||||
|
||||
void SetSpotFindingSettings(const SpotFindingSettings &settings);
|
||||
JFJochServices& Receiver(JFJochReceiverService *input);
|
||||
@@ -64,7 +68,9 @@ public:
|
||||
void ClearImageBuffer() const;
|
||||
|
||||
void LoadDetectorPixelMask(PixelMask &mask);
|
||||
|
||||
void SetupIndexing(const IndexingSettings& input);
|
||||
|
||||
ImagePusherStatus GetImagePusherStatus() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHSERVICES_H
|
||||
|
||||
+254
-97
@@ -5,30 +5,30 @@
|
||||
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
#include "pistache/net.h"
|
||||
#include "../common/CUDAWrapper.h"
|
||||
#include "../common/GitInfo.h"
|
||||
|
||||
JFJochStateMachine::JFJochStateMachine(const DiffractionExperiment& in_experiment,
|
||||
JFJochServices &in_services,
|
||||
Logger &in_logger)
|
||||
: experiment(in_experiment),
|
||||
logger(in_logger),
|
||||
services(in_services),
|
||||
pixel_mask(experiment),
|
||||
current_detector_setup(0),
|
||||
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()),
|
||||
pixel_mask_statistics({0, 0, 0}),
|
||||
gpu_count(get_gpu_count()) {
|
||||
Logger &in_logger,
|
||||
const SpotFindingSettings &spot_finding_settings)
|
||||
: logger(in_logger),
|
||||
services(in_services),
|
||||
experiment(in_experiment),
|
||||
pixel_mask(experiment),
|
||||
current_detector_setup(0),
|
||||
data_processing_settings(spot_finding_settings),
|
||||
pixel_mask_statistics({0, 0, 0}),
|
||||
gpu_count(get_gpu_count()) {
|
||||
|
||||
indexing_possible = (get_gpu_count() >= 0);
|
||||
#ifndef JFJOCH_USE_FFTW
|
||||
indexing_possible = (get_gpu_count() > 0);
|
||||
if (!indexing_possible)
|
||||
data_processing_settings.indexing = false;
|
||||
|
||||
resolution_estimate_possible = !experiment.GetInferenceServerAddress().empty();
|
||||
if (!resolution_estimate_possible)
|
||||
data_processing_settings.resolution_estimate = false;
|
||||
|
||||
SupressTIFFErrors();
|
||||
#else
|
||||
data_processing_settings.indexing = true;
|
||||
#endif
|
||||
SuppressTIFFErrors();
|
||||
}
|
||||
|
||||
bool JFJochStateMachine::ImportPedestalG0(const JFJochReceiverOutput &receiver_output) {
|
||||
@@ -63,58 +63,93 @@ bool JFJochStateMachine::ImportPedestalG1G2(const JFJochReceiverOutput &receiver
|
||||
return true;
|
||||
}
|
||||
|
||||
void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &ul) {
|
||||
if (experiment.GetDetectorSetup().GetDetectorType() != DetectorType::JUNGFRAU) {
|
||||
try {
|
||||
logger.Info("EIGER configuration");
|
||||
services.ConfigureDetector(experiment);
|
||||
logger.Info(" ... done ");
|
||||
SetState(JFJochState::Idle,
|
||||
"Detector configured",
|
||||
BrokerStatus::MessageSeverity::Success);
|
||||
return;
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error("Configuration error {}", e.what());
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
calibration = std::make_unique<JFCalibration>(experiment);
|
||||
|
||||
void JFJochStateMachine::CalibrateJUNGFRAU(std::unique_lock<std::mutex> &ul) {
|
||||
if (!gain_calibration.empty()) {
|
||||
if (gain_calibration.size() != experiment.GetModulesNum())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Mismatch in gain files number");
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Mismatch in gain files number");
|
||||
for (int i = 0; i < gain_calibration.size(); i++)
|
||||
calibration->GainCalibration(i) = gain_calibration[i];
|
||||
}
|
||||
|
||||
TakePedestalInternalG0(ul);
|
||||
if (!experiment.IsFixedGainG1()) {
|
||||
for (int i = 0; i < experiment.GetStorageCellNumber(); i++) {
|
||||
TakePedestalInternalG1(ul, i);
|
||||
TakePedestalInternalG2(ul, i);
|
||||
}
|
||||
}
|
||||
pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get());
|
||||
}
|
||||
|
||||
void JFJochStateMachine::CalibrateDetector(std::unique_lock<std::mutex> ul) {
|
||||
cancel_sequence = false;
|
||||
|
||||
logger.Info("Pedestal sequence started");
|
||||
pixel_mask = PixelMask(experiment);
|
||||
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
|
||||
|
||||
logger.Info("Calibration sequence started");
|
||||
try {
|
||||
TakePedestalInternalG0(ul);
|
||||
if (!experiment.IsFixedGainG1()) {
|
||||
for (int i = 0; i < experiment.GetStorageCellNumber(); i++) {
|
||||
TakePedestalInternalG1(ul, i);
|
||||
TakePedestalInternalG2(ul, i);
|
||||
}
|
||||
if (experiment.GetDetectorType() == DetectorType::EIGER) {
|
||||
// PSI EIGER - only reset calibration
|
||||
calibration.reset();
|
||||
} else if (experiment.GetDetectorType() == DetectorType::DECTRIS) {
|
||||
// DECTRIS - take dark data for mask
|
||||
calibration.reset();
|
||||
TakeDarkMaskInternal(ul);
|
||||
} else {
|
||||
// PSI JUNGFRAU - take pedestal
|
||||
calibration = std::make_unique<JFCalibration>(experiment);
|
||||
CalibrateJUNGFRAU(ul);
|
||||
}
|
||||
SetState(JFJochState::Idle,
|
||||
"Pedestal sequence done",
|
||||
BrokerStatus::MessageSeverity::Success);
|
||||
services.ConfigureDetector(experiment);
|
||||
pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get());
|
||||
// Update pixel mask statistics
|
||||
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
|
||||
// configure detector for standard operation
|
||||
services.ConfigureDetector(experiment);
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error("Pedestal sequence error {}", e.what());
|
||||
logger.Error("Calibration sequence error {}", e.what());
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
throw;
|
||||
}
|
||||
logger.Info("Pedestal sequence done");
|
||||
SetState(JFJochState::Idle, "Calibration sequence done", BrokerStatus::MessageSeverity::Success);
|
||||
logger.Info("Calibration sequence done");
|
||||
ul.unlock(); // Notify all outside of mutex
|
||||
c.notify_all();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::TakeDarkMaskInternal(std::unique_lock<std::mutex> &ul) {
|
||||
if (cancel_sequence) {
|
||||
SetState(JFJochState::Inactive,
|
||||
"Mask sequence cancelled",
|
||||
BrokerStatus::MessageSeverity::Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
services.LoadDetectorPixelMask(pixel_mask);
|
||||
|
||||
if (experiment.GetDarkMaskNumberOfFrames() == 0)
|
||||
return;
|
||||
|
||||
DiffractionExperiment local_experiment(experiment);
|
||||
local_experiment.Mode(DetectorMode::DarkMask);
|
||||
|
||||
SetState(JFJochState::Calibration, "Dark sequence for mask calculation", BrokerStatus::MessageSeverity::Info);
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, pixel_mask, nullptr);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
ul.unlock();
|
||||
// Allow to cancel/abort during the mask data collection
|
||||
auto mask_output = services.Stop();
|
||||
ul.lock();
|
||||
|
||||
if (mask_output.receiver_output.dark_mask_result.size() == local_experiment.GetPixelsNum()) {
|
||||
pixel_mask.LoadDarkBadPixelMask(local_experiment, mask_output.receiver_output.dark_mask_result);
|
||||
SetState(JFJochState::Idle);
|
||||
} else
|
||||
SetState(JFJochState::Error, "Mask not collected properly", BrokerStatus::MessageSeverity::Error);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::TakePedestalInternalG0(std::unique_lock<std::mutex> &ul) {
|
||||
DiffractionExperiment local_experiment(experiment);
|
||||
@@ -142,9 +177,9 @@ void JFJochStateMachine::TakePedestalInternalG0(std::unique_lock<std::mutex> &ul
|
||||
if (local_experiment.GetPedestalG0Frames() == 0)
|
||||
return;
|
||||
|
||||
SetState(JFJochState::Pedestal, message, BrokerStatus::MessageSeverity::Info);
|
||||
SetState(JFJochState::Calibration, message, BrokerStatus::MessageSeverity::Info);
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, calibration.get());
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -183,11 +218,11 @@ void JFJochStateMachine::TakePedestalInternalG1(std::unique_lock<std::mutex> &ul
|
||||
return;
|
||||
|
||||
|
||||
SetState(JFJochState::Pedestal,
|
||||
SetState(JFJochState::Calibration,
|
||||
"Pedestal G1 SC" + std::to_string(storage_cell),
|
||||
BrokerStatus::MessageSeverity::Info);
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, calibration.get());
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -223,11 +258,11 @@ void JFJochStateMachine::TakePedestalInternalG2(std::unique_lock<std::mutex> &ul
|
||||
return;
|
||||
|
||||
|
||||
SetState(JFJochState::Pedestal,
|
||||
SetState(JFJochState::Calibration,
|
||||
"Pedestal G2 SC" + std::to_string(storage_cell),
|
||||
BrokerStatus::MessageSeverity::Info);
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, calibration.get());
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -255,7 +290,13 @@ void JFJochStateMachine::Initialize() {
|
||||
ResetError(); // Clear error, we don't care what was it
|
||||
|
||||
logger.Info("Initialize");
|
||||
|
||||
SetState(JFJochState::Busy, "Configuring indexing threads", BrokerStatus::MessageSeverity::Info);
|
||||
try {
|
||||
services.SetupIndexing(experiment.GetIndexingSettings());
|
||||
} catch (const JFJochException &e) {
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
throw;
|
||||
}
|
||||
SetState(JFJochState::Busy, "Configuring detector", BrokerStatus::MessageSeverity::Info);
|
||||
|
||||
scan_result = {}; // Clear scan result
|
||||
@@ -269,35 +310,39 @@ void JFJochStateMachine::Pedestal() {
|
||||
if (state != JFJochState::Idle)
|
||||
throw WrongDAQStateException("Must be idle to take pedestal");
|
||||
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::PedestalThread, this, std::move(ul));
|
||||
}
|
||||
SetState(JFJochState::Busy, "Updating calibration", BrokerStatus::MessageSeverity::Info);
|
||||
|
||||
|
||||
void JFJochStateMachine::PedestalThread(std::unique_lock<std::mutex> ul) {
|
||||
TakePedestalInternalAll(ul);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::CalibrateDetector, this, std::move(ul));
|
||||
}
|
||||
|
||||
void JFJochStateMachine::InitializeThread(std::unique_lock<std::mutex> ul) {
|
||||
try {
|
||||
// On might modify experiment (reads DECTRIS configuration), so need to have lock acquired at this point
|
||||
services.On(experiment);
|
||||
// services.On can potentially take a lot of time, so better to unlock main mutex
|
||||
// Since On might modify the experiment (reads DECTRIS configuration), one has to have a local copy for unlocked part
|
||||
DiffractionExperiment local_experiment(experiment);
|
||||
if (state != JFJochState::Busy)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"State must be busy for safe operation");
|
||||
ul.unlock();
|
||||
services.On(local_experiment);
|
||||
ul.lock();
|
||||
|
||||
experiment = local_experiment;
|
||||
detector_setup[current_detector_setup] = experiment.GetDetectorSetup();
|
||||
pixel_mask = PixelMask(experiment);
|
||||
services.LoadDetectorPixelMask(pixel_mask);
|
||||
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
|
||||
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error("Initialize error {}", e.what());
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
throw;
|
||||
}
|
||||
TakePedestalInternalAll(ul);
|
||||
CalibrateDetector(std::move(ul));
|
||||
}
|
||||
|
||||
void JFJochStateMachine::Trigger() {
|
||||
services.Trigger();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::Start(const DatasetSettings &settings) {
|
||||
void JFJochStateMachine::Start(const DatasetSettings &settings, bool async) {
|
||||
std::unique_lock ul(m);
|
||||
|
||||
if (state != JFJochState::Idle)
|
||||
@@ -316,18 +361,16 @@ void JFJochStateMachine::Start(const DatasetSettings &settings) {
|
||||
|
||||
experiment.IncrementRunNumber();
|
||||
|
||||
try {
|
||||
SetState(JFJochState::Busy, "Preparing measurement", BrokerStatus::MessageSeverity::Info);
|
||||
services.SetSpotFindingSettings(GetSpotFindingSettings());
|
||||
services.Start(experiment, pixel_mask, *calibration);
|
||||
SetState(JFJochState::Busy, "Preparing measurement", BrokerStatus::MessageSeverity::Info);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::MeasurementThread, this);
|
||||
if (!async)
|
||||
c.wait(ul, [&]() { return state != JFJochState::Busy; });
|
||||
}
|
||||
|
||||
SetState(JFJochState::Measuring, "Measuring ...", BrokerStatus::MessageSeverity::Info);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::MeasurementThread, this);
|
||||
} catch (const std::exception &e) {
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
services.Cancel();
|
||||
throw;
|
||||
}
|
||||
BrokerStatus JFJochStateMachine::WaitTillNotBusy(std::chrono::milliseconds timeout) {
|
||||
std::unique_lock ul(m);
|
||||
c.wait_for(ul, timeout, [&]() { return state != JFJochState::Busy; });
|
||||
return GetStatus();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::UpdatePixelMaskStatistics(const PixelMaskStatistics &input) {
|
||||
@@ -341,12 +384,43 @@ PixelMaskStatistics JFJochStateMachine::GetPixelMaskStatistics() const {
|
||||
}
|
||||
|
||||
void JFJochStateMachine::MeasurementThread() {
|
||||
try {
|
||||
services.SetSpotFindingSettings(GetSpotFindingSettings());
|
||||
services.Start(experiment, pixel_mask, calibration.get());
|
||||
{
|
||||
std::unique_lock ul(m);
|
||||
SetState(JFJochState::Measuring, "Measuring ...", BrokerStatus::MessageSeverity::Info);
|
||||
}
|
||||
c.notify_all();
|
||||
} catch (std::exception &e) {
|
||||
{
|
||||
std::unique_lock ul(m);
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
}
|
||||
services.Cancel();
|
||||
c.notify_all();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
auto tmp_output = services.Stop();
|
||||
{
|
||||
std::unique_lock ul(m);
|
||||
scan_result = tmp_output.receiver_output.scan_result;
|
||||
|
||||
auto image_mean_time = tmp_output.receiver_output.processing_time;
|
||||
logger.Info("Per-image mean processing time (microseconds): compression {:.0f} preprocess {:.0f} azint {:.0f} spot finding {:.0f} indexing {:.0f} refinement {:.0f} indexing analysis {:.0f} prediction {:.0f} integration {:.0f} total {:.0f}",
|
||||
image_mean_time.compression * 1e6,
|
||||
image_mean_time.preprocessing * 1e6,
|
||||
image_mean_time.azint * 1e6,
|
||||
image_mean_time.spot_finding * 1e6,
|
||||
image_mean_time.indexing * 1e6,
|
||||
image_mean_time.refinement * 1e6,
|
||||
image_mean_time.indexing_analysis * 1e6,
|
||||
image_mean_time.bragg_prediction * 1e6,
|
||||
image_mean_time.integration * 1e6,
|
||||
image_mean_time.processing * 1e6);
|
||||
|
||||
if (tmp_output.receiver_output.writer_queue_full_warning)
|
||||
SetState(JFJochState::Idle,
|
||||
"Stream receiver (writer or downstream analysis) cannot cope with data; reduce frame rate",
|
||||
@@ -378,7 +452,7 @@ void JFJochStateMachine::MeasurementThread() {
|
||||
void JFJochStateMachine::Cancel() {
|
||||
// This is inconsistency in naming - need to solve later
|
||||
std::unique_lock ul(m);
|
||||
if ((state == JFJochState::Pedestal) || (state == JFJochState::Measuring)) {
|
||||
if ((state == JFJochState::Calibration) || (state == JFJochState::Measuring)) {
|
||||
services.Cancel();
|
||||
cancel_sequence = true;
|
||||
}
|
||||
@@ -441,6 +515,7 @@ std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistic
|
||||
tmp.saturated_pixels = rcv_status->saturated_pixels;
|
||||
tmp.roi_beam_sum = rcv_status->roi_beam_sum;
|
||||
tmp.roi_beam_npixel = rcv_status->roi_beam_npixel;
|
||||
tmp.images_written = rcv_status->images_written;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
@@ -460,9 +535,14 @@ DetectorSettings JFJochStateMachine::GetDetectorSettings() const {
|
||||
return experiment.GetDetectorSettings();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::ImportDetectorSettings(const DetectorSettings &input) {
|
||||
bool JFJochStateMachine::ImportDetectorSettings(const DetectorSettings &input) {
|
||||
std::unique_lock ul(experiment_detector_settings_mutex);
|
||||
// For JUNGFRAU detector, if detector settings changes key parameters
|
||||
// need to recalibrate the detector
|
||||
bool recalib = input.NeedsJUNGFRAURecalibration(experiment.GetDetectorSettings())
|
||||
&& experiment.GetDetectorType() == DetectorType::JUNGFRAU;
|
||||
experiment.ImportDetectorSettings(input);
|
||||
return recalib;
|
||||
}
|
||||
|
||||
void JFJochStateMachine::LoadDetectorSettings(const DetectorSettings &settings) {
|
||||
@@ -473,13 +553,23 @@ void JFJochStateMachine::LoadDetectorSettings(const DetectorSettings &settings)
|
||||
ImportDetectorSettings(settings);
|
||||
break;
|
||||
case JFJochState::Idle:
|
||||
SetState(JFJochState::Busy, "Loading settings", BrokerStatus::MessageSeverity::Info);
|
||||
ImportDetectorSettings(settings);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::PedestalThread, this, std::move(ul));
|
||||
if (ImportDetectorSettings(settings)) {
|
||||
SetState(JFJochState::Busy, "Loading settings", BrokerStatus::MessageSeverity::Info);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::CalibrateDetector, this, std::move(ul));
|
||||
} else {
|
||||
try {
|
||||
SetState(JFJochState::Busy, "Configure detector", BrokerStatus::MessageSeverity::Info);
|
||||
services.ConfigureDetector(experiment);
|
||||
SetState(JFJochState::Idle, "Detector configured", BrokerStatus::MessageSeverity::Info);
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error("Detector configuration error {}", e.what());
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case JFJochState::Measuring:
|
||||
case JFJochState::Busy:
|
||||
case JFJochState::Pedestal:
|
||||
case JFJochState::Calibration:
|
||||
throw WrongDAQStateException("Cannot change detector settings during data collection");
|
||||
}
|
||||
}
|
||||
@@ -493,7 +583,7 @@ BrokerStatus JFJochStateMachine::GetStatus() const {
|
||||
BrokerStatus ret = broker_status;
|
||||
ret.progress = services.GetReceiverProgress();
|
||||
ret.gpu_count = gpu_count;
|
||||
ret.ml_resolution_estimation = resolution_estimate_possible;
|
||||
ret.broker_version = jfjoch_version();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -503,9 +593,9 @@ void JFJochStateMachine::SetState(JFJochState curr_state,
|
||||
std::unique_lock ul(broker_status_mutex);
|
||||
state = curr_state;
|
||||
broker_status = BrokerStatus{
|
||||
.state = curr_state,
|
||||
.message = message,
|
||||
.message_severity = message_severity
|
||||
.state = curr_state,
|
||||
.message = message,
|
||||
.message_severity = message_severity
|
||||
};
|
||||
}
|
||||
|
||||
@@ -513,6 +603,10 @@ MultiLinePlot JFJochStateMachine::GetPlots(const PlotRequest &request) const {
|
||||
return services.GetPlots(request);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::GetPlotRaw(std::vector<float> &v, PlotType type, const std::string &roi) const {
|
||||
services.GetPlotRaw(v, type, roi);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetSpotFindingSettings(const SpotFindingSettings &settings) {
|
||||
std::unique_lock ul(data_processing_settings_mutex);
|
||||
DiffractionExperiment::CheckDataProcessingSettings(settings);
|
||||
@@ -523,9 +617,6 @@ void JFJochStateMachine::SetSpotFindingSettings(const SpotFindingSettings &setti
|
||||
if (!indexing_possible)
|
||||
data_processing_settings.indexing = false;
|
||||
|
||||
if (!resolution_estimate_possible)
|
||||
data_processing_settings.resolution_estimate = false;
|
||||
|
||||
services.SetSpotFindingSettings(data_processing_settings);
|
||||
}
|
||||
|
||||
@@ -583,6 +674,23 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException("Cannot change detector during data collection");
|
||||
|
||||
// Do nothing if this is the same detector as currently used
|
||||
if (id == current_detector_setup)
|
||||
return;
|
||||
|
||||
// Try to deactivate current detector (if actually running)
|
||||
if (state != JFJochState::Inactive) {
|
||||
try {
|
||||
SetState(JFJochState::Busy, "Deactivating existing detector");
|
||||
ul.unlock();
|
||||
services.Off();
|
||||
ul.lock();
|
||||
} catch (const std::exception &e) {
|
||||
logger.ErrorException(e);
|
||||
logger.Warning("Cannot turn off existing detector - proceeding anyway");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
experiment.Detector(detector_setup[id]);
|
||||
UpdateROIDefinition();
|
||||
@@ -621,7 +729,7 @@ bool JFJochStateMachine::IsRunning() const {
|
||||
return false;
|
||||
case JFJochState::Measuring:
|
||||
case JFJochState::Busy:
|
||||
case JFJochState::Pedestal:
|
||||
case JFJochState::Calibration:
|
||||
return true;
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "State unknown");
|
||||
@@ -704,7 +812,7 @@ void JFJochStateMachine::LoadInternalGeneratorImageTIFF(const std::string &s, ui
|
||||
uint32_t cols, lines;
|
||||
auto v = ReadTIFFFromString16(s, cols, lines);
|
||||
if (((cols == experiment.GetXPixelsNum()) && (lines == experiment.GetYPixelsNum()))
|
||||
|| ((cols == RAW_MODULE_SIZE) && (lines == RAW_MODULE_LINES * experiment.GetModulesNum())))
|
||||
|| ((cols == RAW_MODULE_COLS) && (lines == RAW_MODULE_LINES * experiment.GetModulesNum())))
|
||||
services.LoadInternalGeneratorImage(experiment, v, image_number);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
@@ -795,6 +903,21 @@ void JFJochStateMachine::SetUserPixelMask(const std::vector<uint32_t> &v) {
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetUserPixelMask(const CompressedImage &image) {
|
||||
std::unique_lock ul(m);
|
||||
|
||||
if (state != JFJochState::Idle)
|
||||
throw WrongDAQStateException("User mask can be only modified in Idle state");
|
||||
|
||||
try {
|
||||
pixel_mask.LoadUserMask(experiment, image);
|
||||
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
|
||||
} catch (const JFJochException &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Problem handling user mask " + std::string(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
InstrumentMetadata JFJochStateMachine::GetInstrumentMetadata() const {
|
||||
std::unique_lock ul(experiment_instrument_metadata_mutex);
|
||||
return experiment.GetInstrumentMetadata();
|
||||
@@ -924,6 +1047,15 @@ void JFJochStateMachine::SetIndexingSettings(const IndexingSettings &input) {
|
||||
{
|
||||
std::unique_lock ul2(experiment_indexing_settings_mutex);
|
||||
experiment.ImportIndexingSettings(input);
|
||||
try {
|
||||
services.SetupIndexing(input);
|
||||
} catch (const JFJochException &e) {
|
||||
logger.ErrorException(e);
|
||||
SetState(JFJochState::Error,
|
||||
e.what(),
|
||||
BrokerStatus::MessageSeverity::Error);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,4 +1065,29 @@ std::optional<ScanResult> JFJochStateMachine::GetScanResult() const {
|
||||
throw WrongDAQStateException("Cannot check scan result, when running");
|
||||
|
||||
return scan_result;
|
||||
}
|
||||
}
|
||||
|
||||
DarkMaskSettings JFJochStateMachine::GetDarkMaskSettings() const {
|
||||
std::unique_lock ul(experiment_dark_mask_settings_mutex);
|
||||
return experiment.GetDarkMaskSettings();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetDarkMaskSettings(const DarkMaskSettings &settings) {
|
||||
std::unique_lock ul(m);
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException("Cannot change dark mask calculation settings during data collection");
|
||||
{
|
||||
// Setting dark mask settings in experiment requires BOTH mutexes
|
||||
std::unique_lock ul2(experiment_dark_mask_settings_mutex);
|
||||
experiment.ImportDarkMaskSettings(settings);
|
||||
}
|
||||
if ((experiment.GetDetectorType() == DetectorType::DECTRIS) && (state == JFJochState::Idle)) {
|
||||
// Need to redo the calibration
|
||||
SetState(JFJochState::Busy, "Loading settings", BrokerStatus::MessageSeverity::Info);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::CalibrateDetector, this, std::move(ul));
|
||||
}
|
||||
}
|
||||
|
||||
ImagePusherStatus JFJochStateMachine::GetImagePusherStatus() const {
|
||||
return services.GetImagePusherStatus();
|
||||
}
|
||||
|
||||
+27
-27
@@ -1,8 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_JFJOCHSTATEMACHINE_H
|
||||
#define JUNGFRAUJOCH_JFJOCHSTATEMACHINE_H
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
@@ -15,17 +14,7 @@
|
||||
|
||||
#include "JFJochServices.h"
|
||||
#include "../common/ROIMap.h"
|
||||
|
||||
enum class JFJochState {Inactive, Idle, Measuring, Error, Busy, Pedestal};
|
||||
|
||||
struct BrokerStatus {
|
||||
JFJochState state = JFJochState::Inactive;
|
||||
std::optional<float> progress;
|
||||
std::optional<std::string> message;
|
||||
enum class MessageSeverity {Error, Info, Warning, Success} message_severity = MessageSeverity::Error;
|
||||
int64_t gpu_count;
|
||||
bool ml_resolution_estimation;
|
||||
};
|
||||
#include "../common/BrokerStatus.h"
|
||||
|
||||
struct DetectorListElement {
|
||||
std::string description;
|
||||
@@ -35,9 +24,9 @@ struct DetectorListElement {
|
||||
int64_t nmodules;
|
||||
int64_t width;
|
||||
int64_t height;
|
||||
std::chrono::microseconds readout_time;
|
||||
std::chrono::microseconds min_frame_time;
|
||||
std::chrono::microseconds min_count_time;
|
||||
std::chrono::nanoseconds readout_time;
|
||||
std::chrono::nanoseconds min_frame_time;
|
||||
std::chrono::nanoseconds min_count_time;
|
||||
DetectorType detector_type;
|
||||
float pixel_size_mm;
|
||||
};
|
||||
@@ -56,6 +45,8 @@ struct MeasurementStatistics {
|
||||
int64_t images_collected;
|
||||
int64_t images_sent;
|
||||
int64_t images_skipped;
|
||||
std::optional<int64_t> images_written;
|
||||
|
||||
int64_t max_image_number_sent;
|
||||
std::optional<float> collection_efficiency;
|
||||
std::optional<float> compression_ratio;
|
||||
@@ -96,13 +87,14 @@ class JFJochStateMachine {
|
||||
mutable std::mutex experiment_image_format_settings_mutex;
|
||||
mutable std::mutex experiment_file_writer_settings_mutex;
|
||||
mutable std::mutex experiment_indexing_settings_mutex;
|
||||
mutable std::mutex experiment_dark_mask_settings_mutex;
|
||||
DiffractionExperiment experiment;
|
||||
|
||||
// mutex m is protecting:
|
||||
mutable std::mutex m;
|
||||
std::condition_variable c;
|
||||
volatile JFJochState state = JFJochState::Inactive; // state should not be set directly, but through SetState function
|
||||
volatile bool cancel_sequence = false;
|
||||
std::atomic<JFJochState> state = JFJochState::Inactive; // state should not be set directly, but through SetState function
|
||||
std::atomic<bool> cancel_sequence = false;
|
||||
std::unique_ptr<JFCalibration> calibration;
|
||||
PixelMask pixel_mask;
|
||||
int64_t current_detector_setup; // Lock only on change
|
||||
@@ -124,7 +116,6 @@ class JFJochStateMachine {
|
||||
ROIDefinition roi;
|
||||
|
||||
bool indexing_possible;
|
||||
bool resolution_estimate_possible;
|
||||
|
||||
const int32_t gpu_count;
|
||||
|
||||
@@ -135,28 +126,33 @@ class JFJochStateMachine {
|
||||
const std::optional<std::string> &message = {},
|
||||
BrokerStatus::MessageSeverity message_severity = BrokerStatus::MessageSeverity::Info);
|
||||
void MeasurementThread();
|
||||
void PedestalThread(std::unique_lock<std::mutex> ul);
|
||||
void InitializeThread(std::unique_lock<std::mutex> ul);
|
||||
bool ImportPedestalG1G2(const JFJochReceiverOutput &receiver_output, size_t gain_level, size_t storage_cell = 0);
|
||||
bool ImportPedestalG0(const JFJochReceiverOutput &receiver_output);
|
||||
bool IsRunning() const; // Is state Busy/Pedestal/Measure
|
||||
void ResetError() noexcept;
|
||||
void TakePedestalInternalAll(std::unique_lock<std::mutex> &ul);
|
||||
void TakeDarkMaskInternal(std::unique_lock<std::mutex> &ul);
|
||||
void CalibrateDetector(std::unique_lock<std::mutex> ul);
|
||||
void CalibrateJUNGFRAU(std::unique_lock<std::mutex> &ul);
|
||||
void TakePedestalInternalG0(std::unique_lock<std::mutex> &ul);
|
||||
void TakePedestalInternalG1(std::unique_lock<std::mutex> &ul, int32_t storage_cell = 0);
|
||||
void TakePedestalInternalG2(std::unique_lock<std::mutex> &ul, int32_t storage_cell = 0);
|
||||
void ImportDetectorSettings(const DetectorSettings& input);
|
||||
bool ImportDetectorSettings(const DetectorSettings& input);
|
||||
|
||||
void UpdateROIDefinition();
|
||||
public:
|
||||
JFJochStateMachine(const DiffractionExperiment& experiment,
|
||||
JFJochServices &in_services,
|
||||
Logger &logger);
|
||||
Logger &logger,
|
||||
const SpotFindingSettings &spot_finding_settings = SpotFindingSettings());
|
||||
~JFJochStateMachine();
|
||||
|
||||
void Initialize();
|
||||
void Pedestal();
|
||||
void Deactivate();
|
||||
void Start(const DatasetSettings& settings);
|
||||
void Start(const DatasetSettings& settings, bool async = false);
|
||||
BrokerStatus WaitTillNotBusy(std::chrono::milliseconds timeout);
|
||||
|
||||
BrokerStatus WaitTillMeasurementDone();
|
||||
BrokerStatus WaitTillMeasurementDone(std::chrono::milliseconds timeout);
|
||||
void Trigger();
|
||||
@@ -185,6 +181,7 @@ public:
|
||||
|
||||
BrokerStatus GetStatus() const;
|
||||
MultiLinePlot GetPlots(const PlotRequest &request) const;
|
||||
void GetPlotRaw(std::vector<float> &v,PlotType type, const std::string &roi) const;
|
||||
|
||||
void SetSpotFindingSettings(const SpotFindingSettings& settings);
|
||||
SpotFindingSettings GetSpotFindingSettings() const;
|
||||
@@ -223,6 +220,7 @@ public:
|
||||
std::vector<uint32_t> GetUserPixelMask() const;
|
||||
|
||||
void SetUserPixelMask(const std::vector<uint32_t> &v);
|
||||
void SetUserPixelMask(const CompressedImage &image);
|
||||
|
||||
std::vector<DeviceStatus> GetDeviceStatus() const;
|
||||
|
||||
@@ -243,7 +241,9 @@ public:
|
||||
void AddDetectorSetup(const DetectorSetup& setup); // Not thread safe, only during setup
|
||||
|
||||
std::optional<ScanResult> GetScanResult() const;
|
||||
|
||||
void SetDarkMaskSettings(const DarkMaskSettings& settings);
|
||||
DarkMaskSettings GetDarkMaskSettings() const;
|
||||
|
||||
ImagePusherStatus GetImagePusherStatus() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHSTATEMACHINE_H
|
||||
|
||||
+250
-45
@@ -1,6 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include "../common/JFJochMath.h"
|
||||
#include "OpenAPIConvert.h"
|
||||
|
||||
// From https://en.cppreference.com/w/cpp/string/byte/tolower
|
||||
@@ -19,13 +20,11 @@ SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding
|
||||
ret.low_resolution_limit = input.getLowResolutionLimit();
|
||||
ret.enable = input.isEnable();
|
||||
ret.indexing = input.isIndexing();
|
||||
ret.resolution_estimate = input.isResolutionEstimate();
|
||||
ret.quick_integration = input.isQuickIntegration();
|
||||
if (input.filterPowderRingsIsSet())
|
||||
ret.filter_spots_powder_ring = input.isFilterPowderRings();
|
||||
if (input.minSpotCountPowderRingIsSet())
|
||||
ret.min_spot_count_powder_ring = input.getMinSpotCountPowderRing();
|
||||
|
||||
ret.cutoff_spot_count_low_res = input.getHighResolutionLimitForSpotCountLowRes();
|
||||
ret.ice_ring_width_Q_recipA = input.getIceRingWidthQRecipA();
|
||||
if (input.highResGapQRecipAIsSet())
|
||||
ret.high_res_gap_Q_recipA = input.getHighResGapQRecipA();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -39,10 +38,11 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin
|
||||
ret.setLowResolutionLimit(input.low_resolution_limit);
|
||||
ret.setEnable(input.enable);
|
||||
ret.setIndexing(input.indexing);
|
||||
ret.setFilterPowderRings(input.filter_spots_powder_ring);
|
||||
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
|
||||
ret.setResolutionEstimate(input.resolution_estimate);
|
||||
ret.setHighResolutionLimitForSpotCountLowRes(input.cutoff_spot_count_low_res);
|
||||
ret.setQuickIntegration(input.quick_integration);
|
||||
ret.setIceRingWidthQRecipA(input.ice_ring_width_Q_recipA);
|
||||
if (input.high_res_gap_Q_recipA.has_value())
|
||||
ret.setHighResGapQRecipA(input.high_res_gap_Q_recipA.value());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ 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);
|
||||
|
||||
|
||||
if (input.images_written)
|
||||
ret.setImagesWritten(input.images_written.value());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -171,9 +171,12 @@ DetectorSettings Convert(const org::openapitools::server::model::Detector_settin
|
||||
org::openapitools::server::model::Detector_settings Convert(const DetectorSettings &input) {
|
||||
org::openapitools::server::model::Detector_settings ret{};
|
||||
|
||||
ret.setFrameTimeUs(input.GetFrameTime().count());
|
||||
ret.setFrameTimeUs(std::chrono::round<std::chrono::microseconds>(
|
||||
std::chrono::duration<float>(input.GetFrameTime())).count());
|
||||
if (input.GetCountTime().has_value())
|
||||
ret.setCountTimeUs(input.GetCountTime()->count());
|
||||
ret.setCountTimeUs(std::chrono::round<std::chrono::microseconds>(
|
||||
std::chrono::duration<float>(input.GetCountTime().value())
|
||||
).count());
|
||||
ret.setDetectorTriggerDelayNs(input.GetDetectorDelay().count());
|
||||
ret.setInternalFrameGeneratorImages(input.GetInternalGeneratorImages());
|
||||
ret.setInternalFrameGenerator(input.IsInternalGeneratorEnable());
|
||||
@@ -216,7 +219,7 @@ org::openapitools::server::model::Broker_status Convert(const BrokerStatus& inpu
|
||||
case JFJochState::Busy:
|
||||
ret.setState("Busy");
|
||||
break;
|
||||
case JFJochState::Pedestal:
|
||||
case JFJochState::Calibration:
|
||||
ret.setState("Pedestal");
|
||||
break;
|
||||
}
|
||||
@@ -241,8 +244,8 @@ org::openapitools::server::model::Broker_status Convert(const BrokerStatus& inpu
|
||||
if (input.progress.has_value())
|
||||
ret.setProgress(input.progress.value());
|
||||
|
||||
ret.setMlResolutionEstimation(input.ml_resolution_estimation);
|
||||
ret.setGpuCount(input.gpu_count);
|
||||
ret.setBrokerVersion(input.broker_version);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -371,9 +374,9 @@ org::openapitools::server::model::Detector_list Convert(const DetectorList &inpu
|
||||
d.setSerialNumber(input.detector[i].serial_number);
|
||||
d.setBaseIpv4Addr(input.detector[i].base_ipv4_addr);
|
||||
d.setUdpInterfaceCount(input.detector[i].udp_interface_count);
|
||||
d.setMinFrameTimeUs(input.detector[i].min_frame_time.count());
|
||||
d.setMinCountTimeUs(input.detector[i].min_count_time.count());
|
||||
d.setReadoutTimeUs(input.detector[i].readout_time.count());
|
||||
d.setMinFrameTimeNs(input.detector[i].min_frame_time.count());
|
||||
d.setMinCountTimeNs(input.detector[i].min_count_time.count());
|
||||
d.setReadoutTimeNs(input.detector[i].readout_time.count());
|
||||
d.setPixelSizeMm(input.detector[i].pixel_size_mm);
|
||||
d.setType(Convert(input.detector[i].detector_type));
|
||||
dets.emplace_back(std::move(d));
|
||||
@@ -436,6 +439,7 @@ AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azi
|
||||
ret.QSpacing_recipA(input.getQSpacing());
|
||||
ret.QRange_recipA(input.getLowQRecipA(), input.getHighQRecipA());
|
||||
ret.AzimuthalBinCount(input.getAzimuthalBins());
|
||||
ret.ForceCPUinFPGAWorkflow(input.isForceCpu());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -447,6 +451,7 @@ org::openapitools::server::model::Azim_int_settings Convert(const AzimuthalInteg
|
||||
ret.setLowQRecipA(settings.GetLowQ_recipA());
|
||||
ret.setQSpacing(settings.GetQSpacing_recipA());
|
||||
ret.setAzimuthalBins(settings.GetAzimuthalBinCount());
|
||||
ret.setForceCpu(settings.IsForceCPUinFPGAWorkflow());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -456,10 +461,18 @@ ROIDefinition Convert(const org::openapitools::server::model::Roi_definitions& i
|
||||
output.boxes.emplace_back(ROIBox(i.getName(), i.getMinXPxl(), i.getMaxXPxl(), i.getMinYPxl(), i.getMaxYPxl()));
|
||||
for (const auto &i: input.getCircle().getRois())
|
||||
output.circles.emplace_back(ROICircle(i.getName(), i.getCenterXPxl(), i.getCenterYPxl(), i.getRadiusPxl()));
|
||||
for (const auto &i: input.getAzim().getRois())
|
||||
for (const auto &i: input.getAzim().getRois()) {
|
||||
// A sector needs both bounds; if only one is given, treat it as a full ring.
|
||||
float phi_min = 0, phi_max = 0;
|
||||
if (i.phiMinDegIsSet() && i.phiMaxDegIsSet()) {
|
||||
phi_min = i.getPhiMinDeg();
|
||||
phi_max = i.getPhiMaxDeg();
|
||||
}
|
||||
output.azimuthal.emplace_back(ROIAzimuthal(i.getName(),
|
||||
(i.getQMaxRecipA() == 0.0) ? 0.0 : 2.0f * M_PI / i.getQMaxRecipA(),
|
||||
(i.getQMinRecipA() == 0.0) ? 0.0 : 2.0f * M_PI / i.getQMinRecipA()));
|
||||
(i.getQMaxRecipA() == 0.0) ? 0.0 : 2.0f * PI / i.getQMaxRecipA(),
|
||||
(i.getQMinRecipA() == 0.0) ? 0.0 : 2.0f * PI / i.getQMinRecipA(),
|
||||
phi_min, phi_max));
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -486,6 +499,10 @@ org::openapitools::server::model::Roi_azim_list Convert(const std::vector<ROIAzi
|
||||
elem.setName(i.GetName());
|
||||
elem.setQMinRecipA(i.GetQMin_recipA());
|
||||
elem.setQMaxRecipA(i.GetQMax_recipA());
|
||||
if (i.HasPhi()) {
|
||||
elem.setPhiMinDeg(i.GetPhiMin_deg());
|
||||
elem.setPhiMaxDeg(i.GetPhiMax_deg());
|
||||
}
|
||||
tmp.emplace_back(elem);
|
||||
}
|
||||
ret.setRois(tmp);
|
||||
@@ -664,6 +681,17 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings
|
||||
ret.RingCurrent_mA(input.getRingCurrentMA());
|
||||
if (input.sampleTemperatureKIsSet())
|
||||
ret.SampleTemperature_K(input.getSampleTemperatureK());
|
||||
|
||||
ret.SpotFindingEnable(input.isSpotFinding());
|
||||
ret.MaxSpotCount(input.getMaxSpotCount());
|
||||
|
||||
ret.DetectIceRings(input.isDetectIceRings());
|
||||
|
||||
if (input.xrayFluorescenceSpectrumIsSet()) {
|
||||
auto fl = input.getXrayFluorescenceSpectrum();
|
||||
ret.FluorescenceSpectrum({fl.getEnergyEV(), fl.getData()});
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -715,7 +743,7 @@ org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPrevi
|
||||
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.setPeriodMs(std::chrono::round<std::chrono::milliseconds>(settings.period.value()).count());
|
||||
ret.setSocketAddress(settings.address);
|
||||
return ret;
|
||||
}
|
||||
@@ -724,7 +752,7 @@ org::openapitools::server::model::Zeromq_metadata_settings Convert(const ZMQMeta
|
||||
org::openapitools::server::model::Zeromq_metadata_settings ret;
|
||||
ret.setEnabled(settings.period.has_value());
|
||||
if (settings.period.has_value())
|
||||
ret.setPeriodMs(settings.period.value().count() / 1000);
|
||||
ret.setPeriodMs(std::chrono::round<std::chrono::milliseconds>(settings.period.value()).count());
|
||||
ret.setSocketAddress(settings.address);
|
||||
return ret;
|
||||
}
|
||||
@@ -732,8 +760,8 @@ org::openapitools::server::model::Zeromq_metadata_settings Convert(const ZMQMeta
|
||||
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);
|
||||
ret.setWrongGain(input.error_pixel);
|
||||
ret.setTooHighPedestalRms(input.noisy_pixel);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -744,12 +772,32 @@ org::openapitools::server::model::Image_buffer_status Convert(const ImageBufferS
|
||||
ret.setImageNumbers(input.images_in_the_buffer);
|
||||
ret.setMaxImageNumber(input.max_image_number);
|
||||
ret.setMinImageNumber(input.min_image_number);
|
||||
ret.setInPreparationSlots(input.preparation_slots);
|
||||
ret.setInSendingSlots(input.sending_slots);
|
||||
|
||||
if (input.current_counter.has_value())
|
||||
ret.setCurrentCounter(input.current_counter.value());
|
||||
return ret;
|
||||
}
|
||||
|
||||
ImageBufferStatus Convert(const org::openapitools::server::model::Image_buffer_status& input) {
|
||||
ImageBufferStatus ret;
|
||||
ret.available_slots = input.getAvailableSlots();
|
||||
ret.total_slots = input.getTotalSlots();
|
||||
ret.images_in_the_buffer = input.getImageNumbers();
|
||||
ret.max_image_number = input.getMaxImageNumber();
|
||||
ret.min_image_number = input.getMinImageNumber();
|
||||
ret.sending_slots = input.getInSendingSlots();
|
||||
ret.preparation_slots = input.getInPreparationSlots();
|
||||
|
||||
if (input.currentCounterIsSet())
|
||||
ret.current_counter = input.getCurrentCounter();
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::File_writer_settings Convert(const FileWriterSettings& input) {
|
||||
org::openapitools::server::model::File_writer_settings ret;
|
||||
ret.setFormat(Convert(input.GetHDF5MasterFormatVersion()));
|
||||
ret.setFormat(Convert(input.GetFileFormat()));
|
||||
ret.setOverwrite(input.IsOverwriteExistingFiles());
|
||||
return ret;
|
||||
}
|
||||
@@ -757,7 +805,7 @@ org::openapitools::server::model::File_writer_settings Convert(const FileWriterS
|
||||
FileWriterSettings Convert(const org::openapitools::server::model::File_writer_settings &input) {
|
||||
FileWriterSettings ret;
|
||||
ret.OverwriteExistingFiles(input.isOverwrite());
|
||||
ret.HDF5MasterFormatVersion(Convert(input.getFormat()));
|
||||
ret.FileFormat(Convert(input.getFormat()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -765,7 +813,7 @@ org::openapitools::server::model::File_writer_format Convert(FileWriterFormat in
|
||||
org::openapitools::server::model::File_writer_format ret;
|
||||
switch (input) {
|
||||
case FileWriterFormat::DataOnly:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NONE);
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXONLYDATA);
|
||||
break;
|
||||
case FileWriterFormat::NXmxLegacy:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXLEGACY);
|
||||
@@ -773,12 +821,18 @@ org::openapitools::server::model::File_writer_format Convert(FileWriterFormat in
|
||||
case FileWriterFormat::NXmxVDS:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXVDS);
|
||||
break;
|
||||
case FileWriterFormat::NXmxIntegrated:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXINTEGRATED);
|
||||
break;
|
||||
case FileWriterFormat::CBF:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::CBF);
|
||||
break;
|
||||
case FileWriterFormat::TIFF:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::TIFF);
|
||||
break;
|
||||
case FileWriterFormat::NoFile:
|
||||
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NOFILEWRITTEN);
|
||||
break;
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown file writer format enum value");
|
||||
}
|
||||
@@ -787,16 +841,20 @@ org::openapitools::server::model::File_writer_format Convert(FileWriterFormat in
|
||||
|
||||
FileWriterFormat Convert(const org::openapitools::server::model::File_writer_format& input) {
|
||||
switch (input.getValue()) {
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NONE:
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXONLYDATA:
|
||||
return FileWriterFormat::DataOnly;
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXLEGACY:
|
||||
return FileWriterFormat::NXmxLegacy;
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXVDS:
|
||||
return FileWriterFormat::NXmxVDS;
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXINTEGRATED:
|
||||
return FileWriterFormat::NXmxIntegrated;
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::CBF:
|
||||
return FileWriterFormat::CBF;
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::TIFF:
|
||||
return FileWriterFormat::TIFF;
|
||||
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NOFILEWRITTEN:
|
||||
return FileWriterFormat::NoFile;
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Unknown file writer format enum value");
|
||||
@@ -812,9 +870,12 @@ PlotType ConvertPlotType(const std::optional<std::string>& input) {
|
||||
if (input == "azint_1d") return PlotType::AzInt1D;
|
||||
if (input == "spot_count") return PlotType::SpotCount;
|
||||
if (input == "spot_count_low_res") return PlotType::SpotCountLowRes;
|
||||
if (input == "spot_count_indexed") return PlotType::SpotCountIndexed;
|
||||
if (input == "spot_count_ice") return PlotType::SpotCountIceRing;
|
||||
if (input == "indexing_rate") return PlotType::IndexingRate;
|
||||
if (input == "indexing_unit_cell_length") return PlotType::IndexingUnitCellLength;
|
||||
if (input == "mosaicity") return PlotType::IndexingMosaicity;
|
||||
if (input == "profile_radius") return PlotType::ProfileRadius;
|
||||
if (input == "mosaicity") return PlotType::Mosaicity;
|
||||
if (input == "b_factor") return PlotType::BFactor;
|
||||
if (input == "indexing_unit_cell_angle") return PlotType::IndexingUnitCellAngle;
|
||||
if (input == "error_pixels") return PlotType::ErrorPixels;
|
||||
@@ -832,26 +893,41 @@ PlotType ConvertPlotType(const std::optional<std::string>& input) {
|
||||
if (input == "packets_received") return PlotType::PacketsReceived;
|
||||
if (input == "max_pixel_value") return PlotType::MaxValue;
|
||||
if (input == "resolution_estimate") return PlotType::ResolutionEstimate;
|
||||
if (input == "indexing_time") return PlotType::IndexingTime;
|
||||
if (input == "pixel_sum") return PlotType::PixelSum;
|
||||
if (input == "processing_time") return PlotType::ImageProcessingTime;
|
||||
if (input == "beam_center_x") return PlotType::RefinementBeamX;
|
||||
if (input == "beam_center_y") return PlotType::RefinementBeamY;
|
||||
if (input == "integrated_reflections") return PlotType::IntegratedReflections;
|
||||
if (input == "image_scale_factor") return PlotType::ImageScaleFactor;
|
||||
if (input == "image_scale_cc") return PlotType::ImageScaleCC;
|
||||
if (input == "image_scale_b") return PlotType::ImageScaleBFactor;
|
||||
if (input == "compression_ratio") return PlotType::CompressionRatio;
|
||||
if (input == "indexing_lattice_count") return PlotType::IndexingLatticeCount;
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Plot type not recognized");
|
||||
}
|
||||
|
||||
ColorScaleEnum ConvertColorScale(const std::optional<std::string>& input) {
|
||||
std::string color = input.value_or("indigo");
|
||||
ColorScaleEnum ConvertColorScale(const std::optional<std::string> &input) {
|
||||
std::string color = input.value_or("indigo");
|
||||
|
||||
if (color == "viridis")
|
||||
return ColorScaleEnum::Viridis;
|
||||
else if (color == "bw")
|
||||
if (color == "bw")
|
||||
return ColorScaleEnum::BW;
|
||||
else if (color == "heat")
|
||||
return ColorScaleEnum::Heat;
|
||||
else if (color == "indigo")
|
||||
if (color == "wb")
|
||||
return ColorScaleEnum::WB;
|
||||
if (color == "green")
|
||||
return ColorScaleEnum::Green;
|
||||
if (color == "heat")
|
||||
return ColorScaleEnum::Heat;
|
||||
if (color == "indigo")
|
||||
return ColorScaleEnum::Indigo;
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Color scale unknown");
|
||||
if (color == "magma")
|
||||
return ColorScaleEnum::Magma;
|
||||
if (color == "inferno")
|
||||
return ColorScaleEnum::Inferno;
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Color scale unknown");
|
||||
}
|
||||
|
||||
IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input) {
|
||||
@@ -860,6 +936,9 @@ IndexingSettings Convert(const org::openapitools::server::model::Indexing_settin
|
||||
case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFT:
|
||||
ret.Algorithm(IndexingAlgorithmEnum::FFT);
|
||||
break;
|
||||
case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFTW:
|
||||
ret.Algorithm(IndexingAlgorithmEnum::FFTW);
|
||||
break;
|
||||
case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::NONE:
|
||||
ret.Algorithm(IndexingAlgorithmEnum::None);
|
||||
break;
|
||||
@@ -873,11 +952,34 @@ IndexingSettings Convert(const org::openapitools::server::model::Indexing_settin
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown indexing algorithm");
|
||||
}
|
||||
|
||||
switch (input.getGeomRefinementAlgorithm().getValue()) {
|
||||
case org::openapitools::server::model::Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown refinement algorithm");
|
||||
break;
|
||||
case org::openapitools::server::model::Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTER:
|
||||
ret.GeomRefinementAlgorithm(GeomRefinementAlgorithmEnum::BeamCenter);
|
||||
break;
|
||||
case org::openapitools::server::model::Geom_refinement_algorithm::eGeom_refinement_algorithm::ORIENTATIONONLY:
|
||||
ret.GeomRefinementAlgorithm(GeomRefinementAlgorithmEnum::OrientationOnly);
|
||||
break;
|
||||
case org::openapitools::server::model::Geom_refinement_algorithm::eGeom_refinement_algorithm::NONE:
|
||||
ret.GeomRefinementAlgorithm(GeomRefinementAlgorithmEnum::None);
|
||||
break;
|
||||
}
|
||||
|
||||
ret.FFT_HighResolution_A(input.getFftHighResolutionA());
|
||||
ret.FFT_MaxUnitCell_A(input.getFftMaxUnitCellA());
|
||||
ret.FFT_MinUnitCell_A(input.getFftMinUnitCellA());
|
||||
ret.FFT_NumVectors(input.getFftNumVectors());
|
||||
ret.Tolerance(input.getTolerance());
|
||||
ret.IndexingThreads(input.getThreadCount());
|
||||
ret.UnitCellDistTolerance(input.getUnitCellDistTolerance());
|
||||
ret.ViableCellMinSpots(input.getViableCellMinSpots());
|
||||
ret.IndexIceRings(input.isIndexIceRings());
|
||||
ret.RotationIndexing(input.isRotationIndexing());
|
||||
ret.RotationIndexingAngularStride_deg(input.getRotationIndexingAngularStrideDeg());
|
||||
ret.RotationIndexingMinAngularRange_deg(input.getRotationIndexingMinAngularRangeDeg());
|
||||
ret.BlockingBehavior(input.isBlocking());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -889,6 +991,26 @@ org::openapitools::server::model::Indexing_settings Convert(const IndexingSettin
|
||||
ret.setFftMaxUnitCellA(input.GetFFT_MaxUnitCell_A());
|
||||
ret.setFftNumVectors(input.GetFFT_NumVectors());
|
||||
ret.setTolerance(input.GetTolerance());
|
||||
ret.setThreadCount(input.GetIndexingThreads());
|
||||
ret.setUnitCellDistTolerance(input.GetUnitCellDistTolerance());
|
||||
ret.setViableCellMinSpots(input.GetViableCellMinSpots());
|
||||
ret.setRotationIndexing(input.GetRotationIndexing());
|
||||
ret.setRotationIndexingAngularStrideDeg(input.GetRotationIndexingAngularStride_deg());
|
||||
ret.setRotationIndexingMinAngularRangeDeg(input.GetRotationIndexingMinAngularRange_deg());
|
||||
ret.setBlocking(input.GetBlockingBehavior());
|
||||
|
||||
org::openapitools::server::model::Geom_refinement_algorithm refinement;
|
||||
switch (input.GetGeomRefinementAlgorithm()) {
|
||||
|
||||
case GeomRefinementAlgorithmEnum::None:
|
||||
refinement.setValue(org::openapitools::server::model::Geom_refinement_algorithm::eGeom_refinement_algorithm::NONE);
|
||||
break;
|
||||
case GeomRefinementAlgorithmEnum::BeamCenter:
|
||||
refinement.setValue(org::openapitools::server::model::Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTER);
|
||||
break;
|
||||
}
|
||||
|
||||
ret.setGeomRefinementAlgorithm(refinement);
|
||||
|
||||
org::openapitools::server::model::Indexing_algorithm tmp;
|
||||
switch (input.GetAlgorithm()) {
|
||||
@@ -901,11 +1023,15 @@ org::openapitools::server::model::Indexing_settings Convert(const IndexingSettin
|
||||
case IndexingAlgorithmEnum::FFT:
|
||||
tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFT);
|
||||
break;
|
||||
case IndexingAlgorithmEnum::FFTW:
|
||||
tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFTW);
|
||||
break;
|
||||
case IndexingAlgorithmEnum::None:
|
||||
tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::NONE);
|
||||
break;
|
||||
}
|
||||
ret.setAlgorithm(tmp);
|
||||
ret.setIndexIceRings(input.GetIndexIceRings());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -917,23 +1043,34 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
org::openapitools::server::model::Scan_result_images_inner tmp;
|
||||
tmp.setEfficiency(i.collection_efficiency);
|
||||
tmp.setNumber(i.number);
|
||||
if (i.x.has_value())
|
||||
tmp.setNx(i.x.value());
|
||||
if (i.y.has_value())
|
||||
tmp.setNy(i.y.value());
|
||||
|
||||
if (i.bkg.has_value())
|
||||
tmp.setBkg(i.bkg.value());
|
||||
|
||||
std::optional<uint64_t> pixel_sum;
|
||||
if (i.angle_deg.has_value())
|
||||
tmp.setAngle(i.angle_deg.value());
|
||||
if (i.pixel_sum.has_value())
|
||||
tmp.setPixelSum(i.pixel_sum.value());
|
||||
if (i.max_viable_pixel.has_value())
|
||||
tmp.setMax(i.max_viable_pixel.value());
|
||||
if (i.sat_pixels.has_value())
|
||||
tmp.setSat(i.sat_pixels.value());
|
||||
tmp.setSpots(i.spot_count);
|
||||
tmp.setSat(i.sat_pixels.value());
|
||||
if (i.spot_count.has_value())
|
||||
tmp.setSpots(i.spot_count.value());
|
||||
if (i.spot_count_ice.has_value())
|
||||
tmp.setSpotsIce(i.spot_count_ice.value());
|
||||
if (i.spot_count_low_res.has_value())
|
||||
tmp.setSpotsLowRes(i.spot_count_low_res.value());
|
||||
if (i.spot_count_indexed.has_value())
|
||||
tmp.setSpotsIndexed(i.spot_count_indexed.value());
|
||||
if (i.indexing_solution.has_value())
|
||||
tmp.setIndex(i.indexing_solution.value());
|
||||
if (i.mosaicity.has_value())
|
||||
tmp.setMos(i.mosaicity.value());
|
||||
if (i.profile_radius.has_value())
|
||||
tmp.setPr(i.profile_radius.value());
|
||||
if (i.b_factor.has_value())
|
||||
tmp.setB(i.b_factor.value());
|
||||
if (i.uc.has_value()) {
|
||||
@@ -946,6 +1083,8 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
uc.setGamma(i.uc->gamma);
|
||||
tmp.setUc(uc);
|
||||
}
|
||||
if (i.indexed_lattice_count.has_value())
|
||||
tmp.setLattCount(i.indexed_lattice_count.value());
|
||||
if (i.xfel_pulse_id.has_value())
|
||||
tmp.setXfelPulseid(i.xfel_pulse_id.value());
|
||||
if (i.res.has_value())
|
||||
@@ -953,5 +1092,71 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
v.emplace_back(std::move(tmp));
|
||||
}
|
||||
ret.setImages(v);
|
||||
if (input.rotation_lattice) {
|
||||
ret.setRotationCrystalLattice(input.rotation_lattice->GetVector());
|
||||
org::openapitools::server::model::Unit_cell uc;
|
||||
auto i_uc = input.rotation_lattice->GetUnitCell();
|
||||
|
||||
uc.setA(i_uc.a);
|
||||
uc.setB(i_uc.b);
|
||||
uc.setC(i_uc.c);
|
||||
uc.setAlpha(i_uc.alpha);
|
||||
uc.setBeta(i_uc.beta);
|
||||
uc.setGamma(i_uc.gamma);
|
||||
ret.setRotationUnitCell(uc);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Dark_mask_settings Convert(const DarkMaskSettings &input) {
|
||||
org::openapitools::server::model::Dark_mask_settings ret{};
|
||||
ret.setDetectorThresholdKeV(input.GetThreshold_keV());
|
||||
ret.setFrameTimeUs(std::chrono::round<std::chrono::microseconds>(
|
||||
std::chrono::duration<float>(input.GetFrameTime())
|
||||
).count());
|
||||
ret.setMaxFramesWithSignal(input.GetMaxFramesWithCounts());
|
||||
ret.setMaxAllowedPixelCount(input.GetMaxCounts());
|
||||
ret.setNumberOfFrames(input.GetNumberOfFrames());
|
||||
return ret;
|
||||
}
|
||||
|
||||
DarkMaskSettings Convert(const org::openapitools::server::model::Dark_mask_settings &input) {
|
||||
DarkMaskSettings ret{};
|
||||
ret.FrameTime(std::chrono::microseconds(input.getFrameTimeUs()))
|
||||
.NumberOfFrames(input.getNumberOfFrames())
|
||||
.MaxCounts(input.getMaxAllowedPixelCount())
|
||||
.MaxFramesWithCounts(input.getMaxFramesWithSignal())
|
||||
.Threshold_keV(input.getDetectorThresholdKeV());
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Image_pusher_status Convert(const ImagePusherStatus& input) {
|
||||
org::openapitools::server::model::Image_pusher_status ret;
|
||||
ret.setAddr(input.address);
|
||||
ret.setConnectedWriters(input.connected_writers);
|
||||
org::openapitools::server::model::Image_pusher_type tmp;
|
||||
switch (input.pusher_type) {
|
||||
case ImagePusherType::HDF5:
|
||||
tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::HDF5);
|
||||
break;
|
||||
case ImagePusherType::CBOR:
|
||||
tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::CBOR);
|
||||
break;
|
||||
case ImagePusherType::TCP:
|
||||
tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::TCP);
|
||||
break;
|
||||
case ImagePusherType::ZMQ:
|
||||
tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::ZEROMQ);
|
||||
break;
|
||||
default:
|
||||
tmp.setValue(org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::NONE);
|
||||
break;
|
||||
}
|
||||
ret.setPusherType(tmp);
|
||||
if (input.images_written)
|
||||
ret.setImagesWritten(input.images_written.value());
|
||||
if (input.images_write_error)
|
||||
ret.setImagesWriteError(input.images_write_error.value());
|
||||
ret.setWriterFifoUtilization(input.writer_fifo_utilization);
|
||||
return ret;
|
||||
}
|
||||
+11
-4
@@ -1,9 +1,10 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JFJOCH_OPENAPICONVERT_H
|
||||
#define JFJOCH_OPENAPICONVERT_H
|
||||
#pragma once
|
||||
|
||||
#include "Dark_mask_settings.h"
|
||||
#include "Image_pusher_status.h"
|
||||
#include "gen/model/Spot_finding_settings.h"
|
||||
#include "gen/model/Measurement_statistics.h"
|
||||
#include "gen/model/Detector_settings.h"
|
||||
@@ -32,12 +33,13 @@
|
||||
#include "../common/JFJochMessages.h"
|
||||
#include "../common/DatasetSettings.h"
|
||||
#include "../common/ImageFormatSettings.h"
|
||||
#include "../image_analysis/SpotFindingSettings.h"
|
||||
#include "../image_analysis/spot_finding/SpotFindingSettings.h"
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../common/DetectorSettings.h"
|
||||
#include "../jungfrau/JFCalibration.h"
|
||||
#include "../common/InstrumentMetadata.h"
|
||||
#include "../common/ScanResult.h"
|
||||
#include "../image_pusher/ImagePusher.h"
|
||||
|
||||
SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input);
|
||||
org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input);
|
||||
@@ -74,6 +76,7 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings
|
||||
std::vector<org::openapitools::server::model::Fpga_status_inner> Convert(const std::vector<DeviceStatus> &input);
|
||||
org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input);
|
||||
org::openapitools::server::model::Image_buffer_status Convert(const ImageBufferStatus& input);
|
||||
ImageBufferStatus Convert(const org::openapitools::server::model::Image_buffer_status& input);
|
||||
|
||||
org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPreviewSettings& settings);
|
||||
ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_preview_settings& input);
|
||||
@@ -88,4 +91,8 @@ ColorScaleEnum ConvertColorScale(const std::optional<std::string>& input);
|
||||
|
||||
org::openapitools::server::model::Scan_result Convert(const ScanResult& input);
|
||||
|
||||
#endif //JFJOCH_OPENAPICONVERT_H
|
||||
org::openapitools::server::model::Dark_mask_settings Convert(const DarkMaskSettings& input);
|
||||
DarkMaskSettings Convert(const org::openapitools::server::model::Dark_mask_settings& input);
|
||||
|
||||
org::openapitools::server::model::Image_pusher_status Convert(const ImagePusherStatus& input);
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Generated OpenAPI cpp-pistache-server output.
|
||||
#
|
||||
# Only model/ is compiled (into the JFJochAPI library) and tracked. The REST
|
||||
# server is hand-written on cpp-httplib (see broker/JFJochBrokerHttp.cpp), so the
|
||||
# generated Pistache server stubs below are regeneration debris: never compiled,
|
||||
# and they tend to carry a newer spec version than the committed models. Keep
|
||||
# them out of git to avoid accidentally committing mismatched artefacts.
|
||||
/api/
|
||||
/impl/
|
||||
/main-api-server.cpp
|
||||
/CMakeLists.txt
|
||||
/README.md
|
||||
/.openapi-generator/
|
||||
/.openapi-generator-ignore
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* ApiBase.h
|
||||
*
|
||||
* Generalization of the Api classes
|
||||
*/
|
||||
|
||||
#ifndef ApiBase_H_
|
||||
#define ApiBase_H_
|
||||
|
||||
#include <pistache/router.h>
|
||||
#include <memory>
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
class ApiBase {
|
||||
public:
|
||||
explicit ApiBase(const std::shared_ptr<Pistache::Rest::Router>& rtr) : router(rtr) {};
|
||||
virtual ~ApiBase() = default;
|
||||
virtual void init() = 0;
|
||||
|
||||
protected:
|
||||
const std::shared_ptr<Pistache::Rest::Router> router;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::api
|
||||
|
||||
#endif /* ApiBase_H_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,612 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* DefaultApi.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DefaultApi_H_
|
||||
#define DefaultApi_H_
|
||||
|
||||
|
||||
#include "ApiBase.h"
|
||||
|
||||
#include <pistache/http.h>
|
||||
#include <pistache/router.h>
|
||||
#include <pistache/http_headers.h>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "Azim_int_settings.h"
|
||||
#include "Broker_status.h"
|
||||
#include "Calibration_statistics_inner.h"
|
||||
#include "Dataset_settings.h"
|
||||
#include "Detector_list.h"
|
||||
#include "Detector_selection.h"
|
||||
#include "Detector_settings.h"
|
||||
#include "Detector_status.h"
|
||||
#include "Error_message.h"
|
||||
#include "File_writer_settings.h"
|
||||
#include "Fpga_status_inner.h"
|
||||
#include "Image_buffer_status.h"
|
||||
#include "Image_format_settings.h"
|
||||
#include "Indexing_settings.h"
|
||||
#include "Instrument_metadata.h"
|
||||
#include "Jfjoch_statistics.h"
|
||||
#include "Measurement_statistics.h"
|
||||
#include "Plots.h"
|
||||
#include "Roi_definitions.h"
|
||||
#include "Scan_result.h"
|
||||
#include "Spot_finding_settings.h"
|
||||
#include "Zeromq_metadata_settings.h"
|
||||
#include "Zeromq_preview_settings.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
class DefaultApi : public ApiBase {
|
||||
public:
|
||||
explicit DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr);
|
||||
~DefaultApi() override = default;
|
||||
void init() override;
|
||||
|
||||
static const std::string base;
|
||||
|
||||
private:
|
||||
void setupRoutes();
|
||||
|
||||
void cancel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_azim_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_file_writer_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_file_writer_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_conversion_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_raw_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_indexing_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_indexing_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_instrument_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_roi_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_roi_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_zeromq_metadata_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_zeromq_metadata_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_zeromq_preview_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_zeromq_preview_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void fpga_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_clear_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_png_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void image_buffer_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void preview_plot_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void result_scan_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void statistics_data_collection_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void statistics_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void trigger_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void version_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void wait_till_done_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void xfel_event_code_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void xfel_pulse_id_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void default_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual void handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(const std::exception& ex) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual void handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception& ex) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Cancel running data collection
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Command will inform FPGA network card to stop pedestal or data collection at the current stage. Any frame that is currently being processed by CPU will be finished and sent to writer. Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to `Idle` state. If data collection is not running, the command has no effect.
|
||||
/// </remarks>
|
||||
virtual void cancel_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get radial integration configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_azim_int_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure radial integration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done when detector is Inactive or Idle
|
||||
/// </remarks>
|
||||
/// <param name="azimIntSettings"> (optional)</param>
|
||||
virtual void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &azimIntSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get detector configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_detector_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change detector configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. This can only be done when detector is `Idle`, `Error` or `Inactive` states. If detector is in `Idle` state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation. If detector is in `Inactive` or `Error` states, new settings will be saved, but no calibration will be executed.
|
||||
/// </remarks>
|
||||
/// <param name="detectorSettings"> (optional)</param>
|
||||
virtual void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get file writer settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_file_writer_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change file writer settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="fileWriterSettings"> (optional)</param>
|
||||
virtual void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure format for data collection with full conversion
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
virtual void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get image output format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_image_format_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change image output format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="imageFormatSettings"> (optional)</param>
|
||||
virtual void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure format for raw data collection
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
virtual void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get indexing configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_indexing_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change indexing algorithm settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="indexingSettings"> (optional)</param>
|
||||
virtual void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get instrument metadata
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_instrument_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change instrument metadata
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="instrumentMetadata"> (optional)</param>
|
||||
virtual void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Load binary image for internal FPGA generator
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).
|
||||
/// </remarks>
|
||||
virtual void config_internal_generator_image_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Load TIFF image for internal FPGA generator
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).
|
||||
/// </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 (binary)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Detector must be Initialized. 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>
|
||||
/// Should be in `Idle` state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values
|
||||
/// </remarks>
|
||||
virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get ROI definitions
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void config_roi_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Upload ROI definitions
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="roiDefinitions"> (optional)</param>
|
||||
virtual void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// List available detectors
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Configured detectors that can be selected by used
|
||||
/// </remarks>
|
||||
virtual void config_select_detector_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Select detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Jungfraujoch allows to control multiple detectors and/or region-of-interests. The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response). Changing detector will set detector to `Inactive` state and will require reinitialization.
|
||||
/// </remarks>
|
||||
/// <param name="detectorSelection"> (optional)</param>
|
||||
virtual void config_select_detector_put(const org::openapitools::server::model::Detector_selection &detectorSelection, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get data processing configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_spot_finding_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure spot finding
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime, also while data collection is running
|
||||
/// </remarks>
|
||||
/// <param name="spotFindingSettings"> (optional)</param>
|
||||
virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Detector must be Initialized. Get user mask of the detector (binary)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Upload user mask of the detector (binary)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should be in `Idle` 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't need to be assigned value. Mask is expected as binary array (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration.
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Detector must be Initialized. Get user mask of the detector (TIFF)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Upload user mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should be in `Idle` 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't need to be assigned value. Mask is expected as TIFF (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images.
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get ZeroMQ metadata socket settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Set ZeroMQ metadata settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request.
|
||||
/// </remarks>
|
||||
/// <param name="zeromqMetadataSettings"> (optional)</param>
|
||||
virtual void config_zeromq_metadata_put(const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get ZeroMQ preview settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void config_zeromq_preview_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Set ZeroMQ preview settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. Options set with this PUT request have no effect on HTTP based preview.
|
||||
/// </remarks>
|
||||
/// <param name="zeromqPreviewSettings"> (optional)</param>
|
||||
virtual void config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Prepare detector to turn off
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should be in `Idle` or `Error` state. Command deactivates data acquisition and turns off detector high voltage and ASIC. Should be used always before turning off power from the detector.
|
||||
/// </remarks>
|
||||
virtual void deactivate_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get detector status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Status of the JUNGFRAU detector
|
||||
/// </remarks>
|
||||
virtual void detector_status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get status of FPGA devices
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void fpga_status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Clear image buffer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data.
|
||||
/// </remarks>
|
||||
virtual void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get image message in CBOR format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Contains full image data and metadata. The image must come from the latest data collection.
|
||||
/// </remarks>
|
||||
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
|
||||
virtual void image_buffer_image_cbor_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get preview image in JPEG format using custom settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
|
||||
/// <param name="showUserMask">Show user mask (optional, default to false)</param>
|
||||
/// <param name="showRoi">Show ROI areas on the image (optional, default to false)</param>
|
||||
/// <param name="showSpots">Show spot finding results on the image (optional, default to true)</param>
|
||||
/// <param name="showBeamCenter">Show beam center on the image (optional, default to true)</param>
|
||||
/// <param name="saturation">Saturation value to set contrast in the preview image (optional, default to 10.0f)</param>
|
||||
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
|
||||
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
|
||||
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to "indigo")</param>
|
||||
virtual void image_buffer_image_jpeg_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get preview image in PNG format using custom settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
|
||||
/// <param name="showUserMask">Show user mask (optional, default to false)</param>
|
||||
/// <param name="showRoi">Show ROI areas on the image (optional, default to false)</param>
|
||||
/// <param name="showSpots">Show spot finding results on the image (optional, default to true)</param>
|
||||
/// <param name="showBeamCenter">Show beam center on the image (optional, default to true)</param>
|
||||
/// <param name="saturation">Saturation value to set contrast in the preview image (optional, default to 10.0f)</param>
|
||||
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
|
||||
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
|
||||
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to "indigo")</param>
|
||||
virtual void image_buffer_image_png_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<bool> &showBeamCenter, const std::optional<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get preview image in TIFF format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
|
||||
virtual void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get Start message in CBOR format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Contains metadata for a dataset (e.g., experimental geometry)
|
||||
/// </remarks>
|
||||
virtual void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get status of the image buffers
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor.
|
||||
/// </remarks>
|
||||
virtual void image_buffer_status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Initialize detector and data acquisition
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should be used in two cases: - Detector is in `Inactive` state - Detector is in `Error` state X-ray shutter must be closed. This operation will reconfigure network interface of the detector. During operation of the detector it is recommended to use the `POST /pedestal` operation instead. If storage cells are used, the execution time might be few minutes. This is async function - one needs to use `POST /wait_till_done` to ensure operation is done.
|
||||
/// </remarks>
|
||||
virtual void initialize_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Collect dark current for the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Updates calibration of the JUNGFRAU detector. Must be in `Idle` state. X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us). This is async function - one needs to use `POST /wait_till_done` to ensure operation is done.
|
||||
/// </remarks>
|
||||
virtual void pedestal_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get pedestal in TIFF format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="gainLevel">Gain level (0, 1, 2)</param>
|
||||
/// <param name="sc">Storage cell number (optional, default to 0)</param>
|
||||
virtual void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel, const std::optional<int32_t> &sc, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate 1D plot from Jungfraujoch
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="type">Type of requested plot</param>
|
||||
/// <param name="binning">Binning of frames for the plot (0 = default binning) (optional, default to 0)</param>
|
||||
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to false)</param>
|
||||
/// <param name="experimentalCoord">If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored (optional, default to false)</param>
|
||||
/// <param name="azintUnit">Unit used for azim int. (optional, default to "Q_recipA")</param>
|
||||
virtual void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning, const std::optional<bool> &compression, const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get full scan result
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void result_scan_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Start detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Start data acquisition. Detector must be in `Idle` state. Doesn't run calibration procedure. When the function returns, detector is ready to accept soft/TTL triggers.
|
||||
/// </remarks>
|
||||
/// <param name="datasetSettings"> (optional)</param>
|
||||
virtual void start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get calibration statistics
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Statistics are provided for each module/storage cell separately
|
||||
/// </remarks>
|
||||
virtual void statistics_calibration_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get data collection statistics
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Results of the last data collection
|
||||
/// </remarks>
|
||||
virtual void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get general statistics
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to false)</param>
|
||||
virtual void statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get Jungfraujoch status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Status of the data acquisition
|
||||
/// </remarks>
|
||||
virtual void status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Send soft trigger to the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Generate soft trigger
|
||||
/// </remarks>
|
||||
virtual void trigger_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get Jungfraujoch version of jfjoch_broker
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void version_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Wait for acquisition done
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.
|
||||
/// </remarks>
|
||||
/// <param name="timeout">Timeout in seconds (0 == immediate response) (optional, default to 60)</param>
|
||||
virtual void wait_till_done_post(const std::optional<int32_t> &timeout, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Return XFEL event codes for the current data acquisition
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Return array of XFEL event codes
|
||||
/// </remarks>
|
||||
virtual void xfel_event_code_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Return XFEL pulse IDs for the current data acquisition
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Return array of XFEL pulse IDs - (-1) if image not recorded
|
||||
/// </remarks>
|
||||
virtual void xfel_pulse_id_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::api
|
||||
|
||||
#endif /* DefaultApi_H_ */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -28,6 +28,8 @@ Azim_int_settings::Azim_int_settings()
|
||||
m_Q_spacing = 0.0f;
|
||||
m_Azimuthal_bins = 1L;
|
||||
m_Azimuthal_binsIsSet = false;
|
||||
m_Force_cpu = false;
|
||||
m_Force_cpuIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +52,59 @@ bool Azim_int_settings::validate(std::stringstream& msg, const std::string& path
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Azim_int_settings" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
|
||||
/* High_q_recipA */ {
|
||||
const float& value = m_High_q_recipA;
|
||||
const std::string currentValuePath = _pathPrefix + ".highQRecipA";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.000020))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.000020;";
|
||||
}
|
||||
if (value > static_cast<float>(10.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 10.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Low_q_recipA */ {
|
||||
const float& value = m_Low_q_recipA;
|
||||
const std::string currentValuePath = _pathPrefix + ".lowQRecipA";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.000010))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.000010;";
|
||||
}
|
||||
if (value > static_cast<float>(10))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 10;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Q_spacing */ {
|
||||
const float& value = m_Q_spacing;
|
||||
const std::string currentValuePath = _pathPrefix + ".qSpacing";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.000010))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.000010;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (azimuthalBinsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Azimuthal_bins;
|
||||
@@ -62,14 +116,14 @@ bool Azim_int_settings::validate(std::stringstream& msg, const std::string& path
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 256ll)
|
||||
if (value > 512ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 256;";
|
||||
msg << currentValuePath << ": must be less than or equal to 512;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -94,7 +148,10 @@ bool Azim_int_settings::operator==(const Azim_int_settings& rhs) const
|
||||
&&
|
||||
|
||||
|
||||
((!azimuthalBinsIsSet() && !rhs.azimuthalBinsIsSet()) || (azimuthalBinsIsSet() && rhs.azimuthalBinsIsSet() && getAzimuthalBins() == rhs.getAzimuthalBins()))
|
||||
((!azimuthalBinsIsSet() && !rhs.azimuthalBinsIsSet()) || (azimuthalBinsIsSet() && rhs.azimuthalBinsIsSet() && getAzimuthalBins() == rhs.getAzimuthalBins())) &&
|
||||
|
||||
|
||||
((!forceCpuIsSet() && !rhs.forceCpuIsSet()) || (forceCpuIsSet() && rhs.forceCpuIsSet() && isForceCpu() == rhs.isForceCpu()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -114,6 +171,8 @@ void to_json(nlohmann::json& j, const Azim_int_settings& o)
|
||||
j["q_spacing"] = o.m_Q_spacing;
|
||||
if(o.azimuthalBinsIsSet())
|
||||
j["azimuthal_bins"] = o.m_Azimuthal_bins;
|
||||
if(o.forceCpuIsSet())
|
||||
j["force_cpu"] = o.m_Force_cpu;
|
||||
|
||||
}
|
||||
|
||||
@@ -129,6 +188,11 @@ void from_json(const nlohmann::json& j, Azim_int_settings& o)
|
||||
j.at("azimuthal_bins").get_to(o.m_Azimuthal_bins);
|
||||
o.m_Azimuthal_binsIsSet = true;
|
||||
}
|
||||
if(j.find("force_cpu") != j.end())
|
||||
{
|
||||
j.at("force_cpu").get_to(o.m_Force_cpu);
|
||||
o.m_Force_cpuIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -189,6 +253,23 @@ void Azim_int_settings::unsetAzimuthal_bins()
|
||||
{
|
||||
m_Azimuthal_binsIsSet = false;
|
||||
}
|
||||
bool Azim_int_settings::isForceCpu() const
|
||||
{
|
||||
return m_Force_cpu;
|
||||
}
|
||||
void Azim_int_settings::setForceCpu(bool const value)
|
||||
{
|
||||
m_Force_cpu = value;
|
||||
m_Force_cpuIsSet = true;
|
||||
}
|
||||
bool Azim_int_settings::forceCpuIsSet() const
|
||||
{
|
||||
return m_Force_cpuIsSet;
|
||||
}
|
||||
void Azim_int_settings::unsetForce_cpu()
|
||||
{
|
||||
m_Force_cpuIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -58,12 +58,12 @@ public:
|
||||
/// Azim_int_settings members
|
||||
|
||||
/// <summary>
|
||||
/// Apply polarization correction for radial integration (polarization factor must be configured in dataset settings)
|
||||
/// Apply polarization correction for azimuthal integration (polarization factor must be configured in dataset settings)
|
||||
/// </summary>
|
||||
bool isPolarizationCorr() const;
|
||||
void setPolarizationCorr(bool const value);
|
||||
/// <summary>
|
||||
/// Apply solid angle correction for radial integration
|
||||
/// Apply solid angle correction for azimuthal integration
|
||||
/// </summary>
|
||||
bool isSolidAngleCorr() const;
|
||||
void setSolidAngleCorr(bool const value);
|
||||
@@ -83,12 +83,19 @@ public:
|
||||
float getQSpacing() const;
|
||||
void setQSpacing(float const value);
|
||||
/// <summary>
|
||||
/// Numer of azimuthal (phi) bins; 1 = standard 1D radial integration
|
||||
/// Numer of azimuthal (phi) bins; 1 = standard 1D azimuthal integration
|
||||
/// </summary>
|
||||
int64_t getAzimuthalBins() const;
|
||||
void setAzimuthalBins(int64_t const value);
|
||||
bool azimuthalBinsIsSet() const;
|
||||
void unsetAzimuthal_bins();
|
||||
/// <summary>
|
||||
/// Force CPU processing of azimuthal integration in the FPGA data acquisition workflow. This allows to extend number of azimuthal integration bins, as well as to calculate standard deviation of the azimuthal integration results.
|
||||
/// </summary>
|
||||
bool isForceCpu() const;
|
||||
void setForceCpu(bool const value);
|
||||
bool forceCpuIsSet() const;
|
||||
void unsetForce_cpu();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Azim_int_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Azim_int_settings& o);
|
||||
@@ -105,6 +112,8 @@ protected:
|
||||
|
||||
int64_t m_Azimuthal_bins;
|
||||
bool m_Azimuthal_binsIsSet;
|
||||
bool m_Force_cpu;
|
||||
bool m_Force_cpuIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -30,8 +30,8 @@ Broker_status::Broker_status()
|
||||
m_Message_severityIsSet = false;
|
||||
m_Gpu_count = 0;
|
||||
m_Gpu_countIsSet = false;
|
||||
m_Ml_resolution_estimation = false;
|
||||
m_Ml_resolution_estimationIsSet = false;
|
||||
m_Broker_version = "";
|
||||
m_Broker_versionIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ bool Broker_status::operator==(const Broker_status& rhs) const
|
||||
((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount())) &&
|
||||
|
||||
|
||||
((!mlResolutionEstimationIsSet() && !rhs.mlResolutionEstimationIsSet()) || (mlResolutionEstimationIsSet() && rhs.mlResolutionEstimationIsSet() && isMlResolutionEstimation() == rhs.isMlResolutionEstimation()))
|
||||
((!brokerVersionIsSet() && !rhs.brokerVersionIsSet()) || (brokerVersionIsSet() && rhs.brokerVersionIsSet() && getBrokerVersion() == rhs.getBrokerVersion()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -120,8 +120,8 @@ void to_json(nlohmann::json& j, const Broker_status& o)
|
||||
j["message_severity"] = o.m_Message_severity;
|
||||
if(o.gpuCountIsSet())
|
||||
j["gpu_count"] = o.m_Gpu_count;
|
||||
if(o.mlResolutionEstimationIsSet())
|
||||
j["ml_resolution_estimation"] = o.m_Ml_resolution_estimation;
|
||||
if(o.brokerVersionIsSet())
|
||||
j["broker_version"] = o.m_Broker_version;
|
||||
|
||||
}
|
||||
|
||||
@@ -148,10 +148,10 @@ void from_json(const nlohmann::json& j, Broker_status& o)
|
||||
j.at("gpu_count").get_to(o.m_Gpu_count);
|
||||
o.m_Gpu_countIsSet = true;
|
||||
}
|
||||
if(j.find("ml_resolution_estimation") != j.end())
|
||||
if(j.find("broker_version") != j.end())
|
||||
{
|
||||
j.at("ml_resolution_estimation").get_to(o.m_Ml_resolution_estimation);
|
||||
o.m_Ml_resolution_estimationIsSet = true;
|
||||
j.at("broker_version").get_to(o.m_Broker_version);
|
||||
o.m_Broker_versionIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -232,22 +232,22 @@ void Broker_status::unsetGpu_count()
|
||||
{
|
||||
m_Gpu_countIsSet = false;
|
||||
}
|
||||
bool Broker_status::isMlResolutionEstimation() const
|
||||
std::string Broker_status::getBrokerVersion() const
|
||||
{
|
||||
return m_Ml_resolution_estimation;
|
||||
return m_Broker_version;
|
||||
}
|
||||
void Broker_status::setMlResolutionEstimation(bool const value)
|
||||
void Broker_status::setBrokerVersion(std::string const& value)
|
||||
{
|
||||
m_Ml_resolution_estimation = value;
|
||||
m_Ml_resolution_estimationIsSet = true;
|
||||
m_Broker_version = value;
|
||||
m_Broker_versionIsSet = true;
|
||||
}
|
||||
bool Broker_status::mlResolutionEstimationIsSet() const
|
||||
bool Broker_status::brokerVersionIsSet() const
|
||||
{
|
||||
return m_Ml_resolution_estimationIsSet;
|
||||
return m_Broker_versionIsSet;
|
||||
}
|
||||
void Broker_status::unsetMl_resolution_estimation()
|
||||
void Broker_status::unsetBroker_version()
|
||||
{
|
||||
m_Ml_resolution_estimationIsSet = false;
|
||||
m_Broker_versionIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -92,12 +92,12 @@ public:
|
||||
bool gpuCountIsSet() const;
|
||||
void unsetGpu_count();
|
||||
/// <summary>
|
||||
/// ML resolution estimation available
|
||||
/// Version of the jfjoch_broker
|
||||
/// </summary>
|
||||
bool isMlResolutionEstimation() const;
|
||||
void setMlResolutionEstimation(bool const value);
|
||||
bool mlResolutionEstimationIsSet() const;
|
||||
void unsetMl_resolution_estimation();
|
||||
std::string getBrokerVersion() const;
|
||||
void setBrokerVersion(std::string const& value);
|
||||
bool brokerVersionIsSet() const;
|
||||
void unsetBroker_version();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Broker_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Broker_status& o);
|
||||
@@ -112,8 +112,8 @@ protected:
|
||||
bool m_Message_severityIsSet;
|
||||
int32_t m_Gpu_count;
|
||||
bool m_Gpu_countIsSet;
|
||||
bool m_Ml_resolution_estimation;
|
||||
bool m_Ml_resolution_estimationIsSet;
|
||||
std::string m_Broker_version;
|
||||
bool m_Broker_versionIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* 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 "Dark_mask_settings.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Dark_mask_settings::Dark_mask_settings()
|
||||
{
|
||||
m_Detector_threshold_keV = 3.5f;
|
||||
m_Frame_time_us = 10000L;
|
||||
m_Number_of_frames = 1000L;
|
||||
m_Max_allowed_pixel_count = 1L;
|
||||
m_Max_frames_with_signal = 10L;
|
||||
|
||||
}
|
||||
|
||||
void Dark_mask_settings::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Dark_mask_settings::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Dark_mask_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Dark_mask_settings" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
/* Detector_threshold_keV */ {
|
||||
const float& value = m_Detector_threshold_keV;
|
||||
const std::string currentValuePath = _pathPrefix + ".detectorThresholdKeV";
|
||||
|
||||
|
||||
if (value < static_cast<float>(2.5))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 2.5;";
|
||||
}
|
||||
if (value > static_cast<float>(100.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 100.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Frame_time_us */ {
|
||||
const int64_t& value = m_Frame_time_us;
|
||||
const std::string currentValuePath = _pathPrefix + ".frameTimeUs";
|
||||
|
||||
|
||||
if (value < 500ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 500;";
|
||||
}
|
||||
if (value > 100000ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 100000;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Number_of_frames */ {
|
||||
const int64_t& value = m_Number_of_frames;
|
||||
const std::string currentValuePath = _pathPrefix + ".numberOfFrames";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Max_allowed_pixel_count */ {
|
||||
const int64_t& value = m_Max_allowed_pixel_count;
|
||||
const std::string currentValuePath = _pathPrefix + ".maxAllowedPixelCount";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Max_frames_with_signal */ {
|
||||
const int64_t& value = m_Max_frames_with_signal;
|
||||
const std::string currentValuePath = _pathPrefix + ".maxFramesWithSignal";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Dark_mask_settings::operator==(const Dark_mask_settings& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getDetectorThresholdKeV() == rhs.getDetectorThresholdKeV())
|
||||
&&
|
||||
|
||||
(getFrameTimeUs() == rhs.getFrameTimeUs())
|
||||
&&
|
||||
|
||||
(getNumberOfFrames() == rhs.getNumberOfFrames())
|
||||
&&
|
||||
|
||||
(getMaxAllowedPixelCount() == rhs.getMaxAllowedPixelCount())
|
||||
&&
|
||||
|
||||
(getMaxFramesWithSignal() == rhs.getMaxFramesWithSignal())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Dark_mask_settings::operator!=(const Dark_mask_settings& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Dark_mask_settings& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["detector_threshold_keV"] = o.m_Detector_threshold_keV;
|
||||
j["frame_time_us"] = o.m_Frame_time_us;
|
||||
j["number_of_frames"] = o.m_Number_of_frames;
|
||||
j["max_allowed_pixel_count"] = o.m_Max_allowed_pixel_count;
|
||||
j["max_frames_with_signal"] = o.m_Max_frames_with_signal;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Dark_mask_settings& o)
|
||||
{
|
||||
j.at("detector_threshold_keV").get_to(o.m_Detector_threshold_keV);
|
||||
j.at("frame_time_us").get_to(o.m_Frame_time_us);
|
||||
j.at("number_of_frames").get_to(o.m_Number_of_frames);
|
||||
j.at("max_allowed_pixel_count").get_to(o.m_Max_allowed_pixel_count);
|
||||
j.at("max_frames_with_signal").get_to(o.m_Max_frames_with_signal);
|
||||
|
||||
}
|
||||
|
||||
float Dark_mask_settings::getDetectorThresholdKeV() const
|
||||
{
|
||||
return m_Detector_threshold_keV;
|
||||
}
|
||||
void Dark_mask_settings::setDetectorThresholdKeV(float const value)
|
||||
{
|
||||
m_Detector_threshold_keV = value;
|
||||
}
|
||||
int64_t Dark_mask_settings::getFrameTimeUs() const
|
||||
{
|
||||
return m_Frame_time_us;
|
||||
}
|
||||
void Dark_mask_settings::setFrameTimeUs(int64_t const value)
|
||||
{
|
||||
m_Frame_time_us = value;
|
||||
}
|
||||
int64_t Dark_mask_settings::getNumberOfFrames() const
|
||||
{
|
||||
return m_Number_of_frames;
|
||||
}
|
||||
void Dark_mask_settings::setNumberOfFrames(int64_t const value)
|
||||
{
|
||||
m_Number_of_frames = value;
|
||||
}
|
||||
int64_t Dark_mask_settings::getMaxAllowedPixelCount() const
|
||||
{
|
||||
return m_Max_allowed_pixel_count;
|
||||
}
|
||||
void Dark_mask_settings::setMaxAllowedPixelCount(int64_t const value)
|
||||
{
|
||||
m_Max_allowed_pixel_count = value;
|
||||
}
|
||||
int64_t Dark_mask_settings::getMaxFramesWithSignal() const
|
||||
{
|
||||
return m_Max_frames_with_signal;
|
||||
}
|
||||
void Dark_mask_settings::setMaxFramesWithSignal(int64_t const value)
|
||||
{
|
||||
m_Max_frames_with_signal = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Dark_mask_settings.h
|
||||
*
|
||||
* Settings for collection of dark images to be used for mask calculation
|
||||
*/
|
||||
|
||||
#ifndef Dark_mask_settings_H_
|
||||
#define Dark_mask_settings_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Settings for collection of dark images to be used for mask calculation
|
||||
/// </summary>
|
||||
class Dark_mask_settings
|
||||
{
|
||||
public:
|
||||
Dark_mask_settings();
|
||||
virtual ~Dark_mask_settings() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Dark_mask_settings& rhs) const;
|
||||
bool operator!=(const Dark_mask_settings& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Dark_mask_settings members
|
||||
|
||||
/// <summary>
|
||||
/// Energy threshold for dark image collection
|
||||
/// </summary>
|
||||
float getDetectorThresholdKeV() const;
|
||||
void setDetectorThresholdKeV(float const value);
|
||||
/// <summary>
|
||||
/// Time between frames for dark image collection
|
||||
/// </summary>
|
||||
int64_t getFrameTimeUs() const;
|
||||
void setFrameTimeUs(int64_t const value);
|
||||
/// <summary>
|
||||
/// Number of frames for dark image collection; zero means no dark collection
|
||||
/// </summary>
|
||||
int64_t getNumberOfFrames() const;
|
||||
void setNumberOfFrames(int64_t const value);
|
||||
/// <summary>
|
||||
/// Maximum count in a pixel considered normal (not-masked)
|
||||
/// </summary>
|
||||
int64_t getMaxAllowedPixelCount() const;
|
||||
void setMaxAllowedPixelCount(int64_t const value);
|
||||
/// <summary>
|
||||
/// Maximum number of frames with signal in a pixel considered normal (not-masked)
|
||||
/// </summary>
|
||||
int64_t getMaxFramesWithSignal() const;
|
||||
void setMaxFramesWithSignal(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dark_mask_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Dark_mask_settings& o);
|
||||
protected:
|
||||
float m_Detector_threshold_keV;
|
||||
|
||||
int64_t m_Frame_time_us;
|
||||
|
||||
int64_t m_Number_of_frames;
|
||||
|
||||
int64_t m_Max_allowed_pixel_count;
|
||||
|
||||
int64_t m_Max_frames_with_signal;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Dark_mask_settings_H_ */
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -78,6 +78,15 @@ Dataset_settings::Dataset_settings()
|
||||
m_Poni_rot3_rad = 0.0f;
|
||||
m_Poni_rot3_radIsSet = false;
|
||||
m_Unit_cellIsSet = false;
|
||||
m_Spot_finding = true;
|
||||
m_Spot_findingIsSet = false;
|
||||
m_Max_spot_count = 250;
|
||||
m_Max_spot_countIsSet = false;
|
||||
m_Detect_ice_rings = false;
|
||||
m_Detect_ice_ringsIsSet = false;
|
||||
m_Async_start = false;
|
||||
m_Async_startIsSet = false;
|
||||
m_Xray_fluorescence_spectrumIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -196,10 +205,10 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
const std::string currentValuePath = _pathPrefix + ".spaceGroupNumber";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
if (value < 1ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 194ll)
|
||||
{
|
||||
@@ -397,7 +406,26 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (maxSpotCountIsSet())
|
||||
{
|
||||
const int32_t& value = m_Max_spot_count;
|
||||
const std::string currentValuePath = _pathPrefix + ".maxSpotCount";
|
||||
|
||||
|
||||
if (value < 10)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 10;";
|
||||
}
|
||||
if (value > 2000)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 2000;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -503,7 +531,22 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!poniRot3RadIsSet() && !rhs.poniRot3RadIsSet()) || (poniRot3RadIsSet() && rhs.poniRot3RadIsSet() && getPoniRot3Rad() == rhs.getPoniRot3Rad())) &&
|
||||
|
||||
|
||||
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell()))
|
||||
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell())) &&
|
||||
|
||||
|
||||
((!spotFindingIsSet() && !rhs.spotFindingIsSet()) || (spotFindingIsSet() && rhs.spotFindingIsSet() && isSpotFinding() == rhs.isSpotFinding())) &&
|
||||
|
||||
|
||||
((!maxSpotCountIsSet() && !rhs.maxSpotCountIsSet()) || (maxSpotCountIsSet() && rhs.maxSpotCountIsSet() && getMaxSpotCount() == rhs.getMaxSpotCount())) &&
|
||||
|
||||
|
||||
((!detectIceRingsIsSet() && !rhs.detectIceRingsIsSet()) || (detectIceRingsIsSet() && rhs.detectIceRingsIsSet() && isDetectIceRings() == rhs.isDetectIceRings())) &&
|
||||
|
||||
|
||||
((!asyncStartIsSet() && !rhs.asyncStartIsSet()) || (asyncStartIsSet() && rhs.asyncStartIsSet() && isAsyncStart() == rhs.isAsyncStart())) &&
|
||||
|
||||
|
||||
((!xrayFluorescenceSpectrumIsSet() && !rhs.xrayFluorescenceSpectrumIsSet()) || (xrayFluorescenceSpectrumIsSet() && rhs.xrayFluorescenceSpectrumIsSet() && getXrayFluorescenceSpectrum() == rhs.getXrayFluorescenceSpectrum()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -578,6 +621,16 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
j["poni_rot3_rad"] = o.m_Poni_rot3_rad;
|
||||
if(o.unitCellIsSet())
|
||||
j["unit_cell"] = o.m_Unit_cell;
|
||||
if(o.spotFindingIsSet())
|
||||
j["spot_finding"] = o.m_Spot_finding;
|
||||
if(o.maxSpotCountIsSet())
|
||||
j["max_spot_count"] = o.m_Max_spot_count;
|
||||
if(o.detectIceRingsIsSet())
|
||||
j["detect_ice_rings"] = o.m_Detect_ice_rings;
|
||||
if(o.asyncStartIsSet())
|
||||
j["async_start"] = o.m_Async_start;
|
||||
if(o.xrayFluorescenceSpectrumIsSet())
|
||||
j["xray_fluorescence_spectrum"] = o.m_Xray_fluorescence_spectrum;
|
||||
|
||||
}
|
||||
|
||||
@@ -732,6 +785,31 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("unit_cell").get_to(o.m_Unit_cell);
|
||||
o.m_Unit_cellIsSet = true;
|
||||
}
|
||||
if(j.find("spot_finding") != j.end())
|
||||
{
|
||||
j.at("spot_finding").get_to(o.m_Spot_finding);
|
||||
o.m_Spot_findingIsSet = true;
|
||||
}
|
||||
if(j.find("max_spot_count") != j.end())
|
||||
{
|
||||
j.at("max_spot_count").get_to(o.m_Max_spot_count);
|
||||
o.m_Max_spot_countIsSet = true;
|
||||
}
|
||||
if(j.find("detect_ice_rings") != j.end())
|
||||
{
|
||||
j.at("detect_ice_rings").get_to(o.m_Detect_ice_rings);
|
||||
o.m_Detect_ice_ringsIsSet = true;
|
||||
}
|
||||
if(j.find("async_start") != j.end())
|
||||
{
|
||||
j.at("async_start").get_to(o.m_Async_start);
|
||||
o.m_Async_startIsSet = true;
|
||||
}
|
||||
if(j.find("xray_fluorescence_spectrum") != j.end())
|
||||
{
|
||||
j.at("xray_fluorescence_spectrum").get_to(o.m_Xray_fluorescence_spectrum);
|
||||
o.m_Xray_fluorescence_spectrumIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1260,6 +1338,91 @@ void Dataset_settings::unsetUnit_cell()
|
||||
{
|
||||
m_Unit_cellIsSet = false;
|
||||
}
|
||||
bool Dataset_settings::isSpotFinding() const
|
||||
{
|
||||
return m_Spot_finding;
|
||||
}
|
||||
void Dataset_settings::setSpotFinding(bool const value)
|
||||
{
|
||||
m_Spot_finding = value;
|
||||
m_Spot_findingIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::spotFindingIsSet() const
|
||||
{
|
||||
return m_Spot_findingIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetSpot_finding()
|
||||
{
|
||||
m_Spot_findingIsSet = false;
|
||||
}
|
||||
int32_t Dataset_settings::getMaxSpotCount() const
|
||||
{
|
||||
return m_Max_spot_count;
|
||||
}
|
||||
void Dataset_settings::setMaxSpotCount(int32_t const value)
|
||||
{
|
||||
m_Max_spot_count = value;
|
||||
m_Max_spot_countIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::maxSpotCountIsSet() const
|
||||
{
|
||||
return m_Max_spot_countIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetMax_spot_count()
|
||||
{
|
||||
m_Max_spot_countIsSet = false;
|
||||
}
|
||||
bool Dataset_settings::isDetectIceRings() const
|
||||
{
|
||||
return m_Detect_ice_rings;
|
||||
}
|
||||
void Dataset_settings::setDetectIceRings(bool const value)
|
||||
{
|
||||
m_Detect_ice_rings = value;
|
||||
m_Detect_ice_ringsIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::detectIceRingsIsSet() const
|
||||
{
|
||||
return m_Detect_ice_ringsIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetDetect_ice_rings()
|
||||
{
|
||||
m_Detect_ice_ringsIsSet = false;
|
||||
}
|
||||
bool Dataset_settings::isAsyncStart() const
|
||||
{
|
||||
return m_Async_start;
|
||||
}
|
||||
void Dataset_settings::setAsyncStart(bool const value)
|
||||
{
|
||||
m_Async_start = value;
|
||||
m_Async_startIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::asyncStartIsSet() const
|
||||
{
|
||||
return m_Async_startIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetAsync_start()
|
||||
{
|
||||
m_Async_startIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Dataset_settings_xray_fluorescence_spectrum Dataset_settings::getXrayFluorescenceSpectrum() const
|
||||
{
|
||||
return m_Xray_fluorescence_spectrum;
|
||||
}
|
||||
void Dataset_settings::setXrayFluorescenceSpectrum(org::openapitools::server::model::Dataset_settings_xray_fluorescence_spectrum const& value)
|
||||
{
|
||||
m_Xray_fluorescence_spectrum = value;
|
||||
m_Xray_fluorescence_spectrumIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::xrayFluorescenceSpectrumIsSet() const
|
||||
{
|
||||
return m_Xray_fluorescence_spectrumIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetXray_fluorescence_spectrum()
|
||||
{
|
||||
m_Xray_fluorescence_spectrumIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "Rotation_axis.h"
|
||||
#include "Unit_cell.h"
|
||||
#include <string>
|
||||
#include "Dataset_settings_xray_fluorescence_spectrum.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
@@ -77,7 +78,7 @@ public:
|
||||
bool ntriggerIsSet() const;
|
||||
void unsetNtrigger();
|
||||
/// <summary>
|
||||
/// Image time. If not provided (or zero value) the frame time is assumed as default. Image time must be multiple of frame time; max value is 256 * frame_time. In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells and if raw data are saved.
|
||||
/// Image time. If not provided (or zero value) the frame time is assumed as default. For JUNGFRAU image time must be multiple of frame time and max value is 256 * frame_time. In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells and if raw data are saved.
|
||||
/// </summary>
|
||||
int64_t getImageTimeUs() const;
|
||||
void setImageTimeUs(int64_t const value);
|
||||
@@ -167,7 +168,7 @@ public:
|
||||
bool gridScanIsSet() const;
|
||||
void unsetGrid_scan();
|
||||
/// <summary>
|
||||
/// Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) In general, it is not saved in HDF5 file. However, if values are placed in \"hdf5\" object, `jfjoch_writer` 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 {\"hdf5\": {\"val1\":1, \"val2\":\"xyz\"}}, will write /entry/user/val1 and /entry/user/val2.
|
||||
/// 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 \"hdf5\" object, `jfjoch_writer` will write them in /entry/user of the HDF5 file. This applies solely to string and number (double floating-point). No arrays/sub-objects is allowed. For example {\"hdf5\": {\"val1\":1, \"val2\":\"xyz\"}}, will write /entry/user/val1 and /entry/user/val2.
|
||||
/// </summary>
|
||||
nlohmann::json getHeaderAppendix() const;
|
||||
void setHeaderAppendix(nlohmann::json const& value);
|
||||
@@ -285,6 +286,41 @@ public:
|
||||
void setUnitCell(org::openapitools::server::model::Unit_cell const& value);
|
||||
bool unitCellIsSet() const;
|
||||
void unsetUnit_cell();
|
||||
/// <summary>
|
||||
/// Enable spot finding and save spots
|
||||
/// </summary>
|
||||
bool isSpotFinding() const;
|
||||
void setSpotFinding(bool const value);
|
||||
bool spotFindingIsSet() const;
|
||||
void unsetSpot_finding();
|
||||
/// <summary>
|
||||
/// Maximum number of spots that are saved/used for indexing; spots with highest intensity are selected
|
||||
/// </summary>
|
||||
int32_t getMaxSpotCount() const;
|
||||
void setMaxSpotCount(int32_t const value);
|
||||
bool maxSpotCountIsSet() const;
|
||||
void unsetMax_spot_count();
|
||||
/// <summary>
|
||||
/// Flag spots as ice rings and reduce their effect on indexing
|
||||
/// </summary>
|
||||
bool isDetectIceRings() const;
|
||||
void setDetectIceRings(bool const value);
|
||||
bool detectIceRingsIsSet() const;
|
||||
void unsetDetect_ice_rings();
|
||||
/// <summary>
|
||||
/// When set to true, `/start` will not wait for detector and Jungfraujoch to be ready for the measurement.
|
||||
/// </summary>
|
||||
bool isAsyncStart() const;
|
||||
void setAsyncStart(bool const value);
|
||||
bool asyncStartIsSet() const;
|
||||
void unsetAsync_start();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Dataset_settings_xray_fluorescence_spectrum getXrayFluorescenceSpectrum() const;
|
||||
void setXrayFluorescenceSpectrum(org::openapitools::server::model::Dataset_settings_xray_fluorescence_spectrum const& value);
|
||||
bool xrayFluorescenceSpectrumIsSet() const;
|
||||
void unsetXray_fluorescence_spectrum();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings& o);
|
||||
@@ -355,6 +391,16 @@ protected:
|
||||
bool m_Poni_rot3_radIsSet;
|
||||
org::openapitools::server::model::Unit_cell m_Unit_cell;
|
||||
bool m_Unit_cellIsSet;
|
||||
bool m_Spot_finding;
|
||||
bool m_Spot_findingIsSet;
|
||||
int32_t m_Max_spot_count;
|
||||
bool m_Max_spot_countIsSet;
|
||||
bool m_Detect_ice_rings;
|
||||
bool m_Detect_ice_ringsIsSet;
|
||||
bool m_Async_start;
|
||||
bool m_Async_startIsSet;
|
||||
org::openapitools::server::model::Dataset_settings_xray_fluorescence_spectrum m_Xray_fluorescence_spectrum;
|
||||
bool m_Xray_fluorescence_spectrumIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* 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 "Dataset_settings_xray_fluorescence_spectrum.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Dataset_settings_xray_fluorescence_spectrum::Dataset_settings_xray_fluorescence_spectrum()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Dataset_settings_xray_fluorescence_spectrum::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Dataset_settings_xray_fluorescence_spectrum::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Dataset_settings_xray_fluorescence_spectrum::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Dataset_settings_xray_fluorescence_spectrum" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
/* Energy_eV */ {
|
||||
const std::vector<float>& value = m_Energy_eV;
|
||||
const std::string currentValuePath = _pathPrefix + ".energyEV";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const float& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Data */ {
|
||||
const std::vector<float>& value = m_Data;
|
||||
const std::string currentValuePath = _pathPrefix + ".data";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const float& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Dataset_settings_xray_fluorescence_spectrum::operator==(const Dataset_settings_xray_fluorescence_spectrum& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getEnergyEV() == rhs.getEnergyEV())
|
||||
&&
|
||||
|
||||
(getData() == rhs.getData())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Dataset_settings_xray_fluorescence_spectrum::operator!=(const Dataset_settings_xray_fluorescence_spectrum& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Dataset_settings_xray_fluorescence_spectrum& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["energy_eV"] = o.m_Energy_eV;
|
||||
j["data"] = o.m_Data;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Dataset_settings_xray_fluorescence_spectrum& o)
|
||||
{
|
||||
j.at("energy_eV").get_to(o.m_Energy_eV);
|
||||
j.at("data").get_to(o.m_Data);
|
||||
|
||||
}
|
||||
|
||||
std::vector<float> Dataset_settings_xray_fluorescence_spectrum::getEnergyEV() const
|
||||
{
|
||||
return m_Energy_eV;
|
||||
}
|
||||
void Dataset_settings_xray_fluorescence_spectrum::setEnergyEV(std::vector<float> const value)
|
||||
{
|
||||
m_Energy_eV = value;
|
||||
}
|
||||
std::vector<float> Dataset_settings_xray_fluorescence_spectrum::getData() const
|
||||
{
|
||||
return m_Data;
|
||||
}
|
||||
void Dataset_settings_xray_fluorescence_spectrum::setData(std::vector<float> const value)
|
||||
{
|
||||
m_Data = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Dataset_settings_xray_fluorescence_spectrum.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Dataset_settings_xray_fluorescence_spectrum_H_
|
||||
#define Dataset_settings_xray_fluorescence_spectrum_H_
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Dataset_settings_xray_fluorescence_spectrum
|
||||
{
|
||||
public:
|
||||
Dataset_settings_xray_fluorescence_spectrum();
|
||||
virtual ~Dataset_settings_xray_fluorescence_spectrum() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Dataset_settings_xray_fluorescence_spectrum& rhs) const;
|
||||
bool operator!=(const Dataset_settings_xray_fluorescence_spectrum& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Dataset_settings_xray_fluorescence_spectrum members
|
||||
|
||||
/// <summary>
|
||||
/// X-ray fluorescence scan energy for each measurement point
|
||||
/// </summary>
|
||||
std::vector<float> getEnergyEV() const;
|
||||
void setEnergyEV(std::vector<float> const value);
|
||||
/// <summary>
|
||||
/// X-ray fluorescence scan result in arbitrary units; must be exactly the same length, as energy_eV
|
||||
/// </summary>
|
||||
std::vector<float> getData() const;
|
||||
void setData(std::vector<float> const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings_xray_fluorescence_spectrum& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings_xray_fluorescence_spectrum& o);
|
||||
protected:
|
||||
std::vector<float> m_Energy_eV;
|
||||
|
||||
std::vector<float> m_Data;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Dataset_settings_xray_fluorescence_spectrum_H_ */
|
||||
+194
-64
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -33,13 +33,14 @@ Detector::Detector()
|
||||
m_Module_syncIsSet = false;
|
||||
m_Sensor_thickness_um = 320.0f;
|
||||
m_Sensor_thickness_umIsSet = false;
|
||||
m_Readout_time_us = 0L;
|
||||
m_Readout_time_usIsSet = false;
|
||||
m_Minimum_count_time_us = 0L;
|
||||
m_Minimum_count_time_usIsSet = false;
|
||||
m_Minimum_frame_time_us = 0L;
|
||||
m_Minimum_frame_time_usIsSet = false;
|
||||
m_Readout_time_ns = 0L;
|
||||
m_Readout_time_nsIsSet = false;
|
||||
m_Min_count_time_ns = 0L;
|
||||
m_Min_count_time_nsIsSet = false;
|
||||
m_Min_frame_time_ns = 0L;
|
||||
m_Min_frame_time_nsIsSet = false;
|
||||
m_Calibration_fileIsSet = false;
|
||||
m_Trim_energies_eVIsSet = false;
|
||||
m_HostnameIsSet = false;
|
||||
m_Sensor_material = "Si";
|
||||
m_Sensor_materialIsSet = false;
|
||||
@@ -52,6 +53,9 @@ Detector::Detector()
|
||||
m_Roi_modeIsSet = false;
|
||||
m_Mirror_y = true;
|
||||
m_Mirror_yIsSet = false;
|
||||
m_Temp_thresold_degC = 55L;
|
||||
m_Temp_thresold_degCIsSet = false;
|
||||
m_Default_settingsIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -155,10 +159,10 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
|
||||
|
||||
}
|
||||
|
||||
if (readoutTimeUsIsSet())
|
||||
if (readoutTimeNsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Readout_time_us;
|
||||
const std::string currentValuePath = _pathPrefix + ".readoutTimeUs";
|
||||
const int64_t& value = m_Readout_time_ns;
|
||||
const std::string currentValuePath = _pathPrefix + ".readoutTimeNs";
|
||||
|
||||
|
||||
if (value < 1ll)
|
||||
@@ -169,10 +173,10 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
|
||||
|
||||
}
|
||||
|
||||
if (minimumCountTimeUsIsSet())
|
||||
if (minCountTimeNsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Minimum_count_time_us;
|
||||
const std::string currentValuePath = _pathPrefix + ".minimumCountTimeUs";
|
||||
const int64_t& value = m_Min_count_time_ns;
|
||||
const std::string currentValuePath = _pathPrefix + ".minCountTimeNs";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
@@ -183,10 +187,10 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
|
||||
|
||||
}
|
||||
|
||||
if (minimumFrameTimeUsIsSet())
|
||||
if (minFrameTimeNsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Minimum_frame_time_us;
|
||||
const std::string currentValuePath = _pathPrefix + ".minimumFrameTimeUs";
|
||||
const int64_t& value = m_Min_frame_time_ns;
|
||||
const std::string currentValuePath = _pathPrefix + ".minFrameTimeNs";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
@@ -218,6 +222,32 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
|
||||
|
||||
}
|
||||
|
||||
if (trimEnergiesEVIsSet())
|
||||
{
|
||||
const std::vector<int32_t>& value = m_Trim_energies_eV;
|
||||
const std::string currentValuePath = _pathPrefix + ".trimEnergiesEV";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const int32_t& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
if (value < 100)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 100;";
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (hostnameIsSet())
|
||||
{
|
||||
const std::vector<std::string>& value = m_Hostname;
|
||||
@@ -280,7 +310,26 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (tempThresoldDegCIsSet())
|
||||
{
|
||||
const int64_t& value = m_Temp_thresold_degC;
|
||||
const std::string currentValuePath = _pathPrefix + ".tempThresoldDegC";
|
||||
|
||||
|
||||
if (value < 40ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 40;";
|
||||
}
|
||||
if (value > 70ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 70;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -311,18 +360,21 @@ bool Detector::operator==(const Detector& rhs) const
|
||||
((!sensorThicknessUmIsSet() && !rhs.sensorThicknessUmIsSet()) || (sensorThicknessUmIsSet() && rhs.sensorThicknessUmIsSet() && getSensorThicknessUm() == rhs.getSensorThicknessUm())) &&
|
||||
|
||||
|
||||
((!readoutTimeUsIsSet() && !rhs.readoutTimeUsIsSet()) || (readoutTimeUsIsSet() && rhs.readoutTimeUsIsSet() && getReadoutTimeUs() == rhs.getReadoutTimeUs())) &&
|
||||
((!readoutTimeNsIsSet() && !rhs.readoutTimeNsIsSet()) || (readoutTimeNsIsSet() && rhs.readoutTimeNsIsSet() && getReadoutTimeNs() == rhs.getReadoutTimeNs())) &&
|
||||
|
||||
|
||||
((!minimumCountTimeUsIsSet() && !rhs.minimumCountTimeUsIsSet()) || (minimumCountTimeUsIsSet() && rhs.minimumCountTimeUsIsSet() && getMinimumCountTimeUs() == rhs.getMinimumCountTimeUs())) &&
|
||||
((!minCountTimeNsIsSet() && !rhs.minCountTimeNsIsSet()) || (minCountTimeNsIsSet() && rhs.minCountTimeNsIsSet() && getMinCountTimeNs() == rhs.getMinCountTimeNs())) &&
|
||||
|
||||
|
||||
((!minimumFrameTimeUsIsSet() && !rhs.minimumFrameTimeUsIsSet()) || (minimumFrameTimeUsIsSet() && rhs.minimumFrameTimeUsIsSet() && getMinimumFrameTimeUs() == rhs.getMinimumFrameTimeUs())) &&
|
||||
((!minFrameTimeNsIsSet() && !rhs.minFrameTimeNsIsSet()) || (minFrameTimeNsIsSet() && rhs.minFrameTimeNsIsSet() && getMinFrameTimeNs() == rhs.getMinFrameTimeNs())) &&
|
||||
|
||||
|
||||
((!calibrationFileIsSet() && !rhs.calibrationFileIsSet()) || (calibrationFileIsSet() && rhs.calibrationFileIsSet() && getCalibrationFile() == rhs.getCalibrationFile())) &&
|
||||
|
||||
|
||||
((!trimEnergiesEVIsSet() && !rhs.trimEnergiesEVIsSet()) || (trimEnergiesEVIsSet() && rhs.trimEnergiesEVIsSet() && getTrimEnergiesEV() == rhs.getTrimEnergiesEV())) &&
|
||||
|
||||
|
||||
((!hostnameIsSet() && !rhs.hostnameIsSet()) || (hostnameIsSet() && rhs.hostnameIsSet() && getHostname() == rhs.getHostname())) &&
|
||||
|
||||
|
||||
@@ -344,7 +396,13 @@ bool Detector::operator==(const Detector& rhs) const
|
||||
((!roiModeIsSet() && !rhs.roiModeIsSet()) || (roiModeIsSet() && rhs.roiModeIsSet() && getRoiMode() == rhs.getRoiMode())) &&
|
||||
|
||||
|
||||
((!mirrorYIsSet() && !rhs.mirrorYIsSet()) || (mirrorYIsSet() && rhs.mirrorYIsSet() && isMirrorY() == rhs.isMirrorY()))
|
||||
((!mirrorYIsSet() && !rhs.mirrorYIsSet()) || (mirrorYIsSet() && rhs.mirrorYIsSet() && isMirrorY() == rhs.isMirrorY())) &&
|
||||
|
||||
|
||||
((!tempThresoldDegCIsSet() && !rhs.tempThresoldDegCIsSet()) || (tempThresoldDegCIsSet() && rhs.tempThresoldDegCIsSet() && getTempThresoldDegC() == rhs.getTempThresoldDegC())) &&
|
||||
|
||||
|
||||
((!defaultSettingsIsSet() && !rhs.defaultSettingsIsSet()) || (defaultSettingsIsSet() && rhs.defaultSettingsIsSet() && getDefaultSettings() == rhs.getDefaultSettings()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -370,14 +428,16 @@ void to_json(nlohmann::json& j, const Detector& o)
|
||||
j["module_sync"] = o.m_Module_sync;
|
||||
if(o.sensorThicknessUmIsSet())
|
||||
j["sensor_thickness_um"] = o.m_Sensor_thickness_um;
|
||||
if(o.readoutTimeUsIsSet())
|
||||
j["readout_time_us"] = o.m_Readout_time_us;
|
||||
if(o.minimumCountTimeUsIsSet())
|
||||
j["minimum_count_time_us"] = o.m_Minimum_count_time_us;
|
||||
if(o.minimumFrameTimeUsIsSet())
|
||||
j["minimum_frame_time_us"] = o.m_Minimum_frame_time_us;
|
||||
if(o.readoutTimeNsIsSet())
|
||||
j["readout_time_ns"] = o.m_Readout_time_ns;
|
||||
if(o.minCountTimeNsIsSet())
|
||||
j["min_count_time_ns"] = o.m_Min_count_time_ns;
|
||||
if(o.minFrameTimeNsIsSet())
|
||||
j["min_frame_time_ns"] = o.m_Min_frame_time_ns;
|
||||
if(o.calibrationFileIsSet() || !o.m_Calibration_file.empty())
|
||||
j["calibration_file"] = o.m_Calibration_file;
|
||||
if(o.trimEnergiesEVIsSet() || !o.m_Trim_energies_eV.empty())
|
||||
j["trim_energies_eV"] = o.m_Trim_energies_eV;
|
||||
if(o.hostnameIsSet() || !o.m_Hostname.empty())
|
||||
j["hostname"] = o.m_Hostname;
|
||||
if(o.sensorMaterialIsSet())
|
||||
@@ -394,6 +454,10 @@ void to_json(nlohmann::json& j, const Detector& o)
|
||||
j["roi_mode"] = o.m_Roi_mode;
|
||||
if(o.mirrorYIsSet())
|
||||
j["mirror_y"] = o.m_Mirror_y;
|
||||
if(o.tempThresoldDegCIsSet())
|
||||
j["temp_thresold_degC"] = o.m_Temp_thresold_degC;
|
||||
if(o.defaultSettingsIsSet())
|
||||
j["default_settings"] = o.m_Default_settings;
|
||||
|
||||
}
|
||||
|
||||
@@ -430,26 +494,31 @@ void from_json(const nlohmann::json& j, Detector& o)
|
||||
j.at("sensor_thickness_um").get_to(o.m_Sensor_thickness_um);
|
||||
o.m_Sensor_thickness_umIsSet = true;
|
||||
}
|
||||
if(j.find("readout_time_us") != j.end())
|
||||
if(j.find("readout_time_ns") != j.end())
|
||||
{
|
||||
j.at("readout_time_us").get_to(o.m_Readout_time_us);
|
||||
o.m_Readout_time_usIsSet = true;
|
||||
j.at("readout_time_ns").get_to(o.m_Readout_time_ns);
|
||||
o.m_Readout_time_nsIsSet = true;
|
||||
}
|
||||
if(j.find("minimum_count_time_us") != j.end())
|
||||
if(j.find("min_count_time_ns") != j.end())
|
||||
{
|
||||
j.at("minimum_count_time_us").get_to(o.m_Minimum_count_time_us);
|
||||
o.m_Minimum_count_time_usIsSet = true;
|
||||
j.at("min_count_time_ns").get_to(o.m_Min_count_time_ns);
|
||||
o.m_Min_count_time_nsIsSet = true;
|
||||
}
|
||||
if(j.find("minimum_frame_time_us") != j.end())
|
||||
if(j.find("min_frame_time_ns") != j.end())
|
||||
{
|
||||
j.at("minimum_frame_time_us").get_to(o.m_Minimum_frame_time_us);
|
||||
o.m_Minimum_frame_time_usIsSet = true;
|
||||
j.at("min_frame_time_ns").get_to(o.m_Min_frame_time_ns);
|
||||
o.m_Min_frame_time_nsIsSet = true;
|
||||
}
|
||||
if(j.find("calibration_file") != j.end())
|
||||
{
|
||||
j.at("calibration_file").get_to(o.m_Calibration_file);
|
||||
o.m_Calibration_fileIsSet = true;
|
||||
}
|
||||
if(j.find("trim_energies_eV") != j.end())
|
||||
{
|
||||
j.at("trim_energies_eV").get_to(o.m_Trim_energies_eV);
|
||||
o.m_Trim_energies_eVIsSet = true;
|
||||
}
|
||||
if(j.find("hostname") != j.end())
|
||||
{
|
||||
j.at("hostname").get_to(o.m_Hostname);
|
||||
@@ -490,6 +559,16 @@ void from_json(const nlohmann::json& j, Detector& o)
|
||||
j.at("mirror_y").get_to(o.m_Mirror_y);
|
||||
o.m_Mirror_yIsSet = true;
|
||||
}
|
||||
if(j.find("temp_thresold_degC") != j.end())
|
||||
{
|
||||
j.at("temp_thresold_degC").get_to(o.m_Temp_thresold_degC);
|
||||
o.m_Temp_thresold_degCIsSet = true;
|
||||
}
|
||||
if(j.find("default_settings") != j.end())
|
||||
{
|
||||
j.at("default_settings").get_to(o.m_Default_settings);
|
||||
o.m_Default_settingsIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -603,56 +682,56 @@ void Detector::unsetSensor_thickness_um()
|
||||
{
|
||||
m_Sensor_thickness_umIsSet = false;
|
||||
}
|
||||
int64_t Detector::getReadoutTimeUs() const
|
||||
int64_t Detector::getReadoutTimeNs() const
|
||||
{
|
||||
return m_Readout_time_us;
|
||||
return m_Readout_time_ns;
|
||||
}
|
||||
void Detector::setReadoutTimeUs(int64_t const value)
|
||||
void Detector::setReadoutTimeNs(int64_t const value)
|
||||
{
|
||||
m_Readout_time_us = value;
|
||||
m_Readout_time_usIsSet = true;
|
||||
m_Readout_time_ns = value;
|
||||
m_Readout_time_nsIsSet = true;
|
||||
}
|
||||
bool Detector::readoutTimeUsIsSet() const
|
||||
bool Detector::readoutTimeNsIsSet() const
|
||||
{
|
||||
return m_Readout_time_usIsSet;
|
||||
return m_Readout_time_nsIsSet;
|
||||
}
|
||||
void Detector::unsetReadout_time_us()
|
||||
void Detector::unsetReadout_time_ns()
|
||||
{
|
||||
m_Readout_time_usIsSet = false;
|
||||
m_Readout_time_nsIsSet = false;
|
||||
}
|
||||
int64_t Detector::getMinimumCountTimeUs() const
|
||||
int64_t Detector::getMinCountTimeNs() const
|
||||
{
|
||||
return m_Minimum_count_time_us;
|
||||
return m_Min_count_time_ns;
|
||||
}
|
||||
void Detector::setMinimumCountTimeUs(int64_t const value)
|
||||
void Detector::setMinCountTimeNs(int64_t const value)
|
||||
{
|
||||
m_Minimum_count_time_us = value;
|
||||
m_Minimum_count_time_usIsSet = true;
|
||||
m_Min_count_time_ns = value;
|
||||
m_Min_count_time_nsIsSet = true;
|
||||
}
|
||||
bool Detector::minimumCountTimeUsIsSet() const
|
||||
bool Detector::minCountTimeNsIsSet() const
|
||||
{
|
||||
return m_Minimum_count_time_usIsSet;
|
||||
return m_Min_count_time_nsIsSet;
|
||||
}
|
||||
void Detector::unsetMinimum_count_time_us()
|
||||
void Detector::unsetMin_count_time_ns()
|
||||
{
|
||||
m_Minimum_count_time_usIsSet = false;
|
||||
m_Min_count_time_nsIsSet = false;
|
||||
}
|
||||
int64_t Detector::getMinimumFrameTimeUs() const
|
||||
int64_t Detector::getMinFrameTimeNs() const
|
||||
{
|
||||
return m_Minimum_frame_time_us;
|
||||
return m_Min_frame_time_ns;
|
||||
}
|
||||
void Detector::setMinimumFrameTimeUs(int64_t const value)
|
||||
void Detector::setMinFrameTimeNs(int64_t const value)
|
||||
{
|
||||
m_Minimum_frame_time_us = value;
|
||||
m_Minimum_frame_time_usIsSet = true;
|
||||
m_Min_frame_time_ns = value;
|
||||
m_Min_frame_time_nsIsSet = true;
|
||||
}
|
||||
bool Detector::minimumFrameTimeUsIsSet() const
|
||||
bool Detector::minFrameTimeNsIsSet() const
|
||||
{
|
||||
return m_Minimum_frame_time_usIsSet;
|
||||
return m_Min_frame_time_nsIsSet;
|
||||
}
|
||||
void Detector::unsetMinimum_frame_time_us()
|
||||
void Detector::unsetMin_frame_time_ns()
|
||||
{
|
||||
m_Minimum_frame_time_usIsSet = false;
|
||||
m_Min_frame_time_nsIsSet = false;
|
||||
}
|
||||
std::vector<std::string> Detector::getCalibrationFile() const
|
||||
{
|
||||
@@ -671,6 +750,23 @@ void Detector::unsetCalibration_file()
|
||||
{
|
||||
m_Calibration_fileIsSet = false;
|
||||
}
|
||||
std::vector<int32_t> Detector::getTrimEnergiesEV() const
|
||||
{
|
||||
return m_Trim_energies_eV;
|
||||
}
|
||||
void Detector::setTrimEnergiesEV(std::vector<int32_t> const value)
|
||||
{
|
||||
m_Trim_energies_eV = value;
|
||||
m_Trim_energies_eVIsSet = true;
|
||||
}
|
||||
bool Detector::trimEnergiesEVIsSet() const
|
||||
{
|
||||
return m_Trim_energies_eVIsSet;
|
||||
}
|
||||
void Detector::unsetTrim_energies_eV()
|
||||
{
|
||||
m_Trim_energies_eVIsSet = false;
|
||||
}
|
||||
std::vector<std::string> Detector::getHostname() const
|
||||
{
|
||||
return m_Hostname;
|
||||
@@ -807,6 +903,40 @@ void Detector::unsetMirror_y()
|
||||
{
|
||||
m_Mirror_yIsSet = false;
|
||||
}
|
||||
int64_t Detector::getTempThresoldDegC() const
|
||||
{
|
||||
return m_Temp_thresold_degC;
|
||||
}
|
||||
void Detector::setTempThresoldDegC(int64_t const value)
|
||||
{
|
||||
m_Temp_thresold_degC = value;
|
||||
m_Temp_thresold_degCIsSet = true;
|
||||
}
|
||||
bool Detector::tempThresoldDegCIsSet() const
|
||||
{
|
||||
return m_Temp_thresold_degCIsSet;
|
||||
}
|
||||
void Detector::unsetTemp_thresold_degC()
|
||||
{
|
||||
m_Temp_thresold_degCIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Detector_settings Detector::getDefaultSettings() const
|
||||
{
|
||||
return m_Default_settings;
|
||||
}
|
||||
void Detector::setDefaultSettings(org::openapitools::server::model::Detector_settings const& value)
|
||||
{
|
||||
m_Default_settings = value;
|
||||
m_Default_settingsIsSet = true;
|
||||
}
|
||||
bool Detector::defaultSettingsIsSet() const
|
||||
{
|
||||
return m_Default_settingsIsSet;
|
||||
}
|
||||
void Detector::unsetDefault_settings()
|
||||
{
|
||||
m_Default_settingsIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
+49
-21
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "Detector_type.h"
|
||||
#include <string>
|
||||
#include "Detector_settings.h"
|
||||
#include <vector>
|
||||
#include "Standard_detector_geometry.h"
|
||||
#include "Detector_module.h"
|
||||
@@ -110,26 +111,26 @@ public:
|
||||
bool sensorThicknessUmIsSet() const;
|
||||
void unsetSensor_thickness_um();
|
||||
/// <summary>
|
||||
/// Minimum difference between frame time and count time in microseconds Defaults are 3 us for EIGER and 20 us for JUNGFRAU
|
||||
/// Minimum difference between frame time and count time in microseconds Defaults are 3'000 ns for EIGER and 20'000 ns for JUNGFRAU
|
||||
/// </summary>
|
||||
int64_t getReadoutTimeUs() const;
|
||||
void setReadoutTimeUs(int64_t const value);
|
||||
bool readoutTimeUsIsSet() const;
|
||||
void unsetReadout_time_us();
|
||||
int64_t getReadoutTimeNs() const;
|
||||
void setReadoutTimeNs(int64_t const value);
|
||||
bool readoutTimeNsIsSet() const;
|
||||
void unsetReadout_time_ns();
|
||||
/// <summary>
|
||||
/// Minimum count time available for the detector.
|
||||
/// </summary>
|
||||
int64_t getMinimumCountTimeUs() const;
|
||||
void setMinimumCountTimeUs(int64_t const value);
|
||||
bool minimumCountTimeUsIsSet() const;
|
||||
void unsetMinimum_count_time_us();
|
||||
int64_t getMinCountTimeNs() const;
|
||||
void setMinCountTimeNs(int64_t const value);
|
||||
bool minCountTimeNsIsSet() const;
|
||||
void unsetMin_count_time_ns();
|
||||
/// <summary>
|
||||
/// Minimum frame time available for the detector.
|
||||
/// </summary>
|
||||
int64_t getMinimumFrameTimeUs() const;
|
||||
void setMinimumFrameTimeUs(int64_t const value);
|
||||
bool minimumFrameTimeUsIsSet() const;
|
||||
void unsetMinimum_frame_time_us();
|
||||
int64_t getMinFrameTimeNs() const;
|
||||
void setMinFrameTimeNs(int64_t const value);
|
||||
bool minFrameTimeNsIsSet() const;
|
||||
void unsetMin_frame_time_ns();
|
||||
/// <summary>
|
||||
/// Can be empty for all detectors - default calibration used. For JUNGFRAU: list of gain files, one entry per module. For EIGER: one directory (with detector settings) or list of trim bit files, one entry per half-module.
|
||||
/// </summary>
|
||||
@@ -138,6 +139,13 @@ public:
|
||||
bool calibrationFileIsSet() const;
|
||||
void unsetCalibration_file();
|
||||
/// <summary>
|
||||
/// List of energies at which trimming calibration is provided. Only needed for PSI EIGER and compulsory in this case
|
||||
/// </summary>
|
||||
std::vector<int32_t> getTrimEnergiesEV() const;
|
||||
void setTrimEnergiesEV(std::vector<int32_t> const value);
|
||||
bool trimEnergiesEVIsSet() const;
|
||||
void unsetTrim_energies_eV();
|
||||
/// <summary>
|
||||
/// Hostname for detector module. One entry per module One entry per module. Either empty or number of module entries.
|
||||
/// </summary>
|
||||
std::vector<std::string> getHostname() const;
|
||||
@@ -193,6 +201,20 @@ public:
|
||||
void setMirrorY(bool const value);
|
||||
bool mirrorYIsSet() const;
|
||||
void unsetMirror_y();
|
||||
/// <summary>
|
||||
/// Temperature threshold for JUNGFRAU detector modules
|
||||
/// </summary>
|
||||
int64_t getTempThresoldDegC() const;
|
||||
void setTempThresoldDegC(int64_t const value);
|
||||
bool tempThresoldDegCIsSet() const;
|
||||
void unsetTemp_thresold_degC();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Detector_settings getDefaultSettings() const;
|
||||
void setDefaultSettings(org::openapitools::server::model::Detector_settings const& value);
|
||||
bool defaultSettingsIsSet() const;
|
||||
void unsetDefault_settings();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector& o);
|
||||
@@ -211,14 +233,16 @@ protected:
|
||||
bool m_Module_syncIsSet;
|
||||
float m_Sensor_thickness_um;
|
||||
bool m_Sensor_thickness_umIsSet;
|
||||
int64_t m_Readout_time_us;
|
||||
bool m_Readout_time_usIsSet;
|
||||
int64_t m_Minimum_count_time_us;
|
||||
bool m_Minimum_count_time_usIsSet;
|
||||
int64_t m_Minimum_frame_time_us;
|
||||
bool m_Minimum_frame_time_usIsSet;
|
||||
int64_t m_Readout_time_ns;
|
||||
bool m_Readout_time_nsIsSet;
|
||||
int64_t m_Min_count_time_ns;
|
||||
bool m_Min_count_time_nsIsSet;
|
||||
int64_t m_Min_frame_time_ns;
|
||||
bool m_Min_frame_time_nsIsSet;
|
||||
std::vector<std::string> m_Calibration_file;
|
||||
bool m_Calibration_fileIsSet;
|
||||
std::vector<int32_t> m_Trim_energies_eV;
|
||||
bool m_Trim_energies_eVIsSet;
|
||||
std::vector<std::string> m_Hostname;
|
||||
bool m_HostnameIsSet;
|
||||
std::string m_Sensor_material;
|
||||
@@ -235,6 +259,10 @@ protected:
|
||||
bool m_Roi_modeIsSet;
|
||||
bool m_Mirror_y;
|
||||
bool m_Mirror_yIsSet;
|
||||
int64_t m_Temp_thresold_degC;
|
||||
bool m_Temp_thresold_degCIsSet;
|
||||
org::openapitools::server::model::Detector_settings m_Default_settings;
|
||||
bool m_Default_settingsIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -31,9 +31,9 @@ Detector_list_element::Detector_list_element()
|
||||
m_Height = 0L;
|
||||
m_Pixel_size_mm = 0.0f;
|
||||
m_Pixel_size_mmIsSet = false;
|
||||
m_Readout_time_us = 0L;
|
||||
m_Min_frame_time_us = 0L;
|
||||
m_Min_count_time_us = 0L;
|
||||
m_Readout_time_ns = 0L;
|
||||
m_Min_frame_time_ns = 0L;
|
||||
m_Min_count_time_ns = 0L;
|
||||
m_TypeIsSet = false;
|
||||
|
||||
}
|
||||
@@ -107,13 +107,13 @@ bool Detector_list_element::operator==(const Detector_list_element& rhs) const
|
||||
|
||||
((!pixelSizeMmIsSet() && !rhs.pixelSizeMmIsSet()) || (pixelSizeMmIsSet() && rhs.pixelSizeMmIsSet() && getPixelSizeMm() == rhs.getPixelSizeMm())) &&
|
||||
|
||||
(getReadoutTimeUs() == rhs.getReadoutTimeUs())
|
||||
(getReadoutTimeNs() == rhs.getReadoutTimeNs())
|
||||
&&
|
||||
|
||||
(getMinFrameTimeUs() == rhs.getMinFrameTimeUs())
|
||||
(getMinFrameTimeNs() == rhs.getMinFrameTimeNs())
|
||||
&&
|
||||
|
||||
(getMinCountTimeUs() == rhs.getMinCountTimeUs())
|
||||
(getMinCountTimeNs() == rhs.getMinCountTimeNs())
|
||||
&&
|
||||
|
||||
|
||||
@@ -140,9 +140,9 @@ void to_json(nlohmann::json& j, const Detector_list_element& o)
|
||||
j["height"] = o.m_Height;
|
||||
if(o.pixelSizeMmIsSet())
|
||||
j["pixel_size_mm"] = o.m_Pixel_size_mm;
|
||||
j["readout_time_us"] = o.m_Readout_time_us;
|
||||
j["min_frame_time_us"] = o.m_Min_frame_time_us;
|
||||
j["min_count_time_us"] = o.m_Min_count_time_us;
|
||||
j["readout_time_ns"] = o.m_Readout_time_ns;
|
||||
j["min_frame_time_ns"] = o.m_Min_frame_time_ns;
|
||||
j["min_count_time_ns"] = o.m_Min_count_time_ns;
|
||||
if(o.typeIsSet())
|
||||
j["type"] = o.m_Type;
|
||||
|
||||
@@ -163,9 +163,9 @@ void from_json(const nlohmann::json& j, Detector_list_element& o)
|
||||
j.at("pixel_size_mm").get_to(o.m_Pixel_size_mm);
|
||||
o.m_Pixel_size_mmIsSet = true;
|
||||
}
|
||||
j.at("readout_time_us").get_to(o.m_Readout_time_us);
|
||||
j.at("min_frame_time_us").get_to(o.m_Min_frame_time_us);
|
||||
j.at("min_count_time_us").get_to(o.m_Min_count_time_us);
|
||||
j.at("readout_time_ns").get_to(o.m_Readout_time_ns);
|
||||
j.at("min_frame_time_ns").get_to(o.m_Min_frame_time_ns);
|
||||
j.at("min_count_time_ns").get_to(o.m_Min_count_time_ns);
|
||||
if(j.find("type") != j.end())
|
||||
{
|
||||
j.at("type").get_to(o.m_Type);
|
||||
@@ -255,29 +255,29 @@ void Detector_list_element::unsetPixel_size_mm()
|
||||
{
|
||||
m_Pixel_size_mmIsSet = false;
|
||||
}
|
||||
int64_t Detector_list_element::getReadoutTimeUs() const
|
||||
int64_t Detector_list_element::getReadoutTimeNs() const
|
||||
{
|
||||
return m_Readout_time_us;
|
||||
return m_Readout_time_ns;
|
||||
}
|
||||
void Detector_list_element::setReadoutTimeUs(int64_t const value)
|
||||
void Detector_list_element::setReadoutTimeNs(int64_t const value)
|
||||
{
|
||||
m_Readout_time_us = value;
|
||||
m_Readout_time_ns = value;
|
||||
}
|
||||
int64_t Detector_list_element::getMinFrameTimeUs() const
|
||||
int64_t Detector_list_element::getMinFrameTimeNs() const
|
||||
{
|
||||
return m_Min_frame_time_us;
|
||||
return m_Min_frame_time_ns;
|
||||
}
|
||||
void Detector_list_element::setMinFrameTimeUs(int64_t const value)
|
||||
void Detector_list_element::setMinFrameTimeNs(int64_t const value)
|
||||
{
|
||||
m_Min_frame_time_us = value;
|
||||
m_Min_frame_time_ns = value;
|
||||
}
|
||||
int64_t Detector_list_element::getMinCountTimeUs() const
|
||||
int64_t Detector_list_element::getMinCountTimeNs() const
|
||||
{
|
||||
return m_Min_count_time_us;
|
||||
return m_Min_count_time_ns;
|
||||
}
|
||||
void Detector_list_element::setMinCountTimeUs(int64_t const value)
|
||||
void Detector_list_element::setMinCountTimeNs(int64_t const value)
|
||||
{
|
||||
m_Min_count_time_us = value;
|
||||
m_Min_count_time_ns = value;
|
||||
}
|
||||
org::openapitools::server::model::Detector_type Detector_list_element::getType() const
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -109,18 +109,18 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getReadoutTimeUs() const;
|
||||
void setReadoutTimeUs(int64_t const value);
|
||||
int64_t getReadoutTimeNs() const;
|
||||
void setReadoutTimeNs(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getMinFrameTimeUs() const;
|
||||
void setMinFrameTimeUs(int64_t const value);
|
||||
int64_t getMinFrameTimeNs() const;
|
||||
void setMinFrameTimeNs(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getMinCountTimeUs() const;
|
||||
void setMinCountTimeUs(int64_t const value);
|
||||
int64_t getMinCountTimeNs() const;
|
||||
void setMinCountTimeNs(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -150,11 +150,11 @@ protected:
|
||||
|
||||
float m_Pixel_size_mm;
|
||||
bool m_Pixel_size_mmIsSet;
|
||||
int64_t m_Readout_time_us;
|
||||
int64_t m_Readout_time_ns;
|
||||
|
||||
int64_t m_Min_frame_time_us;
|
||||
int64_t m_Min_frame_time_ns;
|
||||
|
||||
int64_t m_Min_count_time_us;
|
||||
int64_t m_Min_count_time_ns;
|
||||
|
||||
org::openapitools::server::model::Detector_type m_Type;
|
||||
bool m_TypeIsSet;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -99,14 +99,14 @@ public:
|
||||
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.
|
||||
/// Threshold for the PSI EIGER detector and all DECTRIS detectors. 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.
|
||||
/// Bit depth of PSI EIGER read-out. This is If value is not provided, depth will be determined based on the image time: * Exposure time < 500 microseconds depth of 8 bit will be used, * 500 <= exposure time < 2622 microseconds depth of 16 bit will be used * Exposure time >= 2622 microseconds depth of 32 bit will be used.
|
||||
/// </summary>
|
||||
int64_t getEigerBitDepth() const;
|
||||
void setEigerBitDepth(int64_t const value);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -75,8 +75,8 @@ void to_json(nlohmann::json& j, const File_writer_format& o)
|
||||
case File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED:
|
||||
j = "INVALID_VALUE_OPENAPI_GENERATED";
|
||||
break;
|
||||
case File_writer_format::eFile_writer_format::NONE:
|
||||
j = "None";
|
||||
case File_writer_format::eFile_writer_format::NXMXONLYDATA:
|
||||
j = "NXmxOnlyData";
|
||||
break;
|
||||
case File_writer_format::eFile_writer_format::NXMXLEGACY:
|
||||
j = "NXmxLegacy";
|
||||
@@ -84,12 +84,18 @@ void to_json(nlohmann::json& j, const File_writer_format& o)
|
||||
case File_writer_format::eFile_writer_format::NXMXVDS:
|
||||
j = "NXmxVDS";
|
||||
break;
|
||||
case File_writer_format::eFile_writer_format::NXMXINTEGRATED:
|
||||
j = "NXmxIntegrated";
|
||||
break;
|
||||
case File_writer_format::eFile_writer_format::CBF:
|
||||
j = "CBF";
|
||||
break;
|
||||
case File_writer_format::eFile_writer_format::TIFF:
|
||||
j = "TIFF";
|
||||
break;
|
||||
case File_writer_format::eFile_writer_format::NOFILEWRITTEN:
|
||||
j = "NoFileWritten";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,8 +103,8 @@ void from_json(const nlohmann::json& j, File_writer_format& o)
|
||||
{
|
||||
|
||||
auto s = j.get<std::string>();
|
||||
if (s == "None") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::NONE);
|
||||
if (s == "NXmxOnlyData") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::NXMXONLYDATA);
|
||||
}
|
||||
else if (s == "NXmxLegacy") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::NXMXLEGACY);
|
||||
@@ -106,11 +112,17 @@ void from_json(const nlohmann::json& j, File_writer_format& o)
|
||||
else if (s == "NXmxVDS") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::NXMXVDS);
|
||||
}
|
||||
else if (s == "NXmxIntegrated") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::NXMXINTEGRATED);
|
||||
}
|
||||
else if (s == "CBF") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::CBF);
|
||||
}
|
||||
else if (s == "TIFF") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::TIFF);
|
||||
}
|
||||
else if (s == "NoFileWritten") {
|
||||
o.setValue(File_writer_format::eFile_writer_format::NOFILEWRITTEN);
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss << "Unexpected value " << s << " in json"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -12,7 +12,7 @@
|
||||
/*
|
||||
* File_writer_format.h
|
||||
*
|
||||
* None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
|
||||
* NoFileWritten - no files are written at all NXmxOnlyData - only data files are written, no master file NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling NXmxIntegrated - single HDF5 per dataset CBF - CBF format (limited metadata) TIFF - TIFF format (no metadata)
|
||||
*/
|
||||
|
||||
#ifndef File_writer_format_H_
|
||||
@@ -25,7 +25,7 @@ namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
|
||||
/// NoFileWritten - no files are written at all NXmxOnlyData - only data files are written, no master file NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling NXmxIntegrated - single HDF5 per dataset CBF - CBF format (limited metadata) TIFF - TIFF format (no metadata)
|
||||
/// </summary>
|
||||
class File_writer_format
|
||||
{
|
||||
@@ -38,11 +38,13 @@ public:
|
||||
// Avoiding name clashes with user defined
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
NONE,
|
||||
NXMXONLYDATA,
|
||||
NXMXLEGACY,
|
||||
NXMXVDS,
|
||||
NXMXINTEGRATED,
|
||||
CBF,
|
||||
TIFF
|
||||
TIFF,
|
||||
NOFILEWRITTEN
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -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. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Geom_refinement_algorithm.h"
|
||||
#include "Helpers.h"
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Geom_refinement_algorithm::Geom_refinement_algorithm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Geom_refinement_algorithm::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Geom_refinement_algorithm::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Geom_refinement_algorithm::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Geom_refinement_algorithm" : pathPrefix;
|
||||
|
||||
|
||||
if (m_value == Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED)
|
||||
{
|
||||
success = false;
|
||||
msg << _pathPrefix << ": has no value;";
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Geom_refinement_algorithm::operator==(const Geom_refinement_algorithm& rhs) const
|
||||
{
|
||||
return
|
||||
getValue() == rhs.getValue()
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Geom_refinement_algorithm::operator!=(const Geom_refinement_algorithm& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Geom_refinement_algorithm& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
|
||||
switch (o.getValue())
|
||||
{
|
||||
case Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED:
|
||||
j = "INVALID_VALUE_OPENAPI_GENERATED";
|
||||
break;
|
||||
case Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTER:
|
||||
j = "BeamCenter";
|
||||
break;
|
||||
case Geom_refinement_algorithm::eGeom_refinement_algorithm::ORIENTATIONONLY:
|
||||
j = "OrientationOnly";
|
||||
break;
|
||||
case Geom_refinement_algorithm::eGeom_refinement_algorithm::NONE:
|
||||
j = "None";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Geom_refinement_algorithm& o)
|
||||
{
|
||||
|
||||
auto s = j.get<std::string>();
|
||||
if (s == "BeamCenter") {
|
||||
o.setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm::BEAMCENTER);
|
||||
}
|
||||
else if (s == "OrientationOnly") {
|
||||
o.setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm::ORIENTATIONONLY);
|
||||
}
|
||||
else if (s == "None") {
|
||||
o.setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm::NONE);
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss << "Unexpected value " << s << " in json"
|
||||
<< " cannot be converted to enum of type"
|
||||
<< " Geom_refinement_algorithm::eGeom_refinement_algorithm";
|
||||
throw std::invalid_argument(ss.str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Geom_refinement_algorithm::eGeom_refinement_algorithm Geom_refinement_algorithm::getValue() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
void Geom_refinement_algorithm::setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -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. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Geom_refinement_algorithm.h
|
||||
*
|
||||
* Selection of an post-indexing least-square diffraction geometry refinement algorithm used by Jungfraujoch. BeamCenter - This option is refining both beam center and lattice (restricted to a chosen/detected Bravais lattice). OrientationOnly - This option is refining only orientation of the lattice.
|
||||
*/
|
||||
|
||||
#ifndef Geom_refinement_algorithm_H_
|
||||
#define Geom_refinement_algorithm_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Selection of an post-indexing least-square diffraction geometry refinement algorithm used by Jungfraujoch. BeamCenter - This option is refining both beam center and lattice (restricted to a chosen/detected Bravais lattice). OrientationOnly - This option is refining only orientation of the lattice.
|
||||
/// </summary>
|
||||
class Geom_refinement_algorithm
|
||||
{
|
||||
public:
|
||||
Geom_refinement_algorithm();
|
||||
virtual ~Geom_refinement_algorithm() = default;
|
||||
|
||||
enum class eGeom_refinement_algorithm {
|
||||
// To have a valid default value.
|
||||
// Avoiding name clashes with user defined
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
BEAMCENTER,
|
||||
ORIENTATIONONLY,
|
||||
NONE
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Geom_refinement_algorithm& rhs) const;
|
||||
bool operator!=(const Geom_refinement_algorithm& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Geom_refinement_algorithm members
|
||||
|
||||
Geom_refinement_algorithm::eGeom_refinement_algorithm getValue() const;
|
||||
void setValue(Geom_refinement_algorithm::eGeom_refinement_algorithm value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Geom_refinement_algorithm& o);
|
||||
friend void from_json(const nlohmann::json& j, Geom_refinement_algorithm& o);
|
||||
protected:
|
||||
Geom_refinement_algorithm::eGeom_refinement_algorithm m_value = Geom_refinement_algorithm::eGeom_refinement_algorithm::INVALID_VALUE_OPENAPI_GENERATED;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Geom_refinement_algorithm_H_ */
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -18,12 +18,13 @@
|
||||
#ifndef Helpers_H_
|
||||
#define Helpers_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace org::openapitools::server::helpers
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -25,6 +25,10 @@ Image_buffer_status::Image_buffer_status()
|
||||
m_Max_image_number = 0L;
|
||||
m_Total_slots = 0L;
|
||||
m_Available_slots = 0L;
|
||||
m_In_preparation_slots = 0L;
|
||||
m_In_sending_slots = 0L;
|
||||
m_Current_counter = 0L;
|
||||
m_Current_counterIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -96,7 +100,7 @@ bool Image_buffer_status::validate(std::stringstream& msg, const std::string& pa
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -118,7 +122,16 @@ bool Image_buffer_status::operator==(const Image_buffer_status& rhs) const
|
||||
&&
|
||||
|
||||
(getAvailableSlots() == rhs.getAvailableSlots())
|
||||
&&
|
||||
|
||||
(getInPreparationSlots() == rhs.getInPreparationSlots())
|
||||
&&
|
||||
|
||||
(getInSendingSlots() == rhs.getInSendingSlots())
|
||||
&&
|
||||
|
||||
|
||||
((!currentCounterIsSet() && !rhs.currentCounterIsSet()) || (currentCounterIsSet() && rhs.currentCounterIsSet() && getCurrentCounter() == rhs.getCurrentCounter()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -136,6 +149,10 @@ void to_json(nlohmann::json& j, const Image_buffer_status& o)
|
||||
j["image_numbers"] = o.m_Image_numbers;
|
||||
j["total_slots"] = o.m_Total_slots;
|
||||
j["available_slots"] = o.m_Available_slots;
|
||||
j["in_preparation_slots"] = o.m_In_preparation_slots;
|
||||
j["in_sending_slots"] = o.m_In_sending_slots;
|
||||
if(o.currentCounterIsSet())
|
||||
j["current_counter"] = o.m_Current_counter;
|
||||
|
||||
}
|
||||
|
||||
@@ -146,6 +163,13 @@ void from_json(const nlohmann::json& j, Image_buffer_status& o)
|
||||
j.at("image_numbers").get_to(o.m_Image_numbers);
|
||||
j.at("total_slots").get_to(o.m_Total_slots);
|
||||
j.at("available_slots").get_to(o.m_Available_slots);
|
||||
j.at("in_preparation_slots").get_to(o.m_In_preparation_slots);
|
||||
j.at("in_sending_slots").get_to(o.m_In_sending_slots);
|
||||
if(j.find("current_counter") != j.end())
|
||||
{
|
||||
j.at("current_counter").get_to(o.m_Current_counter);
|
||||
o.m_Current_counterIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -189,6 +213,39 @@ void Image_buffer_status::setAvailableSlots(int64_t const value)
|
||||
{
|
||||
m_Available_slots = value;
|
||||
}
|
||||
int64_t Image_buffer_status::getInPreparationSlots() const
|
||||
{
|
||||
return m_In_preparation_slots;
|
||||
}
|
||||
void Image_buffer_status::setInPreparationSlots(int64_t const value)
|
||||
{
|
||||
m_In_preparation_slots = value;
|
||||
}
|
||||
int64_t Image_buffer_status::getInSendingSlots() const
|
||||
{
|
||||
return m_In_sending_slots;
|
||||
}
|
||||
void Image_buffer_status::setInSendingSlots(int64_t const value)
|
||||
{
|
||||
m_In_sending_slots = value;
|
||||
}
|
||||
int64_t Image_buffer_status::getCurrentCounter() const
|
||||
{
|
||||
return m_Current_counter;
|
||||
}
|
||||
void Image_buffer_status::setCurrentCounter(int64_t const value)
|
||||
{
|
||||
m_Current_counter = value;
|
||||
m_Current_counterIsSet = true;
|
||||
}
|
||||
bool Image_buffer_status::currentCounterIsSet() const
|
||||
{
|
||||
return m_Current_counterIsSet;
|
||||
}
|
||||
void Image_buffer_status::unsetCurrent_counter()
|
||||
{
|
||||
m_Current_counterIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -83,6 +83,23 @@ public:
|
||||
/// </summary>
|
||||
int64_t getAvailableSlots() const;
|
||||
void setAvailableSlots(int64_t const value);
|
||||
/// <summary>
|
||||
/// Number of slots in the image buffer that are currently in preparation for sending.
|
||||
/// </summary>
|
||||
int64_t getInPreparationSlots() const;
|
||||
void setInPreparationSlots(int64_t const value);
|
||||
/// <summary>
|
||||
/// Number of slots in the image buffer that are currently sending/writing data.
|
||||
/// </summary>
|
||||
int64_t getInSendingSlots() const;
|
||||
void setInSendingSlots(int64_t const value);
|
||||
/// <summary>
|
||||
/// Counter of changes in the image buffer - either new start message or new image added. For optimization one can only load new images/datasets from the HTTP if this value changes. Counter is optional as it was not implemented in older versions to avoid breaking change
|
||||
/// </summary>
|
||||
int64_t getCurrentCounter() const;
|
||||
void setCurrentCounter(int64_t const value);
|
||||
bool currentCounterIsSet() const;
|
||||
void unsetCurrent_counter();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Image_buffer_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Image_buffer_status& o);
|
||||
@@ -97,6 +114,12 @@ protected:
|
||||
|
||||
int64_t m_Available_slots;
|
||||
|
||||
int64_t m_In_preparation_slots;
|
||||
|
||||
int64_t m_In_sending_slots;
|
||||
|
||||
int64_t m_Current_counter;
|
||||
bool m_Current_counterIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Image_pusher_status.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Image_pusher_status::Image_pusher_status()
|
||||
{
|
||||
m_Connected_writers = 0L;
|
||||
m_Images_written = 0L;
|
||||
m_Images_writtenIsSet = false;
|
||||
m_Images_write_error = 0L;
|
||||
m_Images_write_errorIsSet = false;
|
||||
m_Writer_fifo_utilizationIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Image_pusher_status::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Image_pusher_status::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Image_pusher_status::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Image_pusher_status" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
/* Addr */ {
|
||||
const std::vector<std::string>& value = m_Addr;
|
||||
const std::string currentValuePath = _pathPrefix + ".addr";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const std::string& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Connected_writers */ {
|
||||
const int64_t& value = m_Connected_writers;
|
||||
const std::string currentValuePath = _pathPrefix + ".connectedWriters";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (imagesWrittenIsSet())
|
||||
{
|
||||
const int64_t& value = m_Images_written;
|
||||
const std::string currentValuePath = _pathPrefix + ".imagesWritten";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (imagesWriteErrorIsSet())
|
||||
{
|
||||
const int64_t& value = m_Images_write_error;
|
||||
const std::string currentValuePath = _pathPrefix + ".imagesWriteError";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (writerFifoUtilizationIsSet())
|
||||
{
|
||||
const std::vector<int64_t>& value = m_Writer_fifo_utilization;
|
||||
const std::string currentValuePath = _pathPrefix + ".writerFifoUtilization";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const int64_t& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Image_pusher_status::operator==(const Image_pusher_status& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getPusherType() == rhs.getPusherType())
|
||||
&&
|
||||
|
||||
(getAddr() == rhs.getAddr())
|
||||
&&
|
||||
|
||||
(getConnectedWriters() == rhs.getConnectedWriters())
|
||||
&&
|
||||
|
||||
|
||||
((!imagesWrittenIsSet() && !rhs.imagesWrittenIsSet()) || (imagesWrittenIsSet() && rhs.imagesWrittenIsSet() && getImagesWritten() == rhs.getImagesWritten())) &&
|
||||
|
||||
|
||||
((!imagesWriteErrorIsSet() && !rhs.imagesWriteErrorIsSet()) || (imagesWriteErrorIsSet() && rhs.imagesWriteErrorIsSet() && getImagesWriteError() == rhs.getImagesWriteError())) &&
|
||||
|
||||
|
||||
((!writerFifoUtilizationIsSet() && !rhs.writerFifoUtilizationIsSet()) || (writerFifoUtilizationIsSet() && rhs.writerFifoUtilizationIsSet() && getWriterFifoUtilization() == rhs.getWriterFifoUtilization()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Image_pusher_status::operator!=(const Image_pusher_status& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Image_pusher_status& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["pusher_type"] = o.m_Pusher_type;
|
||||
j["addr"] = o.m_Addr;
|
||||
j["connected_writers"] = o.m_Connected_writers;
|
||||
if(o.imagesWrittenIsSet())
|
||||
j["images_written"] = o.m_Images_written;
|
||||
if(o.imagesWriteErrorIsSet())
|
||||
j["images_write_error"] = o.m_Images_write_error;
|
||||
if(o.writerFifoUtilizationIsSet() || !o.m_Writer_fifo_utilization.empty())
|
||||
j["writer_fifo_utilization"] = o.m_Writer_fifo_utilization;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Image_pusher_status& o)
|
||||
{
|
||||
j.at("pusher_type").get_to(o.m_Pusher_type);
|
||||
j.at("addr").get_to(o.m_Addr);
|
||||
j.at("connected_writers").get_to(o.m_Connected_writers);
|
||||
if(j.find("images_written") != j.end())
|
||||
{
|
||||
j.at("images_written").get_to(o.m_Images_written);
|
||||
o.m_Images_writtenIsSet = true;
|
||||
}
|
||||
if(j.find("images_write_error") != j.end())
|
||||
{
|
||||
j.at("images_write_error").get_to(o.m_Images_write_error);
|
||||
o.m_Images_write_errorIsSet = true;
|
||||
}
|
||||
if(j.find("writer_fifo_utilization") != j.end())
|
||||
{
|
||||
j.at("writer_fifo_utilization").get_to(o.m_Writer_fifo_utilization);
|
||||
o.m_Writer_fifo_utilizationIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Image_pusher_type Image_pusher_status::getPusherType() const
|
||||
{
|
||||
return m_Pusher_type;
|
||||
}
|
||||
void Image_pusher_status::setPusherType(org::openapitools::server::model::Image_pusher_type const& value)
|
||||
{
|
||||
m_Pusher_type = value;
|
||||
}
|
||||
std::vector<std::string> Image_pusher_status::getAddr() const
|
||||
{
|
||||
return m_Addr;
|
||||
}
|
||||
void Image_pusher_status::setAddr(std::vector<std::string> const& value)
|
||||
{
|
||||
m_Addr = value;
|
||||
}
|
||||
int64_t Image_pusher_status::getConnectedWriters() const
|
||||
{
|
||||
return m_Connected_writers;
|
||||
}
|
||||
void Image_pusher_status::setConnectedWriters(int64_t const value)
|
||||
{
|
||||
m_Connected_writers = value;
|
||||
}
|
||||
int64_t Image_pusher_status::getImagesWritten() const
|
||||
{
|
||||
return m_Images_written;
|
||||
}
|
||||
void Image_pusher_status::setImagesWritten(int64_t const value)
|
||||
{
|
||||
m_Images_written = value;
|
||||
m_Images_writtenIsSet = true;
|
||||
}
|
||||
bool Image_pusher_status::imagesWrittenIsSet() const
|
||||
{
|
||||
return m_Images_writtenIsSet;
|
||||
}
|
||||
void Image_pusher_status::unsetImages_written()
|
||||
{
|
||||
m_Images_writtenIsSet = false;
|
||||
}
|
||||
int64_t Image_pusher_status::getImagesWriteError() const
|
||||
{
|
||||
return m_Images_write_error;
|
||||
}
|
||||
void Image_pusher_status::setImagesWriteError(int64_t const value)
|
||||
{
|
||||
m_Images_write_error = value;
|
||||
m_Images_write_errorIsSet = true;
|
||||
}
|
||||
bool Image_pusher_status::imagesWriteErrorIsSet() const
|
||||
{
|
||||
return m_Images_write_errorIsSet;
|
||||
}
|
||||
void Image_pusher_status::unsetImages_write_error()
|
||||
{
|
||||
m_Images_write_errorIsSet = false;
|
||||
}
|
||||
std::vector<int64_t> Image_pusher_status::getWriterFifoUtilization() const
|
||||
{
|
||||
return m_Writer_fifo_utilization;
|
||||
}
|
||||
void Image_pusher_status::setWriterFifoUtilization(std::vector<int64_t> const value)
|
||||
{
|
||||
m_Writer_fifo_utilization = value;
|
||||
m_Writer_fifo_utilizationIsSet = true;
|
||||
}
|
||||
bool Image_pusher_status::writerFifoUtilizationIsSet() const
|
||||
{
|
||||
return m_Writer_fifo_utilizationIsSet;
|
||||
}
|
||||
void Image_pusher_status::unsetWriter_fifo_utilization()
|
||||
{
|
||||
m_Writer_fifo_utilizationIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Image_pusher_status.h
|
||||
*
|
||||
* Informs about status of the image pusher.
|
||||
*/
|
||||
|
||||
#ifndef Image_pusher_status_H_
|
||||
#define Image_pusher_status_H_
|
||||
|
||||
|
||||
#include "Image_pusher_type.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Informs about status of the image pusher.
|
||||
/// </summary>
|
||||
class Image_pusher_status
|
||||
{
|
||||
public:
|
||||
Image_pusher_status();
|
||||
virtual ~Image_pusher_status() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Image_pusher_status& rhs) const;
|
||||
bool operator!=(const Image_pusher_status& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Image_pusher_status members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Image_pusher_type getPusherType() const;
|
||||
void setPusherType(org::openapitools::server::model::Image_pusher_type const& value);
|
||||
/// <summary>
|
||||
/// List of addresses of image pushers. For HDF5 socket - no addresses will be returned. For ZeroMQ - list of addresses for each socket will be provided. For TCP/IP - single address to connect all writers will be provided.
|
||||
/// </summary>
|
||||
std::vector<std::string> getAddr() const;
|
||||
void setAddr(std::vector<std::string> const& value);
|
||||
/// <summary>
|
||||
/// Number of connected writers For ZeroMQ image socket: number is constant For TCP/IP image socket: number is updated live during operation
|
||||
/// </summary>
|
||||
int64_t getConnectedWriters() const;
|
||||
void setConnectedWriters(int64_t const value);
|
||||
/// <summary>
|
||||
/// Number of images written to the image socket. This number is updated live during operation for TCP/IP image socket and direct HDF5 writer. It is updated at the end of experiment for ZeroMQ image socket.
|
||||
/// </summary>
|
||||
int64_t getImagesWritten() const;
|
||||
void setImagesWritten(int64_t const value);
|
||||
bool imagesWrittenIsSet() const;
|
||||
void unsetImages_written();
|
||||
/// <summary>
|
||||
/// Number of images that could not be written to the image socket. This number is updated live during operation for TCP/IP image socket. No other socket use it.
|
||||
/// </summary>
|
||||
int64_t getImagesWriteError() const;
|
||||
void setImagesWriteError(int64_t const value);
|
||||
bool imagesWriteErrorIsSet() const;
|
||||
void unsetImages_write_error();
|
||||
/// <summary>
|
||||
/// Utilization of internal writer FIFO. This number is updated live during operation for TCP/IP image socket. No other socket use it.
|
||||
/// </summary>
|
||||
std::vector<int64_t> getWriterFifoUtilization() const;
|
||||
void setWriterFifoUtilization(std::vector<int64_t> const value);
|
||||
bool writerFifoUtilizationIsSet() const;
|
||||
void unsetWriter_fifo_utilization();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Image_pusher_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Image_pusher_status& o);
|
||||
protected:
|
||||
org::openapitools::server::model::Image_pusher_type m_Pusher_type;
|
||||
|
||||
std::vector<std::string> m_Addr;
|
||||
|
||||
int64_t m_Connected_writers;
|
||||
|
||||
int64_t m_Images_written;
|
||||
bool m_Images_writtenIsSet;
|
||||
int64_t m_Images_write_error;
|
||||
bool m_Images_write_errorIsSet;
|
||||
std::vector<int64_t> m_Writer_fifo_utilization;
|
||||
bool m_Writer_fifo_utilizationIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Image_pusher_status_H_ */
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -84,6 +84,9 @@ void to_json(nlohmann::json& j, const Image_pusher_type& o)
|
||||
case Image_pusher_type::eImage_pusher_type::CBOR:
|
||||
j = "CBOR";
|
||||
break;
|
||||
case Image_pusher_type::eImage_pusher_type::TCP:
|
||||
j = "TCP";
|
||||
break;
|
||||
case Image_pusher_type::eImage_pusher_type::NONE:
|
||||
j = "None";
|
||||
break;
|
||||
@@ -103,6 +106,9 @@ void from_json(const nlohmann::json& j, Image_pusher_type& o)
|
||||
else if (s == "CBOR") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::CBOR);
|
||||
}
|
||||
else if (s == "TCP") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::TCP);
|
||||
}
|
||||
else if (s == "None") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::NONE);
|
||||
} else {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
ZEROMQ,
|
||||
HDF5,
|
||||
CBOR,
|
||||
TCP,
|
||||
NONE
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -81,6 +81,9 @@ void to_json(nlohmann::json& j, const Indexing_algorithm& o)
|
||||
case Indexing_algorithm::eIndexing_algorithm::FFT:
|
||||
j = "FFT";
|
||||
break;
|
||||
case Indexing_algorithm::eIndexing_algorithm::FFTW:
|
||||
j = "FFTW";
|
||||
break;
|
||||
case Indexing_algorithm::eIndexing_algorithm::AUTO:
|
||||
j = "Auto";
|
||||
break;
|
||||
@@ -100,6 +103,9 @@ void from_json(const nlohmann::json& j, Indexing_algorithm& o)
|
||||
else if (s == "FFT") {
|
||||
o.setValue(Indexing_algorithm::eIndexing_algorithm::FFT);
|
||||
}
|
||||
else if (s == "FFTW") {
|
||||
o.setValue(Indexing_algorithm::eIndexing_algorithm::FFTW);
|
||||
}
|
||||
else if (s == "Auto") {
|
||||
o.setValue(Indexing_algorithm::eIndexing_algorithm::AUTO);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
FFBIDX,
|
||||
FFT,
|
||||
FFTW,
|
||||
AUTO,
|
||||
NONE
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -26,6 +26,14 @@ Indexing_settings::Indexing_settings()
|
||||
m_Fft_high_resolution_A = 2.0f;
|
||||
m_Fft_num_vectors = 16384L;
|
||||
m_Tolerance = 0.0f;
|
||||
m_Thread_count = 0L;
|
||||
m_Unit_cell_dist_tolerance = 0.05f;
|
||||
m_Viable_cell_min_spots = 10L;
|
||||
m_Index_ice_rings = false;
|
||||
m_Rotation_indexing = false;
|
||||
m_Rotation_indexing_min_angular_range_deg = 20.0f;
|
||||
m_Rotation_indexing_angular_stride_deg = 0.5f;
|
||||
m_Blocking = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -138,7 +146,87 @@ bool Indexing_settings::validate(std::stringstream& msg, const std::string& path
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Thread_count */ {
|
||||
const int64_t& value = m_Thread_count;
|
||||
const std::string currentValuePath = _pathPrefix + ".threadCount";
|
||||
|
||||
|
||||
if (value < 1ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 64ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 64;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Unit_cell_dist_tolerance */ {
|
||||
const float& value = m_Unit_cell_dist_tolerance;
|
||||
const std::string currentValuePath = _pathPrefix + ".unitCellDistTolerance";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.00010))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.00010;";
|
||||
}
|
||||
if (value > static_cast<float>(0.2001))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 0.2001;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Viable_cell_min_spots */ {
|
||||
const int64_t& value = m_Viable_cell_min_spots;
|
||||
const std::string currentValuePath = _pathPrefix + ".viableCellMinSpots";
|
||||
|
||||
|
||||
if (value < 5ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 5;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Rotation_indexing_min_angular_range_deg */ {
|
||||
const float& value = m_Rotation_indexing_min_angular_range_deg;
|
||||
const std::string currentValuePath = _pathPrefix + ".rotationIndexingMinAngularRangeDeg";
|
||||
|
||||
|
||||
if (value < static_cast<float>(1.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Rotation_indexing_angular_stride_deg */ {
|
||||
const float& value = m_Rotation_indexing_angular_stride_deg;
|
||||
const std::string currentValuePath = _pathPrefix + ".rotationIndexingAngularStrideDeg";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -163,6 +251,33 @@ bool Indexing_settings::operator==(const Indexing_settings& rhs) const
|
||||
&&
|
||||
|
||||
(getTolerance() == rhs.getTolerance())
|
||||
&&
|
||||
|
||||
(getThreadCount() == rhs.getThreadCount())
|
||||
&&
|
||||
|
||||
(getGeomRefinementAlgorithm() == rhs.getGeomRefinementAlgorithm())
|
||||
&&
|
||||
|
||||
(getUnitCellDistTolerance() == rhs.getUnitCellDistTolerance())
|
||||
&&
|
||||
|
||||
(getViableCellMinSpots() == rhs.getViableCellMinSpots())
|
||||
&&
|
||||
|
||||
(isIndexIceRings() == rhs.isIndexIceRings())
|
||||
&&
|
||||
|
||||
(isRotationIndexing() == rhs.isRotationIndexing())
|
||||
&&
|
||||
|
||||
(getRotationIndexingMinAngularRangeDeg() == rhs.getRotationIndexingMinAngularRangeDeg())
|
||||
&&
|
||||
|
||||
(getRotationIndexingAngularStrideDeg() == rhs.getRotationIndexingAngularStrideDeg())
|
||||
&&
|
||||
|
||||
(isBlocking() == rhs.isBlocking())
|
||||
|
||||
|
||||
;
|
||||
@@ -182,6 +297,15 @@ void to_json(nlohmann::json& j, const Indexing_settings& o)
|
||||
j["fft_high_resolution_A"] = o.m_Fft_high_resolution_A;
|
||||
j["fft_num_vectors"] = o.m_Fft_num_vectors;
|
||||
j["tolerance"] = o.m_Tolerance;
|
||||
j["thread_count"] = o.m_Thread_count;
|
||||
j["geom_refinement_algorithm"] = o.m_Geom_refinement_algorithm;
|
||||
j["unit_cell_dist_tolerance"] = o.m_Unit_cell_dist_tolerance;
|
||||
j["viable_cell_min_spots"] = o.m_Viable_cell_min_spots;
|
||||
j["index_ice_rings"] = o.m_Index_ice_rings;
|
||||
j["rotation_indexing"] = o.m_Rotation_indexing;
|
||||
j["rotation_indexing_min_angular_range_deg"] = o.m_Rotation_indexing_min_angular_range_deg;
|
||||
j["rotation_indexing_angular_stride_deg"] = o.m_Rotation_indexing_angular_stride_deg;
|
||||
j["blocking"] = o.m_Blocking;
|
||||
|
||||
}
|
||||
|
||||
@@ -193,6 +317,15 @@ void from_json(const nlohmann::json& j, Indexing_settings& o)
|
||||
j.at("fft_high_resolution_A").get_to(o.m_Fft_high_resolution_A);
|
||||
j.at("fft_num_vectors").get_to(o.m_Fft_num_vectors);
|
||||
j.at("tolerance").get_to(o.m_Tolerance);
|
||||
j.at("thread_count").get_to(o.m_Thread_count);
|
||||
j.at("geom_refinement_algorithm").get_to(o.m_Geom_refinement_algorithm);
|
||||
j.at("unit_cell_dist_tolerance").get_to(o.m_Unit_cell_dist_tolerance);
|
||||
j.at("viable_cell_min_spots").get_to(o.m_Viable_cell_min_spots);
|
||||
j.at("index_ice_rings").get_to(o.m_Index_ice_rings);
|
||||
j.at("rotation_indexing").get_to(o.m_Rotation_indexing);
|
||||
j.at("rotation_indexing_min_angular_range_deg").get_to(o.m_Rotation_indexing_min_angular_range_deg);
|
||||
j.at("rotation_indexing_angular_stride_deg").get_to(o.m_Rotation_indexing_angular_stride_deg);
|
||||
j.at("blocking").get_to(o.m_Blocking);
|
||||
|
||||
}
|
||||
|
||||
@@ -244,6 +377,78 @@ void Indexing_settings::setTolerance(float const value)
|
||||
{
|
||||
m_Tolerance = value;
|
||||
}
|
||||
int64_t Indexing_settings::getThreadCount() const
|
||||
{
|
||||
return m_Thread_count;
|
||||
}
|
||||
void Indexing_settings::setThreadCount(int64_t const value)
|
||||
{
|
||||
m_Thread_count = value;
|
||||
}
|
||||
org::openapitools::server::model::Geom_refinement_algorithm Indexing_settings::getGeomRefinementAlgorithm() const
|
||||
{
|
||||
return m_Geom_refinement_algorithm;
|
||||
}
|
||||
void Indexing_settings::setGeomRefinementAlgorithm(org::openapitools::server::model::Geom_refinement_algorithm const& value)
|
||||
{
|
||||
m_Geom_refinement_algorithm = value;
|
||||
}
|
||||
float Indexing_settings::getUnitCellDistTolerance() const
|
||||
{
|
||||
return m_Unit_cell_dist_tolerance;
|
||||
}
|
||||
void Indexing_settings::setUnitCellDistTolerance(float const value)
|
||||
{
|
||||
m_Unit_cell_dist_tolerance = value;
|
||||
}
|
||||
int64_t Indexing_settings::getViableCellMinSpots() const
|
||||
{
|
||||
return m_Viable_cell_min_spots;
|
||||
}
|
||||
void Indexing_settings::setViableCellMinSpots(int64_t const value)
|
||||
{
|
||||
m_Viable_cell_min_spots = value;
|
||||
}
|
||||
bool Indexing_settings::isIndexIceRings() const
|
||||
{
|
||||
return m_Index_ice_rings;
|
||||
}
|
||||
void Indexing_settings::setIndexIceRings(bool const value)
|
||||
{
|
||||
m_Index_ice_rings = value;
|
||||
}
|
||||
bool Indexing_settings::isRotationIndexing() const
|
||||
{
|
||||
return m_Rotation_indexing;
|
||||
}
|
||||
void Indexing_settings::setRotationIndexing(bool const value)
|
||||
{
|
||||
m_Rotation_indexing = value;
|
||||
}
|
||||
float Indexing_settings::getRotationIndexingMinAngularRangeDeg() const
|
||||
{
|
||||
return m_Rotation_indexing_min_angular_range_deg;
|
||||
}
|
||||
void Indexing_settings::setRotationIndexingMinAngularRangeDeg(float const value)
|
||||
{
|
||||
m_Rotation_indexing_min_angular_range_deg = value;
|
||||
}
|
||||
float Indexing_settings::getRotationIndexingAngularStrideDeg() const
|
||||
{
|
||||
return m_Rotation_indexing_angular_stride_deg;
|
||||
}
|
||||
void Indexing_settings::setRotationIndexingAngularStrideDeg(float const value)
|
||||
{
|
||||
m_Rotation_indexing_angular_stride_deg = value;
|
||||
}
|
||||
bool Indexing_settings::isBlocking() const
|
||||
{
|
||||
return m_Blocking;
|
||||
}
|
||||
void Indexing_settings::setBlocking(bool const value)
|
||||
{
|
||||
m_Blocking = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
|
||||
#include "Indexing_algorithm.h"
|
||||
#include "Geom_refinement_algorithm.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
@@ -88,6 +89,51 @@ public:
|
||||
/// </summary>
|
||||
float getTolerance() const;
|
||||
void setTolerance(float const value);
|
||||
/// <summary>
|
||||
/// Thread count for indexing algorithm
|
||||
/// </summary>
|
||||
int64_t getThreadCount() const;
|
||||
void setThreadCount(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Geom_refinement_algorithm getGeomRefinementAlgorithm() const;
|
||||
void setGeomRefinementAlgorithm(org::openapitools::server::model::Geom_refinement_algorithm const& value);
|
||||
/// <summary>
|
||||
/// Relative distance tolerance for unit cell vs. reference; Lattices outside given tolerance will be ignored
|
||||
/// </summary>
|
||||
float getUnitCellDistTolerance() const;
|
||||
void setUnitCellDistTolerance(float const value);
|
||||
/// <summary>
|
||||
/// Minimum number of indexed spots required for a cell to be considered viable
|
||||
/// </summary>
|
||||
int64_t getViableCellMinSpots() const;
|
||||
void setViableCellMinSpots(int64_t const value);
|
||||
/// <summary>
|
||||
/// Include spots marked as ice rings in the indexing run. If `dataset_settings` doesn't have `detect_ice_rings` on, this option will have no effect on processing.
|
||||
/// </summary>
|
||||
bool isIndexIceRings() const;
|
||||
void setIndexIceRings(bool const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool isRotationIndexing() const;
|
||||
void setRotationIndexing(bool const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getRotationIndexingMinAngularRangeDeg() const;
|
||||
void setRotationIndexingMinAngularRangeDeg(float const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getRotationIndexingAngularStrideDeg() const;
|
||||
void setRotationIndexingAngularStrideDeg(float const value);
|
||||
/// <summary>
|
||||
/// Indexing in Jungfraujoch goes with a dedicated thread pool. If set to false, the thread pool is non-blocking, i.e. if there are no threads available, image indexing will be skipped. This option is recommended for real-time processing at high frame rates. If set to true, the thread pool will block until a thread is available.
|
||||
/// </summary>
|
||||
bool isBlocking() const;
|
||||
void setBlocking(bool const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Indexing_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Indexing_settings& o);
|
||||
@@ -104,6 +150,24 @@ protected:
|
||||
|
||||
float m_Tolerance;
|
||||
|
||||
int64_t m_Thread_count;
|
||||
|
||||
org::openapitools::server::model::Geom_refinement_algorithm m_Geom_refinement_algorithm;
|
||||
|
||||
float m_Unit_cell_dist_tolerance;
|
||||
|
||||
int64_t m_Viable_cell_min_spots;
|
||||
|
||||
bool m_Index_ice_rings;
|
||||
|
||||
bool m_Rotation_indexing;
|
||||
|
||||
float m_Rotation_indexing_min_angular_range_deg;
|
||||
|
||||
float m_Rotation_indexing_angular_stride_deg;
|
||||
|
||||
bool m_Blocking;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* 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.
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.59
|
||||
* The version of the OpenAPI document: 1.0.0-rc.154
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -23,6 +23,7 @@ Jfjoch_settings::Jfjoch_settings()
|
||||
{
|
||||
m_PcieIsSet = false;
|
||||
m_ZeromqIsSet = false;
|
||||
m_TcpIsSet = false;
|
||||
m_InstrumentIsSet = false;
|
||||
m_File_writerIsSet = false;
|
||||
m_IndexingIsSet = false;
|
||||
@@ -31,14 +32,17 @@ Jfjoch_settings::Jfjoch_settings()
|
||||
m_Image_formatIsSet = false;
|
||||
m_Image_buffer_MiB = 2048;
|
||||
m_Image_buffer_MiBIsSet = false;
|
||||
m_Verbose = false;
|
||||
m_VerboseIsSet = false;
|
||||
m_Receiver_threads = 64;
|
||||
m_Receiver_threadsIsSet = false;
|
||||
m_Numa_policy = "";
|
||||
m_Numa_policyIsSet = false;
|
||||
m_Frontend_directory = "";
|
||||
m_Inference_server_addrIsSet = false;
|
||||
m_Spot_findingIsSet = false;
|
||||
m_Zeromq_previewIsSet = false;
|
||||
m_Zeromq_metadataIsSet = false;
|
||||
m_Dark_maskIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +86,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Detector */ {
|
||||
const std::vector<org::openapitools::server::model::Detector>& value = m_Detector;
|
||||
@@ -117,7 +121,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (receiverThreadsIsSet())
|
||||
{
|
||||
const int32_t& value = m_Receiver_threads;
|
||||
@@ -136,28 +140,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (inferenceServerAddrIsSet())
|
||||
{
|
||||
const std::vector<std::string>& value = m_Inference_server_addr;
|
||||
const std::string currentValuePath = _pathPrefix + ".inferenceServerAddr";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const std::string& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -173,6 +156,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
|
||||
((!zeromqIsSet() && !rhs.zeromqIsSet()) || (zeromqIsSet() && rhs.zeromqIsSet() && getZeromq() == rhs.getZeromq())) &&
|
||||
|
||||
|
||||
((!tcpIsSet() && !rhs.tcpIsSet()) || (tcpIsSet() && rhs.tcpIsSet() && getTcp() == rhs.getTcp())) &&
|
||||
|
||||
|
||||
((!instrumentIsSet() && !rhs.instrumentIsSet()) || (instrumentIsSet() && rhs.instrumentIsSet() && getInstrument() == rhs.getInstrument())) &&
|
||||
|
||||
|
||||
@@ -197,6 +183,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
|
||||
((!imageBufferMiBIsSet() && !rhs.imageBufferMiBIsSet()) || (imageBufferMiBIsSet() && rhs.imageBufferMiBIsSet() && getImageBufferMiB() == rhs.getImageBufferMiB())) &&
|
||||
|
||||
|
||||
((!verboseIsSet() && !rhs.verboseIsSet()) || (verboseIsSet() && rhs.verboseIsSet() && isVerbose() == rhs.isVerbose())) &&
|
||||
|
||||
|
||||
((!receiverThreadsIsSet() && !rhs.receiverThreadsIsSet()) || (receiverThreadsIsSet() && rhs.receiverThreadsIsSet() && getReceiverThreads() == rhs.getReceiverThreads())) &&
|
||||
|
||||
|
||||
@@ -206,7 +195,7 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
|
||||
&&
|
||||
|
||||
|
||||
((!inferenceServerAddrIsSet() && !rhs.inferenceServerAddrIsSet()) || (inferenceServerAddrIsSet() && rhs.inferenceServerAddrIsSet() && getInferenceServerAddr() == rhs.getInferenceServerAddr())) &&
|
||||
((!spotFindingIsSet() && !rhs.spotFindingIsSet()) || (spotFindingIsSet() && rhs.spotFindingIsSet() && getSpotFinding() == rhs.getSpotFinding())) &&
|
||||
|
||||
(getImagePusher() == rhs.getImagePusher())
|
||||
&&
|
||||
@@ -215,7 +204,10 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
|
||||
((!zeromqPreviewIsSet() && !rhs.zeromqPreviewIsSet()) || (zeromqPreviewIsSet() && rhs.zeromqPreviewIsSet() && getZeromqPreview() == rhs.getZeromqPreview())) &&
|
||||
|
||||
|
||||
((!zeromqMetadataIsSet() && !rhs.zeromqMetadataIsSet()) || (zeromqMetadataIsSet() && rhs.zeromqMetadataIsSet() && getZeromqMetadata() == rhs.getZeromqMetadata()))
|
||||
((!zeromqMetadataIsSet() && !rhs.zeromqMetadataIsSet()) || (zeromqMetadataIsSet() && rhs.zeromqMetadataIsSet() && getZeromqMetadata() == rhs.getZeromqMetadata())) &&
|
||||
|
||||
|
||||
((!darkMaskIsSet() && !rhs.darkMaskIsSet()) || (darkMaskIsSet() && rhs.darkMaskIsSet() && getDarkMask() == rhs.getDarkMask()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -232,6 +224,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o)
|
||||
j["pcie"] = o.m_Pcie;
|
||||
if(o.zeromqIsSet())
|
||||
j["zeromq"] = o.m_Zeromq;
|
||||
if(o.tcpIsSet())
|
||||
j["tcp"] = o.m_Tcp;
|
||||
if(o.instrumentIsSet())
|
||||
j["instrument"] = o.m_Instrument;
|
||||
if(o.fileWriterIsSet())
|
||||
@@ -247,18 +241,22 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o)
|
||||
j["image_format"] = o.m_Image_format;
|
||||
if(o.imageBufferMiBIsSet())
|
||||
j["image_buffer_MiB"] = o.m_Image_buffer_MiB;
|
||||
if(o.verboseIsSet())
|
||||
j["verbose"] = o.m_Verbose;
|
||||
if(o.receiverThreadsIsSet())
|
||||
j["receiver_threads"] = o.m_Receiver_threads;
|
||||
if(o.numaPolicyIsSet())
|
||||
j["numa_policy"] = o.m_Numa_policy;
|
||||
j["frontend_directory"] = o.m_Frontend_directory;
|
||||
if(o.inferenceServerAddrIsSet() || !o.m_Inference_server_addr.empty())
|
||||
j["inference_server_addr"] = o.m_Inference_server_addr;
|
||||
if(o.spotFindingIsSet())
|
||||
j["spot_finding"] = o.m_Spot_finding;
|
||||
j["image_pusher"] = o.m_Image_pusher;
|
||||
if(o.zeromqPreviewIsSet())
|
||||
j["zeromq_preview"] = o.m_Zeromq_preview;
|
||||
if(o.zeromqMetadataIsSet())
|
||||
j["zeromq_metadata"] = o.m_Zeromq_metadata;
|
||||
if(o.darkMaskIsSet())
|
||||
j["dark_mask"] = o.m_Dark_mask;
|
||||
|
||||
}
|
||||
|
||||
@@ -274,6 +272,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
|
||||
j.at("zeromq").get_to(o.m_Zeromq);
|
||||
o.m_ZeromqIsSet = true;
|
||||
}
|
||||
if(j.find("tcp") != j.end())
|
||||
{
|
||||
j.at("tcp").get_to(o.m_Tcp);
|
||||
o.m_TcpIsSet = true;
|
||||
}
|
||||
if(j.find("instrument") != j.end())
|
||||
{
|
||||
j.at("instrument").get_to(o.m_Instrument);
|
||||
@@ -310,6 +313,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
|
||||
j.at("image_buffer_MiB").get_to(o.m_Image_buffer_MiB);
|
||||
o.m_Image_buffer_MiBIsSet = true;
|
||||
}
|
||||
if(j.find("verbose") != j.end())
|
||||
{
|
||||
j.at("verbose").get_to(o.m_Verbose);
|
||||
o.m_VerboseIsSet = true;
|
||||
}
|
||||
if(j.find("receiver_threads") != j.end())
|
||||
{
|
||||
j.at("receiver_threads").get_to(o.m_Receiver_threads);
|
||||
@@ -321,10 +329,10 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
|
||||
o.m_Numa_policyIsSet = true;
|
||||
}
|
||||
j.at("frontend_directory").get_to(o.m_Frontend_directory);
|
||||
if(j.find("inference_server_addr") != j.end())
|
||||
if(j.find("spot_finding") != j.end())
|
||||
{
|
||||
j.at("inference_server_addr").get_to(o.m_Inference_server_addr);
|
||||
o.m_Inference_server_addrIsSet = true;
|
||||
j.at("spot_finding").get_to(o.m_Spot_finding);
|
||||
o.m_Spot_findingIsSet = true;
|
||||
}
|
||||
j.at("image_pusher").get_to(o.m_Image_pusher);
|
||||
if(j.find("zeromq_preview") != j.end())
|
||||
@@ -337,6 +345,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
|
||||
j.at("zeromq_metadata").get_to(o.m_Zeromq_metadata);
|
||||
o.m_Zeromq_metadataIsSet = true;
|
||||
}
|
||||
if(j.find("dark_mask") != j.end())
|
||||
{
|
||||
j.at("dark_mask").get_to(o.m_Dark_mask);
|
||||
o.m_Dark_maskIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -374,6 +387,23 @@ void Jfjoch_settings::unsetZeromq()
|
||||
{
|
||||
m_ZeromqIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Tcp_settings Jfjoch_settings::getTcp() const
|
||||
{
|
||||
return m_Tcp;
|
||||
}
|
||||
void Jfjoch_settings::setTcp(org::openapitools::server::model::Tcp_settings const& value)
|
||||
{
|
||||
m_Tcp = value;
|
||||
m_TcpIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::tcpIsSet() const
|
||||
{
|
||||
return m_TcpIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetTcp()
|
||||
{
|
||||
m_TcpIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Instrument_metadata Jfjoch_settings::getInstrument() const
|
||||
{
|
||||
return m_Instrument;
|
||||
@@ -501,6 +531,23 @@ void Jfjoch_settings::unsetImage_buffer_MiB()
|
||||
{
|
||||
m_Image_buffer_MiBIsSet = false;
|
||||
}
|
||||
bool Jfjoch_settings::isVerbose() const
|
||||
{
|
||||
return m_Verbose;
|
||||
}
|
||||
void Jfjoch_settings::setVerbose(bool const value)
|
||||
{
|
||||
m_Verbose = value;
|
||||
m_VerboseIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::verboseIsSet() const
|
||||
{
|
||||
return m_VerboseIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetVerbose()
|
||||
{
|
||||
m_VerboseIsSet = false;
|
||||
}
|
||||
int32_t Jfjoch_settings::getReceiverThreads() const
|
||||
{
|
||||
return m_Receiver_threads;
|
||||
@@ -543,22 +590,22 @@ void Jfjoch_settings::setFrontendDirectory(std::string const& value)
|
||||
{
|
||||
m_Frontend_directory = value;
|
||||
}
|
||||
std::vector<std::string> Jfjoch_settings::getInferenceServerAddr() const
|
||||
org::openapitools::server::model::Spot_finding_settings Jfjoch_settings::getSpotFinding() const
|
||||
{
|
||||
return m_Inference_server_addr;
|
||||
return m_Spot_finding;
|
||||
}
|
||||
void Jfjoch_settings::setInferenceServerAddr(std::vector<std::string> const& value)
|
||||
void Jfjoch_settings::setSpotFinding(org::openapitools::server::model::Spot_finding_settings const& value)
|
||||
{
|
||||
m_Inference_server_addr = value;
|
||||
m_Inference_server_addrIsSet = true;
|
||||
m_Spot_finding = value;
|
||||
m_Spot_findingIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::inferenceServerAddrIsSet() const
|
||||
bool Jfjoch_settings::spotFindingIsSet() const
|
||||
{
|
||||
return m_Inference_server_addrIsSet;
|
||||
return m_Spot_findingIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetInference_server_addr()
|
||||
void Jfjoch_settings::unsetSpot_finding()
|
||||
{
|
||||
m_Inference_server_addrIsSet = false;
|
||||
m_Spot_findingIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Image_pusher_type Jfjoch_settings::getImagePusher() const
|
||||
{
|
||||
@@ -602,6 +649,23 @@ void Jfjoch_settings::unsetZeromq_metadata()
|
||||
{
|
||||
m_Zeromq_metadataIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Dark_mask_settings Jfjoch_settings::getDarkMask() const
|
||||
{
|
||||
return m_Dark_mask;
|
||||
}
|
||||
void Jfjoch_settings::setDarkMask(org::openapitools::server::model::Dark_mask_settings const& value)
|
||||
{
|
||||
m_Dark_mask = value;
|
||||
m_Dark_maskIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::darkMaskIsSet() const
|
||||
{
|
||||
return m_Dark_maskIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetDark_mask()
|
||||
{
|
||||
m_Dark_maskIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user