From 53c90ee5d851df472e85445eb81b590924545fde Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Wed, 28 May 2025 18:49:27 +0200 Subject: [PATCH] v1.0.0-rc.40 --- CMakeLists.txt | 4 +- VERSION | 2 +- broker/JFJochBrokerHttp.cpp | 159 +- broker/JFJochBrokerHttp.h | 69 +- broker/JFJochBrokerParser.cpp | 3 + broker/JFJochServices.cpp | 7 +- broker/JFJochStateMachine.cpp | 39 +- broker/JFJochStateMachine.h | 3 + broker/OpenAPIConvert.cpp | 180 +- broker/OpenAPIConvert.h | 17 +- broker/gen/api/ApiBase.h | 2 +- broker/gen/api/DefaultApi.cpp | 864 ++------- broker/gen/api/DefaultApi.h | 237 +-- broker/gen/model/Azim_int_settings.cpp | 2 +- broker/gen/model/Azim_int_settings.h | 2 +- broker/gen/model/Broker_status.cpp | 2 +- broker/gen/model/Broker_status.h | 2 +- .../model/Calibration_statistics_inner.cpp | 2 +- .../gen/model/Calibration_statistics_inner.h | 2 +- broker/gen/model/Dataset_settings.cpp | 32 +- broker/gen/model/Dataset_settings.h | 12 +- .../gen/model/Dataset_settings_unit_cell.cpp | 2 +- broker/gen/model/Dataset_settings_unit_cell.h | 2 +- broker/gen/model/Detector.cpp | 2 +- broker/gen/model/Detector.h | 2 +- broker/gen/model/Detector_list.cpp | 2 +- broker/gen/model/Detector_list.h | 2 +- broker/gen/model/Detector_list_element.cpp | 2 +- broker/gen/model/Detector_list_element.h | 2 +- broker/gen/model/Detector_module.cpp | 2 +- broker/gen/model/Detector_module.h | 2 +- .../gen/model/Detector_module_direction.cpp | 2 +- broker/gen/model/Detector_module_direction.h | 2 +- broker/gen/model/Detector_power_state.cpp | 2 +- broker/gen/model/Detector_power_state.h | 2 +- broker/gen/model/Detector_selection.cpp | 2 +- broker/gen/model/Detector_selection.h | 2 +- broker/gen/model/Detector_settings.cpp | 2 +- broker/gen/model/Detector_settings.h | 2 +- broker/gen/model/Detector_state.cpp | 2 +- broker/gen/model/Detector_state.h | 2 +- broker/gen/model/Detector_status.cpp | 2 +- broker/gen/model/Detector_status.h | 2 +- broker/gen/model/Detector_timing.cpp | 2 +- broker/gen/model/Detector_timing.h | 2 +- broker/gen/model/Detector_type.cpp | 2 +- broker/gen/model/Detector_type.h | 2 +- broker/gen/model/Error_message.cpp | 2 +- broker/gen/model/Error_message.h | 2 +- broker/gen/model/File_writer_format.cpp | 2 +- broker/gen/model/File_writer_format.h | 2 +- broker/gen/model/File_writer_settings.cpp | 2 +- broker/gen/model/File_writer_settings.h | 2 +- broker/gen/model/Fpga_status_inner.cpp | 2 +- broker/gen/model/Fpga_status_inner.h | 2 +- broker/gen/model/Grid_plot.cpp | 139 ++ broker/gen/model/Grid_plot.h | 84 + broker/gen/model/Grid_plots.cpp | 139 ++ broker/gen/model/Grid_plots.h | 85 + broker/gen/model/Grid_scan.cpp | 191 ++ broker/gen/model/Grid_scan.h | 108 ++ broker/gen/model/Helpers.cpp | 2 +- broker/gen/model/Helpers.h | 2 +- broker/gen/model/Image_buffer_status.cpp | 2 +- broker/gen/model/Image_buffer_status.h | 2 +- broker/gen/model/Image_format_settings.cpp | 2 +- broker/gen/model/Image_format_settings.h | 2 +- broker/gen/model/Image_pusher_type.cpp | 2 +- broker/gen/model/Image_pusher_type.h | 2 +- broker/gen/model/Indexing_algorithm.cpp | 122 ++ broker/gen/model/Indexing_algorithm.h | 80 + broker/gen/model/Indexing_settings.cpp | 250 +++ broker/gen/model/Indexing_settings.h | 112 ++ broker/gen/model/Instrument_metadata.cpp | 2 +- broker/gen/model/Instrument_metadata.h | 2 +- broker/gen/model/Jfjoch_settings.cpp | 32 +- broker/gen/model/Jfjoch_settings.h | 12 +- broker/gen/model/Jfjoch_statistics.cpp | 34 +- broker/gen/model/Jfjoch_statistics.h | 12 +- broker/gen/model/Measurement_statistics.cpp | 2 +- broker/gen/model/Measurement_statistics.h | 2 +- broker/gen/model/Pcie_devices_inner.cpp | 2 +- broker/gen/model/Pcie_devices_inner.h | 2 +- broker/gen/model/Pixel_mask_statistics.cpp | 2 +- broker/gen/model/Pixel_mask_statistics.h | 2 +- broker/gen/model/Plot.cpp | 51 +- broker/gen/model/Plot.h | 11 +- broker/gen/model/Plot_type_enum.cpp | 224 +++ broker/gen/model/Plot_type_enum.h | 97 + broker/gen/model/Plot_unit_x.cpp | 134 ++ broker/gen/model/Plot_unit_x.h | 82 + broker/gen/model/Plots.cpp | 75 +- broker/gen/model/Plots.h | 28 +- broker/gen/model/Roi_azim_list.cpp | 2 +- broker/gen/model/Roi_azim_list.h | 2 +- broker/gen/model/Roi_azimuthal.cpp | 2 +- broker/gen/model/Roi_azimuthal.h | 2 +- broker/gen/model/Roi_box.cpp | 2 +- broker/gen/model/Roi_box.h | 2 +- broker/gen/model/Roi_box_list.cpp | 2 +- broker/gen/model/Roi_box_list.h | 2 +- broker/gen/model/Roi_circle.cpp | 2 +- broker/gen/model/Roi_circle.h | 2 +- broker/gen/model/Roi_circle_list.cpp | 2 +- broker/gen/model/Roi_circle_list.h | 2 +- broker/gen/model/Roi_definitions.cpp | 2 +- broker/gen/model/Roi_definitions.h | 2 +- broker/gen/model/Rotation_axis.cpp | 61 +- broker/gen/model/Rotation_axis.h | 13 +- broker/gen/model/Spot_finding_settings.cpp | 51 +- broker/gen/model/Spot_finding_settings.h | 18 +- .../gen/model/Standard_detector_geometry.cpp | 2 +- broker/gen/model/Standard_detector_geometry.h | 2 +- broker/gen/model/Zeromq_metadata_settings.cpp | 2 +- broker/gen/model/Zeromq_metadata_settings.h | 2 +- broker/gen/model/Zeromq_preview_settings.cpp | 2 +- broker/gen/model/Zeromq_preview_settings.h | 2 +- broker/gen/model/Zeromq_settings.cpp | 2 +- broker/gen/model/Zeromq_settings.h | 2 +- broker/jfjoch_api.yaml | 714 +++---- broker/redoc-static.html | 400 ++-- common/ADUHistogram.cpp | 13 +- common/ADUHistogram.h | 2 +- common/AzimuthalIntegrationProfile.cpp | 6 +- common/AzimuthalIntegrationProfile.h | 2 +- common/CMakeLists.txt | 16 +- common/ColorScale.cpp | 64 +- common/ColorScale.h | 13 +- common/CompressedImage.cpp | 226 +++ common/CompressedImage.h | 61 + common/Coord.cpp | 10 + common/Coord.h | 2 + common/DatasetSettings.cpp | 41 +- common/DatasetSettings.h | 19 +- common/DiffractionExperiment.cpp | 78 +- common/DiffractionExperiment.h | 20 +- common/FileWriterSettings.h | 2 +- common/GoniometerAxis.cpp | 99 + common/GoniometerAxis.h | 43 + common/GridPlot.cpp | 85 + common/GridPlot.h | 41 + common/GridScanSettings.cpp | 165 ++ common/GridScanSettings.h | 64 + common/Histogram.h | 28 +- common/ImageBuffer.cpp | 8 +- common/ImageBuffer.h | 2 +- common/IndexingSettings.cpp | 100 + common/IndexingSettings.h | 37 + {frame_serialize => common}/JFJochMessages.h | 44 +- common/MovingAverage.cpp | 5 + common/MovingAverage.h | 1 + common/MultiLinePlot.cpp | 54 + common/MultiLinePlot.h | 41 + common/Plot.h | 16 +- common/ROIElement.h | 2 +- common/Reflection.h | 21 + common/StatusVector.h | 68 +- compression/JFJochDecompress.h | 8 +- docs/CBOR.md | 15 +- docs/CHANGELOG.md | 20 + docs/conf.py | 2 +- docs/python_client/README.md | 31 +- docs/python_client/docs/DatasetSettings.md | 1 + docs/python_client/docs/DefaultApi.md | 1653 +++-------------- .../docs/DetectorListDetectorsInner.md | 3 - docs/python_client/docs/GridPlot.md | 30 + docs/python_client/docs/GridPlots.md | 30 + docs/python_client/docs/GridScan.md | 34 + docs/python_client/docs/IndexingAlgorithm.md | 15 + docs/python_client/docs/IndexingSettings.md | 35 + docs/python_client/docs/JfjochSettings.md | 1 + docs/python_client/docs/JfjochStatistics.md | 1 + docs/python_client/docs/Plot.md | 1 + docs/python_client/docs/PlotTypeEnum.md | 48 + docs/python_client/docs/PlotUnitX.md | 18 + docs/python_client/docs/Plots.md | 3 + docs/python_client/docs/PreviewSettings.md | 2 +- docs/python_client/docs/RotationAxis.md | 3 +- .../python_client/docs/SpotFindingSettings.md | 4 +- fpga/hdl/action_config.v | 2 +- fpga/pcie_driver/dkms.conf | 2 +- fpga/pcie_driver/install_dkms.sh | 2 +- fpga/pcie_driver/jfjoch_drv.c | 2 +- fpga/pcie_driver/postinstall.sh | 2 +- fpga/pcie_driver/preuninstall.sh | 2 +- frame_serialize/CBORStream2Deserializer.cpp | 217 ++- frame_serialize/CBORStream2Deserializer.h | 2 +- frame_serialize/CBORStream2Serializer.cpp | 132 +- frame_serialize/CBORStream2Serializer.h | 2 +- frame_serialize/CMakeLists.txt | 4 +- frame_serialize/CborUtil.h | 3 + frontend/package-lock.json | 4 +- frontend/package.json | 2 +- frontend/src/App.tsx | 13 +- frontend/src/components/DataCollection.tsx | 136 +- .../src/components/DataProcessingPlot.tsx | 262 +-- .../src/components/DataProcessingPlots.tsx | 69 +- .../src/components/DataProcessingSettings.tsx | 28 +- .../src/components/ImageFormatSettings.tsx | 2 +- frontend/src/components/IndexingSettings.tsx | 209 +++ .../src/components/MultiLinePlotWrapper.jsx | 43 +- frontend/src/components/PreviewImage.tsx | 2 +- frontend/src/openapi/core/OpenAPI.ts | 2 +- frontend/src/openapi/index.ts | 9 + frontend/src/openapi/models/background.ts | 9 + .../src/openapi/models/dataset_settings.ts | 2 + .../src/openapi/models/experimental_coord.ts | 12 + frontend/src/openapi/models/fill_value.ts | 10 + frontend/src/openapi/models/grid_scan.ts | 40 + .../src/openapi/models/indexing_algorithm.ts | 14 + .../src/openapi/models/indexing_settings.ts | 36 + .../src/openapi/models/jfjoch_settings.ts | 2 + .../src/openapi/models/jfjoch_statistics.ts | 2 + frontend/src/openapi/models/plot.ts | 1 + frontend/src/openapi/models/plot_type.ts | 32 + frontend/src/openapi/models/plot_unit_x.ts | 12 + frontend/src/openapi/models/plots.ts | 10 + frontend/src/openapi/models/roi.ts | 9 + frontend/src/openapi/models/rotation_axis.ts | 6 +- .../openapi/models/spot_finding_settings.ts | 13 +- .../src/openapi/services/DefaultService.ts | 570 +----- frontend/src/version.ts | 2 +- image_analysis/CMakeLists.txt | 35 +- image_analysis/ImageAnalysisCPU.cpp | 85 +- image_analysis/ImageAnalysisCPU.h | 8 +- image_analysis/IndexerWrapper.cpp | 154 -- image_analysis/IndexerWrapper.h | 41 - image_analysis/MXAnalyzer.cpp | 25 +- image_analysis/MXAnalyzer.h | 6 +- image_analysis/QuickIntegrate.cpp | 120 ++ image_analysis/QuickIntegrate.h | 38 + image_analysis/SpotFindingSettings.h | 3 +- .../{ => indexing}/CrystalLattice.cpp | 55 +- .../{ => indexing}/CrystalLattice.h | 19 +- image_analysis/indexing/FFBIDXIndexer.cpp | 85 + image_analysis/indexing/FFBIDXIndexer.h | 47 + image_analysis/indexing/FFTIndexer.cpp | 109 ++ image_analysis/indexing/FFTIndexer.cu | 209 +++ image_analysis/indexing/FFTIndexer.h | 76 + image_analysis/indexing/FFTIndexer_refine.cpp | 108 ++ image_analysis/indexing/Indexer.cpp | 48 + image_analysis/indexing/Indexer.h | 34 + image_analysis/indexing/IndexerFactory.cpp | 33 + image_analysis/indexing/IndexerFactory.h | 12 + image_pusher/ImagePusher.cpp | 18 +- image_pusher/ImagePusher.h | 4 +- image_pusher/NonePusher.cpp | 4 - image_pusher/NonePusher.h | 1 - image_pusher/TestImagePusher.cpp | 6 +- image_pusher/ZMQStream2Pusher.cpp | 14 +- image_pusher/ZMQStream2Pusher.h | 2 +- image_pusher/ZMQWriterNotificationPuller.cpp | 2 + image_pusher/ZMQWriterNotificationPuller.h | 1 + preview/CMakeLists.txt | 3 +- preview/JFJochJPEG.cpp | 17 +- preview/JFJochJPEG.h | 3 +- preview/JFJochTIFF.cpp | 127 +- preview/JFJochTIFF.h | 9 +- preview/PreviewImage.cpp | 100 +- preview/PreviewImage.h | 12 +- preview/ZMQMetadataSocket.h | 2 +- reader/JFJochHDF5Reader.cpp | 24 +- reader/JFJochReader.h | 2 +- reader/JFJochReaderImage.cpp | 66 +- receiver/FrameTransformation.cpp | 127 +- receiver/FrameTransformation.h | 4 +- receiver/ImageMetadata.h | 2 +- receiver/JFJochReceiver.cpp | 11 +- receiver/JFJochReceiver.h | 4 +- receiver/JFJochReceiverFPGA.cpp | 34 +- receiver/JFJochReceiverLite.cpp | 16 +- receiver/JFJochReceiverOutput.h | 1 + receiver/JFJochReceiverPlots.cpp | 137 +- receiver/JFJochReceiverPlots.h | 17 +- receiver/JFJochReceiverService.cpp | 2 + receiver/JFJochReceiverService.h | 1 + receiver/LossyFilter.cpp | 2 +- receiver/LossyFilter.h | 2 +- resonet/jfjoch_inference_server.py | 2 +- tests/AzimuthalIntegrationTest.cpp | 20 +- tests/CBORTest.cpp | 319 ++-- tests/CMakeLists.txt | 3 + tests/DiffractionExperimentTest.cpp | 49 +- tests/FFTIndexerTest.cpp | 54 + tests/FrameTransformationTest.cpp | 75 +- tests/GridScanSettingsTest.cpp | 494 +++++ tests/HDF5WritingTest.cpp | 91 +- tests/HistogramTest.cpp | 43 +- tests/IndexingUnitTest.cpp | 79 +- tests/JFJochReaderTest.cpp | 75 +- tests/JFJochReceiverLiteTest.cpp | 11 +- tests/JFJochReceiverPlotsTest.cpp | 143 ++ tests/JFJochReceiverProcessingTest.cpp | 228 ++- tests/JPEGTest.cpp | 4 +- tests/StatusVectorTest.cpp | 230 ++- tests/StreamWriterTest.cpp | 10 +- tests/TIFFTest.cpp | 39 +- tests/ZMQImagePusherTest.cpp | 52 +- tests/test_data/jfjoch_broker_test.py | 10 +- tools/jfjoch_hdf5_test.cpp | 17 +- tools/jfjoch_lite_perf_test.cpp | 33 +- tools/jfjoch_offline_process.cpp | 20 +- tools/jfjoch_simplon_test.cpp | 9 +- viewer/CMakeLists.txt | 19 +- viewer/JFJochViewerImageListWindow.cpp | 10 +- viewer/JFJochViewerImageListWindow.h | 2 +- viewer/JFJochViewerImageStatistics.cpp | 2 +- viewer/JFJochViewerWindow.cpp | 36 +- viewer/JFJochViewerWindow.h | 14 +- viewer/dbus/JFJochViewerAdaptor.cpp | 20 + viewer/dbus/JFJochViewerAdaptor.h | 25 + viewer/dbus/ch.psi.jfjoch_viewer.service.in | 3 + viewer/jfjoch_viewer.cpp | 43 +- writer/CBFWriter.cpp | 48 +- writer/CBFWriter.h | 2 +- writer/CMakeLists.txt | 2 + writer/FileWriter.cpp | 17 +- writer/FileWriter.h | 2 +- writer/HDF5DataFile.cpp | 28 +- writer/HDF5DataFile.h | 2 +- writer/HDF5DataFilePlugin.h | 2 +- writer/HDF5DataFilePluginDetector.cpp | 11 - writer/HDF5DataFilePluginDetector.h | 1 - writer/HDF5DataFilePluginImageStats.cpp | 32 + writer/HDF5DataFilePluginImageStats.h | 25 + writer/HDF5DataFilePluginMX.cpp | 10 +- writer/HDF5NXmx.cpp | 96 +- writer/HDF5NXmx.h | 2 +- writer/HDF5Objects.cpp | 38 + writer/HDF5Objects.h | 3 + writer/StreamWriter.cpp | 198 +- writer/StreamWriter.h | 19 +- writer/gen/api/ApiBase.h | 2 +- writer/gen/api/DefaultApi.cpp | 2 +- writer/gen/api/DefaultApi.h | 2 +- writer/gen/model/Helpers.cpp | 2 +- writer/gen/model/Helpers.h | 2 +- writer/gen/model/Writer_statistics.cpp | 2 +- writer/gen/model/Writer_statistics.h | 2 +- writer/writer_api.yaml | 2 +- 340 files changed, 9583 insertions(+), 5919 deletions(-) create mode 100644 broker/gen/model/Grid_plot.cpp create mode 100644 broker/gen/model/Grid_plot.h create mode 100644 broker/gen/model/Grid_plots.cpp create mode 100644 broker/gen/model/Grid_plots.h create mode 100644 broker/gen/model/Grid_scan.cpp create mode 100644 broker/gen/model/Grid_scan.h create mode 100644 broker/gen/model/Indexing_algorithm.cpp create mode 100644 broker/gen/model/Indexing_algorithm.h create mode 100644 broker/gen/model/Indexing_settings.cpp create mode 100644 broker/gen/model/Indexing_settings.h create mode 100644 broker/gen/model/Plot_type_enum.cpp create mode 100644 broker/gen/model/Plot_type_enum.h create mode 100644 broker/gen/model/Plot_unit_x.cpp create mode 100644 broker/gen/model/Plot_unit_x.h create mode 100644 common/CompressedImage.cpp create mode 100644 common/CompressedImage.h create mode 100644 common/GoniometerAxis.cpp create mode 100644 common/GoniometerAxis.h create mode 100644 common/GridPlot.cpp create mode 100644 common/GridPlot.h create mode 100644 common/GridScanSettings.cpp create mode 100644 common/GridScanSettings.h create mode 100644 common/IndexingSettings.cpp create mode 100644 common/IndexingSettings.h rename {frame_serialize => common}/JFJochMessages.h (89%) create mode 100644 common/MultiLinePlot.cpp create mode 100644 common/MultiLinePlot.h create mode 100644 common/Reflection.h create mode 100644 docs/python_client/docs/GridPlot.md create mode 100644 docs/python_client/docs/GridPlots.md create mode 100644 docs/python_client/docs/GridScan.md create mode 100644 docs/python_client/docs/IndexingAlgorithm.md create mode 100644 docs/python_client/docs/IndexingSettings.md create mode 100644 docs/python_client/docs/PlotTypeEnum.md create mode 100644 docs/python_client/docs/PlotUnitX.md create mode 100644 frontend/src/components/IndexingSettings.tsx create mode 100644 frontend/src/openapi/models/background.ts create mode 100644 frontend/src/openapi/models/experimental_coord.ts create mode 100644 frontend/src/openapi/models/fill_value.ts create mode 100644 frontend/src/openapi/models/grid_scan.ts create mode 100644 frontend/src/openapi/models/indexing_algorithm.ts create mode 100644 frontend/src/openapi/models/indexing_settings.ts create mode 100644 frontend/src/openapi/models/plot_type.ts create mode 100644 frontend/src/openapi/models/plot_unit_x.ts create mode 100644 frontend/src/openapi/models/roi.ts delete mode 100644 image_analysis/IndexerWrapper.cpp delete mode 100644 image_analysis/IndexerWrapper.h create mode 100644 image_analysis/QuickIntegrate.cpp create mode 100644 image_analysis/QuickIntegrate.h rename image_analysis/{ => indexing}/CrystalLattice.cpp (55%) rename image_analysis/{ => indexing}/CrystalLattice.h (53%) create mode 100644 image_analysis/indexing/FFBIDXIndexer.cpp create mode 100644 image_analysis/indexing/FFBIDXIndexer.h create mode 100644 image_analysis/indexing/FFTIndexer.cpp create mode 100644 image_analysis/indexing/FFTIndexer.cu create mode 100644 image_analysis/indexing/FFTIndexer.h create mode 100644 image_analysis/indexing/FFTIndexer_refine.cpp create mode 100644 image_analysis/indexing/Indexer.cpp create mode 100644 image_analysis/indexing/Indexer.h create mode 100644 image_analysis/indexing/IndexerFactory.cpp create mode 100644 image_analysis/indexing/IndexerFactory.h create mode 100644 tests/FFTIndexerTest.cpp create mode 100644 tests/GridScanSettingsTest.cpp create mode 100644 tests/JFJochReceiverPlotsTest.cpp create mode 100644 viewer/dbus/JFJochViewerAdaptor.cpp create mode 100644 viewer/dbus/JFJochViewerAdaptor.h create mode 100644 viewer/dbus/ch.psi.jfjoch_viewer.service.in create mode 100644 writer/HDF5DataFilePluginImageStats.cpp create mode 100644 writer/HDF5DataFilePluginImageStats.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e470d6d6..25518d26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ SET(JFJOCH_CUDA_AVAILABLE OFF) IF (CMAKE_CUDA_COMPILER) IF (JFJOCH_USE_CUDA) ENABLE_LANGUAGE(CUDA) + FIND_PACKAGE(CUDAToolkit REQUIRED) MESSAGE(STATUS "CUDA VERSION: ${CMAKE_CUDA_COMPILER_VERSION}") ADD_COMPILE_DEFINITIONS(JFJOCH_USE_CUDA) FIND_LIBRARY(CUDART_LIBRARY cudart_static PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED) @@ -181,13 +182,14 @@ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # Initialize CPACK_COMPONENTS_ALL with common components SET(CPACK_COMPONENTS_ALL jfjoch writer) SET(CPACK_PACKAGE_NAME "jfjoch") +SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src /usr/share /usr/share/dbus-1 /usr/share/dbus-1/services) + IF (JFJOCH_INSTALL_DRIVER_SOURCE) LIST(APPEND CPACK_COMPONENTS_ALL driver-dkms) SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed") SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch") SET(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh) SET(CPACK_RPM_DRIVER-DKMS_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh) - SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src) ELSE() SET(CPACK_COMPONENTS_ALL jfjoch writer) ENDIF() diff --git a/VERSION b/VERSION index 2db107ae..c1ff7b98 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-rc.39 +1.0.0-rc.40 diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index fe2004e9..daedcbee 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -140,11 +140,6 @@ void JFJochBrokerHttp::config_spot_finding_put( response.send(Pistache::Http::Code::Ok); } -void JFJochBrokerHttp::plot_azim_int_get(const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::AzInt, 0, compression, response); -} - void JFJochBrokerHttp::statistics_calibration_get(Pistache::Http::ResponseWriter &response) { nlohmann::json j; for (const auto &d: Convert(state_machine.GetCalibrationStatistics())) @@ -297,117 +292,6 @@ void JFJochBrokerHttp::preview_pedestal_tiff_get(const std::optional &g response.send(Pistache::Http::Code::Not_Found); } -void JFJochBrokerHttp::GenericPlot(PlotType plot_type, const std::optional &binning, - const std::optional& in_compression, - Pistache::Http::ResponseWriter &response) { - bool compression = !in_compression.has_value() || in_compression.value(); - - PlotRequest req{.type = plot_type, .binning = 0}; - if (binning) { - if (binning.value() < 0) - throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, - "Binning must be positive number or zero"); - req.binning = binning.value(); - } - auto plot = state_machine.GetPlots(req); - ProcessOutput(Convert(plot), response, compression); -} - -void JFJochBrokerHttp::plot_bkg_estimate_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - 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) { - GenericPlot(PlotType::ErrorPixels, binning, compression, response); -} - -void JFJochBrokerHttp::plot_image_collection_efficiency_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ImageCollectionEfficiency, binning, compression, response); -} - -void JFJochBrokerHttp::plot_indexing_rate_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::IndexingRate, binning, compression, response); -} - -void JFJochBrokerHttp::plot_indexing_unit_cell_get(const std::optional &binning, - const std::optional &compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::IndexingUnitCellLength, binning, compression, response); -} - -void JFJochBrokerHttp::plot_indexing_unit_cell_angle_get(const std::optional &binning, - const std::optional &compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::IndexingUnitCellAngle, binning, compression, response); -} - -void JFJochBrokerHttp::plot_packets_received_get(const std::optional &binning, - const std::optional &compression, Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::PacketsReceived, binning, compression, response); -} - -void JFJochBrokerHttp::plot_receiver_delay_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ReceiverDelay, binning, compression, response); -} - -void JFJochBrokerHttp::plot_receiver_free_send_buffers_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ReceiverFreeSendBuf, binning, compression, response); -} - -void JFJochBrokerHttp::plot_roi_max_count_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIMaxCount, binning, compression, response); -} - -void JFJochBrokerHttp::plot_roi_sum_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROISum, binning, compression, response); -} - -void JFJochBrokerHttp::plot_roi_valid_pixels_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIPixels, binning, compression, response); -} - -void JFJochBrokerHttp::plot_spot_count_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::SpotCount, binning, compression, response); -} - -void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::StrongPixels, binning, compression, response); -} - -void JFJochBrokerHttp::plot_max_value_get(const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::MaxValue, binning, compression, response); -} - void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) { auto s = state_machine.GetFullPixelMaskTIFF(); response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff")); @@ -527,6 +411,7 @@ void JFJochBrokerHttp::statistics_get(const std::optional &compression, Pi statistics.setFileWriterSettings(Convert(state_machine.GetFileWriterSettings())); statistics.setAzInt(Convert(state_machine.GetRadialIntegrationSettings())); statistics.setBuffer(Convert(state_machine.GetImageBufferStatus())); + statistics.setIndexing(Convert(state_machine.GetIndexingSettings())); auto zeromq_prev = state_machine.GetPreviewSocketSettings(); if (!zeromq_prev.address.empty()) @@ -587,7 +472,7 @@ void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional const std::optional &showUserMask, const std::optional &showRoi, const std::optional &showSpots, - const std::optional &saturation, + const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, @@ -601,14 +486,7 @@ void JFJochBrokerHttp::image_buffer_image_jpeg_get(const std::optional 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; + settings.scale = ConvertColorScale(color); std::string s = state_machine.GetPreviewJPEG(settings, image_id); if (!s.empty()) @@ -657,17 +535,30 @@ void JFJochBrokerHttp::config_file_writer_put( response.send(Pistache::Http::Code::Ok); } -void JFJochBrokerHttp::plot_roi_mean_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIMean, binning, compression, response); +void JFJochBrokerHttp::preview_plot_get(const std::optional &type, const std::optional &binning, + const std::optional &compression, const std::optional &experimentalCoord, + Pistache::Http::ResponseWriter &response) { + PlotRequest req{ + .type = ConvertPlotType(type), + .binning = 0, + .experimental_coord = experimentalCoord.value_or(false) + }; + if (binning) { + if (binning.value() < 0) + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, + "Binning must be positive number or zero"); + req.binning = binning.value(); + } + auto plot = state_machine.GetPlots(req); + ProcessOutput(Convert(plot), response, compression.value_or(false)); } -void JFJochBrokerHttp::plot_roi_x_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIWeightedX, binning, compression, response); +void JFJochBrokerHttp::config_indexing_get(Pistache::Http::ResponseWriter &response) { + ProcessOutput(Convert(state_machine.GetIndexingSettings()), response); } -void JFJochBrokerHttp::plot_roi_y_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) { - GenericPlot(PlotType::ROIWeightedY, binning, compression, response); +void JFJochBrokerHttp::config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, + Pistache::Http::ResponseWriter &response) { + state_machine.SetIndexingSettings(Convert(indexingSettings)); + response.send(Pistache::Http::Code::Ok); } diff --git a/broker/JFJochBrokerHttp.h b/broker/JFJochBrokerHttp.h index 98ae4984..cfd5f345 100644 --- a/broker/JFJochBrokerHttp.h +++ b/broker/JFJochBrokerHttp.h @@ -37,7 +37,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void config_azim_int_get(Pistache::Http::ResponseWriter &response) override; void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &radIntSettings, - Pistache::Http::ResponseWriter &response) override; + Pistache::Http::ResponseWriter &response) override; void config_select_detector_get(Pistache::Http::ResponseWriter &response) override; @@ -51,39 +51,6 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) override; - void GenericPlot(PlotType plot_type, - const std::optional &binning, - const std::optional& compression, - Pistache::Http::ResponseWriter &response); - - 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, - Pistache::Http::ResponseWriter &response) override; - void plot_indexing_rate_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_receiver_delay_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_receiver_free_send_buffers_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_roi_max_count_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_roi_sum_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_roi_valid_pixels_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_spot_count_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_strong_pixel_get(const std::optional &binning, const std::optional& compression, - Pistache::Http::ResponseWriter &response) override; - void plot_max_value_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) override; - void plot_azim_int_get(const std::optional& compression, Pistache::Http::ResponseWriter &response) override; - void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override; void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) override; @@ -109,7 +76,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void config_roi_get(Pistache::Http::ResponseWriter &response) override; void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions, - Pistache::Http::ResponseWriter &response) override; + Pistache::Http::ResponseWriter &response) override; void config_internal_generator_image_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) override; @@ -122,7 +89,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) override; void config_user_mask_tiff_put(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter &response) override; + Pistache::Http::ResponseWriter &response) override; void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) override; @@ -166,24 +133,15 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) override; void config_zeromq_metadata_put( - const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings, - Pistache::Http::ResponseWriter &response) override; + const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings, + Pistache::Http::ResponseWriter &response) override; void config_mask_get(Pistache::Http::ResponseWriter &response) override; void config_user_mask_get(Pistache::Http::ResponseWriter &response) override; void config_user_mask_put(const Pistache::Rest::Request &request, - Pistache::Http::ResponseWriter &response) override; - - void plot_indexing_unit_cell_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) override; - - void plot_indexing_unit_cell_angle_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) override; - - void plot_packets_received_get(const std::optional &binning, const std::optional &compression, - Pistache::Http::ResponseWriter &response) override; + Pistache::Http::ResponseWriter &response) override; void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) override; @@ -194,7 +152,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { const std::optional &showUserMask, const std::optional &showRoi, const std::optional &showSpots, - const std::optional &saturation, + const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, @@ -204,9 +162,16 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi { void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) override; void image_buffer_status_get(Pistache::Http::ResponseWriter &response) override; - void plot_roi_mean_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) override; - void plot_roi_x_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) override; - void plot_roi_y_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) override; + + void preview_plot_get(const std::optional &type, const std::optional &binning, + const std::optional &compression, const std::optional &experimentalCoord, + Pistache::Http::ResponseWriter &response) override; + + void config_indexing_get(Pistache::Http::ResponseWriter &response) override; + + void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, + Pistache::Http::ResponseWriter &response) override; + public: JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr &rtr); void AddDetectorSetup(const DetectorSetup &setup); diff --git a/broker/JFJochBrokerParser.cpp b/broker/JFJochBrokerParser.cpp index 19fc8f67..c773bef2 100644 --- a/broker/JFJochBrokerParser.cpp +++ b/broker/JFJochBrokerParser.cpp @@ -157,6 +157,9 @@ void ParseFacilityConfiguration(const org::openapitools::server::model::Jfjoch_s if (j.imageFormatIsSet()) experiment.ImportImageFormatSettings(Convert(j.getImageFormat())); + + if (j.indexingIsSet()) + experiment.ImportIndexingSettings(Convert(j.getIndexing())); } std::unique_ptr ParseZMQImagePusher(const org::openapitools::server::model::Jfjoch_settings &j) { diff --git a/broker/JFJochServices.cpp b/broker/JFJochServices.cpp index 7ca84024..381f637e 100644 --- a/broker/JFJochServices.cpp +++ b/broker/JFJochServices.cpp @@ -151,12 +151,7 @@ std::optional JFJochServices::GetReceiverProgress() const { MultiLinePlot JFJochServices::GetPlots(const PlotRequest &request) { if (receiver == nullptr) return {}; - - try { - return receiver->GetDataProcessingPlot(request); - } catch (...) { - return {}; - } + return receiver->GetDataProcessingPlot(request); } void JFJochServices::SetSpotFindingSettings(const SpotFindingSettings &settings) { diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 894bf94e..4a713ef1 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -17,15 +17,9 @@ JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_l 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; + data_processing_settings.resolution_estimate = false; SupressTIFFErrors(); } @@ -355,6 +349,10 @@ void JFJochStateMachine::MeasurementThread() { SetState(JFJochState::Idle, "Missing packets in data collection; reduce frame rate", BrokerStatus::MessageSeverity::Error); + else if (!tmp_output.receiver_output.writer_err.empty()) + SetState(JFJochState::Idle, + tmp_output.receiver_output.writer_err, + BrokerStatus::MessageSeverity::Error); else SetState(JFJochState::Idle, "Data collection without problems", @@ -656,8 +654,8 @@ std::string JFJochStateMachine::GetPedestalTIFF(size_t gain_level, size_t sc) co if ((experiment.GetDetectorSetup().GetDetectorType() == DetectorType::JUNGFRAU) && calibration) { auto tmp = calibration->GetPedestal(gain_level, sc); - return WriteTIFFToString(tmp.data(), RAW_MODULE_COLS, RAW_MODULE_LINES * experiment.GetModulesNum(), - sizeof(uint16_t), false); + CompressedImage image(tmp, RAW_MODULE_COLS, RAW_MODULE_LINES * experiment.GetModulesNum()); + return WriteTIFFToString(image); } else return {}; } @@ -737,8 +735,8 @@ std::string JFJochStateMachine::GetFullPixelMaskTIFF() const { return {}; std::vector v = pixel_mask.GetMask(experiment); - return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(), - sizeof(uint32_t), false); + CompressedImage mask_image(v, experiment.GetXPixelsNum(), experiment.GetYPixelsNum()); + return WriteTIFFToString(mask_image); } std::string JFJochStateMachine::GetUserPixelMaskTIFF() const { @@ -748,8 +746,8 @@ std::string JFJochStateMachine::GetUserPixelMaskTIFF() const { return {}; std::vector v = pixel_mask.GetUserMask(experiment); - return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(), - sizeof(uint32_t), false); + CompressedImage mask_image(v, experiment.GetXPixelsNum(), experiment.GetYPixelsNum()); + return WriteTIFFToString(mask_image); } std::vector JFJochStateMachine::GetFullPixelMask() const { @@ -899,3 +897,18 @@ void JFJochStateMachine::LoadFileWriterSettings(const FileWriterSettings &settin experiment.ImportFileWriterSettings(settings); } } + +IndexingSettings JFJochStateMachine::GetIndexingSettings() const { + std::unique_lock ul(experiment_indexing_settings_mutex); + return experiment.GetIndexingSettings(); +} + +void JFJochStateMachine::SetIndexingSettings(const IndexingSettings &input) { + std::unique_lock ul(m); + if (IsRunning()) + throw WrongDAQStateException("Cannot change instrument metadata during data collection"); + { + std::unique_lock ul2(experiment_indexing_settings_mutex); + experiment.ImportIndexingSettings(input); + } +} diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 241f9eeb..a9b9d17e 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -92,6 +92,7 @@ class JFJochStateMachine { mutable std::mutex experiment_instrument_metadata_mutex; mutable std::mutex experiment_image_format_settings_mutex; mutable std::mutex experiment_file_writer_settings_mutex; + mutable std::mutex experiment_indexing_settings_mutex; DiffractionExperiment experiment; // mutex m is protecting: @@ -223,6 +224,8 @@ public: void SetMetadataSocketSettings(const ZMQMetadataSettings &input); ZMQMetadataSettings GetMetadataSocketSettings(); + void SetIndexingSettings(const IndexingSettings &input); + IndexingSettings GetIndexingSettings() const; PixelMaskStatistics GetPixelMaskStatistics() const; void GetStartMessageFromBuffer(std::vector &v); diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 5218aa34..920b77d7 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -20,7 +20,7 @@ SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding ret.enable = input.isEnable(); ret.indexing = input.isIndexing(); ret.resolution_estimate = input.isResolutionEstimate(); - ret.indexing_tolerance = input.getIndexingTolerance(); + ret.quick_integration = input.isQuickIntegration(); if (input.filterPowderRingsIsSet()) ret.filter_spots_powder_ring = input.isFilterPowderRings(); if (input.minSpotCountPowderRingIsSet()) @@ -38,10 +38,10 @@ org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindin ret.setLowResolutionLimit(input.low_resolution_limit); ret.setEnable(input.enable); ret.setIndexing(input.indexing); - ret.setIndexingTolerance(input.indexing_tolerance); ret.setFilterPowderRings(input.filter_spots_powder_ring); ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring); ret.setResolutionEstimate(input.resolution_estimate); + ret.setQuickIntegration(input.quick_integration); return ret; } @@ -380,15 +380,45 @@ org::openapitools::server::model::Detector_list Convert(const DetectorList &inpu } org::openapitools::server::model::Plots Convert(const MultiLinePlot& input) { - std::vector tmp(input.size()); - for (int i = 0; i < input.size(); i++) { - tmp[i].setTitle(input[i].title); - tmp[i].setX(input[i].x); - tmp[i].setY(input[i].y); + std::vector tmp(input.GetPlots().size()); + for (int i = 0; i < input.GetPlots().size(); i++) { + tmp[i].setTitle(input.GetPlots()[i].title); + tmp[i].setX(input.GetPlots()[i].x); + tmp[i].setY(input.GetPlots()[i].y); + tmp[i].setZ(input.GetPlots()[i].z); } org::openapitools::server::model::Plots output; output.setPlot(tmp); + + org::openapitools::server::model::Plot_unit_x unit; + switch (input.GetUnits()) { + case MultiLinePlotUnits::ImageNumber: + unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::IMAGE_NUMBER); + break; + case MultiLinePlotUnits::Angle_deg: + unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::ANGLE_DEG); + break; + case MultiLinePlotUnits::Q_recipA: + unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::Q_RECIPA); + break; + case MultiLinePlotUnits::ADU: + unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::ADU); + break; + case MultiLinePlotUnits::Grid_um: + unit.setValue(org::openapitools::server::model::Plot_unit_x::ePlot_unit_x::GRID_UM); + break; + default: + break; + } + output.setUnitX(unit); + + if (input.GetSizeX().has_value()) + output.setSizeX(input.GetSizeX().value()); + + if (input.GetSizeY().has_value()) + output.setSizeY(input.GetSizeY().value()); + return output; } @@ -517,6 +547,25 @@ org::openapitools::server::model::Image_format_settings Convert(const ImageForma return ret; } +Coord ConvertOpenAPI(const std::vector &input) { + if (input.size() != 3) + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Wrong size of Coord array"); + return {input[0], input[1], input[2]}; +} + +GoniometerAxis Convert(const org::openapitools::server::model::Rotation_axis& input) { + std::optional helical; + if (input.helicalStepUmIsSet()) + helical = ConvertOpenAPI(input.getHelicalStepUm()); + + return {input.getName(), input.getStart(), input.getStep(), + ConvertOpenAPI(input.getVector()), helical}; +} + +GridScanSettings Convert(const org::openapitools::server::model::Grid_scan& input) { + return {input.getNFast(), input.getStepXUm(), input.getStepYUm(), input.isSnake(), input.isVertical()}; +} + DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input) { DatasetSettings ret; @@ -571,19 +620,11 @@ DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings ret.TotalFlux(input.getTotalFlux()); if (input.transmissionIsSet()) ret.AttenuatorTransmission(input.getTransmission()); + if (input.goniometerIsSet()) + ret.Goniometer(Convert(input.getGoniometer())); + else if (input.gridScanIsSet()) + ret.GridScan(Convert(input.getGridScan())); - if (input.goniometerIsSet()) { - ret.Goniometer(GoniometerAxis{ - .name = input.getGoniometer().getName(), - .increment = input.getGoniometer().getStep(), - .start = input.getGoniometer().getStart() - }); - if (input.getGoniometer().getVector().size() == 3) { - auto v = input.getGoniometer().getVector(); - ret.RotationAxis(Coord(v[0], v[1], v[2])); - } else - throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Rotation axis must be provided"); - } if (input.spaceGroupNumberIsSet()) ret.SpaceGroupNumber(input.getSpaceGroupNumber()); ret.SampleName(input.getSampleName()); @@ -741,3 +782,104 @@ FileWriterFormat Convert(const org::openapitools::server::model::File_writer_for } } +PlotType ConvertPlotType(const std::optional& input) { + if (!input.has_value()) + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, + "Plot type is compulsory paramater"); + if (input == "bkg_estimate") return PlotType::BkgEstimate; + if (input == "azint") return PlotType::AzInt; + if (input == "spot_count") return PlotType::SpotCount; + if (input == "indexing_rate") return PlotType::IndexingRate; + if (input == "indexing_unit_cell_length") return PlotType::IndexingUnitCellLength; + if (input == "indexing_unit_cell_angle") return PlotType::IndexingUnitCellAngle; + if (input == "error_pixels") return PlotType::ErrorPixels; + if (input == "strong_pixels") return PlotType::StrongPixels; + if (input == "saturated_pixels") return PlotType::SaturatedPixels; + if (input == "image_collection_efficiency") return PlotType::ImageCollectionEfficiency; + if (input == "receiver_delay") return PlotType::ReceiverDelay; + if (input == "receiver_free_send_buf") return PlotType::ReceiverFreeSendBuf; + if (input == "roi_sum") return PlotType::ROISum; + if (input == "roi_mean") return PlotType::ROIMean; + if (input == "roi_max_count") return PlotType::ROIMaxCount; + if (input == "roi_pixels") return PlotType::ROIPixels; + if (input == "roi_weighted_x") return PlotType::ROIWeightedX; + if (input == "roi_weighted_y") return PlotType::ROIWeightedY; + if (input == "packets_received") return PlotType::PacketsReceived; + if (input == "max_pixel_value") return PlotType::MaxValue; + if (input == "resolution_estimate") return PlotType::ResolutionEstimate; + if (input == "indexing_time") return PlotType::IndexingTime; + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, + "Plot type not recognized"); +} + +ColorScaleEnum ConvertColorScale(const std::optional& input) { + std::string color = input.value_or("indigo"); + + if (color == "viridis") + return ColorScaleEnum::Viridis; + else if (color == "bw") + return ColorScaleEnum::BW; + else if (color == "heat") + return ColorScaleEnum::Heat; + else if (color == "indigo") + return ColorScaleEnum::Indigo; + else + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, + "Color scale unknown"); +} + +org::openapitools::server::model::Grid_plot Convert(const GridPlot& input) { + org::openapitools::server::model::Grid_plot ret; + ret.setWidth(input.GetWidth()); + ret.setData(input.GetPlot()); + return ret; +} + +IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input) { + IndexingSettings ret; + switch (input.getAlgorithm().getValue()) { + case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFT: + ret.Algorithm(IndexingAlgorithmEnum::FFT); + break; + case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::NONE: + ret.Algorithm(IndexingAlgorithmEnum::None); + break; + case org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFBIDX: + ret.Algorithm(IndexingAlgorithmEnum::FFBIDX); + break; + default: + throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown indexing algorithm"); + } + + ret.FFT_HighResolution_A(input.getFftHighResolutionA()); + ret.FFT_MaxUnitCell_A(input.getFftMaxUnitCellA()); + ret.FFT_MinUnitCell_A(input.getFftMinUnitCellA()); + ret.FFT_NumVectors(input.getFftNumVectors()); + ret.Tolerance(input.getTolerance()); + return ret; +} + +org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input) { + org::openapitools::server::model::Indexing_settings ret; + + ret.setFftHighResolutionA(input.GetFFT_HighResolution_A()); + ret.setFftMinUnitCellA(input.GetFFT_MinUnitCell_A()); + ret.setFftMaxUnitCellA(input.GetFFT_MaxUnitCell_A()); + ret.setFftNumVectors(input.GetFFT_NumVectors()); + ret.setTolerance(input.GetTolerance()); + + org::openapitools::server::model::Indexing_algorithm tmp; + switch (input.GetAlgorithm()) { + case IndexingAlgorithmEnum::FFBIDX: + tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFBIDX); + break; + case IndexingAlgorithmEnum::FFT: + tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::FFT); + break; + case IndexingAlgorithmEnum::None: + tmp.setValue(org::openapitools::server::model::Indexing_algorithm::eIndexing_algorithm::NONE); + break; + } + ret.setAlgorithm(tmp); + return ret; +} diff --git a/broker/OpenAPIConvert.h b/broker/OpenAPIConvert.h index 1b1c67a7..cc8630d1 100644 --- a/broker/OpenAPIConvert.h +++ b/broker/OpenAPIConvert.h @@ -24,8 +24,11 @@ #include "gen/model/Zeromq_metadata_settings.h" #include "gen/model/File_writer_settings.h" #include "gen/model/Image_buffer_status.h" +#include "gen/model/Rotation_axis.h" +#include "gen/model/Grid_scan.h" +#include "gen/model/Indexing_settings.h" -#include "../frame_serialize/JFJochMessages.h" +#include "../common/JFJochMessages.h" #include "../common/DatasetSettings.h" #include "../common/ImageFormatSettings.h" #include "../image_analysis/SpotFindingSettings.h" @@ -33,10 +36,14 @@ #include "../common/DetectorSettings.h" #include "../jungfrau/JFCalibration.h" #include "../common/InstrumentMetadata.h" +#include "Grid_plots.h" SpotFindingSettings Convert(const org::openapitools::server::model::Spot_finding_settings &input); org::openapitools::server::model::Spot_finding_settings Convert(const SpotFindingSettings &input); +IndexingSettings Convert(const org::openapitools::server::model::Indexing_settings &input); +org::openapitools::server::model::Indexing_settings Convert(const IndexingSettings &input); + org::openapitools::server::model::Measurement_statistics Convert(const MeasurementStatistics &input); DetectorSettings Convert(const org::openapitools::server::model::Detector_settings &input); @@ -60,6 +67,8 @@ ROIDefinition Convert(const org::openapitools::server::model::Roi_definitions& i org::openapitools::server::model::Roi_definitions Convert(const ROIDefinition &input); ImageFormatSettings Convert(const org::openapitools::server::model::Image_format_settings& input); org::openapitools::server::model::Image_format_settings Convert(const ImageFormatSettings& input); +GoniometerAxis Convert(const org::openapitools::server::model::Rotation_axis& input); +GridScanSettings Convert(const org::openapitools::server::model::Grid_scan& input); DatasetSettings Convert(const org::openapitools::server::model::Dataset_settings& input); std::vector Convert(const std::vector &input); org::openapitools::server::model::Pixel_mask_statistics Convert(const PixelMaskStatistics& input); @@ -72,4 +81,10 @@ ZMQMetadataSettings Convert(const org::openapitools::server::model::Zeromq_metad org::openapitools::server::model::File_writer_format Convert(FileWriterFormat input); FileWriterFormat Convert(const org::openapitools::server::model::File_writer_format& input); + +org::openapitools::server::model::Grid_plot Convert(const GridPlot& input); + +PlotType ConvertPlotType(const std::optional& input); +ColorScaleEnum ConvertColorScale(const std::optional& input); + #endif //JFJOCH_OPENAPICONVERT_H diff --git a/broker/gen/api/ApiBase.h b/broker/gen/api/ApiBase.h index f61d8815..8c2b4922 100644 --- a/broker/gen/api/ApiBase.h +++ b/broker/gen/api/ApiBase.h @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp index e3baacf3..c81087a2 100644 --- a/broker/gen/api/DefaultApi.cpp +++ b/broker/gen/api/DefaultApi.cpp @@ -2,7 +2,7 @@ * Jungfraujoch * API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. * -* The version of the OpenAPI document: 1.0.0-rc.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -44,6 +44,8 @@ void DefaultApi::setupRoutes() { Routes::Get(*router, base + "/config/image_format", Routes::bind(&DefaultApi::config_image_format_get_handler, this)); Routes::Put(*router, base + "/config/image_format", Routes::bind(&DefaultApi::config_image_format_put_handler, this)); Routes::Post(*router, base + "/config/image_format/raw", Routes::bind(&DefaultApi::config_image_format_raw_post_handler, this)); + Routes::Get(*router, base + "/config/indexing", Routes::bind(&DefaultApi::config_indexing_get_handler, this)); + Routes::Put(*router, base + "/config/indexing", Routes::bind(&DefaultApi::config_indexing_put_handler, this)); Routes::Get(*router, base + "/config/instrument", Routes::bind(&DefaultApi::config_instrument_get_handler, this)); Routes::Put(*router, base + "/config/instrument", Routes::bind(&DefaultApi::config_instrument_put_handler, this)); Routes::Put(*router, base + "/config/internal_generator_image", Routes::bind(&DefaultApi::config_internal_generator_image_put_handler, this)); @@ -75,27 +77,8 @@ void DefaultApi::setupRoutes() { Routes::Get(*router, base + "/image_buffer/status", Routes::bind(&DefaultApi::image_buffer_status_get_handler, this)); Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this)); Routes::Post(*router, base + "/pedestal", Routes::bind(&DefaultApi::pedestal_post_handler, this)); - Routes::Get(*router, base + "/plot/azim_int", Routes::bind(&DefaultApi::plot_azim_int_get_handler, this)); - Routes::Get(*router, base + "/plot/bkg_estimate", Routes::bind(&DefaultApi::plot_bkg_estimate_get_handler, this)); - Routes::Get(*router, base + "/plot/error_pixel", Routes::bind(&DefaultApi::plot_error_pixel_get_handler, this)); - Routes::Get(*router, base + "/plot/image_collection_efficiency", Routes::bind(&DefaultApi::plot_image_collection_efficiency_get_handler, this)); - Routes::Get(*router, base + "/plot/indexing_rate", Routes::bind(&DefaultApi::plot_indexing_rate_get_handler, this)); - Routes::Get(*router, base + "/plot/indexing_unit_cell_angle", Routes::bind(&DefaultApi::plot_indexing_unit_cell_angle_get_handler, this)); - Routes::Get(*router, base + "/plot/indexing_unit_cell", Routes::bind(&DefaultApi::plot_indexing_unit_cell_get_handler, this)); - Routes::Get(*router, base + "/plot/max_value", Routes::bind(&DefaultApi::plot_max_value_get_handler, this)); - Routes::Get(*router, base + "/plot/packets_received", Routes::bind(&DefaultApi::plot_packets_received_get_handler, this)); - Routes::Get(*router, base + "/plot/receiver_delay", Routes::bind(&DefaultApi::plot_receiver_delay_get_handler, this)); - Routes::Get(*router, base + "/plot/receiver_free_send_buffers", Routes::bind(&DefaultApi::plot_receiver_free_send_buffers_get_handler, this)); - Routes::Get(*router, base + "/plot/resolution_estimate", Routes::bind(&DefaultApi::plot_resolution_estimate_get_handler, this)); - Routes::Get(*router, base + "/plot/roi_max_count", Routes::bind(&DefaultApi::plot_roi_max_count_get_handler, this)); - Routes::Get(*router, base + "/plot/roi_mean", Routes::bind(&DefaultApi::plot_roi_mean_get_handler, this)); - Routes::Get(*router, base + "/plot/roi_sum", Routes::bind(&DefaultApi::plot_roi_sum_get_handler, this)); - Routes::Get(*router, base + "/plot/roi_valid_pixels", Routes::bind(&DefaultApi::plot_roi_valid_pixels_get_handler, this)); - Routes::Get(*router, base + "/plot/roi_x", Routes::bind(&DefaultApi::plot_roi_x_get_handler, this)); - Routes::Get(*router, base + "/plot/roi_y", Routes::bind(&DefaultApi::plot_roi_y_get_handler, this)); - Routes::Get(*router, base + "/plot/spot_count", Routes::bind(&DefaultApi::plot_spot_count_get_handler, this)); - Routes::Get(*router, base + "/plot/strong_pixel", Routes::bind(&DefaultApi::plot_strong_pixel_get_handler, this)); Routes::Get(*router, base + "/preview/pedestal.tiff", Routes::bind(&DefaultApi::preview_pedestal_tiff_get_handler, this)); + Routes::Get(*router, base + "/preview/plot", Routes::bind(&DefaultApi::preview_plot_get_handler, this)); Routes::Post(*router, base + "/start", Routes::bind(&DefaultApi::start_post_handler, this)); Routes::Get(*router, base + "/statistics/calibration", Routes::bind(&DefaultApi::statistics_calibration_get_handler, this)); Routes::Get(*router, base + "/statistics/data_collection", Routes::bind(&DefaultApi::statistics_data_collection_get_handler, this)); @@ -397,6 +380,56 @@ void DefaultApi::config_image_format_raw_post_handler(const Pistache::Rest::Requ response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } +} +void DefaultApi::config_indexing_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->config_indexing_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void DefaultApi::config_indexing_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Indexing_settings indexingSettings; + + try { + nlohmann::json::parse(request.body()).get_to(indexingSettings); + indexingSettings.validate(); + } catch (std::exception &e) { + this->handleParsingException(e, response); + return; + } + + try { + this->config_indexing_put(indexingSettings, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + } void DefaultApi::config_instrument_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { try { @@ -989,9 +1022,9 @@ void DefaultApi::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Reque } } auto saturationQuery = request.query().get("saturation"); - std::optional saturation; + std::optional saturation; if(saturationQuery.has_value()){ - int64_t valueQuery_instance; + float valueQuery_instance; if(fromStringValue(saturationQuery.value(), valueQuery_instance)){ saturation = valueQuery_instance; } @@ -1140,738 +1173,6 @@ void DefaultApi::pedestal_post_handler(const Pistache::Rest::Request &, Pistache response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } -} -void DefaultApi::plot_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - 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_azim_int_get(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_bkg_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_bkg_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_error_pixel_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_error_pixel_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_image_collection_efficiency_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_image_collection_efficiency_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_indexing_rate_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_indexing_rate_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_indexing_unit_cell_angle_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_indexing_unit_cell_angle_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_indexing_unit_cell_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_indexing_unit_cell_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_max_value_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto binningQuery = request.query().get("binning"); - std::optional 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_max_value_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_packets_received_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto binningQuery = request.query().get("binning"); - std::optional 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_packets_received_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_receiver_delay_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_receiver_delay_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_receiver_free_send_buffers_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_receiver_free_send_buffers_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_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 { - - - // 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_roi_max_count_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_mean_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto binningQuery = request.query().get("binning"); - std::optional 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_roi_mean_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_sum_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_roi_sum_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_valid_pixels_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_roi_valid_pixels_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_x_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto binningQuery = request.query().get("binning"); - std::optional 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_roi_x_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_y_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto binningQuery = request.query().get("binning"); - std::optional 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_roi_y_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_spot_count_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_spot_count_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_strong_pixel_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_strong_pixel_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::preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { try { @@ -1909,6 +1210,59 @@ void DefaultApi::preview_pedestal_tiff_get_handler(const Pistache::Rest::Request response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } +} +void DefaultApi::preview_plot_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; + } + } + auto typeQuery = request.query().get("type"); + std::optional type; + if(typeQuery.has_value()){ + std::string valueQuery_instance; + if(fromStringValue(typeQuery.value(), valueQuery_instance)){ + type = valueQuery_instance; + } + } + auto experimentalCoordQuery = request.query().get("experimental_coord"); + std::optional experimentalCoord; + if(experimentalCoordQuery.has_value()){ + bool valueQuery_instance; + if(fromStringValue(experimentalCoordQuery.value(), valueQuery_instance)){ + experimentalCoord = valueQuery_instance; + } + } + + try { + this->preview_plot_get(type, binning, compression, experimentalCoord, 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::start_post_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 d7d6152b..7002eb4a 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -41,6 +41,7 @@ #include "Fpga_status_inner.h" #include "Image_buffer_status.h" #include "Image_format_settings.h" +#include "Indexing_settings.h" #include "Instrument_metadata.h" #include "Jfjoch_statistics.h" #include "Measurement_statistics.h" @@ -77,6 +78,8 @@ private: void config_image_format_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_image_format_raw_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void config_indexing_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void config_indexing_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_instrument_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); @@ -108,27 +111,8 @@ private: void image_buffer_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void pedestal_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_azim_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_bkg_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_error_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_image_collection_efficiency_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_indexing_rate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_indexing_unit_cell_angle_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_indexing_unit_cell_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_max_value_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_packets_received_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_receiver_delay_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_receiver_free_send_buffers_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_resolution_estimate_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_roi_mean_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_roi_sum_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_roi_x_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_roi_y_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_spot_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); - void plot_strong_pixel_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void preview_pedestal_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void preview_plot_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void statistics_calibration_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); void statistics_data_collection_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); @@ -251,6 +235,21 @@ private: /// virtual void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) = 0; /// + /// Get indexing configuration + /// + /// + /// Can be done anytime + /// + virtual void config_indexing_get(Pistache::Http::ResponseWriter &response) = 0; + /// + /// Change indexing algorithm settings + /// + /// + /// This can only be done when detector is `Idle`, `Error` or `Inactive` states. + /// + /// (optional) + virtual void config_indexing_put(const org::openapitools::server::model::Indexing_settings &indexingSettings, Pistache::Http::ResponseWriter &response) = 0; + /// /// Get instrument metadata /// /// @@ -442,11 +441,11 @@ private: /// 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) + /// Saturation value to set contrast in the preview image (optional, default to 10.0f) /// 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; + 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 /// @@ -484,185 +483,6 @@ private: /// virtual void pedestal_post(Pistache::Http::ResponseWriter &response) = 0; /// - /// Generate radial integration profile - /// - /// - /// Generate average radial integration profile - /// - /// Enable DEFLATE compression of output data. (optional, default to true) - virtual void plot_azim_int_get(const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate background estimate plot - /// - /// - /// Mean intensity for d = 3 - 5 A per image; 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_bkg_estimate_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate error pixels plot - /// - /// - /// Count of error (mean) and saturated (mean/max) pixels per image; 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_error_pixel_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate image collection efficiency plot - /// - /// - /// Ratio of collected and expected packets per image; 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_image_collection_efficiency_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate indexing rate plot - /// - /// - /// Image indexing rate; 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_indexing_rate_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate indexing unit cell angle plot - /// - /// - /// Crystal unit cell based on indexing results; 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_indexing_unit_cell_angle_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate indexing unit cell length plots - /// - /// - /// Crystal unit cell based on indexing results; 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_indexing_unit_cell_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// 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 - /// - /// 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_max_value_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate plot with number of received packets per image - /// - /// - /// Number of collected packets per image; 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_packets_received_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate receiver delay plot - /// - /// - /// Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; 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_receiver_delay_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate receiver free send buffer plot - /// - /// - /// Amount of send buffers available during frame processing - used for internal debugging; 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_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 - /// - /// - /// Max count of ROI per image; 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_roi_max_count_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// 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! - /// - /// 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_roi_mean_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate ROI sum plot - /// - /// - /// Sum of ROI rectangle per image; 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_roi_sum_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// 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 - /// - /// 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_roi_valid_pixels_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// 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 - /// - /// 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_roi_x_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// 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 - /// - /// 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_roi_y_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate spot count plot - /// - /// - /// Number of spots per image; 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_spot_count_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// - /// Generate strong pixels plot - /// - /// - /// Count of strong pixels per image (from spot finding); 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_strong_pixel_get(const std::optional &binning, const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; - /// /// Get pedestal in TIFF format /// /// @@ -672,6 +492,17 @@ private: /// Storage cell number (optional, default to 0) virtual void preview_pedestal_tiff_get(const std::optional &gainLevel, const std::optional &sc, Pistache::Http::ResponseWriter &response) = 0; /// + /// Generate 1D plot from Jungfraujoch + /// + /// + /// + /// + /// Type of requested plot + /// Binning of frames for the plot (0 = default binning) (optional, default to 0) + /// Enable DEFLATE compression of output data. (optional, default to false) + /// If measurement has goniometer axis defined, plot X-axis will represent rotation angle If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value For still measurement the number is ignored (optional, default to false) + virtual void preview_plot_get(const std::optional &type, const std::optional &binning, const std::optional &compression, const std::optional &experimentalCoord, Pistache::Http::ResponseWriter &response) = 0; + /// /// Start detector /// /// @@ -699,7 +530,7 @@ private: /// /// /// - /// Enable DEFLATE compression of output data. (optional, default to true) + /// Enable DEFLATE compression of output data. (optional, default to false) virtual void statistics_get(const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Get Jungfraujoch status diff --git a/broker/gen/model/Azim_int_settings.cpp b/broker/gen/model/Azim_int_settings.cpp index ba858d50..d8b464f7 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Azim_int_settings.h b/broker/gen/model/Azim_int_settings.h index 61fc8ad7..1189a837 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Broker_status.cpp b/broker/gen/model/Broker_status.cpp index a785ecbd..bf5d6e68 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Broker_status.h b/broker/gen/model/Broker_status.h index b8217d9d..91d017c0 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Calibration_statistics_inner.cpp b/broker/gen/model/Calibration_statistics_inner.cpp index 418ede27..712bbfa1 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Calibration_statistics_inner.h b/broker/gen/model/Calibration_statistics_inner.h index db6fa978..f1f4291f 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings.cpp b/broker/gen/model/Dataset_settings.cpp index 5136d1e8..fdf80c3f 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -46,6 +46,7 @@ Dataset_settings::Dataset_settings() m_Transmission = 0.0f; m_TransmissionIsSet = false; m_GoniometerIsSet = false; + m_Grid_scanIsSet = false; m_Header_appendixIsSet = false; m_Image_appendixIsSet = false; m_Data_reduction_factor_serialmx = 1.0f; @@ -214,7 +215,7 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP } } - + if (dataReductionFactorSerialmxIsSet()) { const float& value = m_Data_reduction_factor_serialmx; @@ -335,6 +336,9 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const ((!goniometerIsSet() && !rhs.goniometerIsSet()) || (goniometerIsSet() && rhs.goniometerIsSet() && getGoniometer() == rhs.getGoniometer())) && + ((!gridScanIsSet() && !rhs.gridScanIsSet()) || (gridScanIsSet() && rhs.gridScanIsSet() && getGridScan() == rhs.getGridScan())) && + + ((!headerAppendixIsSet() && !rhs.headerAppendixIsSet()) || (headerAppendixIsSet() && rhs.headerAppendixIsSet() && getHeaderAppendix() == rhs.getHeaderAppendix())) && @@ -404,6 +408,8 @@ void to_json(nlohmann::json& j, const Dataset_settings& o) j["transmission"] = o.m_Transmission; if(o.goniometerIsSet()) j["goniometer"] = o.m_Goniometer; + if(o.gridScanIsSet()) + j["grid_scan"] = o.m_Grid_scan; if(o.headerAppendixIsSet()) j["header_appendix"] = o.m_Header_appendix; if(o.imageAppendixIsSet()) @@ -490,6 +496,11 @@ void from_json(const nlohmann::json& j, Dataset_settings& o) j.at("goniometer").get_to(o.m_Goniometer); o.m_GoniometerIsSet = true; } + if(j.find("grid_scan") != j.end()) + { + j.at("grid_scan").get_to(o.m_Grid_scan); + o.m_Grid_scanIsSet = true; + } if(j.find("header_appendix") != j.end()) { j.at("header_appendix").get_to(o.m_Header_appendix); @@ -767,6 +778,23 @@ void Dataset_settings::unsetGoniometer() { m_GoniometerIsSet = false; } +org::openapitools::server::model::Grid_scan Dataset_settings::getGridScan() const +{ + return m_Grid_scan; +} +void Dataset_settings::setGridScan(org::openapitools::server::model::Grid_scan const& value) +{ + m_Grid_scan = value; + m_Grid_scanIsSet = true; +} +bool Dataset_settings::gridScanIsSet() const +{ + return m_Grid_scanIsSet; +} +void Dataset_settings::unsetGrid_scan() +{ + m_Grid_scanIsSet = false; +} nlohmann::json Dataset_settings::getHeaderAppendix() const { return m_Header_appendix; diff --git a/broker/gen/model/Dataset_settings.h b/broker/gen/model/Dataset_settings.h index bda93eb3..5d0f9d85 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -19,6 +19,7 @@ #define Dataset_settings_H_ +#include "Grid_scan.h" #include #include "Rotation_axis.h" #include @@ -159,6 +160,13 @@ public: bool goniometerIsSet() const; void unsetGoniometer(); /// + /// + /// + org::openapitools::server::model::Grid_scan getGridScan() const; + void setGridScan(org::openapitools::server::model::Grid_scan const& value); + bool gridScanIsSet() const; + void unsetGrid_scan(); + /// /// Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) In general, it is not saved in HDF5 file. However, if values are placed in \"hdf5\" object, `jfjoch_writer` will write them in /entry/data of the HDF5 file. This applies solely to string and number (double floating-point). No arrays/sub-objects is allowed. For example {\"hdf5\": {\"val1\":1, \"val2\":\"xyz\"}}, will write /entry/user/val1 and /entry/user/val2. /// nlohmann::json getHeaderAppendix() const; @@ -269,6 +277,8 @@ protected: bool m_TransmissionIsSet; org::openapitools::server::model::Rotation_axis m_Goniometer; bool m_GoniometerIsSet; + org::openapitools::server::model::Grid_scan m_Grid_scan; + bool m_Grid_scanIsSet; nlohmann::json m_Header_appendix; bool m_Header_appendixIsSet; nlohmann::json m_Image_appendix; diff --git a/broker/gen/model/Dataset_settings_unit_cell.cpp b/broker/gen/model/Dataset_settings_unit_cell.cpp index 9899d3be..b886e220 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Dataset_settings_unit_cell.h b/broker/gen/model/Dataset_settings_unit_cell.h index 9e089c2b..2d8f96a0 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector.cpp b/broker/gen/model/Detector.cpp index 594185cf..4d73c6c5 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector.h b/broker/gen/model/Detector.h index 3cf1feab..f2efb734 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list.cpp b/broker/gen/model/Detector_list.cpp index ec8026ae..37f36929 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list.h b/broker/gen/model/Detector_list.h index d189357e..d44eaed6 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list_element.cpp b/broker/gen/model/Detector_list_element.cpp index 943e0189..7468cca4 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_list_element.h b/broker/gen/model/Detector_list_element.h index cc4686e2..7ef2c5ad 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module.cpp b/broker/gen/model/Detector_module.cpp index 6ffc2a29..f34bf256 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module.h b/broker/gen/model/Detector_module.h index c13f3909..9459184d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module_direction.cpp b/broker/gen/model/Detector_module_direction.cpp index 7400c067..a2264ae6 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_module_direction.h b/broker/gen/model/Detector_module_direction.h index 40c735a1..0dfd1a96 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_power_state.cpp b/broker/gen/model/Detector_power_state.cpp index 65c88277..460159b7 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_power_state.h b/broker/gen/model/Detector_power_state.h index 5529d4a4..86b14293 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_selection.cpp b/broker/gen/model/Detector_selection.cpp index 7252bf39..408a1358 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_selection.h b/broker/gen/model/Detector_selection.h index b47fdc5c..e14a815c 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_settings.cpp b/broker/gen/model/Detector_settings.cpp index 28f21f87..4ae061eb 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_settings.h b/broker/gen/model/Detector_settings.h index 172ad53b..b52ed84d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_state.cpp b/broker/gen/model/Detector_state.cpp index c007cc95..488e9606 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_state.h b/broker/gen/model/Detector_state.h index 17153ccb..27273f9e 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_status.cpp b/broker/gen/model/Detector_status.cpp index 0f4b35c6..259fbd8a 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_status.h b/broker/gen/model/Detector_status.h index 5c96ba87..7efee583 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_timing.cpp b/broker/gen/model/Detector_timing.cpp index 73fbd59a..b1ec8de5 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_timing.h b/broker/gen/model/Detector_timing.h index ccd62cce..4fdd4c9e 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_type.cpp b/broker/gen/model/Detector_type.cpp index 01c62696..0b5c1060 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Detector_type.h b/broker/gen/model/Detector_type.h index dfa55c39..a95d4abd 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Error_message.cpp b/broker/gen/model/Error_message.cpp index 9b31aa28..2d87c9b4 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Error_message.h b/broker/gen/model/Error_message.h index b32d4c78..a45d0209 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/File_writer_format.cpp b/broker/gen/model/File_writer_format.cpp index ed9988eb..9e6691fb 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/File_writer_format.h b/broker/gen/model/File_writer_format.h index db78a429..9a3e51e5 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/File_writer_settings.cpp b/broker/gen/model/File_writer_settings.cpp index a51145ac..733e61ef 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/File_writer_settings.h b/broker/gen/model/File_writer_settings.h index feabb02e..4ddb96b7 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Fpga_status_inner.cpp b/broker/gen/model/Fpga_status_inner.cpp index daf4ded4..cc14221d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Fpga_status_inner.h b/broker/gen/model/Fpga_status_inner.h index 04e7b80d..7f4e63e5 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Grid_plot.cpp b/broker/gen/model/Grid_plot.cpp new file mode 100644 index 00000000..6942ba81 --- /dev/null +++ b/broker/gen/model/Grid_plot.cpp @@ -0,0 +1,139 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Grid_plot.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Grid_plot::Grid_plot() +{ + m_Width = 0L; + +} + +void Grid_plot::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Grid_plot::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Grid_plot::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Grid_plot" : pathPrefix; + + + + /* Data */ { + const std::vector& value = m_Data; + const std::string currentValuePath = _pathPrefix + ".data"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const float& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + + i++; + } + } + + } + + + /* Width */ { + const int64_t& value = m_Width; + const std::string currentValuePath = _pathPrefix + ".width"; + + + if (value < 1ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 1;"; + } + + } + + return success; +} + +bool Grid_plot::operator==(const Grid_plot& rhs) const +{ + return + + + (getData() == rhs.getData()) + && + + (getWidth() == rhs.getWidth()) + + + ; +} + +bool Grid_plot::operator!=(const Grid_plot& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Grid_plot& o) +{ + j = nlohmann::json::object(); + j["data"] = o.m_Data; + j["width"] = o.m_Width; + +} + +void from_json(const nlohmann::json& j, Grid_plot& o) +{ + j.at("data").get_to(o.m_Data); + j.at("width").get_to(o.m_Width); + +} + +std::vector Grid_plot::getData() const +{ + return m_Data; +} +void Grid_plot::setData(std::vector const value) +{ + m_Data = value; +} +int64_t Grid_plot::getWidth() const +{ + return m_Width; +} +void Grid_plot::setWidth(int64_t const value) +{ + m_Width = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Grid_plot.h b/broker/gen/model/Grid_plot.h new file mode 100644 index 00000000..49583bed --- /dev/null +++ b/broker/gen/model/Grid_plot.h @@ -0,0 +1,84 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Grid_plot.h + * + * + */ + +#ifndef Grid_plot_H_ +#define Grid_plot_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class Grid_plot +{ +public: + Grid_plot(); + virtual ~Grid_plot() = 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 Grid_plot& rhs) const; + bool operator!=(const Grid_plot& rhs) const; + + ///////////////////////////////////////////// + /// Grid_plot members + + /// + /// + /// + std::vector getData() const; + void setData(std::vector const value); + /// + /// + /// + int64_t getWidth() const; + void setWidth(int64_t const value); + + friend void to_json(nlohmann::json& j, const Grid_plot& o); + friend void from_json(const nlohmann::json& j, Grid_plot& o); +protected: + std::vector m_Data; + + int64_t m_Width; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Grid_plot_H_ */ diff --git a/broker/gen/model/Grid_plots.cpp b/broker/gen/model/Grid_plots.cpp new file mode 100644 index 00000000..2d7fc7d1 --- /dev/null +++ b/broker/gen/model/Grid_plots.cpp @@ -0,0 +1,139 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Grid_plots.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Grid_plots::Grid_plots() +{ + m_Width = 0L; + +} + +void Grid_plots::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Grid_plots::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Grid_plots::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Grid_plots" : pathPrefix; + + + + /* Plots */ { + const std::vector& value = m_Plots; + const std::string currentValuePath = _pathPrefix + ".plots"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const org::openapitools::server::model::Grid_plot& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + success = value.validate(msg, currentValuePath + ".plots") && success; + + i++; + } + } + + } + + + /* Width */ { + const int64_t& value = m_Width; + const std::string currentValuePath = _pathPrefix + ".width"; + + + if (value < 1ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 1;"; + } + + } + + return success; +} + +bool Grid_plots::operator==(const Grid_plots& rhs) const +{ + return + + + (getPlots() == rhs.getPlots()) + && + + (getWidth() == rhs.getWidth()) + + + ; +} + +bool Grid_plots::operator!=(const Grid_plots& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Grid_plots& o) +{ + j = nlohmann::json::object(); + j["plots"] = o.m_Plots; + j["width"] = o.m_Width; + +} + +void from_json(const nlohmann::json& j, Grid_plots& o) +{ + j.at("plots").get_to(o.m_Plots); + j.at("width").get_to(o.m_Width); + +} + +std::vector Grid_plots::getPlots() const +{ + return m_Plots; +} +void Grid_plots::setPlots(std::vector const& value) +{ + m_Plots = value; +} +int64_t Grid_plots::getWidth() const +{ + return m_Width; +} +void Grid_plots::setWidth(int64_t const value) +{ + m_Width = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Grid_plots.h b/broker/gen/model/Grid_plots.h new file mode 100644 index 00000000..60e0a0fe --- /dev/null +++ b/broker/gen/model/Grid_plots.h @@ -0,0 +1,85 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Grid_plots.h + * + * + */ + +#ifndef Grid_plots_H_ +#define Grid_plots_H_ + + +#include +#include "Grid_plot.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class Grid_plots +{ +public: + Grid_plots(); + virtual ~Grid_plots() = 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 Grid_plots& rhs) const; + bool operator!=(const Grid_plots& rhs) const; + + ///////////////////////////////////////////// + /// Grid_plots members + + /// + /// + /// + std::vector getPlots() const; + void setPlots(std::vector const& value); + /// + /// + /// + int64_t getWidth() const; + void setWidth(int64_t const value); + + friend void to_json(nlohmann::json& j, const Grid_plots& o); + friend void from_json(const nlohmann::json& j, Grid_plots& o); +protected: + std::vector m_Plots; + + int64_t m_Width; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Grid_plots_H_ */ diff --git a/broker/gen/model/Grid_scan.cpp b/broker/gen/model/Grid_scan.cpp new file mode 100644 index 00000000..85742102 --- /dev/null +++ b/broker/gen/model/Grid_scan.cpp @@ -0,0 +1,191 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Grid_scan.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Grid_scan::Grid_scan() +{ + m_N_fast = 0L; + m_Step_x_um = 0.0f; + m_Step_y_um = 0.0f; + m_Vertical = false; + m_VerticalIsSet = false; + m_Snake = false; + m_SnakeIsSet = false; + +} + +void Grid_scan::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Grid_scan::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Grid_scan::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Grid_scan" : pathPrefix; + + + + /* N_fast */ { + const int64_t& value = m_N_fast; + const std::string currentValuePath = _pathPrefix + ".nFast"; + + + if (value < 1ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 1;"; + } + + } + + return success; +} + +bool Grid_scan::operator==(const Grid_scan& rhs) const +{ + return + + + (getNFast() == rhs.getNFast()) + && + + (getStepXUm() == rhs.getStepXUm()) + && + + (getStepYUm() == rhs.getStepYUm()) + && + + + ((!verticalIsSet() && !rhs.verticalIsSet()) || (verticalIsSet() && rhs.verticalIsSet() && isVertical() == rhs.isVertical())) && + + + ((!snakeIsSet() && !rhs.snakeIsSet()) || (snakeIsSet() && rhs.snakeIsSet() && isSnake() == rhs.isSnake())) + + ; +} + +bool Grid_scan::operator!=(const Grid_scan& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Grid_scan& o) +{ + j = nlohmann::json::object(); + j["n_fast"] = o.m_N_fast; + j["step_x_um"] = o.m_Step_x_um; + j["step_y_um"] = o.m_Step_y_um; + if(o.verticalIsSet()) + j["vertical"] = o.m_Vertical; + if(o.snakeIsSet()) + j["snake"] = o.m_Snake; + +} + +void from_json(const nlohmann::json& j, Grid_scan& o) +{ + j.at("n_fast").get_to(o.m_N_fast); + j.at("step_x_um").get_to(o.m_Step_x_um); + j.at("step_y_um").get_to(o.m_Step_y_um); + if(j.find("vertical") != j.end()) + { + j.at("vertical").get_to(o.m_Vertical); + o.m_VerticalIsSet = true; + } + if(j.find("snake") != j.end()) + { + j.at("snake").get_to(o.m_Snake); + o.m_SnakeIsSet = true; + } + +} + +int64_t Grid_scan::getNFast() const +{ + return m_N_fast; +} +void Grid_scan::setNFast(int64_t const value) +{ + m_N_fast = value; +} +float Grid_scan::getStepXUm() const +{ + return m_Step_x_um; +} +void Grid_scan::setStepXUm(float const value) +{ + m_Step_x_um = value; +} +float Grid_scan::getStepYUm() const +{ + return m_Step_y_um; +} +void Grid_scan::setStepYUm(float const value) +{ + m_Step_y_um = value; +} +bool Grid_scan::isVertical() const +{ + return m_Vertical; +} +void Grid_scan::setVertical(bool const value) +{ + m_Vertical = value; + m_VerticalIsSet = true; +} +bool Grid_scan::verticalIsSet() const +{ + return m_VerticalIsSet; +} +void Grid_scan::unsetVertical() +{ + m_VerticalIsSet = false; +} +bool Grid_scan::isSnake() const +{ + return m_Snake; +} +void Grid_scan::setSnake(bool const value) +{ + m_Snake = value; + m_SnakeIsSet = true; +} +bool Grid_scan::snakeIsSet() const +{ + return m_SnakeIsSet; +} +void Grid_scan::unsetSnake() +{ + m_SnakeIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Grid_scan.h b/broker/gen/model/Grid_scan.h new file mode 100644 index 00000000..5248f506 --- /dev/null +++ b/broker/gen/model/Grid_scan.h @@ -0,0 +1,108 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Grid_scan.h + * + * Definition of a grid scan (mutually exclusive with `rotation_axis`) + */ + +#ifndef Grid_scan_H_ +#define Grid_scan_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// Definition of a grid scan (mutually exclusive with `rotation_axis`) +/// +class Grid_scan +{ +public: + Grid_scan(); + virtual ~Grid_scan() = 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 Grid_scan& rhs) const; + bool operator!=(const Grid_scan& rhs) const; + + ///////////////////////////////////////////// + /// Grid_scan members + + /// + /// Number of elements in the fast direction + /// + int64_t getNFast() const; + void setNFast(int64_t const value); + /// + /// Step in grid along the fast direction. Can be negative. Positive number: left to right Negative number: right to left + /// + float getStepXUm() const; + void setStepXUm(float const value); + /// + /// Step in grid along the slow direction. Can be negative. Positive number: top to bottom Negative number: bottom to top + /// + float getStepYUm() const; + void setStepYUm(float const value); + /// + /// If disabled: fast direction = X, slow direction = Y If enabled: fast direction = Y, slow direction = X + /// + bool isVertical() const; + void setVertical(bool const value); + bool verticalIsSet() const; + void unsetVertical(); + /// + /// Flip fast direction for every second row + /// + bool isSnake() const; + void setSnake(bool const value); + bool snakeIsSet() const; + void unsetSnake(); + + friend void to_json(nlohmann::json& j, const Grid_scan& o); + friend void from_json(const nlohmann::json& j, Grid_scan& o); +protected: + int64_t m_N_fast; + + float m_Step_x_um; + + float m_Step_y_um; + + bool m_Vertical; + bool m_VerticalIsSet; + bool m_Snake; + bool m_SnakeIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Grid_scan_H_ */ diff --git a/broker/gen/model/Helpers.cpp b/broker/gen/model/Helpers.cpp index 083e43da..9e097fbd 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Helpers.h b/broker/gen/model/Helpers.h index f1d9bf07..d502b264 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_buffer_status.cpp b/broker/gen/model/Image_buffer_status.cpp index a2285418..ee8766f0 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_buffer_status.h b/broker/gen/model/Image_buffer_status.h index 3b5968d8..a012fb30 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_format_settings.cpp b/broker/gen/model/Image_format_settings.cpp index f053bf34..d3ccb748 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_format_settings.h b/broker/gen/model/Image_format_settings.h index 7b036915..cbb7b559 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_pusher_type.cpp b/broker/gen/model/Image_pusher_type.cpp index 0b117ac1..14aefecf 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Image_pusher_type.h b/broker/gen/model/Image_pusher_type.h index ef0076bc..f4f9adac 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Indexing_algorithm.cpp b/broker/gen/model/Indexing_algorithm.cpp new file mode 100644 index 00000000..ea7ad633 --- /dev/null +++ b/broker/gen/model/Indexing_algorithm.cpp @@ -0,0 +1,122 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Indexing_algorithm.h" +#include "Helpers.h" +#include +#include + +namespace org::openapitools::server::model +{ + +Indexing_algorithm::Indexing_algorithm() +{ + +} + +void Indexing_algorithm::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Indexing_algorithm::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Indexing_algorithm::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_algorithm" : pathPrefix; + + + if (m_value == Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED) + { + success = false; + msg << _pathPrefix << ": has no value;"; + } + + return success; +} + +bool Indexing_algorithm::operator==(const Indexing_algorithm& rhs) const +{ + return + getValue() == rhs.getValue() + + ; +} + +bool Indexing_algorithm::operator!=(const Indexing_algorithm& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Indexing_algorithm& o) +{ + j = nlohmann::json::object(); + + switch (o.getValue()) + { + case Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED: + j = "INVALID_VALUE_OPENAPI_GENERATED"; + break; + case Indexing_algorithm::eIndexing_algorithm::FFBIDX: + j = "FFBIDX"; + break; + case Indexing_algorithm::eIndexing_algorithm::FFT: + j = "FFT"; + break; + case Indexing_algorithm::eIndexing_algorithm::NONE: + j = "None"; + break; + } +} + +void from_json(const nlohmann::json& j, Indexing_algorithm& o) +{ + + auto s = j.get(); + if (s == "FFBIDX") { + o.setValue(Indexing_algorithm::eIndexing_algorithm::FFBIDX); + } + else if (s == "FFT") { + o.setValue(Indexing_algorithm::eIndexing_algorithm::FFT); + } + else if (s == "None") { + o.setValue(Indexing_algorithm::eIndexing_algorithm::NONE); + } else { + std::stringstream ss; + ss << "Unexpected value " << s << " in json" + << " cannot be converted to enum of type" + << " Indexing_algorithm::eIndexing_algorithm"; + throw std::invalid_argument(ss.str()); + } + +} + +Indexing_algorithm::eIndexing_algorithm Indexing_algorithm::getValue() const +{ + return m_value; +} +void Indexing_algorithm::setValue(Indexing_algorithm::eIndexing_algorithm value) +{ + m_value = value; +} + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Indexing_algorithm.h b/broker/gen/model/Indexing_algorithm.h new file mode 100644 index 00000000..b1c91abf --- /dev/null +++ b/broker/gen/model/Indexing_algorithm.h @@ -0,0 +1,80 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Indexing_algorithm.h + * + * Selection of an indexing algorithm used by Jungfraujoch + */ + +#ifndef Indexing_algorithm_H_ +#define Indexing_algorithm_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// Selection of an indexing algorithm used by Jungfraujoch +/// +class Indexing_algorithm +{ +public: + Indexing_algorithm(); + virtual ~Indexing_algorithm() = default; + + enum class eIndexing_algorithm { + // To have a valid default value. + // Avoiding name clashes with user defined + // enum values + INVALID_VALUE_OPENAPI_GENERATED = 0, + FFBIDX, + FFT, + NONE + }; + + /// + /// 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 Indexing_algorithm& rhs) const; + bool operator!=(const Indexing_algorithm& rhs) const; + + ///////////////////////////////////////////// + /// Indexing_algorithm members + + Indexing_algorithm::eIndexing_algorithm getValue() const; + void setValue(Indexing_algorithm::eIndexing_algorithm value); + + friend void to_json(nlohmann::json& j, const Indexing_algorithm& o); + friend void from_json(const nlohmann::json& j, Indexing_algorithm& o); +protected: + Indexing_algorithm::eIndexing_algorithm m_value = Indexing_algorithm::eIndexing_algorithm::INVALID_VALUE_OPENAPI_GENERATED; +}; + +} // namespace org::openapitools::server::model + +#endif /* Indexing_algorithm_H_ */ diff --git a/broker/gen/model/Indexing_settings.cpp b/broker/gen/model/Indexing_settings.cpp new file mode 100644 index 00000000..301d83d3 --- /dev/null +++ b/broker/gen/model/Indexing_settings.cpp @@ -0,0 +1,250 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Indexing_settings.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Indexing_settings::Indexing_settings() +{ + m_Fft_max_unit_cell_A = 250.0f; + m_Fft_min_unit_cell_A = 10.0f; + m_Fft_high_resolution_A = 2.0f; + m_Fft_num_vectors = 16384L; + m_Tolerance = 0.0f; + +} + +void Indexing_settings::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Indexing_settings::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Indexing_settings::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Indexing_settings" : pathPrefix; + + + + /* Fft_max_unit_cell_A */ { + const float& value = m_Fft_max_unit_cell_A; + const std::string currentValuePath = _pathPrefix + ".fftMaxUnitCellA"; + + + if (value < static_cast(50)) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 50;"; + } + if (value > static_cast(500)) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 500;"; + } + + } + + + /* Fft_min_unit_cell_A */ { + const float& value = m_Fft_min_unit_cell_A; + const std::string currentValuePath = _pathPrefix + ".fftMinUnitCellA"; + + + if (value < static_cast(5)) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 5;"; + } + if (value > static_cast(40)) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 40;"; + } + + } + + + /* Fft_high_resolution_A */ { + const float& value = m_Fft_high_resolution_A; + const std::string currentValuePath = _pathPrefix + ".fftHighResolutionA"; + + + if (value < static_cast(0.5)) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0.5;"; + } + if (value > static_cast(6.0)) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 6.0;"; + } + + } + + + /* Fft_num_vectors */ { + const int64_t& value = m_Fft_num_vectors; + const std::string currentValuePath = _pathPrefix + ".fftNumVectors"; + + + if (value < 128ll) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 128;"; + } + + } + + + /* Tolerance */ { + const float& value = m_Tolerance; + const std::string currentValuePath = _pathPrefix + ".tolerance"; + + + if (value < static_cast(0.0)) + { + success = false; + msg << currentValuePath << ": must be greater than or equal to 0.0;"; + } + if (value > static_cast(0.5)) + { + success = false; + msg << currentValuePath << ": must be less than or equal to 0.5;"; + } + + } + + return success; +} + +bool Indexing_settings::operator==(const Indexing_settings& rhs) const +{ + return + + + (getAlgorithm() == rhs.getAlgorithm()) + && + + (getFftMaxUnitCellA() == rhs.getFftMaxUnitCellA()) + && + + (getFftMinUnitCellA() == rhs.getFftMinUnitCellA()) + && + + (getFftHighResolutionA() == rhs.getFftHighResolutionA()) + && + + (getFftNumVectors() == rhs.getFftNumVectors()) + && + + (getTolerance() == rhs.getTolerance()) + + + ; +} + +bool Indexing_settings::operator!=(const Indexing_settings& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Indexing_settings& o) +{ + j = nlohmann::json::object(); + j["algorithm"] = o.m_Algorithm; + j["fft_max_unit_cell_A"] = o.m_Fft_max_unit_cell_A; + j["fft_min_unit_cell_A"] = o.m_Fft_min_unit_cell_A; + j["fft_high_resolution_A"] = o.m_Fft_high_resolution_A; + j["fft_num_vectors"] = o.m_Fft_num_vectors; + j["tolerance"] = o.m_Tolerance; + +} + +void from_json(const nlohmann::json& j, Indexing_settings& o) +{ + j.at("algorithm").get_to(o.m_Algorithm); + j.at("fft_max_unit_cell_A").get_to(o.m_Fft_max_unit_cell_A); + j.at("fft_min_unit_cell_A").get_to(o.m_Fft_min_unit_cell_A); + j.at("fft_high_resolution_A").get_to(o.m_Fft_high_resolution_A); + j.at("fft_num_vectors").get_to(o.m_Fft_num_vectors); + j.at("tolerance").get_to(o.m_Tolerance); + +} + +org::openapitools::server::model::Indexing_algorithm Indexing_settings::getAlgorithm() const +{ + return m_Algorithm; +} +void Indexing_settings::setAlgorithm(org::openapitools::server::model::Indexing_algorithm const& value) +{ + m_Algorithm = value; +} +float Indexing_settings::getFftMaxUnitCellA() const +{ + return m_Fft_max_unit_cell_A; +} +void Indexing_settings::setFftMaxUnitCellA(float const value) +{ + m_Fft_max_unit_cell_A = value; +} +float Indexing_settings::getFftMinUnitCellA() const +{ + return m_Fft_min_unit_cell_A; +} +void Indexing_settings::setFftMinUnitCellA(float const value) +{ + m_Fft_min_unit_cell_A = value; +} +float Indexing_settings::getFftHighResolutionA() const +{ + return m_Fft_high_resolution_A; +} +void Indexing_settings::setFftHighResolutionA(float const value) +{ + m_Fft_high_resolution_A = value; +} +int64_t Indexing_settings::getFftNumVectors() const +{ + return m_Fft_num_vectors; +} +void Indexing_settings::setFftNumVectors(int64_t const value) +{ + m_Fft_num_vectors = value; +} +float Indexing_settings::getTolerance() const +{ + return m_Tolerance; +} +void Indexing_settings::setTolerance(float const value) +{ + m_Tolerance = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Indexing_settings.h b/broker/gen/model/Indexing_settings.h new file mode 100644 index 00000000..0c057858 --- /dev/null +++ b/broker/gen/model/Indexing_settings.h @@ -0,0 +1,112 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Indexing_settings.h + * + * Settings for crystallography indexing + */ + +#ifndef Indexing_settings_H_ +#define Indexing_settings_H_ + + +#include "Indexing_algorithm.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// Settings for crystallography indexing +/// +class Indexing_settings +{ +public: + Indexing_settings(); + virtual ~Indexing_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 Indexing_settings& rhs) const; + bool operator!=(const Indexing_settings& rhs) const; + + ///////////////////////////////////////////// + /// Indexing_settings members + + /// + /// + /// + org::openapitools::server::model::Indexing_algorithm getAlgorithm() const; + void setAlgorithm(org::openapitools::server::model::Indexing_algorithm const& value); + /// + /// Largest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT + /// + float getFftMaxUnitCellA() const; + void setFftMaxUnitCellA(float const value); + /// + /// Smallest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT + /// + float getFftMinUnitCellA() const; + void setFftMinUnitCellA(float const value); + /// + /// Highest resolution of spots used for FFT algorithm; parameter value affects execution time of FFT. There is also correlation between smallest unit cell and max resolution, which need to be checked for very small systems. + /// + float getFftHighResolutionA() const; + void setFftHighResolutionA(float const value); + /// + /// Number of search directions for the FFT algorithm; parameter value affects execution time of FFT. + /// + int64_t getFftNumVectors() const; + void setFftNumVectors(int64_t const value); + /// + /// Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted + /// + float getTolerance() const; + void setTolerance(float const value); + + friend void to_json(nlohmann::json& j, const Indexing_settings& o); + friend void from_json(const nlohmann::json& j, Indexing_settings& o); +protected: + org::openapitools::server::model::Indexing_algorithm m_Algorithm; + + float m_Fft_max_unit_cell_A; + + float m_Fft_min_unit_cell_A; + + float m_Fft_high_resolution_A; + + int64_t m_Fft_num_vectors; + + float m_Tolerance; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Indexing_settings_H_ */ diff --git a/broker/gen/model/Instrument_metadata.cpp b/broker/gen/model/Instrument_metadata.cpp index a033574e..a4ebaeea 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Instrument_metadata.h b/broker/gen/model/Instrument_metadata.h index c787f733..2ff2afe9 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Jfjoch_settings.cpp b/broker/gen/model/Jfjoch_settings.cpp index a49002d8..0525b496 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,6 +25,7 @@ Jfjoch_settings::Jfjoch_settings() m_ZeromqIsSet = false; m_InstrumentIsSet = false; m_File_writerIsSet = false; + m_IndexingIsSet = false; m_Detector_settingsIsSet = false; m_Azim_intIsSet = false; m_Image_formatIsSet = false; @@ -102,7 +103,7 @@ bool Jfjoch_settings::validate(std::stringstream& msg, const std::string& pathPr } } - + if (imageBufferMiBIsSet()) { const int32_t& value = m_Image_buffer_MiB; @@ -181,6 +182,9 @@ bool Jfjoch_settings::operator==(const Jfjoch_settings& rhs) const && + ((!indexingIsSet() && !rhs.indexingIsSet()) || (indexingIsSet() && rhs.indexingIsSet() && getIndexing() == rhs.getIndexing())) && + + ((!detectorSettingsIsSet() && !rhs.detectorSettingsIsSet()) || (detectorSettingsIsSet() && rhs.detectorSettingsIsSet() && getDetectorSettings() == rhs.getDetectorSettings())) && @@ -233,6 +237,8 @@ void to_json(nlohmann::json& j, const Jfjoch_settings& o) if(o.fileWriterIsSet()) j["file_writer"] = o.m_File_writer; j["detector"] = o.m_Detector; + if(o.indexingIsSet()) + j["indexing"] = o.m_Indexing; if(o.detectorSettingsIsSet()) j["detector_settings"] = o.m_Detector_settings; if(o.azimIntIsSet()) @@ -279,6 +285,11 @@ void from_json(const nlohmann::json& j, Jfjoch_settings& o) o.m_File_writerIsSet = true; } j.at("detector").get_to(o.m_Detector); + if(j.find("indexing") != j.end()) + { + j.at("indexing").get_to(o.m_Indexing); + o.m_IndexingIsSet = true; + } if(j.find("detector_settings") != j.end()) { j.at("detector_settings").get_to(o.m_Detector_settings); @@ -405,6 +416,23 @@ void Jfjoch_settings::setDetector(std::vector +#include "Indexing_settings.h" #include "Detector.h" #include "Image_pusher_type.h" #include "Zeromq_settings.h" @@ -106,6 +107,13 @@ public: /// /// /// + org::openapitools::server::model::Indexing_settings getIndexing() const; + void setIndexing(org::openapitools::server::model::Indexing_settings const& value); + bool indexingIsSet() const; + void unsetIndexing(); + /// + /// + /// org::openapitools::server::model::Detector_settings getDetectorSettings() const; void setDetectorSettings(org::openapitools::server::model::Detector_settings const& value); bool detectorSettingsIsSet() const; @@ -190,6 +198,8 @@ protected: bool m_File_writerIsSet; std::vector m_Detector; + org::openapitools::server::model::Indexing_settings m_Indexing; + bool m_IndexingIsSet; org::openapitools::server::model::Detector_settings m_Detector_settings; bool m_Detector_settingsIsSet; org::openapitools::server::model::Azim_int_settings m_Azim_int; diff --git a/broker/gen/model/Jfjoch_statistics.cpp b/broker/gen/model/Jfjoch_statistics.cpp index d72938a8..d20efd11 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -38,6 +38,7 @@ Jfjoch_statistics::Jfjoch_statistics() m_RoiIsSet = false; m_Az_intIsSet = false; m_BufferIsSet = false; + m_IndexingIsSet = false; } @@ -102,7 +103,7 @@ bool Jfjoch_statistics::validate(std::stringstream& msg, const std::string& path } } - + return success; } @@ -160,7 +161,10 @@ bool Jfjoch_statistics::operator==(const Jfjoch_statistics& rhs) const ((!azIntIsSet() && !rhs.azIntIsSet()) || (azIntIsSet() && rhs.azIntIsSet() && getAzInt() == rhs.getAzInt())) && - ((!bufferIsSet() && !rhs.bufferIsSet()) || (bufferIsSet() && rhs.bufferIsSet() && getBuffer() == rhs.getBuffer())) + ((!bufferIsSet() && !rhs.bufferIsSet()) || (bufferIsSet() && rhs.bufferIsSet() && getBuffer() == rhs.getBuffer())) && + + + ((!indexingIsSet() && !rhs.indexingIsSet()) || (indexingIsSet() && rhs.indexingIsSet() && getIndexing() == rhs.getIndexing())) ; } @@ -207,6 +211,8 @@ void to_json(nlohmann::json& j, const Jfjoch_statistics& o) j["az_int"] = o.m_Az_int; if(o.bufferIsSet()) j["buffer"] = o.m_Buffer; + if(o.indexingIsSet()) + j["indexing"] = o.m_Indexing; } @@ -297,6 +303,11 @@ void from_json(const nlohmann::json& j, Jfjoch_statistics& o) j.at("buffer").get_to(o.m_Buffer); o.m_BufferIsSet = true; } + if(j.find("indexing") != j.end()) + { + j.at("indexing").get_to(o.m_Indexing); + o.m_IndexingIsSet = true; + } } @@ -589,6 +600,23 @@ void Jfjoch_statistics::unsetBuffer() { m_BufferIsSet = false; } +org::openapitools::server::model::Indexing_settings Jfjoch_statistics::getIndexing() const +{ + return m_Indexing; +} +void Jfjoch_statistics::setIndexing(org::openapitools::server::model::Indexing_settings const& value) +{ + m_Indexing = value; + m_IndexingIsSet = true; +} +bool Jfjoch_statistics::indexingIsSet() const +{ + return m_IndexingIsSet; +} +void Jfjoch_statistics::unsetIndexing() +{ + m_IndexingIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Jfjoch_statistics.h b/broker/gen/model/Jfjoch_statistics.h index 71c0d6f7..8f35ca1e 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,6 +32,7 @@ #include "Zeromq_metadata_settings.h" #include "Detector_settings.h" #include +#include "Indexing_settings.h" #include "Detector_status.h" #include "Roi_definitions.h" #include "Fpga_status_inner.h" @@ -194,6 +195,13 @@ public: void setBuffer(org::openapitools::server::model::Image_buffer_status const& value); bool bufferIsSet() const; void unsetBuffer(); + /// + /// + /// + org::openapitools::server::model::Indexing_settings getIndexing() const; + void setIndexing(org::openapitools::server::model::Indexing_settings const& value); + bool indexingIsSet() const; + void unsetIndexing(); friend void to_json(nlohmann::json& j, const Jfjoch_statistics& o); friend void from_json(const nlohmann::json& j, Jfjoch_statistics& o); @@ -232,6 +240,8 @@ protected: bool m_Az_intIsSet; org::openapitools::server::model::Image_buffer_status m_Buffer; bool m_BufferIsSet; + org::openapitools::server::model::Indexing_settings m_Indexing; + bool m_IndexingIsSet; }; diff --git a/broker/gen/model/Measurement_statistics.cpp b/broker/gen/model/Measurement_statistics.cpp index 6758452f..239a6db7 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Measurement_statistics.h b/broker/gen/model/Measurement_statistics.h index 34caf8f5..6efee7cd 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pcie_devices_inner.cpp b/broker/gen/model/Pcie_devices_inner.cpp index 866be6a7..28dd62e4 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pcie_devices_inner.h b/broker/gen/model/Pcie_devices_inner.h index e32ced71..721d2849 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pixel_mask_statistics.cpp b/broker/gen/model/Pixel_mask_statistics.cpp index f9afcec5..d8c8e7a8 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Pixel_mask_statistics.h b/broker/gen/model/Pixel_mask_statistics.h index d9fc323d..76cf85fa 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Plot.cpp b/broker/gen/model/Plot.cpp index f7c10d0c..9a071fca 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +22,7 @@ namespace org::openapitools::server::model Plot::Plot() { m_Title = ""; + m_zIsSet = false; } @@ -81,6 +82,27 @@ bool Plot::validate(std::stringstream& msg, const std::string& pathPrefix) const + i++; + } + } + + } + + if (ZIsSet()) + { + const std::vector& value = m_z; + const std::string currentValuePath = _pathPrefix + ".Z"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const float& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + i++; } } @@ -102,8 +124,11 @@ bool Plot::operator==(const Plot& rhs) const && (getY() == rhs.getY()) + && + ((!ZIsSet() && !rhs.ZIsSet()) || (ZIsSet() && rhs.ZIsSet() && getZ() == rhs.getZ())) + ; } @@ -118,6 +143,8 @@ void to_json(nlohmann::json& j, const Plot& o) j["title"] = o.m_Title; j["x"] = o.m_x; j["y"] = o.m_y; + if(o.ZIsSet() || !o.m_z.empty()) + j["z"] = o.m_z; } @@ -126,6 +153,11 @@ void from_json(const nlohmann::json& j, Plot& o) j.at("title").get_to(o.m_Title); j.at("x").get_to(o.m_x); j.at("y").get_to(o.m_y); + if(j.find("z") != j.end()) + { + j.at("z").get_to(o.m_z); + o.m_zIsSet = true; + } } @@ -153,6 +185,23 @@ void Plot::setY(std::vector const value) { m_y = value; } +std::vector Plot::getZ() const +{ + return m_z; +} +void Plot::setZ(std::vector const value) +{ + m_z = value; + m_zIsSet = true; +} +bool Plot::ZIsSet() const +{ + return m_zIsSet; +} +void Plot::unsetz() +{ + m_zIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Plot.h b/broker/gen/model/Plot.h index 579434d1..8343995b 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -74,6 +74,13 @@ public: /// std::vector getY() const; void setY(std::vector const value); + /// + /// + /// + std::vector getZ() const; + void setZ(std::vector const value); + bool ZIsSet() const; + void unsetz(); friend void to_json(nlohmann::json& j, const Plot& o); friend void from_json(const nlohmann::json& j, Plot& o); @@ -84,6 +91,8 @@ protected: std::vector m_y; + std::vector m_z; + bool m_zIsSet; }; diff --git a/broker/gen/model/Plot_type_enum.cpp b/broker/gen/model/Plot_type_enum.cpp new file mode 100644 index 00000000..c9b2f018 --- /dev/null +++ b/broker/gen/model/Plot_type_enum.cpp @@ -0,0 +1,224 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Plot_type_enum.h" +#include "Helpers.h" +#include +#include + +namespace org::openapitools::server::model +{ + +Plot_type_enum::Plot_type_enum() +{ + +} + +void Plot_type_enum::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Plot_type_enum::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Plot_type_enum::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Plot_type_enum" : pathPrefix; + + + if (m_value == Plot_type_enum::ePlot_type_enum::INVALID_VALUE_OPENAPI_GENERATED) + { + success = false; + msg << _pathPrefix << ": has no value;"; + } + + return success; +} + +bool Plot_type_enum::operator==(const Plot_type_enum& rhs) const +{ + return + getValue() == rhs.getValue() + + ; +} + +bool Plot_type_enum::operator!=(const Plot_type_enum& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Plot_type_enum& o) +{ + j = nlohmann::json::object(); + + switch (o.getValue()) + { + case Plot_type_enum::ePlot_type_enum::INVALID_VALUE_OPENAPI_GENERATED: + j = "INVALID_VALUE_OPENAPI_GENERATED"; + break; + case Plot_type_enum::ePlot_type_enum::BKG_ESTIMATE: + j = "bkg_estimate"; + break; + case Plot_type_enum::ePlot_type_enum::AZINT: + j = "azint"; + break; + case Plot_type_enum::ePlot_type_enum::SPOT_COUNT: + j = "spot_count"; + break; + case Plot_type_enum::ePlot_type_enum::INDEXING_RATE: + j = "indexing_rate"; + break; + case Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_LENGTH: + j = "indexing_unit_cell_length"; + break; + case Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_ANGLE: + j = "indexing_unit_cell_angle"; + break; + case Plot_type_enum::ePlot_type_enum::ERROR_PIXELS: + j = "error_pixels"; + break; + case Plot_type_enum::ePlot_type_enum::IMAGE_COLLECTION_EFFICIENCY: + j = "image_collection_efficiency"; + break; + case Plot_type_enum::ePlot_type_enum::RECEIVER_DELAY: + j = "receiver_delay"; + break; + case Plot_type_enum::ePlot_type_enum::RECEIVER_FREE_SEND_BUF: + j = "receiver_free_send_buf"; + break; + case Plot_type_enum::ePlot_type_enum::STRONG_PIXELS: + j = "strong_pixels"; + break; + case Plot_type_enum::ePlot_type_enum::ROI_SUM: + j = "roi_sum"; + break; + case Plot_type_enum::ePlot_type_enum::ROI_MEAN: + j = "roi_mean"; + break; + case Plot_type_enum::ePlot_type_enum::ROI_MAX_COUNT: + j = "roi_max_count"; + break; + case Plot_type_enum::ePlot_type_enum::ROI_PIXELS: + j = "roi_pixels"; + break; + case Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_X: + j = "roi_weighted_x"; + break; + case Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_Y: + j = "roi_weighted_y"; + break; + case Plot_type_enum::ePlot_type_enum::PACKETS_RECEIVED: + j = "packets_received"; + break; + case Plot_type_enum::ePlot_type_enum::MAX_PIXEL_VALUE: + j = "max_pixel_value"; + break; + case Plot_type_enum::ePlot_type_enum::RESOLUTION_ESTIMATE: + j = "resolution_estimate"; + break; + } +} + +void from_json(const nlohmann::json& j, Plot_type_enum& o) +{ + + auto s = j.get(); + if (s == "bkg_estimate") { + o.setValue(Plot_type_enum::ePlot_type_enum::BKG_ESTIMATE); + } + else if (s == "azint") { + o.setValue(Plot_type_enum::ePlot_type_enum::AZINT); + } + else if (s == "spot_count") { + o.setValue(Plot_type_enum::ePlot_type_enum::SPOT_COUNT); + } + else if (s == "indexing_rate") { + o.setValue(Plot_type_enum::ePlot_type_enum::INDEXING_RATE); + } + else if (s == "indexing_unit_cell_length") { + o.setValue(Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_LENGTH); + } + else if (s == "indexing_unit_cell_angle") { + o.setValue(Plot_type_enum::ePlot_type_enum::INDEXING_UNIT_CELL_ANGLE); + } + else if (s == "error_pixels") { + o.setValue(Plot_type_enum::ePlot_type_enum::ERROR_PIXELS); + } + else if (s == "image_collection_efficiency") { + o.setValue(Plot_type_enum::ePlot_type_enum::IMAGE_COLLECTION_EFFICIENCY); + } + else if (s == "receiver_delay") { + o.setValue(Plot_type_enum::ePlot_type_enum::RECEIVER_DELAY); + } + else if (s == "receiver_free_send_buf") { + o.setValue(Plot_type_enum::ePlot_type_enum::RECEIVER_FREE_SEND_BUF); + } + else if (s == "strong_pixels") { + o.setValue(Plot_type_enum::ePlot_type_enum::STRONG_PIXELS); + } + else if (s == "roi_sum") { + o.setValue(Plot_type_enum::ePlot_type_enum::ROI_SUM); + } + else if (s == "roi_mean") { + o.setValue(Plot_type_enum::ePlot_type_enum::ROI_MEAN); + } + else if (s == "roi_max_count") { + o.setValue(Plot_type_enum::ePlot_type_enum::ROI_MAX_COUNT); + } + else if (s == "roi_pixels") { + o.setValue(Plot_type_enum::ePlot_type_enum::ROI_PIXELS); + } + else if (s == "roi_weighted_x") { + o.setValue(Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_X); + } + else if (s == "roi_weighted_y") { + o.setValue(Plot_type_enum::ePlot_type_enum::ROI_WEIGHTED_Y); + } + else if (s == "packets_received") { + o.setValue(Plot_type_enum::ePlot_type_enum::PACKETS_RECEIVED); + } + else if (s == "max_pixel_value") { + o.setValue(Plot_type_enum::ePlot_type_enum::MAX_PIXEL_VALUE); + } + else if (s == "resolution_estimate") { + o.setValue(Plot_type_enum::ePlot_type_enum::RESOLUTION_ESTIMATE); + } else { + std::stringstream ss; + ss << "Unexpected value " << s << " in json" + << " cannot be converted to enum of type" + << " Plot_type_enum::ePlot_type_enum"; + throw std::invalid_argument(ss.str()); + } + +} + +Plot_type_enum::ePlot_type_enum Plot_type_enum::getValue() const +{ + return m_value; +} +void Plot_type_enum::setValue(Plot_type_enum::ePlot_type_enum value) +{ + m_value = value; +} + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Plot_type_enum.h b/broker/gen/model/Plot_type_enum.h new file mode 100644 index 00000000..93bf683e --- /dev/null +++ b/broker/gen/model/Plot_type_enum.h @@ -0,0 +1,97 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Plot_type_enum.h + * + * + */ + +#ifndef Plot_type_enum_H_ +#define Plot_type_enum_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class Plot_type_enum +{ +public: + Plot_type_enum(); + virtual ~Plot_type_enum() = default; + + enum class ePlot_type_enum { + // To have a valid default value. + // Avoiding name clashes with user defined + // enum values + INVALID_VALUE_OPENAPI_GENERATED = 0, + BKG_ESTIMATE, + AZINT, + SPOT_COUNT, + INDEXING_RATE, + INDEXING_UNIT_CELL_LENGTH, + INDEXING_UNIT_CELL_ANGLE, + ERROR_PIXELS, + IMAGE_COLLECTION_EFFICIENCY, + RECEIVER_DELAY, + RECEIVER_FREE_SEND_BUF, + STRONG_PIXELS, + ROI_SUM, + ROI_MEAN, + ROI_MAX_COUNT, + ROI_PIXELS, + ROI_WEIGHTED_X, + ROI_WEIGHTED_Y, + PACKETS_RECEIVED, + MAX_PIXEL_VALUE, + RESOLUTION_ESTIMATE + }; + + /// + /// 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 Plot_type_enum& rhs) const; + bool operator!=(const Plot_type_enum& rhs) const; + + ///////////////////////////////////////////// + /// Plot_type_enum members + + Plot_type_enum::ePlot_type_enum getValue() const; + void setValue(Plot_type_enum::ePlot_type_enum value); + + friend void to_json(nlohmann::json& j, const Plot_type_enum& o); + friend void from_json(const nlohmann::json& j, Plot_type_enum& o); +protected: + Plot_type_enum::ePlot_type_enum m_value = Plot_type_enum::ePlot_type_enum::INVALID_VALUE_OPENAPI_GENERATED; +}; + +} // namespace org::openapitools::server::model + +#endif /* Plot_type_enum_H_ */ diff --git a/broker/gen/model/Plot_unit_x.cpp b/broker/gen/model/Plot_unit_x.cpp new file mode 100644 index 00000000..6fccc6ad --- /dev/null +++ b/broker/gen/model/Plot_unit_x.cpp @@ -0,0 +1,134 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Plot_unit_x.h" +#include "Helpers.h" +#include +#include + +namespace org::openapitools::server::model +{ + +Plot_unit_x::Plot_unit_x() +{ + +} + +void Plot_unit_x::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Plot_unit_x::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Plot_unit_x::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Plot_unit_x" : pathPrefix; + + + if (m_value == Plot_unit_x::ePlot_unit_x::INVALID_VALUE_OPENAPI_GENERATED) + { + success = false; + msg << _pathPrefix << ": has no value;"; + } + + return success; +} + +bool Plot_unit_x::operator==(const Plot_unit_x& rhs) const +{ + return + getValue() == rhs.getValue() + + ; +} + +bool Plot_unit_x::operator!=(const Plot_unit_x& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Plot_unit_x& o) +{ + j = nlohmann::json::object(); + + switch (o.getValue()) + { + case Plot_unit_x::ePlot_unit_x::INVALID_VALUE_OPENAPI_GENERATED: + j = "INVALID_VALUE_OPENAPI_GENERATED"; + break; + case Plot_unit_x::ePlot_unit_x::IMAGE_NUMBER: + j = "image_number"; + break; + case Plot_unit_x::ePlot_unit_x::Q_RECIPA: + j = "q_recipA"; + break; + case Plot_unit_x::ePlot_unit_x::ANGLE_DEG: + j = "angle_deg"; + break; + case Plot_unit_x::ePlot_unit_x::ADU: + j = "ADU"; + break; + case Plot_unit_x::ePlot_unit_x::GRID_UM: + j = "grid_um"; + break; + } +} + +void from_json(const nlohmann::json& j, Plot_unit_x& o) +{ + + auto s = j.get(); + if (s == "image_number") { + o.setValue(Plot_unit_x::ePlot_unit_x::IMAGE_NUMBER); + } + else if (s == "q_recipA") { + o.setValue(Plot_unit_x::ePlot_unit_x::Q_RECIPA); + } + else if (s == "angle_deg") { + o.setValue(Plot_unit_x::ePlot_unit_x::ANGLE_DEG); + } + else if (s == "ADU") { + o.setValue(Plot_unit_x::ePlot_unit_x::ADU); + } + else if (s == "grid_um") { + o.setValue(Plot_unit_x::ePlot_unit_x::GRID_UM); + } else { + std::stringstream ss; + ss << "Unexpected value " << s << " in json" + << " cannot be converted to enum of type" + << " Plot_unit_x::ePlot_unit_x"; + throw std::invalid_argument(ss.str()); + } + +} + +Plot_unit_x::ePlot_unit_x Plot_unit_x::getValue() const +{ + return m_value; +} +void Plot_unit_x::setValue(Plot_unit_x::ePlot_unit_x value) +{ + m_value = value; +} + +} // namespace org::openapitools::server::model + diff --git a/broker/gen/model/Plot_unit_x.h b/broker/gen/model/Plot_unit_x.h new file mode 100644 index 00000000..d6515b8d --- /dev/null +++ b/broker/gen/model/Plot_unit_x.h @@ -0,0 +1,82 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. +* +* The version of the OpenAPI document: 1.0.0-rc.40 +* Contact: filip.leonarski@psi.ch +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Plot_unit_x.h + * + * + */ + +#ifndef Plot_unit_x_H_ +#define Plot_unit_x_H_ + + +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class Plot_unit_x +{ +public: + Plot_unit_x(); + virtual ~Plot_unit_x() = default; + + enum class ePlot_unit_x { + // To have a valid default value. + // Avoiding name clashes with user defined + // enum values + INVALID_VALUE_OPENAPI_GENERATED = 0, + IMAGE_NUMBER, + Q_RECIPA, + ANGLE_DEG, + ADU, + GRID_UM + }; + + /// + /// 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 Plot_unit_x& rhs) const; + bool operator!=(const Plot_unit_x& rhs) const; + + ///////////////////////////////////////////// + /// Plot_unit_x members + + Plot_unit_x::ePlot_unit_x getValue() const; + void setValue(Plot_unit_x::ePlot_unit_x value); + + friend void to_json(nlohmann::json& j, const Plot_unit_x& o); + friend void from_json(const nlohmann::json& j, Plot_unit_x& o); +protected: + Plot_unit_x::ePlot_unit_x m_value = Plot_unit_x::ePlot_unit_x::INVALID_VALUE_OPENAPI_GENERATED; +}; + +} // namespace org::openapitools::server::model + +#endif /* Plot_unit_x_H_ */ diff --git a/broker/gen/model/Plots.cpp b/broker/gen/model/Plots.cpp index 9fc8ccd7..41dc71ee 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -23,6 +23,10 @@ Plots::Plots() { m_Title = ""; m_TitleIsSet = false; + m_Size_x = 0.0f; + m_Size_xIsSet = false; + m_Size_y = 0.0f; + m_Size_yIsSet = false; } @@ -45,7 +49,7 @@ bool Plots::validate(std::stringstream& msg, const std::string& pathPrefix) cons bool success = true; const std::string _pathPrefix = pathPrefix.empty() ? "Plots" : pathPrefix; - + /* Plot */ { const std::vector& value = m_Plot; @@ -78,6 +82,15 @@ bool Plots::operator==(const Plots& rhs) const ((!titleIsSet() && !rhs.titleIsSet()) || (titleIsSet() && rhs.titleIsSet() && getTitle() == rhs.getTitle())) && + (getUnitX() == rhs.getUnitX()) + && + + + ((!sizeXIsSet() && !rhs.sizeXIsSet()) || (sizeXIsSet() && rhs.sizeXIsSet() && getSizeX() == rhs.getSizeX())) && + + + ((!sizeYIsSet() && !rhs.sizeYIsSet()) || (sizeYIsSet() && rhs.sizeYIsSet() && getSizeY() == rhs.getSizeY())) && + (getPlot() == rhs.getPlot()) @@ -94,6 +107,11 @@ void to_json(nlohmann::json& j, const Plots& o) j = nlohmann::json::object(); if(o.titleIsSet()) j["title"] = o.m_Title; + j["unit_x"] = o.m_Unit_x; + if(o.sizeXIsSet()) + j["size_x"] = o.m_Size_x; + if(o.sizeYIsSet()) + j["size_y"] = o.m_Size_y; j["plot"] = o.m_Plot; } @@ -105,6 +123,17 @@ void from_json(const nlohmann::json& j, Plots& o) j.at("title").get_to(o.m_Title); o.m_TitleIsSet = true; } + j.at("unit_x").get_to(o.m_Unit_x); + if(j.find("size_x") != j.end()) + { + j.at("size_x").get_to(o.m_Size_x); + o.m_Size_xIsSet = true; + } + if(j.find("size_y") != j.end()) + { + j.at("size_y").get_to(o.m_Size_y); + o.m_Size_yIsSet = true; + } j.at("plot").get_to(o.m_Plot); } @@ -126,6 +155,48 @@ void Plots::unsetTitle() { m_TitleIsSet = false; } +org::openapitools::server::model::Plot_unit_x Plots::getUnitX() const +{ + return m_Unit_x; +} +void Plots::setUnitX(org::openapitools::server::model::Plot_unit_x const& value) +{ + m_Unit_x = value; +} +float Plots::getSizeX() const +{ + return m_Size_x; +} +void Plots::setSizeX(float const value) +{ + m_Size_x = value; + m_Size_xIsSet = true; +} +bool Plots::sizeXIsSet() const +{ + return m_Size_xIsSet; +} +void Plots::unsetSize_x() +{ + m_Size_xIsSet = false; +} +float Plots::getSizeY() const +{ + return m_Size_y; +} +void Plots::setSizeY(float const value) +{ + m_Size_y = value; + m_Size_yIsSet = true; +} +bool Plots::sizeYIsSet() const +{ + return m_Size_yIsSet; +} +void Plots::unsetSize_y() +{ + m_Size_yIsSet = false; +} std::vector Plots::getPlot() const { return m_Plot; diff --git a/broker/gen/model/Plots.h b/broker/gen/model/Plots.h index 647e01f3..2245add4 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -22,6 +22,7 @@ #include "Plot.h" #include #include +#include "Plot_unit_x.h" #include namespace org::openapitools::server::model @@ -70,6 +71,25 @@ public: /// /// /// + org::openapitools::server::model::Plot_unit_x getUnitX() const; + void setUnitX(org::openapitools::server::model::Plot_unit_x const& value); + /// + /// Max X range of the plot + /// + float getSizeX() const; + void setSizeX(float const value); + bool sizeXIsSet() const; + void unsetSize_x(); + /// + /// Max Y range of the plot + /// + float getSizeY() const; + void setSizeY(float const value); + bool sizeYIsSet() const; + void unsetSize_y(); + /// + /// + /// std::vector getPlot() const; void setPlot(std::vector const& value); @@ -78,6 +98,12 @@ public: protected: std::string m_Title; bool m_TitleIsSet; + org::openapitools::server::model::Plot_unit_x m_Unit_x; + + float m_Size_x; + bool m_Size_xIsSet; + float m_Size_y; + bool m_Size_yIsSet; std::vector m_Plot; diff --git a/broker/gen/model/Roi_azim_list.cpp b/broker/gen/model/Roi_azim_list.cpp index 72ba9155..eeb05f25 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_azim_list.h b/broker/gen/model/Roi_azim_list.h index 4c76574f..49d6ed9e 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_azimuthal.cpp b/broker/gen/model/Roi_azimuthal.cpp index 3a1b99e9..e06f833c 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_azimuthal.h b/broker/gen/model/Roi_azimuthal.h index 7637875e..b5092ed1 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box.cpp b/broker/gen/model/Roi_box.cpp index 49fd05ed..8d8e1eb1 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box.h b/broker/gen/model/Roi_box.h index 6361f5b5..e3aa8eda 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box_list.cpp b/broker/gen/model/Roi_box_list.cpp index 760fe942..8dc489f6 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_box_list.h b/broker/gen/model/Roi_box_list.h index b08ecb7a..3668f57d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle.cpp b/broker/gen/model/Roi_circle.cpp index 83202a6b..d13cb8ac 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle.h b/broker/gen/model/Roi_circle.h index 4c8d6bb8..fc0ae714 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle_list.cpp b/broker/gen/model/Roi_circle_list.cpp index be81d474..355f8f54 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_circle_list.h b/broker/gen/model/Roi_circle_list.h index 965aa278..1f217ff7 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_definitions.cpp b/broker/gen/model/Roi_definitions.cpp index 01dfca16..d64621a2 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Roi_definitions.h b/broker/gen/model/Roi_definitions.h index ba0a9747..46613423 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Rotation_axis.cpp b/broker/gen/model/Rotation_axis.cpp index 8d8157e7..00529d3d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,6 +26,7 @@ Rotation_axis::Rotation_axis() m_Step = 0.0f; m_Start = 0.0f; m_StartIsSet = false; + m_Helical_step_umIsSet = false; } @@ -88,6 +89,37 @@ bool Rotation_axis::validate(std::stringstream& msg, const std::string& pathPref + i++; + } + } + + } + + if (helicalStepUmIsSet()) + { + const std::vector& value = m_Helical_step_um; + const std::string currentValuePath = _pathPrefix + ".helicalStepUm"; + + + if (value.size() < 3) + { + success = false; + msg << currentValuePath << ": must have at least 3 elements;"; + } + if (value.size() > 3) + { + success = false; + msg << currentValuePath << ": must have at most 3 elements;"; + } + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const float& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + i++; } } @@ -112,8 +144,11 @@ bool Rotation_axis::operator==(const Rotation_axis& rhs) const ((!startIsSet() && !rhs.startIsSet()) || (startIsSet() && rhs.startIsSet() && getStart() == rhs.getStart())) && (getVector() == rhs.getVector()) + && + ((!helicalStepUmIsSet() && !rhs.helicalStepUmIsSet()) || (helicalStepUmIsSet() && rhs.helicalStepUmIsSet() && getHelicalStepUm() == rhs.getHelicalStepUm())) + ; } @@ -131,6 +166,8 @@ void to_json(nlohmann::json& j, const Rotation_axis& o) if(o.startIsSet()) j["start"] = o.m_Start; j["vector"] = o.m_Vector; + if(o.helicalStepUmIsSet() || !o.m_Helical_step_um.empty()) + j["helical_step_um"] = o.m_Helical_step_um; } @@ -148,6 +185,11 @@ void from_json(const nlohmann::json& j, Rotation_axis& o) o.m_StartIsSet = true; } j.at("vector").get_to(o.m_Vector); + if(j.find("helical_step_um") != j.end()) + { + j.at("helical_step_um").get_to(o.m_Helical_step_um); + o.m_Helical_step_umIsSet = true; + } } @@ -201,6 +243,23 @@ void Rotation_axis::setVector(std::vector const value) { m_Vector = value; } +std::vector Rotation_axis::getHelicalStepUm() const +{ + return m_Helical_step_um; +} +void Rotation_axis::setHelicalStepUm(std::vector const value) +{ + m_Helical_step_um = value; + m_Helical_step_umIsSet = true; +} +bool Rotation_axis::helicalStepUmIsSet() const +{ + return m_Helical_step_umIsSet; +} +void Rotation_axis::unsetHelical_step_um() +{ + m_Helical_step_umIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Rotation_axis.h b/broker/gen/model/Rotation_axis.h index 8dc4dfa2..5fba6f6d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -67,7 +67,7 @@ public: bool nameIsSet() const; void unsetName(); /// - /// Angle step in degrees + /// Angle step (per image) in degrees /// float getStep() const; void setStep(float const value); @@ -83,6 +83,13 @@ public: /// std::vector getVector() const; void setVector(std::vector const value); + /// + /// Translation (per image) for helical scan + /// + std::vector getHelicalStepUm() const; + void setHelicalStepUm(std::vector const value); + bool helicalStepUmIsSet() const; + void unsetHelical_step_um(); friend void to_json(nlohmann::json& j, const Rotation_axis& o); friend void from_json(const nlohmann::json& j, Rotation_axis& o); @@ -95,6 +102,8 @@ protected: bool m_StartIsSet; std::vector m_Vector; + std::vector m_Helical_step_um; + bool m_Helical_step_umIsSet; }; diff --git a/broker/gen/model/Spot_finding_settings.cpp b/broker/gen/model/Spot_finding_settings.cpp index 58f80366..aeae689b 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -33,9 +33,9 @@ Spot_finding_settings::Spot_finding_settings() m_Max_pix_per_spot = 0L; 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; + m_Quick_integration = false; } @@ -128,26 +128,7 @@ bool Spot_finding_settings::validate(std::stringstream& msg, const std::string& } } - - - /* Indexing_tolerance */ { - const float& value = m_Indexing_tolerance; - const std::string currentValuePath = _pathPrefix + ".indexingTolerance"; - - - if (value < static_cast(0.0)) - { - success = false; - msg << currentValuePath << ": must be greater than or equal to 0.0;"; - } - if (value > static_cast(1.0)) - { - success = false; - msg << currentValuePath << ": must be less than or equal to 1.0;"; - } - - } - + return success; } @@ -186,11 +167,11 @@ bool Spot_finding_settings::operator==(const Spot_finding_settings& rhs) const (getLowResolutionLimit() == rhs.getLowResolutionLimit()) && - (getIndexingTolerance() == rhs.getIndexingTolerance()) - && + ((!resolutionEstimateIsSet() && !rhs.resolutionEstimateIsSet()) || (resolutionEstimateIsSet() && rhs.resolutionEstimateIsSet() && isResolutionEstimate() == rhs.isResolutionEstimate())) && + + (isQuickIntegration() == rhs.isQuickIntegration()) - ((!resolutionEstimateIsSet() && !rhs.resolutionEstimateIsSet()) || (resolutionEstimateIsSet() && rhs.resolutionEstimateIsSet() && isResolutionEstimate() == rhs.isResolutionEstimate())) ; } @@ -215,9 +196,9 @@ void to_json(nlohmann::json& j, const Spot_finding_settings& o) j["max_pix_per_spot"] = o.m_Max_pix_per_spot; 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; + j["quick_integration"] = o.m_Quick_integration; } @@ -241,12 +222,12 @@ void from_json(const nlohmann::json& j, Spot_finding_settings& o) j.at("max_pix_per_spot").get_to(o.m_Max_pix_per_spot); 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; } + j.at("quick_integration").get_to(o.m_Quick_integration); } @@ -348,14 +329,6 @@ void Spot_finding_settings::setLowResolutionLimit(float const value) { m_Low_resolution_limit = value; } -float Spot_finding_settings::getIndexingTolerance() const -{ - return m_Indexing_tolerance; -} -void Spot_finding_settings::setIndexingTolerance(float const value) -{ - m_Indexing_tolerance = value; -} bool Spot_finding_settings::isResolutionEstimate() const { return m_Resolution_estimate; @@ -373,6 +346,14 @@ void Spot_finding_settings::unsetResolution_estimate() { m_Resolution_estimateIsSet = false; } +bool Spot_finding_settings::isQuickIntegration() const +{ + return m_Quick_integration; +} +void Spot_finding_settings::setQuickIntegration(bool const value) +{ + m_Quick_integration = value; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Spot_finding_settings.h b/broker/gen/model/Spot_finding_settings.h index e27c22d6..ea36f645 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -112,17 +112,17 @@ public: float getLowResolutionLimit() const; void setLowResolutionLimit(float const value); /// - /// Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted - /// - 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. + /// 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. If enabled it will likely reduce performance of Jungfraujoch to below 100 Hz. (experimental feature) /// bool isResolutionEstimate() const; void setResolutionEstimate(bool const value); bool resolutionEstimateIsSet() const; void unsetResolution_estimate(); + /// + /// Quick integration of collected diffraction images. If enabled it will likely reduce performance of Jungfraujoch for datasets with a very high indexing rate. (experimental feature) + /// + bool isQuickIntegration() const; + void setQuickIntegration(bool const value); friend void to_json(nlohmann::json& j, const Spot_finding_settings& o); friend void from_json(const nlohmann::json& j, Spot_finding_settings& o); @@ -147,10 +147,10 @@ protected: float m_Low_resolution_limit; - float m_Indexing_tolerance; - bool m_Resolution_estimate; bool m_Resolution_estimateIsSet; + bool m_Quick_integration; + }; diff --git a/broker/gen/model/Standard_detector_geometry.cpp b/broker/gen/model/Standard_detector_geometry.cpp index b83034f3..539d2dd4 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Standard_detector_geometry.h b/broker/gen/model/Standard_detector_geometry.h index be6b56f1..b11ea0b4 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_metadata_settings.cpp b/broker/gen/model/Zeromq_metadata_settings.cpp index ee1b4323..3f66eb86 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_metadata_settings.h b/broker/gen/model/Zeromq_metadata_settings.h index e5f7085c..544ab631 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_preview_settings.cpp b/broker/gen/model/Zeromq_preview_settings.cpp index 120aac37..849d19ea 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_preview_settings.h b/broker/gen/model/Zeromq_preview_settings.h index f27c53f9..fb5de5c9 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_settings.cpp b/broker/gen/model/Zeromq_settings.cpp index 9830b6af..ac7c154d 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/gen/model/Zeromq_settings.h b/broker/gen/model/Zeromq_settings.h index fbbeb33a..c7a922c3 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.39 +* The version of the OpenAPI document: 1.0.0-rc.40 * Contact: filip.leonarski@psi.ch * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 1dc57744..b57d8581 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.39 + version: 1.0.0-rc.40 contact: name: Filip Leonarski (Paul Scherrer Institute) email: filip.leonarski@psi.ch @@ -30,8 +30,67 @@ components: required: false schema: type: boolean - default: true + default: false description: Enable DEFLATE compression of output data. + experimental_coord: + in: query + name: experimental_coord + required: false + schema: + type: boolean + default: false + description: | + If measurement has goniometer axis defined, plot X-axis will represent rotation angle + If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value + For still measurement the number is ignored + fill_value: + in: query + name: fill + required: false + schema: + type: number + format: float + default: -1.0 + description: | + Fill value for grid scan elements that were not yet measured + plot_type: + in: query + name: type + required: true + description: Type of requested plot + schema: + type: string + enum: + - bkg_estimate + - azint + - spot_count + - indexing_rate + - indexing_time + - indexing_unit_cell_length + - indexing_unit_cell_angle + - error_pixels + - saturated_pixels + - image_collection_efficiency + - receiver_delay + - receiver_free_send_buf + - strong_pixels + - roi_sum + - roi_mean + - roi_max_count + - roi_pixels + - roi_weighted_x + - roi_weighted_y + - packets_received + - max_pixel_value + - resolution_estimate + roi: + in: query + name: roi + required: false + schema: + type: string + minLength: 1 + description: Name of ROI for which plot is requested image_id: in: query name: id @@ -46,11 +105,22 @@ components: in: query name: saturation schema: - type: integer - format: int64 - minimum: 0 - maximum: 65535 + type: number + format: float + default: 10 + minimum: -32767 + maximum: 32767 description: "Saturation value to set contrast in the preview image" + background: + in: query + name: background + schema: + type: number + format: float + default: 0 + minimum: -32767 + maximum: 32767 + description: "Background value to set contrast in the preview image" show_spots: in: query name: show_spots @@ -105,6 +175,47 @@ components: - "heat" default: "indigo" schemas: + grid_scan: + description: Definition of a grid scan (mutually exclusive with `rotation_axis`) + type: object + required: + - n_fast + - step_x_um + - step_y_um + properties: + n_fast: + type: integer + format: int64 + minimum: 1 + example: 20 + description: Number of elements in the fast direction + step_x_um: + type: number + format: float + example: 5.0 + description: | + Step in grid along the fast direction. Can be negative. + Positive number: left to right + Negative number: right to left + step_y_um: + type: number + format: float + example: -3.0 + description: | + Step in grid along the slow direction. Can be negative. + Positive number: top to bottom + Negative number: bottom to top + vertical: + type: boolean + default: false + description: | + If disabled: fast direction = X, slow direction = Y + If enabled: fast direction = Y, slow direction = X + snake: + type: boolean + default: false + description: | + Flip fast direction for every second row rotation_axis: description: Definition of a crystal rotation axis type: object @@ -121,7 +232,7 @@ components: type: number format: float example: 0.1 - description: Angle step in degrees + description: Angle step (per image) in degrees start: type: number format: float @@ -137,6 +248,24 @@ components: format: float minItems: 3 maxItems: 3 + helical_step_um: + type: array + description: Translation (per image) for helical scan + example: [ -5, -2, 0 ] + items: + type: number + format: float + minItems: 3 + maxItems: 3 + indexing_algorithm: + type: string + description: | + Selection of an indexing algorithm used by Jungfraujoch + enum: + - "FFBIDX" + - "FFT" + - "None" + default: "FFBIDX" dataset_settings: type: object required: @@ -248,6 +377,8 @@ components: Transmission of attenuator (filter) [no units] goniometer: $ref: "#/components/schemas/rotation_axis" + grid_scan: + $ref: "#/components/schemas/grid_scan" header_appendix: description: | Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON) @@ -663,8 +794,8 @@ components: - min_pix_per_spot - high_resolution_limit - low_resolution_limit - - indexing_tolerance - resolution_estimation + - quick_integration properties: enable: type: boolean @@ -708,18 +839,21 @@ components: low_resolution_limit: type: number format: float - indexing_tolerance: - type: number - format: float - 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. + If enabled it will likely reduce performance of Jungfraujoch to below 100 Hz. + (experimental feature) + quick_integration: + type: boolean + default: false + description: | + Quick integration of collected diffraction images. + If enabled it will likely reduce performance of Jungfraujoch for datasets with a very high indexing rate. + (experimental feature) azim_int_settings: type: object required: @@ -1022,13 +1156,38 @@ components: items: type: number format: float + z: + type: array + items: + type: number + format: float + plot_unit_x: + type: string + enum: + - "image_number" + - "q_recipA" + - "angle_deg" + - "ADU" + - "grid_um" + default: "image_number" plots: type: object required: - plot + - unit_x properties: title: type: string + unit_x: + $ref: '#/components/schemas/plot_unit_x' + size_x: + type: number + format: float + description: Max X range of the plot + size_y: + type: number + format: float + description: Max Y range of the plot plot: type: array items: @@ -1113,6 +1272,8 @@ components: $ref: '#/components/schemas/azim_int_settings' buffer: $ref: '#/components/schemas/image_buffer_status' + indexing: + $ref: '#/components/schemas/indexing_settings' error_message: type: object required: @@ -1253,6 +1414,55 @@ components: $ref: '#/components/schemas/roi_circle_list' azim: $ref: '#/components/schemas/roi_azim_list' + indexing_settings: + type: object + description: "Settings for crystallography indexing" + required: + - algorithm + - fft_high_resolution_A + - fft_max_unit_cell_A + - fft_min_unit_cell_A + - fft_num_vectors + - tolerance + properties: + algorithm: + $ref: "#/components/schemas/indexing_algorithm" + fft_max_unit_cell_A: + type: number + format: float + default: 250 + maximum: 500 + minimum: 50 + description: Largest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT + fft_min_unit_cell_A: + type: number + format: float + default: 10.0 + minimum: 5 + maximum: 40 + description: Smallest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT + fft_high_resolution_A: + type: number + format: float + default: 2.0 + minimum: 0.5 + maximum: 6.0 + description: | + Highest resolution of spots used for FFT algorithm; parameter value affects execution time of FFT. + There is also correlation between smallest unit cell and max resolution, which need to be checked for very small systems. + fft_num_vectors: + type: integer + format: int64 + minimum: 128 + default: 16384 + description: Number of search directions for the FFT algorithm; parameter value affects execution time of FFT. + tolerance: + type: number + format: float + minimum: 0.0 + maximum: 0.5 + description: Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted + instrument_metadata: type: object description: "Metadata for a measurement instrument" @@ -1516,6 +1726,8 @@ components: minLength: 1 items: $ref: '#/components/schemas/detector' + indexing: + $ref: '#/components/schemas/indexing_settings' detector_settings: $ref: '#/components/schemas/detector_settings' azim_int: @@ -1784,7 +1996,42 @@ paths: application/json: schema: $ref: '#/components/schemas/detector_settings' - + /config/indexing: + put: + summary: Change indexing algorithm settings + description: | + This can only be done when detector is `Idle`, `Error` or `Inactive` states. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/indexing_settings' + responses: + "200": + description: Everything OK + "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' + get: + summary: Get indexing configuration + description: Can be done anytime + responses: + "200": + description: Everything OK + content: + application/json: + schema: + $ref: '#/components/schemas/indexing_settings' /config/file_writer: put: summary: Change file writer settings @@ -2270,421 +2517,6 @@ paths: application/json: schema: $ref: '#/components/schemas/error_message' - /plot/bkg_estimate: - get: - summary: Generate background estimate plot - description: | - Mean intensity for d = 3 - 5 A per image; 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/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 - description: Number of spots per image; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/indexing_rate: - get: - summary: Generate indexing rate plot - description: Image indexing rate; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/indexing_unit_cell: - get: - summary: Generate indexing unit cell length plots - description: Crystal unit cell based on indexing results; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/indexing_unit_cell_angle: - get: - summary: Generate indexing unit cell angle plot - description: Crystal unit cell based on indexing results; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/error_pixel: - get: - summary: Generate error pixels plot - description: Count of error (mean) and saturated (mean/max) pixels per image; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/strong_pixel: - get: - summary: Generate strong pixels plot - description: Count of strong pixels per image (from spot finding); binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/max_value: - get: - summary: Generate maximum pixel value plot - description: Provides maximum viable pixel value (excluding overloads and error pixels); binning is configurable and maximum of a bin is returned - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/roi_sum: - get: - summary: Generate ROI sum plot - description: Sum of ROI rectangle per image; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/roi_max_count: - get: - summary: Generate plot of ROI max count - description: Max count of ROI per image; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/roi_valid_pixels: - get: - summary: Generate plot of ROI valid pixels - description: Number of pixels within a ROI area; pixels with special values (overload, bad pixel) are excluded; multipixels are counted just once; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/roi_mean: - get: - summary: Generate plot of ROI mean value - description: 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! - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/roi_x: - get: - summary: Generate plot of ROI weighted X-coordinate - description: Pixel X weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/roi_y: - get: - summary: Generate plot of ROI weighted Y-coordinate - description: Pixel Y weighted by measured counts; pixels with special values (overload, bad pixel) are excluded; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: 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/receiver_delay: - get: - summary: Generate receiver delay plot - description: Amount of frames the receiver is behind the FPGA for each image - used for internal debugging; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: Everything OK - 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/receiver_free_send_buffers: - get: - summary: Generate receiver free send buffer plot - description: Amount of send buffers available during frame processing - used for internal debugging; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: Everything OK - 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/image_collection_efficiency: - get: - summary: Generate image collection efficiency plot - description: Ratio of collected and expected packets per image; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: Everything OK - 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/packets_received: - get: - summary: Generate plot with number of received packets per image - description: Number of collected packets per image; binning is configurable - parameters: - - $ref: '#/components/parameters/binning' - - $ref: '#/components/parameters/compression' - responses: - "200": - description: Everything OK - 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/azim_int: - get: - summary: Generate radial integration profile - description: Generate average radial integration profile - parameters: - - $ref: '#/components/parameters/compression' - responses: - "200": - description: Everything OK - content: - application/json: - schema: - $ref: '#/components/schemas/plots' /statistics: get: summary: Get general statistics @@ -2855,6 +2687,28 @@ paths: format: binary "404": description: No calibration recorded so far + /preview/plot: + get: + summary: Generate 1D plot from Jungfraujoch + parameters: + - $ref: "#/components/parameters/binning" + - $ref: "#/components/parameters/compression" + - $ref: "#/components/parameters/plot_type" + - $ref: "#/components/parameters/experimental_coord" + responses: + "200": + description: Everything OK. + content: + application/json: + schema: + $ref: '#/components/schemas/plots' + "400": + description: Input parsing or validation error + content: + text/plain: + schema: + type: string + description: Exception error /image_buffer/start.cbor: get: summary: Get Start message in CBOR format diff --git a/broker/redoc-static.html b/broker/redoc-static.html index b63d7224..dcd0a079 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -373,11 +373,11 @@ data-styled.g138[id="sc-edfAab"]{content:"jutLom,"}/*!sc*/ -

