Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu BAGUE <[email protected]>
  • Loading branch information
Mathieu BAGUE committed May 31, 2021
1 parent f5a3e37 commit 725d8fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/iidm/converter/xml/TerminalRefXml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ void TerminalRefXml::writeTerminalRef(const Terminal& terminal, NetworkXmlWriter
if (!context.getFilter().test(c)) {
throw PowsyblException(stdcxx::format("Oups, terminal ref point to a filtered equipment %1%", c.get().getId()));
}
if (terminal.getVoltageLevel().getTopologyKind() == TopologyKind::NODE_BREAKER
&& context.getOptions().getTopologyLevel() != TopologyLevel::NODE_BREAKER
&& stdcxx::isInstanceOf<BusbarSection>(terminal.getConnectable())) {
if (terminal.getVoltageLevel().getTopologyKind() == TopologyKind::NODE_BREAKER &&
context.getOptions().getTopologyLevel() != TopologyLevel::NODE_BREAKER &&
stdcxx::isInstanceOf<BusbarSection>(terminal.getConnectable())) {
throw PowsyblException(stdcxx::format("Terminal ref should not point to a busbar section (here %1%). Try to export in node-breaker or delete this terminal ref.", terminal.getConnectable().get().getId()));
}
writer.writeStartElement(nsPrefix, elementName);
Expand Down
3 changes: 2 additions & 1 deletion test/iidm/NodeBreakerVoltageLevelTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,9 +1231,10 @@ BOOST_AUTO_TEST_CASE(NbkComprehensiveErrorMessage) {
stdcxx::Properties properties;
properties.set(converter::ExportOptions::TOPOLOGY_LEVEL, "NODE_BREAKER");

std::stringstream ss;

// make sure no error is thrown while exporting to NODE_BREAKER topology
BOOST_CHECK_NO_THROW({
std::stringstream ss;
Network::writeXml("network.xiidm", ss, network, converter::ExportOptions(properties));
Network::readXml("network.xiidm", ss);
});
Expand Down

0 comments on commit 725d8fc

Please sign in to comment.