| 765 | } |
| 766 | |
| 767 | MeasureManagerServer::ResponseType MeasureManagerServer::update_measures(const web::json::value& body) { |
| 768 | auto measuresDir = get_field<openstudio::path>(body, "measures_dir", my_measures_dir); |
| 769 | const bool force_reload = get_field<bool>(body, "force_reload", false); |
| 770 | |
| 771 | // Scan the directory for measures |
| 772 | std::vector<web::json::value> result; |
| 773 | for (const auto& dirEnt : openstudio::filesystem::directory_iterator{measuresDir}) { |
| 774 | if (openstudio::filesystem::is_directory(dirEnt)) { |
| 775 | const auto& measureDir = dirEnt.path(); |
| 776 | if (boost::optional<BCLMeasure> measure_ = m_measureManager.getMeasure(measureDir, force_reload)) { |
| 777 | result.emplace_back(toWebJSON(measure_->toJSON())); |
| 778 | } else { |
| 779 | fmt::print("Directory '{}' is not a measure\n", measureDir.generic_string()); |
| 780 | } |
| 781 | } |
| 782 | } |
| 783 | |
| 784 | return {web::http::status_codes::OK, web::json::value::array(result)}; |
| 785 | } |
| 786 | |
| 787 | MeasureManagerServer::ResponseType MeasureManagerServer::compute_arguments(const web::json::value& body) { |
| 788 | openstudio::path measureDir; |
nothing calls this directly
no test coverage detected