Compare commits
99
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
575d5d09e4 | ||
|
|
523301bc6b | ||
|
|
4d20298523 | ||
|
|
8ecfa780eb | ||
|
|
d90888b5f9 | ||
|
|
1aac0495e1 | ||
|
|
d033b378ae | ||
|
|
6c80dbdc32 | ||
|
|
4aab8078d6 | ||
|
|
fbebc0d56e | ||
|
|
bab52a8077 | ||
|
|
dee679380b | ||
|
|
a854523fee | ||
|
|
27802a30a3 | ||
|
|
0dfaf0a58a | ||
|
|
f737424bdf | ||
|
|
b1cd49c6b5 | ||
|
|
c37bc2d005 | ||
|
|
b3b4f5824e | ||
|
|
3b02156fba | ||
|
|
180f93341a | ||
|
|
7fd2105f96 | ||
|
|
53ffb56aae | ||
|
|
4fcbb09771 | ||
|
|
cdcd5d28ca | ||
|
|
007e65cdfe | ||
|
|
49d078563c | ||
|
|
efd5f3513a | ||
|
|
6c9a22d7f3 | ||
|
|
05feb74602 | ||
|
|
4b72a89249 | ||
|
|
acd2025676 | ||
|
|
e7fbeb527f | ||
|
|
c3468eef6c | ||
|
|
7da60c3385 | ||
|
|
54de990100 | ||
|
|
668855a9e7 | ||
|
|
61eb661eca | ||
|
|
85cf1b04d1 | ||
|
|
4374babe26 | ||
|
|
936d2efd4a | ||
|
|
0ed943dd4d | ||
|
|
228841870d | ||
|
|
9b1ab02c41 | ||
|
|
343af8deed | ||
|
|
8858951419 | ||
|
|
4292c990ea | ||
|
|
54c0100e8e | ||
|
|
d6389e12da | ||
|
|
54c667190f | ||
|
|
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 |
@@ -1,2 +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
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
name: Build Packages
|
||||
|
||||
env:
|
||||
MARCH_CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-march=x86-64-v3" -DCMAKE_C_FLAGS="-march=x86-64-v3"'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -16,6 +19,150 @@ on:
|
||||
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-windows:
|
||||
name: build:windows:${{ matrix.variant }}
|
||||
runs-on: windows-11-cuda-qt
|
||||
timeout-minutes: 120
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- variant: cuda
|
||||
use_cuda: 'ON'
|
||||
- variant: nocuda
|
||||
use_cuda: 'OFF'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Configure viewer build
|
||||
shell: cmd
|
||||
run: |
|
||||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "VSPATH=%%i"
|
||||
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cmake -G Ninja -B build -DJFJOCH_USE_CUDA=${{ matrix.use_cuda }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:/deps;C:/Qt/6.11.1/msvc2022_64"
|
||||
- name: Build viewer
|
||||
shell: cmd
|
||||
run: |
|
||||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "VSPATH=%%i"
|
||||
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cmake --build build
|
||||
- name: Build installer (NSIS)
|
||||
shell: cmd
|
||||
run: |
|
||||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "VSPATH=%%i"
|
||||
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cd build
|
||||
cpack
|
||||
- name: Upload installer to release
|
||||
if: github.ref_type == 'tag'
|
||||
shell: powershell
|
||||
env:
|
||||
TOKEN: ${{ secrets.PIP_REPOSITORY_API_TOKEN }}
|
||||
run: |
|
||||
# NSIS installer named jfjoch-viewer-<version>-win64-{cuda<major>|cpu}.exe (see CMakeLists.txt).
|
||||
$files = Get-ChildItem -Path build -Filter 'jfjoch-viewer-*-win64-*.exe'
|
||||
if ($files.Count -eq 0) { throw 'No Windows installer found in build/' }
|
||||
foreach ($file in $files) {
|
||||
python gitea_upload_file.py $file.FullName
|
||||
if ($LASTEXITCODE -ne 0) { throw "Upload failed for $($file.Name)" }
|
||||
}
|
||||
build-viewer-tgz:
|
||||
name: build:viewer-tgz:${{ matrix.variant }}
|
||||
runs-on: jfjoch_rocky8
|
||||
timeout-minutes: 120
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- variant: cuda
|
||||
use_cuda: 'ON'
|
||||
- variant: cpu
|
||||
use_cuda: 'OFF'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Clean previous build
|
||||
shell: bash
|
||||
run: rm -rf build # self-hosted runners reuse the workspace volume; a stale build dir
|
||||
# can leave the viewer linking a system libcurl instead of the vendored one
|
||||
- name: Configure viewer build
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DJFJOCH_VIEWER_ONLY=ON -DJFJOCH_USE_CUDA=${{ matrix.use_cuda }} ${{ env.MARCH_CMAKE_FLAGS }} -DCMAKE_BUILD_TYPE=Release ..
|
||||
- name: Build viewer tgz
|
||||
shell: bash
|
||||
run: |
|
||||
cd build
|
||||
# Build the whole viewer-only tree, not just the GUI: the "viewer" CPack component also
|
||||
# contains the portable CLI tools (rugnux/rugnux_scale/azint/recompress/extract_hkl),
|
||||
# which must exist on disk before cpack installs the component.
|
||||
ninja -j16
|
||||
cpack
|
||||
- name: Upload viewer tgz to release
|
||||
if: github.ref_type == 'tag'
|
||||
shell: bash
|
||||
env:
|
||||
TOKEN: ${{ secrets.PIP_REPOSITORY_API_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
shopt -s nullglob
|
||||
# CMakeLists.txt names the archive jfjoch_viewer-<version>-linux-{cuda<major>|cpu}.tar.gz;
|
||||
# rename to .tgz (matching the Windows installer's release naming) before upload.
|
||||
files=(build/jfjoch_viewer-*.tar.gz)
|
||||
if [ ${#files[@]} -eq 0 ]; then
|
||||
echo "No viewer archive found in build/"
|
||||
exit 1
|
||||
fi
|
||||
for file in "${files[@]}"; do
|
||||
tgz="${file%.tar.gz}.tgz"
|
||||
mv "$file" "$tgz"
|
||||
python3 gitea_upload_file.py "$tgz"
|
||||
done
|
||||
build-rpm:
|
||||
name: build:rpm (${{ matrix.distro }})
|
||||
if: github.ref_type != 'workflow_dispatch'
|
||||
@@ -44,6 +191,11 @@ jobs:
|
||||
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
|
||||
@@ -71,12 +223,20 @@ jobs:
|
||||
upload_url: https://gitea.psi.ch/api/packages/mx/debian/pool/noble/nocuda/upload
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build packages
|
||||
- name: Clean previous build
|
||||
shell: bash
|
||||
run: rm -rf build # self-hosted runners reuse the workspace volume; a stale build dir
|
||||
# can leave the viewer linking a system libcurl instead of the vendored one
|
||||
- name: Setup build (cmake)
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} ..
|
||||
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
|
||||
@@ -93,26 +253,168 @@ jobs:
|
||||
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 -> ${{ matrix.upload_url }}"
|
||||
curl --fail --user __token__:"$TOKEN" --upload-file "$file" "${{ matrix.upload_url }}"
|
||||
echo "Uploading $file -> $url"
|
||||
curl --fail --user __token__:"$TOKEN" --upload-file "$file" "$url"
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
# The viewer is shipped to the release as a Linux-version-agnostic .tgz by the
|
||||
# build-viewer-tgz job; only the writer (and the XDS plugin .so on rocky8) go to the
|
||||
# release as distro packages here.
|
||||
if [ "${{ matrix.distro }}" = "rocky8_nocuda" ]; then
|
||||
for file in build/jfjoch-viewer*.rpm build/jfjoch-writer*rpm; do
|
||||
for file in 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
|
||||
for file in 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
|
||||
for file in 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
|
||||
@@ -152,36 +454,6 @@ jobs:
|
||||
git add .
|
||||
git commit -m "Deploy site"
|
||||
git push -f https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git gitea-pages
|
||||
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: Build tests
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
|
||||
ninja -j48 jfjoch_test jfjoch_hdf5_test
|
||||
- name: Run unit tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/tests
|
||||
./jfjoch_test
|
||||
- name: Run hdf5 test
|
||||
shell: bash
|
||||
run: |
|
||||
cd build/tools
|
||||
./jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5
|
||||
|
||||
create-release:
|
||||
name: Create release
|
||||
runs-on: jfjoch_rocky8
|
||||
|
||||
@@ -3,3 +3,6 @@ cmake-build-release/
|
||||
build*/
|
||||
python-client/
|
||||
openapi-generator-cli.jar
|
||||
|
||||
# rugnux_vs_xds.py default output dir
|
||||
rugnux_cmp/
|
||||
|
||||
-406
@@ -1,406 +0,0 @@
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- synthesis
|
||||
- release
|
||||
|
||||
variables:
|
||||
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
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
|
||||
- make -j48
|
||||
|
||||
build:x86:gcc-13:
|
||||
stage: build
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-13/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
|
||||
- make -j48
|
||||
|
||||
build:x86:gcc_writer:
|
||||
stage: build
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_WRITER_ONLY=ON ..
|
||||
- make -j48
|
||||
|
||||
build:x86:gcc_nocuda:
|
||||
stage: build
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_USE_CUDA=OFF ..
|
||||
- make -j48
|
||||
|
||||
build:x86:driver:
|
||||
stage: build
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- cd fpga/pcie_driver
|
||||
- make
|
||||
|
||||
build:x86:python_client:
|
||||
stage: build
|
||||
needs: []
|
||||
tags:
|
||||
- python
|
||||
script:
|
||||
- bash gen_python_client.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- dist/jfjoch_client-*whl
|
||||
- dist/jfjoch_client-*tar.gz
|
||||
expire_in: 1 week
|
||||
|
||||
build:x86:frontend:
|
||||
stage: build
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make frontend
|
||||
- cd ../frontend/dist
|
||||
- tar czf ../../jfjoch_frontend.tar.gz *
|
||||
artifacts:
|
||||
paths:
|
||||
- jfjoch_frontend.tar.gz
|
||||
expire_in: 1 week
|
||||
|
||||
build:x86:rpm:
|
||||
stage: build
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON ..
|
||||
- make frontend
|
||||
- make -j48 package
|
||||
- mv *.rpm ..
|
||||
artifacts:
|
||||
paths:
|
||||
- "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:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
needs: ["build:x86:gcc-12"]
|
||||
dependencies: []
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j48 jfjoch_test jfjoch_hdf5_test
|
||||
- cd tests
|
||||
- ./jfjoch_test -r junit -o report.xml
|
||||
- cd ../tools
|
||||
- ./jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
reports:
|
||||
junit: build/tests/report.xml
|
||||
|
||||
test:x86:crystfel:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
needs: ["build:x86:gcc-12"]
|
||||
dependencies: []
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
- crystfel
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j8 jfjoch_hdf5_test
|
||||
- cd ../tests/crystfel
|
||||
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 10
|
||||
- indexamajig -i writing_test.lst -g jf4m.geom -o x.stream --indexing=xgandalf
|
||||
|
||||
test:x86:xds_durin:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
needs: ["build:x86:gcc-12"]
|
||||
dependencies: []
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
- xds
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j8 jfjoch_hdf5_test
|
||||
- cd ../tests/xds_durin
|
||||
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
|
||||
- xds_par |grep -a1 ISa |tail -n1
|
||||
|
||||
test:x86:xds_durin_new_hdf5_format:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
needs: ["build:x86:gcc-12"]
|
||||
dependencies: []
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
- xds
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j8 jfjoch_hdf5_test
|
||||
- cd ../tests/xds_durin
|
||||
- HDF5MASTER_NEW_FORMAT=1 ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
|
||||
- xds_par |grep -a1 ISa |tail -n1
|
||||
|
||||
test:x86:xds_neggia:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
needs: ["build:x86:gcc-12"]
|
||||
dependencies: []
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
- xds
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j8 jfjoch_hdf5_test
|
||||
- cd ../tests/xds_neggia
|
||||
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
|
||||
- xds_par |grep -a1 ISa |tail -n1
|
||||
|
||||
test:x86:xia2.ssx:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
needs: ["build:x86:gcc-12"]
|
||||
dependencies: []
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
- xds
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- mkdir -p dials_test
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j8 jfjoch_hdf5_test
|
||||
- cd ../dials_test
|
||||
- ../build/tools/jfjoch_hdf5_test ../tests/test_data/compression_benchmark.h5 100
|
||||
- source /usr/local/dials-v3-17-0/dials_env.sh
|
||||
- xia2.ssx image=writing_test_master.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000
|
||||
|
||||
synthesis:hls:
|
||||
stage: synthesis
|
||||
dependencies: []
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
rules:
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^HLS/
|
||||
tags:
|
||||
- vivado
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make hls
|
||||
needs: ["build:x86:gcc-12", "test:x86:gcc"]
|
||||
|
||||
synthesis:100g:
|
||||
stage: synthesis
|
||||
dependencies: []
|
||||
retry: 2
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
allow_failure: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^100G/
|
||||
tags:
|
||||
- vivado
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch_fpga_pcie_100g.mcs"
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make -j4 pcie_100g
|
||||
- mv fpga/jfjoch_fpga_pcie_100g.mcs ..
|
||||
needs: ["build:x86:gcc-12", "test:x86:gcc"]
|
||||
|
||||
synthesis:8x10g:
|
||||
stage: synthesis
|
||||
dependencies: []
|
||||
variables:
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
retry: 2
|
||||
allow_failure: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^8x10G/
|
||||
tags:
|
||||
- vivado
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch_fpga_pcie_8x10g.mcs"
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make -j4 pcie_8x10g
|
||||
- mv fpga/jfjoch_fpga_pcie_8x10g.mcs ..
|
||||
needs: [ "build:x86:gcc-12", "test:x86:gcc" ]
|
||||
|
||||
release:
|
||||
stage: release
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
when: manual
|
||||
tags:
|
||||
- x86
|
||||
- python
|
||||
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,230 @@
|
||||
# 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.
|
||||
- `rugnux` (`tools/rugnux_cli.cpp`, built on the `Rugnux` library in `rugnux/`) — offline batch over
|
||||
a stored HDF5; writes `_process.h5` and `.mtz`/`.cif`/`.hkl`. Merging is on by default (`--no-merge`
|
||||
to disable); `--azint-only` runs only azimuthal integration and `--scale` re-scales/merges the
|
||||
already-integrated reflections in a `_process.h5`. (rugnux = the data-processing half of the system;
|
||||
see `docs/NAMING.md`.)
|
||||
|
||||
**`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`).
|
||||
|
||||
## Adding a per-image scalar quantity
|
||||
|
||||
A per-image scalar (e.g. `ice_ring_score`, `bkg_estimate`, `mosaicity`) flows analysis → message → CBOR
|
||||
→ HDF5 → scan-result/plot → API → viewer/frontend. To add one, mirror an existing float scalar
|
||||
(`bkg_estimate` is a clean template) at every layer:
|
||||
|
||||
1. **Compute** where the azint profile is finalized: `image_analysis/MXAnalysisWithoutFPGA.cpp` (CPU),
|
||||
`receiver/JFJochReceiverFPGA.cpp` (FPGA), and the offline azint worker in `rugnux/Rugnux.cpp`.
|
||||
2. **Message** (`common/JFJochMessages.h`): `std::optional<float>` in `DataMessage`, `std::vector<float>`
|
||||
in `EndMessage`.
|
||||
3. **CBOR**: encode in `frame_serialize/CBORStream2Serializer.cpp` (DataMessage block *and* END block),
|
||||
decode in `CBORStream2Deserializer.cpp` (both). Optional fields are back-compatible — no version bump.
|
||||
4. **HDF5** write: `writer/HDF5DataFilePluginMX.{h,cpp}` — an `AutoIncrVector<float>` with reserve /
|
||||
per-image write / `SaveVector("/entry/MX/<name>")` (per-image arrays live in the data-file plugin);
|
||||
plus the NXmx master write in `writer/HDF5NXmx.cpp` (`SaveVectorIfMissing(..., end.<name>)`). HDF5
|
||||
**read-back** (so a stored file re-opens, e.g. in the viewer) is in `reader/HDF5MetadataSource.cpp`,
|
||||
NOT `JFJochHDF5Reader.cpp`: mirror the three `bkgEstimate` sites — master `ReadOptVector`, data-file
|
||||
`ReadVector` into the dataset, and the per-image message population.
|
||||
5. **Scan result**: `common/ScanResult.h` (`ScanResultElem`) + `common/ScanResultGenerator.cpp`
|
||||
(copy in `Add`, resize+fill in `FillEndMessage`).
|
||||
6. **Receiver plot**: `common/Plot.h` (`PlotType`) + `common/JFJochReceiverPlots.{h,cpp}` (`StatusVector`
|
||||
+ Clear / AddElement / GetPlots / GetPlotRaw cases).
|
||||
7. **API**: add to the `plot_type` enum and the `scan_result` images schema in `broker/jfjoch_api.yaml`,
|
||||
regenerate the C++ model (`java -jar openapi-generator-cli.jar generate -i broker/jfjoch_api.yaml -o
|
||||
broker/gen -g cpp-pistache-server`) and the frontend client (`cd frontend && npm run openapi`), then
|
||||
wire `broker/OpenAPIConvert.cpp` (`ConvertPlotType` string→enum and the `Convert(ScanResult)` setter).
|
||||
8. **Reader/viewer**: `reader/JFJochReaderDataset.h` + `reader/JFJochHttpReader.cpp` (`GetPlot_i`) and
|
||||
`viewer/JFJochViewerDatasetInfo.cpp` (combo item + `ExtractMetric`).
|
||||
9. **Frontend**: `frontend/src/components/DataProcessingPlots.tsx` (`MenuItem`) + `DataProcessingPlot.tsx`
|
||||
(y-axis label).
|
||||
10. **Docs**: `docs/CBOR.md`, `docs/HDF5.md`, `docs/CPU_DATA_ANALYSIS.md`.
|
||||
|
||||
Gotcha: an existing `build/` dir needs a `cmake .` reconfigure to pick up a newly-added `broker/gen`
|
||||
source file (the source list is a configure-time glob).
|
||||
+352
-82
@@ -1,4 +1,4 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.19)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.26)
|
||||
|
||||
FILE(STRINGS VERSION JFJOCH_VERSION)
|
||||
|
||||
@@ -8,16 +8,24 @@ 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)
|
||||
@@ -37,60 +45,76 @@ SET(BUILD_FAST_INDEXER_STATIC ON)
|
||||
|
||||
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 75 80 86 89) # 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)
|
||||
SET(CMAKE_CUDA_RUNTIME_LIBRARY Static)
|
||||
MESSAGE(STATUS "CUDA VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
|
||||
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA)
|
||||
FIND_LIBRARY(CUDART_LIBRARY cudart_static PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
|
||||
SET(JFJOCH_CUDA_AVAILABLE ON)
|
||||
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()
|
||||
|
||||
FIND_LIBRARY(FFTWF_LIBRARY NAMES libfftw3f.a libfftw3f.so fftw3f DOC "FFTW single-precision library"
|
||||
PATHS /usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu/)
|
||||
CHECK_INCLUDE_FILE(fftw3.h HAS_FFTW3_H)
|
||||
|
||||
IF(HAS_FFTW3_H AND FFTWF_LIBRARY)
|
||||
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_FFTW)
|
||||
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)
|
||||
|
||||
SET(PISTACHE_USE_CONTENT_ENCODING_DEFLATE ON)
|
||||
SET(PISTACHE_BUILD_TESTS OFF)
|
||||
SET(PISTACHE_USE_SSL ON)
|
||||
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(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 ON)
|
||||
SET(HDF5_EXTERNALLY_CONFIGURED 1)
|
||||
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(
|
||||
pistache_http
|
||||
GIT_REPOSITORY https://github.com/fleon-psi/pistache
|
||||
GIT_TAG 0393f6c
|
||||
spdlog
|
||||
GIT_REPOSITORY https://github.com/gabime/spdlog.git
|
||||
GIT_TAG v1.17.0
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
@@ -104,7 +128,7 @@ FetchContent_Declare(
|
||||
|
||||
FetchContent_Declare(hdf5
|
||||
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
|
||||
GIT_TAG hdf5_1.14.6
|
||||
GIT_TAG hdf5_2.1.0
|
||||
GIT_SHALLOW 1
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
@@ -117,50 +141,226 @@ FetchContent_Declare(
|
||||
sls_detector_package
|
||||
GIT_REPOSITORY https://github.com/slsdetectorgroup/slsDetectorPackage
|
||||
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)
|
||||
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)
|
||||
ADD_SUBDIRECTORY(symmetry)
|
||||
# httplib auto-enables HTTPS by linking system OpenSSL whenever it finds it. The broker serves
|
||||
# plain HTTP only (TLS, if ever wanted, is terminated by a front reverse proxy), so disable it --
|
||||
# otherwise jfjoch_broker would pull in libssl/libcrypto for no reason.
|
||||
SET(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
IF (JFJOCH_WRITER_ONLY)
|
||||
MESSAGE(STATUS "Compiling HDF5 writer only")
|
||||
# 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
|
||||
)
|
||||
|
||||
# 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()
|
||||
|
||||
# libcurl: the jfjoch_viewer HTTP client (viewer/JFJochHttpReader). Fetched and STATICALLY linked
|
||||
# ONLY for viewer builds, so the broker/writer never pull in a TLS/Kerberos stack. Backends are
|
||||
# OS-native per platform to keep the Windows build self-contained: Schannel (TLS) + SSPI
|
||||
# (Negotiate/Kerberos) on Windows -- no external OpenSSL/krb5 -- and system OpenSSL + GSSAPI (krb5)
|
||||
# on Linux. Trimmed to HTTP(S) only, mirroring the libtiff codec pruning above.
|
||||
IF (JFJOCH_VIEWER_BUILD OR JFJOCH_VIEWER_ONLY)
|
||||
SET(BUILD_CURL_EXE OFF CACHE BOOL "" FORCE)
|
||||
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) # static libcurl only, never a shared lib
|
||||
SET(BUILD_STATIC_LIBS ON CACHE BOOL "" FORCE)
|
||||
SET(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
SET(CURL_DISABLE_INSTALL ON CACHE BOOL "" FORCE)
|
||||
SET(HTTP_ONLY ON CACHE BOOL "" FORCE) # HTTP/HTTPS only; drop FTP/LDAP/SMTP/...
|
||||
SET(CURL_USE_LIBPSL OFF CACHE BOOL "" FORCE) # avoid the libpsl dependency
|
||||
SET(CURL_USE_LIBSSH2 OFF CACHE BOOL "" FORCE)
|
||||
SET(CURL_ZLIB ON CACHE BOOL "" FORCE) # reuse the project's ZLIB
|
||||
IF (WIN32)
|
||||
SET(CURL_USE_SCHANNEL ON CACHE BOOL "" FORCE) # native Windows TLS (no OpenSSL)
|
||||
SET(CURL_USE_SSPI ON CACHE BOOL "" FORCE) # native Negotiate/Kerberos (no krb5)
|
||||
ELSE()
|
||||
SET(CURL_USE_OPENSSL ON CACHE BOOL "" FORCE)
|
||||
SET(CURL_USE_GSSAPI ON CACHE BOOL "" FORCE) # Kerberos via system krb5 (needs krb5-dev)
|
||||
ENDIF()
|
||||
FetchContent_Declare(curl
|
||||
GIT_REPOSITORY https://github.com/curl/curl.git
|
||||
GIT_TAG curl-8_11_1
|
||||
EXCLUDE_FROM_ALL)
|
||||
FetchContent_MakeAvailable(curl)
|
||||
# The viewer links libcurl_static (curl's concrete static-lib target) directly rather than the
|
||||
# CURL::libcurl alias: the alias can be shadowed by a system libcurl (find_package / dependency
|
||||
# provider / a distro CURL config), silently linking the OS curl with the wrong TLS/Kerberos
|
||||
# backend. libcurl_static is unambiguous; guard that FetchContent actually produced it.
|
||||
IF (NOT TARGET libcurl_static)
|
||||
MESSAGE(FATAL_ERROR "libcurl_static missing after FetchContent_MakeAvailable(curl) -- "
|
||||
"the vendored static libcurl was not built.")
|
||||
ENDIF()
|
||||
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(rugnux)
|
||||
ADD_SUBDIRECTORY(viewer)
|
||||
ADD_SUBDIRECTORY(tools) # builds only the portable analysis tools (rugnux/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(rugnux)
|
||||
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)
|
||||
|
||||
@@ -188,24 +388,19 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
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")
|
||||
|
||||
IF (SLS9)
|
||||
SET(CPACK_PACKAGE_NAME "jfjoch-slsdet9")
|
||||
ELSE()
|
||||
SET(CPACK_PACKAGE_NAME "jfjoch")
|
||||
ENDIF()
|
||||
|
||||
# Add optional components
|
||||
if (JFJOCH_INSTALL_DRIVER_SOURCE)
|
||||
list(APPEND CPACK_COMPONENTS_ALL driver-dkms)
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
if (JFJOCH_VIEWER_BUILD)
|
||||
list(APPEND CPACK_COMPONENTS_ALL viewer)
|
||||
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()
|
||||
|
||||
# Common metadata
|
||||
@@ -213,8 +408,69 @@ set(CPACK_PACKAGE_CONTACT "Filip Leonarski <filip.leonarski@psi.ch>")
|
||||
set(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
|
||||
set(CPACK_PACKAGE_VERSION ${JFJOCH_VERSION})
|
||||
|
||||
# OS-aware packaging: DEB on Debian/Ubuntu, RPM on RHEL/Rocky
|
||||
if (EXISTS "/etc/debian_version")
|
||||
# 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")
|
||||
|
||||
# GPLv3 text shown as the click-through license page of the installer.
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
|
||||
# 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-viewer-${JFJOCH_VERSION}-win64-cuda${CUDAToolkit_VERSION_MAJOR}")
|
||||
else()
|
||||
set(CPACK_NSIS_DISPLAY_NAME "Jungfraujoch (CPU)")
|
||||
set(CPACK_PACKAGE_FILE_NAME "jfjoch-viewer-${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 (JFJOCH_VIEWER_ONLY)
|
||||
# Linux portable viewer: a single self-contained .tar.gz of jfjoch_viewer (Qt is linked
|
||||
# statically here, so there is nothing external to ship alongside the binary). Built on the
|
||||
# oldest supported distro (RHEL 8) for a low glibc floor, so the archive runs on any newer
|
||||
# Linux -- unlike the per-distro .rpm/.deb this is meant to replace in the release. Named to
|
||||
# mirror the Windows/macOS artifacts, with the same -cuda<major>/-cpu tag so the (larger) GPU
|
||||
# build is self-identifying. CI renames the .tar.gz to .tgz before upload.
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
# Package only the components in CPACK_COMPONENTS_ALL (here: viewer). Without this the archive
|
||||
# generator falls back to a monolithic install and walks every install() rule in the tree --
|
||||
# including the fetched HDF5 command-line tools, abseil's EXCLUDE_FROM_ALL sub-libraries and the
|
||||
# non-viewer components -- none of which the viewer-only build produces, so cpack aborts with
|
||||
# "cannot find <artifact>". ALL_COMPONENTS_IN_ONE keeps the output a single tarball named
|
||||
# CPACK_PACKAGE_FILE_NAME (no per-component suffix), matching the CI upload glob. This mirrors
|
||||
# CPACK_DEB_COMPONENT_INSTALL / CPACK_RPM_COMPONENT_INSTALL in the DEB/RPM branches below.
|
||||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
|
||||
if (JFJOCH_CUDA_AVAILABLE)
|
||||
set(CPACK_PACKAGE_FILE_NAME "jfjoch_viewer-${JFJOCH_VERSION}-linux-cuda${CUDAToolkit_VERSION_MAJOR}")
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "jfjoch_viewer-${JFJOCH_VERSION}-linux-cpu")
|
||||
endif()
|
||||
elseif (EXISTS "/etc/debian_version")
|
||||
set(CPACK_PACKAGE_LICENSE "GPL-3.0-only")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
|
||||
@@ -263,7 +519,7 @@ elseif (EXISTS "/etc/redhat-release")
|
||||
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/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)
|
||||
@@ -280,4 +536,18 @@ else()
|
||||
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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,14 +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;
|
||||
|
||||
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 ${CMAKE_DL_LIBS})
|
||||
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()
|
||||
|
||||
+706
-341
File diff suppressed because it is too large
Load Diff
+168
-164
@@ -1,198 +1,202 @@
|
||||
// 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/Bragg_integration_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_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void image_buffer_status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
|
||||
const std::optional<bool> &compression, const std::optional<float> &fill,
|
||||
const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_indexing_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void result_scan_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_dark_mask_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void config_dark_mask_put(const org::openapitools::server::model::Dark_mask_settings &darkMaskSettings,
|
||||
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> &showPredictions,
|
||||
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_bragg_integration_get(httplib::Response &response);
|
||||
void config_bragg_integration_put(const org::openapitools::server::model::Bragg_integration_settings &braggIntegrationSettings,
|
||||
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,6 +9,7 @@
|
||||
#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();
|
||||
@@ -90,10 +91,15 @@ DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detecto
|
||||
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);
|
||||
@@ -117,25 +123,31 @@ DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detecto
|
||||
setup.HighVoltage(d.getHighVoltageV());
|
||||
|
||||
setup.UDPInterfaceCount(d.getUdpInterfaceCount())
|
||||
.SensorThickness_um(d.getSensorThicknessUm())
|
||||
// .PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
|
||||
.SensorMaterial(d.getSensorMaterial())
|
||||
.SerialNumber(d.getSerialNumber())
|
||||
.ModuleSync(d.isModuleSync());
|
||||
|
||||
if (d.readoutTimeUsIsSet())
|
||||
setup.ReadOutTime(std::chrono::microseconds(d.getReadoutTimeUs()));
|
||||
// Only override the sensor from the request when it explicitly sets these. The API model defaults
|
||||
// them (320 um / Si) with IsSet=false, so an unconditional set would clobber the detector-reported
|
||||
// value (DECTRIS SIMPLON read) or a detector-specific default with 320 um (highVoltageV above is
|
||||
// guarded the same way).
|
||||
if (d.sensorThicknessUmIsSet())
|
||||
setup.SensorThickness_um(d.getSensorThicknessUm());
|
||||
if (d.sensorMaterialIsSet())
|
||||
setup.SensorMaterial(d.getSensorMaterial());
|
||||
|
||||
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()));
|
||||
@@ -165,6 +177,9 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s
|
||||
if (j.indexingIsSet())
|
||||
experiment.ImportIndexingSettings(Convert(j.getIndexing()));
|
||||
|
||||
if (j.braggIntegrationIsSet())
|
||||
experiment.ImportBraggIntegrationSettings(Convert(j.getBraggIntegration()));
|
||||
|
||||
if (j.darkMaskIsSet())
|
||||
experiment.ImportDarkMaskSettings(Convert(j.getDarkMask()));
|
||||
}
|
||||
@@ -190,10 +205,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:
|
||||
@@ -218,10 +254,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());
|
||||
|
||||
@@ -235,3 +267,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);
|
||||
|
||||
+120
-37
@@ -15,40 +15,87 @@ void JFJochServices::Start(const DiffractionExperiment& experiment,
|
||||
|
||||
cannot_stop_detector = false;
|
||||
|
||||
if (receiver != nullptr) {
|
||||
logger.Info(" ... receiver start");
|
||||
receiver->Start(experiment, pixel_mask, calibration);
|
||||
if (receiver == nullptr) {
|
||||
logger.Info(" Done!");
|
||||
return;
|
||||
}
|
||||
|
||||
logger.Info(" ... receiver start");
|
||||
if (image_puller)
|
||||
image_puller->ResumeAndClear();
|
||||
receiver->Start(experiment, pixel_mask, calibration, image_puller);
|
||||
|
||||
// From here the receiver is running asynchronously. If starting the detector fails, stop the
|
||||
// receiver again so the service returns to idle and the run can be retried without
|
||||
// re-initialising. The detector failure is then propagated (a critical detector error stays
|
||||
// critical, so the broker still goes to the Error state).
|
||||
try {
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector && !experiment.IsUsingInternalPacketGen()) {
|
||||
logger.Info(" ... detector start");
|
||||
detector->Start(experiment);
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error(" ... detector failed to start ({}) - stopping detector and receiver", e.what());
|
||||
// Best-effort cleanup - it must not replace the original detector exception (which may be
|
||||
// critical), so swallow anything it throws and let the throw below re-raise e. The detector
|
||||
// may have partially armed before failing, so stop it too; otherwise it lingers in a BUSY
|
||||
// state and the next start fails with "detector busy" until a manual re-initialisation.
|
||||
try {
|
||||
{
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector)
|
||||
detector->Stop();
|
||||
}
|
||||
receiver->Cancel(false);
|
||||
receiver->Stop();
|
||||
} catch (const std::exception &stop_error) {
|
||||
logger.Warning("Stop after failed start reported: {}", stop_error.what());
|
||||
}
|
||||
throw;
|
||||
}
|
||||
|
||||
logger.Info(" Done!");
|
||||
}
|
||||
|
||||
void JFJochServices::Off() {
|
||||
if (detector) {
|
||||
detector->Deactivate();
|
||||
detector.reset();
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -56,32 +103,41 @@ void JFJochServices::On(DiffractionExperiment &x) {
|
||||
JFJochServicesOutput JFJochServices::Stop() {
|
||||
JFJochServicesOutput ret;
|
||||
|
||||
std::unique_ptr<JFJochException> exception;
|
||||
// Captured as an exception_ptr (not a copied JFJochException) so the dynamic type survives: a
|
||||
// critical hardware fault (e.g. PCIeDeviceException) must stay critical when re-thrown, otherwise
|
||||
// slicing it to a plain JFJochException would send the state machine to Idle instead of Error.
|
||||
std::exception_ptr exception;
|
||||
|
||||
bool detector_error = false;
|
||||
|
||||
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),
|
||||
@@ -95,11 +151,16 @@ 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. This is
|
||||
// reported to the caller via receiver_output.writer_err (the state machine surfaces it as
|
||||
// an error message) - it is not a detector fault, so it does not need re-initialisation.
|
||||
|
||||
logger.Info(" ... finished with success");
|
||||
} catch (const JFJochException &e) {
|
||||
logger.Error(" ... finished with error {}", e.what());
|
||||
exception = std::make_unique<JFJochException>(e);
|
||||
exception = std::current_exception();
|
||||
}
|
||||
logger.Info("Receiver finished with success");
|
||||
} else {
|
||||
logger.Info("No receiver - sleeping for 30 seconds");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(30));
|
||||
@@ -107,16 +168,20 @@ JFJochServicesOutput JFJochServices::Stop() {
|
||||
}
|
||||
|
||||
|
||||
if (exception)
|
||||
throw JFJochException(*exception);
|
||||
|
||||
// A detector fault must win over an ordinary receiver/writer error: it needs re-initialisation,
|
||||
// so raise the critical exception first. If only the receiver failed, the run can be retried from
|
||||
// Idle, so that ordinary error is raised second.
|
||||
if (detector_error)
|
||||
throw JFJochException(JFJochExceptionCategory::Detector, "Error in detector operation");
|
||||
throw JFJochCriticalException("Error in detector operation");
|
||||
|
||||
if (exception)
|
||||
std::rethrow_exception(exception);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -152,21 +217,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 {
|
||||
@@ -184,6 +255,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);
|
||||
}
|
||||
@@ -202,7 +274,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 {
|
||||
@@ -257,6 +329,7 @@ void JFJochServices::ClearImageBuffer() const {
|
||||
}
|
||||
|
||||
void JFJochServices::LoadDetectorPixelMask(PixelMask &mask) {
|
||||
std::shared_lock ul(detector_mutex);
|
||||
if (detector)
|
||||
detector->LoadPixelMask(mask);
|
||||
}
|
||||
@@ -264,4 +337,14 @@ void JFJochServices::LoadDetectorPixelMask(PixelMask &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
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
@@ -66,7 +70,7 @@ public:
|
||||
void LoadDetectorPixelMask(PixelMask &mask);
|
||||
|
||||
void SetupIndexing(const IndexingSettings& input);
|
||||
|
||||
ImagePusherStatus GetImagePusherStatus() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHSERVICES_H
|
||||
|
||||
+145
-38
@@ -5,26 +5,31 @@
|
||||
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
#include "pistache/net.h"
|
||||
#include "../common/CUDAWrapper.h"
|
||||
#include "../common/GitInfo.h"
|
||||
#include "../common/JFJochException.h"
|
||||
|
||||
JFJochStateMachine::JFJochStateMachine(const DiffractionExperiment& in_experiment,
|
||||
JFJochServices &in_services,
|
||||
Logger &in_logger)
|
||||
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(DiffractionExperiment::DefaultDataProcessingSettings()),
|
||||
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;
|
||||
|
||||
SupressTIFFErrors();
|
||||
#else
|
||||
data_processing_settings.indexing = true;
|
||||
#endif
|
||||
SuppressTIFFErrors();
|
||||
}
|
||||
|
||||
bool JFJochStateMachine::ImportPedestalG0(const JFJochReceiverOutput &receiver_output) {
|
||||
@@ -78,7 +83,7 @@ void JFJochStateMachine::CalibrateJUNGFRAU(std::unique_lock<std::mutex> &ul) {
|
||||
pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get());
|
||||
}
|
||||
|
||||
void JFJochStateMachine::CalibrateDetector(std::unique_lock<std::mutex> &ul) {
|
||||
void JFJochStateMachine::CalibrateDetector(std::unique_lock<std::mutex> ul) {
|
||||
cancel_sequence = false;
|
||||
|
||||
pixel_mask = PixelMask(experiment);
|
||||
@@ -108,8 +113,9 @@ void JFJochStateMachine::CalibrateDetector(std::unique_lock<std::mutex> &ul) {
|
||||
throw;
|
||||
}
|
||||
SetState(JFJochState::Idle, "Calibration sequence done", BrokerStatus::MessageSeverity::Success);
|
||||
|
||||
logger.Info("Pedestal sequence done");
|
||||
logger.Info("Calibration sequence done");
|
||||
ul.unlock(); // Notify all outside of mutex
|
||||
c.notify_all();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::TakeDarkMaskInternal(std::unique_lock<std::mutex> &ul) {
|
||||
@@ -140,7 +146,7 @@ void JFJochStateMachine::TakeDarkMaskInternal(std::unique_lock<std::mutex> &ul)
|
||||
ul.lock();
|
||||
|
||||
if (mask_output.receiver_output.dark_mask_result.size() == local_experiment.GetPixelsNum()) {
|
||||
pixel_mask.LoadDarkBadPixelMask(mask_output.receiver_output.dark_mask_result);
|
||||
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);
|
||||
@@ -305,12 +311,9 @@ 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) {
|
||||
CalibrateDetector(ul);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::CalibrateDetector, this, std::move(ul));
|
||||
}
|
||||
|
||||
void JFJochStateMachine::InitializeThread(std::unique_lock<std::mutex> ul) {
|
||||
@@ -333,14 +336,14 @@ void JFJochStateMachine::InitializeThread(std::unique_lock<std::mutex> ul) {
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
throw;
|
||||
}
|
||||
CalibrateDetector(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)
|
||||
@@ -359,20 +362,27 @@ 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.get());
|
||||
|
||||
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;
|
||||
start_exception = nullptr;
|
||||
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; });
|
||||
// A synchronous start propagates the failure to the caller. The state has already been set
|
||||
// by MeasurementThread (Idle for an ordinary failure, Error for a critical detector fault).
|
||||
if (start_exception) {
|
||||
auto e = start_exception;
|
||||
start_exception = nullptr;
|
||||
std::rethrow_exception(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
std::unique_lock ul(pixel_mask_statistics_mutex);
|
||||
pixel_mask_statistics = input;
|
||||
@@ -384,17 +394,62 @@ 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 (const JFJochCriticalException &e) {
|
||||
// Detector left in an undefined state - force re-initialisation via the Error state.
|
||||
logger.Error("Critical error starting measurement: {}", e.what());
|
||||
{
|
||||
std::unique_lock ul(m);
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
start_exception = std::current_exception();
|
||||
}
|
||||
c.notify_all();
|
||||
return;
|
||||
} catch (const std::exception &e) {
|
||||
// Ordinary acquisition failure - the detector is still configured/calibrated, so return to
|
||||
// Idle and let the user retry without re-initialising. services.Start has already stopped the
|
||||
// receiver it launched.
|
||||
logger.Error("Error starting measurement: {}", e.what());
|
||||
{
|
||||
std::unique_lock ul(m);
|
||||
SetState(JFJochState::Idle, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
start_exception = std::current_exception();
|
||||
}
|
||||
c.notify_all();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
auto tmp_output = services.Stop();
|
||||
{
|
||||
std::unique_lock ul(m);
|
||||
scan_result = tmp_output.receiver_output.scan_result;
|
||||
|
||||
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",
|
||||
BrokerStatus::MessageSeverity::Warning);
|
||||
else if (tmp_output.receiver_output.status.cancelled)
|
||||
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);
|
||||
|
||||
// Priority order matters. A cancel is checked first (it legitimately leaves efficiency < 1),
|
||||
// then the hard errors (missing packets, truncated writer output). The queue-full warning is
|
||||
// only the primary status when the run otherwise succeeded - it must not mask a real error
|
||||
// by downgrading an incomplete/truncated dataset to a "reduce frame rate" warning.
|
||||
if (tmp_output.receiver_output.status.cancelled)
|
||||
SetState(JFJochState::Idle,
|
||||
"Data collection cancelled",
|
||||
BrokerStatus::MessageSeverity::Info);
|
||||
@@ -404,16 +459,28 @@ void JFJochStateMachine::MeasurementThread() {
|
||||
BrokerStatus::MessageSeverity::Error);
|
||||
else if (!tmp_output.receiver_output.writer_err.empty())
|
||||
SetState(JFJochState::Idle,
|
||||
tmp_output.receiver_output.writer_err,
|
||||
"Writer error, written data may be incomplete: " + tmp_output.receiver_output.writer_err,
|
||||
BrokerStatus::MessageSeverity::Error);
|
||||
else 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",
|
||||
BrokerStatus::MessageSeverity::Warning);
|
||||
else
|
||||
SetState(JFJochState::Idle,
|
||||
"Data collection without problems",
|
||||
BrokerStatus::MessageSeverity::Success);
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
} catch (const JFJochCriticalException &e) {
|
||||
// Detector faulted during the run - it needs re-initialisation, so go to the Error state.
|
||||
logger.Error("Critical error finishing measurement: {}", e.what());
|
||||
std::unique_lock ul(m);
|
||||
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
} catch (const std::exception &e) {
|
||||
// Receiver/writer problem - the data may be incomplete, but the detector is still usable, so
|
||||
// return to Idle rather than forcing re-initialisation.
|
||||
logger.Error("Error finishing measurement: {}", e.what());
|
||||
std::unique_lock ul(m);
|
||||
SetState(JFJochState::Idle, e.what(), BrokerStatus::MessageSeverity::Error);
|
||||
}
|
||||
c.notify_all();
|
||||
}
|
||||
@@ -484,6 +551,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;
|
||||
}
|
||||
@@ -523,7 +591,7 @@ void JFJochStateMachine::LoadDetectorSettings(const DetectorSettings &settings)
|
||||
case JFJochState::Idle:
|
||||
if (ImportDetectorSettings(settings)) {
|
||||
SetState(JFJochState::Busy, "Loading settings", BrokerStatus::MessageSeverity::Info);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::PedestalThread, this, std::move(ul));
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::CalibrateDetector, this, std::move(ul));
|
||||
} else {
|
||||
try {
|
||||
SetState(JFJochState::Busy, "Configure detector", BrokerStatus::MessageSeverity::Info);
|
||||
@@ -551,6 +619,7 @@ BrokerStatus JFJochStateMachine::GetStatus() const {
|
||||
BrokerStatus ret = broker_status;
|
||||
ret.progress = services.GetReceiverProgress();
|
||||
ret.gpu_count = gpu_count;
|
||||
ret.broker_version = jfjoch_version();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -570,6 +639,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);
|
||||
@@ -775,7 +848,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,
|
||||
@@ -866,6 +939,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();
|
||||
@@ -1007,6 +1095,21 @@ void JFJochStateMachine::SetIndexingSettings(const IndexingSettings &input) {
|
||||
}
|
||||
}
|
||||
|
||||
BraggIntegrationSettings JFJochStateMachine::GetBraggIntegrationSettings() const {
|
||||
std::unique_lock ul(experiment_indexing_settings_mutex);
|
||||
return experiment.GetBraggIntegrationSettings();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetBraggIntegrationSettings(const BraggIntegrationSettings &input) {
|
||||
std::unique_lock ul(m);
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException("Cannot change Bragg integration settings during data collection");
|
||||
// The analysis engines read the integrator mode off the experiment when they are built at the start
|
||||
// of the next run, so importing it here is all that is needed.
|
||||
std::unique_lock ul2(experiment_indexing_settings_mutex);
|
||||
experiment.ImportBraggIntegrationSettings(input);
|
||||
}
|
||||
|
||||
std::optional<ScanResult> JFJochStateMachine::GetScanResult() const {
|
||||
std::unique_lock ul(m);
|
||||
if (IsRunning())
|
||||
@@ -1032,6 +1135,10 @@ void JFJochStateMachine::SetDarkMaskSettings(const DarkMaskSettings &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::PedestalThread, this, std::move(ul));
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::CalibrateDetector, this, std::move(ul));
|
||||
}
|
||||
}
|
||||
|
||||
ImagePusherStatus JFJochStateMachine::GetImagePusherStatus() const {
|
||||
return services.GetImagePusherStatus();
|
||||
}
|
||||
|
||||
+25
-25
@@ -1,13 +1,13 @@
|
||||
// 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>
|
||||
#include <future>
|
||||
#include <optional>
|
||||
#include <exception>
|
||||
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "../jungfrau/JFCalibration.h"
|
||||
@@ -15,16 +15,7 @@
|
||||
|
||||
#include "JFJochServices.h"
|
||||
#include "../common/ROIMap.h"
|
||||
|
||||
enum class JFJochState {Inactive, Idle, Measuring, Error, Busy, Calibration};
|
||||
|
||||
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;
|
||||
};
|
||||
#include "../common/BrokerStatus.h"
|
||||
|
||||
struct DetectorListElement {
|
||||
std::string description;
|
||||
@@ -34,9 +25,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;
|
||||
};
|
||||
@@ -55,6 +46,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;
|
||||
@@ -101,12 +94,14 @@ class JFJochStateMachine {
|
||||
// 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
|
||||
std::optional<ScanResult> scan_result;
|
||||
// Set by MeasurementThread when a synchronous Start fails, so Start() can rethrow to the caller
|
||||
std::exception_ptr start_exception;
|
||||
|
||||
mutable std::mutex calibration_statistics_mutex;
|
||||
std::vector<JFCalibrationModuleStatistics> calibration_statistics;
|
||||
@@ -124,7 +119,6 @@ class JFJochStateMachine {
|
||||
ROIDefinition roi;
|
||||
|
||||
bool indexing_possible;
|
||||
bool resolution_estimate_possible;
|
||||
|
||||
const int32_t gpu_count;
|
||||
|
||||
@@ -135,14 +129,13 @@ 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 TakeDarkMaskInternal(std::unique_lock<std::mutex> &ul);
|
||||
void CalibrateDetector(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);
|
||||
@@ -153,13 +146,16 @@ class JFJochStateMachine {
|
||||
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();
|
||||
@@ -188,6 +184,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;
|
||||
@@ -226,6 +223,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;
|
||||
|
||||
@@ -237,6 +235,9 @@ public:
|
||||
|
||||
void SetIndexingSettings(const IndexingSettings &input);
|
||||
IndexingSettings GetIndexingSettings() const;
|
||||
|
||||
void SetBraggIntegrationSettings(const BraggIntegrationSettings &input);
|
||||
BraggIntegrationSettings GetBraggIntegrationSettings() const;
|
||||
PixelMaskStatistics GetPixelMaskStatistics() const;
|
||||
|
||||
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
|
||||
@@ -249,7 +250,6 @@ public:
|
||||
|
||||
void SetDarkMaskSettings(const DarkMaskSettings& settings);
|
||||
DarkMaskSettings GetDarkMaskSettings() const;
|
||||
|
||||
ImagePusherStatus GetImagePusherStatus() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHSTATEMACHINE_H
|
||||
|
||||
+202
-28
@@ -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
|
||||
@@ -87,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;
|
||||
}
|
||||
|
||||
@@ -170,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());
|
||||
@@ -241,6 +245,7 @@ org::openapitools::server::model::Broker_status Convert(const BrokerStatus& inpu
|
||||
ret.setProgress(input.progress.value());
|
||||
|
||||
ret.setGpuCount(input.gpu_count);
|
||||
ret.setBrokerVersion(input.broker_version);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -369,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));
|
||||
@@ -434,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;
|
||||
}
|
||||
|
||||
@@ -445,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;
|
||||
}
|
||||
|
||||
@@ -454,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;
|
||||
}
|
||||
|
||||
@@ -484,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);
|
||||
@@ -606,6 +625,8 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
else if (compr == "bszstd_rle")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD_RLE);
|
||||
else if (compr == "bszstd_rlehuf")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD_RLE_HUFF);
|
||||
else if (compr == "none")
|
||||
ret.Compression(CompressionAlgorithm::NO_COMPRESSION);
|
||||
else
|
||||
@@ -673,6 +694,18 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings
|
||||
ret.FluorescenceSpectrum({fl.getEnergyEV(), fl.getData()});
|
||||
}
|
||||
|
||||
if (input.smargonIsSet()) {
|
||||
auto sm = input.getSmargon();
|
||||
SmargonPosition smargon;
|
||||
smargon.phi_deg = sm.getPhiDeg();
|
||||
smargon.chi_deg = sm.getChiDeg();
|
||||
if (sm.phiAxisIsSet())
|
||||
smargon.phi_axis = ConvertOpenAPI(sm.getPhiAxis());
|
||||
if (sm.chiAxisIsSet())
|
||||
smargon.chi_axis = ConvertOpenAPI(sm.getChiAxis());
|
||||
ret.Smargon(smargon);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -724,7 +757,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;
|
||||
}
|
||||
@@ -733,7 +766,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;
|
||||
}
|
||||
@@ -753,12 +786,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;
|
||||
}
|
||||
@@ -766,7 +819,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;
|
||||
}
|
||||
|
||||
@@ -774,7 +827,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);
|
||||
@@ -782,6 +835,9 @@ 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;
|
||||
@@ -799,12 +855,14 @@ 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:
|
||||
@@ -822,6 +880,7 @@ PlotType ConvertPlotType(const std::optional<std::string>& input) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Plot type is compulsory paramater");
|
||||
if (input == "bkg_estimate") return PlotType::BkgEstimate;
|
||||
if (input == "ice_ring_score") return PlotType::IceRingScore;
|
||||
if (input == "azint") return PlotType::AzInt;
|
||||
if (input == "azint_1d") return PlotType::AzInt1D;
|
||||
if (input == "spot_count") return PlotType::SpotCount;
|
||||
@@ -831,6 +890,7 @@ PlotType ConvertPlotType(const std::optional<std::string>& input) {
|
||||
if (input == "indexing_rate") return PlotType::IndexingRate;
|
||||
if (input == "indexing_unit_cell_length") return PlotType::IndexingUnitCellLength;
|
||||
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;
|
||||
@@ -848,29 +908,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) {
|
||||
@@ -902,6 +974,9 @@ IndexingSettings Convert(const org::openapitools::server::model::Indexing_settin
|
||||
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;
|
||||
@@ -914,7 +989,12 @@ IndexingSettings Convert(const org::openapitools::server::model::Indexing_settin
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -928,6 +1008,11 @@ org::openapitools::server::model::Indexing_settings Convert(const IndexingSettin
|
||||
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()) {
|
||||
@@ -965,6 +1050,42 @@ org::openapitools::server::model::Indexing_settings Convert(const IndexingSettin
|
||||
return ret;
|
||||
}
|
||||
|
||||
BraggIntegrationSettings Convert(const org::openapitools::server::model::Bragg_integration_settings &input) {
|
||||
BraggIntegrationSettings ret;
|
||||
switch (input.getIntegrationModel().getValue()) {
|
||||
case org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEGAUSSIAN:
|
||||
ret.Integrator(IntegratorMode::ProfileGaussian);
|
||||
break;
|
||||
case org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEEMPIRICAL:
|
||||
ret.Integrator(IntegratorMode::ProfileEmpirical);
|
||||
break;
|
||||
case org::openapitools::server::model::Integration_model::eIntegration_model::BOXSUM:
|
||||
ret.Integrator(IntegratorMode::BoxSum);
|
||||
break;
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown integration model");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Bragg_integration_settings Convert(const BraggIntegrationSettings &input) {
|
||||
org::openapitools::server::model::Bragg_integration_settings ret;
|
||||
org::openapitools::server::model::Integration_model tmp;
|
||||
switch (input.GetIntegrator()) {
|
||||
case IntegratorMode::ProfileGaussian:
|
||||
tmp.setValue(org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEGAUSSIAN);
|
||||
break;
|
||||
case IntegratorMode::ProfileEmpirical:
|
||||
tmp.setValue(org::openapitools::server::model::Integration_model::eIntegration_model::PROFILEEMPIRICAL);
|
||||
break;
|
||||
case IntegratorMode::BoxSum:
|
||||
tmp.setValue(org::openapitools::server::model::Integration_model::eIntegration_model::BOXSUM);
|
||||
break;
|
||||
}
|
||||
ret.setIntegrationModel(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
org::openapitools::server::model::Scan_result ret;
|
||||
ret.setFilePrefix(input.file_prefix);
|
||||
@@ -981,7 +1102,8 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
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())
|
||||
@@ -992,6 +1114,8 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input) {
|
||||
tmp.setSpots(i.spot_count.value());
|
||||
if (i.spot_count_ice.has_value())
|
||||
tmp.setSpotsIce(i.spot_count_ice.value());
|
||||
if (i.ice_ring_score.has_value())
|
||||
tmp.setIce(i.ice_ring_score.value());
|
||||
if (i.spot_count_low_res.has_value())
|
||||
tmp.setSpotsLowRes(i.spot_count_low_res.value());
|
||||
if (i.spot_count_indexed.has_value())
|
||||
@@ -1012,6 +1136,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())
|
||||
@@ -1019,13 +1145,30 @@ 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);
|
||||
}
|
||||
if (input.rotation_crystal_system && input.rotation_centering)
|
||||
ret.setRotationBravais(BravaisSymbol(*input.rotation_crystal_system, *input.rotation_centering));
|
||||
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(input.GetFrameTime().count());
|
||||
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());
|
||||
@@ -1041,3 +1184,34 @@ DarkMaskSettings Convert(const org::openapitools::server::model::Dark_mask_setti
|
||||
.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
-3
@@ -1,10 +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"
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "gen/model/Rotation_axis.h"
|
||||
#include "gen/model/Grid_scan.h"
|
||||
#include "gen/model/Indexing_settings.h"
|
||||
#include "gen/model/Bragg_integration_settings.h"
|
||||
#include "gen/model/Scan_result.h"
|
||||
|
||||
#include "../common/JFJochMessages.h"
|
||||
@@ -39,6 +40,7 @@
|
||||
#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);
|
||||
@@ -46,6 +48,9 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin
|
||||
IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input);
|
||||
org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input);
|
||||
|
||||
BraggIntegrationSettings Convert(const org::openapitools::server::model::Bragg_integration_settings &input);
|
||||
org::openapitools::server::model::Bragg_integration_settings Convert(const BraggIntegrationSettings &input);
|
||||
|
||||
org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input);
|
||||
DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input);
|
||||
|
||||
@@ -75,6 +80,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);
|
||||
@@ -91,4 +97,6 @@ org::openapitools::server::model::Scan_result Convert(const ScanResult& input);
|
||||
|
||||
org::openapitools::server::model::Dark_mask_settings Convert(const DarkMaskSettings& input);
|
||||
DarkMaskSettings Convert(const org::openapitools::server::model::Dark_mask_settings& input);
|
||||
#endif //JFJOCH_OPENAPICONVERT_H
|
||||
|
||||
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. # 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.108
|
||||
* 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,614 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.108
|
||||
* 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 "Dark_mask_settings.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_dark_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_dark_mask_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_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 azimuthal integration configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_azim_int_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure azimuthal integration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done when detector is Inactive or Idle
|
||||
/// </remarks>
|
||||
/// <param name="azimIntSettings"> (optional)</param>
|
||||
virtual void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &azimIntSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get settings for dark data collection to calculate mask
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void config_dark_mask_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Set configuration for dark data collection to calculate mask
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point. This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="darkMaskSettings"> (optional)</param>
|
||||
virtual void config_dark_mask_put(const org::openapitools::server::model::Dark_mask_settings &darkMaskSettings, 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 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="fill">Fill value for elements that were missed during data collection (optional, default to 0.0f)</param>
|
||||
/// <param name="experimentalCoord">If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored (optional, default to false)</param>
|
||||
/// <param name="azintUnit">Unit used for azim int. (optional, default to "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<float> &fill, 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_ */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -89,6 +89,13 @@ public:
|
||||
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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* 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.158
|
||||
* 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 "Bragg_integration_settings.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Bragg_integration_settings::Bragg_integration_settings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Bragg_integration_settings::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Bragg_integration_settings::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Bragg_integration_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Bragg_integration_settings" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Bragg_integration_settings::operator==(const Bragg_integration_settings& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getIntegrationModel() == rhs.getIntegrationModel())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Bragg_integration_settings::operator!=(const Bragg_integration_settings& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Bragg_integration_settings& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["integration_model"] = o.m_Integration_model;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Bragg_integration_settings& o)
|
||||
{
|
||||
j.at("integration_model").get_to(o.m_Integration_model);
|
||||
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Integration_model Bragg_integration_settings::getIntegrationModel() const
|
||||
{
|
||||
return m_Integration_model;
|
||||
}
|
||||
void Bragg_integration_settings::setIntegrationModel(org::openapitools::server::model::Integration_model const& value)
|
||||
{
|
||||
m_Integration_model = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* 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.158
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Bragg_integration_settings.h
|
||||
*
|
||||
* Settings for Bragg spot integration
|
||||
*/
|
||||
|
||||
#ifndef Bragg_integration_settings_H_
|
||||
#define Bragg_integration_settings_H_
|
||||
|
||||
|
||||
#include "Integration_model.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Settings for Bragg spot integration
|
||||
/// </summary>
|
||||
class Bragg_integration_settings
|
||||
{
|
||||
public:
|
||||
Bragg_integration_settings();
|
||||
virtual ~Bragg_integration_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 Bragg_integration_settings& rhs) const;
|
||||
bool operator!=(const Bragg_integration_settings& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Bragg_integration_settings members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Integration_model getIntegrationModel() const;
|
||||
void setIntegrationModel(org::openapitools::server::model::Integration_model const& value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Bragg_integration_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Bragg_integration_settings& o);
|
||||
protected:
|
||||
org::openapitools::server::model::Integration_model m_Integration_model;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Bragg_integration_settings_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -30,6 +30,8 @@ Broker_status::Broker_status()
|
||||
m_Message_severityIsSet = false;
|
||||
m_Gpu_count = 0;
|
||||
m_Gpu_countIsSet = false;
|
||||
m_Broker_version = "";
|
||||
m_Broker_versionIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -71,7 +73,7 @@ bool Broker_status::validate(std::stringstream& msg, const std::string& pathPref
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -93,7 +95,10 @@ bool Broker_status::operator==(const Broker_status& rhs) const
|
||||
((!messageSeverityIsSet() && !rhs.messageSeverityIsSet()) || (messageSeverityIsSet() && rhs.messageSeverityIsSet() && getMessageSeverity() == rhs.getMessageSeverity())) &&
|
||||
|
||||
|
||||
((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount()))
|
||||
((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount())) &&
|
||||
|
||||
|
||||
((!brokerVersionIsSet() && !rhs.brokerVersionIsSet()) || (brokerVersionIsSet() && rhs.brokerVersionIsSet() && getBrokerVersion() == rhs.getBrokerVersion()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -115,6 +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.brokerVersionIsSet())
|
||||
j["broker_version"] = o.m_Broker_version;
|
||||
|
||||
}
|
||||
|
||||
@@ -141,6 +148,11 @@ 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("broker_version") != j.end())
|
||||
{
|
||||
j.at("broker_version").get_to(o.m_Broker_version);
|
||||
o.m_Broker_versionIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -220,6 +232,23 @@ void Broker_status::unsetGpu_count()
|
||||
{
|
||||
m_Gpu_countIsSet = false;
|
||||
}
|
||||
std::string Broker_status::getBrokerVersion() const
|
||||
{
|
||||
return m_Broker_version;
|
||||
}
|
||||
void Broker_status::setBrokerVersion(std::string const& value)
|
||||
{
|
||||
m_Broker_version = value;
|
||||
m_Broker_versionIsSet = true;
|
||||
}
|
||||
bool Broker_status::brokerVersionIsSet() const
|
||||
{
|
||||
return m_Broker_versionIsSet;
|
||||
}
|
||||
void Broker_status::unsetBroker_version()
|
||||
{
|
||||
m_Broker_versionIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -91,6 +91,13 @@ public:
|
||||
void setGpuCount(int32_t const value);
|
||||
bool gpuCountIsSet() const;
|
||||
void unsetGpu_count();
|
||||
/// <summary>
|
||||
/// Version of the jfjoch_broker
|
||||
/// </summary>
|
||||
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);
|
||||
@@ -105,6 +112,8 @@ protected:
|
||||
bool m_Message_severityIsSet;
|
||||
int32_t m_Gpu_count;
|
||||
bool m_Gpu_countIsSet;
|
||||
std::string m_Broker_version;
|
||||
bool m_Broker_versionIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -80,10 +80,13 @@ Dataset_settings::Dataset_settings()
|
||||
m_Unit_cellIsSet = false;
|
||||
m_Spot_finding = true;
|
||||
m_Spot_findingIsSet = false;
|
||||
m_SmargonIsSet = 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;
|
||||
|
||||
}
|
||||
@@ -404,7 +407,7 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (maxSpotCountIsSet())
|
||||
{
|
||||
const int32_t& value = m_Max_spot_count;
|
||||
@@ -423,7 +426,7 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -535,12 +538,18 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!spotFindingIsSet() && !rhs.spotFindingIsSet()) || (spotFindingIsSet() && rhs.spotFindingIsSet() && isSpotFinding() == rhs.isSpotFinding())) &&
|
||||
|
||||
|
||||
((!smargonIsSet() && !rhs.smargonIsSet()) || (smargonIsSet() && rhs.smargonIsSet() && getSmargon() == rhs.getSmargon())) &&
|
||||
|
||||
|
||||
((!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()))
|
||||
|
||||
;
|
||||
@@ -618,10 +627,14 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
j["unit_cell"] = o.m_Unit_cell;
|
||||
if(o.spotFindingIsSet())
|
||||
j["spot_finding"] = o.m_Spot_finding;
|
||||
if(o.smargonIsSet())
|
||||
j["smargon"] = o.m_Smargon;
|
||||
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;
|
||||
|
||||
@@ -783,6 +796,11 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("spot_finding").get_to(o.m_Spot_finding);
|
||||
o.m_Spot_findingIsSet = true;
|
||||
}
|
||||
if(j.find("smargon") != j.end())
|
||||
{
|
||||
j.at("smargon").get_to(o.m_Smargon);
|
||||
o.m_SmargonIsSet = true;
|
||||
}
|
||||
if(j.find("max_spot_count") != j.end())
|
||||
{
|
||||
j.at("max_spot_count").get_to(o.m_Max_spot_count);
|
||||
@@ -793,6 +811,11 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
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);
|
||||
@@ -1343,6 +1366,23 @@ void Dataset_settings::unsetSpot_finding()
|
||||
{
|
||||
m_Spot_findingIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Dataset_settings_smargon Dataset_settings::getSmargon() const
|
||||
{
|
||||
return m_Smargon;
|
||||
}
|
||||
void Dataset_settings::setSmargon(org::openapitools::server::model::Dataset_settings_smargon const& value)
|
||||
{
|
||||
m_Smargon = value;
|
||||
m_SmargonIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::smargonIsSet() const
|
||||
{
|
||||
return m_SmargonIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetSmargon()
|
||||
{
|
||||
m_SmargonIsSet = false;
|
||||
}
|
||||
int32_t Dataset_settings::getMaxSpotCount() const
|
||||
{
|
||||
return m_Max_spot_count;
|
||||
@@ -1377,6 +1417,23 @@ 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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "Grid_scan.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "Dataset_settings_smargon.h"
|
||||
#include "Rotation_axis.h"
|
||||
#include "Unit_cell.h"
|
||||
#include <string>
|
||||
@@ -168,7 +169,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);
|
||||
@@ -294,6 +295,13 @@ public:
|
||||
bool spotFindingIsSet() const;
|
||||
void unsetSpot_finding();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Dataset_settings_smargon getSmargon() const;
|
||||
void setSmargon(org::openapitools::server::model::Dataset_settings_smargon const& value);
|
||||
bool smargonIsSet() const;
|
||||
void unsetSmargon();
|
||||
/// <summary>
|
||||
/// Maximum number of spots that are saved/used for indexing; spots with highest intensity are selected
|
||||
/// </summary>
|
||||
int32_t getMaxSpotCount() const;
|
||||
@@ -308,6 +316,13 @@ public:
|
||||
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;
|
||||
@@ -386,10 +401,14 @@ protected:
|
||||
bool m_Unit_cellIsSet;
|
||||
bool m_Spot_finding;
|
||||
bool m_Spot_findingIsSet;
|
||||
org::openapitools::server::model::Dataset_settings_smargon m_Smargon;
|
||||
bool m_SmargonIsSet;
|
||||
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,242 @@
|
||||
/**
|
||||
* 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.158
|
||||
* 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_smargon.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Dataset_settings_smargon::Dataset_settings_smargon()
|
||||
{
|
||||
m_Phi_deg = 0.0f;
|
||||
m_Chi_deg = 0.0f;
|
||||
m_Phi_axisIsSet = false;
|
||||
m_Chi_axisIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Dataset_settings_smargon::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Dataset_settings_smargon::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Dataset_settings_smargon::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Dataset_settings_smargon" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
/* Chi_deg */ {
|
||||
const float& value = m_Chi_deg;
|
||||
const std::string currentValuePath = _pathPrefix + ".chiDeg";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.0;";
|
||||
}
|
||||
if (value > static_cast<float>(90.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 90.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (phiAxisIsSet())
|
||||
{
|
||||
const std::vector<float>& value = m_Phi_axis;
|
||||
const std::string currentValuePath = _pathPrefix + ".phiAxis";
|
||||
|
||||
|
||||
if (value.size() < 3)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must have at least 3 elements;";
|
||||
}
|
||||
if (value.size() > 3)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must have at most 3 elements;";
|
||||
}
|
||||
{ // 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++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (chiAxisIsSet())
|
||||
{
|
||||
const std::vector<float>& value = m_Chi_axis;
|
||||
const std::string currentValuePath = _pathPrefix + ".chiAxis";
|
||||
|
||||
|
||||
if (value.size() < 3)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must have at least 3 elements;";
|
||||
}
|
||||
if (value.size() > 3)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must have at most 3 elements;";
|
||||
}
|
||||
{ // 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_smargon::operator==(const Dataset_settings_smargon& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getPhiDeg() == rhs.getPhiDeg())
|
||||
&&
|
||||
|
||||
(getChiDeg() == rhs.getChiDeg())
|
||||
&&
|
||||
|
||||
|
||||
((!phiAxisIsSet() && !rhs.phiAxisIsSet()) || (phiAxisIsSet() && rhs.phiAxisIsSet() && getPhiAxis() == rhs.getPhiAxis())) &&
|
||||
|
||||
|
||||
((!chiAxisIsSet() && !rhs.chiAxisIsSet()) || (chiAxisIsSet() && rhs.chiAxisIsSet() && getChiAxis() == rhs.getChiAxis()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Dataset_settings_smargon::operator!=(const Dataset_settings_smargon& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Dataset_settings_smargon& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["phi_deg"] = o.m_Phi_deg;
|
||||
j["chi_deg"] = o.m_Chi_deg;
|
||||
if(o.phiAxisIsSet() || !o.m_Phi_axis.empty())
|
||||
j["phi_axis"] = o.m_Phi_axis;
|
||||
if(o.chiAxisIsSet() || !o.m_Chi_axis.empty())
|
||||
j["chi_axis"] = o.m_Chi_axis;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Dataset_settings_smargon& o)
|
||||
{
|
||||
j.at("phi_deg").get_to(o.m_Phi_deg);
|
||||
j.at("chi_deg").get_to(o.m_Chi_deg);
|
||||
if(j.find("phi_axis") != j.end())
|
||||
{
|
||||
j.at("phi_axis").get_to(o.m_Phi_axis);
|
||||
o.m_Phi_axisIsSet = true;
|
||||
}
|
||||
if(j.find("chi_axis") != j.end())
|
||||
{
|
||||
j.at("chi_axis").get_to(o.m_Chi_axis);
|
||||
o.m_Chi_axisIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float Dataset_settings_smargon::getPhiDeg() const
|
||||
{
|
||||
return m_Phi_deg;
|
||||
}
|
||||
void Dataset_settings_smargon::setPhiDeg(float const value)
|
||||
{
|
||||
m_Phi_deg = value;
|
||||
}
|
||||
float Dataset_settings_smargon::getChiDeg() const
|
||||
{
|
||||
return m_Chi_deg;
|
||||
}
|
||||
void Dataset_settings_smargon::setChiDeg(float const value)
|
||||
{
|
||||
m_Chi_deg = value;
|
||||
}
|
||||
std::vector<float> Dataset_settings_smargon::getPhiAxis() const
|
||||
{
|
||||
return m_Phi_axis;
|
||||
}
|
||||
void Dataset_settings_smargon::setPhiAxis(std::vector<float> const value)
|
||||
{
|
||||
m_Phi_axis = value;
|
||||
m_Phi_axisIsSet = true;
|
||||
}
|
||||
bool Dataset_settings_smargon::phiAxisIsSet() const
|
||||
{
|
||||
return m_Phi_axisIsSet;
|
||||
}
|
||||
void Dataset_settings_smargon::unsetPhi_axis()
|
||||
{
|
||||
m_Phi_axisIsSet = false;
|
||||
}
|
||||
std::vector<float> Dataset_settings_smargon::getChiAxis() const
|
||||
{
|
||||
return m_Chi_axis;
|
||||
}
|
||||
void Dataset_settings_smargon::setChiAxis(std::vector<float> const value)
|
||||
{
|
||||
m_Chi_axis = value;
|
||||
m_Chi_axisIsSet = true;
|
||||
}
|
||||
bool Dataset_settings_smargon::chiAxisIsSet() const
|
||||
{
|
||||
return m_Chi_axisIsSet;
|
||||
}
|
||||
void Dataset_settings_smargon::unsetChi_axis()
|
||||
{
|
||||
m_Chi_axisIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* 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.158
|
||||
* 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_smargon.h
|
||||
*
|
||||
* Geometry of Smargon goniometer at SLS 2.0 / MX beamlines. Assuming that Smargon is used as static positioner and not moving during the scan, allowing to reconstruct geometry.
|
||||
*/
|
||||
|
||||
#ifndef Dataset_settings_smargon_H_
|
||||
#define Dataset_settings_smargon_H_
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Geometry of Smargon goniometer at SLS 2.0 / MX beamlines. Assuming that Smargon is used as static positioner and not moving during the scan, allowing to reconstruct geometry.
|
||||
/// </summary>
|
||||
class Dataset_settings_smargon
|
||||
{
|
||||
public:
|
||||
Dataset_settings_smargon();
|
||||
virtual ~Dataset_settings_smargon() = 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_smargon& rhs) const;
|
||||
bool operator!=(const Dataset_settings_smargon& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Dataset_settings_smargon members
|
||||
|
||||
/// <summary>
|
||||
/// Phi angle in degrees
|
||||
/// </summary>
|
||||
float getPhiDeg() const;
|
||||
void setPhiDeg(float const value);
|
||||
/// <summary>
|
||||
/// Chi angle in degrees
|
||||
/// </summary>
|
||||
float getChiDeg() const;
|
||||
void setChiDeg(float const value);
|
||||
/// <summary>
|
||||
/// Phi rotation axis
|
||||
/// </summary>
|
||||
std::vector<float> getPhiAxis() const;
|
||||
void setPhiAxis(std::vector<float> const value);
|
||||
bool phiAxisIsSet() const;
|
||||
void unsetPhi_axis();
|
||||
/// <summary>
|
||||
/// Chi rotation axis
|
||||
/// </summary>
|
||||
std::vector<float> getChiAxis() const;
|
||||
void setChiAxis(std::vector<float> const value);
|
||||
bool chiAxisIsSet() const;
|
||||
void unsetChi_axis();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings_smargon& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings_smargon& o);
|
||||
protected:
|
||||
float m_Phi_deg;
|
||||
|
||||
float m_Chi_deg;
|
||||
|
||||
std::vector<float> m_Phi_axis;
|
||||
bool m_Phi_axisIsSet;
|
||||
std::vector<float> m_Chi_axis;
|
||||
bool m_Chi_axisIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Dataset_settings_smargon_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
+115
-61
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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;
|
||||
@@ -158,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)
|
||||
@@ -172,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)
|
||||
@@ -186,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)
|
||||
@@ -221,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;
|
||||
@@ -333,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())) &&
|
||||
|
||||
|
||||
@@ -398,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())
|
||||
@@ -462,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);
|
||||
@@ -645,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
|
||||
{
|
||||
@@ -713,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;
|
||||
|
||||
+29
-20
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -111,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>
|
||||
@@ -139,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;
|
||||
@@ -226,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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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,6 +84,9 @@ 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;
|
||||
@@ -100,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);
|
||||
@@ -109,6 +112,9 @@ 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);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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,9 +38,10 @@ public:
|
||||
// Avoiding name clashes with user defined
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
NONE,
|
||||
NXMXONLYDATA,
|
||||
NXMXLEGACY,
|
||||
NXMXVDS,
|
||||
NXMXINTEGRATED,
|
||||
CBF,
|
||||
TIFF,
|
||||
NOFILEWRITTEN
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -78,6 +78,9 @@ void to_json(nlohmann::json& j, const Geom_refinement_algorithm& o)
|
||||
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;
|
||||
@@ -91,6 +94,9 @@ void from_json(const nlohmann::json& j, Geom_refinement_algorithm& o)
|
||||
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 {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -12,7 +12,7 @@
|
||||
/*
|
||||
* Geom_refinement_algorithm.h
|
||||
*
|
||||
* Selection of an post-indexing detector geometry refinement algorithm used by Jungfraujoch. This option is using non-linear least squares optimization to find unit cell and beam center.
|
||||
* 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_
|
||||
@@ -25,7 +25,7 @@ namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Selection of an post-indexing detector geometry refinement algorithm used by Jungfraujoch. This option is using non-linear least squares optimization to find unit cell and beam center.
|
||||
/// 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
|
||||
{
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
BEAMCENTER,
|
||||
ORIENTATIONONLY,
|
||||
NONE
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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.158
|
||||
* 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.158
|
||||
* 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_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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 {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* 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
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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.108
|
||||
* The version of the OpenAPI document: 1.0.0-rc.158
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user