diff --git a/CMakeLists.txt b/CMakeLists.txt index 74ef2984..e3b38839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,13 @@ SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only") SET(JFJOCH_INSTALL_DRIVER_SOURCE OFF CACHE BOOL "Install kernel driver source (ignored if building writer only; necessary for RPM building)") SET(JFJOCH_USE_CUDA ON CACHE BOOL "Compile Jungfraujoch with CUDA") SET(JFJOCH_VIEWER_BUILD OFF CACHE BOOL "Compile Jungfraujoch viewer") +SET(JFJOCH_USE_TORCH OFF CACHE BOOL "Compile ML support") + +#This is to supress error in TORCH +IF ((NOT EXISTS /usr/bin/python) AND (EXISTS /usr/bin/python3)) + SET(PYTHON_EXECUTABLE /usr/bin/python3) +ENDIF() + SET(BUILD_SHARED_LIBS OFF) SET(BUILD_TESTING OFF) @@ -65,6 +72,14 @@ IF (CMAKE_CUDA_COMPILER) ENDIF() ENDIF() +IF(JFJOCH_USE_TORCH) + FIND_PACKAGE(Protobuf REQUIRED) + FIND_PACKAGE(Torch HINTS /home/jungfrau/torch/lib/python3.11/site-packages/torch REQUIRED) + IF (${TORCH_FOUND}) + ADD_COMPILE_DEFINITIONS(JFJOCH_USE_TORCH) + ENDIF() +ENDIF() + INCLUDE_DIRECTORIES(include) INCLUDE(CheckIncludeFile) @@ -125,6 +140,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 +154,6 @@ ELSE() ADD_SUBDIRECTORY(image_analysis) ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tools) - ADD_SUBDIRECTORY(preview) ENDIF() IF (JFJOCH_VIEWER_BUILD) diff --git a/VERSION b/VERSION index 63f99b99..bd5cb50a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-rc.35 +1.0.0-rc.36 diff --git a/acquisition_device/AcquisitionCounters.cpp b/acquisition_device/AcquisitionCounters.cpp index 60e97668..ae9a84f9 100644 --- a/acquisition_device/AcquisitionCounters.cpp +++ b/acquisition_device/AcquisitionCounters.cpp @@ -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; diff --git a/acquisition_device/AcquisitionDevice.cpp b/acquisition_device/AcquisitionDevice.cpp index be5a8384..2f478afc 100644 --- a/acquisition_device/AcquisitionDevice.cpp +++ b/acquisition_device/AcquisitionDevice.cpp @@ -175,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& 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 tmp(RAW_MODULE_SIZE); @@ -198,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 tmp1(RAW_MODULE_SIZE); + std::vector 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 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) { @@ -317,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); } diff --git a/acquisition_device/AcquisitionDevice.h b/acquisition_device/AcquisitionDevice.h index 110f2aa7..49e84a2d 100644 --- a/acquisition_device/AcquisitionDevice.h +++ b/acquisition_device/AcquisitionDevice.h @@ -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& raw_roi_map); - void InitializeDataProcessing(const DiffractionExperiment &experiment, const RawGeomAzimuthalIntegration& azint); + void InitializeDataProcessing(const DiffractionExperiment &experiment, const AzimuthalIntegration& azint); const AcquisitionCounters& Counters() const; diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index e8f56d14..fe2004e9 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -227,39 +227,6 @@ void JFJochBrokerHttp::detector_status_get(Pistache::Http::ResponseWriter &respo response.send(Pistache::Http::Code::Not_Found); } -void JFJochBrokerHttp::preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) { - std::string s = state_machine.GetPreviewTIFF(true); - if (!s.empty()) - response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff")); - else - response.send(Pistache::Http::Code::Not_Found); -} - -void -JFJochBrokerHttp::preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings, - Pistache::Http::ResponseWriter &response) { - std::string s = state_machine.GetPreviewJPEG(Convert(previewSettings)); - if (!s.empty()) - response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg")); - else - response.send(Pistache::Http::Code::Not_Found); -} - -void JFJochBrokerHttp::preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) { - std::string s = state_machine.GetPreviewJPEG(PreviewJPEGSettings()); - if (!s.empty()) - response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg")); - else - response.send(Pistache::Http::Code::Not_Found); -} - -void JFJochBrokerHttp::preview_image_tiff_get(Pistache::Http::ResponseWriter &response) { - std::string s = state_machine.GetPreviewTIFF(false); - if (!s.empty()) - response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff")); - else - response.send(Pistache::Http::Code::Not_Found); -} void JFJochBrokerHttp::config_internal_generator_image_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) { @@ -352,6 +319,12 @@ void JFJochBrokerHttp::plot_bkg_estimate_get(const std::optional &binni GenericPlot(PlotType::BkgEstimate, binning, compression, response); } +void JFJochBrokerHttp::plot_resolution_estimate_get(const std::optional &binning, + const std::optional &compression, + Pistache::Http::ResponseWriter &response) { + GenericPlot(PlotType::ResolutionEstimate, binning, compression, response); +} + void JFJochBrokerHttp::plot_error_pixel_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) { @@ -553,6 +526,7 @@ void JFJochBrokerHttp::statistics_get(const std::optional &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())); auto zeromq_prev = state_machine.GetPreviewSocketSettings(); if (!zeromq_prev.address.empty()) @@ -609,6 +583,53 @@ void JFJochBrokerHttp::image_buffer_image_cbor_get(const std::optional response.send(Pistache::Http::Code::Not_Found); } +void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional &id, + const std::optional &showUserMask, + const std::optional &showRoi, + const std::optional &showSpots, + const std::optional &saturation, + const std::optional &jpegQuality, + const std::optional &showResRing, + const std::optional &color, + Pistache::Http::ResponseWriter &response) { + int64_t image_id = id.value_or(ImageBuffer::MaxImage); + PreviewJPEGSettings settings{}; + + settings.show_user_mask = showUserMask.value_or(true); + settings.show_roi = showRoi.value_or(false); + settings.show_spots = showSpots.value_or(true); + settings.saturation_value = saturation.value_or(10); + settings.jpeg_quality = jpegQuality.value_or(100); + settings.resolution_ring = showResRing; + settings.scale = ColorScaleEnum::Indigo; + + if (color == "viridis") + settings.scale = ColorScaleEnum::Viridis; + else if (color == "bw") + settings.scale = ColorScaleEnum::BW; + else if (color == "heat") + settings.scale = ColorScaleEnum::Heat; + + std::string s = state_machine.GetPreviewJPEG(settings, image_id); + if (!s.empty()) + response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/jpeg")); + else + response.send(Pistache::Http::Code::Not_Found); +} + +void +JFJochBrokerHttp::image_buffer_image_tiff_get(const std::optional &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 tmp_vector; state_machine.GetStartMessageFromBuffer(tmp_vector); diff --git a/broker/JFJochBrokerHttp.h b/broker/JFJochBrokerHttp.h index 332cff54..98ae4984 100644 --- a/broker/JFJochBrokerHttp.h +++ b/broker/JFJochBrokerHttp.h @@ -58,6 +58,8 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void plot_bkg_estimate_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; + void plot_resolution_estimate_get(const std::optional &binning, const std::optional &compression, + Pistache::Http::ResponseWriter &response) override; void plot_error_pixel_get(const std::optional &binning, const std::optional& compression, Pistache::Http::ResponseWriter &response) override; void plot_image_collection_efficiency_get(const std::optional &binning, const std::optional& compression, @@ -101,17 +103,10 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void trigger_post(Pistache::Http::ResponseWriter &response) override; void pedestal_post(Pistache::Http::ResponseWriter &response) override; - - void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) override; void preview_pedestal_tiff_get(const std::optional &gainLevel, const std::optional &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; @@ -192,9 +187,20 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) override; - void image_buffer_image_cbor_get(const std::optional &imageNumber, + void image_buffer_image_cbor_get(const std::optional &id, Pistache::Http::ResponseWriter &response) override; + void image_buffer_image_jpeg_get(const std::optional &id, + const std::optional &showUserMask, + const std::optional &showRoi, + const std::optional &showSpots, + const std::optional &saturation, + const std::optional &jpegQuality, + const std::optional &showResRing, + const std::optional &color, + Pistache::Http::ResponseWriter &response) override; + void image_buffer_image_tiff_get(const std::optional &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; diff --git a/broker/JFJochBrokerParser.cpp b/broker/JFJochBrokerParser.cpp index e74e86b4..19fc8f67 100644 --- a/broker/JFJochBrokerParser.cpp +++ b/broker/JFJochBrokerParser.cpp @@ -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 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; } diff --git a/broker/JFJochBrokerParser.h b/broker/JFJochBrokerParser.h index c47c39d2..a3152906 100644 --- a/broker/JFJochBrokerParser.h +++ b/broker/JFJochBrokerParser.h @@ -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); diff --git a/broker/JFJochServices.cpp b/broker/JFJochServices.cpp index b37b2176..70c43faf 100644 --- a/broker/JFJochServices.cpp +++ b/broker/JFJochServices.cpp @@ -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(); + switch (x.GetDetectorType()) { + case DetectorType::EIGER: + case DetectorType::JUNGFRAU: + detector = std::make_unique(); + break; + case DetectorType::DECTRIS: + detector = std::make_unique(); + 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(ret.receiver_output.efficiency * 100.0), - ret.receiver_output.status.max_receive_delay, - static_cast(std::round(ret.receiver_output.status.compressed_ratio.value()))); - else - logger.Info(" ... Receiver efficiency: {} % Max delay: {}", - static_cast(ret.receiver_output.efficiency * 100.0), - ret.receiver_output.status.max_receive_delay); + static_cast(ret.receiver_output.efficiency * 100.0), + ret.receiver_output.status.max_receive_delay.value_or(0), + static_cast(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++) { @@ -173,16 +176,16 @@ std::optional 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 +246,10 @@ void JFJochServices::GetStartMessageFromBuffer(std::vector &v) { return receiver->GetStartMessageFromBuffer(v); } -void JFJochServices::GetImageFromBuffer(std::vector &v, int64_t image_number) { +bool JFJochServices::GetImageFromBuffer(std::vector &v, int64_t image_number) { if (receiver) return receiver->GetImageFromBuffer(v, image_number); + return false; } ImageBufferStatus JFJochServices::GetImageBufferStatus() const { diff --git a/broker/JFJochServices.h b/broker/JFJochServices.h index 3c639bd7..a0ec78b7 100644 --- a/broker/JFJochServices.h +++ b/broker/JFJochServices.h @@ -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 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 &v) const; void GetXFELEventCode(std::vector &v) const; @@ -59,7 +59,7 @@ public: ZMQMetadataSettings GetMetadataSocketSettings(); void GetStartMessageFromBuffer(std::vector &v); - void GetImageFromBuffer(std::vector &v, int64_t image_number = -1); + bool GetImageFromBuffer(std::vector &v, int64_t image_number = -1); ImageBufferStatus GetImageBufferStatus() const; void ClearImageBuffer() const; }; diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 05563e3d..a7ed301d 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -6,6 +6,7 @@ #include "JFJochStateMachine.h" #include "../preview/JFJochTIFF.h" #include "pistache/net.h" +#include "../common/CUDAWrapper.h" JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_logger) : logger(in_logger), @@ -14,6 +15,18 @@ JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_l current_detector_setup(0), data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()), pixel_mask_statistics({0, 0, 0}) { + + indexing_possible = (get_gpu_count() >= 0); +#ifdef JFJOCH_USE_TORCH + resolution_estimate_possible = true; +#else + resolution_estimate_possible = false; +#endif + if (!indexing_possible) + data_processing_settings.indexing = false; + if (!resolution_estimate_possible) + data_processing_settings.resolution_estimate = false; + SupressTIFFErrors(); } @@ -50,17 +63,17 @@ bool JFJochStateMachine::ImportPedestalG1G2(const JFJochReceiverOutput &receiver } void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock &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 +276,12 @@ void JFJochStateMachine::PedestalThread(std::unique_lock ul) { void JFJochStateMachine::InitializeThread(std::unique_lock 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); } catch (const std::exception &e) { + logger.Error("Initialize error {}", e.what()); SetState(JFJochState::Error, e.what(), BrokerStatus::MessageSeverity::Error); throw; } @@ -489,8 +506,16 @@ MultiLinePlot JFJochStateMachine::GetPlots(const PlotRequest &request) const { void JFJochStateMachine::SetSpotFindingSettings(const SpotFindingSettings &settings) { std::unique_lock ul(data_processing_settings_mutex); DiffractionExperiment::CheckDataProcessingSettings(settings); + + // If there is no capability to use the features, make sure these are disabled + if (!indexing_possible) + data_processing_settings.indexing = false; + if (!resolution_estimate_possible) + data_processing_settings.resolution_estimate = false; + data_processing_settings = settings; - services.SetSpotFindingSettings(settings); + + services.SetSpotFindingSettings(data_processing_settings); } SpotFindingSettings JFJochStateMachine::GetSpotFindingSettings() const { @@ -518,20 +543,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 +577,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); @@ -620,12 +640,12 @@ void JFJochStateMachine::ResetError() noexcept { } } -std::string JFJochStateMachine::GetPreviewJPEG(const PreviewJPEGSettings &settings) const { - return services.GetPreviewJPEG(settings); +std::string JFJochStateMachine::GetPreviewJPEG(const PreviewJPEGSettings &settings, int64_t image_number) const { + return services.GetPreviewJPEG(settings, image_number); } -std::string JFJochStateMachine::GetPreviewTIFF(bool calibration) const { - return services.GetPreviewTIFF(calibration); +std::string JFJochStateMachine::GetPreviewTIFF(int64_t image_number) const { + return services.GetPreviewTIFF(image_number); } std::string JFJochStateMachine::GetPedestalTIFF(size_t gain_level, size_t sc) const { @@ -713,6 +733,9 @@ std::vector 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); @@ -720,6 +743,10 @@ std::string JFJochStateMachine::GetFullPixelMaskTIFF() const { std::string JFJochStateMachine::GetUserPixelMaskTIFF() const { std::unique_lock ul(m); + + if (state == JFJochState::Inactive) + return {}; + std::vector v = pixel_mask.GetUserMask(experiment); return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(), sizeof(uint32_t), false); @@ -727,11 +754,17 @@ std::string JFJochStateMachine::GetUserPixelMaskTIFF() const { std::vector JFJochStateMachine::GetFullPixelMask() const { std::unique_lock ul(m); + if (state == JFJochState::Inactive) + return {}; + return pixel_mask.GetMask(experiment); } std::vector JFJochStateMachine::GetUserPixelMask() const { std::unique_lock ul(m); + if (state == JFJochState::Inactive) + return {}; + return pixel_mask.GetUserMask(experiment); } @@ -782,7 +815,7 @@ void JFJochStateMachine::LoadImageFormatSettings(const ImageFormatSettings &sett if (recalc_mask) pixel_mask.LoadDetectorBadPixelMask(experiment, calibration.get()); else - pixel_mask.Update(settings); + pixel_mask.CalcEdgePixels(experiment); UpdatePixelMaskStatistics(pixel_mask.GetStatistics()); } @@ -830,7 +863,7 @@ void JFJochStateMachine::GetStartMessageFromBuffer(std::vector &v) { } void JFJochStateMachine::GetImageFromBuffer(std::vector &v, int64_t image_number) { - return services.GetImageFromBuffer(v, image_number); + services.GetImageFromBuffer(v, image_number); } ImageBufferStatus JFJochStateMachine::GetImageBufferStatus() const { diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 5ff6cc96..02fdf50b 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -36,6 +36,7 @@ struct DetectorListElement { std::chrono::microseconds readout_time; std::chrono::microseconds min_frame_time; std::chrono::microseconds min_count_time; + DetectorType detector_type; }; struct DetectorList { @@ -57,7 +58,7 @@ struct MeasurementStatistics { std::optional compression_ratio; bool cancelled; - int64_t max_receive_delay; + std::optional max_receive_delay; std::optional indexing_rate; @@ -97,9 +98,7 @@ class JFJochStateMachine { volatile bool cancel_sequence = false; std::unique_ptr 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 calibration_statistics; @@ -116,6 +115,9 @@ class JFJochStateMachine { mutable std::mutex roi_mutex; ROIDefinition roi; + bool indexing_possible; + bool resolution_estimate_possible; + void UpdatePixelMaskStatistics(const PixelMaskStatistics &input); // Private functions assume that lock m is acquired @@ -182,8 +184,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); diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 3c20f289..5218aa34 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -19,6 +19,7 @@ SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding ret.low_resolution_limit = input.getLowResolutionLimit(); ret.enable = input.isEnable(); ret.indexing = input.isIndexing(); + ret.resolution_estimate = input.isResolutionEstimate(); ret.indexing_tolerance = input.getIndexingTolerance(); if (input.filterPowderRingsIsSet()) ret.filter_spots_powder_ring = input.isFilterPowderRings(); @@ -40,6 +41,7 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin ret.setIndexingTolerance(input.indexing_tolerance); ret.setFilterPowderRings(input.filter_spots_powder_ring); ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring); + ret.setResolutionEstimate(input.resolution_estimate); return ret; } @@ -61,7 +63,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); @@ -336,6 +339,22 @@ org::openapitools::server::model::Detector_status Convert(const DetectorStatus & return output; } +org::openapitools::server::model::Detector_type Convert(const DetectorType &input) { + org::openapitools::server::model::Detector_type dt; + switch (input) { + case DetectorType::EIGER: + dt.setValue(org::openapitools::server::model::Detector_type::eDetector_type::EIGER); + break; + case DetectorType::JUNGFRAU: + dt.setValue(org::openapitools::server::model::Detector_type::eDetector_type::JUNGFRAU); + break; + case DetectorType::DECTRIS: + dt.setValue(org::openapitools::server::model::Detector_type::eDetector_type::DECTRIS); + break; + } + return dt; +} + org::openapitools::server::model::Detector_list Convert(const DetectorList &input) { org::openapitools::server::model::Detector_list ret; std::vector dets; @@ -352,6 +371,7 @@ org::openapitools::server::model::Detector_list Convert(const DetectorList &inpu d.setMinFrameTimeUs(input.detector[i].min_frame_time.count()); d.setMinCountTimeUs(input.detector[i].min_count_time.count()); d.setReadoutTimeUs(input.detector[i].readout_time.count()); + d.setType(Convert(input.detector[i].detector_type)); dets.emplace_back(std::move(d)); } ret.setDetectors(dets); @@ -400,7 +420,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 +448,7 @@ org::openapitools::server::model::Roi_azim_list Convert(const std::vector imageNumber; - if(imageNumberQuery.has_value()){ + auto idQuery = request.query().get("id"); + std::optional id; + if(idQuery.has_value()){ int64_t valueQuery_instance; - if(fromStringValue(imageNumberQuery.value(), valueQuery_instance)){ - imageNumber = valueQuery_instance; + if(fromStringValue(idQuery.value(), valueQuery_instance)){ + id = valueQuery_instance; } } try { - this->image_buffer_image_cbor_get(imageNumber, response); + this->image_buffer_image_cbor_get(id, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void DefaultApi::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the query params + auto idQuery = request.query().get("id"); + std::optional id; + if(idQuery.has_value()){ + int64_t valueQuery_instance; + if(fromStringValue(idQuery.value(), valueQuery_instance)){ + id = valueQuery_instance; + } + } + auto showUserMaskQuery = request.query().get("show_user_mask"); + std::optional showUserMask; + if(showUserMaskQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(showUserMaskQuery.value(), valueQuery_instance)){ + showUserMask = valueQuery_instance; + } + } + auto showRoiQuery = request.query().get("show_roi"); + std::optional showRoi; + if(showRoiQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(showRoiQuery.value(), valueQuery_instance)){ + showRoi = valueQuery_instance; + } + } + auto showSpotsQuery = request.query().get("show_spots"); + std::optional showSpots; + if(showSpotsQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(showSpotsQuery.value(), valueQuery_instance)){ + showSpots = valueQuery_instance; + } + } + auto saturationQuery = request.query().get("saturation"); + std::optional saturation; + if(saturationQuery.has_value()){ + int64_t valueQuery_instance; + if(fromStringValue(saturationQuery.value(), valueQuery_instance)){ + saturation = valueQuery_instance; + } + } + auto jpegQualityQuery = request.query().get("jpeg_quality"); + std::optional jpegQuality; + if(jpegQualityQuery.has_value()){ + int64_t valueQuery_instance; + if(fromStringValue(jpegQualityQuery.value(), valueQuery_instance)){ + jpegQuality = valueQuery_instance; + } + } + auto showResRingQuery = request.query().get("show_res_ring"); + std::optional showResRing; + if(showResRingQuery.has_value()){ + float valueQuery_instance; + if(fromStringValue(showResRingQuery.value(), valueQuery_instance)){ + showResRing = valueQuery_instance; + } + } + auto colorQuery = request.query().get("color"); + std::optional color; + if(colorQuery.has_value()){ + std::string valueQuery_instance; + if(fromStringValue(colorQuery.value(), valueQuery_instance)){ + color = valueQuery_instance; + } + } + + try { + this->image_buffer_image_jpeg_get(id, showUserMask, showRoi, showSpots, saturation, jpegQuality, showResRing, color, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void DefaultApi::image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the query params + auto idQuery = request.query().get("id"); + std::optional id; + if(idQuery.has_value()){ + int64_t valueQuery_instance; + if(fromStringValue(idQuery.value(), valueQuery_instance)){ + id = valueQuery_instance; + } + } + + try { + this->image_buffer_image_tiff_get(id, response); } catch (Pistache::Http::HttpError &e) { response.send(static_cast(e.code()), e.what()); return; @@ -1426,6 +1539,43 @@ void DefaultApi::plot_receiver_free_send_buffers_get_handler(const Pistache::Res response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } +} +void DefaultApi::plot_resolution_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the query params + auto binningQuery = request.query().get("binning"); + std::optional binning; + if(binningQuery.has_value()){ + int32_t valueQuery_instance; + if(fromStringValue(binningQuery.value(), valueQuery_instance)){ + binning = valueQuery_instance; + } + } + auto compressionQuery = request.query().get("compression"); + std::optional compression; + if(compressionQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(compressionQuery.value(), valueQuery_instance)){ + compression = valueQuery_instance; + } + } + + try { + this->plot_resolution_estimate_get(binning, compression, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + } void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { try { @@ -1722,94 +1872,6 @@ void DefaultApi::plot_strong_pixel_get_handler(const Pistache::Rest::Request &re response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } -} -void DefaultApi::preview_calibration_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->preview_calibration_tiff_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::preview_image_jpeg_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->preview_image_jpeg_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::preview_image_jpeg_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Preview_settings previewSettings; - - try { - nlohmann::json::parse(request.body()).get_to(previewSettings); - previewSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->preview_image_jpeg_post(previewSettings, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::preview_image_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->preview_image_tiff_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - } void DefaultApi::preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { try { diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h index cb6750c7..e645d499 100644 --- a/broker/gen/api/DefaultApi.h +++ b/broker/gen/api/DefaultApi.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -45,7 +45,6 @@ #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" @@ -103,6 +102,8 @@ 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); @@ -118,6 +119,7 @@ private: void plot_packets_received_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_receiver_delay_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_receiver_free_send_buffers_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void plot_resolution_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_roi_mean_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_roi_sum_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); @@ -126,10 +128,6 @@ private: void plot_roi_y_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_spot_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void plot_strong_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void preview_calibration_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void preview_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void preview_image_jpeg_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void preview_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); @@ -432,8 +430,31 @@ private: /// /// Contains full image data and metadata. The image must come from the latest data collection. /// - /// Image number. If omitted, the image with the highest number in the image buffer will be provided. (optional, default to 0L) - virtual void image_buffer_image_cbor_get(const std::optional &imageNumber, Pistache::Http::ResponseWriter &response) = 0; + /// 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) + virtual void image_buffer_image_cbor_get(const std::optional &id, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Get preview image in JPEG format using custom settings + /// + /// + /// + /// + /// 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) + /// Show user mask (optional, default to false) + /// Show ROI areas on the image (optional, default to false) + /// Show spot finding results on the image (optional, default to true) + /// Saturation value to set contrast in the preview image (optional, default to 0L) + /// Quality of JPEG image (100 - highest; 0 - lowest) (optional, default to 100L) + /// Show resolution ring, provided in Angstrom (optional, default to 0.1f) + /// Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat (optional, default to "indigo") + virtual void image_buffer_image_jpeg_get(const std::optional &id, const std::optional &showUserMask, const std::optional &showRoi, const std::optional &showSpots, const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Get preview image in TIFF format + /// + /// + /// + /// + /// 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) + virtual void image_buffer_image_tiff_get(const std::optional &id, Pistache::Http::ResponseWriter &response) = 0; /// /// Get Start message in CBOR format /// @@ -561,6 +582,15 @@ private: /// Enable DEFLATE compression of output data. (optional, default to true) virtual void plot_receiver_free_send_buffers_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// + /// Generate resolution estimate plot + /// + /// + /// Diffraction resolution, as estimated by SSRL ML model; binning is configurable + /// + /// Binning of frames for the plot (0 = default binning) (optional, default to 0) + /// Enable DEFLATE compression of output data. (optional, default to true) + virtual void plot_resolution_estimate_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; + /// /// Generate plot of ROI max count /// /// @@ -633,35 +663,6 @@ private: /// Enable DEFLATE compression of output data. (optional, default to true) virtual void plot_strong_pixel_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// - /// Get last preview image in TIFF format for calibration with PyFAI/Dioptas - /// - /// - /// Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction - /// - virtual void preview_calibration_tiff_get(Pistache::Http::ResponseWriter &response) = 0; - /// - /// Get last preview image in JPEG format using default settings - /// - /// - /// - /// - virtual void preview_image_jpeg_get(Pistache::Http::ResponseWriter &response) = 0; - /// - /// Get last preview image in JPEG format using custom settings - /// - /// - /// - /// - /// (optional) - virtual void preview_image_jpeg_post(const org::openapitools::server::model::Preview_settings &previewSettings, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Get last preview image in TIFF format - /// - /// - /// - /// - virtual void preview_image_tiff_get(Pistache::Http::ResponseWriter &response) = 0; - /// /// Get pedestal in TIFF format /// /// diff --git a/broker/gen/model/Azim_int_settings.cpp b/broker/gen/model/Azim_int_settings.cpp index 8e41df8e..aa208b74 100644 --- a/broker/gen/model/Azim_int_settings.cpp +++ b/broker/gen/model/Azim_int_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Azim_int_settings.h b/broker/gen/model/Azim_int_settings.h index 5c042f79..67c27737 100644 --- a/broker/gen/model/Azim_int_settings.h +++ b/broker/gen/model/Azim_int_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Broker_status.cpp b/broker/gen/model/Broker_status.cpp index 10309726..ca1d3740 100644 --- a/broker/gen/model/Broker_status.cpp +++ b/broker/gen/model/Broker_status.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Broker_status.h b/broker/gen/model/Broker_status.h index 0a5cc30b..f4be5755 100644 --- a/broker/gen/model/Broker_status.h +++ b/broker/gen/model/Broker_status.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Calibration_statistics_inner.cpp b/broker/gen/model/Calibration_statistics_inner.cpp index f26d841e..e94a405f 100644 --- a/broker/gen/model/Calibration_statistics_inner.cpp +++ b/broker/gen/model/Calibration_statistics_inner.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Calibration_statistics_inner.h b/broker/gen/model/Calibration_statistics_inner.h index 3d42e670..c8afbcbd 100644 --- a/broker/gen/model/Calibration_statistics_inner.h +++ b/broker/gen/model/Calibration_statistics_inner.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings.cpp b/broker/gen/model/Dataset_settings.cpp index 639eaa71..1d61f105 100644 --- a/broker/gen/model/Dataset_settings.cpp +++ b/broker/gen/model/Dataset_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index 479692d6..48fb5b06 100644 --- a/broker/gen/model/Dataset_settings.h +++ b/broker/gen/model/Dataset_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings_unit_cell.cpp b/broker/gen/model/Dataset_settings_unit_cell.cpp index a1dbc950..175335d2 100644 --- a/broker/gen/model/Dataset_settings_unit_cell.cpp +++ b/broker/gen/model/Dataset_settings_unit_cell.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings_unit_cell.h b/broker/gen/model/Dataset_settings_unit_cell.h index e863711e..66b0de39 100644 --- a/broker/gen/model/Dataset_settings_unit_cell.h +++ b/broker/gen/model/Dataset_settings_unit_cell.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector.cpp b/broker/gen/model/Detector.cpp index 840dcebc..f4f345f0 100644 --- a/broker/gen/model/Detector.cpp +++ b/broker/gen/model/Detector.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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& 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 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; diff --git a/broker/gen/model/Detector.h b/broker/gen/model/Detector.h index 51c14228..be7ce38a 100644 --- a/broker/gen/model/Detector.h +++ b/broker/gen/model/Detector.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -72,6 +72,8 @@ public: /// std::string getSerialNumber() const; void setSerialNumber(std::string const& value); + bool serialNumberIsSet() const; + void unsetSerial_number(); /// /// /// @@ -115,6 +117,20 @@ public: bool readoutTimeUsIsSet() const; void unsetReadout_time_us(); /// + /// Minimum count time available for the detector. + /// + int64_t getMinimumCountTimeUs() const; + void setMinimumCountTimeUs(int64_t const value); + bool minimumCountTimeUsIsSet() const; + void unsetMinimum_count_time_us(); + /// + /// Minimum frame time available for the detector. + /// + int64_t getMinimumFrameTimeUs() const; + void setMinimumFrameTimeUs(int64_t const value); + bool minimumFrameTimeUsIsSet() const; + void unsetMinimum_frame_time_us(); + /// /// 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. /// std::vector getCalibrationFile() const; @@ -164,6 +180,13 @@ public: bool customGeometryIsSet() const; void unsetCustom_geometry(); /// + /// ROI setting for DECTRIS detectors + /// + std::string getRoiMode() const; + void setRoiMode(std::string const& value); + bool roiModeIsSet() const; + void unsetRoi_mode(); + /// /// Mirror detector in Y direction to account for MX convention of (0,0) point in top left corner /// 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 m_Calibration_file; bool m_Calibration_fileIsSet; std::vector m_Hostname; @@ -204,6 +231,8 @@ protected: bool m_Standard_geometryIsSet; std::vector m_Custom_geometry; bool m_Custom_geometryIsSet; + std::string m_Roi_mode; + bool m_Roi_modeIsSet; bool m_Mirror_y; bool m_Mirror_yIsSet; diff --git a/broker/gen/model/Detector_list.cpp b/broker/gen/model/Detector_list.cpp index 21cc0659..ecd6e593 100644 --- a/broker/gen/model/Detector_list.cpp +++ b/broker/gen/model/Detector_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list.h b/broker/gen/model/Detector_list.h index 19fb114e..27c56df9 100644 --- a/broker/gen/model/Detector_list.h +++ b/broker/gen/model/Detector_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list_detectors_inner.cpp b/broker/gen/model/Detector_list_detectors_inner.cpp deleted file mode 100644 index 38eaeb74..00000000 --- a/broker/gen/model/Detector_list_detectors_inner.cpp +++ /dev/null @@ -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 - -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 - diff --git a/broker/gen/model/Detector_list_detectors_inner.h b/broker/gen/model/Detector_list_detectors_inner.h deleted file mode 100644 index a7416024..00000000 --- a/broker/gen/model/Detector_list_detectors_inner.h +++ /dev/null @@ -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 -#include - -namespace org::openapitools::server::model -{ - -/// -/// -/// -class Detector_list_detectors_inner -{ -public: - Detector_list_detectors_inner(); - virtual ~Detector_list_detectors_inner() = default; - - - /// - /// Validate the current data in the model. Throws a ValidationException on failure. - /// - void validate() const; - - /// - /// Validate the current data in the model. Returns false on error and writes an error - /// message into the given stringstream. - /// - bool validate(std::stringstream& msg) const; - - /// - /// Helper overload for validate. Used when one model stores another model and calls it's validate. - /// Not meant to be called outside that case. - /// - bool validate(std::stringstream& msg, const std::string& pathPrefix) const; - - bool operator==(const Detector_list_detectors_inner& rhs) const; - bool operator!=(const Detector_list_detectors_inner& rhs) const; - - ///////////////////////////////////////////// - /// Detector_list_detectors_inner members - - /// - /// - /// - int64_t getId() const; - void setId(int64_t const value); - /// - /// - /// - std::string getDescription() const; - void setDescription(std::string const& value); - /// - /// - /// - std::string getSerialNumber() const; - void setSerialNumber(std::string const& value); - /// - /// - /// - std::string getBaseIpv4Addr() const; - void setBaseIpv4Addr(std::string const& value); - /// - /// Number of UDP interfaces per detector module - /// - int64_t getUdpInterfaceCount() const; - void setUdpInterfaceCount(int64_t const value); - /// - /// - /// - int64_t getNmodules() const; - void setNmodules(int64_t const value); - /// - /// - /// - int64_t getWidth() const; - void setWidth(int64_t const value); - /// - /// - /// - int64_t getHeight() const; - void setHeight(int64_t const value); - /// - /// - /// - int64_t getReadoutTimeUs() const; - void setReadoutTimeUs(int64_t const value); - /// - /// - /// - int64_t getMinFrameTimeUs() const; - void setMinFrameTimeUs(int64_t const value); - /// - /// - /// - 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_ */ diff --git a/broker/gen/model/Detector_list_element.cpp b/broker/gen/model/Detector_list_element.cpp index 32d490cd..768d879c 100644 --- a/broker/gen/model/Detector_list_element.cpp +++ b/broker/gen/model/Detector_list_element.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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 diff --git a/broker/gen/model/Detector_list_element.h b/broker/gen/model/Detector_list_element.h index 1cd6c291..09599373 100644 --- a/broker/gen/model/Detector_list_element.h +++ b/broker/gen/model/Detector_list_element.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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 #include @@ -113,6 +114,13 @@ public: /// int64_t getMinCountTimeUs() const; void setMinCountTimeUs(int64_t const value); + /// + /// + /// + 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; }; diff --git a/broker/gen/model/Detector_module.cpp b/broker/gen/model/Detector_module.cpp index 4f2dc955..cf1328e9 100644 --- a/broker/gen/model/Detector_module.cpp +++ b/broker/gen/model/Detector_module.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module.h b/broker/gen/model/Detector_module.h index f84d33af..e314e601 100644 --- a/broker/gen/model/Detector_module.h +++ b/broker/gen/model/Detector_module.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module_direction.cpp b/broker/gen/model/Detector_module_direction.cpp index 773c81a8..3f422cc6 100644 --- a/broker/gen/model/Detector_module_direction.cpp +++ b/broker/gen/model/Detector_module_direction.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module_direction.h b/broker/gen/model/Detector_module_direction.h index 9fe2a5d7..3e4c94cb 100644 --- a/broker/gen/model/Detector_module_direction.h +++ b/broker/gen/model/Detector_module_direction.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_power_state.cpp b/broker/gen/model/Detector_power_state.cpp index 9e66d6a3..f5433868 100644 --- a/broker/gen/model/Detector_power_state.cpp +++ b/broker/gen/model/Detector_power_state.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_power_state.h b/broker/gen/model/Detector_power_state.h index 0a0d76fe..aaf121a9 100644 --- a/broker/gen/model/Detector_power_state.h +++ b/broker/gen/model/Detector_power_state.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_selection.cpp b/broker/gen/model/Detector_selection.cpp index dbad9de3..af6ef279 100644 --- a/broker/gen/model/Detector_selection.cpp +++ b/broker/gen/model/Detector_selection.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_selection.h b/broker/gen/model/Detector_selection.h index 678b9c45..f40b5b75 100644 --- a/broker/gen/model/Detector_selection.h +++ b/broker/gen/model/Detector_selection.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_settings.cpp b/broker/gen/model/Detector_settings.cpp index a433306b..790e61df 100644 --- a/broker/gen/model/Detector_settings.cpp +++ b/broker/gen/model/Detector_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_settings.h b/broker/gen/model/Detector_settings.h index d3140871..6be4888c 100644 --- a/broker/gen/model/Detector_settings.h +++ b/broker/gen/model/Detector_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_state.cpp b/broker/gen/model/Detector_state.cpp index ce3970b3..2fd6052e 100644 --- a/broker/gen/model/Detector_state.cpp +++ b/broker/gen/model/Detector_state.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_state.h b/broker/gen/model/Detector_state.h index 56341e4c..13b05ae2 100644 --- a/broker/gen/model/Detector_state.h +++ b/broker/gen/model/Detector_state.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_status.cpp b/broker/gen/model/Detector_status.cpp index fead1dc6..836a6ce7 100644 --- a/broker/gen/model/Detector_status.cpp +++ b/broker/gen/model/Detector_status.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_status.h b/broker/gen/model/Detector_status.h index 7f470e6f..95194df2 100644 --- a/broker/gen/model/Detector_status.h +++ b/broker/gen/model/Detector_status.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_timing.cpp b/broker/gen/model/Detector_timing.cpp index 2daadf22..67067459 100644 --- a/broker/gen/model/Detector_timing.cpp +++ b/broker/gen/model/Detector_timing.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_timing.h b/broker/gen/model/Detector_timing.h index 65db2044..0f49294b 100644 --- a/broker/gen/model/Detector_timing.h +++ b/broker/gen/model/Detector_timing.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_type.cpp b/broker/gen/model/Detector_type.cpp index 3543a2b3..ee117bea 100644 --- a/broker/gen/model/Detector_type.cpp +++ b/broker/gen/model/Detector_type.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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" diff --git a/broker/gen/model/Detector_type.h b/broker/gen/model/Detector_type.h index 739eea0d..93bdc3df 100644 --- a/broker/gen/model/Detector_type.h +++ b/broker/gen/model/Detector_type.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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 }; /// diff --git a/broker/gen/model/Error_message.cpp b/broker/gen/model/Error_message.cpp index 68b2efda..eae7a34e 100644 --- a/broker/gen/model/Error_message.cpp +++ b/broker/gen/model/Error_message.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Error_message.h b/broker/gen/model/Error_message.h index 1f6dd76b..028e7a1d 100644 --- a/broker/gen/model/Error_message.h +++ b/broker/gen/model/Error_message.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/File_writer_format.cpp b/broker/gen/model/File_writer_format.cpp index 66d9e4c2..a7171ec7 100644 --- a/broker/gen/model/File_writer_format.cpp +++ b/broker/gen/model/File_writer_format.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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" diff --git a/broker/gen/model/File_writer_format.h b/broker/gen/model/File_writer_format.h index 31d59778..331d3e5b 100644 --- a/broker/gen/model/File_writer_format.h +++ b/broker/gen/model/File_writer_format.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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 }; /// diff --git a/broker/gen/model/File_writer_settings.cpp b/broker/gen/model/File_writer_settings.cpp index b08318b4..d9ded3ae 100644 --- a/broker/gen/model/File_writer_settings.cpp +++ b/broker/gen/model/File_writer_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/File_writer_settings.h b/broker/gen/model/File_writer_settings.h index 0b7ff017..0eeebdac 100644 --- a/broker/gen/model/File_writer_settings.h +++ b/broker/gen/model/File_writer_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Fpga_status_inner.cpp b/broker/gen/model/Fpga_status_inner.cpp index 6a8c8e1e..6e4974bc 100644 --- a/broker/gen/model/Fpga_status_inner.cpp +++ b/broker/gen/model/Fpga_status_inner.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Fpga_status_inner.h b/broker/gen/model/Fpga_status_inner.h index dfdfde8f..cce87a25 100644 --- a/broker/gen/model/Fpga_status_inner.h +++ b/broker/gen/model/Fpga_status_inner.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Helpers.cpp b/broker/gen/model/Helpers.cpp index f8f7861e..9764c18e 100644 --- a/broker/gen/model/Helpers.cpp +++ b/broker/gen/model/Helpers.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Helpers.h b/broker/gen/model/Helpers.h index 631ba61d..3543e6ab 100644 --- a/broker/gen/model/Helpers.h +++ b/broker/gen/model/Helpers.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_buffer_status.cpp b/broker/gen/model/Image_buffer_status.cpp index 4225fa89..37defa63 100644 --- a/broker/gen/model/Image_buffer_status.cpp +++ b/broker/gen/model/Image_buffer_status.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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& 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 Image_buffer_status::getImageNumbers() const { return m_Image_numbers; diff --git a/broker/gen/model/Image_buffer_status.h b/broker/gen/model/Image_buffer_status.h index 53bcd0f4..c8c1e5ff 100644 --- a/broker/gen/model/Image_buffer_status.h +++ b/broker/gen/model/Image_buffer_status.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * 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 + /// + /// Smallest image number available in the buffer + /// + int64_t getMinImageNumber() const; + void setMinImageNumber(int64_t const value); + /// + /// Largest image number available in the buffer + /// + int64_t getMaxImageNumber() const; + void setMaxImageNumber(int64_t const value); /// /// Image numbers currently present in the buffer. /// @@ -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 m_Image_numbers; int64_t m_Total_slots; diff --git a/broker/gen/model/Image_format_settings.cpp b/broker/gen/model/Image_format_settings.cpp index 5a4e8950..49520503 100644 --- a/broker/gen/model/Image_format_settings.cpp +++ b/broker/gen/model/Image_format_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_format_settings.h b/broker/gen/model/Image_format_settings.h index 2dda388a..685fa40c 100644 --- a/broker/gen/model/Image_format_settings.h +++ b/broker/gen/model/Image_format_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_pusher_type.cpp b/broker/gen/model/Image_pusher_type.cpp index e2f0140f..cec81251 100644 --- a/broker/gen/model/Image_pusher_type.cpp +++ b/broker/gen/model/Image_pusher_type.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_pusher_type.h b/broker/gen/model/Image_pusher_type.h index 790c1c22..f10b129c 100644 --- a/broker/gen/model/Image_pusher_type.h +++ b/broker/gen/model/Image_pusher_type.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Instrument_metadata.cpp b/broker/gen/model/Instrument_metadata.cpp index 84dd94f7..4c57a5f8 100644 --- a/broker/gen/model/Instrument_metadata.cpp +++ b/broker/gen/model/Instrument_metadata.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Instrument_metadata.h b/broker/gen/model/Instrument_metadata.h index 292896e8..67b7dbb3 100644 --- a/broker/gen/model/Instrument_metadata.h +++ b/broker/gen/model/Instrument_metadata.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Jfjoch_settings.cpp b/broker/gen/model/Jfjoch_settings.cpp index 3a8d3831..af45887a 100644 --- a/broker/gen/model/Jfjoch_settings.cpp +++ b/broker/gen/model/Jfjoch_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,6 +35,8 @@ Jfjoch_settings::Jfjoch_settings() m_Numa_policy = ""; m_Numa_policyIsSet = false; m_Frontend_directory = ""; + m_Resonet_model = ""; + m_Resonet_modelIsSet = false; m_Zeromq_previewIsSet = false; m_Zeromq_metadataIsSet = false; @@ -134,7 +136,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr } } - + return success; } @@ -179,6 +181,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const (getFrontendDirectory() == rhs.getFrontendDirectory()) && + + ((!resonetModelIsSet() && !rhs.resonetModelIsSet()) || (resonetModelIsSet() && rhs.resonetModelIsSet() && getResonetModel() == rhs.getResonetModel())) && + (getImagePusher() == rhs.getImagePusher()) && @@ -221,6 +226,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.resonetModelIsSet()) + j["resonet_model"] = o.m_Resonet_model; j["image_pusher"] = o.m_Image_pusher; if(o.zeromqPreviewIsSet()) j["zeromq_preview"] = o.m_Zeromq_preview; @@ -283,6 +290,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("resonet_model") != j.end()) + { + j.at("resonet_model").get_to(o.m_Resonet_model); + o.m_Resonet_modelIsSet = true; + } j.at("image_pusher").get_to(o.m_Image_pusher); if(j.find("zeromq_preview") != j.end()) { @@ -483,6 +495,23 @@ void Jfjoch_settings::setFrontendDirectory(std::string const& value) { m_Frontend_directory = value; } +std::string Jfjoch_settings::getResonetModel() const +{ + return m_Resonet_model; +} +void Jfjoch_settings::setResonetModel(std::string const& value) +{ + m_Resonet_model = value; + m_Resonet_modelIsSet = true; +} +bool Jfjoch_settings::resonetModelIsSet() const +{ + return m_Resonet_modelIsSet; +} +void Jfjoch_settings::unsetResonet_model() +{ + m_Resonet_modelIsSet = false; +} org::openapitools::server::model::Image_pusher_type Jfjoch_settings::getImagePusher() const { return m_Image_pusher; diff --git a/broker/gen/model/Jfjoch_settings.h b/broker/gen/model/Jfjoch_settings.h index 05ebdfd1..4f4ae2b8 100644 --- a/broker/gen/model/Jfjoch_settings.h +++ b/broker/gen/model/Jfjoch_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -151,6 +151,13 @@ public: std::string getFrontendDirectory() const; void setFrontendDirectory(std::string const& value); /// + /// Path to Resonet model + /// + std::string getResonetModel() const; + void setResonetModel(std::string const& value); + bool resonetModelIsSet() const; + void unsetResonet_model(); + /// /// /// org::openapitools::server::model::Image_pusher_type getImagePusher() const; @@ -197,6 +204,8 @@ protected: bool m_Numa_policyIsSet; std::string m_Frontend_directory; + std::string m_Resonet_model; + bool m_Resonet_modelIsSet; org::openapitools::server::model::Image_pusher_type m_Image_pusher; org::openapitools::server::model::Zeromq_preview_settings m_Zeromq_preview; diff --git a/broker/gen/model/Jfjoch_statistics.cpp b/broker/gen/model/Jfjoch_statistics.cpp index 17eb13a1..b5f184a6 100644 --- a/broker/gen/model/Jfjoch_statistics.cpp +++ b/broker/gen/model/Jfjoch_statistics.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -37,6 +37,7 @@ Jfjoch_statistics::Jfjoch_statistics() m_Pixel_maskIsSet = false; m_RoiIsSet = false; m_Az_intIsSet = false; + m_BufferIsSet = false; } @@ -101,7 +102,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path } } - + return success; } @@ -156,7 +157,10 @@ 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())) ; } @@ -201,6 +205,8 @@ 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; } @@ -286,6 +292,11 @@ 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; + } } @@ -561,6 +572,23 @@ void Jfjoch_statistics::unsetAz_int() { m_Az_intIsSet = false; } +org::openapitools::server::model::Image_buffer_status Jfjoch_statistics::getBuffer() const +{ + return m_Buffer; +} +void Jfjoch_statistics::setBuffer(org::openapitools::server::model::Image_buffer_status const& value) +{ + m_Buffer = value; + m_BufferIsSet = true; +} +bool Jfjoch_statistics::bufferIsSet() const +{ + return m_BufferIsSet; +} +void Jfjoch_statistics::unsetBuffer() +{ + m_BufferIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Jfjoch_statistics.h b/broker/gen/model/Jfjoch_statistics.h index 1090a5e3..7eb9b9bb 100644 --- a/broker/gen/model/Jfjoch_statistics.h +++ b/broker/gen/model/Jfjoch_statistics.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -35,6 +35,7 @@ #include "Detector_status.h" #include "Roi_definitions.h" #include "Fpga_status_inner.h" +#include "Image_buffer_status.h" #include "Instrument_metadata.h" #include @@ -186,6 +187,13 @@ public: void setAzInt(org::openapitools::server::model::Azim_int_settings const& value); bool azIntIsSet() const; void unsetAz_int(); + /// + /// + /// + org::openapitools::server::model::Image_buffer_status getBuffer() const; + void setBuffer(org::openapitools::server::model::Image_buffer_status const& value); + bool bufferIsSet() const; + void unsetBuffer(); friend void to_json(nlohmann::json& j, const Jfjoch_statistics& o); friend void from_json(const nlohmann::json& j, Jfjoch_statistics& o); @@ -222,6 +230,8 @@ 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; }; diff --git a/broker/gen/model/Measurement_statistics.cpp b/broker/gen/model/Measurement_statistics.cpp index a6db172a..d34b855e 100644 --- a/broker/gen/model/Measurement_statistics.cpp +++ b/broker/gen/model/Measurement_statistics.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Measurement_statistics.h b/broker/gen/model/Measurement_statistics.h index 8c158171..c134f6d0 100644 --- a/broker/gen/model/Measurement_statistics.h +++ b/broker/gen/model/Measurement_statistics.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pcie_devices_inner.cpp b/broker/gen/model/Pcie_devices_inner.cpp index e1332f53..28c022db 100644 --- a/broker/gen/model/Pcie_devices_inner.cpp +++ b/broker/gen/model/Pcie_devices_inner.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pcie_devices_inner.h b/broker/gen/model/Pcie_devices_inner.h index b49a3085..c0c572f8 100644 --- a/broker/gen/model/Pcie_devices_inner.h +++ b/broker/gen/model/Pcie_devices_inner.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pixel_mask_statistics.cpp b/broker/gen/model/Pixel_mask_statistics.cpp index 13f1502c..249ea8e9 100644 --- a/broker/gen/model/Pixel_mask_statistics.cpp +++ b/broker/gen/model/Pixel_mask_statistics.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pixel_mask_statistics.h b/broker/gen/model/Pixel_mask_statistics.h index f9dd3ed9..1e081af1 100644 --- a/broker/gen/model/Pixel_mask_statistics.h +++ b/broker/gen/model/Pixel_mask_statistics.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plot.cpp b/broker/gen/model/Plot.cpp index 32e8666c..5c377c42 100644 --- a/broker/gen/model/Plot.cpp +++ b/broker/gen/model/Plot.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plot.h b/broker/gen/model/Plot.h index f4dec62b..4467fba0 100644 --- a/broker/gen/model/Plot.h +++ b/broker/gen/model/Plot.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plots.cpp b/broker/gen/model/Plots.cpp index 05ea7a67..fa37e014 100644 --- a/broker/gen/model/Plots.cpp +++ b/broker/gen/model/Plots.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plots.h b/broker/gen/model/Plots.h index 21a1b3dc..05a9d764 100644 --- a/broker/gen/model/Plots.h +++ b/broker/gen/model/Plots.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Preview_settings.cpp b/broker/gen/model/Preview_settings.cpp deleted file mode 100644 index 71e43bc7..00000000 --- a/broker/gen/model/Preview_settings.cpp +++ /dev/null @@ -1,322 +0,0 @@ -/** -* Jungfraujoch -* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. -* -* The version of the OpenAPI document: 1.0.0-rc.35 -* Contact: filip.leonarski@psi.ch -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#include "Preview_settings.h" -#include "Helpers.h" - -#include - -namespace org::openapitools::server::model -{ - -Preview_settings::Preview_settings() -{ - m_Saturation = 0L; - m_Show_spots = true; - m_Show_spotsIsSet = false; - m_Show_roi = false; - m_Show_roiIsSet = false; - m_Jpeg_quality = 100L; - m_Jpeg_qualityIsSet = false; - m_Show_indexed = false; - m_Show_indexedIsSet = false; - m_Show_user_mask = false; - m_Show_user_maskIsSet = false; - m_Resolution_ring = 0.1f; - m_Resolution_ringIsSet = false; - -} - -void Preview_settings::validate() const -{ - std::stringstream msg; - if (!validate(msg)) - { - throw org::openapitools::server::helpers::ValidationException(msg.str()); - } -} - -bool Preview_settings::validate(std::stringstream& msg) const -{ - return validate(msg, ""); -} - -bool Preview_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const -{ - bool success = true; - const std::string _pathPrefix = pathPrefix.empty() ? "Preview_settings" : pathPrefix; - - - - /* Saturation */ { - const int64_t& value = m_Saturation; - const std::string currentValuePath = _pathPrefix + ".saturation"; - - - if (value < 0ll) - { - success = false; - msg << currentValuePath << ": must be greater than or equal to 0;"; - } - if (value > 65535ll) - { - success = false; - msg << currentValuePath << ": must be less than or equal to 65535;"; - } - - } - - if (jpegQualityIsSet()) - { - const int64_t& value = m_Jpeg_quality; - const std::string currentValuePath = _pathPrefix + ".jpegQuality"; - - - if (value < 0ll) - { - success = false; - msg << currentValuePath << ": must be greater than or equal to 0;"; - } - if (value > 100ll) - { - success = false; - msg << currentValuePath << ": must be less than or equal to 100;"; - } - - } - - if (resolutionRingIsSet()) - { - const float& value = m_Resolution_ring; - const std::string currentValuePath = _pathPrefix + ".resolutionRing"; - - - if (value < static_cast(0.1)) - { - success = false; - msg << currentValuePath << ": must be greater than or equal to 0.1;"; - } - if (value > static_cast(100.0)) - { - success = false; - msg << currentValuePath << ": must be less than or equal to 100.0;"; - } - - } - - return success; -} - -bool Preview_settings::operator==(const Preview_settings& rhs) const -{ - return - - - (getSaturation() == rhs.getSaturation()) - && - - - ((!showSpotsIsSet() && !rhs.showSpotsIsSet()) || (showSpotsIsSet() && rhs.showSpotsIsSet() && isShowSpots() == rhs.isShowSpots())) && - - - ((!showRoiIsSet() && !rhs.showRoiIsSet()) || (showRoiIsSet() && rhs.showRoiIsSet() && isShowRoi() == rhs.isShowRoi())) && - - - ((!jpegQualityIsSet() && !rhs.jpegQualityIsSet()) || (jpegQualityIsSet() && rhs.jpegQualityIsSet() && getJpegQuality() == rhs.getJpegQuality())) && - - - ((!showIndexedIsSet() && !rhs.showIndexedIsSet()) || (showIndexedIsSet() && rhs.showIndexedIsSet() && isShowIndexed() == rhs.isShowIndexed())) && - - - ((!showUserMaskIsSet() && !rhs.showUserMaskIsSet()) || (showUserMaskIsSet() && rhs.showUserMaskIsSet() && isShowUserMask() == rhs.isShowUserMask())) && - - - ((!resolutionRingIsSet() && !rhs.resolutionRingIsSet()) || (resolutionRingIsSet() && rhs.resolutionRingIsSet() && getResolutionRing() == rhs.getResolutionRing())) - - ; -} - -bool Preview_settings::operator!=(const Preview_settings& rhs) const -{ - return !(*this == rhs); -} - -void to_json(nlohmann::json& j, const Preview_settings& o) -{ - j = nlohmann::json::object(); - j["saturation"] = o.m_Saturation; - if(o.showSpotsIsSet()) - j["show_spots"] = o.m_Show_spots; - if(o.showRoiIsSet()) - j["show_roi"] = o.m_Show_roi; - if(o.jpegQualityIsSet()) - j["jpeg_quality"] = o.m_Jpeg_quality; - if(o.showIndexedIsSet()) - j["show_indexed"] = o.m_Show_indexed; - if(o.showUserMaskIsSet()) - j["show_user_mask"] = o.m_Show_user_mask; - if(o.resolutionRingIsSet()) - j["resolution_ring"] = o.m_Resolution_ring; - -} - -void from_json(const nlohmann::json& j, Preview_settings& o) -{ - j.at("saturation").get_to(o.m_Saturation); - if(j.find("show_spots") != j.end()) - { - j.at("show_spots").get_to(o.m_Show_spots); - o.m_Show_spotsIsSet = true; - } - if(j.find("show_roi") != j.end()) - { - j.at("show_roi").get_to(o.m_Show_roi); - o.m_Show_roiIsSet = true; - } - if(j.find("jpeg_quality") != j.end()) - { - j.at("jpeg_quality").get_to(o.m_Jpeg_quality); - o.m_Jpeg_qualityIsSet = true; - } - if(j.find("show_indexed") != j.end()) - { - j.at("show_indexed").get_to(o.m_Show_indexed); - o.m_Show_indexedIsSet = true; - } - if(j.find("show_user_mask") != j.end()) - { - j.at("show_user_mask").get_to(o.m_Show_user_mask); - o.m_Show_user_maskIsSet = true; - } - if(j.find("resolution_ring") != j.end()) - { - j.at("resolution_ring").get_to(o.m_Resolution_ring); - o.m_Resolution_ringIsSet = true; - } - -} - -int64_t Preview_settings::getSaturation() const -{ - return m_Saturation; -} -void Preview_settings::setSaturation(int64_t const value) -{ - m_Saturation = value; -} -bool Preview_settings::isShowSpots() const -{ - return m_Show_spots; -} -void Preview_settings::setShowSpots(bool const value) -{ - m_Show_spots = value; - m_Show_spotsIsSet = true; -} -bool Preview_settings::showSpotsIsSet() const -{ - return m_Show_spotsIsSet; -} -void Preview_settings::unsetShow_spots() -{ - m_Show_spotsIsSet = false; -} -bool Preview_settings::isShowRoi() const -{ - return m_Show_roi; -} -void Preview_settings::setShowRoi(bool const value) -{ - m_Show_roi = value; - m_Show_roiIsSet = true; -} -bool Preview_settings::showRoiIsSet() const -{ - return m_Show_roiIsSet; -} -void Preview_settings::unsetShow_roi() -{ - m_Show_roiIsSet = false; -} -int64_t Preview_settings::getJpegQuality() const -{ - return m_Jpeg_quality; -} -void Preview_settings::setJpegQuality(int64_t const value) -{ - m_Jpeg_quality = value; - m_Jpeg_qualityIsSet = true; -} -bool Preview_settings::jpegQualityIsSet() const -{ - return m_Jpeg_qualityIsSet; -} -void Preview_settings::unsetJpeg_quality() -{ - m_Jpeg_qualityIsSet = false; -} -bool Preview_settings::isShowIndexed() const -{ - return m_Show_indexed; -} -void Preview_settings::setShowIndexed(bool const value) -{ - m_Show_indexed = value; - m_Show_indexedIsSet = true; -} -bool Preview_settings::showIndexedIsSet() const -{ - return m_Show_indexedIsSet; -} -void Preview_settings::unsetShow_indexed() -{ - m_Show_indexedIsSet = false; -} -bool Preview_settings::isShowUserMask() const -{ - return m_Show_user_mask; -} -void Preview_settings::setShowUserMask(bool const value) -{ - m_Show_user_mask = value; - m_Show_user_maskIsSet = true; -} -bool Preview_settings::showUserMaskIsSet() const -{ - return m_Show_user_maskIsSet; -} -void Preview_settings::unsetShow_user_mask() -{ - m_Show_user_maskIsSet = false; -} -float Preview_settings::getResolutionRing() const -{ - return m_Resolution_ring; -} -void Preview_settings::setResolutionRing(float const value) -{ - m_Resolution_ring = value; - m_Resolution_ringIsSet = true; -} -bool Preview_settings::resolutionRingIsSet() const -{ - return m_Resolution_ringIsSet; -} -void Preview_settings::unsetResolution_ring() -{ - m_Resolution_ringIsSet = false; -} - - -} // namespace org::openapitools::server::model - diff --git a/broker/gen/model/Preview_settings.h b/broker/gen/model/Preview_settings.h deleted file mode 100644 index c1e12de6..00000000 --- a/broker/gen/model/Preview_settings.h +++ /dev/null @@ -1,130 +0,0 @@ -/** -* Jungfraujoch -* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. -* -* The version of the OpenAPI document: 1.0.0-rc.35 -* Contact: filip.leonarski@psi.ch -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -/* - * Preview_settings.h - * - * Settings for JPEG rendering of preview images - */ - -#ifndef Preview_settings_H_ -#define Preview_settings_H_ - - -#include - -namespace org::openapitools::server::model -{ - -/// -/// Settings for JPEG rendering of preview images -/// -class Preview_settings -{ -public: - Preview_settings(); - virtual ~Preview_settings() = default; - - - /// - /// Validate the current data in the model. Throws a ValidationException on failure. - /// - void validate() const; - - /// - /// Validate the current data in the model. Returns false on error and writes an error - /// message into the given stringstream. - /// - bool validate(std::stringstream& msg) const; - - /// - /// Helper overload for validate. Used when one model stores another model and calls it's validate. - /// Not meant to be called outside that case. - /// - bool validate(std::stringstream& msg, const std::string& pathPrefix) const; - - bool operator==(const Preview_settings& rhs) const; - bool operator!=(const Preview_settings& rhs) const; - - ///////////////////////////////////////////// - /// Preview_settings members - - /// - /// Saturation value to set contrast in the preview image - /// - int64_t getSaturation() const; - void setSaturation(int64_t const value); - /// - /// Show spot finding results on the image - /// - bool isShowSpots() const; - void setShowSpots(bool const value); - bool showSpotsIsSet() const; - void unsetShow_spots(); - /// - /// Show ROI areas on the image - /// - bool isShowRoi() const; - void setShowRoi(bool const value); - bool showRoiIsSet() const; - void unsetShow_roi(); - /// - /// Quality of JPEG image (100 - highest; 0 - lowest) - /// - int64_t getJpegQuality() const; - void setJpegQuality(int64_t const value); - bool jpegQualityIsSet() const; - void unsetJpeg_quality(); - /// - /// Preview indexed images only - /// - bool isShowIndexed() const; - void setShowIndexed(bool const value); - bool showIndexedIsSet() const; - void unsetShow_indexed(); - /// - /// Show user mask - /// - bool isShowUserMask() const; - void setShowUserMask(bool const value); - bool showUserMaskIsSet() const; - void unsetShow_user_mask(); - /// - /// - /// - float getResolutionRing() const; - void setResolutionRing(float const value); - bool resolutionRingIsSet() const; - void unsetResolution_ring(); - - friend void to_json(nlohmann::json& j, const Preview_settings& o); - friend void from_json(const nlohmann::json& j, Preview_settings& o); -protected: - int64_t m_Saturation; - - bool m_Show_spots; - bool m_Show_spotsIsSet; - bool m_Show_roi; - bool m_Show_roiIsSet; - int64_t m_Jpeg_quality; - bool m_Jpeg_qualityIsSet; - bool m_Show_indexed; - bool m_Show_indexedIsSet; - bool m_Show_user_mask; - bool m_Show_user_maskIsSet; - float m_Resolution_ring; - bool m_Resolution_ringIsSet; - -}; - -} // namespace org::openapitools::server::model - -#endif /* Preview_settings_H_ */ diff --git a/broker/gen/model/Roi_azim_list.cpp b/broker/gen/model/Roi_azim_list.cpp index bbf66215..64e90289 100644 --- a/broker/gen/model/Roi_azim_list.cpp +++ b/broker/gen/model/Roi_azim_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_azim_list.h b/broker/gen/model/Roi_azim_list.h index f532193c..ab08d6e8 100644 --- a/broker/gen/model/Roi_azim_list.h +++ b/broker/gen/model/Roi_azim_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_azimuthal.cpp b/broker/gen/model/Roi_azimuthal.cpp index 0eba14b9..b6810370 100644 --- a/broker/gen/model/Roi_azimuthal.cpp +++ b/broker/gen/model/Roi_azimuthal.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_azimuthal.h b/broker/gen/model/Roi_azimuthal.h index ff89d38b..9b30b158 100644 --- a/broker/gen/model/Roi_azimuthal.h +++ b/broker/gen/model/Roi_azimuthal.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box.cpp b/broker/gen/model/Roi_box.cpp index ad537386..19be5b53 100644 --- a/broker/gen/model/Roi_box.cpp +++ b/broker/gen/model/Roi_box.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box.h b/broker/gen/model/Roi_box.h index f1032460..e1690240 100644 --- a/broker/gen/model/Roi_box.h +++ b/broker/gen/model/Roi_box.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box_list.cpp b/broker/gen/model/Roi_box_list.cpp index 566dc403..dc921975 100644 --- a/broker/gen/model/Roi_box_list.cpp +++ b/broker/gen/model/Roi_box_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box_list.h b/broker/gen/model/Roi_box_list.h index 96a2ccf2..57926d04 100644 --- a/broker/gen/model/Roi_box_list.h +++ b/broker/gen/model/Roi_box_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle.cpp b/broker/gen/model/Roi_circle.cpp index 9d686937..a40915f8 100644 --- a/broker/gen/model/Roi_circle.cpp +++ b/broker/gen/model/Roi_circle.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle.h b/broker/gen/model/Roi_circle.h index 36afcf4f..52b2e961 100644 --- a/broker/gen/model/Roi_circle.h +++ b/broker/gen/model/Roi_circle.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle_list.cpp b/broker/gen/model/Roi_circle_list.cpp index 27700828..12dd3532 100644 --- a/broker/gen/model/Roi_circle_list.cpp +++ b/broker/gen/model/Roi_circle_list.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle_list.h b/broker/gen/model/Roi_circle_list.h index 8303cfd3..f487404c 100644 --- a/broker/gen/model/Roi_circle_list.h +++ b/broker/gen/model/Roi_circle_list.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_definitions.cpp b/broker/gen/model/Roi_definitions.cpp index b497801e..24b3bebc 100644 --- a/broker/gen/model/Roi_definitions.cpp +++ b/broker/gen/model/Roi_definitions.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -21,7 +21,6 @@ namespace org::openapitools::server::model Roi_definitions::Roi_definitions() { - m_AzimIsSet = false; } @@ -53,6 +52,10 @@ bool Roi_definitions::validate(std::stringstream& msg, const std::string& pathPr msg << _pathPrefix << ": Circle is invalid;"; success = false; } + if (!m_Azim.validate(msg, _pathPrefix + ".azim")) { + msg << _pathPrefix << ": Azim is invalid;"; + success = false; + } return success; } @@ -67,8 +70,8 @@ bool Roi_definitions::operator==(const Roi_definitions& rhs) const (getCircle() == rhs.getCircle()) && + (getAzim() == rhs.getAzim()) - ((!azimIsSet() && !rhs.azimIsSet()) || (azimIsSet() && rhs.azimIsSet() && getAzim() == rhs.getAzim())) ; } @@ -83,8 +86,7 @@ void to_json(nlohmann::json& j, const Roi_definitions& o) j = nlohmann::json::object(); j["box"] = o.m_Box; j["circle"] = o.m_Circle; - if(o.azimIsSet()) - j["azim"] = o.m_Azim; + j["azim"] = o.m_Azim; } @@ -92,11 +94,7 @@ void from_json(const nlohmann::json& j, Roi_definitions& o) { j.at("box").get_to(o.m_Box); j.at("circle").get_to(o.m_Circle); - if(j.find("azim") != j.end()) - { - j.at("azim").get_to(o.m_Azim); - o.m_AzimIsSet = true; - } + j.at("azim").get_to(o.m_Azim); } @@ -123,15 +121,6 @@ org::openapitools::server::model::Roi_azim_list Roi_definitions::getAzim() const void Roi_definitions::setAzim(org::openapitools::server::model::Roi_azim_list const& value) { m_Azim = value; - m_AzimIsSet = true; -} -bool Roi_definitions::azimIsSet() const -{ - return m_AzimIsSet; -} -void Roi_definitions::unsetAzim() -{ - m_AzimIsSet = false; } diff --git a/broker/gen/model/Roi_definitions.h b/broker/gen/model/Roi_definitions.h index 921c114e..bafaacad 100644 --- a/broker/gen/model/Roi_definitions.h +++ b/broker/gen/model/Roi_definitions.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -75,8 +75,6 @@ public: /// org::openapitools::server::model::Roi_azim_list getAzim() const; void setAzim(org::openapitools::server::model::Roi_azim_list const& value); - bool azimIsSet() const; - void unsetAzim(); friend void to_json(nlohmann::json& j, const Roi_definitions& o); friend void from_json(const nlohmann::json& j, Roi_definitions& o); @@ -86,7 +84,7 @@ protected: org::openapitools::server::model::Roi_circle_list m_Circle; org::openapitools::server::model::Roi_azim_list m_Azim; - bool m_AzimIsSet; + }; diff --git a/broker/gen/model/Rotation_axis.cpp b/broker/gen/model/Rotation_axis.cpp index 9819a0b7..74066f4f 100644 --- a/broker/gen/model/Rotation_axis.cpp +++ b/broker/gen/model/Rotation_axis.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Rotation_axis.h b/broker/gen/model/Rotation_axis.h index 3ad009bb..6c99d77f 100644 --- a/broker/gen/model/Rotation_axis.h +++ b/broker/gen/model/Rotation_axis.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Spot_finding_settings.cpp b/broker/gen/model/Spot_finding_settings.cpp index c8001c1f..c3cd60d8 100644 --- a/broker/gen/model/Spot_finding_settings.cpp +++ b/broker/gen/model/Spot_finding_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,6 +34,8 @@ Spot_finding_settings::Spot_finding_settings() m_High_resolution_limit = 0.0f; m_Low_resolution_limit = 0.0f; m_Indexing_tolerance = 0.0f; + m_Resolution_estimate = true; + m_Resolution_estimateIsSet = false; } @@ -145,7 +147,7 @@ bool Spot_finding_settings::validate(std::stringstream& msg, const std::string& } } - + return success; } @@ -185,8 +187,11 @@ bool Spot_finding_settings::operator==(const Spot_finding_settings& rhs) const && (getIndexingTolerance() == rhs.getIndexingTolerance()) + && + ((!resolutionEstimateIsSet() && !rhs.resolutionEstimateIsSet()) || (resolutionEstimateIsSet() && rhs.resolutionEstimateIsSet() && isResolutionEstimate() == rhs.isResolutionEstimate())) + ; } @@ -211,6 +216,8 @@ void to_json(nlohmann::json& j, const Spot_finding_settings& o) j["high_resolution_limit"] = o.m_High_resolution_limit; j["low_resolution_limit"] = o.m_Low_resolution_limit; j["indexing_tolerance"] = o.m_Indexing_tolerance; + if(o.resolutionEstimateIsSet()) + j["resolution_estimate"] = o.m_Resolution_estimate; } @@ -235,6 +242,11 @@ void from_json(const nlohmann::json& j, Spot_finding_settings& o) j.at("high_resolution_limit").get_to(o.m_High_resolution_limit); j.at("low_resolution_limit").get_to(o.m_Low_resolution_limit); j.at("indexing_tolerance").get_to(o.m_Indexing_tolerance); + if(j.find("resolution_estimate") != j.end()) + { + j.at("resolution_estimate").get_to(o.m_Resolution_estimate); + o.m_Resolution_estimateIsSet = true; + } } @@ -344,6 +356,23 @@ void Spot_finding_settings::setIndexingTolerance(float const value) { m_Indexing_tolerance = value; } +bool Spot_finding_settings::isResolutionEstimate() const +{ + return m_Resolution_estimate; +} +void Spot_finding_settings::setResolutionEstimate(bool const value) +{ + m_Resolution_estimate = value; + m_Resolution_estimateIsSet = true; +} +bool Spot_finding_settings::resolutionEstimateIsSet() const +{ + return m_Resolution_estimateIsSet; +} +void Spot_finding_settings::unsetResolution_estimate() +{ + m_Resolution_estimateIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Spot_finding_settings.h b/broker/gen/model/Spot_finding_settings.h index e1ea9a19..f50da870 100644 --- a/broker/gen/model/Spot_finding_settings.h +++ b/broker/gen/model/Spot_finding_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -116,6 +116,13 @@ public: /// float getIndexingTolerance() const; void setIndexingTolerance(float const value); + /// + /// Diffraction image resolution estimation using ML model from SSRL; `jfjoch_broker` must be compiled with libtorch support and path to .pt file configured in `jfjoch_broker` configuration file. + /// + bool isResolutionEstimate() const; + void setResolutionEstimate(bool const value); + bool resolutionEstimateIsSet() const; + void unsetResolution_estimate(); friend void to_json(nlohmann::json& j, const Spot_finding_settings& o); friend void from_json(const nlohmann::json& j, Spot_finding_settings& o); @@ -142,6 +149,8 @@ protected: float m_Indexing_tolerance; + bool m_Resolution_estimate; + bool m_Resolution_estimateIsSet; }; diff --git a/broker/gen/model/Standard_detector_geometry.cpp b/broker/gen/model/Standard_detector_geometry.cpp index f4b7b242..9f638d4e 100644 --- a/broker/gen/model/Standard_detector_geometry.cpp +++ b/broker/gen/model/Standard_detector_geometry.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Standard_detector_geometry.h b/broker/gen/model/Standard_detector_geometry.h index f9cea8f2..c9f1dc72 100644 --- a/broker/gen/model/Standard_detector_geometry.h +++ b/broker/gen/model/Standard_detector_geometry.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_metadata_settings.cpp b/broker/gen/model/Zeromq_metadata_settings.cpp index b126b026..c8c3064e 100644 --- a/broker/gen/model/Zeromq_metadata_settings.cpp +++ b/broker/gen/model/Zeromq_metadata_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_metadata_settings.h b/broker/gen/model/Zeromq_metadata_settings.h index 2f96437f..60fad465 100644 --- a/broker/gen/model/Zeromq_metadata_settings.h +++ b/broker/gen/model/Zeromq_metadata_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_preview_settings.cpp b/broker/gen/model/Zeromq_preview_settings.cpp index 3b5c0ab1..38657e02 100644 --- a/broker/gen/model/Zeromq_preview_settings.cpp +++ b/broker/gen/model/Zeromq_preview_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_preview_settings.h b/broker/gen/model/Zeromq_preview_settings.h index 813f3c7f..a2652afb 100644 --- a/broker/gen/model/Zeromq_preview_settings.h +++ b/broker/gen/model/Zeromq_preview_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_settings.cpp b/broker/gen/model/Zeromq_settings.cpp index b7c4ad0f..d333767e 100644 --- a/broker/gen/model/Zeromq_settings.cpp +++ b/broker/gen/model/Zeromq_settings.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_settings.h b/broker/gen/model/Zeromq_settings.h index 4e3292f8..185b8d63 100644 --- a/broker/gen/model/Zeromq_settings.h +++ b/broker/gen/model/Zeromq_settings.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.35 +* The version of the OpenAPI document: 1.0.0-rc.36 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 5e089a3f..e9089d10 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -5,7 +5,7 @@ info: API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. - version: 1.0.0-rc.35 + version: 1.0.0-rc.36 contact: name: Filip Leonarski (Paul Scherrer Institute) email: filip.leonarski@psi.ch @@ -32,6 +32,78 @@ components: type: boolean default: true description: Enable DEFLATE compression of output data. + image_id: + in: query + name: id + required: false + schema: + type: integer + format: int64 + default: -1 + minimum: -2 + description: "Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer" + saturation: + in: query + name: saturation + schema: + type: integer + format: int64 + minimum: 0 + maximum: 65535 + description: "Saturation value to set contrast in the preview image" + show_spots: + in: query + name: show_spots + schema: + type: boolean + default: true + description: "Show spot finding results on the image" + show_roi: + in: query + name: show_roi + schema: + type: boolean + default: false + description: "Show ROI areas on the image" + jpeg_quality: + in: query + name: jpeg_quality + description: "Quality of JPEG image (100 - highest; 0 - lowest)" + schema: + type: integer + format: int64 + default: 100 + minimum: 0 + maximum: 100 + show_user_mask: + in: query + name: show_user_mask + schema: + type: boolean + default: false + description: "Show user mask" + resolution_ring: + in: query + name: show_res_ring + description: "Show resolution ring, provided in Angstrom" + schema: + type: number + format: float + default: 0.1 + minimum: 0.1 + maximum: 100.0 + color_scale: + in: query + name: color + description: "Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat" + schema: + type: string + enum: + - "indigo" + - "viridis" + - "bw" + - "heat" + default: "indigo" schemas: rotation_axis: description: Definition of a crystal rotation axis @@ -298,6 +370,8 @@ components: - "None" - "NXmxLegacy" - "NXmxVDS" + - "CBF" + - "TIFF" default: "NXmxLegacy" description: | None - no master file written @@ -337,7 +411,19 @@ components: - image_numbers - total_slots - available_slots + - max_image_number + - min_image_number properties: + min_image_number: + type: integer + format: int64 + minimum: 0 + description: Smallest image number available in the buffer + max_image_number: + type: integer + format: int64 + minimum: 0 + description: Largest image number available in the buffer image_numbers: type: array description: Image numbers currently present in the buffer. @@ -578,6 +664,7 @@ components: - high_resolution_limit - low_resolution_limit - indexing_tolerance + - resolution_estimation properties: enable: type: boolean @@ -627,6 +714,12 @@ components: minimum: 0.0 maximum: 1.0 description: Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted + resolution_estimate: + type: boolean + default: true + description: | + Diffraction image resolution estimation using ML model from SSRL; `jfjoch_broker` must be compiled with libtorch support + and path to .pt file configured in `jfjoch_broker` configuration file. azim_int_settings: type: object required: @@ -708,6 +801,8 @@ components: min_count_time_us: type: integer format: int64 + type: + $ref: "#/components/schemas/detector_type" detector_list: type: object required: @@ -1016,47 +1111,8 @@ components: $ref: '#/components/schemas/roi_definitions' az_int: $ref: '#/components/schemas/azim_int_settings' - preview_settings: - type: object - description: "Settings for JPEG rendering of preview images" - required: - - saturation - properties: - saturation: - type: integer - format: int64 - minimum: 0 - maximum: 65535 - description: "Saturation value to set contrast in the preview image" - show_spots: - type: boolean - default: true - description: "Show spot finding results on the image" - show_roi: - type: boolean - default: false - description: "Show ROI areas on the image" - jpeg_quality: - type: integer - description: "Quality of JPEG image (100 - highest; 0 - lowest)" - format: int64 - default: 100 - minimum: 0 - maximum: 100 - show_indexed: - type: boolean - description: "Preview indexed images only" - default: false - show_user_mask: - type: boolean - description: "Show user mask" - default: false - resolution_ring: - type: number - format: float - default: 0.1 - minimum: 0.1 - maximum: 100.0 + buffer: + $ref: '#/components/schemas/image_buffer_status' error_message: type: object required: @@ -1188,6 +1244,7 @@ components: required: - box - circle + - azim description: "ROI defintions" properties: box: @@ -1246,7 +1303,7 @@ components: enum: [Xp, Xn, Yp, Yn] detector_type: type: string - enum: [EIGER, JUNGFRAU] + enum: [EIGER, JUNGFRAU, DECTRIS] image_pusher_type: type: string default: None @@ -1296,13 +1353,13 @@ components: type: object required: - description - - serial_number properties: description: type: string minLength: 1 serial_number: type: string + default: "Unknown" minLength: 1 type: $ref: '#/components/schemas/detector_type' @@ -1334,6 +1391,16 @@ components: description: | Minimum difference between frame time and count time in microseconds Defaults are 3 us for EIGER and 20 us for JUNGFRAU + minimum_count_time_us: + type: integer + format: int64 + minimum: 0 + description: Minimum count time available for the detector. + minimum_frame_time_us: + type: integer + format: int64 + minimum: 0 + description: Minimum frame time available for the detector. calibration_file: type: array description: | @@ -1366,6 +1433,10 @@ components: type: array items: $ref: '#/components/schemas/detector_module' + roi_mode: + type: string + default: "" + description: ROI setting for DECTRIS detectors mirror_y: type: boolean default: true @@ -1468,6 +1539,9 @@ components: frontend_directory: type: string description: Location of built JavaScript web frontend + resonet_model: + type: string + description: Path to Resonet model image_pusher: $ref: '#/components/schemas/image_pusher_type' zeromq_preview: @@ -2215,6 +2289,28 @@ paths: schema: type: string description: Exception error + /plot/resolution_estimate: + get: + summary: Generate resolution estimate plot + description: | + Diffraction resolution, as estimated by SSRL ML model; binning is configurable + parameters: + - $ref: '#/components/parameters/binning' + - $ref: '#/components/parameters/compression' + responses: + "200": + description: Everything OK. Response will be by default compressed with deflate algorithm, if using curl, use --compressed option. + content: + application/json: + schema: + $ref: '#/components/schemas/plots' + "400": + description: Input parsing or validation error + content: + text/plain: + schema: + type: string + description: Exception error /plot/spot_count: get: summary: Generate spot count plot @@ -2622,82 +2718,13 @@ paths: application/json: schema: $ref: '#/components/schemas/calibration_statistics' - /preview/image.jpeg: - post: - summary: Get last preview image in JPEG format using custom settings - responses: - "200": - description: Preview image - content: - image/jpeg: - schema: - type: string - format: binary - "404": - description: No preview image recorded so far - "400": - description: Input parsing or validation error - content: - text/plain: - schema: - type: string - description: Exception error - "500": - description: Error within Jungfraujoch code - see output message. - content: - application/json: - schema: - $ref: '#/components/schemas/error_message' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/preview_settings' - get: - summary: Get last preview image in JPEG format using default settings - responses: - "200": - description: Preview image - content: - image/jpeg: - schema: - type: string - format: binary - "404": - description: No preview image recorded so far - /preview/image.tiff: - get: - summary: Get last preview image in TIFF format - responses: - "200": - description: Preview image - content: - image/tiff: - schema: - type: string - format: binary - "404": - description: No preview image recorded so far - /preview/calibration.tiff: - get: - summary: Get last preview image in TIFF format for calibration with PyFAI/Dioptas - description: Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction - responses: - "200": - description: Preview image - content: - image/tiff: - schema: - type: string - format: binary - "404": - description: No preview image recorded so far /config/mask: get: summary: Get mask of the detector (binary) description: | - Get full pixel mask of the detector - See NXmx standard for meaning of pixel values + Detector must be Initialized. + Get full pixel mask of the detector. + See NXmx standard for meaning of pixel values. responses: "200": description: Binary array (4 byte; unsigned) @@ -2708,7 +2735,9 @@ paths: format: binary /config/user_mask: get: - summary: Get user mask of the detector (binary) + summary: | + Detector must be Initialized. + Get user mask of the detector (binary) description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked" responses: "200": @@ -2747,6 +2776,7 @@ paths: get: summary: Get mask of the detector (TIFF) description: | + Should be in `Idle` state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values responses: @@ -2759,7 +2789,9 @@ paths: format: binary /config/user_mask.tiff: get: - summary: Get user mask of the detector (TIFF) + summary: | + Detector must be Initialized. + Get user mask of the detector (TIFF) description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked" responses: "200": @@ -2845,13 +2877,7 @@ paths: summary: Get image message in CBOR format description: Contains full image data and metadata. The image must come from the latest data collection. parameters: - - in: query - name: image_number - required: false - schema: - type: integer - format: int64 - description: Image number. If omitted, the image with the highest number in the image buffer will be provided. + - $ref: '#/components/parameters/image_id' responses: "200": description: Return image message @@ -2868,6 +2894,56 @@ paths: application/json: schema: $ref: '#/components/schemas/error_message' + /image_buffer/image.jpeg: + get: + summary: Get preview image in JPEG format using custom settings + parameters: + - $ref: '#/components/parameters/image_id' + - $ref: '#/components/parameters/show_user_mask' + - $ref: '#/components/parameters/show_roi' + - $ref: '#/components/parameters/show_spots' + - $ref: '#/components/parameters/saturation' + - $ref: '#/components/parameters/jpeg_quality' + - $ref: '#/components/parameters/resolution_ring' + - $ref: '#/components/parameters/color_scale' + responses: + "200": + description: Preview image + content: + image/jpeg: + schema: + type: string + format: binary + "404": + description: Image not present in the buffer - either not yet measured or already replaced by a next image. + "400": + description: Input parsing or validation error + content: + text/plain: + schema: + type: string + description: Exception error + "500": + description: Error within Jungfraujoch code - see output message. + content: + application/json: + schema: + $ref: '#/components/schemas/error_message' + /image_buffer/image.tiff: + get: + summary: Get preview image in TIFF format + parameters: + - $ref: '#/components/parameters/image_id' + responses: + "200": + description: Preview image + content: + image/tiff: + schema: + type: string + format: binary + "404": + description: No preview image recorded so far /image_buffer/clear: post: summary: Clear image buffer diff --git a/broker/jfjoch_broker.cpp b/broker/jfjoch_broker.cpp index 86f984d3..a732db15 100644 --- a/broker/jfjoch_broker.cpp +++ b/broker/jfjoch_broker.cpp @@ -13,6 +13,8 @@ #include "JFJochBrokerParser.h" #include "../writer/HDF5Objects.h" +#include "../common/print_license.h" +#include "../detector_control/DectrisSimplonClient.h" static Pistache::Http::Endpoint *httpEndpoint; @@ -47,13 +49,7 @@ static void setUpUnixSignals(std::vector quitSignals) { int main (int argc, char **argv) { RegisterHDF5Filter(); - std::cout << "jfjoch_broker Copyright (C) 2024 Paul Scherrer Institute" << std::endl; - std::cout << "This program comes with ABSOLUTELY NO WARRANTY" << std::endl; - std::cout << "This is free software, and you are welcome to redistribute it" << std::endl; - std::cout << "under certain conditions (GPLv3)" << std::endl; - std::cout << "" << std::endl; - std::cout << "Development supported by Innovation Project (101.535.1 IP-ENG) from Innosuisse" << std::endl; - std::cout << "" << std::endl; + print_license("jfjoch_broker"); if ((argc == 1) || (argc > 3)) { std::cout << "Usage ./jfjoch_broker {}" << std::endl; @@ -80,12 +76,24 @@ int main (int argc, char **argv) { std::unique_ptr image_pusher = ParseImagePusher(settings); - DiffractionExperiment experiment; + std::vector det_setup; + for (const auto &d: settings.getDetector()) + det_setup.push_back(ParseDetectorSetup(d)); + + if (det_setup.empty()) { + logger.Error("At least one detector need to be defined in the config file"); + exit(EXIT_FAILURE); + } + + DiffractionExperiment experiment(det_setup[0]); ParseFacilityConfiguration(settings, experiment); AcquisitionDeviceGroup aq_devices; ParseAcquisitionDeviceGroup(settings, aq_devices); + if (settings.resonetModelIsSet()) + experiment.NeuralNetModelPath(settings.getResonetModel()); + experiment.DataStreams(aq_devices.size()); int32_t send_buffer_size_MiB = settings.getImageBufferMiB(); @@ -110,8 +118,8 @@ int main (int argc, char **argv) { JFJochBrokerHttp broker(experiment, router); broker.FrontendDirectory(settings.getFrontendDirectory()); - for (const auto &d: settings.getDetector()) - broker.AddDetectorSetup(ParseDetectorSetup(d)); + for (const auto &d: det_setup) + broker.AddDetectorSetup(d); if (receiver) broker.Services().Receiver(receiver.get()); diff --git a/broker/redoc-static.html b/broker/redoc-static.html index c435a954..43a3d9e3 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -12,344 +12,368 @@ margin: 0; } - -

Jungfraujoch (1.0.0-rc.35)

Download OpenAPI specification:Download

Filip Leonarski (Paul Scherrer Institute): filip.leonarski@psi.ch License: GPL-3.0

Jungfraujoch (1.0.0-rc.36)

Download OpenAPI specification:

Filip Leonarski (Paul Scherrer Institute): filip.leonarski@psi.ch License: GPL-3.0

API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates.

-

Initialize detector and data acquisition

Initialize detector and data acquisition

Should be used in two cases:

+" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Should be used in two cases:

  • Detector is in Inactive state
  • Detector is in Error state @@ -393,291 +417,291 @@ During operation of the detector it is recommended to use the POST /pedest If storage cells are used, the execution time might be few minutes.

This is async function - one needs to use POST /wait_till_done to ensure operation is done.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Collect dark current for the detector

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Collect dark current for the detector

Updates calibration of the JUNGFRAU detector. Must be in Idle state.

+" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Updates calibration of the JUNGFRAU detector. Must be in Idle state.

X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us).

This is async function - one needs to use POST /wait_till_done to ensure operation is done.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Start detector

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Start detector

Start data acquisition. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Start data acquisition. Detector must be in Idle state. Doesn't run calibration procedure. When the function returns, detector is ready to accept soft/TTL triggers.

-
Request Body schema: application/json
images_per_trigger
integer <int64> >= 1
Default: 1
Request Body schema: application/json
images_per_trigger
integer <int64> >= 1
Default: 1

For standard synchrotron data collection - this is number of images collected per one TTL trigger +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

For standard synchrotron data collection - this is number of images collected per one TTL trigger For XFEL (pulsed source) - this number is ignored and set to 1 For storage cell mode - this number is ignored and set to number of storage cells

-
ntrigger
integer <int64> >= 1
Default: 1

Number of TTL trigger that the detector is expected to receive during data collection

-
image_time_us
integer <int64> >= 0
ntrigger
integer <int64> >= 1
Default: 1

Number of TTL trigger that the detector is expected to receive during data collection

+
image_time_us
integer <int64> >= 0

Image time. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Image time. If not provided (or zero value) the frame time is assumed as default. Image time must be multiple of frame time; max value is 256 * frame_time.
In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells and if raw data are saved.

-
beam_x_pxl
required
number <float>
beam_x_pxl
required
number <float>

/entry/detector/beam_center_x in NXmx +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

/entry/detector/beam_center_x in NXmx Beam center in X direction [pixels]

-
beam_y_pxl
required
number <float>
beam_y_pxl
required
number <float>

/entry/detector/beam_center_y in NXmx +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

/entry/detector/beam_center_y in NXmx Beam center in X direction [pixels]

-
detector_distance_mm
required
number <float> >= 0

/entry/detector/distance in NXmx Detector distance [mm]

-
incident_energy_keV
required
number <float> [ 0.001 .. 500 ]
detector_distance_mm
required
number <float> >= 0

/entry/detector/distance in NXmx Detector distance [mm]

+
incident_energy_keV
required
number <float> [ 0.001 .. 500 ]

Used to calculate /entry/beam/incident_wavelength in NXmx +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Used to calculate /entry/beam/incident_wavelength in NXmx Incident particle (photon, electron) energy in keV

-
file_prefix
string
Default: ""

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

-
images_per_file
integer <int64> >= 0
Default: 1000

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

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

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

-
sample_name
string
Default: ""
file_prefix
string
Default: ""

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

+
images_per_file
integer <int64> >= 0
Default: 1000

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

+
space_group_number
integer <int64> [ 0 .. 194 ]
Default: 0

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

+
sample_name
string
Default: ""

/entry/sample/name in NXmx +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

/entry/sample/name in NXmx Sample name

-
compression
string
Default: "bslz4"
Enum: "bslz4" "bszstd" "bszstd_rle" "none"

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

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

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

+
total_flux
number <float>

/entry/beam/total_flux in NXmx +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

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

-
transmission
number <float> [ 0 .. 1 ]
transmission
number <float> [ 0 .. 1 ]

/entry/instrument/attenuator/attenuator_transmission +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

/entry/instrument/attenuator/attenuator_transmission Transmission of attenuator (filter) [no units]

-
object (rotation_axis)

Definition of a crystal rotation axis

-
header_appendix
any
object (rotation_axis)

Definition of a crystal rotation axis

+
header_appendix
any

Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) In general, it is not saved in HDF5 file.

