Compare commits
12 Commits
1.0.0_rc.1
...
1.0.0-rc.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a23eade30 | |||
| 3be959f272 | |||
| 9e21d312b2 | |||
| e812918e2e | |||
| e03a41ec73 | |||
| f7ae0546bd | |||
| e1045ee3b6 | |||
| 3e5ed2e9f9 | |||
| 3a08733872 | |||
| 00be0bb224 | |||
| c4fc178f7a | |||
| 6b5fddf2b7 |
@@ -87,7 +87,7 @@ build:x86:frontend:
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make frontend
|
||||
- cd ../frontend_ui/build
|
||||
- cd ../frontend/dist
|
||||
- tar czf ../../jfjoch_frontend.tar.gz *
|
||||
artifacts:
|
||||
paths:
|
||||
@@ -242,16 +242,17 @@ synthesis:vivado_pcie_100g:
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "push"
|
||||
allow_failure: true
|
||||
changes:
|
||||
- fpga/hls/*
|
||||
- fpga/hdl/*
|
||||
- fpga/scripts/*
|
||||
- fpga/xdc/*
|
||||
- fpga/pcie_driver/jfjoch_fpga.h
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
allow_failure: true
|
||||
tags:
|
||||
- vivado
|
||||
retry: 1
|
||||
retry: 2
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch_fpga_pcie_100g.mcs"
|
||||
@@ -282,10 +283,11 @@ synthesis:vivado_pcie_8x10g:
|
||||
- fpga/scripts/*
|
||||
- fpga/xdc/*
|
||||
- fpga/pcie_driver/jfjoch_fpga.h
|
||||
allow_failure: true
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
allow_failure: true
|
||||
tags:
|
||||
- vivado
|
||||
retry: 1
|
||||
retry: 2
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch_fpga_pcie_8x10g.mcs"
|
||||
@@ -315,8 +317,9 @@ release:
|
||||
- build:x86:driver
|
||||
- build:x86:rpm
|
||||
script:
|
||||
- export PACKAGE_VERSION=`head -n1 VERSION`
|
||||
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION}"
|
||||
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
|
||||
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
|
||||
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
|
||||
@@ -325,7 +328,7 @@ release:
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_8x10g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs"'
|
||||
- >
|
||||
release-cli create --name "Release $PACKAGE_VERSION" --tag-name $PACKAGE_VERSION
|
||||
release-cli create --name "Release $PACKAGE_VERSION_SEM" --tag-name $PACKAGE_VERSION_SEM
|
||||
--assets-link "{\"name\":\"jfjoch_driver.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_frontend.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_fpga_pcie_8x10g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs\"}"
|
||||
@@ -333,3 +336,83 @@ release:
|
||||
--assets-link "{\"name\":\"jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"link_type\":\"package\"}"
|
||||
|
||||
release_no_fpga:
|
||||
stage: release
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
when: manual
|
||||
tags:
|
||||
- x86
|
||||
dependencies:
|
||||
- build:x86:frontend
|
||||
- build:x86:driver
|
||||
- build:x86:rpm
|
||||
script:
|
||||
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
|
||||
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
|
||||
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_driver.tar.gz "${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_frontend.tar.gz "${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz"'
|
||||
- >
|
||||
release-cli create --name "Release $PACKAGE_VERSION_SEM" --tag-name $PACKAGE_VERSION_SEM
|
||||
--assets-link "{\"name\":\"jfjoch_driver.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_frontend.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_fpga_pcie_8x10g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_fpga_pcie_100g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs\"}"
|
||||
|
||||
upload_fpga_100g:
|
||||
stage: release
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
when: manual
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
when: manual
|
||||
- if: $CI_PIPELINE_SOURCE == "push"
|
||||
changes:
|
||||
- fpga/hls/*
|
||||
- fpga/hdl/*
|
||||
- fpga/scripts/*
|
||||
- fpga/xdc/*
|
||||
- fpga/pcie_driver/jfjoch_fpga.h
|
||||
when: manual
|
||||
tags:
|
||||
- x86
|
||||
dependencies:
|
||||
- synthesis:vivado_pcie_100g
|
||||
script:
|
||||
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
|
||||
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
|
||||
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs"'
|
||||
|
||||
upload_fpga_8x10g:
|
||||
stage: release
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
when: manual
|
||||
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
|
||||
when: manual
|
||||
- if: $CI_PIPELINE_SOURCE == "push"
|
||||
changes:
|
||||
- fpga/hls/*
|
||||
- fpga/hdl/*
|
||||
- fpga/scripts/*
|
||||
- fpga/xdc/*
|
||||
- fpga/pcie_driver/jfjoch_fpga.h
|
||||
when: manual
|
||||
tags:
|
||||
- x86
|
||||
dependencies:
|
||||
- synthesis:vivado_pcie_8x10g
|
||||
script:
|
||||
- export PACKAGE_VERSION_SEM=`head -n1 VERSION`
|
||||
- export PACKAGE_VERSION=${PACKAGE_VERSION_SEM//-/_}
|
||||
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION_SEM}"
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_8x10g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs"'
|
||||
|
||||
@@ -7,6 +7,8 @@ stages:
|
||||
|
||||
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
|
||||
|
||||
@@ -113,6 +113,7 @@ ADD_SUBDIRECTORY(detector_control)
|
||||
IF (JFJOCH_WRITER_ONLY)
|
||||
MESSAGE(STATUS "Compiling HDF5 writer only")
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(image_pusher)
|
||||
ADD_SUBDIRECTORY(broker)
|
||||
ADD_SUBDIRECTORY(fpga)
|
||||
ADD_SUBDIRECTORY(acquisition_device)
|
||||
@@ -124,25 +125,29 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
IF (NOT JFJOCH_WRITER_ONLY)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT frontend_ui/build/index.html
|
||||
ADD_CUSTOM_COMMAND(OUTPUT frontend/dist/index.html
|
||||
COMMAND npm install
|
||||
COMMAND npm run build
|
||||
COMMAND npm run redocly
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui)
|
||||
ADD_CUSTOM_TARGET(frontend DEPENDS frontend_ui/build/index.html)
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend)
|
||||
ADD_CUSTOM_TARGET(frontend DEPENDS frontend/dist/index.html)
|
||||
|
||||
ADD_CUSTOM_TARGET(update_version
|
||||
COMMAND bash update_version.sh
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/
|
||||
DESTINATION /usr/src/jfjoch-1.0.0
|
||||
DESTINATION /usr/src/jfjoch-${JFJOCH_VERSION}
|
||||
COMPONENT driver-dkms
|
||||
FILES_MATCHING PATTERN "dkms.conf")
|
||||
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/
|
||||
DESTINATION /usr/src/jfjoch-1.0.0/src
|
||||
DESTINATION /usr/src/jfjoch-${JFJOCH_VERSION}/src
|
||||
COMPONENT driver-dkms
|
||||
FILES_MATCHING PATTERN "*.c" PATTERN "*.h" PATTERN "Makefile")
|
||||
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui/build/)
|
||||
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui/build/ DESTINATION share/jfjoch/frontend COMPONENT jfjoch )
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend/dist/)
|
||||
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/frontend/dist/ DESTINATION share/jfjoch/frontend COMPONENT jfjoch )
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
||||
20
Dockerfile
20
Dockerfile
@@ -1,20 +0,0 @@
|
||||
# MAX IV docker config
|
||||
|
||||
FROM harbor.maxiv.lu.se/dockerhub/library/ubuntu:22.04
|
||||
|
||||
RUN set -ex; \
|
||||
apt-get update; \
|
||||
apt-get install -y pkg-config git cmake make g++;\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
COPY . /usr/src/nextgendcu
|
||||
|
||||
RUN set -ex; \
|
||||
cd /usr/src/nextgendcu; \
|
||||
mkdir build; \
|
||||
cd build; \
|
||||
cmake -DJFJOCH_WRITER_ONLY=ON .. ;\
|
||||
make -j8 install;
|
||||
|
||||
ENTRYPOINT ["/opt/jfjoch/bin/jfjoch_writer"]
|
||||
16
README.md
16
README.md
@@ -1,6 +1,6 @@
|
||||
# Jungfraujoch
|
||||
|
||||
Application to receive data from the JUNGFRAU detector.
|
||||
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).
|
||||
|
||||
@@ -15,15 +15,19 @@ Operating Jungfraujoch requires license from the Paul Scherrer Institute.
|
||||
Sharing the code requires explicit permission from the Paul Scherrer Institute.
|
||||
|
||||
## Hardware requirements
|
||||
1. JUNGFRAU detector (optimally 4M with 2 kHz enabled read-out boards)
|
||||
1. PSI JUNGFRAU or EIGER detector
|
||||
2. Server system with AMD/Xilinx Alveo U55C cards and optionally Nvidia GPUs
|
||||
|
||||
At the moment only U55C card is supported by Jungfraujoch.
|
||||
Nvidia L4 GPU is recommended and used for performance tuning.
|
||||
At the moment only AMD Alveo U55C card is supported by Jungfraujoch.
|
||||
Nvidia L4 GPU is recommended for indexing and used for performance tuning.
|
||||
|
||||
## FPGA bitstream
|
||||
Instructions see [here](fpga/README.md)
|
||||
|
||||
## Detector
|
||||
Jungfraujoch supports PSI JUNGFRAU and EIGER detectors. Jungfruajoch controls the detector via statically compiled `slsDetectorPackage` into its source code.
|
||||
It is important that detector firmware has to match `slsDetectorPackage` version used in Jungfraujoch (8.0.2 at the moment).
|
||||
See [PSI Detector group website](https://www.psi.ch/en/lxn/software-releases) for details.
|
||||
## Software
|
||||
Recommended operating system is Red Hat Enterprise Linux (RHEL) / Rocky Linux versions 8 and 9 (both are tested on a regular basis).
|
||||
Running Jungfraujoch on Red Hat Enterprise Linux 7 is currently not tested and not recommended,
|
||||
@@ -106,7 +110,7 @@ Jungfraujoch is equipped with React-based web frontend for user-friendly experie
|
||||
* JUNGFRAU calibration numbers
|
||||
* Configuring the detector, as well as pedestal/initialization operations
|
||||
|
||||
Frontend is written in TypeScript. For details see [frontend_ui/](frontend_ui) directory.
|
||||
Frontend is written in TypeScript. For details see [frontend/](frontend) directory.
|
||||
|
||||
Jungfraujoch Cmake scripts have an option to start frontend build with the following command:
|
||||
```
|
||||
@@ -115,7 +119,7 @@ cd build
|
||||
cmake ..
|
||||
make frontend
|
||||
```
|
||||
Contrary to standard CMake way, frontend will be built in "source" `frontend_ui/build` directory, not in `build/` subdirectory.
|
||||
Contrary to standard CMake way, frontend will be built in "source" `frontend/build` directory, not in `build/` subdirectory.
|
||||
|
||||
## Tests
|
||||
|
||||
|
||||
@@ -41,17 +41,6 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_
|
||||
void AcquisitionCounters::UpdateCounters(const Completion *c) {
|
||||
std::unique_lock<std::shared_mutex> ul(m);
|
||||
|
||||
if (c->pedestal) {
|
||||
if (c->module_number >= nmodules)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"UpdateCounters wrong module number: " + std::to_string(c->module_number) + " for pedestal SC" + std::to_string(c->frame_number));
|
||||
if (c->frame_number >= 16)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"UpdateCounters pedestal frame number is out of bounds for storage cells");
|
||||
handle_for_pedestal.at(c->frame_number * nmodules + c->module_number) = c->handle;
|
||||
return;
|
||||
}
|
||||
|
||||
if (c->module_number >= nmodules)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"UpdateCounters wrong module number: " + std::to_string(c->module_number) + " for frame " + std::to_string(c->frame_number) +
|
||||
|
||||
@@ -75,7 +75,7 @@ void AcquisitionDevice::StartAction(const DiffractionExperiment &experiment, uin
|
||||
RunInternalGenerator(experiment);
|
||||
}
|
||||
|
||||
void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
|
||||
void AcquisitionDevice::WaitForActionComplete() {
|
||||
auto c = work_completion_queue.GetBlocking();
|
||||
|
||||
while (c.type != Completion::Type::End) {
|
||||
@@ -92,9 +92,8 @@ void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
|
||||
c.module_number = output->module_statistics.module_number;
|
||||
c.packet_count = output->module_statistics.packet_count;
|
||||
c.frame_number = output->module_statistics.frame_number;
|
||||
c.pedestal = output->module_statistics.pedestal;
|
||||
|
||||
if ((c.frame_number >= expected_frames) && !c.pedestal) {
|
||||
if (c.frame_number >= expected_frames) {
|
||||
Cancel();
|
||||
// this frame is not of any interest, therefore its location can be immediately released
|
||||
SendWorkRequest(c.handle);
|
||||
@@ -104,14 +103,6 @@ void AcquisitionDevice::WaitForActionComplete(bool pedestal_mode) {
|
||||
logger->Error("Completion with wrong module number data stream {} completion frame number {} module {} handle {}",
|
||||
data_stream, c.frame_number, c.module_number, c.handle);
|
||||
SendWorkRequest(c.handle);
|
||||
} else if (pedestal_mode && !c.pedestal) {
|
||||
try {
|
||||
counters.UpdateCounters(&c);
|
||||
} catch (const JFJochException &e) {
|
||||
if (logger)
|
||||
logger->ErrorException(e);
|
||||
}
|
||||
SendWorkRequest(c.handle);
|
||||
} else {
|
||||
try {
|
||||
counters.UpdateCounters(&c);
|
||||
@@ -152,14 +143,6 @@ const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t frame_number, uint
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Frame not collected");
|
||||
}
|
||||
|
||||
const DeviceOutput *AcquisitionDevice::GetDeviceOutputPedestal(size_t storage_cell, uint16_t module_number) const {
|
||||
auto handle = counters.GetPedestalBufferHandle(storage_cell, module_number);
|
||||
if (handle != HandleNotValid)
|
||||
return GetDeviceOutput(handle);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Frame not collected");
|
||||
}
|
||||
|
||||
const DeviceOutput *AcquisitionDevice::GetDeviceOutput(size_t handle) const {
|
||||
if (handle >= buffer_device.size())
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Handle outside of range");
|
||||
@@ -272,10 +255,6 @@ void AcquisitionDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) {
|
||||
ipv4_addr = ipv4_addr_network_order;
|
||||
}
|
||||
|
||||
void AcquisitionDevice::SetMACAddress(uint64_t mac_addr_network_order) {
|
||||
mac_addr = mac_addr_network_order;
|
||||
}
|
||||
|
||||
AcquisitionDeviceNetConfig AcquisitionDevice::GetNetConfig() const {
|
||||
return {
|
||||
.mac_addr = GetMACAddress(),
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
void StartAction(const DiffractionExperiment &experiment, uint32_t optional_flags = 0);
|
||||
void PrepareAction(const DiffractionExperiment &experiment);
|
||||
|
||||
void WaitForActionComplete(bool pedestal_mode = false);
|
||||
void WaitForActionComplete();
|
||||
virtual void Cancel() = 0;
|
||||
|
||||
void EnableLogging(Logger *logger);
|
||||
@@ -87,7 +87,6 @@ public:
|
||||
virtual DeviceStatus GetDeviceStatus() const;
|
||||
AcquisitionDeviceStatistics GetStatistics() const;
|
||||
const DeviceOutput *GetDeviceOutput(size_t frame_number, uint16_t module_number) const;
|
||||
const DeviceOutput *GetDeviceOutputPedestal(size_t frame_number, uint16_t module_number) const;
|
||||
void FrameBufferRelease(size_t frame_number, uint16_t module_number);
|
||||
|
||||
// Calibration
|
||||
@@ -104,7 +103,6 @@ public:
|
||||
void SetSpotFinderParameters(const SpotFindingSettings &settings);
|
||||
virtual std::string GetIPv4Address() const;
|
||||
virtual void SetIPv4Address(uint32_t ipv4_addr_network_order);
|
||||
virtual void SetMACAddress(uint64_t mac_addr_network_order);
|
||||
virtual std::string GetMACAddress() const;
|
||||
virtual uint16_t GetUDPPort() const;
|
||||
virtual int32_t GetNUMANode() const;
|
||||
|
||||
@@ -20,8 +20,11 @@ void AcquisitionDeviceGroup::Add(std::unique_ptr<AcquisitionDevice> &&device) {
|
||||
aq_devices.emplace_back(std::move(device));
|
||||
}
|
||||
|
||||
void AcquisitionDeviceGroup::AddPCIeDevice(const std::string &device_name) {
|
||||
aq_devices.emplace_back(std::make_unique<PCIExpressDevice>(aq_devices.size(), device_name));
|
||||
void AcquisitionDeviceGroup::AddPCIeDevice(const std::string &device_name, std::optional<uint32_t> ipv4_addr) {
|
||||
auto tmp = std::make_unique<PCIExpressDevice>(aq_devices.size(), device_name);
|
||||
if (ipv4_addr.has_value())
|
||||
tmp->SetIPv4Address(ipv4_addr.value());
|
||||
aq_devices.emplace_back(std::move(tmp));
|
||||
}
|
||||
|
||||
void AcquisitionDeviceGroup::AddHLSDevice(int64_t buffer_size_modules) {
|
||||
@@ -43,4 +46,11 @@ void AcquisitionDeviceGroup::SetDefaultDataSource(AcquisitionDeviceSource id) {
|
||||
void AcquisitionDeviceGroup::EnableLogging(Logger *logger) {
|
||||
for (auto &i: aq_devices)
|
||||
i->EnableLogging(logger);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<DeviceStatus> AcquisitionDeviceGroup::GetDeviceStatus() const {
|
||||
std::vector<DeviceStatus> ret;
|
||||
for (auto &i: aq_devices)
|
||||
ret.emplace_back(i->GetDeviceStatus());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -13,9 +13,10 @@ public:
|
||||
AcquisitionDevice& operator[](int idx);
|
||||
size_t size();
|
||||
void Add(std::unique_ptr<AcquisitionDevice> &&device);
|
||||
void AddPCIeDevice(const std::string &device_name);
|
||||
void AddPCIeDevice(const std::string &device_name, std::optional<uint32_t> ipv4_addr = {});
|
||||
void AddHLSDevice(int64_t buffer_size_modules);
|
||||
std::vector<AcquisitionDeviceNetConfig> GetNetworkConfig();
|
||||
std::vector<DeviceStatus> GetDeviceStatus() const;
|
||||
void SetDefaultDataSource(AcquisitionDeviceSource id);
|
||||
void EnableLogging(Logger *logger);
|
||||
};
|
||||
|
||||
@@ -17,7 +17,6 @@ struct Completion {
|
||||
uint16_t packet_count;
|
||||
uint16_t data_collection_id;
|
||||
uint16_t module_number;
|
||||
bool pedestal;
|
||||
};
|
||||
|
||||
Completion parse_hw_completion(uint32_t hw_input);
|
||||
|
||||
@@ -221,22 +221,7 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
|
||||
|
||||
expected_descriptors_per_module = DMA_DESCRIPTORS_PER_MODULE;
|
||||
|
||||
switch (x.GetDetectorMode()) {
|
||||
case DetectorMode::Conversion:
|
||||
case DetectorMode::Raw:
|
||||
break;
|
||||
case DetectorMode::PedestalG0:
|
||||
job.mode |= MODE_PEDESTAL_G0;
|
||||
break;
|
||||
case DetectorMode::PedestalG1:
|
||||
job.mode |= MODE_PEDESTAL_G1;
|
||||
break;
|
||||
case DetectorMode::PedestalG2:
|
||||
job.mode |= MODE_PEDESTAL_G2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (x.IsConversionOnFPGA())
|
||||
if (x.IsJungfrauConvPhotonCnt())
|
||||
job.mode |= MODE_CONV;
|
||||
|
||||
if (x.IsFixedGainG1())
|
||||
@@ -245,8 +230,18 @@ void FPGAAcquisitionDevice::FillActionRegister(const DiffractionExperiment& x, D
|
||||
if (!x.IsPixelSigned())
|
||||
job.mode |= MODE_UNSIGNED;
|
||||
|
||||
if (x.GetPixelDepth() == 4)
|
||||
if (x.GetByteDepthImage() == 4)
|
||||
job.mode |= MODE_32BIT;
|
||||
|
||||
if (x.GetLossyCompressionPoisson()) {
|
||||
job.mode |= MODE_SQROOT;
|
||||
job.sqrtmult = x.GetLossyCompressionPoisson().value();
|
||||
}
|
||||
|
||||
if (x.GetPixelValueLowThreshold()) {
|
||||
job.mode |= MODE_THRESHOLD;
|
||||
job.pxlthreshold = x.GetPixelValueLowThreshold().value();
|
||||
}
|
||||
}
|
||||
|
||||
void FPGAAcquisitionDevice::Start(const DiffractionExperiment &experiment, uint32_t flag) {
|
||||
|
||||
@@ -41,9 +41,6 @@ class FPGAAcquisitionDevice : public AcquisitionDevice {
|
||||
protected:
|
||||
std::vector<uint16_t> internal_pkt_gen_frame;
|
||||
explicit FPGAAcquisitionDevice(uint16_t data_stream);
|
||||
virtual void HW_GetEnvParams(DeviceStatus *status) const {
|
||||
memset(status, 0, sizeof(DeviceStatus));
|
||||
}
|
||||
public:
|
||||
void InitializeCalibration(const DiffractionExperiment &experiment, const JFCalibration &calib) override;
|
||||
void InitializeIntegrationMap(const DiffractionExperiment &experiment, const std::vector<uint16_t> &v,
|
||||
|
||||
@@ -2,117 +2,29 @@
|
||||
|
||||
#include "HLSSimulatedDevice.h"
|
||||
|
||||
#include <bitset>
|
||||
#include <arpa/inet.h>
|
||||
#include "../fpga/hls/datamover_model.h"
|
||||
#include "../fpga/hls/hls_jfjoch.h"
|
||||
|
||||
uint16_t checksum(const uint16_t *addr, size_t count) {
|
||||
/* Compute Internet Checksum for "count" bytes
|
||||
* beginning at location "addr".
|
||||
*/
|
||||
long sum = 0;
|
||||
|
||||
for (int i = 0; i < count / 2; i++)
|
||||
sum += addr[i];
|
||||
|
||||
/* Add left-over byte, if any */
|
||||
if (count % 2 == 1)
|
||||
sum += ((uint8_t *) addr)[count / 2];
|
||||
|
||||
/* Fold 32-bit sum to 16 bits */
|
||||
while (sum>>16)
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
|
||||
return ~sum;
|
||||
}
|
||||
|
||||
HLSSimulatedDevice::HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node)
|
||||
: FPGAAcquisitionDevice(data_stream),
|
||||
datamover_in(Direction::Input, nullptr),
|
||||
datamover_out(Direction::Output, nullptr),
|
||||
datamover_out_hbm_0(Direction::Output, (char *) hbm.data()),
|
||||
datamover_out_hbm_1(Direction::Output, (char *) hbm.data()),
|
||||
datamover_in_hbm_0(Direction::Input, (char *) hbm.data()),
|
||||
datamover_in_hbm_1(Direction::Input, (char *) hbm.data()),
|
||||
idle(true), hbm(hbm_if_size / 32 * hbm_if_count),
|
||||
dma_address_table(65536) {
|
||||
: FPGAAcquisitionDevice(data_stream) {
|
||||
mac_addr = 0xCCAA11223344;
|
||||
ipv4_addr = 0x0132010A;
|
||||
|
||||
max_modules = MAX_MODULES_FPGA;
|
||||
|
||||
if (data_stream != 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"HLS simulation can only work with 1 data_stream, due to use of static variables");
|
||||
MapBuffersStandard(in_frame_buffer_size_modules, numa_node);
|
||||
|
||||
auto in_mem_location32 = (uint32_t *) dma_address_table.data();
|
||||
|
||||
for (int i = 0; i < buffer_device.size(); i++) {
|
||||
in_mem_location32[2 * i ] = ((uint64_t) buffer_device[i]) & UINT32_MAX;
|
||||
in_mem_location32[2 * i + 1] = ((uint64_t) buffer_device[i]) >> 32;
|
||||
}
|
||||
device = std::make_unique<HLSDevice>(buffer_device);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::CreateFinalPacket(const DiffractionExperiment& experiment) {
|
||||
CreateJFPacket(experiment, UINT64_MAX, 0, 0, nullptr, false);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::SendPacket(char *buffer, int len, uint8_t user) {
|
||||
auto obuff = (ap_uint<512> *)buffer;
|
||||
|
||||
for (int i = 0; i < (len + 63) / 64; i++) {
|
||||
packet_512_t packet_in;
|
||||
if (i == (len + 63) / 64 - 1) packet_in.last = 1;
|
||||
else packet_in.last = 0;
|
||||
packet_in.keep = 0xFFFFFFFFFFFFFFFF;
|
||||
packet_in.user = user;
|
||||
packet_in.data = obuff[i];
|
||||
din_eth.write(packet_in);
|
||||
}
|
||||
device->CreateFinalPacket(experiment);
|
||||
}
|
||||
|
||||
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) {
|
||||
char buff[256*64];
|
||||
memset(buff, 0, 256*64);
|
||||
|
||||
auto packet = (jf_raw_packet *)buff;
|
||||
|
||||
packet->ether_type = htons(0x0800);
|
||||
packet->sour_mac[0] = 0x00; // module 0
|
||||
|
||||
uint64_t tmp_mac = mac_addr;
|
||||
for (int i = 0; i < 6; i++)
|
||||
packet->dest_mac[i] = (tmp_mac >> (8*i)) % 256;
|
||||
|
||||
uint32_t half_module = 2 * module_number | ((eth_packet >= 64) ? 1 : 0);
|
||||
|
||||
packet->ipv4_header_h = htons(0x4500); // Big endian in IP header!
|
||||
packet->ipv4_header_total_length = htons(8268); // Big endian in IP header!
|
||||
packet->ipv4_header_dest_ip = ipv4_addr;
|
||||
packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, half_module);
|
||||
|
||||
packet->ipv4_header_ttl_protocol = htons(0x0011);
|
||||
packet->ipv4_header_checksum = checksum( (uint16_t *) &packet->ipv4_header_h, 20); // checksum is already in network order
|
||||
|
||||
packet->udp_dest_port = htons(GetUDPPort()); // module number
|
||||
packet->udp_sour_port = htons(0xDFAC);
|
||||
packet->udp_length = htons(8248);
|
||||
|
||||
// JF headers are little endian
|
||||
packet->jf.detectortype = SLS_DETECTOR_TYPE_JUNGFRAU;
|
||||
packet->jf.timestamp = 0xABCDEF0000FEDCBAL;
|
||||
packet->jf.bunchid = 0x1234567898765431L;
|
||||
packet->jf.row = half_module;
|
||||
packet->jf.column = 0;
|
||||
packet->jf.framenum = frame_number;
|
||||
packet->jf.packetnum = eth_packet % 64;
|
||||
if (data != nullptr) {
|
||||
for (int i = 0; i < 4096; i++)
|
||||
packet->jf.data[i] = data[i];
|
||||
}
|
||||
packet->udp_checksum = htons(checksum( (uint16_t *) (buff+42), 8192+48));
|
||||
|
||||
SendPacket(buff, (130+adjust_axis)*64, user);
|
||||
device->CreateJFPacket(experiment, frame_number, eth_packet, module_number, data, adjust_axis, user);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames,
|
||||
@@ -126,635 +38,83 @@ 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) {
|
||||
char buff[256*64];
|
||||
memset(buff, 0, 256*64);
|
||||
|
||||
auto packet = (eiger_raw_packet *)buff;
|
||||
|
||||
packet->ether_type = htons(0x0800);
|
||||
packet->sour_mac[0] = 0x00; // module 0
|
||||
|
||||
uint64_t tmp_mac = mac_addr;
|
||||
for (int i = 0; i < 6; i++)
|
||||
packet->dest_mac[i] = (tmp_mac >> (8*i)) % 256;
|
||||
|
||||
packet->ipv4_header_h = htons(0x4500); // Big endian in IP header!
|
||||
packet->ipv4_header_total_length = htons(4172); // Big endian in IP header!
|
||||
packet->ipv4_header_dest_ip = ipv4_addr;
|
||||
packet->ipv4_header_sour_ip = experiment.GetSrcIPv4Address(data_stream, 0);
|
||||
|
||||
packet->ipv4_header_ttl_protocol = htons(0x0011);
|
||||
packet->ipv4_header_checksum = checksum( (uint16_t *) &packet->ipv4_header_h, 20); // checksum is already in network order
|
||||
|
||||
packet->udp_dest_port = htons(GetUDPPort()); // module number
|
||||
packet->udp_sour_port = htons(0xDFAC);
|
||||
packet->udp_length = htons(4152);
|
||||
|
||||
// JF headers are little endian
|
||||
packet->eiger.detectortype = SLS_DETECTOR_TYPE_EIGER;
|
||||
packet->eiger.timestamp = 0xABCDEF0000FEDCBAL;
|
||||
packet->eiger.bunchid = 0x1234567898765431L;
|
||||
packet->eiger.row = (2 * module_number) | (row % 2);
|
||||
packet->eiger.column = col % 2;
|
||||
packet->eiger.framenum = frame_number;
|
||||
packet->eiger.packetnum = eth_packet % 64;
|
||||
if (data != nullptr) {
|
||||
for (int i = 0; i < 2048; i++)
|
||||
packet->eiger.data[i] = data[i];
|
||||
}
|
||||
packet->udp_checksum = htons(checksum( (uint16_t *) (buff+42), 4096+48));
|
||||
|
||||
SendPacket(buff, 66*64, 0);
|
||||
}
|
||||
|
||||
AXI_STREAM & HLSSimulatedDevice::OutputStream() {
|
||||
return dout_eth;
|
||||
device->CreateEIGERPacket(experiment, frame_number, eth_packet, module_number, col, row, data);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HW_ReadActionRegister(DataCollectionConfig *job) {
|
||||
memcpy(job, &cfg, sizeof(DataCollectionConfig));
|
||||
device->HW_ReadActionRegister(job);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HW_WriteActionRegister(const DataCollectionConfig *job) {
|
||||
memcpy(&cfg, job, sizeof(DataCollectionConfig));
|
||||
device->HW_WriteActionRegister(job);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::FPGA_StartAction(const DiffractionExperiment &experiment) {
|
||||
if (action_thread.joinable())
|
||||
action_thread.join();
|
||||
|
||||
run_counter += 1;
|
||||
run_data_collection = 1;
|
||||
cancel_data_collection = 0;
|
||||
idle = false;
|
||||
|
||||
while (!din_frame_generator.empty())
|
||||
din_frame_generator.read();
|
||||
|
||||
datamover_out.ClearCompletedDescriptors();
|
||||
|
||||
action_thread = std::thread(&HLSSimulatedDevice::HLSMainThread, this );
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::FrameGeneratorFuture(FrameGeneratorConfig config) {
|
||||
frame_generator(din_frame_generator,
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm_if_size,
|
||||
mac_addr,
|
||||
ipv4_addr,
|
||||
cancel_data_collection,
|
||||
config);
|
||||
device->FPGA_StartAction(experiment);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HW_RunInternalGenerator(const FrameGeneratorConfig &config) {
|
||||
frame_generator_future = std::async(std::launch::async, &HLSSimulatedDevice::FrameGeneratorFuture, this, config);
|
||||
device->HW_RunInternalGenerator(config);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::FPGA_EndAction() {
|
||||
if (action_thread.joinable())
|
||||
action_thread.join();
|
||||
device->FPGA_EndAction();
|
||||
}
|
||||
|
||||
HLSSimulatedDevice::~HLSSimulatedDevice() {
|
||||
if (action_thread.joinable())
|
||||
action_thread.join();
|
||||
}
|
||||
|
||||
bool HLSSimulatedDevice::HW_ReadMailbox(uint32_t *values) {
|
||||
std::unique_lock<std::mutex> ul(completion_mutex);
|
||||
|
||||
ap_uint<32> tmp;
|
||||
bool ret = completion_stream.read_nb(tmp);
|
||||
values[0] = tmp;
|
||||
// equivalent to driver functionality
|
||||
if (ret) {
|
||||
uint32_t data_collection_id = (values[0] >> 16) & 0xFFFF;
|
||||
uint32_t handle = values[0] & 0xFFFF;
|
||||
if (handle == HANDLE_START)
|
||||
completion_count = 0;
|
||||
else if ((handle != HANDLE_END) && (data_collection_id != DATA_COLLECTION_ID_PURGE)) {
|
||||
completion_count++;
|
||||
while (completion_count * DMA_DESCRIPTORS_PER_MODULE > datamover_out.GetCompletedDescriptors())
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return device->HW_ReadMailbox(values);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::Cancel() {
|
||||
cancel_data_collection = 1;
|
||||
device->Cancel();
|
||||
}
|
||||
|
||||
bool HLSSimulatedDevice::HW_IsIdle() const {
|
||||
return idle && datamover_out.IsIdle();
|
||||
return device->HW_IsIdle();
|
||||
}
|
||||
|
||||
|
||||
bool HLSSimulatedDevice::HW_SendWorkRequest(uint32_t handle) {
|
||||
work_request_stream.write(handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline uint32_t float2uint(float f) {
|
||||
float_uint32 fu;
|
||||
fu.f = f;
|
||||
return fu.u;
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HLSMainThread() {
|
||||
ap_uint<1> clear_counters = 0;
|
||||
|
||||
uint64_t packets_processed;
|
||||
|
||||
std::vector<std::thread> hls_cores;
|
||||
|
||||
STREAM_512 ip1, udp1, udp2, icmp1, arp1;
|
||||
|
||||
STREAM_512 network0;
|
||||
|
||||
STREAM_768 stream_768_0;
|
||||
STREAM_768 stream_768_1;
|
||||
STREAM_768 stream_768_2;
|
||||
STREAM_768 stream_768_3;
|
||||
STREAM_768 stream_768_4;
|
||||
STREAM_768 stream_768_5;
|
||||
|
||||
STREAM_512 data_0;
|
||||
hls::stream<ap_axiu<512, 1, 1, 1>, 2> data_1;
|
||||
hls::stream<ap_axiu<512, 1, 1, 1>, 2> data_2;
|
||||
STREAM_512 data_3;
|
||||
STREAM_512 data_4;
|
||||
STREAM_512 data_5;
|
||||
STREAM_512 data_6;
|
||||
STREAM_512 data_7;
|
||||
STREAM_512 data_8;
|
||||
STREAM_512 data_9;
|
||||
STREAM_512 data_10;
|
||||
STREAM_512 data_12;
|
||||
STREAM_512 data_13;
|
||||
|
||||
hls::stream<axis_addr> addr0;
|
||||
hls::stream<axis_addr> addr1;
|
||||
hls::stream<axis_addr> addr2;
|
||||
hls::stream<axis_addr> addr3;
|
||||
|
||||
hls::stream<axis_completion> axi_compl[12];
|
||||
|
||||
hls::stream<ap_uint<16>> hbm_handles;
|
||||
hls::stream<ap_uint<512>> adu_histo_result;
|
||||
|
||||
hls::stream<ap_axiu<64,1,1,1>> integration_result_0;
|
||||
hls::stream<ap_uint<512>> integration_result_1;
|
||||
|
||||
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_0;
|
||||
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_1;
|
||||
hls::stream<ap_uint<32>> spot_finder_conn_0;
|
||||
hls::stream<ap_axiu<32,1,1,1>> spot_finder_result_2;
|
||||
hls::stream<ap_uint<512>> spot_finder_result_3;
|
||||
|
||||
hls::stream<ap_uint<32>> spot_finder_mask_0;
|
||||
|
||||
hls::stream<ap_uint<256>> roi_calc_result_0;
|
||||
|
||||
hls::stream<ap_uint<UDP_METADATA_STREAM_WIDTH> > udp_metadata;
|
||||
volatile ap_uint<1> idle_data_collection = 1;
|
||||
ap_uint<1> load_to_hbm_idle;
|
||||
ap_uint<1> save_to_hbm_idle;
|
||||
ap_uint<1> integration_idle;
|
||||
ap_uint<1> stream_conv_idle;
|
||||
ap_uint<1> frame_summation_idle;
|
||||
|
||||
volatile bool done = false;
|
||||
volatile bool udp_done = false; // done AND udp_idle
|
||||
volatile bool sls_done = false; // done AND sls_idle
|
||||
|
||||
// Sent gratuitous ARP message
|
||||
arp(arp1, dout_eth, mac_addr, ipv4_addr, 1, 1);
|
||||
|
||||
Logger logger_hls("HLS");
|
||||
|
||||
volatile rcv_state_t state = RCV_INIT;
|
||||
// Start data collection
|
||||
data_collection_fsm(data_0, data_1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
cfg.mode,
|
||||
float2uint(cfg.energy_kev),
|
||||
cfg.nframes,
|
||||
cfg.nmodules,
|
||||
cfg.nstorage_cells,
|
||||
cfg.nsummation , state);
|
||||
|
||||
run_data_collection = 0;
|
||||
data_collection_fsm(data_0, data_1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
cfg.mode,
|
||||
float2uint(cfg.energy_kev),
|
||||
cfg.nframes,
|
||||
cfg.nmodules,
|
||||
cfg.nstorage_cells,
|
||||
cfg.nsummation, state);
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
while (!udp_done) {
|
||||
if (din_eth.empty() && din_frame_generator.empty())
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(10));
|
||||
else
|
||||
stream_merge(din_eth, din_frame_generator, network0, data_source);
|
||||
}
|
||||
logger_hls.Info("Stream_merge done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
while (!udp_done) {
|
||||
if (network0.empty())
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(10));
|
||||
else
|
||||
ethernet(network0, ip1, arp1, mac_addr, eth_packets, clear_counters);
|
||||
}
|
||||
logger_hls.Info("ethernet done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
while (!udp_done) {
|
||||
if (ip1.empty())
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(10));
|
||||
else
|
||||
ipv4(ip1, udp1, icmp1, ipv4_addr);
|
||||
}
|
||||
logger_hls.Info("ipv4 done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
ap_uint<1> udp_idle = 1;
|
||||
while (!done || !udp_idle) {
|
||||
if (udp1.empty())
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(10));
|
||||
else
|
||||
udp(udp1, udp2, udp_metadata, udp_packets, clear_counters, udp_idle);
|
||||
}
|
||||
udp_done = true;
|
||||
logger_hls.Info("udp done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
ap_uint<1> sls_idle = 1;
|
||||
while (!done || !sls_idle) {
|
||||
if (udp2.empty())
|
||||
std::this_thread::sleep_for(std::chrono::microseconds (10));
|
||||
else
|
||||
sls_detector(udp2, udp_metadata, data_0, addr0, sls_packets, udp_eth_err, udp_len_err, current_pulse_id,
|
||||
clear_counters, sls_idle);
|
||||
}
|
||||
sls_done = true;
|
||||
logger_hls.Info("sls_detector done");
|
||||
});
|
||||
|
||||
// 1. Parse incoming UDP packets
|
||||
hls_cores.emplace_back([&] {
|
||||
while ((state != RCV_WAIT_FOR_START) || (idle_data_collection.read() == 0) || (!data_0.empty())) {
|
||||
data_collection_fsm(data_0, data_1,
|
||||
addr0, addr1,
|
||||
run_data_collection,
|
||||
cancel_data_collection,
|
||||
idle_data_collection,
|
||||
cfg.mode,
|
||||
float2uint(cfg.energy_kev),
|
||||
cfg.nframes,
|
||||
cfg.nmodules,
|
||||
cfg.nstorage_cells,
|
||||
cfg.nsummation,
|
||||
state);
|
||||
}
|
||||
done = true;
|
||||
|
||||
logger_hls.Info("data collection done");
|
||||
});
|
||||
|
||||
// 2. Cache images in HBM
|
||||
hls_cores.emplace_back([&] { save_to_hbm(addr1, axi_compl[0], hbm_handles,
|
||||
datamover_out_hbm_0.GetCtrlStream(),
|
||||
datamover_out_hbm_1.GetCtrlStream(),
|
||||
save_to_hbm_idle,
|
||||
hbm_if_size);});
|
||||
|
||||
hls_cores.emplace_back([&] { save_to_hbm_data(data_1,
|
||||
data_3,
|
||||
datamover_out_hbm_0.GetDataStream(),
|
||||
datamover_out_hbm_1.GetDataStream());});
|
||||
|
||||
hls_cores.emplace_back([&] {frame_summation_reorder_compl(data_3, data_4, axi_compl[0], axi_compl[1]);});
|
||||
|
||||
hls_cores.emplace_back([&] { load_from_hbm(data_4, data_5, axi_compl[1], axi_compl[2], hbm_handles,
|
||||
datamover_in_hbm_0.GetDataStream(), datamover_in_hbm_1.GetDataStream(),
|
||||
datamover_in_hbm_0.GetCtrlStream(), datamover_in_hbm_1.GetCtrlStream(),
|
||||
load_to_hbm_idle, hbm_if_size);});
|
||||
|
||||
hls_cores.emplace_back([&] { pedestal(data_5, data_6, axi_compl[2], axi_compl[3],
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm_if_size);});
|
||||
|
||||
|
||||
// 3. Calculate histogram of ADU values
|
||||
hls_cores.emplace_back([&] { adu_histo(data_6, data_7, adu_histo_result, axi_compl[3], axi_compl[4]);});
|
||||
|
||||
// 4. Mask missing pixels
|
||||
hls_cores.emplace_back([&] { mask_missing(data_7, data_8, axi_compl[4], axi_compl[5]);});
|
||||
|
||||
// 5. Handle EIGER packets properly
|
||||
hls_cores.emplace_back([&] { eiger_reorder(data_8, data_9, axi_compl[5], axi_compl[6]);});
|
||||
|
||||
// 6. Apply pedestal & gain corrections
|
||||
hls_cores.emplace_back([&] { jf_conversion(data_9, stream_768_0,
|
||||
axi_compl[6], axi_compl[7],
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm_if_size); });
|
||||
|
||||
// 7. Frame summation
|
||||
hls_cores.emplace_back([&] { frame_summation(stream_768_0, stream_768_1, axi_compl[7], axi_compl[8], frame_summation_idle);});
|
||||
|
||||
// 8. Integration of pixels
|
||||
hls_cores.emplace_back([&] { integration(stream_768_1, stream_768_2, integration_result_0, axi_compl[8], axi_compl[9],
|
||||
hbm.data(), hbm.data(), hbm.data(), hbm.data(), integration_idle, hbm_if_size);});
|
||||
hls_cores.emplace_back([&] { axis_64_to_512(integration_result_0, integration_result_1);});
|
||||
|
||||
// 9. Spot finding
|
||||
ap_uint<32> tmp_snr_threshold = float2uint(spot_finder_parameters.snr_threshold);
|
||||
ap_uint<32> min_d = float2uint(spot_finder_parameters.min_d);
|
||||
ap_uint<32> max_d = float2uint(spot_finder_parameters.max_d);
|
||||
ap_int<32> tmp_count_threshold = spot_finder_parameters.count_threshold;
|
||||
ap_uint<32> min_pix_per_spot = spot_finder_parameters.min_pix_per_spot;
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
spot_finder_mask(stream_768_2,
|
||||
stream_768_3,
|
||||
spot_finder_mask_0,
|
||||
axi_compl[9],
|
||||
axi_compl[10],
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
min_d,
|
||||
max_d,
|
||||
hbm_if_size);
|
||||
logger_hls.Info("spot_finder_mask done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
spot_finder(stream_768_3, spot_finder_mask_0, stream_768_4, spot_finder_result_0, tmp_count_threshold, tmp_snr_threshold);
|
||||
logger_hls.Info("spot_finder done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
spot_finder_connectivity(spot_finder_result_0,
|
||||
spot_finder_result_1,
|
||||
spot_finder_conn_0);
|
||||
logger_hls.Info("spot_finder_connectivity done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
spot_finder_merge(spot_finder_result_1,
|
||||
spot_finder_conn_0,
|
||||
spot_finder_result_2,
|
||||
min_pix_per_spot);
|
||||
logger_hls.Info("spot_finder_merge done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
axis_32_to_512(spot_finder_result_2, spot_finder_result_3);
|
||||
logger_hls.Info("axis_32_to_512 done");
|
||||
});
|
||||
|
||||
hls_cores.emplace_back([&] {
|
||||
roi_calc(stream_768_4,
|
||||
stream_768_5,
|
||||
roi_calc_result_0,
|
||||
axi_compl[10],
|
||||
axi_compl[11],
|
||||
hbm.data(),
|
||||
hbm.data(),
|
||||
hbm_if_size);
|
||||
logger_hls.Info("roi_calc done");
|
||||
});
|
||||
|
||||
// 10. Reduce/extend 24-bit stream
|
||||
hls_cores.emplace_back([&] { stream_24bit_conv(stream_768_5, data_12, stream_conv_idle);});
|
||||
|
||||
// 11. Prepare data to write to host memory
|
||||
hls_cores.emplace_back([&] {
|
||||
ap_uint<3> state;
|
||||
host_writer(data_12, adu_histo_result, integration_result_1, spot_finder_result_3, roi_calc_result_0,
|
||||
axi_compl[11], datamover_out.GetDataStream(),
|
||||
datamover_out.GetCtrlStream(), work_request_stream, completion_stream,
|
||||
dma_address_table.data(), packets_processed, host_writer_idle, cancel_data_collection, state);
|
||||
logger_hls.Info("host_writer done");
|
||||
});
|
||||
|
||||
for (auto &i : hls_cores)
|
||||
i.join();
|
||||
|
||||
if (frame_generator_future.valid())
|
||||
frame_generator_future.get();
|
||||
|
||||
// reset static counter
|
||||
arp(arp1, dout_eth, mac_addr, ipv4_addr, 0, 1);
|
||||
try {
|
||||
while (!din_eth.empty())
|
||||
din_eth.read();
|
||||
|
||||
if (!addr1.empty())
|
||||
throw std::runtime_error("Addr1 queue not empty");
|
||||
|
||||
if (!addr2.empty())
|
||||
throw std::runtime_error("Addr2 queue not empty");
|
||||
|
||||
if (!addr3.empty())
|
||||
throw std::runtime_error("Addr3 queue not empty");
|
||||
|
||||
if (!data_1.empty())
|
||||
throw std::runtime_error("data_1 queue not empty");
|
||||
|
||||
if (!data_2.empty())
|
||||
throw std::runtime_error("data_2 queue not empty");
|
||||
|
||||
if (!data_3.empty())
|
||||
throw std::runtime_error("data_3 queue not empty");
|
||||
|
||||
if (!data_4.empty())
|
||||
throw std::runtime_error("data_4 queue not empty");
|
||||
|
||||
if (!data_5.empty())
|
||||
throw std::runtime_error("data_5 queue not empty");
|
||||
|
||||
if (!data_7.empty())
|
||||
throw std::runtime_error("data_7 queue not empty");
|
||||
|
||||
if (!data_8.empty())
|
||||
throw std::runtime_error("data_8 queue not empty");
|
||||
|
||||
if (!data_9.empty())
|
||||
throw std::runtime_error("data_9 queue not empty");
|
||||
|
||||
if (!data_10.empty())
|
||||
throw std::runtime_error("data_10 queue not empty");
|
||||
|
||||
|
||||
|
||||
if (!data_12.empty())
|
||||
throw std::runtime_error("data_12 queue not empty");
|
||||
|
||||
if (!data_13.empty())
|
||||
throw std::runtime_error("data_13 queue not empty");
|
||||
|
||||
for (auto &c: axi_compl) {
|
||||
if (!c.empty())
|
||||
throw std::runtime_error("Compl queue not empty");
|
||||
}
|
||||
|
||||
if (!stream_768_0.empty())
|
||||
throw std::runtime_error("stream_768_0 queue not empty");
|
||||
|
||||
if (!stream_768_1.empty())
|
||||
throw std::runtime_error("stream_768_1 queue not empty");
|
||||
|
||||
if (!stream_768_2.empty())
|
||||
throw std::runtime_error("stream_768_2 queue not empty");
|
||||
|
||||
if (!stream_768_3.empty())
|
||||
throw std::runtime_error("stream_768_3 queue not empty");
|
||||
|
||||
if (!stream_768_4.empty())
|
||||
throw std::runtime_error("stream_768_4 queue not empty");
|
||||
|
||||
if (!hbm_handles.empty())
|
||||
throw std::runtime_error("Handles queue not empty");
|
||||
|
||||
if (!integration_result_0.empty())
|
||||
throw std::runtime_error("Integration result queue not empty");
|
||||
|
||||
if (!integration_result_1.empty())
|
||||
throw std::runtime_error("Integration result queue not empty");
|
||||
|
||||
if (!datamover_in.GetDataStream().empty())
|
||||
throw std::runtime_error("Datamover queue is not empty");
|
||||
|
||||
while (!datamover_out.IsIdle())
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
} catch (const std::runtime_error &e) {
|
||||
if (logger)
|
||||
logger->ErrorException(e);
|
||||
throw e;
|
||||
}
|
||||
if (logger)
|
||||
logger->Info("Packets Eth {} UDP {} SLS {} Proc {}", eth_packets, udp_packets, sls_packets, packets_processed);
|
||||
idle = true;
|
||||
return device->HW_SendWorkRequest(handle);
|
||||
}
|
||||
|
||||
DataCollectionStatus HLSSimulatedDevice::GetDataCollectionStatus() const {
|
||||
DataCollectionStatus status{};
|
||||
|
||||
union {
|
||||
uint64_t u64;
|
||||
double d;
|
||||
} pulse_id_conv;
|
||||
pulse_id_conv.u64 = current_pulse_id;
|
||||
|
||||
status.ctrl_reg = ap_uint<1>(host_writer_idle) ? (1 << 4) : 0;
|
||||
status.max_modules = max_modules;
|
||||
status.hbm_size_bytes = hbm_if_size;
|
||||
status.run_counter = run_counter;
|
||||
status.current_pulseid = pulse_id_conv.d;
|
||||
status.packets_udp = udp_packets;
|
||||
status.packets_eth = eth_packets;
|
||||
status.packets_sls = sls_packets;
|
||||
|
||||
return status;
|
||||
return device->GetDataCollectionStatus();
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HW_LoadCalibration(const LoadCalibrationConfig &config) {
|
||||
int ret = load_calibration(hbm.data(), hbm.data(),
|
||||
config,
|
||||
hbm_if_size,
|
||||
datamover_in.GetCtrlStream(),
|
||||
datamover_in.GetDataStream(),
|
||||
dma_address_table.data());
|
||||
if (ret)
|
||||
throw JFJochException(JFJochExceptionCategory::AcquisitionDeviceError,
|
||||
"Error in loading calibration " + std::to_string(ret));
|
||||
|
||||
if (!datamover_in.GetDataStream().empty())
|
||||
throw std::runtime_error("Datamover queue is not empty");
|
||||
device->HW_LoadCalibration(config);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HW_SetSpotFinderParameters(const SpotFinderParameters ¶ms) {
|
||||
spot_finder_parameters = params;
|
||||
device->HW_SetSpotFinderParameters(params);
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::HW_SetDataSource(uint32_t val) {
|
||||
data_source = val;
|
||||
device->HW_SetDataSource(val);
|
||||
}
|
||||
|
||||
uint32_t HLSSimulatedDevice::HW_GetDataSource() {
|
||||
return data_source;
|
||||
return device->HW_GetDataSource();
|
||||
}
|
||||
|
||||
void HLSSimulatedDevice::CreateXfelBunchIDPacket(double pulse_id, uint32_t event_code) {
|
||||
|
||||
union {
|
||||
uint64_t u64;
|
||||
double d;
|
||||
} pulse_id_conv;
|
||||
pulse_id_conv.d = pulse_id;
|
||||
|
||||
bunchid_raw_packet packet{};
|
||||
|
||||
packet.ether_type = htons(0x0800);
|
||||
for (int i = 0; i < 6; i++)
|
||||
packet.dest_mac[i] = 0xFF;
|
||||
|
||||
packet.ipv4_header_h = htons(0x4500); // Big endian in IP header!
|
||||
packet.ipv4_header_total_length = htons(sizeof(bunchid_payload) + 8 + 20); // Big endian in IP header!
|
||||
packet.ipv4_header_dest_ip = UINT32_MAX;
|
||||
|
||||
packet.ipv4_header_ttl_protocol = htons(0x0011);
|
||||
packet.ipv4_header_checksum = checksum( (uint16_t *) &packet.ipv4_header_h, 20); // checksum is already in network order
|
||||
|
||||
packet.udp_length = htons(sizeof(bunchid_payload) + 8);
|
||||
packet.payload.magicn[0] = BUNCHID_MAGICN;
|
||||
packet.payload.magicn[1] = BUNCHID_MAGICN;
|
||||
packet.payload.magicn[2] = BUNCHID_MAGICN;
|
||||
packet.payload.bunchid_msb[0] = (pulse_id_conv.u64 >> 32) & UINT32_MAX;
|
||||
packet.payload.bunchid_msb[1] = (pulse_id_conv.u64 >> 32) & UINT32_MAX;
|
||||
packet.payload.bunchid_lsb[0] = pulse_id_conv.u64 & UINT32_MAX;
|
||||
packet.payload.bunchid_lsb[1] = pulse_id_conv.u64 & UINT32_MAX;
|
||||
packet.payload.montrig = event_code;
|
||||
|
||||
SendPacket((char *) &packet, sizeof(bunchid_raw_packet));
|
||||
device->CreateXfelBunchIDPacket(pulse_id, event_code);
|
||||
}
|
||||
|
||||
DeviceStatus HLSSimulatedDevice::GetDeviceStatus() const {
|
||||
DeviceStatus status{};
|
||||
|
||||
strncpy(status.serial_number, "HLS1", sizeof(status.device_number));
|
||||
strncpy(status.device_number, "HLS device", sizeof(status.device_number));
|
||||
status.fpga_default_mac_addr = mac_addr;
|
||||
status.eth_link_count = 1;
|
||||
status.eth_link_status = 1;
|
||||
status.packets_sls = device->GetSLSPackets();
|
||||
status.packets_udp = device->GetUDPPackets();
|
||||
status.hbm_0_temp_C = 0;
|
||||
status.hbm_1_temp_C = 0;
|
||||
status.fpga_temp_C = 0;
|
||||
return status;
|
||||
}
|
||||
@@ -5,61 +5,13 @@
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include "../fpga/hls/hls_jfjoch.h"
|
||||
#include "../fpga/hls/datamover_model.h"
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "FPGAAcquisitionDevice.h"
|
||||
#include "../jungfrau/sls_packet.h"
|
||||
#include "../fpga/hls/HLSDevice.h"
|
||||
|
||||
uint16_t checksum(const uint16_t *addr, size_t count);
|
||||
#include "FPGAAcquisitionDevice.h"
|
||||
|
||||
class HLSSimulatedDevice : public FPGAAcquisitionDevice {
|
||||
AXI_STREAM din_eth;
|
||||
AXI_STREAM din_frame_generator;
|
||||
AXI_STREAM dout_eth;
|
||||
|
||||
uint32_t run_counter = 0;
|
||||
|
||||
ap_uint<2> data_source = STREAM_MERGE_SRC_NETWORK;
|
||||
SpotFinderParameters spot_finder_parameters;
|
||||
|
||||
uint64_t current_pulse_id = 0;
|
||||
|
||||
DataCollectionConfig cfg;
|
||||
|
||||
volatile bool idle;
|
||||
|
||||
constexpr static const size_t hbm_if_count = 32;
|
||||
constexpr static const size_t hbm_if_size = 32*1024*1024LU;
|
||||
std::vector<ap_uint<256>> hbm;
|
||||
|
||||
hls::stream<ap_uint<32> > work_request_stream;
|
||||
hls::stream<ap_uint<32> > completion_stream;
|
||||
std::mutex completion_mutex;
|
||||
uint32_t completion_count;
|
||||
|
||||
std::thread action_thread;
|
||||
std::future<void> frame_generator_future;
|
||||
|
||||
Datamover<512> datamover_in;
|
||||
Datamover<512> datamover_out;
|
||||
Datamover<256> datamover_in_hbm_0;
|
||||
Datamover<256> datamover_in_hbm_1;
|
||||
Datamover<256, 16> datamover_out_hbm_0;
|
||||
Datamover<256, 16> datamover_out_hbm_1;
|
||||
|
||||
ap_uint<1> run_data_collection;
|
||||
ap_uint<1> cancel_data_collection;
|
||||
volatile ap_uint<1> host_writer_idle;
|
||||
|
||||
std::vector<uint64_t> dma_address_table;
|
||||
|
||||
uint64_t eth_packets = 0;
|
||||
uint64_t icmp_packets = 0;
|
||||
uint64_t udp_packets = 0;
|
||||
uint64_t sls_packets = 0;
|
||||
uint32_t udp_len_err = 0;
|
||||
uint32_t udp_eth_err = 0;
|
||||
std::unique_ptr<HLSDevice> device;
|
||||
|
||||
void HW_ReadActionRegister(DataCollectionConfig *job) override;
|
||||
void HW_WriteActionRegister(const DataCollectionConfig *job) override;
|
||||
@@ -74,12 +26,9 @@ class HLSSimulatedDevice : public FPGAAcquisitionDevice {
|
||||
uint32_t HW_GetDataSource() override;
|
||||
void HW_SetDataSource(uint32_t val) override;
|
||||
void HW_RunInternalGenerator(const FrameGeneratorConfig &config) override;
|
||||
void FrameGeneratorFuture(FrameGeneratorConfig config);
|
||||
void HLSMainThread();
|
||||
public:
|
||||
HLSSimulatedDevice(uint16_t data_stream, size_t in_frame_buffer_size_modules, int16_t numa_node = -1);
|
||||
~HLSSimulatedDevice() override;
|
||||
void SendPacket(char *buffer, int len, uint8_t user = 0);
|
||||
~HLSSimulatedDevice() override = default;
|
||||
void CreateJFPacket(const DiffractionExperiment& experiment, uint64_t frame_number, uint32_t eth_packet,
|
||||
uint32_t module_number, const uint16_t *data, int8_t adjust_axis = 0, uint8_t user = 0);
|
||||
void CreateJFPackets(const DiffractionExperiment& experiment, uint64_t frame_number_0, uint64_t frames,
|
||||
@@ -90,8 +39,8 @@ public:
|
||||
void CreateXfelBunchIDPacket(double bunchid, uint32_t event_code);
|
||||
void CreateFinalPacket(const DiffractionExperiment& experiment);
|
||||
DataCollectionStatus GetDataCollectionStatus() const override;
|
||||
AXI_STREAM &OutputStream();
|
||||
void Cancel() override;
|
||||
DeviceStatus GetDeviceStatus() const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -70,14 +70,6 @@ std::string PCIExpressDevice::GetMACAddress() const {
|
||||
return MacAddressToStr(dev.GetMACAddress());
|
||||
}
|
||||
|
||||
void PCIExpressDevice::SetMACAddress(uint64_t mac_addr_network_order) {
|
||||
dev.SetMACAddress(mac_addr_network_order);
|
||||
}
|
||||
|
||||
void PCIExpressDevice::HW_GetEnvParams(DeviceStatus *status) const {
|
||||
*status = dev.GetDeviceStatus();
|
||||
}
|
||||
|
||||
uint32_t PCIExpressDevice::GetNumKernelBuffers() const {
|
||||
return dev.GetBufferCount();
|
||||
}
|
||||
@@ -86,12 +78,12 @@ int32_t PCIExpressDevice::GetNUMANode() const {
|
||||
return dev.GetNumaNode();
|
||||
}
|
||||
|
||||
void PCIExpressDevice::SetDefaultMAC() {
|
||||
dev.SetDefaultMACAddress();
|
||||
}
|
||||
|
||||
void PCIExpressDevice::SetIPv4Address(uint32_t ipv4_addr_network_order) {
|
||||
dev.SetIPv4Address(ipv4_addr_network_order);
|
||||
// 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);
|
||||
}
|
||||
|
||||
std::string PCIExpressDevice::GetIPv4Address() const {
|
||||
|
||||
@@ -28,12 +28,8 @@ public:
|
||||
PCIExpressDevice(uint16_t data_stream, const std::string &device_name);
|
||||
|
||||
void Cancel() override;
|
||||
void HW_GetEnvParams(DeviceStatus *status) const override;
|
||||
|
||||
int32_t GetNUMANode() const override;
|
||||
|
||||
void SetMACAddress(uint64_t mac_addr_network_order) override;
|
||||
void SetDefaultMAC();
|
||||
void SetIPv4Address(uint32_t ipv4_addr_network_order) override;
|
||||
|
||||
std::string GetMACAddress() const override;
|
||||
|
||||
@@ -8,7 +8,9 @@ TARGET_INCLUDE_DIRECTORIES(JFJochAPI PUBLIC gen/model gen/api)
|
||||
ADD_LIBRARY(JFJochBroker STATIC
|
||||
JFJochStateMachine.cpp JFJochStateMachine.h
|
||||
JFJochServices.cpp JFJochServices.h
|
||||
JFJochBrokerHttp.cpp JFJochBrokerHttp.h JFJochBrokerParser.cpp JFJochBrokerParser.h)
|
||||
JFJochBrokerHttp.cpp JFJochBrokerHttp.h JFJochBrokerParser.cpp JFJochBrokerParser.h
|
||||
OpenAPIConvert.h
|
||||
OpenAPIConvert.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochBroker JFJochReceiver JFJochDetector JFJochCommon JFJochAPI JFJochPreview)
|
||||
|
||||
|
||||
@@ -1,441 +1,18 @@
|
||||
// Copyright (2019-2023) Paul Scherrer Institute
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
// Using OpenAPI licensed with Apache License 2.0
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "JFJochBrokerHttp.h"
|
||||
#include "gen/model/Error_message.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
#include "../common/GitInfo.h"
|
||||
|
||||
// From https://en.cppreference.com/w/cpp/string/byte/tolower
|
||||
inline std::string str_tolower(std::string s) {
|
||||
std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c){ return std::tolower(c); });
|
||||
return s;
|
||||
}
|
||||
|
||||
inline SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input) {
|
||||
SpotFindingSettings ret{};
|
||||
ret.signal_to_noise_threshold = input.getSignalToNoiseThreshold();
|
||||
ret.photon_count_threshold = input.getPhotonCountThreshold();
|
||||
ret.min_pix_per_spot = input.getMinPixPerSpot();
|
||||
ret.max_pix_per_spot = input.getMaxPixPerSpot();
|
||||
ret.high_resolution_limit = input.getHighResolutionLimit();
|
||||
ret.low_resolution_limit = input.getLowResolutionLimit();
|
||||
ret.enable = input.isEnable();
|
||||
ret.indexing = input.isIndexing();
|
||||
ret.indexing_tolerance = input.getIndexingTolerance();
|
||||
if (input.filterPowderRingsIsSet())
|
||||
ret.filter_spots_powder_ring = input.isFilterPowderRings();
|
||||
if (input.minSpotCountPowderRingIsSet())
|
||||
ret.min_spot_count_powder_ring = input.getMinSpotCountPowderRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input) {
|
||||
org::openapitools::server::model::Spot_finding_settings ret;
|
||||
ret.setSignalToNoiseThreshold(input.signal_to_noise_threshold);
|
||||
ret.setPhotonCountThreshold(input.photon_count_threshold);
|
||||
ret.setMinPixPerSpot(input.min_pix_per_spot);
|
||||
ret.setMaxPixPerSpot(input.max_pix_per_spot);
|
||||
ret.setHighResolutionLimit(input.high_resolution_limit);
|
||||
ret.setLowResolutionLimit(input.low_resolution_limit);
|
||||
ret.setEnable(input.enable);
|
||||
ret.setIndexing(input.indexing);
|
||||
ret.setIndexingTolerance(input.indexing_tolerance);
|
||||
ret.setFilterPowderRings(input.filter_spots_powder_ring);
|
||||
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input) {
|
||||
org::openapitools::server::model::Measurement_statistics ret{};
|
||||
|
||||
if (!input.file_prefix.empty())
|
||||
ret.setFilePrefix(input.file_prefix);
|
||||
|
||||
ret.setExperimentGroup(input.experiment_group);
|
||||
ret.setImagesExpected(input.images_expected);
|
||||
ret.setImagesCollected(input.images_collected);
|
||||
ret.setImagesSent(input.images_sent);
|
||||
ret.setImagesDiscardedLossyCompression(input.images_skipped);
|
||||
ret.setMaxImageNumberSent(input.max_image_number_sent);
|
||||
if (input.collection_efficiency)
|
||||
ret.setCollectionEfficiency(input.collection_efficiency.value());
|
||||
if (input.compression_ratio)
|
||||
ret.setCompressionRatio(input.compression_ratio.value());
|
||||
|
||||
ret.setCancelled(input.cancelled);
|
||||
ret.setMaxReceiverDelay(input.max_receive_delay);
|
||||
|
||||
ret.setDetectorWidth(input.detector_width);
|
||||
ret.setDetectorHeight(input.detector_height);
|
||||
ret.setDetectorPixelDepth(input.detector_pixel_depth);
|
||||
|
||||
if (input.indexing_rate)
|
||||
ret.setIndexingRate(input.indexing_rate.value());
|
||||
|
||||
if (input.bkg_estimate)
|
||||
ret.setBkgEstimate(input.bkg_estimate.value());
|
||||
ret.setUnitCell(input.unit_cell);
|
||||
ret.setRunNumber(input.run_number);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input) {
|
||||
DetectorSettings ret{};
|
||||
|
||||
ret.frame_time_us = input.getFrameTimeUs();
|
||||
if (input.countTimeUsIsSet())
|
||||
ret.count_time_us = input.getCountTimeUs();
|
||||
|
||||
ret.storage_cell_count = input.getStorageCellCount();
|
||||
|
||||
ret.use_internal_packet_generator = input.isInternalFrameGenerator();
|
||||
ret.collect_raw_data = input.isCollectRawData();
|
||||
ret.fixed_gain_g1 = input.isFixedGainG1();
|
||||
ret.use_gain_hg0 = input.isUseGainHg0();
|
||||
|
||||
if (input.pedestalG0FramesIsSet())
|
||||
ret.pedestal_g0_frames = input.getPedestalG0Frames();
|
||||
if (input.pedestalG1FramesIsSet())
|
||||
ret.pedestal_g1_frames = input.getPedestalG1Frames();
|
||||
if (input.pedestalG2FramesIsSet())
|
||||
ret.pedestal_g2_frames = input.getPedestalG2Frames();
|
||||
if (input.storageCellDelayUsIsSet() && std::isfinite(input.getStorageCellDelayUs()))
|
||||
ret.storage_cell_delay_ns = std::round(input.getStorageCellDelayUs() * 1000.0f);
|
||||
if (input.detectorTriggerDelayUsIsSet() && std::isfinite(input.getDetectorTriggerDelayUs()))
|
||||
ret.detector_delay_ns = std::round(input.getDetectorTriggerDelayUs() * 1000.0f);
|
||||
if (input.internalFrameGeneratorImagesIsSet())
|
||||
ret.internal_packet_generator_images = input.getInternalFrameGeneratorImages();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Detector_settings Convert(const DetectorSettings &input) {
|
||||
org::openapitools::server::model::Detector_settings ret{};
|
||||
|
||||
ret.setFrameTimeUs(input.frame_time_us);
|
||||
if (input.count_time_us)
|
||||
ret.setCountTimeUs(input.count_time_us.value());
|
||||
|
||||
ret.setStorageCellCount(input.storage_cell_count);
|
||||
ret.setInternalFrameGenerator(input.use_internal_packet_generator);
|
||||
ret.setCollectRawData(input.collect_raw_data);
|
||||
ret.setFixedGainG1(input.fixed_gain_g1);
|
||||
ret.setUseGainHg0(input.use_gain_hg0);
|
||||
|
||||
if (input.pedestal_g0_frames)
|
||||
ret.setPedestalG0Frames(input.pedestal_g0_frames.value());
|
||||
if (input.pedestal_g1_frames)
|
||||
ret.setPedestalG1Frames(input.pedestal_g1_frames.value());
|
||||
if (input.pedestal_g2_frames)
|
||||
ret.setPedestalG2Frames(input.pedestal_g2_frames.value());
|
||||
|
||||
if (input.storage_cell_delay_ns)
|
||||
ret.setStorageCellDelayUs(static_cast<float>(input.storage_cell_delay_ns.value()) / 1000.0f);
|
||||
if (input.detector_delay_ns)
|
||||
ret.setDetectorTriggerDelayUs(static_cast<float>(input.detector_delay_ns.value()) / 1000.0f);
|
||||
if (input.internal_packet_generator_images)
|
||||
ret.setInternalFrameGeneratorImages(input.internal_packet_generator_images.value());
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Broker_status Convert(const BrokerStatus& input) {
|
||||
org::openapitools::server::model::Broker_status ret;
|
||||
|
||||
switch (input.broker_state) {
|
||||
case JFJochState::Inactive:
|
||||
ret.setState("Inactive");
|
||||
break;
|
||||
case JFJochState::Idle:
|
||||
ret.setState("Idle");
|
||||
break;
|
||||
case JFJochState::Measuring:
|
||||
ret.setState("Measuring");
|
||||
break;
|
||||
case JFJochState::Error:
|
||||
ret.setState("Error");
|
||||
break;
|
||||
case JFJochState::Busy:
|
||||
ret.setState("Busy");
|
||||
break;
|
||||
case JFJochState::Pedestal:
|
||||
ret.setState("Pedestal");
|
||||
break;
|
||||
}
|
||||
if (input.progress.has_value())
|
||||
ret.setProgress(input.progress.value());
|
||||
if (input.indexing_rate.has_value() && (input.indexing_rate >= 0.0))
|
||||
ret.setIndexingRate(input.indexing_rate.value());
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Calibration_statistics_inner Convert(const JFCalibrationModuleStatistics& input) {
|
||||
org::openapitools::server::model::Calibration_statistics_inner output;
|
||||
|
||||
output.setModuleNumber(input.module_number);
|
||||
output.setMaskedPixels(input.bad_pixels);
|
||||
output.setStorageCellNumber(input.storage_cell_number);
|
||||
output.setGainG0Mean(input.gain_g0_mean);
|
||||
output.setGainG1Mean(input.gain_g1_mean);
|
||||
output.setGainG2Mean(input.gain_g2_mean);
|
||||
output.setPedestalG0Mean(input.pedestal_g0_mean);
|
||||
output.setPedestalG1Mean(input.pedestal_g1_mean);
|
||||
output.setPedestalG2Mean(input.pedestal_g2_mean);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Detector_status Convert(const DetectorStatus &input) {
|
||||
org::openapitools::server::model::Detector_status output;
|
||||
output.setServerVersion(input.detector_server_version);
|
||||
output.setNumberOfTriggersLeft(input.remaining_triggers);
|
||||
output.setFpgaTempDegC(input.temperature_fpga_degC);
|
||||
output.setHighVoltageV(input.high_voltage_V);
|
||||
switch (input.power_state) {
|
||||
case DetectorPowerState::ON:
|
||||
output.setPowerchip("PowerOn");
|
||||
break;
|
||||
case DetectorPowerState::OFF:
|
||||
output.setPowerchip("PowerOff");
|
||||
break;
|
||||
case DetectorPowerState::PARTIAL:
|
||||
output.setPowerchip("Partial");
|
||||
break;
|
||||
}
|
||||
switch (input.detector_state) {
|
||||
|
||||
case DetectorState::IDLE:
|
||||
output.setState("Idle");
|
||||
break;
|
||||
case DetectorState::ERROR:
|
||||
output.setState("Error");
|
||||
break;
|
||||
case DetectorState::BUSY:
|
||||
output.setState("Busy");
|
||||
break;
|
||||
case DetectorState::WAITING:
|
||||
output.setState("Waiting");
|
||||
break;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Detector_list Convert(const DetectorList &input) {
|
||||
org::openapitools::server::model::Detector_list ret;
|
||||
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> dets;
|
||||
for (int i = 0; i < input.detector.size(); i++) {
|
||||
org::openapitools::server::model::Detector_list_detectors_inner d;
|
||||
d.setId(i);
|
||||
d.setDescription(input.detector[i].description);
|
||||
d.setNmodules(input.detector[i].nmodules);
|
||||
d.setHeight(input.detector[i].height);
|
||||
d.setWidth(input.detector[i].width);
|
||||
dets.emplace_back(std::move(d));
|
||||
}
|
||||
ret.setDetectors(dets);
|
||||
ret.setCurrentId(input.current_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Plots Convert(const MultiLinePlot& input) {
|
||||
std::vector<org::openapitools::server::model::Plot> tmp(input.size());
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
tmp[i].setTitle(input[i].title);
|
||||
tmp[i].setX(input[i].x);
|
||||
tmp[i].setY(input[i].y);
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Plots output;
|
||||
output.setPlot(tmp);
|
||||
return output;
|
||||
}
|
||||
|
||||
inline RadialIntegrationSettings Convert(const org::openapitools::server::model::Rad_int_settings& input) {
|
||||
RadialIntegrationSettings ret{};
|
||||
ret.solid_angle_correction = input.isSolidAngleCorr();
|
||||
if (input.polarizationFactorIsSet())
|
||||
ret.polarization_factor = input.getPolarizationFactor();
|
||||
ret.q_spacing = input.getQSpacing();
|
||||
ret.low_q_recipA = input.getLowQRecipA();
|
||||
ret.high_q_recipA = input.getHighQRecipA();
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Rad_int_settings Convert(const RadialIntegrationSettings& settings) {
|
||||
org::openapitools::server::model::Rad_int_settings ret{};
|
||||
ret.setSolidAngleCorr(settings.solid_angle_correction);
|
||||
if (settings.polarization_factor)
|
||||
ret.setPolarizationFactor(settings.polarization_factor.value());
|
||||
ret.setHighQRecipA(settings.high_q_recipA);
|
||||
ret.setLowQRecipA(settings.low_q_recipA);
|
||||
ret.setQSpacing(settings.q_spacing);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline std::vector<ROIBox> Convert(const org::openapitools::server::model::Roi_box_list& input) {
|
||||
std::vector<ROIBox> ret;
|
||||
for (const auto &i: input.getRois())
|
||||
ret.emplace_back(ROIBox(i.getName(), i.getMinXPxl(), i.getMaxXPxl(), i.getMinYPxl(), i.getMaxYPxl()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline std::vector<ROICircle> Convert(const org::openapitools::server::model::Roi_circle_list& input) {
|
||||
std::vector<ROICircle> ret;
|
||||
for (const auto &i: input.getRois())
|
||||
ret.emplace_back(ROICircle(i.getName(), i.getCenterXPxl(), i.getCenterYPxl(), i.getRadiusPxl()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline org::openapitools::server::model::Roi_circle_list Convert(const std::vector<ROICircle> &input) {
|
||||
org::openapitools::server::model::Roi_circle_list ret{};
|
||||
std::vector<org::openapitools::server::model::Roi_circle> tmp;
|
||||
for (const auto &i: input) {
|
||||
org::openapitools::server::model::Roi_circle elem;
|
||||
elem.setName(i.GetName());
|
||||
elem.setCenterXPxl(i.GetX());
|
||||
elem.setCenterYPxl(i.GetY());
|
||||
elem.setRadiusPxl(i.GetRadius_pxl());
|
||||
tmp.emplace_back(elem);
|
||||
}
|
||||
ret.setRois(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
inline org::openapitools::server::model::Roi_box_list Convert(const std::vector<ROIBox> &input) {
|
||||
org::openapitools::server::model::Roi_box_list ret{};
|
||||
std::vector<org::openapitools::server::model::Roi_box> tmp;
|
||||
for (const auto &i: input) {
|
||||
org::openapitools::server::model::Roi_box elem;
|
||||
elem.setName(i.GetName());
|
||||
elem.setMinXPxl(i.GetXMin());
|
||||
elem.setMaxXPxl(i.GetXMax());
|
||||
elem.setMinYPxl(i.GetYMin());
|
||||
elem.setMaxYPxl(i.GetYMax());
|
||||
tmp.emplace_back(elem);
|
||||
}
|
||||
ret.setRois(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline PreviewJPEGSettings Convert(const org::openapitools::server::model::Preview_settings& input) {
|
||||
PreviewJPEGSettings ret{};
|
||||
ret.show_spots = input.isShowSpots();
|
||||
ret.jpeg_quality = input.getJpegQuality();
|
||||
ret.saturation_value = input.getSaturation();
|
||||
ret.show_roi = input.isShowRoi();
|
||||
ret.show_indexed = input.isShowIndexed();
|
||||
ret.show_user_mask = input.isShowUserMask();
|
||||
if (input.resolutionRingIsSet())
|
||||
ret.resolution_ring = input.getResolutionRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input) {
|
||||
DatasetSettings ret;
|
||||
|
||||
ret.ImagesPerTrigger(input.getImagesPerTrigger());
|
||||
ret.NumTriggers(input.getNtrigger());
|
||||
|
||||
if (input.runNumberIsSet())
|
||||
ret.RunNumber(input.getRunNumber());
|
||||
if (input.runNameIsSet())
|
||||
ret.RunName(input.getRunName());
|
||||
|
||||
ret.ExperimentGroup(input.getExperimentGroup());
|
||||
|
||||
if (!input.fpgaOutputIsSet())
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Auto);
|
||||
else {
|
||||
std::string out = str_tolower(input.getFpgaOutput());
|
||||
if (out == "auto")
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Auto);
|
||||
else if (out == "int16")
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Int16);
|
||||
else if (out == "uint16")
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Uint16);
|
||||
else if (out == "int32")
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Int32);
|
||||
else if (out == "uint32")
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Uint32);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown output format");
|
||||
}
|
||||
|
||||
if (input.imageTimeUsIsSet())
|
||||
ret.ImageTime(std::chrono::microseconds(input.getImageTimeUs()));
|
||||
ret.BeamX_pxl(input.getBeamXPxl());
|
||||
ret.BeamY_pxl(input.getBeamYPxl());
|
||||
ret.DetectorDistance_mm(input.getDetectorDistanceMm());
|
||||
ret.PhotonEnergy_keV(input.getIncidentEnergyKeV());
|
||||
ret.PhotonEnergyMultiplayer(input.getEnergyMultiplier());
|
||||
|
||||
ret.FilePrefix(input.getFilePrefix());
|
||||
|
||||
if (!input.compressionIsSet())
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_LZ4);
|
||||
else {
|
||||
std::string compr = str_tolower(input.getCompression());
|
||||
if (compr == "bslz4")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_LZ4);
|
||||
else if (compr == "bszstd")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
else if (compr == "bszstd_rle")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD_RLE);
|
||||
else if (compr == "none")
|
||||
ret.Compression(CompressionAlgorithm::NO_COMPRESSION);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown compression");
|
||||
}
|
||||
|
||||
if (input.unitCellIsSet())
|
||||
ret.SetUnitCell(UnitCell{
|
||||
.a = input.getUnitCell().getA(),
|
||||
.b = input.getUnitCell().getB(),
|
||||
.c = input.getUnitCell().getC(),
|
||||
.alpha = input.getUnitCell().getAlpha(),
|
||||
.beta = input.getUnitCell().getBeta(),
|
||||
.gamma = input.getUnitCell().getGamma()
|
||||
});
|
||||
|
||||
if (input.totalFluxIsSet())
|
||||
ret.TotalFlux(input.getTotalFlux());
|
||||
if (input.transmissionIsSet())
|
||||
ret.AttenuatorTransmission(input.getTransmission());
|
||||
|
||||
if (input.goniometerIsSet()) {
|
||||
ret.Goniometer(GoniometerAxis{
|
||||
.name = input.getGoniometer().getName(),
|
||||
.increment = input.getGoniometer().getStep(),
|
||||
.start = input.getGoniometer().getStart()
|
||||
});
|
||||
if (input.getGoniometer().getVector().size() == 3) {
|
||||
auto v = input.getGoniometer().getVector();
|
||||
ret.RotationAxis(Coord(v[0], v[1], v[2]));
|
||||
}
|
||||
}
|
||||
|
||||
ret.SpaceGroupNumber(input.getSpaceGroupNumber());
|
||||
ret.SampleName(input.getSampleName());
|
||||
ret.HeaderAppendix(input.getHeaderAppendix());
|
||||
ret.ImageAppendix(input.getImageAppendix());
|
||||
ret.ImagesPerFile(input.getImagesPerFile());
|
||||
|
||||
if (input.dataReductionFactorSerialmxIsSet())
|
||||
ret.DataReductionFactorSerialMX(input.getDataReductionFactorSerialmx());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#include "OpenAPIConvert.h"
|
||||
|
||||
JFJochBrokerHttp::JFJochBrokerHttp(const DiffractionExperiment &experiment, std::shared_ptr<Pistache::Rest::Router> &rtr)
|
||||
: DefaultApi(rtr) {
|
||||
: DefaultApi(rtr) {
|
||||
Pistache::Rest::Routes::Get(*rtr, "/", Pistache::Rest::Routes::bind(&JFJochBrokerHttp::GetStaticFile, this));
|
||||
Pistache::Rest::Routes::Get(*rtr, "/frontend", Pistache::Rest::Routes::bind(&JFJochBrokerHttp::GetStaticFile, this));
|
||||
Pistache::Rest::Routes::Get(*rtr, "/frontend/*", Pistache::Rest::Routes::bind(&JFJochBrokerHttp::GetStaticFile, this));
|
||||
Pistache::Rest::Routes::Get(*rtr, "/frontend/static/js/*", Pistache::Rest::Routes::bind(&JFJochBrokerHttp::GetStaticFile, this));
|
||||
Pistache::Rest::Routes::Get(*rtr, "/frontend/static/css/*", Pistache::Rest::Routes::bind(&JFJochBrokerHttp::GetStaticFile, this));
|
||||
Pistache::Rest::Routes::Get(*rtr, "/frontend/assets/*", Pistache::Rest::Routes::bind(&JFJochBrokerHttp::GetStaticFile, this));
|
||||
|
||||
state_machine.NotThreadSafe_Experiment() = experiment;
|
||||
init();
|
||||
@@ -528,11 +105,11 @@ void JFJochBrokerHttp::config_detector_put(const org::openapitools::server::mode
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_rad_int_get(Pistache::Http::ResponseWriter &response) {
|
||||
void JFJochBrokerHttp::config_azim_int_get(Pistache::Http::ResponseWriter &response) {
|
||||
ProcessOutput(Convert(state_machine.GetRadialIntegrationSettings()), response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_rad_int_put(const org::openapitools::server::model::Rad_int_settings &radIntSettings,
|
||||
void JFJochBrokerHttp::config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &radIntSettings,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.SetRadialIntegrationSettings(Convert(radIntSettings));
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
@@ -560,16 +137,8 @@ void JFJochBrokerHttp::config_spot_finding_put(
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::IndexingRatePerTimePoint, 0, response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::plot_rad_int_get(Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::RadInt, 0, response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::plot_rad_int_per_file_get(Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::RadIntPerTimePoint, 0, response);
|
||||
void JFJochBrokerHttp::plot_azim_int_get(Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::AzInt, 0, response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::statistics_calibration_get(Pistache::Http::ResponseWriter &response) {
|
||||
@@ -627,9 +196,21 @@ void JFJochBrokerHttp::GetStaticFile(const Pistache::Rest::Request &request, Pis
|
||||
if ((request.resource() == "/")
|
||||
|| (request.resource() == "/frontend")
|
||||
|| (request.resource() == "/frontend/"))
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/index.html");
|
||||
else if (request.resource().substr(0, 10) == "/frontend/")
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/" + request.resource().substr(10));
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/index.html", MIME(Text, Html));
|
||||
else if (request.resource().starts_with("/frontend/")) {
|
||||
if (request.resource().ends_with(".js"))
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/" + request.resource().substr(10),
|
||||
MIME(Text,Javascript));
|
||||
else if (request.resource().ends_with(".css"))
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/" + request.resource().substr(10),
|
||||
MIME(Text,Css));
|
||||
else if (request.resource().ends_with(".html"))
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/" + request.resource().substr(10),
|
||||
MIME(Text,Html));
|
||||
else
|
||||
Pistache::Http::serveFile(response, frontend_directory + "/" + request.resource().substr(10));
|
||||
|
||||
}
|
||||
else response.send(Pistache::Http::Code::Not_Found);
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error(e.what());
|
||||
@@ -753,7 +334,7 @@ void JFJochBrokerHttp::xfel_pulse_id_get(Pistache::Http::ResponseWriter &respons
|
||||
|
||||
void JFJochBrokerHttp::preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel,
|
||||
const std::optional<int32_t> &sc,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
if (!gainLevel)
|
||||
response.send(Pistache::Http::Code::Bad_Request);
|
||||
std::string s = state_machine.GetPedestalTIFF(gainLevel.value(), sc ? sc.value() : 0);
|
||||
@@ -842,7 +423,7 @@ void JFJochBrokerHttp::config_user_mask_tiff_get(Pistache::Http::ResponseWriter
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_user_mask_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.SetUserPixelMask(request.body());
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
@@ -850,3 +431,41 @@ void JFJochBrokerHttp::config_user_mask_tiff_put(const Pistache::Rest::Request &
|
||||
void JFJochBrokerHttp::version_get(Pistache::Http::ResponseWriter &response) {
|
||||
response.send(Pistache::Http::Code::Ok, jfjoch_version(), MIME(Text, Plain));
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_instrument_get(Pistache::Http::ResponseWriter &response) {
|
||||
ProcessOutput(Convert(state_machine.GetInstrumentMetadata()), response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_instrument_put(const org::openapitools::server::model::Instrument_metadata
|
||||
&instrumentMetadata,Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.LoadInstrumentMetadata(Convert(instrumentMetadata));
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_image_format_get(Pistache::Http::ResponseWriter &response) {
|
||||
ProcessOutput(Convert(state_machine.GetImageFormatSettings()), response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_image_format_put(
|
||||
const org::openapitools::server::model::Image_format_settings &imageFormatSettings,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.LoadImageFormatSettings(Convert(imageFormatSettings));
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.ConvImageFormatSettings();
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_image_format_raw_post(Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.RawImageFormatSettings();
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::fpga_status_get(Pistache::Http::ResponseWriter &response) {
|
||||
nlohmann::json j;
|
||||
for (const auto &d: Convert(state_machine.GetDeviceStatus()))
|
||||
j.push_back(d);
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
}
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
Logger logger{"JFJochBroker"};
|
||||
JFJochServices services {logger};
|
||||
|
||||
void config_image_format_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void fpga_status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
JFJochStateMachine state_machine {services, logger};
|
||||
std::string frontend_directory;
|
||||
|
||||
@@ -25,9 +33,9 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_rad_int_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void config_azim_int_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_rad_int_put(const org::openapitools::server::model::Rad_int_settings &radIntSettings,
|
||||
void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &radIntSettings,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_select_detector_get(Pistache::Http::ResponseWriter &response) override;
|
||||
@@ -69,11 +77,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
void plot_strong_pixel_get(const std::optional<int32_t> &binning,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void plot_rad_int_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void plot_rad_int_per_file_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void plot_azim_int_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
@@ -128,6 +132,11 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_instrument_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void GetStaticFile(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception &ex) const noexcept override;
|
||||
|
||||
@@ -139,13 +148,16 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, s.str(), MIME(Text, Plain));
|
||||
}
|
||||
|
||||
nlohmann::json j;
|
||||
to_json(j, output);
|
||||
nlohmann::json j = output;
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
}
|
||||
|
||||
void version_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
public:
|
||||
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
|
||||
void AddDetectorSetup(const DetectorSetup &setup);
|
||||
|
||||
@@ -2,426 +2,152 @@
|
||||
|
||||
#include "JFJochBrokerParser.h"
|
||||
#include "../common/NetworkAddressConvert.h"
|
||||
#include "../frame_serialize/ZMQStream2Pusher.h"
|
||||
#include "../frame_serialize/DumpCBORToFilePusher.h"
|
||||
#include "../image_pusher/ZMQStream2Pusher.h"
|
||||
#include "../image_pusher/CBORFilePusher.h"
|
||||
#include "../image_pusher/HDF5FilePusher.h"
|
||||
#include "OpenAPIConvert.h"
|
||||
#include "Detector_type.h"
|
||||
|
||||
inline bool CHECK_ARRAY(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_array())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be array");
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
DetectorGeometry ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j) {
|
||||
auto s = j.getStandardGeometry();
|
||||
return {s.getNmodules(), s.getModulesInRow(), s.getGapX(), s.getGapY(), false};
|
||||
}
|
||||
|
||||
inline bool CHECK_OBJECT(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_object())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be object");
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
inline int64_t GET_I64(const nlohmann::json &j, const std::string& tag, int64_t def) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_number_integer())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
|
||||
try {
|
||||
return j[tag].get<int64_t>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
return def;
|
||||
}
|
||||
|
||||
inline int32_t GET_I32(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_number_integer())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
|
||||
try {
|
||||
return j[tag].get<int32_t>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
|
||||
}
|
||||
|
||||
inline int32_t GET_I32(const nlohmann::json &j, const std::string& tag, int32_t def) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_number_integer())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
|
||||
try {
|
||||
return j[tag].get<int32_t>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
return def;
|
||||
}
|
||||
|
||||
inline float GET_FLOAT(const nlohmann::json &j, const std::string& tag, float def) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_number())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be float");
|
||||
try {
|
||||
return j[tag].get<float>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
return def;
|
||||
}
|
||||
|
||||
inline bool GET_BOOL(const nlohmann::json &j, const std::string& tag, bool def) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_boolean())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
|
||||
try {
|
||||
return j[tag].get<bool>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
return def;
|
||||
}
|
||||
|
||||
inline std::string GET_STR(const nlohmann::json &j, const std::string& tag, const std::string& def) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_string())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be string");
|
||||
try {
|
||||
return j[tag].get<std::string>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
return def;
|
||||
}
|
||||
|
||||
inline std::string GET_STR(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_string())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be string");
|
||||
try {
|
||||
return j[tag].get<std::string>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
|
||||
}
|
||||
|
||||
inline int64_t GET_I64(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_number_integer())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be integer");
|
||||
try {
|
||||
return j[tag].get<int64_t>();
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
|
||||
}
|
||||
|
||||
inline std::vector<std::string> GET_STR_ARR(const nlohmann::json &j, const std::string& tag) {
|
||||
std::vector<std::string> ret;
|
||||
|
||||
if (CHECK_ARRAY(j, tag)) {
|
||||
try {
|
||||
for (const auto &iter: j[tag])
|
||||
ret.push_back(iter.get<std::string>());
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline std::vector<std::int64_t> GET_I64_ARR(const nlohmann::json &j, const std::string& tag) {
|
||||
std::vector<std::int64_t> ret;
|
||||
|
||||
if (CHECK_ARRAY(j, tag)) {
|
||||
try {
|
||||
for (const auto &iter: j[tag])
|
||||
ret.push_back(iter.get<int64_t>());
|
||||
} catch (std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + ": " + e.what());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
DetectorModuleGeometry::Direction GET_DIRECTION(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
if (!j[tag].is_string())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be string");
|
||||
if (j[tag] == "Xp")
|
||||
DetectorModuleGeometry::Direction Convert(const org::openapitools::server::model::Detector_module_direction& d) {
|
||||
switch (d.getValue()) {
|
||||
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::XP:
|
||||
return DetectorModuleGeometry::Direction::Xpos;
|
||||
if (j[tag] == "Xn")
|
||||
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::XN:
|
||||
return DetectorModuleGeometry::Direction::Xneg;
|
||||
if (j[tag] == "Yp")
|
||||
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::YP:
|
||||
return DetectorModuleGeometry::Direction::Ypos;
|
||||
if (j[tag] == "Yn")
|
||||
case org::openapitools::server::model::Detector_module_direction::eDetector_module_direction::YN:
|
||||
return DetectorModuleGeometry::Direction::Yneg;
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Allowed values for direction: Xp, Xn, Yp, Yn");
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid detector direction");
|
||||
}
|
||||
}
|
||||
|
||||
inline int64_t TimeToUs(const std::string &unit) {
|
||||
if ((unit == "us") || unit.empty()) return 1L;
|
||||
else if (unit == "ms") return 1000L;
|
||||
else if ((unit == "s") || (unit == "sec")) return 1000*1000L;
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::WrongUnit,
|
||||
"Only us, ms and s (or sec) are viable units for time");
|
||||
DetectorType Convert(const org::openapitools::server::model::Detector_type &d) {
|
||||
switch (d.getValue()) {
|
||||
case org::openapitools::server::model::Detector_type::eDetector_type::EIGER:
|
||||
return DetectorType::EIGER;
|
||||
case org::openapitools::server::model::Detector_type::eDetector_type::JUNGFRAU:
|
||||
return DetectorType::JUNGFRAU;
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid detector type");
|
||||
}
|
||||
}
|
||||
|
||||
inline std::chrono::microseconds GET_TIME(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
// If no units provided for time, this is always microsecond
|
||||
if (j[tag].is_number())
|
||||
return std::chrono::microseconds (std::lround(j[tag].get<double>() * 1000.0 * 1000.0));
|
||||
else if (j[tag].is_string()) {
|
||||
std::string::size_type pos;
|
||||
auto text = j[tag].get<std::string>();
|
||||
|
||||
// Check if floating point
|
||||
pos = text.find_first_of('.');
|
||||
if (pos != std::string::npos)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongNumber,
|
||||
"Time must be provided as <integer> {s|ms|us|Hz} - no floating point allowed");
|
||||
|
||||
// Convert integer part
|
||||
int64_t val = std::stol(text, &pos);
|
||||
if (pos == 0)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongNumber,
|
||||
"Time must be provided as <integer> {s|ms|us|Hz}");
|
||||
|
||||
pos = text.find_first_not_of(' ', pos);
|
||||
if (pos != std::string::npos) {
|
||||
if (text.substr(pos) == "Hz")
|
||||
val = 1000*1000L / val;
|
||||
else
|
||||
val *= TimeToUs(text.substr(pos));
|
||||
}
|
||||
return std::chrono::microseconds(val);
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " must be number in seconds or string with time units s|ms|us");
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, tag + " is compulsory");
|
||||
}
|
||||
|
||||
DetectorGeometry ParseStandardDetectorGeometry(const nlohmann::json &j) {
|
||||
int32_t nmodules = GET_I64(j, "nmodules");
|
||||
int32_t gap_x = GET_I64(j, "gap_x", 8);
|
||||
int32_t gap_y = GET_I64(j, "gap_y", 36);
|
||||
int32_t h_stacking = GET_I64(j, "horizontal_stacking", 2);
|
||||
bool mirror_y = GET_BOOL(j, "mirror_y", true);
|
||||
return {nmodules, h_stacking, gap_x, gap_y, mirror_y};
|
||||
}
|
||||
|
||||
DetectorGeometry ParseCustomDetectorGeometry(const nlohmann::json &j, bool mirror_y) {
|
||||
DetectorGeometry ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j) {
|
||||
std::vector<DetectorModuleGeometry> modules;
|
||||
for (const auto &iter: j) {
|
||||
if (!iter.is_object())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"custom_geometry element must be JSON object");
|
||||
int64_t x0 = GET_I64(iter, "x0");
|
||||
int64_t y0 = GET_I64(iter, "y0");
|
||||
auto fast = GET_DIRECTION(iter, "fast_axis");
|
||||
auto slow = GET_DIRECTION(iter, "slow_axis");
|
||||
modules.emplace_back(x0, y0, fast, slow);
|
||||
for (const auto &iter: j.getCustomGeometry()) {
|
||||
auto fast = Convert(iter.getFastAxis());
|
||||
auto slow = Convert(iter.getSlowAxis());
|
||||
modules.emplace_back(iter.getX0(), iter.getY0(), fast, slow);
|
||||
}
|
||||
return {modules, mirror_y};
|
||||
return {modules, false};
|
||||
}
|
||||
|
||||
DetectorGeometry ParseDetectorGeometry(const nlohmann::json &j) {
|
||||
if (CHECK_OBJECT(j, "standard_geometry"))
|
||||
return ParseStandardDetectorGeometry(j["standard_geometry"]);
|
||||
else if (CHECK_ARRAY(j, "custom_geometry")) {
|
||||
return ParseCustomDetectorGeometry(j["custom_geometry"], GET_BOOL(j, "custom_geometry_mirror_y", false));
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"It is compulsory to have either standard_detector or custom_detector declared.");
|
||||
|
||||
DetectorGeometry ParseDetectorGeometry(const org::openapitools::server::model::Detector &d) {
|
||||
if (d.standardGeometryIsSet() && d.customGeometryIsSet())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Need to set EITHER standard or custom geometry");
|
||||
|
||||
if (d.standardGeometryIsSet())
|
||||
return ParseStandardDetectorGeometry(d);
|
||||
else if (d.customGeometryIsSet())
|
||||
return ParseCustomDetectorGeometry(d);
|
||||
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Need to set EITHER standard or custom geometry");
|
||||
}
|
||||
|
||||
DetectorSetup ParseDetectorSetup(const nlohmann::json &j) {
|
||||
if (!j.is_object())
|
||||
throw JFJochException(JFJochExceptionCategory::JSON, "Expecting JSON object for detector setup");
|
||||
DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detector &d) {
|
||||
DetectorGeometry geom = ParseDetectorGeometry(d);
|
||||
if (d.isMirrorY())
|
||||
geom.VerticalFlip();
|
||||
|
||||
DetectorGeometry geom = ParseDetectorGeometry(j);
|
||||
DetectorType detector_type = Convert(d.getType());
|
||||
DetectorSetup setup(geom, detector_type, d.getDescription(), d.getHostname());
|
||||
|
||||
std::string description = GET_STR(j, "description");
|
||||
auto module_hostname = GET_STR_ARR(j, "module_hostname");
|
||||
|
||||
DetectorType detector_type;
|
||||
const std::string detector_type_str = GET_STR(j, "type", "jungfrau");
|
||||
if (detector_type_str == "jungfrau")
|
||||
detector_type = DetectorType::JUNGFRAU;
|
||||
else if (detector_type_str == "eiger")
|
||||
detector_type = DetectorType::EIGER;
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::JSON, "type must be \"jungfrau\" or \"eiger\" ");
|
||||
DetectorSetup setup(geom, detector_type, description, module_hostname);
|
||||
if (detector_type == DetectorType::JUNGFRAU) {
|
||||
auto gain_files = GET_STR_ARR(j, "gain_files");
|
||||
if (!gain_files.empty())
|
||||
setup.LoadGain(gain_files);
|
||||
} else if (detector_type == DetectorType::EIGER) {
|
||||
auto trim_files = GET_STR_ARR(j, "trim_files");
|
||||
if (!trim_files.empty())
|
||||
setup.SetTrimFiles(trim_files);
|
||||
auto calib = d.getCalibrationFile();
|
||||
if (!calib.empty()) {
|
||||
if (detector_type == DetectorType::JUNGFRAU)
|
||||
setup.LoadGain(calib);
|
||||
else if (detector_type == DetectorType::EIGER)
|
||||
setup.SetTrimFiles(calib);
|
||||
}
|
||||
|
||||
if (j.contains("high_voltage"))
|
||||
setup.HighVoltage(GET_I32(j,"high_voltage"));
|
||||
if ((detector_type == DetectorType::EIGER) || (detector_type == DetectorType::JUNGFRAU))
|
||||
setup.PixelSize_um(75.0f);
|
||||
|
||||
setup.UDPInterfaceCount(GET_I64(j, "udp_interface_count", 2))
|
||||
.SensorThickness_um(GET_FLOAT(j, "sensor_thickness_um", 320.0f))
|
||||
.PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
|
||||
.SensorMaterial(GET_STR(j, "sensor_material", "Si"))
|
||||
.SerialNumber(GET_STR(j, "serial_number",""));
|
||||
if (d.highVoltageVIsSet())
|
||||
setup.HighVoltage(d.getHighVoltageV());
|
||||
|
||||
if (j.contains("tx_delay"))
|
||||
setup.TxDelay(GET_I64_ARR(j, "tx_delay"));
|
||||
setup.UDPInterfaceCount(d.getUdpInterfaceCount())
|
||||
.SensorThickness_um(d.getSensorThicknessUm())
|
||||
// .PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
|
||||
.SensorMaterial(d.getSensorMaterial())
|
||||
.SerialNumber(d.getSerialNumber());
|
||||
if (d.baseDataIpv4AddressIsSet())
|
||||
setup.BaseIPv4Addr(d.getBaseDataIpv4Address());
|
||||
if (d.txDelayIsSet())
|
||||
setup.TxDelay(d.getTxDelay());
|
||||
|
||||
return setup;
|
||||
}
|
||||
|
||||
void ParseDetectorSetup(const nlohmann::json &j, const std::string& tag, JFJochBrokerHttp& broker) {
|
||||
if (CHECK_ARRAY(j, tag)) {
|
||||
for (const auto &iter : j[tag])
|
||||
broker.AddDetectorSetup(ParseDetectorSetup(iter));
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::JSON, "Detector setup not found");
|
||||
void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_settings &j, DiffractionExperiment &experiment) {
|
||||
if (j.instrumentIsSet())
|
||||
experiment.ImportInstrumentMetadata(Convert(j.getInstrument()));
|
||||
|
||||
if (j.detectorSettingsIsSet())
|
||||
experiment.ImportDetectorSettings(Convert(j.getDetectorSettings()));
|
||||
|
||||
if (j.azimIntIsSet())
|
||||
experiment.ImportRadialIntegrationSettings(Convert(j.getAzimInt()));
|
||||
|
||||
if (j.imageFormatIsSet())
|
||||
experiment.ImportImageFormatSettings(Convert(j.getImageFormat()));
|
||||
}
|
||||
|
||||
void ParseImagePusher(const nlohmann::json &input, std::unique_ptr<ImagePusher> &image_pusher) {
|
||||
std::string pusher_type = ParseString(input, "stream_type", "zmq");
|
||||
if (pusher_type == "zmq") {
|
||||
int32_t zmq_send_watermark = ParseInt32(input, "zmq_send_watermark", 100);
|
||||
int32_t zmq_send_buffer_size = ParseInt32(input, "zmq_send_buffer_size", -1);
|
||||
std::unique_ptr<ImagePusher> ParseZMQImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
|
||||
if (!j.zeromqIsSet())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "ZeroMQ settings must be provided");
|
||||
auto tmp = std::make_unique<ZMQStream2Pusher>(j.getZeromq().getImageSocket(),
|
||||
j.getZeromq().getSendWatermark());
|
||||
|
||||
auto tmp = std::make_unique<ZMQStream2Pusher>(ParseStringArray(input, "zmq_image_addr"),
|
||||
zmq_send_watermark,
|
||||
zmq_send_buffer_size);
|
||||
if (j.getZeromq().previewSocketIsSet())
|
||||
tmp->PreviewSocket(j.getZeromq().getPreviewSocket());
|
||||
|
||||
std::string preview_addr = ParseString(input, "zmq_preview_addr", "");
|
||||
if (!preview_addr.empty())
|
||||
tmp->PreviewSocket(preview_addr);
|
||||
|
||||
if (input.contains("zmq_preview_period"))
|
||||
tmp->PreviewCounterPeriod(GET_TIME(input, "zmq_preview_period"));
|
||||
|
||||
std::string writer_notification_addr = ParseString(input, "zmq_writer_notification_addr", "");
|
||||
if (!writer_notification_addr.empty())
|
||||
tmp->WriterNotificationSocket(writer_notification_addr);
|
||||
|
||||
image_pusher = std::move(tmp);
|
||||
} else if (pusher_type == "dump_cbor") {
|
||||
image_pusher = std::make_unique<DumpCBORToFilePusher>();
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"stream_type allowed: zmq (default), dump_cbor");
|
||||
if (j.getZeromq().writerNotificationSocketIsSet())
|
||||
tmp->WriterNotificationSocket(j.getZeromq().getWriterNotificationSocket());
|
||||
return std::move(tmp);
|
||||
}
|
||||
|
||||
void ParseFacilityConfiguration(const nlohmann::json &input, const std::string& tag, DiffractionExperiment &experiment) {
|
||||
if (CHECK_OBJECT(input, tag)) {
|
||||
auto j = input[tag];
|
||||
experiment.SourceName(GET_STR(j, "source_name"));
|
||||
experiment.SourceNameShort(GET_STR(j, "source_name_short"));
|
||||
experiment.SourceType(GET_STR(j, "source_type", ""));
|
||||
|
||||
experiment.InstrumentName(GET_STR(j, "instrument_name"));
|
||||
experiment.InstrumentNameShort(GET_STR(j, "instrument_name_short"));
|
||||
|
||||
experiment.PulsedSource(GET_BOOL(j, "pulsed_source", false));
|
||||
|
||||
if (j.contains("rotation_axis")) {
|
||||
if (j["rotation_axis"].is_array() && (j["rotation_axis"].size() == 3))
|
||||
experiment.DefaultRotationAxis(Coord(j["rotation_axis"][0].get<float>(),
|
||||
j["rotation_axis"][1].get<float>(),
|
||||
j["rotation_axis"][2].get<float>()));
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"rotation_axis must be float array of 3");
|
||||
}
|
||||
|
||||
if (j.contains("pedestal_g0_frames"))
|
||||
experiment.PedestalG0Frames(GET_I64(j, "pedestal_g0_frames"));
|
||||
if (j.contains("pedestal_g1_frames"))
|
||||
experiment.PedestalG1Frames(GET_I64(j, "pedestal_g1_frames"));
|
||||
if (j.contains("pedestal_g2_frames"))
|
||||
experiment.PedestalG2Frames(GET_I64(j, "pedestal_g2_frames"));
|
||||
if (j.contains("detector_trigger_delay"))
|
||||
experiment.DetectorDelay(GET_TIME(j, "detector_trigger_delay"));
|
||||
|
||||
experiment.FrameTime(GET_TIME(j, "frame_time"), GET_TIME(j, "count_time"));
|
||||
|
||||
experiment.UseInternalPacketGenerator(GET_BOOL(j, "internal_frame_generator", false));
|
||||
if (experiment.IsUsingInternalPacketGen())
|
||||
experiment.ConversionOnFPGA(false);
|
||||
|
||||
experiment.IPv4BaseAddr(GET_STR(j, "detector_ipv4"));
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::JSON, "Default configuration not found");
|
||||
}
|
||||
|
||||
void ParseAcquisitionDeviceGroup(const nlohmann::json &input, const std::string& tag,
|
||||
AcquisitionDeviceGroup &aq_devices) {
|
||||
if (CHECK_OBJECT(input, tag)) {
|
||||
const auto &j = input[tag];
|
||||
|
||||
std::string dev_type = GET_STR(j, "type");
|
||||
|
||||
if (dev_type == "pcie") {
|
||||
std::vector<std::string> devices = GET_STR_ARR(j, "devices");
|
||||
if (devices.empty())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"At least one PCIe device must be provided");
|
||||
for (auto &d: devices)
|
||||
aq_devices.AddPCIeDevice(d);
|
||||
} else if (dev_type == "hls") {
|
||||
int64_t buffer_size = GET_I64(j, "buffer_size", 1024);
|
||||
|
||||
if ((buffer_size < 16) || (buffer_size > 65536))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Buffer size must be in range 16-65536");
|
||||
|
||||
aq_devices.AddHLSDevice(buffer_size);
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Device type unknown");
|
||||
|
||||
aq_devices.SetDefaultDataSource(AcquisitionDeviceSource::NETWORK);
|
||||
|
||||
std::vector<std::string> ipv4_addr = GET_STR_ARR(j, "ipv4_addr");
|
||||
if (ipv4_addr.size() != aq_devices.size())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Mismatch between number of devices and number of IPv4 addresses");
|
||||
for (int i = 0; i < ipv4_addr.size(); i++)
|
||||
aq_devices[i].SetIPv4Address(IPv4AddressFromStr(ipv4_addr[i]));
|
||||
|
||||
std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {
|
||||
switch (j.getImagePusher().getValue()) {
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::ZEROMQ:
|
||||
return ParseZMQImagePusher(j);
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::HDF5:
|
||||
return std::make_unique<HDF5FilePusher>();
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::NONE:
|
||||
return {};
|
||||
case org::openapitools::server::model::Image_pusher_type::eImage_pusher_type::CBOR:
|
||||
return std::make_unique<CBORFilePusher>();
|
||||
default:
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Invalid value");
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> ParseStringArray(const nlohmann::json &input, const std::string& tag) {
|
||||
return GET_STR_ARR(input, tag);
|
||||
}
|
||||
|
||||
std::string ParseString(const nlohmann::json &input, const std::string& tag, const std::string &def) {
|
||||
return GET_STR(input, tag, def);
|
||||
}
|
||||
|
||||
int64_t ParseInt64(const nlohmann::json &input, const std::string& tag, int64_t def) {
|
||||
return GET_I64(input, tag, def);
|
||||
}
|
||||
|
||||
int32_t ParseInt32(const nlohmann::json &input, const std::string& tag, int32_t def) {
|
||||
return GET_I32(input, tag, def);
|
||||
void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_settings &input,
|
||||
AcquisitionDeviceGroup &aq_devices) {
|
||||
if (!input.pcieIsSet())
|
||||
aq_devices.AddHLSDevice(256);
|
||||
else for (auto &p: input.getPcie()) {
|
||||
std::optional<uint32_t> ipv4_addr = {};
|
||||
if (p.ipv4IsSet())
|
||||
ipv4_addr = IPv4AddressFromStr(p.getIpv4());
|
||||
aq_devices.AddPCIeDevice(p.getBlk(), ipv4_addr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,23 +3,21 @@
|
||||
#ifndef JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
|
||||
#define JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
#include "JFJochBrokerHttp.h"
|
||||
#include "../acquisition_device/AcquisitionDeviceGroup.h"
|
||||
#include "../image_pusher/ImagePusher.h"
|
||||
|
||||
DetectorGeometry ParseStandardDetectorGeometry(const nlohmann::json &j);
|
||||
DetectorGeometry ParseCustomDetectorGeometry(const nlohmann::json &j);
|
||||
DetectorGeometry ParseDetectorGeometry(const nlohmann::json &j);
|
||||
DetectorSetup ParseDetectorSetup(const nlohmann::json &j);
|
||||
void ParseDetectorSetup(const nlohmann::json &j, const std::string& tag, JFJochBrokerHttp& broker);
|
||||
void ParseFacilityConfiguration(const nlohmann::json &j, const std::string& tag, DiffractionExperiment &experiment);
|
||||
void ParseImagePusher(const nlohmann::json &j, std::unique_ptr<ImagePusher> &image_pusher);
|
||||
#include "gen/model/Jfjoch_settings.h"
|
||||
|
||||
void ParseAcquisitionDeviceGroup(const nlohmann::json &input, const std::string& tag, AcquisitionDeviceGroup &aq_devices);
|
||||
std::vector<std::string> ParseStringArray(const nlohmann::json &input, const std::string& tag);
|
||||
std::string ParseString(const nlohmann::json &input, const std::string& tag, const std::string& def);
|
||||
int64_t ParseInt64(const nlohmann::json &input, const std::string& tag, int64_t def);
|
||||
int32_t ParseInt32(const nlohmann::json &input, const std::string& tag, int32_t def);
|
||||
DetectorGeometry ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j);
|
||||
DetectorGeometry ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j);
|
||||
DetectorGeometry ParseDetectorGeometry(const org::openapitools::server::model::Detector &j);
|
||||
DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detector &j);
|
||||
|
||||
void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_settings &j, DiffractionExperiment &experiment);
|
||||
|
||||
std::unique_ptr<ImagePusher> ParseImagePusher(const org::openapitools::server::model::Jfjoch_settings &j);
|
||||
|
||||
void ParseAcquisitionDeviceGroup(const org::openapitools::server::model::Jfjoch_settings &input, AcquisitionDeviceGroup &aq_devices);
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHBROKERPARSER_H
|
||||
|
||||
@@ -12,7 +12,7 @@ void JFJochServices::Start(const DiffractionExperiment& experiment,
|
||||
|
||||
if (receiver != nullptr) {
|
||||
logger.Info(" ... receiver start");
|
||||
if (experiment.GetDetectorMode() == DetectorMode::Conversion)
|
||||
if (experiment.IsJungfrauConvPhotonCnt())
|
||||
receiver->Start(experiment, pixel_mask, &calibration);
|
||||
else
|
||||
receiver->Start(experiment, pixel_mask, nullptr);
|
||||
@@ -187,3 +187,10 @@ void JFJochServices::GetXFELEventCode(std::vector<uint64_t> &v) const {
|
||||
if (receiver)
|
||||
receiver->GetXFELPulseID(v);
|
||||
}
|
||||
|
||||
std::vector<DeviceStatus> JFJochServices::GetDeviceStatus() const {
|
||||
std::vector<DeviceStatus> ret;
|
||||
if (receiver)
|
||||
ret = receiver->GetDeviceStatus();
|
||||
return ret;
|
||||
}
|
||||
@@ -46,6 +46,8 @@ public:
|
||||
|
||||
void GetXFELPulseID(std::vector<uint64_t> &v) const;
|
||||
void GetXFELEventCode(std::vector<uint64_t> &v) const;
|
||||
|
||||
std::vector<DeviceStatus> GetDeviceStatus() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5,66 +5,6 @@
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
void ApplyDetectorSettings(DiffractionExperiment& experiment, const DetectorSettings &settings) {
|
||||
auto tmp = experiment;
|
||||
try {
|
||||
if (settings.count_time_us)
|
||||
experiment.FrameTime(std::chrono::microseconds(settings.frame_time_us),
|
||||
std::chrono::microseconds(settings.count_time_us.value()));
|
||||
else
|
||||
experiment.FrameTime(std::chrono::microseconds(settings.frame_time_us));
|
||||
|
||||
experiment.StorageCells(settings.storage_cell_count);
|
||||
|
||||
experiment.UseInternalPacketGenerator(settings.use_internal_packet_generator);
|
||||
// If internal packet generator is used --> no conversion on FPGA
|
||||
experiment.ConversionOnFPGA(!settings.use_internal_packet_generator);
|
||||
|
||||
if (settings.collect_raw_data)
|
||||
experiment.Mode(DetectorMode::Raw);
|
||||
else
|
||||
experiment.Mode(DetectorMode::Conversion);
|
||||
|
||||
experiment.UsingGainHG0(settings.use_gain_hg0);
|
||||
experiment.FixedGainG1(settings.fixed_gain_g1);
|
||||
|
||||
if (settings.pedestal_g0_frames)
|
||||
experiment.PedestalG0Frames(settings.pedestal_g0_frames.value());
|
||||
if (settings.pedestal_g1_frames)
|
||||
experiment.PedestalG1Frames(settings.pedestal_g1_frames.value());
|
||||
if (settings.pedestal_g2_frames)
|
||||
experiment.PedestalG2Frames(settings.pedestal_g2_frames.value());
|
||||
if (settings.storage_cell_delay_ns)
|
||||
experiment.StorageCellDelay(std::chrono::nanoseconds(settings.storage_cell_delay_ns.value()));
|
||||
if (settings.detector_delay_ns)
|
||||
experiment.DetectorDelay(std::chrono::nanoseconds(settings.detector_delay_ns.value()));
|
||||
if (settings.internal_packet_generator_images)
|
||||
experiment.InternalPacketGeneratorImages(settings.internal_packet_generator_images.value());
|
||||
} catch (...) {
|
||||
experiment = tmp;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyRadialIntegrationSettings(DiffractionExperiment& experiment, const RadialIntegrationSettings &settings) {
|
||||
auto tmp = experiment;
|
||||
try {
|
||||
if (settings.polarization_factor) {
|
||||
experiment.ApplyPolarizationCorr(true);
|
||||
experiment.PolarizationFactor(settings.polarization_factor.value());
|
||||
} else
|
||||
experiment.ApplyPolarizationCorr(false);
|
||||
|
||||
experiment.ApplySolidAngleCorr(settings.solid_angle_correction);
|
||||
experiment.LowQForAzimInt_recipA(settings.low_q_recipA);
|
||||
experiment.HighQForAzimInt_recipA(settings.high_q_recipA);
|
||||
experiment.QSpacingForAzimInt_recipA(settings.q_spacing);
|
||||
} catch (...) {
|
||||
experiment = tmp;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_logger)
|
||||
: services(in_services),
|
||||
logger(in_logger),
|
||||
@@ -400,7 +340,7 @@ void JFJochStateMachine::SetFullMeasurementOutput(const JFJochServicesOutput &ou
|
||||
|
||||
tmp.detector_width = experiment.GetXPixelsNum();
|
||||
tmp.detector_height = experiment.GetYPixelsNum();
|
||||
tmp.detector_pixel_depth = experiment.GetPixelDepth();
|
||||
tmp.detector_pixel_depth = experiment.GetByteDepthImage();
|
||||
tmp.images_expected = experiment.GetImageNum();
|
||||
tmp.unit_cell = experiment.GetUnitCellString();
|
||||
|
||||
@@ -429,7 +369,7 @@ void JFJochStateMachine::ClearAndSetMeasurementStatistics() {
|
||||
|
||||
tmp.detector_height = experiment.GetXPixelsNum();
|
||||
tmp.detector_width = experiment.GetYPixelsNum();
|
||||
tmp.detector_pixel_depth = experiment.GetPixelDepth();
|
||||
tmp.detector_pixel_depth = experiment.GetByteDepthImage();
|
||||
tmp.images_expected = experiment.GetImageNum();
|
||||
tmp.unit_cell = experiment.GetUnitCellString();
|
||||
|
||||
@@ -453,7 +393,7 @@ std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistic
|
||||
|
||||
tmp.detector_width = experiment.GetXPixelsNum();
|
||||
tmp.detector_height = experiment.GetYPixelsNum();
|
||||
tmp.detector_pixel_depth = experiment.GetPixelDepth();
|
||||
tmp.detector_pixel_depth = experiment.GetByteDepthImage();
|
||||
tmp.images_expected = experiment.GetImageNum();
|
||||
tmp.unit_cell = experiment.GetUnitCellString();
|
||||
|
||||
@@ -486,21 +426,7 @@ void JFJochStateMachine::SetCalibrationStatistics(const std::vector<JFCalibratio
|
||||
|
||||
DetectorSettings JFJochStateMachine::GetDetectorSettings() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
DetectorSettings ret;
|
||||
ret.frame_time_us = experiment.GetFrameTime().count();
|
||||
ret.count_time_us = experiment.GetFrameCountTime().count();
|
||||
ret.collect_raw_data = (experiment.GetDetectorMode() != DetectorMode::Conversion);
|
||||
ret.use_internal_packet_generator = experiment.IsUsingInternalPacketGen();
|
||||
ret.storage_cell_count = experiment.GetStorageCellNumber();
|
||||
ret.pedestal_g0_frames = experiment.GetPedestalG0Frames();
|
||||
ret.pedestal_g1_frames = experiment.GetPedestalG1Frames();
|
||||
ret.pedestal_g2_frames = experiment.GetPedestalG2Frames();
|
||||
ret.storage_cell_delay_ns = experiment.GetStorageCellDelay().count();
|
||||
ret.detector_delay_ns = experiment.GetDetectorDelay().count();
|
||||
ret.fixed_gain_g1 = experiment.IsFixedGainG1();
|
||||
ret.use_gain_hg0 = experiment.IsUsingGainHG0();
|
||||
ret.internal_packet_generator_images = experiment.GetInternalPacketGeneratorImages();
|
||||
return ret;
|
||||
return experiment.GetDetectorSettings();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::LoadDetectorSettings(const DetectorSettings &settings) {
|
||||
@@ -508,11 +434,11 @@ void JFJochStateMachine::LoadDetectorSettings(const DetectorSettings &settings)
|
||||
switch (state) {
|
||||
case JFJochState::Inactive:
|
||||
case JFJochState::Error:
|
||||
ApplyDetectorSettings(experiment, settings);
|
||||
experiment.ImportDetectorSettings(settings);
|
||||
break;
|
||||
case JFJochState::Idle:
|
||||
state = JFJochState::Busy;
|
||||
ApplyDetectorSettings(experiment, settings);
|
||||
experiment.ImportDetectorSettings(settings);
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::PedestalThread, this, std::move(ul));
|
||||
break;
|
||||
case JFJochState::Measuring:
|
||||
@@ -583,6 +509,9 @@ DetectorList JFJochStateMachine::GetDetectorsList() const {
|
||||
tmp.nmodules = i.GetModulesNum();
|
||||
tmp.width = i.GetGeometry().GetWidth();
|
||||
tmp.height = i.GetGeometry().GetHeight();
|
||||
tmp.serial_number = i.GetSerialNumber();
|
||||
tmp.base_ipv4_addr = i.GetBaseIPv4Addr();
|
||||
tmp.udp_interface_count = i.GetUDPInterfaceCount();
|
||||
ret.detector.emplace_back(std::move(tmp));
|
||||
}
|
||||
|
||||
@@ -615,27 +544,18 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetRadialIntegrationSettings(const RadialIntegrationSettings &settings) {
|
||||
void JFJochStateMachine::SetRadialIntegrationSettings(const AzimuthalIntegrationSettings &settings) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException ("Cannot change radial integration settings during data collection");
|
||||
|
||||
ApplyRadialIntegrationSettings(experiment, settings);
|
||||
experiment.ImportRadialIntegrationSettings(settings);
|
||||
}
|
||||
|
||||
RadialIntegrationSettings JFJochStateMachine::GetRadialIntegrationSettings() const {
|
||||
RadialIntegrationSettings ret;
|
||||
|
||||
if (experiment.GetApplyPolarizationCorr())
|
||||
ret.polarization_factor = experiment.GetPolarizationFactor();
|
||||
ret.solid_angle_correction = experiment.GetApplySolidAngleCorr();
|
||||
|
||||
ret.q_spacing = experiment.GetQSpacingForAzimInt_recipA();
|
||||
ret.low_q_recipA = experiment.GetLowQForAzimInt_recipA();
|
||||
ret.high_q_recipA = experiment.GetHighQForAzimInt_recipA();
|
||||
|
||||
return ret;
|
||||
AzimuthalIntegrationSettings JFJochStateMachine::GetRadialIntegrationSettings() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
return experiment.GetRadialIntegrationSettings();
|
||||
}
|
||||
|
||||
bool JFJochStateMachine::IsRunning() const {
|
||||
@@ -805,3 +725,53 @@ void JFJochStateMachine::SetUserPixelMask(const std::string &s) {
|
||||
"Problem handling user mask " + std::string(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
InstrumentMetadata JFJochStateMachine::GetInstrumentMetadata() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
return experiment.GetInstrumentMetadata();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::LoadInstrumentMetadata(const InstrumentMetadata &settings) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException ("Cannot change instrument metadata during data collection");
|
||||
|
||||
experiment.ImportInstrumentMetadata(settings);
|
||||
}
|
||||
|
||||
ImageFormatSettings JFJochStateMachine::GetImageFormatSettings() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
return experiment.GetImageFormatSettings();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::LoadImageFormatSettings(const ImageFormatSettings &settings) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException ("Cannot change instrument metadata during data collection");
|
||||
|
||||
experiment.ImportImageFormatSettings(settings);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::RawImageFormatSettings() {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException ("Cannot change instrument metadata during data collection");
|
||||
|
||||
experiment.Raw();
|
||||
}
|
||||
|
||||
void JFJochStateMachine::ConvImageFormatSettings() {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (IsRunning())
|
||||
throw WrongDAQStateException ("Cannot change instrument metadata during data collection");
|
||||
|
||||
experiment.Conversion();
|
||||
}
|
||||
|
||||
std::vector<DeviceStatus> JFJochStateMachine::GetDeviceStatus() const {
|
||||
return services.GetDeviceStatus();
|
||||
}
|
||||
@@ -25,6 +25,9 @@ struct BrokerStatus {
|
||||
|
||||
struct DetectorListElement {
|
||||
std::string description;
|
||||
std::string serial_number;
|
||||
std::string base_ipv4_addr;
|
||||
int64_t udp_interface_count;
|
||||
int64_t nmodules;
|
||||
int64_t width;
|
||||
int64_t height;
|
||||
@@ -63,32 +66,6 @@ struct MeasurementStatistics {
|
||||
std::string unit_cell;
|
||||
};
|
||||
|
||||
struct DetectorSettings {
|
||||
int64_t frame_time_us;
|
||||
std::optional<int64_t> count_time_us;
|
||||
|
||||
int64_t storage_cell_count;
|
||||
bool use_internal_packet_generator;
|
||||
bool collect_raw_data;
|
||||
bool use_gain_hg0;
|
||||
bool fixed_gain_g1;
|
||||
std::optional<int64_t> pedestal_g0_frames;
|
||||
std::optional<int64_t> pedestal_g1_frames;
|
||||
std::optional<int64_t> pedestal_g2_frames;
|
||||
|
||||
std::optional<int64_t> storage_cell_delay_ns;
|
||||
std::optional<int64_t> detector_delay_ns;
|
||||
std::optional<int64_t> internal_packet_generator_images;
|
||||
};
|
||||
|
||||
struct RadialIntegrationSettings {
|
||||
bool solid_angle_correction;
|
||||
std::optional<float> polarization_factor;
|
||||
float high_q_recipA;
|
||||
float low_q_recipA;
|
||||
float q_spacing;
|
||||
};
|
||||
|
||||
class JFJochStateMachine {
|
||||
Logger &logger;
|
||||
JFJochServices &services;
|
||||
@@ -152,6 +129,14 @@ public:
|
||||
DetectorSettings GetDetectorSettings() const;
|
||||
void LoadDetectorSettings(const DetectorSettings& settings);
|
||||
|
||||
InstrumentMetadata GetInstrumentMetadata() const;
|
||||
void LoadInstrumentMetadata(const InstrumentMetadata& settings);
|
||||
|
||||
ImageFormatSettings GetImageFormatSettings() const;
|
||||
void LoadImageFormatSettings(const ImageFormatSettings& settings);
|
||||
void RawImageFormatSettings();
|
||||
void ConvImageFormatSettings();
|
||||
|
||||
// return by value to ensure thread safety
|
||||
std::optional<MeasurementStatistics> GetMeasurementStatistics() const;
|
||||
std::vector<JFCalibrationModuleStatistics> GetCalibrationStatistics() const;
|
||||
@@ -169,8 +154,8 @@ public:
|
||||
void SelectDetector(int64_t id);
|
||||
std::optional<DetectorStatus> GetDetectorStatus() const;
|
||||
|
||||
void SetRadialIntegrationSettings(const RadialIntegrationSettings& settings);
|
||||
RadialIntegrationSettings GetRadialIntegrationSettings() const;
|
||||
void SetRadialIntegrationSettings(const AzimuthalIntegrationSettings& settings);
|
||||
AzimuthalIntegrationSettings GetRadialIntegrationSettings() const;
|
||||
|
||||
std::string GetPreviewJPEG(const PreviewJPEGSettings& settings) const;
|
||||
std::string GetPreviewTIFF(bool calibration) const;
|
||||
@@ -197,6 +182,7 @@ public:
|
||||
std::string GetFullPixelMaskTIFF() const;
|
||||
std::string GetUserPixelMaskTIFF() const;
|
||||
void SetUserPixelMask(const std::string &v);
|
||||
std::vector<DeviceStatus> GetDeviceStatus() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
483
broker/OpenAPIConvert.cpp
Normal file
483
broker/OpenAPIConvert.cpp
Normal file
@@ -0,0 +1,483 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#include "OpenAPIConvert.h"
|
||||
|
||||
// From https://en.cppreference.com/w/cpp/string/byte/tolower
|
||||
std::string str_tolower(std::string s) {
|
||||
std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c){ return std::tolower(c); });
|
||||
return s;
|
||||
}
|
||||
|
||||
SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input) {
|
||||
SpotFindingSettings ret{};
|
||||
ret.signal_to_noise_threshold = input.getSignalToNoiseThreshold();
|
||||
ret.photon_count_threshold = input.getPhotonCountThreshold();
|
||||
ret.min_pix_per_spot = input.getMinPixPerSpot();
|
||||
ret.max_pix_per_spot = input.getMaxPixPerSpot();
|
||||
ret.high_resolution_limit = input.getHighResolutionLimit();
|
||||
ret.low_resolution_limit = input.getLowResolutionLimit();
|
||||
ret.enable = input.isEnable();
|
||||
ret.indexing = input.isIndexing();
|
||||
ret.indexing_tolerance = input.getIndexingTolerance();
|
||||
if (input.filterPowderRingsIsSet())
|
||||
ret.filter_spots_powder_ring = input.isFilterPowderRings();
|
||||
if (input.minSpotCountPowderRingIsSet())
|
||||
ret.min_spot_count_powder_ring = input.getMinSpotCountPowderRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input) {
|
||||
org::openapitools::server::model::Spot_finding_settings ret;
|
||||
ret.setSignalToNoiseThreshold(input.signal_to_noise_threshold);
|
||||
ret.setPhotonCountThreshold(input.photon_count_threshold);
|
||||
ret.setMinPixPerSpot(input.min_pix_per_spot);
|
||||
ret.setMaxPixPerSpot(input.max_pix_per_spot);
|
||||
ret.setHighResolutionLimit(input.high_resolution_limit);
|
||||
ret.setLowResolutionLimit(input.low_resolution_limit);
|
||||
ret.setEnable(input.enable);
|
||||
ret.setIndexing(input.indexing);
|
||||
ret.setIndexingTolerance(input.indexing_tolerance);
|
||||
ret.setFilterPowderRings(input.filter_spots_powder_ring);
|
||||
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input) {
|
||||
org::openapitools::server::model::Measurement_statistics ret{};
|
||||
|
||||
if (!input.file_prefix.empty())
|
||||
ret.setFilePrefix(input.file_prefix);
|
||||
|
||||
ret.setExperimentGroup(input.experiment_group);
|
||||
ret.setImagesExpected(input.images_expected);
|
||||
ret.setImagesCollected(input.images_collected);
|
||||
ret.setImagesSent(input.images_sent);
|
||||
ret.setImagesDiscardedLossyCompression(input.images_skipped);
|
||||
ret.setMaxImageNumberSent(input.max_image_number_sent);
|
||||
if (input.collection_efficiency)
|
||||
ret.setCollectionEfficiency(input.collection_efficiency.value());
|
||||
if (input.compression_ratio)
|
||||
ret.setCompressionRatio(input.compression_ratio.value());
|
||||
|
||||
ret.setCancelled(input.cancelled);
|
||||
ret.setMaxReceiverDelay(input.max_receive_delay);
|
||||
|
||||
ret.setDetectorWidth(input.detector_width);
|
||||
ret.setDetectorHeight(input.detector_height);
|
||||
ret.setDetectorPixelDepth(input.detector_pixel_depth);
|
||||
|
||||
if (input.indexing_rate)
|
||||
ret.setIndexingRate(input.indexing_rate.value());
|
||||
|
||||
if (input.bkg_estimate)
|
||||
ret.setBkgEstimate(input.bkg_estimate.value());
|
||||
ret.setUnitCell(input.unit_cell);
|
||||
ret.setRunNumber(input.run_number);
|
||||
return ret;
|
||||
}
|
||||
|
||||
DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input) {
|
||||
DetectorSettings ret{};
|
||||
|
||||
if (input.countTimeUsIsSet())
|
||||
ret.FrameTime(std::chrono::microseconds(input.getFrameTimeUs()),
|
||||
std::chrono::microseconds(input.getCountTimeUs()));
|
||||
else
|
||||
ret.FrameTime(std::chrono::microseconds(input.getFrameTimeUs()));
|
||||
|
||||
ret.StorageCells(input.getStorageCellCount());
|
||||
|
||||
ret.StorageCellDelay(std::chrono::nanoseconds(input.getStorageCellDelayNs()));
|
||||
|
||||
ret.FixGainG1(input.isFixedGainG1());
|
||||
ret.UseGainHG0(input.isUseGainHg0());
|
||||
ret.InternalGeneratorEnable(input.isInternalFrameGenerator());
|
||||
ret.InternalGeneratorImages(input.getInternalFrameGeneratorImages());
|
||||
|
||||
ret.PedestalG0Frames(input.getPedestalG0Frames());
|
||||
ret.PedestalG1Frames(input.getPedestalG1Frames());
|
||||
ret.PedestalG2Frames(input.getPedestalG2Frames());
|
||||
ret.PedestalMinImageCount(input.getPedestalMinImageCount());
|
||||
|
||||
ret.PedestalG0RMSLimit(input.getPedestalG0RmsLimit());
|
||||
ret.DetectorDelay(std::chrono::nanoseconds(input.getDetectorTriggerDelayNs()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Detector_settings Convert(const DetectorSettings &input) {
|
||||
org::openapitools::server::model::Detector_settings ret{};
|
||||
|
||||
ret.setFrameTimeUs(input.GetFrameTime().count());
|
||||
if (input.GetCountTime().has_value())
|
||||
ret.setCountTimeUs(input.GetCountTime()->count());
|
||||
|
||||
ret.setStorageCellCount(input.GetStorageCells());
|
||||
ret.setInternalFrameGenerator(input.IsInternalGeneratorEnable());
|
||||
ret.setFixedGainG1(input.IsFixGainG1());
|
||||
ret.setUseGainHg0(input.IsUseGainHG0());
|
||||
|
||||
ret.setPedestalG0Frames(input.GetPedestalG0Frames());
|
||||
ret.setPedestalG1Frames(input.GetPedestalG1Frames());
|
||||
ret.setPedestalG2Frames(input.GetPedestalG2Frames());
|
||||
ret.setPedestalMinImageCount(input.GetPedestalMinImageCount());
|
||||
|
||||
ret.setStorageCellDelayNs(input.GetStorageCellDelay().count());
|
||||
ret.setDetectorTriggerDelayNs(input.GetDetectorDelay().count());
|
||||
ret.setInternalFrameGeneratorImages(input.GetInternalGeneratorImages());
|
||||
ret.setPedestalG0RmsLimit(input.GetPedestalG0RMSLimit());
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Broker_status Convert(const BrokerStatus& input) {
|
||||
org::openapitools::server::model::Broker_status ret;
|
||||
|
||||
switch (input.broker_state) {
|
||||
case JFJochState::Inactive:
|
||||
ret.setState("Inactive");
|
||||
break;
|
||||
case JFJochState::Idle:
|
||||
ret.setState("Idle");
|
||||
break;
|
||||
case JFJochState::Measuring:
|
||||
ret.setState("Measuring");
|
||||
break;
|
||||
case JFJochState::Error:
|
||||
ret.setState("Error");
|
||||
break;
|
||||
case JFJochState::Busy:
|
||||
ret.setState("Busy");
|
||||
break;
|
||||
case JFJochState::Pedestal:
|
||||
ret.setState("Pedestal");
|
||||
break;
|
||||
}
|
||||
if (input.progress.has_value())
|
||||
ret.setProgress(input.progress.value());
|
||||
if (input.indexing_rate.has_value() && (input.indexing_rate >= 0.0))
|
||||
ret.setIndexingRate(input.indexing_rate.value());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Calibration_statistics_inner Convert(const JFCalibrationModuleStatistics& input) {
|
||||
org::openapitools::server::model::Calibration_statistics_inner output;
|
||||
|
||||
output.setModuleNumber(input.module_number);
|
||||
output.setMaskedPixels(input.bad_pixels);
|
||||
output.setStorageCellNumber(input.storage_cell_number);
|
||||
output.setGainG0Mean(input.gain_g0_mean);
|
||||
output.setGainG1Mean(input.gain_g1_mean);
|
||||
output.setGainG2Mean(input.gain_g2_mean);
|
||||
output.setPedestalG0Mean(input.pedestal_g0_mean);
|
||||
output.setPedestalG1Mean(input.pedestal_g1_mean);
|
||||
output.setPedestalG2Mean(input.pedestal_g2_mean);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Instrument_metadata Convert(const InstrumentMetadata& input) {
|
||||
org::openapitools::server::model::Instrument_metadata output;
|
||||
output.setInstrumentName(input.GetInstrumentName());
|
||||
output.setSourceName(input.GetSourceName());
|
||||
output.setSourceType(input.GetSourceType());
|
||||
output.setPulsedSource(input.IsPulsedSource());
|
||||
return output;
|
||||
}
|
||||
|
||||
InstrumentMetadata Convert(const org::openapitools::server::model::Instrument_metadata &input) {
|
||||
InstrumentMetadata output;
|
||||
output.InstrumentName(input.getInstrumentName())
|
||||
.SourceName(input.getSourceName())
|
||||
.SourceType(input.getSourceType())
|
||||
.PulsedSource(input.isPulsedSource());
|
||||
return output;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Detector_status Convert(const DetectorStatus &input) {
|
||||
org::openapitools::server::model::Detector_status output;
|
||||
output.setServerVersion(input.detector_server_version);
|
||||
output.setNumberOfTriggersLeft(input.remaining_triggers);
|
||||
output.setFpgaTempDegC(input.temperature_fpga_degC);
|
||||
output.setHighVoltageV(input.high_voltage_V);
|
||||
switch (input.power_state) {
|
||||
case DetectorPowerState::ON:
|
||||
output.setPowerchip("PowerOn");
|
||||
break;
|
||||
case DetectorPowerState::OFF:
|
||||
output.setPowerchip("PowerOff");
|
||||
break;
|
||||
case DetectorPowerState::PARTIAL:
|
||||
output.setPowerchip("Partial");
|
||||
break;
|
||||
}
|
||||
switch (input.detector_state) {
|
||||
|
||||
case DetectorState::IDLE:
|
||||
output.setState("Idle");
|
||||
break;
|
||||
case DetectorState::ERROR:
|
||||
output.setState("Error");
|
||||
break;
|
||||
case DetectorState::BUSY:
|
||||
output.setState("Busy");
|
||||
break;
|
||||
case DetectorState::WAITING:
|
||||
output.setState("Waiting");
|
||||
break;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Detector_list Convert(const DetectorList &input) {
|
||||
org::openapitools::server::model::Detector_list ret;
|
||||
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> dets;
|
||||
for (int i = 0; i < input.detector.size(); i++) {
|
||||
org::openapitools::server::model::Detector_list_detectors_inner d;
|
||||
d.setId(i);
|
||||
d.setDescription(input.detector[i].description);
|
||||
d.setNmodules(input.detector[i].nmodules);
|
||||
d.setHeight(input.detector[i].height);
|
||||
d.setWidth(input.detector[i].width);
|
||||
d.setSerialNumber(input.detector[i].serial_number);
|
||||
d.setBaseIpv4Addr(input.detector[i].base_ipv4_addr);
|
||||
d.setUdpInterfaceCount(input.detector[i].udp_interface_count);
|
||||
dets.emplace_back(std::move(d));
|
||||
}
|
||||
ret.setDetectors(dets);
|
||||
ret.setCurrentId(input.current_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Plots Convert(const MultiLinePlot& input) {
|
||||
std::vector<org::openapitools::server::model::Plot> tmp(input.size());
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
tmp[i].setTitle(input[i].title);
|
||||
tmp[i].setX(input[i].x);
|
||||
tmp[i].setY(input[i].y);
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Plots output;
|
||||
output.setPlot(tmp);
|
||||
return output;
|
||||
}
|
||||
|
||||
AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azim_int_settings& input) {
|
||||
AzimuthalIntegrationSettings ret{};
|
||||
ret.SolidAngleCorrection(input.isSolidAngleCorr());
|
||||
if (input.polarizationFactorIsSet())
|
||||
ret.PolarizationFactor(input.getPolarizationFactor());
|
||||
ret.QSpacing_recipA(input.getQSpacing());
|
||||
ret.LowQ_recipA(input.getLowQRecipA());
|
||||
ret.HighQ_recipA(input.getHighQRecipA());
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Azim_int_settings Convert(const AzimuthalIntegrationSettings& settings) {
|
||||
org::openapitools::server::model::Azim_int_settings ret{};
|
||||
ret.setSolidAngleCorr(settings.IsSolidAngleCorrection());
|
||||
if (settings.GetPolarizationFactor().has_value())
|
||||
ret.setPolarizationFactor(settings.GetPolarizationFactor().value());
|
||||
ret.setHighQRecipA(settings.GetHighQ_recipA());
|
||||
ret.setLowQRecipA(settings.GetLowQ_recipA());
|
||||
ret.setQSpacing(settings.GetQSpacing_recipA());
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<ROIBox> Convert(const org::openapitools::server::model::Roi_box_list& input) {
|
||||
std::vector<ROIBox> ret;
|
||||
for (const auto &i: input.getRois())
|
||||
ret.emplace_back(ROIBox(i.getName(), i.getMinXPxl(), i.getMaxXPxl(), i.getMinYPxl(), i.getMaxYPxl()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<ROICircle> Convert(const org::openapitools::server::model::Roi_circle_list& input) {
|
||||
std::vector<ROICircle> ret;
|
||||
for (const auto &i: input.getRois())
|
||||
ret.emplace_back(ROICircle(i.getName(), i.getCenterXPxl(), i.getCenterYPxl(), i.getRadiusPxl()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Roi_circle_list Convert(const std::vector<ROICircle> &input) {
|
||||
org::openapitools::server::model::Roi_circle_list ret{};
|
||||
std::vector<org::openapitools::server::model::Roi_circle> tmp;
|
||||
for (const auto &i: input) {
|
||||
org::openapitools::server::model::Roi_circle elem;
|
||||
elem.setName(i.GetName());
|
||||
elem.setCenterXPxl(i.GetX());
|
||||
elem.setCenterYPxl(i.GetY());
|
||||
elem.setRadiusPxl(i.GetRadius_pxl());
|
||||
tmp.emplace_back(elem);
|
||||
}
|
||||
ret.setRois(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
org::openapitools::server::model::Roi_box_list Convert(const std::vector<ROIBox> &input) {
|
||||
org::openapitools::server::model::Roi_box_list ret{};
|
||||
std::vector<org::openapitools::server::model::Roi_box> tmp;
|
||||
for (const auto &i: input) {
|
||||
org::openapitools::server::model::Roi_box elem;
|
||||
elem.setName(i.GetName());
|
||||
elem.setMinXPxl(i.GetXMin());
|
||||
elem.setMaxXPxl(i.GetXMax());
|
||||
elem.setMinYPxl(i.GetYMin());
|
||||
elem.setMaxYPxl(i.GetYMax());
|
||||
tmp.emplace_back(elem);
|
||||
}
|
||||
ret.setRois(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
PreviewJPEGSettings Convert(const org::openapitools::server::model::Preview_settings& input) {
|
||||
PreviewJPEGSettings ret{};
|
||||
ret.show_spots = input.isShowSpots();
|
||||
ret.jpeg_quality = input.getJpegQuality();
|
||||
ret.saturation_value = input.getSaturation();
|
||||
ret.show_roi = input.isShowRoi();
|
||||
ret.show_indexed = input.isShowIndexed();
|
||||
ret.show_user_mask = input.isShowUserMask();
|
||||
if (input.resolutionRingIsSet())
|
||||
ret.resolution_ring = input.getResolutionRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
ImageFormatSettings Convert(const org::openapitools::server::model::Image_format_settings& input) {
|
||||
ImageFormatSettings ret{};
|
||||
ret.GeometryTransformed(input.isGeometryTransform());
|
||||
ret.AutoSummation(input.isSummation());
|
||||
ret.JungfrauConversion(input.isJungfrauConversion());
|
||||
ret.MaskChipEdges(input.isMaskChipEdges());
|
||||
ret.MaskModuleEdges(input.isMaskModuleEdges());
|
||||
if (input.signedOutputIsSet())
|
||||
ret.PixelSigned(input.isSignedOutput());
|
||||
if (input.jungfrauConversionFactorKeVIsSet())
|
||||
ret.JungfrauConvFactor_keV(input.getJungfrauConversionFactorKeV());
|
||||
if (input.bitDepthImageIsSet())
|
||||
ret.BitDepthImage(input.getBitDepthImage());
|
||||
return ret;
|
||||
}
|
||||
|
||||
org::openapitools::server::model::Image_format_settings Convert(const ImageFormatSettings& input) {
|
||||
org::openapitools::server::model::Image_format_settings ret{};
|
||||
ret.setGeometryTransform(input.IsGeometryTransformed());
|
||||
ret.setSummation(input.IsAutoSummation());
|
||||
ret.setJungfrauConversion(input.IsJungfrauConversion());
|
||||
ret.setMaskChipEdges(input.IsMaskChipEdges());
|
||||
ret.setMaskModuleEdges(input.IsMaskModuleEdges());
|
||||
if (input.IsPixelSigned().has_value())
|
||||
ret.setSignedOutput(input.IsPixelSigned().value());
|
||||
if (input.GetJungfrauConvFactor_keV().has_value())
|
||||
ret.setJungfrauConversionFactorKeV(input.GetJungfrauConvFactor_keV().value());
|
||||
if (input.GetBitDepthImage().has_value())
|
||||
ret.setBitDepthImage(input.GetBitDepthImage().value());
|
||||
return ret;
|
||||
}
|
||||
|
||||
DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input) {
|
||||
DatasetSettings ret;
|
||||
|
||||
ret.ImagesPerTrigger(input.getImagesPerTrigger());
|
||||
ret.NumTriggers(input.getNtrigger());
|
||||
|
||||
if (input.runNumberIsSet())
|
||||
ret.RunNumber(input.getRunNumber());
|
||||
if (input.runNameIsSet())
|
||||
ret.RunName(input.getRunName());
|
||||
|
||||
ret.ExperimentGroup(input.getExperimentGroup());
|
||||
|
||||
if (input.imageTimeUsIsSet())
|
||||
ret.ImageTime(std::chrono::microseconds(input.getImageTimeUs()));
|
||||
ret.BeamX_pxl(input.getBeamXPxl());
|
||||
ret.BeamY_pxl(input.getBeamYPxl());
|
||||
ret.DetectorDistance_mm(input.getDetectorDistanceMm());
|
||||
ret.PhotonEnergy_keV(input.getIncidentEnergyKeV());
|
||||
|
||||
ret.FilePrefix(input.getFilePrefix());
|
||||
|
||||
if (!input.compressionIsSet())
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_LZ4);
|
||||
else {
|
||||
std::string compr = str_tolower(input.getCompression());
|
||||
if (compr == "bslz4")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_LZ4);
|
||||
else if (compr == "bszstd")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD);
|
||||
else if (compr == "bszstd_rle")
|
||||
ret.Compression(CompressionAlgorithm::BSHUF_ZSTD_RLE);
|
||||
else if (compr == "none")
|
||||
ret.Compression(CompressionAlgorithm::NO_COMPRESSION);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown compression");
|
||||
}
|
||||
if (input.poissonCompressionIsSet())
|
||||
ret.LossyCompressionPoisson(input.getPoissonCompression());
|
||||
|
||||
if (input.unitCellIsSet())
|
||||
ret.SetUnitCell(UnitCell{
|
||||
.a = input.getUnitCell().getA(),
|
||||
.b = input.getUnitCell().getB(),
|
||||
.c = input.getUnitCell().getC(),
|
||||
.alpha = input.getUnitCell().getAlpha(),
|
||||
.beta = input.getUnitCell().getBeta(),
|
||||
.gamma = input.getUnitCell().getGamma()
|
||||
});
|
||||
|
||||
if (input.totalFluxIsSet())
|
||||
ret.TotalFlux(input.getTotalFlux());
|
||||
if (input.transmissionIsSet())
|
||||
ret.AttenuatorTransmission(input.getTransmission());
|
||||
|
||||
if (input.goniometerIsSet()) {
|
||||
ret.Goniometer(GoniometerAxis{
|
||||
.name = input.getGoniometer().getName(),
|
||||
.increment = input.getGoniometer().getStep(),
|
||||
.start = input.getGoniometer().getStart()
|
||||
});
|
||||
if (input.getGoniometer().getVector().size() == 3) {
|
||||
auto v = input.getGoniometer().getVector();
|
||||
ret.RotationAxis(Coord(v[0], v[1], v[2]));
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Rotation axis must be provided");
|
||||
}
|
||||
if (input.spaceGroupNumberIsSet())
|
||||
ret.SpaceGroupNumber(input.getSpaceGroupNumber());
|
||||
ret.SampleName(input.getSampleName());
|
||||
ret.HeaderAppendix(input.getHeaderAppendix());
|
||||
ret.ImageAppendix(input.getImageAppendix());
|
||||
ret.ImagesPerFile(input.getImagesPerFile());
|
||||
|
||||
if (input.dataReductionFactorSerialmxIsSet())
|
||||
ret.LossyCompressionSerialMX(input.getDataReductionFactorSerialmx());
|
||||
|
||||
if (input.pixelValueLowThresholdIsSet())
|
||||
ret.PixelValueLowThreshold(input.getPixelValueLowThreshold());
|
||||
|
||||
if (input.saveCalibrationIsSet())
|
||||
ret.SaveCalibration(input.isSaveCalibration());
|
||||
|
||||
ret.WriteNXmxHDF5Master(input.isWriteNxmxHdf5Master());
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<org::openapitools::server::model::Fpga_status_inner> Convert(const std::vector<DeviceStatus> &input) {
|
||||
std::vector<org::openapitools::server::model::Fpga_status_inner> ret;
|
||||
for (const auto &d: input) {
|
||||
org::openapitools::server::model::Fpga_status_inner tmp;
|
||||
tmp.setPciDevId(d.device_number);
|
||||
tmp.setSerialNumber(d.serial_number);
|
||||
tmp.setBaseMacAddr(MacAddressToStr(d.fpga_default_mac_addr));
|
||||
tmp.setPacketsSls(d.packets_sls);
|
||||
tmp.setPacketsUdp(d.packets_udp);
|
||||
tmp.setEthLinkCount(d.eth_link_count);
|
||||
tmp.setEthLinkStatus(d.eth_link_status);
|
||||
tmp.setFpgaTempC(static_cast<float>(d.fpga_temp_C));
|
||||
tmp.setHbmTempC(static_cast<float>(d.hbm_0_temp_C));
|
||||
tmp.setPowerUsageW(static_cast<float>(d.fpga_pcie_12V_I_mA * d.fpga_pcie_12V_V_mV + d.fpga_pcie_3p3V_I_mA
|
||||
* d.fpga_pcie_3p3V_V_mV) / (1000.0f * 1000.0f));
|
||||
ret.emplace_back(std::move(tmp));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
59
broker/OpenAPIConvert.h
Normal file
59
broker/OpenAPIConvert.h
Normal file
@@ -0,0 +1,59 @@
|
||||
// Copyright (2019-2024) Paul Scherrer Institute
|
||||
|
||||
#ifndef JFJOCH_OPENAPICONVERT_H
|
||||
#define JFJOCH_OPENAPICONVERT_H
|
||||
|
||||
#include "gen/model/Spot_finding_settings.h"
|
||||
#include "gen/model/Measurement_statistics.h"
|
||||
#include "gen/model/Detector_settings.h"
|
||||
#include "gen/model/Broker_status.h"
|
||||
|
||||
#include "gen/model/Calibration_statistics_inner.h"
|
||||
#include "gen/model/Instrument_metadata.h"
|
||||
#include "gen/model/Detector_list.h"
|
||||
#include "gen/model/Detector_status.h"
|
||||
#include "gen/model/Plots.h"
|
||||
#include "gen/model/Azim_int_settings.h"
|
||||
#include "gen/model/Roi_box_list.h"
|
||||
#include "gen/model/Roi_circle_list.h"
|
||||
#include "gen/model/Image_format_settings.h"
|
||||
#include "gen/model/Preview_settings.h"
|
||||
#include "gen/model/Dataset_settings.h"
|
||||
#include "gen/model/Fpga_status_inner.h"
|
||||
|
||||
#include "../common/DatasetSettings.h"
|
||||
#include "../common/ImageFormatSettings.h"
|
||||
#include "../image_analysis/SpotFindingSettings.h"
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../common/DetectorSettings.h"
|
||||
#include "../jungfrau/JFCalibration.h"
|
||||
#include "../common/InstrumentMetadata.h"
|
||||
|
||||
SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input);
|
||||
org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input);
|
||||
|
||||
org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input);
|
||||
DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input);
|
||||
|
||||
org::openapitools::server::model::Detector_settings Convert(const DetectorSettings &input);
|
||||
org::openapitools::server::model::Broker_status Convert(const BrokerStatus& input);
|
||||
org::openapitools::server::model::Calibration_statistics_inner Convert(const JFCalibrationModuleStatistics& input);
|
||||
org::openapitools::server::model::Instrument_metadata Convert(const InstrumentMetadata& input);
|
||||
|
||||
InstrumentMetadata Convert(const org::openapitools::server::model::Instrument_metadata &input);
|
||||
org::openapitools::server::model::Detector_status Convert(const DetectorStatus &input);
|
||||
org::openapitools::server::model::Detector_list Convert(const DetectorList &input);
|
||||
org::openapitools::server::model::Plots Convert(const MultiLinePlot& input);
|
||||
AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azim_int_settings& input);
|
||||
org::openapitools::server::model::Azim_int_settings Convert(const AzimuthalIntegrationSettings& settings);
|
||||
std::vector<ROIBox> Convert(const org::openapitools::server::model::Roi_box_list& input);
|
||||
std::vector<ROICircle> Convert(const org::openapitools::server::model::Roi_circle_list& input);
|
||||
org::openapitools::server::model::Roi_circle_list Convert(const std::vector<ROICircle> &input);
|
||||
org::openapitools::server::model::Roi_box_list Convert(const std::vector<ROIBox> &input);
|
||||
PreviewJPEGSettings Convert(const org::openapitools::server::model::Preview_settings& input);
|
||||
ImageFormatSettings Convert(const org::openapitools::server::model::Image_format_settings& input);
|
||||
org::openapitools::server::model::Image_format_settings Convert(const ImageFormatSettings& input);
|
||||
DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input);
|
||||
std::vector<org::openapitools::server::model::Fpga_status_inner> Convert(const std::vector<DeviceStatus> &input);
|
||||
|
||||
#endif //JFJOCH_OPENAPICONVERT_H
|
||||
@@ -6,11 +6,20 @@
|
||||
* Configuring FPGA firmware
|
||||
* Building images from FPGA output and forwarding the results over ZeroMQ
|
||||
|
||||
Description of OpenAPI is presented in the `redoc-static.html` file.
|
||||
## 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. At the moment the format of the configuration file is not properly documented.
|
||||
Till this happens, it is recommended to go through example files in the [etc/](../etc/).
|
||||
'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.
|
||||
|
||||
39
broker/gen/api/ApiBase.h
Normal file
39
broker/gen/api/ApiBase.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* ApiBase.h
|
||||
*
|
||||
* Generalization of the Api classes
|
||||
*/
|
||||
|
||||
#ifndef ApiBase_H_
|
||||
#define ApiBase_H_
|
||||
|
||||
#include <pistache/router.h>
|
||||
#include <memory>
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
class ApiBase {
|
||||
public:
|
||||
explicit ApiBase(const std::shared_ptr<Pistache::Rest::Router>& rtr) : router(rtr) {};
|
||||
virtual ~ApiBase() = default;
|
||||
virtual void init() = 0;
|
||||
|
||||
protected:
|
||||
const std::shared_ptr<Pistache::Rest::Router> router;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::api
|
||||
|
||||
#endif /* ApiBase_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -22,7 +22,7 @@ using namespace org::openapitools::server::model;
|
||||
const std::string DefaultApi::base = "";
|
||||
|
||||
DefaultApi::DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr)
|
||||
: router(rtr)
|
||||
: ApiBase(rtr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,13 +34,19 @@ void DefaultApi::setupRoutes() {
|
||||
using namespace Pistache::Rest;
|
||||
|
||||
Routes::Post(*router, base + "/cancel", Routes::bind(&DefaultApi::cancel_post_handler, this));
|
||||
Routes::Get(*router, base + "/config/azim_int", Routes::bind(&DefaultApi::config_azim_int_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/azim_int", Routes::bind(&DefaultApi::config_azim_int_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/detector", Routes::bind(&DefaultApi::config_detector_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/detector", Routes::bind(&DefaultApi::config_detector_put_handler, this));
|
||||
Routes::Post(*router, base + "/config/image_format/conversion", Routes::bind(&DefaultApi::config_image_format_conversion_post_handler, this));
|
||||
Routes::Get(*router, base + "/config/image_format", Routes::bind(&DefaultApi::config_image_format_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/image_format", Routes::bind(&DefaultApi::config_image_format_put_handler, this));
|
||||
Routes::Post(*router, base + "/config/image_format/raw", Routes::bind(&DefaultApi::config_image_format_raw_post_handler, this));
|
||||
Routes::Get(*router, base + "/config/instrument", Routes::bind(&DefaultApi::config_instrument_get_handler, this));
|
||||
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.tiff", Routes::bind(&DefaultApi::config_mask_tiff_get_handler, this));
|
||||
Routes::Get(*router, base + "/config/rad_int", Routes::bind(&DefaultApi::config_rad_int_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/rad_int", Routes::bind(&DefaultApi::config_rad_int_put_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));
|
||||
@@ -49,15 +55,14 @@ void DefaultApi::setupRoutes() {
|
||||
Routes::Put(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_put_handler, this));
|
||||
Routes::Post(*router, base + "/deactivate", Routes::bind(&DefaultApi::deactivate_post_handler, this));
|
||||
Routes::Get(*router, base + "/detector/status", Routes::bind(&DefaultApi::detector_status_get_handler, this));
|
||||
Routes::Get(*router, base + "/fpga_status", Routes::bind(&DefaultApi::fpga_status_get_handler, this));
|
||||
Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this));
|
||||
Routes::Post(*router, base + "/pedestal", Routes::bind(&DefaultApi::pedestal_post_handler, this));
|
||||
Routes::Get(*router, base + "/plot/azim_int", Routes::bind(&DefaultApi::plot_azim_int_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/bkg_estimate", Routes::bind(&DefaultApi::plot_bkg_estimate_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/error_pixel", Routes::bind(&DefaultApi::plot_error_pixel_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/image_collection_efficiency", Routes::bind(&DefaultApi::plot_image_collection_efficiency_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/indexing_rate", Routes::bind(&DefaultApi::plot_indexing_rate_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/indexing_rate_per_file", Routes::bind(&DefaultApi::plot_indexing_rate_per_file_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/rad_int", Routes::bind(&DefaultApi::plot_rad_int_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/rad_int_per_file", Routes::bind(&DefaultApi::plot_rad_int_per_file_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/receiver_delay", Routes::bind(&DefaultApi::plot_receiver_delay_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/receiver_free_send_buffers", Routes::bind(&DefaultApi::plot_receiver_free_send_buffers_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/roi_max_count", Routes::bind(&DefaultApi::plot_roi_max_count_get_handler, this));
|
||||
@@ -88,6 +93,12 @@ void DefaultApi::setupRoutes() {
|
||||
router->addCustomHandler(Routes::bind(&DefaultApi::default_api_default_handler, this));
|
||||
}
|
||||
|
||||
void DefaultApi::handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept
|
||||
{
|
||||
std::pair<Pistache::Http::Code, std::string> codeAndError = handleParsingException(ex);
|
||||
response.send(codeAndError.first, codeAndError.second);
|
||||
}
|
||||
|
||||
std::pair<Pistache::Http::Code, std::string> DefaultApi::handleParsingException(const std::exception& ex) const noexcept
|
||||
{
|
||||
try {
|
||||
@@ -101,6 +112,12 @@ std::pair<Pistache::Http::Code, std::string> DefaultApi::handleParsingException(
|
||||
}
|
||||
}
|
||||
|
||||
void DefaultApi::handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept
|
||||
{
|
||||
std::pair<Pistache::Http::Code, std::string> codeAndError = handleOperationException(ex);
|
||||
response.send(codeAndError.first, codeAndError.second);
|
||||
}
|
||||
|
||||
std::pair<Pistache::Http::Code, std::string> DefaultApi::handleOperationException(const std::exception& ex) const noexcept
|
||||
{
|
||||
return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what());
|
||||
@@ -116,8 +133,57 @@ void DefaultApi::cancel_post_handler(const Pistache::Rest::Request &, Pistache::
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_azim_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_azim_int_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_azim_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
// Getting the body param
|
||||
|
||||
Azim_int_settings azimIntSettings;
|
||||
|
||||
try {
|
||||
nlohmann::json::parse(request.body()).get_to(azimIntSettings);
|
||||
azimIntSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this->config_azim_int_put(azimIntSettings, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,8 +202,7 @@ void DefaultApi::config_detector_get_handler(const Pistache::Rest::Request &, Pi
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -158,8 +223,7 @@ void DefaultApi::config_detector_put_handler(const Pistache::Rest::Request &requ
|
||||
nlohmann::json::parse(request.body()).get_to(detectorSettings);
|
||||
detectorSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -169,8 +233,145 @@ void DefaultApi::config_detector_put_handler(const Pistache::Rest::Request &requ
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_image_format_conversion_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_image_format_conversion_post(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_image_format_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_image_format_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
// Getting the body param
|
||||
|
||||
Image_format_settings imageFormatSettings;
|
||||
|
||||
try {
|
||||
nlohmann::json::parse(request.body()).get_to(imageFormatSettings);
|
||||
imageFormatSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this->config_image_format_put(imageFormatSettings, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_image_format_raw_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_image_format_raw_post(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_instrument_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_instrument_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
// Getting the body param
|
||||
|
||||
Instrument_metadata instrumentMetadata;
|
||||
|
||||
try {
|
||||
nlohmann::json::parse(request.body()).get_to(instrumentMetadata);
|
||||
instrumentMetadata.validate();
|
||||
} catch (std::exception &e) {
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this->config_instrument_put(instrumentMetadata, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -188,8 +389,7 @@ void DefaultApi::config_internal_generator_image_put_handler(const Pistache::Res
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,8 +407,7 @@ void DefaultApi::config_internal_generator_image_tiff_put_handler(const Pistache
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -227,61 +426,7 @@ void DefaultApi::config_mask_tiff_get_handler(const Pistache::Rest::Request &, P
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_rad_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_rad_int_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_rad_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
// Getting the body param
|
||||
|
||||
Rad_int_settings radIntSettings;
|
||||
|
||||
try {
|
||||
nlohmann::json::parse(request.body()).get_to(radIntSettings);
|
||||
radIntSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this->config_rad_int_put(radIntSettings, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -300,8 +445,7 @@ void DefaultApi::config_select_detector_get_handler(const Pistache::Rest::Reques
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -322,8 +466,7 @@ void DefaultApi::config_select_detector_put_handler(const Pistache::Rest::Reques
|
||||
nlohmann::json::parse(request.body()).get_to(detectorSelection);
|
||||
detectorSelection.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -333,8 +476,7 @@ void DefaultApi::config_select_detector_put_handler(const Pistache::Rest::Reques
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -353,8 +495,7 @@ void DefaultApi::config_spot_finding_get_handler(const Pistache::Rest::Request &
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -375,8 +516,7 @@ void DefaultApi::config_spot_finding_put_handler(const Pistache::Rest::Request &
|
||||
nlohmann::json::parse(request.body()).get_to(spotFindingSettings);
|
||||
spotFindingSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -386,8 +526,7 @@ void DefaultApi::config_spot_finding_put_handler(const Pistache::Rest::Request &
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -406,8 +545,7 @@ void DefaultApi::config_user_mask_tiff_get_handler(const Pistache::Rest::Request
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -425,8 +563,7 @@ void DefaultApi::config_user_mask_tiff_put_handler(const Pistache::Rest::Request
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -445,8 +582,7 @@ void DefaultApi::deactivate_post_handler(const Pistache::Rest::Request &, Pistac
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -465,8 +601,26 @@ void DefaultApi::detector_status_get_handler(const Pistache::Rest::Request &, Pi
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::fpga_status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->fpga_status_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -485,8 +639,7 @@ void DefaultApi::initialize_post_handler(const Pistache::Rest::Request &, Pistac
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -505,8 +658,26 @@ void DefaultApi::pedestal_post_handler(const Pistache::Rest::Request &, Pistache
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::plot_azim_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->plot_azim_int_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -535,8 +706,7 @@ void DefaultApi::plot_bkg_estimate_get_handler(const Pistache::Rest::Request &re
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -565,8 +735,7 @@ void DefaultApi::plot_error_pixel_get_handler(const Pistache::Rest::Request &req
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -595,8 +764,7 @@ void DefaultApi::plot_image_collection_efficiency_get_handler(const Pistache::Re
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -625,68 +793,7 @@ void DefaultApi::plot_indexing_rate_get_handler(const Pistache::Rest::Request &r
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::plot_indexing_rate_per_file_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->plot_indexing_rate_per_file_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::plot_rad_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->plot_rad_int_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::plot_rad_int_per_file_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->plot_rad_int_per_file_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -715,8 +822,7 @@ void DefaultApi::plot_receiver_delay_get_handler(const Pistache::Rest::Request &
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -745,8 +851,7 @@ void DefaultApi::plot_receiver_free_send_buffers_get_handler(const Pistache::Res
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -775,8 +880,7 @@ void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &r
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -805,8 +909,7 @@ void DefaultApi::plot_roi_sum_get_handler(const Pistache::Rest::Request &request
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -835,8 +938,7 @@ void DefaultApi::plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -865,8 +967,7 @@ void DefaultApi::plot_spot_count_get_handler(const Pistache::Rest::Request &requ
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -895,8 +996,7 @@ void DefaultApi::plot_strong_pixel_get_handler(const Pistache::Rest::Request &re
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -915,8 +1015,7 @@ void DefaultApi::preview_calibration_tiff_get_handler(const Pistache::Rest::Requ
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -935,8 +1034,7 @@ void DefaultApi::preview_image_jpeg_get_handler(const Pistache::Rest::Request &,
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -957,8 +1055,7 @@ void DefaultApi::preview_image_jpeg_post_handler(const Pistache::Rest::Request &
|
||||
nlohmann::json::parse(request.body()).get_to(previewSettings);
|
||||
previewSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -968,8 +1065,7 @@ void DefaultApi::preview_image_jpeg_post_handler(const Pistache::Rest::Request &
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -988,8 +1084,7 @@ void DefaultApi::preview_image_tiff_get_handler(const Pistache::Rest::Request &,
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1026,8 +1121,7 @@ void DefaultApi::preview_pedestal_tiff_get_handler(const Pistache::Rest::Request
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1046,8 +1140,7 @@ void DefaultApi::roi_box_get_handler(const Pistache::Rest::Request &, Pistache::
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1068,8 +1161,7 @@ void DefaultApi::roi_box_put_handler(const Pistache::Rest::Request &request, Pis
|
||||
nlohmann::json::parse(request.body()).get_to(roiBoxList);
|
||||
roiBoxList.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1079,8 +1171,7 @@ void DefaultApi::roi_box_put_handler(const Pistache::Rest::Request &request, Pis
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1099,8 +1190,7 @@ void DefaultApi::roi_circle_get_handler(const Pistache::Rest::Request &, Pistach
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1121,8 +1211,7 @@ void DefaultApi::roi_circle_put_handler(const Pistache::Rest::Request &request,
|
||||
nlohmann::json::parse(request.body()).get_to(roiCircleList);
|
||||
roiCircleList.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1132,8 +1221,7 @@ void DefaultApi::roi_circle_put_handler(const Pistache::Rest::Request &request,
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1154,8 +1242,7 @@ void DefaultApi::start_post_handler(const Pistache::Rest::Request &request, Pist
|
||||
nlohmann::json::parse(request.body()).get_to(datasetSettings);
|
||||
datasetSettings.validate();
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleParsingException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleParsingException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1165,8 +1252,7 @@ void DefaultApi::start_post_handler(const Pistache::Rest::Request &request, Pist
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1185,8 +1271,7 @@ void DefaultApi::statistics_calibration_get_handler(const Pistache::Rest::Reques
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1205,8 +1290,7 @@ void DefaultApi::statistics_data_collection_get_handler(const Pistache::Rest::Re
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1225,8 +1309,7 @@ void DefaultApi::status_get_handler(const Pistache::Rest::Request &, Pistache::H
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1245,8 +1328,7 @@ void DefaultApi::trigger_post_handler(const Pistache::Rest::Request &, Pistache:
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1265,8 +1347,7 @@ void DefaultApi::version_get_handler(const Pistache::Rest::Request &, Pistache::
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1295,8 +1376,7 @@ void DefaultApi::wait_till_done_post_handler(const Pistache::Rest::Request &requ
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1315,8 +1395,7 @@ void DefaultApi::xfel_event_code_get_handler(const Pistache::Rest::Request &, Pi
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1335,8 +1414,7 @@ void DefaultApi::xfel_pulse_id_get_handler(const Pistache::Rest::Request &, Pist
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -19,6 +19,8 @@
|
||||
#define DefaultApi_H_
|
||||
|
||||
|
||||
#include "ApiBase.h"
|
||||
|
||||
#include <pistache/http.h>
|
||||
#include <pistache/router.h>
|
||||
#include <pistache/http_headers.h>
|
||||
@@ -26,6 +28,7 @@
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "Azim_int_settings.h"
|
||||
#include "Broker_status.h"
|
||||
#include "Calibration_statistics_inner.h"
|
||||
#include "Dataset_settings.h"
|
||||
@@ -34,23 +37,26 @@
|
||||
#include "Detector_settings.h"
|
||||
#include "Detector_status.h"
|
||||
#include "Error_message.h"
|
||||
#include "Fpga_status_inner.h"
|
||||
#include "Image_format_settings.h"
|
||||
#include "Instrument_metadata.h"
|
||||
#include "Measurement_statistics.h"
|
||||
#include "Plots.h"
|
||||
#include "Preview_settings.h"
|
||||
#include "Rad_int_settings.h"
|
||||
#include "Roi_box_list.h"
|
||||
#include "Roi_circle_list.h"
|
||||
#include "Spot_finding_settings.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
class DefaultApi {
|
||||
class DefaultApi : public ApiBase {
|
||||
public:
|
||||
explicit DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr);
|
||||
virtual ~DefaultApi() = default;
|
||||
void init();
|
||||
~DefaultApi() override = default;
|
||||
void init() override;
|
||||
|
||||
static const std::string base;
|
||||
|
||||
@@ -58,13 +64,19 @@ private:
|
||||
void setupRoutes();
|
||||
|
||||
void cancel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_azim_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_conversion_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_image_format_raw_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_instrument_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_rad_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_rad_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -73,15 +85,14 @@ private:
|
||||
void config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void fpga_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_bkg_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_error_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_image_collection_efficiency_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_indexing_rate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_indexing_rate_per_file_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_rad_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_rad_int_per_file_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_receiver_delay_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_receiver_free_send_buffers_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -109,7 +120,12 @@ private:
|
||||
void xfel_pulse_id_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void default_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
|
||||
const std::shared_ptr<Pistache::Rest::Router> router;
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual void handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
||||
@@ -118,6 +134,13 @@ private:
|
||||
/// </summary>
|
||||
virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(const std::exception& ex) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual void handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
@@ -133,6 +156,21 @@ private:
|
||||
/// </remarks>
|
||||
virtual void cancel_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get radial integration configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_azim_int_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure radial integration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done when detector is Inactive or Idle
|
||||
/// </remarks>
|
||||
/// <param name="azimIntSettings"> (optional)</param>
|
||||
virtual void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &azimIntSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get detector configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -148,6 +186,50 @@ private:
|
||||
/// <param name="detectorSettings"> (optional)</param>
|
||||
virtual void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure format for data collection with full conversion
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
virtual void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get image output format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_image_format_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change image output format
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="imageFormatSettings"> (optional)</param>
|
||||
virtual void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure format for raw data collection
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
virtual void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get instrument metadata
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_instrument_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Change instrument metadata
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done when detector is `Idle`, `Error` or `Inactive` states.
|
||||
/// </remarks>
|
||||
/// <param name="instrumentMetadata"> (optional)</param>
|
||||
virtual void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Load binary image for internal FPGA generator
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -169,21 +251,6 @@ private:
|
||||
/// </remarks>
|
||||
virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get radial integration configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done anytime
|
||||
/// </remarks>
|
||||
virtual void config_rad_int_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Configure radial integration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can be done when detector is Inactive or Idle
|
||||
/// </remarks>
|
||||
/// <param name="radIntSettings"> (optional)</param>
|
||||
virtual void config_rad_int_put(const org::openapitools::server::model::Rad_int_settings &radIntSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// List available detectors
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -242,6 +309,13 @@ private:
|
||||
/// </remarks>
|
||||
virtual void detector_status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get status of FPGA devices
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void fpga_status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Initialize detector and data acquisition
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -256,6 +330,13 @@ private:
|
||||
/// </remarks>
|
||||
virtual void pedestal_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate radial integration profile
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Generate average radial integration profile
|
||||
/// </remarks>
|
||||
virtual void plot_azim_int_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate background estimate plot
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -288,27 +369,6 @@ private:
|
||||
/// <param name="binning">Binning of frames for the plot (0 = default binning) (optional, default to 0)</param>
|
||||
virtual void plot_indexing_rate_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate indexing rate per file
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Indexing rate per each of data files; useful for example for time resolved data
|
||||
/// </remarks>
|
||||
virtual void plot_indexing_rate_per_file_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate radial integration profile
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Generate average radial integration profile
|
||||
/// </remarks>
|
||||
virtual void plot_rad_int_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate radial integration profiles per file
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Radial integration plots for both the whole dataset and per file; useful for time-resolved measurements
|
||||
/// </remarks>
|
||||
virtual void plot_rad_int_per_file_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate receiver delay plot
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -436,7 +496,7 @@ private:
|
||||
/// Start detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Start data acquisition. Detector must be in `Idle` state. Doesn't run calibration procedure. This is async function - one needs to use `POST /wait_till_done` to ensure operation is done.
|
||||
/// Start data acquisition. Detector must be in `Idle` state. Doesn't run calibration procedure. When the function returns, detector is ready to accept soft/TTL triggers.
|
||||
/// </remarks>
|
||||
/// <param name="datasetSettings"> (optional)</param>
|
||||
virtual void start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "Rad_int_settings.h"
|
||||
#include "Azim_int_settings.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
@@ -19,7 +19,7 @@
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Rad_int_settings::Rad_int_settings()
|
||||
Azim_int_settings::Azim_int_settings()
|
||||
{
|
||||
m_Polarization_factor = 0.0f;
|
||||
m_Polarization_factorIsSet = false;
|
||||
@@ -30,7 +30,7 @@ Rad_int_settings::Rad_int_settings()
|
||||
|
||||
}
|
||||
|
||||
void Rad_int_settings::validate() const
|
||||
void Azim_int_settings::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
@@ -39,15 +39,15 @@ void Rad_int_settings::validate() const
|
||||
}
|
||||
}
|
||||
|
||||
bool Rad_int_settings::validate(std::stringstream& msg) const
|
||||
bool Azim_int_settings::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Rad_int_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
bool Azim_int_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Rad_int_settings" : pathPrefix;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Azim_int_settings" : pathPrefix;
|
||||
|
||||
|
||||
if (polarizationFactorIsSet())
|
||||
@@ -72,7 +72,7 @@ bool Rad_int_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Rad_int_settings::operator==(const Rad_int_settings& rhs) const
|
||||
bool Azim_int_settings::operator==(const Azim_int_settings& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
@@ -95,14 +95,14 @@ bool Rad_int_settings::operator==(const Rad_int_settings& rhs) const
|
||||
;
|
||||
}
|
||||
|
||||
bool Rad_int_settings::operator!=(const Rad_int_settings& rhs) const
|
||||
bool Azim_int_settings::operator!=(const Azim_int_settings& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Rad_int_settings& o)
|
||||
void to_json(nlohmann::json& j, const Azim_int_settings& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
if(o.polarizationFactorIsSet())
|
||||
j["polarization_factor"] = o.m_Polarization_factor;
|
||||
j["solid_angle_corr"] = o.m_Solid_angle_corr;
|
||||
@@ -112,7 +112,7 @@ void to_json(nlohmann::json& j, const Rad_int_settings& o)
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Rad_int_settings& o)
|
||||
void from_json(const nlohmann::json& j, Azim_int_settings& o)
|
||||
{
|
||||
if(j.find("polarization_factor") != j.end())
|
||||
{
|
||||
@@ -126,52 +126,52 @@ void from_json(const nlohmann::json& j, Rad_int_settings& o)
|
||||
|
||||
}
|
||||
|
||||
float Rad_int_settings::getPolarizationFactor() const
|
||||
float Azim_int_settings::getPolarizationFactor() const
|
||||
{
|
||||
return m_Polarization_factor;
|
||||
}
|
||||
void Rad_int_settings::setPolarizationFactor(float const value)
|
||||
void Azim_int_settings::setPolarizationFactor(float const value)
|
||||
{
|
||||
m_Polarization_factor = value;
|
||||
m_Polarization_factorIsSet = true;
|
||||
}
|
||||
bool Rad_int_settings::polarizationFactorIsSet() const
|
||||
bool Azim_int_settings::polarizationFactorIsSet() const
|
||||
{
|
||||
return m_Polarization_factorIsSet;
|
||||
}
|
||||
void Rad_int_settings::unsetPolarization_factor()
|
||||
void Azim_int_settings::unsetPolarization_factor()
|
||||
{
|
||||
m_Polarization_factorIsSet = false;
|
||||
}
|
||||
bool Rad_int_settings::isSolidAngleCorr() const
|
||||
bool Azim_int_settings::isSolidAngleCorr() const
|
||||
{
|
||||
return m_Solid_angle_corr;
|
||||
}
|
||||
void Rad_int_settings::setSolidAngleCorr(bool const value)
|
||||
void Azim_int_settings::setSolidAngleCorr(bool const value)
|
||||
{
|
||||
m_Solid_angle_corr = value;
|
||||
}
|
||||
float Rad_int_settings::getHighQRecipA() const
|
||||
float Azim_int_settings::getHighQRecipA() const
|
||||
{
|
||||
return m_High_q_recipA;
|
||||
}
|
||||
void Rad_int_settings::setHighQRecipA(float const value)
|
||||
void Azim_int_settings::setHighQRecipA(float const value)
|
||||
{
|
||||
m_High_q_recipA = value;
|
||||
}
|
||||
float Rad_int_settings::getLowQRecipA() const
|
||||
float Azim_int_settings::getLowQRecipA() const
|
||||
{
|
||||
return m_Low_q_recipA;
|
||||
}
|
||||
void Rad_int_settings::setLowQRecipA(float const value)
|
||||
void Azim_int_settings::setLowQRecipA(float const value)
|
||||
{
|
||||
m_Low_q_recipA = value;
|
||||
}
|
||||
float Rad_int_settings::getQSpacing() const
|
||||
float Azim_int_settings::getQSpacing() const
|
||||
{
|
||||
return m_Q_spacing;
|
||||
}
|
||||
void Rad_int_settings::setQSpacing(float const value)
|
||||
void Azim_int_settings::setQSpacing(float const value)
|
||||
{
|
||||
m_Q_spacing = value;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -10,13 +10,13 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Rad_int_settings.h
|
||||
* Azim_int_settings.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Rad_int_settings_H_
|
||||
#define Rad_int_settings_H_
|
||||
#ifndef Azim_int_settings_H_
|
||||
#define Azim_int_settings_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
@@ -27,11 +27,11 @@ namespace org::openapitools::server::model
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Rad_int_settings
|
||||
class Azim_int_settings
|
||||
{
|
||||
public:
|
||||
Rad_int_settings();
|
||||
virtual ~Rad_int_settings() = default;
|
||||
Azim_int_settings();
|
||||
virtual ~Azim_int_settings() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -51,11 +51,11 @@ public:
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Rad_int_settings& rhs) const;
|
||||
bool operator!=(const Rad_int_settings& rhs) const;
|
||||
bool operator==(const Azim_int_settings& rhs) const;
|
||||
bool operator!=(const Azim_int_settings& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Rad_int_settings members
|
||||
/// Azim_int_settings members
|
||||
|
||||
/// <summary>
|
||||
/// If polarization factor is provided, than polarization correction is enabled.
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
float getQSpacing() const;
|
||||
void setQSpacing(float const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Rad_int_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Rad_int_settings& o);
|
||||
friend void to_json(nlohmann::json& j, const Azim_int_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Azim_int_settings& o);
|
||||
protected:
|
||||
float m_Polarization_factor;
|
||||
bool m_Polarization_factorIsSet;
|
||||
@@ -103,4 +103,4 @@ protected:
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Rad_int_settings_H_ */
|
||||
#endif /* Azim_int_settings_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -114,7 +114,7 @@ bool Broker_status::operator!=(const Broker_status& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Broker_status& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["state"] = o.m_State;
|
||||
if(o.progressIsSet())
|
||||
j["progress"] = o.m_Progress;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -78,8 +78,8 @@ public:
|
||||
bool indexingRateIsSet() const;
|
||||
void unsetIndexing_rate();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Broker_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Broker_status& o);
|
||||
friend void to_json(nlohmann::json& j, const Broker_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Broker_status& o);
|
||||
protected:
|
||||
std::string m_State;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -98,7 +98,7 @@ bool Calibration_statistics_inner::operator!=(const Calibration_statistics_inner
|
||||
|
||||
void to_json(nlohmann::json& j, const Calibration_statistics_inner& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["module_number"] = o.m_Module_number;
|
||||
j["storage_cell_number"] = o.m_Storage_cell_number;
|
||||
j["pedestal_g0_mean"] = o.m_Pedestal_g0_mean;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -103,8 +103,8 @@ public:
|
||||
int64_t getMaskedPixels() const;
|
||||
void setMaskedPixels(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Calibration_statistics_inner& o);
|
||||
friend void from_json(const nlohmann::json& j, Calibration_statistics_inner& o);
|
||||
friend void to_json(nlohmann::json& j, const Calibration_statistics_inner& o);
|
||||
friend void from_json(const nlohmann::json& j, Calibration_statistics_inner& o);
|
||||
protected:
|
||||
int64_t m_Module_number;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -39,8 +39,6 @@ Dataset_settings::Dataset_settings()
|
||||
m_Space_group_numberIsSet = false;
|
||||
m_Sample_name = "";
|
||||
m_Sample_nameIsSet = false;
|
||||
m_Fpga_output = "auto";
|
||||
m_Fpga_outputIsSet = false;
|
||||
m_Compression = "bslz4";
|
||||
m_CompressionIsSet = false;
|
||||
m_Total_flux = 0.0f;
|
||||
@@ -50,16 +48,22 @@ Dataset_settings::Dataset_settings()
|
||||
m_GoniometerIsSet = false;
|
||||
m_Header_appendixIsSet = false;
|
||||
m_Image_appendixIsSet = false;
|
||||
m_Energy_multiplier = 1.0f;
|
||||
m_Energy_multiplierIsSet = false;
|
||||
m_Data_reduction_factor_serialmx = 1.0f;
|
||||
m_Data_reduction_factor_serialmxIsSet = false;
|
||||
m_Pixel_value_low_threshold = 0L;
|
||||
m_Pixel_value_low_thresholdIsSet = false;
|
||||
m_Run_number = 0L;
|
||||
m_Run_numberIsSet = false;
|
||||
m_Run_name = "";
|
||||
m_Run_nameIsSet = false;
|
||||
m_Experiment_group = "";
|
||||
m_Experiment_groupIsSet = false;
|
||||
m_Poisson_compression = 0L;
|
||||
m_Poisson_compressionIsSet = false;
|
||||
m_Write_nxmx_hdf5_master = true;
|
||||
m_Write_nxmx_hdf5_masterIsSet = false;
|
||||
m_Save_calibration = false;
|
||||
m_Save_calibrationIsSet = false;
|
||||
m_Unit_cellIsSet = false;
|
||||
|
||||
}
|
||||
@@ -146,10 +150,15 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
const std::string currentValuePath = _pathPrefix + ".incidentEnergyKeV";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0))
|
||||
if (value < static_cast<float>(0.001))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.001;";
|
||||
}
|
||||
if (value > static_cast<float>(500.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 500.0;";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -186,7 +195,7 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (transmissionIsSet())
|
||||
{
|
||||
const float& value = m_Transmission;
|
||||
@@ -206,25 +215,6 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
|
||||
}
|
||||
|
||||
if (energyMultiplierIsSet())
|
||||
{
|
||||
const float& value = m_Energy_multiplier;
|
||||
const std::string currentValuePath = _pathPrefix + ".energyMultiplier";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.015625))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.015625;";
|
||||
}
|
||||
if (value > static_cast<float>(4.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 4.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (dataReductionFactorSerialmxIsSet())
|
||||
{
|
||||
const float& value = m_Data_reduction_factor_serialmx;
|
||||
@@ -244,6 +234,20 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
|
||||
}
|
||||
|
||||
if (pixelValueLowThresholdIsSet())
|
||||
{
|
||||
const int64_t& value = m_Pixel_value_low_threshold;
|
||||
const std::string currentValuePath = _pathPrefix + ".pixelValueLowThreshold";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (runNumberIsSet())
|
||||
{
|
||||
const int64_t& value = m_Run_number;
|
||||
@@ -257,6 +261,25 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (poissonCompressionIsSet())
|
||||
{
|
||||
const int64_t& value = m_Poisson_compression;
|
||||
const std::string currentValuePath = _pathPrefix + ".poissonCompression";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
if (value > 16ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 16;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -300,9 +323,6 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!sampleNameIsSet() && !rhs.sampleNameIsSet()) || (sampleNameIsSet() && rhs.sampleNameIsSet() && getSampleName() == rhs.getSampleName())) &&
|
||||
|
||||
|
||||
((!fpgaOutputIsSet() && !rhs.fpgaOutputIsSet()) || (fpgaOutputIsSet() && rhs.fpgaOutputIsSet() && getFpgaOutput() == rhs.getFpgaOutput())) &&
|
||||
|
||||
|
||||
((!compressionIsSet() && !rhs.compressionIsSet()) || (compressionIsSet() && rhs.compressionIsSet() && getCompression() == rhs.getCompression())) &&
|
||||
|
||||
|
||||
@@ -321,12 +341,12 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!imageAppendixIsSet() && !rhs.imageAppendixIsSet()) || (imageAppendixIsSet() && rhs.imageAppendixIsSet() && getImageAppendix() == rhs.getImageAppendix())) &&
|
||||
|
||||
|
||||
((!energyMultiplierIsSet() && !rhs.energyMultiplierIsSet()) || (energyMultiplierIsSet() && rhs.energyMultiplierIsSet() && getEnergyMultiplier() == rhs.getEnergyMultiplier())) &&
|
||||
|
||||
|
||||
((!dataReductionFactorSerialmxIsSet() && !rhs.dataReductionFactorSerialmxIsSet()) || (dataReductionFactorSerialmxIsSet() && rhs.dataReductionFactorSerialmxIsSet() && getDataReductionFactorSerialmx() == rhs.getDataReductionFactorSerialmx())) &&
|
||||
|
||||
|
||||
((!pixelValueLowThresholdIsSet() && !rhs.pixelValueLowThresholdIsSet()) || (pixelValueLowThresholdIsSet() && rhs.pixelValueLowThresholdIsSet() && getPixelValueLowThreshold() == rhs.getPixelValueLowThreshold())) &&
|
||||
|
||||
|
||||
((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) &&
|
||||
|
||||
|
||||
@@ -336,6 +356,15 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!experimentGroupIsSet() && !rhs.experimentGroupIsSet()) || (experimentGroupIsSet() && rhs.experimentGroupIsSet() && getExperimentGroup() == rhs.getExperimentGroup())) &&
|
||||
|
||||
|
||||
((!poissonCompressionIsSet() && !rhs.poissonCompressionIsSet()) || (poissonCompressionIsSet() && rhs.poissonCompressionIsSet() && getPoissonCompression() == rhs.getPoissonCompression())) &&
|
||||
|
||||
|
||||
((!writeNxmxHdf5MasterIsSet() && !rhs.writeNxmxHdf5MasterIsSet()) || (writeNxmxHdf5MasterIsSet() && rhs.writeNxmxHdf5MasterIsSet() && isWriteNxmxHdf5Master() == rhs.isWriteNxmxHdf5Master())) &&
|
||||
|
||||
|
||||
((!saveCalibrationIsSet() && !rhs.saveCalibrationIsSet()) || (saveCalibrationIsSet() && rhs.saveCalibrationIsSet() && isSaveCalibration() == rhs.isSaveCalibration())) &&
|
||||
|
||||
|
||||
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell()))
|
||||
|
||||
;
|
||||
@@ -348,7 +377,7 @@ bool Dataset_settings::operator!=(const Dataset_settings& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
if(o.imagesPerTriggerIsSet())
|
||||
j["images_per_trigger"] = o.m_Images_per_trigger;
|
||||
if(o.ntriggerIsSet())
|
||||
@@ -367,8 +396,6 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
j["space_group_number"] = o.m_Space_group_number;
|
||||
if(o.sampleNameIsSet())
|
||||
j["sample_name"] = o.m_Sample_name;
|
||||
if(o.fpgaOutputIsSet())
|
||||
j["fpga_output"] = o.m_Fpga_output;
|
||||
if(o.compressionIsSet())
|
||||
j["compression"] = o.m_Compression;
|
||||
if(o.totalFluxIsSet())
|
||||
@@ -381,16 +408,22 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
j["header_appendix"] = o.m_Header_appendix;
|
||||
if(o.imageAppendixIsSet())
|
||||
j["image_appendix"] = o.m_Image_appendix;
|
||||
if(o.energyMultiplierIsSet())
|
||||
j["energy_multiplier"] = o.m_Energy_multiplier;
|
||||
if(o.dataReductionFactorSerialmxIsSet())
|
||||
j["data_reduction_factor_serialmx"] = o.m_Data_reduction_factor_serialmx;
|
||||
if(o.pixelValueLowThresholdIsSet())
|
||||
j["pixel_value_low_threshold"] = o.m_Pixel_value_low_threshold;
|
||||
if(o.runNumberIsSet())
|
||||
j["run_number"] = o.m_Run_number;
|
||||
if(o.runNameIsSet())
|
||||
j["run_name"] = o.m_Run_name;
|
||||
if(o.experimentGroupIsSet())
|
||||
j["experiment_group"] = o.m_Experiment_group;
|
||||
if(o.poissonCompressionIsSet())
|
||||
j["poisson_compression"] = o.m_Poisson_compression;
|
||||
if(o.writeNxmxHdf5MasterIsSet())
|
||||
j["write_nxmx_hdf5_master"] = o.m_Write_nxmx_hdf5_master;
|
||||
if(o.saveCalibrationIsSet())
|
||||
j["save_calibration"] = o.m_Save_calibration;
|
||||
if(o.unitCellIsSet())
|
||||
j["unit_cell"] = o.m_Unit_cell;
|
||||
|
||||
@@ -437,11 +470,6 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("sample_name").get_to(o.m_Sample_name);
|
||||
o.m_Sample_nameIsSet = true;
|
||||
}
|
||||
if(j.find("fpga_output") != j.end())
|
||||
{
|
||||
j.at("fpga_output").get_to(o.m_Fpga_output);
|
||||
o.m_Fpga_outputIsSet = true;
|
||||
}
|
||||
if(j.find("compression") != j.end())
|
||||
{
|
||||
j.at("compression").get_to(o.m_Compression);
|
||||
@@ -472,16 +500,16 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("image_appendix").get_to(o.m_Image_appendix);
|
||||
o.m_Image_appendixIsSet = true;
|
||||
}
|
||||
if(j.find("energy_multiplier") != j.end())
|
||||
{
|
||||
j.at("energy_multiplier").get_to(o.m_Energy_multiplier);
|
||||
o.m_Energy_multiplierIsSet = true;
|
||||
}
|
||||
if(j.find("data_reduction_factor_serialmx") != j.end())
|
||||
{
|
||||
j.at("data_reduction_factor_serialmx").get_to(o.m_Data_reduction_factor_serialmx);
|
||||
o.m_Data_reduction_factor_serialmxIsSet = true;
|
||||
}
|
||||
if(j.find("pixel_value_low_threshold") != j.end())
|
||||
{
|
||||
j.at("pixel_value_low_threshold").get_to(o.m_Pixel_value_low_threshold);
|
||||
o.m_Pixel_value_low_thresholdIsSet = true;
|
||||
}
|
||||
if(j.find("run_number") != j.end())
|
||||
{
|
||||
j.at("run_number").get_to(o.m_Run_number);
|
||||
@@ -497,6 +525,21 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("experiment_group").get_to(o.m_Experiment_group);
|
||||
o.m_Experiment_groupIsSet = true;
|
||||
}
|
||||
if(j.find("poisson_compression") != j.end())
|
||||
{
|
||||
j.at("poisson_compression").get_to(o.m_Poisson_compression);
|
||||
o.m_Poisson_compressionIsSet = true;
|
||||
}
|
||||
if(j.find("write_nxmx_hdf5_master") != j.end())
|
||||
{
|
||||
j.at("write_nxmx_hdf5_master").get_to(o.m_Write_nxmx_hdf5_master);
|
||||
o.m_Write_nxmx_hdf5_masterIsSet = true;
|
||||
}
|
||||
if(j.find("save_calibration") != j.end())
|
||||
{
|
||||
j.at("save_calibration").get_to(o.m_Save_calibration);
|
||||
o.m_Save_calibrationIsSet = true;
|
||||
}
|
||||
if(j.find("unit_cell") != j.end())
|
||||
{
|
||||
j.at("unit_cell").get_to(o.m_Unit_cell);
|
||||
@@ -656,23 +699,6 @@ void Dataset_settings::unsetSample_name()
|
||||
{
|
||||
m_Sample_nameIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getFpgaOutput() const
|
||||
{
|
||||
return m_Fpga_output;
|
||||
}
|
||||
void Dataset_settings::setFpgaOutput(std::string const& value)
|
||||
{
|
||||
m_Fpga_output = value;
|
||||
m_Fpga_outputIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::fpgaOutputIsSet() const
|
||||
{
|
||||
return m_Fpga_outputIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetFpga_output()
|
||||
{
|
||||
m_Fpga_outputIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getCompression() const
|
||||
{
|
||||
return m_Compression;
|
||||
@@ -775,23 +801,6 @@ void Dataset_settings::unsetImage_appendix()
|
||||
{
|
||||
m_Image_appendixIsSet = false;
|
||||
}
|
||||
float Dataset_settings::getEnergyMultiplier() const
|
||||
{
|
||||
return m_Energy_multiplier;
|
||||
}
|
||||
void Dataset_settings::setEnergyMultiplier(float const value)
|
||||
{
|
||||
m_Energy_multiplier = value;
|
||||
m_Energy_multiplierIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::energyMultiplierIsSet() const
|
||||
{
|
||||
return m_Energy_multiplierIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetEnergy_multiplier()
|
||||
{
|
||||
m_Energy_multiplierIsSet = false;
|
||||
}
|
||||
float Dataset_settings::getDataReductionFactorSerialmx() const
|
||||
{
|
||||
return m_Data_reduction_factor_serialmx;
|
||||
@@ -809,6 +818,23 @@ void Dataset_settings::unsetData_reduction_factor_serialmx()
|
||||
{
|
||||
m_Data_reduction_factor_serialmxIsSet = false;
|
||||
}
|
||||
int64_t Dataset_settings::getPixelValueLowThreshold() const
|
||||
{
|
||||
return m_Pixel_value_low_threshold;
|
||||
}
|
||||
void Dataset_settings::setPixelValueLowThreshold(int64_t const value)
|
||||
{
|
||||
m_Pixel_value_low_threshold = value;
|
||||
m_Pixel_value_low_thresholdIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::pixelValueLowThresholdIsSet() const
|
||||
{
|
||||
return m_Pixel_value_low_thresholdIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetPixel_value_low_threshold()
|
||||
{
|
||||
m_Pixel_value_low_thresholdIsSet = false;
|
||||
}
|
||||
int64_t Dataset_settings::getRunNumber() const
|
||||
{
|
||||
return m_Run_number;
|
||||
@@ -860,6 +886,57 @@ void Dataset_settings::unsetExperiment_group()
|
||||
{
|
||||
m_Experiment_groupIsSet = false;
|
||||
}
|
||||
int64_t Dataset_settings::getPoissonCompression() const
|
||||
{
|
||||
return m_Poisson_compression;
|
||||
}
|
||||
void Dataset_settings::setPoissonCompression(int64_t const value)
|
||||
{
|
||||
m_Poisson_compression = value;
|
||||
m_Poisson_compressionIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::poissonCompressionIsSet() const
|
||||
{
|
||||
return m_Poisson_compressionIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetPoisson_compression()
|
||||
{
|
||||
m_Poisson_compressionIsSet = false;
|
||||
}
|
||||
bool Dataset_settings::isWriteNxmxHdf5Master() const
|
||||
{
|
||||
return m_Write_nxmx_hdf5_master;
|
||||
}
|
||||
void Dataset_settings::setWriteNxmxHdf5Master(bool const value)
|
||||
{
|
||||
m_Write_nxmx_hdf5_master = value;
|
||||
m_Write_nxmx_hdf5_masterIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::writeNxmxHdf5MasterIsSet() const
|
||||
{
|
||||
return m_Write_nxmx_hdf5_masterIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetWrite_nxmx_hdf5_master()
|
||||
{
|
||||
m_Write_nxmx_hdf5_masterIsSet = false;
|
||||
}
|
||||
bool Dataset_settings::isSaveCalibration() const
|
||||
{
|
||||
return m_Save_calibration;
|
||||
}
|
||||
void Dataset_settings::setSaveCalibration(bool const value)
|
||||
{
|
||||
m_Save_calibration = value;
|
||||
m_Save_calibrationIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::saveCalibrationIsSet() const
|
||||
{
|
||||
return m_Save_calibrationIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetSave_calibration()
|
||||
{
|
||||
m_Save_calibrationIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Dataset_settings_unit_cell Dataset_settings::getUnitCell() const
|
||||
{
|
||||
return m_Unit_cell;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -131,13 +131,6 @@ public:
|
||||
bool sampleNameIsSet() const;
|
||||
void unsetSample_name();
|
||||
/// <summary>
|
||||
/// FPGA output data type
|
||||
/// </summary>
|
||||
std::string getFpgaOutput() const;
|
||||
void setFpgaOutput(std::string const& value);
|
||||
bool fpgaOutputIsSet() const;
|
||||
void unsetFpga_output();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getCompression() const;
|
||||
@@ -180,13 +173,6 @@ public:
|
||||
bool imageAppendixIsSet() const;
|
||||
void unsetImage_appendix();
|
||||
/// <summary>
|
||||
/// For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts
|
||||
/// </summary>
|
||||
float getEnergyMultiplier() const;
|
||||
void setEnergyMultiplier(float const value);
|
||||
bool energyMultiplierIsSet() const;
|
||||
void unsetEnergy_multiplier();
|
||||
/// <summary>
|
||||
/// Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability.
|
||||
/// </summary>
|
||||
float getDataReductionFactorSerialmx() const;
|
||||
@@ -194,6 +180,13 @@ public:
|
||||
bool dataReductionFactorSerialmxIsSet() const;
|
||||
void unsetData_reduction_factor_serialmx();
|
||||
/// <summary>
|
||||
/// Set all counts lower than the value to zero. When the value is set, negative numbers other than error pixel value are always set to zero. Setting to zero is equivalent to turning the option off.
|
||||
/// </summary>
|
||||
int64_t getPixelValueLowThreshold() const;
|
||||
void setPixelValueLowThreshold(int64_t const value);
|
||||
bool pixelValueLowThresholdIsSet() const;
|
||||
void unsetPixel_value_low_threshold();
|
||||
/// <summary>
|
||||
/// Number of run within an experimental session. Transferred over CBOR stream as \"series ID\", though not saved in HDF5 file. It is highly recommended to keep this number unique for each data collection during experimental series. If not provided, the number will be automatically incremented.
|
||||
/// </summary>
|
||||
int64_t getRunNumber() const;
|
||||
@@ -215,6 +208,27 @@ public:
|
||||
bool experimentGroupIsSet() const;
|
||||
void unsetExperiment_group();
|
||||
/// <summary>
|
||||
/// Enable lossy compression of pixel values that preserves Poisson statistics. Requires to provide a numerical factor SQ. Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer. Compression is turned off if the value is missing or it is set to zero.
|
||||
/// </summary>
|
||||
int64_t getPoissonCompression() const;
|
||||
void setPoissonCompression(int64_t const value);
|
||||
bool poissonCompressionIsSet() const;
|
||||
void unsetPoisson_compression();
|
||||
/// <summary>
|
||||
/// Write NXmx formatted HDF5 master file. Recommended to use for macromolecular crystallography experiments and to turn off for other experiments.
|
||||
/// </summary>
|
||||
bool isWriteNxmxHdf5Master() const;
|
||||
void setWriteNxmxHdf5Master(bool const value);
|
||||
bool writeNxmxHdf5MasterIsSet() const;
|
||||
void unsetWrite_nxmx_hdf5_master();
|
||||
/// <summary>
|
||||
/// Forward image calibration (at the moment pedestal and pedestal RMS for JUNGFRAU) using the ZeroMQ stream to writer. If parameter is not provided calibration will be saved only if more than 4 images are recorded.
|
||||
/// </summary>
|
||||
bool isSaveCalibration() const;
|
||||
void setSaveCalibration(bool const value);
|
||||
bool saveCalibrationIsSet() const;
|
||||
void unsetSave_calibration();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Dataset_settings_unit_cell getUnitCell() const;
|
||||
@@ -222,8 +236,8 @@ public:
|
||||
bool unitCellIsSet() const;
|
||||
void unsetUnit_cell();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings& o);
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings& o);
|
||||
protected:
|
||||
int64_t m_Images_per_trigger;
|
||||
bool m_Images_per_triggerIsSet;
|
||||
@@ -247,8 +261,6 @@ protected:
|
||||
bool m_Space_group_numberIsSet;
|
||||
std::string m_Sample_name;
|
||||
bool m_Sample_nameIsSet;
|
||||
std::string m_Fpga_output;
|
||||
bool m_Fpga_outputIsSet;
|
||||
std::string m_Compression;
|
||||
bool m_CompressionIsSet;
|
||||
float m_Total_flux;
|
||||
@@ -261,16 +273,22 @@ protected:
|
||||
bool m_Header_appendixIsSet;
|
||||
nlohmann::json m_Image_appendix;
|
||||
bool m_Image_appendixIsSet;
|
||||
float m_Energy_multiplier;
|
||||
bool m_Energy_multiplierIsSet;
|
||||
float m_Data_reduction_factor_serialmx;
|
||||
bool m_Data_reduction_factor_serialmxIsSet;
|
||||
int64_t m_Pixel_value_low_threshold;
|
||||
bool m_Pixel_value_low_thresholdIsSet;
|
||||
int64_t m_Run_number;
|
||||
bool m_Run_numberIsSet;
|
||||
std::string m_Run_name;
|
||||
bool m_Run_nameIsSet;
|
||||
std::string m_Experiment_group;
|
||||
bool m_Experiment_groupIsSet;
|
||||
int64_t m_Poisson_compression;
|
||||
bool m_Poisson_compressionIsSet;
|
||||
bool m_Write_nxmx_hdf5_master;
|
||||
bool m_Write_nxmx_hdf5_masterIsSet;
|
||||
bool m_Save_calibration;
|
||||
bool m_Save_calibrationIsSet;
|
||||
org::openapitools::server::model::Dataset_settings_unit_cell m_Unit_cell;
|
||||
bool m_Unit_cellIsSet;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -185,7 +185,7 @@ bool Dataset_settings_unit_cell::operator!=(const Dataset_settings_unit_cell& rh
|
||||
|
||||
void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["a"] = o.m_a;
|
||||
j["b"] = o.m_b;
|
||||
j["c"] = o.m_c;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -88,8 +88,8 @@ public:
|
||||
float getGamma() const;
|
||||
void setGamma(float const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings_unit_cell& o);
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings_unit_cell& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings_unit_cell& o);
|
||||
protected:
|
||||
float m_a;
|
||||
|
||||
|
||||
611
broker/gen/model/Detector.cpp
Normal file
611
broker/gen/model/Detector.cpp
Normal file
@@ -0,0 +1,611 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Detector.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Detector::Detector()
|
||||
{
|
||||
m_Description = "";
|
||||
m_Serial_number = "";
|
||||
m_TypeIsSet = false;
|
||||
m_High_voltage_V = 0L;
|
||||
m_High_voltage_VIsSet = false;
|
||||
m_Udp_interface_count = 1L;
|
||||
m_Udp_interface_countIsSet = false;
|
||||
m_Sensor_thickness_um = 320.0f;
|
||||
m_Sensor_thickness_umIsSet = false;
|
||||
m_Calibration_fileIsSet = false;
|
||||
m_HostnameIsSet = false;
|
||||
m_Sensor_material = "Si";
|
||||
m_Sensor_materialIsSet = false;
|
||||
m_Tx_delayIsSet = false;
|
||||
m_Base_data_ipv4_address = "";
|
||||
m_Base_data_ipv4_addressIsSet = false;
|
||||
m_Standard_geometryIsSet = false;
|
||||
m_Custom_geometryIsSet = false;
|
||||
m_Mirror_y = true;
|
||||
m_Mirror_yIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Detector::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Detector::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Detector" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
/* Description */ {
|
||||
const std::string& value = m_Description;
|
||||
const std::string currentValuePath = _pathPrefix + ".description";
|
||||
|
||||
|
||||
if (value.length() < 1)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be at least 1 characters long;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Serial_number */ {
|
||||
const std::string& value = m_Serial_number;
|
||||
const std::string currentValuePath = _pathPrefix + ".serialNumber";
|
||||
|
||||
|
||||
if (value.length() < 1)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be at least 1 characters long;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (highVoltageVIsSet())
|
||||
{
|
||||
const int64_t& value = m_High_voltage_V;
|
||||
const std::string currentValuePath = _pathPrefix + ".highVoltageV";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
if (value > 200ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 200;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (udpInterfaceCountIsSet())
|
||||
{
|
||||
const int64_t& value = m_Udp_interface_count;
|
||||
const std::string currentValuePath = _pathPrefix + ".udpInterfaceCount";
|
||||
|
||||
|
||||
if (value < 1ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 2ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 2;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sensorThicknessUmIsSet())
|
||||
{
|
||||
const float& value = m_Sensor_thickness_um;
|
||||
const std::string currentValuePath = _pathPrefix + ".sensorThicknessUm";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (calibrationFileIsSet())
|
||||
{
|
||||
const std::vector<std::string>& value = m_Calibration_file;
|
||||
const std::string currentValuePath = _pathPrefix + ".calibrationFile";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const std::string& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (hostnameIsSet())
|
||||
{
|
||||
const std::vector<std::string>& value = m_Hostname;
|
||||
const std::string currentValuePath = _pathPrefix + ".hostname";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const std::string& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (txDelayIsSet())
|
||||
{
|
||||
const std::vector<int64_t>& value = m_Tx_delay;
|
||||
const std::string currentValuePath = _pathPrefix + ".txDelay";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const int64_t& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (customGeometryIsSet())
|
||||
{
|
||||
const std::vector<org::openapitools::server::model::Detector_module>& value = m_Custom_geometry;
|
||||
const std::string currentValuePath = _pathPrefix + ".customGeometry";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const org::openapitools::server::model::Detector_module& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
success = value.validate(msg, currentValuePath + ".customGeometry") && success;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Detector::operator==(const Detector& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getDescription() == rhs.getDescription())
|
||||
&&
|
||||
|
||||
(getSerialNumber() == rhs.getSerialNumber())
|
||||
&&
|
||||
|
||||
|
||||
((!typeIsSet() && !rhs.typeIsSet()) || (typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType())) &&
|
||||
|
||||
|
||||
((!highVoltageVIsSet() && !rhs.highVoltageVIsSet()) || (highVoltageVIsSet() && rhs.highVoltageVIsSet() && getHighVoltageV() == rhs.getHighVoltageV())) &&
|
||||
|
||||
|
||||
((!udpInterfaceCountIsSet() && !rhs.udpInterfaceCountIsSet()) || (udpInterfaceCountIsSet() && rhs.udpInterfaceCountIsSet() && getUdpInterfaceCount() == rhs.getUdpInterfaceCount())) &&
|
||||
|
||||
|
||||
((!sensorThicknessUmIsSet() && !rhs.sensorThicknessUmIsSet()) || (sensorThicknessUmIsSet() && rhs.sensorThicknessUmIsSet() && getSensorThicknessUm() == rhs.getSensorThicknessUm())) &&
|
||||
|
||||
|
||||
((!calibrationFileIsSet() && !rhs.calibrationFileIsSet()) || (calibrationFileIsSet() && rhs.calibrationFileIsSet() && getCalibrationFile() == rhs.getCalibrationFile())) &&
|
||||
|
||||
|
||||
((!hostnameIsSet() && !rhs.hostnameIsSet()) || (hostnameIsSet() && rhs.hostnameIsSet() && getHostname() == rhs.getHostname())) &&
|
||||
|
||||
|
||||
((!sensorMaterialIsSet() && !rhs.sensorMaterialIsSet()) || (sensorMaterialIsSet() && rhs.sensorMaterialIsSet() && getSensorMaterial() == rhs.getSensorMaterial())) &&
|
||||
|
||||
|
||||
((!txDelayIsSet() && !rhs.txDelayIsSet()) || (txDelayIsSet() && rhs.txDelayIsSet() && getTxDelay() == rhs.getTxDelay())) &&
|
||||
|
||||
|
||||
((!baseDataIpv4AddressIsSet() && !rhs.baseDataIpv4AddressIsSet()) || (baseDataIpv4AddressIsSet() && rhs.baseDataIpv4AddressIsSet() && getBaseDataIpv4Address() == rhs.getBaseDataIpv4Address())) &&
|
||||
|
||||
|
||||
((!standardGeometryIsSet() && !rhs.standardGeometryIsSet()) || (standardGeometryIsSet() && rhs.standardGeometryIsSet() && getStandardGeometry() == rhs.getStandardGeometry())) &&
|
||||
|
||||
|
||||
((!customGeometryIsSet() && !rhs.customGeometryIsSet()) || (customGeometryIsSet() && rhs.customGeometryIsSet() && getCustomGeometry() == rhs.getCustomGeometry())) &&
|
||||
|
||||
|
||||
((!mirrorYIsSet() && !rhs.mirrorYIsSet()) || (mirrorYIsSet() && rhs.mirrorYIsSet() && isMirrorY() == rhs.isMirrorY()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Detector::operator!=(const Detector& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["description"] = o.m_Description;
|
||||
j["serial_number"] = o.m_Serial_number;
|
||||
if(o.typeIsSet())
|
||||
j["type"] = o.m_Type;
|
||||
if(o.highVoltageVIsSet())
|
||||
j["high_voltage_V"] = o.m_High_voltage_V;
|
||||
if(o.udpInterfaceCountIsSet())
|
||||
j["udp_interface_count"] = o.m_Udp_interface_count;
|
||||
if(o.sensorThicknessUmIsSet())
|
||||
j["sensor_thickness_um"] = o.m_Sensor_thickness_um;
|
||||
if(o.calibrationFileIsSet() || !o.m_Calibration_file.empty())
|
||||
j["calibration_file"] = o.m_Calibration_file;
|
||||
if(o.hostnameIsSet() || !o.m_Hostname.empty())
|
||||
j["hostname"] = o.m_Hostname;
|
||||
if(o.sensorMaterialIsSet())
|
||||
j["sensor_material"] = o.m_Sensor_material;
|
||||
if(o.txDelayIsSet() || !o.m_Tx_delay.empty())
|
||||
j["tx_delay"] = o.m_Tx_delay;
|
||||
if(o.baseDataIpv4AddressIsSet())
|
||||
j["base_data_ipv4_address"] = o.m_Base_data_ipv4_address;
|
||||
if(o.standardGeometryIsSet())
|
||||
j["standard_geometry"] = o.m_Standard_geometry;
|
||||
if(o.customGeometryIsSet() || !o.m_Custom_geometry.empty())
|
||||
j["custom_geometry"] = o.m_Custom_geometry;
|
||||
if(o.mirrorYIsSet())
|
||||
j["mirror_y"] = o.m_Mirror_y;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Detector& o)
|
||||
{
|
||||
j.at("description").get_to(o.m_Description);
|
||||
j.at("serial_number").get_to(o.m_Serial_number);
|
||||
if(j.find("type") != j.end())
|
||||
{
|
||||
j.at("type").get_to(o.m_Type);
|
||||
o.m_TypeIsSet = true;
|
||||
}
|
||||
if(j.find("high_voltage_V") != j.end())
|
||||
{
|
||||
j.at("high_voltage_V").get_to(o.m_High_voltage_V);
|
||||
o.m_High_voltage_VIsSet = true;
|
||||
}
|
||||
if(j.find("udp_interface_count") != j.end())
|
||||
{
|
||||
j.at("udp_interface_count").get_to(o.m_Udp_interface_count);
|
||||
o.m_Udp_interface_countIsSet = true;
|
||||
}
|
||||
if(j.find("sensor_thickness_um") != j.end())
|
||||
{
|
||||
j.at("sensor_thickness_um").get_to(o.m_Sensor_thickness_um);
|
||||
o.m_Sensor_thickness_umIsSet = true;
|
||||
}
|
||||
if(j.find("calibration_file") != j.end())
|
||||
{
|
||||
j.at("calibration_file").get_to(o.m_Calibration_file);
|
||||
o.m_Calibration_fileIsSet = true;
|
||||
}
|
||||
if(j.find("hostname") != j.end())
|
||||
{
|
||||
j.at("hostname").get_to(o.m_Hostname);
|
||||
o.m_HostnameIsSet = true;
|
||||
}
|
||||
if(j.find("sensor_material") != j.end())
|
||||
{
|
||||
j.at("sensor_material").get_to(o.m_Sensor_material);
|
||||
o.m_Sensor_materialIsSet = true;
|
||||
}
|
||||
if(j.find("tx_delay") != j.end())
|
||||
{
|
||||
j.at("tx_delay").get_to(o.m_Tx_delay);
|
||||
o.m_Tx_delayIsSet = true;
|
||||
}
|
||||
if(j.find("base_data_ipv4_address") != j.end())
|
||||
{
|
||||
j.at("base_data_ipv4_address").get_to(o.m_Base_data_ipv4_address);
|
||||
o.m_Base_data_ipv4_addressIsSet = true;
|
||||
}
|
||||
if(j.find("standard_geometry") != j.end())
|
||||
{
|
||||
j.at("standard_geometry").get_to(o.m_Standard_geometry);
|
||||
o.m_Standard_geometryIsSet = true;
|
||||
}
|
||||
if(j.find("custom_geometry") != j.end())
|
||||
{
|
||||
j.at("custom_geometry").get_to(o.m_Custom_geometry);
|
||||
o.m_Custom_geometryIsSet = true;
|
||||
}
|
||||
if(j.find("mirror_y") != j.end())
|
||||
{
|
||||
j.at("mirror_y").get_to(o.m_Mirror_y);
|
||||
o.m_Mirror_yIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string Detector::getDescription() const
|
||||
{
|
||||
return m_Description;
|
||||
}
|
||||
void Detector::setDescription(std::string const& value)
|
||||
{
|
||||
m_Description = value;
|
||||
}
|
||||
std::string Detector::getSerialNumber() const
|
||||
{
|
||||
return m_Serial_number;
|
||||
}
|
||||
void Detector::setSerialNumber(std::string const& value)
|
||||
{
|
||||
m_Serial_number = value;
|
||||
}
|
||||
org::openapitools::server::model::Detector_type Detector::getType() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
void Detector::setType(org::openapitools::server::model::Detector_type const& value)
|
||||
{
|
||||
m_Type = value;
|
||||
m_TypeIsSet = true;
|
||||
}
|
||||
bool Detector::typeIsSet() const
|
||||
{
|
||||
return m_TypeIsSet;
|
||||
}
|
||||
void Detector::unsetType()
|
||||
{
|
||||
m_TypeIsSet = false;
|
||||
}
|
||||
int64_t Detector::getHighVoltageV() const
|
||||
{
|
||||
return m_High_voltage_V;
|
||||
}
|
||||
void Detector::setHighVoltageV(int64_t const value)
|
||||
{
|
||||
m_High_voltage_V = value;
|
||||
m_High_voltage_VIsSet = true;
|
||||
}
|
||||
bool Detector::highVoltageVIsSet() const
|
||||
{
|
||||
return m_High_voltage_VIsSet;
|
||||
}
|
||||
void Detector::unsetHigh_voltage_V()
|
||||
{
|
||||
m_High_voltage_VIsSet = false;
|
||||
}
|
||||
int64_t Detector::getUdpInterfaceCount() const
|
||||
{
|
||||
return m_Udp_interface_count;
|
||||
}
|
||||
void Detector::setUdpInterfaceCount(int64_t const value)
|
||||
{
|
||||
m_Udp_interface_count = value;
|
||||
m_Udp_interface_countIsSet = true;
|
||||
}
|
||||
bool Detector::udpInterfaceCountIsSet() const
|
||||
{
|
||||
return m_Udp_interface_countIsSet;
|
||||
}
|
||||
void Detector::unsetUdp_interface_count()
|
||||
{
|
||||
m_Udp_interface_countIsSet = false;
|
||||
}
|
||||
float Detector::getSensorThicknessUm() const
|
||||
{
|
||||
return m_Sensor_thickness_um;
|
||||
}
|
||||
void Detector::setSensorThicknessUm(float const value)
|
||||
{
|
||||
m_Sensor_thickness_um = value;
|
||||
m_Sensor_thickness_umIsSet = true;
|
||||
}
|
||||
bool Detector::sensorThicknessUmIsSet() const
|
||||
{
|
||||
return m_Sensor_thickness_umIsSet;
|
||||
}
|
||||
void Detector::unsetSensor_thickness_um()
|
||||
{
|
||||
m_Sensor_thickness_umIsSet = false;
|
||||
}
|
||||
std::vector<std::string> Detector::getCalibrationFile() const
|
||||
{
|
||||
return m_Calibration_file;
|
||||
}
|
||||
void Detector::setCalibrationFile(std::vector<std::string> const& value)
|
||||
{
|
||||
m_Calibration_file = value;
|
||||
m_Calibration_fileIsSet = true;
|
||||
}
|
||||
bool Detector::calibrationFileIsSet() const
|
||||
{
|
||||
return m_Calibration_fileIsSet;
|
||||
}
|
||||
void Detector::unsetCalibration_file()
|
||||
{
|
||||
m_Calibration_fileIsSet = false;
|
||||
}
|
||||
std::vector<std::string> Detector::getHostname() const
|
||||
{
|
||||
return m_Hostname;
|
||||
}
|
||||
void Detector::setHostname(std::vector<std::string> const& value)
|
||||
{
|
||||
m_Hostname = value;
|
||||
m_HostnameIsSet = true;
|
||||
}
|
||||
bool Detector::hostnameIsSet() const
|
||||
{
|
||||
return m_HostnameIsSet;
|
||||
}
|
||||
void Detector::unsetHostname()
|
||||
{
|
||||
m_HostnameIsSet = false;
|
||||
}
|
||||
std::string Detector::getSensorMaterial() const
|
||||
{
|
||||
return m_Sensor_material;
|
||||
}
|
||||
void Detector::setSensorMaterial(std::string const& value)
|
||||
{
|
||||
m_Sensor_material = value;
|
||||
m_Sensor_materialIsSet = true;
|
||||
}
|
||||
bool Detector::sensorMaterialIsSet() const
|
||||
{
|
||||
return m_Sensor_materialIsSet;
|
||||
}
|
||||
void Detector::unsetSensor_material()
|
||||
{
|
||||
m_Sensor_materialIsSet = false;
|
||||
}
|
||||
std::vector<int64_t> Detector::getTxDelay() const
|
||||
{
|
||||
return m_Tx_delay;
|
||||
}
|
||||
void Detector::setTxDelay(std::vector<int64_t> const value)
|
||||
{
|
||||
m_Tx_delay = value;
|
||||
m_Tx_delayIsSet = true;
|
||||
}
|
||||
bool Detector::txDelayIsSet() const
|
||||
{
|
||||
return m_Tx_delayIsSet;
|
||||
}
|
||||
void Detector::unsetTx_delay()
|
||||
{
|
||||
m_Tx_delayIsSet = false;
|
||||
}
|
||||
std::string Detector::getBaseDataIpv4Address() const
|
||||
{
|
||||
return m_Base_data_ipv4_address;
|
||||
}
|
||||
void Detector::setBaseDataIpv4Address(std::string const& value)
|
||||
{
|
||||
m_Base_data_ipv4_address = value;
|
||||
m_Base_data_ipv4_addressIsSet = true;
|
||||
}
|
||||
bool Detector::baseDataIpv4AddressIsSet() const
|
||||
{
|
||||
return m_Base_data_ipv4_addressIsSet;
|
||||
}
|
||||
void Detector::unsetBase_data_ipv4_address()
|
||||
{
|
||||
m_Base_data_ipv4_addressIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Standard_detector_geometry Detector::getStandardGeometry() const
|
||||
{
|
||||
return m_Standard_geometry;
|
||||
}
|
||||
void Detector::setStandardGeometry(org::openapitools::server::model::Standard_detector_geometry const& value)
|
||||
{
|
||||
m_Standard_geometry = value;
|
||||
m_Standard_geometryIsSet = true;
|
||||
}
|
||||
bool Detector::standardGeometryIsSet() const
|
||||
{
|
||||
return m_Standard_geometryIsSet;
|
||||
}
|
||||
void Detector::unsetStandard_geometry()
|
||||
{
|
||||
m_Standard_geometryIsSet = false;
|
||||
}
|
||||
std::vector<org::openapitools::server::model::Detector_module> Detector::getCustomGeometry() const
|
||||
{
|
||||
return m_Custom_geometry;
|
||||
}
|
||||
void Detector::setCustomGeometry(std::vector<org::openapitools::server::model::Detector_module> const& value)
|
||||
{
|
||||
m_Custom_geometry = value;
|
||||
m_Custom_geometryIsSet = true;
|
||||
}
|
||||
bool Detector::customGeometryIsSet() const
|
||||
{
|
||||
return m_Custom_geometryIsSet;
|
||||
}
|
||||
void Detector::unsetCustom_geometry()
|
||||
{
|
||||
m_Custom_geometryIsSet = false;
|
||||
}
|
||||
bool Detector::isMirrorY() const
|
||||
{
|
||||
return m_Mirror_y;
|
||||
}
|
||||
void Detector::setMirrorY(bool const value)
|
||||
{
|
||||
m_Mirror_y = value;
|
||||
m_Mirror_yIsSet = true;
|
||||
}
|
||||
bool Detector::mirrorYIsSet() const
|
||||
{
|
||||
return m_Mirror_yIsSet;
|
||||
}
|
||||
void Detector::unsetMirror_y()
|
||||
{
|
||||
m_Mirror_yIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
196
broker/gen/model/Detector.h
Normal file
196
broker/gen/model/Detector.h
Normal file
@@ -0,0 +1,196 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Detector.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Detector_H_
|
||||
#define Detector_H_
|
||||
|
||||
|
||||
#include "Detector_type.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "Standard_detector_geometry.h"
|
||||
#include "Detector_module.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Detector
|
||||
{
|
||||
public:
|
||||
Detector();
|
||||
virtual ~Detector() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Detector& rhs) const;
|
||||
bool operator!=(const Detector& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Detector members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getDescription() const;
|
||||
void setDescription(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getSerialNumber() const;
|
||||
void setSerialNumber(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Detector_type getType() const;
|
||||
void setType(org::openapitools::server::model::Detector_type const& value);
|
||||
bool typeIsSet() const;
|
||||
void unsetType();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getHighVoltageV() const;
|
||||
void setHighVoltageV(int64_t const value);
|
||||
bool highVoltageVIsSet() const;
|
||||
void unsetHigh_voltage_V();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getUdpInterfaceCount() const;
|
||||
void setUdpInterfaceCount(int64_t const value);
|
||||
bool udpInterfaceCountIsSet() const;
|
||||
void unsetUdp_interface_count();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getSensorThicknessUm() const;
|
||||
void setSensorThicknessUm(float const value);
|
||||
bool sensorThicknessUmIsSet() const;
|
||||
void unsetSensor_thickness_um();
|
||||
/// <summary>
|
||||
/// Gain file (JUNGFRAU) or trimbit file (EIGER). One entry per module. Either empty or number of module entries.
|
||||
/// </summary>
|
||||
std::vector<std::string> getCalibrationFile() const;
|
||||
void setCalibrationFile(std::vector<std::string> const& value);
|
||||
bool calibrationFileIsSet() const;
|
||||
void unsetCalibration_file();
|
||||
/// <summary>
|
||||
/// Hostname for detector module. One entry per module One entry per module. Either empty or number of module entries.
|
||||
/// </summary>
|
||||
std::vector<std::string> getHostname() const;
|
||||
void setHostname(std::vector<std::string> const& value);
|
||||
bool hostnameIsSet() const;
|
||||
void unsetHostname();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getSensorMaterial() const;
|
||||
void setSensorMaterial(std::string const& value);
|
||||
bool sensorMaterialIsSet() const;
|
||||
void unsetSensor_material();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<int64_t> getTxDelay() const;
|
||||
void setTxDelay(std::vector<int64_t> const value);
|
||||
bool txDelayIsSet() const;
|
||||
void unsetTx_delay();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getBaseDataIpv4Address() const;
|
||||
void setBaseDataIpv4Address(std::string const& value);
|
||||
bool baseDataIpv4AddressIsSet() const;
|
||||
void unsetBase_data_ipv4_address();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Standard_detector_geometry getStandardGeometry() const;
|
||||
void setStandardGeometry(org::openapitools::server::model::Standard_detector_geometry const& value);
|
||||
bool standardGeometryIsSet() const;
|
||||
void unsetStandard_geometry();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<org::openapitools::server::model::Detector_module> getCustomGeometry() const;
|
||||
void setCustomGeometry(std::vector<org::openapitools::server::model::Detector_module> const& value);
|
||||
bool customGeometryIsSet() const;
|
||||
void unsetCustom_geometry();
|
||||
/// <summary>
|
||||
/// Mirror detector in Y direction to account for MX convention of (0,0) point in top left corner
|
||||
/// </summary>
|
||||
bool isMirrorY() const;
|
||||
void setMirrorY(bool const value);
|
||||
bool mirrorYIsSet() const;
|
||||
void unsetMirror_y();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector& o);
|
||||
protected:
|
||||
std::string m_Description;
|
||||
|
||||
std::string m_Serial_number;
|
||||
|
||||
org::openapitools::server::model::Detector_type m_Type;
|
||||
bool m_TypeIsSet;
|
||||
int64_t m_High_voltage_V;
|
||||
bool m_High_voltage_VIsSet;
|
||||
int64_t m_Udp_interface_count;
|
||||
bool m_Udp_interface_countIsSet;
|
||||
float m_Sensor_thickness_um;
|
||||
bool m_Sensor_thickness_umIsSet;
|
||||
std::vector<std::string> m_Calibration_file;
|
||||
bool m_Calibration_fileIsSet;
|
||||
std::vector<std::string> m_Hostname;
|
||||
bool m_HostnameIsSet;
|
||||
std::string m_Sensor_material;
|
||||
bool m_Sensor_materialIsSet;
|
||||
std::vector<int64_t> m_Tx_delay;
|
||||
bool m_Tx_delayIsSet;
|
||||
std::string m_Base_data_ipv4_address;
|
||||
bool m_Base_data_ipv4_addressIsSet;
|
||||
org::openapitools::server::model::Standard_detector_geometry m_Standard_geometry;
|
||||
bool m_Standard_geometryIsSet;
|
||||
std::vector<org::openapitools::server::model::Detector_module> m_Custom_geometry;
|
||||
bool m_Custom_geometryIsSet;
|
||||
bool m_Mirror_y;
|
||||
bool m_Mirror_yIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Detector_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -90,7 +90,7 @@ bool Detector_list::operator!=(const Detector_list& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_list& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["detectors"] = o.m_Detectors;
|
||||
j["current_id"] = o.m_Current_id;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -70,8 +70,8 @@ public:
|
||||
int64_t getCurrentId() const;
|
||||
void setCurrentId(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_list& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_list& o);
|
||||
friend void to_json(nlohmann::json& j, const Detector_list& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_list& o);
|
||||
protected:
|
||||
std::vector<org::openapitools::server::model::Detector_list_detectors_inner> m_Detectors;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -23,6 +23,10 @@ Detector_list_detectors_inner::Detector_list_detectors_inner()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_Description = "";
|
||||
m_Serial_number = "";
|
||||
m_Base_ipv4_addr = "";
|
||||
m_Udp_interface_count = 0L;
|
||||
m_Udp_interface_countIsSet = false;
|
||||
m_Nmodules = 0L;
|
||||
m_Width = 0L;
|
||||
m_Height = 0L;
|
||||
@@ -62,7 +66,7 @@ bool Detector_list_detectors_inner::validate(std::stringstream& msg, const std::
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -77,6 +81,15 @@ bool Detector_list_detectors_inner::operator==(const Detector_list_detectors_inn
|
||||
(getDescription() == rhs.getDescription())
|
||||
&&
|
||||
|
||||
(getSerialNumber() == rhs.getSerialNumber())
|
||||
&&
|
||||
|
||||
(getBaseIpv4Addr() == rhs.getBaseIpv4Addr())
|
||||
&&
|
||||
|
||||
|
||||
((!udpInterfaceCountIsSet() && !rhs.udpInterfaceCountIsSet()) || (udpInterfaceCountIsSet() && rhs.udpInterfaceCountIsSet() && getUdpInterfaceCount() == rhs.getUdpInterfaceCount())) &&
|
||||
|
||||
(getNmodules() == rhs.getNmodules())
|
||||
&&
|
||||
|
||||
@@ -96,9 +109,13 @@ bool Detector_list_detectors_inner::operator!=(const Detector_list_detectors_inn
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["id"] = o.m_Id;
|
||||
j["description"] = o.m_Description;
|
||||
j["serial_number"] = o.m_Serial_number;
|
||||
j["base_ipv4_addr"] = o.m_Base_ipv4_addr;
|
||||
if(o.udpInterfaceCountIsSet())
|
||||
j["udp_interface_count"] = o.m_Udp_interface_count;
|
||||
j["nmodules"] = o.m_Nmodules;
|
||||
j["width"] = o.m_Width;
|
||||
j["height"] = o.m_Height;
|
||||
@@ -109,6 +126,13 @@ void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o)
|
||||
{
|
||||
j.at("id").get_to(o.m_Id);
|
||||
j.at("description").get_to(o.m_Description);
|
||||
j.at("serial_number").get_to(o.m_Serial_number);
|
||||
j.at("base_ipv4_addr").get_to(o.m_Base_ipv4_addr);
|
||||
if(j.find("udp_interface_count") != j.end())
|
||||
{
|
||||
j.at("udp_interface_count").get_to(o.m_Udp_interface_count);
|
||||
o.m_Udp_interface_countIsSet = true;
|
||||
}
|
||||
j.at("nmodules").get_to(o.m_Nmodules);
|
||||
j.at("width").get_to(o.m_Width);
|
||||
j.at("height").get_to(o.m_Height);
|
||||
@@ -131,6 +155,39 @@ void Detector_list_detectors_inner::setDescription(std::string const& value)
|
||||
{
|
||||
m_Description = value;
|
||||
}
|
||||
std::string Detector_list_detectors_inner::getSerialNumber() const
|
||||
{
|
||||
return m_Serial_number;
|
||||
}
|
||||
void Detector_list_detectors_inner::setSerialNumber(std::string const& value)
|
||||
{
|
||||
m_Serial_number = value;
|
||||
}
|
||||
std::string Detector_list_detectors_inner::getBaseIpv4Addr() const
|
||||
{
|
||||
return m_Base_ipv4_addr;
|
||||
}
|
||||
void Detector_list_detectors_inner::setBaseIpv4Addr(std::string const& value)
|
||||
{
|
||||
m_Base_ipv4_addr = value;
|
||||
}
|
||||
int64_t Detector_list_detectors_inner::getUdpInterfaceCount() const
|
||||
{
|
||||
return m_Udp_interface_count;
|
||||
}
|
||||
void Detector_list_detectors_inner::setUdpInterfaceCount(int64_t const value)
|
||||
{
|
||||
m_Udp_interface_count = value;
|
||||
m_Udp_interface_countIsSet = true;
|
||||
}
|
||||
bool Detector_list_detectors_inner::udpInterfaceCountIsSet() const
|
||||
{
|
||||
return m_Udp_interface_countIsSet;
|
||||
}
|
||||
void Detector_list_detectors_inner::unsetUdp_interface_count()
|
||||
{
|
||||
m_Udp_interface_countIsSet = false;
|
||||
}
|
||||
int64_t Detector_list_detectors_inner::getNmodules() const
|
||||
{
|
||||
return m_Nmodules;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -71,6 +71,23 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getSerialNumber() const;
|
||||
void setSerialNumber(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getBaseIpv4Addr() const;
|
||||
void setBaseIpv4Addr(std::string const& value);
|
||||
/// <summary>
|
||||
/// Number of UDP interfaces per detector module
|
||||
/// </summary>
|
||||
int64_t getUdpInterfaceCount() const;
|
||||
void setUdpInterfaceCount(int64_t const value);
|
||||
bool udpInterfaceCountIsSet() const;
|
||||
void unsetUdp_interface_count();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getNmodules() const;
|
||||
void setNmodules(int64_t const value);
|
||||
/// <summary>
|
||||
@@ -84,13 +101,19 @@ public:
|
||||
int64_t getHeight() const;
|
||||
void setHeight(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o);
|
||||
friend void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_list_detectors_inner& o);
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
||||
std::string m_Description;
|
||||
|
||||
std::string m_Serial_number;
|
||||
|
||||
std::string m_Base_ipv4_addr;
|
||||
|
||||
int64_t m_Udp_interface_count;
|
||||
bool m_Udp_interface_countIsSet;
|
||||
int64_t m_Nmodules;
|
||||
|
||||
int64_t m_Width;
|
||||
|
||||
131
broker/gen/model/Detector_module.cpp
Normal file
131
broker/gen/model/Detector_module.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Detector_module.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Detector_module::Detector_module()
|
||||
{
|
||||
m_X0 = 0.0;
|
||||
m_Y0 = 0.0;
|
||||
|
||||
}
|
||||
|
||||
void Detector_module::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Detector_module::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Detector_module::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_module" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Detector_module::operator==(const Detector_module& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getX0() == rhs.getX0())
|
||||
&&
|
||||
|
||||
(getY0() == rhs.getY0())
|
||||
&&
|
||||
|
||||
(getFastAxis() == rhs.getFastAxis())
|
||||
&&
|
||||
|
||||
(getSlowAxis() == rhs.getSlowAxis())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Detector_module::operator!=(const Detector_module& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_module& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["x0"] = o.m_X0;
|
||||
j["y0"] = o.m_Y0;
|
||||
j["fast_axis"] = o.m_Fast_axis;
|
||||
j["slow_axis"] = o.m_Slow_axis;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Detector_module& o)
|
||||
{
|
||||
j.at("x0").get_to(o.m_X0);
|
||||
j.at("y0").get_to(o.m_Y0);
|
||||
j.at("fast_axis").get_to(o.m_Fast_axis);
|
||||
j.at("slow_axis").get_to(o.m_Slow_axis);
|
||||
|
||||
}
|
||||
|
||||
double Detector_module::getX0() const
|
||||
{
|
||||
return m_X0;
|
||||
}
|
||||
void Detector_module::setX0(double const value)
|
||||
{
|
||||
m_X0 = value;
|
||||
}
|
||||
double Detector_module::getY0() const
|
||||
{
|
||||
return m_Y0;
|
||||
}
|
||||
void Detector_module::setY0(double const value)
|
||||
{
|
||||
m_Y0 = value;
|
||||
}
|
||||
org::openapitools::server::model::Detector_module_direction Detector_module::getFastAxis() const
|
||||
{
|
||||
return m_Fast_axis;
|
||||
}
|
||||
void Detector_module::setFastAxis(org::openapitools::server::model::Detector_module_direction const& value)
|
||||
{
|
||||
m_Fast_axis = value;
|
||||
}
|
||||
org::openapitools::server::model::Detector_module_direction Detector_module::getSlowAxis() const
|
||||
{
|
||||
return m_Slow_axis;
|
||||
}
|
||||
void Detector_module::setSlowAxis(org::openapitools::server::model::Detector_module_direction const& value)
|
||||
{
|
||||
m_Slow_axis = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
98
broker/gen/model/Detector_module.h
Normal file
98
broker/gen/model/Detector_module.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Detector_module.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Detector_module_H_
|
||||
#define Detector_module_H_
|
||||
|
||||
|
||||
#include "Detector_module_direction.h"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Detector_module
|
||||
{
|
||||
public:
|
||||
Detector_module();
|
||||
virtual ~Detector_module() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Detector_module& rhs) const;
|
||||
bool operator!=(const Detector_module& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Detector_module members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
double getX0() const;
|
||||
void setX0(double const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
double getY0() const;
|
||||
void setY0(double const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Detector_module_direction getFastAxis() const;
|
||||
void setFastAxis(org::openapitools::server::model::Detector_module_direction const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Detector_module_direction getSlowAxis() const;
|
||||
void setSlowAxis(org::openapitools::server::model::Detector_module_direction const& value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_module& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_module& o);
|
||||
protected:
|
||||
double m_X0;
|
||||
|
||||
double m_Y0;
|
||||
|
||||
org::openapitools::server::model::Detector_module_direction m_Fast_axis;
|
||||
|
||||
org::openapitools::server::model::Detector_module_direction m_Slow_axis;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Detector_module_H_ */
|
||||
128
broker/gen/model/Detector_module_direction.cpp
Normal file
128
broker/gen/model/Detector_module_direction.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Detector_module_direction.h"
|
||||
#include "Helpers.h"
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Detector_module_direction::Detector_module_direction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Detector_module_direction::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Detector_module_direction::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Detector_module_direction::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_module_direction" : pathPrefix;
|
||||
|
||||
|
||||
if (m_value == Detector_module_direction::eDetector_module_direction::INVALID_VALUE_OPENAPI_GENERATED)
|
||||
{
|
||||
success = false;
|
||||
msg << _pathPrefix << ": has no value;";
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Detector_module_direction::operator==(const Detector_module_direction& rhs) const
|
||||
{
|
||||
return
|
||||
getValue() == rhs.getValue()
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Detector_module_direction::operator!=(const Detector_module_direction& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_module_direction& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
|
||||
switch (o.getValue())
|
||||
{
|
||||
case Detector_module_direction::eDetector_module_direction::INVALID_VALUE_OPENAPI_GENERATED:
|
||||
j = "INVALID_VALUE_OPENAPI_GENERATED";
|
||||
break;
|
||||
case Detector_module_direction::eDetector_module_direction::XP:
|
||||
j = "Xp";
|
||||
break;
|
||||
case Detector_module_direction::eDetector_module_direction::XN:
|
||||
j = "Xn";
|
||||
break;
|
||||
case Detector_module_direction::eDetector_module_direction::YP:
|
||||
j = "Yp";
|
||||
break;
|
||||
case Detector_module_direction::eDetector_module_direction::YN:
|
||||
j = "Yn";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Detector_module_direction& o)
|
||||
{
|
||||
|
||||
auto s = j.get<std::string>();
|
||||
if (s == "Xp") {
|
||||
o.setValue(Detector_module_direction::eDetector_module_direction::XP);
|
||||
}
|
||||
else if (s == "Xn") {
|
||||
o.setValue(Detector_module_direction::eDetector_module_direction::XN);
|
||||
}
|
||||
else if (s == "Yp") {
|
||||
o.setValue(Detector_module_direction::eDetector_module_direction::YP);
|
||||
}
|
||||
else if (s == "Yn") {
|
||||
o.setValue(Detector_module_direction::eDetector_module_direction::YN);
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss << "Unexpected value " << s << " in json"
|
||||
<< " cannot be converted to enum of type"
|
||||
<< " Detector_module_direction::eDetector_module_direction";
|
||||
throw std::invalid_argument(ss.str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Detector_module_direction::eDetector_module_direction Detector_module_direction::getValue() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
void Detector_module_direction::setValue(Detector_module_direction::eDetector_module_direction value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
81
broker/gen/model/Detector_module_direction.h
Normal file
81
broker/gen/model/Detector_module_direction.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Detector_module_direction.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Detector_module_direction_H_
|
||||
#define Detector_module_direction_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Detector_module_direction
|
||||
{
|
||||
public:
|
||||
Detector_module_direction();
|
||||
virtual ~Detector_module_direction() = default;
|
||||
|
||||
enum class eDetector_module_direction {
|
||||
// To have a valid default value.
|
||||
// Avoiding name clashes with user defined
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
XP,
|
||||
XN,
|
||||
YP,
|
||||
YN
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Detector_module_direction& rhs) const;
|
||||
bool operator!=(const Detector_module_direction& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Detector_module_direction members
|
||||
|
||||
Detector_module_direction::eDetector_module_direction getValue() const;
|
||||
void setValue(Detector_module_direction::eDetector_module_direction value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_module_direction& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_module_direction& o);
|
||||
protected:
|
||||
Detector_module_direction::eDetector_module_direction m_value = Detector_module_direction::eDetector_module_direction::INVALID_VALUE_OPENAPI_GENERATED;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Detector_module_direction_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -66,7 +66,7 @@ bool Detector_selection::operator!=(const Detector_selection& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_selection& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["id"] = o.m_Id;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -63,8 +63,8 @@ public:
|
||||
int64_t getId() const;
|
||||
void setId(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_selection& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_selection& o);
|
||||
friend void to_json(nlohmann::json& j, const Detector_selection& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_selection& o);
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -25,23 +25,16 @@ Detector_settings::Detector_settings()
|
||||
m_Count_time_us = 0L;
|
||||
m_Count_time_usIsSet = false;
|
||||
m_Storage_cell_count = 1L;
|
||||
m_Storage_cell_countIsSet = false;
|
||||
m_Internal_frame_generator = false;
|
||||
m_Internal_frame_generatorIsSet = false;
|
||||
m_Internal_frame_generator_images = 1L;
|
||||
m_Internal_frame_generator_imagesIsSet = false;
|
||||
m_Collect_raw_data = false;
|
||||
m_Collect_raw_dataIsSet = false;
|
||||
m_Pedestal_g0_frames = 0L;
|
||||
m_Pedestal_g0_framesIsSet = false;
|
||||
m_Pedestal_g1_frames = 0L;
|
||||
m_Pedestal_g1_framesIsSet = false;
|
||||
m_Pedestal_g2_frames = 0L;
|
||||
m_Pedestal_g2_framesIsSet = false;
|
||||
m_Storage_cell_delay_us = 0.0f;
|
||||
m_Storage_cell_delay_usIsSet = false;
|
||||
m_Detector_trigger_delay_us = 0.0f;
|
||||
m_Detector_trigger_delay_usIsSet = false;
|
||||
m_Pedestal_g0_frames = 2000L;
|
||||
m_Pedestal_g1_frames = 300L;
|
||||
m_Pedestal_g2_frames = 300L;
|
||||
m_Pedestal_g0_rms_limit = 100L;
|
||||
m_Pedestal_min_image_count = 128L;
|
||||
m_Storage_cell_delay_ns = 5000L;
|
||||
m_Detector_trigger_delay_ns = 0L;
|
||||
m_Detector_trigger_delay_nsIsSet = false;
|
||||
m_Fixed_gain_g1 = false;
|
||||
m_Fixed_gain_g1IsSet = false;
|
||||
m_Use_gain_hg0 = false;
|
||||
@@ -83,8 +76,8 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
|
||||
|
||||
}
|
||||
|
||||
if (storageCellCountIsSet())
|
||||
{
|
||||
|
||||
/* Storage_cell_count */ {
|
||||
const int64_t& value = m_Storage_cell_count;
|
||||
const std::string currentValuePath = _pathPrefix + ".storageCellCount";
|
||||
|
||||
@@ -102,8 +95,8 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
|
||||
|
||||
}
|
||||
|
||||
if (internalFrameGeneratorImagesIsSet())
|
||||
{
|
||||
|
||||
/* Internal_frame_generator_images */ {
|
||||
const int64_t& value = m_Internal_frame_generator_images;
|
||||
const std::string currentValuePath = _pathPrefix + ".internalFrameGeneratorImages";
|
||||
|
||||
@@ -120,9 +113,9 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (pedestalG0FramesIsSet())
|
||||
{
|
||||
|
||||
|
||||
/* Pedestal_g0_frames */ {
|
||||
const int64_t& value = m_Pedestal_g0_frames;
|
||||
const std::string currentValuePath = _pathPrefix + ".pedestalG0Frames";
|
||||
|
||||
@@ -135,8 +128,8 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
|
||||
|
||||
}
|
||||
|
||||
if (pedestalG1FramesIsSet())
|
||||
{
|
||||
|
||||
/* Pedestal_g1_frames */ {
|
||||
const int64_t& value = m_Pedestal_g1_frames;
|
||||
const std::string currentValuePath = _pathPrefix + ".pedestalG1Frames";
|
||||
|
||||
@@ -149,8 +142,8 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
|
||||
|
||||
}
|
||||
|
||||
if (pedestalG2FramesIsSet())
|
||||
{
|
||||
|
||||
/* Pedestal_g2_frames */ {
|
||||
const int64_t& value = m_Pedestal_g2_frames;
|
||||
const std::string currentValuePath = _pathPrefix + ".pedestalG2Frames";
|
||||
|
||||
@@ -162,7 +155,63 @@ bool Detector_settings::validate(std::stringstream& msg, const std::string& path
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Pedestal_g0_rms_limit */ {
|
||||
const int64_t& value = m_Pedestal_g0_rms_limit;
|
||||
const std::string currentValuePath = _pathPrefix + ".pedestalG0RmsLimit";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Pedestal_min_image_count */ {
|
||||
const int64_t& value = m_Pedestal_min_image_count;
|
||||
const std::string currentValuePath = _pathPrefix + ".pedestalMinImageCount";
|
||||
|
||||
|
||||
if (value < 32ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 32;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Storage_cell_delay_ns */ {
|
||||
const int64_t& value = m_Storage_cell_delay_ns;
|
||||
const std::string currentValuePath = _pathPrefix + ".storageCellDelayNs";
|
||||
|
||||
|
||||
if (value < 2100ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 2100;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (detectorTriggerDelayNsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Detector_trigger_delay_ns;
|
||||
const std::string currentValuePath = _pathPrefix + ".detectorTriggerDelayNs";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -177,32 +226,35 @@ bool Detector_settings::operator==(const Detector_settings& rhs) const
|
||||
|
||||
((!countTimeUsIsSet() && !rhs.countTimeUsIsSet()) || (countTimeUsIsSet() && rhs.countTimeUsIsSet() && getCountTimeUs() == rhs.getCountTimeUs())) &&
|
||||
|
||||
(getStorageCellCount() == rhs.getStorageCellCount())
|
||||
&&
|
||||
|
||||
((!storageCellCountIsSet() && !rhs.storageCellCountIsSet()) || (storageCellCountIsSet() && rhs.storageCellCountIsSet() && getStorageCellCount() == rhs.getStorageCellCount())) &&
|
||||
(isInternalFrameGenerator() == rhs.isInternalFrameGenerator())
|
||||
&&
|
||||
|
||||
(getInternalFrameGeneratorImages() == rhs.getInternalFrameGeneratorImages())
|
||||
&&
|
||||
|
||||
(getPedestalG0Frames() == rhs.getPedestalG0Frames())
|
||||
&&
|
||||
|
||||
(getPedestalG1Frames() == rhs.getPedestalG1Frames())
|
||||
&&
|
||||
|
||||
(getPedestalG2Frames() == rhs.getPedestalG2Frames())
|
||||
&&
|
||||
|
||||
(getPedestalG0RmsLimit() == rhs.getPedestalG0RmsLimit())
|
||||
&&
|
||||
|
||||
(getPedestalMinImageCount() == rhs.getPedestalMinImageCount())
|
||||
&&
|
||||
|
||||
(getStorageCellDelayNs() == rhs.getStorageCellDelayNs())
|
||||
&&
|
||||
|
||||
|
||||
((!internalFrameGeneratorIsSet() && !rhs.internalFrameGeneratorIsSet()) || (internalFrameGeneratorIsSet() && rhs.internalFrameGeneratorIsSet() && isInternalFrameGenerator() == rhs.isInternalFrameGenerator())) &&
|
||||
|
||||
|
||||
((!internalFrameGeneratorImagesIsSet() && !rhs.internalFrameGeneratorImagesIsSet()) || (internalFrameGeneratorImagesIsSet() && rhs.internalFrameGeneratorImagesIsSet() && getInternalFrameGeneratorImages() == rhs.getInternalFrameGeneratorImages())) &&
|
||||
|
||||
|
||||
((!collectRawDataIsSet() && !rhs.collectRawDataIsSet()) || (collectRawDataIsSet() && rhs.collectRawDataIsSet() && isCollectRawData() == rhs.isCollectRawData())) &&
|
||||
|
||||
|
||||
((!pedestalG0FramesIsSet() && !rhs.pedestalG0FramesIsSet()) || (pedestalG0FramesIsSet() && rhs.pedestalG0FramesIsSet() && getPedestalG0Frames() == rhs.getPedestalG0Frames())) &&
|
||||
|
||||
|
||||
((!pedestalG1FramesIsSet() && !rhs.pedestalG1FramesIsSet()) || (pedestalG1FramesIsSet() && rhs.pedestalG1FramesIsSet() && getPedestalG1Frames() == rhs.getPedestalG1Frames())) &&
|
||||
|
||||
|
||||
((!pedestalG2FramesIsSet() && !rhs.pedestalG2FramesIsSet()) || (pedestalG2FramesIsSet() && rhs.pedestalG2FramesIsSet() && getPedestalG2Frames() == rhs.getPedestalG2Frames())) &&
|
||||
|
||||
|
||||
((!storageCellDelayUsIsSet() && !rhs.storageCellDelayUsIsSet()) || (storageCellDelayUsIsSet() && rhs.storageCellDelayUsIsSet() && getStorageCellDelayUs() == rhs.getStorageCellDelayUs())) &&
|
||||
|
||||
|
||||
((!detectorTriggerDelayUsIsSet() && !rhs.detectorTriggerDelayUsIsSet()) || (detectorTriggerDelayUsIsSet() && rhs.detectorTriggerDelayUsIsSet() && getDetectorTriggerDelayUs() == rhs.getDetectorTriggerDelayUs())) &&
|
||||
((!detectorTriggerDelayNsIsSet() && !rhs.detectorTriggerDelayNsIsSet()) || (detectorTriggerDelayNsIsSet() && rhs.detectorTriggerDelayNsIsSet() && getDetectorTriggerDelayNs() == rhs.getDetectorTriggerDelayNs())) &&
|
||||
|
||||
|
||||
((!fixedGainG1IsSet() && !rhs.fixedGainG1IsSet()) || (fixedGainG1IsSet() && rhs.fixedGainG1IsSet() && isFixedGainG1() == rhs.isFixedGainG1())) &&
|
||||
@@ -220,28 +272,21 @@ bool Detector_settings::operator!=(const Detector_settings& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_settings& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["frame_time_us"] = o.m_Frame_time_us;
|
||||
if(o.countTimeUsIsSet())
|
||||
j["count_time_us"] = o.m_Count_time_us;
|
||||
if(o.storageCellCountIsSet())
|
||||
j["storage_cell_count"] = o.m_Storage_cell_count;
|
||||
if(o.internalFrameGeneratorIsSet())
|
||||
j["internal_frame_generator"] = o.m_Internal_frame_generator;
|
||||
if(o.internalFrameGeneratorImagesIsSet())
|
||||
j["internal_frame_generator_images"] = o.m_Internal_frame_generator_images;
|
||||
if(o.collectRawDataIsSet())
|
||||
j["collect_raw_data"] = o.m_Collect_raw_data;
|
||||
if(o.pedestalG0FramesIsSet())
|
||||
j["pedestal_g0_frames"] = o.m_Pedestal_g0_frames;
|
||||
if(o.pedestalG1FramesIsSet())
|
||||
j["pedestal_g1_frames"] = o.m_Pedestal_g1_frames;
|
||||
if(o.pedestalG2FramesIsSet())
|
||||
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
|
||||
if(o.storageCellDelayUsIsSet())
|
||||
j["storage_cell_delay_us"] = o.m_Storage_cell_delay_us;
|
||||
if(o.detectorTriggerDelayUsIsSet())
|
||||
j["detector_trigger_delay_us"] = o.m_Detector_trigger_delay_us;
|
||||
j["storage_cell_count"] = o.m_Storage_cell_count;
|
||||
j["internal_frame_generator"] = o.m_Internal_frame_generator;
|
||||
j["internal_frame_generator_images"] = o.m_Internal_frame_generator_images;
|
||||
j["pedestal_g0_frames"] = o.m_Pedestal_g0_frames;
|
||||
j["pedestal_g1_frames"] = o.m_Pedestal_g1_frames;
|
||||
j["pedestal_g2_frames"] = o.m_Pedestal_g2_frames;
|
||||
j["pedestal_g0_rms_limit"] = o.m_Pedestal_g0_rms_limit;
|
||||
j["pedestal_min_image_count"] = o.m_Pedestal_min_image_count;
|
||||
j["storage_cell_delay_ns"] = o.m_Storage_cell_delay_ns;
|
||||
if(o.detectorTriggerDelayNsIsSet())
|
||||
j["detector_trigger_delay_ns"] = o.m_Detector_trigger_delay_ns;
|
||||
if(o.fixedGainG1IsSet())
|
||||
j["fixed_gain_g1"] = o.m_Fixed_gain_g1;
|
||||
if(o.useGainHg0IsSet())
|
||||
@@ -257,50 +302,19 @@ void from_json(const nlohmann::json& j, Detector_settings& o)
|
||||
j.at("count_time_us").get_to(o.m_Count_time_us);
|
||||
o.m_Count_time_usIsSet = true;
|
||||
}
|
||||
if(j.find("storage_cell_count") != j.end())
|
||||
j.at("storage_cell_count").get_to(o.m_Storage_cell_count);
|
||||
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
|
||||
j.at("internal_frame_generator_images").get_to(o.m_Internal_frame_generator_images);
|
||||
j.at("pedestal_g0_frames").get_to(o.m_Pedestal_g0_frames);
|
||||
j.at("pedestal_g1_frames").get_to(o.m_Pedestal_g1_frames);
|
||||
j.at("pedestal_g2_frames").get_to(o.m_Pedestal_g2_frames);
|
||||
j.at("pedestal_g0_rms_limit").get_to(o.m_Pedestal_g0_rms_limit);
|
||||
j.at("pedestal_min_image_count").get_to(o.m_Pedestal_min_image_count);
|
||||
j.at("storage_cell_delay_ns").get_to(o.m_Storage_cell_delay_ns);
|
||||
if(j.find("detector_trigger_delay_ns") != j.end())
|
||||
{
|
||||
j.at("storage_cell_count").get_to(o.m_Storage_cell_count);
|
||||
o.m_Storage_cell_countIsSet = true;
|
||||
}
|
||||
if(j.find("internal_frame_generator") != j.end())
|
||||
{
|
||||
j.at("internal_frame_generator").get_to(o.m_Internal_frame_generator);
|
||||
o.m_Internal_frame_generatorIsSet = true;
|
||||
}
|
||||
if(j.find("internal_frame_generator_images") != j.end())
|
||||
{
|
||||
j.at("internal_frame_generator_images").get_to(o.m_Internal_frame_generator_images);
|
||||
o.m_Internal_frame_generator_imagesIsSet = true;
|
||||
}
|
||||
if(j.find("collect_raw_data") != j.end())
|
||||
{
|
||||
j.at("collect_raw_data").get_to(o.m_Collect_raw_data);
|
||||
o.m_Collect_raw_dataIsSet = true;
|
||||
}
|
||||
if(j.find("pedestal_g0_frames") != j.end())
|
||||
{
|
||||
j.at("pedestal_g0_frames").get_to(o.m_Pedestal_g0_frames);
|
||||
o.m_Pedestal_g0_framesIsSet = true;
|
||||
}
|
||||
if(j.find("pedestal_g1_frames") != j.end())
|
||||
{
|
||||
j.at("pedestal_g1_frames").get_to(o.m_Pedestal_g1_frames);
|
||||
o.m_Pedestal_g1_framesIsSet = true;
|
||||
}
|
||||
if(j.find("pedestal_g2_frames") != j.end())
|
||||
{
|
||||
j.at("pedestal_g2_frames").get_to(o.m_Pedestal_g2_frames);
|
||||
o.m_Pedestal_g2_framesIsSet = true;
|
||||
}
|
||||
if(j.find("storage_cell_delay_us") != j.end())
|
||||
{
|
||||
j.at("storage_cell_delay_us").get_to(o.m_Storage_cell_delay_us);
|
||||
o.m_Storage_cell_delay_usIsSet = true;
|
||||
}
|
||||
if(j.find("detector_trigger_delay_us") != j.end())
|
||||
{
|
||||
j.at("detector_trigger_delay_us").get_to(o.m_Detector_trigger_delay_us);
|
||||
o.m_Detector_trigger_delay_usIsSet = true;
|
||||
j.at("detector_trigger_delay_ns").get_to(o.m_Detector_trigger_delay_ns);
|
||||
o.m_Detector_trigger_delay_nsIsSet = true;
|
||||
}
|
||||
if(j.find("fixed_gain_g1") != j.end())
|
||||
{
|
||||
@@ -347,15 +361,6 @@ int64_t Detector_settings::getStorageCellCount() const
|
||||
void Detector_settings::setStorageCellCount(int64_t const value)
|
||||
{
|
||||
m_Storage_cell_count = value;
|
||||
m_Storage_cell_countIsSet = true;
|
||||
}
|
||||
bool Detector_settings::storageCellCountIsSet() const
|
||||
{
|
||||
return m_Storage_cell_countIsSet;
|
||||
}
|
||||
void Detector_settings::unsetStorage_cell_count()
|
||||
{
|
||||
m_Storage_cell_countIsSet = false;
|
||||
}
|
||||
bool Detector_settings::isInternalFrameGenerator() const
|
||||
{
|
||||
@@ -364,15 +369,6 @@ bool Detector_settings::isInternalFrameGenerator() const
|
||||
void Detector_settings::setInternalFrameGenerator(bool const value)
|
||||
{
|
||||
m_Internal_frame_generator = value;
|
||||
m_Internal_frame_generatorIsSet = true;
|
||||
}
|
||||
bool Detector_settings::internalFrameGeneratorIsSet() const
|
||||
{
|
||||
return m_Internal_frame_generatorIsSet;
|
||||
}
|
||||
void Detector_settings::unsetInternal_frame_generator()
|
||||
{
|
||||
m_Internal_frame_generatorIsSet = false;
|
||||
}
|
||||
int64_t Detector_settings::getInternalFrameGeneratorImages() const
|
||||
{
|
||||
@@ -381,32 +377,6 @@ int64_t Detector_settings::getInternalFrameGeneratorImages() const
|
||||
void Detector_settings::setInternalFrameGeneratorImages(int64_t const value)
|
||||
{
|
||||
m_Internal_frame_generator_images = value;
|
||||
m_Internal_frame_generator_imagesIsSet = true;
|
||||
}
|
||||
bool Detector_settings::internalFrameGeneratorImagesIsSet() const
|
||||
{
|
||||
return m_Internal_frame_generator_imagesIsSet;
|
||||
}
|
||||
void Detector_settings::unsetInternal_frame_generator_images()
|
||||
{
|
||||
m_Internal_frame_generator_imagesIsSet = false;
|
||||
}
|
||||
bool Detector_settings::isCollectRawData() const
|
||||
{
|
||||
return m_Collect_raw_data;
|
||||
}
|
||||
void Detector_settings::setCollectRawData(bool const value)
|
||||
{
|
||||
m_Collect_raw_data = value;
|
||||
m_Collect_raw_dataIsSet = true;
|
||||
}
|
||||
bool Detector_settings::collectRawDataIsSet() const
|
||||
{
|
||||
return m_Collect_raw_dataIsSet;
|
||||
}
|
||||
void Detector_settings::unsetCollect_raw_data()
|
||||
{
|
||||
m_Collect_raw_dataIsSet = false;
|
||||
}
|
||||
int64_t Detector_settings::getPedestalG0Frames() const
|
||||
{
|
||||
@@ -415,15 +385,6 @@ int64_t Detector_settings::getPedestalG0Frames() const
|
||||
void Detector_settings::setPedestalG0Frames(int64_t const value)
|
||||
{
|
||||
m_Pedestal_g0_frames = value;
|
||||
m_Pedestal_g0_framesIsSet = true;
|
||||
}
|
||||
bool Detector_settings::pedestalG0FramesIsSet() const
|
||||
{
|
||||
return m_Pedestal_g0_framesIsSet;
|
||||
}
|
||||
void Detector_settings::unsetPedestal_g0_frames()
|
||||
{
|
||||
m_Pedestal_g0_framesIsSet = false;
|
||||
}
|
||||
int64_t Detector_settings::getPedestalG1Frames() const
|
||||
{
|
||||
@@ -432,15 +393,6 @@ int64_t Detector_settings::getPedestalG1Frames() const
|
||||
void Detector_settings::setPedestalG1Frames(int64_t const value)
|
||||
{
|
||||
m_Pedestal_g1_frames = value;
|
||||
m_Pedestal_g1_framesIsSet = true;
|
||||
}
|
||||
bool Detector_settings::pedestalG1FramesIsSet() const
|
||||
{
|
||||
return m_Pedestal_g1_framesIsSet;
|
||||
}
|
||||
void Detector_settings::unsetPedestal_g1_frames()
|
||||
{
|
||||
m_Pedestal_g1_framesIsSet = false;
|
||||
}
|
||||
int64_t Detector_settings::getPedestalG2Frames() const
|
||||
{
|
||||
@@ -449,49 +401,47 @@ int64_t Detector_settings::getPedestalG2Frames() const
|
||||
void Detector_settings::setPedestalG2Frames(int64_t const value)
|
||||
{
|
||||
m_Pedestal_g2_frames = value;
|
||||
m_Pedestal_g2_framesIsSet = true;
|
||||
}
|
||||
bool Detector_settings::pedestalG2FramesIsSet() const
|
||||
int64_t Detector_settings::getPedestalG0RmsLimit() const
|
||||
{
|
||||
return m_Pedestal_g2_framesIsSet;
|
||||
return m_Pedestal_g0_rms_limit;
|
||||
}
|
||||
void Detector_settings::unsetPedestal_g2_frames()
|
||||
void Detector_settings::setPedestalG0RmsLimit(int64_t const value)
|
||||
{
|
||||
m_Pedestal_g2_framesIsSet = false;
|
||||
m_Pedestal_g0_rms_limit = value;
|
||||
}
|
||||
float Detector_settings::getStorageCellDelayUs() const
|
||||
int64_t Detector_settings::getPedestalMinImageCount() const
|
||||
{
|
||||
return m_Storage_cell_delay_us;
|
||||
return m_Pedestal_min_image_count;
|
||||
}
|
||||
void Detector_settings::setStorageCellDelayUs(float const value)
|
||||
void Detector_settings::setPedestalMinImageCount(int64_t const value)
|
||||
{
|
||||
m_Storage_cell_delay_us = value;
|
||||
m_Storage_cell_delay_usIsSet = true;
|
||||
m_Pedestal_min_image_count = value;
|
||||
}
|
||||
bool Detector_settings::storageCellDelayUsIsSet() const
|
||||
int64_t Detector_settings::getStorageCellDelayNs() const
|
||||
{
|
||||
return m_Storage_cell_delay_usIsSet;
|
||||
return m_Storage_cell_delay_ns;
|
||||
}
|
||||
void Detector_settings::unsetStorage_cell_delay_us()
|
||||
void Detector_settings::setStorageCellDelayNs(int64_t const value)
|
||||
{
|
||||
m_Storage_cell_delay_usIsSet = false;
|
||||
m_Storage_cell_delay_ns = value;
|
||||
}
|
||||
float Detector_settings::getDetectorTriggerDelayUs() const
|
||||
int64_t Detector_settings::getDetectorTriggerDelayNs() const
|
||||
{
|
||||
return m_Detector_trigger_delay_us;
|
||||
return m_Detector_trigger_delay_ns;
|
||||
}
|
||||
void Detector_settings::setDetectorTriggerDelayUs(float const value)
|
||||
void Detector_settings::setDetectorTriggerDelayNs(int64_t const value)
|
||||
{
|
||||
m_Detector_trigger_delay_us = value;
|
||||
m_Detector_trigger_delay_usIsSet = true;
|
||||
m_Detector_trigger_delay_ns = value;
|
||||
m_Detector_trigger_delay_nsIsSet = true;
|
||||
}
|
||||
bool Detector_settings::detectorTriggerDelayUsIsSet() const
|
||||
bool Detector_settings::detectorTriggerDelayNsIsSet() const
|
||||
{
|
||||
return m_Detector_trigger_delay_usIsSet;
|
||||
return m_Detector_trigger_delay_nsIsSet;
|
||||
}
|
||||
void Detector_settings::unsetDetector_trigger_delay_us()
|
||||
void Detector_settings::unsetDetector_trigger_delay_ns()
|
||||
{
|
||||
m_Detector_trigger_delay_usIsSet = false;
|
||||
m_Detector_trigger_delay_nsIsSet = false;
|
||||
}
|
||||
bool Detector_settings::isFixedGainG1() const
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -74,64 +74,53 @@ public:
|
||||
/// </summary>
|
||||
int64_t getStorageCellCount() const;
|
||||
void setStorageCellCount(int64_t const value);
|
||||
bool storageCellCountIsSet() const;
|
||||
void unsetStorage_cell_count();
|
||||
/// <summary>
|
||||
/// Use internal frame generator in FPGA instead of getting data from a real detector
|
||||
/// </summary>
|
||||
bool isInternalFrameGenerator() const;
|
||||
void setInternalFrameGenerator(bool const value);
|
||||
bool internalFrameGeneratorIsSet() const;
|
||||
void unsetInternal_frame_generator();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getInternalFrameGeneratorImages() const;
|
||||
void setInternalFrameGeneratorImages(int64_t const value);
|
||||
bool internalFrameGeneratorImagesIsSet() const;
|
||||
void unsetInternal_frame_generator_images();
|
||||
/// <summary>
|
||||
/// Turn off conversion of pixel read-out to photon count
|
||||
/// </summary>
|
||||
bool isCollectRawData() const;
|
||||
void setCollectRawData(bool const value);
|
||||
bool collectRawDataIsSet() const;
|
||||
void unsetCollect_raw_data();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPedestalG0Frames() const;
|
||||
void setPedestalG0Frames(int64_t const value);
|
||||
bool pedestalG0FramesIsSet() const;
|
||||
void unsetPedestal_g0_frames();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPedestalG1Frames() const;
|
||||
void setPedestalG1Frames(int64_t const value);
|
||||
bool pedestalG1FramesIsSet() const;
|
||||
void unsetPedestal_g1_frames();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPedestalG2Frames() const;
|
||||
void setPedestalG2Frames(int64_t const value);
|
||||
bool pedestalG2FramesIsSet() const;
|
||||
void unsetPedestal_g2_frames();
|
||||
/// <summary>
|
||||
/// Delay between two storage cells [us]
|
||||
/// Pixels with pedestal G0 RMS above the threshold are marked as masked pixels
|
||||
/// </summary>
|
||||
float getStorageCellDelayUs() const;
|
||||
void setStorageCellDelayUs(float const value);
|
||||
bool storageCellDelayUsIsSet() const;
|
||||
void unsetStorage_cell_delay_us();
|
||||
int64_t getPedestalG0RmsLimit() const;
|
||||
void setPedestalG0RmsLimit(int64_t const value);
|
||||
/// <summary>
|
||||
/// Delay between TTL trigger and acquisition start [us]
|
||||
/// Minimum number of collected images for pedestal to consider it viable
|
||||
/// </summary>
|
||||
float getDetectorTriggerDelayUs() const;
|
||||
void setDetectorTriggerDelayUs(float const value);
|
||||
bool detectorTriggerDelayUsIsSet() const;
|
||||
void unsetDetector_trigger_delay_us();
|
||||
int64_t getPedestalMinImageCount() const;
|
||||
void setPedestalMinImageCount(int64_t const value);
|
||||
/// <summary>
|
||||
/// Delay between two storage cells [ns]
|
||||
/// </summary>
|
||||
int64_t getStorageCellDelayNs() const;
|
||||
void setStorageCellDelayNs(int64_t const value);
|
||||
/// <summary>
|
||||
/// Delay between TTL trigger and acquisition start [ns]
|
||||
/// </summary>
|
||||
int64_t getDetectorTriggerDelayNs() const;
|
||||
void setDetectorTriggerDelayNs(int64_t const value);
|
||||
bool detectorTriggerDelayNsIsSet() const;
|
||||
void unsetDetector_trigger_delay_ns();
|
||||
/// <summary>
|
||||
/// Fix gain to G1 (can be useful for storage cells)
|
||||
/// </summary>
|
||||
@@ -147,31 +136,33 @@ public:
|
||||
bool useGainHg0IsSet() const;
|
||||
void unsetUse_gain_hg0();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_settings& o);
|
||||
friend void to_json(nlohmann::json& j, const Detector_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_settings& o);
|
||||
protected:
|
||||
int64_t m_Frame_time_us;
|
||||
|
||||
int64_t m_Count_time_us;
|
||||
bool m_Count_time_usIsSet;
|
||||
int64_t m_Storage_cell_count;
|
||||
bool m_Storage_cell_countIsSet;
|
||||
|
||||
bool m_Internal_frame_generator;
|
||||
bool m_Internal_frame_generatorIsSet;
|
||||
|
||||
int64_t m_Internal_frame_generator_images;
|
||||
bool m_Internal_frame_generator_imagesIsSet;
|
||||
bool m_Collect_raw_data;
|
||||
bool m_Collect_raw_dataIsSet;
|
||||
|
||||
int64_t m_Pedestal_g0_frames;
|
||||
bool m_Pedestal_g0_framesIsSet;
|
||||
|
||||
int64_t m_Pedestal_g1_frames;
|
||||
bool m_Pedestal_g1_framesIsSet;
|
||||
|
||||
int64_t m_Pedestal_g2_frames;
|
||||
bool m_Pedestal_g2_framesIsSet;
|
||||
float m_Storage_cell_delay_us;
|
||||
bool m_Storage_cell_delay_usIsSet;
|
||||
float m_Detector_trigger_delay_us;
|
||||
bool m_Detector_trigger_delay_usIsSet;
|
||||
|
||||
int64_t m_Pedestal_g0_rms_limit;
|
||||
|
||||
int64_t m_Pedestal_min_image_count;
|
||||
|
||||
int64_t m_Storage_cell_delay_ns;
|
||||
|
||||
int64_t m_Detector_trigger_delay_ns;
|
||||
bool m_Detector_trigger_delay_nsIsSet;
|
||||
bool m_Fixed_gain_g1;
|
||||
bool m_Fixed_gain_g1IsSet;
|
||||
bool m_Use_gain_hg0;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -126,7 +126,7 @@ bool Detector_status::operator!=(const Detector_status& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_status& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["state"] = o.m_State;
|
||||
j["powerchip"] = o.m_Powerchip;
|
||||
j["server_version"] = o.m_Server_version;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -90,8 +90,8 @@ public:
|
||||
std::vector<int64_t> getHighVoltageV() const;
|
||||
void setHighVoltageV(std::vector<int64_t> const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_status& o);
|
||||
friend void to_json(nlohmann::json& j, const Detector_status& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_status& o);
|
||||
protected:
|
||||
std::string m_State;
|
||||
|
||||
|
||||
116
broker/gen/model/Detector_type.cpp
Normal file
116
broker/gen/model/Detector_type.cpp
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Detector_type.h"
|
||||
#include "Helpers.h"
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Detector_type::Detector_type()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Detector_type::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Detector_type::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Detector_type::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_type" : pathPrefix;
|
||||
|
||||
|
||||
if (m_value == Detector_type::eDetector_type::INVALID_VALUE_OPENAPI_GENERATED)
|
||||
{
|
||||
success = false;
|
||||
msg << _pathPrefix << ": has no value;";
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Detector_type::operator==(const Detector_type& rhs) const
|
||||
{
|
||||
return
|
||||
getValue() == rhs.getValue()
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Detector_type::operator!=(const Detector_type& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Detector_type& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
|
||||
switch (o.getValue())
|
||||
{
|
||||
case Detector_type::eDetector_type::INVALID_VALUE_OPENAPI_GENERATED:
|
||||
j = "INVALID_VALUE_OPENAPI_GENERATED";
|
||||
break;
|
||||
case Detector_type::eDetector_type::EIGER:
|
||||
j = "EIGER";
|
||||
break;
|
||||
case Detector_type::eDetector_type::JUNGFRAU:
|
||||
j = "JUNGFRAU";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Detector_type& o)
|
||||
{
|
||||
|
||||
auto s = j.get<std::string>();
|
||||
if (s == "EIGER") {
|
||||
o.setValue(Detector_type::eDetector_type::EIGER);
|
||||
}
|
||||
else if (s == "JUNGFRAU") {
|
||||
o.setValue(Detector_type::eDetector_type::JUNGFRAU);
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss << "Unexpected value " << s << " in json"
|
||||
<< " cannot be converted to enum of type"
|
||||
<< " Detector_type::eDetector_type";
|
||||
throw std::invalid_argument(ss.str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Detector_type::eDetector_type Detector_type::getValue() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
void Detector_type::setValue(Detector_type::eDetector_type value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
79
broker/gen/model/Detector_type.h
Normal file
79
broker/gen/model/Detector_type.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Detector_type.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Detector_type_H_
|
||||
#define Detector_type_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Detector_type
|
||||
{
|
||||
public:
|
||||
Detector_type();
|
||||
virtual ~Detector_type() = default;
|
||||
|
||||
enum class eDetector_type {
|
||||
// To have a valid default value.
|
||||
// Avoiding name clashes with user defined
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
EIGER,
|
||||
JUNGFRAU
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Detector_type& rhs) const;
|
||||
bool operator!=(const Detector_type& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Detector_type members
|
||||
|
||||
Detector_type::eDetector_type getValue() const;
|
||||
void setValue(Detector_type::eDetector_type value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Detector_type& o);
|
||||
friend void from_json(const nlohmann::json& j, Detector_type& o);
|
||||
protected:
|
||||
Detector_type::eDetector_type m_value = Detector_type::eDetector_type::INVALID_VALUE_OPENAPI_GENERATED;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Detector_type_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -70,7 +70,7 @@ bool Error_message::operator!=(const Error_message& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Error_message& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["msg"] = o.m_Msg;
|
||||
j["reason"] = o.m_Reason;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
std::string getReason() const;
|
||||
void setReason(std::string const& value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Error_message& o);
|
||||
friend void from_json(const nlohmann::json& j, Error_message& o);
|
||||
friend void to_json(nlohmann::json& j, const Error_message& o);
|
||||
friend void from_json(const nlohmann::json& j, Error_message& o);
|
||||
protected:
|
||||
std::string m_Msg;
|
||||
|
||||
|
||||
217
broker/gen/model/Fpga_status_inner.cpp
Normal file
217
broker/gen/model/Fpga_status_inner.cpp
Normal file
@@ -0,0 +1,217 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Fpga_status_inner.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Fpga_status_inner::Fpga_status_inner()
|
||||
{
|
||||
m_Pci_dev_id = "";
|
||||
m_Serial_number = "";
|
||||
m_Base_mac_addr = "";
|
||||
m_Eth_link_count = 0L;
|
||||
m_Eth_link_status = 0L;
|
||||
m_Power_usage_W = 0.0f;
|
||||
m_Fpga_temp_C = 0.0f;
|
||||
m_Hbm_temp_C = 0.0f;
|
||||
m_Packets_udp = 0L;
|
||||
m_Packets_sls = 0L;
|
||||
|
||||
}
|
||||
|
||||
void Fpga_status_inner::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Fpga_status_inner::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Fpga_status_inner::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Fpga_status_inner" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Fpga_status_inner::operator==(const Fpga_status_inner& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getPciDevId() == rhs.getPciDevId())
|
||||
&&
|
||||
|
||||
(getSerialNumber() == rhs.getSerialNumber())
|
||||
&&
|
||||
|
||||
(getBaseMacAddr() == rhs.getBaseMacAddr())
|
||||
&&
|
||||
|
||||
(getEthLinkCount() == rhs.getEthLinkCount())
|
||||
&&
|
||||
|
||||
(getEthLinkStatus() == rhs.getEthLinkStatus())
|
||||
&&
|
||||
|
||||
(getPowerUsageW() == rhs.getPowerUsageW())
|
||||
&&
|
||||
|
||||
(getFpgaTempC() == rhs.getFpgaTempC())
|
||||
&&
|
||||
|
||||
(getHbmTempC() == rhs.getHbmTempC())
|
||||
&&
|
||||
|
||||
(getPacketsUdp() == rhs.getPacketsUdp())
|
||||
&&
|
||||
|
||||
(getPacketsSls() == rhs.getPacketsSls())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Fpga_status_inner::operator!=(const Fpga_status_inner& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Fpga_status_inner& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["pci_dev_id"] = o.m_Pci_dev_id;
|
||||
j["serial_number"] = o.m_Serial_number;
|
||||
j["base_mac_addr"] = o.m_Base_mac_addr;
|
||||
j["eth_link_count"] = o.m_Eth_link_count;
|
||||
j["eth_link_status"] = o.m_Eth_link_status;
|
||||
j["power_usage_W"] = o.m_Power_usage_W;
|
||||
j["fpga_temp_C"] = o.m_Fpga_temp_C;
|
||||
j["hbm_temp_C"] = o.m_Hbm_temp_C;
|
||||
j["packets_udp"] = o.m_Packets_udp;
|
||||
j["packets_sls"] = o.m_Packets_sls;
|
||||
|
||||
}
|
||||
|
||||
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("base_mac_addr").get_to(o.m_Base_mac_addr);
|
||||
j.at("eth_link_count").get_to(o.m_Eth_link_count);
|
||||
j.at("eth_link_status").get_to(o.m_Eth_link_status);
|
||||
j.at("power_usage_W").get_to(o.m_Power_usage_W);
|
||||
j.at("fpga_temp_C").get_to(o.m_Fpga_temp_C);
|
||||
j.at("hbm_temp_C").get_to(o.m_Hbm_temp_C);
|
||||
j.at("packets_udp").get_to(o.m_Packets_udp);
|
||||
j.at("packets_sls").get_to(o.m_Packets_sls);
|
||||
|
||||
}
|
||||
|
||||
std::string Fpga_status_inner::getPciDevId() const
|
||||
{
|
||||
return m_Pci_dev_id;
|
||||
}
|
||||
void Fpga_status_inner::setPciDevId(std::string const& value)
|
||||
{
|
||||
m_Pci_dev_id = value;
|
||||
}
|
||||
std::string Fpga_status_inner::getSerialNumber() const
|
||||
{
|
||||
return m_Serial_number;
|
||||
}
|
||||
void Fpga_status_inner::setSerialNumber(std::string const& value)
|
||||
{
|
||||
m_Serial_number = value;
|
||||
}
|
||||
std::string Fpga_status_inner::getBaseMacAddr() const
|
||||
{
|
||||
return m_Base_mac_addr;
|
||||
}
|
||||
void Fpga_status_inner::setBaseMacAddr(std::string const& value)
|
||||
{
|
||||
m_Base_mac_addr = value;
|
||||
}
|
||||
int64_t Fpga_status_inner::getEthLinkCount() const
|
||||
{
|
||||
return m_Eth_link_count;
|
||||
}
|
||||
void Fpga_status_inner::setEthLinkCount(int64_t const value)
|
||||
{
|
||||
m_Eth_link_count = value;
|
||||
}
|
||||
int64_t Fpga_status_inner::getEthLinkStatus() const
|
||||
{
|
||||
return m_Eth_link_status;
|
||||
}
|
||||
void Fpga_status_inner::setEthLinkStatus(int64_t const value)
|
||||
{
|
||||
m_Eth_link_status = value;
|
||||
}
|
||||
float Fpga_status_inner::getPowerUsageW() const
|
||||
{
|
||||
return m_Power_usage_W;
|
||||
}
|
||||
void Fpga_status_inner::setPowerUsageW(float const value)
|
||||
{
|
||||
m_Power_usage_W = value;
|
||||
}
|
||||
float Fpga_status_inner::getFpgaTempC() const
|
||||
{
|
||||
return m_Fpga_temp_C;
|
||||
}
|
||||
void Fpga_status_inner::setFpgaTempC(float const value)
|
||||
{
|
||||
m_Fpga_temp_C = value;
|
||||
}
|
||||
float Fpga_status_inner::getHbmTempC() const
|
||||
{
|
||||
return m_Hbm_temp_C;
|
||||
}
|
||||
void Fpga_status_inner::setHbmTempC(float const value)
|
||||
{
|
||||
m_Hbm_temp_C = value;
|
||||
}
|
||||
int64_t Fpga_status_inner::getPacketsUdp() const
|
||||
{
|
||||
return m_Packets_udp;
|
||||
}
|
||||
void Fpga_status_inner::setPacketsUdp(int64_t const value)
|
||||
{
|
||||
m_Packets_udp = value;
|
||||
}
|
||||
int64_t Fpga_status_inner::getPacketsSls() const
|
||||
{
|
||||
return m_Packets_sls;
|
||||
}
|
||||
void Fpga_status_inner::setPacketsSls(int64_t const value)
|
||||
{
|
||||
m_Packets_sls = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
140
broker/gen/model/Fpga_status_inner.h
Normal file
140
broker/gen/model/Fpga_status_inner.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Fpga_status_inner.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Fpga_status_inner_H_
|
||||
#define Fpga_status_inner_H_
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Fpga_status_inner
|
||||
{
|
||||
public:
|
||||
Fpga_status_inner();
|
||||
virtual ~Fpga_status_inner() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Fpga_status_inner& rhs) const;
|
||||
bool operator!=(const Fpga_status_inner& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Fpga_status_inner members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getPciDevId() const;
|
||||
void setPciDevId(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getSerialNumber() const;
|
||||
void setSerialNumber(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getBaseMacAddr() const;
|
||||
void setBaseMacAddr(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getEthLinkCount() const;
|
||||
void setEthLinkCount(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getEthLinkStatus() const;
|
||||
void setEthLinkStatus(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getPowerUsageW() const;
|
||||
void setPowerUsageW(float const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getFpgaTempC() const;
|
||||
void setFpgaTempC(float const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getHbmTempC() const;
|
||||
void setHbmTempC(float const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPacketsUdp() const;
|
||||
void setPacketsUdp(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPacketsSls() const;
|
||||
void setPacketsSls(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Fpga_status_inner& o);
|
||||
friend void from_json(const nlohmann::json& j, Fpga_status_inner& o);
|
||||
protected:
|
||||
std::string m_Pci_dev_id;
|
||||
|
||||
std::string m_Serial_number;
|
||||
|
||||
std::string m_Base_mac_addr;
|
||||
|
||||
int64_t m_Eth_link_count;
|
||||
|
||||
int64_t m_Eth_link_status;
|
||||
|
||||
float m_Power_usage_W;
|
||||
|
||||
float m_Fpga_temp_C;
|
||||
|
||||
float m_Hbm_temp_C;
|
||||
|
||||
int64_t m_Packets_udp;
|
||||
|
||||
int64_t m_Packets_sls;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Fpga_status_inner_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
namespace org::openapitools::server::helpers
|
||||
{
|
||||
@@ -92,6 +93,15 @@ namespace org::openapitools::server::helpers
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the given set<T> only has unique elements.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
bool hasOnlyUniqueItems(const std::set<T>&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string toStringValue(const std::string &value);
|
||||
std::string toStringValue(const int32_t value);
|
||||
std::string toStringValue(const int64_t value);
|
||||
|
||||
253
broker/gen/model/Image_format_settings.cpp
Normal file
253
broker/gen/model/Image_format_settings.cpp
Normal file
@@ -0,0 +1,253 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Image_format_settings.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Image_format_settings::Image_format_settings()
|
||||
{
|
||||
m_Summation = false;
|
||||
m_Geometry_transform = false;
|
||||
m_Jungfrau_conversion = false;
|
||||
m_Jungfrau_conversion_factor_keV = 0.0f;
|
||||
m_Jungfrau_conversion_factor_keVIsSet = false;
|
||||
m_Bit_depth_image = 0L;
|
||||
m_Bit_depth_imageIsSet = false;
|
||||
m_Signed_output = false;
|
||||
m_Signed_outputIsSet = false;
|
||||
m_Mask_module_edges = true;
|
||||
m_Mask_chip_edges = true;
|
||||
|
||||
}
|
||||
|
||||
void Image_format_settings::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Image_format_settings::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Image_format_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Image_format_settings" : pathPrefix;
|
||||
|
||||
|
||||
if (jungfrauConversionFactorKeVIsSet())
|
||||
{
|
||||
const float& value = m_Jungfrau_conversion_factor_keV;
|
||||
const std::string currentValuePath = _pathPrefix + ".jungfrauConversionFactorKeV";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.001))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.001;";
|
||||
}
|
||||
if (value > static_cast<float>(500.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 500.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Image_format_settings::operator==(const Image_format_settings& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(isSummation() == rhs.isSummation())
|
||||
&&
|
||||
|
||||
(isGeometryTransform() == rhs.isGeometryTransform())
|
||||
&&
|
||||
|
||||
(isJungfrauConversion() == rhs.isJungfrauConversion())
|
||||
&&
|
||||
|
||||
|
||||
((!jungfrauConversionFactorKeVIsSet() && !rhs.jungfrauConversionFactorKeVIsSet()) || (jungfrauConversionFactorKeVIsSet() && rhs.jungfrauConversionFactorKeVIsSet() && getJungfrauConversionFactorKeV() == rhs.getJungfrauConversionFactorKeV())) &&
|
||||
|
||||
|
||||
((!bitDepthImageIsSet() && !rhs.bitDepthImageIsSet()) || (bitDepthImageIsSet() && rhs.bitDepthImageIsSet() && getBitDepthImage() == rhs.getBitDepthImage())) &&
|
||||
|
||||
|
||||
((!signedOutputIsSet() && !rhs.signedOutputIsSet()) || (signedOutputIsSet() && rhs.signedOutputIsSet() && isSignedOutput() == rhs.isSignedOutput())) &&
|
||||
|
||||
(isMaskModuleEdges() == rhs.isMaskModuleEdges())
|
||||
&&
|
||||
|
||||
(isMaskChipEdges() == rhs.isMaskChipEdges())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Image_format_settings::operator!=(const Image_format_settings& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Image_format_settings& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["summation"] = o.m_Summation;
|
||||
j["geometry_transform"] = o.m_Geometry_transform;
|
||||
j["jungfrau_conversion"] = o.m_Jungfrau_conversion;
|
||||
if(o.jungfrauConversionFactorKeVIsSet())
|
||||
j["jungfrau_conversion_factor_keV"] = o.m_Jungfrau_conversion_factor_keV;
|
||||
if(o.bitDepthImageIsSet())
|
||||
j["bit_depth_image"] = o.m_Bit_depth_image;
|
||||
if(o.signedOutputIsSet())
|
||||
j["signed_output"] = o.m_Signed_output;
|
||||
j["mask_module_edges"] = o.m_Mask_module_edges;
|
||||
j["mask_chip_edges"] = o.m_Mask_chip_edges;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Image_format_settings& o)
|
||||
{
|
||||
j.at("summation").get_to(o.m_Summation);
|
||||
j.at("geometry_transform").get_to(o.m_Geometry_transform);
|
||||
j.at("jungfrau_conversion").get_to(o.m_Jungfrau_conversion);
|
||||
if(j.find("jungfrau_conversion_factor_keV") != j.end())
|
||||
{
|
||||
j.at("jungfrau_conversion_factor_keV").get_to(o.m_Jungfrau_conversion_factor_keV);
|
||||
o.m_Jungfrau_conversion_factor_keVIsSet = true;
|
||||
}
|
||||
if(j.find("bit_depth_image") != j.end())
|
||||
{
|
||||
j.at("bit_depth_image").get_to(o.m_Bit_depth_image);
|
||||
o.m_Bit_depth_imageIsSet = true;
|
||||
}
|
||||
if(j.find("signed_output") != j.end())
|
||||
{
|
||||
j.at("signed_output").get_to(o.m_Signed_output);
|
||||
o.m_Signed_outputIsSet = true;
|
||||
}
|
||||
j.at("mask_module_edges").get_to(o.m_Mask_module_edges);
|
||||
j.at("mask_chip_edges").get_to(o.m_Mask_chip_edges);
|
||||
|
||||
}
|
||||
|
||||
bool Image_format_settings::isSummation() const
|
||||
{
|
||||
return m_Summation;
|
||||
}
|
||||
void Image_format_settings::setSummation(bool const value)
|
||||
{
|
||||
m_Summation = value;
|
||||
}
|
||||
bool Image_format_settings::isGeometryTransform() const
|
||||
{
|
||||
return m_Geometry_transform;
|
||||
}
|
||||
void Image_format_settings::setGeometryTransform(bool const value)
|
||||
{
|
||||
m_Geometry_transform = value;
|
||||
}
|
||||
bool Image_format_settings::isJungfrauConversion() const
|
||||
{
|
||||
return m_Jungfrau_conversion;
|
||||
}
|
||||
void Image_format_settings::setJungfrauConversion(bool const value)
|
||||
{
|
||||
m_Jungfrau_conversion = value;
|
||||
}
|
||||
float Image_format_settings::getJungfrauConversionFactorKeV() const
|
||||
{
|
||||
return m_Jungfrau_conversion_factor_keV;
|
||||
}
|
||||
void Image_format_settings::setJungfrauConversionFactorKeV(float const value)
|
||||
{
|
||||
m_Jungfrau_conversion_factor_keV = value;
|
||||
m_Jungfrau_conversion_factor_keVIsSet = true;
|
||||
}
|
||||
bool Image_format_settings::jungfrauConversionFactorKeVIsSet() const
|
||||
{
|
||||
return m_Jungfrau_conversion_factor_keVIsSet;
|
||||
}
|
||||
void Image_format_settings::unsetJungfrau_conversion_factor_keV()
|
||||
{
|
||||
m_Jungfrau_conversion_factor_keVIsSet = false;
|
||||
}
|
||||
int64_t Image_format_settings::getBitDepthImage() const
|
||||
{
|
||||
return m_Bit_depth_image;
|
||||
}
|
||||
void Image_format_settings::setBitDepthImage(int64_t const value)
|
||||
{
|
||||
m_Bit_depth_image = value;
|
||||
m_Bit_depth_imageIsSet = true;
|
||||
}
|
||||
bool Image_format_settings::bitDepthImageIsSet() const
|
||||
{
|
||||
return m_Bit_depth_imageIsSet;
|
||||
}
|
||||
void Image_format_settings::unsetBit_depth_image()
|
||||
{
|
||||
m_Bit_depth_imageIsSet = false;
|
||||
}
|
||||
bool Image_format_settings::isSignedOutput() const
|
||||
{
|
||||
return m_Signed_output;
|
||||
}
|
||||
void Image_format_settings::setSignedOutput(bool const value)
|
||||
{
|
||||
m_Signed_output = value;
|
||||
m_Signed_outputIsSet = true;
|
||||
}
|
||||
bool Image_format_settings::signedOutputIsSet() const
|
||||
{
|
||||
return m_Signed_outputIsSet;
|
||||
}
|
||||
void Image_format_settings::unsetSigned_output()
|
||||
{
|
||||
m_Signed_outputIsSet = false;
|
||||
}
|
||||
bool Image_format_settings::isMaskModuleEdges() const
|
||||
{
|
||||
return m_Mask_module_edges;
|
||||
}
|
||||
void Image_format_settings::setMaskModuleEdges(bool const value)
|
||||
{
|
||||
m_Mask_module_edges = value;
|
||||
}
|
||||
bool Image_format_settings::isMaskChipEdges() const
|
||||
{
|
||||
return m_Mask_chip_edges;
|
||||
}
|
||||
void Image_format_settings::setMaskChipEdges(bool const value)
|
||||
{
|
||||
m_Mask_chip_edges = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
131
broker/gen/model/Image_format_settings.h
Normal file
131
broker/gen/model/Image_format_settings.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Image_format_settings.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Image_format_settings_H_
|
||||
#define Image_format_settings_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Image_format_settings
|
||||
{
|
||||
public:
|
||||
Image_format_settings();
|
||||
virtual ~Image_format_settings() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Image_format_settings& rhs) const;
|
||||
bool operator!=(const Image_format_settings& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Image_format_settings members
|
||||
|
||||
/// <summary>
|
||||
/// Enable summation of images to a given image_time If disabled images are saved according to original detector speed, but image count is adjusted
|
||||
/// </summary>
|
||||
bool isSummation() const;
|
||||
void setSummation(bool const value);
|
||||
/// <summary>
|
||||
/// Place module read-out into their location on composed detector and extend multipixels
|
||||
/// </summary>
|
||||
bool isGeometryTransform() const;
|
||||
void setGeometryTransform(bool const value);
|
||||
/// <summary>
|
||||
/// Convert pixel value in ADU to photon counts/energy Only affects JUNGFRAU detector
|
||||
/// </summary>
|
||||
bool isJungfrauConversion() const;
|
||||
void setJungfrauConversion(bool const value);
|
||||
/// <summary>
|
||||
/// Used to convert energy deposited into pixel to counts If not provided incident_energy_keV is used
|
||||
/// </summary>
|
||||
float getJungfrauConversionFactorKeV() const;
|
||||
void setJungfrauConversionFactorKeV(float const value);
|
||||
bool jungfrauConversionFactorKeVIsSet() const;
|
||||
void unsetJungfrau_conversion_factor_keV();
|
||||
/// <summary>
|
||||
/// Bit depth of resulting image (it doesn't affect the original detector value) If not provided value is adjusted automatically
|
||||
/// </summary>
|
||||
int64_t getBitDepthImage() const;
|
||||
void setBitDepthImage(int64_t const value);
|
||||
bool bitDepthImageIsSet() const;
|
||||
void unsetBit_depth_image();
|
||||
/// <summary>
|
||||
/// Controls if pixels have signed output If not provided value is adjusted automatically
|
||||
/// </summary>
|
||||
bool isSignedOutput() const;
|
||||
void setSignedOutput(bool const value);
|
||||
bool signedOutputIsSet() const;
|
||||
void unsetSigned_output();
|
||||
/// <summary>
|
||||
/// Mask 1 pixel on the module boundary
|
||||
/// </summary>
|
||||
bool isMaskModuleEdges() const;
|
||||
void setMaskModuleEdges(bool const value);
|
||||
/// <summary>
|
||||
/// Mask multipixels on chip boundary
|
||||
/// </summary>
|
||||
bool isMaskChipEdges() const;
|
||||
void setMaskChipEdges(bool const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Image_format_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Image_format_settings& o);
|
||||
protected:
|
||||
bool m_Summation;
|
||||
|
||||
bool m_Geometry_transform;
|
||||
|
||||
bool m_Jungfrau_conversion;
|
||||
|
||||
float m_Jungfrau_conversion_factor_keV;
|
||||
bool m_Jungfrau_conversion_factor_keVIsSet;
|
||||
int64_t m_Bit_depth_image;
|
||||
bool m_Bit_depth_imageIsSet;
|
||||
bool m_Signed_output;
|
||||
bool m_Signed_outputIsSet;
|
||||
bool m_Mask_module_edges;
|
||||
|
||||
bool m_Mask_chip_edges;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Image_format_settings_H_ */
|
||||
128
broker/gen/model/Image_pusher_type.cpp
Normal file
128
broker/gen/model/Image_pusher_type.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Image_pusher_type.h"
|
||||
#include "Helpers.h"
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Image_pusher_type::Image_pusher_type()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Image_pusher_type::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Image_pusher_type::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Image_pusher_type::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Image_pusher_type" : pathPrefix;
|
||||
|
||||
|
||||
if (m_value == Image_pusher_type::eImage_pusher_type::INVALID_VALUE_OPENAPI_GENERATED)
|
||||
{
|
||||
success = false;
|
||||
msg << _pathPrefix << ": has no value;";
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Image_pusher_type::operator==(const Image_pusher_type& rhs) const
|
||||
{
|
||||
return
|
||||
getValue() == rhs.getValue()
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Image_pusher_type::operator!=(const Image_pusher_type& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Image_pusher_type& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
|
||||
switch (o.getValue())
|
||||
{
|
||||
case Image_pusher_type::eImage_pusher_type::INVALID_VALUE_OPENAPI_GENERATED:
|
||||
j = "INVALID_VALUE_OPENAPI_GENERATED";
|
||||
break;
|
||||
case Image_pusher_type::eImage_pusher_type::ZEROMQ:
|
||||
j = "ZeroMQ";
|
||||
break;
|
||||
case Image_pusher_type::eImage_pusher_type::HDF5:
|
||||
j = "HDF5";
|
||||
break;
|
||||
case Image_pusher_type::eImage_pusher_type::CBOR:
|
||||
j = "CBOR";
|
||||
break;
|
||||
case Image_pusher_type::eImage_pusher_type::NONE:
|
||||
j = "None";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Image_pusher_type& o)
|
||||
{
|
||||
|
||||
auto s = j.get<std::string>();
|
||||
if (s == "ZeroMQ") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::ZEROMQ);
|
||||
}
|
||||
else if (s == "HDF5") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::HDF5);
|
||||
}
|
||||
else if (s == "CBOR") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::CBOR);
|
||||
}
|
||||
else if (s == "None") {
|
||||
o.setValue(Image_pusher_type::eImage_pusher_type::NONE);
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss << "Unexpected value " << s << " in json"
|
||||
<< " cannot be converted to enum of type"
|
||||
<< " Image_pusher_type::eImage_pusher_type";
|
||||
throw std::invalid_argument(ss.str());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Image_pusher_type::eImage_pusher_type Image_pusher_type::getValue() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
void Image_pusher_type::setValue(Image_pusher_type::eImage_pusher_type value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
81
broker/gen/model/Image_pusher_type.h
Normal file
81
broker/gen/model/Image_pusher_type.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Image_pusher_type.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Image_pusher_type_H_
|
||||
#define Image_pusher_type_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Image_pusher_type
|
||||
{
|
||||
public:
|
||||
Image_pusher_type();
|
||||
virtual ~Image_pusher_type() = default;
|
||||
|
||||
enum class eImage_pusher_type {
|
||||
// To have a valid default value.
|
||||
// Avoiding name clashes with user defined
|
||||
// enum values
|
||||
INVALID_VALUE_OPENAPI_GENERATED = 0,
|
||||
ZEROMQ,
|
||||
HDF5,
|
||||
CBOR,
|
||||
NONE
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Image_pusher_type& rhs) const;
|
||||
bool operator!=(const Image_pusher_type& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Image_pusher_type members
|
||||
|
||||
Image_pusher_type::eImage_pusher_type getValue() const;
|
||||
void setValue(Image_pusher_type::eImage_pusher_type value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Image_pusher_type& o);
|
||||
friend void from_json(const nlohmann::json& j, Image_pusher_type& o);
|
||||
protected:
|
||||
Image_pusher_type::eImage_pusher_type m_value = Image_pusher_type::eImage_pusher_type::INVALID_VALUE_OPENAPI_GENERATED;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Image_pusher_type_H_ */
|
||||
163
broker/gen/model/Instrument_metadata.cpp
Normal file
163
broker/gen/model/Instrument_metadata.cpp
Normal file
@@ -0,0 +1,163 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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 "Instrument_metadata.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Instrument_metadata::Instrument_metadata()
|
||||
{
|
||||
m_Source_name = "";
|
||||
m_Source_type = "";
|
||||
m_Source_typeIsSet = false;
|
||||
m_Instrument_name = "";
|
||||
m_Pulsed_source = false;
|
||||
m_Pulsed_sourceIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Instrument_metadata::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Instrument_metadata::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Instrument_metadata::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Instrument_metadata" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Instrument_metadata::operator==(const Instrument_metadata& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getSourceName() == rhs.getSourceName())
|
||||
&&
|
||||
|
||||
|
||||
((!sourceTypeIsSet() && !rhs.sourceTypeIsSet()) || (sourceTypeIsSet() && rhs.sourceTypeIsSet() && getSourceType() == rhs.getSourceType())) &&
|
||||
|
||||
(getInstrumentName() == rhs.getInstrumentName())
|
||||
&&
|
||||
|
||||
|
||||
((!pulsedSourceIsSet() && !rhs.pulsedSourceIsSet()) || (pulsedSourceIsSet() && rhs.pulsedSourceIsSet() && isPulsedSource() == rhs.isPulsedSource()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Instrument_metadata::operator!=(const Instrument_metadata& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Instrument_metadata& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["source_name"] = o.m_Source_name;
|
||||
if(o.sourceTypeIsSet())
|
||||
j["source_type"] = o.m_Source_type;
|
||||
j["instrument_name"] = o.m_Instrument_name;
|
||||
if(o.pulsedSourceIsSet())
|
||||
j["pulsed_source"] = o.m_Pulsed_source;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Instrument_metadata& o)
|
||||
{
|
||||
j.at("source_name").get_to(o.m_Source_name);
|
||||
if(j.find("source_type") != j.end())
|
||||
{
|
||||
j.at("source_type").get_to(o.m_Source_type);
|
||||
o.m_Source_typeIsSet = true;
|
||||
}
|
||||
j.at("instrument_name").get_to(o.m_Instrument_name);
|
||||
if(j.find("pulsed_source") != j.end())
|
||||
{
|
||||
j.at("pulsed_source").get_to(o.m_Pulsed_source);
|
||||
o.m_Pulsed_sourceIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string Instrument_metadata::getSourceName() const
|
||||
{
|
||||
return m_Source_name;
|
||||
}
|
||||
void Instrument_metadata::setSourceName(std::string const& value)
|
||||
{
|
||||
m_Source_name = value;
|
||||
}
|
||||
std::string Instrument_metadata::getSourceType() const
|
||||
{
|
||||
return m_Source_type;
|
||||
}
|
||||
void Instrument_metadata::setSourceType(std::string const& value)
|
||||
{
|
||||
m_Source_type = value;
|
||||
m_Source_typeIsSet = true;
|
||||
}
|
||||
bool Instrument_metadata::sourceTypeIsSet() const
|
||||
{
|
||||
return m_Source_typeIsSet;
|
||||
}
|
||||
void Instrument_metadata::unsetSource_type()
|
||||
{
|
||||
m_Source_typeIsSet = false;
|
||||
}
|
||||
std::string Instrument_metadata::getInstrumentName() const
|
||||
{
|
||||
return m_Instrument_name;
|
||||
}
|
||||
void Instrument_metadata::setInstrumentName(std::string const& value)
|
||||
{
|
||||
m_Instrument_name = value;
|
||||
}
|
||||
bool Instrument_metadata::isPulsedSource() const
|
||||
{
|
||||
return m_Pulsed_source;
|
||||
}
|
||||
void Instrument_metadata::setPulsedSource(bool const value)
|
||||
{
|
||||
m_Pulsed_source = value;
|
||||
m_Pulsed_sourceIsSet = true;
|
||||
}
|
||||
bool Instrument_metadata::pulsedSourceIsSet() const
|
||||
{
|
||||
return m_Pulsed_sourceIsSet;
|
||||
}
|
||||
void Instrument_metadata::unsetPulsed_source()
|
||||
{
|
||||
m_Pulsed_sourceIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
102
broker/gen/model/Instrument_metadata.h
Normal file
102
broker/gen/model/Instrument_metadata.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Instrument_metadata.h
|
||||
*
|
||||
* Metadata for a measurement instrument
|
||||
*/
|
||||
|
||||
#ifndef Instrument_metadata_H_
|
||||
#define Instrument_metadata_H_
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Metadata for a measurement instrument
|
||||
/// </summary>
|
||||
class Instrument_metadata
|
||||
{
|
||||
public:
|
||||
Instrument_metadata();
|
||||
virtual ~Instrument_metadata() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Instrument_metadata& rhs) const;
|
||||
bool operator!=(const Instrument_metadata& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Instrument_metadata members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getSourceName() const;
|
||||
void setSourceName(std::string const& value);
|
||||
/// <summary>
|
||||
/// 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 Synchrotron X-ray Source Pulsed Muon Source Rotating Anode X-ray Fixed Tube X-ray UV Laser Free-Electron Laser Optical Laser Ion Source UV Plasma Source Metal Jet X-ray
|
||||
/// </summary>
|
||||
std::string getSourceType() const;
|
||||
void setSourceType(std::string const& value);
|
||||
bool sourceTypeIsSet() const;
|
||||
void unsetSource_type();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getInstrumentName() const;
|
||||
void setInstrumentName(std::string const& value);
|
||||
/// <summary>
|
||||
/// Settings specific to XFEL (e.g., every image has to come from TTL trigger, save pulse ID and event code)
|
||||
/// </summary>
|
||||
bool isPulsedSource() const;
|
||||
void setPulsedSource(bool const value);
|
||||
bool pulsedSourceIsSet() const;
|
||||
void unsetPulsed_source();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Instrument_metadata& o);
|
||||
friend void from_json(const nlohmann::json& j, Instrument_metadata& o);
|
||||
protected:
|
||||
std::string m_Source_name;
|
||||
|
||||
std::string m_Source_type;
|
||||
bool m_Source_typeIsSet;
|
||||
std::string m_Instrument_name;
|
||||
|
||||
bool m_Pulsed_source;
|
||||
bool m_Pulsed_sourceIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Instrument_metadata_H_ */
|
||||
452
broker/gen/model/Jfjoch_settings.cpp
Normal file
452
broker/gen/model/Jfjoch_settings.cpp
Normal file
@@ -0,0 +1,452 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Jfjoch_settings.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Jfjoch_settings::Jfjoch_settings()
|
||||
{
|
||||
m_PcieIsSet = false;
|
||||
m_ZeromqIsSet = false;
|
||||
m_InstrumentIsSet = false;
|
||||
m_Detector_settingsIsSet = false;
|
||||
m_Azim_intIsSet = false;
|
||||
m_Image_formatIsSet = false;
|
||||
m_Image_buffer_MiB = 2048;
|
||||
m_Image_buffer_MiBIsSet = false;
|
||||
m_Receiver_threads = 64;
|
||||
m_Receiver_threadsIsSet = false;
|
||||
m_Numa_policy = "";
|
||||
m_Numa_policyIsSet = false;
|
||||
m_Frontend_directory = "";
|
||||
|
||||
}
|
||||
|
||||
void Jfjoch_settings::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Jfjoch_settings::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Jfjoch_settings" : pathPrefix;
|
||||
|
||||
|
||||
if (pcieIsSet())
|
||||
{
|
||||
const std::vector<org::openapitools::server::model::Pcie_devices_inner>& value = m_Pcie;
|
||||
const std::string currentValuePath = _pathPrefix + ".pcie";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const org::openapitools::server::model::Pcie_devices_inner& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
success = value.validate(msg, currentValuePath + ".pcie") && success;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Detector */ {
|
||||
const std::vector<org::openapitools::server::model::Detector>& value = m_Detector;
|
||||
const std::string currentValuePath = _pathPrefix + ".detector";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const org::openapitools::server::model::Detector& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
success = value.validate(msg, currentValuePath + ".detector") && success;
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (imageBufferMiBIsSet())
|
||||
{
|
||||
const int32_t& value = m_Image_buffer_MiB;
|
||||
const std::string currentValuePath = _pathPrefix + ".imageBufferMiB";
|
||||
|
||||
|
||||
if (value < 128)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 128;";
|
||||
}
|
||||
if (value > 16384)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 16384;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (receiverThreadsIsSet())
|
||||
{
|
||||
const int32_t& value = m_Receiver_threads;
|
||||
const std::string currentValuePath = _pathPrefix + ".receiverThreads";
|
||||
|
||||
|
||||
if (value < 1)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 512)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 512;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
|
||||
((!pcieIsSet() && !rhs.pcieIsSet()) || (pcieIsSet() && rhs.pcieIsSet() && getPcie() == rhs.getPcie())) &&
|
||||
|
||||
|
||||
((!zeromqIsSet() && !rhs.zeromqIsSet()) || (zeromqIsSet() && rhs.zeromqIsSet() && getZeromq() == rhs.getZeromq())) &&
|
||||
|
||||
|
||||
((!instrumentIsSet() && !rhs.instrumentIsSet()) || (instrumentIsSet() && rhs.instrumentIsSet() && getInstrument() == rhs.getInstrument())) &&
|
||||
|
||||
(getDetector() == rhs.getDetector())
|
||||
&&
|
||||
|
||||
|
||||
((!detectorSettingsIsSet() && !rhs.detectorSettingsIsSet()) || (detectorSettingsIsSet() && rhs.detectorSettingsIsSet() && getDetectorSettings() == rhs.getDetectorSettings())) &&
|
||||
|
||||
|
||||
((!azimIntIsSet() && !rhs.azimIntIsSet()) || (azimIntIsSet() && rhs.azimIntIsSet() && getAzimInt() == rhs.getAzimInt())) &&
|
||||
|
||||
|
||||
((!imageFormatIsSet() && !rhs.imageFormatIsSet()) || (imageFormatIsSet() && rhs.imageFormatIsSet() && getImageFormat() == rhs.getImageFormat())) &&
|
||||
|
||||
|
||||
((!imageBufferMiBIsSet() && !rhs.imageBufferMiBIsSet()) || (imageBufferMiBIsSet() && rhs.imageBufferMiBIsSet() && getImageBufferMiB() == rhs.getImageBufferMiB())) &&
|
||||
|
||||
|
||||
((!receiverThreadsIsSet() && !rhs.receiverThreadsIsSet()) || (receiverThreadsIsSet() && rhs.receiverThreadsIsSet() && getReceiverThreads() == rhs.getReceiverThreads())) &&
|
||||
|
||||
|
||||
((!numaPolicyIsSet() && !rhs.numaPolicyIsSet()) || (numaPolicyIsSet() && rhs.numaPolicyIsSet() && getNumaPolicy() == rhs.getNumaPolicy())) &&
|
||||
|
||||
(getFrontendDirectory() == rhs.getFrontendDirectory())
|
||||
&&
|
||||
|
||||
(getImagePusher() == rhs.getImagePusher())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Jfjoch_settings::operator!=(const Jfjoch_settings& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Jfjoch_settings& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
if(o.pcieIsSet() || !o.m_Pcie.empty())
|
||||
j["pcie"] = o.m_Pcie;
|
||||
if(o.zeromqIsSet())
|
||||
j["zeromq"] = o.m_Zeromq;
|
||||
if(o.instrumentIsSet())
|
||||
j["instrument"] = o.m_Instrument;
|
||||
j["detector"] = o.m_Detector;
|
||||
if(o.detectorSettingsIsSet())
|
||||
j["detector_settings"] = o.m_Detector_settings;
|
||||
if(o.azimIntIsSet())
|
||||
j["azim_int"] = o.m_Azim_int;
|
||||
if(o.imageFormatIsSet())
|
||||
j["image_format"] = o.m_Image_format;
|
||||
if(o.imageBufferMiBIsSet())
|
||||
j["image_buffer_MiB"] = o.m_Image_buffer_MiB;
|
||||
if(o.receiverThreadsIsSet())
|
||||
j["receiver_threads"] = o.m_Receiver_threads;
|
||||
if(o.numaPolicyIsSet())
|
||||
j["numa_policy"] = o.m_Numa_policy;
|
||||
j["frontend_directory"] = o.m_Frontend_directory;
|
||||
j["image_pusher"] = o.m_Image_pusher;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Jfjoch_settings& o)
|
||||
{
|
||||
if(j.find("pcie") != j.end())
|
||||
{
|
||||
j.at("pcie").get_to(o.m_Pcie);
|
||||
o.m_PcieIsSet = true;
|
||||
}
|
||||
if(j.find("zeromq") != j.end())
|
||||
{
|
||||
j.at("zeromq").get_to(o.m_Zeromq);
|
||||
o.m_ZeromqIsSet = true;
|
||||
}
|
||||
if(j.find("instrument") != j.end())
|
||||
{
|
||||
j.at("instrument").get_to(o.m_Instrument);
|
||||
o.m_InstrumentIsSet = true;
|
||||
}
|
||||
j.at("detector").get_to(o.m_Detector);
|
||||
if(j.find("detector_settings") != j.end())
|
||||
{
|
||||
j.at("detector_settings").get_to(o.m_Detector_settings);
|
||||
o.m_Detector_settingsIsSet = true;
|
||||
}
|
||||
if(j.find("azim_int") != j.end())
|
||||
{
|
||||
j.at("azim_int").get_to(o.m_Azim_int);
|
||||
o.m_Azim_intIsSet = true;
|
||||
}
|
||||
if(j.find("image_format") != j.end())
|
||||
{
|
||||
j.at("image_format").get_to(o.m_Image_format);
|
||||
o.m_Image_formatIsSet = true;
|
||||
}
|
||||
if(j.find("image_buffer_MiB") != j.end())
|
||||
{
|
||||
j.at("image_buffer_MiB").get_to(o.m_Image_buffer_MiB);
|
||||
o.m_Image_buffer_MiBIsSet = true;
|
||||
}
|
||||
if(j.find("receiver_threads") != j.end())
|
||||
{
|
||||
j.at("receiver_threads").get_to(o.m_Receiver_threads);
|
||||
o.m_Receiver_threadsIsSet = true;
|
||||
}
|
||||
if(j.find("numa_policy") != j.end())
|
||||
{
|
||||
j.at("numa_policy").get_to(o.m_Numa_policy);
|
||||
o.m_Numa_policyIsSet = true;
|
||||
}
|
||||
j.at("frontend_directory").get_to(o.m_Frontend_directory);
|
||||
j.at("image_pusher").get_to(o.m_Image_pusher);
|
||||
|
||||
}
|
||||
|
||||
std::vector<org::openapitools::server::model::Pcie_devices_inner> Jfjoch_settings::getPcie() const
|
||||
{
|
||||
return m_Pcie;
|
||||
}
|
||||
void Jfjoch_settings::setPcie(std::vector<org::openapitools::server::model::Pcie_devices_inner> const& value)
|
||||
{
|
||||
m_Pcie = value;
|
||||
m_PcieIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::pcieIsSet() const
|
||||
{
|
||||
return m_PcieIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetPcie()
|
||||
{
|
||||
m_PcieIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Zeromq_settings Jfjoch_settings::getZeromq() const
|
||||
{
|
||||
return m_Zeromq;
|
||||
}
|
||||
void Jfjoch_settings::setZeromq(org::openapitools::server::model::Zeromq_settings const& value)
|
||||
{
|
||||
m_Zeromq = value;
|
||||
m_ZeromqIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::zeromqIsSet() const
|
||||
{
|
||||
return m_ZeromqIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetZeromq()
|
||||
{
|
||||
m_ZeromqIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Instrument_metadata Jfjoch_settings::getInstrument() const
|
||||
{
|
||||
return m_Instrument;
|
||||
}
|
||||
void Jfjoch_settings::setInstrument(org::openapitools::server::model::Instrument_metadata const& value)
|
||||
{
|
||||
m_Instrument = value;
|
||||
m_InstrumentIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::instrumentIsSet() const
|
||||
{
|
||||
return m_InstrumentIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetInstrument()
|
||||
{
|
||||
m_InstrumentIsSet = false;
|
||||
}
|
||||
std::vector<org::openapitools::server::model::Detector> Jfjoch_settings::getDetector() const
|
||||
{
|
||||
return m_Detector;
|
||||
}
|
||||
void Jfjoch_settings::setDetector(std::vector<org::openapitools::server::model::Detector> const& value)
|
||||
{
|
||||
m_Detector = value;
|
||||
}
|
||||
org::openapitools::server::model::Detector_settings Jfjoch_settings::getDetectorSettings() const
|
||||
{
|
||||
return m_Detector_settings;
|
||||
}
|
||||
void Jfjoch_settings::setDetectorSettings(org::openapitools::server::model::Detector_settings const& value)
|
||||
{
|
||||
m_Detector_settings = value;
|
||||
m_Detector_settingsIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::detectorSettingsIsSet() const
|
||||
{
|
||||
return m_Detector_settingsIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetDetector_settings()
|
||||
{
|
||||
m_Detector_settingsIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Azim_int_settings Jfjoch_settings::getAzimInt() const
|
||||
{
|
||||
return m_Azim_int;
|
||||
}
|
||||
void Jfjoch_settings::setAzimInt(org::openapitools::server::model::Azim_int_settings const& value)
|
||||
{
|
||||
m_Azim_int = value;
|
||||
m_Azim_intIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::azimIntIsSet() const
|
||||
{
|
||||
return m_Azim_intIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetAzim_int()
|
||||
{
|
||||
m_Azim_intIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Image_format_settings Jfjoch_settings::getImageFormat() const
|
||||
{
|
||||
return m_Image_format;
|
||||
}
|
||||
void Jfjoch_settings::setImageFormat(org::openapitools::server::model::Image_format_settings const& value)
|
||||
{
|
||||
m_Image_format = value;
|
||||
m_Image_formatIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::imageFormatIsSet() const
|
||||
{
|
||||
return m_Image_formatIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetImage_format()
|
||||
{
|
||||
m_Image_formatIsSet = false;
|
||||
}
|
||||
int32_t Jfjoch_settings::getImageBufferMiB() const
|
||||
{
|
||||
return m_Image_buffer_MiB;
|
||||
}
|
||||
void Jfjoch_settings::setImageBufferMiB(int32_t const value)
|
||||
{
|
||||
m_Image_buffer_MiB = value;
|
||||
m_Image_buffer_MiBIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::imageBufferMiBIsSet() const
|
||||
{
|
||||
return m_Image_buffer_MiBIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetImage_buffer_MiB()
|
||||
{
|
||||
m_Image_buffer_MiBIsSet = false;
|
||||
}
|
||||
int32_t Jfjoch_settings::getReceiverThreads() const
|
||||
{
|
||||
return m_Receiver_threads;
|
||||
}
|
||||
void Jfjoch_settings::setReceiverThreads(int32_t const value)
|
||||
{
|
||||
m_Receiver_threads = value;
|
||||
m_Receiver_threadsIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::receiverThreadsIsSet() const
|
||||
{
|
||||
return m_Receiver_threadsIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetReceiver_threads()
|
||||
{
|
||||
m_Receiver_threadsIsSet = false;
|
||||
}
|
||||
std::string Jfjoch_settings::getNumaPolicy() const
|
||||
{
|
||||
return m_Numa_policy;
|
||||
}
|
||||
void Jfjoch_settings::setNumaPolicy(std::string const& value)
|
||||
{
|
||||
m_Numa_policy = value;
|
||||
m_Numa_policyIsSet = true;
|
||||
}
|
||||
bool Jfjoch_settings::numaPolicyIsSet() const
|
||||
{
|
||||
return m_Numa_policyIsSet;
|
||||
}
|
||||
void Jfjoch_settings::unsetNuma_policy()
|
||||
{
|
||||
m_Numa_policyIsSet = false;
|
||||
}
|
||||
std::string Jfjoch_settings::getFrontendDirectory() const
|
||||
{
|
||||
return m_Frontend_directory;
|
||||
}
|
||||
void Jfjoch_settings::setFrontendDirectory(std::string const& value)
|
||||
{
|
||||
m_Frontend_directory = value;
|
||||
}
|
||||
org::openapitools::server::model::Image_pusher_type Jfjoch_settings::getImagePusher() const
|
||||
{
|
||||
return m_Image_pusher;
|
||||
}
|
||||
void Jfjoch_settings::setImagePusher(org::openapitools::server::model::Image_pusher_type const& value)
|
||||
{
|
||||
m_Image_pusher = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
181
broker/gen/model/Jfjoch_settings.h
Normal file
181
broker/gen/model/Jfjoch_settings.h
Normal file
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Jfjoch_settings.h
|
||||
*
|
||||
* Default settings for Jungfraujoch software. This structure is used to provide default settings using configuration JSON file and is not used in HTTP.
|
||||
*/
|
||||
|
||||
#ifndef Jfjoch_settings_H_
|
||||
#define Jfjoch_settings_H_
|
||||
|
||||
|
||||
#include "Detector.h"
|
||||
#include "Image_pusher_type.h"
|
||||
#include "Pcie_devices_inner.h"
|
||||
#include <string>
|
||||
#include "Zeromq_settings.h"
|
||||
#include "Azim_int_settings.h"
|
||||
#include "Image_format_settings.h"
|
||||
#include "Detector_settings.h"
|
||||
#include "Instrument_metadata.h"
|
||||
#include <vector>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Default settings for Jungfraujoch software. This structure is used to provide default settings using configuration JSON file and is not used in HTTP.
|
||||
/// </summary>
|
||||
class Jfjoch_settings
|
||||
{
|
||||
public:
|
||||
Jfjoch_settings();
|
||||
virtual ~Jfjoch_settings() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Jfjoch_settings& rhs) const;
|
||||
bool operator!=(const Jfjoch_settings& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Jfjoch_settings members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<org::openapitools::server::model::Pcie_devices_inner> getPcie() const;
|
||||
void setPcie(std::vector<org::openapitools::server::model::Pcie_devices_inner> const& value);
|
||||
bool pcieIsSet() const;
|
||||
void unsetPcie();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Zeromq_settings getZeromq() const;
|
||||
void setZeromq(org::openapitools::server::model::Zeromq_settings const& value);
|
||||
bool zeromqIsSet() const;
|
||||
void unsetZeromq();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Instrument_metadata getInstrument() const;
|
||||
void setInstrument(org::openapitools::server::model::Instrument_metadata const& value);
|
||||
bool instrumentIsSet() const;
|
||||
void unsetInstrument();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<org::openapitools::server::model::Detector> getDetector() const;
|
||||
void setDetector(std::vector<org::openapitools::server::model::Detector> const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Detector_settings getDetectorSettings() const;
|
||||
void setDetectorSettings(org::openapitools::server::model::Detector_settings const& value);
|
||||
bool detectorSettingsIsSet() const;
|
||||
void unsetDetector_settings();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Azim_int_settings getAzimInt() const;
|
||||
void setAzimInt(org::openapitools::server::model::Azim_int_settings const& value);
|
||||
bool azimIntIsSet() const;
|
||||
void unsetAzim_int();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Image_format_settings getImageFormat() const;
|
||||
void setImageFormat(org::openapitools::server::model::Image_format_settings const& value);
|
||||
bool imageFormatIsSet() const;
|
||||
void unsetImage_format();
|
||||
/// <summary>
|
||||
/// Size of internal buffer in MiB for images before they are sent to a stream
|
||||
/// </summary>
|
||||
int32_t getImageBufferMiB() const;
|
||||
void setImageBufferMiB(int32_t const value);
|
||||
bool imageBufferMiBIsSet() const;
|
||||
void unsetImage_buffer_MiB();
|
||||
/// <summary>
|
||||
/// Number of threads used by the receiver
|
||||
/// </summary>
|
||||
int32_t getReceiverThreads() const;
|
||||
void setReceiverThreads(int32_t const value);
|
||||
bool receiverThreadsIsSet() const;
|
||||
void unsetReceiver_threads();
|
||||
/// <summary>
|
||||
/// NUMA policy to bind CPUs
|
||||
/// </summary>
|
||||
std::string getNumaPolicy() const;
|
||||
void setNumaPolicy(std::string const& value);
|
||||
bool numaPolicyIsSet() const;
|
||||
void unsetNuma_policy();
|
||||
/// <summary>
|
||||
/// Location of built JavaScript web frontend
|
||||
/// </summary>
|
||||
std::string getFrontendDirectory() const;
|
||||
void setFrontendDirectory(std::string const& value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Image_pusher_type getImagePusher() const;
|
||||
void setImagePusher(org::openapitools::server::model::Image_pusher_type const& value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Jfjoch_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Jfjoch_settings& o);
|
||||
protected:
|
||||
std::vector<org::openapitools::server::model::Pcie_devices_inner> m_Pcie;
|
||||
bool m_PcieIsSet;
|
||||
org::openapitools::server::model::Zeromq_settings m_Zeromq;
|
||||
bool m_ZeromqIsSet;
|
||||
org::openapitools::server::model::Instrument_metadata m_Instrument;
|
||||
bool m_InstrumentIsSet;
|
||||
std::vector<org::openapitools::server::model::Detector> m_Detector;
|
||||
|
||||
org::openapitools::server::model::Detector_settings m_Detector_settings;
|
||||
bool m_Detector_settingsIsSet;
|
||||
org::openapitools::server::model::Azim_int_settings m_Azim_int;
|
||||
bool m_Azim_intIsSet;
|
||||
org::openapitools::server::model::Image_format_settings m_Image_format;
|
||||
bool m_Image_formatIsSet;
|
||||
int32_t m_Image_buffer_MiB;
|
||||
bool m_Image_buffer_MiBIsSet;
|
||||
int32_t m_Receiver_threads;
|
||||
bool m_Receiver_threadsIsSet;
|
||||
std::string m_Numa_policy;
|
||||
bool m_Numa_policyIsSet;
|
||||
std::string m_Frontend_directory;
|
||||
|
||||
org::openapitools::server::model::Image_pusher_type m_Image_pusher;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Jfjoch_settings_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -185,7 +185,7 @@ bool Measurement_statistics::operator!=(const Measurement_statistics& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Measurement_statistics& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
if(o.filePrefixIsSet())
|
||||
j["file_prefix"] = o.m_File_prefix;
|
||||
if(o.runNumberIsSet())
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -185,8 +185,8 @@ public:
|
||||
bool unitCellIsSet() const;
|
||||
void unsetUnit_cell();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Measurement_statistics& o);
|
||||
friend void from_json(const nlohmann::json& j, Measurement_statistics& o);
|
||||
friend void to_json(nlohmann::json& j, const Measurement_statistics& o);
|
||||
friend void from_json(const nlohmann::json& j, Measurement_statistics& o);
|
||||
protected:
|
||||
std::string m_File_prefix;
|
||||
bool m_File_prefixIsSet;
|
||||
|
||||
135
broker/gen/model/Pcie_devices_inner.cpp
Normal file
135
broker/gen/model/Pcie_devices_inner.cpp
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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 "Pcie_devices_inner.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Pcie_devices_inner::Pcie_devices_inner()
|
||||
{
|
||||
m_Blk = "";
|
||||
m_BlkIsSet = false;
|
||||
m_Ipv4 = "";
|
||||
m_Ipv4IsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Pcie_devices_inner::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Pcie_devices_inner::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Pcie_devices_inner::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Pcie_devices_inner" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Pcie_devices_inner::operator==(const Pcie_devices_inner& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
|
||||
((!blkIsSet() && !rhs.blkIsSet()) || (blkIsSet() && rhs.blkIsSet() && getBlk() == rhs.getBlk())) &&
|
||||
|
||||
|
||||
((!ipv4IsSet() && !rhs.ipv4IsSet()) || (ipv4IsSet() && rhs.ipv4IsSet() && getIpv4() == rhs.getIpv4()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Pcie_devices_inner::operator!=(const Pcie_devices_inner& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Pcie_devices_inner& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
if(o.blkIsSet())
|
||||
j["blk"] = o.m_Blk;
|
||||
if(o.ipv4IsSet())
|
||||
j["ipv4"] = o.m_Ipv4;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Pcie_devices_inner& o)
|
||||
{
|
||||
if(j.find("blk") != j.end())
|
||||
{
|
||||
j.at("blk").get_to(o.m_Blk);
|
||||
o.m_BlkIsSet = true;
|
||||
}
|
||||
if(j.find("ipv4") != j.end())
|
||||
{
|
||||
j.at("ipv4").get_to(o.m_Ipv4);
|
||||
o.m_Ipv4IsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string Pcie_devices_inner::getBlk() const
|
||||
{
|
||||
return m_Blk;
|
||||
}
|
||||
void Pcie_devices_inner::setBlk(std::string const& value)
|
||||
{
|
||||
m_Blk = value;
|
||||
m_BlkIsSet = true;
|
||||
}
|
||||
bool Pcie_devices_inner::blkIsSet() const
|
||||
{
|
||||
return m_BlkIsSet;
|
||||
}
|
||||
void Pcie_devices_inner::unsetBlk()
|
||||
{
|
||||
m_BlkIsSet = false;
|
||||
}
|
||||
std::string Pcie_devices_inner::getIpv4() const
|
||||
{
|
||||
return m_Ipv4;
|
||||
}
|
||||
void Pcie_devices_inner::setIpv4(std::string const& value)
|
||||
{
|
||||
m_Ipv4 = value;
|
||||
m_Ipv4IsSet = true;
|
||||
}
|
||||
bool Pcie_devices_inner::ipv4IsSet() const
|
||||
{
|
||||
return m_Ipv4IsSet;
|
||||
}
|
||||
void Pcie_devices_inner::unsetIpv4()
|
||||
{
|
||||
m_Ipv4IsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
88
broker/gen/model/Pcie_devices_inner.h
Normal file
88
broker/gen/model/Pcie_devices_inner.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Pcie_devices_inner.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Pcie_devices_inner_H_
|
||||
#define Pcie_devices_inner_H_
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Pcie_devices_inner
|
||||
{
|
||||
public:
|
||||
Pcie_devices_inner();
|
||||
virtual ~Pcie_devices_inner() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Pcie_devices_inner& rhs) const;
|
||||
bool operator!=(const Pcie_devices_inner& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Pcie_devices_inner members
|
||||
|
||||
/// <summary>
|
||||
/// Block device name
|
||||
/// </summary>
|
||||
std::string getBlk() const;
|
||||
void setBlk(std::string const& value);
|
||||
bool blkIsSet() const;
|
||||
void unsetBlk();
|
||||
/// <summary>
|
||||
/// IPv4 address of the block device
|
||||
/// </summary>
|
||||
std::string getIpv4() const;
|
||||
void setIpv4(std::string const& value);
|
||||
bool ipv4IsSet() const;
|
||||
void unsetIpv4();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Pcie_devices_inner& o);
|
||||
friend void from_json(const nlohmann::json& j, Pcie_devices_inner& o);
|
||||
protected:
|
||||
std::string m_Blk;
|
||||
bool m_BlkIsSet;
|
||||
std::string m_Ipv4;
|
||||
bool m_Ipv4IsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Pcie_devices_inner_H_ */
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -114,7 +114,7 @@ bool Plot::operator!=(const Plot& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Plot& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["title"] = o.m_Title;
|
||||
j["x"] = o.m_x;
|
||||
j["y"] = o.m_y;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -75,8 +75,8 @@ public:
|
||||
std::vector<float> getY() const;
|
||||
void setY(std::vector<float> const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Plot& o);
|
||||
friend void from_json(const nlohmann::json& j, Plot& o);
|
||||
friend void to_json(nlohmann::json& j, const Plot& o);
|
||||
friend void from_json(const nlohmann::json& j, Plot& o);
|
||||
protected:
|
||||
std::string m_Title;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -91,7 +91,7 @@ bool Plots::operator!=(const Plots& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Plots& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
if(o.titleIsSet())
|
||||
j["title"] = o.m_Title;
|
||||
j["plot"] = o.m_Plot;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -73,8 +73,8 @@ public:
|
||||
std::vector<org::openapitools::server::model::Plot> getPlot() const;
|
||||
void setPlot(std::vector<org::openapitools::server::model::Plot> const& value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Plots& o);
|
||||
friend void from_json(const nlohmann::json& j, Plots& o);
|
||||
friend void to_json(nlohmann::json& j, const Plots& o);
|
||||
friend void from_json(const nlohmann::json& j, Plots& o);
|
||||
protected:
|
||||
std::string m_Title;
|
||||
bool m_TitleIsSet;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -153,7 +153,7 @@ bool Preview_settings::operator!=(const Preview_settings& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Preview_settings& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["saturation"] = o.m_Saturation;
|
||||
if(o.showSpotsIsSet())
|
||||
j["show_spots"] = o.m_Show_spots;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -105,8 +105,8 @@ public:
|
||||
bool resolutionRingIsSet() const;
|
||||
void unsetResolution_ring();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Preview_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Preview_settings& o);
|
||||
friend void to_json(nlohmann::json& j, const Preview_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Preview_settings& o);
|
||||
protected:
|
||||
int64_t m_Saturation;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -152,7 +152,7 @@ bool Roi_box::operator!=(const Roi_box& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Roi_box& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["name"] = o.m_Name;
|
||||
j["min_x_pxl"] = o.m_Min_x_pxl;
|
||||
j["max_x_pxl"] = o.m_Max_x_pxl;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -84,8 +84,8 @@ public:
|
||||
int64_t getMaxYPxl() const;
|
||||
void setMaxYPxl(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Roi_box& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_box& o);
|
||||
friend void to_json(nlohmann::json& j, const Roi_box& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_box& o);
|
||||
protected:
|
||||
std::string m_Name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -92,7 +92,7 @@ bool Roi_box_list::operator!=(const Roi_box_list& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Roi_box_list& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
if(o.roisIsSet() || !o.m_Rois.empty())
|
||||
j["rois"] = o.m_Rois;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -67,8 +67,8 @@ public:
|
||||
bool roisIsSet() const;
|
||||
void unsetRois();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Roi_box_list& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_box_list& o);
|
||||
friend void to_json(nlohmann::json& j, const Roi_box_list& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_box_list& o);
|
||||
protected:
|
||||
std::vector<org::openapitools::server::model::Roi_box> m_Rois;
|
||||
bool m_RoisIsSet;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -106,7 +106,7 @@ bool Roi_circle::operator!=(const Roi_circle& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Roi_circle& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["name"] = o.m_Name;
|
||||
j["center_x_pxl"] = o.m_Center_x_pxl;
|
||||
j["center_y_pxl"] = o.m_Center_y_pxl;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -79,8 +79,8 @@ public:
|
||||
float getRadiusPxl() const;
|
||||
void setRadiusPxl(float const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Roi_circle& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_circle& o);
|
||||
friend void to_json(nlohmann::json& j, const Roi_circle& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_circle& o);
|
||||
protected:
|
||||
std::string m_Name;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -91,7 +91,7 @@ bool Roi_circle_list::operator!=(const Roi_circle_list& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Roi_circle_list& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["rois"] = o.m_Rois;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
std::vector<org::openapitools::server::model::Roi_circle> getRois() const;
|
||||
void setRois(std::vector<org::openapitools::server::model::Roi_circle> const& value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Roi_circle_list& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_circle_list& o);
|
||||
friend void to_json(nlohmann::json& j, const Roi_circle_list& o);
|
||||
friend void from_json(const nlohmann::json& j, Roi_circle_list& o);
|
||||
protected:
|
||||
std::vector<org::openapitools::server::model::Roi_circle> m_Rois;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -26,7 +26,6 @@ Rotation_axis::Rotation_axis()
|
||||
m_Step = 0.0f;
|
||||
m_Start = 0.0f;
|
||||
m_StartIsSet = false;
|
||||
m_VectorIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -64,8 +63,8 @@ bool Rotation_axis::validate(std::stringstream& msg, const std::string& pathPref
|
||||
|
||||
}
|
||||
|
||||
if (vectorIsSet())
|
||||
{
|
||||
|
||||
/* Vector */ {
|
||||
const std::vector<float>& value = m_Vector;
|
||||
const std::string currentValuePath = _pathPrefix + ".vector";
|
||||
|
||||
@@ -112,8 +111,8 @@ bool Rotation_axis::operator==(const Rotation_axis& rhs) const
|
||||
|
||||
((!startIsSet() && !rhs.startIsSet()) || (startIsSet() && rhs.startIsSet() && getStart() == rhs.getStart())) &&
|
||||
|
||||
(getVector() == rhs.getVector())
|
||||
|
||||
((!vectorIsSet() && !rhs.vectorIsSet()) || (vectorIsSet() && rhs.vectorIsSet() && getVector() == rhs.getVector()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -125,14 +124,13 @@ bool Rotation_axis::operator!=(const Rotation_axis& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Rotation_axis& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
if(o.nameIsSet())
|
||||
j["name"] = o.m_Name;
|
||||
j["step"] = o.m_Step;
|
||||
if(o.startIsSet())
|
||||
j["start"] = o.m_Start;
|
||||
if(o.vectorIsSet() || !o.m_Vector.empty())
|
||||
j["vector"] = o.m_Vector;
|
||||
j["vector"] = o.m_Vector;
|
||||
|
||||
}
|
||||
|
||||
@@ -149,11 +147,7 @@ void from_json(const nlohmann::json& j, Rotation_axis& o)
|
||||
j.at("start").get_to(o.m_Start);
|
||||
o.m_StartIsSet = true;
|
||||
}
|
||||
if(j.find("vector") != j.end())
|
||||
{
|
||||
j.at("vector").get_to(o.m_Vector);
|
||||
o.m_VectorIsSet = true;
|
||||
}
|
||||
j.at("vector").get_to(o.m_Vector);
|
||||
|
||||
}
|
||||
|
||||
@@ -206,15 +200,6 @@ std::vector<float> Rotation_axis::getVector() const
|
||||
void Rotation_axis::setVector(std::vector<float> const value)
|
||||
{
|
||||
m_Vector = value;
|
||||
m_VectorIsSet = true;
|
||||
}
|
||||
bool Rotation_axis::vectorIsSet() const
|
||||
{
|
||||
return m_VectorIsSet;
|
||||
}
|
||||
void Rotation_axis::unsetVector()
|
||||
{
|
||||
m_VectorIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -79,15 +79,13 @@ public:
|
||||
bool startIsSet() const;
|
||||
void unsetStart();
|
||||
/// <summary>
|
||||
/// Rotation axis - vector with only zeros means using default value (set in a configuration file)
|
||||
/// Rotation axis
|
||||
/// </summary>
|
||||
std::vector<float> getVector() const;
|
||||
void setVector(std::vector<float> const value);
|
||||
bool vectorIsSet() const;
|
||||
void unsetVector();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Rotation_axis& o);
|
||||
friend void from_json(const nlohmann::json& j, Rotation_axis& o);
|
||||
friend void to_json(nlohmann::json& j, const Rotation_axis& o);
|
||||
friend void from_json(const nlohmann::json& j, Rotation_axis& o);
|
||||
protected:
|
||||
std::string m_Name;
|
||||
bool m_NameIsSet;
|
||||
@@ -96,7 +94,7 @@ protected:
|
||||
float m_Start;
|
||||
bool m_StartIsSet;
|
||||
std::vector<float> m_Vector;
|
||||
bool m_VectorIsSet;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -197,7 +197,7 @@ bool Spot_finding_settings::operator!=(const Spot_finding_settings& rhs) const
|
||||
|
||||
void to_json(nlohmann::json& j, const Spot_finding_settings& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j = nlohmann::json::object();
|
||||
j["enable"] = o.m_Enable;
|
||||
j["indexing"] = o.m_Indexing;
|
||||
if(o.filterPowderRingsIsSet())
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -117,8 +117,8 @@ public:
|
||||
float getIndexingTolerance() const;
|
||||
void setIndexingTolerance(float const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Spot_finding_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Spot_finding_settings& o);
|
||||
friend void to_json(nlohmann::json& j, const Spot_finding_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Spot_finding_settings& o);
|
||||
protected:
|
||||
bool m_Enable;
|
||||
|
||||
|
||||
234
broker/gen/model/Standard_detector_geometry.cpp
Normal file
234
broker/gen/model/Standard_detector_geometry.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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 "Standard_detector_geometry.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Standard_detector_geometry::Standard_detector_geometry()
|
||||
{
|
||||
m_Nmodules = 0;
|
||||
m_Gap_x = 8;
|
||||
m_Gap_xIsSet = false;
|
||||
m_Gap_y = 36;
|
||||
m_Gap_yIsSet = false;
|
||||
m_Modules_in_row = 1;
|
||||
m_Modules_in_rowIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Standard_detector_geometry::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Standard_detector_geometry::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Standard_detector_geometry::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Standard_detector_geometry" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
/* Nmodules */ {
|
||||
const int32_t& value = m_Nmodules;
|
||||
const std::string currentValuePath = _pathPrefix + ".nmodules";
|
||||
|
||||
|
||||
if (value < 1)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (gapXIsSet())
|
||||
{
|
||||
const int32_t& value = m_Gap_x;
|
||||
const std::string currentValuePath = _pathPrefix + ".gapX";
|
||||
|
||||
|
||||
if (value < 0)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (gapYIsSet())
|
||||
{
|
||||
const int32_t& value = m_Gap_y;
|
||||
const std::string currentValuePath = _pathPrefix + ".gapY";
|
||||
|
||||
|
||||
if (value < 0)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (modulesInRowIsSet())
|
||||
{
|
||||
const int32_t& value = m_Modules_in_row;
|
||||
const std::string currentValuePath = _pathPrefix + ".modulesInRow";
|
||||
|
||||
|
||||
if (value < 1)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Standard_detector_geometry::operator==(const Standard_detector_geometry& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getNmodules() == rhs.getNmodules())
|
||||
&&
|
||||
|
||||
|
||||
((!gapXIsSet() && !rhs.gapXIsSet()) || (gapXIsSet() && rhs.gapXIsSet() && getGapX() == rhs.getGapX())) &&
|
||||
|
||||
|
||||
((!gapYIsSet() && !rhs.gapYIsSet()) || (gapYIsSet() && rhs.gapYIsSet() && getGapY() == rhs.getGapY())) &&
|
||||
|
||||
|
||||
((!modulesInRowIsSet() && !rhs.modulesInRowIsSet()) || (modulesInRowIsSet() && rhs.modulesInRowIsSet() && getModulesInRow() == rhs.getModulesInRow()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Standard_detector_geometry::operator!=(const Standard_detector_geometry& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Standard_detector_geometry& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
j["nmodules"] = o.m_Nmodules;
|
||||
if(o.gapXIsSet())
|
||||
j["gap_x"] = o.m_Gap_x;
|
||||
if(o.gapYIsSet())
|
||||
j["gap_y"] = o.m_Gap_y;
|
||||
if(o.modulesInRowIsSet())
|
||||
j["modules_in_row"] = o.m_Modules_in_row;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Standard_detector_geometry& o)
|
||||
{
|
||||
j.at("nmodules").get_to(o.m_Nmodules);
|
||||
if(j.find("gap_x") != j.end())
|
||||
{
|
||||
j.at("gap_x").get_to(o.m_Gap_x);
|
||||
o.m_Gap_xIsSet = true;
|
||||
}
|
||||
if(j.find("gap_y") != j.end())
|
||||
{
|
||||
j.at("gap_y").get_to(o.m_Gap_y);
|
||||
o.m_Gap_yIsSet = true;
|
||||
}
|
||||
if(j.find("modules_in_row") != j.end())
|
||||
{
|
||||
j.at("modules_in_row").get_to(o.m_Modules_in_row);
|
||||
o.m_Modules_in_rowIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int32_t Standard_detector_geometry::getNmodules() const
|
||||
{
|
||||
return m_Nmodules;
|
||||
}
|
||||
void Standard_detector_geometry::setNmodules(int32_t const value)
|
||||
{
|
||||
m_Nmodules = value;
|
||||
}
|
||||
int32_t Standard_detector_geometry::getGapX() const
|
||||
{
|
||||
return m_Gap_x;
|
||||
}
|
||||
void Standard_detector_geometry::setGapX(int32_t const value)
|
||||
{
|
||||
m_Gap_x = value;
|
||||
m_Gap_xIsSet = true;
|
||||
}
|
||||
bool Standard_detector_geometry::gapXIsSet() const
|
||||
{
|
||||
return m_Gap_xIsSet;
|
||||
}
|
||||
void Standard_detector_geometry::unsetGap_x()
|
||||
{
|
||||
m_Gap_xIsSet = false;
|
||||
}
|
||||
int32_t Standard_detector_geometry::getGapY() const
|
||||
{
|
||||
return m_Gap_y;
|
||||
}
|
||||
void Standard_detector_geometry::setGapY(int32_t const value)
|
||||
{
|
||||
m_Gap_y = value;
|
||||
m_Gap_yIsSet = true;
|
||||
}
|
||||
bool Standard_detector_geometry::gapYIsSet() const
|
||||
{
|
||||
return m_Gap_yIsSet;
|
||||
}
|
||||
void Standard_detector_geometry::unsetGap_y()
|
||||
{
|
||||
m_Gap_yIsSet = false;
|
||||
}
|
||||
int32_t Standard_detector_geometry::getModulesInRow() const
|
||||
{
|
||||
return m_Modules_in_row;
|
||||
}
|
||||
void Standard_detector_geometry::setModulesInRow(int32_t const value)
|
||||
{
|
||||
m_Modules_in_row = value;
|
||||
m_Modules_in_rowIsSet = true;
|
||||
}
|
||||
bool Standard_detector_geometry::modulesInRowIsSet() const
|
||||
{
|
||||
return m_Modules_in_rowIsSet;
|
||||
}
|
||||
void Standard_detector_geometry::unsetModules_in_row()
|
||||
{
|
||||
m_Modules_in_rowIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
103
broker/gen/model/Standard_detector_geometry.h
Normal file
103
broker/gen/model/Standard_detector_geometry.h
Normal file
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Standard_detector_geometry.h
|
||||
*
|
||||
* Regular rectangular geometry, first module is in the bottom left corner of the detector
|
||||
*/
|
||||
|
||||
#ifndef Standard_detector_geometry_H_
|
||||
#define Standard_detector_geometry_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Regular rectangular geometry, first module is in the bottom left corner of the detector
|
||||
/// </summary>
|
||||
class Standard_detector_geometry
|
||||
{
|
||||
public:
|
||||
Standard_detector_geometry();
|
||||
virtual ~Standard_detector_geometry() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Standard_detector_geometry& rhs) const;
|
||||
bool operator!=(const Standard_detector_geometry& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Standard_detector_geometry members
|
||||
|
||||
/// <summary>
|
||||
/// Number of modules in the detector
|
||||
/// </summary>
|
||||
int32_t getNmodules() const;
|
||||
void setNmodules(int32_t const value);
|
||||
/// <summary>
|
||||
/// Gap size in X direction [pixels]
|
||||
/// </summary>
|
||||
int32_t getGapX() const;
|
||||
void setGapX(int32_t const value);
|
||||
bool gapXIsSet() const;
|
||||
void unsetGap_x();
|
||||
/// <summary>
|
||||
/// Gap size in Y direction [pixels]
|
||||
/// </summary>
|
||||
int32_t getGapY() const;
|
||||
void setGapY(int32_t const value);
|
||||
bool gapYIsSet() const;
|
||||
void unsetGap_y();
|
||||
/// <summary>
|
||||
/// Number of modules in one row
|
||||
/// </summary>
|
||||
int32_t getModulesInRow() const;
|
||||
void setModulesInRow(int32_t const value);
|
||||
bool modulesInRowIsSet() const;
|
||||
void unsetModules_in_row();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Standard_detector_geometry& o);
|
||||
friend void from_json(const nlohmann::json& j, Standard_detector_geometry& o);
|
||||
protected:
|
||||
int32_t m_Nmodules;
|
||||
|
||||
int32_t m_Gap_x;
|
||||
bool m_Gap_xIsSet;
|
||||
int32_t m_Gap_y;
|
||||
bool m_Gap_yIsSet;
|
||||
int32_t m_Modules_in_row;
|
||||
bool m_Modules_in_rowIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Standard_detector_geometry_H_ */
|
||||
232
broker/gen/model/Zeromq_settings.cpp
Normal file
232
broker/gen/model/Zeromq_settings.cpp
Normal file
@@ -0,0 +1,232 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.14
|
||||
* 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 "Zeromq_settings.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Zeromq_settings::Zeromq_settings()
|
||||
{
|
||||
m_Send_watermark = 100L;
|
||||
m_Send_watermarkIsSet = false;
|
||||
m_Image_socketIsSet = false;
|
||||
m_Preview_socket = "";
|
||||
m_Preview_socketIsSet = false;
|
||||
m_Writer_notification_socket = "";
|
||||
m_Writer_notification_socketIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Zeromq_settings::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Zeromq_settings::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Zeromq_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Zeromq_settings" : pathPrefix;
|
||||
|
||||
|
||||
if (sendWatermarkIsSet())
|
||||
{
|
||||
const int64_t& value = m_Send_watermark;
|
||||
const std::string currentValuePath = _pathPrefix + ".sendWatermark";
|
||||
|
||||
|
||||
if (value < 2ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 2;";
|
||||
}
|
||||
if (value > 16384ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 16384;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (imageSocketIsSet())
|
||||
{
|
||||
const std::vector<std::string>& value = m_Image_socket;
|
||||
const std::string currentValuePath = _pathPrefix + ".imageSocket";
|
||||
|
||||
|
||||
{ // Recursive validation of array elements
|
||||
const std::string oldValuePath = currentValuePath;
|
||||
int i = 0;
|
||||
for (const std::string& value : value)
|
||||
{
|
||||
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
|
||||
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Zeromq_settings::operator==(const Zeromq_settings& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
|
||||
((!sendWatermarkIsSet() && !rhs.sendWatermarkIsSet()) || (sendWatermarkIsSet() && rhs.sendWatermarkIsSet() && getSendWatermark() == rhs.getSendWatermark())) &&
|
||||
|
||||
|
||||
((!imageSocketIsSet() && !rhs.imageSocketIsSet()) || (imageSocketIsSet() && rhs.imageSocketIsSet() && getImageSocket() == rhs.getImageSocket())) &&
|
||||
|
||||
|
||||
((!previewSocketIsSet() && !rhs.previewSocketIsSet()) || (previewSocketIsSet() && rhs.previewSocketIsSet() && getPreviewSocket() == rhs.getPreviewSocket())) &&
|
||||
|
||||
|
||||
((!writerNotificationSocketIsSet() && !rhs.writerNotificationSocketIsSet()) || (writerNotificationSocketIsSet() && rhs.writerNotificationSocketIsSet() && getWriterNotificationSocket() == rhs.getWriterNotificationSocket()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Zeromq_settings::operator!=(const Zeromq_settings& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Zeromq_settings& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
if(o.sendWatermarkIsSet())
|
||||
j["send_watermark"] = o.m_Send_watermark;
|
||||
if(o.imageSocketIsSet() || !o.m_Image_socket.empty())
|
||||
j["image_socket"] = o.m_Image_socket;
|
||||
if(o.previewSocketIsSet())
|
||||
j["preview_socket"] = o.m_Preview_socket;
|
||||
if(o.writerNotificationSocketIsSet())
|
||||
j["writer_notification_socket"] = o.m_Writer_notification_socket;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Zeromq_settings& o)
|
||||
{
|
||||
if(j.find("send_watermark") != j.end())
|
||||
{
|
||||
j.at("send_watermark").get_to(o.m_Send_watermark);
|
||||
o.m_Send_watermarkIsSet = true;
|
||||
}
|
||||
if(j.find("image_socket") != j.end())
|
||||
{
|
||||
j.at("image_socket").get_to(o.m_Image_socket);
|
||||
o.m_Image_socketIsSet = true;
|
||||
}
|
||||
if(j.find("preview_socket") != j.end())
|
||||
{
|
||||
j.at("preview_socket").get_to(o.m_Preview_socket);
|
||||
o.m_Preview_socketIsSet = true;
|
||||
}
|
||||
if(j.find("writer_notification_socket") != j.end())
|
||||
{
|
||||
j.at("writer_notification_socket").get_to(o.m_Writer_notification_socket);
|
||||
o.m_Writer_notification_socketIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int64_t Zeromq_settings::getSendWatermark() const
|
||||
{
|
||||
return m_Send_watermark;
|
||||
}
|
||||
void Zeromq_settings::setSendWatermark(int64_t const value)
|
||||
{
|
||||
m_Send_watermark = value;
|
||||
m_Send_watermarkIsSet = true;
|
||||
}
|
||||
bool Zeromq_settings::sendWatermarkIsSet() const
|
||||
{
|
||||
return m_Send_watermarkIsSet;
|
||||
}
|
||||
void Zeromq_settings::unsetSend_watermark()
|
||||
{
|
||||
m_Send_watermarkIsSet = false;
|
||||
}
|
||||
std::vector<std::string> Zeromq_settings::getImageSocket() const
|
||||
{
|
||||
return m_Image_socket;
|
||||
}
|
||||
void Zeromq_settings::setImageSocket(std::vector<std::string> const& value)
|
||||
{
|
||||
m_Image_socket = value;
|
||||
m_Image_socketIsSet = true;
|
||||
}
|
||||
bool Zeromq_settings::imageSocketIsSet() const
|
||||
{
|
||||
return m_Image_socketIsSet;
|
||||
}
|
||||
void Zeromq_settings::unsetImage_socket()
|
||||
{
|
||||
m_Image_socketIsSet = false;
|
||||
}
|
||||
std::string Zeromq_settings::getPreviewSocket() const
|
||||
{
|
||||
return m_Preview_socket;
|
||||
}
|
||||
void Zeromq_settings::setPreviewSocket(std::string const& value)
|
||||
{
|
||||
m_Preview_socket = value;
|
||||
m_Preview_socketIsSet = true;
|
||||
}
|
||||
bool Zeromq_settings::previewSocketIsSet() const
|
||||
{
|
||||
return m_Preview_socketIsSet;
|
||||
}
|
||||
void Zeromq_settings::unsetPreview_socket()
|
||||
{
|
||||
m_Preview_socketIsSet = false;
|
||||
}
|
||||
std::string Zeromq_settings::getWriterNotificationSocket() const
|
||||
{
|
||||
return m_Writer_notification_socket;
|
||||
}
|
||||
void Zeromq_settings::setWriterNotificationSocket(std::string const& value)
|
||||
{
|
||||
m_Writer_notification_socket = value;
|
||||
m_Writer_notification_socketIsSet = true;
|
||||
}
|
||||
bool Zeromq_settings::writerNotificationSocketIsSet() const
|
||||
{
|
||||
return m_Writer_notification_socketIsSet;
|
||||
}
|
||||
void Zeromq_settings::unsetWriter_notification_socket()
|
||||
{
|
||||
m_Writer_notification_socketIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user