Jungfraujoch (1.0.0-rc.39)

Download OpenAPI specification:

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

Jungfraujoch (1.0.0-rc.40)

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). @@ -427,7 +427,7 @@ If storage cells are used, the execution time might be few minutes. " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

Response samples

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

Collect dark current for the detector

http://localhost:5232/initialize

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.

@@ -439,7 +439,7 @@ If storage cells are used, the execution time might be few minutes. " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

Response samples

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

Start detector

http://localhost:5232/pedestal

Response samples

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

Start detector

object (rotation_axis)

Definition of a crystal rotation axis

+
object (grid_scan)

Definition of a grid scan (mutually exclusive with rotation_axis)

header_appendix
any

Error within Jungfraujoch code - see output message.

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

http://localhost:5232/start

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": {
    },
  • "grid_scan": {
    },
  • "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

Timeout reached, need to restart operation

Response samples

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

Send soft trigger to the detector

http://localhost:5232/wait_till_done

Response samples

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

Send soft trigger to the detector

Generate soft trigger

Responses

Response samples

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

Change detector configuration

http://localhost:5232/deactivate

Response samples

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

Change detector configuration

Error within Jungfraujoch code - see output message.

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

http://localhost:5232/config/detector

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

http://localhost:5232/config/detector

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 indexing algorithm settings

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

