MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / bcl_measures

Method bcl_measures

src/cli/MeasureManager.cpp:751–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

749}
750
751MeasureManagerServer::ResponseType MeasureManagerServer::bcl_measures([[maybe_unused]] const web::json::value& body) {
752 const bool force_reload = false; // Not supposed to mess with the BCL Measures!
753 auto& localBCL = openstudio::LocalBCL::instance();
754 std::vector<web::json::value> result;
755 for (auto& measure : localBCL.measures()) {
756 auto measureDir = measure.directory();
757 if (boost::optional<BCLMeasure> measure_ = m_measureManager.getMeasure(measureDir, force_reload)) {
758 result.emplace_back(toWebJSON(measure_->toJSON()));
759 } else {
760 fmt::print("Directory '{}' is not a measure\n", measureDir.generic_string());
761 }
762 }
763
764 return {web::http::status_codes::OK, web::json::value::array(result)};
765}
766
767MeasureManagerServer::ResponseType MeasureManagerServer::update_measures(const web::json::value& body) {
768 auto measuresDir = get_field<openstudio::path>(body, "measures_dir", my_measures_dir);

Callers

nothing calls this directly

Calls 5

toWebJSONFunction · 0.85
measuresMethod · 0.80
directoryMethod · 0.45
getMeasureMethod · 0.45
toJSONMethod · 0.45

Tested by

no test coverage detected