However, if values are placed in "hdf5" object, jfjoch_writer will write them in /entry/data of the HDF5 file. This applies solely to string and number (double floating-point). No arrays/sub-objects is allowed. For example {"hdf5": {"val1":1, "val2":"xyz"}}, will write /entry/user/val1 and /entry/user/val2.

-
image_appendix
any
image_appendix
any

Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON) +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

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

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

Rate at which non-indexed images are accepted to be forwarded to writer. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability.

-
pixel_value_low_threshold
integer <int64> >= 0
pixel_value_low_threshold
integer <int64> >= 0

Set all counts lower than the value to zero. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Set all counts lower than the value to zero. When the value is set, negative numbers other than error pixel value are always set to zero. Setting to zero is equivalent to turning the option off.

-
run_number
integer <int64> >= 0
run_number
integer <int64> >= 0

Number of run within an experimental session. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Number of run within an experimental session. Transferred over CBOR stream as "series ID", though not saved in HDF5 file. It is highly recommended to keep this number unique for each data collection during experimental series. If not provided, the number will be automatically incremented.

-
run_name
string
run_name
string

Unique ID of run. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Unique ID of run. Transferred over CBOR stream as "unique series ID", though not saved in HDF5 file. It is highly recommended to keep this name unique for each data collection during experimental series. If not provided, the name will be automatically generated as number + colon + file_prefix.

