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

Method updateLastWeatherFileFromModel

src/workflow/OSWorkflow.cpp:138–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void 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
161void OSWorkflow::saveModelicaFileToPath(const openstudio::path& filePath) {
162 if (!modelicaFile) {

Callers

nothing calls this directly

Calls 7

findFileMethod · 0.80
filenameMethod · 0.80
setLastEpwFilePathMethod · 0.80
weatherFileMethod · 0.45
pathMethod · 0.45
getMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected