Skip to content

Commit

Permalink
#810 Add an error if the steady state simulation did not generate a f…
Browse files Browse the repository at this point in the history
…inal state IIDM file

Signed-off-by: Dimitri Baron <[email protected]>
  • Loading branch information
barondim committed Jan 17, 2025
1 parent a6ef06e commit f83a962
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions etc/Dictionaries/DFLError_en_GB.dic
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ ContextProcessError = processing of the network %1% failed
ConnexityError = slack node of id %1% not present in main connex component
NetworkHasNoRegulatingGenerator = network file %1% has no generator regulating voltage in the main connex component
SlackNodeNotFound = no slack node found for network '%1%'
MissingFinalStateIIDMFile = steady state simulation did not generate a final state IIDM file
12 changes: 6 additions & 6 deletions sources/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ void Context::execute() {
mapData_[lostEquipementsFileRelativePath.generic_string()] = lostEquipmentsStream.str();

const boost::optional<boost::filesystem::path>& iidmFilePath = simu->getExportIIDMFile();
if (iidmFilePath.is_initialized()) {
std::stringstream outputIIDMStream;
simu->dumpIIDMFile(outputIIDMStream);
const boost::filesystem::path iidmFileRelativePath = boost::filesystem::relative(*iidmFilePath, config_.outputDir());
mapData_[iidmFileRelativePath.generic_string()] = outputIIDMStream.str();
}
if (!iidmFilePath.is_initialized())
throw Error(MissingFinalStateIIDMFile);
std::stringstream outputIIDMStream;
simu->dumpIIDMFile(outputIIDMStream);
const boost::filesystem::path iidmFileRelativePath = boost::filesystem::relative(*iidmFilePath, config_.outputDir());
mapData_[iidmFileRelativePath.generic_string()] = outputIIDMStream.str();

const std::vector<boost::shared_ptr<job::AppenderEntry> >& jobLogAppenders = jobEntry_->getOutputsEntry()->getLogsEntry()->getAppenderEntries();
for (const boost::shared_ptr<job::AppenderEntry>& jobLogAppender : jobLogAppenders) {
Expand Down

0 comments on commit f83a962

Please sign in to comment.