Skip to content

Commit

Permalink
looking for ospModelDescr at model path
Browse files Browse the repository at this point in the history
  • Loading branch information
levi committed Apr 15, 2020
1 parent dc8dc3c commit ad64b6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cpp/cse_config_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <cse/exception.hpp>
#include <cse/log/logger.hpp>
#include <cse/utility/utility.hpp>
#include <cse/uri.hpp>

#include <boost/lexical_cast.hpp>
#include <xercesc/dom/DOM.hpp>
Expand Down Expand Up @@ -996,9 +997,15 @@ std::pair<execution, simulator_map> load_cse_config(
}

std::string msmiFileName = model->description()->name + "_OspModelDescription.xml";
const auto msmiFilePath = configFile.parent_path() / msmiFileName;
const auto modelUri = resolve_reference(baseURI, simulator.source);
auto msmiFilePath = file_uri_to_path(modelUri).remove_leaf() / msmiFileName;
if (boost::filesystem::exists(msmiFilePath)) {
emds.emplace(simulator.name, msmiFilePath);
} else {
msmiFilePath = configFile.parent_path() / msmiFileName;
if (boost::filesystem::exists(msmiFilePath)) {
emds.emplace(simulator.name, msmiFilePath);
}
}
}

Expand Down

0 comments on commit ad64b6a

Please sign in to comment.