Skip to content

Commit

Permalink
Fix contingency element deserializer (#1704)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
  • Loading branch information
geofjamg authored and flo-dup committed Apr 28, 2021
1 parent 54d61fb commit c7b2e07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public ContingencyElement deserialize(JsonParser parser, DeserializationContext
case DANGLING_LINE:
return new DanglingLineContingency(id);

case LINE:
return new LineContingency(id, voltageLevelId);

case TWO_WINDINGS_TRANSFORMER:
return new TwoWindingsTransformerContingency(id, voltageLevelId);

default:
throw new AssertionError("Unexpected ContingencyElementType value: " + type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ private static Contingency create() {
.addStaticVarCompensator("SVC")
.addBusbarSection("BBS1")
.addDanglingLine("DL1")
.addLine("LINE1")
.addTwoWindingsTransformer("TRANSFO1")
.build();

contingency.addExtension(DummyExtension.class, new DummyExtension());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
}, {
"id" : "DL1",
"type" : "DANGLING_LINE"
}, {
"id" : "LINE1",
"type" : "LINE"
}, {
"id" : "TRANSFO1",
"type" : "TWO_WINDINGS_TRANSFORMER"
} ],
"extensions" : {
"dummy-extension" : { }
Expand Down

0 comments on commit c7b2e07

Please sign in to comment.