Skip to content

Commit

Permalink
first ideas to add an unknown component
Browse files Browse the repository at this point in the history
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
  • Loading branch information
So-Fras committed Mar 16, 2023
1 parent 2958346 commit fe1aef3
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public final class ComponentTypeName {
public static final String DANGLING_LINE = "DANGLING_LINE";
public static final String PHASE_SHIFT_TRANSFORMER = "PHASE_SHIFT_TRANSFORMER";
public static final String PHASE_SHIFT_TRANSFORMER_LEG = "PHASE_SHIFT_TRANSFORMER_LEG";
public static final String UNKNOWN_COMPONENT = "UNKNOWN_COMPONENT";

private ComponentTypeName() {
throw new AssertionError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

import com.powsybl.diagram.util.ValueFormatter;
import com.powsybl.sld.layout.LayoutParameters;
import com.powsybl.sld.library.AnchorPoint;
import com.powsybl.sld.library.Component;
import com.powsybl.sld.library.ComponentLibrary;
import com.powsybl.sld.library.ComponentSize;
import com.powsybl.sld.library.*;
import com.powsybl.sld.model.cells.Cell;
import com.powsybl.sld.model.coordinate.Direction;
import com.powsybl.sld.model.coordinate.Orientation;
Expand Down Expand Up @@ -573,6 +570,8 @@ protected void incorporateComponents(String prefixId, Graph graph, Node node, Po
transformComponent(node, shift, g);
if (componentLibrary.getSvgElements(componentType) != null) {
insertComponentSVGIntoDocumentSVG(prefixId, componentType, g, graph, node, labelProvider, styleProvider);
} else if (!(componentType.equals(PHASE_SHIFT_TRANSFORMER_LEG) || componentType.equals(TWO_WINDINGS_TRANSFORMER_LEG) || componentType.equals(THREE_WINDINGS_TRANSFORMER_LEG) || componentType.equals(DANGLING_LINE) || componentType.equals(BUSBAR_SECTION))) {
insertComponentSVGIntoDocumentSVG(prefixId, UNKNOWN_COMPONENT, g, graph, node, labelProvider, styleProvider);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
.sld-node {stroke: none; fill: black}
.sld-flash {stroke: none; fill: black}
.sld-lock {stroke: none; fill: black}
.sld-unknown {stroke: none; fill: black}
/* Fonts */
.sld-label {stroke: none; fill: black; font: 8px serif}
.sld-angle, .sld-voltage {font: 10px serif}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,35 @@
} ],
"styleClass" : "sld-lock"
}, {
"type" : "UNKNOWN_COMPONENT",
"anchorPoints" : [ {
"x" : 6.0,
"y" : 0.0,
"orientation" : "VERTICAL"
}, {
"x" : 6.0,
"y" : 12.0,
"orientation" : "VERTICAL"
}, {
"x" : 0.0,
"y" : 6.0,
"orientation" : "HORIZONTAL"
}, {
"x" : 12.0,
"y" : 6.0,
"orientation" : "HORIZONTAL"
} ],
"size" : {
"width" : 12.0,
"height" : 12.0
},
"transformations" : {},
"subComponents" : [ {
"name" : "UNKNOWN_COMPONENT",
"fileName" : "unknown-component.svg"
} ],
"styleClass" : "sld-unknown"
},{
"type" : "ARROW_ACTIVE",
"size" : {
"width" : 10.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.sld-node {stroke: none; fill: black}
.sld-flash {stroke: none; fill: black}
.sld-lock {stroke: none; fill: black}
.sld-unknown {stroke: none; fill: black}
/* Fonts */
.sld-label {stroke: none; fill: black; font: 8px serif}
.sld-angle, .sld-voltage {font: 10px serif}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,36 @@
],
"styleClass": "sld-node"
},
{
"type" : "UNKNOWN_COMPONENT",
"anchorPoints" : [ {
"x" : 6.0,
"y" : 0.0,
"orientation" : "VERTICAL"
}, {
"x" : 6.0,
"y" : 12.0,
"orientation" : "VERTICAL"
}, {
"x" : 0.0,
"y" : 6.0,
"orientation" : "HORIZONTAL"
}, {
"x" : 12.0,
"y" : 6.0,
"orientation" : "HORIZONTAL"
} ],
"size" : {
"width" : 12.0,
"height" : 12.0
},
"transformations" : {},
"subComponents" : [ {
"name" : "UNKNOWN_COMPONENT",
"fileName" : "unknown-component.svg"
} ],
"styleClass" : "sld-unknown"
},
{
"type": "ARROW_ACTIVE",
"size": {
Expand Down

0 comments on commit fe1aef3

Please sign in to comment.