Compare commits

..

28 Commits

Author SHA1 Message Date
aaae74e70b Merge branch '2505-fpga-sum-analysis' into 'main'
v1.0.0-rc.39

See merge request jungfraujoch/nextgendcu!123
2025-05-14 23:28:10 +02:00
18b50e9472 v1.0.0-rc.39 2025-05-14 23:28:10 +02:00
01877ffe60 Merge branch '2505-resonet-python' into 'main'
v1.0.0-rc.38

See merge request jungfraujoch/nextgendcu!122
2025-05-12 14:17:24 +02:00
b245967df3 v1.0.0-rc.38 2025-05-12 14:17:24 +02:00
19d6f22136 Merge branch '2405-eiger-mask' into 'main'
patch to 1.0.0-rc.36

See merge request jungfraujoch/nextgendcu!121
2025-05-07 16:24:35 +02:00
29ecd3515a patch to 1.0.0-rc.36 2025-05-07 16:24:35 +02:00
2533499acc Merge branch 'jfjoch_lite' into 'main'
v1.0.0-rc.36

See merge request jungfraujoch/nextgendcu!120
2025-05-05 19:32:23 +02:00
040cf08386 v1.0.0-rc.36 2025-05-05 19:32:22 +02:00
759243d1bf Merge branch '2404-test-ignore-frames' into 'main'
jfjoch_tests: Add test for missing modules with data acquistion continuing

See merge request jungfraujoch/nextgendcu!119
2025-04-23 17:22:11 +02:00
b3898b1915 jfjoch_tests: Add test for missing modules with data acquistion continuing 2025-04-23 17:22:11 +02:00
7c42c00fa9 Merge branch '2504-aq-dev-ret-handle' into 'main'
jfjoch_broker: acquisition device handles ignored if module is falling behind

See merge request jungfraujoch/nextgendcu!118
2025-04-23 16:01:22 +02:00
5c1650e71b jfjoch_broker: acquisition device handles ignored if module is falling behind 2025-04-23 15:13:13 +02:00
ec69e1ac95 Merge branch '2504-writer-mod' into 'main'
v1.0.0-rc.35

See merge request jungfraujoch/nextgendcu!117
2025-04-22 14:42:15 +02:00
9bec33290c v1.0.0-rc.35 2025-04-22 14:42:14 +02:00
2a1807f4bd Merge branch '2503-post-maxiv' into 'main'
v1.0.0-rc.34

See merge request jungfraujoch/nextgendcu!116
2025-04-14 11:52:06 +02:00
b0607ab3ca v1.0.0-rc.34 2025-04-14 11:52:06 +02:00
708b5fbc4b Merge branch '2503-eiger-trim-fix' into 'main'
v1.0.0-rc.32

See merge request jungfraujoch/nextgendcu!115
2025-03-24 18:08:05 +01:00
3f6be4c7a0 v1.0.0-rc.32 2025-03-24 18:08:05 +01:00
118e2f7992 Merge branch '2503-1.0.0-rc.32-2' into 'main'
v.1.0.0-rc.32

See merge request jungfraujoch/nextgendcu!114
2025-03-24 12:16:33 +01:00
a30707964d v.1.0.0-rc.32 2025-03-24 12:16:33 +01:00
19be3575f0 Merge branch '2502-release-script' into 'main'
Update FPGA version in the upload script

See merge request jungfraujoch/nextgendcu!113
2025-03-02 14:15:49 +01:00
d7b586452a Update FPGA version in the upload script 2025-03-02 14:15:11 +01:00
fbdb3de175 Merge branch '2505-fpga-revid-5' into 'main'
v1.0.0-rc.31

See merge request jungfraujoch/nextgendcu!112
2025-03-02 13:15:28 +01:00
ddf4c75645 v1.0.0-rc.31 2025-03-02 13:15:28 +01:00
aeabc81a4c Merge branch '2502-fix-pedestal-auto-count-time' into 'main'
DiffractionExperiment: Fix error in pedestal G1/G2 count time

See merge request jungfraujoch/nextgendcu!110
2025-02-14 12:50:32 +01:00
2fec68d3b9 DiffractionExperiment: Fix error in pedestal G1/G2 count time 2025-02-14 10:21:38 +01:00
1737f410d5 Merge branch '2501-pedestal-bug' into 'main'
Fix bug: Pixel mask applied + error in pedestal

See merge request jungfraujoch/nextgendcu!109
2025-01-21 16:53:40 +01:00
a059b66a3c AcquisitionDevice: Fix bug, when pixel mask was applied; in a situation of a bad pedestal run the system went into bad loop (given mask affected pedestal calculation, there was no way to actually take meaningful pedestal and update the mask) 2025-01-21 16:09:59 +01:00
492 changed files with 37706 additions and 17425 deletions

View File

@@ -4,6 +4,9 @@ stages:
- synthesis
- release
variables:
CMAKE_PREFIX_PATH: /opt/qt6
build:x86:gcc-11:
stage: build
variables:
@@ -17,7 +20,7 @@ build:x86:gcc-11:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-11/enable
- cmake -DCMAKE_BUILD_TYPE=Release ..
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
- make -j48
build:x86:gcc-12:
@@ -33,7 +36,7 @@ build:x86:gcc-12:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release ..
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
- make -j48
build:x86:gcc-13:
@@ -49,7 +52,7 @@ build:x86:gcc-13:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-13/enable
- cmake -DCMAKE_BUILD_TYPE=Release ..
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_VIEWER_BUILD=ON ..
- make -j48
build:x86:gcc_writer:
@@ -136,7 +139,7 @@ build:x86:rpm:
- mkdir build
- cd build
- source /opt/rh/gcc-toolset-12/enable
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=ON ..
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_INSTALL_DRIVER_SOURCE=ON -DJFJOCH_VIEWER_BUILD=ON ..
- make frontend
- make -j48 package
- mv *.rpm ..
@@ -218,6 +221,29 @@ test:x86:xds_durin:
- ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
- xds_par |grep -a1 ISa |tail -n1
test:x86:xds_durin_new_hdf5_format:
stage: test
timeout: 90m
variables:
CTEST_OUTPUT_ON_FAILURE: 1
CC: gcc
CXX: g++
needs: ["build:x86:gcc-12"]
dependencies: []
tags:
- gcc
- x86
- xds
script:
- source /opt/rh/gcc-toolset-12/enable
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j8 jfjoch_hdf5_test
- cd ../tests/xds_durin
- HDF5MASTER_NEW_FORMAT=1 ../../build/tools/jfjoch_hdf5_test ../../tests/test_data/compression_benchmark.h5 25
- xds_par |grep -a1 ISa |tail -n1
test:x86:xds_neggia:
stage: test
timeout: 90m
@@ -279,7 +305,7 @@ synthesis:hls:
- vivado
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
- mkdir -p build
- cd build
- /usr/bin/cmake ..
@@ -296,6 +322,7 @@ synthesis:100g:
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^100G/
tags:
- vivado
artifacts:
@@ -304,7 +331,7 @@ synthesis:100g:
expire_in: 1 week
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
- mkdir -p build
- cd build
- /usr/bin/cmake ..
@@ -322,6 +349,7 @@ synthesis:8x10g:
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^8x10G/
tags:
- vivado
artifacts:
@@ -330,7 +358,7 @@ synthesis:8x10g:
expire_in: 1 week
script:
- source /opt/rh/gcc-toolset-12/enable
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
- source /opt/Xilinx/Vivado/2022.2/settings64.sh
- mkdir -p build
- cd build
- /usr/bin/cmake ..
@@ -352,17 +380,3 @@ release:
- build:x86:python_client
script:
- bash gitlab_upload_release.sh
deploy-pages:
stage: release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
script:
bash make_doc.sh
artifacts:
paths:
- public/
tags:
- x86
- python

View File

@@ -14,6 +14,8 @@ SET(CMAKE_C_FLAGS_RELEASE "-O3")
SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only")
SET(JFJOCH_INSTALL_DRIVER_SOURCE OFF CACHE BOOL "Install kernel driver source (ignored if building writer only; necessary for RPM building)")
SET(JFJOCH_USE_CUDA ON CACHE BOOL "Compile Jungfraujoch with CUDA")
SET(JFJOCH_VIEWER_BUILD OFF CACHE BOOL "Compile Jungfraujoch viewer")
SET(BUILD_SHARED_LIBS OFF)
SET(BUILD_TESTING OFF)
@@ -80,7 +82,7 @@ FetchContent_Declare(tiff
FetchContent_Declare(hdf5
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
GIT_TAG hdf5_1.14.4.2
GIT_TAG hdf5_1.14.5
GIT_SHALLOW 1
EXCLUDE_FROM_ALL)
@@ -122,8 +124,11 @@ ADD_SUBDIRECTORY(compression)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(writer)
ADD_SUBDIRECTORY(frame_serialize)
ADD_SUBDIRECTORY(reader)
ADD_SUBDIRECTORY(detector_control)
ADD_SUBDIRECTORY(image_puller)
ADD_SUBDIRECTORY(preview)
IF (JFJOCH_WRITER_ONLY)
MESSAGE(STATUS "Compiling HDF5 writer only")
ELSE()
@@ -135,7 +140,10 @@ ELSE()
ADD_SUBDIRECTORY(image_analysis)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(preview)
ENDIF()
IF (JFJOCH_VIEWER_BUILD)
ADD_SUBDIRECTORY(viewer)
ENDIF()
IF (NOT JFJOCH_WRITER_ONLY)
@@ -170,9 +178,11 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Set Package Name
set(CPACK_PACKAGE_NAME "jfjoch")
# Initialize CPACK_COMPONENTS_ALL with common components
SET(CPACK_COMPONENTS_ALL jfjoch writer)
SET(CPACK_PACKAGE_NAME "jfjoch")
IF (JFJOCH_INSTALL_DRIVER_SOURCE)
SET(CPACK_COMPONENTS_ALL jfjoch writer driver-dkms)
LIST(APPEND CPACK_COMPONENTS_ALL driver-dkms)
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed")
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch")
SET(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh)
@@ -182,6 +192,10 @@ ELSE()
SET(CPACK_COMPONENTS_ALL jfjoch writer)
ENDIF()
IF (JFJOCH_VIEWER_BUILD)
LIST(APPEND CPACK_COMPONENTS_ALL viewer)
ENDIF()
SET(CPACK_GENERATOR RPM)
SET(CPACK_RPM_COMPONENT_INSTALL ON)
SET(CPACK_RPM_MAIN_COMPONENT jfjoch)
@@ -192,10 +206,11 @@ SET(CPACK_RPM_PACKAGE_RELEASE 1)
SET(CPACK_RPM_PACKAGE_SUMMARY "Jungfraujoch data acquisition system")
SET(CPACK_RPM_PACKAGE_DESCRIPTION "Jungfraujoch")
SET(CPACK_PACKAGE_CONTACT "Filip Leonarski <filip.leonarski@psi.ch>")
# Set The Vendor Name
SET(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
# Set The License Information
SET(CPACK_RPM_PACKAGE_LICENSE "Proprietary")
SET(CPACK_RPM_PACKAGE_LICENSE "GPLv3")
INCLUDE(CPack)

View File

@@ -1 +1 @@
1.0.0-rc.30
1.0.0-rc.39

View File

@@ -38,9 +38,9 @@ void AcquisitionCounters::Reset(const DiffractionExperiment &experiment, uint16_
total_packets = 0;
expected_packets_per_module = 512 * experiment.GetFPGASummation();
if (experiment.GetByteDepthReadout() == 4)
if (experiment.GetBitDepthReadout() == 32)
bytes_per_packet = 4096LU;
else if (experiment.GetByteDepthReadout() == 1)
else if (experiment.GetBitDepthReadout() == 8)
bytes_per_packet = 1024LU; // Need to seriously refactor, to have expected_packets_per_module specific for detector
else
bytes_per_packet = 2048LU;
@@ -71,6 +71,9 @@ void AcquisitionCounters::UpdateCounters(const Completion *c) {
fastest_frame_number = c->frame_number;
}
if (fastest_frame_number - slowest_frame_number > ThresholdFramesLost)
slowest_frame_number = fastest_frame_number - ThresholdFramesLost;
packets_collected.at(c->frame_number * nmodules + c->module_number) = c->packet_count;
handle_for_frame.at(c->frame_number * nmodules + c->module_number) = c->handle;
saved_completions.at(c->frame_number * nmodules + c->module_number) = *c;
@@ -206,11 +209,15 @@ uint64_t AcquisitionCounters::GetTotalPackets(uint16_t module_number) const {
return packets_per_module[module_number];
}
uint64_t AcquisitionCounters::GetExpectedPackets() const {
return GetExpectedPacketsPerModule() * nmodules;
uint64_t AcquisitionCounters::GetExpectedPacketsPerImage() const {
return expected_packets_per_module * nmodules;
}
uint64_t AcquisitionCounters::GetExpectedPacketsPerModule() const {
uint64_t AcquisitionCounters::GetTotalExpectedPackets() const {
return GetTotalExpectedPacketsPerModule() * nmodules;
}
uint64_t AcquisitionCounters::GetTotalExpectedPacketsPerModule() const {
return expected_frames * expected_packets_per_module;
}

View File

@@ -18,7 +18,6 @@
class AcquisitionCounters {
uint16_t expected_packets_per_module;
constexpr static const uint64_t max_modules = 32;
mutable std::shared_mutex m;
mutable std::condition_variable_any data_updated;
@@ -41,6 +40,7 @@ class AcquisitionCounters {
public:
static constexpr const uint64_t HandleNotFound = UINT64_MAX;
constexpr static const uint64_t ThresholdFramesLost = 50;
AcquisitionCounters();
void Reset(const DiffractionExperiment &experiment, uint16_t data_stream);
@@ -65,8 +65,9 @@ public:
uint64_t GetTotalPackets(uint16_t module_number) const;
uint64_t GetBytesReceived() const;
uint64_t GetExpectedPackets() const;
uint64_t GetExpectedPacketsPerModule() const;
uint64_t GetTotalExpectedPackets() const;
uint64_t GetTotalExpectedPacketsPerModule() const;
uint64_t GetExpectedPacketsPerImage() const;
uint64_t GetModuleNumber() const;
};

View File

@@ -103,6 +103,9 @@ void AcquisitionDevice::WaitForActionComplete() {
logger->Error("Completion with wrong module number data stream {} completion frame number {} module {} handle {}",
data_stream, c.frame_number, c.module_number, c.handle);
SendWorkRequest(c.handle);
} else if (c.frame_number < counters.GetSlowestFrameNumber()) {
// Module is falling behind, needs to return the handle then
SendWorkRequest(c.handle);
} else {
try {
counters.UpdateCounters(&c);
@@ -171,21 +174,65 @@ void AcquisitionDevice::InitializeROIMap(const uint16_t *map, size_t module_numb
void AcquisitionDevice::InitializePixelMask(const uint32_t *module_mask, size_t module_number) {}
void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment) {
void AcquisitionDevice::InitializeROIMap(const DiffractionExperiment& experiment, const std::vector<uint16_t>& roi_map) {
if (roi_map.size() != experiment.GetXPixelsNumConv() * experiment.GetYPixelsNumConv())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Mismatch in array size");
std::vector<uint16_t> tmp(RAW_MODULE_SIZE);
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++) {
experiment.ExportROIMap(tmp.data(), offset + m);
ConvertedToRawGeometry(experiment, offset + m, tmp.data(), roi_map.data());
InitializeROIMap(tmp.data(), m);
}
}
void AcquisitionDevice::InitializeEmptyPixelMask(const DiffractionExperiment &experiment) {
std::vector<uint32_t> empty_mask(RAW_MODULE_SIZE);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++)
InitializePixelMask(empty_mask.data(), m);
}
void AcquisitionDevice::InitializeDataProcessing(const DiffractionExperiment &experiment,
const AzimuthalIntegration &azint) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
if (experiment.IsGeometryTransformed()) {
std::vector<float> tmp1(RAW_MODULE_SIZE);
std::vector<uint16_t> tmp2(RAW_MODULE_SIZE);
for (int m = 0; m < modules; m++) {
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Corrections().data());
ConvertedToRawGeometry(experiment, offset + m, tmp2.data(), azint.GetPixelToBin().data());
InitializeIntegrationMap(tmp2.data(), tmp1.data(), m);
ConvertedToRawGeometry(experiment, offset + m, tmp1.data(), azint.Resolution().data());
InitializeSpotFinderResolutionMap(tmp1.data(), m);
}
} else {
for (int m = 0; m < modules; m++) {
InitializeIntegrationMap(azint.GetPixelToBin().data() + (offset + m) * RAW_MODULE_SIZE,
azint.Corrections().data() + (offset + m) * RAW_MODULE_SIZE,
m);
InitializeSpotFinderResolutionMap(azint.Resolution().data() + (m + offset) * RAW_MODULE_SIZE,
m);
}
}
}
void AcquisitionDevice::InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++)
InitializePixelMask(mask.GetMaskRaw().data() + RAW_MODULE_SIZE * (offset + m), m);
std::vector<uint32_t> tmp(RAW_MODULE_SIZE);
for (int m = 0; m < modules; m++) {
ConvertedToRawGeometry(experiment, offset + m, tmp.data(), mask.GetMask().data());
InitializePixelMask(tmp.data(), m);
}
}
void AcquisitionDevice::MapBuffersStandard(size_t c2h_buffer_count, int16_t numa_node) {
@@ -246,7 +293,7 @@ AcquisitionDeviceStatistics AcquisitionDevice::GetStatistics() const {
ret.bytes_received = GetBytesReceived();
ret.start_timestamp = start_time.time_since_epoch().count();
ret.end_timestamp = end_time.time_since_epoch().count();
ret.packets_expected = counters.GetExpectedPackets();
ret.packets_expected = counters.GetTotalExpectedPackets();
ret.good_packets = counters.GetTotalPackets();
for (int i = 0; i < counters.GetModuleNumber(); i++)
@@ -288,8 +335,10 @@ void AcquisitionDevice::RunInternalGenerator(const DiffractionExperiment &experi
break;
case DetectorType::EIGER:
config.detector_type = SLS_DETECTOR_TYPE_EIGER;
config.eiger_bit_depth = experiment.GetByteDepthReadout() * 8;
config.eiger_bit_depth = experiment.GetBitDepthReadout();
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Detector not supported");
}
HW_RunInternalGenerator(config);
}

View File

@@ -21,6 +21,7 @@
#include "Completion.h"
#include "../fpga/pcie_driver/jfjoch_fpga.h"
#include "../common/NetworkAddressConvert.h"
#include "../common/AzimuthalIntegration.h"
struct AcquisitionDeviceStatistics {
uint64_t good_packets;
@@ -96,9 +97,11 @@ public:
virtual void InitializeIntegrationMap(const uint16_t *map, const float *weights, size_t module_number);
virtual void InitializeSpotFinderResolutionMap(const float *data, size_t module_number);
virtual void InitializeROIMap(const uint16_t *map, size_t module_number);
void InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask);
void InitializeEmptyPixelMask(const DiffractionExperiment &experiment); // Empty Mask
void InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &mask_raw);
virtual void InitializePixelMask(const uint32_t *module_mask, size_t module_number);
void InitializeROIMap(const DiffractionExperiment &experiment);
void InitializeROIMap(const DiffractionExperiment& experiment, const std::vector<uint16_t>& raw_roi_map);
void InitializeDataProcessing(const DiffractionExperiment &experiment, const AzimuthalIntegration& azint);
const AcquisitionCounters& Counters() const;

View File

@@ -227,39 +227,6 @@ void JFJochBrokerHttp::detector_status_get(Pistache::Http::ResponseWriter &respo
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewTIFF(true);
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void
JFJochBrokerHttp::preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings,
Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewJPEG(Convert(previewSettings));
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewJPEG(PreviewJPEGSettings());
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::preview_image_tiff_get(Pistache::Http::ResponseWriter &response) {
std::string s = state_machine.GetPreviewTIFF(false);
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::config_internal_generator_image_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) {
@@ -352,6 +319,12 @@ void JFJochBrokerHttp::plot_bkg_estimate_get(const std::optional<int32_t> &binni
GenericPlot(PlotType::BkgEstimate, binning, compression, response);
}
void JFJochBrokerHttp::plot_resolution_estimate_get(const std::optional<int32_t> &binning,
const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ResolutionEstimate, binning, compression, response);
}
void JFJochBrokerHttp::plot_error_pixel_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
@@ -382,6 +355,11 @@ void JFJochBrokerHttp::plot_indexing_unit_cell_angle_get(const std::optional<int
GenericPlot(PlotType::IndexingUnitCellAngle, binning, compression, response);
}
void JFJochBrokerHttp::plot_packets_received_get(const std::optional<int32_t> &binning,
const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::PacketsReceived, binning, compression, response);
}
void JFJochBrokerHttp::plot_receiver_delay_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
@@ -424,6 +402,12 @@ void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional<int32_t> &binni
GenericPlot(PlotType::StrongPixels, binning, compression, response);
}
void JFJochBrokerHttp::plot_max_value_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::MaxValue, binning, compression, response);
}
void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
auto s = state_machine.GetFullPixelMaskTIFF();
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
@@ -540,6 +524,9 @@ void JFJochBrokerHttp::statistics_get(const std::optional<bool> &compression, Pi
statistics.setImageFormatSettings(Convert(state_machine.GetImageFormatSettings()));
statistics.setPixelMask(Convert(state_machine.GetPixelMaskStatistics()));
statistics.setRoi(Convert(state_machine.GetROIDefintion()));
statistics.setFileWriterSettings(Convert(state_machine.GetFileWriterSettings()));
statistics.setAzInt(Convert(state_machine.GetRadialIntegrationSettings()));
statistics.setBuffer(Convert(state_machine.GetImageBufferStatus()));
auto zeromq_prev = state_machine.GetPreviewSocketSettings();
if (!zeromq_prev.address.empty())
@@ -577,3 +564,110 @@ void JFJochBrokerHttp::config_zeromq_metadata_put(
state_machine.SetMetadataSocketSettings(Convert(zeromqMetadataSettings));
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::image_buffer_clear_post(Pistache::Http::ResponseWriter &response) {
state_machine.ClearImageBuffer();
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::image_buffer_image_cbor_get(const std::optional<int64_t> &imageNumber,
Pistache::Http::ResponseWriter &response) {
std::vector<uint8_t> tmp_vector;
state_machine.GetImageFromBuffer(tmp_vector, imageNumber.value_or(-1));
std::string s = std::string((char *) tmp_vector.data(), tmp_vector.size());
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s,
Pistache::Http::Mime::MediaType::fromString("application/cbor"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional<int64_t> &id,
const std::optional<bool> &showUserMask,
const std::optional<bool> &showRoi,
const std::optional<bool> &showSpots,
const std::optional<int64_t> &saturation,
const std::optional<int64_t> &jpegQuality,
const std::optional<float> &showResRing,
const std::optional<std::string> &color,
Pistache::Http::ResponseWriter &response) {
int64_t image_id = id.value_or(ImageBuffer::MaxImage);
PreviewJPEGSettings settings{};
settings.show_user_mask = showUserMask.value_or(true);
settings.show_roi = showRoi.value_or(false);
settings.show_spots = showSpots.value_or(true);
settings.saturation_value = saturation.value_or(10);
settings.jpeg_quality = jpegQuality.value_or(100);
settings.resolution_ring = showResRing;
settings.scale = ColorScaleEnum::Indigo;
if (color == "viridis")
settings.scale = ColorScaleEnum::Viridis;
else if (color == "bw")
settings.scale = ColorScaleEnum::BW;
else if (color == "heat")
settings.scale = ColorScaleEnum::Heat;
std::string s = state_machine.GetPreviewJPEG(settings, image_id);
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void
JFJochBrokerHttp::image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) {
int64_t image_id = ImageBuffer::MaxImage;
if (id.has_value())
image_id = id.value();
std::string s = state_machine.GetPreviewTIFF(image_id);
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) {
std::vector<uint8_t> tmp_vector;
state_machine.GetStartMessageFromBuffer(tmp_vector);
std::string s = std::string((char *) tmp_vector.data(), tmp_vector.size());
if (!s.empty())
response.send(Pistache::Http::Code::Ok, s,
Pistache::Http::Mime::MediaType::fromString("application/cbor"));
else
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::image_buffer_status_get(Pistache::Http::ResponseWriter &response) {
ProcessOutput(Convert(state_machine.GetImageBufferStatus()), response);
}
void JFJochBrokerHttp::config_file_writer_get(Pistache::Http::ResponseWriter &response) {
ProcessOutput(Convert(state_machine.GetFileWriterSettings()), response);
}
void JFJochBrokerHttp::config_file_writer_put(
const org::openapitools::server::model::File_writer_settings &fileWriterSettings,
Pistache::Http::ResponseWriter &response) {
state_machine.LoadFileWriterSettings(Convert(fileWriterSettings));
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::plot_roi_mean_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIMean, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_x_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIWeightedX, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_y_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIWeightedY, binning, compression, response);
}

View File

@@ -58,6 +58,8 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void plot_bkg_estimate_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_resolution_estimate_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) override;
void plot_error_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_image_collection_efficiency_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
@@ -78,7 +80,8 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
Pistache::Http::ResponseWriter &response) override;
void plot_strong_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_max_value_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) override;
void plot_azim_int_get(const std::optional<bool>& compression, Pistache::Http::ResponseWriter &response) override;
void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override;
@@ -100,17 +103,10 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void trigger_post(Pistache::Http::ResponseWriter &response) override;
void pedestal_post(Pistache::Http::ResponseWriter &response) override;
void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) override;
void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel,
const std::optional<int32_t> &sc,
Pistache::Http::ResponseWriter &response) override;
void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) override;
void preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings,
Pistache::Http::ResponseWriter &response) override;
void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) override;
void config_roi_get(Pistache::Http::ResponseWriter &response) override;
void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions,
Pistache::Http::ResponseWriter &response) override;
@@ -185,6 +181,32 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void plot_indexing_unit_cell_angle_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) override;
void plot_packets_received_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_cbor_get(const std::optional<int64_t> &id,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_jpeg_get(const std::optional<int64_t> &id,
const std::optional<bool> &showUserMask,
const std::optional<bool> &showRoi,
const std::optional<bool> &showSpots,
const std::optional<int64_t> &saturation,
const std::optional<int64_t> &jpegQuality,
const std::optional<float> &showResRing,
const std::optional<std::string> &color,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) override;
void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) override;
void image_buffer_status_get(Pistache::Http::ResponseWriter &response) override;
void plot_roi_mean_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) override;
void plot_roi_x_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) override;
void plot_roi_y_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) override;
public:
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
void AddDetectorSetup(const DetectorSetup &setup);
@@ -193,6 +215,12 @@ public:
JFJochBrokerHttp& FrontendDirectory(const std::string &directory);
~JFJochBrokerHttp() override = default;
private:
void config_file_writer_get(Pistache::Http::ResponseWriter &response) override;
void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings,
Pistache::Http::ResponseWriter &response) override;
};

