diff --git a/.fpga_gitlab-ci.yml b/.fpga_gitlab-ci.yml deleted file mode 100644 index 9dbbc9f2..00000000 --- a/.fpga_gitlab-ci.yml +++ /dev/null @@ -1,329 +0,0 @@ -stages: - - build - - test - - synthesis - - release - -build:x86:gcc: - 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 .. - - 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: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: - - cd python-client - - python3 setup.py sdist bdist_wheel - - mv dist/* .. - artifacts: - paths: - - jfjoch_client-*whl - - jfjoch_client-*tar.gz - expire_in: 1 week - -build:x86:vitis_hls: - stage: build - tags: - - x86 - needs: [] - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_PIPELINE_SOURCE == "push" - changes: - - fpga/hls/* - - fpga/hdl/* - - fpga/scripts/* - - fpga/xdc/* - - fpga/microblaze/* - - fpga/include/jfjoch_fpga.h - script: - - source /opt/Xilinx/Vitis_HLS/2022.1/settings64.sh - - mkdir build - - cd build - - /usr/bin/cmake .. - - make hls - -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 .. - - make frontend - - make -j48 package - - mv *.rpm .. - artifacts: - paths: - - "*.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"] - 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 HDF5DatasetWriteTest - - cd tests - - ./jfjoch_test -r junit -o report.xml - - cd ../tools - - ./HDF5DatasetWriteTest ../../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"] - 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 HDF5DatasetWriteTest - - cd ../tests/crystfel - - HDF5DATASET_WRITE_TEST_IMAGES_PER_FILE=0 ../../build/tools/HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5 10 - - indexamajig -i writing_test.lst -g jf4m.geom -o x.stream --indexing=xgandalf - -test:x86:xds_durin: - stage: test - timeout: 90m - variables: - CTEST_OUTPUT_ON_FAILURE: 1 - CC: gcc - CXX: g++ - needs: ["build:x86:gcc"] - 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 HDF5DatasetWriteTest - - cd ../tests/xds_durin - - HDF5DATASET_WRITE_TEST_IMAGES_PER_FILE=0 ../../build/tools/HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5 25 - - xds_par |grep -a1 ISa |tail -n1 - -test:x86:xds_neggia: - stage: test - timeout: 90m - variables: - CTEST_OUTPUT_ON_FAILURE: 1 - CC: gcc - CXX: g++ - needs: ["build:x86:gcc"] - 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 HDF5DatasetWriteTest - - cd ../tests/xds_neggia - - HDF5DATASET_WRITE_TEST_IMAGES_PER_FILE=0 ../../build/tools/HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5 25 - - xds_par |grep -a1 ISa |tail -n1 - -test:x86:xia2.ssx: - stage: test - timeout: 90m - variables: - CTEST_OUTPUT_ON_FAILURE: 1 - CC: gcc - CXX: g++ - needs: ["build:x86:gcc"] - 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 HDF5DatasetWriteTest - - cd ../dials_test - - ../build/tools/HDF5DatasetWriteTest ../tests/test_data/compression_benchmark.h5 100 - - source /usr/local/dials-v3-17-0/dials_env.sh - - xia2.ssx image=writing_test_master.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000 - -synthesis:vivado_pcie_100g: - stage: synthesis - dependencies: [] - variables: - CC: gcc - CXX: g++ - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_PIPELINE_SOURCE == "push" - changes: - - fpga/hls/* - - fpga/hdl/* - - fpga/scripts/* - - fpga/xdc/* - - fpga/pcie_driver/jfjoch_fpga.h - - if: $CI_COMMIT_MESSAGE =~ /^FPGA/ - allow_failure: true - tags: - - vivado - retry: 2 - artifacts: - paths: - - "jfjoch_fpga_pcie_100g.mcs" - expire_in: 1 week - script: - - source /opt/rh/gcc-toolset-12/enable - - source /opt/Xilinx/Vivado/2022.1/settings64.sh - - touch jfjoch_fpga_pcie_100g.mcs - - mkdir -p build - - cd build - - /usr/bin/cmake .. - - make -j4 pcie_100g - - mv fpga/jfjoch_fpga_pcie_100g.mcs .. - needs: ["build:x86:gcc", "test:x86:gcc"] - -synthesis:vivado_pcie_8x10g: - stage: synthesis - dependencies: [] - variables: - CC: gcc - CXX: g++ - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_PIPELINE_SOURCE == "push" - changes: - - fpga/hls/* - - fpga/hdl/* - - fpga/scripts/* - - fpga/xdc/* - - fpga/pcie_driver/jfjoch_fpga.h - - if: $CI_COMMIT_MESSAGE =~ /^FPGA/ - allow_failure: true - tags: - - vivado - retry: 2 - artifacts: - paths: - - "jfjoch_fpga_pcie_8x10g.mcs" - expire_in: 1 week - script: - - source /opt/rh/gcc-toolset-12/enable - - source /opt/Xilinx/Vivado/2022.1/settings64.sh - - touch jfjoch_fpga_pcie_8x10g.mcs - - mkdir -p build - - cd build - - /usr/bin/cmake .. - - make -j4 pcie_8x10g - - mv fpga/jfjoch_fpga_pcie_8x10g.mcs .. - needs: [ "build:x86:gcc", "test:x86:gcc" ] - -release: - stage: release - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: manual - tags: - - x86 - dependencies: - - synthesis:vivado_pcie_8x10g - - synthesis:vivado_pcie_100g - - build:x86:python_client - - build:x86:frontend - - build:x86:rpm - script: - - bash gitlab_upload_release.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c77ab206..72a3c606 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - test + - synthesis - release build:x86:gcc: @@ -217,6 +218,78 @@ test:x86:xia2.ssx: - source /usr/local/dials-v3-17-0/dials_env.sh - xia2.ssx image=writing_test_master.h5 space_group=P43212 unit_cell=78.551,78.551,36.914,90.000,90.000,90.000 +synthesis: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.1/settings64.sh + - mkdir -p build + - cd build + - /usr/bin/cmake .. + - make hls + needs: ["build:x86:gcc", "test:x86:gcc"] + +synthesis:100g: + stage: synthesis + dependencies: [] + retry: 2 + variables: + CC: gcc + CXX: g++ + allow_failure: true + rules: + - if: $CI_COMMIT_MESSAGE =~ /^FPGA/ + tags: + - vivado + artifacts: + paths: + - "jfjoch_fpga_pcie_100g.mcs" + expire_in: 1 week + script: + - source /opt/rh/gcc-toolset-12/enable + - source /opt/Xilinx/Vivado/2022.1/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", "test:x86:gcc"] + +synthesis:8x10g: + stage: synthesis + dependencies: [] + variables: + CC: gcc + CXX: g++ + retry: 2 + allow_failure: true + rules: + - if: $CI_COMMIT_MESSAGE =~ /^FPGA/ + 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.1/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", "test:x86:gcc" ] + release: stage: release rules: diff --git a/.miv_gitlab-ci.yml b/.miv_gitlab-ci.yml deleted file mode 100644 index 84ceecd4..00000000 --- a/.miv_gitlab-ci.yml +++ /dev/null @@ -1,42 +0,0 @@ -stages: - - mirror - - build - - publish - - - -mirror-psi: - stage: mirror - tags: - - docker-shared - script: - - SOURCE_REPOSITORY=https://$PSI_PROJECT_GIT_USRNAME:$PSI_PROJECT_GIT_TOKEN@gitlab.psi.ch/jungfraujoch/nextgendcu.git - - DESTINATION_REPOSITORY=https://$MIV_PROJECT_GIT_USRNAME:$MIV_PROJECT_GIT_TOKEN@gitlab.maxiv.lu.se/jungfraujoch/nextgendcu.git - - GIT_USER_NAME=git - - GIT_USER_EMAIL=git@maxiv.lu.se - - rm -rf _mirror_repo_tmp - - git clone --mirror $SOURCE_REPOSITORY _mirror_repo_tmp - - cd _mirror_repo_tmp - - git config --local user.name "${GIT_USER_NAME}" - - git config --local user.email "${GIT_USER_EMAIL}" - - git remote remove origin - - git remote add origin $DESTINATION_REPOSITORY - - git push --prune --all - - git push --prune --tags - after_script: - - rm -rf _mirror_repo_tmp - rules: - - if: '$CI_PIPELINE_SOURCE != "schedule" && $CI_PIPELINE_SOURCE != "trigger"' - when: never - - if: '$MODE != "sync"' - when: never - - when: always - - -include: - - project: 'kits-maxiv/cfg-maxiv-gitlabci' - file: '/Docker.gitlab-ci.yml' - -variables: - DOCKER_REGISTRY: "harbor.maxiv.lu.se/daq" - GIT_SUBMODULE_STRATEGY: recursive diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a32fe204 --- /dev/null +++ b/LICENSE @@ -0,0 +1,6 @@ +Operating Jungfraujoch requires license from the Paul Scherrer Institute. + +Specifically, non-profit research facilities operating PSI JUNGFRAU and PSI EIGER detectors are granted the license to use the +code and binary images within their facilities, as well as to modify the code according to their needs. + +Sharing the code requires explicit permission from the Paul Scherrer Institute. \ No newline at end of file diff --git a/README.md b/README.md index d042ff4f..3a963d64 100644 --- a/README.md +++ b/README.md @@ -2,110 +2,4 @@ Application to receive data from the PSI JUNGFRAU and EIGER detectors. -Citation: F. Leonarski, M. Bruckner, C. Lopez-Cuenca, A. Mozzanica, H.-C. Stadler, Z. Matej, A. Castellane, B. Mesnet, J. Wojdyla, B. Schmitt and M. Wang "Jungfraujoch: hardware-accelerated data-acquisition system for kilohertz pixel-array X-ray detectors" (2023), J. Synchrotron Rad., 30, 227-234 [doi:10.1107/S1600577522010268](https://doi.org/10.1107/S1600577522010268). - -The project is supported by : -* Innosuisse via Innovation Project "NextGenDCU high data rate acquisition system for X-ray detectors in structural biology applications" (101.535.1 IP-ENG; Apr 2023 - Sep 2025). -* ETH Domain via Open Research Data Contribute project (Jan - Dec 2023) -* AMD University Program with donation of licenses of Ethernet IP cores and Vivado software - -## License - -Operating Jungfraujoch requires license from the Paul Scherrer Institute. - -Specifically, non-profit research facilities operating PSI JUNGFRAU and PSI EIGER detectors are granted the license to use the -code and binary images within their facilities, as well as to modify the code according to their needs. - -Sharing the code requires explicit permission from the Paul Scherrer Institute. - -## Compatible detectors -Currently, Jungfraujoch supports PSI JUNGFRAU and PSI EIGER detectors. - -## Hardware requirements -See [hardware requirements](HARDWARE.md) documentation. - -## FPGA bitstream -Instructions see [here](fpga/README.md) - -## Detector -Jungfraujoch supports PSI JUNGFRAU and EIGER detectors. Jungfruajoch controls the detector via statically compiled `slsDetectorPackage` into its source code. -It is important that detector firmware has to match `slsDetectorPackage` version used in Jungfraujoch (8.0.2 at the moment). -See [PSI Detector group website](https://www.psi.ch/en/lxn/software-releases) for details. - -## Operating system -Recommended operating system is Red Hat Enterprise Linux (RHEL) / Rocky Linux versions 8. -For this operating system we provide RPMs with pre-built binaries to simplify deployment. - -We do also operate one of the systems with Rocky 9 without issues. -Running Jungfraujoch on Red Hat Enterprise Linux 7 is currently not tested and not recommended, -but likely possible with providing some packages from external repositories. -There are some limited tests with recent Ubuntu and Fedora distributions, though these are not systematic. -Other linux platforms should work, but no tests were done so far. - -### Software dependencies -Required: -* C++20 compiler and C++20 standard library; recommended GCC 11+ or clang 14+ (Intel OneAPI, AMD AOCC) -* CMake version 3.21 or newer + GNU make tool -* zlib compression library - -Optional: -* CUDA compiler version 11 or newer - required for MX fast feedback indexer -* NUMA library - to pin threads to nodes/CPUs -* Node.js - to make frontend - -Automatically downloaded by CMake and statically linked: -* SLS Detector Package - see [github.com/slsdetectorgroup/slsDetectorPackage](https://github.com/slsdetectorgroup/slsDetectorPackage) -* Zstandard (Facebook) - see [github.com/facebook/zstd](https://github.com/facebook/zstd) -* Pistache webserver - see [github.com/pistacheio/pistache](https://github.com/pistacheio/pistache) -* Fast feedback indexer (Hans-Christian Stadler, PSI) - see [github.com/paulscherrerinstitute/fast-feedback-indexer](https://github.com/paulscherrerinstitute/fast-feedback-indexer) -* Catch2 testing library - see [github.com/catchorg/Catch2](https://github.com/catchorg/Catch2) -* HDF5 library - see [github.com/HDFGroup/hdf5](https://github.com/HDFGroup/hdf5) -* TIFF library - see [gitlab.com/libtiff/libtiff](https://gitlab.com/libtiff/libtiff) - -Please follow the link provided above to check for LICENSE file. Building code with dependencies above requires access from the build system to github.com. - -Directly included in the repository: -* JSON parser/writer from N. Lohmann - see [github.com/nlohmann/json](https://github.com/nlohmann/json) -* Xilinx arbitrary precision arithmetic headers - see [github.com/Xilinx/HLS_arbitrary_Precision_Types](https://github.com/Xilinx/HLS_arbitrary_Precision_Types) -* Bitshuffle filter from K. Masui - see [github.com/kiyo-masui/bitshuffle](https://github.com/kiyo-masui/bitshuffle) -* Fast replacement for Bitshuffle pre-compression filter (Kal Cutter, DECTRIS) - see [github.com/kalcutter/bitshuffle](https://github.com/kalcutter/bitshuffle) -* Tinycbor (Intel) - see [github.com/intel/tinycbor](https://github.com/intel/tinycbor) -* LZ4 compression by Y.Collet - see [github.com/lz4/lz4](https://github.com/lz4/lz4) -* Spdlog logging library - see [github.com/gabime/spdlog](https://github.com/gabime/spdlog) -* ZeroMQ library (through slsDetectorPackage) - see [github.com/zeromq/libzmq](https://github.com/zeromq/libzmq) - -For license check LICENSE file in respective directory - -## Installation guide -Follow [Installation guide](INSTALL.md). - -### Software components - -* `jfjoch_broker` in `broker` - main service running on the Jungfraujoch server, responsible for control of the detector and data acquisition; - Example configuration `jfjoch_broker` for the modules is given in configuration files present in `etc` directory. See [details](broker/README.md). -* `jfjoch_writer` in `writer` - HDF5 writer; HDF5 writer is designed to work on the same or separate server system. It has rather limited requirements in terms of performance and memory. - The goal is to separate data acquisition node with custom FPGA hardware and file system node with stronger security/stability requirements. See [details](writer/README.md). - -## Web Frontend -Jungfraujoch is equipped with React-based web frontend for user-friendly experience. Frontend has the following options: -* Presenting current state of the detector -* Plotting results of online quality calculations -* Showing live view images from the detector -* JUNGFRAU calibration numbers -* Configuring the detector, as well as pedestal/initialization operations - -Frontend is written in TypeScript. For details see [frontend/](frontend) directory. - -## OpenAPI python client -Jungfraujoch is controlled with HTTP/REST interface defined with an OpenAPI specification. For convenience, we provide Python client in [python_client](python_client/) directory. - -## Tests - -Automated test routine is then accessible as `tests/jfjoch_test`. There are also benchmark routines: - -* `HDF5DatasetWriteTest` to measure HDF5 dataset writing speed (single threaded) -* `jfjoch_spot_finding_test` to apply spot finding and indexing routines in Jungfraujoch to an example dataset - this is equivalent to FPGA spot finding algorithm, but NOT performance equivalent as it is particularly not-efficient -* `jfjoch_action_test` to test quality/performance of FPGA card(s) and software routines - -In addition, tests are executed to verify that datasets written by Jungfraujoch are readable with XDS Durin plugin, XDS Neggia plygin and CrystFEL. -Input files for these programs are placed in `xds_durin`, `xds_neggia` and `crystfel` folders. See `.gitlab-ci.yml` for details. +All documentation is now placed in [docs/](docs/) subdirectory. \ No newline at end of file diff --git a/VERSION b/VERSION index 96b536fb..debcfd18 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-rc.23 +1.0.0-rc.24 diff --git a/acquisition_device/AcquisitionCounters.cpp b/acquisition_device/AcquisitionCounters.cpp index 14ef5dca..b631756d 100644 --- a/acquisition_device/AcquisitionCounters.cpp +++ b/acquisition_device/AcquisitionCounters.cpp @@ -21,7 +21,7 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_ (experiment.GetDetectorMode() == DetectorMode::PedestalG2)) expected_frames = experiment.GetFrameNum(); else - expected_frames = experiment.GetImageNum(); + expected_frames = experiment.GetFrameNum() / experiment.GetFPGASummation(); nmodules = experiment.GetModulesNum(data_stream); if (nmodules > max_modules) @@ -35,7 +35,14 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_ saved_completions = std::vector(expected_frames * nmodules); packets_per_module = std::vector(nmodules); total_packets = 0; - expected_packets_per_module = 256 * experiment.GetSummation(); + expected_packets_per_module = 512 * experiment.GetFPGASummation(); + + if (experiment.GetByteDepthReadout() == 4) + bytes_per_packet = 4096LU; + else if (experiment.GetByteDepthReadout() == 1) + bytes_per_packet = 1024LU; // Need to seriously refactor, to have expected_packets_per_module specific for detector + else + bytes_per_packet = 2048LU; } void AcquisitionCounters::UpdateCounters(const Completion *c) { @@ -134,6 +141,8 @@ uint64_t AcquisitionCounters::GetFastestFrameNumber() const { void AcquisitionCounters::WaitForFrame(size_t curr_frame, uint16_t module_number) const { uint64_t slowest_head_tmp = (module_number == UINT16_MAX) ? GetSlowestFrameNumber() : GetCurrFrameNumber(module_number); + if (curr_frame == 0) + curr_frame = 1; // Cannot wait for frame 0, as this is initial value of slowest frame number, so waiting for frame 1 in this case while (!acquisition_finished && (slowest_head_tmp < curr_frame)) { std::this_thread::sleep_for(std::chrono::microseconds(100)); slowest_head_tmp = (module_number == UINT16_MAX) ? GetSlowestFrameNumber() : GetCurrFrameNumber(module_number); @@ -207,3 +216,7 @@ uint64_t AcquisitionCounters::GetExpectedPacketsPerModule() const { uint64_t AcquisitionCounters::GetModuleNumber() const { return nmodules; } + +uint64_t AcquisitionCounters::GetBytesReceived() const { + return GetTotalPackets() * bytes_per_packet; +} diff --git a/acquisition_device/AcquisitionCounters.h b/acquisition_device/AcquisitionCounters.h index 67b4c84d..b7b0c9c4 100644 --- a/acquisition_device/AcquisitionCounters.h +++ b/acquisition_device/AcquisitionCounters.h @@ -36,6 +36,7 @@ class AcquisitionCounters { bool acquisition_finished; uint64_t expected_frames; uint64_t nmodules = max_modules; + uint64_t bytes_per_packet; public: static constexpr const uint64_t HandleNotFound = UINT64_MAX; @@ -61,6 +62,7 @@ public: uint64_t GetTotalPackets() const; uint64_t GetTotalPackets(uint16_t module_number) const; + uint64_t GetBytesReceived() const; uint64_t GetExpectedPackets() const; uint64_t GetExpectedPacketsPerModule() const; diff --git a/acquisition_device/AcquisitionDevice.cpp b/acquisition_device/AcquisitionDevice.cpp index b4f03852..8dd898bd 100644 --- a/acquisition_device/AcquisitionDevice.cpp +++ b/acquisition_device/AcquisitionDevice.cpp @@ -52,7 +52,7 @@ void AcquisitionDevice::StartAction(const DiffractionExperiment &experiment, uin "Number of modules exceeds max possible for FPGA")); counters.Reset(experiment, data_stream); - expected_frames = experiment.GetFrameNum() / experiment.GetSummation(); + expected_frames = experiment.GetFrameNum() / experiment.GetFPGASummation(); // Ensure internal WR queue is empty work_request_queue.Clear(); @@ -131,7 +131,7 @@ void AcquisitionDevice::SendWorkRequest(uint32_t handle) { } uint64_t AcquisitionDevice::GetBytesReceived() const { - return counters.GetTotalPackets() * 4096LU; + return counters.GetBytesReceived(); } const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t frame_number, uint16_t module_number) const { @@ -168,6 +168,8 @@ void AcquisitionDevice::InitializeSpotFinderResolutionMap(const float *data, siz void AcquisitionDevice::InitializeROIMap(const uint16_t *map, size_t module_number) {} +void AcquisitionDevice::InitializePixelMask(const uint32_t *module_mask, size_t module_number) {} + void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment) { std::vector tmp(RAW_MODULE_SIZE); auto offset = experiment.GetFirstModuleOfDataStream(data_stream); @@ -178,6 +180,13 @@ void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment } } +void AcquisitionDevice::InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask) { + auto offset = experiment.GetFirstModuleOfDataStream(data_stream); + size_t modules = experiment.GetModulesNum(data_stream); + for (int m = 0; m < modules; m++) + InitializePixelMask(mask.GetMaskRaw().data() + RAW_MODULE_SIZE * (offset + m), m); +} + void AcquisitionDevice::MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node) { try { for (int i = 0; i < c2h_buffer_count; i++) @@ -278,6 +287,7 @@ void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experi break; case DetectorType::EIGER: config.detector_type = SLS_DETECTOR_TYPE_EIGER; + config.eiger_bit_depth = experiment.GetByteDepthReadout() * 8; break; } HW_RunInternalGenerator(config); diff --git a/acquisition_device/AcquisitionDevice.h b/acquisition_device/AcquisitionDevice.h index 69a86cfa..7fc2c030 100644 --- a/acquisition_device/AcquisitionDevice.h +++ b/acquisition_device/AcquisitionDevice.h @@ -11,6 +11,7 @@ #include "../common/Definitions.h" #include "../common/DiffractionExperiment.h" #include "../common/Logger.h" +#include "../common/PixelMask.h" #include "../common/ThreadSafeFIFO.h" #include "../jungfrau/JFCalibration.h" @@ -94,6 +95,8 @@ public: virtual void InitializeIntegrationMap(const uint16_t *map, const float *weights, size_t module_number); virtual void InitializeSpotFinderResolutionMap(const float *data, size_t module_number); virtual void InitializeROIMap(const uint16_t *map, size_t module_number); + void InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask); + virtual void InitializePixelMask(const uint32_t *module_mask, size_t module_number); void InitializeROIMap(const DiffractionExperiment &experiment); const AcquisitionCounters& Counters() const; diff --git a/acquisition_device/FPGAAcquisitionDevice.cpp b/acquisition_device/FPGAAcquisitionDevice.cpp index 25e27486..d4917267 100644 --- a/acquisition_device/FPGAAcquisitionDevice.cpp +++ b/acquisition_device/FPGAAcquisitionDevice.cpp @@ -135,6 +135,14 @@ void FPGAAcquisitionDevice::InitializeROIMap(const uint16_t *map, size_t module_ LoadCalibration(0); } +void FPGAAcquisitionDevice::InitializePixelMask(const uint32_t *module_mask, size_t module_number) { + memcpy(buffer_device[0]->pixels, module_mask, RAW_MODULE_SIZE * sizeof(uint32_t)); + buffer_device[0]->module_statistics.module_number = module_number; + buffer_device[0]->module_statistics.load_calibration_destination = LOAD_CALIBRATION_DEST_PXL_MASK; + LoadCalibration(0); +} + + void FPGAAcquisitionDevice::InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) { auto offset = experiment.GetFirstModuleOfDataStream(data_stream); @@ -215,7 +223,7 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D job.energy_kev = x.GetPhotonEnergyForConversion_keV(); job.nstorage_cells = x.GetStorageCellNumber() - 1; job.mode = data_collection_id << 16; - job.nsummation = x.GetSummation() - 1; + job.nsummation = x.GetFPGASummation() - 1; expected_descriptors_per_module = DMA_DESCRIPTORS_PER_MODULE; @@ -228,8 +236,18 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D if (!x.IsPixelSigned()) job.mode |= MODE_UNSIGNED; - if (x.GetByteDepthImage() == 4) - job.mode |= MODE_32BIT; + if (x.GetEigerBitDepth() == 32) + job.mode |= MODE_EIGER_32BIT; + else if (x.GetEigerBitDepth() == 8) + job.mode |= MODE_EIGER_8BIT; + + if (x.GetByteDepthFPGA() == 4) + job.mode |= MODE_32BIT_OUTPUT; + if (x.GetByteDepthFPGA() == 1) + job.mode |= MODE_8BIT_OUTPUT; + + if (x.IsApplyPixelMask()) + job.mode |= MODE_APPLY_PIXEL_MASK; if (x.GetLossyCompressionPoisson()) { job.mode |= MODE_SQROOT; @@ -281,4 +299,4 @@ uint32_t FPGAAcquisitionDevice::GetExpectedDescriptorsPerModule() const { void FPGAAcquisitionDevice::LoadCalibration(uint32_t handle) { HW_LoadCalibration(LoadCalibrationConfig{.handle = handle}); -} \ No newline at end of file +} diff --git a/acquisition_device/FPGAAcquisitionDevice.h b/acquisition_device/FPGAAcquisitionDevice.h index b5a15560..f682f0ac 100644 --- a/acquisition_device/FPGAAcquisitionDevice.h +++ b/acquisition_device/FPGAAcquisitionDevice.h @@ -44,6 +44,7 @@ public: void InitializeIntegrationMap(const uint16_t *map, const float *weights, size_t module_number) override; void InitializeSpotFinderResolutionMap(const float *data, size_t module_number) override; void InitializeROIMap(const uint16_t *map, size_t module_number) override; + void InitializePixelMask(const uint32_t *module_mask, size_t module_number) override; void SetInternalGeneratorFrame(const uint16_t *input, size_t module_number) override; uint32_t GetExpectedDescriptorsPerModule() const override; }; diff --git a/acquisition_device/HLSSimulatedDevice.cpp b/acquisition_device/HLSSimulatedDevice.cpp index ab9151f3..8da5fd49 100644 --- a/acquisition_device/HLSSimulatedDevice.cpp +++ b/acquisition_device/HLSSimulatedDevice.cpp @@ -19,12 +19,12 @@ HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buf } void HLSSimulatedDevice::CreateFinalPacket(const DiffractionExperiment& experiment) { - device->CreateFinalPacket(experiment); + device->CreateFinalPacket(); } void HLSSimulatedDevice::CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet, uint32_t module_number, const uint16_t *data, int8_t adjust_axis, uint8_t user) { - device->CreateJFPacket(experiment, frame_number, eth_packet, module_number, data, adjust_axis, user); + device->CreateJFPacket(frame_number, eth_packet, module_number, data, adjust_axis, user); } void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames, @@ -38,7 +38,7 @@ void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment void HLSSimulatedDevice::CreateEIGERPacket(const DiffractionExperiment &experiment, uint64_t frame_number, uint32_t eth_packet, uint32_t module_number, uint32_t col, uint32_t row, const uint16_t *data) { - device->CreateEIGERPacket(experiment, frame_number, eth_packet, module_number, col, row, data); + device->CreateEIGERPacket(frame_number, eth_packet, module_number, col, row, data); } void HLSSimulatedDevice::HW_ReadActionRegister(DataCollectionConfig *job) { @@ -50,7 +50,7 @@ void HLSSimulatedDevice::HW_WriteActionRegister(const DataCollectionConfig *job) } void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) { - device->FPGA_StartAction(experiment); + device->FPGA_StartAction(); } void HLSSimulatedDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) { diff --git a/acquisition_device/HLSSimulatedDevice.h b/acquisition_device/HLSSimulatedDevice.h index d0204b4d..a6fdb842 100644 --- a/acquisition_device/HLSSimulatedDevice.h +++ b/acquisition_device/HLSSimulatedDevice.h @@ -6,7 +6,7 @@ #include #include "../common/DiffractionExperiment.h" -#include "../fpga/hls/HLSDevice.h" +#include "../fpga/hls_simulation/HLSDevice.h" #include "FPGAAcquisitionDevice.h" diff --git a/acquisition_device/PCIExpressDevice.cpp b/acquisition_device/PCIExpressDevice.cpp index c24b4b75..b4cee98d 100644 --- a/acquisition_device/PCIExpressDevice.cpp +++ b/acquisition_device/PCIExpressDevice.cpp @@ -2,17 +2,19 @@ #include "PCIExpressDevice.h" #include "../common/NetworkAddressConvert.h" +#define PCI_EXCEPT(x) try {x;} catch (const std::exception &e) { throw PCIeDeviceException(e.what()); } PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, uint16_t pci_slot) : PCIExpressDevice(data_stream, "/dev/jfjoch" + std::to_string(pci_slot)) {} PCIExpressDevice::PCIExpressDevice(uint16_t data_stream) : -PCIExpressDevice(data_stream, "/dev/jfjoch" + std::to_string(data_stream)) {} + PCIExpressDevice(data_stream, "/dev/jfjoch" + std::to_string(data_stream)) {} PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, const std::string &device_name) -: FPGAAcquisitionDevice(data_stream), dev(device_name, true) { + : FPGAAcquisitionDevice(data_stream), dev(device_name, true) { - DataCollectionStatus status = dev.GetDataCollectionStatus(); + DataCollectionStatus status; + PCI_EXCEPT(status = dev.GetDataCollectionStatus()) max_modules = status.max_modules; if (max_modules == 0) @@ -31,78 +33,88 @@ PCIExpressDevice::PCIExpressDevice(uint16_t data_stream, const std::string &devi } bool PCIExpressDevice::HW_ReadMailbox(uint32_t *values) { - return dev.ReadWorkCompletion(values); + PCI_EXCEPT(return dev.ReadWorkCompletion(values);) } void PCIExpressDevice::Cancel() { - dev.Cancel(); + PCI_EXCEPT(dev.Cancel();) } bool PCIExpressDevice::HW_SendWorkRequest(uint32_t handle) { - return dev.SendWorkRequest(handle); + PCI_EXCEPT(return dev.SendWorkRequest(handle);) } void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment) { - dev.Start(); + PCI_EXCEPT(dev.Start();) } void PCIExpressDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) { - dev.RunFrameGenerator(config); + PCI_EXCEPT(dev.RunFrameGenerator(config);) } void PCIExpressDevice::FPGA_EndAction() { - dev.End(); + PCI_EXCEPT(dev.End();) } bool PCIExpressDevice::HW_IsIdle() const { - return dev.IsIdle(); + PCI_EXCEPT(return dev.IsIdle();) } void PCIExpressDevice::HW_WriteActionRegister(const DataCollectionConfig *config) { - dev.SetConfig(*config); + PCI_EXCEPT(dev.SetConfig(*config);) } void PCIExpressDevice::HW_ReadActionRegister(DataCollectionConfig *config) { - *config = dev.GetConfig(); + PCI_EXCEPT(*config = dev.GetConfig();) } std::string PCIExpressDevice::GetMACAddress() const { - return MacAddressToStr(dev.GetMACAddress()); + PCI_EXCEPT(return MacAddressToStr(dev.GetMACAddress());) } uint32_t PCIExpressDevice::GetNumKernelBuffers() const { - return dev.GetBufferCount(); + PCI_EXCEPT(return dev.GetBufferCount();) } int32_t PCIExpressDevice::GetNUMANode() const { - return dev.GetNumaNode(); + PCI_EXCEPT(return dev.GetNumaNode();) } void PCIExpressDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) { + PCI_EXCEPT( // Configure all links with the same IPv4 address - auto dev_status = dev.GetDeviceStatus(); - for (int i = 0; i < dev_status.eth_link_count; i++) - dev.SetIPv4Address(ipv4_addr_network_order, i); - dev.SetIPv4Address(ipv4_addr_network_order, NET_IF_FRAME_GENERATOR); + auto dev_status = dev.GetDeviceStatus(); + for (int i = 0; i < dev_status.eth_link_count; i++) + dev.SetIPv4Address(ipv4_addr_network_order, i); + dev.SetIPv4Address(ipv4_addr_network_order, NET_IF_FRAME_GENERATOR); + ) } std::string PCIExpressDevice::GetIPv4Address() const { + PCI_EXCEPT( return IPv4AddressToStr(dev.GetIPv4Address()); + ) } void PCIExpressDevice::HW_SetSpotFinderParameters(const SpotFinderParameters ¶ms) { - dev.SetSpotFinderParameters(params); + PCI_EXCEPT( + dev.SetSpotFinderParameters(params); + ) } DeviceStatus PCIExpressDevice::GetDeviceStatus() const { - return dev.GetDeviceStatus(); + PCI_EXCEPT( + return dev.GetDeviceStatus(); + ) } DataCollectionStatus PCIExpressDevice::GetDataCollectionStatus() const { - return dev.GetDataCollectionStatus(); + PCI_EXCEPT( + return dev.GetDataCollectionStatus(); + ) } void PCIExpressDevice::HW_LoadCalibration(const LoadCalibrationConfig &config) { - dev.LoadCalibration(config); + PCI_EXCEPT(dev.LoadCalibration(config);) } diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index 5239763b..535ee84d 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -6,6 +6,7 @@ #include "gen/model/Error_message.h" #include "../common/GitInfo.h" #include "OpenAPIConvert.h" +#include "../preview/JFJochTIFF.h" JFJochBrokerHttp::JFJochBrokerHttp(const DiffractionExperiment &experiment, std::shared_ptr &rtr) : DefaultApi(rtr) { @@ -421,18 +422,54 @@ void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional &binni } void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) { - std::string s = state_machine.GetFullPixelMaskTIFF(); + auto s = state_machine.GetFullPixelMaskTIFF(); response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff")); } void JFJochBrokerHttp::config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) { - std::string s = state_machine.GetUserPixelMaskTIFF(); + auto s = state_machine.GetUserPixelMaskTIFF(); response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff")); } void JFJochBrokerHttp::config_user_mask_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) { - state_machine.SetUserPixelMask(request.body()); + uint32_t cols, lines; + auto v = ReadTIFFFromString32(request.body(), cols, lines); + state_machine.SetUserPixelMask(v); + response.send(Pistache::Http::Code::Ok); +} + +void JFJochBrokerHttp::config_mask_get(Pistache::Http::ResponseWriter &response) { + const auto v = state_machine.GetFullPixelMask(); + response.send(Pistache::Http::Code::Ok, + reinterpret_cast(v.data()), + v.size() * sizeof(uint32_t), + Pistache::Http::Mime::MediaType::fromString("application/octet-stream")); +} + +void JFJochBrokerHttp::config_user_mask_get(Pistache::Http::ResponseWriter &response) { + const auto v = state_machine.GetUserPixelMask(); + response.send(Pistache::Http::Code::Ok, + reinterpret_cast(v.data()), + v.size() * sizeof(uint32_t), + Pistache::Http::Mime::MediaType::fromString("application/octet-stream")); +} + +void JFJochBrokerHttp::config_user_mask_put(const Pistache::Rest::Request &request, + Pistache::Http::ResponseWriter &response) { + if (request.body().empty()) { + response.send(Pistache::Http::Code::Bad_Request, "Request body cannot be empty"); + return; + } + + if (request.body().size() % 4 != 0) { + response.send(Pistache::Http::Code::Bad_Request, "Request has to be 32-bit"); + return; + } + + std::vector v(request.body().size() / 4); + memcpy(v.data(), request.body().data(), request.body().size()); + state_machine.SetUserPixelMask(v); response.send(Pistache::Http::Code::Ok); } @@ -498,6 +535,7 @@ void JFJochBrokerHttp::statistics_get(const std::optional &compression, Pi statistics.setDataProcessingSettings(Convert(state_machine.GetSpotFindingSettings())); statistics.setInstrumentMetadata(Convert(state_machine.GetInstrumentMetadata())); statistics.setImageFormatSettings(Convert(state_machine.GetImageFormatSettings())); + statistics.setPixelMask(Convert(state_machine.GetPixelMaskStatistics())); auto zeromq_prev = state_machine.GetPreviewSocketSettings(); if (!zeromq_prev.address.empty()) @@ -520,3 +558,5 @@ void JFJochBrokerHttp::config_zeromq_preview_put( state_machine.SetPreviewSocketSettings(Convert(zeromqPreviewSettings)); response.send(Pistache::Http::Code::Ok); } + + diff --git a/broker/JFJochBrokerHttp.h b/broker/JFJochBrokerHttp.h index 30d21274..4c5638b1 100644 --- a/broker/JFJochBrokerHttp.h +++ b/broker/JFJochBrokerHttp.h @@ -169,6 +169,13 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings, Pistache::Http::ResponseWriter &response) override; + void config_mask_get(Pistache::Http::ResponseWriter &response) override; + + void config_user_mask_get(Pistache::Http::ResponseWriter &response) override; + + void config_user_mask_put(const Pistache::Rest::Request &request, + Pistache::Http::ResponseWriter &response) override; + public: JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr &rtr); void AddDetectorSetup(const DetectorSetup &setup); diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 8cbe2062..624cc77f 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -10,7 +10,7 @@ JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_l logger(in_logger), data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()), pixel_mask(experiment) { - + SupressTIFFErrors(); } bool JFJochStateMachine::ImportPedestalG0(const JFJochReceiverOutput &receiver_output) { @@ -75,7 +75,8 @@ void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock &u } } services.ConfigureDetector(experiment); - pixel_mask.LoadDetectorBadPixelMask(calibration->CalculateMask()); + pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get()); + UpdatePixelMaskStatistics(pixel_mask.GetStatistics()); } catch (const std::exception &e) { logger.Error("Pedestal sequence error {}", e.what()); state = JFJochState::Error; @@ -281,6 +282,16 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) { } } +void JFJochStateMachine::UpdatePixelMaskStatistics(const PixelMaskStatistics &input) { + std::unique_lock ul(pixel_mask_statistics_mutex); + pixel_mask_statistics = input; +} + +PixelMaskStatistics JFJochStateMachine::GetPixelMaskStatistics() const { + std::unique_lock ul(pixel_mask_statistics_mutex); + return pixel_mask_statistics; +} + void JFJochStateMachine::MeasurementThread() { try { auto tmp_output = services.Stop(); @@ -435,7 +446,7 @@ void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) { experiment.Detector(setup); gain_calibration = setup.GetGainCalibration(); current_detector_setup = 0; - pixel_mask = PixelMask(setup); + pixel_mask = PixelMask(experiment); } detector_setup.emplace_back(setup); } @@ -476,7 +487,7 @@ void JFJochStateMachine::SelectDetector(int64_t id) { try { experiment.Detector(detector_setup[id]); gain_calibration = detector_setup[id].GetGainCalibration(); - pixel_mask = PixelMask(detector_setup[id]); + pixel_mask = PixelMask(experiment); state = JFJochState::Inactive; current_detector_setup = id; } catch (JFJochException &e) { @@ -651,16 +662,25 @@ std::string JFJochStateMachine::GetUserPixelMaskTIFF() const { sizeof(uint32_t), false); } -void JFJochStateMachine::SetUserPixelMask(const std::string &s) { +std::vector JFJochStateMachine::GetFullPixelMask() const { + std::unique_lock ul(m); + return pixel_mask.GetMask(experiment); +} + +std::vector JFJochStateMachine::GetUserPixelMask() const { + std::unique_lock ul(m); + return pixel_mask.GetUserMask(experiment); +} + +void JFJochStateMachine::SetUserPixelMask(const std::vector &v) { std::unique_lock ul(m); if (state != JFJochState::Idle) throw WrongDAQStateException ("User mask can be only modified in Idle state"); try { - uint32_t cols, lines; - auto v = ReadTIFFFromString32(s, cols, lines); pixel_mask.LoadUserMask(experiment, v); + UpdatePixelMaskStatistics(pixel_mask.GetStatistics()); } catch (const JFJochException &e) { throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Problem handling user mask " + std::string(e.what())); @@ -693,6 +713,8 @@ void JFJochStateMachine::LoadImageFormatSettings(const ImageFormatSettings &sett throw WrongDAQStateException ("Cannot change instrument metadata during data collection"); experiment.ImportImageFormatSettings(settings); + pixel_mask.Update(settings); + UpdatePixelMaskStatistics(pixel_mask.GetStatistics()); } void JFJochStateMachine::RawImageFormatSettings() { diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 0995426b..456afdf9 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -93,6 +93,11 @@ class JFJochStateMachine { mutable std::mutex data_processing_settings_mutex; SpotFindingSettings data_processing_settings; + mutable std::mutex pixel_mask_statistics_mutex; + PixelMaskStatistics pixel_mask_statistics; + + void UpdatePixelMaskStatistics(const PixelMaskStatistics &input); + // Private functions assume that lock m is acquired void MeasurementThread(); void PedestalThread(std::unique_lock ul); @@ -177,11 +182,17 @@ public: std::string GetFullPixelMaskTIFF() const; std::string GetUserPixelMaskTIFF() const; - void SetUserPixelMask(const std::string &v); + std::vector GetFullPixelMask() const; + std::vector GetUserPixelMask() const; + + void SetUserPixelMask(const std::vector &v); + std::vector GetDeviceStatus() const; void SetPreviewSocketSettings(const ZMQPreviewSettings &input); ZMQPreviewSettings GetPreviewSocketSettings(); + + PixelMaskStatistics GetPixelMaskStatistics() const; }; diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 6dad9e21..ba044193 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -139,7 +139,9 @@ DetectorSettings Convert(const org::openapitools::server::model::Detector_settin ret.PedestalG1Frames(input.getJungfrauPedestalG1Frames()); ret.PedestalG2Frames(input.getJungfrauPedestalG2Frames()); ret.PedestalMinImageCount(input.getJungfrauPedestalMinImageCount()); - ret.PedestalG0RMSLimit(input.getJungfrauPedestalG0RmsLimit()); + + if (input.eigerBitDepthIsSet()) + ret.EigerBitDepth(input.getEigerBitDepth()); if (input.eigerThresholdKeVIsSet()) ret.EigerThreshold_keV(input.getEigerThresholdKeV()); @@ -171,10 +173,11 @@ org::openapitools::server::model::Detector_settings Convert(const DetectorSettin ret.setJungfrauPedestalMinImageCount(input.GetPedestalMinImageCount()); ret.setJungfrauStorageCellDelayNs(input.GetStorageCellDelay().count()); - ret.setJungfrauPedestalG0RmsLimit(input.GetPedestalG0RMSLimit()); - if (input.GetEIGERThreshold_keV().has_value()) - ret.setEigerThresholdKeV(input.GetEIGERThreshold_keV().value()); - + if (input.GetEigerThreshold_keV().has_value()) + ret.setEigerThresholdKeV(input.GetEigerThreshold_keV().value()); + if (input.GetEigerBitDepth().has_value()) + ret.setEigerBitDepth(input.GetEigerBitDepth().value()); + ret.setTiming(Convert(input.GetTiming())); return ret; } @@ -423,6 +426,9 @@ ImageFormatSettings Convert(const org::openapitools::server::model::Image_format ret.JungfrauConversion(input.isJungfrauConversion()); ret.MaskChipEdges(input.isMaskChipEdges()); ret.MaskModuleEdges(input.isMaskModuleEdges()); + ret.ApplyPixelMask(input.isApplyMask()); + ret.PedestalG0RMSLimit(input.getJungfrauPedestalG0RmsLimit()); + ret.MaskPixelsWithoutG0(input.isJungfrauMaskPixelsWithoutG0()); if (input.signedOutputIsSet()) ret.PixelSigned(input.isSignedOutput()); if (input.jungfrauConversionFactorKeVIsSet()) @@ -439,6 +445,9 @@ org::openapitools::server::model::Image_format_settings Convert(const ImageForma ret.setJungfrauConversion(input.IsJungfrauConversion()); ret.setMaskChipEdges(input.IsMaskChipEdges()); ret.setMaskModuleEdges(input.IsMaskModuleEdges()); + ret.setApplyMask(input.IsApplyPixelMask()); + ret.setJungfrauMaskPixelsWithoutG0(input.IsMaskPixelsWithoutG0()); + ret.setJungfrauPedestalG0RmsLimit(input.GetPedestalG0RMSLimit()); if (input.IsPixelSigned().has_value()) ret.setSignedOutput(input.IsPixelSigned().value()); if (input.GetJungfrauConvFactor_keV().has_value()) @@ -542,6 +551,7 @@ std::vector Convert(const s org::openapitools::server::model::Fpga_status_inner tmp; tmp.setPciDevId(d.device_number); tmp.setSerialNumber(d.serial_number); + tmp.setFwVersion(d.fpga_firmware_version); tmp.setBaseMacAddr(MacAddressToStr(d.fpga_default_mac_addr)); tmp.setPacketsSls(d.packets_sls); tmp.setPacketsUdp(d.packets_udp); @@ -563,6 +573,7 @@ ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_previe ret.period = std::chrono::milliseconds(input.getPeriodMs()); else ret.period = {}; + ret.send_start_message = input.isSendStartMessage(); ret.address = ""; return ret; } @@ -573,5 +584,14 @@ org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPrevi if (settings.period.has_value()) ret.setPeriodMs(settings.period.value().count() / 1000); ret.setSocketAddress(settings.address); + ret.setSendStartMessage(settings.send_start_message); + return ret; +} + +org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input) { + org::openapitools::server::model::Pixel_mask_statistics ret; + ret.setUserMask(input.user_mask); + ret.setWrongGain(input.wrong_gain); + ret.setTooHighPedestalRms(input.too_high_pedestal_rms); return ret; } diff --git a/broker/OpenAPIConvert.h b/broker/OpenAPIConvert.h index 630ac7fb..2643dc53 100644 --- a/broker/OpenAPIConvert.h +++ b/broker/OpenAPIConvert.h @@ -20,6 +20,7 @@ #include "gen/model/Preview_settings.h" #include "gen/model/Dataset_settings.h" #include "gen/model/Fpga_status_inner.h" +#include "gen/model/Pixel_mask_statistics.h" #include "../common/DatasetSettings.h" #include "../common/ImageFormatSettings.h" @@ -57,6 +58,7 @@ ImageFormatSettings Convert(const org::openapitools::server::model::Image_format org::openapitools::server::model::Image_format_settings Convert(const ImageFormatSettings& input); DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input); std::vector Convert(const std::vector &input); +org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input); org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPreviewSettings& settings); ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_preview_settings& input); diff --git a/broker/README.md b/broker/README.md deleted file mode 100644 index 63fead50..00000000 --- a/broker/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Jungfraujoch service (jfjoch_broker) - -'jfjoch_broker' is the main service for the Jungfraujoch application. It is responsible for: - -* Providing user interface via HTTP and OpenAPI -* Configuring FPGA firmware -* Building images from FPGA output and forwarding the results over ZeroMQ - -## External interfaces -Broker operates three external interfaces. - -**Data interface** ZeroMQ PULL socket with CBOR serialization is used to send images, metadata and processing results for writing or downstream -processing. See [here](../frame_serialize/README.md) for description of the format. - -**Preview interface** as above, but limited to subset of frames (1 image/s by default). - -**Configuration, status and results** HTTP/REST interface described in the OpenAPI format. -Description of the API is presented in the `redoc-static.html` file. -Due to limitations of GitLab/GitHub the file cannot be viewed directly from the repository, but needs to be downloaded. -## Broker configuration -'jfjoch_broker' requires JSON configuration files. The file is described by OpenAPI structure `jfjoch_settings` defined in [jfjoch_api.yaml](jfjoch_api.yaml) file. -It is recommended to go through example files in the [etc/](../etc/). - -## Setting up a local test for Jungfraujoch -For development, it is possible to setup a local installation of Jungfraujoch. -This will work without FPGA installed in the computer and allows to test Jungfraujoch software layer, including -ZeroMQ streaming and file writing. - -The workflow simulates FPGA behavior, by running high-level synthesis code on the CPU - the performance is therefore -very low, as fixed-point calculations have large performance penalty on CPU. In the CPU simulation mode, one can simulate -using only a single FPGA device. - -To run the test: - -### Compile Jungfraujoch with frontend -``` -mkdir build -cd build -cmake .. -make jfjoch -make frontend -``` -### Start services -Start broker: -``` -cd build/broker -./jfjoch_broker ../../etc/broker_local.json 5232 -``` - -Start writer: -``` -cd build/writer -./jfjoch_writer tcp://127.0.0.1:5500 -``` - -### Run tests -To run test a Python script is provided: -``` -cd tests/test_data -python jfjoch_broker_test.py -``` -The script will initialize Jungfraujoch, import test image and start data collection. - -### Expected result -You can observe online data analysis by opening the following web page: [http://localhost:5232](http://localhost:5232). -Also in the `build/writer` subdirectory a dataset with images should be written. diff --git a/broker/gen/api/ApiBase.h b/broker/gen/api/ApiBase.h index dbcfc721..1d781e3c 100644 --- a/broker/gen/api/ApiBase.h +++ b/broker/gen/api/ApiBase.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp index 15b48af1..977ffc44 100644 --- a/broker/gen/api/DefaultApi.cpp +++ b/broker/gen/api/DefaultApi.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -46,11 +46,14 @@ void DefaultApi::setupRoutes() { Routes::Put(*router, base + "/config/instrument", Routes::bind(&DefaultApi::config_instrument_put_handler, this)); Routes::Put(*router, base + "/config/internal_generator_image", Routes::bind(&DefaultApi::config_internal_generator_image_put_handler, this)); Routes::Put(*router, base + "/config/internal_generator_image.tiff", Routes::bind(&DefaultApi::config_internal_generator_image_tiff_put_handler, this)); + Routes::Get(*router, base + "/config/mask", Routes::bind(&DefaultApi::config_mask_get_handler, this)); Routes::Get(*router, base + "/config/mask.tiff", Routes::bind(&DefaultApi::config_mask_tiff_get_handler, this)); Routes::Get(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_get_handler, this)); Routes::Put(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_put_handler, this)); Routes::Get(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_get_handler, this)); Routes::Put(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_put_handler, this)); + Routes::Get(*router, base + "/config/user_mask", Routes::bind(&DefaultApi::config_user_mask_get_handler, this)); + Routes::Put(*router, base + "/config/user_mask", Routes::bind(&DefaultApi::config_user_mask_put_handler, this)); Routes::Get(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_get_handler, this)); Routes::Put(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_put_handler, this)); Routes::Get(*router, base + "/config/zeromq_preview", Routes::bind(&DefaultApi::config_zeromq_preview_get_handler, this)); @@ -418,6 +421,25 @@ void DefaultApi::config_internal_generator_image_tiff_put_handler(const Pistache response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } +} +void DefaultApi::config_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->config_mask_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + } void DefaultApi::config_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { try { @@ -537,6 +559,43 @@ void DefaultApi::config_spot_finding_put_handler(const Pistache::Rest::Request & response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } +} +void DefaultApi::config_user_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->config_user_mask_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void DefaultApi::config_user_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->config_user_mask_put(request, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + } void DefaultApi::config_user_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { try { diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h index b1c81eac..03fc2a19 100644 --- a/broker/gen/api/DefaultApi.h +++ b/broker/gen/api/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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -78,11 +78,14 @@ private: void config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void config_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_select_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void config_user_mask_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void config_user_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_user_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_zeromq_preview_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); @@ -249,7 +252,14 @@ private: /// virtual void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0; /// - /// Get mask of the detector + /// Get mask of the detector (binary) + /// + /// + /// Get full pixel mask of the detector See NXmx standard for meaning of pixel values + /// + virtual void config_mask_get(Pistache::Http::ResponseWriter &response) = 0; + /// + /// Get mask of the detector (TIFF) /// /// /// Get full pixel mask of the detector See NXmx standard for meaning of pixel values @@ -286,7 +296,21 @@ private: /// (optional) virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0; /// - /// Get user mask of the detector + /// Get user mask of the detector (binary) + /// + /// + /// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked + /// + virtual void config_user_mask_get(Pistache::Http::ResponseWriter &response) = 0; + /// + /// Upload user mask of the detector (binary) + /// + /// + /// 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. + /// + virtual void config_user_mask_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Get user mask of the detector (TIFF) /// /// /// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked @@ -486,7 +510,7 @@ private: /// virtual void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) = 0; /// - /// Get pedestal G0 in TIFF format + /// Get pedestal in TIFF format /// /// /// @@ -579,7 +603,7 @@ private: /// Wait for acquisition done /// /// - /// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection. + /// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection. /// /// Timeout in seconds (0 == immediate response) (optional, default to 60) virtual void wait_till_done_post(const std::optional &timeout, Pistache::Http::ResponseWriter &response) = 0; diff --git a/broker/gen/model/Azim_int_settings.cpp b/broker/gen/model/Azim_int_settings.cpp index 1b14e1af..b69caa7c 100644 --- a/broker/gen/model/Azim_int_settings.cpp +++ b/broker/gen/model/Azim_int_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Azim_int_settings.h b/broker/gen/model/Azim_int_settings.h index 42c8fa85..7bf93338 100644 --- a/broker/gen/model/Azim_int_settings.h +++ b/broker/gen/model/Azim_int_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Broker_status.cpp b/broker/gen/model/Broker_status.cpp index 1b25c957..c61fc9f9 100644 --- a/broker/gen/model/Broker_status.cpp +++ b/broker/gen/model/Broker_status.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Broker_status.h b/broker/gen/model/Broker_status.h index 1e1f7d24..f80a6548 100644 --- a/broker/gen/model/Broker_status.h +++ b/broker/gen/model/Broker_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Calibration_statistics_inner.cpp b/broker/gen/model/Calibration_statistics_inner.cpp index 0cdadd51..837ce346 100644 --- a/broker/gen/model/Calibration_statistics_inner.cpp +++ b/broker/gen/model/Calibration_statistics_inner.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Calibration_statistics_inner.h b/broker/gen/model/Calibration_statistics_inner.h index 1579976a..294069a3 100644 --- a/broker/gen/model/Calibration_statistics_inner.h +++ b/broker/gen/model/Calibration_statistics_inner.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings.cpp b/broker/gen/model/Dataset_settings.cpp index d4b9483f..c6dfc024 100644 --- a/broker/gen/model/Dataset_settings.cpp +++ b/broker/gen/model/Dataset_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index 36cd1255..248fa1b0 100644 --- a/broker/gen/model/Dataset_settings.h +++ b/broker/gen/model/Dataset_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -117,7 +117,7 @@ public: bool imagesPerFileIsSet() const; void unsetImages_per_file(); /// - /// + /// Number of space group for the crystal. Currently used solely as metadata, not relevant for image processing done in Jungfraujoch. /// int64_t getSpaceGroupNumber() const; void setSpaceGroupNumber(int64_t const value); @@ -131,7 +131,7 @@ public: bool sampleNameIsSet() const; void unsetSample_name(); /// - /// + /// Compression type for the images transferred over ZeroMQ and saved to HDF5 file. /// std::string getCompression() const; void setCompression(std::string const& value); @@ -159,14 +159,14 @@ public: bool goniometerIsSet() const; void unsetGoniometer(); /// - /// Header appendix, added as user_data/user to start message (can be any valid JSON) + /// Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) In general, it is not saved in HDF5 file. However, if values are placed in \"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. /// nlohmann::json getHeaderAppendix() const; void setHeaderAppendix(nlohmann::json const& value); bool headerAppendixIsSet() const; void unsetHeader_appendix(); /// - /// Image appendix, added as user_data to image message (can be any valid JSON) + /// Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON) Not saved in HDF5 file /// nlohmann::json getImageAppendix() const; void setImageAppendix(nlohmann::json const& value); diff --git a/broker/gen/model/Dataset_settings_unit_cell.cpp b/broker/gen/model/Dataset_settings_unit_cell.cpp index 1d736098..38d14678 100644 --- a/broker/gen/model/Dataset_settings_unit_cell.cpp +++ b/broker/gen/model/Dataset_settings_unit_cell.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings_unit_cell.h b/broker/gen/model/Dataset_settings_unit_cell.h index 0205da82..303b67d4 100644 --- a/broker/gen/model/Dataset_settings_unit_cell.h +++ b/broker/gen/model/Dataset_settings_unit_cell.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -12,7 +12,7 @@ /* * Dataset_settings_unit_cell.h * - * Units of angstrom and degree + * Unit cell parameters. Necessary to run indexing. Units of angstrom and degree */ #ifndef Dataset_settings_unit_cell_H_ @@ -25,7 +25,7 @@ namespace org::openapitools::server::model { /// -/// Units of angstrom and degree +/// Unit cell parameters. Necessary to run indexing. Units of angstrom and degree /// class Dataset_settings_unit_cell { diff --git a/broker/gen/model/Detector.cpp b/broker/gen/model/Detector.cpp index 3931656d..05c8435d 100644 --- a/broker/gen/model/Detector.cpp +++ b/broker/gen/model/Detector.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector.h b/broker/gen/model/Detector.h index d8189ecd..1b999064 100644 --- a/broker/gen/model/Detector.h +++ b/broker/gen/model/Detector.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list.cpp b/broker/gen/model/Detector_list.cpp index 9eb867c3..eaf9507b 100644 --- a/broker/gen/model/Detector_list.cpp +++ b/broker/gen/model/Detector_list.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list.h b/broker/gen/model/Detector_list.h index ee0ebe62..5c86cf2b 100644 --- a/broker/gen/model/Detector_list.h +++ b/broker/gen/model/Detector_list.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list_detectors_inner.cpp b/broker/gen/model/Detector_list_detectors_inner.cpp index 8db6fbd0..bb3f24a7 100644 --- a/broker/gen/model/Detector_list_detectors_inner.cpp +++ b/broker/gen/model/Detector_list_detectors_inner.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list_detectors_inner.h b/broker/gen/model/Detector_list_detectors_inner.h index 172031b2..2ca5ff00 100644 --- a/broker/gen/model/Detector_list_detectors_inner.h +++ b/broker/gen/model/Detector_list_detectors_inner.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module.cpp b/broker/gen/model/Detector_module.cpp index b53f514b..ef2aad35 100644 --- a/broker/gen/model/Detector_module.cpp +++ b/broker/gen/model/Detector_module.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module.h b/broker/gen/model/Detector_module.h index 84952476..e2b6206f 100644 --- a/broker/gen/model/Detector_module.h +++ b/broker/gen/model/Detector_module.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module_direction.cpp b/broker/gen/model/Detector_module_direction.cpp index 2133d0f9..25338a25 100644 --- a/broker/gen/model/Detector_module_direction.cpp +++ b/broker/gen/model/Detector_module_direction.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module_direction.h b/broker/gen/model/Detector_module_direction.h index a3ee9864..e44c7218 100644 --- a/broker/gen/model/Detector_module_direction.h +++ b/broker/gen/model/Detector_module_direction.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_power_state.cpp b/broker/gen/model/Detector_power_state.cpp index 0e4fd528..a8e0aa29 100644 --- a/broker/gen/model/Detector_power_state.cpp +++ b/broker/gen/model/Detector_power_state.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_power_state.h b/broker/gen/model/Detector_power_state.h index fb540366..abe04746 100644 --- a/broker/gen/model/Detector_power_state.h +++ b/broker/gen/model/Detector_power_state.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_selection.cpp b/broker/gen/model/Detector_selection.cpp index a5aa2db8..c957ae61 100644 --- a/broker/gen/model/Detector_selection.cpp +++ b/broker/gen/model/Detector_selection.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_selection.h b/broker/gen/model/Detector_selection.h index af02d367..c29a6c94 100644 --- a/broker/gen/model/Detector_selection.h +++ b/broker/gen/model/Detector_selection.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_settings.cpp b/broker/gen/model/Detector_settings.cpp index b375cccf..312eb681 100644 --- a/broker/gen/model/Detector_settings.cpp +++ b/broker/gen/model/Detector_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -33,14 +33,14 @@ Detector_settings::Detector_settings() m_TimingIsSet = false; m_Eiger_threshold_keV = 0.0f; m_Eiger_threshold_keVIsSet = false; + m_Eiger_bit_depth = 0L; + m_Eiger_bit_depthIsSet = false; m_Jungfrau_pedestal_g0_frames = 2000L; m_Jungfrau_pedestal_g0_framesIsSet = false; m_Jungfrau_pedestal_g1_frames = 300L; m_Jungfrau_pedestal_g1_framesIsSet = false; m_Jungfrau_pedestal_g2_frames = 300L; m_Jungfrau_pedestal_g2_framesIsSet = false; - m_Jungfrau_pedestal_g0_rms_limit = 100L; - m_Jungfrau_pedestal_g0_rms_limitIsSet = false; m_Jungfrau_pedestal_min_image_count = 128L; m_Jungfrau_pedestal_min_image_countIsSet = false; m_Jungfrau_storage_cell_count = 1L; @@ -99,10 +99,10 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path success = false; msg << currentValuePath << ": must be greater than or equal to 1;"; } - if (value > 128ll) + if (value > 64ll) { success = false; - msg << currentValuePath << ": must be less than or equal to 128;"; + msg << currentValuePath << ": must be less than or equal to 64;"; } } @@ -139,7 +139,7 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path } } - + if (jungfrauPedestalG0FramesIsSet()) { const int64_t& value = m_Jungfrau_pedestal_g0_frames; @@ -182,20 +182,6 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path } - if (jungfrauPedestalG0RmsLimitIsSet()) - { - const int64_t& value = m_Jungfrau_pedestal_g0_rms_limit; - const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalG0RmsLimit"; - - - if (value < 0ll) - { - success = false; - msg << currentValuePath << ": must be greater than or equal to 0;"; - } - - } - if (jungfrauPedestalMinImageCountIsSet()) { const int64_t& value = m_Jungfrau_pedestal_min_image_count; @@ -273,6 +259,9 @@ bool Detector_settings::operator==(const Detector_settings& rhs) const ((!eigerThresholdKeVIsSet() && !rhs.eigerThresholdKeVIsSet()) || (eigerThresholdKeVIsSet() && rhs.eigerThresholdKeVIsSet() && getEigerThresholdKeV() == rhs.getEigerThresholdKeV())) && + ((!eigerBitDepthIsSet() && !rhs.eigerBitDepthIsSet()) || (eigerBitDepthIsSet() && rhs.eigerBitDepthIsSet() && getEigerBitDepth() == rhs.getEigerBitDepth())) && + + ((!jungfrauPedestalG0FramesIsSet() && !rhs.jungfrauPedestalG0FramesIsSet()) || (jungfrauPedestalG0FramesIsSet() && rhs.jungfrauPedestalG0FramesIsSet() && getJungfrauPedestalG0Frames() == rhs.getJungfrauPedestalG0Frames())) && @@ -282,9 +271,6 @@ bool Detector_settings::operator==(const Detector_settings& rhs) const ((!jungfrauPedestalG2FramesIsSet() && !rhs.jungfrauPedestalG2FramesIsSet()) || (jungfrauPedestalG2FramesIsSet() && rhs.jungfrauPedestalG2FramesIsSet() && getJungfrauPedestalG2Frames() == rhs.getJungfrauPedestalG2Frames())) && - ((!jungfrauPedestalG0RmsLimitIsSet() && !rhs.jungfrauPedestalG0RmsLimitIsSet()) || (jungfrauPedestalG0RmsLimitIsSet() && rhs.jungfrauPedestalG0RmsLimitIsSet() && getJungfrauPedestalG0RmsLimit() == rhs.getJungfrauPedestalG0RmsLimit())) && - - ((!jungfrauPedestalMinImageCountIsSet() && !rhs.jungfrauPedestalMinImageCountIsSet()) || (jungfrauPedestalMinImageCountIsSet() && rhs.jungfrauPedestalMinImageCountIsSet() && getJungfrauPedestalMinImageCount() == rhs.getJungfrauPedestalMinImageCount())) && @@ -323,14 +309,14 @@ void to_json(nlohmann::json& j, const Detector_settings& o) j["timing"] = o.m_Timing; if(o.eigerThresholdKeVIsSet()) j["eiger_threshold_keV"] = o.m_Eiger_threshold_keV; + if(o.eigerBitDepthIsSet()) + j["eiger_bit_depth"] = o.m_Eiger_bit_depth; if(o.jungfrauPedestalG0FramesIsSet()) j["jungfrau_pedestal_g0_frames"] = o.m_Jungfrau_pedestal_g0_frames; if(o.jungfrauPedestalG1FramesIsSet()) j["jungfrau_pedestal_g1_frames"] = o.m_Jungfrau_pedestal_g1_frames; if(o.jungfrauPedestalG2FramesIsSet()) j["jungfrau_pedestal_g2_frames"] = o.m_Jungfrau_pedestal_g2_frames; - if(o.jungfrauPedestalG0RmsLimitIsSet()) - j["jungfrau_pedestal_g0_rms_limit"] = o.m_Jungfrau_pedestal_g0_rms_limit; if(o.jungfrauPedestalMinImageCountIsSet()) j["jungfrau_pedestal_min_image_count"] = o.m_Jungfrau_pedestal_min_image_count; if(o.jungfrauStorageCellCountIsSet()) @@ -377,6 +363,11 @@ void from_json(const nlohmann::json& j, Detector_settings& o) j.at("eiger_threshold_keV").get_to(o.m_Eiger_threshold_keV); o.m_Eiger_threshold_keVIsSet = true; } + if(j.find("eiger_bit_depth") != j.end()) + { + j.at("eiger_bit_depth").get_to(o.m_Eiger_bit_depth); + o.m_Eiger_bit_depthIsSet = true; + } if(j.find("jungfrau_pedestal_g0_frames") != j.end()) { j.at("jungfrau_pedestal_g0_frames").get_to(o.m_Jungfrau_pedestal_g0_frames); @@ -392,11 +383,6 @@ void from_json(const nlohmann::json& j, Detector_settings& o) j.at("jungfrau_pedestal_g2_frames").get_to(o.m_Jungfrau_pedestal_g2_frames); o.m_Jungfrau_pedestal_g2_framesIsSet = true; } - if(j.find("jungfrau_pedestal_g0_rms_limit") != j.end()) - { - j.at("jungfrau_pedestal_g0_rms_limit").get_to(o.m_Jungfrau_pedestal_g0_rms_limit); - o.m_Jungfrau_pedestal_g0_rms_limitIsSet = true; - } if(j.find("jungfrau_pedestal_min_image_count") != j.end()) { j.at("jungfrau_pedestal_min_image_count").get_to(o.m_Jungfrau_pedestal_min_image_count); @@ -535,6 +521,23 @@ void Detector_settings::unsetEiger_threshold_keV() { m_Eiger_threshold_keVIsSet = false; } +int64_t Detector_settings::getEigerBitDepth() const +{ + return m_Eiger_bit_depth; +} +void Detector_settings::setEigerBitDepth(int64_t const value) +{ + m_Eiger_bit_depth = value; + m_Eiger_bit_depthIsSet = true; +} +bool Detector_settings::eigerBitDepthIsSet() const +{ + return m_Eiger_bit_depthIsSet; +} +void Detector_settings::unsetEiger_bit_depth() +{ + m_Eiger_bit_depthIsSet = false; +} int64_t Detector_settings::getJungfrauPedestalG0Frames() const { return m_Jungfrau_pedestal_g0_frames; @@ -586,23 +589,6 @@ void Detector_settings::unsetJungfrau_pedestal_g2_frames() { m_Jungfrau_pedestal_g2_framesIsSet = false; } -int64_t Detector_settings::getJungfrauPedestalG0RmsLimit() const -{ - return m_Jungfrau_pedestal_g0_rms_limit; -} -void Detector_settings::setJungfrauPedestalG0RmsLimit(int64_t const value) -{ - m_Jungfrau_pedestal_g0_rms_limit = value; - m_Jungfrau_pedestal_g0_rms_limitIsSet = true; -} -bool Detector_settings::jungfrauPedestalG0RmsLimitIsSet() const -{ - return m_Jungfrau_pedestal_g0_rms_limitIsSet; -} -void Detector_settings::unsetJungfrau_pedestal_g0_rms_limit() -{ - m_Jungfrau_pedestal_g0_rms_limitIsSet = false; -} int64_t Detector_settings::getJungfrauPedestalMinImageCount() const { return m_Jungfrau_pedestal_min_image_count; diff --git a/broker/gen/model/Detector_settings.h b/broker/gen/model/Detector_settings.h index e8fba837..3f91e8a7 100644 --- a/broker/gen/model/Detector_settings.h +++ b/broker/gen/model/Detector_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -59,12 +59,12 @@ public: /// Detector_settings members /// - /// Interval between consecutive frames. + /// Interval between consecutive frames. This is internal frame time for the JUNGFRAU detector, image time has to be integer multiply of this number. For EIGER detector this is default frame time, not used otherwise /// int64_t getFrameTimeUs() const; void setFrameTimeUs(int64_t const value); /// - /// Integration time of the detector. If not provided count time will be set to maximum value for a given frame time. + /// Integration time of the detector. If not provided count time will be set to maximum value for a given frame time. /// int64_t getCountTimeUs() const; void setCountTimeUs(int64_t const value); @@ -78,7 +78,7 @@ public: bool internalFrameGeneratorIsSet() const; void unsetInternal_frame_generator(); /// - /// + /// Number of images stored in the internal frame generator. /// int64_t getInternalFrameGeneratorImages() const; void setInternalFrameGeneratorImages(int64_t const value); @@ -99,13 +99,20 @@ public: bool timingIsSet() const; void unsetTiming(); /// - /// + /// 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. /// float getEigerThresholdKeV() const; void setEigerThresholdKeV(float const value); bool eigerThresholdKeVIsSet() const; void unsetEiger_threshold_keV(); /// + /// Bit depth of EIGER read-out. If value is not provided bit depth is adjusted automatically based on the image time. + /// + int64_t getEigerBitDepth() const; + void setEigerBitDepth(int64_t const value); + bool eigerBitDepthIsSet() const; + void unsetEiger_bit_depth(); + /// /// /// int64_t getJungfrauPedestalG0Frames() const; @@ -127,13 +134,6 @@ public: bool jungfrauPedestalG2FramesIsSet() const; void unsetJungfrau_pedestal_g2_frames(); /// - /// Pixels with pedestal G0 RMS above the threshold are marked as masked pixels - /// - int64_t getJungfrauPedestalG0RmsLimit() const; - void setJungfrauPedestalG0RmsLimit(int64_t const value); - bool jungfrauPedestalG0RmsLimitIsSet() const; - void unsetJungfrau_pedestal_g0_rms_limit(); - /// /// Minimum number of collected images for pedestal to consider it viable /// int64_t getJungfrauPedestalMinImageCount() const; @@ -186,14 +186,14 @@ protected: bool m_TimingIsSet; float m_Eiger_threshold_keV; bool m_Eiger_threshold_keVIsSet; + int64_t m_Eiger_bit_depth; + bool m_Eiger_bit_depthIsSet; int64_t m_Jungfrau_pedestal_g0_frames; bool m_Jungfrau_pedestal_g0_framesIsSet; int64_t m_Jungfrau_pedestal_g1_frames; bool m_Jungfrau_pedestal_g1_framesIsSet; int64_t m_Jungfrau_pedestal_g2_frames; bool m_Jungfrau_pedestal_g2_framesIsSet; - int64_t m_Jungfrau_pedestal_g0_rms_limit; - bool m_Jungfrau_pedestal_g0_rms_limitIsSet; int64_t m_Jungfrau_pedestal_min_image_count; bool m_Jungfrau_pedestal_min_image_countIsSet; int64_t m_Jungfrau_storage_cell_count; diff --git a/broker/gen/model/Detector_state.cpp b/broker/gen/model/Detector_state.cpp index 1d068909..8ad07cbe 100644 --- a/broker/gen/model/Detector_state.cpp +++ b/broker/gen/model/Detector_state.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_state.h b/broker/gen/model/Detector_state.h index 1c4a2847..443a053e 100644 --- a/broker/gen/model/Detector_state.h +++ b/broker/gen/model/Detector_state.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_status.cpp b/broker/gen/model/Detector_status.cpp index 359575a1..c7939a85 100644 --- a/broker/gen/model/Detector_status.cpp +++ b/broker/gen/model/Detector_status.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_status.h b/broker/gen/model/Detector_status.h index 15d0c3a9..bf644ed9 100644 --- a/broker/gen/model/Detector_status.h +++ b/broker/gen/model/Detector_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_timing.cpp b/broker/gen/model/Detector_timing.cpp index 0141938b..f1b5fd9a 100644 --- a/broker/gen/model/Detector_timing.cpp +++ b/broker/gen/model/Detector_timing.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_timing.h b/broker/gen/model/Detector_timing.h index 7261427b..0180da5b 100644 --- a/broker/gen/model/Detector_timing.h +++ b/broker/gen/model/Detector_timing.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_type.cpp b/broker/gen/model/Detector_type.cpp index 6930c345..fa8eddce 100644 --- a/broker/gen/model/Detector_type.cpp +++ b/broker/gen/model/Detector_type.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_type.h b/broker/gen/model/Detector_type.h index 7d2fb091..2e434102 100644 --- a/broker/gen/model/Detector_type.h +++ b/broker/gen/model/Detector_type.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Error_message.cpp b/broker/gen/model/Error_message.cpp index 564ad3ff..f9ba951d 100644 --- a/broker/gen/model/Error_message.cpp +++ b/broker/gen/model/Error_message.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Error_message.h b/broker/gen/model/Error_message.h index 06b5b240..b53d30f6 100644 --- a/broker/gen/model/Error_message.h +++ b/broker/gen/model/Error_message.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Fpga_status_inner.cpp b/broker/gen/model/Fpga_status_inner.cpp index 569dd4b8..f3579d52 100644 --- a/broker/gen/model/Fpga_status_inner.cpp +++ b/broker/gen/model/Fpga_status_inner.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,6 +23,7 @@ Fpga_status_inner::Fpga_status_inner() { m_Pci_dev_id = ""; m_Serial_number = ""; + m_Fw_version = ""; m_Base_mac_addr = ""; m_Eth_link_count = 0L; m_Eth_link_status = 0L; @@ -54,7 +55,7 @@ bool Fpga_status_inner::validate(std::stringstream& msg, const std::string& path bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "Fpga_status_inner" : pathPrefix; - + return success; } @@ -69,6 +70,9 @@ bool Fpga_status_inner::operator==(const Fpga_status_inner& rhs) const (getSerialNumber() == rhs.getSerialNumber()) && + (getFwVersion() == rhs.getFwVersion()) + && + (getBaseMacAddr() == rhs.getBaseMacAddr()) && @@ -109,6 +113,7 @@ void to_json(nlohmann::json& j, const Fpga_status_inner& o) j = nlohmann::json::object(); j["pci_dev_id"] = o.m_Pci_dev_id; j["serial_number"] = o.m_Serial_number; + j["fw_version"] = o.m_Fw_version; j["base_mac_addr"] = o.m_Base_mac_addr; j["eth_link_count"] = o.m_Eth_link_count; j["eth_link_status"] = o.m_Eth_link_status; @@ -125,6 +130,7 @@ void from_json(const nlohmann::json& j, Fpga_status_inner& o) { j.at("pci_dev_id").get_to(o.m_Pci_dev_id); j.at("serial_number").get_to(o.m_Serial_number); + j.at("fw_version").get_to(o.m_Fw_version); j.at("base_mac_addr").get_to(o.m_Base_mac_addr); j.at("eth_link_count").get_to(o.m_Eth_link_count); j.at("eth_link_status").get_to(o.m_Eth_link_status); @@ -153,6 +159,14 @@ void Fpga_status_inner::setSerialNumber(std::string const& value) { m_Serial_number = value; } +std::string Fpga_status_inner::getFwVersion() const +{ + return m_Fw_version; +} +void Fpga_status_inner::setFwVersion(std::string const& value) +{ + m_Fw_version = value; +} std::string Fpga_status_inner::getBaseMacAddr() const { return m_Base_mac_addr; diff --git a/broker/gen/model/Fpga_status_inner.h b/broker/gen/model/Fpga_status_inner.h index 82c06f66..51e335fb 100644 --- a/broker/gen/model/Fpga_status_inner.h +++ b/broker/gen/model/Fpga_status_inner.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -71,6 +71,11 @@ public: /// /// /// + std::string getFwVersion() const; + void setFwVersion(std::string const& value); + /// + /// + /// std::string getBaseMacAddr() const; void setBaseMacAddr(std::string const& value); /// @@ -121,6 +126,8 @@ protected: std::string m_Serial_number; + std::string m_Fw_version; + std::string m_Base_mac_addr; int64_t m_Eth_link_count; diff --git a/broker/gen/model/Helpers.cpp b/broker/gen/model/Helpers.cpp index 06380a9e..d77ab413 100644 --- a/broker/gen/model/Helpers.cpp +++ b/broker/gen/model/Helpers.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Helpers.h b/broker/gen/model/Helpers.h index a3eec293..3b135feb 100644 --- a/broker/gen/model/Helpers.h +++ b/broker/gen/model/Helpers.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_format_settings.cpp b/broker/gen/model/Image_format_settings.cpp index e8fa5a0c..4419db4f 100644 --- a/broker/gen/model/Image_format_settings.cpp +++ b/broker/gen/model/Image_format_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,6 +32,11 @@ Image_format_settings::Image_format_settings() m_Signed_outputIsSet = false; m_Mask_module_edges = true; m_Mask_chip_edges = true; + m_Jungfrau_mask_pixels_without_g0 = true; + m_Jungfrau_mask_pixels_without_g0IsSet = false; + m_Apply_mask = false; + m_Jungfrau_pedestal_g0_rms_limit = 100L; + m_Jungfrau_pedestal_g0_rms_limitIsSet = false; } @@ -73,7 +78,21 @@ bool Image_format_settings::validate(std::stringstream& msg, const std::string& } } - + + if (jungfrauPedestalG0RmsLimitIsSet()) + { + const int64_t& value = m_Jungfrau_pedestal_g0_rms_limit; + const std::string currentValuePath = _pathPrefix + ".jungfrauPedestalG0RmsLimit"; + + + if (value < 0ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + + } + return success; } @@ -104,8 +123,17 @@ bool Image_format_settings::operator==(const Image_format_settings& rhs) const && (isMaskChipEdges() == rhs.isMaskChipEdges()) + && + ((!jungfrauMaskPixelsWithoutG0IsSet() && !rhs.jungfrauMaskPixelsWithoutG0IsSet()) || (jungfrauMaskPixelsWithoutG0IsSet() && rhs.jungfrauMaskPixelsWithoutG0IsSet() && isJungfrauMaskPixelsWithoutG0() == rhs.isJungfrauMaskPixelsWithoutG0())) && + + (isApplyMask() == rhs.isApplyMask()) + && + + + ((!jungfrauPedestalG0RmsLimitIsSet() && !rhs.jungfrauPedestalG0RmsLimitIsSet()) || (jungfrauPedestalG0RmsLimitIsSet() && rhs.jungfrauPedestalG0RmsLimitIsSet() && getJungfrauPedestalG0RmsLimit() == rhs.getJungfrauPedestalG0RmsLimit())) + ; } @@ -128,6 +156,11 @@ void to_json(nlohmann::json& j, const Image_format_settings& o) j["signed_output"] = o.m_Signed_output; j["mask_module_edges"] = o.m_Mask_module_edges; j["mask_chip_edges"] = o.m_Mask_chip_edges; + if(o.jungfrauMaskPixelsWithoutG0IsSet()) + j["jungfrau_mask_pixels_without_g0"] = o.m_Jungfrau_mask_pixels_without_g0; + j["apply_mask"] = o.m_Apply_mask; + if(o.jungfrauPedestalG0RmsLimitIsSet()) + j["jungfrau_pedestal_g0_rms_limit"] = o.m_Jungfrau_pedestal_g0_rms_limit; } @@ -153,6 +186,17 @@ void from_json(const nlohmann::json& j, Image_format_settings& o) } j.at("mask_module_edges").get_to(o.m_Mask_module_edges); j.at("mask_chip_edges").get_to(o.m_Mask_chip_edges); + if(j.find("jungfrau_mask_pixels_without_g0") != j.end()) + { + j.at("jungfrau_mask_pixels_without_g0").get_to(o.m_Jungfrau_mask_pixels_without_g0); + o.m_Jungfrau_mask_pixels_without_g0IsSet = true; + } + j.at("apply_mask").get_to(o.m_Apply_mask); + if(j.find("jungfrau_pedestal_g0_rms_limit") != j.end()) + { + j.at("jungfrau_pedestal_g0_rms_limit").get_to(o.m_Jungfrau_pedestal_g0_rms_limit); + o.m_Jungfrau_pedestal_g0_rms_limitIsSet = true; + } } @@ -247,6 +291,48 @@ void Image_format_settings::setMaskChipEdges(bool const value) { m_Mask_chip_edges = value; } +bool Image_format_settings::isJungfrauMaskPixelsWithoutG0() const +{ + return m_Jungfrau_mask_pixels_without_g0; +} +void Image_format_settings::setJungfrauMaskPixelsWithoutG0(bool const value) +{ + m_Jungfrau_mask_pixels_without_g0 = value; + m_Jungfrau_mask_pixels_without_g0IsSet = true; +} +bool Image_format_settings::jungfrauMaskPixelsWithoutG0IsSet() const +{ + return m_Jungfrau_mask_pixels_without_g0IsSet; +} +void Image_format_settings::unsetJungfrau_mask_pixels_without_g0() +{ + m_Jungfrau_mask_pixels_without_g0IsSet = false; +} +bool Image_format_settings::isApplyMask() const +{ + return m_Apply_mask; +} +void Image_format_settings::setApplyMask(bool const value) +{ + m_Apply_mask = value; +} +int64_t Image_format_settings::getJungfrauPedestalG0RmsLimit() const +{ + return m_Jungfrau_pedestal_g0_rms_limit; +} +void Image_format_settings::setJungfrauPedestalG0RmsLimit(int64_t const value) +{ + m_Jungfrau_pedestal_g0_rms_limit = value; + m_Jungfrau_pedestal_g0_rms_limitIsSet = true; +} +bool Image_format_settings::jungfrauPedestalG0RmsLimitIsSet() const +{ + return m_Jungfrau_pedestal_g0_rms_limitIsSet; +} +void Image_format_settings::unsetJungfrau_pedestal_g0_rms_limit() +{ + m_Jungfrau_pedestal_g0_rms_limitIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Image_format_settings.h b/broker/gen/model/Image_format_settings.h index 1d6849b6..8b51d567 100644 --- a/broker/gen/model/Image_format_settings.h +++ b/broker/gen/model/Image_format_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -80,7 +80,7 @@ public: bool jungfrauConversionFactorKeVIsSet() const; void unsetJungfrau_conversion_factor_keV(); /// - /// Bit depth of resulting image (it doesn't affect the original detector value) If not provided value is adjusted automatically + /// Bit depth of resulting image (it doesn't affect the detector read-out value) If not provided value is adjusted automatically /// int64_t getBitDepthImage() const; void setBitDepthImage(int64_t const value); @@ -103,6 +103,25 @@ public: /// bool isMaskChipEdges() const; void setMaskChipEdges(bool const value); + /// + /// JUNGFRAU: mask pixels that don't operate in G0, but do operate in G1 and G1. This should be turned off for cases, where detector is operated at room temperature with long exposure time. + /// + bool isJungfrauMaskPixelsWithoutG0() const; + void setJungfrauMaskPixelsWithoutG0(bool const value); + bool jungfrauMaskPixelsWithoutG0IsSet() const; + void unsetJungfrau_mask_pixels_without_g0(); + /// + /// Masked pixels are set to special value in the images produced by Jungfraujoch + /// + bool isApplyMask() const; + void setApplyMask(bool const value); + /// + /// Pixels with pedestal G0 RMS above the threshold are marked as masked pixels + /// + int64_t getJungfrauPedestalG0RmsLimit() const; + void setJungfrauPedestalG0RmsLimit(int64_t const value); + bool jungfrauPedestalG0RmsLimitIsSet() const; + void unsetJungfrau_pedestal_g0_rms_limit(); friend void to_json(nlohmann::json& j, const Image_format_settings& o); friend void from_json(const nlohmann::json& j, Image_format_settings& o); @@ -123,6 +142,12 @@ protected: bool m_Mask_chip_edges; + bool m_Jungfrau_mask_pixels_without_g0; + bool m_Jungfrau_mask_pixels_without_g0IsSet; + bool m_Apply_mask; + + int64_t m_Jungfrau_pedestal_g0_rms_limit; + bool m_Jungfrau_pedestal_g0_rms_limitIsSet; }; diff --git a/broker/gen/model/Image_pusher_type.cpp b/broker/gen/model/Image_pusher_type.cpp index a0de57df..f95b765b 100644 --- a/broker/gen/model/Image_pusher_type.cpp +++ b/broker/gen/model/Image_pusher_type.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_pusher_type.h b/broker/gen/model/Image_pusher_type.h index dc23b4d3..d25d5ab4 100644 --- a/broker/gen/model/Image_pusher_type.h +++ b/broker/gen/model/Image_pusher_type.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Instrument_metadata.cpp b/broker/gen/model/Instrument_metadata.cpp index e1d82c19..9a2de81e 100644 --- a/broker/gen/model/Instrument_metadata.cpp +++ b/broker/gen/model/Instrument_metadata.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Instrument_metadata.h b/broker/gen/model/Instrument_metadata.h index c523e601..e0c8d8b2 100644 --- a/broker/gen/model/Instrument_metadata.h +++ b/broker/gen/model/Instrument_metadata.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Jfjoch_settings.cpp b/broker/gen/model/Jfjoch_settings.cpp index e6a90087..70182b02 100644 --- a/broker/gen/model/Jfjoch_settings.cpp +++ b/broker/gen/model/Jfjoch_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Jfjoch_settings.h b/broker/gen/model/Jfjoch_settings.h index 3421be63..9ce760a6 100644 --- a/broker/gen/model/Jfjoch_settings.h +++ b/broker/gen/model/Jfjoch_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Jfjoch_statistics.cpp b/broker/gen/model/Jfjoch_statistics.cpp index fb74231a..f5e40a3f 100644 --- a/broker/gen/model/Jfjoch_statistics.cpp +++ b/broker/gen/model/Jfjoch_statistics.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,6 +32,7 @@ Jfjoch_statistics::Jfjoch_statistics() m_FpgaIsSet = false; m_CalibrationIsSet = false; m_Zeromq_previewIsSet = false; + m_Pixel_maskIsSet = false; } @@ -96,7 +97,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path } } - + return success; } @@ -136,7 +137,10 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const ((!calibrationIsSet() && !rhs.calibrationIsSet()) || (calibrationIsSet() && rhs.calibrationIsSet() && getCalibration() == rhs.getCalibration())) && - ((!zeromqPreviewIsSet() && !rhs.zeromqPreviewIsSet()) || (zeromqPreviewIsSet() && rhs.zeromqPreviewIsSet() && getZeromqPreview() == rhs.getZeromqPreview())) + ((!zeromqPreviewIsSet() && !rhs.zeromqPreviewIsSet()) || (zeromqPreviewIsSet() && rhs.zeromqPreviewIsSet() && getZeromqPreview() == rhs.getZeromqPreview())) && + + + ((!pixelMaskIsSet() && !rhs.pixelMaskIsSet()) || (pixelMaskIsSet() && rhs.pixelMaskIsSet() && getPixelMask() == rhs.getPixelMask())) ; } @@ -171,6 +175,8 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o) j["calibration"] = o.m_Calibration; if(o.zeromqPreviewIsSet()) j["zeromq_preview"] = o.m_Zeromq_preview; + if(o.pixelMaskIsSet()) + j["pixel_mask"] = o.m_Pixel_mask; } @@ -231,6 +237,11 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o) j.at("zeromq_preview").get_to(o.m_Zeromq_preview); o.m_Zeromq_previewIsSet = true; } + if(j.find("pixel_mask") != j.end()) + { + j.at("pixel_mask").get_to(o.m_Pixel_mask); + o.m_Pixel_maskIsSet = true; + } } @@ -421,6 +432,23 @@ void Jfjoch_statistics::unsetZeromq_preview() { m_Zeromq_previewIsSet = false; } +org::openapitools::server::model::Pixel_mask_statistics Jfjoch_statistics::getPixelMask() const +{ + return m_Pixel_mask; +} +void Jfjoch_statistics::setPixelMask(org::openapitools::server::model::Pixel_mask_statistics const& value) +{ + m_Pixel_mask = value; + m_Pixel_maskIsSet = true; +} +bool Jfjoch_statistics::pixelMaskIsSet() const +{ + return m_Pixel_maskIsSet; +} +void Jfjoch_statistics::unsetPixel_mask() +{ + m_Pixel_maskIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Jfjoch_statistics.h b/broker/gen/model/Jfjoch_statistics.h index 66eba2fc..1086dd6b 100644 --- a/broker/gen/model/Jfjoch_statistics.h +++ b/broker/gen/model/Jfjoch_statistics.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,17 +20,18 @@ #include "Calibration_statistics_inner.h" -#include "Detector_status.h" #include "Broker_status.h" +#include "Pixel_mask_statistics.h" #include "Measurement_statistics.h" #include "Spot_finding_settings.h" #include "Zeromq_preview_settings.h" #include "Detector_list.h" -#include "Fpga_status_inner.h" #include "Image_format_settings.h" #include "Detector_settings.h" -#include "Instrument_metadata.h" #include +#include "Detector_status.h" +#include "Fpga_status_inner.h" +#include "Instrument_metadata.h" #include namespace org::openapitools::server::model @@ -146,6 +147,13 @@ public: void setZeromqPreview(org::openapitools::server::model::Zeromq_preview_settings const& value); bool zeromqPreviewIsSet() const; void unsetZeromq_preview(); + /// + /// + /// + org::openapitools::server::model::Pixel_mask_statistics getPixelMask() const; + void setPixelMask(org::openapitools::server::model::Pixel_mask_statistics const& value); + bool pixelMaskIsSet() const; + void unsetPixel_mask(); friend void to_json(nlohmann::json& j, const Jfjoch_statistics& o); friend void from_json(const nlohmann::json& j, Jfjoch_statistics& o); @@ -172,6 +180,8 @@ protected: bool m_CalibrationIsSet; org::openapitools::server::model::Zeromq_preview_settings m_Zeromq_preview; bool m_Zeromq_previewIsSet; + org::openapitools::server::model::Pixel_mask_statistics m_Pixel_mask; + bool m_Pixel_maskIsSet; }; diff --git a/broker/gen/model/Measurement_statistics.cpp b/broker/gen/model/Measurement_statistics.cpp index bdcf0950..55c93871 100644 --- a/broker/gen/model/Measurement_statistics.cpp +++ b/broker/gen/model/Measurement_statistics.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Measurement_statistics.h b/broker/gen/model/Measurement_statistics.h index 0520bab6..a3cd8014 100644 --- a/broker/gen/model/Measurement_statistics.h +++ b/broker/gen/model/Measurement_statistics.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pcie_devices_inner.cpp b/broker/gen/model/Pcie_devices_inner.cpp index daa4d3f7..33a09b5b 100644 --- a/broker/gen/model/Pcie_devices_inner.cpp +++ b/broker/gen/model/Pcie_devices_inner.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pcie_devices_inner.h b/broker/gen/model/Pcie_devices_inner.h index d755b083..47048860 100644 --- a/broker/gen/model/Pcie_devices_inner.h +++ b/broker/gen/model/Pcie_devices_inner.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pixel_mask_statistics.cpp b/broker/gen/model/Pixel_mask_statistics.cpp new file mode 100644 index 00000000..cec2daf4 --- /dev/null +++ b/broker/gen/model/Pixel_mask_statistics.cpp @@ -0,0 +1,206 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.24 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Pixel_mask_statistics.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Pixel_mask_statistics::Pixel_mask_statistics() +{ + m_User_mask = 0L; + m_User_maskIsSet = false; + m_Too_high_pedestal_rms = 0L; + m_Too_high_pedestal_rmsIsSet = false; + m_Wrong_gain = 0L; + m_Wrong_gainIsSet = false; + +} + +void Pixel_mask_statistics::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Pixel_mask_statistics::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Pixel_mask_statistics::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Pixel_mask_statistics" : pathPrefix; + + + if (userMaskIsSet()) + { + const int64_t& value = m_User_mask; + const std::string currentValuePath = _pathPrefix + ".userMask"; + + + if (value < 0ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + + } + + if (tooHighPedestalRmsIsSet()) + { + const int64_t& value = m_Too_high_pedestal_rms; + const std::string currentValuePath = _pathPrefix + ".tooHighPedestalRms"; + + + if (value < 0ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + + } + + if (wrongGainIsSet()) + { + const int64_t& value = m_Wrong_gain; + const std::string currentValuePath = _pathPrefix + ".wrongGain"; + + + if (value < 0ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0;"; + } + + } + + return success; +} + +bool Pixel_mask_statistics::operator==(const Pixel_mask_statistics& rhs) const +{ + return + + + + ((!userMaskIsSet() && !rhs.userMaskIsSet()) || (userMaskIsSet() && rhs.userMaskIsSet() && getUserMask() == rhs.getUserMask())) && + + + ((!tooHighPedestalRmsIsSet() && !rhs.tooHighPedestalRmsIsSet()) || (tooHighPedestalRmsIsSet() && rhs.tooHighPedestalRmsIsSet() && getTooHighPedestalRms() == rhs.getTooHighPedestalRms())) && + + + ((!wrongGainIsSet() && !rhs.wrongGainIsSet()) || (wrongGainIsSet() && rhs.wrongGainIsSet() && getWrongGain() == rhs.getWrongGain())) + + ; +} + +bool Pixel_mask_statistics::operator!=(const Pixel_mask_statistics& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Pixel_mask_statistics& o) +{ + j = nlohmann::json::object(); + if(o.userMaskIsSet()) + j["user_mask"] = o.m_User_mask; + if(o.tooHighPedestalRmsIsSet()) + j["too_high_pedestal_rms"] = o.m_Too_high_pedestal_rms; + if(o.wrongGainIsSet()) + j["wrong_gain"] = o.m_Wrong_gain; + +} + +void from_json(const nlohmann::json& j, Pixel_mask_statistics& o) +{ + if(j.find("user_mask") != j.end()) + { + j.at("user_mask").get_to(o.m_User_mask); + o.m_User_maskIsSet = true; + } + if(j.find("too_high_pedestal_rms") != j.end()) + { + j.at("too_high_pedestal_rms").get_to(o.m_Too_high_pedestal_rms); + o.m_Too_high_pedestal_rmsIsSet = true; + } + if(j.find("wrong_gain") != j.end()) + { + j.at("wrong_gain").get_to(o.m_Wrong_gain); + o.m_Wrong_gainIsSet = true; + } + +} + +int64_t Pixel_mask_statistics::getUserMask() const +{ + return m_User_mask; +} +void Pixel_mask_statistics::setUserMask(int64_t const value) +{ + m_User_mask = value; + m_User_maskIsSet = true; +} +bool Pixel_mask_statistics::userMaskIsSet() const +{ + return m_User_maskIsSet; +} +void Pixel_mask_statistics::unsetUser_mask() +{ + m_User_maskIsSet = false; +} +int64_t Pixel_mask_statistics::getTooHighPedestalRms() const +{ + return m_Too_high_pedestal_rms; +} +void Pixel_mask_statistics::setTooHighPedestalRms(int64_t const value) +{ + m_Too_high_pedestal_rms = value; + m_Too_high_pedestal_rmsIsSet = true; +} +bool Pixel_mask_statistics::tooHighPedestalRmsIsSet() const +{ + return m_Too_high_pedestal_rmsIsSet; +} +void Pixel_mask_statistics::unsetToo_high_pedestal_rms() +{ + m_Too_high_pedestal_rmsIsSet = false; +} +int64_t Pixel_mask_statistics::getWrongGain() const +{ + return m_Wrong_gain; +} +void Pixel_mask_statistics::setWrongGain(int64_t const value) +{ + m_Wrong_gain = value; + m_Wrong_gainIsSet = true; +} +bool Pixel_mask_statistics::wrongGainIsSet() const +{ + return m_Wrong_gainIsSet; +} +void Pixel_mask_statistics::unsetWrong_gain() +{ + m_Wrong_gainIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Pixel_mask_statistics.h b/broker/gen/model/Pixel_mask_statistics.h new file mode 100644 index 00000000..aa617f7a --- /dev/null +++ b/broker/gen/model/Pixel_mask_statistics.h @@ -0,0 +1,96 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.24 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Pixel_mask_statistics.h + * + * + */ + +#ifndef Pixel_mask_statistics_H_ +#define Pixel_mask_statistics_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class Pixel_mask_statistics +{ +public: + Pixel_mask_statistics(); + virtual ~Pixel_mask_statistics() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Pixel_mask_statistics& rhs) const; + bool operator!=(const Pixel_mask_statistics& rhs) const; + + ///////////////////////////////////////////// + /// Pixel_mask_statistics members + + /// + /// Number of pixels masked using the user mask + /// + int64_t getUserMask() const; + void setUserMask(int64_t const value); + bool userMaskIsSet() const; + void unsetUser_mask(); + /// + /// Number of pixels with G0 pedestal RMS higher than provided threshold + /// + int64_t getTooHighPedestalRms() const; + void setTooHighPedestalRms(int64_t const value); + bool tooHighPedestalRmsIsSet() const; + void unsetToo_high_pedestal_rms(); + /// + /// Number of pixels that show wrong gain level during the pedestal procedure + /// + int64_t getWrongGain() const; + void setWrongGain(int64_t const value); + bool wrongGainIsSet() const; + void unsetWrong_gain(); + + friend void to_json(nlohmann::json& j, const Pixel_mask_statistics& o); + friend void from_json(const nlohmann::json& j, Pixel_mask_statistics& o); +protected: + int64_t m_User_mask; + bool m_User_maskIsSet; + int64_t m_Too_high_pedestal_rms; + bool m_Too_high_pedestal_rmsIsSet; + int64_t m_Wrong_gain; + bool m_Wrong_gainIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Pixel_mask_statistics_H_ */ diff --git a/broker/gen/model/Plot.cpp b/broker/gen/model/Plot.cpp index b8ac69d1..6a9ac1f3 100644 --- a/broker/gen/model/Plot.cpp +++ b/broker/gen/model/Plot.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plot.h b/broker/gen/model/Plot.h index 7d49c9f3..14a8ce99 100644 --- a/broker/gen/model/Plot.h +++ b/broker/gen/model/Plot.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plots.cpp b/broker/gen/model/Plots.cpp index a810985b..3f1e74ac 100644 --- a/broker/gen/model/Plots.cpp +++ b/broker/gen/model/Plots.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plots.h b/broker/gen/model/Plots.h index 9bae9602..703568a7 100644 --- a/broker/gen/model/Plots.h +++ b/broker/gen/model/Plots.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Preview_settings.cpp b/broker/gen/model/Preview_settings.cpp index fecaa806..cac28fc8 100644 --- a/broker/gen/model/Preview_settings.cpp +++ b/broker/gen/model/Preview_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Preview_settings.h b/broker/gen/model/Preview_settings.h index 4b5f6374..b7617e2c 100644 --- a/broker/gen/model/Preview_settings.h +++ b/broker/gen/model/Preview_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box.cpp b/broker/gen/model/Roi_box.cpp index bbb886f5..a0c0afab 100644 --- a/broker/gen/model/Roi_box.cpp +++ b/broker/gen/model/Roi_box.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box.h b/broker/gen/model/Roi_box.h index c75ec77f..5e1f1788 100644 --- a/broker/gen/model/Roi_box.h +++ b/broker/gen/model/Roi_box.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box_list.cpp b/broker/gen/model/Roi_box_list.cpp index 6bf25824..6bf7d633 100644 --- a/broker/gen/model/Roi_box_list.cpp +++ b/broker/gen/model/Roi_box_list.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box_list.h b/broker/gen/model/Roi_box_list.h index 31ffdee3..de1c4290 100644 --- a/broker/gen/model/Roi_box_list.h +++ b/broker/gen/model/Roi_box_list.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle.cpp b/broker/gen/model/Roi_circle.cpp index e830cd3b..b6daf7fe 100644 --- a/broker/gen/model/Roi_circle.cpp +++ b/broker/gen/model/Roi_circle.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle.h b/broker/gen/model/Roi_circle.h index 9ef0cc05..1435a4b1 100644 --- a/broker/gen/model/Roi_circle.h +++ b/broker/gen/model/Roi_circle.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle_list.cpp b/broker/gen/model/Roi_circle_list.cpp index cb521fb0..188cd6f1 100644 --- a/broker/gen/model/Roi_circle_list.cpp +++ b/broker/gen/model/Roi_circle_list.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle_list.h b/broker/gen/model/Roi_circle_list.h index 6da4e3e9..2b41b8b3 100644 --- a/broker/gen/model/Roi_circle_list.h +++ b/broker/gen/model/Roi_circle_list.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Rotation_axis.cpp b/broker/gen/model/Rotation_axis.cpp index c90fb4ca..10ebc15d 100644 --- a/broker/gen/model/Rotation_axis.cpp +++ b/broker/gen/model/Rotation_axis.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Rotation_axis.h b/broker/gen/model/Rotation_axis.h index 9bb67f94..6de97526 100644 --- a/broker/gen/model/Rotation_axis.h +++ b/broker/gen/model/Rotation_axis.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Spot_finding_settings.cpp b/broker/gen/model/Spot_finding_settings.cpp index aa2663f3..7a707b8b 100644 --- a/broker/gen/model/Spot_finding_settings.cpp +++ b/broker/gen/model/Spot_finding_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Spot_finding_settings.h b/broker/gen/model/Spot_finding_settings.h index 3b4009e2..6f7a5aa1 100644 --- a/broker/gen/model/Spot_finding_settings.h +++ b/broker/gen/model/Spot_finding_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Standard_detector_geometry.cpp b/broker/gen/model/Standard_detector_geometry.cpp index 7e5d0c1a..4dd4e0c5 100644 --- a/broker/gen/model/Standard_detector_geometry.cpp +++ b/broker/gen/model/Standard_detector_geometry.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Standard_detector_geometry.h b/broker/gen/model/Standard_detector_geometry.h index 855f55e0..b96b2185 100644 --- a/broker/gen/model/Standard_detector_geometry.h +++ b/broker/gen/model/Standard_detector_geometry.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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_preview_settings.cpp b/broker/gen/model/Zeromq_preview_settings.cpp index 8d44fb00..130e1b12 100644 --- a/broker/gen/model/Zeromq_preview_settings.cpp +++ b/broker/gen/model/Zeromq_preview_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,6 +23,8 @@ Zeromq_preview_settings::Zeromq_preview_settings() { m_Enabled = true; m_Period_ms = 1000L; + m_Send_start_message = true; + m_Send_start_messageIsSet = false; m_Socket_address = ""; m_Socket_addressIsSet = false; @@ -47,7 +49,7 @@ bool Zeromq_preview_settings::validate(std::stringstream& msg, const std::string bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "Zeromq_preview_settings" : pathPrefix; - + return success; } @@ -63,6 +65,9 @@ bool Zeromq_preview_settings::operator==(const Zeromq_preview_settings& rhs) con && + ((!sendStartMessageIsSet() && !rhs.sendStartMessageIsSet()) || (sendStartMessageIsSet() && rhs.sendStartMessageIsSet() && isSendStartMessage() == rhs.isSendStartMessage())) && + + ((!socketAddressIsSet() && !rhs.socketAddressIsSet()) || (socketAddressIsSet() && rhs.socketAddressIsSet() && getSocketAddress() == rhs.getSocketAddress())) ; @@ -78,6 +83,8 @@ void to_json(nlohmann::json& j, const Zeromq_preview_settings& o) j = nlohmann::json::object(); j["enabled"] = o.m_Enabled; j["period_ms"] = o.m_Period_ms; + if(o.sendStartMessageIsSet()) + j["send_start_message"] = o.m_Send_start_message; if(o.socketAddressIsSet()) j["socket_address"] = o.m_Socket_address; @@ -87,6 +94,11 @@ void from_json(const nlohmann::json& j, Zeromq_preview_settings& o) { j.at("enabled").get_to(o.m_Enabled); j.at("period_ms").get_to(o.m_Period_ms); + if(j.find("send_start_message") != j.end()) + { + j.at("send_start_message").get_to(o.m_Send_start_message); + o.m_Send_start_messageIsSet = true; + } if(j.find("socket_address") != j.end()) { j.at("socket_address").get_to(o.m_Socket_address); @@ -111,6 +123,23 @@ void Zeromq_preview_settings::setPeriodMs(int64_t const value) { m_Period_ms = value; } +bool Zeromq_preview_settings::isSendStartMessage() const +{ + return m_Send_start_message; +} +void Zeromq_preview_settings::setSendStartMessage(bool const value) +{ + m_Send_start_message = value; + m_Send_start_messageIsSet = true; +} +bool Zeromq_preview_settings::sendStartMessageIsSet() const +{ + return m_Send_start_messageIsSet; +} +void Zeromq_preview_settings::unsetSend_start_message() +{ + m_Send_start_messageIsSet = false; +} std::string Zeromq_preview_settings::getSocketAddress() const { return m_Socket_address; diff --git a/broker/gen/model/Zeromq_preview_settings.h b/broker/gen/model/Zeromq_preview_settings.h index 1485881c..47c36a60 100644 --- a/broker/gen/model/Zeromq_preview_settings.h +++ b/broker/gen/model/Zeromq_preview_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -69,6 +69,13 @@ public: int64_t getPeriodMs() const; void setPeriodMs(int64_t const value); /// + /// Publish start message on the preview ZeroMQ stream + /// + bool isSendStartMessage() const; + void setSendStartMessage(bool const value); + bool sendStartMessageIsSet() const; + void unsetSend_start_message(); + /// /// PUB ZeroMQ socket for preview images. This socket operates at a reduced frame rate. Images are serialized using CBOR. Address follows ZeroMQ convention for sockets - in practice ipc://<socket file> and tpc://<IP address>:<port> sockets are OK. 0.0.0.0 instead of IP address is accepted and means listening on all network interfaces. /// std::string getSocketAddress() const; @@ -83,6 +90,8 @@ protected: int64_t m_Period_ms; + bool m_Send_start_message; + bool m_Send_start_messageIsSet; std::string m_Socket_address; bool m_Socket_addressIsSet; diff --git a/broker/gen/model/Zeromq_settings.cpp b/broker/gen/model/Zeromq_settings.cpp index b31bd1c1..18859d2a 100644 --- a/broker/gen/model/Zeromq_settings.cpp +++ b/broker/gen/model/Zeromq_settings.cpp @@ -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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_settings.h b/broker/gen/model/Zeromq_settings.h index d03d1d40..fafd01aa 100644 --- a/broker/gen/model/Zeromq_settings.h +++ b/broker/gen/model/Zeromq_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. * -* The version of the OpenAPI document: 1.0.0-rc.23 +* The version of the OpenAPI document: 1.0.0-rc.24 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index e00fd562..b8d58ac8 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -5,7 +5,7 @@ info: API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. - version: 1.0.0-rc.23 + version: 1.0.0-rc.24 contact: name: Filip Leonarski (Paul Scherrer Institute) email: filip.leonarski@psi.ch @@ -139,6 +139,7 @@ components: minimum: 0 default: 0 maximum: 194 + description: Number of space group for the crystal. Currently used solely as metadata, not relevant for image processing done in Jungfraujoch. sample_name: type: string default: "" @@ -154,6 +155,8 @@ components: "none" ] default: "bslz4" + description: | + Compression type for the images transferred over ZeroMQ and saved to HDF5 file. total_flux: type: number format: float @@ -171,9 +174,17 @@ components: goniometer: $ref: "#/components/schemas/rotation_axis" header_appendix: - description: Header appendix, added as user_data/user to start message (can be any valid JSON) + description: | + 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. image_appendix: - description: Image appendix, added as user_data to image message (can be any valid JSON) + description: | + Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON) + Not saved in HDF5 file data_reduction_factor_serialmx: type: number format: float @@ -236,7 +247,7 @@ components: If parameter is not provided calibration will be saved only if more than 4 images are recorded. unit_cell: type: object - description: Units of angstrom and degree + description: Unit cell parameters. Necessary to run indexing. Units of angstrom and degree required: - a - b @@ -278,6 +289,24 @@ components: example: 90 minimum: 0 maximum: 360 + pixel_mask_statistics: + type: object + properties: + user_mask: + description: Number of pixels masked using the user mask + type: integer + format: int64 + minimum: 0 + too_high_pedestal_rms: + description: Number of pixels with G0 pedestal RMS higher than provided threshold + type: integer + format: int64 + minimum: 0 + wrong_gain: + description: Number of pixels that show wrong gain level during the pedestal procedure + type: integer + format: int64 + minimum: 0 image_format_settings: type: object required: @@ -286,6 +315,7 @@ components: - geometry_transform - mask_chip_edges - mask_module_edges + - apply_mask properties: summation: type: boolean @@ -312,9 +342,9 @@ components: bit_depth_image: type: integer format: int64 - enum: [16, 32] + enum: [8, 16, 32] description: | - Bit depth of resulting image (it doesn't affect the original detector value) + Bit depth of resulting image (it doesn't affect the detector read-out value) If not provided value is adjusted automatically signed_output: type: boolean @@ -331,6 +361,23 @@ components: default: true description: | Mask multipixels on chip boundary + jungfrau_mask_pixels_without_g0: + type: boolean + default: true + description: | + JUNGFRAU: mask pixels that don't operate in G0, but do operate in G1 and G1. + This should be turned off for cases, where detector is operated at room temperature with long exposure time. + apply_mask: + type: boolean + default: false + description: | + Masked pixels are set to special value in the images produced by Jungfraujoch + jungfrau_pedestal_g0_rms_limit: + type: integer + format: int64 + default: 100 + minimum: 0 + description: Pixels with pedestal G0 RMS above the threshold are marked as masked pixels detector_power_state: type: string description: Power on of ASICs @@ -383,12 +430,17 @@ components: properties: frame_time_us: type: integer - description: Interval between consecutive frames. + description: | + Interval between consecutive frames. + This is internal frame time for the JUNGFRAU detector, image time has to be integer multiply of this number. + For EIGER detector this is default frame time, not used otherwise format: int64 minimum: 450 count_time_us: type: integer - description: Integration time of the detector. If not provided count time will be set to maximum value for a given frame time. + description: | + Integration time of the detector. + If not provided count time will be set to maximum value for a given frame time. format: int64 internal_frame_generator: type: boolean @@ -399,7 +451,8 @@ components: format: int64 default: 1 minimum: 1 - maximum: 128 + maximum: 64 + description: Number of images stored in the internal frame generator. detector_trigger_delay_ns: type: integer format: int64 @@ -413,6 +466,18 @@ components: format: float minimum: 1.0 maximum: 100.0 + description: | + 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. + eiger_bit_depth: + type: integer + format: int64 + enum: [ 8, 16, 32 ] + description: | + Bit depth of EIGER read-out. + If value is not provided bit depth is adjusted automatically based on the image time. jungfrau_pedestal_g0_frames: type: integer format: int64 @@ -428,12 +493,6 @@ components: format: int64 default: 300 minimum: 0 - jungfrau_pedestal_g0_rms_limit: - type: integer - format: int64 - default: 100 - minimum: 0 - description: Pixels with pedestal G0 RMS above the threshold are marked as masked pixels jungfrau_pedestal_min_image_count: type: integer format: int64 @@ -696,11 +755,14 @@ components: - packets_sls - packets_udp - idle + - fw_version properties: pci_dev_id: type: string serial_number: type: string + fw_version: + type: string base_mac_addr: type: string eth_link_count: @@ -841,6 +903,8 @@ components: $ref: '#/components/schemas/calibration_statistics' zeromq_preview: $ref: '#/components/schemas/zeromq_preview_settings' + pixel_mask: + $ref: '#/components/schemas/pixel_mask_statistics' preview_settings: type: object description: "Settings for JPEG rendering of preview images" @@ -993,7 +1057,7 @@ components: Type of radiation source. NXmx gives a fixed dictionary, though Jungfraujoch is not enforcing compliance. https://manual.nexusformat.org/classes/base_classes/NXsource.html#nxsource NXsource allows the following: - + Spallation Neutron Source Pulsed Reactor Neutron Source Reactor Neutron Source @@ -1255,6 +1319,11 @@ components: Period for generating preview image sent to the ZeroMQ interface in milliseconds. Default is 1 second. If set to zero, all images will be sent ZeroMQ (should be used only in case of relatively slow data collection). This has no effect on HTTP based preview, which updates always at rate of 1 second. + send_start_message: + type: boolean + default: true + description: | + Publish start message on the preview ZeroMQ stream socket_address: type: string description: | @@ -1350,7 +1419,7 @@ paths: description: | 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. responses: @@ -2242,9 +2311,60 @@ paths: format: binary "404": description: No preview image recorded so far + /config/mask: + get: + summary: Get mask of the detector (binary) + description: | + Get full pixel mask of the detector + See NXmx standard for meaning of pixel values + responses: + "200": + description: Binary array (4 byte; unsigned) + content: + application/octet-stream: + schema: + type: string + format: binary + /config/user_mask: + get: + summary: Get user mask of the detector (binary) + description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked" + responses: + "200": + description: User mask in binary format (4 byte; unsigned) + content: + application/octet-stream: + schema: + type: string + format: binary + put: + summary: Upload user mask of the detector (binary) + description: | + 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. + requestBody: + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + "200": + description: All good + "500": + description: Error within Jungfraujoch code - see output message. + content: + application/json: + schema: + $ref: '#/components/schemas/error_message' /config/mask.tiff: get: - summary: Get mask of the detector + summary: Get mask of the detector (TIFF) description: | Get full pixel mask of the detector See NXmx standard for meaning of pixel values @@ -2258,7 +2378,7 @@ paths: format: binary /config/user_mask.tiff: get: - summary: Get user mask of the detector + summary: Get user mask of the detector (TIFF) description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked" responses: "200": @@ -2281,18 +2401,13 @@ paths: User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images. requestBody: content: - application/octet-stream: + image/tiff: schema: type: string format: binary responses: "200": description: All good - content: - image/tiff: - schema: - type: string - format: binary "500": description: Error within Jungfraujoch code - see output message. content: @@ -2313,7 +2428,7 @@ paths: schema: type: integer description: Storage cell number - summary: Get pedestal G0 in TIFF format + summary: Get pedestal in TIFF format responses: "200": description: Calibration image diff --git a/broker/redoc-static.html b/broker/redoc-static.html index 190b9161..491b90b1 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -349,7 +349,7 @@ data-styled.g137[id="sc-kqGpvY"]{content:"bAFwPb,"}/*!sc*/ -