-
experiment_group
string
experiment_group
string

Name of group owning the data (e.g. p-group or proposal number). +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Name of group owning the data (e.g. p-group or proposal number). Transferred over CBOR stream, though not saved in HDF5 file.

-
poisson_compression
integer <int64> [ 0 .. 16 ]
poisson_compression
integer <int64> [ 0 .. 16 ]

Enable lossy compression of pixel values that preserves Poisson statistics. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Enable lossy compression of pixel values that preserves Poisson statistics. Requires to provide a numerical factor SQ. Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer. Compression is turned off if the value is missing or it is set to zero.

-
write_nxmx_hdf5_master
boolean
Default: true
write_nxmx_hdf5_master
boolean
Default: true

Write NXmx formatted HDF5 master file. Recommended to use for macromolecular crystallography experiments +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Write NXmx formatted HDF5 master file. Recommended to use for macromolecular crystallography experiments and to turn off for other experiments.

-
save_calibration
boolean
save_calibration
boolean

Forward image calibration (at the moment pedestal and pedestal RMS for JUNGFRAU) using the ZeroMQ stream to writer. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

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

-
object

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

-

Responses

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "image_time_us": 0,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "incident_energy_keV": 0.001,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 0,
  • "sample_name": "",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "goniometer": {
    },
  • "header_appendix": null,
  • "image_appendix": null,
  • "data_reduction_factor_serialmx": 1,
  • "pixel_value_low_threshold": 0,
  • "run_number": 0,
  • "run_name": "string",
  • "experiment_group": "string",
  • "poisson_compression": 16,
  • "write_nxmx_hdf5_master": true,
  • "save_calibration": true,
  • "unit_cell": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Wait for acquisition done