View File

@@ -10,9 +10,9 @@
#include "Detector_type.h"
#include "../image_pusher/NonePusher.h"
DetectorGeometry ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j) {
DetectorGeometryModular ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j) {
auto s = j.getStandardGeometry();
return {s.getNmodules(), s.getModulesInRow(), s.getGapX(), s.getGapY(), false};
return DetectorGeometryModular(s.getNmodules(), s.getModulesInRow(), s.getGapX(), s.getGapY(), false);
}
DetectorModuleGeometry::Direction Convert(const org::openapitools::server::model::Detector_module_direction& d) {
@@ -36,23 +36,25 @@ DetectorType Convert(const org::openapitools::server::model::Detector_type &d) {
return DetectorType::EIGER;
case org::openapitools::server::model::Detector_type::eDetector_type::JUNGFRAU:
return DetectorType::JUNGFRAU;
case org::openapitools::server::model::Detector_type::eDetector_type::DECTRIS:
return DetectorType::DECTRIS;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "invalid detector type");
}
}
DetectorGeometry ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j) {
DetectorGeometryModular ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j) {
std::vector<DetectorModuleGeometry> modules;
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, false};
return DetectorGeometryModular(modules, false);
}
DetectorGeometry ParseDetectorGeometry(const org::openapitools::server::model::Detector &d) {
DetectorGeometryModular 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");
@@ -65,24 +67,54 @@ DetectorGeometry ParseDetectorGeometry(const org::openapitools::server::model::D
}
DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detector &d) {
DetectorGeometry geom = ParseDetectorGeometry(d);
DetectorType detector_type = Convert(d.getType());
if (detector_type == DetectorType::DECTRIS) {
std::string hostname;
if (d.getHostname().size() > 1)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"DECTRIS detector requires single hostname (or none)");
else if (d.getHostname().size() == 1)
hostname = d.getHostname()[0];
DetectorSetup setup = DetDECTRIS(1,1, d.getDescription(), hostname);
if (d.roiModeIsSet())
setup.DECTRISROI(d.getRoiMode());
return setup;
}
DetectorGeometryModular geom = ParseDetectorGeometry(d);
if (d.isMirrorY())
geom.VerticalFlip();
DetectorType detector_type = Convert(d.getType());
DetectorSetup setup(geom, detector_type, d.getDescription(), d.getHostname());
auto calib = d.getCalibrationFile();
if (!calib.empty()) {
if (detector_type == DetectorType::JUNGFRAU)
setup.LoadGain(calib);
else if (detector_type == DetectorType::EIGER)
setup.SetTrimFiles(calib);
switch (detector_type) {
case DetectorType::EIGER:
setup.SetTrimFiles(calib);
break;
case DetectorType::JUNGFRAU:
setup.LoadGain(calib);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Detector type not supported");
}
}
if ((detector_type == DetectorType::EIGER) || (detector_type == DetectorType::JUNGFRAU))
setup.PixelSize_um(75.0f);
switch (detector_type) {
case DetectorType::EIGER:
case DetectorType::JUNGFRAU:
setup.PixelSize_um(75.0f);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Detector type not supported");
}
if (d.highVoltageVIsSet())
setup.HighVoltage(d.getHighVoltageV());
@@ -101,6 +133,12 @@ DetectorSetup ParseDetectorSetup(const org::openapitools::server::model::Detecto
if (d.txDelayIsSet())
setup.TxDelay(d.getTxDelay());
if (d.minimumCountTimeUsIsSet())
setup.MinCountTime(std::chrono::microseconds(d.getMinimumCountTimeUs()));
if (d.minimumFrameTimeUsIsSet())
setup.MinFrameTime(std::chrono::microseconds(d.getMinimumFrameTimeUs()));
return setup;
}
@@ -108,11 +146,14 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s
if (j.instrumentIsSet())
experiment.ImportInstrumentMetadata(Convert(j.getInstrument()));
if (j.fileWriterIsSet())
experiment.ImportFileWriterSettings(Convert(j.getFileWriter()));
if (j.detectorSettingsIsSet())
experiment.ImportDetectorSettings(Convert(j.getDetectorSettings()));
if (j.azimIntIsSet())
experiment.ImportRadialIntegrationSettings(Convert(j.getAzimInt()));
experiment.ImportAzimuthalIntegrationSettings(Convert(j.getAzimInt()));
if (j.imageFormatIsSet())
experiment.ImportImageFormatSettings(Convert(j.getImageFormat()));

View File

@@ -10,9 +10,9 @@
#include "../receiver/JFJochReceiverService.h"
#include "gen/model/Jfjoch_settings.h"
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);
DetectorGeometryModular ParseStandardDetectorGeometry(const org::openapitools::server::model::Detector &j);
DetectorGeometryModular ParseCustomDetectorGeometry(const org::openapitools::server::model::Detector &j);
DetectorGeometryModular 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);

View File

