| 136 | } |
| 137 | |
| 138 | void OSWorkflow::updateLastWeatherFileFromModel() { |
| 139 | LOG(Debug, "Find model's weather file and update LastEpwFilePath"); |
| 140 | if (auto epwFile_ = model.weatherFile()) { |
| 141 | if (auto epwPath_ = epwFile_->path()) { |
| 142 | LOG(Debug, "Search for weather file " << epwPath_.get()); |
| 143 | auto epwFullPath_ = workflowJSON.findFile(epwPath_.get()); |
| 144 | if (!epwFullPath_) { |
| 145 | auto epwFullPath_ = workflowJSON.findFile(epwPath_->filename()); |
| 146 | } |
| 147 | if (!epwFullPath_) { |
| 148 | throw std::runtime_error(fmt::format("Weather file {} specified but cannot be found", epwPath_->string())); |
| 149 | } |
| 150 | |
| 151 | epwPath = epwFullPath_.get(); |
| 152 | runner.setLastEpwFilePath(epwPath); |
| 153 | |
| 154 | return; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | LOG(Debug, "Weather file is not defined by the model"); |
| 159 | } |
| 160 | |
| 161 | void OSWorkflow::saveModelicaFileToPath(const openstudio::path& filePath) { |
| 162 | if (!modelicaFile) { |
nothing calls this directly
no test coverage detected