object

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

+

Responses

Request samples

Content type
application/json
{
  • "images_per_trigger": 1,
  • "ntrigger": 1,
  • "image_time_us": 0,
  • "beam_x_pxl": 0.1,
  • "beam_y_pxl": 0.1,
  • "detector_distance_mm": 0.1,
  • "incident_energy_keV": 0.001,
  • "file_prefix": "",
  • "images_per_file": 1000,
  • "space_group_number": 0,
  • "sample_name": "",
  • "compression": "bslz4",
  • "total_flux": 0.1,
  • "transmission": 1,
  • "goniometer": {
    },
  • "header_appendix": null,
  • "image_appendix": null,
  • "data_reduction_factor_serialmx": 1,
  • "pixel_value_low_threshold": 0,
  • "run_number": 0,
  • "run_name": "string",
  • "experiment_group": "string",
  • "poisson_compression": 16,
  • "write_nxmx_hdf5_master": true,
  • "save_calibration": true,
  • "unit_cell": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Wait for acquisition done

Block execution of external script till initialization, data collection or pedestal is finished. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software.

To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.

-
query Parameters
timeout
integer [ 0 .. 3600 ]
Default: 60

Timeout in seconds (0 == immediate response)

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Send soft trigger to the detector

Generate soft trigger

-

Responses

Cancel running data collection

query Parameters
timeout
integer [ 0 .. 3600 ]
Default: 60

Timeout in seconds (0 == immediate response)

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Send soft trigger to the detector

Generate soft trigger

+

Responses

Cancel running data collection

Command will inform FPGA network card to stop pedestal or data collection at the current stage. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Command will inform FPGA network card to stop pedestal or data collection at the current stage. Any frame that is currently being processed by CPU will be finished and sent to writer. Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to Idle state.

If data collection is not running, the command has no effect.

-

Responses

Prepare detector to turn off

Responses

Prepare detector to turn off

Should be in Idle or Error state. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Should be in Idle or Error state. Command deactivates data acquisition and turns off detector high voltage and ASIC. Should be used always before turning off power from the detector.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Change detector configuration

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Change detector configuration

Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. This can only be done when detector is Idle, Error or Inactive states. If detector is in Idle state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation. If detector is in Inactive or Error states, new settings will be saved, but no calibration will be executed.

-
Request Body schema: application/json
frame_time_us
required
integer <int64> >= 1
Request Body schema: application/json
frame_time_us
required
integer <int64> >= 1

Interval between consecutive frames. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Interval between consecutive frames. This is internal frame time for the JUNGFRAU detector, image time has to be integer multiply of this number. For EIGER detector this is default frame time, not used otherwise

-
count_time_us
integer <int64>
count_time_us
integer <int64>

Integration time of the detector. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Integration time of the detector. If not provided count time will be set to maximum value for a given frame time.

-
internal_frame_generator
boolean
Default: false

Use internal frame generator in FPGA instead of getting data from a real detector

-
internal_frame_generator_images
integer <int64> [ 1 .. 64 ]
Default: 1

Number of images stored in the internal frame generator.

-
detector_trigger_delay_ns
integer <int64> >= 0
Default: 0

Delay between TTL trigger and acquisition start [ns]

-
timing
string (detector_timing)
Default: "trigger"
Enum: "auto" "trigger" "burst" "gated"
eiger_threshold_keV
number <float> [ 1 .. 100 ]
internal_frame_generator
boolean
Default: false

Use internal frame generator in FPGA instead of getting data from a real detector

+
internal_frame_generator_images
integer <int64> [ 1 .. 64 ]
Default: 1

Number of images stored in the internal frame generator.

+
detector_trigger_delay_ns
integer <int64> >= 0
Default: 0

Delay between TTL trigger and acquisition start [ns]

+
timing
string (detector_timing)
Default: "trigger"
Enum: "auto" "trigger" "burst" "gated"
eiger_threshold_keV
number <float> [ 1 .. 100 ]

Threshold for the EIGER detector. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Threshold for the EIGER detector. If value is provided, it will be used for all subsequent acquisitions, irrespective of beam energy. If value is not provided, threshold will be determined on start of acquisition as half of incident energy. This might lead to increased start time.

-
eiger_bit_depth
integer <int64>
Enum: 8 16 32
eiger_bit_depth
integer <int64>
Enum: 8 16 32

Bit depth of EIGER read-out. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Bit depth of EIGER read-out. If value is not provided bit depth is adjusted automatically based on the image time.

-
jungfrau_pedestal_g0_frames
integer <int64> >= 0
Default: 2000
jungfrau_pedestal_g1_frames
integer <int64> >= 0
Default: 300
jungfrau_pedestal_g2_frames
integer <int64> >= 0
Default: 300
jungfrau_pedestal_min_image_count
integer <int64> >= 32
Default: 128

Minimum number of collected images for pedestal to consider it viable

-
jungfrau_storage_cell_count
integer <int64> [ 1 .. 16 ]
Default: 1
jungfrau_storage_cell_delay_ns
integer <int64> >= 2100
Default: 5000

Delay between two storage cells [ns]

-
jungfrau_fixed_gain_g1
boolean
Default: false

Fix gain to G1 (can be useful for storage cells)

-
jungfrau_use_gain_hg0
boolean
Default: false

Use high G0 (for low energy applications)

-

Responses

Request samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get detector configuration

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Change file writer settings

This can only be done when detector is Idle, Error or Inactive states.

-
Request Body schema: application/json
overwrite
boolean
Default: false

Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.

-
format
string (file_writer_format)
Default: "NXmxLegacy"
Enum: "None" "NXmxLegacy" "NXmxVDS"
jungfrau_pedestal_g0_frames
integer <int64> >= 0
Default: 2000
jungfrau_pedestal_g1_frames
integer <int64> >= 0
Default: 300
jungfrau_pedestal_g2_frames
integer <int64> >= 0
Default: 300
jungfrau_pedestal_min_image_count
integer <int64> >= 32
Default: 128

Minimum number of collected images for pedestal to consider it viable

+
jungfrau_storage_cell_count
integer <int64> [ 1 .. 16 ]
Default: 1
jungfrau_storage_cell_delay_ns
integer <int64> >= 2100
Default: 5000

Delay between two storage cells [ns]

+
jungfrau_fixed_gain_g1
boolean
Default: false

Fix gain to G1 (can be useful for storage cells)

+
jungfrau_use_gain_hg0
boolean
Default: false

Use high G0 (for low energy applications)

+

Responses

Request samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get detector configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "frame_time_us": 1,
  • "count_time_us": 0,
  • "internal_frame_generator": false,
  • "internal_frame_generator_images": 1,
  • "detector_trigger_delay_ns": 0,
  • "timing": "auto",
  • "eiger_threshold_keV": 1,
  • "eiger_bit_depth": 8,
  • "jungfrau_pedestal_g0_frames": 2000,
  • "jungfrau_pedestal_g1_frames": 300,
  • "jungfrau_pedestal_g2_frames": 300,
  • "jungfrau_pedestal_min_image_count": 128,
  • "jungfrau_storage_cell_count": 1,
  • "jungfrau_storage_cell_delay_ns": 5000,
  • "jungfrau_fixed_gain_g1": false,
  • "jungfrau_use_gain_hg0": false
}

