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

Method get_model

src/cli/MeasureManager.cpp:738–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736}
737
738MeasureManagerServer::ResponseType MeasureManagerServer::get_model(const web::json::value& body) {
739 if (auto osmPath_ = get_field<openstudio::path>(body, "osm_path")) {
740 auto osmInfo_ = m_measureManager.getModel(*osmPath_);
741 if (osmInfo_) {
742 return {web::http::status_codes::OK, toWebJSON(fmt::format("OK, loaded model with checksum {}", osmInfo_->checksum))};
743 } else {
744 return {web::http::status_codes::BadRequest, toWebJSON(fmt::format("Wrong osm path: '{}'", osmPath_->generic_string()))};
745 }
746 } else {
747 return {web::http::status_codes::BadRequest, toWebJSON("The 'osm_path' (string/path) must be in the post data")};
748 }
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!

Callers

nothing calls this directly

Calls 2

toWebJSONFunction · 0.85
getModelMethod · 0.80

Tested by

no test coverage detected