Skip to content

Commit

Permalink
feat(#352): Enhancement debind also extrefs when voltageLevel@name un…
Browse files Browse the repository at this point in the history
…known

Signed-off-by: Aliou DIAITE <aliou.diaite@rte-france.com>
  • Loading branch information
AliouDIAITE committed Jan 5, 2024
1 parent 79e222e commit 9176627
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,11 @@ public void debindCompasFlowsAndExtRefsBasedOnVoltageLevel(SCL scd) {
.filter(TCompasFlow::isSetFlowSourceVoltageLevel)
.filter(TCompasFlow::isSetExtRefiedName)
.forEach(tCompasFlow -> {
if (flowSource == null) {
//debind all compas flow
extRefService.clearCompasFlowBinding(tCompasFlow);
} else if (!tCompasFlow.getFlowSourceVoltageLevel().equals(flowSource)) {
//debind extRef
if (!tCompasFlow.getFlowSourceVoltageLevel().equals(flowSource)) {
//debind extRefs correspondind to compas flow
extRefService.getMatchingExtRefs(tlDevice, tCompasFlow)
.forEach(extRefService::clearExtRefBinding);
//debind compas flow
//debind all compas flow
extRefService.clearCompasFlowBinding(tCompasFlow);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ private static Stream<Arguments> provideFlowAndExtRefForDebinding(){
return Stream.of(
Arguments.of("case known voltageLevel should debind THT flow and corresponding ExtRef", scd, tupleExtRef1, tupleFlow1, tupleExtRefDebind, tupleFlowDebind),
Arguments.of("case voltageLevel 0 should do nothing", scdVoltageLevel0, tupleExtRef1, tupleFlow1, tupleExtRef2, tupleFlow2),
Arguments.of("case unknown voltageLevel should debind all", scdVoltageLevelUnknown, tupleExtRef1, tupleFlowDebind, tupleExtRef2, tupleFlowDebind),
Arguments.of("case unknown voltageLevel should debind all CompasFlow and corresponding ExtRef", scdVoltageLevelUnknown, tupleExtRefDebind, tupleFlowDebind, tupleExtRefDebind, tupleFlowDebind),
Arguments.of("case known voltageLevel should not debind because no ExtRefIedName", scdUnsetExtRefIedName, tupleExtRef1, tupleFlow1, tupleExtRef2, tupleFlowNoExtRefIedName),
Arguments.of("case unknown voltageLevel should not debind because unset FlowSourceVoltageLevel", scdVLevelUnknownUnsetFlowSourceVoltageLevel, tupleExtRef1, tupleFlow1, tupleExtRef2, tupleFlow2)
);
Expand Down

0 comments on commit 9176627

Please sign in to comment.