Compare commits

..

22 Commits

Author SHA1 Message Date
50fd15c678 Merge branch '2506-raster-scan-result' into 'main'
v1.0.0-rc.43

See merge request jungfraujoch/nextgendcu!127
2025-06-13 16:00:50 +02:00
80251cc5b8 v1.0.0-rc.43 2025-06-13 16:00:50 +02:00
32c9e6926e Merge branch '2506-Isigma' into 'main'
v1.0.0-rc.42

See merge request jungfraujoch/nextgendcu!126
2025-06-11 19:53:33 +02:00
a9c7d23b9e v1.0.0-rc.42 2025-06-11 19:53:33 +02:00
dc90b05512 Merge branch '2506-Bragg-prediction' into 'main'
v1.0.0-rc.41

See merge request jungfraujoch/nextgendcu!125
2025-06-10 18:14:04 +02:00
41a3e671f4 v1.0.0-rc.41 2025-06-10 18:14:04 +02:00
72cdbd04a5 Merge branch '2405-grid-scan' into 'main'
v1.0.0-rc.40

See merge request jungfraujoch/nextgendcu!124
2025-05-28 18:49:27 +02:00
53c90ee5d8 v1.0.0-rc.40 2025-05-28 18:49:27 +02:00
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
533 changed files with 37429 additions and 21585 deletions

View File

@@ -322,6 +322,7 @@ synthesis:100g:
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^100G/
tags:
- vivado
artifacts:
@@ -348,6 +349,7 @@ synthesis:8x10g:
allow_failure: true
rules:
- if: $CI_COMMIT_MESSAGE =~ /^FPGA/
- if: $CI_COMMIT_MESSAGE =~ /^8x10G/
tags:
- vivado
artifacts:
@@ -378,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

@@ -16,6 +16,7 @@ SET(JFJOCH_INSTALL_DRIVER_SOURCE OFF CACHE BOOL "Install kernel driver source (i
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)
@@ -56,6 +57,7 @@ SET(JFJOCH_CUDA_AVAILABLE OFF)
IF (CMAKE_CUDA_COMPILER)
IF (JFJOCH_USE_CUDA)
ENABLE_LANGUAGE(CUDA)
FIND_PACKAGE(CUDAToolkit REQUIRED)
MESSAGE(STATUS "CUDA VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA)
FIND_LIBRARY(CUDART_LIBRARY cudart_static PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
@@ -125,6 +127,8 @@ 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")
@@ -137,7 +141,6 @@ ELSE()
ADD_SUBDIRECTORY(image_analysis)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(preview)
ENDIF()
IF (JFJOCH_VIEWER_BUILD)
@@ -179,13 +182,14 @@ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Initialize CPACK_COMPONENTS_ALL with common components
SET(CPACK_COMPONENTS_ALL jfjoch writer)
SET(CPACK_PACKAGE_NAME "jfjoch")
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src /usr/share /usr/share/dbus-1 /usr/share/dbus-1/services)
IF (JFJOCH_INSTALL_DRIVER_SOURCE)
LIST(APPEND CPACK_COMPONENTS_ALL driver-dkms)
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed")
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch")
SET(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh)
SET(CPACK_RPM_DRIVER-DKMS_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh)
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src)
ELSE()
SET(CPACK_COMPONENTS_ALL jfjoch writer)
ENDIF()

View File

