diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index 9d517dd1..dbc3e2f3 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -6,6 +6,7 @@ #include "JFJochStateMachine.h" #include "../preview/JFJochTIFF.h" #include "../common/CUDAWrapper.h" +#include "../common/GitInfo.h" JFJochStateMachine::JFJochStateMachine(const DiffractionExperiment& in_experiment, JFJochServices &in_services, @@ -551,6 +552,7 @@ BrokerStatus JFJochStateMachine::GetStatus() const { BrokerStatus ret = broker_status; ret.progress = services.GetReceiverProgress(); ret.gpu_count = gpu_count; + ret.broker_version = jfjoch_version(); return ret; } diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index 5bd7852c..3296769f 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -15,16 +15,7 @@ #include "JFJochServices.h" #include "../common/ROIMap.h" - -enum class JFJochState {Inactive, Idle, Measuring, Error, Busy, Calibration}; - -struct BrokerStatus { - JFJochState state = JFJochState::Inactive; - std::optional progress; - std::optional message; - enum class MessageSeverity {Error, Info, Warning, Success} message_severity = MessageSeverity::Error; - int64_t gpu_count; -}; +#include "../common/BrokerStatus.h" struct DetectorListElement { std::string description; diff --git a/broker/OpenAPIConvert.cpp b/broker/OpenAPIConvert.cpp index 3b603dcc..84c78c0f 100644 --- a/broker/OpenAPIConvert.cpp +++ b/broker/OpenAPIConvert.cpp @@ -241,6 +241,7 @@ org::openapitools::server::model::Broker_status Convert(const BrokerStatus& inpu ret.setProgress(input.progress.value()); ret.setGpuCount(input.gpu_count); + ret.setBrokerVersion(input.broker_version); return ret; } diff --git a/broker/gen/model/Broker_status.cpp b/broker/gen/model/Broker_status.cpp index 8c1cf391..0bca4129 100644 --- a/broker/gen/model/Broker_status.cpp +++ b/broker/gen/model/Broker_status.cpp @@ -30,6 +30,8 @@ Broker_status::Broker_status() m_Message_severityIsSet = false; m_Gpu_count = 0; m_Gpu_countIsSet = false; + m_Broker_version = ""; + m_Broker_versionIsSet = false; } @@ -71,7 +73,7 @@ bool Broker_status::validate(std::stringstream& msg, const std::string& pathPref } } - + return success; } @@ -93,7 +95,10 @@ bool Broker_status::operator==(const Broker_status& rhs) const ((!messageSeverityIsSet() && !rhs.messageSeverityIsSet()) || (messageSeverityIsSet() && rhs.messageSeverityIsSet() && getMessageSeverity() == rhs.getMessageSeverity())) && - ((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount())) + ((!gpuCountIsSet() && !rhs.gpuCountIsSet()) || (gpuCountIsSet() && rhs.gpuCountIsSet() && getGpuCount() == rhs.getGpuCount())) && + + + ((!brokerVersionIsSet() && !rhs.brokerVersionIsSet()) || (brokerVersionIsSet() && rhs.brokerVersionIsSet() && getBrokerVersion() == rhs.getBrokerVersion())) ; } @@ -115,6 +120,8 @@ void to_json(nlohmann::json& j, const Broker_status& o) j["message_severity"] = o.m_Message_severity; if(o.gpuCountIsSet()) j["gpu_count"] = o.m_Gpu_count; + if(o.brokerVersionIsSet()) + j["broker_version"] = o.m_Broker_version; } @@ -141,6 +148,11 @@ void from_json(const nlohmann::json& j, Broker_status& o) j.at("gpu_count").get_to(o.m_Gpu_count); o.m_Gpu_countIsSet = true; } + if(j.find("broker_version") != j.end()) + { + j.at("broker_version").get_to(o.m_Broker_version); + o.m_Broker_versionIsSet = true; + } } @@ -220,6 +232,23 @@ void Broker_status::unsetGpu_count() { m_Gpu_countIsSet = false; } +std::string Broker_status::getBrokerVersion() const +{ + return m_Broker_version; +} +void Broker_status::setBrokerVersion(std::string const& value) +{ + m_Broker_version = value; + m_Broker_versionIsSet = true; +} +bool Broker_status::brokerVersionIsSet() const +{ + return m_Broker_versionIsSet; +} +void Broker_status::unsetBroker_version() +{ + m_Broker_versionIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Broker_status.h b/broker/gen/model/Broker_status.h index 7b1fcbad..c00d131f 100644 --- a/broker/gen/model/Broker_status.h +++ b/broker/gen/model/Broker_status.h @@ -91,6 +91,13 @@ public: void setGpuCount(int32_t const value); bool gpuCountIsSet() const; void unsetGpu_count(); + /// + /// Version of the jfjoch_broker + /// + std::string getBrokerVersion() const; + void setBrokerVersion(std::string const& value); + bool brokerVersionIsSet() const; + void unsetBroker_version(); friend void to_json(nlohmann::json& j, const Broker_status& o); friend void from_json(const nlohmann::json& j, Broker_status& o); @@ -105,6 +112,8 @@ protected: bool m_Message_severityIsSet; int32_t m_Gpu_count; bool m_Gpu_countIsSet; + std::string m_Broker_version; + bool m_Broker_versionIsSet; }; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 92f500b6..925e168c 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -1334,6 +1334,10 @@ components: type: integer format: int32 description: Number of installed GPUs + broker_version: + type: string + description: Version of the jfjoch_broker + example: "1.0.0-rc.128" plot: type: object required: diff --git a/broker/redoc-static.html b/broker/redoc-static.html index d06d1936..3b90814d 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -763,7 +763,7 @@ This can only be done when detector is Idle, Error or
http://localhost:5232/config/dark_mask

Response samples

Content type
application/json
{
  • "detector_threshold_keV": 3.5,
  • "frame_time_us": 10000,
  • "number_of_frames": 1000,
  • "max_allowed_pixel_count": 1,
  • "max_frames_with_signal": 10
}

Get Jungfraujoch status

Status of the data acquisition

Responses

Response samples

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

Get status of FPGA devices

Responses

Response samples

Content type
application/json
{
  • "state": "Inactive",
  • "progress": 1,
  • "message": "string",
  • "message_severity": "success",
  • "gpu_count": 0,
  • "broker_version": "1.0.0-rc.128"
}

Get status of FPGA devices

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Return XFEL pulse IDs for the current data acquisition

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

Responses

Request samples

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

Response samples

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

Get general statistics

query Parameters
compression
boolean
Default: false

Enable DEFLATE compression of output data.

Responses

Response samples

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

Get data collection statistics

Results of the last data collection

+
http://localhost:5232/statistics

Response samples

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

Get data collection statistics

Results of the last data collection

Responses