Change file writer settings

This can only be done when detector is Idle, Error or Inactive states.

+
Request Body schema: application/json
overwrite
boolean
Default: false

Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.

+
format
string (file_writer_format)
Default: "NXmxLegacy"
Enum: "None" "NXmxLegacy" "NXmxVDS" "CBF" "TIFF"

None - no master file written +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

None - no master file written NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia
NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling

-

Responses

Request samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "None"
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get file writer settings

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "None"
}

Change instrument metadata

This can only be done when detector is Idle, Error or Inactive states.

-
Request Body schema: application/json
source_name
required
string
source_type
string
Default: ""
Responses

Request samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "None"
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get file writer settings

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "overwrite": false,
  • "format": "None"
}

Change instrument metadata

This can only be done when detector is Idle, Error or Inactive states.

+
Request Body schema: application/json
source_name
required
string
source_type
string
Default: ""

Type of radiation source. NXmx gives a fixed dictionary, though Jungfraujoch is not enforcing compliance. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Type of radiation source. NXmx gives a fixed dictionary, though Jungfraujoch is not enforcing compliance. https://manual.nexusformat.org/classes/base_classes/NXsource.html#nxsource NXsource allows the following:

Spallation Neutron Source @@ -709,639 +733,613 @@ Optical Laser Ion Source UV Plasma Source Metal Jet X-ray