@@ -1 +1 @@
1.0.0-rc.34
1.0.0-rc.43

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;

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);

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);
@@ -172,8 +175,7 @@ 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, const std::vector<uint16_t>& roi_map) {
if (roi_map.size() != experiment.GetDetectorSetup().GetGeometry().GetWidth() *
experiment.GetDetectorSetup().GetGeometry().GetHeight())
if (roi_map.size() != experiment.GetXPixelsNumConv() * experiment.GetYPixelsNumConv())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Mismatch in array size");
std::vector<uint16_t> tmp(RAW_MODULE_SIZE);
@@ -195,23 +197,42 @@ void AcquisitionDevice::InitializeEmptyPixelMask(const DiffractionExperiment &ex
void AcquisitionDevice::InitializeDataProcessing(const DiffractionExperiment &experiment,
const RawGeomAzimuthalIntegration &azint) {
const AzimuthalIntegration &azint) {
auto offset = experiment.GetFirstModuleOfDataStream(data_stream);
size_t modules = experiment.GetModulesNum(data_stream);
for (int m = 0; m < modules; m++) {
InitializeSpotFinderResolutionMap(azint.Resolution().data() + (m + offset) * RAW_MODULE_SIZE,
m);
InitializeIntegrationMap(azint.GetPixelToBin().data() + (m + offset) * RAW_MODULE_SIZE,
azint.Corrections().data() + (m + offset) * RAW_MODULE_SIZE,
m);
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) {
@@ -314,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,7 +21,7 @@
#include "Completion.h"
#include "../fpga/pcie_driver/jfjoch_fpga.h"
#include "../common/NetworkAddressConvert.h"
#include "../common/RawGeomAzimuthalIntegration.h"
#include "../common/AzimuthalIntegration.h"
struct AcquisitionDeviceStatistics {
uint64_t good_packets;
@@ -98,10 +98,10 @@ public:
virtual void InitializeSpotFinderResolutionMap(const float *data, size_t module_number);
virtual void InitializeROIMap(const uint16_t *map, size_t module_number);
void InitializeEmptyPixelMask(const DiffractionExperiment &experiment); // Empty Mask
void InitializePixelMask(const DiffractionExperiment &experiment, const PixelMask &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, const std::vector<uint16_t>& raw_roi_map);
void InitializeDataProcessing(const DiffractionExperiment &experiment, const RawGeomAzimuthalIntegration& azint);
void InitializeDataProcessing(const DiffractionExperiment &experiment, const AzimuthalIntegration& azint);
const AcquisitionCounters& Counters() const;

View File

@@ -140,11 +140,6 @@ void JFJochBrokerHttp::config_spot_finding_put(
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::plot_azim_int_get(const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::AzInt, 0, compression, response);
}
void JFJochBrokerHttp::statistics_calibration_get(Pistache::Http::ResponseWriter &response) {
nlohmann::json j;
for (const auto &d: Convert(state_machine.GetCalibrationStatistics()))
@@ -227,39 +222,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) {
@@ -330,111 +292,6 @@ void JFJochBrokerHttp::preview_pedestal_tiff_get(const std::optional<int32_t> &g
response.send(Pistache::Http::Code::Not_Found);
}
void JFJochBrokerHttp::GenericPlot(PlotType plot_type, const std::optional<int32_t> &binning,
const std::optional<bool>& in_compression,
Pistache::Http::ResponseWriter &response) {
bool compression = !in_compression.has_value() || in_compression.value();
PlotRequest req{.type = plot_type, .binning = 0};
if (binning) {
if (binning.value() < 0)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Binning must be positive number or zero");
req.binning = binning.value();
}
auto plot = state_machine.GetPlots(req);
ProcessOutput(Convert(plot), response, compression);
}
void JFJochBrokerHttp::plot_bkg_estimate_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::BkgEstimate, binning, compression, response);
}
void JFJochBrokerHttp::plot_error_pixel_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ErrorPixels, binning, compression, response);
}
void JFJochBrokerHttp::plot_image_collection_efficiency_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ImageCollectionEfficiency, binning, compression, response);
}
void JFJochBrokerHttp::plot_indexing_rate_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::IndexingRate, binning, compression, response);
}
void JFJochBrokerHttp::plot_indexing_unit_cell_get(const std::optional<int32_t> &binning,
const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::IndexingUnitCellLength, binning, compression, response);
}
void JFJochBrokerHttp::plot_indexing_unit_cell_angle_get(const std::optional<int32_t> &binning,
const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) {
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) {
GenericPlot(PlotType::ReceiverDelay, binning, compression, response);
}
void JFJochBrokerHttp::plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ReceiverFreeSendBuf, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_max_count_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIMaxCount, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_sum_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROISum, binning, compression, response);
}
void JFJochBrokerHttp::plot_roi_valid_pixels_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::ROIPixels, binning, compression, response);
}
void JFJochBrokerHttp::plot_spot_count_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
GenericPlot(PlotType::SpotCount, binning, compression, response);
}
void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) {
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"));
@@ -553,6 +410,8 @@ void JFJochBrokerHttp::statistics_get(const std::optional<bool> &compression, Pi
statistics.setRoi(Convert(state_machine.GetROIDefintion()));
statistics.setFileWriterSettings(Convert(state_machine.GetFileWriterSettings()));
statistics.setAzInt(Convert(state_machine.GetRadialIntegrationSettings()));
statistics.setBuffer(Convert(state_machine.GetImageBufferStatus()));
statistics.setIndexing(Convert(state_machine.GetIndexingSettings()));
auto zeromq_prev = state_machine.GetPreviewSocketSettings();
if (!zeromq_prev.address.empty())
@@ -609,6 +468,46 @@ void JFJochBrokerHttp::image_buffer_image_cbor_get(const std::optional<int64_t>
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<float> &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 = ConvertColorScale(color);
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);
@@ -636,17 +535,50 @@ void JFJochBrokerHttp::config_file_writer_put(
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::preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
const std::optional<bool> &compression, const std::optional<bool> &experimentalCoord,
const std::optional<std::string> &azintUnit, Pistache::Http::ResponseWriter &response) {
PlotAzintUnit unit = PlotAzintUnit::Q_recipA;
if (azintUnit.has_value()) {
if (azintUnit == "Q_recipA" || azintUnit == "q_recipa")
unit = PlotAzintUnit::Q_recipA;
else if (azintUnit == "d_A" || azintUnit == "d_a")
unit = PlotAzintUnit::D_A;
else if (azintUnit == "two_theta_deg")
unit = PlotAzintUnit::TwoTheta_deg;
}
PlotRequest req{
.type = ConvertPlotType(type),
.binning = 0,
.experimental_coord = experimentalCoord.value_or(false),
.azint_unit = unit
};
if (binning) {
if (binning.value() < 0)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Binning must be positive number or zero");
req.binning = binning.value();
}
auto plot = state_machine.GetPlots(req);
ProcessOutput(Convert(plot), response, compression.value_or(false));
}
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::config_indexing_get(Pistache::Http::ResponseWriter &response) {
ProcessOutput(Convert(state_machine.GetIndexingSettings()), 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);
void JFJochBrokerHttp::config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings,
Pistache::Http::ResponseWriter &response) {
state_machine.SetIndexingSettings(Convert(indexingSettings));
response.send(Pistache::Http::Code::Ok);
}
void JFJochBrokerHttp::result_grid_scan_get(Pistache::Http::ResponseWriter &response) {
auto ret = state_machine.GetGridScanResult();
if (ret.has_value())
ProcessOutput(Convert(ret.value()), response, true);
else
response.send(Pistache::Http::Code::Not_Found);
}

View File

@@ -37,7 +37,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_azim_int_get(Pistache::Http::ResponseWriter &response) override;
void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &radIntSettings,
Pistache::Http::ResponseWriter &response) override;
Pistache::Http::ResponseWriter &response) override;
void config_select_detector_get(Pistache::Http::ResponseWriter &response) override;
@@ -51,37 +51,6 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings,
Pistache::Http::ResponseWriter &response) override;
void GenericPlot(PlotType plot_type,
const std::optional<int32_t> &binning,
const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response);
void plot_bkg_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,
Pistache::Http::ResponseWriter &response) override;
void plot_indexing_rate_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_receiver_delay_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_max_count_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_sum_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_roi_valid_pixels_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
Pistache::Http::ResponseWriter &response) override;
void plot_spot_count_get(const std::optional<int32_t> &binning, const std::optional<bool>& compression,
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;
void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) override;
@@ -101,20 +70,13 @@ 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;
Pistache::Http::ResponseWriter &response) override;
void config_internal_generator_image_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
@@ -127,7 +89,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_tiff_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
Pistache::Http::ResponseWriter &response) override;
void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
@@ -171,36 +133,46 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) override;
void config_zeromq_metadata_put(
const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings,
Pistache::Http::ResponseWriter &response) override;
const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings,
Pistache::Http::ResponseWriter &response) override;
void config_mask_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_get(Pistache::Http::ResponseWriter &response) override;
void config_user_mask_put(const Pistache::Rest::Request &request,
Pistache::Http::ResponseWriter &response) override;
void plot_indexing_unit_cell_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression,
Pistache::Http::ResponseWriter &response) override;
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;
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> &imageNumber,
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<float> &saturation,
const std::optional<int64_t> &jpegQuality,
const std::optional<float> &showResRing,
const std::optional<std::string> &color,
Pistache::Http::ResponseWriter &response) override;
void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) override;
void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) override;
void image_buffer_status_get(Pistache::Http::ResponseWriter &response) override;
void 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;
void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning,
const std::optional<bool> &compression, const std::optional<bool> &experimentalCoord,
const std::optional<std::string> &azintUnit, Pistache::Http::ResponseWriter &response) override;
void config_indexing_get(Pistache::Http::ResponseWriter &response) override;
void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings,
Pistache::Http::ResponseWriter &response) override;
void result_grid_scan_get(Pistache::Http::ResponseWriter &response) override;
public:
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
void AddDetectorSetup(const DetectorSetup &setup);

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;
}
@@ -119,6 +157,9 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s
if (j.imageFormatIsSet())
experiment.ImportImageFormatSettings(Convert(j.getImageFormat()));
if (j.indexingIsSet())
experiment.ImportIndexingSettings(Convert(j.getIndexing()));
}
std::unique_ptr<ImagePusher> ParseZMQImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) {

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) {}
@@ -34,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");
}
}
@@ -58,7 +65,7 @@ JFJochServicesOutput JFJochServices::Stop() {
if (receiver != nullptr) {
try {
if (detector) {
logger.Info("Wait for detector done");
logger.Info("Wait for detector idle");
DetectorState state = detector->GetState();
while ((!cannot_stop_detector)
&& ((state == DetectorState::WAITING) || (state == DetectorState::BUSY))) {
@@ -67,6 +74,7 @@ JFJochServicesOutput JFJochServices::Stop() {
state = detector->GetState();
}
if (state == DetectorState::IDLE) {
logger.Info(" ... detector idle");
receiver->Cancel(true); // cancel silently
} else {
logger.Error(" ... detector in error state");
@@ -77,15 +85,10 @@ JFJochServicesOutput JFJochServices::Stop() {
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++) {
@@ -148,12 +151,7 @@ std::optional<float> JFJochServices::GetReceiverProgress() const {
MultiLinePlot JFJochServices::GetPlots(const PlotRequest &request) {
if (receiver == nullptr)
return {};
try {
return receiver->GetDataProcessingPlot(request);
} catch (...) {
return {};
}
return receiver->GetDataProcessingPlot(request);
}
void JFJochServices::SetSpotFindingSettings(const SpotFindingSettings &settings) {
@@ -173,16 +171,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 "";
}
@@ -243,9 +241,10 @@ void JFJochServices::GetStartMessageFromBuffer(std::vector<uint8_t> &v) {
return receiver->GetStartMessageFromBuffer(v);
}
void JFJochServices::GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number) {
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 {
@@ -258,3 +257,8 @@ void JFJochServices::ClearImageBuffer() const {
if (receiver)
receiver->ClearImageBuffer();
}
void JFJochServices::LoadDetectorPixelMask(PixelMask &mask) {
if (detector)
detector->LoadPixelMask(mask);
}

View File

@@ -22,7 +22,7 @@ class JFJochServices {
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,
@@ -44,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;
@@ -59,9 +59,11 @@ public:
ZMQMetadataSettings GetMetadataSocketSettings();
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
void GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number = -1);
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),
@@ -13,7 +14,14 @@ JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_l
pixel_mask(experiment),
current_detector_setup(0),
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()),
pixel_mask_statistics({0, 0, 0}) {
pixel_mask_statistics({0, 0, 0}),
gpu_count(get_gpu_count()) {
indexing_possible = (get_gpu_count() >= 0);
if (!indexing_possible)
data_processing_settings.indexing = false;
data_processing_settings.resolution_estimate = false;
SupressTIFFErrors();
}
@@ -50,17 +58,17 @@ bool JFJochStateMachine::ImportPedestalG1G2(const JFJochReceiverOutput &receiver
}
void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &ul) {
if (experiment.GetDetectorSetup().GetDetectorType() == DetectorType::EIGER) {
if (experiment.GetDetectorSetup().GetDetectorType() != DetectorType::JUNGFRAU) {
try {
logger.Info("EIGER configuration");
services.ConfigureDetector(experiment);
logger.Info(" ... done ");
SetState(JFJochState::Idle,
"EIGER detector configured",
"Detector configured",
BrokerStatus::MessageSeverity::Success);
return;
} catch (const std::exception &e) {
logger.Error("EIGER configuration error {}", e.what());
logger.Error("Configuration error {}", e.what());
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
throw;
}
@@ -263,8 +271,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;
}
@@ -272,9 +286,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) {
@@ -326,6 +338,8 @@ void JFJochStateMachine::MeasurementThread() {
{
std::unique_lock ul(m);
SetGridScanResult(tmp_output.receiver_output.grid_scan_result);
if (tmp_output.receiver_output.writer_queue_full_warning)
SetState(JFJochState::Idle,
"Stream receiver (writer or downstream analysis) cannot cope with data; reduce frame rate",
@@ -338,6 +352,10 @@ void JFJochStateMachine::MeasurementThread() {
SetState(JFJochState::Idle,
"Missing packets in data collection; reduce frame rate",
BrokerStatus::MessageSeverity::Error);
else if (!tmp_output.receiver_output.writer_err.empty())
SetState(JFJochState::Idle,
tmp_output.receiver_output.writer_err,
BrokerStatus::MessageSeverity::Error);
else
SetState(JFJochState::Idle,
"Data collection without problems",
@@ -467,6 +485,8 @@ BrokerStatus JFJochStateMachine::GetStatus() const {
std::unique_lock ul(broker_status_mutex);
BrokerStatus ret = broker_status;
ret.progress = services.GetReceiverProgress();
ret.gpu_count = gpu_count;
ret.ml_resolution_estimation = resolution_estimate_possible;
return ret;
}
@@ -489,8 +509,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 {
@@ -518,20 +546,18 @@ DetectorList JFJochStateMachine::GetDetectorsList() const {
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));
}
{
std::unique_lock ul(current_detector_setup_mutex);
ret.current_id = current_detector_setup;
}
ret.current_id = current_detector_setup;
return ret;
}
@@ -554,10 +580,7 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
gain_calibration = detector_setup[id].GetGainCalibration();
pixel_mask = PixelMask(experiment);
SetState(JFJochState::Inactive, detector_setup[id].GetDescription() + " selected; please initialize");
{
std::unique_lock ul(current_detector_setup_mutex);
current_detector_setup = id;
}
current_detector_setup = id;
} catch (const JFJochException &e) {
logger.ErrorException(e);
SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error);
@@ -571,7 +594,7 @@ void JFJochStateMachine::SetRadialIntegrationSettings(const AzimuthalIntegration
if (IsRunning())
throw WrongDAQStateException("Cannot change radial integration settings during data collection");
{
std::unique_lock ul(experiment_azimuthal_integration_settings_mutex);
std::unique_lock ul2(experiment_azimuthal_integration_settings_mutex);
experiment.ImportAzimuthalIntegrationSettings(settings);
}
}
@@ -620,12 +643,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 {
@@ -636,8 +659,8 @@ std::string JFJochStateMachine::GetPedestalTIFF(size_t gain_level, size_t sc) co
if ((experiment.GetDetectorSetup().GetDetectorType() == DetectorType::JUNGFRAU) && calibration) {
auto tmp = calibration->GetPedestal(gain_level, sc);
return WriteTIFFToString(tmp.data(), RAW_MODULE_COLS, RAW_MODULE_LINES * experiment.GetModulesNum(),
sizeof(uint16_t), false);
CompressedImage image(tmp, RAW_MODULE_COLS, RAW_MODULE_LINES * experiment.GetModulesNum());
return WriteTIFFToString(image);
} else
return {};
}
@@ -713,25 +736,38 @@ 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);
CompressedImage mask_image(v, experiment.GetXPixelsNum(), experiment.GetYPixelsNum());
return WriteTIFFToString(mask_image);
}
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);
CompressedImage mask_image(v, experiment.GetXPixelsNum(), experiment.GetYPixelsNum());
return WriteTIFFToString(mask_image);
}
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);
}
@@ -751,7 +787,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();
}
@@ -760,12 +796,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();
}
@@ -777,12 +815,15 @@ void JFJochStateMachine::LoadImageFormatSettings(const ImageFormatSettings &sett
bool recalc_mask = (experiment.GetPedestalG0RMSLimit() != settings.GetPedestalG0RMSLimit());
experiment.ImportImageFormatSettings(settings);
{
std::unique_lock ul2(experiment_image_format_settings_mutex);
experiment.ImportImageFormatSettings(settings);
}
if (recalc_mask)
pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get());
else
pixel_mask.Update(settings);
pixel_mask.CalcEdgePixels(experiment);
UpdatePixelMaskStatistics(pixel_mask.GetStatistics());
}
@@ -830,7 +871,7 @@ void JFJochStateMachine::GetStartMessageFromBuffer(std::vector<uint8_t> &v) {
}
void JFJochStateMachine::GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number) {
return services.GetImageFromBuffer(v, image_number);
services.GetImageFromBuffer(v, image_number);
}
ImageBufferStatus JFJochStateMachine::GetImageBufferStatus() const {
@@ -847,7 +888,7 @@ void JFJochStateMachine::ClearImageBuffer() const {
}
FileWriterSettings JFJochStateMachine::GetFileWriterSettings() const {
std::unique_lock ul(m);
std::unique_lock ul(experiment_file_writer_settings_mutex);
return experiment.GetFileWriterSettings();
}
@@ -856,6 +897,33 @@ void JFJochStateMachine::LoadFileWriterSettings(const FileWriterSettings &settin
if (IsRunning())
throw WrongDAQStateException("Cannot change instrument metadata during data collection");
experiment.ImportFileWriterSettings(settings);
{
std::unique_lock ul2(experiment_file_writer_settings_mutex);
experiment.ImportFileWriterSettings(settings);
}
}
IndexingSettings JFJochStateMachine::GetIndexingSettings() const {
std::unique_lock ul(experiment_indexing_settings_mutex);
return experiment.GetIndexingSettings();
}
void JFJochStateMachine::SetIndexingSettings(const IndexingSettings &input) {
std::unique_lock ul(m);
if (IsRunning())
throw WrongDAQStateException("Cannot change instrument metadata during data collection");
{
std::unique_lock ul2(experiment_indexing_settings_mutex);
experiment.ImportIndexingSettings(input);
}
}
void JFJochStateMachine::SetGridScanResult(const std::optional<GridScanResult> &input) {
std::unique_lock ul(grid_scan_result_mutex);
grid_scan_result = input;
}
std::optional<GridScanResult> JFJochStateMachine::GetGridScanResult() const {
std::unique_lock ul(grid_scan_result_mutex);
return grid_scan_result;
}

View File

@@ -23,6 +23,8 @@ struct BrokerStatus {
std::optional<float> progress;
std::optional<std::string> message;
enum class MessageSeverity {Error, Info, Warning, Success} message_severity = MessageSeverity::Error;
int64_t gpu_count;
bool ml_resolution_estimation;
};
struct DetectorListElement {
@@ -36,6 +38,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 +60,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;
@@ -88,6 +91,10 @@ class JFJochStateMachine {
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;
mutable std::mutex experiment_indexing_settings_mutex;
DiffractionExperiment experiment;
// mutex m is protecting:
@@ -97,9 +104,7 @@ class JFJochStateMachine {
volatile bool cancel_sequence = false;
std::unique_ptr<JFCalibration> calibration;
PixelMask pixel_mask;
mutable std::mutex current_detector_setup_mutex;
int64_t current_detector_setup;
int64_t current_detector_setup; // Lock only on change
mutable std::mutex calibration_statistics_mutex;
std::vector<JFCalibrationModuleStatistics> calibration_statistics;
@@ -116,6 +121,14 @@ class JFJochStateMachine {
mutable std::mutex roi_mutex;
ROIDefinition roi;
mutable std::mutex grid_scan_result_mutex;
std::optional<GridScanResult> grid_scan_result;
bool indexing_possible;
bool resolution_estimate_possible;
const int32_t gpu_count;
void UpdatePixelMaskStatistics(const PixelMaskStatistics &input);
// Private functions assume that lock m is acquired
@@ -135,6 +148,8 @@ class JFJochStateMachine {
void TakePedestalInternalG2(std::unique_lock<std::mutex> &ul, int32_t storage_cell = 0);
void ImportDetectorSettings(const DetectorSettings& input);
void UpdateROIDefinition();
void SetGridScanResult(const std::optional<GridScanResult>& input);
public:
JFJochStateMachine(JFJochServices &in_services, Logger &logger);
~JFJochStateMachine();
@@ -182,8 +197,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);
@@ -218,6 +233,8 @@ public:
void SetMetadataSocketSettings(const ZMQMetadataSettings &input);
ZMQMetadataSettings GetMetadataSocketSettings();
void SetIndexingSettings(const IndexingSettings &input);
IndexingSettings GetIndexingSettings() const;
PixelMaskStatistics GetPixelMaskStatistics() const;
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
@@ -225,6 +242,8 @@ public:
ImageBufferStatus GetImageBufferStatus() const;
void ClearImageBuffer() const;
void AddDetectorSetup(const DetectorSetup& setup); // Not thread safe, only during setup
std::optional<GridScanResult> GetGridScanResult() const;
};

View File

@@ -19,11 +19,14 @@ SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding
ret.low_resolution_limit = input.getLowResolutionLimit();
ret.enable = input.isEnable();
ret.indexing = input.isIndexing();
ret.indexing_tolerance = input.getIndexingTolerance();
ret.resolution_estimate = input.isResolutionEstimate();
ret.quick_integration = input.isQuickIntegration();
ret.quick_integration_d_min_A = input.getQuickIntegrationHighResA();
if (input.filterPowderRingsIsSet())
ret.filter_spots_powder_ring = input.isFilterPowderRings();
if (input.minSpotCountPowderRingIsSet())
ret.min_spot_count_powder_ring = input.getMinSpotCountPowderRing();
return ret;
}
@@ -37,9 +40,11 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin
ret.setLowResolutionLimit(input.low_resolution_limit);
ret.setEnable(input.enable);
ret.setIndexing(input.indexing);
ret.setIndexingTolerance(input.indexing_tolerance);
ret.setFilterPowderRings(input.filter_spots_powder_ring);
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
ret.setResolutionEstimate(input.resolution_estimate);
ret.setQuickIntegration(input.quick_integration);
ret.setQuickIntegrationHighResA(input.quick_integration_d_min_A);
return ret;
}
@@ -61,7 +66,8 @@ 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);
@@ -237,6 +243,8 @@ org::openapitools::server::model::Broker_status Convert(const BrokerStatus& inpu
if (input.progress.has_value())
ret.setProgress(input.progress.value());
ret.setMlResolutionEstimation(input.ml_resolution_estimation);
ret.setGpuCount(input.gpu_count);
return ret;
}
@@ -336,6 +344,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;
@@ -352,6 +376,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);
@@ -360,36 +385,69 @@ org::openapitools::server::model::Detector_list Convert(const DetectorList &inpu
}
org::openapitools::server::model::Plots Convert(const MultiLinePlot& input) {
std::vector<org::openapitools::server::model::Plot> tmp(input.size());
for (int i = 0; i < input.size(); i++) {
tmp[i].setTitle(input[i].title);
tmp[i].setX(input[i].x);
tmp[i].setY(input[i].y);
std::vector<org::openapitools::server::model::Plot> tmp(input.GetPlots().size());
for (int i = 0; i < input.GetPlots().size(); i++) {
tmp[i].setTitle(input.GetPlots()[i].title);
tmp[i].setX(input.GetPlots()[i].x);
tmp[i].setY(input.GetPlots()[i].y);
tmp[i].setZ(input.GetPlots()[i].z);
}
org::openapitools::server::model::Plots output;
output.setPlot(tmp);
org::openapitools::server::model::Plot_unit_x unit;
switch (input.GetUnits()) {
case MultiLinePlotUnits::ImageNumber:
unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::IMAGE_NUMBER);
break;
case MultiLinePlotUnits::Angle_deg:
unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::ANGLE_DEG);
break;
case MultiLinePlotUnits::Q_recipA:
unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::Q_RECIPA);
break;
case MultiLinePlotUnits::ADU:
unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::ADU);
break;
case MultiLinePlotUnits::d_A:
unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::D_A);
break;
case MultiLinePlotUnits::Grid_um:
unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::GRID_UM);
break;
default:
break;
}
output.setUnitX(unit);
if (input.GetSizeX().has_value())
output.setSizeX(input.GetSizeX().value());
if (input.GetSizeY().has_value())
output.setSizeY(input.GetSizeY().value());
return output;
}
AzimuthalIntegrationSettings Convert(const org::openapitools::server::model::Azim_int_settings& input) {
AzimuthalIntegrationSettings ret{};
ret.SolidAngleCorrection(input.isSolidAngleCorr());
if (input.polarizationFactorIsSet())
ret.PolarizationFactor(input.getPolarizationFactor());
ret.PolarizationCorrection(input.isPolarizationCorr());
ret.QSpacing_recipA(input.getQSpacing());
ret.QRange_recipA(input.getLowQRecipA(), input.getHighQRecipA());
ret.AzimuthalBinCount(input.getAzimuthalBins());
return ret;
}
org::openapitools::server::model::Azim_int_settings Convert(const AzimuthalIntegrationSettings& settings) {
org::openapitools::server::model::Azim_int_settings ret{};
ret.setSolidAngleCorr(settings.IsSolidAngleCorrection());
if (settings.GetPolarizationFactor().has_value())
ret.setPolarizationFactor(settings.GetPolarizationFactor().value());
ret.setPolarizationCorr(settings.IsPolarizationCorrection());
ret.setHighQRecipA(settings.GetHighQ_recipA());
ret.setLowQRecipA(settings.GetLowQ_recipA());
ret.setQSpacing(settings.GetQSpacing_recipA());
ret.setAzimuthalBins(settings.GetAzimuthalBinCount());
return ret;
}
@@ -400,7 +458,9 @@ ROIDefinition Convert(const org::openapitools::server::model::Roi_definitions& i
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(), 2.0f * M_PI / i.getQMaxRecipA(), 2.0f * M_PI / i.getQMinRecipA()));
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;
}
@@ -426,7 +486,7 @@ org::openapitools::server::model::Roi_azim_list Convert(const std::vector<ROIAzi
org::openapitools::server::model::Roi_azimuthal elem;
elem.setName(i.GetName());
elem.setQMinRecipA(i.GetQMin_recipA());
elem.setQMinRecipA(i.GetQMax_recipA());
elem.setQMaxRecipA(i.GetQMax_recipA());
tmp.emplace_back(elem);
}
ret.setRois(tmp);
@@ -457,19 +517,6 @@ org::openapitools::server::model::Roi_definitions Convert(const ROIDefinition &i
return ret;
}
PreviewJPEGSettings Convert(const org::openapitools::server::model::Preview_settings& input) {
PreviewJPEGSettings ret{};
ret.show_spots = input.isShowSpots();
ret.jpeg_quality = input.getJpegQuality();
ret.saturation_value = input.getSaturation();
ret.show_roi = input.isShowRoi();
ret.show_indexed = input.isShowIndexed();
ret.show_user_mask = input.isShowUserMask();
if (input.resolutionRingIsSet())
ret.resolution_ring = input.getResolutionRing();
return ret;
}
ImageFormatSettings Convert(const org::openapitools::server::model::Image_format_settings& input) {
ImageFormatSettings ret{};
ret.GeometryTransformed(input.isGeometryTransform());
@@ -508,6 +555,25 @@ org::openapitools::server::model::Image_format_settings Convert(const ImageForma
return ret;
}
Coord ConvertOpenAPI(const std::vector<float> &input) {
if (input.size() != 3)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Wrong size of Coord array");
return {input[0], input[1], input[2]};
}
GoniometerAxis Convert(const org::openapitools::server::model::Rotation_axis& input) {
std::optional<Coord> helical;
if (input.helicalStepUmIsSet())
helical = ConvertOpenAPI(input.getHelicalStepUm());
return {input.getName(), input.getStart(), input.getStep(),
ConvertOpenAPI(input.getVector()), helical};
}
GridScanSettings Convert(const org::openapitools::server::model::Grid_scan& input) {
return {input.getNFast(), input.getStepXUm(), input.getStepYUm(), input.isSnake(), input.isVertical()};
}
DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input) {
DatasetSettings ret;
@@ -562,19 +628,11 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings
ret.TotalFlux(input.getTotalFlux());
if (input.transmissionIsSet())
ret.AttenuatorTransmission(input.getTransmission());
if (input.goniometerIsSet())
ret.Goniometer(Convert(input.getGoniometer()));
else if (input.gridScanIsSet())
ret.GridScan(Convert(input.getGridScan()));
if (input.goniometerIsSet()) {
ret.Goniometer(GoniometerAxis{
.name = input.getGoniometer().getName(),
.increment = input.getGoniometer().getStep(),
.start = input.getGoniometer().getStart()
});
if (input.getGoniometer().getVector().size() == 3) {
auto v = input.getGoniometer().getVector();
ret.RotationAxis(Coord(v[0], v[1], v[2]));
} else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Rotation axis must be provided");
}
if (input.spaceGroupNumberIsSet())
ret.SpaceGroupNumber(input.getSpaceGroupNumber());
ret.SampleName(input.getSampleName());
@@ -593,6 +651,13 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings
ret.WriteNXmxHDF5Master(input.isWriteNxmxHdf5Master());
if (input.polarizationFactorIsSet())
ret.PolarizationFactor(input.getPolarizationFactor());
ret.PoniRot1_rad(input.getPoniRot1Rad());
ret.PoniRot2_rad(input.getPoniRot2Rad());
ret.PoniRot3_rad(input.getPoniRot3Rad());
return ret;
}
@@ -671,6 +736,8 @@ org::openapitools::server::model::Image_buffer_status Convert(const ImageBufferS
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;
}
@@ -688,33 +755,161 @@ FileWriterSettings Convert(const org::openapitools::server::model::File_writer_s
return ret;
}
org::openapitools::server::model::File_writer_format Convert(FileWriterFileFormat input) {
org::openapitools::server::model::File_writer_format Convert(FileWriterFormat input) {
org::openapitools::server::model::File_writer_format ret;
switch (input) {
case FileWriterFileFormat::DataOnly:
case FileWriterFormat::DataOnly:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NONE);
break;
case FileWriterFileFormat::NXmxLegacy:
case FileWriterFormat::NXmxLegacy:
ret.setValue(org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXLEGACY);
break;
case FileWriterFileFormat::NXmxVDS:
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;
}
FileWriterFileFormat Convert(const org::openapitools::server::model::File_writer_format& input) {
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 FileWriterFileFormat::DataOnly;
return FileWriterFormat::DataOnly;
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXLEGACY:
return FileWriterFileFormat::NXmxLegacy;
return FileWriterFormat::NXmxLegacy;
case org::openapitools::server::model::File_writer_format::eFile_writer_format::NXMXVDS:
return FileWriterFileFormat::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");
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Unknown file writer format enum value");
}
}
PlotType ConvertPlotType(const std::optional<std::string>& input) {
if (!input.has_value())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Plot type is compulsory paramater");
if (input == "bkg_estimate") return PlotType::BkgEstimate;
if (input == "azint") return PlotType::AzInt;
if (input == "azint_1d") return PlotType::AzInt1D;
if (input == "spot_count") return PlotType::SpotCount;
if (input == "indexing_rate") return PlotType::IndexingRate;
if (input == "indexing_unit_cell_length") return PlotType::IndexingUnitCellLength;
if (input == "mosaicity") return PlotType::IndexingMosaicity;
if (input == "b_factor") return PlotType::BFactor;
if (input == "indexing_unit_cell_angle") return PlotType::IndexingUnitCellAngle;
if (input == "error_pixels") return PlotType::ErrorPixels;
if (input == "strong_pixels") return PlotType::StrongPixels;
if (input == "saturated_pixels") return PlotType::SaturatedPixels;
if (input == "image_collection_efficiency") return PlotType::ImageCollectionEfficiency;
if (input == "receiver_delay") return PlotType::ReceiverDelay;
if (input == "receiver_free_send_buf") return PlotType::ReceiverFreeSendBuf;
if (input == "roi_sum") return PlotType::ROISum;
if (input == "roi_mean") return PlotType::ROIMean;
if (input == "roi_max_count") return PlotType::ROIMaxCount;
if (input == "roi_pixels") return PlotType::ROIPixels;
if (input == "roi_weighted_x") return PlotType::ROIWeightedX;
if (input == "roi_weighted_y") return PlotType::ROIWeightedY;
if (input == "packets_received") return PlotType::PacketsReceived;
if (input == "max_pixel_value") return PlotType::MaxValue;
if (input == "resolution_estimate") return PlotType::ResolutionEstimate;
if (input == "indexing_time") return PlotType::IndexingTime;
if (input == "pixel_sum") return PlotType::PixelSum;
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Plot type not recognized");
}
ColorScaleEnum ConvertColorScale(const std::optional<std::string>& input) {
std::string color = input.value_or("indigo");
if (color == "viridis")
return ColorScaleEnum::Viridis;
else if (color == "bw")
return ColorScaleEnum::BW;
else if (color == "heat")
return ColorScaleEnum::Heat;
else if (color == "indigo")
return ColorScaleEnum::Indigo;
else
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Color scale unknown");
}
org::openapitools::server::model::Grid_plot Convert(const GridPlot& input) {
org::openapitools::server::model::Grid_plot ret;
ret.setWidth(input.GetWidth());
ret.setData(input.GetPlot());
return ret;
}
IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input) {
IndexingSettings ret;
switch (input.getAlgorithm().getValue()) {
case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFT:
ret.Algorithm(IndexingAlgorithmEnum::FFT);
break;
case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::NONE:
ret.Algorithm(IndexingAlgorithmEnum::None);
break;
case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFBIDX:
ret.Algorithm(IndexingAlgorithmEnum::FFBIDX);
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown indexing algorithm");
}
ret.FFT_HighResolution_A(input.getFftHighResolutionA());
ret.FFT_MaxUnitCell_A(input.getFftMaxUnitCellA());
ret.FFT_MinUnitCell_A(input.getFftMinUnitCellA());
ret.FFT_NumVectors(input.getFftNumVectors());
ret.Tolerance(input.getTolerance());
return ret;
}
org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input) {
org::openapitools::server::model::Indexing_settings ret;
ret.setFftHighResolutionA(input.GetFFT_HighResolution_A());
ret.setFftMinUnitCellA(input.GetFFT_MinUnitCell_A());
ret.setFftMaxUnitCellA(input.GetFFT_MaxUnitCell_A());
ret.setFftNumVectors(input.GetFFT_NumVectors());
ret.setTolerance(input.GetTolerance());
org::openapitools::server::model::Indexing_algorithm tmp;
switch (input.GetAlgorithm()) {
case IndexingAlgorithmEnum::FFBIDX:
tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFBIDX);
break;
case IndexingAlgorithmEnum::FFT:
tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFT);
break;
case IndexingAlgorithmEnum::None:
tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::NONE);
break;
}
ret.setAlgorithm(tmp);
return ret;
}
org::openapitools::server::model::Grid_scan_result Convert(const GridScanResult& input) {
org::openapitools::server::model::Grid_scan_result ret;
ret.setBFactor(input.b_factor);
ret.setMosaicity(input.mosaicity);
ret.setDetImg(input.det_img);
ret.setBkgEstimate(input.bkg);
ret.setIndexedLattices(input.indexing_solution);
ret.setSpotCount(input.spots);
return ret;
}