@@ -3,6 +3,8 @@
#include "JFJochServices.h"
#include "../common/JFJochException.h"
#include "../detector_control/SLSDetectorWrapper.h"
#include "../detector_control/DectrisDetectorWrapper.h"
JFJochServices::JFJochServices(Logger &in_logger) : logger(in_logger) {}
@@ -11,6 +13,8 @@ void JFJochServices::Start(const DiffractionExperiment& experiment,
const JFCalibration &calibration) {
logger.Info("Measurement start for: {}", experiment.GetFilePrefix());
cannot_stop_detector = false;
if (receiver != nullptr) {
logger.Info(" ... receiver start");
if (experiment.IsJungfrauConvPhotonCnt())
@@ -32,16 +36,21 @@ void JFJochServices::Off() {
detector->Deactivate();
}
void JFJochServices::On(const DiffractionExperiment &x) {
void JFJochServices::On(DiffractionExperiment &x) {
if (x.IsUsingInternalPacketGen() || (receiver == nullptr)) {
detector.reset();
} else {
logger.Info("Detector on");
if (!detector)
detector = std::make_unique<DetectorWrapper>();
switch (x.GetDetectorType()) {
case DetectorType::EIGER:
case DetectorType::JUNGFRAU:
detector = std::make_unique<SLSDetectorWrapper>();
break;
case DetectorType::DECTRIS:
detector = std::make_unique<DectrisDetectorWrapper>();
break;
}
detector->Initialize(x, receiver->GetNetworkConfig());
logger.Info(" ... done");
}
}
@@ -51,35 +60,35 @@ JFJochServicesOutput JFJochServices::Stop() {
std::unique_ptr<JFJochException> exception;
bool detector_error = false;
if (receiver != nullptr) {
try {
if (detector) {
logger.Info("Wait for detector done");
logger.Info("Wait for detector idle");
DetectorState state = detector->GetState();
while ((state == DetectorState::WAITING) || (state == DetectorState::BUSY)) {
while ((!cannot_stop_detector)
&& ((state == DetectorState::WAITING) || (state == DetectorState::BUSY))) {
// check detector state every 5 ms
std::this_thread::sleep_for(std::chrono::milliseconds(5));
state = detector->GetState();
}
if (state == DetectorState::ERROR) {
if (state == DetectorState::IDLE) {
logger.Info(" ... detector idle");
receiver->Cancel(true); // cancel silently
} else {
logger.Error(" ... detector in error state");
receiver->Cancel(false);
} else if (state == DetectorState::IDLE) {
receiver->Cancel(true); // cancel silently
detector_error = true;
}
}
logger.Info("Wait for receiver done");
ret.receiver_output = receiver->Stop();
if (ret.receiver_output.status.compressed_ratio)
logger.Info(" ... Receiver efficiency: {} % Max delay: {} Compression ratio {}x",
static_cast<int>(ret.receiver_output.efficiency * 100.0),
ret.receiver_output.status.max_receive_delay,
static_cast<int>(std::round(ret.receiver_output.status.compressed_ratio.value())));
else
logger.Info(" ... Receiver efficiency: {} % Max delay: {}",
static_cast<int>(ret.receiver_output.efficiency * 100.0),
ret.receiver_output.status.max_receive_delay);
static_cast<int>(ret.receiver_output.efficiency * 100.0),
ret.receiver_output.status.max_receive_delay.value_or(0),
static_cast<int>(std::round(ret.receiver_output.status.compressed_ratio.value_or(1))));
if (ret.receiver_output.efficiency < 1.0) {
for (int i = 0; i < ret.receiver_output.received_packets.size(); i++) {
@@ -103,15 +112,23 @@ JFJochServicesOutput JFJochServices::Stop() {
if (exception)
throw JFJochException(*exception);
if (detector_error)
throw JFJochException(JFJochExceptionCategory::Detector, "Error in detector operation");
return ret;
}
void JFJochServices::Cancel() {
if (receiver != nullptr) {
if (detector)
if (detector) {
// Best effort - if detector cannot be stopped, this is OK, important to still stop receiver
try {
detector->Stop();
receiver->Cancel(false);
} catch (...) {
cannot_stop_detector = true;
}
}
if (receiver != nullptr)
receiver->Cancel(false);
}
JFJochServices &JFJochServices::Receiver(JFJochReceiverService *input) {
@@ -159,16 +176,16 @@ std::optional<DetectorStatus> JFJochServices::GetDetectorStatus() const {
return {};
}
std::string JFJochServices::GetPreviewJPEG(const PreviewJPEGSettings &settings) const {
std::string JFJochServices::GetPreviewJPEG(const PreviewJPEGSettings &settings, int64_t image_number) const {
if (receiver != nullptr)
return receiver->GetJPEG(settings);
return receiver->GetJPEGFromBuffer(settings, image_number);
else
return {};
}
std::string JFJochServices::GetPreviewTIFF(bool calibration) const {
std::string JFJochServices::GetPreviewTIFF(int64_t image_number) const {
if (receiver != nullptr)
return receiver->GetTIFF(calibration);
return receiver->GetTIFFFromBuffer(image_number);
else
return "";
}
@@ -223,3 +240,30 @@ void JFJochServices::SetMetadataSocketSettings(const ZMQMetadataSettings &input)
if (receiver)
receiver->MetadataSocketSettings(input);
}
void JFJochServices::GetStartMessageFromBuffer(std::vector<uint8_t> &v) {
if (receiver)
return receiver->GetStartMessageFromBuffer(v);
}
bool JFJochServices::GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number) {
if (receiver)
return receiver->GetImageFromBuffer(v, image_number);
return false;
}
ImageBufferStatus JFJochServices::GetImageBufferStatus() const {
if (receiver)
return receiver->GetImageBufferStatus();
else return ImageBufferStatus{.total_slots = 0, .available_slots = 0};
}
void JFJochServices::ClearImageBuffer() const {
if (receiver)
receiver->ClearImageBuffer();
}
void JFJochServices::LoadDetectorPixelMask(PixelMask &mask) {
if (detector)
detector->LoadPixelMask(mask);
}

View File

@@ -18,10 +18,11 @@ class JFJochServices {
JFJochReceiverService *receiver = nullptr;
std::unique_ptr<DetectorWrapper> detector;
volatile bool cannot_stop_detector = false;
Logger &logger;
public:
explicit JFJochServices(Logger &in_logger);
void On(const DiffractionExperiment& experiment);
void On(DiffractionExperiment& experiment);
void Off();
void ConfigureDetector(const DiffractionExperiment& experiment);
void Start(const DiffractionExperiment& experiment,
@@ -43,8 +44,8 @@ public:
std::optional<DetectorStatus> GetDetectorStatus() const;
std::string GetPreviewJPEG(const PreviewJPEGSettings &settings) const;
std::string GetPreviewTIFF(bool calibration) const;
std::string GetPreviewJPEG(const PreviewJPEGSettings &settings, int64_t image_number) const;
std::string GetPreviewTIFF(int64_t image_number) const;
void GetXFELPulseID(std::vector<uint64_t> &v) const;
void GetXFELEventCode(std::vector<uint64_t> &v) const;
@@ -56,6 +57,13 @@ public:
void SetMetadataSocketSettings(const ZMQMetadataSettings &input);
ZMQMetadataSettings GetMetadataSocketSettings();
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
bool GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number = -1);
ImageBufferStatus GetImageBufferStatus() const;
void ClearImageBuffer() const;
void LoadDetectorPixelMask(PixelMask &mask);
};

View File

@@ -6,6 +6,7 @@
#include "JFJochStateMachine.h"
#include "../preview/JFJochTIFF.h"
#include "pistache/net.h"
#include "../common/CUDAWrapper.h"
JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_logger)
: logger(in_logger),
@@ -14,6 +15,18 @@ JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_l
current_detector_setup(0),
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()),
pixel_mask_statistics({0, 0, 0}) {
indexing_possible = (get_gpu_count() >= 0);
#ifdef JFJOCH_USE_TORCH
resolution_estimate_possible = true;
#else
resolution_estimate_possible = false;
#endif
if (!indexing_possible)
data_processing_settings.indexing = false;
if (!resolution_estimate_possible)
data_processing_settings.resolution_estimate = false;
SupressTIFFErrors();
}
@@ -50,11 +63,20 @@ bool JFJochStateMachine::ImportPedestalG1G2(const JFJochReceiverOutput &receiver
}
void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &ul) {
if (experiment.GetDetectorSetup().GetDetectorType() == DetectorType::EIGER) {
logger.Info("EIGER configuration");
services.ConfigureDetector(experiment);
logger.Info(" ... done ");
return;
if (experiment.GetDetectorSetup().GetDetectorType() != DetectorType::JUNGFRAU) {
try {
logger.Info("EIGER configuration");
services.ConfigureDetector(experiment);
logger.Info(" ... done ");
SetState(JFJochState::Idle,
"Detector configured",
BrokerStatus::MessageSeverity::Success);
return;
} catch (const std::exception &e) {
logger.Error("Configuration error {}", e.what());
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
throw;
}
}
calibration = std::make_unique<JFCalibration>(experiment);
@@ -254,8 +276,14 @@ void JFJochStateMachine::PedestalThread(std::unique_lock<std::mutex> ul) {
void JFJochStateMachine::InitializeThread(std::unique_lock<std::mutex> ul) {
try {
// On might modify experiment (reads DECTRIS configuration), so need to have lock acquired at this point
services.On(experiment);
detector_setup[current_detector_setup] = experiment.GetDetectorSetup();
pixel_mask = PixelMask(experiment);
services.LoadDetectorPixelMask(pixel_mask);
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
} catch (const std::exception &e) {
logger.Error("Initialize error {}", e.what());
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
throw;
}
@@ -263,9 +291,7 @@ void JFJochStateMachine::InitializeThread(std::unique_lock<std::mutex> ul) {
}
void JFJochStateMachine::Trigger() {
std::unique_lock ul(m);
if (state == JFJochState::Measuring)
services.Trigger();
services.Trigger();
}
void JFJochStateMachine::Start(const DatasetSettings &settings) {
@@ -313,7 +339,8 @@ PixelMaskStatistics JFJochStateMachine::GetPixelMaskStatistics() const {
void JFJochStateMachine::MeasurementThread() {
try {
auto tmp_output = services.Stop(); {
auto tmp_output = services.Stop();
{
std::unique_lock ul(m);
if (tmp_output.receiver_output.writer_queue_full_warning)
@@ -402,6 +429,10 @@ std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistic
tmp.indexing_rate = rcv_status->indexing_rate;
tmp.bkg_estimate = rcv_status->bkg_estimate;
tmp.collection_efficiency = rcv_status->efficiency;
tmp.error_pixels = rcv_status->error_pixels;
tmp.saturated_pixels = rcv_status->saturated_pixels;
tmp.roi_beam_sum = rcv_status->roi_beam_sum;
tmp.roi_beam_npixel = rcv_status->roi_beam_npixel;
}
return tmp;
}
@@ -475,8 +506,16 @@ MultiLinePlot JFJochStateMachine::GetPlots(const PlotRequest &request) const {
void JFJochStateMachine::SetSpotFindingSettings(const SpotFindingSettings &settings) {
std::unique_lock ul(data_processing_settings_mutex);
DiffractionExperiment::CheckDataProcessingSettings(settings);
// If there is no capability to use the features, make sure these are disabled
if (!indexing_possible)
data_processing_settings.indexing = false;
if (!resolution_estimate_possible)
data_processing_settings.resolution_estimate = false;
data_processing_settings = settings;
services.SetSpotFindingSettings(settings);
services.SetSpotFindingSettings(data_processing_settings);
}
SpotFindingSettings JFJochStateMachine::GetSpotFindingSettings() const {
@@ -485,7 +524,7 @@ SpotFindingSettings JFJochStateMachine::GetSpotFindingSettings() const {
}
void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) {
std::unique_lock ul(m);
// Not thread safe, only during setup
if (detector_setup.empty()) {
experiment.Detector(setup);
@@ -498,24 +537,23 @@ void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) {
}
DetectorList JFJochStateMachine::GetDetectorsList() const {
std::unique_lock ul(m);
DetectorList ret;
for (const auto &i: detector_setup) {
DetectorListElement tmp;
tmp.description = i.GetDescription();
tmp.nmodules = i.GetModulesNum();
tmp.width = i.GetGeometry().GetWidth();
tmp.height = i.GetGeometry().GetHeight();
tmp.width = i.GetGeometry().GetWidth(true);
tmp.height = i.GetGeometry().GetHeight(true);
tmp.serial_number = i.GetSerialNumber();
tmp.base_ipv4_addr = i.GetBaseIPv4Addr();
tmp.udp_interface_count = i.GetUDPInterfaceCount();
tmp.min_frame_time = i.GetMinFrameTime();
tmp.min_count_time = i.GetMinCountTime();
tmp.readout_time = i.GetReadOutTime();
tmp.detector_type = i.GetDetectorType();
ret.detector.emplace_back(std::move(tmp));
}
ret.current_id = current_detector_setup;
return ret;
}
@@ -552,13 +590,15 @@ void JFJochStateMachine::SetRadialIntegrationSettings(const AzimuthalIntegration
if (IsRunning())
throw WrongDAQStateException("Cannot change radial integration settings during data collection");
experiment.ImportRadialIntegrationSettings(settings);
{
std::unique_lock ul2(experiment_azimuthal_integration_settings_mutex);
experiment.ImportAzimuthalIntegrationSettings(settings);
}
}
AzimuthalIntegrationSettings JFJochStateMachine::GetRadialIntegrationSettings() const {
std::unique_lock ul(m);
return experiment.GetRadialIntegrationSettings();
std::unique_lock ul(experiment_azimuthal_integration_settings_mutex);
return experiment.GetAzimuthalIntegrationSettings();
}
bool JFJochStateMachine::IsRunning() const {
@@ -600,12 +640,12 @@ void JFJochStateMachine::ResetError() noexcept {
}
}
std::string JFJochStateMachine::GetPreviewJPEG(const PreviewJPEGSettings &settings) const {
return services.GetPreviewJPEG(settings);
std::string JFJochStateMachine::GetPreviewJPEG(const PreviewJPEGSettings &settings, int64_t image_number) const {
return services.GetPreviewJPEG(settings, image_number);
}
std::string JFJochStateMachine::GetPreviewTIFF(bool calibration) const {
return services.GetPreviewTIFF(calibration);
std::string JFJochStateMachine::GetPreviewTIFF(int64_t image_number) const {
return services.GetPreviewTIFF(image_number);
}
std::string JFJochStateMachine::GetPedestalTIFF(size_t gain_level, size_t sc) const {
@@ -693,6 +733,9 @@ std::vector<uint64_t> JFJochStateMachine::GetXFELEventCode() const {
std::string JFJochStateMachine::GetFullPixelMaskTIFF() const {
std::unique_lock ul(m);
if (state == JFJochState::Inactive)
return {};
std::vector v = pixel_mask.GetMask(experiment);
return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
sizeof(uint32_t), false);
@@ -700,6 +743,10 @@ std::string JFJochStateMachine::GetFullPixelMaskTIFF() const {
std::string JFJochStateMachine::GetUserPixelMaskTIFF() const {
std::unique_lock ul(m);
if (state == JFJochState::Inactive)
return {};
std::vector v = pixel_mask.GetUserMask(experiment);
return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
sizeof(uint32_t), false);
@@ -707,11 +754,17 @@ std::string JFJochStateMachine::GetUserPixelMaskTIFF() const {
std::vector<uint32_t> JFJochStateMachine::GetFullPixelMask() const {
std::unique_lock ul(m);
if (state == JFJochState::Inactive)
return {};
return pixel_mask.GetMask(experiment);
}
std::vector<uint32_t> JFJochStateMachine::GetUserPixelMask() const {
std::unique_lock ul(m);
if (state == JFJochState::Inactive)
return {};
return pixel_mask.GetUserMask(experiment);
}
@@ -731,7 +784,7 @@ void JFJochStateMachine::SetUserPixelMask(const std::vector<uint32_t> &v) {
}
InstrumentMetadata JFJochStateMachine::GetInstrumentMetadata() const {
std::unique_lock ul(m);
std::unique_lock ul(experiment_instrument_metadata_mutex);
return experiment.GetInstrumentMetadata();
}
@@ -740,12 +793,14 @@ void JFJochStateMachine::LoadInstrumentMetadata(const InstrumentMetadata &settin
if (IsRunning())
throw WrongDAQStateException("Cannot change instrument metadata during data collection");
experiment.ImportInstrumentMetadata(settings);
{
std::unique_lock ul2(experiment_instrument_metadata_mutex);
experiment.ImportInstrumentMetadata(settings);
}
}
ImageFormatSettings JFJochStateMachine::GetImageFormatSettings() const {
std::unique_lock ul(m);
std::unique_lock ul(experiment_image_format_settings_mutex);
return experiment.GetImageFormatSettings();
}
@@ -755,8 +810,18 @@ void JFJochStateMachine::LoadImageFormatSettings(const ImageFormatSettings &sett
if (IsRunning())
throw WrongDAQStateException("Cannot change image format settings during data collection");
experiment.ImportImageFormatSettings(settings);
pixel_mask.Update(settings);
bool recalc_mask = (experiment.GetPedestalG0RMSLimit() != settings.GetPedestalG0RMSLimit());
{
std::unique_lock ul2(experiment_image_format_settings_mutex);
experiment.ImportImageFormatSettings(settings);
}
if (recalc_mask)
pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get());
else
pixel_mask.CalcEdgePixels(experiment);
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
}
@@ -797,3 +862,40 @@ void JFJochStateMachine::SetMetadataSocketSettings(const ZMQMetadataSettings &in
ZMQMetadataSettings JFJochStateMachine::GetMetadataSocketSettings() {
return services.GetMetadataSocketSettings();
}
void JFJochStateMachine::GetStartMessageFromBuffer(std::vector<uint8_t> &v) {
return services.GetStartMessageFromBuffer(v);
}
void JFJochStateMachine::GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number) {
services.GetImageFromBuffer(v, image_number);
}
ImageBufferStatus JFJochStateMachine::GetImageBufferStatus() const {
return services.GetImageBufferStatus();
}
void JFJochStateMachine::ClearImageBuffer() const {
std::unique_lock ul(m);
if (IsRunning())
throw WrongDAQStateException("Cannot clear image buffer during data collection");
services.ClearImageBuffer();
}
FileWriterSettings JFJochStateMachine::GetFileWriterSettings() const {
std::unique_lock ul(experiment_file_writer_settings_mutex);
return experiment.GetFileWriterSettings();
}
void JFJochStateMachine::LoadFileWriterSettings(const FileWriterSettings &settings) {
std::unique_lock ul(m);
if (IsRunning())
throw WrongDAQStateException("Cannot change instrument metadata during data collection");
{
std::unique_lock ul2(experiment_file_writer_settings_mutex);
experiment.ImportFileWriterSettings(settings);
}
}

View File

@@ -36,6 +36,7 @@ struct DetectorListElement {
std::chrono::microseconds readout_time;
std::chrono::microseconds min_frame_time;
std::chrono::microseconds min_count_time;
DetectorType detector_type;
};
struct DetectorList {
@@ -57,7 +58,7 @@ struct MeasurementStatistics {
std::optional<float> compression_ratio;
bool cancelled;
int64_t max_receive_delay;
std::optional<int64_t> max_receive_delay;
std::optional<float> indexing_rate;
@@ -69,29 +70,38 @@ struct MeasurementStatistics {
std::optional<std::pair<float, float>> beam_center_drift_pxl;
std::string unit_cell;
std::optional<float> error_pixels;
std::optional<float> saturated_pixels;
std::optional<float> roi_beam_npixel;
std::optional<float> roi_beam_sum;
};
class JFJochStateMachine {
Logger &logger;
JFJochServices &services;
std::future<void> measurement;
// assuming immutable during normal operation
std::vector<DetectorSetup> detector_setup;
std::vector<JFModuleGainCalibration> gain_calibration;
mutable std::mutex experiment_detector_settings_mutex;
mutable std::mutex experiment_azimuthal_integration_settings_mutex;
mutable std::mutex experiment_instrument_metadata_mutex;
mutable std::mutex experiment_image_format_settings_mutex;
mutable std::mutex experiment_file_writer_settings_mutex;
DiffractionExperiment experiment;
// mutex m is protecting:
mutable std::mutex m;
std::condition_variable c;
// mutex m is protecting:
volatile JFJochState state = JFJochState::Inactive; // state should not be set directly, but through SetState function
volatile bool cancel_sequence = false;
std::unique_ptr<JFCalibration> calibration;
PixelMask pixel_mask;
std::vector<JFModuleGainCalibration> gain_calibration;
std::vector<DetectorSetup> detector_setup;
int64_t current_detector_setup;
std::future<void> measurement;
int64_t current_detector_setup; // Lock only on change
mutable std::mutex calibration_statistics_mutex;
std::vector<JFCalibrationModuleStatistics> calibration_statistics;
@@ -108,6 +118,9 @@ class JFJochStateMachine {
mutable std::mutex roi_mutex;
ROIDefinition roi;
bool indexing_possible;
bool resolution_estimate_possible;
void UpdatePixelMaskStatistics(const PixelMaskStatistics &input);
// Private functions assume that lock m is acquired
@@ -149,6 +162,9 @@ public:
InstrumentMetadata GetInstrumentMetadata() const;
void LoadInstrumentMetadata(const InstrumentMetadata& settings);
FileWriterSettings GetFileWriterSettings() const;
void LoadFileWriterSettings(const FileWriterSettings& settings);
ImageFormatSettings GetImageFormatSettings() const;
void LoadImageFormatSettings(const ImageFormatSettings& settings);
void RawImageFormatSettings();
@@ -164,7 +180,6 @@ public:
void SetSpotFindingSettings(const SpotFindingSettings& settings);
SpotFindingSettings GetSpotFindingSettings() const;
void AddDetectorSetup(const DetectorSetup& setup);
DetectorList GetDetectorsList() const;
void SelectDetector(int64_t id);
std::optional<DetectorStatus> GetDetectorStatus() const;
@@ -172,8 +187,8 @@ public:
void SetRadialIntegrationSettings(const AzimuthalIntegrationSettings& settings);
AzimuthalIntegrationSettings GetRadialIntegrationSettings() const;
std::string GetPreviewJPEG(const PreviewJPEGSettings& settings) const;
std::string GetPreviewTIFF(bool calibration) const;
std::string GetPreviewJPEG(const PreviewJPEGSettings& settings, int64_t image_number) const;
std::string GetPreviewTIFF(int64_t image_number) const;
std::string GetPedestalTIFF(size_t gain_level, size_t sc) const;
void LoadInternalGeneratorImage(const void *data, size_t size, uint64_t image_number);
@@ -209,6 +224,12 @@ public:
ZMQMetadataSettings GetMetadataSocketSettings();
PixelMaskStatistics GetPixelMaskStatistics() const;
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
void GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number = -1);
ImageBufferStatus GetImageBufferStatus() const;
void ClearImageBuffer() const;
void AddDetectorSetup(const DetectorSetup& setup); // Not thread safe, only during setup
};

View File

@@ -19,6 +19,7 @@ SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding
ret.low_resolution_limit = input.getLowResolutionLimit();
ret.enable = input.isEnable();
ret.indexing = input.isIndexing();
ret.resolution_estimate = input.isResolutionEstimate();
ret.indexing_tolerance = input.getIndexingTolerance();
if (input.filterPowderRingsIsSet())
ret.filter_spots_powder_ring = input.isFilterPowderRings();
@@ -40,6 +41,7 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin
ret.setIndexingTolerance(input.indexing_tolerance);
ret.setFilterPowderRings(input.filter_spots_powder_ring);
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
ret.setResolutionEstimate(input.resolution_estimate);
return ret;
}
@@ -61,12 +63,23 @@ org::openapitools::server::model::Measurement_statistics Convert(const Measureme
ret.setCompressionRatio(input.compression_ratio.value());
ret.setCancelled(input.cancelled);
ret.setMaxReceiverDelay(input.max_receive_delay);
if (input.max_receive_delay)
ret.setMaxReceiverDelay(input.max_receive_delay.value());
ret.setDetectorWidth(input.detector_width);
ret.setDetectorHeight(input.detector_height);
ret.setDetectorPixelDepth(input.detector_pixel_depth);
if (input.roi_beam_npixel)
ret.setRoiBeamPixels(input.roi_beam_npixel.value());
if (input.roi_beam_sum)
ret.setRoiBeamSum(input.roi_beam_sum.value());
if (input.error_pixels)
ret.setErrorPixels(input.error_pixels.value());
if (input.saturated_pixels)
ret.setSaturatedPixels(input.saturated_pixels.value());
if (input.indexing_rate)
ret.setIndexingRate(input.indexing_rate.value());
@@ -326,6 +339,22 @@ org::openapitools::server::model::Detector_status Convert(const DetectorStatus &
return output;
}
org::openapitools::server::model::Detector_type Convert(const DetectorType &input) {
org::openapitools::server::model::Detector_type dt;
switch (input) {
case DetectorType::EIGER:
dt.setValue(org::openapitools::server::model::Detector_type::eDetector_type::EIGER);
break;
case DetectorType::JUNGFRAU:
dt.setValue(org::openapitools::server::model::Detector_type::eDetector_type::JUNGFRAU);
break;
case DetectorType::DECTRIS:
dt.setValue(org::openapitools::server::model::Detector_type::eDetector_type::DECTRIS);
break;
}
return dt;
}
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_element> dets;
@@ -342,6 +371,7 @@ org::openapitools::server::model::Detector_list Convert(const DetectorList &inpu
d.setMinFrameTimeUs(input.detector[i].min_frame_time.count());
d.setMinCountTimeUs(input.detector[i].min_count_time.count());
d.setReadoutTimeUs(input.detector[i].readout_time.count());
d.setType(Convert(input.detector[i].detector_type));
dets.emplace_back(std::move(d));
}
ret.setDetectors(dets);
@@ -368,8 +398,7 @@ AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azi
if (input.polarizationFactorIsSet())
ret.PolarizationFactor(input.getPolarizationFactor());
ret.QSpacing_recipA(input.getQSpacing());
ret.LowQ_recipA(input.getLowQRecipA());
ret.HighQ_recipA(input.getHighQRecipA());
ret.QRange_recipA(input.getLowQRecipA(), input.getHighQRecipA());
return ret;
}
@@ -390,6 +419,10 @@ ROIDefinition Convert(const org::openapitools::server::model::Roi_definitions& i
output.boxes.emplace_back(ROIBox(i.getName(), i.getMinXPxl(), i.getMaxXPxl(), i.getMinYPxl(), i.getMaxYPxl()));
for (const auto &i: input.getCircle().getRois())
output.circles.emplace_back(ROICircle(i.getName(), i.getCenterXPxl(), i.getCenterYPxl(), i.getRadiusPxl()));
for (const auto &i: input.getAzim().getRois())
output.azimuthal.emplace_back(ROIAzimuthal(i.getName(),
(i.getQMaxRecipA() == 0.0) ? 0.0 : 2.0f * M_PI / i.getQMaxRecipA(),
(i.getQMinRecipA() == 0.0) ? 0.0 : 2.0f * M_PI / i.getQMinRecipA()));
return output;
}
@@ -408,6 +441,20 @@ org::openapitools::server::model::Roi_circle_list Convert(const std::vector<ROIC
return ret;
}
org::openapitools::server::model::Roi_azim_list Convert(const std::vector<ROIAzimuthal> &input) {
org::openapitools::server::model::Roi_azim_list ret{};
std::vector<org::openapitools::server::model::Roi_azimuthal> tmp;
for (const auto &i: input) {
org::openapitools::server::model::Roi_azimuthal elem;
elem.setName(i.GetName());
elem.setQMinRecipA(i.GetQMin_recipA());
elem.setQMaxRecipA(i.GetQMax_recipA());
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;
@@ -428,19 +475,7 @@ org::openapitools::server::model::Roi_definitions Convert(const ROIDefinition &i
org::openapitools::server::model::Roi_definitions ret{};
ret.setCircle(Convert(input.circles));
ret.setBox(Convert(input.boxes));
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();
ret.setAzim(Convert(input.azimuthal));
return ret;
}
@@ -587,6 +622,8 @@ std::vector<org::openapitools::server::model::Fpga_status_inner> Convert(const s
tmp.setPowerUsageW(static_cast<float>(d.fpga_pcie_12V_I_mA * d.fpga_pcie_12V_V_mV + d.fpga_pcie_3p3V_I_mA
* d.fpga_pcie_3p3V_V_mV) / (1000.0f * 1000.0f));
tmp.setIdle(d.idle);
tmp.setPcieLinkSpeed(d.pcie_link_speed);
tmp.setPcieLinkWidth(d.pcie_link_width);
ret.emplace_back(std::move(tmp));
}
return ret;
@@ -637,3 +674,70 @@ org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskS
ret.setTooHighPedestalRms(input.too_high_pedestal_rms);
return ret;
}
org::openapitools::server::model::Image_buffer_status Convert(const ImageBufferStatus& input) {
org::openapitools::server::model::Image_buffer_status ret;
ret.setAvailableSlots(input.available_slots);
ret.setTotalSlots(input.total_slots);
ret.setImageNumbers(input.images_in_the_buffer);
ret.setMaxImageNumber(input.max_image_number);
ret.setMinImageNumber(input.min_image_number);
return ret;
}
org::openapitools::server::model::File_writer_settings Convert(const FileWriterSettings& input) {
org::openapitools::server::model::File_writer_settings ret;
ret.setFormat(Convert(input.GetHDF5MasterFormatVersion()));
ret.setOverwrite(input.IsOverwriteExistingFiles());
return ret;
}
FileWriterSettings Convert(const org::openapitools::server::model::File_writer_settings &input) {
FileWriterSettings ret;
ret.OverwriteExistingFiles(input.isOverwrite());
ret.HDF5MasterFormatVersion(Convert(input.getFormat()));
return ret;
}
org::openapitools::server::model::File_writer_format Convert(FileWriterFormat input) {
org::openapitools::server::model::File_writer_format ret;
switch (input) {
case FileWriterFormat::DataOnly:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NONE);
break;
case FileWriterFormat::NXmxLegacy:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXLEGACY);
break;
case FileWriterFormat::NXmxVDS:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXVDS);
break;
case FileWriterFormat::CBF:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::CBF);
break;
case FileWriterFormat::TIFF:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::TIFF);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown file writer format enum value");
}
return ret;
}
FileWriterFormat Convert(const org::openapitools::server::model::File_writer_format& input) {
switch (input.getValue()) {
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NONE:
return FileWriterFormat::DataOnly;
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXLEGACY:
return FileWriterFormat::NXmxLegacy;
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXVDS:
return FileWriterFormat::NXmxVDS;
case org::openapitools::server::model::File_writer_format::eFile_writer_format::CBF:
return FileWriterFormat::CBF;
case org::openapitools::server::model::File_writer_format::eFile_writer_format::TIFF:
return FileWriterFormat::TIFF;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Unknown file writer format enum value");
}
}

View File

@@ -17,13 +17,15 @@
#include "gen/model/Azim_int_settings.h"
#include "gen/model/Roi_definitions.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 "gen/model/Pixel_mask_statistics.h"
#include "gen/model/Zeromq_preview_settings.h"
#include "gen/model/Zeromq_metadata_settings.h"
#include "gen/model/File_writer_settings.h"
#include "gen/model/Image_buffer_status.h"
#include "../frame_serialize/JFJochMessages.h"
#include "../common/DatasetSettings.h"
#include "../common/ImageFormatSettings.h"
#include "../image_analysis/SpotFindingSettings.h"
@@ -45,6 +47,10 @@ std::vector<org::openapitools::server::model::Calibration_statistics_inner> Conv
org::openapitools::server::model::Instrument_metadata Convert(const InstrumentMetadata& input);
InstrumentMetadata Convert(const org::openapitools::server::model::Instrument_metadata &input);
org::openapitools::server::model::File_writer_settings Convert(const FileWriterSettings& input);
FileWriterSettings Convert(const org::openapitools::server::model::File_writer_settings &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);
@@ -52,16 +58,18 @@ AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azi
org::openapitools::server::model::Azim_int_settings Convert(const AzimuthalIntegrationSettings& settings);
ROIDefinition Convert(const org::openapitools::server::model::Roi_definitions& input);
org::openapitools::server::model::Roi_definitions Convert(const ROIDefinition &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);
org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input);
org::openapitools::server::model::Image_buffer_status Convert(const ImageBufferStatus& input);
org::openapitools::server::model::Zeromq_preview_settings Convert(const ZMQPreviewSettings& settings);
ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_preview_settings& input);
org::openapitools::server::model::Zeromq_metadata_settings Convert(const ZMQMetadataSettings& settings);
ZMQMetadataSettings Convert(const org::openapitools::server::model::Zeromq_metadata_settings& input);
org::openapitools::server::model::File_writer_format Convert(FileWriterFormat input);
FileWriterFormat Convert(const org::openapitools::server::model::File_writer_format& input);
#endif //JFJOCH_OPENAPICONVERT_H

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -38,6 +38,8 @@ void DefaultApi::setupRoutes() {
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::Get(*router, base + "/config/file_writer", Routes::bind(&DefaultApi::config_file_writer_get_handler, this));
Routes::Put(*router, base + "/config/file_writer", Routes::bind(&DefaultApi::config_file_writer_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));
@@ -65,6 +67,12 @@ void DefaultApi::setupRoutes() {
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 + "/image_buffer/clear", Routes::bind(&DefaultApi::image_buffer_clear_post_handler, this));
Routes::Get(*router, base + "/image_buffer/image.cbor", Routes::bind(&DefaultApi::image_buffer_image_cbor_get_handler, this));
Routes::Get(*router, base + "/image_buffer/image.jpeg", Routes::bind(&DefaultApi::image_buffer_image_jpeg_get_handler, this));
Routes::Get(*router, base + "/image_buffer/image.tiff", Routes::bind(&DefaultApi::image_buffer_image_tiff_get_handler, this));
Routes::Get(*router, base + "/image_buffer/start.cbor", Routes::bind(&DefaultApi::image_buffer_start_cbor_get_handler, this));
Routes::Get(*router, base + "/image_buffer/status", Routes::bind(&DefaultApi::image_buffer_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));
@@ -74,17 +82,19 @@ void DefaultApi::setupRoutes() {
Routes::Get(*router, base + "/plot/indexing_rate", Routes::bind(&DefaultApi::plot_indexing_rate_get_handler, this));
Routes::Get(*router, base + "/plot/indexing_unit_cell_angle", Routes::bind(&DefaultApi::plot_indexing_unit_cell_angle_get_handler, this));
Routes::Get(*router, base + "/plot/indexing_unit_cell", Routes::bind(&DefaultApi::plot_indexing_unit_cell_get_handler, this));
Routes::Get(*router, base + "/plot/max_value", Routes::bind(&DefaultApi::plot_max_value_get_handler, this));
Routes::Get(*router, base + "/plot/packets_received", Routes::bind(&DefaultApi::plot_packets_received_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/resolution_estimate", Routes::bind(&DefaultApi::plot_resolution_estimate_get_handler, this));
Routes::Get(*router, base + "/plot/roi_max_count", Routes::bind(&DefaultApi::plot_roi_max_count_get_handler, this));
Routes::Get(*router, base + "/plot/roi_mean", Routes::bind(&DefaultApi::plot_roi_mean_get_handler, this));
Routes::Get(*router, base + "/plot/roi_sum", Routes::bind(&DefaultApi::plot_roi_sum_get_handler, this));
Routes::Get(*router, base + "/plot/roi_valid_pixels", Routes::bind(&DefaultApi::plot_roi_valid_pixels_get_handler, this));
Routes::Get(*router, base + "/plot/roi_x", Routes::bind(&DefaultApi::plot_roi_x_get_handler, this));
Routes::Get(*router, base + "/plot/roi_y", Routes::bind(&DefaultApi::plot_roi_y_get_handler, this));
Routes::Get(*router, base + "/plot/spot_count", Routes::bind(&DefaultApi::plot_spot_count_get_handler, this));
Routes::Get(*router, base + "/plot/strong_pixel", Routes::bind(&DefaultApi::plot_strong_pixel_get_handler, this));
Routes::Get(*router, base + "/preview/calibration.tiff", Routes::bind(&DefaultApi::preview_calibration_tiff_get_handler, this));
Routes::Get(*router, base + "/preview/image.jpeg", Routes::bind(&DefaultApi::preview_image_jpeg_get_handler, this));
Routes::Post(*router, base + "/preview/image.jpeg", Routes::bind(&DefaultApi::preview_image_jpeg_post_handler, this));
Routes::Get(*router, base + "/preview/image.tiff", Routes::bind(&DefaultApi::preview_image_tiff_get_handler, this));
Routes::Get(*router, base + "/preview/pedestal.tiff", Routes::bind(&DefaultApi::preview_pedestal_tiff_get_handler, this));
Routes::Post(*router, base + "/start", Routes::bind(&DefaultApi::start_post_handler, this));
Routes::Get(*router, base + "/statistics/calibration", Routes::bind(&DefaultApi::statistics_calibration_get_handler, this));
@@ -249,6 +259,56 @@ void DefaultApi::config_detector_put_handler(const Pistache::Rest::Request &requ
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::config_file_writer_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->config_file_writer_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_file_writer_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the body param
File_writer_settings fileWriterSettings;
try {
nlohmann::json::parse(request.body()).get_to(fileWriterSettings);
fileWriterSettings.validate();
} catch (std::exception &e) {
this->handleParsingException(e, response);
return;
}
try {
this->config_file_writer_put(fileWriterSettings, 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_conversion_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
@@ -842,6 +902,206 @@ void DefaultApi::fpga_status_get_handler(const Pistache::Rest::Request &, Pistac
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::image_buffer_clear_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->image_buffer_clear_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::image_buffer_image_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto idQuery = request.query().get("id");
std::optional<int64_t> id;
if(idQuery.has_value()){
int64_t valueQuery_instance;
if(fromStringValue(idQuery.value(), valueQuery_instance)){
id = valueQuery_instance;
}
}
try {
this->image_buffer_image_cbor_get(id, 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::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto idQuery = request.query().get("id");
std::optional<int64_t> id;
if(idQuery.has_value()){
int64_t valueQuery_instance;
if(fromStringValue(idQuery.value(), valueQuery_instance)){
id = valueQuery_instance;
}
}
auto showUserMaskQuery = request.query().get("show_user_mask");
std::optional<bool> showUserMask;
if(showUserMaskQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(showUserMaskQuery.value(), valueQuery_instance)){
showUserMask = valueQuery_instance;
}
}
auto showRoiQuery = request.query().get("show_roi");
std::optional<bool> showRoi;
if(showRoiQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(showRoiQuery.value(), valueQuery_instance)){
showRoi = valueQuery_instance;
}
}
auto showSpotsQuery = request.query().get("show_spots");
std::optional<bool> showSpots;
if(showSpotsQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(showSpotsQuery.value(), valueQuery_instance)){
showSpots = valueQuery_instance;
}
}
auto saturationQuery = request.query().get("saturation");
std::optional<int64_t> saturation;
if(saturationQuery.has_value()){
int64_t valueQuery_instance;
if(fromStringValue(saturationQuery.value(), valueQuery_instance)){
saturation = valueQuery_instance;
}
}
auto jpegQualityQuery = request.query().get("jpeg_quality");
std::optional<int64_t> jpegQuality;
if(jpegQualityQuery.has_value()){
int64_t valueQuery_instance;
if(fromStringValue(jpegQualityQuery.value(), valueQuery_instance)){
jpegQuality = valueQuery_instance;
}
}
auto showResRingQuery = request.query().get("show_res_ring");
std::optional<float> showResRing;
if(showResRingQuery.has_value()){
float valueQuery_instance;
if(fromStringValue(showResRingQuery.value(), valueQuery_instance)){
showResRing = valueQuery_instance;
}
}
auto colorQuery = request.query().get("color");
std::optional<std::string> color;
if(colorQuery.has_value()){
std::string valueQuery_instance;
if(fromStringValue(colorQuery.value(), valueQuery_instance)){
color = valueQuery_instance;
}
}
try {
this->image_buffer_image_jpeg_get(id, showUserMask, showRoi, showSpots, saturation, jpegQuality, showResRing, color, 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::image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto idQuery = request.query().get("id");
std::optional<int64_t> id;
if(idQuery.has_value()){
int64_t valueQuery_instance;
if(fromStringValue(idQuery.value(), valueQuery_instance)){
id = valueQuery_instance;
}
}
try {
this->image_buffer_image_tiff_get(id, 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::image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->image_buffer_start_cbor_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::image_buffer_status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->image_buffer_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;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::initialize_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
@@ -1131,6 +1391,80 @@ void DefaultApi::plot_indexing_unit_cell_get_handler(const Pistache::Rest::Reque
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_max_value_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto binningQuery = request.query().get("binning");
std::optional<int32_t> binning;
if(binningQuery.has_value()){
int32_t valueQuery_instance;
if(fromStringValue(binningQuery.value(), valueQuery_instance)){
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_max_value_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_packets_received_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto binningQuery = request.query().get("binning");
std::optional<int32_t> binning;
if(binningQuery.has_value()){
int32_t valueQuery_instance;
if(fromStringValue(binningQuery.value(), valueQuery_instance)){
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_packets_received_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_receiver_delay_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
@@ -1205,6 +1539,43 @@ void DefaultApi::plot_receiver_free_send_buffers_get_handler(const Pistache::Res
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_resolution_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto binningQuery = request.query().get("binning");
std::optional<int32_t> binning;
if(binningQuery.has_value()){
int32_t valueQuery_instance;
if(fromStringValue(binningQuery.value(), valueQuery_instance)){
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_resolution_estimate_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
@@ -1242,6 +1613,43 @@ void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &r
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_roi_mean_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto binningQuery = request.query().get("binning");
std::optional<int32_t> binning;
if(binningQuery.has_value()){
int32_t valueQuery_instance;
if(fromStringValue(binningQuery.value(), valueQuery_instance)){
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_roi_mean_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_roi_sum_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
@@ -1316,6 +1724,80 @@ void DefaultApi::plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_roi_x_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto binningQuery = request.query().get("binning");
std::optional<int32_t> binning;
if(binningQuery.has_value()){
int32_t valueQuery_instance;
if(fromStringValue(binningQuery.value(), valueQuery_instance)){
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_roi_x_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_roi_y_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the query params
auto binningQuery = request.query().get("binning");
std::optional<int32_t> binning;
if(binningQuery.has_value()){
int32_t valueQuery_instance;
if(fromStringValue(binningQuery.value(), valueQuery_instance)){
binning = valueQuery_instance;
}
}
auto compressionQuery = request.query().get("compression");
std::optional<bool> compression;
if(compressionQuery.has_value()){
bool valueQuery_instance;
if(fromStringValue(compressionQuery.value(), valueQuery_instance)){
compression = valueQuery_instance;
}
}
try {
this->plot_roi_y_get(binning, compression, response);
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
this->handleOperationException(e, response);
return;
}
} catch (std::exception &e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::plot_spot_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
@@ -1390,94 +1872,6 @@ void DefaultApi::plot_strong_pixel_get_handler(const Pistache::Rest::Request &re
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void DefaultApi::preview_calibration_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_calibration_tiff_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::preview_image_jpeg_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_image_jpeg_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::preview_image_jpeg_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {
// Getting the body param
Preview_settings previewSettings;
try {
nlohmann::json::parse(request.body()).get_to(previewSettings);
previewSettings.validate();
} catch (std::exception &e) {
this->handleParsingException(e, response);
return;
}
try {
this->preview_image_jpeg_post(previewSettings, 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::preview_image_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
try {
this->preview_image_tiff_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::preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
try {

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -37,13 +37,14 @@
#include "Detector_settings.h"
#include "Detector_status.h"
#include "Error_message.h"
#include "File_writer_settings.h"
#include "Fpga_status_inner.h"
#include "Image_buffer_status.h"
#include "Image_format_settings.h"
#include "Instrument_metadata.h"
#include "Jfjoch_statistics.h"
#include "Measurement_statistics.h"
#include "Plots.h"
#include "Preview_settings.h"
#include "Roi_definitions.h"
#include "Spot_finding_settings.h"
#include "Zeromq_metadata_settings.h"
@@ -70,6 +71,8 @@ private:
void config_azim_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_file_writer_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_file_writer_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_conversion_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -97,6 +100,12 @@ private:
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void fpga_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_clear_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void image_buffer_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -106,17 +115,19 @@ private:
void plot_indexing_rate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_indexing_unit_cell_angle_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_indexing_unit_cell_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_max_value_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_packets_received_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_resolution_estimate_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);
void plot_roi_mean_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_sum_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_x_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_roi_y_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_spot_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_strong_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_calibration_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_jpeg_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -196,6 +207,21 @@ 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>
/// Get file writer settings
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_file_writer_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Change file writer settings
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
/// <param name="fileWriterSettings"> (optional)</param>
virtual void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Configure format for data collection with full conversion
/// </summary>
/// <remarks>
@@ -257,14 +283,14 @@ private:
/// Get mask of the detector (binary)
/// </summary>
/// <remarks>
/// Get full pixel mask of the detector See NXmx standard for meaning of pixel values
/// Detector must be Initialized. Get full pixel mask of the detector. See NXmx standard for meaning of pixel values.
/// </remarks>
virtual void config_mask_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get mask of the detector (TIFF)
/// </summary>
/// <remarks>
/// Get full pixel mask of the detector See NXmx standard for meaning of pixel values
/// Should be in &#x60;Idle&#x60; state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values
/// </remarks>
virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
@@ -313,7 +339,7 @@ private:
/// <param name="spotFindingSettings"> (optional)</param>
virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get user mask of the detector (binary)
/// Detector must be Initialized. Get user mask of the detector (binary)
/// </summary>
/// <remarks>
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
@@ -327,7 +353,7 @@ private:
/// </remarks>
virtual void config_user_mask_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get user mask of the detector (TIFF)
/// Detector must be Initialized. Get user mask of the detector (TIFF)
/// </summary>
/// <remarks>
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
@@ -392,6 +418,58 @@ private:
/// </remarks>
virtual void fpga_status_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Clear image buffer
/// </summary>
/// <remarks>
/// Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data.
/// </remarks>
virtual void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get image message in CBOR format
/// </summary>
/// <remarks>
/// Contains full image data and metadata. The image must come from the latest data collection.
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
virtual void image_buffer_image_cbor_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get preview image in JPEG format using custom settings
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
/// <param name="showUserMask">Show user mask (optional, default to false)</param>
/// <param name="showRoi">Show ROI areas on the image (optional, default to false)</param>
/// <param name="showSpots">Show spot finding results on the image (optional, default to true)</param>
/// <param name="saturation">Saturation value to set contrast in the preview image (optional, default to 0L)</param>
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to &quot;indigo&quot;)</param>
virtual void image_buffer_image_jpeg_get(const std::optional<int64_t> &id, const std::optional<bool> &showUserMask, const std::optional<bool> &showRoi, const std::optional<bool> &showSpots, const std::optional<int64_t> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get preview image in TIFF format
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
virtual void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Start message in CBOR format
/// </summary>
/// <remarks>
/// Contains metadata for a dataset (e.g., experimental geometry)
/// </remarks>
virtual void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get status of the image buffers
/// </summary>
/// <remarks>
/// Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor.
/// </remarks>
virtual void image_buffer_status_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Initialize detector and data acquisition
/// </summary>
/// <remarks>
@@ -468,6 +546,24 @@ private:
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_indexing_unit_cell_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate maximum pixel value plot
/// </summary>
/// <remarks>
/// Provides maximum viable pixel value (excluding overloads and error pixels); binning is configurable and maximum of a bin is returned
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_max_value_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot with number of received packets per image
/// </summary>
/// <remarks>
/// Number of collected packets per image; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_packets_received_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate receiver delay plot
/// </summary>
/// <remarks>
@@ -486,6 +582,15 @@ private:
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate resolution estimate plot
/// </summary>
/// <remarks>
/// Diffraction resolution, as estimated by SSRL ML model; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_resolution_estimate_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI max count
/// </summary>
/// <remarks>
@@ -495,6 +600,15 @@ private:
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_max_count_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI mean value
/// </summary>
/// <remarks>
/// Mean of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; binning is configurable; number will be wrong if multipixels are included!
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_mean_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate ROI sum plot
/// </summary>
/// <remarks>
@@ -513,6 +627,24 @@ private:
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI weighted X-coordinate
/// </summary>
/// <remarks>
/// Pixel X weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_x_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI weighted Y-coordinate
/// </summary>
/// <remarks>
/// Pixel Y weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable
/// </remarks>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_roi_y_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate spot count plot
/// </summary>
/// <remarks>
@@ -531,35 +663,6 @@ private:
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_strong_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format for calibration with PyFAI/Dioptas
/// </summary>
/// <remarks>
/// Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction
/// </remarks>
virtual void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in JPEG format using default settings
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in JPEG format using custom settings
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="previewSettings"> (optional)</param>
virtual void preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get last preview image in TIFF format
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get pedestal in TIFF format
/// </summary>
/// <remarks>

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -222,7 +222,7 @@ public:
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.
/// 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);

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,7 +22,8 @@ namespace org::openapitools::server::model
Detector::Detector()
{
m_Description = "";
m_Serial_number = "";
m_Serial_number = "Unknown";
m_Serial_numberIsSet = false;
m_TypeIsSet = false;
m_High_voltage_V = 0L;
m_High_voltage_VIsSet = false;
@@ -34,6 +35,10 @@ Detector::Detector()
m_Sensor_thickness_umIsSet = false;
m_Readout_time_us = 0L;
m_Readout_time_usIsSet = false;
m_Minimum_count_time_us = 0L;
m_Minimum_count_time_usIsSet = false;
m_Minimum_frame_time_us = 0L;
m_Minimum_frame_time_usIsSet = false;
m_Calibration_fileIsSet = false;
m_HostnameIsSet = false;
m_Sensor_material = "Si";
@@ -43,6 +48,8 @@ Detector::Detector()
m_Base_data_ipv4_addressIsSet = false;
m_Standard_geometryIsSet = false;
m_Custom_geometryIsSet = false;
m_Roi_mode = "";
m_Roi_modeIsSet = false;
m_Mirror_y = true;
m_Mirror_yIsSet = false;
@@ -82,8 +89,8 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
}
/* Serial_number */ {
if (serialNumberIsSet())
{
const std::string& value = m_Serial_number;
const std::string currentValuePath = _pathPrefix + ".serialNumber";
@@ -162,6 +169,34 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
}
if (minimumCountTimeUsIsSet())
{
const int64_t& value = m_Minimum_count_time_us;
const std::string currentValuePath = _pathPrefix + ".minimumCountTimeUs";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (minimumFrameTimeUsIsSet())
{
const int64_t& value = m_Minimum_frame_time_us;
const std::string currentValuePath = _pathPrefix + ".minimumFrameTimeUs";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
if (calibrationFileIsSet())
{
const std::vector<std::string>& value = m_Calibration_file;
@@ -245,7 +280,7 @@ bool Detector::validate(std::stringstream& msg, const std::string& pathPrefix) c
}
}
return success;
}
@@ -257,8 +292,8 @@ bool Detector::operator==(const Detector& rhs) const
(getDescription() == rhs.getDescription())
&&
(getSerialNumber() == rhs.getSerialNumber())
&&
((!serialNumberIsSet() && !rhs.serialNumberIsSet()) || (serialNumberIsSet() && rhs.serialNumberIsSet() && getSerialNumber() == rhs.getSerialNumber())) &&
((!typeIsSet() && !rhs.typeIsSet()) || (typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType())) &&
@@ -279,6 +314,12 @@ bool Detector::operator==(const Detector& rhs) const
((!readoutTimeUsIsSet() && !rhs.readoutTimeUsIsSet()) || (readoutTimeUsIsSet() && rhs.readoutTimeUsIsSet() && getReadoutTimeUs() == rhs.getReadoutTimeUs())) &&
((!minimumCountTimeUsIsSet() && !rhs.minimumCountTimeUsIsSet()) || (minimumCountTimeUsIsSet() && rhs.minimumCountTimeUsIsSet() && getMinimumCountTimeUs() == rhs.getMinimumCountTimeUs())) &&
((!minimumFrameTimeUsIsSet() && !rhs.minimumFrameTimeUsIsSet()) || (minimumFrameTimeUsIsSet() && rhs.minimumFrameTimeUsIsSet() && getMinimumFrameTimeUs() == rhs.getMinimumFrameTimeUs())) &&
((!calibrationFileIsSet() && !rhs.calibrationFileIsSet()) || (calibrationFileIsSet() && rhs.calibrationFileIsSet() && getCalibrationFile() == rhs.getCalibrationFile())) &&
@@ -300,6 +341,9 @@ bool Detector::operator==(const Detector& rhs) const
((!customGeometryIsSet() && !rhs.customGeometryIsSet()) || (customGeometryIsSet() && rhs.customGeometryIsSet() && getCustomGeometry() == rhs.getCustomGeometry())) &&
((!roiModeIsSet() && !rhs.roiModeIsSet()) || (roiModeIsSet() && rhs.roiModeIsSet() && getRoiMode() == rhs.getRoiMode())) &&
((!mirrorYIsSet() && !rhs.mirrorYIsSet()) || (mirrorYIsSet() && rhs.mirrorYIsSet() && isMirrorY() == rhs.isMirrorY()))
;
@@ -314,7 +358,8 @@ 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.serialNumberIsSet())
j["serial_number"] = o.m_Serial_number;
if(o.typeIsSet())
j["type"] = o.m_Type;
if(o.highVoltageVIsSet())
@@ -327,6 +372,10 @@ void to_json(nlohmann::json& j, const Detector& o)
j["sensor_thickness_um"] = o.m_Sensor_thickness_um;
if(o.readoutTimeUsIsSet())
j["readout_time_us"] = o.m_Readout_time_us;
if(o.minimumCountTimeUsIsSet())
j["minimum_count_time_us"] = o.m_Minimum_count_time_us;
if(o.minimumFrameTimeUsIsSet())
j["minimum_frame_time_us"] = o.m_Minimum_frame_time_us;
if(o.calibrationFileIsSet() || !o.m_Calibration_file.empty())
j["calibration_file"] = o.m_Calibration_file;
if(o.hostnameIsSet() || !o.m_Hostname.empty())
@@ -341,6 +390,8 @@ void to_json(nlohmann::json& j, const Detector& o)
j["standard_geometry"] = o.m_Standard_geometry;
if(o.customGeometryIsSet() || !o.m_Custom_geometry.empty())
j["custom_geometry"] = o.m_Custom_geometry;
if(o.roiModeIsSet())
j["roi_mode"] = o.m_Roi_mode;
if(o.mirrorYIsSet())
j["mirror_y"] = o.m_Mirror_y;
@@ -349,7 +400,11 @@ void to_json(nlohmann::json& j, const Detector& o)
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("serial_number") != j.end())
{
j.at("serial_number").get_to(o.m_Serial_number);
o.m_Serial_numberIsSet = true;
}
if(j.find("type") != j.end())
{
j.at("type").get_to(o.m_Type);
@@ -380,6 +435,16 @@ void from_json(const nlohmann::json& j, Detector& o)
j.at("readout_time_us").get_to(o.m_Readout_time_us);
o.m_Readout_time_usIsSet = true;
}
if(j.find("minimum_count_time_us") != j.end())
{
j.at("minimum_count_time_us").get_to(o.m_Minimum_count_time_us);
o.m_Minimum_count_time_usIsSet = true;
}
if(j.find("minimum_frame_time_us") != j.end())
{
j.at("minimum_frame_time_us").get_to(o.m_Minimum_frame_time_us);
o.m_Minimum_frame_time_usIsSet = true;
}
if(j.find("calibration_file") != j.end())
{
j.at("calibration_file").get_to(o.m_Calibration_file);
@@ -415,6 +480,11 @@ void from_json(const nlohmann::json& j, Detector& o)
j.at("custom_geometry").get_to(o.m_Custom_geometry);
o.m_Custom_geometryIsSet = true;
}
if(j.find("roi_mode") != j.end())
{
j.at("roi_mode").get_to(o.m_Roi_mode);
o.m_Roi_modeIsSet = true;
}
if(j.find("mirror_y") != j.end())
{
j.at("mirror_y").get_to(o.m_Mirror_y);
@@ -438,6 +508,15 @@ std::string Detector::getSerialNumber() const
void Detector::setSerialNumber(std::string const& value)
{
m_Serial_number = value;
m_Serial_numberIsSet = true;
}
bool Detector::serialNumberIsSet() const
{
return m_Serial_numberIsSet;
}
void Detector::unsetSerial_number()
{
m_Serial_numberIsSet = false;
}
org::openapitools::server::model::Detector_type Detector::getType() const
{
@@ -541,6 +620,40 @@ void Detector::unsetReadout_time_us()
{
m_Readout_time_usIsSet = false;
}
int64_t Detector::getMinimumCountTimeUs() const
{
return m_Minimum_count_time_us;
}
void Detector::setMinimumCountTimeUs(int64_t const value)
{
m_Minimum_count_time_us = value;
m_Minimum_count_time_usIsSet = true;
}
bool Detector::minimumCountTimeUsIsSet() const
{
return m_Minimum_count_time_usIsSet;
}
void Detector::unsetMinimum_count_time_us()
{
m_Minimum_count_time_usIsSet = false;
}
int64_t Detector::getMinimumFrameTimeUs() const
{
return m_Minimum_frame_time_us;
}
void Detector::setMinimumFrameTimeUs(int64_t const value)
{
m_Minimum_frame_time_us = value;
m_Minimum_frame_time_usIsSet = true;
}
bool Detector::minimumFrameTimeUsIsSet() const
{
return m_Minimum_frame_time_usIsSet;
}
void Detector::unsetMinimum_frame_time_us()
{
m_Minimum_frame_time_usIsSet = false;
}
std::vector<std::string> Detector::getCalibrationFile() const
{
return m_Calibration_file;
@@ -660,6 +773,23 @@ void Detector::unsetCustom_geometry()
{
m_Custom_geometryIsSet = false;
}
std::string Detector::getRoiMode() const
{
return m_Roi_mode;
}
void Detector::setRoiMode(std::string const& value)
{
m_Roi_mode = value;
m_Roi_modeIsSet = true;
}
bool Detector::roiModeIsSet() const
{
return m_Roi_modeIsSet;
}
void Detector::unsetRoi_mode()
{
m_Roi_modeIsSet = false;
}
bool Detector::isMirrorY() const
{
return m_Mirror_y;

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -72,6 +72,8 @@ public:
/// </summary>
std::string getSerialNumber() const;
void setSerialNumber(std::string const& value);
bool serialNumberIsSet() const;
void unsetSerial_number();
/// <summary>
///
/// </summary>
@@ -115,6 +117,20 @@ public:
bool readoutTimeUsIsSet() const;
void unsetReadout_time_us();
/// <summary>
/// Minimum count time available for the detector.
/// </summary>
int64_t getMinimumCountTimeUs() const;
void setMinimumCountTimeUs(int64_t const value);
bool minimumCountTimeUsIsSet() const;
void unsetMinimum_count_time_us();
/// <summary>
/// Minimum frame time available for the detector.
/// </summary>
int64_t getMinimumFrameTimeUs() const;
void setMinimumFrameTimeUs(int64_t const value);
bool minimumFrameTimeUsIsSet() const;
void unsetMinimum_frame_time_us();
/// <summary>
/// Can be empty for all detectors - default calibration used. For JUNGFRAU: list of gain files, one entry per module. For EIGER: one directory (with detector settings) or list of trim bit files, one entry per half-module.
/// </summary>
std::vector<std::string> getCalibrationFile() const;
@@ -164,6 +180,13 @@ public:
bool customGeometryIsSet() const;
void unsetCustom_geometry();
/// <summary>
/// ROI setting for DECTRIS detectors
/// </summary>
std::string getRoiMode() const;
void setRoiMode(std::string const& value);
bool roiModeIsSet() const;
void unsetRoi_mode();
/// <summary>
/// Mirror detector in Y direction to account for MX convention of (0,0) point in top left corner
/// </summary>
bool isMirrorY() const;
@@ -177,7 +200,7 @@ protected:
std::string m_Description;
std::string m_Serial_number;
bool m_Serial_numberIsSet;
org::openapitools::server::model::Detector_type m_Type;
bool m_TypeIsSet;
int64_t m_High_voltage_V;
@@ -190,6 +213,10 @@ protected:
bool m_Sensor_thickness_umIsSet;
int64_t m_Readout_time_us;
bool m_Readout_time_usIsSet;
int64_t m_Minimum_count_time_us;
bool m_Minimum_count_time_usIsSet;
int64_t m_Minimum_frame_time_us;
bool m_Minimum_frame_time_usIsSet;
std::vector<std::string> m_Calibration_file;
bool m_Calibration_fileIsSet;
std::vector<std::string> m_Hostname;
@@ -204,6 +231,8 @@ protected:
bool m_Standard_geometryIsSet;
std::vector<org::openapitools::server::model::Detector_module> m_Custom_geometry;
bool m_Custom_geometryIsSet;
std::string m_Roi_mode;
bool m_Roi_modeIsSet;
bool m_Mirror_y;
bool m_Mirror_yIsSet;

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,245 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.29
* 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_list_detectors_inner.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
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_Nmodules = 0L;
m_Width = 0L;
m_Height = 0L;
m_Readout_time_us = 0L;
m_Min_frame_time_us = 0L;
m_Min_count_time_us = 0L;
}
void Detector_list_detectors_inner::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Detector_list_detectors_inner::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Detector_list_detectors_inner::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Detector_list_detectors_inner" : pathPrefix;
/* Id */ {
const int64_t& value = m_Id;
const std::string currentValuePath = _pathPrefix + ".id";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
bool Detector_list_detectors_inner::operator==(const Detector_list_detectors_inner& rhs) const
{
return
(getId() == rhs.getId())
&&
(getDescription() == rhs.getDescription())
&&
(getSerialNumber() == rhs.getSerialNumber())
&&
(getBaseIpv4Addr() == rhs.getBaseIpv4Addr())
&&
(getUdpInterfaceCount() == rhs.getUdpInterfaceCount())
&&
(getNmodules() == rhs.getNmodules())
&&
(getWidth() == rhs.getWidth())
&&
(getHeight() == rhs.getHeight())
&&
(getReadoutTimeUs() == rhs.getReadoutTimeUs())
&&
(getMinFrameTimeUs() == rhs.getMinFrameTimeUs())
&&
(getMinCountTimeUs() == rhs.getMinCountTimeUs())
;
}
bool Detector_list_detectors_inner::operator!=(const Detector_list_detectors_inner& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Detector_list_detectors_inner& o)
{
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;
j["udp_interface_count"] = o.m_Udp_interface_count;
j["nmodules"] = o.m_Nmodules;
j["width"] = o.m_Width;
j["height"] = o.m_Height;
j["readout_time_us"] = o.m_Readout_time_us;
j["min_frame_time_us"] = o.m_Min_frame_time_us;
j["min_count_time_us"] = o.m_Min_count_time_us;
}
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);
j.at("udp_interface_count").get_to(o.m_Udp_interface_count);
j.at("nmodules").get_to(o.m_Nmodules);
j.at("width").get_to(o.m_Width);
j.at("height").get_to(o.m_Height);
j.at("readout_time_us").get_to(o.m_Readout_time_us);
j.at("min_frame_time_us").get_to(o.m_Min_frame_time_us);
j.at("min_count_time_us").get_to(o.m_Min_count_time_us);
}
int64_t Detector_list_detectors_inner::getId() const
{
return m_Id;
}
void Detector_list_detectors_inner::setId(int64_t const value)
{
m_Id = value;
}
std::string Detector_list_detectors_inner::getDescription() const
{
return m_Description;
}
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;
}
int64_t Detector_list_detectors_inner::getNmodules() const
{
return m_Nmodules;
}
void Detector_list_detectors_inner::setNmodules(int64_t const value)
{
m_Nmodules = value;
}
int64_t Detector_list_detectors_inner::getWidth() const
{
return m_Width;
}
void Detector_list_detectors_inner::setWidth(int64_t const value)
{
m_Width = value;
}
int64_t Detector_list_detectors_inner::getHeight() const
{
return m_Height;
}
void Detector_list_detectors_inner::setHeight(int64_t const value)
{
m_Height = value;
}
int64_t Detector_list_detectors_inner::getReadoutTimeUs() const
{
return m_Readout_time_us;
}
void Detector_list_detectors_inner::setReadoutTimeUs(int64_t const value)
{
m_Readout_time_us = value;
}
int64_t Detector_list_detectors_inner::getMinFrameTimeUs() const
{
return m_Min_frame_time_us;
}
void Detector_list_detectors_inner::setMinFrameTimeUs(int64_t const value)
{
m_Min_frame_time_us = value;
}
int64_t Detector_list_detectors_inner::getMinCountTimeUs() const
{
return m_Min_count_time_us;
}
void Detector_list_detectors_inner::setMinCountTimeUs(int64_t const value)
{
m_Min_count_time_us = value;
}
} // namespace org::openapitools::server::model

View File

@@ -1,147 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.29
* 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_list_detectors_inner.h
*
*
*/
#ifndef Detector_list_detectors_inner_H_
#define Detector_list_detectors_inner_H_
#include <string>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Detector_list_detectors_inner
{
public:
Detector_list_detectors_inner();
virtual ~Detector_list_detectors_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 Detector_list_detectors_inner& rhs) const;
bool operator!=(const Detector_list_detectors_inner& rhs) const;
/////////////////////////////////////////////
/// Detector_list_detectors_inner members
/// <summary>
///
/// </summary>
int64_t getId() const;
void setId(int64_t const value);
/// <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>
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);
/// <summary>
///
/// </summary>
int64_t getNmodules() const;
void setNmodules(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getWidth() const;
void setWidth(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getHeight() const;
void setHeight(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getReadoutTimeUs() const;
void setReadoutTimeUs(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getMinFrameTimeUs() const;
void setMinFrameTimeUs(int64_t const value);
/// <summary>
///
/// </summary>
int64_t getMinCountTimeUs() const;
void setMinCountTimeUs(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);
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;
int64_t m_Nmodules;
int64_t m_Width;
int64_t m_Height;
int64_t m_Readout_time_us;
int64_t m_Min_frame_time_us;
int64_t m_Min_count_time_us;
};
} // namespace org::openapitools::server::model
#endif /* Detector_list_detectors_inner_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -32,6 +32,7 @@ Detector_list_element::Detector_list_element()
m_Readout_time_us = 0L;
m_Min_frame_time_us = 0L;
m_Min_count_time_us = 0L;
m_TypeIsSet = false;
}
@@ -68,7 +69,7 @@ bool Detector_list_element::validate(std::stringstream& msg, const std::string&
}
}
return success;
}
@@ -108,8 +109,11 @@ bool Detector_list_element::operator==(const Detector_list_element& rhs) const
&&
(getMinCountTimeUs() == rhs.getMinCountTimeUs())
&&
((!typeIsSet() && !rhs.typeIsSet()) || (typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType()))
;
}
@@ -132,6 +136,8 @@ void to_json(nlohmann::json& j, const Detector_list_element& o)
j["readout_time_us"] = o.m_Readout_time_us;
j["min_frame_time_us"] = o.m_Min_frame_time_us;
j["min_count_time_us"] = o.m_Min_count_time_us;
if(o.typeIsSet())
j["type"] = o.m_Type;
}
@@ -148,6 +154,11 @@ void from_json(const nlohmann::json& j, Detector_list_element& o)
j.at("readout_time_us").get_to(o.m_Readout_time_us);
j.at("min_frame_time_us").get_to(o.m_Min_frame_time_us);
j.at("min_count_time_us").get_to(o.m_Min_count_time_us);
if(j.find("type") != j.end())
{
j.at("type").get_to(o.m_Type);
o.m_TypeIsSet = true;
}
}
@@ -239,6 +250,23 @@ void Detector_list_element::setMinCountTimeUs(int64_t const value)
{
m_Min_count_time_us = value;
}
org::openapitools::server::model::Detector_type Detector_list_element::getType() const
{
return m_Type;
}
void Detector_list_element::setType(org::openapitools::server::model::Detector_type const& value)
{
m_Type = value;
m_TypeIsSet = true;
}
bool Detector_list_element::typeIsSet() const
{
return m_TypeIsSet;
}
void Detector_list_element::unsetType()
{
m_TypeIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,6 +19,7 @@
#define Detector_list_element_H_
#include "Detector_type.h"
#include <string>
#include <nlohmann/json.hpp>
@@ -113,6 +114,13 @@ public:
/// </summary>
int64_t getMinCountTimeUs() const;
void setMinCountTimeUs(int64_t 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();
friend void to_json(nlohmann::json& j, const Detector_list_element& o);
friend void from_json(const nlohmann::json& j, Detector_list_element& o);
@@ -139,6 +147,8 @@ protected:
int64_t m_Min_count_time_us;
org::openapitools::server::model::Detector_type m_Type;
bool m_TypeIsSet;
};

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -81,6 +81,9 @@ void to_json(nlohmann::json& j, const Detector_type& o)
case Detector_type::eDetector_type::JUNGFRAU:
j = "JUNGFRAU";
break;
case Detector_type::eDetector_type::DECTRIS:
j = "DECTRIS";
break;
}
}
@@ -93,6 +96,9 @@ void from_json(const nlohmann::json& j, Detector_type& o)
}
else if (s == "JUNGFRAU") {
o.setValue(Detector_type::eDetector_type::JUNGFRAU);
}
else if (s == "DECTRIS") {
o.setValue(Detector_type::eDetector_type::DECTRIS);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -39,7 +39,8 @@ public:
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
EIGER,
JUNGFRAU
JUNGFRAU,
DECTRIS
};
/// <summary>

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,134 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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 "File_writer_format.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
File_writer_format::File_writer_format()
{
}
void File_writer_format::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool File_writer_format::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool File_writer_format::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "File_writer_format" : pathPrefix;
if (m_value == File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool File_writer_format::operator==(const File_writer_format& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool File_writer_format::operator!=(const File_writer_format& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const File_writer_format& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case File_writer_format::eFile_writer_format::NONE:
j = "None";
break;
case File_writer_format::eFile_writer_format::NXMXLEGACY:
j = "NXmxLegacy";
break;
case File_writer_format::eFile_writer_format::NXMXVDS:
j = "NXmxVDS";
break;
case File_writer_format::eFile_writer_format::CBF:
j = "CBF";
break;
case File_writer_format::eFile_writer_format::TIFF:
j = "TIFF";
break;
}
}
void from_json(const nlohmann::json& j, File_writer_format& o)
{
auto s = j.get<std::string>();
if (s == "None") {
o.setValue(File_writer_format::eFile_writer_format::NONE);
}
else if (s == "NXmxLegacy") {
o.setValue(File_writer_format::eFile_writer_format::NXMXLEGACY);
}
else if (s == "NXmxVDS") {
o.setValue(File_writer_format::eFile_writer_format::NXMXVDS);
}
else if (s == "CBF") {
o.setValue(File_writer_format::eFile_writer_format::CBF);
}
else if (s == "TIFF") {
o.setValue(File_writer_format::eFile_writer_format::TIFF);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " File_writer_format::eFile_writer_format";
throw std::invalid_argument(ss.str());
}
}
File_writer_format::eFile_writer_format File_writer_format::getValue() const
{
return m_value;
}
void File_writer_format::setValue(File_writer_format::eFile_writer_format value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,82 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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.
*/
/*
* File_writer_format.h
*
* None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
*/
#ifndef File_writer_format_H_
#define File_writer_format_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
/// </summary>
class File_writer_format
{
public:
File_writer_format();
virtual ~File_writer_format() = default;
enum class eFile_writer_format {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
NONE,
NXMXLEGACY,
NXMXVDS,
CBF,
TIFF
};
/// <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 File_writer_format& rhs) const;
bool operator!=(const File_writer_format& rhs) const;
/////////////////////////////////////////////
/// File_writer_format members
File_writer_format::eFile_writer_format getValue() const;
void setValue(File_writer_format::eFile_writer_format value);
friend void to_json(nlohmann::json& j, const File_writer_format& o);
friend void from_json(const nlohmann::json& j, File_writer_format& o);
protected:
File_writer_format::eFile_writer_format m_value = File_writer_format::eFile_writer_format::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* File_writer_format_H_ */

View File

@@ -0,0 +1,134 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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 "File_writer_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
File_writer_settings::File_writer_settings()
{
m_Overwrite = false;
m_OverwriteIsSet = false;
m_FormatIsSet = false;
}
void File_writer_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool File_writer_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool File_writer_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "File_writer_settings" : pathPrefix;
return success;
}
bool File_writer_settings::operator==(const File_writer_settings& rhs) const
{
return
((!overwriteIsSet() && !rhs.overwriteIsSet()) || (overwriteIsSet() && rhs.overwriteIsSet() && isOverwrite() == rhs.isOverwrite())) &&
((!formatIsSet() && !rhs.formatIsSet()) || (formatIsSet() && rhs.formatIsSet() && getFormat() == rhs.getFormat()))
;
}
bool File_writer_settings::operator!=(const File_writer_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const File_writer_settings& o)
{
j = nlohmann::json::object();
if(o.overwriteIsSet())
j["overwrite"] = o.m_Overwrite;
if(o.formatIsSet())
j["format"] = o.m_Format;
}
void from_json(const nlohmann::json& j, File_writer_settings& o)
{
if(j.find("overwrite") != j.end())
{
j.at("overwrite").get_to(o.m_Overwrite);
o.m_OverwriteIsSet = true;
}
if(j.find("format") != j.end())
{
j.at("format").get_to(o.m_Format);
o.m_FormatIsSet = true;
}
}
bool File_writer_settings::isOverwrite() const
{
return m_Overwrite;
}
void File_writer_settings::setOverwrite(bool const value)
{
m_Overwrite = value;
m_OverwriteIsSet = true;
}
bool File_writer_settings::overwriteIsSet() const
{
return m_OverwriteIsSet;
}
void File_writer_settings::unsetOverwrite()
{
m_OverwriteIsSet = false;
}
org::openapitools::server::model::File_writer_format File_writer_settings::getFormat() const
{
return m_Format;
}
void File_writer_settings::setFormat(org::openapitools::server::model::File_writer_format const& value)
{
m_Format = value;
m_FormatIsSet = true;
}
bool File_writer_settings::formatIsSet() const
{
return m_FormatIsSet;
}
void File_writer_settings::unsetFormat()
{
m_FormatIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,88 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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.
*/
/*
* File_writer_settings.h
*
*
*/
#ifndef File_writer_settings_H_
#define File_writer_settings_H_
#include "File_writer_format.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class File_writer_settings
{
public:
File_writer_settings();
virtual ~File_writer_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 File_writer_settings& rhs) const;
bool operator!=(const File_writer_settings& rhs) const;
/////////////////////////////////////////////
/// File_writer_settings members
/// <summary>
/// Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.
/// </summary>
bool isOverwrite() const;
void setOverwrite(bool const value);
bool overwriteIsSet() const;
void unsetOverwrite();
/// <summary>
///
/// </summary>
org::openapitools::server::model::File_writer_format getFormat() const;
void setFormat(org::openapitools::server::model::File_writer_format const& value);
bool formatIsSet() const;
void unsetFormat();
friend void to_json(nlohmann::json& j, const File_writer_settings& o);
friend void from_json(const nlohmann::json& j, File_writer_settings& o);
protected:
bool m_Overwrite;
bool m_OverwriteIsSet;
org::openapitools::server::model::File_writer_format m_Format;
bool m_FormatIsSet;
};
} // namespace org::openapitools::server::model
#endif /* File_writer_settings_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -33,6 +33,8 @@ Fpga_status_inner::Fpga_status_inner()
m_Packets_udp = 0L;
m_Packets_sls = 0L;
m_Idle = false;
m_Pcie_link_speed = 0L;
m_Pcie_link_width = 0L;
}
@@ -55,7 +57,7 @@ bool Fpga_status_inner::validate(std::stringstream& msg, const std::string& path
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Fpga_status_inner" : pathPrefix;
return success;
}
@@ -98,6 +100,12 @@ bool Fpga_status_inner::operator==(const Fpga_status_inner& rhs) const
&&
(isIdle() == rhs.isIdle())
&&
(getPcieLinkSpeed() == rhs.getPcieLinkSpeed())
&&
(getPcieLinkWidth() == rhs.getPcieLinkWidth())
;
@@ -123,6 +131,8 @@ void to_json(nlohmann::json& j, const Fpga_status_inner& o)
j["packets_udp"] = o.m_Packets_udp;
j["packets_sls"] = o.m_Packets_sls;
j["idle"] = o.m_Idle;
j["pcie_link_speed"] = o.m_Pcie_link_speed;
j["pcie_link_width"] = o.m_Pcie_link_width;
}
@@ -140,6 +150,8 @@ void from_json(const nlohmann::json& j, Fpga_status_inner& o)
j.at("packets_udp").get_to(o.m_Packets_udp);
j.at("packets_sls").get_to(o.m_Packets_sls);
j.at("idle").get_to(o.m_Idle);
j.at("pcie_link_speed").get_to(o.m_Pcie_link_speed);
j.at("pcie_link_width").get_to(o.m_Pcie_link_width);
}
@@ -239,6 +251,22 @@ void Fpga_status_inner::setIdle(bool const value)
{
m_Idle = value;
}
int64_t Fpga_status_inner::getPcieLinkSpeed() const
{
return m_Pcie_link_speed;
}
void Fpga_status_inner::setPcieLinkSpeed(int64_t const value)
{
m_Pcie_link_speed = value;
}
int64_t Fpga_status_inner::getPcieLinkWidth() const
{
return m_Pcie_link_width;
}
void Fpga_status_inner::setPcieLinkWidth(int64_t const value)
{
m_Pcie_link_width = value;
}
} // namespace org::openapitools::server::model

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -118,6 +118,16 @@ public:
/// </summary>
bool isIdle() const;
void setIdle(bool const value);
/// <summary>
/// PCIe link speed measured by generation (expected value is 4 &#x3D;&#x3D; PCIe Gen4)
/// </summary>
int64_t getPcieLinkSpeed() const;
void setPcieLinkSpeed(int64_t const value);
/// <summary>
/// PCIe link width (expected value is 8 &#x3D;&#x3D; x8)
/// </summary>
int64_t getPcieLinkWidth() const;
void setPcieLinkWidth(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);
@@ -146,6 +156,10 @@ protected:
bool m_Idle;
int64_t m_Pcie_link_speed;
int64_t m_Pcie_link_width;
};

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,195 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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_buffer_status.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Image_buffer_status::Image_buffer_status()
{
m_Min_image_number = 0L;
m_Max_image_number = 0L;
m_Total_slots = 0L;
m_Available_slots = 0L;
}
void Image_buffer_status::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Image_buffer_status::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Image_buffer_status::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Image_buffer_status" : pathPrefix;
/* Min_image_number */ {
const int64_t& value = m_Min_image_number;
const std::string currentValuePath = _pathPrefix + ".minImageNumber";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Max_image_number */ {
const int64_t& value = m_Max_image_number;
const std::string currentValuePath = _pathPrefix + ".maxImageNumber";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Image_numbers */ {
const std::vector<int64_t>& value = m_Image_numbers;
const std::string currentValuePath = _pathPrefix + ".imageNumbers";
{ // 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++;
}
}
}
return success;
}
bool Image_buffer_status::operator==(const Image_buffer_status& rhs) const
{
return
(getMinImageNumber() == rhs.getMinImageNumber())
&&
(getMaxImageNumber() == rhs.getMaxImageNumber())
&&
(getImageNumbers() == rhs.getImageNumbers())
&&
(getTotalSlots() == rhs.getTotalSlots())
&&
(getAvailableSlots() == rhs.getAvailableSlots())
;
}
bool Image_buffer_status::operator!=(const Image_buffer_status& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Image_buffer_status& o)
{
j = nlohmann::json::object();
j["min_image_number"] = o.m_Min_image_number;
j["max_image_number"] = o.m_Max_image_number;
j["image_numbers"] = o.m_Image_numbers;
j["total_slots"] = o.m_Total_slots;
j["available_slots"] = o.m_Available_slots;
}
void from_json(const nlohmann::json& j, Image_buffer_status& o)
{
j.at("min_image_number").get_to(o.m_Min_image_number);
j.at("max_image_number").get_to(o.m_Max_image_number);
j.at("image_numbers").get_to(o.m_Image_numbers);
j.at("total_slots").get_to(o.m_Total_slots);
j.at("available_slots").get_to(o.m_Available_slots);
}
int64_t Image_buffer_status::getMinImageNumber() const
{
return m_Min_image_number;
}
void Image_buffer_status::setMinImageNumber(int64_t const value)
{
m_Min_image_number = value;
}
int64_t Image_buffer_status::getMaxImageNumber() const
{
return m_Max_image_number;
}
void Image_buffer_status::setMaxImageNumber(int64_t const value)
{
m_Max_image_number = value;
}
std::vector<int64_t> Image_buffer_status::getImageNumbers() const
{
return m_Image_numbers;
}
void Image_buffer_status::setImageNumbers(std::vector<int64_t> const value)
{
m_Image_numbers = value;
}
int64_t Image_buffer_status::getTotalSlots() const
{
return m_Total_slots;
}
void Image_buffer_status::setTotalSlots(int64_t const value)
{
m_Total_slots = value;
}
int64_t Image_buffer_status::getAvailableSlots() const
{
return m_Available_slots;
}
void Image_buffer_status::setAvailableSlots(int64_t const value)
{
m_Available_slots = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,105 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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_buffer_status.h
*
*
*/
#ifndef Image_buffer_status_H_
#define Image_buffer_status_H_
#include <vector>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Image_buffer_status
{
public:
Image_buffer_status();
virtual ~Image_buffer_status() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Image_buffer_status& rhs) const;
bool operator!=(const Image_buffer_status& rhs) const;
/////////////////////////////////////////////
/// Image_buffer_status members
/// <summary>
/// Smallest image number available in the buffer
/// </summary>
int64_t getMinImageNumber() const;
void setMinImageNumber(int64_t const value);
/// <summary>
/// Largest image number available in the buffer
/// </summary>
int64_t getMaxImageNumber() const;
void setMaxImageNumber(int64_t const value);
/// <summary>
/// Image numbers currently present in the buffer.
/// </summary>
std::vector<int64_t> getImageNumbers() const;
void setImageNumbers(std::vector<int64_t> const value);
/// <summary>
/// Number of slots in the image buffer. This number, compared to number of images in data collection and frame rate will determine \&quot;retention\&quot; rate of the image buffer.
/// </summary>
int64_t getTotalSlots() const;
void setTotalSlots(int64_t const value);
/// <summary>
/// Slots available for the data collection
/// </summary>
int64_t getAvailableSlots() const;
void setAvailableSlots(int64_t const value);
friend void to_json(nlohmann::json& j, const Image_buffer_status& o);
friend void from_json(const nlohmann::json& j, Image_buffer_status& o);
protected:
int64_t m_Min_image_number;
int64_t m_Max_image_number;
std::vector<int64_t> m_Image_numbers;
int64_t m_Total_slots;
int64_t m_Available_slots;
};
} // namespace org::openapitools::server::model
#endif /* Image_buffer_status_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,6 +24,7 @@ Jfjoch_settings::Jfjoch_settings()
m_PcieIsSet = false;
m_ZeromqIsSet = false;
m_InstrumentIsSet = false;
m_File_writerIsSet = false;
m_Detector_settingsIsSet = false;
m_Azim_intIsSet = false;
m_Image_formatIsSet = false;
@@ -34,6 +35,7 @@ Jfjoch_settings::Jfjoch_settings()
m_Numa_policy = "";
m_Numa_policyIsSet = false;
m_Frontend_directory = "";
m_Inference_server_addrIsSet = false;
m_Zeromq_previewIsSet = false;
m_Zeromq_metadataIsSet = false;
@@ -79,7 +81,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
}
}
/* Detector */ {
const std::vector<org::openapitools::server::model::Detector>& value = m_Detector;
@@ -133,7 +135,28 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
}
}
if (inferenceServerAddrIsSet())
{
const std::vector<std::string>& value = m_Inference_server_addr;
const std::string currentValuePath = _pathPrefix + ".inferenceServerAddr";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const std::string& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
return success;
}
@@ -151,6 +174,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
((!instrumentIsSet() && !rhs.instrumentIsSet()) || (instrumentIsSet() && rhs.instrumentIsSet() && getInstrument() == rhs.getInstrument())) &&
((!fileWriterIsSet() && !rhs.fileWriterIsSet()) || (fileWriterIsSet() && rhs.fileWriterIsSet() && getFileWriter() == rhs.getFileWriter())) &&
(getDetector() == rhs.getDetector())
&&
@@ -175,6 +201,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
(getFrontendDirectory() == rhs.getFrontendDirectory())
&&
((!inferenceServerAddrIsSet() && !rhs.inferenceServerAddrIsSet()) || (inferenceServerAddrIsSet() && rhs.inferenceServerAddrIsSet() && getInferenceServerAddr() == rhs.getInferenceServerAddr())) &&
(getImagePusher() == rhs.getImagePusher())
&&
@@ -201,6 +230,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o)
j["zeromq"] = o.m_Zeromq;
if(o.instrumentIsSet())
j["instrument"] = o.m_Instrument;
if(o.fileWriterIsSet())
j["file_writer"] = o.m_File_writer;
j["detector"] = o.m_Detector;
if(o.detectorSettingsIsSet())
j["detector_settings"] = o.m_Detector_settings;
@@ -215,6 +246,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o)
if(o.numaPolicyIsSet())
j["numa_policy"] = o.m_Numa_policy;
j["frontend_directory"] = o.m_Frontend_directory;
if(o.inferenceServerAddrIsSet() || !o.m_Inference_server_addr.empty())
j["inference_server_addr"] = o.m_Inference_server_addr;
j["image_pusher"] = o.m_Image_pusher;
if(o.zeromqPreviewIsSet())
j["zeromq_preview"] = o.m_Zeromq_preview;
@@ -240,6 +273,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
j.at("instrument").get_to(o.m_Instrument);
o.m_InstrumentIsSet = true;
}
if(j.find("file_writer") != j.end())
{
j.at("file_writer").get_to(o.m_File_writer);
o.m_File_writerIsSet = true;
}
j.at("detector").get_to(o.m_Detector);
if(j.find("detector_settings") != j.end())
{
@@ -272,6 +310,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
o.m_Numa_policyIsSet = true;
}
j.at("frontend_directory").get_to(o.m_Frontend_directory);
if(j.find("inference_server_addr") != j.end())
{
j.at("inference_server_addr").get_to(o.m_Inference_server_addr);
o.m_Inference_server_addrIsSet = true;
}
j.at("image_pusher").get_to(o.m_Image_pusher);
if(j.find("zeromq_preview") != j.end())
{
@@ -337,6 +380,23 @@ void Jfjoch_settings::unsetInstrument()
{
m_InstrumentIsSet = false;
}
org::openapitools::server::model::File_writer_settings Jfjoch_settings::getFileWriter() const
{
return m_File_writer;
}
void Jfjoch_settings::setFileWriter(org::openapitools::server::model::File_writer_settings const& value)
{
m_File_writer = value;
m_File_writerIsSet = true;
}
bool Jfjoch_settings::fileWriterIsSet() const
{
return m_File_writerIsSet;
}
void Jfjoch_settings::unsetFile_writer()
{
m_File_writerIsSet = false;
}
std::vector<org::openapitools::server::model::Detector> Jfjoch_settings::getDetector() const
{
return m_Detector;
@@ -455,6 +515,23 @@ void Jfjoch_settings::setFrontendDirectory(std::string const& value)
{
m_Frontend_directory = value;
}
std::vector<std::string> Jfjoch_settings::getInferenceServerAddr() const
{
return m_Inference_server_addr;
}
void Jfjoch_settings::setInferenceServerAddr(std::vector<std::string> const& value)
{
m_Inference_server_addr = value;
m_Inference_server_addrIsSet = true;
}
bool Jfjoch_settings::inferenceServerAddrIsSet() const
{
return m_Inference_server_addrIsSet;
}
void Jfjoch_settings::unsetInference_server_addr()
{
m_Inference_server_addrIsSet = false;
}
org::openapitools::server::model::Image_pusher_type Jfjoch_settings::getImagePusher() const
{
return m_Image_pusher;

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,18 +19,19 @@
#define Jfjoch_settings_H_
#include "Detector.h"
#include "Zeromq_preview_settings.h"
#include "Image_pusher_type.h"
#include "Pcie_devices_inner.h"
#include <string>
#include "Zeromq_settings.h"
#include "File_writer_settings.h"
#include "Azim_int_settings.h"
#include "Image_format_settings.h"
#include "Zeromq_metadata_settings.h"
#include "Detector_settings.h"
#include "Instrument_metadata.h"
#include <vector>
#include "Detector.h"
#include "Image_pusher_type.h"
#include "Zeromq_settings.h"
#include "Instrument_metadata.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
@@ -93,6 +94,13 @@ public:
/// <summary>
///
/// </summary>
org::openapitools::server::model::File_writer_settings getFileWriter() const;
void setFileWriter(org::openapitools::server::model::File_writer_settings const& value);
bool fileWriterIsSet() const;
void unsetFile_writer();
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Detector> getDetector() const;
void setDetector(std::vector<org::openapitools::server::model::Detector> const& value);
/// <summary>
@@ -143,6 +151,13 @@ public:
std::string getFrontendDirectory() const;
void setFrontendDirectory(std::string const& value);
/// <summary>
/// Address to ML-based inference servers
/// </summary>
std::vector<std::string> getInferenceServerAddr() const;
void setInferenceServerAddr(std::vector<std::string> const& value);
bool inferenceServerAddrIsSet() const;
void unsetInference_server_addr();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Image_pusher_type getImagePusher() const;
@@ -171,6 +186,8 @@ protected:
bool m_ZeromqIsSet;
org::openapitools::server::model::Instrument_metadata m_Instrument;
bool m_InstrumentIsSet;
org::openapitools::server::model::File_writer_settings m_File_writer;
bool m_File_writerIsSet;
std::vector<org::openapitools::server::model::Detector> m_Detector;
org::openapitools::server::model::Detector_settings m_Detector_settings;
@@ -187,6 +204,8 @@ protected:
bool m_Numa_policyIsSet;
std::string m_Frontend_directory;
std::vector<std::string> m_Inference_server_addr;
bool m_Inference_server_addrIsSet;
org::openapitools::server::model::Image_pusher_type m_Image_pusher;
org::openapitools::server::model::Zeromq_preview_settings m_Zeromq_preview;

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -26,6 +26,7 @@ Jfjoch_statistics::Jfjoch_statistics()
m_Detector_settingsIsSet = false;
m_Image_format_settingsIsSet = false;
m_Instrument_metadataIsSet = false;
m_File_writer_settingsIsSet = false;
m_Data_processing_settingsIsSet = false;
m_MeasurementIsSet = false;
m_BrokerIsSet = false;
@@ -35,6 +36,8 @@ Jfjoch_statistics::Jfjoch_statistics()
m_Zeromq_metadataIsSet = false;
m_Pixel_maskIsSet = false;
m_RoiIsSet = false;
m_Az_intIsSet = false;
m_BufferIsSet = false;
}
@@ -57,7 +60,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Jfjoch_statistics" : pathPrefix;
if (fpgaIsSet())
{
const std::vector<org::openapitools::server::model::Fpga_status_inner>& value = m_Fpga;
@@ -99,7 +102,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path
}
}
return success;
}
@@ -124,6 +127,9 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const
((!instrumentMetadataIsSet() && !rhs.instrumentMetadataIsSet()) || (instrumentMetadataIsSet() && rhs.instrumentMetadataIsSet() && getInstrumentMetadata() == rhs.getInstrumentMetadata())) &&
((!fileWriterSettingsIsSet() && !rhs.fileWriterSettingsIsSet()) || (fileWriterSettingsIsSet() && rhs.fileWriterSettingsIsSet() && getFileWriterSettings() == rhs.getFileWriterSettings())) &&
((!dataProcessingSettingsIsSet() && !rhs.dataProcessingSettingsIsSet()) || (dataProcessingSettingsIsSet() && rhs.dataProcessingSettingsIsSet() && getDataProcessingSettings() == rhs.getDataProcessingSettings())) &&
@@ -148,7 +154,13 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const
((!pixelMaskIsSet() && !rhs.pixelMaskIsSet()) || (pixelMaskIsSet() && rhs.pixelMaskIsSet() && getPixelMask() == rhs.getPixelMask())) &&
((!roiIsSet() && !rhs.roiIsSet()) || (roiIsSet() && rhs.roiIsSet() && getRoi() == rhs.getRoi()))
((!roiIsSet() && !rhs.roiIsSet()) || (roiIsSet() && rhs.roiIsSet() && getRoi() == rhs.getRoi())) &&
((!azIntIsSet() && !rhs.azIntIsSet()) || (azIntIsSet() && rhs.azIntIsSet() && getAzInt() == rhs.getAzInt())) &&
((!bufferIsSet() && !rhs.bufferIsSet()) || (bufferIsSet() && rhs.bufferIsSet() && getBuffer() == rhs.getBuffer()))
;
}
@@ -171,6 +183,8 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o)
j["image_format_settings"] = o.m_Image_format_settings;
if(o.instrumentMetadataIsSet())
j["instrument_metadata"] = o.m_Instrument_metadata;
if(o.fileWriterSettingsIsSet())
j["file_writer_settings"] = o.m_File_writer_settings;
if(o.dataProcessingSettingsIsSet())
j["data_processing_settings"] = o.m_Data_processing_settings;
if(o.measurementIsSet())
@@ -189,6 +203,10 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o)
j["pixel_mask"] = o.m_Pixel_mask;
if(o.roiIsSet())
j["roi"] = o.m_Roi;
if(o.azIntIsSet())
j["az_int"] = o.m_Az_int;
if(o.bufferIsSet())
j["buffer"] = o.m_Buffer;
}
@@ -219,6 +237,11 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o)
j.at("instrument_metadata").get_to(o.m_Instrument_metadata);
o.m_Instrument_metadataIsSet = true;
}
if(j.find("file_writer_settings") != j.end())
{
j.at("file_writer_settings").get_to(o.m_File_writer_settings);
o.m_File_writer_settingsIsSet = true;
}
if(j.find("data_processing_settings") != j.end())
{
j.at("data_processing_settings").get_to(o.m_Data_processing_settings);
@@ -264,6 +287,16 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o)
j.at("roi").get_to(o.m_Roi);
o.m_RoiIsSet = true;
}
if(j.find("az_int") != j.end())
{
j.at("az_int").get_to(o.m_Az_int);
o.m_Az_intIsSet = true;
}
if(j.find("buffer") != j.end())
{
j.at("buffer").get_to(o.m_Buffer);
o.m_BufferIsSet = true;
}
}
@@ -352,6 +385,23 @@ void Jfjoch_statistics::unsetInstrument_metadata()
{
m_Instrument_metadataIsSet = false;
}
org::openapitools::server::model::File_writer_settings Jfjoch_statistics::getFileWriterSettings() const
{
return m_File_writer_settings;
}
void Jfjoch_statistics::setFileWriterSettings(org::openapitools::server::model::File_writer_settings const& value)
{
m_File_writer_settings = value;
m_File_writer_settingsIsSet = true;
}
bool Jfjoch_statistics::fileWriterSettingsIsSet() const
{
return m_File_writer_settingsIsSet;
}
void Jfjoch_statistics::unsetFile_writer_settings()
{
m_File_writer_settingsIsSet = false;
}
org::openapitools::server::model::Spot_finding_settings Jfjoch_statistics::getDataProcessingSettings() const
{
return m_Data_processing_settings;
@@ -505,6 +555,40 @@ void Jfjoch_statistics::unsetRoi()
{
m_RoiIsSet = false;
}
org::openapitools::server::model::Azim_int_settings Jfjoch_statistics::getAzInt() const
{
return m_Az_int;
}
void Jfjoch_statistics::setAzInt(org::openapitools::server::model::Azim_int_settings const& value)
{
m_Az_int = value;
m_Az_intIsSet = true;
}
bool Jfjoch_statistics::azIntIsSet() const
{
return m_Az_intIsSet;
}
void Jfjoch_statistics::unsetAz_int()
{
m_Az_intIsSet = false;
}
org::openapitools::server::model::Image_buffer_status Jfjoch_statistics::getBuffer() const
{
return m_Buffer;
}
void Jfjoch_statistics::setBuffer(org::openapitools::server::model::Image_buffer_status const& value)
{
m_Buffer = value;
m_BufferIsSet = true;
}
bool Jfjoch_statistics::bufferIsSet() const
{
return m_BufferIsSet;
}
void Jfjoch_statistics::unsetBuffer()
{
m_BufferIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -26,6 +26,8 @@
#include "Spot_finding_settings.h"
#include "Zeromq_preview_settings.h"
#include "Detector_list.h"
#include "File_writer_settings.h"
#include "Azim_int_settings.h"
#include "Image_format_settings.h"
#include "Zeromq_metadata_settings.h"
#include "Detector_settings.h"
@@ -33,6 +35,7 @@
#include "Detector_status.h"
#include "Roi_definitions.h"
#include "Fpga_status_inner.h"
#include "Image_buffer_status.h"
#include "Instrument_metadata.h"
#include <nlohmann/json.hpp>
@@ -110,6 +113,13 @@ public:
/// <summary>
///
/// </summary>
org::openapitools::server::model::File_writer_settings getFileWriterSettings() const;
void setFileWriterSettings(org::openapitools::server::model::File_writer_settings const& value);
bool fileWriterSettingsIsSet() const;
void unsetFile_writer_settings();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Spot_finding_settings getDataProcessingSettings() const;
void setDataProcessingSettings(org::openapitools::server::model::Spot_finding_settings const& value);
bool dataProcessingSettingsIsSet() const;
@@ -170,6 +180,20 @@ public:
void setRoi(org::openapitools::server::model::Roi_definitions const& value);
bool roiIsSet() const;
void unsetRoi();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Azim_int_settings getAzInt() const;
void setAzInt(org::openapitools::server::model::Azim_int_settings const& value);
bool azIntIsSet() const;
void unsetAz_int();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Image_buffer_status getBuffer() const;
void setBuffer(org::openapitools::server::model::Image_buffer_status const& value);
bool bufferIsSet() const;
void unsetBuffer();
friend void to_json(nlohmann::json& j, const Jfjoch_statistics& o);
friend void from_json(const nlohmann::json& j, Jfjoch_statistics& o);
@@ -184,6 +208,8 @@ protected:
bool m_Image_format_settingsIsSet;
org::openapitools::server::model::Instrument_metadata m_Instrument_metadata;
bool m_Instrument_metadataIsSet;
org::openapitools::server::model::File_writer_settings m_File_writer_settings;
bool m_File_writer_settingsIsSet;
org::openapitools::server::model::Spot_finding_settings m_Data_processing_settings;
bool m_Data_processing_settingsIsSet;
org::openapitools::server::model::Measurement_statistics m_Measurement;
@@ -202,6 +228,10 @@ protected:
bool m_Pixel_maskIsSet;
org::openapitools::server::model::Roi_definitions m_Roi;
bool m_RoiIsSet;
org::openapitools::server::model::Azim_int_settings m_Az_int;
bool m_Az_intIsSet;
org::openapitools::server::model::Image_buffer_status m_Buffer;
bool m_BufferIsSet;
};

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -57,6 +57,14 @@ Measurement_statistics::Measurement_statistics()
m_Bkg_estimateIsSet = false;
m_Unit_cell = "";
m_Unit_cellIsSet = false;
m_Error_pixels = 0.0f;
m_Error_pixelsIsSet = false;
m_Saturated_pixels = 0.0f;
m_Saturated_pixelsIsSet = false;
m_Roi_beam_pixels = 0.0f;
m_Roi_beam_pixelsIsSet = false;
m_Roi_beam_sum = 0.0f;
m_Roi_beam_sumIsSet = false;
}
@@ -112,7 +120,7 @@ bool Measurement_statistics::validate(std::stringstream& msg, const std::string&
}
}
return success;
}
@@ -173,7 +181,19 @@ bool Measurement_statistics::operator==(const Measurement_statistics& rhs) const
((!bkgEstimateIsSet() && !rhs.bkgEstimateIsSet()) || (bkgEstimateIsSet() && rhs.bkgEstimateIsSet() && getBkgEstimate() == rhs.getBkgEstimate())) &&
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell()))
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell())) &&
((!errorPixelsIsSet() && !rhs.errorPixelsIsSet()) || (errorPixelsIsSet() && rhs.errorPixelsIsSet() && getErrorPixels() == rhs.getErrorPixels())) &&
((!saturatedPixelsIsSet() && !rhs.saturatedPixelsIsSet()) || (saturatedPixelsIsSet() && rhs.saturatedPixelsIsSet() && getSaturatedPixels() == rhs.getSaturatedPixels())) &&
((!roiBeamPixelsIsSet() && !rhs.roiBeamPixelsIsSet()) || (roiBeamPixelsIsSet() && rhs.roiBeamPixelsIsSet() && getRoiBeamPixels() == rhs.getRoiBeamPixels())) &&
((!roiBeamSumIsSet() && !rhs.roiBeamSumIsSet()) || (roiBeamSumIsSet() && rhs.roiBeamSumIsSet() && getRoiBeamSum() == rhs.getRoiBeamSum()))
;
}
@@ -222,6 +242,14 @@ void to_json(nlohmann::json& j, const Measurement_statistics& o)
j["bkg_estimate"] = o.m_Bkg_estimate;
if(o.unitCellIsSet())
j["unit_cell"] = o.m_Unit_cell;
if(o.errorPixelsIsSet())
j["error_pixels"] = o.m_Error_pixels;
if(o.saturatedPixelsIsSet())
j["saturated_pixels"] = o.m_Saturated_pixels;
if(o.roiBeamPixelsIsSet())
j["roi_beam_pixels"] = o.m_Roi_beam_pixels;
if(o.roiBeamSumIsSet())
j["roi_beam_sum"] = o.m_Roi_beam_sum;
}
@@ -317,6 +345,26 @@ void from_json(const nlohmann::json& j, Measurement_statistics& o)
j.at("unit_cell").get_to(o.m_Unit_cell);
o.m_Unit_cellIsSet = true;
}
if(j.find("error_pixels") != j.end())
{
j.at("error_pixels").get_to(o.m_Error_pixels);
o.m_Error_pixelsIsSet = true;
}
if(j.find("saturated_pixels") != j.end())
{
j.at("saturated_pixels").get_to(o.m_Saturated_pixels);
o.m_Saturated_pixelsIsSet = true;
}
if(j.find("roi_beam_pixels") != j.end())
{
j.at("roi_beam_pixels").get_to(o.m_Roi_beam_pixels);
o.m_Roi_beam_pixelsIsSet = true;
}
if(j.find("roi_beam_sum") != j.end())
{
j.at("roi_beam_sum").get_to(o.m_Roi_beam_sum);
o.m_Roi_beam_sumIsSet = true;
}
}
@@ -626,6 +674,74 @@ void Measurement_statistics::unsetUnit_cell()
{
m_Unit_cellIsSet = false;
}
float Measurement_statistics::getErrorPixels() const
{
return m_Error_pixels;
}
void Measurement_statistics::setErrorPixels(float const value)
{
m_Error_pixels = value;
m_Error_pixelsIsSet = true;
}
bool Measurement_statistics::errorPixelsIsSet() const
{
return m_Error_pixelsIsSet;
}
void Measurement_statistics::unsetError_pixels()
{
m_Error_pixelsIsSet = false;
}
float Measurement_statistics::getSaturatedPixels() const
{
return m_Saturated_pixels;
}
void Measurement_statistics::setSaturatedPixels(float const value)
{
m_Saturated_pixels = value;
m_Saturated_pixelsIsSet = true;
}
bool Measurement_statistics::saturatedPixelsIsSet() const
{
return m_Saturated_pixelsIsSet;
}
void Measurement_statistics::unsetSaturated_pixels()
{
m_Saturated_pixelsIsSet = false;
}
float Measurement_statistics::getRoiBeamPixels() const
{
return m_Roi_beam_pixels;
}
void Measurement_statistics::setRoiBeamPixels(float const value)
{
m_Roi_beam_pixels = value;
m_Roi_beam_pixelsIsSet = true;
}
bool Measurement_statistics::roiBeamPixelsIsSet() const
{
return m_Roi_beam_pixelsIsSet;
}
void Measurement_statistics::unsetRoi_beam_pixels()
{
m_Roi_beam_pixelsIsSet = false;
}
float Measurement_statistics::getRoiBeamSum() const
{
return m_Roi_beam_sum;
}
void Measurement_statistics::setRoiBeamSum(float const value)
{
m_Roi_beam_sum = value;
m_Roi_beam_sumIsSet = true;
}
bool Measurement_statistics::roiBeamSumIsSet() const
{
return m_Roi_beam_sumIsSet;
}
void Measurement_statistics::unsetRoi_beam_sum()
{
m_Roi_beam_sumIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -184,6 +184,34 @@ public:
void setUnitCell(std::string const& value);
bool unitCellIsSet() const;
void unsetUnit_cell();
/// <summary>
/// Moving average of 1000 images counting number of error pixels on the detector
/// </summary>
float getErrorPixels() const;
void setErrorPixels(float const value);
bool errorPixelsIsSet() const;
void unsetError_pixels();
/// <summary>
/// Moving average of 1000 images counting number of saturated pixels on the detector
/// </summary>
float getSaturatedPixels() const;
void setSaturatedPixels(float const value);
bool saturatedPixelsIsSet() const;
void unsetSaturated_pixels();
/// <summary>
/// If there is an ROI defined with name \&quot;beam\&quot;, this number will hold moving average of 1000 images for number of valid pixels within this ROI
/// </summary>
float getRoiBeamPixels() const;
void setRoiBeamPixels(float const value);
bool roiBeamPixelsIsSet() const;
void unsetRoi_beam_pixels();
/// <summary>
/// If there is an ROI defined with name \&quot;beam\&quot;, this number will hold moving average of 1000 images for sum of valid pixels within this ROI
/// </summary>
float getRoiBeamSum() const;
void setRoiBeamSum(float const value);
bool roiBeamSumIsSet() const;
void unsetRoi_beam_sum();
friend void to_json(nlohmann::json& j, const Measurement_statistics& o);
friend void from_json(const nlohmann::json& j, Measurement_statistics& o);
@@ -224,6 +252,14 @@ protected:
bool m_Bkg_estimateIsSet;
std::string m_Unit_cell;
bool m_Unit_cellIsSet;
float m_Error_pixels;
bool m_Error_pixelsIsSet;
float m_Saturated_pixels;
bool m_Saturated_pixelsIsSet;
float m_Roi_beam_pixels;
bool m_Roi_beam_pixelsIsSet;
float m_Roi_beam_sum;
bool m_Roi_beam_sumIsSet;
};

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -1,322 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* 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 "Preview_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Preview_settings::Preview_settings()
{
m_Saturation = 0L;
m_Show_spots = true;
m_Show_spotsIsSet = false;
m_Show_roi = false;
m_Show_roiIsSet = false;
m_Jpeg_quality = 100L;
m_Jpeg_qualityIsSet = false;
m_Show_indexed = false;
m_Show_indexedIsSet = false;
m_Show_user_mask = false;
m_Show_user_maskIsSet = false;
m_Resolution_ring = 0.1f;
m_Resolution_ringIsSet = false;
}
void Preview_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Preview_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Preview_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Preview_settings" : pathPrefix;
/* Saturation */ {
const int64_t& value = m_Saturation;
const std::string currentValuePath = _pathPrefix + ".saturation";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 65535ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 65535;";
}
}
if (jpegQualityIsSet())
{
const int64_t& value = m_Jpeg_quality;
const std::string currentValuePath = _pathPrefix + ".jpegQuality";
if (value < 0ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 100ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 100;";
}
}
if (resolutionRingIsSet())
{
const float& value = m_Resolution_ring;
const std::string currentValuePath = _pathPrefix + ".resolutionRing";
if (value < static_cast<float>(0.1))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.1;";
}
if (value > static_cast<float>(100.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 100.0;";
}
}
return success;
}
bool Preview_settings::operator==(const Preview_settings& rhs) const
{
return
(getSaturation() == rhs.getSaturation())
&&
((!showSpotsIsSet() && !rhs.showSpotsIsSet()) || (showSpotsIsSet() && rhs.showSpotsIsSet() && isShowSpots() == rhs.isShowSpots())) &&
((!showRoiIsSet() && !rhs.showRoiIsSet()) || (showRoiIsSet() && rhs.showRoiIsSet() && isShowRoi() == rhs.isShowRoi())) &&
((!jpegQualityIsSet() && !rhs.jpegQualityIsSet()) || (jpegQualityIsSet() && rhs.jpegQualityIsSet() && getJpegQuality() == rhs.getJpegQuality())) &&
((!showIndexedIsSet() && !rhs.showIndexedIsSet()) || (showIndexedIsSet() && rhs.showIndexedIsSet() && isShowIndexed() == rhs.isShowIndexed())) &&
((!showUserMaskIsSet() && !rhs.showUserMaskIsSet()) || (showUserMaskIsSet() && rhs.showUserMaskIsSet() && isShowUserMask() == rhs.isShowUserMask())) &&
((!resolutionRingIsSet() && !rhs.resolutionRingIsSet()) || (resolutionRingIsSet() && rhs.resolutionRingIsSet() && getResolutionRing() == rhs.getResolutionRing()))
;
}
bool Preview_settings::operator!=(const Preview_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Preview_settings& o)
{
j = nlohmann::json::object();
j["saturation"] = o.m_Saturation;
if(o.showSpotsIsSet())
j["show_spots"] = o.m_Show_spots;
if(o.showRoiIsSet())
j["show_roi"] = o.m_Show_roi;
if(o.jpegQualityIsSet())
j["jpeg_quality"] = o.m_Jpeg_quality;
if(o.showIndexedIsSet())
j["show_indexed"] = o.m_Show_indexed;
if(o.showUserMaskIsSet())
j["show_user_mask"] = o.m_Show_user_mask;
if(o.resolutionRingIsSet())
j["resolution_ring"] = o.m_Resolution_ring;
}
void from_json(const nlohmann::json& j, Preview_settings& o)
{
j.at("saturation").get_to(o.m_Saturation);
if(j.find("show_spots") != j.end())
{
j.at("show_spots").get_to(o.m_Show_spots);
o.m_Show_spotsIsSet = true;
}
if(j.find("show_roi") != j.end())
{
j.at("show_roi").get_to(o.m_Show_roi);
o.m_Show_roiIsSet = true;
}
if(j.find("jpeg_quality") != j.end())
{
j.at("jpeg_quality").get_to(o.m_Jpeg_quality);
o.m_Jpeg_qualityIsSet = true;
}
if(j.find("show_indexed") != j.end())
{
j.at("show_indexed").get_to(o.m_Show_indexed);
o.m_Show_indexedIsSet = true;
}
if(j.find("show_user_mask") != j.end())
{
j.at("show_user_mask").get_to(o.m_Show_user_mask);
o.m_Show_user_maskIsSet = true;
}
if(j.find("resolution_ring") != j.end())
{
j.at("resolution_ring").get_to(o.m_Resolution_ring);
o.m_Resolution_ringIsSet = true;
}
}
int64_t Preview_settings::getSaturation() const
{
return m_Saturation;
}
void Preview_settings::setSaturation(int64_t const value)
{
m_Saturation = value;
}
bool Preview_settings::isShowSpots() const
{
return m_Show_spots;
}
void Preview_settings::setShowSpots(bool const value)
{
m_Show_spots = value;
m_Show_spotsIsSet = true;
}
bool Preview_settings::showSpotsIsSet() const
{
return m_Show_spotsIsSet;
}
void Preview_settings::unsetShow_spots()
{
m_Show_spotsIsSet = false;
}
bool Preview_settings::isShowRoi() const
{
return m_Show_roi;
}
void Preview_settings::setShowRoi(bool const value)
{
m_Show_roi = value;
m_Show_roiIsSet = true;
}
bool Preview_settings::showRoiIsSet() const
{
return m_Show_roiIsSet;
}
void Preview_settings::unsetShow_roi()
{
m_Show_roiIsSet = false;
}
int64_t Preview_settings::getJpegQuality() const
{
return m_Jpeg_quality;
}
void Preview_settings::setJpegQuality(int64_t const value)
{
m_Jpeg_quality = value;
m_Jpeg_qualityIsSet = true;
}
bool Preview_settings::jpegQualityIsSet() const
{
return m_Jpeg_qualityIsSet;
}
void Preview_settings::unsetJpeg_quality()
{
m_Jpeg_qualityIsSet = false;
}
bool Preview_settings::isShowIndexed() const
{
return m_Show_indexed;
}
void Preview_settings::setShowIndexed(bool const value)
{
m_Show_indexed = value;
m_Show_indexedIsSet = true;
}
bool Preview_settings::showIndexedIsSet() const
{
return m_Show_indexedIsSet;
}
void Preview_settings::unsetShow_indexed()
{
m_Show_indexedIsSet = false;
}
bool Preview_settings::isShowUserMask() const
{
return m_Show_user_mask;
}
void Preview_settings::setShowUserMask(bool const value)
{
m_Show_user_mask = value;
m_Show_user_maskIsSet = true;
}
bool Preview_settings::showUserMaskIsSet() const
{
return m_Show_user_maskIsSet;
}
void Preview_settings::unsetShow_user_mask()
{
m_Show_user_maskIsSet = false;
}
float Preview_settings::getResolutionRing() const
{
return m_Resolution_ring;
}
void Preview_settings::setResolutionRing(float const value)
{
m_Resolution_ring = value;
m_Resolution_ringIsSet = true;
}
bool Preview_settings::resolutionRingIsSet() const
{
return m_Resolution_ringIsSet;
}
void Preview_settings::unsetResolution_ring()
{
m_Resolution_ringIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -1,130 +0,0 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* 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.
*/
/*
* Preview_settings.h
*
* Settings for JPEG rendering of preview images
*/
#ifndef Preview_settings_H_
#define Preview_settings_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Settings for JPEG rendering of preview images
/// </summary>
class Preview_settings
{
public:
Preview_settings();
virtual ~Preview_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 Preview_settings& rhs) const;
bool operator!=(const Preview_settings& rhs) const;
/////////////////////////////////////////////
/// Preview_settings members
/// <summary>
/// Saturation value to set contrast in the preview image
/// </summary>
int64_t getSaturation() const;
void setSaturation(int64_t const value);
/// <summary>
/// Show spot finding results on the image
/// </summary>
bool isShowSpots() const;
void setShowSpots(bool const value);
bool showSpotsIsSet() const;
void unsetShow_spots();
/// <summary>
/// Show ROI areas on the image
/// </summary>
bool isShowRoi() const;
void setShowRoi(bool const value);
bool showRoiIsSet() const;
void unsetShow_roi();
/// <summary>
/// Quality of JPEG image (100 - highest; 0 - lowest)
/// </summary>
int64_t getJpegQuality() const;
void setJpegQuality(int64_t const value);
bool jpegQualityIsSet() const;
void unsetJpeg_quality();
/// <summary>
/// Preview indexed images only
/// </summary>
bool isShowIndexed() const;
void setShowIndexed(bool const value);
bool showIndexedIsSet() const;
void unsetShow_indexed();
/// <summary>
/// Show user mask
/// </summary>
bool isShowUserMask() const;
void setShowUserMask(bool const value);
bool showUserMaskIsSet() const;
void unsetShow_user_mask();
/// <summary>
///
/// </summary>
float getResolutionRing() const;
void setResolutionRing(float const value);
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);
protected:
int64_t m_Saturation;
bool m_Show_spots;
bool m_Show_spotsIsSet;
bool m_Show_roi;
bool m_Show_roiIsSet;
int64_t m_Jpeg_quality;
bool m_Jpeg_qualityIsSet;
bool m_Show_indexed;
bool m_Show_indexedIsSet;
bool m_Show_user_mask;
bool m_Show_user_maskIsSet;
float m_Resolution_ring;
bool m_Resolution_ringIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Preview_settings_H_ */

View File

@@ -0,0 +1,131 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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 "Roi_azim_list.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Roi_azim_list::Roi_azim_list()
{
m_RoisIsSet = false;
}
void Roi_azim_list::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Roi_azim_list::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Roi_azim_list::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Roi_azim_list" : pathPrefix;
if (roisIsSet())
{
const std::vector<org::openapitools::server::model::Roi_azimuthal>& value = m_Rois;
const std::string currentValuePath = _pathPrefix + ".rois";
if (value.size() > 12)
{
success = false;
msg << currentValuePath << ": must have at most 12 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Roi_azimuthal& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".rois") && success;
i++;
}
}
}
return success;
}
bool Roi_azim_list::operator==(const Roi_azim_list& rhs) const
{
return
((!roisIsSet() && !rhs.roisIsSet()) || (roisIsSet() && rhs.roisIsSet() && getRois() == rhs.getRois()))
;
}
bool Roi_azim_list::operator!=(const Roi_azim_list& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Roi_azim_list& o)
{
j = nlohmann::json::object();
if(o.roisIsSet() || !o.m_Rois.empty())
j["rois"] = o.m_Rois;
}
void from_json(const nlohmann::json& j, Roi_azim_list& o)
{
if(j.find("rois") != j.end())
{
j.at("rois").get_to(o.m_Rois);
o.m_RoisIsSet = true;
}
}
std::vector<org::openapitools::server::model::Roi_azimuthal> Roi_azim_list::getRois() const
{
return m_Rois;
}
void Roi_azim_list::setRois(std::vector<org::openapitools::server::model::Roi_azimuthal> const& value)
{
m_Rois = value;
m_RoisIsSet = true;
}
bool Roi_azim_list::roisIsSet() const
{
return m_RoisIsSet;
}
void Roi_azim_list::unsetRois()
{
m_RoisIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,80 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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.
*/
/*
* Roi_azim_list.h
*
* List of azimuthal ROIs
*/
#ifndef Roi_azim_list_H_
#define Roi_azim_list_H_
#include "Roi_azimuthal.h"
#include <vector>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// List of azimuthal ROIs
/// </summary>
class Roi_azim_list
{
public:
Roi_azim_list();
virtual ~Roi_azim_list() = 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 Roi_azim_list& rhs) const;
bool operator!=(const Roi_azim_list& rhs) const;
/////////////////////////////////////////////
/// Roi_azim_list members
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Roi_azimuthal> getRois() const;
void setRois(std::vector<org::openapitools::server::model::Roi_azimuthal> const& value);
bool roisIsSet() const;
void unsetRois();
friend void to_json(nlohmann::json& j, const Roi_azim_list& o);
friend void from_json(const nlohmann::json& j, Roi_azim_list& o);
protected:
std::vector<org::openapitools::server::model::Roi_azimuthal> m_Rois;
bool m_RoisIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Roi_azim_list_H_ */

View File

@@ -0,0 +1,161 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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 "Roi_azimuthal.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Roi_azimuthal::Roi_azimuthal()
{
m_Name = "";
m_Q_min_recipA = 0.0f;
m_Q_max_recipA = 0.0f;
}
void Roi_azimuthal::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Roi_azimuthal::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Roi_azimuthal::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Roi_azimuthal" : pathPrefix;
/* Name */ {
const std::string& value = m_Name;
const std::string currentValuePath = _pathPrefix + ".name";
if (value.length() < 1)
{
success = false;
msg << currentValuePath << ": must be at least 1 characters long;";
}
}
/* Q_min_recipA */ {
const float& value = m_Q_min_recipA;
const std::string currentValuePath = _pathPrefix + ".qMinRecipA";
if (value < static_cast<float>(0.000010))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.000010;";
}
}
/* Q_max_recipA */ {
const float& value = m_Q_max_recipA;
const std::string currentValuePath = _pathPrefix + ".qMaxRecipA";
if (value < static_cast<float>(0.000010))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.000010;";
}
}
return success;
}
bool Roi_azimuthal::operator==(const Roi_azimuthal& rhs) const
{
return
(getName() == rhs.getName())
&&
(getQMinRecipA() == rhs.getQMinRecipA())
&&
(getQMaxRecipA() == rhs.getQMaxRecipA())
;
}
bool Roi_azimuthal::operator!=(const Roi_azimuthal& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Roi_azimuthal& o)
{
j = nlohmann::json::object();
j["name"] = o.m_Name;
j["q_min_recipA"] = o.m_Q_min_recipA;
j["q_max_recipA"] = o.m_Q_max_recipA;
}
void from_json(const nlohmann::json& j, Roi_azimuthal& o)
{
j.at("name").get_to(o.m_Name);
j.at("q_min_recipA").get_to(o.m_Q_min_recipA);
j.at("q_max_recipA").get_to(o.m_Q_max_recipA);
}
std::string Roi_azimuthal::getName() const
{
return m_Name;
}
void Roi_azimuthal::setName(std::string const& value)
{
m_Name = value;
}
float Roi_azimuthal::getQMinRecipA() const
{
return m_Q_min_recipA;
}
void Roi_azimuthal::setQMinRecipA(float const value)
{
m_Q_min_recipA = value;
}
float Roi_azimuthal::getQMaxRecipA() const
{
return m_Q_max_recipA;
}
void Roi_azimuthal::setQMaxRecipA(float const value)
{
m_Q_max_recipA = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,91 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.39
* 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.
*/
/*
* Roi_azimuthal.h
*
* ROI as Q-range (or resolution range)
*/
#ifndef Roi_azimuthal_H_
#define Roi_azimuthal_H_
#include <string>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// ROI as Q-range (or resolution range)
/// </summary>
class Roi_azimuthal
{
public:
Roi_azimuthal();
virtual ~Roi_azimuthal() = 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 Roi_azimuthal& rhs) const;
bool operator!=(const Roi_azimuthal& rhs) const;
/////////////////////////////////////////////
/// Roi_azimuthal members
/// <summary>
/// Name for the ROI; used in the plots
/// </summary>
std::string getName() const;
void setName(std::string const& value);
/// <summary>
/// Minimum Q-range for the ROI
/// </summary>
float getQMinRecipA() const;
void setQMinRecipA(float const value);
/// <summary>
/// Maximum Q-range for the ROI
/// </summary>
float getQMaxRecipA() const;
void setQMaxRecipA(float const value);
friend void to_json(nlohmann::json& j, const Roi_azimuthal& o);
friend void from_json(const nlohmann::json& j, Roi_azimuthal& o);
protected:
std::string m_Name;
float m_Q_min_recipA;
float m_Q_max_recipA;
};
} // namespace org::openapitools::server::model
#endif /* Roi_azimuthal_H_ */

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -51,10 +51,10 @@ bool Roi_box_list::validate(std::stringstream& msg, const std::string& pathPrefi
const std::string currentValuePath = _pathPrefix + ".rois";
if (value.size() > 32)
if (value.size() > 12)
{
success = false;
msg << currentValuePath << ": must have at most 32 elements;";
msg << currentValuePath << ": must have at most 12 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -2,7 +2,7 @@
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.30
* The version of the OpenAPI document: 1.0.0-rc.39
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

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