+
Request Body schema: application/json
algorithm
required
string (indexing_algorithm)
Default: "FFBIDX"
Enum: "FFBIDX" "FFT" "None"

Selection of an indexing algorithm used by Jungfraujoch

+
fft_max_unit_cell_A
required
number <float> [ 50 .. 500 ]
Default: 250

Largest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT

+
fft_min_unit_cell_A
required
number <float> [ 5 .. 40 ]
Default: 10

Smallest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT

+
fft_high_resolution_A
required
number <float> [ 0.5 .. 6 ]
Default: 2

Highest resolution of spots used for FFT algorithm; parameter value affects execution time of FFT. +There is also correlation between smallest unit cell and max resolution, which need to be checked for very small systems.

+
fft_num_vectors
required
integer <int64> >= 128
Default: 16384

Number of search directions for the FFT algorithm; parameter value affects execution time of FFT.

+
tolerance
required
number <float> [ 0 .. 0.5 ]

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
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5
}

Response samples

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

Get indexing configuration

Can be done anytime

+

Responses

Response samples

Content type
application/json
{
  • "algorithm": "FFBIDX",
  • "fft_max_unit_cell_A": 250,
  • "fft_min_unit_cell_A": 10,
  • "fft_high_resolution_A": 2,
  • "fft_num_vectors": 16384,
  • "tolerance": 0.5
}

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.