View File

@@ -17,7 +17,6 @@
#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"
@@ -25,8 +24,12 @@
#include "gen/model/Zeromq_metadata_settings.h"
#include "gen/model/File_writer_settings.h"
#include "gen/model/Image_buffer_status.h"
#include "gen/model/Rotation_axis.h"
#include "gen/model/Grid_scan.h"
#include "gen/model/Indexing_settings.h"
#include "gen/model/Grid_scan_result.h"
#include "../frame_serialize/JFJochMessages.h"
#include "../common/JFJochMessages.h"
#include "../common/DatasetSettings.h"
#include "../common/ImageFormatSettings.h"
#include "../image_analysis/SpotFindingSettings.h"
@@ -34,10 +37,15 @@
#include "../common/DetectorSettings.h"
#include "../jungfrau/JFCalibration.h"
#include "../common/InstrumentMetadata.h"
#include "Grid_plots.h"
#include "../common/GridScanResult.h"
SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input);
org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input);
IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input);
org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input);
org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input);
DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input);
@@ -59,9 +67,10 @@ 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);
GoniometerAxis Convert(const org::openapitools::server::model::Rotation_axis& input);
GridScanSettings Convert(const org::openapitools::server::model::Grid_scan& 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);
@@ -72,6 +81,14 @@ ZMQPreviewSettings Convert(const org::openapitools::server::model::Zeromq_previe
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(FileWriterFileFormat input);
FileWriterFileFormat Convert(const org::openapitools::server::model::File_writer_format& input);
org::openapitools::server::model::File_writer_format Convert(FileWriterFormat input);
FileWriterFormat Convert(const org::openapitools::server::model::File_writer_format& input);
org::openapitools::server::model::Grid_plot Convert(const GridPlot& input);
PlotType ConvertPlotType(const std::optional<std::string>& input);
ColorScaleEnum ConvertColorScale(const std::optional<std::string>& input);
org::openapitools::server::model::Grid_scan_result Convert(const GridScanResult& 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

File diff suppressed because it is too large Load Diff

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -39,13 +39,14 @@
#include "Error_message.h"
#include "File_writer_settings.h"
#include "Fpga_status_inner.h"
#include "Grid_scan_result.h"
#include "Image_buffer_status.h"
#include "Image_format_settings.h"
#include "Indexing_settings.h"
#include "Instrument_metadata.h"
#include "Jfjoch_statistics.h"
#include "Measurement_statistics.h"
#include "Plots.h"
#include "Preview_settings.h"
#include "Roi_definitions.h"
#include "Spot_finding_settings.h"
#include "Zeromq_metadata_settings.h"
@@ -78,6 +79,8 @@ private:
void config_image_format_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_image_format_raw_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_indexing_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_indexing_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_instrument_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -103,34 +106,15 @@ private:
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);
void plot_bkg_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_error_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_image_collection_efficiency_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_indexing_rate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void plot_indexing_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_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 preview_plot_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void result_grid_scan_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void statistics_data_collection_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
@@ -253,6 +237,21 @@ private:
/// </remarks>
virtual void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get indexing configuration
/// </summary>
/// <remarks>
/// Can be done anytime
/// </remarks>
virtual void config_indexing_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Change indexing algorithm settings
/// </summary>
/// <remarks>
/// This can only be done when detector is &#x60;Idle&#x60;, &#x60;Error&#x60; or &#x60;Inactive&#x60; states.
/// </remarks>
/// <param name="indexingSettings"> (optional)</param>
virtual void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get instrument metadata
/// </summary>
/// <remarks>
@@ -285,14 +284,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>
@@ -341,7 +340,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
@@ -355,7 +354,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
@@ -432,8 +431,31 @@ private:
/// <remarks>
/// Contains full image data and metadata. The image must come from the latest data collection.
/// </remarks>
/// <param name="imageNumber">Image number. If omitted, the image with the highest number in the image buffer will be provided. (optional, default to 0L)</param>
virtual void image_buffer_image_cbor_get(const std::optional<int64_t> &imageNumber, Pistache::Http::ResponseWriter &response) = 0;
/// <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 10.0f)</param>
/// <param name="jpegQuality">Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L)</param>
/// <param name="showResRing">Show resolution ring, provided in Angstrom (optional, default to 0.1f)</param>
/// <param name="color">Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to &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<float> &saturation, const std::optional<int64_t> &jpegQuality, const std::optional<float> &showResRing, const std::optional<std::string> &color, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get preview image in TIFF format
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="id">Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L)</param>
virtual void image_buffer_image_tiff_get(const std::optional<int64_t> &id, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Start message in CBOR format
/// </summary>
@@ -463,205 +485,6 @@ private:
/// </remarks>
virtual void pedestal_post(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate radial integration profile
/// </summary>
/// <remarks>
/// Generate average radial integration profile
/// </remarks>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
virtual void plot_azim_int_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate background estimate plot
/// </summary>
/// <remarks>
/// Mean intensity for d &#x3D; 3 - 5 A 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_bkg_estimate_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate error pixels plot
/// </summary>
/// <remarks>
/// Count of error (mean) and saturated (mean/max) pixels 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_error_pixel_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate image collection efficiency plot
/// </summary>
/// <remarks>
/// Ratio of collected and expected 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_image_collection_efficiency_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate indexing rate plot
/// </summary>
/// <remarks>
/// Image indexing rate; 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_indexing_rate_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate indexing unit cell angle plot
/// </summary>
/// <remarks>
/// Crystal unit cell based on indexing results; 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_indexing_unit_cell_angle_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate indexing unit cell length plots
/// </summary>
/// <remarks>
/// Crystal unit cell based on indexing results; 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_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>
/// Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; 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_receiver_delay_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate receiver free send buffer plot
/// </summary>
/// <remarks>
/// Amount of send buffers available during frame processing - used for internal debugging; 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_receiver_free_send_buffers_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>
/// Max count of ROI 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_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>
/// Sum of ROI rectangle 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_roi_sum_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate plot of ROI valid pixels
/// </summary>
/// <remarks>
/// Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; 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_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>
/// Number of spots 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_spot_count_get(const std::optional<int32_t> &binning, const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate strong pixels plot
/// </summary>
/// <remarks>
/// Count of strong pixels per image (from spot finding); 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_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>
@@ -671,6 +494,25 @@ private:
/// <param name="sc">Storage cell number (optional, default to 0)</param>
virtual void preview_pedestal_tiff_get(const std::optional<int32_t> &gainLevel, const std::optional<int32_t> &sc, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Generate 1D plot from Jungfraujoch
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="type">Type of requested plot</param>
/// <param name="binning">Binning of frames for the plot (0 &#x3D; default binning) (optional, default to 0)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to false)</param>
/// <param name="experimentalCoord">If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored (optional, default to false)</param>
/// <param name="azintUnit">Unit used for azim int. (optional, default to &quot;Q_recipA&quot;)</param>
virtual void preview_plot_get(const std::optional<std::string> &type, const std::optional<int32_t> &binning, const std::optional<bool> &compression, const std::optional<bool> &experimentalCoord, const std::optional<std::string> &azintUnit, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get grid scan result
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void result_grid_scan_get(Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Start detector
/// </summary>
/// <remarks>
@@ -698,7 +540,7 @@ private:
/// <remarks>
///
/// </remarks>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to true)</param>
/// <param name="compression">Enable DEFLATE compression of output data. (optional, default to false)</param>
virtual void statistics_get(const std::optional<bool> &compression, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Get Jungfraujoch status

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,12 +21,13 @@ namespace org::openapitools::server::model
Azim_int_settings::Azim_int_settings()
{
m_Polarization_factor = 0.0f;
m_Polarization_factorIsSet = false;
m_Polarization_corr = true;
m_Solid_angle_corr = true;
m_High_q_recipA = 0.0f;
m_Low_q_recipA = 0.0f;
m_Q_spacing = 0.0f;
m_Azimuthal_bins = 1L;
m_Azimuthal_binsIsSet = false;
}
@@ -49,26 +50,26 @@ bool Azim_int_settings::validate(std::stringstream& msg, const std::string& path
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Azim_int_settings" : pathPrefix;
if (polarizationFactorIsSet())
if (azimuthalBinsIsSet())
{
const float& value = m_Polarization_factor;
const std::string currentValuePath = _pathPrefix + ".polarizationFactor";
const int64_t& value = m_Azimuthal_bins;
const std::string currentValuePath = _pathPrefix + ".azimuthalBins";
if (value < static_cast<float>(-1.0))
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to -1.0;";
msg << currentValuePath << ": must be greater than or equal to 1;";
}
if (value > static_cast<float>(1.0))
if (value > 256ll)
{
success = false;
msg << currentValuePath << ": must be less than or equal to 1.0;";
msg << currentValuePath << ": must be less than or equal to 256;";
}
}
return success;
}
@@ -77,8 +78,8 @@ bool Azim_int_settings::operator==(const Azim_int_settings& rhs) const
return
((!polarizationFactorIsSet() && !rhs.polarizationFactorIsSet()) || (polarizationFactorIsSet() && rhs.polarizationFactorIsSet() && getPolarizationFactor() == rhs.getPolarizationFactor())) &&
(isPolarizationCorr() == rhs.isPolarizationCorr())
&&
(isSolidAngleCorr() == rhs.isSolidAngleCorr())
&&
@@ -90,8 +91,11 @@ bool Azim_int_settings::operator==(const Azim_int_settings& rhs) const
&&
(getQSpacing() == rhs.getQSpacing())
&&
((!azimuthalBinsIsSet() && !rhs.azimuthalBinsIsSet()) || (azimuthalBinsIsSet() && rhs.azimuthalBinsIsSet() && getAzimuthalBins() == rhs.getAzimuthalBins()))
;
}
@@ -103,45 +107,38 @@ bool Azim_int_settings::operator!=(const Azim_int_settings& rhs) const
void to_json(nlohmann::json& j, const Azim_int_settings& o)
{
j = nlohmann::json::object();
if(o.polarizationFactorIsSet())
j["polarization_factor"] = o.m_Polarization_factor;
j["polarization_corr"] = o.m_Polarization_corr;
j["solid_angle_corr"] = o.m_Solid_angle_corr;
j["high_q_recipA"] = o.m_High_q_recipA;
j["low_q_recipA"] = o.m_Low_q_recipA;
j["q_spacing"] = o.m_Q_spacing;
if(o.azimuthalBinsIsSet())
j["azimuthal_bins"] = o.m_Azimuthal_bins;
}
void from_json(const nlohmann::json& j, Azim_int_settings& o)
{
if(j.find("polarization_factor") != j.end())
{
j.at("polarization_factor").get_to(o.m_Polarization_factor);
o.m_Polarization_factorIsSet = true;
}
j.at("polarization_corr").get_to(o.m_Polarization_corr);
j.at("solid_angle_corr").get_to(o.m_Solid_angle_corr);
j.at("high_q_recipA").get_to(o.m_High_q_recipA);
j.at("low_q_recipA").get_to(o.m_Low_q_recipA);
j.at("q_spacing").get_to(o.m_Q_spacing);
if(j.find("azimuthal_bins") != j.end())
{
j.at("azimuthal_bins").get_to(o.m_Azimuthal_bins);
o.m_Azimuthal_binsIsSet = true;
}
}
float Azim_int_settings::getPolarizationFactor() const
bool Azim_int_settings::isPolarizationCorr() const
{
return m_Polarization_factor;
return m_Polarization_corr;
}
void Azim_int_settings::setPolarizationFactor(float const value)
void Azim_int_settings::setPolarizationCorr(bool const value)
{
m_Polarization_factor = value;
m_Polarization_factorIsSet = true;
}
bool Azim_int_settings::polarizationFactorIsSet() const
{
return m_Polarization_factorIsSet;
}
void Azim_int_settings::unsetPolarization_factor()
{
m_Polarization_factorIsSet = false;
m_Polarization_corr = value;
}
bool Azim_int_settings::isSolidAngleCorr() const
{
@@ -175,6 +172,23 @@ void Azim_int_settings::setQSpacing(float const value)
{
m_Q_spacing = value;
}
int64_t Azim_int_settings::getAzimuthalBins() const
{
return m_Azimuthal_bins;
}
void Azim_int_settings::setAzimuthalBins(int64_t const value)
{
m_Azimuthal_bins = value;
m_Azimuthal_binsIsSet = true;
}
bool Azim_int_settings::azimuthalBinsIsSet() const
{
return m_Azimuthal_binsIsSet;
}
void Azim_int_settings::unsetAzimuthal_bins()
{
m_Azimuthal_binsIsSet = 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -58,12 +58,10 @@ public:
/// Azim_int_settings members
/// <summary>
/// If polarization factor is provided, than polarization correction is enabled.
/// Apply polarization correction for radial integration (polarization factor must be configured in dataset settings)
/// </summary>
float getPolarizationFactor() const;
void setPolarizationFactor(float const value);
bool polarizationFactorIsSet() const;
void unsetPolarization_factor();
bool isPolarizationCorr() const;
void setPolarizationCorr(bool const value);
/// <summary>
/// Apply solid angle correction for radial integration
/// </summary>
@@ -84,12 +82,19 @@ public:
/// </summary>
float getQSpacing() const;
void setQSpacing(float const value);
/// <summary>
/// Numer of azimuthal (phi) bins; 1 &#x3D; standard 1D radial integration
/// </summary>
int64_t getAzimuthalBins() const;
void setAzimuthalBins(int64_t const value);
bool azimuthalBinsIsSet() const;
void unsetAzimuthal_bins();
friend void to_json(nlohmann::json& j, const Azim_int_settings& o);
friend void from_json(const nlohmann::json& j, Azim_int_settings& o);
protected:
float m_Polarization_factor;
bool m_Polarization_factorIsSet;
bool m_Polarization_corr;
bool m_Solid_angle_corr;
float m_High_q_recipA;
@@ -98,6 +103,8 @@ protected:
float m_Q_spacing;
int64_t m_Azimuthal_bins;
bool m_Azimuthal_binsIsSet;
};

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,6 +28,10 @@ Broker_status::Broker_status()
m_MessageIsSet = false;
m_Message_severity = "error";
m_Message_severityIsSet = false;
m_Gpu_count = 0;
m_Gpu_countIsSet = false;
m_Ml_resolution_estimation = false;
m_Ml_resolution_estimationIsSet = false;
}
@@ -69,7 +73,7 @@ bool Broker_status::validate(std::stringstream& msg, const std::string& pathPref
}
}
return success;
}
@@ -88,7 +92,13 @@ bool Broker_status::operator==(const Broker_status& rhs) const
((!messageIsSet() && !rhs.messageIsSet()) || (messageIsSet() && rhs.messageIsSet() && getMessage() == rhs.getMessage())) &&
((!messageSeverityIsSet() && !rhs.messageSeverityIsSet()) || (messageSeverityIsSet() && rhs.messageSeverityIsSet() && getMessageSeverity() == rhs.getMessageSeverity()))
((!messageSeverityIsSet() && !rhs.messageSeverityIsSet()) || (messageSeverityIsSet() && rhs.messageSeverityIsSet() && getMessageSeverity() == rhs.getMessageSeverity())) &&
((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount())) &&
((!mlResolutionEstimationIsSet() && !rhs.mlResolutionEstimationIsSet()) || (mlResolutionEstimationIsSet() && rhs.mlResolutionEstimationIsSet() && isMlResolutionEstimation() == rhs.isMlResolutionEstimation()))
;
}
@@ -108,6 +118,10 @@ void to_json(nlohmann::json& j, const Broker_status& o)
j["message"] = o.m_Message;
if(o.messageSeverityIsSet())
j["message_severity"] = o.m_Message_severity;
if(o.gpuCountIsSet())
j["gpu_count"] = o.m_Gpu_count;
if(o.mlResolutionEstimationIsSet())
j["ml_resolution_estimation"] = o.m_Ml_resolution_estimation;
}
@@ -129,6 +143,16 @@ void from_json(const nlohmann::json& j, Broker_status& o)
j.at("message_severity").get_to(o.m_Message_severity);
o.m_Message_severityIsSet = true;
}
if(j.find("gpu_count") != j.end())
{
j.at("gpu_count").get_to(o.m_Gpu_count);
o.m_Gpu_countIsSet = true;
}
if(j.find("ml_resolution_estimation") != j.end())
{
j.at("ml_resolution_estimation").get_to(o.m_Ml_resolution_estimation);
o.m_Ml_resolution_estimationIsSet = true;
}
}
@@ -191,6 +215,40 @@ void Broker_status::unsetMessage_severity()
{
m_Message_severityIsSet = false;
}
int32_t Broker_status::getGpuCount() const
{
return m_Gpu_count;
}
void Broker_status::setGpuCount(int32_t const value)
{
m_Gpu_count = value;
m_Gpu_countIsSet = true;
}
bool Broker_status::gpuCountIsSet() const
{
return m_Gpu_countIsSet;
}
void Broker_status::unsetGpu_count()
{
m_Gpu_countIsSet = false;
}
bool Broker_status::isMlResolutionEstimation() const
{
return m_Ml_resolution_estimation;
}
void Broker_status::setMlResolutionEstimation(bool const value)
{
m_Ml_resolution_estimation = value;
m_Ml_resolution_estimationIsSet = true;
}
bool Broker_status::mlResolutionEstimationIsSet() const
{
return m_Ml_resolution_estimationIsSet;
}
void Broker_status::unsetMl_resolution_estimation()
{
m_Ml_resolution_estimationIsSet = 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -84,6 +84,20 @@ public:
void setMessageSeverity(std::string const& value);
bool messageSeverityIsSet() const;
void unsetMessage_severity();
/// <summary>
/// Number of installed GPUs
/// </summary>
int32_t getGpuCount() const;
void setGpuCount(int32_t const value);
bool gpuCountIsSet() const;
void unsetGpu_count();
/// <summary>
/// ML resolution estimation available
/// </summary>
bool isMlResolutionEstimation() const;
void setMlResolutionEstimation(bool const value);
bool mlResolutionEstimationIsSet() const;
void unsetMl_resolution_estimation();
friend void to_json(nlohmann::json& j, const Broker_status& o);
friend void from_json(const nlohmann::json& j, Broker_status& o);
@@ -96,6 +110,10 @@ protected:
bool m_MessageIsSet;
std::string m_Message_severity;
bool m_Message_severityIsSet;
int32_t m_Gpu_count;
bool m_Gpu_countIsSet;
bool m_Ml_resolution_estimation;
bool m_Ml_resolution_estimationIsSet;
};

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -46,6 +46,7 @@ Dataset_settings::Dataset_settings()
m_Transmission = 0.0f;
m_TransmissionIsSet = false;
m_GoniometerIsSet = false;
m_Grid_scanIsSet = false;
m_Header_appendixIsSet = false;
m_Image_appendixIsSet = false;
m_Data_reduction_factor_serialmx = 1.0f;
@@ -64,6 +65,14 @@ Dataset_settings::Dataset_settings()
m_Write_nxmx_hdf5_masterIsSet = false;
m_Save_calibration = false;
m_Save_calibrationIsSet = false;
m_Polarization_factor = 0.0f;
m_Polarization_factorIsSet = false;
m_Poni_rot1_rad = 0.0f;
m_Poni_rot1_radIsSet = false;
m_Poni_rot2_rad = 0.0f;
m_Poni_rot2_radIsSet = false;
m_Poni_rot3_rad = 0.0f;
m_Poni_rot3_radIsSet = false;
m_Unit_cellIsSet = false;
}
@@ -214,7 +223,7 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
}
}
if (dataReductionFactorSerialmxIsSet())
{
const float& value = m_Data_reduction_factor_serialmx;
@@ -280,7 +289,83 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
}
}
if (polarizationFactorIsSet())
{
const float& value = m_Polarization_factor;
const std::string currentValuePath = _pathPrefix + ".polarizationFactor";
if (value < static_cast<float>(-1.0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to -1.0;";
}
if (value > static_cast<float>(1.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 1.0;";
}
}
if (poniRot1RadIsSet())
{
const float& value = m_Poni_rot1_rad;
const std::string currentValuePath = _pathPrefix + ".poniRot1Rad";
if (value < static_cast<float>(-6.28318530718))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to -6.28318530718;";
}
if (value > static_cast<float>(6.28318530718))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 6.28318530718;";
}
}
if (poniRot2RadIsSet())
{
const float& value = m_Poni_rot2_rad;
const std::string currentValuePath = _pathPrefix + ".poniRot2Rad";
if (value < static_cast<float>(-6.28318530718))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to -6.28318530718;";
}
if (value > static_cast<float>(6.28318530718))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 6.28318530718;";
}
}
if (poniRot3RadIsSet())
{
const float& value = m_Poni_rot3_rad;
const std::string currentValuePath = _pathPrefix + ".poniRot3Rad";
if (value < static_cast<float>(-6.28318530718))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to -6.28318530718;";
}
if (value > static_cast<float>(6.28318530718))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 6.28318530718;";
}
}
return success;
}
@@ -335,6 +420,9 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
((!goniometerIsSet() && !rhs.goniometerIsSet()) || (goniometerIsSet() && rhs.goniometerIsSet() && getGoniometer() == rhs.getGoniometer())) &&
((!gridScanIsSet() && !rhs.gridScanIsSet()) || (gridScanIsSet() && rhs.gridScanIsSet() && getGridScan() == rhs.getGridScan())) &&
((!headerAppendixIsSet() && !rhs.headerAppendixIsSet()) || (headerAppendixIsSet() && rhs.headerAppendixIsSet() && getHeaderAppendix() == rhs.getHeaderAppendix())) &&
@@ -365,6 +453,18 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
((!saveCalibrationIsSet() && !rhs.saveCalibrationIsSet()) || (saveCalibrationIsSet() && rhs.saveCalibrationIsSet() && isSaveCalibration() == rhs.isSaveCalibration())) &&
((!polarizationFactorIsSet() && !rhs.polarizationFactorIsSet()) || (polarizationFactorIsSet() && rhs.polarizationFactorIsSet() && getPolarizationFactor() == rhs.getPolarizationFactor())) &&
((!poniRot1RadIsSet() && !rhs.poniRot1RadIsSet()) || (poniRot1RadIsSet() && rhs.poniRot1RadIsSet() && getPoniRot1Rad() == rhs.getPoniRot1Rad())) &&
((!poniRot2RadIsSet() && !rhs.poniRot2RadIsSet()) || (poniRot2RadIsSet() && rhs.poniRot2RadIsSet() && getPoniRot2Rad() == rhs.getPoniRot2Rad())) &&
((!poniRot3RadIsSet() && !rhs.poniRot3RadIsSet()) || (poniRot3RadIsSet() && rhs.poniRot3RadIsSet() && getPoniRot3Rad() == rhs.getPoniRot3Rad())) &&
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell()))
;
@@ -404,6 +504,8 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
j["transmission"] = o.m_Transmission;
if(o.goniometerIsSet())
j["goniometer"] = o.m_Goniometer;
if(o.gridScanIsSet())
j["grid_scan"] = o.m_Grid_scan;
if(o.headerAppendixIsSet())
j["header_appendix"] = o.m_Header_appendix;
if(o.imageAppendixIsSet())
@@ -424,6 +526,14 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
j["write_nxmx_hdf5_master"] = o.m_Write_nxmx_hdf5_master;
if(o.saveCalibrationIsSet())
j["save_calibration"] = o.m_Save_calibration;
if(o.polarizationFactorIsSet())
j["polarization_factor"] = o.m_Polarization_factor;
if(o.poniRot1RadIsSet())
j["poni_rot1_rad"] = o.m_Poni_rot1_rad;
if(o.poniRot2RadIsSet())
j["poni_rot2_rad"] = o.m_Poni_rot2_rad;
if(o.poniRot3RadIsSet())
j["poni_rot3_rad"] = o.m_Poni_rot3_rad;
if(o.unitCellIsSet())
j["unit_cell"] = o.m_Unit_cell;
@@ -490,6 +600,11 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
j.at("goniometer").get_to(o.m_Goniometer);
o.m_GoniometerIsSet = true;
}
if(j.find("grid_scan") != j.end())
{
j.at("grid_scan").get_to(o.m_Grid_scan);
o.m_Grid_scanIsSet = true;
}
if(j.find("header_appendix") != j.end())
{
j.at("header_appendix").get_to(o.m_Header_appendix);
@@ -540,6 +655,26 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
j.at("save_calibration").get_to(o.m_Save_calibration);
o.m_Save_calibrationIsSet = true;
}
if(j.find("polarization_factor") != j.end())
{
j.at("polarization_factor").get_to(o.m_Polarization_factor);
o.m_Polarization_factorIsSet = true;
}
if(j.find("poni_rot1_rad") != j.end())
{
j.at("poni_rot1_rad").get_to(o.m_Poni_rot1_rad);
o.m_Poni_rot1_radIsSet = true;
}
if(j.find("poni_rot2_rad") != j.end())
{
j.at("poni_rot2_rad").get_to(o.m_Poni_rot2_rad);
o.m_Poni_rot2_radIsSet = true;
}
if(j.find("poni_rot3_rad") != j.end())
{
j.at("poni_rot3_rad").get_to(o.m_Poni_rot3_rad);
o.m_Poni_rot3_radIsSet = true;
}
if(j.find("unit_cell") != j.end())
{
j.at("unit_cell").get_to(o.m_Unit_cell);
@@ -767,6 +902,23 @@ void Dataset_settings::unsetGoniometer()
{
m_GoniometerIsSet = false;
}
org::openapitools::server::model::Grid_scan Dataset_settings::getGridScan() const
{
return m_Grid_scan;
}
void Dataset_settings::setGridScan(org::openapitools::server::model::Grid_scan const& value)
{
m_Grid_scan = value;
m_Grid_scanIsSet = true;
}
bool Dataset_settings::gridScanIsSet() const
{
return m_Grid_scanIsSet;
}
void Dataset_settings::unsetGrid_scan()
{
m_Grid_scanIsSet = false;
}
nlohmann::json Dataset_settings::getHeaderAppendix() const
{
return m_Header_appendix;
@@ -937,6 +1089,74 @@ void Dataset_settings::unsetSave_calibration()
{
m_Save_calibrationIsSet = false;
}
float Dataset_settings::getPolarizationFactor() const
{
return m_Polarization_factor;
}
void Dataset_settings::setPolarizationFactor(float const value)
{
m_Polarization_factor = value;
m_Polarization_factorIsSet = true;
}
bool Dataset_settings::polarizationFactorIsSet() const
{
return m_Polarization_factorIsSet;
}
void Dataset_settings::unsetPolarization_factor()
{
m_Polarization_factorIsSet = false;
}
float Dataset_settings::getPoniRot1Rad() const
{
return m_Poni_rot1_rad;
}
void Dataset_settings::setPoniRot1Rad(float const value)
{
m_Poni_rot1_rad = value;
m_Poni_rot1_radIsSet = true;
}
bool Dataset_settings::poniRot1RadIsSet() const
{
return m_Poni_rot1_radIsSet;
}
void Dataset_settings::unsetPoni_rot1_rad()
{
m_Poni_rot1_radIsSet = false;
}
float Dataset_settings::getPoniRot2Rad() const
{
return m_Poni_rot2_rad;
}
void Dataset_settings::setPoniRot2Rad(float const value)
{
m_Poni_rot2_rad = value;
m_Poni_rot2_radIsSet = true;
}
bool Dataset_settings::poniRot2RadIsSet() const
{
return m_Poni_rot2_radIsSet;
}
void Dataset_settings::unsetPoni_rot2_rad()
{
m_Poni_rot2_radIsSet = false;
}
float Dataset_settings::getPoniRot3Rad() const
{
return m_Poni_rot3_rad;
}
void Dataset_settings::setPoniRot3Rad(float const value)
{
m_Poni_rot3_rad = value;
m_Poni_rot3_radIsSet = true;
}
bool Dataset_settings::poniRot3RadIsSet() const
{
return m_Poni_rot3_radIsSet;
}
void Dataset_settings::unsetPoni_rot3_rad()
{
m_Poni_rot3_radIsSet = false;
}
org::openapitools::server::model::Dataset_settings_unit_cell Dataset_settings::getUnitCell() const
{
return m_Unit_cell;

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,6 +19,7 @@
#define Dataset_settings_H_
#include "Grid_scan.h"
#include <nlohmann/json.hpp>
#include "Rotation_axis.h"
#include <string>
@@ -159,6 +160,13 @@ public:
bool goniometerIsSet() const;
void unsetGoniometer();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Grid_scan getGridScan() const;
void setGridScan(org::openapitools::server::model::Grid_scan const& value);
bool gridScanIsSet() const;
void unsetGrid_scan();
/// <summary>
/// Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) In general, it is not saved in HDF5 file. However, if values are placed in \&quot;hdf5\&quot; object, &#x60;jfjoch_writer&#x60; will write them in /entry/data of the HDF5 file. This applies solely to string and number (double floating-point). No arrays/sub-objects is allowed. For example {\&quot;hdf5\&quot;: {\&quot;val1\&quot;:1, \&quot;val2\&quot;:\&quot;xyz\&quot;}}, will write /entry/user/val1 and /entry/user/val2.
/// </summary>
nlohmann::json getHeaderAppendix() const;
@@ -229,6 +237,34 @@ public:
bool saveCalibrationIsSet() const;
void unsetSave_calibration();
/// <summary>
/// Polarization factor for integration; 1.0 is horizontal polarization; -1.0 is vertical polarization
/// </summary>
float getPolarizationFactor() const;
void setPolarizationFactor(float const value);
bool polarizationFactorIsSet() const;
void unsetPolarization_factor();
/// <summary>
/// PONI angle rot1 (see PyFAI documentation for details) in radians
/// </summary>
float getPoniRot1Rad() const;
void setPoniRot1Rad(float const value);
bool poniRot1RadIsSet() const;
void unsetPoni_rot1_rad();
/// <summary>
/// PONI angle rot2 (see PyFAI documentation for details) in radians
/// </summary>
float getPoniRot2Rad() const;
void setPoniRot2Rad(float const value);
bool poniRot2RadIsSet() const;
void unsetPoni_rot2_rad();
/// <summary>
/// PONI angle rot3 (see PyFAI documentation for details) in radians
/// </summary>
float getPoniRot3Rad() const;
void setPoniRot3Rad(float const value);
bool poniRot3RadIsSet() const;
void unsetPoni_rot3_rad();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Dataset_settings_unit_cell getUnitCell() const;
@@ -269,6 +305,8 @@ protected:
bool m_TransmissionIsSet;
org::openapitools::server::model::Rotation_axis m_Goniometer;
bool m_GoniometerIsSet;
org::openapitools::server::model::Grid_scan m_Grid_scan;
bool m_Grid_scanIsSet;
nlohmann::json m_Header_appendix;
bool m_Header_appendixIsSet;
nlohmann::json m_Image_appendix;
@@ -289,6 +327,14 @@ protected:
bool m_Write_nxmx_hdf5_masterIsSet;
bool m_Save_calibration;
bool m_Save_calibrationIsSet;
float m_Polarization_factor;
bool m_Polarization_factorIsSet;
float m_Poni_rot1_rad;
bool m_Poni_rot1_radIsSet;
float m_Poni_rot2_rad;
bool m_Poni_rot2_radIsSet;
float m_Poni_rot3_rad;
bool m_Poni_rot3_radIsSet;
org::openapitools::server::model::Dataset_settings_unit_cell m_Unit_cell;
bool m_Unit_cellIsSet;

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -84,6 +84,12 @@ void to_json(nlohmann::json& j, const File_writer_format& o)
case File_writer_format::eFile_writer_format::NXMXVDS:
j = "NXmxVDS";
break;
case File_writer_format::eFile_writer_format::CBF:
j = "CBF";
break;
case File_writer_format::eFile_writer_format::TIFF:
j = "TIFF";
break;
}
}
@@ -99,6 +105,12 @@ void from_json(const nlohmann::json& j, File_writer_format& o)
}
else if (s == "NXmxVDS") {
o.setValue(File_writer_format::eFile_writer_format::NXMXVDS);
}
else if (s == "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"

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -40,7 +40,9 @@ public:
INVALID_VALUE_OPENAPI_GENERATED = 0,
NONE,
NXMXLEGACY,
NXMXVDS
NXMXVDS,
CBF,
TIFF
};
/// <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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,139 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.40
* 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 "Grid_plot.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Grid_plot::Grid_plot()
{
m_Width = 0L;
}
void Grid_plot::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Grid_plot::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Grid_plot::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_plot" : pathPrefix;
/* Data */ {
const std::vector<float>& value = m_Data;
const std::string currentValuePath = _pathPrefix + ".data";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const float& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
/* Width */ {
const int64_t& value = m_Width;
const std::string currentValuePath = _pathPrefix + ".width";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
return success;
}
bool Grid_plot::operator==(const Grid_plot& rhs) const
{
return
(getData() == rhs.getData())
&&
(getWidth() == rhs.getWidth())
;
}
bool Grid_plot::operator!=(const Grid_plot& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Grid_plot& o)
{
j = nlohmann::json::object();
j["data"] = o.m_Data;
j["width"] = o.m_Width;
}
void from_json(const nlohmann::json& j, Grid_plot& o)
{
j.at("data").get_to(o.m_Data);
j.at("width").get_to(o.m_Width);
}
std::vector<float> Grid_plot::getData() const
{
return m_Data;
}
void Grid_plot::setData(std::vector<float> const value)
{
m_Data = value;
}
int64_t Grid_plot::getWidth() const
{
return m_Width;
}
void Grid_plot::setWidth(int64_t const value)
{
m_Width = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,84 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.40
* 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.
*/
/*
* Grid_plot.h
*
*
*/
#ifndef Grid_plot_H_
#define Grid_plot_H_
#include <vector>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Grid_plot
{
public:
Grid_plot();
virtual ~Grid_plot() = 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 Grid_plot& rhs) const;
bool operator!=(const Grid_plot& rhs) const;
/////////////////////////////////////////////
/// Grid_plot members
/// <summary>
///
/// </summary>
std::vector<float> getData() const;
void setData(std::vector<float> const value);
/// <summary>
///
/// </summary>
int64_t getWidth() const;
void setWidth(int64_t const value);
friend void to_json(nlohmann::json& j, const Grid_plot& o);
friend void from_json(const nlohmann::json& j, Grid_plot& o);
protected:
std::vector<float> m_Data;
int64_t m_Width;
};
} // namespace org::openapitools::server::model
#endif /* Grid_plot_H_ */

