| 736 | } |
| 737 | |
| 738 | MeasureManagerServer::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 | |
| 751 | MeasureManagerServer::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! |