@@ -697,13 +729,13 @@ NXmxLegacy - legacy format with soft links to data files in the master file; nec " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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

http://localhost:5232/config/file_writer

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

http://localhost:5232/config/file_writer

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: ""

Error within Jungfraujoch code - see output message.

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

http://localhost:5232/config/instrument

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

http://localhost:5232/config/instrument

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

Error within Jungfraujoch code - see output message.

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

http://localhost:5232/config/image_format

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

http://localhost:5232/config/image_format

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

http://localhost:5232/config/image_format/raw

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

http://localhost:5232/config/image_format/conversion

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

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
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>
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.

+and path to .pt file configured in jfjoch_broker configuration file. +If enabled it will likely reduce performance of Jungfraujoch to below 100 Hz. +(experimental feature)

+
quick_integration
required
boolean
Default: false

Quick integration of collected diffraction images. +If enabled it will likely reduce performance of Jungfraujoch for datasets with a very high indexing rate. +(experimental feature)

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

http://localhost:5232/config/spot_finding

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,
  • "resolution_estimate": true,
  • "quick_integration": false
}

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

http://localhost:5232/config/spot_finding

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,
  • "resolution_estimate": true,
  • "quick_integration": false
}

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.

@@ -865,13 +905,13 @@ and path to .pt file configured in jfjoch_broker configuration file " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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

