Skip to content

Commit

Permalink
CGMES import: CN is a property of DLs (can not be unique to a DL) (#2508
Browse files Browse the repository at this point in the history
)

Signed-off-by: VEDELAGO MIORA <miora.ralambotiana@rte-france.com>
  • Loading branch information
miovd committed Mar 30, 2023
1 parent 35ff4ad commit 60914d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void convertToDanglingLine(int boundarySide, double r, double x, double g
dl.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + "Terminal", terminalId(boundarySide == 1 ? 2 : 1)); // TODO: delete when aliases are correctly handled by mergedlines
Optional.ofNullable(topologicalNodeId(boundarySide)).ifPresent(tn -> dl.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.TOPOLOGICAL_NODE_BOUNDARY, tn));
Optional.ofNullable(connectivityNodeId(boundarySide)).ifPresent(cn ->
dl.addAlias(cn, Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY)
dl.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY, cn)
);
context.namingStrategy().readIdMapping(dl, type);
setBoundaryNodeInfo(boundaryNode, dl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ private static String writeDanglingLineConnectivity(DanglingLine danglingLine, S
String connectivityNodeId = null;
if (context.writeConnectivityNodes()) {
// We keep the connectivity node from the boundary definition as an alias in the dangling line
if (danglingLine.getAliasFromType(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY).isPresent()) {
connectivityNodeId = context.getNamingStrategy().getCgmesIdFromAlias(danglingLine, Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY);
if (danglingLine.hasProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY)) {
connectivityNodeId = context.getNamingStrategy().getCgmesIdFromProperty(danglingLine, Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY);
} else {
// If no information about original boundary has been preserved in the IIDM model,
// we create a new ConnectivityNode in a fictitious Substation and Voltage Level
Expand All @@ -633,7 +633,7 @@ private static String writeDanglingLineConnectivity(DanglingLine danglingLine, S
connectivityNodeId = CgmesExportUtil.getUniqueId();
String connectivityNodeContainerId = createFictitiousContainerFor(danglingLine, baseVoltageId, cimNamespace, writer, context);
ConnectivityNodeEq.write(connectivityNodeId, danglingLine.getNameOrId() + "_NODE", connectivityNodeContainerId, cimNamespace, writer, context);
danglingLine.addAlias(connectivityNodeId, Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY);
danglingLine.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY, connectivityNodeId);
}
} else {
if (danglingLine.getProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.TOPOLOGICAL_NODE_BOUNDARY) == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ void testFromIidmDanglingLineNodeBreaker() throws IOException {
// For this test we chose the Conformity MicroGrid BaseCase
ResourceSet boundaries = Cgmes3Catalog.microGridBaseCaseBoundaries();
String boundaryCN = "b675a570-cb6e-11e1-bcee-406c8f32ef58";
expected.addAlias(boundaryCN, Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY);
expected.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + CgmesNames.CONNECTIVITY_NODE_BOUNDARY, boundaryCN);
// We inform the identifier of the boundaries we depend on
Properties exportParameters = new Properties();
exportParameters.put(CgmesExport.BOUNDARY_EQ_ID, "urn:uuid:536f9bf1-3f8f-a546-87e3-7af2272f29b7");
Expand Down

0 comments on commit 60914d6

Please sign in to comment.