Skip to content

Commit

Permalink
Add three windings transformers for expert filters [Thang's suggestion]
Browse files Browse the repository at this point in the history
  • Loading branch information
thangqp committed Jul 24, 2024
1 parent 612a07d commit 3e59b36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ private static String getRatioTapChangerFieldValue(FieldType field, @Nullable Ra
LOAD_TAP_CHANGING_CAPABILITIES_1,
LOAD_TAP_CHANGING_CAPABILITIES_2,
LOAD_TAP_CHANGING_CAPABILITIES_3 -> String.valueOf(ratioTapChanger.hasLoadTapChangingCapabilities());
case RATIO_REGULATION_MODE, RATIO_REGULATION_MODE_1, RATIO_REGULATION_MODE_2, RATIO_REGULATION_MODE_3
-> String.valueOf(getRatioRegulationMode(ratioTapChanger));
case RATIO_REGULATION_MODE,
RATIO_REGULATION_MODE_1,
RATIO_REGULATION_MODE_2,
RATIO_REGULATION_MODE_3 -> String.valueOf(getRatioRegulationMode(ratioTapChanger));
default -> throw new PowsyblException(FIELD_AND_TYPE_NOT_IMPLEMENTED + " [" + field + ",ratioTapChanger]");
};
}
Expand Down Expand Up @@ -332,7 +334,10 @@ private static String getPhaseTapChangerFieldValue(FieldType field, @Nullable Ph
PHASE_REGULATION_VALUE_1,
PHASE_REGULATION_VALUE_2,
PHASE_REGULATION_VALUE_3 -> String.valueOf(phaseTapChanger.getRegulationValue());
case PHASE_REGULATION_MODE, PHASE_REGULATION_MODE_1, PHASE_REGULATION_MODE_2, PHASE_REGULATION_MODE_3 -> String.valueOf(getPhaseRegulationMode(phaseTapChanger));
case PHASE_REGULATION_MODE,
PHASE_REGULATION_MODE_1,
PHASE_REGULATION_MODE_2,
PHASE_REGULATION_MODE_3 -> String.valueOf(getPhaseRegulationMode(phaseTapChanger));
default -> throw new PowsyblException(FIELD_AND_TYPE_NOT_IMPLEMENTED + " [" + field + ",phaseTapChanger]");
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,16 @@ private static Stream<Arguments> provideArgumentsForThreeWindingTransformerTest(
// RatioTapChanger fields
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_1, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_1, false, threeWindingsTransformer, false),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_3, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_3, false, threeWindingsTransformer, false),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_2, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_2, false, threeWindingsTransformer, false),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_3, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_3, false, threeWindingsTransformer, false),
Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_1, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_1, false, threeWindingsTransformer, false),
Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_2, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_2, false, threeWindingsTransformer, false),
Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_3, true, threeWindingsTransformer, true),
Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_3, false, threeWindingsTransformer, false),

// PhaseTapChanger fields
Arguments.of(EQUALS, FieldType.HAS_PHASE_TAP_CHANGER_1, true, threeWindingsTransformer, false),
Expand All @@ -424,8 +427,11 @@ private static Stream<Arguments> provideArgumentsForThreeWindingTransformerTest(
Arguments.of(NOT_EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_3, false, threeWindingsTransformer, true),
Arguments.of(NOT_EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES_3, true, threeWindingsTransformer, false),
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_1, true, threeWindingsTransformer, false),
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_1, false, threeWindingsTransformer, true),
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_2, true, threeWindingsTransformer, false),
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_2, false, threeWindingsTransformer, true),
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_3, true, threeWindingsTransformer, false),
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_3, false, threeWindingsTransformer, true),

// null RatioTapChanger
Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER_1, false, threeWindingsTransformer2, false),
Expand Down

0 comments on commit 3e59b36

Please sign in to comment.