Jungfraujoch (1.0.0-rc.23)

Download OpenAPI specification:Download

Filip Leonarski (Paul Scherrer Institute): filip.leonarski@psi.ch

Jungfraujoch (1.0.0-rc.24)

Download OpenAPI specification:Download

Filip Leonarski (Paul Scherrer Institute): filip.leonarski@psi.ch

API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). @@ -453,11 +453,15 @@ Incident particle (photon, electron) energy in keV

" class="sc-eeDSqt sc-eBMFzZ bSgSrX gayXgA">

Prefix for filenames. If left empty, no file will be saved.

images_per_file
integer <int64> >= 0
Default: 1000

Number of files in a single HDF5 data file (0 = write all images to a single data file).

-
space_group_number
integer <int64> [ 0 .. 194 ]
Default: 0
sample_name
string
Default: ""
space_group_number
integer <int64> [ 0 .. 194 ]
Default: 0

Number of space group for the crystal. Currently used solely as metadata, not relevant for image processing done in Jungfraujoch.

+
sample_name
string
Default: ""

/entry/sample/name in NXmx Sample name

-
compression
string
Default: "bslz4"
Enum: "bslz4" "bszstd" "bszstd_rle" "none"
total_flux
number <float>
compression
string
Default: "bslz4"
Enum: "bslz4" "bszstd" "bszstd_rle" "none"

Compression type for the images transferred over ZeroMQ and saved to HDF5 file.

+
total_flux
number <float>

/entry/beam/total_flux in NXmx Flux incident on beam plane in photons per second. In other words this is the flux integrated over area. [photons/s]

@@ -467,10 +471,20 @@ Transmission of attenuator (filter) [no units]</p> Transmission of attenuator (filter) [no units]

object (rotation_axis)

Definition of a crystal rotation axis

-
header_appendix
any

Header appendix, added as user_data/user to start message (can be any valid JSON)

-
image_appendix
any

Image appendix, added as user_data to image message (can be any valid JSON)

+
header_appendix
any

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.

+
image_appendix
any

Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON) +Not saved in HDF5 file

data_reduction_factor_serialmx
number <float> [ 0 .. 1 ]
Default: 1

Forward image calibration (at the moment pedestal and pedestal RMS for JUNGFRAU) using the ZeroMQ stream to writer. If parameter is not provided calibration will be saved only if more than 4 images are recorded.

-
object

Units of angstrom and degree

+
object

Unit cell parameters. Necessary to run indexing. Units of angstrom and degree

Responses