diff --git a/broker/CMakeLists.txt b/broker/CMakeLists.txt index 129f667e..fe51bf6a 100644 --- a/broker/CMakeLists.txt +++ b/broker/CMakeLists.txt @@ -16,7 +16,7 @@ ADD_LIBRARY(JFJochBroker STATIC TARGET_LINK_LIBRARIES(JFJochBroker JFJochReceiver JFJochDetector JFJochCommon JFJochAPI JFJochPreview) ADD_EXECUTABLE(jfjoch_broker jfjoch_broker.cpp JFJochBrokerHttp.cpp JFJochBrokerHttp.h - gen/api/DefaultApi.cpp gen/api/DefaultApi.h) + gen/api/DefaultApi.cpp gen/api/DefaultApi.h gen/api/ApiBase.h gen/api/ApiBase.cpp) TARGET_LINK_LIBRARIES(jfjoch_broker JFJochBroker pistache_static ${CMAKE_DL_LIBS}) TARGET_INCLUDE_DIRECTORIES(jfjoch_broker PUBLIC gen/api) INSTALL(TARGETS jfjoch_broker RUNTIME COMPONENT jfjoch) diff --git a/broker/gen/api/ApiBase.cpp b/broker/gen/api/ApiBase.cpp new file mode 100644 index 00000000..a02a91f4 --- /dev/null +++ b/broker/gen/api/ApiBase.cpp @@ -0,0 +1,22 @@ +/** +* Jungfraujoch +* API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland). Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU. Jungfraujoch uses FPGA boards to acquire data at high data rates. # License Clarification While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply** when this file is used solely to generate OpenAPI clients or when implementing applications that interact with the API. Generated client code and applications using this API definition are not subject to the GPL license requirements and may be distributed under terms of your choosing. This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not derivative works of the kernel and are not subject to the terms of the GPL. This exception is intended to allow wider use of this API specification without imposing GPL requirements on applications that merely interact with the API, regardless of whether they communicate through network calls or other mechanisms. +* +* The version of the OpenAPI document: 1.0.0-rc.124 +* 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 "ApiBase.h" + +namespace org::openapitools::server::api +{ + +ApiBase::ApiBase(const std::shared_ptr& rtr) : router(rtr) +{ +} + + +} // Namespace org::openapitools::server::api diff --git a/broker/gen/api/ApiBase.h b/broker/gen/api/ApiBase.h index 53a9c26f..96b9bd0a 100644 --- a/broker/gen/api/ApiBase.h +++ b/broker/gen/api/ApiBase.h @@ -24,14 +24,26 @@ namespace org::openapitools::server::api { + + + + class ApiBase { public: - explicit ApiBase(const std::shared_ptr& rtr) : router(rtr) {}; + explicit ApiBase(const std::shared_ptr& rtr); virtual ~ApiBase() = default; virtual void init() = 0; + + + + protected: const std::shared_ptr router; + + + + }; } // namespace org::openapitools::server::api diff --git a/broker/gen/api/DefaultApi.cpp b/broker/gen/api/DefaultApi.cpp index 2d3adb69..e1b0f255 100644 --- a/broker/gen/api/DefaultApi.cpp +++ b/broker/gen/api/DefaultApi.cpp @@ -23,8 +23,7 @@ const std::string DefaultApi::base = ""; DefaultApi::DefaultApi(const std::shared_ptr& rtr) : ApiBase(rtr) -{ -} +{} void DefaultApi::init() { setupRoutes(); @@ -98,14 +97,12 @@ void DefaultApi::setupRoutes() { router->addCustomHandler(Routes::bind(&DefaultApi::default_api_default_handler, this)); } -void DefaultApi::handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept -{ +void DefaultApi::handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept { std::pair codeAndError = handleParsingException(ex); response.send(codeAndError.first, codeAndError.second); } -std::pair DefaultApi::handleParsingException(const std::exception& ex) const noexcept -{ +std::pair DefaultApi::handleParsingException(const std::exception& ex) const noexcept { try { throw; } catch (nlohmann::detail::exception &e) { @@ -117,1518 +114,2132 @@ std::pair DefaultApi::handleParsingException( } } -void DefaultApi::handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept -{ +void DefaultApi::handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept { std::pair codeAndError = handleOperationException(ex); response.send(codeAndError.first, codeAndError.second); } -std::pair DefaultApi::handleOperationException(const std::exception& ex) const noexcept -{ +std::pair DefaultApi::handleOperationException(const std::exception& ex) const noexcept { return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what()); } -void DefaultApi::cancel_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { +void DefaultApi::cancel_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { - - try { - this->cancel_post(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_azim_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_azim_int_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_azim_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param + + - Azim_int_settings azimIntSettings; + + + try { + + + + + + this->cancel_post(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_azim_int_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + - try { - nlohmann::json::parse(request.body()).get_to(azimIntSettings); - azimIntSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - try { - this->config_azim_int_put(azimIntSettings, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + try { + + + + + + this->config_azim_int_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_dark_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_dark_mask_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_dark_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_azim_int_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { - - // Getting the body param + + // Getting the body param + + Azim_int_settings azimIntSettings; + + + - Dark_mask_settings darkMaskSettings; - - try { - nlohmann::json::parse(request.body()).get_to(darkMaskSettings); - darkMaskSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - try { - this->config_dark_mask_put(darkMaskSettings, 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_detector_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_detector_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_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Detector_settings detectorSettings; - - try { - nlohmann::json::parse(request.body()).get_to(detectorSettings); - detectorSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_detector_put(detectorSettings, 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_file_writer_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_file_writer_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_file_writer_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - File_writer_settings fileWriterSettings; - - try { - nlohmann::json::parse(request.body()).get_to(fileWriterSettings); - fileWriterSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_file_writer_put(fileWriterSettings, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_image_format_conversion_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_image_format_conversion_post(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_image_format_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_image_format_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_image_format_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Image_format_settings imageFormatSettings; - - try { - nlohmann::json::parse(request.body()).get_to(imageFormatSettings); - imageFormatSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_image_format_put(imageFormatSettings, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_image_format_raw_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_image_format_raw_post(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(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_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 { - - - try { - this->config_instrument_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_instrument_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Instrument_metadata instrumentMetadata; - - try { - nlohmann::json::parse(request.body()).get_to(instrumentMetadata); - instrumentMetadata.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_instrument_put(instrumentMetadata, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(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_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - try { - this->config_internal_generator_image_put(request, 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_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - try { - this->config_internal_generator_image_tiff_put(request, 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_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_mask_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_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_mask_tiff_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_roi_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_roi_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_roi_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Roi_definitions roiDefinitions; - - try { - nlohmann::json::parse(request.body()).get_to(roiDefinitions); - roiDefinitions.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_roi_put(roiDefinitions, 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_select_detector_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_select_detector_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_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Detector_selection detectorSelection; - - try { - nlohmann::json::parse(request.body()).get_to(detectorSelection); - detectorSelection.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_select_detector_put(detectorSelection, 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_spot_finding_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_spot_finding_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_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Spot_finding_settings spotFindingSettings; - - try { - nlohmann::json::parse(request.body()).get_to(spotFindingSettings); - spotFindingSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_spot_finding_put(spotFindingSettings, 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_user_mask_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_user_mask_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_user_mask_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - try { - this->config_user_mask_put(request, 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_user_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_user_mask_tiff_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - try { - this->config_user_mask_tiff_put(request, 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_zeromq_metadata_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_zeromq_metadata_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_zeromq_metadata_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Zeromq_metadata_settings zeromqMetadataSettings; - - try { - nlohmann::json::parse(request.body()).get_to(zeromqMetadataSettings); - zeromqMetadataSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_zeromq_metadata_put(zeromqMetadataSettings, 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_zeromq_preview_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->config_zeromq_preview_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_zeromq_preview_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Zeromq_preview_settings zeromqPreviewSettings; - - try { - nlohmann::json::parse(request.body()).get_to(zeromqPreviewSettings); - zeromqPreviewSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->config_zeromq_preview_put(zeromqPreviewSettings, 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::deactivate_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->deactivate_post(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::detector_status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->detector_status_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::fpga_status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->fpga_status_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::image_buffer_clear_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->image_buffer_clear_post(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } - -} -void DefaultApi::image_buffer_image_cbor_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto idQuery = request.query().get("id"); - std::optional id; - if(idQuery.has_value()){ - int64_t valueQuery_instance; - if(fromStringValue(idQuery.value(), valueQuery_instance)){ - id = valueQuery_instance; + try { + nlohmann::json::parse(request.body()).get_to(azimIntSettings); + azimIntSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; } + + try { + + + + + + this->config_azim_int_put(azimIntSettings, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(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_dark_mask_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + - try { - this->image_buffer_image_cbor_get(id, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + + try { + + + + + + this->config_dark_mask_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::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_dark_mask_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { - - // Getting the query params - auto idQuery = request.query().get("id"); - std::optional id; - if(idQuery.has_value()){ - int64_t valueQuery_instance; - if(fromStringValue(idQuery.value(), valueQuery_instance)){ - id = valueQuery_instance; - } - } - auto showUserMaskQuery = request.query().get("show_user_mask"); - std::optional showUserMask; - if(showUserMaskQuery.has_value()){ - bool valueQuery_instance; - if(fromStringValue(showUserMaskQuery.value(), valueQuery_instance)){ - showUserMask = valueQuery_instance; - } - } - auto showRoiQuery = request.query().get("show_roi"); - std::optional showRoi; - if(showRoiQuery.has_value()){ - bool valueQuery_instance; - if(fromStringValue(showRoiQuery.value(), valueQuery_instance)){ - showRoi = valueQuery_instance; - } - } - auto showSpotsQuery = request.query().get("show_spots"); - std::optional showSpots; - if(showSpotsQuery.has_value()){ - bool valueQuery_instance; - if(fromStringValue(showSpotsQuery.value(), valueQuery_instance)){ - showSpots = valueQuery_instance; - } - } - auto showBeamCenterQuery = request.query().get("show_beam_center"); - std::optional showBeamCenter; - if(showBeamCenterQuery.has_value()){ - bool valueQuery_instance; - if(fromStringValue(showBeamCenterQuery.value(), valueQuery_instance)){ - showBeamCenter = valueQuery_instance; - } - } - auto saturationQuery = request.query().get("saturation"); - std::optional saturation; - if(saturationQuery.has_value()){ - float valueQuery_instance; - if(fromStringValue(saturationQuery.value(), valueQuery_instance)){ - saturation = valueQuery_instance; - } - } - auto jpegQualityQuery = request.query().get("jpeg_quality"); - std::optional jpegQuality; - if(jpegQualityQuery.has_value()){ - int64_t valueQuery_instance; - if(fromStringValue(jpegQualityQuery.value(), valueQuery_instance)){ - jpegQuality = valueQuery_instance; - } - } - auto showResRingQuery = request.query().get("show_res_ring"); - std::optional showResRing; - if(showResRingQuery.has_value()){ - float valueQuery_instance; - if(fromStringValue(showResRingQuery.value(), valueQuery_instance)){ - showResRing = valueQuery_instance; - } - } - auto colorQuery = request.query().get("color"); - std::optional color; - if(colorQuery.has_value()){ - std::string valueQuery_instance; - if(fromStringValue(colorQuery.value(), valueQuery_instance)){ - color = valueQuery_instance; - } - } - auto showResEstQuery = request.query().get("show_res_est"); - std::optional showResEst; - if(showResEstQuery.has_value()){ - bool valueQuery_instance; - if(fromStringValue(showResEstQuery.value(), valueQuery_instance)){ - showResEst = valueQuery_instance; - } - } + + // Getting the body param + + Dark_mask_settings darkMaskSettings; + + + - try { - this->image_buffer_image_jpeg_get(id, showUserMask, showRoi, showSpots, showBeamCenter, saturation, jpegQuality, showResRing, color, showResEst, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + try { + nlohmann::json::parse(request.body()).get_to(darkMaskSettings); + darkMaskSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_dark_mask_put(darkMaskSettings, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } } catch (std::exception &e) { response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } + } -void DefaultApi::image_buffer_image_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_detector_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { - - // Getting the query params - auto idQuery = request.query().get("id"); - std::optional id; - if(idQuery.has_value()){ - int64_t valueQuery_instance; - if(fromStringValue(idQuery.value(), valueQuery_instance)){ - id = valueQuery_instance; - } - } + + - try { - this->image_buffer_image_tiff_get(id, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + + try { + + + + + + this->config_detector_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::image_buffer_start_cbor_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->image_buffer_start_cbor_get(response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } - - } catch (std::exception &e) { - response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); - } } -void DefaultApi::image_buffer_status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_detector_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { - - try { - this->image_buffer_status_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::initialize_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->initialize_post(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::pedestal_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->pedestal_post(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 { - - - // Getting the query params - auto gainLevelQuery = request.query().get("gain_level"); - std::optional gainLevel; - if(gainLevelQuery.has_value()){ - int32_t valueQuery_instance; - if(fromStringValue(gainLevelQuery.value(), valueQuery_instance)){ - gainLevel = valueQuery_instance; - } - } - auto scQuery = request.query().get("sc"); - std::optional sc; - if(scQuery.has_value()){ - int32_t valueQuery_instance; - if(fromStringValue(scQuery.value(), valueQuery_instance)){ - sc = valueQuery_instance; - } - } + + // Getting the body param + + Detector_settings detectorSettings; + + + - try { - this->preview_pedestal_tiff_get(gainLevel, sc, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + try { + nlohmann::json::parse(request.body()).get_to(detectorSettings); + detectorSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_detector_put(detectorSettings, 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_plot_bin_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_file_writer_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { - - // Getting the query params - 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 roiQuery = request.query().get("roi"); - std::optional roi; - if(roiQuery.has_value()){ - std::string valueQuery_instance; - if(fromStringValue(roiQuery.value(), valueQuery_instance)){ - roi = valueQuery_instance; - } - } + + - try { - this->preview_plot_bin_get(type, roi, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + + try { + + + + + + this->config_file_writer_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } } catch (std::exception &e) { response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } + } -void DefaultApi::preview_plot_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_file_writer_put_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 fillQuery = request.query().get("fill"); - std::optional fill; - if(fillQuery.has_value()){ - float valueQuery_instance; - if(fromStringValue(fillQuery.value(), valueQuery_instance)){ - fill = 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; - } - } - auto azintUnitQuery = request.query().get("azint_unit"); - std::optional azintUnit; - if(azintUnitQuery.has_value()){ - std::string valueQuery_instance; - if(fromStringValue(azintUnitQuery.value(), valueQuery_instance)){ - azintUnit = valueQuery_instance; - } - } + + // Getting the body param + + File_writer_settings fileWriterSettings; + + + - try { - this->preview_plot_get(type, binning, compression, fill, experimentalCoord, azintUnit, 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::result_scan_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->result_scan_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::start_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the body param - - Dataset_settings datasetSettings; - - try { - nlohmann::json::parse(request.body()).get_to(datasetSettings); - datasetSettings.validate(); - } catch (std::exception &e) { - this->handleParsingException(e, response); - return; - } - - try { - this->start_post(datasetSettings, 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::statistics_calibration_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->statistics_calibration_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::statistics_data_collection_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->statistics_data_collection_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::statistics_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 { + nlohmann::json::parse(request.body()).get_to(fileWriterSettings); + fileWriterSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; } + + try { + + + + + + this->config_file_writer_put(fileWriterSettings, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } + + +} + +void DefaultApi::config_image_format_conversion_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + - try { - this->statistics_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; - } + + + try { + + + + + + this->config_image_format_conversion_post(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::status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_image_format_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { + + + - try { - this->status_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; - } + + try { + + + + + + this->config_image_format_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::trigger_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { - try { - - - try { - this->trigger_post(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::version_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_image_format_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { + + // Getting the body param + + Image_format_settings imageFormatSettings; + + + + - try { - this->version_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::wait_till_done_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { - try { - - - // Getting the query params - auto timeoutQuery = request.query().get("timeout"); - std::optional timeout; - if(timeoutQuery.has_value()){ - int32_t valueQuery_instance; - if(fromStringValue(timeoutQuery.value(), valueQuery_instance)){ - timeout = valueQuery_instance; + try { + nlohmann::json::parse(request.body()).get_to(imageFormatSettings); + imageFormatSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; } + + try { + + + + + + this->config_image_format_put(imageFormatSettings, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); } + + +} + +void DefaultApi::config_image_format_raw_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + - try { - this->wait_till_done_post(timeout, response); - } catch (Pistache::Http::HttpError &e) { - response.send(static_cast(e.code()), e.what()); - return; - } catch (std::exception &e) { - this->handleOperationException(e, response); - return; - } + + + try { + + + + + + this->config_image_format_raw_post(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::xfel_event_code_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_indexing_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { + + + - try { - this->xfel_event_code_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; - } + + 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::xfel_pulse_id_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + +void DefaultApi::config_indexing_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { try { + + // Getting the body param + + Indexing_settings indexingSettings; + + + + - try { - this->xfel_pulse_id_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; - } + 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& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_instrument_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_instrument_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Instrument_metadata instrumentMetadata; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(instrumentMetadata); + instrumentMetadata.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_instrument_put(instrumentMetadata, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(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_internal_generator_image_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->config_internal_generator_image_put(request, 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_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->config_internal_generator_image_tiff_put(request, 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_mask_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_mask_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_mask_tiff_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_mask_tiff_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + +} + +void DefaultApi::config_roi_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_roi_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_roi_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Roi_definitions roiDefinitions; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(roiDefinitions); + roiDefinitions.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_roi_put(roiDefinitions, 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_select_detector_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_select_detector_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_select_detector_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Detector_selection detectorSelection; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(detectorSelection); + detectorSelection.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_select_detector_put(detectorSelection, 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_spot_finding_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_spot_finding_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_spot_finding_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Spot_finding_settings spotFindingSettings; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(spotFindingSettings); + spotFindingSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_spot_finding_put(spotFindingSettings, 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_user_mask_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_user_mask_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_user_mask_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->config_user_mask_put(request, 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_user_mask_tiff_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_user_mask_tiff_get(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + +} + +void DefaultApi::config_user_mask_tiff_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->config_user_mask_tiff_put(request, 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_zeromq_metadata_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_zeromq_metadata_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_zeromq_metadata_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Zeromq_metadata_settings zeromqMetadataSettings; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(zeromqMetadataSettings); + zeromqMetadataSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_zeromq_metadata_put(zeromqMetadataSettings, 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_zeromq_preview_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->config_zeromq_preview_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_zeromq_preview_put_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Zeromq_preview_settings zeromqPreviewSettings; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(zeromqPreviewSettings); + zeromqPreviewSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->config_zeromq_preview_put(zeromqPreviewSettings, 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::deactivate_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->deactivate_post(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::detector_status_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->detector_status_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::fpga_status_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->fpga_status_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::image_buffer_clear_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->image_buffer_clear_post(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + +} + +void DefaultApi::image_buffer_image_cbor_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + // Getting the query params + auto idQuery = request.query().get("id"); + std::optional id; + if (idQuery.has_value()) { + int64_t valueQuery_instance; + if (fromStringValue(idQuery.value(), valueQuery_instance)) { + id = valueQuery_instance; + } + } + + + + try { + + + + + + this->image_buffer_image_cbor_get(id, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + +} + +void DefaultApi::image_buffer_image_jpeg_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + // Getting the query params + auto idQuery = request.query().get("id"); + std::optional id; + if (idQuery.has_value()) { + int64_t valueQuery_instance; + if (fromStringValue(idQuery.value(), valueQuery_instance)) { + id = valueQuery_instance; + } + } + auto showUserMaskQuery = request.query().get("show_user_mask"); + std::optional showUserMask; + if (showUserMaskQuery.has_value()) { + bool valueQuery_instance; + if (fromStringValue(showUserMaskQuery.value(), valueQuery_instance)) { + showUserMask = valueQuery_instance; + } + } + auto showRoiQuery = request.query().get("show_roi"); + std::optional showRoi; + if (showRoiQuery.has_value()) { + bool valueQuery_instance; + if (fromStringValue(showRoiQuery.value(), valueQuery_instance)) { + showRoi = valueQuery_instance; + } + } + auto showSpotsQuery = request.query().get("show_spots"); + std::optional showSpots; + if (showSpotsQuery.has_value()) { + bool valueQuery_instance; + if (fromStringValue(showSpotsQuery.value(), valueQuery_instance)) { + showSpots = valueQuery_instance; + } + } + auto showBeamCenterQuery = request.query().get("show_beam_center"); + std::optional showBeamCenter; + if (showBeamCenterQuery.has_value()) { + bool valueQuery_instance; + if (fromStringValue(showBeamCenterQuery.value(), valueQuery_instance)) { + showBeamCenter = valueQuery_instance; + } + } + auto saturationQuery = request.query().get("saturation"); + std::optional saturation; + if (saturationQuery.has_value()) { + float valueQuery_instance; + if (fromStringValue(saturationQuery.value(), valueQuery_instance)) { + saturation = valueQuery_instance; + } + } + auto jpegQualityQuery = request.query().get("jpeg_quality"); + std::optional jpegQuality; + if (jpegQualityQuery.has_value()) { + int64_t valueQuery_instance; + if (fromStringValue(jpegQualityQuery.value(), valueQuery_instance)) { + jpegQuality = valueQuery_instance; + } + } + auto showResRingQuery = request.query().get("show_res_ring"); + std::optional showResRing; + if (showResRingQuery.has_value()) { + float valueQuery_instance; + if (fromStringValue(showResRingQuery.value(), valueQuery_instance)) { + showResRing = valueQuery_instance; + } + } + auto colorQuery = request.query().get("color"); + std::optional color; + if (colorQuery.has_value()) { + std::string valueQuery_instance; + if (fromStringValue(colorQuery.value(), valueQuery_instance)) { + color = valueQuery_instance; + } + } + auto showResEstQuery = request.query().get("show_res_est"); + std::optional showResEst; + if (showResEstQuery.has_value()) { + bool valueQuery_instance; + if (fromStringValue(showResEstQuery.value(), valueQuery_instance)) { + showResEst = valueQuery_instance; + } + } + + + + try { + + + + + + this->image_buffer_image_jpeg_get(id, showUserMask, showRoi, showSpots, showBeamCenter, saturation, jpegQuality, showResRing, color, showResEst, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + +} + +void DefaultApi::image_buffer_image_tiff_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + // Getting the query params + auto idQuery = request.query().get("id"); + std::optional id; + if (idQuery.has_value()) { + int64_t valueQuery_instance; + if (fromStringValue(idQuery.value(), valueQuery_instance)) { + id = valueQuery_instance; + } + } + + + + try { + + + + + + this->image_buffer_image_tiff_get(id, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + this->handleOperationException(e, response); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + + +} + +void DefaultApi::image_buffer_start_cbor_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->image_buffer_start_cbor_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::image_buffer_status_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->image_buffer_status_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::initialize_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->initialize_post(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::pedestal_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->pedestal_post(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 { + + + + // Getting the query params + auto gainLevelQuery = request.query().get("gain_level"); + std::optional gainLevel; + if (gainLevelQuery.has_value()) { + int32_t valueQuery_instance; + if (fromStringValue(gainLevelQuery.value(), valueQuery_instance)) { + gainLevel = valueQuery_instance; + } + } + auto scQuery = request.query().get("sc"); + std::optional sc; + if (scQuery.has_value()) { + int32_t valueQuery_instance; + if (fromStringValue(scQuery.value(), valueQuery_instance)) { + sc = valueQuery_instance; + } + } + + + + try { + + + + + + this->preview_pedestal_tiff_get(gainLevel, sc, 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_plot_bin_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + // Getting the query params + 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 roiQuery = request.query().get("roi"); + std::optional roi; + if (roiQuery.has_value()) { + std::string valueQuery_instance; + if (fromStringValue(roiQuery.value(), valueQuery_instance)) { + roi = valueQuery_instance; + } + } + + + + try { + + + + + + this->preview_plot_bin_get(type, roi, 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_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 fillQuery = request.query().get("fill"); + std::optional fill; + if (fillQuery.has_value()) { + float valueQuery_instance; + if (fromStringValue(fillQuery.value(), valueQuery_instance)) { + fill = 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; + } + } + auto azintUnitQuery = request.query().get("azint_unit"); + std::optional azintUnit; + if (azintUnitQuery.has_value()) { + std::string valueQuery_instance; + if (fromStringValue(azintUnitQuery.value(), valueQuery_instance)) { + azintUnit = valueQuery_instance; + } + } + + + + try { + + + + + + this->preview_plot_get(type, binning, compression, fill, experimentalCoord, azintUnit, 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::result_scan_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->result_scan_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::start_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Dataset_settings datasetSettings; + + + + + + try { + nlohmann::json::parse(request.body()).get_to(datasetSettings); + datasetSettings.validate(); + } catch (std::exception& e) { + this->handleParsingException(e, response); + return; + } + + try { + + + + + + this->start_post(datasetSettings, 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::statistics_calibration_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->statistics_calibration_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::statistics_data_collection_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->statistics_data_collection_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::statistics_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->statistics_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::status_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->status_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::trigger_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->trigger_post(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::version_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->version_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::wait_till_done_post_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + // Getting the query params + auto timeoutQuery = request.query().get("timeout"); + std::optional timeout; + if (timeoutQuery.has_value()) { + int32_t valueQuery_instance; + if (fromStringValue(timeoutQuery.value(), valueQuery_instance)) { + timeout = valueQuery_instance; + } + } + + + + try { + + + + + + this->wait_till_done_post(timeout, 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::xfel_event_code_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->xfel_event_code_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::xfel_pulse_id_get_handler(const Pistache::Rest::Request& request, Pistache::Http::ResponseWriter response) { + try { + + + + + + + try { + + + + + + this->xfel_pulse_id_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::default_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); } diff --git a/broker/gen/api/DefaultApi.h b/broker/gen/api/DefaultApi.h index e37dfcda..983cf838 100644 --- a/broker/gen/api/DefaultApi.h +++ b/broker/gen/api/DefaultApi.h @@ -165,14 +165,14 @@ private: /// /// Command will inform FPGA network card to stop pedestal or data collection at the current stage. Any frame that is currently being processed by CPU will be finished and sent to writer. Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to `Idle` state. If data collection is not running, the command has no effect. /// - virtual void cancel_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void cancel_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Get azimuthal integration configuration /// /// /// Can be done anytime /// - virtual void config_azim_int_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_azim_int_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Configure azimuthal integration /// @@ -180,14 +180,14 @@ private: /// Can be done when detector is Inactive or Idle /// /// (optional) - virtual void config_azim_int_put(const org::openapitools::server::model::Azim_int_settings &azimIntSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_azim_int_put( const org::openapitools::server::model::Azim_int_settings &azimIntSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Get settings for dark data collection to calculate mask /// /// /// /// - virtual void config_dark_mask_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_dark_mask_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Set configuration for dark data collection to calculate mask /// @@ -195,14 +195,14 @@ private: /// This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point. This can only be done when detector is `Idle`, `Error` or `Inactive` states. /// /// (optional) - virtual void config_dark_mask_put(const org::openapitools::server::model::Dark_mask_settings &darkMaskSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_dark_mask_put( const org::openapitools::server::model::Dark_mask_settings &darkMaskSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Get detector configuration /// /// /// Can be done anytime /// - virtual void config_detector_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_detector_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Change detector configuration /// @@ -210,14 +210,14 @@ private: /// Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. This can only be done when detector is `Idle`, `Error` or `Inactive` states. If detector is in `Idle` state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation. If detector is in `Inactive` or `Error` states, new settings will be saved, but no calibration will be executed. /// /// (optional) - virtual void config_detector_put(const org::openapitools::server::model::Detector_settings &detectorSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_detector_put( const org::openapitools::server::model::Detector_settings &detectorSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Get file writer settings /// /// /// Can be done anytime /// - virtual void config_file_writer_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_file_writer_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Change file writer settings /// @@ -225,21 +225,21 @@ private: /// This can only be done when detector is `Idle`, `Error` or `Inactive` states. /// /// (optional) - virtual void config_file_writer_put(const org::openapitools::server::model::File_writer_settings &fileWriterSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_file_writer_put( const org::openapitools::server::model::File_writer_settings &fileWriterSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Configure format for data collection with full conversion /// /// /// This can only be done when detector is `Idle`, `Error` or `Inactive` states. /// - virtual void config_image_format_conversion_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_image_format_conversion_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Get image output format /// /// /// Can be done anytime /// - virtual void config_image_format_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_image_format_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Change image output format /// @@ -247,21 +247,21 @@ private: /// This can only be done when detector is `Idle`, `Error` or `Inactive` states. /// /// (optional) - virtual void config_image_format_put(const org::openapitools::server::model::Image_format_settings &imageFormatSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_image_format_put( const org::openapitools::server::model::Image_format_settings &imageFormatSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Configure format for raw data collection /// /// /// This can only be done when detector is `Idle`, `Error` or `Inactive` states. /// - virtual void config_image_format_raw_post(Pistache::Http::ResponseWriter &response) = 0; + 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; + virtual void config_indexing_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Change indexing algorithm settings /// @@ -269,14 +269,14 @@ private: /// 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; + virtual void config_indexing_put( const org::openapitools::server::model::Indexing_settings &indexingSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Get instrument metadata /// /// /// Can be done anytime /// - virtual void config_instrument_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_instrument_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Change instrument metadata /// @@ -284,7 +284,7 @@ private: /// This can only be done when detector is `Idle`, `Error` or `Inactive` states. /// /// (optional) - virtual void config_instrument_put(const org::openapitools::server::model::Instrument_metadata &instrumentMetadata, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_instrument_put( const org::openapitools::server::model::Instrument_metadata &instrumentMetadata, Pistache::Http::ResponseWriter &response) = 0; /// /// Load binary image for internal FPGA generator /// @@ -305,21 +305,21 @@ private: /// /// Detector must be Initialized. Get full pixel mask of the detector. See NXmx standard for meaning of pixel values. /// - virtual void config_mask_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_mask_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Get mask of the detector (TIFF) /// /// /// Should be in `Idle` state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values /// - virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_mask_tiff_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Get ROI definitions /// /// /// /// - virtual void config_roi_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_roi_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Upload ROI definitions /// @@ -327,14 +327,14 @@ private: /// /// /// (optional) - virtual void config_roi_put(const org::openapitools::server::model::Roi_definitions &roiDefinitions, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_roi_put( const org::openapitools::server::model::Roi_definitions &roiDefinitions, Pistache::Http::ResponseWriter &response) = 0; /// /// List available detectors /// /// /// Configured detectors that can be selected by used /// - virtual void config_select_detector_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_select_detector_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Select detector /// @@ -342,14 +342,14 @@ private: /// Jungfraujoch allows to control multiple detectors and/or region-of-interests. The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response). Changing detector will set detector to `Inactive` state and will require reinitialization. /// /// (optional) - virtual void config_select_detector_put(const org::openapitools::server::model::Detector_selection &detectorSelection, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_select_detector_put( const org::openapitools::server::model::Detector_selection &detectorSelection, Pistache::Http::ResponseWriter &response) = 0; /// /// Get data processing configuration /// /// /// Can be done anytime /// - virtual void config_spot_finding_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_spot_finding_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Configure spot finding /// @@ -357,14 +357,14 @@ private: /// Can be done anytime, also while data collection is running /// /// (optional) - virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_spot_finding_put( const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Detector must be Initialized. Get user mask of the detector (binary) /// /// /// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked /// - virtual void config_user_mask_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_user_mask_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Upload user mask of the detector (binary) /// @@ -378,7 +378,7 @@ private: /// /// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked /// - virtual void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_user_mask_tiff_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Upload user mask of the detector /// @@ -392,7 +392,7 @@ private: /// /// /// - virtual void config_zeromq_metadata_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_zeromq_metadata_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Set ZeroMQ metadata settings /// @@ -400,14 +400,14 @@ private: /// Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. /// /// (optional) - virtual void config_zeromq_metadata_put(const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_zeromq_metadata_put( const org::openapitools::server::model::Zeromq_metadata_settings &zeromqMetadataSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Get ZeroMQ preview settings /// /// /// /// - virtual void config_zeromq_preview_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void config_zeromq_preview_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Set ZeroMQ preview settings /// @@ -415,35 +415,35 @@ private: /// Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. Options set with this PUT request have no effect on HTTP based preview. /// /// (optional) - virtual void config_zeromq_preview_put(const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void config_zeromq_preview_put( const org::openapitools::server::model::Zeromq_preview_settings &zeromqPreviewSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Prepare detector to turn off /// /// /// Should be in `Idle` or `Error` state. Command deactivates data acquisition and turns off detector high voltage and ASIC. Should be used always before turning off power from the detector. /// - virtual void deactivate_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void deactivate_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Get detector status /// /// /// Status of the JUNGFRAU detector /// - virtual void detector_status_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void detector_status_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Get status of FPGA devices /// /// /// /// - virtual void fpga_status_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void fpga_status_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Clear image buffer /// /// /// Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data. /// - virtual void image_buffer_clear_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void image_buffer_clear_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Get image message in CBOR format /// @@ -451,7 +451,7 @@ private: /// Contains full image data and metadata. The image must come from the latest data collection. /// /// Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L) - virtual void image_buffer_image_cbor_get(const std::optional &id, Pistache::Http::ResponseWriter &response) = 0; + virtual void image_buffer_image_cbor_get( const std::optional &id, Pistache::Http::ResponseWriter &response) = 0; /// /// Get preview image in JPEG format using custom settings /// @@ -468,7 +468,7 @@ private: /// Show resolution ring, provided in Angstrom (optional, default to 0.1f) /// Color scale for preview image (optional, default to "indigo") /// Show resolution estimation as a ring (optional, default to false) - 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 &showBeamCenter, const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, const std::optional &showResEst, 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 &showBeamCenter, const std::optional &saturation, const std::optional &jpegQuality, const std::optional &showResRing, const std::optional &color, const std::optional &showResEst, Pistache::Http::ResponseWriter &response) = 0; /// /// Get preview image in TIFF format /// @@ -476,35 +476,35 @@ private: /// /// /// Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer (optional, default to -1L) - virtual void image_buffer_image_tiff_get(const std::optional &id, Pistache::Http::ResponseWriter &response) = 0; + virtual void image_buffer_image_tiff_get( const std::optional &id, Pistache::Http::ResponseWriter &response) = 0; /// /// Get Start message in CBOR format /// /// /// Contains metadata for a dataset (e.g., experimental geometry) /// - virtual void image_buffer_start_cbor_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void image_buffer_start_cbor_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Get status of the image buffers /// /// /// Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor. /// - virtual void image_buffer_status_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void image_buffer_status_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Initialize detector and data acquisition /// /// /// Should be used in two cases: - Detector is in `Inactive` state - Detector is in `Error` state X-ray shutter must be closed. This operation will reconfigure network interface of the detector. During operation of the detector it is recommended to use the `POST /pedestal` operation instead. If storage cells are used, the execution time might be few minutes. This is async function - one needs to use `POST /wait_till_done` to ensure operation is done. /// - virtual void initialize_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void initialize_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Collect dark current for the detector /// /// /// Updates calibration of the JUNGFRAU detector. Must be in `Idle` state. X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us). This is async function - one needs to use `POST /wait_till_done` to ensure operation is done. /// - virtual void pedestal_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void pedestal_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Get pedestal in TIFF format /// @@ -513,7 +513,7 @@ private: /// /// Gain level (0, 1, 2) /// 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; + virtual void preview_pedestal_tiff_get( const std::optional &gainLevel, const std::optional &sc, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate 1D plot from Jungfraujoch and send in raw binary format. Data are provided as (32-bit) float binary array. This format doesn't transmit information about X-axis, only values, so it is of limited use for azimuthal integration. /// @@ -522,7 +522,7 @@ private: /// /// Type of requested plot /// Name of ROI for which plot is requested (optional, default to "") - virtual void preview_plot_bin_get(const std::optional &type, const std::optional &roi, Pistache::Http::ResponseWriter &response) = 0; + virtual void preview_plot_bin_get( const std::optional &type, const std::optional &roi, Pistache::Http::ResponseWriter &response) = 0; /// /// Generate 1D plot from Jungfraujoch /// @@ -535,14 +535,14 @@ private: /// Fill value for elements that were missed during data collection (optional, default to 0.0f) /// 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) /// Unit used for azim int. (optional, default to "Q_recipA") - virtual void preview_plot_get(const std::optional &type, const std::optional &binning, const std::optional &compression, const std::optional &fill, const std::optional &experimentalCoord, const std::optional &azintUnit, Pistache::Http::ResponseWriter &response) = 0; + virtual void preview_plot_get( const std::optional &type, const std::optional &binning, const std::optional &compression, const std::optional &fill, const std::optional &experimentalCoord, const std::optional &azintUnit, Pistache::Http::ResponseWriter &response) = 0; /// /// Get full scan result /// /// /// /// - virtual void result_scan_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void result_scan_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Start detector /// @@ -550,21 +550,21 @@ private: /// Start data acquisition. Detector must be in `Idle` state. Doesn't run calibration procedure. When the function returns, detector is ready to accept soft/TTL triggers. /// /// (optional) - virtual void start_post(const org::openapitools::server::model::Dataset_settings &datasetSettings, Pistache::Http::ResponseWriter &response) = 0; + virtual void start_post( const org::openapitools::server::model::Dataset_settings &datasetSettings, Pistache::Http::ResponseWriter &response) = 0; /// /// Get calibration statistics /// /// /// Statistics are provided for each module/storage cell separately /// - virtual void statistics_calibration_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void statistics_calibration_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Get data collection statistics /// /// /// Results of the last data collection /// - virtual void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void statistics_data_collection_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Get general statistics /// @@ -572,28 +572,28 @@ private: /// /// /// Enable DEFLATE compression of output data. (optional, default to false) - virtual void statistics_get(const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; + virtual void statistics_get( const std::optional &compression, Pistache::Http::ResponseWriter &response) = 0; /// /// Get Jungfraujoch status /// /// /// Status of the data acquisition /// - virtual void status_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void status_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Send soft trigger to the detector /// /// /// Generate soft trigger /// - virtual void trigger_post(Pistache::Http::ResponseWriter &response) = 0; + virtual void trigger_post( Pistache::Http::ResponseWriter &response) = 0; /// /// Get Jungfraujoch version of jfjoch_broker /// /// /// /// - virtual void version_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void version_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Wait for acquisition done /// @@ -601,21 +601,21 @@ private: /// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection. /// /// Timeout in seconds (0 == immediate response) (optional, default to 60) - virtual void wait_till_done_post(const std::optional &timeout, Pistache::Http::ResponseWriter &response) = 0; + virtual void wait_till_done_post( const std::optional &timeout, Pistache::Http::ResponseWriter &response) = 0; /// /// Return XFEL event codes for the current data acquisition /// /// /// Return array of XFEL event codes /// - virtual void xfel_event_code_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void xfel_event_code_get( Pistache::Http::ResponseWriter &response) = 0; /// /// Return XFEL pulse IDs for the current data acquisition /// /// /// Return array of XFEL pulse IDs - (-1) if image not recorded /// - virtual void xfel_pulse_id_get(Pistache::Http::ResponseWriter &response) = 0; + virtual void xfel_pulse_id_get( Pistache::Http::ResponseWriter &response) = 0; }; diff --git a/broker/gen/model/Helpers.h b/broker/gen/model/Helpers.h index 7fe6abfb..907a557f 100644 --- a/broker/gen/model/Helpers.h +++ b/broker/gen/model/Helpers.h @@ -18,12 +18,13 @@ #ifndef Helpers_H_ #define Helpers_H_ +#include #include -#include -#include -#include #include #include +#include +#include +#include namespace org::openapitools::server::helpers { diff --git a/docs/python_client/README.md b/docs/python_client/README.md index 57736bc2..91b8b019 100644 --- a/docs/python_client/README.md +++ b/docs/python_client/README.md @@ -24,12 +24,12 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0-rc.124 - Package version: 1.0.0-rc.124 -- Generator version: 7.8.0 +- Generator version: 7.20.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 3.7+ +Python 3.9+ ## Installation & Usage ### pip install diff --git a/docs/python_client/docs/DefaultApi.md b/docs/python_client/docs/DefaultApi.md index c54db9ef..fdcc7ef4 100644 --- a/docs/python_client/docs/DefaultApi.md +++ b/docs/python_client/docs/DefaultApi.md @@ -71,7 +71,12 @@ Method | HTTP request | Description Cancel running data collection -Command will inform FPGA network card to stop pedestal or data collection at the current stage. Any frame that is currently being processed by CPU will be finished and sent to writer. Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to `Idle` state. If data collection is not running, the command has no effect. +Command will inform FPGA network card to stop pedestal or data collection at the current stage. +Any frame that is currently being processed by CPU will be finished and sent to writer. +Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to `Idle` state. + +If data collection is not running, the command has no effect. + ### Example @@ -326,7 +331,9 @@ No authorization required Set configuration for dark data collection to calculate mask -This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point. This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -458,7 +465,11 @@ No authorization required Change detector configuration -Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. This can only be done when detector is `Idle`, `Error` or `Inactive` states. If detector is in `Idle` state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation. If detector is in `Inactive` or `Error` states, new settings will be saved, but no calibration will be executed. +Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. +If detector is in `Idle` state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation. +If detector is in `Inactive` or `Error` states, new settings will be saved, but no calibration will be executed. + ### Example @@ -590,7 +601,8 @@ No authorization required Change file writer settings -This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -658,7 +670,8 @@ No authorization required Configure format for data collection with full conversion -This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -784,7 +797,8 @@ No authorization required Change image output format -This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -852,7 +866,8 @@ No authorization required Configure format for raw data collection -This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -978,7 +993,8 @@ No authorization required Change indexing algorithm settings -This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -1110,7 +1126,8 @@ No authorization required Change instrument metadata -This can only be done when detector is `Idle`, `Error` or `Inactive` states. +This can only be done when detector is `Idle`, `Error` or `Inactive` states. + ### Example @@ -1178,7 +1195,10 @@ No authorization required Load binary image for internal FPGA generator -Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings). +Load image for internal FPGA generator. This can only happen in Idle state of the detector. +Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates +(depending on detector settings). + ### Example @@ -1246,7 +1266,10 @@ No authorization required Load TIFF image for internal FPGA generator -Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings). +Load image for internal FPGA generator. This can only happen in Idle state of the detector. +Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates +(depending on detector settings). + ### Example @@ -1314,7 +1337,10 @@ No authorization required Get mask of the detector (binary) -Detector must be Initialized. Get full pixel mask of the detector. See NXmx standard for meaning of pixel values. +Detector must be Initialized. +Get full pixel mask of the detector. +See NXmx standard for meaning of pixel values. + ### Example @@ -1377,7 +1403,10 @@ No authorization required Get mask of the detector (TIFF) -Should be in `Idle` state. Get full pixel mask of the detector See NXmx standard for meaning of pixel values +Should be in `Idle` state. +Get full pixel mask of the detector +See NXmx standard for meaning of pixel values + ### Example @@ -1632,7 +1661,10 @@ No authorization required Select detector -Jungfraujoch allows to control multiple detectors and/or region-of-interests. The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response). Changing detector will set detector to `Inactive` state and will require reinitialization. +Jungfraujoch allows to control multiple detectors and/or region-of-interests. +The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response). +Changing detector will set detector to `Inactive` state and will require reinitialization. + ### Example @@ -1894,7 +1926,14 @@ No authorization required Upload user mask of the detector (binary) -Should be in `Idle` state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don't need to be assigned value. Mask is expected as binary array (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. +Should be in `Idle` state. +Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. +If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. +In the latter case - module gaps are ignored and don't need to be assigned value. +Mask is expected as binary array (4-byte; unsigned). +0 - good pixel, other value - masked +User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. + ### Example @@ -2023,7 +2062,15 @@ No authorization required Upload user mask of the detector -Should be in `Idle` state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don't need to be assigned value. Mask is expected as TIFF (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images. +Should be in `Idle` state. +Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. +If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. +In the latter case - module gaps are ignored and don't need to be assigned value. +Mask is expected as TIFF (4-byte; unsigned). +0 - good pixel, other value - masked +User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. +User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images. + ### Example @@ -2151,7 +2198,10 @@ No authorization required Set ZeroMQ metadata settings -Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. +Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images. +Here settings of the socket can be adjusted. +While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. + ### Example @@ -2281,7 +2331,11 @@ No authorization required Set ZeroMQ preview settings -Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. Here settings of the socket can be adjusted. While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. Options set with this PUT request have no effect on HTTP based preview. +Jungfraujoch can generate preview message stream on ZeroMQ SUB socket. +Here settings of the socket can be adjusted. +While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request. +Options set with this PUT request have no effect on HTTP based preview. + ### Example @@ -2349,7 +2403,10 @@ No authorization required Prepare detector to turn off -Should be in `Idle` or `Error` state. Command deactivates data acquisition and turns off detector high voltage and ASIC. Should be used always before turning off power from the detector. +Should be in `Idle` or `Error` state. +Command deactivates data acquisition and turns off detector high voltage and ASIC. +Should be used always before turning off power from the detector. + ### Example @@ -2887,7 +2944,10 @@ No authorization required Get status of the image buffers -Can be run at any stage of Jungfraujoch operation, including during data collection. The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, then image might be replaced in the buffer between calling /images and /image.cbor. +Can be run at any stage of Jungfraujoch operation, including during data collection. +The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots, +then image might be replaced in the buffer between calling /images and /image.cbor. + ### Example @@ -2952,7 +3012,16 @@ No authorization required Initialize detector and data acquisition -Should be used in two cases: - Detector is in `Inactive` state - Detector is in `Error` state X-ray shutter must be closed. This operation will reconfigure network interface of the detector. During operation of the detector it is recommended to use the `POST /pedestal` operation instead. If storage cells are used, the execution time might be few minutes. This is async function - one needs to use `POST /wait_till_done` to ensure operation is done. +Should be used in two cases: + - Detector is in `Inactive` state + - Detector is in `Error` state +X-ray shutter must be closed. +This operation will reconfigure network interface of the detector. +During operation of the detector it is recommended to use the `POST /pedestal` operation instead. +If storage cells are used, the execution time might be few minutes. + +This is async function - one needs to use `POST /wait_till_done` to ensure operation is done. + ### Example @@ -3014,7 +3083,12 @@ No authorization required Collect dark current for the detector -Updates calibration of the JUNGFRAU detector. Must be in `Idle` state. X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us). This is async function - one needs to use `POST /wait_till_done` to ensure operation is done. +Updates calibration of the JUNGFRAU detector. Must be in `Idle` state. + +X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us). + +This is async function - one needs to use `POST /wait_till_done` to ensure operation is done. + ### Example @@ -3353,7 +3427,11 @@ No authorization required Start detector -Start data acquisition. Detector must be in `Idle` state. Doesn't run calibration procedure. When the function returns, detector is ready to accept soft/TTL triggers. +Start data acquisition. +Detector must be in `Idle` state. +Doesn't run calibration procedure. +When the function returns, detector is ready to accept soft/TTL triggers. + ### Example @@ -3802,7 +3880,12 @@ No authorization required Wait for acquisition done -Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection. +Block execution of external script till initialization, data collection or pedestal is finished. +Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. + +To not block web server for a indefinite period of time, the procedure is provided with a timeout. +Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection. + ### Example diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 83908720..ef76b27e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "jungfraujoch-frontend", - "version": "1.0.0-rc.123", + "version": "1.0.0-rc.124", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jungfraujoch-frontend", - "version": "1.0.0-rc.123", + "version": "1.0.0-rc.124", "license": "GPL-3.0", "dependencies": { "@emotion/react": "^11.10.4", diff --git a/gen_python_client.sh b/gen_python_client.sh index 63307335..87492a55 100644 --- a/gen_python_client.sh +++ b/gen_python_client.sh @@ -3,7 +3,7 @@ mkdir -p dist VERSION=$(