-
instrument_name
required
string
pulsed_source
boolean
Default: false

Settings specific to XFEL (e.g., every image has to come from TTL trigger, save pulse ID and event code)

-
electron_source
boolean
Default: false

Settings specific to electron source (e.g., wavelength definition)

-

Responses

Request samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get instrument metadata

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Change image output format

This can only be done when detector is Idle, Error or Inactive states.

-
Request Body schema: application/json
summation
required
boolean
instrument_name
required
string
pulsed_source
boolean
Default: false

Settings specific to XFEL (e.g., every image has to come from TTL trigger, save pulse ID and event code)

+
electron_source
boolean
Default: false

Settings specific to electron source (e.g., wavelength definition)

+

Responses

Request samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get instrument metadata

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "source_name": "Swiss Light Source",
  • "source_type": "Synchrotron X-ray Source",
  • "instrument_name": "CristallinaMX",
  • "pulsed_source": false,
  • "electron_source": false
}

Change image output format

This can only be done when detector is Idle, Error or Inactive states.

+
Request Body schema: application/json
summation
required
boolean

Enable summation of images to a given image_time +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Enable summation of images to a given image_time If disabled images are saved according to original detector speed, but image count is adjusted

-
geometry_transform
required
boolean

Place module read-out into their location on composed detector and extend multipixels