View File

@@ -0,0 +1,139 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.40
* 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 "Grid_plots.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Grid_plots::Grid_plots()
{
m_Width = 0L;
}
void Grid_plots::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Grid_plots::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Grid_plots::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_plots" : pathPrefix;
/* Plots */ {
const std::vector<org::openapitools::server::model::Grid_plot>& value = m_Plots;
const std::string currentValuePath = _pathPrefix + ".plots";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const org::openapitools::server::model::Grid_plot& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".plots") && success;
i++;
}
}
}
/* Width */ {
const int64_t& value = m_Width;
const std::string currentValuePath = _pathPrefix + ".width";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
return success;
}
bool Grid_plots::operator==(const Grid_plots& rhs) const
{
return
(getPlots() == rhs.getPlots())
&&
(getWidth() == rhs.getWidth())
;
}
bool Grid_plots::operator!=(const Grid_plots& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Grid_plots& o)
{
j = nlohmann::json::object();
j["plots"] = o.m_Plots;
j["width"] = o.m_Width;
}
void from_json(const nlohmann::json& j, Grid_plots& o)
{
j.at("plots").get_to(o.m_Plots);
j.at("width").get_to(o.m_Width);
}
std::vector<org::openapitools::server::model::Grid_plot> Grid_plots::getPlots() const
{
return m_Plots;
}
void Grid_plots::setPlots(std::vector<org::openapitools::server::model::Grid_plot> const& value)
{
m_Plots = value;
}
int64_t Grid_plots::getWidth() const
{
return m_Width;
}
void Grid_plots::setWidth(int64_t const value)
{
m_Width = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,85 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.40
* 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.
*/
/*
* Grid_plots.h
*
*
*/
#ifndef Grid_plots_H_
#define Grid_plots_H_
#include <vector>
#include "Grid_plot.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Grid_plots
{
public:
Grid_plots();
virtual ~Grid_plots() = 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 Grid_plots& rhs) const;
bool operator!=(const Grid_plots& rhs) const;
/////////////////////////////////////////////
/// Grid_plots members
/// <summary>
///
/// </summary>
std::vector<org::openapitools::server::model::Grid_plot> getPlots() const;
void setPlots(std::vector<org::openapitools::server::model::Grid_plot> const& value);
/// <summary>
///
/// </summary>
int64_t getWidth() const;
void setWidth(int64_t const value);
friend void to_json(nlohmann::json& j, const Grid_plots& o);
friend void from_json(const nlohmann::json& j, Grid_plots& o);
protected:
std::vector<org::openapitools::server::model::Grid_plot> m_Plots;
int64_t m_Width;
};
} // namespace org::openapitools::server::model
#endif /* Grid_plots_H_ */