http://localhost:5232/config/azim_int

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

http://localhost:5232/config/azim_int

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. @@ -913,13 +953,13 @@ Changing detector will set detector to Inactive state and will requ " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

Request samples

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

Response samples

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

List available detectors

http://localhost:5232/config/select_detector

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

http://localhost:5232/config/select_detector

Response samples

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

Set ZeroMQ preview settings

Error within Jungfraujoch code - see output message.

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

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

http://localhost:5232/config/zeromq_preview

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. @@ -981,21 +1021,21 @@ Address follows ZeroMQ convention for sockets - in practice ipc:// " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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

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

http://localhost:5232/config/zeromq_metadata

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
{
  • "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

http://localhost:5232/fpga_status

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

http://localhost:5232/xfel/pulse_id

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

http://localhost:5232/xfel/event_code

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
{
  • "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)
http://localhost:5232/config/roi

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

@@ -1039,249 +1079,13 @@ Address follows ZeroMQ convention for sockets - in practice ipc:// " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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
http://localhost:5232/config/roi

Request samples

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

Response samples

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

Get general statistics

query Parameters
compression
boolean
Default: false

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

http://localhost:5232/statistics

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": {
    },
  • "indexing": {
    }
}

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

http://localhost:5232/statistics/data_collection

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)

http://localhost:5232/statistics/calibration