-
jungfrau_conversion
required
boolean
geometry_transform
required
boolean

Place module read-out into their location on composed detector and extend multipixels

+
jungfrau_conversion
required
boolean

Convert pixel value in ADU to photon counts/energy +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Convert pixel value in ADU to photon counts/energy Only affects JUNGFRAU detector

-
jungfrau_conversion_factor_keV
number <float> [ 0.001 .. 500 ]
jungfrau_conversion_factor_keV
number <float> [ 0.001 .. 500 ]

Used to convert energy deposited into pixel to counts +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Used to convert energy deposited into pixel to counts If not provided incident_energy_keV is used

-
bit_depth_image
integer <int64>
Enum: 8 16 32
bit_depth_image
integer <int64>
Enum: 8 16 32

Bit depth of resulting image (it doesn't affect the detector read-out value) +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Bit depth of resulting image (it doesn't affect the detector read-out value) If not provided value is adjusted automatically

-
signed_output
boolean
signed_output
boolean

Controls if pixels have signed output +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Controls if pixels have signed output If not provided value is adjusted automatically

-
mask_module_edges
required
boolean
Default: true

Mask 1 pixel on the module boundary

-
mask_chip_edges
required
boolean
Default: true

Mask multipixels on chip boundary

-
jungfrau_mask_pixels_without_g0
boolean
Default: true
mask_module_edges
required
boolean
Default: true

Mask 1 pixel on the module boundary

+
mask_chip_edges
required
boolean
Default: true

Mask multipixels on chip boundary

+
jungfrau_mask_pixels_without_g0
boolean
Default: true

JUNGFRAU: mask pixels that don't operate in G0, but do operate in G1 and G1. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

JUNGFRAU: mask pixels that don't operate in G0, but do operate in G1 and G1. This should be turned off for cases, where detector is operated at room temperature with long exposure time.

-
apply_mask
required
boolean
Default: false

Masked pixels are set to special value in the images produced by Jungfraujoch

-
jungfrau_pedestal_g0_rms_limit
integer <int64> >= 0
Default: 100

Pixels with pedestal G0 RMS above the threshold are marked as masked pixels

-

Responses

Request samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get image output format

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Configure format for raw data collection

This can only be done when detector is Idle, Error or Inactive states.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Configure format for data collection with full conversion

This can only be done when detector is Idle, Error or Inactive states.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Configure spot finding

Can be done anytime, also while data collection is running

-
Request Body schema: application/json
enable
required
boolean
Default: true
apply_mask
required
boolean
Default: false

Masked pixels are set to special value in the images produced by Jungfraujoch

+
jungfrau_pedestal_g0_rms_limit
integer <int64> >= 0
Default: 100

Pixels with pedestal G0 RMS above the threshold are marked as masked pixels

+

Responses

Request samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get image output format

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "summation": true,
  • "geometry_transform": true,
  • "jungfrau_conversion": true,
  • "jungfrau_conversion_factor_keV": 0.001,
  • "bit_depth_image": 8,
  • "signed_output": true,
  • "mask_module_edges": true,
  • "mask_chip_edges": true,
  • "jungfrau_mask_pixels_without_g0": true,
  • "apply_mask": false,
  • "jungfrau_pedestal_g0_rms_limit": 100
}

Configure format for raw data collection

This can only be done when detector is Idle, Error or Inactive states.

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Configure format for data collection with full conversion

This can only be done when detector is Idle, Error or Inactive states.

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Configure spot finding

Can be done anytime, also while data collection is running

+
Request Body schema: application/json
enable
required
boolean
Default: true

Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection. Even if disabled spot finding information will still be send and written, though always with zero spots.

-
indexing
required
boolean
Default: true

Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.

-
filter_powder_rings
boolean
Default: false

Filter spots which form powder rings (e.g., ice rings)

-
min_spot_count_powder_ring
integer <int64> >= 5

Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.

-
signal_to_noise_threshold
required
number <float> >= 0
photon_count_threshold
required
integer <int64> >= 0
min_pix_per_spot
required
integer <int64> >= 1
max_pix_per_spot
required
integer <int64> >= 1
high_resolution_limit
required
number <float>
low_resolution_limit
required
number <float>
indexing_tolerance
required
number <float> [ 0 .. 1 ]

Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted

-

Responses

Request samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1
}

Get data processing configuration

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1
}

Configure radial integration

Can be done when detector is Inactive or Idle

-
Request Body schema: application/json
polarization_factor
number <float> [ -1 .. 1 ]

If polarization factor is provided, than polarization correction is enabled.

-
solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for radial integration

-
high_q_recipA
required
number <float>
low_q_recipA
required
number <float>
q_spacing
required
number <float>

Responses

Request samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get radial integration configuration

Can be done anytime

-

Responses

Response samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Load binary image for internal FPGA generator

indexing
required
boolean
Default: true

Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.

+
filter_powder_rings
boolean
Default: false

Filter spots which form powder rings (e.g., ice rings)

+
min_spot_count_powder_ring
integer <int64> >= 5

Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.

+
signal_to_noise_threshold
required
number <float> >= 0
photon_count_threshold
required
integer <int64> >= 0
min_pix_per_spot
required
integer <int64> >= 1
max_pix_per_spot
required
integer <int64> >= 1
high_resolution_limit
required
number <float>
low_resolution_limit
required
number <float>
indexing_tolerance
required
number <float> [ 0 .. 1 ]

Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted

+
resolution_estimate
boolean
Default: true

Diffraction image resolution estimation using ML model from SSRL; jfjoch_broker must be compiled with libtorch support +and path to .pt file configured in jfjoch_broker configuration file.

+

Responses

Request samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1,
  • "resolution_estimate": true
}

Get data processing configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "enable": true,
  • "indexing": true,
  • "filter_powder_rings": false,
  • "min_spot_count_powder_ring": 5,
  • "signal_to_noise_threshold": 0.1,
  • "photon_count_threshold": 0,
  • "min_pix_per_spot": 1,
  • "max_pix_per_spot": 1,
  • "high_resolution_limit": 0.1,
  • "low_resolution_limit": 0.1,
  • "indexing_tolerance": 1,
  • "resolution_estimate": true
}

Configure radial integration

Can be done when detector is Inactive or Idle

+
Request Body schema: application/json
polarization_factor
number <float> [ -1 .. 1 ]

If polarization factor is provided, than polarization correction is enabled.

+
solid_angle_corr
required
boolean
Default: true

Apply solid angle correction for radial integration

+
high_q_recipA
required
number <float>
low_q_recipA
required
number <float>
q_spacing
required
number <float>

Responses

Request samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get radial integration configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "polarization_factor": -1,
  • "solid_angle_corr": true,
  • "high_q_recipA": 0.1,
  • "low_q_recipA": 0.1,
  • "q_spacing": 0.1
}

Load binary image for internal FPGA generator

Load image for internal FPGA generator. This can only happen in Idle state of the detector. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).

-
query Parameters
id
integer <int64> [ 0 .. 127 ]

Image id to upload

-
Request Body schema: application/octet-stream
string <binary>

Responses

Load TIFF image for internal FPGA generator

query Parameters
id
integer <int64> [ 0 .. 127 ]

Image id to upload

+
Request Body schema: application/octet-stream
string <binary>

Responses

Load TIFF image for internal FPGA generator

Load image for internal FPGA generator. This can only happen in Idle state of the detector. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).