View File

@@ -0,0 +1,191 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.43
* 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 "Grid_scan.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Grid_scan::Grid_scan()
{
m_N_fast = 0L;
m_Step_x_um = 0.0f;
m_Step_y_um = 0.0f;
m_Vertical = false;
m_VerticalIsSet = false;
m_Snake = false;
m_SnakeIsSet = false;
}
void Grid_scan::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Grid_scan::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Grid_scan::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan" : pathPrefix;
/* N_fast */ {
const int64_t& value = m_N_fast;
const std::string currentValuePath = _pathPrefix + ".nFast";
if (value < 1ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 1;";
}
}
return success;
}
bool Grid_scan::operator==(const Grid_scan& rhs) const
{
return
(getNFast() == rhs.getNFast())
&&
(getStepXUm() == rhs.getStepXUm())
&&
(getStepYUm() == rhs.getStepYUm())
&&
((!verticalIsSet() && !rhs.verticalIsSet()) || (verticalIsSet() && rhs.verticalIsSet() && isVertical() == rhs.isVertical())) &&
((!snakeIsSet() && !rhs.snakeIsSet()) || (snakeIsSet() && rhs.snakeIsSet() && isSnake() == rhs.isSnake()))
;
}
bool Grid_scan::operator!=(const Grid_scan& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Grid_scan& o)
{
j = nlohmann::json::object();
j["n_fast"] = o.m_N_fast;
j["step_x_um"] = o.m_Step_x_um;
j["step_y_um"] = o.m_Step_y_um;
if(o.verticalIsSet())
j["vertical"] = o.m_Vertical;
if(o.snakeIsSet())
j["snake"] = o.m_Snake;
}
void from_json(const nlohmann::json& j, Grid_scan& o)
{
j.at("n_fast").get_to(o.m_N_fast);
j.at("step_x_um").get_to(o.m_Step_x_um);
j.at("step_y_um").get_to(o.m_Step_y_um);
if(j.find("vertical") != j.end())
{
j.at("vertical").get_to(o.m_Vertical);
o.m_VerticalIsSet = true;
}
if(j.find("snake") != j.end())
{
j.at("snake").get_to(o.m_Snake);
o.m_SnakeIsSet = true;
}
}
int64_t Grid_scan::getNFast() const
{
return m_N_fast;
}
void Grid_scan::setNFast(int64_t const value)
{
m_N_fast = value;
}
float Grid_scan::getStepXUm() const
{
return m_Step_x_um;
}
void Grid_scan::setStepXUm(float const value)
{
m_Step_x_um = value;
}
float Grid_scan::getStepYUm() const
{
return m_Step_y_um;
}
void Grid_scan::setStepYUm(float const value)
{
m_Step_y_um = value;
}
bool Grid_scan::isVertical() const
{
return m_Vertical;
}
void Grid_scan::setVertical(bool const value)
{
m_Vertical = value;
m_VerticalIsSet = true;
}
bool Grid_scan::verticalIsSet() const
{
return m_VerticalIsSet;
}
void Grid_scan::unsetVertical()
{
m_VerticalIsSet = false;
}
bool Grid_scan::isSnake() const
{
return m_Snake;
}
void Grid_scan::setSnake(bool const value)
{
m_Snake = value;
m_SnakeIsSet = true;
}
bool Grid_scan::snakeIsSet() const
{
return m_SnakeIsSet;
}
void Grid_scan::unsetSnake()
{
m_SnakeIsSet = false;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,108 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.43
* 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.
*/
/*
* Grid_scan.h
*
* Definition of a grid scan (mutually exclusive with &#x60;rotation_axis&#x60;)
*/
#ifndef Grid_scan_H_
#define Grid_scan_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Definition of a grid scan (mutually exclusive with &#x60;rotation_axis&#x60;)
/// </summary>
class Grid_scan
{
public:
Grid_scan();
virtual ~Grid_scan() = 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 Grid_scan& rhs) const;
bool operator!=(const Grid_scan& rhs) const;
/////////////////////////////////////////////
/// Grid_scan members
/// <summary>
/// Number of elements in the fast direction
/// </summary>
int64_t getNFast() const;
void setNFast(int64_t const value);
/// <summary>
/// Step in grid along the fast direction. Can be negative. Positive number: left to right Negative number: right to left
/// </summary>
float getStepXUm() const;
void setStepXUm(float const value);
/// <summary>
/// Step in grid along the slow direction. Can be negative. Positive number: top to bottom Negative number: bottom to top
/// </summary>
float getStepYUm() const;
void setStepYUm(float const value);
/// <summary>
/// If disabled: fast direction &#x3D; X, slow direction &#x3D; Y If enabled: fast direction &#x3D; Y, slow direction &#x3D; X
/// </summary>
bool isVertical() const;
void setVertical(bool const value);
bool verticalIsSet() const;
void unsetVertical();
/// <summary>
/// Flip fast direction for every second row
/// </summary>
bool isSnake() const;
void setSnake(bool const value);
bool snakeIsSet() const;
void unsetSnake();
friend void to_json(nlohmann::json& j, const Grid_scan& o);
friend void from_json(const nlohmann::json& j, Grid_scan& o);
protected:
int64_t m_N_fast;
float m_Step_x_um;
float m_Step_y_um;
bool m_Vertical;
bool m_VerticalIsSet;
bool m_Snake;
bool m_SnakeIsSet;
};
} // namespace org::openapitools::server::model
#endif /* Grid_scan_H_ */

