diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 140944cc..02444b0d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,11 +83,11 @@ build:x86:frontend: - x86 needs: [] script: - - cd frontend_ui - - npm install - - npm run build + - mkdir build - cd build - - cp ../../broker/redoc-static.html . + - /usr/bin/cmake .. + - make frontend + - cd ../frontend_ui/build - tar czf ../../jfjoch_frontend.tar.gz * artifacts: paths: diff --git a/CMakeLists.txt b/CMakeLists.txt index 293c369d..acff982d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,6 +127,7 @@ IF (NOT JFJOCH_WRITER_ONLY) ADD_CUSTOM_COMMAND(OUTPUT frontend_ui/build/index.html COMMAND npm install COMMAND npm run build + COMMAND npm run redocly WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui) ADD_CUSTOM_TARGET(frontend DEPENDS frontend_ui/build/index.html) diff --git a/Dockerfile b/Dockerfile index 053da655..f79f2698 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM harbor.maxiv.lu.se/dockerhub/library/ubuntu:22.04 RUN set -ex; \ apt-get update; \ - apt-get install -y pkg-config git cmake make g++ libhdf5-dev libczmq-dev;\ + apt-get install -y pkg-config git cmake make g++;\ rm -rf /var/lib/apt/lists/* diff --git a/VERSION b/VERSION index 1fa52941..99c6b2af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0_rc.5 +1.0.0_rc.6 diff --git a/broker/JFJochBrokerHttp.cpp b/broker/JFJochBrokerHttp.cpp index bcd9135e..7a5c6e61 100644 --- a/broker/JFJochBrokerHttp.cpp +++ b/broker/JFJochBrokerHttp.cpp @@ -67,6 +67,7 @@ inline org::openapitools::server::model::Measurement_statistics Convert(const Me if (input.bkg_estimate) ret.setBkgEstimate(input.bkg_estimate.value()); + ret.setUnitCell(input.unit_cell); return ret; } diff --git a/broker/JFJochStateMachine.cpp b/broker/JFJochStateMachine.cpp index c33c4af2..09e0050b 100644 --- a/broker/JFJochStateMachine.cpp +++ b/broker/JFJochStateMachine.cpp @@ -402,6 +402,8 @@ void JFJochStateMachine::SetFullMeasurementOutput(const JFJochServicesOutput &ou tmp.detector_height = experiment.GetYPixelsNum(); tmp.detector_pixel_depth = experiment.GetPixelDepth(); tmp.images_expected = experiment.GetImageNum(); + tmp.unit_cell = experiment.GetUnitCellString(); + tmp.compression_ratio = output.receiver_output.status.compressed_ratio; tmp.collection_efficiency = output.receiver_output.efficiency; @@ -426,6 +428,8 @@ void JFJochStateMachine::ClearAndSetMeasurementStatistics() { tmp.detector_width = experiment.GetYPixelsNum(); tmp.detector_pixel_depth = experiment.GetPixelDepth(); tmp.images_expected = experiment.GetImageNum(); + tmp.unit_cell = experiment.GetUnitCellString(); + measurement_statistics = tmp; } @@ -445,6 +449,7 @@ std::optional JFJochStateMachine::GetMeasurementStatistic tmp.detector_height = experiment.GetYPixelsNum(); tmp.detector_pixel_depth = experiment.GetPixelDepth(); tmp.images_expected = experiment.GetImageNum(); + tmp.unit_cell = experiment.GetUnitCellString(); tmp.compression_ratio = rcv_status->compressed_ratio; tmp.images_collected = rcv_status->images_collected; diff --git a/broker/JFJochStateMachine.h b/broker/JFJochStateMachine.h index fddb6fbf..fb7f6d77 100644 --- a/broker/JFJochStateMachine.h +++ b/broker/JFJochStateMachine.h @@ -56,6 +56,8 @@ struct MeasurementStatistics { std::optional bkg_estimate; std::optional> beam_center_drift_pxl; + + std::string unit_cell; }; struct DetectorSettings { diff --git a/broker/gen/model/Measurement_statistics.cpp b/broker/gen/model/Measurement_statistics.cpp index 2346d4b9..cb04c716 100644 --- a/broker/gen/model/Measurement_statistics.cpp +++ b/broker/gen/model/Measurement_statistics.cpp @@ -51,6 +51,8 @@ Measurement_statistics::Measurement_statistics() m_Detector_pixel_depthIsSet = false; m_Bkg_estimate = 0.0f; m_Bkg_estimateIsSet = false; + m_Unit_cell = ""; + m_Unit_cellIsSet = false; } @@ -106,7 +108,7 @@ bool Measurement_statistics::validate(std::stringstream& msg, const std::string& } } - + return success; } @@ -158,7 +160,10 @@ bool Measurement_statistics::operator==(const Measurement_statistics& rhs) const ((!detectorPixelDepthIsSet() && !rhs.detectorPixelDepthIsSet()) || (detectorPixelDepthIsSet() && rhs.detectorPixelDepthIsSet() && getDetectorPixelDepth() == rhs.getDetectorPixelDepth())) && - ((!bkgEstimateIsSet() && !rhs.bkgEstimateIsSet()) || (bkgEstimateIsSet() && rhs.bkgEstimateIsSet() && getBkgEstimate() == rhs.getBkgEstimate())) + ((!bkgEstimateIsSet() && !rhs.bkgEstimateIsSet()) || (bkgEstimateIsSet() && rhs.bkgEstimateIsSet() && getBkgEstimate() == rhs.getBkgEstimate())) && + + + ((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell())) ; } @@ -201,6 +206,8 @@ void to_json(nlohmann::json& j, const Measurement_statistics& o) j["detector_pixel_depth"] = o.m_Detector_pixel_depth; if(o.bkgEstimateIsSet()) j["bkg_estimate"] = o.m_Bkg_estimate; + if(o.unitCellIsSet()) + j["unit_cell"] = o.m_Unit_cell; } @@ -281,6 +288,11 @@ void from_json(const nlohmann::json& j, Measurement_statistics& o) j.at("bkg_estimate").get_to(o.m_Bkg_estimate); o.m_Bkg_estimateIsSet = true; } + if(j.find("unit_cell") != j.end()) + { + j.at("unit_cell").get_to(o.m_Unit_cell); + o.m_Unit_cellIsSet = true; + } } @@ -539,6 +551,23 @@ void Measurement_statistics::unsetBkg_estimate() { m_Bkg_estimateIsSet = false; } +std::string Measurement_statistics::getUnitCell() const +{ + return m_Unit_cell; +} +void Measurement_statistics::setUnitCell(std::string const& value) +{ + m_Unit_cell = value; + m_Unit_cellIsSet = true; +} +bool Measurement_statistics::unitCellIsSet() const +{ + return m_Unit_cellIsSet; +} +void Measurement_statistics::unsetUnit_cell() +{ + m_Unit_cellIsSet = false; +} } // namespace org::openapitools::server::model diff --git a/broker/gen/model/Measurement_statistics.h b/broker/gen/model/Measurement_statistics.h index eba15a2a..278b9fba 100644 --- a/broker/gen/model/Measurement_statistics.h +++ b/broker/gen/model/Measurement_statistics.h @@ -163,6 +163,13 @@ public: void setBkgEstimate(float const value); bool bkgEstimateIsSet() const; void unsetBkg_estimate(); + /// + /// + /// + std::string getUnitCell() const; + void setUnitCell(std::string const& value); + bool unitCellIsSet() const; + void unsetUnit_cell(); friend void to_json(nlohmann::json& j, const Measurement_statistics& o); friend void from_json(const nlohmann::json& j, Measurement_statistics& o); @@ -197,6 +204,8 @@ protected: bool m_Detector_pixel_depthIsSet; float m_Bkg_estimate; bool m_Bkg_estimateIsSet; + std::string m_Unit_cell; + bool m_Unit_cellIsSet; }; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 01e9ba67..f30f520a 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -500,6 +500,8 @@ components: bkg_estimate: type: number format: float + unit_cell: + type: string broker_status: type: object required: diff --git a/broker/redoc-static.html b/broker/redoc-static.html index ce9ee474..cca0b980 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -749,7 +749,7 @@ Changing detector will set detector to Inactive state and will requ " class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk">

Everything OK

Response samples

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

Get calibration statistics

Response samples

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

Get calibration statistics

Statistics are provided for each module/storage cell separately

Responses