-
query Parameters
id
integer [ 0 .. 127 ]

Image ID to upload

-
Request Body schema: image/tiff
string <binary>

Responses

Select detector

query Parameters
id
integer [ 0 .. 127 ]

Image ID to upload

+
Request Body schema: image/tiff
string <binary>

Responses

Select detector

Jungfraujoch allows to control multiple detectors and/or region-of-interests. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Jungfraujoch allows to control multiple detectors and/or region-of-interests. The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response). Changing detector will set detector to Inactive state and will require reinitialization.

-
Request Body schema: application/json
id
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "id": 1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

List available detectors

Configured detectors that can be selected by used

-

Responses

Response samples

Content type
application/json
{
  • "detectors": [
    ],
  • "current_id": 0
}

Set ZeroMQ preview settings

Request Body schema: application/json
id
required
integer <int64>

Responses

Request samples

Content type
application/json
{
  • "id": 1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

List available detectors

Configured detectors that can be selected by used

+

Responses

Response samples

Content type
application/json
{
  • "detectors": [
    ],
  • "current_id": 0
}

Set ZeroMQ preview settings

Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. Options set with this PUT request have no effect on HTTP based preview.

-
Request Body schema: application/json
enabled
required
boolean
Default: true

ZeroMQ preview socket is enabled.

-
period_ms
required
integer <int64>
Default: 1000
Request Body schema: application/json
enabled
required
boolean
Default: true

ZeroMQ preview socket is enabled.

+
period_ms
required
integer <int64>
Default: 1000

Period for generating preview image sent to the ZeroMQ interface in milliseconds. Default is 1 second. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Period for generating preview image sent to the ZeroMQ interface in milliseconds. Default is 1 second. If set to zero, all images will be sent ZeroMQ (should be used only in case of relatively slow data collection). This has no effect on HTTP based preview, which updates always at rate of 1 second.

-
socket_address
string
socket_address
string

PUB ZeroMQ socket for preview images. This socket operates at a reduced frame rate. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

PUB ZeroMQ socket for preview images. This socket operates at a reduced frame rate. Images are serialized using CBOR. Address follows ZeroMQ convention for sockets - in practice ipc:// and tcp://: sockets are OK. 0.0.0.0 instead of IP address is accepted and means listening on all network interfaces.

-

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get ZeroMQ preview settings

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Set ZeroMQ metadata settings

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get ZeroMQ preview settings

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Set ZeroMQ metadata settings

Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request.

-
Request Body schema: application/json
enabled
required
boolean
Default: true

ZeroMQ metadata socket is enabled.

-
period_ms
required
integer <int64> >= 1
Default: 1000

Period for generating metadata package sent to the ZeroMQ interface in milliseconds.

-
socket_address
string
Request Body schema: application/json
enabled
required
boolean
Default: true

ZeroMQ metadata socket is enabled.

+
period_ms
required
integer <int64> >= 1
Default: 1000

Period for generating metadata package sent to the ZeroMQ interface in milliseconds.

+
socket_address
string

PUB ZeroMQ socket for image metadata information. +" class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

PUB ZeroMQ socket for image metadata information. Image metadata are serialized using CBOR. Address follows ZeroMQ convention for sockets - in practice ipc:// and tcp://: sockets are OK. 0.0.0.0 instead of IP address is accepted and means listening on all network interfaces.

-

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get ZeroMQ metadata socket settings

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Get Jungfraujoch status

Status of the data acquisition

-

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "message": "string",
  • "message_severity": "success"
}

Get status of FPGA devices

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Return XFEL pulse IDs for the current data acquisition

Return array of XFEL pulse IDs - (-1) if image not recorded

-

Responses

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

-

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

-

Responses

Response samples

Content type
application/json
{
  • "state": "Idle",
  • "powerchip": "PowerOn",
  • "server_version": "string",
  • "number_of_triggers_left": 0,
  • "fpga_temp_degC": [
    ],
  • "high_voltage_V": [
    ]
}

Get ROI definitions

Responses

Response samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Upload ROI definitions

Request Body schema: application/json
required
object (roi_box_list)

List of box ROIs

-
required
object (roi_circle_list)

List of circular ROIs

-
object (roi_azim_list)

List of azimuthal ROIs

-

Responses

Request samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Generate background estimate plot

Mean intensity for d = 3 - 5 A per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate spot count plot

Number of spots per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing rate plot

Image indexing rate; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing unit cell length plots

Crystal unit cell based on indexing results; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing unit cell angle plot

Crystal unit cell based on indexing results; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate error pixels plot

Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate strong pixels plot

Count of strong pixels per image (from spot finding); binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate maximum pixel value plot

Provides maximum viable pixel value (excluding overloads and error pixels); binning is configurable and maximum of a bin is returned

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate ROI sum plot

Sum of ROI rectangle per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI max count

Max count of ROI per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI valid pixels

Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI mean value

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!

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI weighted X-coordinate

Pixel X weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI weighted Y-coordinate

Pixel Y weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver delay plot

Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver free send buffer plot

Amount of send buffers available during frame processing - used for internal debugging; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate image collection efficiency plot

Ratio of collected and expected packets per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot with number of received packets per image

Number of collected packets per image; binning is configurable

-
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

-
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate radial integration profile

Generate average radial integration profile

-
query Parameters
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Get general statistics

query Parameters
compression
boolean
Default: true

Enable DEFLATE compression of output data.

-

Responses

Response samples

Content type
application/json
{
  • "detector": {
    },
  • "detector_list": {
    },
  • "detector_settings": {
    },
  • "image_format_settings": {
    },
  • "instrument_metadata": {
    },
  • "file_writer_settings": {
    },
  • "data_processing_settings": {
    },
  • "measurement": {
    },
  • "broker": {
    },
  • "fpga": [
    ],
  • "calibration": [
    ],
  • "zeromq_preview": {
    },
  • "zeromq_metadata": {
    },
  • "pixel_mask": {
    },
  • "roi": {
    },
  • "az_int": {
    }
}

Get data collection statistics

Results of the last data collection

-

Responses

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "run_number": 0,
  • "experiment_group": "string",
  • "images_expected": 0,
  • "images_collected": 0,
  • "images_sent": 0,
  • "images_discarded_lossy_compression": 0,
  • "max_image_number_sent": 0,
  • "collection_efficiency": 1,
  • "compression_ratio": 5.3,
  • "cancelled": true,
  • "max_receiver_delay": 0,
  • "indexing_rate": 0.1,
  • "detector_width": 0,
  • "detector_height": 0,
  • "detector_pixel_depth": 2,
  • "bkg_estimate": 0.1,
  • "unit_cell": "string",
  • "error_pixels": 0.1,
  • "saturated_pixels": 0.1,
  • "roi_beam_pixels": 0.1,
  • "roi_beam_sum": 0.1
}

Get calibration statistics

Statistics are provided for each module/storage cell separately

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get last preview image in JPEG format using custom settings

Request Body schema: application/json
saturation
required
integer <int64> [ 0 .. 65535 ]

Saturation value to set contrast in the preview image

-
show_spots
boolean
Default: true

Show spot finding results on the image

-
show_roi
boolean
Default: false

Show ROI areas on the image

-
jpeg_quality
integer <int64> [ 0 .. 100 ]
Default: 100

Quality of JPEG image (100 - highest; 0 - lowest)

-
show_indexed
boolean
Default: false

Preview indexed images only

-
show_user_mask
boolean
Default: false

Show user mask

-
resolution_ring
number <float> [ 0.1 .. 100 ]
Default: 0.1

Responses

Request samples

Content type
application/json
{
  • "saturation": 65535,
  • "show_spots": true,
  • "show_roi": false,
  • "jpeg_quality": 100,
  • "show_indexed": false,
  • "show_user_mask": false,
  • "resolution_ring": 0.1
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get last preview image in JPEG format using default settings

Responses

Get last preview image in TIFF format

Responses

Get last preview image in TIFF format for calibration with PyFAI/Dioptas

Image is reduced to unsigned 16-bit images, all bad pixels are set to 65535 and image is mirrored in vertical direction

-

Responses

Get mask of the detector (binary)

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get ZeroMQ metadata socket settings

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "period_ms": 1000,
  • "socket_address": "string"
}

Get Jungfraujoch status

Status of the data acquisition

+

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "message": "string",
  • "message_severity": "success"
}

Get status of FPGA devices

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Return XFEL pulse IDs for the current data acquisition

Return array of XFEL pulse IDs - (-1) if image not recorded

+

Responses

Response samples

Content type
application/json
[
  • 0
]

Return XFEL event codes for the current data acquisition

Return array of XFEL event codes

+

Responses

Response samples

Content type
application/json
[
  • 0
]

Get detector status

Status of the JUNGFRAU detector

+

Responses

Response samples

Content type
application/json
{
  • "state": "Idle",
  • "powerchip": "PowerOn",
  • "server_version": "string",
  • "number_of_triggers_left": 0,
  • "fpga_temp_degC": [
    ],
  • "high_voltage_V": [
    ]
}

Get ROI definitions

Responses

Response samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Upload ROI definitions

Request Body schema: application/json
required
object (roi_box_list)

List of box ROIs

+
required
object (roi_circle_list)

List of circular ROIs

+
required
object (roi_azim_list)

List of azimuthal ROIs

+

Responses

Request samples

Content type
application/json
{
  • "box": {
    },
  • "circle": {
    },
  • "azim": {
    }
}

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Generate background estimate plot

Mean intensity for d = 3 - 5 A per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate resolution estimate plot

Diffraction resolution, as estimated by SSRL ML model; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate spot count plot

Number of spots per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing rate plot

Image indexing rate; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing unit cell length plots

Crystal unit cell based on indexing results; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate indexing unit cell angle plot

Crystal unit cell based on indexing results; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate error pixels plot

Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate strong pixels plot

Count of strong pixels per image (from spot finding); binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate maximum pixel value plot

Provides maximum viable pixel value (excluding overloads and error pixels); binning is configurable and maximum of a bin is returned

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate ROI sum plot

Sum of ROI rectangle per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI max count

Max count of ROI per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI valid pixels

Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI mean value

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!

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI weighted X-coordinate

Pixel X weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot of ROI weighted Y-coordinate

Pixel Y weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver delay plot

Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate receiver free send buffer plot

Amount of send buffers available during frame processing - used for internal debugging; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate image collection efficiency plot

Ratio of collected and expected packets per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate plot with number of received packets per image

Number of collected packets per image; binning is configurable

+
query Parameters
binning
integer

Binning of frames for the plot (0 = default binning)

+
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Generate radial integration profile

Generate average radial integration profile

+
query Parameters
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "plot": [
    ]
}

Get general statistics

query Parameters
compression
boolean
Default: true

Enable DEFLATE compression of output data.

+

Responses

Response samples

Content type
application/json
{
  • "detector": {
    },
  • "detector_list": {
    },
  • "detector_settings": {
    },
  • "image_format_settings": {
    },
  • "instrument_metadata": {
    },
  • "file_writer_settings": {
    },
  • "data_processing_settings": {
    },
  • "measurement": {
    },
  • "broker": {
    },
  • "fpga": [
    ],
  • "calibration": [
    ],
  • "zeromq_preview": {
    },
  • "zeromq_metadata": {
    },
  • "pixel_mask": {
    },
  • "roi": {
    },
  • "az_int": {
    },
  • "buffer": {
    }
}

Get data collection statistics

Results of the last data collection

+

Responses

Response samples

Content type
application/json
{
  • "file_prefix": "string",
  • "run_number": 0,
  • "experiment_group": "string",
  • "images_expected": 0,
  • "images_collected": 0,
  • "images_sent": 0,
  • "images_discarded_lossy_compression": 0,
  • "max_image_number_sent": 0,
  • "collection_efficiency": 1,
  • "compression_ratio": 5.3,
  • "cancelled": true,
  • "max_receiver_delay": 0,
  • "indexing_rate": 0.1,
  • "detector_width": 0,
  • "detector_height": 0,
  • "detector_pixel_depth": 2,
  • "bkg_estimate": 0.1,
  • "unit_cell": "string",
  • "error_pixels": 0.1,
  • "saturated_pixels": 0.1,
  • "roi_beam_pixels": 0.1,
  • "roi_beam_sum": 0.1
}

Get calibration statistics

Statistics are provided for each module/storage cell separately

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get mask of the detector (binary)

Get full pixel mask of the detector +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Get full pixel mask of the detector See NXmx standard for meaning of pixel values

-

Responses

Get user mask of the detector (binary)

Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked

-

Responses

Upload user mask of the detector (binary)

Responses

Get user mask of the detector (binary)

Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked

+

Responses

Upload user mask of the detector (binary)

Should be in Idle state. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Should be in Idle state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don't need to be assigned value. Mask is expected as binary array (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration.

-
Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get mask of the detector (TIFF)

Request Body schema: application/octet-stream
string <binary>

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get mask of the detector (TIFF)

Get full pixel mask of the detector +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Get full pixel mask of the detector See NXmx standard for meaning of pixel values

-

Responses

Get user mask of the detector (TIFF)

Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked

-

Responses

Upload user mask of the detector

Responses

Get user mask of the detector (TIFF)

Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked

+

Responses

Upload user mask of the detector

Should be in Idle state. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Should be in Idle state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don't need to be assigned value. @@ -1357,71 +1355,105 @@ Mask is expected as TIFF (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images.

-
Request Body schema: image/tiff
string <binary>

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get pedestal in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

-
sc
integer

Storage cell number

-

Responses

Get Start message in CBOR format

Contains metadata for a dataset (e.g., experimental geometry)

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get image message in CBOR format

Contains full image data and metadata. The image must come from the latest data collection.

-
query Parameters
image_number
integer <int64>

Image number. If omitted, the image with the highest number in the image buffer will be provided.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Clear image buffer

Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data.

-

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get status of the image buffers

Request Body schema: image/tiff
string <binary>

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get pedestal in TIFF format

query Parameters
gain_level
required
integer

Gain level (0, 1, 2)

+
sc
integer

Storage cell number

+

Responses

Get Start message in CBOR format

Contains metadata for a dataset (e.g., experimental geometry)

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get image message in CBOR format

Contains full image data and metadata. The image must come from the latest data collection.

+
query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get preview image in JPEG format using custom settings

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

+
show_user_mask
boolean
Default: false

Show user mask

+
show_roi
boolean
Default: false

Show ROI areas on the image

+
show_spots
boolean
Default: true

Show spot finding results on the image

+
saturation
integer <int64> [ 0 .. 65535 ]

Saturation value to set contrast in the preview image

+
jpeg_quality
integer <int64> [ 0 .. 100 ]
Default: 100

Quality of JPEG image (100 - highest; 0 - lowest)

+
show_res_ring
number <float> [ 0.1 .. 100 ]
Default: 0.1

Show resolution ring, provided in Angstrom

+
color
string
Default: "indigo"
Enum: "indigo" "viridis" "bw" "heat"

Color scale for preview image: 0 - indigo, 1 - viridis, 2 - B/W, 3 - heat

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get preview image in TIFF format

query Parameters
id
integer <int64> >= -2
Default: -1

Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer

+

Responses

Clear image buffer

Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data.

+

Responses

Response samples

Content type
application/json
{
  • "msg": "Detector in wrong state",
  • "reason": "WrongDAQState"
}

Get status of the image buffers

Can be run at any stage of Jungfraujoch operation, including during data collection. +" class="sc-dTUlgT sc-fhPBcz gAHTYt ewPyd">

Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor.

-

Responses

Response samples

Content type
application/json
{
  • "image_numbers": [
    ],
  • "total_slots": 0,
  • "available_slots": 0
}

Get Jungfraujoch version of jfjoch_broker

Responses

+

Responses

Response samples

Content type
application/json
{
  • "min_image_number": 0,
  • "max_image_number": 0,
  • "image_numbers": [
    ],
  • "total_slots": 0,
  • "available_slots": 0
}

Get Jungfraujoch version of jfjoch_broker

Responses