View File

@@ -0,0 +1,281 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.43
* 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 "Grid_scan_result.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Grid_scan_result::Grid_scan_result()
{
}
void Grid_scan_result::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Grid_scan_result::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Grid_scan_result::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan_result" : pathPrefix;
/* Det_img */ {
const std::vector<int64_t>& value = m_Det_img;
const std::string currentValuePath = _pathPrefix + ".detImg";
{ // 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++;
}
}
}
/* Bkg_estimate */ {
const std::vector<float>& value = m_Bkg_estimate;
const std::string currentValuePath = _pathPrefix + ".bkgEstimate";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const float& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
/* Spot_count */ {
const std::vector<int64_t>& value = m_Spot_count;
const std::string currentValuePath = _pathPrefix + ".spotCount";
{ // 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++;
}
}
}
/* Indexed_lattices */ {
const std::vector<int64_t>& value = m_Indexed_lattices;
const std::string currentValuePath = _pathPrefix + ".indexedLattices";
{ // 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++;
}
}
}
/* Mosaicity */ {
const std::vector<float>& value = m_Mosaicity;
const std::string currentValuePath = _pathPrefix + ".mosaicity";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const float& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
/* B_factor */ {
const std::vector<float>& value = m_B_factor;
const std::string currentValuePath = _pathPrefix + ".bFactor";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const float& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
}
return success;
}
bool Grid_scan_result::operator==(const Grid_scan_result& rhs) const
{
return
(getDetImg() == rhs.getDetImg())
&&
(getBkgEstimate() == rhs.getBkgEstimate())
&&
(getSpotCount() == rhs.getSpotCount())
&&
(getIndexedLattices() == rhs.getIndexedLattices())
&&
(getMosaicity() == rhs.getMosaicity())
&&
(getBFactor() == rhs.getBFactor())
;
}
bool Grid_scan_result::operator!=(const Grid_scan_result& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Grid_scan_result& o)
{
j = nlohmann::json::object();
j["det_img"] = o.m_Det_img;
j["bkg_estimate"] = o.m_Bkg_estimate;
j["spot_count"] = o.m_Spot_count;
j["indexed_lattices"] = o.m_Indexed_lattices;
j["mosaicity"] = o.m_Mosaicity;
j["b_factor"] = o.m_B_factor;
}
void from_json(const nlohmann::json& j, Grid_scan_result& o)
{
j.at("det_img").get_to(o.m_Det_img);
j.at("bkg_estimate").get_to(o.m_Bkg_estimate);
j.at("spot_count").get_to(o.m_Spot_count);
j.at("indexed_lattices").get_to(o.m_Indexed_lattices);
j.at("mosaicity").get_to(o.m_Mosaicity);
j.at("b_factor").get_to(o.m_B_factor);
}
std::vector<int64_t> Grid_scan_result::getDetImg() const
{
return m_Det_img;
}
void Grid_scan_result::setDetImg(std::vector<int64_t> const value)
{
m_Det_img = value;
}
std::vector<float> Grid_scan_result::getBkgEstimate() const
{
return m_Bkg_estimate;
}
void Grid_scan_result::setBkgEstimate(std::vector<float> const value)
{
m_Bkg_estimate = value;
}
std::vector<int64_t> Grid_scan_result::getSpotCount() const
{
return m_Spot_count;
}
void Grid_scan_result::setSpotCount(std::vector<int64_t> const value)
{
m_Spot_count = value;
}
std::vector<int64_t> Grid_scan_result::getIndexedLattices() const
{
return m_Indexed_lattices;
}
void Grid_scan_result::setIndexedLattices(std::vector<int64_t> const value)
{
m_Indexed_lattices = value;
}
std::vector<float> Grid_scan_result::getMosaicity() const
{
return m_Mosaicity;
}
void Grid_scan_result::setMosaicity(std::vector<float> const value)
{
m_Mosaicity = value;
}
std::vector<float> Grid_scan_result::getBFactor() const
{
return m_B_factor;
}
void Grid_scan_result::setBFactor(std::vector<float> const value)
{
m_B_factor = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,112 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.43
* 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.
*/
/*
* Grid_scan_result.h
*
* Results of a grid scan
*/
#ifndef Grid_scan_result_H_
#define Grid_scan_result_H_
#include <vector>
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Results of a grid scan
/// </summary>
class Grid_scan_result
{
public:
Grid_scan_result();
virtual ~Grid_scan_result() = 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 Grid_scan_result& rhs) const;
bool operator!=(const Grid_scan_result& rhs) const;
/////////////////////////////////////////////
/// Grid_scan_result members
/// <summary>
/// Detector image number for a given cell
/// </summary>
std::vector<int64_t> getDetImg() const;
void setDetImg(std::vector<int64_t> const value);
/// <summary>
///
/// </summary>
std::vector<float> getBkgEstimate() const;
void setBkgEstimate(std::vector<float> const value);
/// <summary>
///
/// </summary>
std::vector<int64_t> getSpotCount() const;
void setSpotCount(std::vector<int64_t> const value);
/// <summary>
///
/// </summary>
std::vector<int64_t> getIndexedLattices() const;
void setIndexedLattices(std::vector<int64_t> const value);
/// <summary>
///
/// </summary>
std::vector<float> getMosaicity() const;
void setMosaicity(std::vector<float> const value);
/// <summary>
///
/// </summary>
std::vector<float> getBFactor() const;
void setBFactor(std::vector<float> const value);
friend void to_json(nlohmann::json& j, const Grid_scan_result& o);
friend void from_json(const nlohmann::json& j, Grid_scan_result& o);
protected:
std::vector<int64_t> m_Det_img;
std::vector<float> m_Bkg_estimate;
std::vector<int64_t> m_Spot_count;
std::vector<int64_t> m_Indexed_lattices;
std::vector<float> m_Mosaicity;
std::vector<float> m_B_factor;
};
} // namespace org::openapitools::server::model
#endif /* Grid_scan_result_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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,6 +21,8 @@ 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;
@@ -47,6 +49,34 @@ bool Image_buffer_status::validate(std::stringstream& msg, const std::string& pa
/* 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";
@@ -75,6 +105,12 @@ bool Image_buffer_status::operator==(const Image_buffer_status& rhs) const
return
(getMinImageNumber() == rhs.getMinImageNumber())
&&
(getMaxImageNumber() == rhs.getMaxImageNumber())
&&
(getImageNumbers() == rhs.getImageNumbers())
&&
@@ -95,6 +131,8 @@ bool Image_buffer_status::operator!=(const Image_buffer_status& rhs) const
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;
@@ -103,12 +141,30 @@ void to_json(nlohmann::json& j, const Image_buffer_status& o)
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;

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -58,6 +58,16 @@ public:
/////////////////////////////////////////////
/// 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>
@@ -77,6 +87,10 @@ public:
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;

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -0,0 +1,122 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.
*
* The version of the OpenAPI document: 1.0.0-rc.43
* 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 "Indexing_algorithm.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Indexing_algorithm::Indexing_algorithm()
{
}
void Indexing_algorithm::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Indexing_algorithm::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Indexing_algorithm::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_algorithm" : pathPrefix;
if (m_value == Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Indexing_algorithm::operator==(const Indexing_algorithm& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Indexing_algorithm::operator!=(const Indexing_algorithm& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Indexing_algorithm& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Indexing_algorithm::eIndexing_algorithm::FFBIDX:
j = "FFBIDX";
break;
case Indexing_algorithm::eIndexing_algorithm::FFT:
j = "FFT";
break;
case Indexing_algorithm::eIndexing_algorithm::NONE:
j = "None";
break;
}
}
void from_json(const nlohmann::json& j, Indexing_algorithm& o)
{
auto s = j.get<std::string>();
if (s == "FFBIDX") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::FFBIDX);
}
else if (s == "FFT") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::FFT);
}
else if (s == "None") {
o.setValue(Indexing_algorithm::eIndexing_algorithm::NONE);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Indexing_algorithm::eIndexing_algorithm";
throw std::invalid_argument(ss.str());
}
}
Indexing_algorithm::eIndexing_algorithm Indexing_algorithm::getValue() const
{
return m_value;
}
void Indexing_algorithm::setValue(Indexing_algorithm::eIndexing_algorithm value)
{
m_value = value;
}
} // 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.43
* 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.
*/
/*
* Indexing_algorithm.h
*
* Selection of an indexing algorithm used by Jungfraujoch
*/
#ifndef Indexing_algorithm_H_
#define Indexing_algorithm_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Selection of an indexing algorithm used by Jungfraujoch
/// </summary>
class Indexing_algorithm
{
public:
Indexing_algorithm();
virtual ~Indexing_algorithm() = default;
enum class eIndexing_algorithm {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
FFBIDX,
FFT,
NONE
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const Indexing_algorithm& rhs) const;
bool operator!=(const Indexing_algorithm& rhs) const;
/////////////////////////////////////////////
/// Indexing_algorithm members
Indexing_algorithm::eIndexing_algorithm getValue() const;
void setValue(Indexing_algorithm::eIndexing_algorithm value);
friend void to_json(nlohmann::json& j, const Indexing_algorithm& o);
friend void from_json(const nlohmann::json& j, Indexing_algorithm& o);
protected:
Indexing_algorithm::eIndexing_algorithm m_value = Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Indexing_algorithm_H_ */

View File

@@ -0,0 +1,250 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.43
* 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 "Indexing_settings.h"
#include "Helpers.h"
#include <sstream>
namespace org::openapitools::server::model
{
Indexing_settings::Indexing_settings()
{
m_Fft_max_unit_cell_A = 250.0f;
m_Fft_min_unit_cell_A = 10.0f;
m_Fft_high_resolution_A = 2.0f;
m_Fft_num_vectors = 16384L;
m_Tolerance = 0.0f;
}
void Indexing_settings::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Indexing_settings::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Indexing_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_settings" : pathPrefix;
/* Fft_max_unit_cell_A */ {
const float& value = m_Fft_max_unit_cell_A;
const std::string currentValuePath = _pathPrefix + ".fftMaxUnitCellA";
if (value < static_cast<float>(50))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 50;";
}
if (value > static_cast<float>(500))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 500;";
}
}
/* Fft_min_unit_cell_A */ {
const float& value = m_Fft_min_unit_cell_A;
const std::string currentValuePath = _pathPrefix + ".fftMinUnitCellA";
if (value < static_cast<float>(5))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 5;";
}
if (value > static_cast<float>(40))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 40;";
}
}
/* Fft_high_resolution_A */ {
const float& value = m_Fft_high_resolution_A;
const std::string currentValuePath = _pathPrefix + ".fftHighResolutionA";
if (value < static_cast<float>(0.5))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.5;";
}
if (value > static_cast<float>(6.0))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 6.0;";
}
}
/* Fft_num_vectors */ {
const int64_t& value = m_Fft_num_vectors;
const std::string currentValuePath = _pathPrefix + ".fftNumVectors";
if (value < 128ll)
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 128;";
}
}
/* Tolerance */ {
const float& value = m_Tolerance;
const std::string currentValuePath = _pathPrefix + ".tolerance";
if (value < static_cast<float>(0.0))
{
success = false;
msg << currentValuePath << ": must be greater than or equal to 0.0;";
}
if (value > static_cast<float>(0.5))
{
success = false;
msg << currentValuePath << ": must be less than or equal to 0.5;";
}
}
return success;
}
bool Indexing_settings::operator==(const Indexing_settings& rhs) const
{
return
(getAlgorithm() == rhs.getAlgorithm())
&&
(getFftMaxUnitCellA() == rhs.getFftMaxUnitCellA())
&&
(getFftMinUnitCellA() == rhs.getFftMinUnitCellA())
&&
(getFftHighResolutionA() == rhs.getFftHighResolutionA())
&&
(getFftNumVectors() == rhs.getFftNumVectors())
&&
(getTolerance() == rhs.getTolerance())
;
}
bool Indexing_settings::operator!=(const Indexing_settings& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Indexing_settings& o)
{
j = nlohmann::json::object();
j["algorithm"] = o.m_Algorithm;
j["fft_max_unit_cell_A"] = o.m_Fft_max_unit_cell_A;
j["fft_min_unit_cell_A"] = o.m_Fft_min_unit_cell_A;
j["fft_high_resolution_A"] = o.m_Fft_high_resolution_A;
j["fft_num_vectors"] = o.m_Fft_num_vectors;
j["tolerance"] = o.m_Tolerance;
}
void from_json(const nlohmann::json& j, Indexing_settings& o)
{
j.at("algorithm").get_to(o.m_Algorithm);
j.at("fft_max_unit_cell_A").get_to(o.m_Fft_max_unit_cell_A);
j.at("fft_min_unit_cell_A").get_to(o.m_Fft_min_unit_cell_A);
j.at("fft_high_resolution_A").get_to(o.m_Fft_high_resolution_A);
j.at("fft_num_vectors").get_to(o.m_Fft_num_vectors);
j.at("tolerance").get_to(o.m_Tolerance);
}
org::openapitools::server::model::Indexing_algorithm Indexing_settings::getAlgorithm() const
{
return m_Algorithm;
}
void Indexing_settings::setAlgorithm(org::openapitools::server::model::Indexing_algorithm const& value)
{
m_Algorithm = value;
}
float Indexing_settings::getFftMaxUnitCellA() const
{
return m_Fft_max_unit_cell_A;
}
void Indexing_settings::setFftMaxUnitCellA(float const value)
{
m_Fft_max_unit_cell_A = value;
}
float Indexing_settings::getFftMinUnitCellA() const
{
return m_Fft_min_unit_cell_A;
}
void Indexing_settings::setFftMinUnitCellA(float const value)
{
m_Fft_min_unit_cell_A = value;
}
float Indexing_settings::getFftHighResolutionA() const
{
return m_Fft_high_resolution_A;
}
void Indexing_settings::setFftHighResolutionA(float const value)
{
m_Fft_high_resolution_A = value;
}
int64_t Indexing_settings::getFftNumVectors() const
{
return m_Fft_num_vectors;
}
void Indexing_settings::setFftNumVectors(int64_t const value)
{
m_Fft_num_vectors = value;
}
float Indexing_settings::getTolerance() const
{
return m_Tolerance;
}
void Indexing_settings::setTolerance(float const value)
{
m_Tolerance = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,112 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.43
* 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.
*/
/*
* Indexing_settings.h
*
* Settings for crystallography indexing
*/
#ifndef Indexing_settings_H_
#define Indexing_settings_H_
#include "Indexing_algorithm.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
/// Settings for crystallography indexing
/// </summary>
class Indexing_settings
{
public:
Indexing_settings();
virtual ~Indexing_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 Indexing_settings& rhs) const;
bool operator!=(const Indexing_settings& rhs) const;
/////////////////////////////////////////////
/// Indexing_settings members
/// <summary>
///
/// </summary>
org::openapitools::server::model::Indexing_algorithm getAlgorithm() const;
void setAlgorithm(org::openapitools::server::model::Indexing_algorithm const& value);
/// <summary>
/// Largest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT
/// </summary>
float getFftMaxUnitCellA() const;
void setFftMaxUnitCellA(float const value);
/// <summary>
/// Smallest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT
/// </summary>
float getFftMinUnitCellA() const;
void setFftMinUnitCellA(float const value);
/// <summary>
/// Highest resolution of spots used for FFT algorithm; parameter value affects execution time of FFT. There is also correlation between smallest unit cell and max resolution, which need to be checked for very small systems.
/// </summary>
float getFftHighResolutionA() const;
void setFftHighResolutionA(float const value);
/// <summary>
/// Number of search directions for the FFT algorithm; parameter value affects execution time of FFT.
/// </summary>
int64_t getFftNumVectors() const;
void setFftNumVectors(int64_t const value);
/// <summary>
/// Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted
/// </summary>
float getTolerance() const;
void setTolerance(float const value);
friend void to_json(nlohmann::json& j, const Indexing_settings& o);
friend void from_json(const nlohmann::json& j, Indexing_settings& o);
protected:
org::openapitools::server::model::Indexing_algorithm m_Algorithm;
float m_Fft_max_unit_cell_A;
float m_Fft_min_unit_cell_A;
float m_Fft_high_resolution_A;
int64_t m_Fft_num_vectors;
float m_Tolerance;
};
} // namespace org::openapitools::server::model
#endif /* Indexing_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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -25,6 +25,7 @@ Jfjoch_settings::Jfjoch_settings()
m_ZeromqIsSet = false;
m_InstrumentIsSet = false;
m_File_writerIsSet = false;
m_IndexingIsSet = false;
m_Detector_settingsIsSet = false;
m_Azim_intIsSet = false;
m_Image_formatIsSet = false;
@@ -35,6 +36,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;
@@ -101,7 +103,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr
}
}
if (imageBufferMiBIsSet())
{
const int32_t& value = m_Image_buffer_MiB;
@@ -134,7 +136,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;
}
@@ -159,6 +182,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const
&&
((!indexingIsSet() && !rhs.indexingIsSet()) || (indexingIsSet() && rhs.indexingIsSet() && getIndexing() == rhs.getIndexing())) &&
((!detectorSettingsIsSet() && !rhs.detectorSettingsIsSet()) || (detectorSettingsIsSet() && rhs.detectorSettingsIsSet() && getDetectorSettings() == rhs.getDetectorSettings())) &&
@@ -179,6 +205,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())
&&
@@ -208,6 +237,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o)
if(o.fileWriterIsSet())
j["file_writer"] = o.m_File_writer;
j["detector"] = o.m_Detector;
if(o.indexingIsSet())
j["indexing"] = o.m_Indexing;
if(o.detectorSettingsIsSet())
j["detector_settings"] = o.m_Detector_settings;
if(o.azimIntIsSet())
@@ -221,6 +252,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;
@@ -252,6 +285,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o)
o.m_File_writerIsSet = true;
}
j.at("detector").get_to(o.m_Detector);
if(j.find("indexing") != j.end())
{
j.at("indexing").get_to(o.m_Indexing);
o.m_IndexingIsSet = true;
}
if(j.find("detector_settings") != j.end())
{
j.at("detector_settings").get_to(o.m_Detector_settings);
@@ -283,6 +321,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())
{
@@ -373,6 +416,23 @@ void Jfjoch_settings::setDetector(std::vector<org::openapitools::server::model::
{
m_Detector = value;
}
org::openapitools::server::model::Indexing_settings Jfjoch_settings::getIndexing() const
{
return m_Indexing;
}
void Jfjoch_settings::setIndexing(org::openapitools::server::model::Indexing_settings const& value)
{
m_Indexing = value;
m_IndexingIsSet = true;
}
bool Jfjoch_settings::indexingIsSet() const
{
return m_IndexingIsSet;
}
void Jfjoch_settings::unsetIndexing()
{
m_IndexingIsSet = false;
}
org::openapitools::server::model::Detector_settings Jfjoch_settings::getDetectorSettings() const
{
return m_Detector_settings;
@@ -483,6 +543,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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,6 +28,7 @@
#include "Zeromq_metadata_settings.h"
#include "Detector_settings.h"
#include <vector>
#include "Indexing_settings.h"
#include "Detector.h"
#include "Image_pusher_type.h"
#include "Zeromq_settings.h"
@@ -106,6 +107,13 @@ public:
/// <summary>
///
/// </summary>
org::openapitools::server::model::Indexing_settings getIndexing() const;
void setIndexing(org::openapitools::server::model::Indexing_settings const& value);
bool indexingIsSet() const;
void unsetIndexing();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Detector_settings getDetectorSettings() const;
void setDetectorSettings(org::openapitools::server::model::Detector_settings const& value);
bool detectorSettingsIsSet() const;
@@ -151,6 +159,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;
@@ -183,6 +198,8 @@ protected:
bool m_File_writerIsSet;
std::vector<org::openapitools::server::model::Detector> m_Detector;
org::openapitools::server::model::Indexing_settings m_Indexing;
bool m_IndexingIsSet;
org::openapitools::server::model::Detector_settings m_Detector_settings;
bool m_Detector_settingsIsSet;
org::openapitools::server::model::Azim_int_settings m_Azim_int;
@@ -197,6 +214,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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -37,6 +37,8 @@ Jfjoch_statistics::Jfjoch_statistics()
m_Pixel_maskIsSet = false;
m_RoiIsSet = false;
m_Az_intIsSet = false;
m_BufferIsSet = false;
m_IndexingIsSet = false;
}
@@ -101,7 +103,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path
}
}
return success;
}
@@ -156,7 +158,13 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const
((!roiIsSet() && !rhs.roiIsSet()) || (roiIsSet() && rhs.roiIsSet() && getRoi() == rhs.getRoi())) &&
((!azIntIsSet() && !rhs.azIntIsSet()) || (azIntIsSet() && rhs.azIntIsSet() && getAzInt() == rhs.getAzInt()))
((!azIntIsSet() && !rhs.azIntIsSet()) || (azIntIsSet() && rhs.azIntIsSet() && getAzInt() == rhs.getAzInt())) &&
((!bufferIsSet() && !rhs.bufferIsSet()) || (bufferIsSet() && rhs.bufferIsSet() && getBuffer() == rhs.getBuffer())) &&
((!indexingIsSet() && !rhs.indexingIsSet()) || (indexingIsSet() && rhs.indexingIsSet() && getIndexing() == rhs.getIndexing()))
;
}
@@ -201,6 +209,10 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o)
j["roi"] = o.m_Roi;
if(o.azIntIsSet())
j["az_int"] = o.m_Az_int;
if(o.bufferIsSet())
j["buffer"] = o.m_Buffer;
if(o.indexingIsSet())
j["indexing"] = o.m_Indexing;
}
@@ -286,6 +298,16 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o)
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;
}
if(j.find("indexing") != j.end())
{
j.at("indexing").get_to(o.m_Indexing);
o.m_IndexingIsSet = true;
}
}
@@ -561,6 +583,40 @@ 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;
}
org::openapitools::server::model::Indexing_settings Jfjoch_statistics::getIndexing() const
{
return m_Indexing;
}
void Jfjoch_statistics::setIndexing(org::openapitools::server::model::Indexing_settings const& value)
{
m_Indexing = value;
m_IndexingIsSet = true;
}
bool Jfjoch_statistics::indexingIsSet() const
{
return m_IndexingIsSet;
}
void Jfjoch_statistics::unsetIndexing()
{
m_IndexingIsSet = 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -32,9 +32,11 @@
#include "Zeromq_metadata_settings.h"
#include "Detector_settings.h"
#include <vector>
#include "Indexing_settings.h"
#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>
@@ -186,6 +188,20 @@ public:
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();
/// <summary>
///
/// </summary>
org::openapitools::server::model::Indexing_settings getIndexing() const;
void setIndexing(org::openapitools::server::model::Indexing_settings const& value);
bool indexingIsSet() const;
void unsetIndexing();
friend void to_json(nlohmann::json& j, const Jfjoch_statistics& o);
friend void from_json(const nlohmann::json& j, Jfjoch_statistics& o);
@@ -222,6 +238,10 @@ protected:
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;
org::openapitools::server::model::Indexing_settings m_Indexing;
bool m_IndexingIsSet;
};

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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,6 +22,7 @@ namespace org::openapitools::server::model
Plot::Plot()
{
m_Title = "";
m_zIsSet = false;
}
@@ -81,6 +82,27 @@ bool Plot::validate(std::stringstream& msg, const std::string& pathPrefix) const
i++;
}
}
}
if (ZIsSet())
{
const std::vector<float>& value = m_z;
const std::string currentValuePath = _pathPrefix + ".Z";
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const float& value : value)
{
const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]";
i++;
}
}
@@ -102,8 +124,11 @@ bool Plot::operator==(const Plot& rhs) const
&&
(getY() == rhs.getY())
&&
((!ZIsSet() && !rhs.ZIsSet()) || (ZIsSet() && rhs.ZIsSet() && getZ() == rhs.getZ()))
;
}
@@ -118,6 +143,8 @@ void to_json(nlohmann::json& j, const Plot& o)
j["title"] = o.m_Title;
j["x"] = o.m_x;
j["y"] = o.m_y;
if(o.ZIsSet() || !o.m_z.empty())
j["z"] = o.m_z;
}
@@ -126,6 +153,11 @@ void from_json(const nlohmann::json& j, Plot& o)
j.at("title").get_to(o.m_Title);
j.at("x").get_to(o.m_x);
j.at("y").get_to(o.m_y);
if(j.find("z") != j.end())
{
j.at("z").get_to(o.m_z);
o.m_zIsSet = true;
}
}
@@ -153,6 +185,23 @@ void Plot::setY(std::vector<float> const value)
{
m_y = value;
}
std::vector<float> Plot::getZ() const
{
return m_z;
}
void Plot::setZ(std::vector<float> const value)
{
m_z = value;
m_zIsSet = true;
}
bool Plot::ZIsSet() const
{
return m_zIsSet;
}
void Plot::unsetz()
{
m_zIsSet = 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.34
* The version of the OpenAPI document: 1.0.0-rc.43
* Contact: filip.leonarski@psi.ch
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -74,6 +74,13 @@ public:
/// </summary>
std::vector<float> getY() const;
void setY(std::vector<float> const value);
/// <summary>
///
/// </summary>
std::vector<float> getZ() const;
void setZ(std::vector<float> const value);
bool ZIsSet() const;
void unsetz();
friend void to_json(nlohmann::json& j, const Plot& o);
friend void from_json(const nlohmann::json& j, Plot& o);
@@ -84,6 +91,8 @@ protected:
std::vector<float> m_y;
std::vector<float> m_z;
bool m_zIsSet;
};