Response samples

Content type
application/json
[
  • {
    }
]

Get mask of the detector (binary)

Detector must be Initialized. @@ -1333,7 +1137,7 @@ User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

Response samples

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

Get mask of the detector (TIFF)

http://localhost:5232/config/user_mask

Response samples

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

Get mask of the detector (TIFF)

Should be in Idle state. @@ -1373,7 +1177,7 @@ User mask is not automatically applied - i.e. pixels with user mask will have a " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

Response samples

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

Get pedestal in TIFF format

query Parameters
gain_level
required
integer
http://localhost:5232/config/user_mask.tiff

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

@@ -1383,7 +1187,25 @@ User mask is not automatically applied - i.e. pixels with user mask will have a " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

No calibration recorded so far

Get Start message in CBOR format

http://localhost:5232/preview/pedestal.tiff

Generate 1D plot from Jungfraujoch

query Parameters
binning
integer

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

+
compression
boolean
Default: false

Enable DEFLATE compression of output data.

+
type
required
string
Enum: "bkg_estimate" "azint" "spot_count" "indexing_rate" "indexing_time" "indexing_unit_cell_length" "indexing_unit_cell_angle" "error_pixels" "saturated_pixels" "image_collection_efficiency" "receiver_delay" "receiver_free_send_buf" "strong_pixels" "roi_sum" "roi_mean" "roi_max_count" "roi_pixels" "roi_weighted_x" "roi_weighted_y" "packets_received" "max_pixel_value" "resolution_estimate"