View File

@@ -0,0 +1,224 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.40
* 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 "Plot_type_enum.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace org::openapitools::server::model
{
Plot_type_enum::Plot_type_enum()
{
}
void Plot_type_enum::validate() const
{
std::stringstream msg;
if (!validate(msg))
{
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Plot_type_enum::validate(std::stringstream& msg) const
{
return validate(msg, "");
}
bool Plot_type_enum::validate(std::stringstream& msg, const std::string& pathPrefix) const
{
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Plot_type_enum" : pathPrefix;
if (m_value == Plot_type_enum::ePlot_type_enum::INVALID_VALUE_OPENAPI_GENERATED)
{
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool Plot_type_enum::operator==(const Plot_type_enum& rhs) const
{
return
getValue() == rhs.getValue()
;
}
bool Plot_type_enum::operator!=(const Plot_type_enum& rhs) const
{
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const Plot_type_enum& o)
{
j = nlohmann::json::object();
switch (o.getValue())
{
case Plot_type_enum::ePlot_type_enum::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case Plot_type_enum::ePlot_type_enum::BKG_ESTIMATE:
j = "bkg_estimate";
break;
case Plot_type_enum::ePlot_type_enum::AZINT:
j = "azint";
break;
case Plot_type_enum::ePlot_type_enum::SPOT_COUNT:
j = "spot_count";
break;
case Plot_type_enum::ePlot_type_enum::INDEXING_RATE:
j = "indexing_rate";
break;
case Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_LENGTH:
j = "indexing_unit_cell_length";
break;
case Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_ANGLE:
j = "indexing_unit_cell_angle";
break;
case Plot_type_enum::ePlot_type_enum::ERROR_PIXELS:
j = "error_pixels";
break;
case Plot_type_enum::ePlot_type_enum::IMAGE_COLLECTION_EFFICIENCY:
j = "image_collection_efficiency";
break;
case Plot_type_enum::ePlot_type_enum::RECEIVER_DELAY:
j = "receiver_delay";
break;
case Plot_type_enum::ePlot_type_enum::RECEIVER_FREE_SEND_BUF:
j = "receiver_free_send_buf";
break;
case Plot_type_enum::ePlot_type_enum::STRONG_PIXELS:
j = "strong_pixels";
break;
case Plot_type_enum::ePlot_type_enum::ROI_SUM:
j = "roi_sum";
break;
case Plot_type_enum::ePlot_type_enum::ROI_MEAN:
j = "roi_mean";
break;
case Plot_type_enum::ePlot_type_enum::ROI_MAX_COUNT:
j = "roi_max_count";
break;
case Plot_type_enum::ePlot_type_enum::ROI_PIXELS:
j = "roi_pixels";
break;
case Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_X:
j = "roi_weighted_x";
break;
case Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_Y:
j = "roi_weighted_y";
break;
case Plot_type_enum::ePlot_type_enum::PACKETS_RECEIVED:
j = "packets_received";
break;
case Plot_type_enum::ePlot_type_enum::MAX_PIXEL_VALUE:
j = "max_pixel_value";
break;
case Plot_type_enum::ePlot_type_enum::RESOLUTION_ESTIMATE:
j = "resolution_estimate";
break;
}
}
void from_json(const nlohmann::json& j, Plot_type_enum& o)
{
auto s = j.get<std::string>();
if (s == "bkg_estimate") {
o.setValue(Plot_type_enum::ePlot_type_enum::BKG_ESTIMATE);
}
else if (s == "azint") {
o.setValue(Plot_type_enum::ePlot_type_enum::AZINT);
}
else if (s == "spot_count") {
o.setValue(Plot_type_enum::ePlot_type_enum::SPOT_COUNT);
}
else if (s == "indexing_rate") {
o.setValue(Plot_type_enum::ePlot_type_enum::INDEXING_RATE);
}
else if (s == "indexing_unit_cell_length") {
o.setValue(Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_LENGTH);
}
else if (s == "indexing_unit_cell_angle") {
o.setValue(Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_ANGLE);
}
else if (s == "error_pixels") {
o.setValue(Plot_type_enum::ePlot_type_enum::ERROR_PIXELS);
}
else if (s == "image_collection_efficiency") {
o.setValue(Plot_type_enum::ePlot_type_enum::IMAGE_COLLECTION_EFFICIENCY);
}
else if (s == "receiver_delay") {
o.setValue(Plot_type_enum::ePlot_type_enum::RECEIVER_DELAY);
}
else if (s == "receiver_free_send_buf") {
o.setValue(Plot_type_enum::ePlot_type_enum::RECEIVER_FREE_SEND_BUF);
}
else if (s == "strong_pixels") {
o.setValue(Plot_type_enum::ePlot_type_enum::STRONG_PIXELS);
}
else if (s == "roi_sum") {
o.setValue(Plot_type_enum::ePlot_type_enum::ROI_SUM);
}
else if (s == "roi_mean") {
o.setValue(Plot_type_enum::ePlot_type_enum::ROI_MEAN);
}
else if (s == "roi_max_count") {
o.setValue(Plot_type_enum::ePlot_type_enum::ROI_MAX_COUNT);
}
else if (s == "roi_pixels") {
o.setValue(Plot_type_enum::ePlot_type_enum::ROI_PIXELS);
}
else if (s == "roi_weighted_x") {
o.setValue(Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_X);
}
else if (s == "roi_weighted_y") {
o.setValue(Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_Y);
}
else if (s == "packets_received") {
o.setValue(Plot_type_enum::ePlot_type_enum::PACKETS_RECEIVED);
}
else if (s == "max_pixel_value") {
o.setValue(Plot_type_enum::ePlot_type_enum::MAX_PIXEL_VALUE);
}
else if (s == "resolution_estimate") {
o.setValue(Plot_type_enum::ePlot_type_enum::RESOLUTION_ESTIMATE);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " Plot_type_enum::ePlot_type_enum";
throw std::invalid_argument(ss.str());
}
}
Plot_type_enum::ePlot_type_enum Plot_type_enum::getValue() const
{
return m_value;
}
void Plot_type_enum::setValue(Plot_type_enum::ePlot_type_enum value)
{
m_value = value;
}
} // namespace org::openapitools::server::model

View File

@@ -0,0 +1,97 @@
/**
* Jungfraujoch
* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is 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.40
* 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.
*/
/*
* Plot_type_enum.h
*
*
*/
#ifndef Plot_type_enum_H_
#define Plot_type_enum_H_
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class Plot_type_enum
{
public:
Plot_type_enum();
virtual ~Plot_type_enum() = default;
enum class ePlot_type_enum {
// To have a valid default value.
// Avoiding name clashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
BKG_ESTIMATE,
AZINT,
SPOT_COUNT,
INDEXING_RATE,
INDEXING_UNIT_CELL_LENGTH,
INDEXING_UNIT_CELL_ANGLE,
ERROR_PIXELS,
IMAGE_COLLECTION_EFFICIENCY,
RECEIVER_DELAY,
RECEIVER_FREE_SEND_BUF,
STRONG_PIXELS,
ROI_SUM,
ROI_MEAN,
ROI_MAX_COUNT,
ROI_PIXELS,
ROI_WEIGHTED_X,
ROI_WEIGHTED_Y,
PACKETS_RECEIVED,
MAX_PIXEL_VALUE,
RESOLUTION_ESTIMATE
};
/// <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 Plot_type_enum& rhs) const;
bool operator!=(const Plot_type_enum& rhs) const;
/////////////////////////////////////////////
/// Plot_type_enum members
Plot_type_enum::ePlot_type_enum getValue() const;
void setValue(Plot_type_enum::ePlot_type_enum value);
friend void to_json(nlohmann::json& j, const Plot_type_enum& o);
friend void from_json(const nlohmann::json& j, Plot_type_enum& o);
protected:
Plot_type_enum::ePlot_type_enum m_value = Plot_type_enum::ePlot_type_enum::INVALID_VALUE_OPENAPI_GENERATED;
};
} // namespace org::openapitools::server::model
#endif /* Plot_type_enum_H_ */

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