Type of requested plot

+
experimental_coord
boolean
Default: false

If measurement has goniometer axis defined, plot X-axis will represent rotation angle +If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value +For still measurement the number is ignored

+

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "unit_x": "image_number",
  • "size_x": 0.1,
  • "size_y": 0.1,
  • "plot": [
    ]
}

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

http://localhost:5232/image_buffer/start.cbor

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

@@ -1405,7 +1227,7 @@ User mask is not automatically applied - i.e. pixels with user mask will have a " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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
http://localhost:5232/image_buffer/image.cbor

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

@@ -1413,7 +1235,7 @@ User mask is not automatically applied - i.e. pixels with user mask will have a " class="sc-dTUlgT sc-fhPBcz gAHTYt iCKFAv">

Show ROI areas on the image

show_spots
boolean
Default: true

Show spot finding results on the image

-
saturation
integer <int64> [ 0 .. 65535 ]
saturation
number <float> [ -32767 .. 32767 ]
Default: 10

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)

@@ -1431,7 +1253,7 @@ User mask is not automatically applied - i.e. pixels with user mask will have a " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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
http://localhost:5232/image_buffer/image.jpeg

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

Response samples

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

Get status of the image buffers

http://localhost:5232/image_buffer/clear

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. @@ -1459,13 +1281,13 @@ then image might be replaced in the buffer between calling /images and /image.cb " class="sc-dTUlgT sc-fhPBcz sc-dNpohg gAHTYt hNgelr kfJzSr">

Error within Jungfraujoch code - see output message.

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

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