From d4b03fba0d7bb0fbfad9e3ff59b543590c9a34de Mon Sep 17 00:00:00 2001 From: FranckLecuyer <47824306+FranckLecuyer@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:40:18 +0200 Subject: [PATCH] Fix on expert filter for two windings transformer (#30) * Remove RATIO_REGULATING and PHASE_REGULATING fields for expert filter on two windings transformer. Change options for RATIO_REGULATION_MODE field. Change evaluation for rule using RATIO_REGULATION_MODE and PHASE_REGULATION_MODE fields. Signed-off-by: Franck LECUYER --- .../utils/expertfilter/ExpertFilterUtils.java | 36 ++++-- .../filter/utils/expertfilter/FieldType.java | 2 - .../expertfilter/RatioRegulationModeType.java | 15 +++ .../expertfilter/BooleanExpertRuleTest.java | 10 -- .../expertfilter/EnumExpertRuleTest.java | 111 ++++++++++++++---- 5 files changed, 134 insertions(+), 40 deletions(-) create mode 100644 src/main/java/org/gridsuite/filter/utils/expertfilter/RatioRegulationModeType.java diff --git a/src/main/java/org/gridsuite/filter/utils/expertfilter/ExpertFilterUtils.java b/src/main/java/org/gridsuite/filter/utils/expertfilter/ExpertFilterUtils.java index a56c039..b858898 100644 --- a/src/main/java/org/gridsuite/filter/utils/expertfilter/ExpertFilterUtils.java +++ b/src/main/java/org/gridsuite/filter/utils/expertfilter/ExpertFilterUtils.java @@ -251,27 +251,49 @@ private static String getSubstationFieldValue(FieldType field, Substation substa }; } + private static String getRatioRegulationMode(RatioTapChanger ratioTapChanger) { + if (ratioTapChanger.hasLoadTapChangingCapabilities() && ratioTapChanger.isRegulating()) { + return RatioRegulationModeType.VOLTAGE_REGULATION.name(); + } else if (!ratioTapChanger.isRegulating()) { + return RatioRegulationModeType.FIXED_RATIO.name(); + } else { + return null; + } + } + private static String getRatioTapChangerFieldValue(FieldType field, @Nullable RatioTapChanger ratioTapChanger) { if (ratioTapChanger == null) { return null; } return switch (field) { - case RATIO_REGULATING -> String.valueOf(ratioTapChanger.isRegulating()); case RATIO_TARGET_V -> String.valueOf(ratioTapChanger.getTargetV()); case LOAD_TAP_CHANGING_CAPABILITIES -> String.valueOf(ratioTapChanger.hasLoadTapChangingCapabilities()); - case RATIO_REGULATION_MODE -> ratioTapChanger.getRegulationMode() != null ? ratioTapChanger.getRegulationMode().name() : null; + case RATIO_REGULATION_MODE -> String.valueOf(getRatioRegulationMode(ratioTapChanger)); default -> throw new PowsyblException(FIELD_AND_TYPE_NOT_IMPLEMENTED + " [" + field + ",ratioTapChanger]"); }; } + private static String getPhaseRegulationMode(PhaseTapChanger phaseTapChanger) { + if (phaseTapChanger.getRegulationMode() == PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL && phaseTapChanger.isRegulating()) { + return PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name(); + } else if (phaseTapChanger.getRegulationMode() == PhaseTapChanger.RegulationMode.CURRENT_LIMITER && phaseTapChanger.isRegulating()) { + return PhaseTapChanger.RegulationMode.CURRENT_LIMITER.name(); + } else if (phaseTapChanger.getRegulationMode() == PhaseTapChanger.RegulationMode.FIXED_TAP || + phaseTapChanger.getRegulationMode() == PhaseTapChanger.RegulationMode.CURRENT_LIMITER && !phaseTapChanger.isRegulating() || + phaseTapChanger.getRegulationMode() == PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL && !phaseTapChanger.isRegulating()) { + return PhaseTapChanger.RegulationMode.FIXED_TAP.name(); + } else { + return null; + } + } + private static String getPhaseTapChangerFieldValue(FieldType field, @Nullable PhaseTapChanger phaseTapChanger) { if (phaseTapChanger == null) { return null; } return switch (field) { - case PHASE_REGULATING -> String.valueOf(phaseTapChanger.isRegulating()); case PHASE_REGULATION_VALUE -> String.valueOf(phaseTapChanger.getRegulationValue()); - case PHASE_REGULATION_MODE -> phaseTapChanger.getRegulationMode() != null ? phaseTapChanger.getRegulationMode().name() : null; + case PHASE_REGULATION_MODE -> String.valueOf(getPhaseRegulationMode(phaseTapChanger)); default -> throw new PowsyblException(FIELD_AND_TYPE_NOT_IMPLEMENTED + " [" + field + ",phaseTapChanger]"); }; } @@ -293,13 +315,11 @@ private static String getTwoWindingsTransformerFieldValue(FieldType field, Strin case MAGNETIZING_CONDUCTANCE -> String.valueOf(twoWindingsTransformer.getG()); case MAGNETIZING_SUSCEPTANCE -> String.valueOf(twoWindingsTransformer.getB()); case HAS_RATIO_TAP_CHANGER -> String.valueOf(twoWindingsTransformer.hasRatioTapChanger()); - case RATIO_REGULATING, - RATIO_TARGET_V, + case RATIO_TARGET_V, LOAD_TAP_CHANGING_CAPABILITIES, RATIO_REGULATION_MODE -> getRatioTapChangerFieldValue(field, twoWindingsTransformer.getRatioTapChanger()); case HAS_PHASE_TAP_CHANGER -> String.valueOf(twoWindingsTransformer.hasPhaseTapChanger()); - case PHASE_REGULATING, - PHASE_REGULATION_MODE, + case PHASE_REGULATION_MODE, PHASE_REGULATION_VALUE -> getPhaseTapChangerFieldValue(field, twoWindingsTransformer.getPhaseTapChanger()); case SUBSTATION_PROPERTIES_1 -> twoWindingsTransformer.getTerminal1().getVoltageLevel().getNullableSubstation().getProperty(propertyName); case SUBSTATION_PROPERTIES_2 -> twoWindingsTransformer.getTerminal2().getVoltageLevel().getNullableSubstation().getProperty(propertyName); diff --git a/src/main/java/org/gridsuite/filter/utils/expertfilter/FieldType.java b/src/main/java/org/gridsuite/filter/utils/expertfilter/FieldType.java index 351bc12..74f8a2c 100644 --- a/src/main/java/org/gridsuite/filter/utils/expertfilter/FieldType.java +++ b/src/main/java/org/gridsuite/filter/utils/expertfilter/FieldType.java @@ -62,12 +62,10 @@ public enum FieldType { MAGNETIZING_SUSCEPTANCE, LOAD_TYPE, HAS_RATIO_TAP_CHANGER, - RATIO_REGULATING, LOAD_TAP_CHANGING_CAPABILITIES, RATIO_REGULATION_MODE, RATIO_TARGET_V, HAS_PHASE_TAP_CHANGER, - PHASE_REGULATING, PHASE_REGULATION_MODE, PHASE_REGULATION_VALUE, FREE_PROPERTIES, diff --git a/src/main/java/org/gridsuite/filter/utils/expertfilter/RatioRegulationModeType.java b/src/main/java/org/gridsuite/filter/utils/expertfilter/RatioRegulationModeType.java new file mode 100644 index 0000000..f1e86c2 --- /dev/null +++ b/src/main/java/org/gridsuite/filter/utils/expertfilter/RatioRegulationModeType.java @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package org.gridsuite.filter.utils.expertfilter; + +/** + * @author Franck Lecuyer + */ +public enum RatioRegulationModeType { + VOLTAGE_REGULATION, + FIXED_RATIO +} diff --git a/src/test/java/org/gridsuite/filter/expertfilter/BooleanExpertRuleTest.java b/src/test/java/org/gridsuite/filter/expertfilter/BooleanExpertRuleTest.java index 985cbdd..ef96be0 100644 --- a/src/test/java/org/gridsuite/filter/expertfilter/BooleanExpertRuleTest.java +++ b/src/test/java/org/gridsuite/filter/expertfilter/BooleanExpertRuleTest.java @@ -263,15 +263,11 @@ private static Stream provideArgumentsForTwoWindingTransformerTest() Arguments.of(EQUALS, FieldType.CONNECTED_2, false, twoWindingsTransformer, false), // RatioTapChanger fields - Arguments.of(EQUALS, FieldType.RATIO_REGULATING, true, twoWindingsTransformer, true), - Arguments.of(EQUALS, FieldType.RATIO_REGULATING, false, twoWindingsTransformer, false), Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES, true, twoWindingsTransformer, true), Arguments.of(EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES, false, twoWindingsTransformer, false), Arguments.of(EQUALS, FieldType.HAS_RATIO_TAP_CHANGER, true, twoWindingsTransformer, true), // PhaseTapChanger fields - Arguments.of(EQUALS, FieldType.PHASE_REGULATING, false, twoWindingsTransformer, true), - Arguments.of(EQUALS, FieldType.PHASE_REGULATING, true, twoWindingsTransformer, false), Arguments.of(EQUALS, FieldType.HAS_PHASE_TAP_CHANGER, true, twoWindingsTransformer, true), // --- NOT_EQUALS--- // @@ -282,23 +278,17 @@ private static Stream provideArgumentsForTwoWindingTransformerTest() Arguments.of(NOT_EQUALS, FieldType.CONNECTED_2, true, twoWindingsTransformer, false), // RatioTapChanger fields - Arguments.of(NOT_EQUALS, FieldType.RATIO_REGULATING, false, twoWindingsTransformer, true), - Arguments.of(NOT_EQUALS, FieldType.RATIO_REGULATING, true, twoWindingsTransformer, false), Arguments.of(NOT_EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES, false, twoWindingsTransformer, true), Arguments.of(NOT_EQUALS, FieldType.LOAD_TAP_CHANGING_CAPABILITIES, true, twoWindingsTransformer, false), Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER, true, twoWindingsTransformer, false), // null RatioTapChanger - Arguments.of(NOT_EQUALS, FieldType.RATIO_REGULATING, false, twoWindingsTransformer2, false), Arguments.of(NOT_EQUALS, FieldType.HAS_RATIO_TAP_CHANGER, false, twoWindingsTransformer2, false), // PhaseTapChanger fields - Arguments.of(NOT_EQUALS, FieldType.PHASE_REGULATING, true, twoWindingsTransformer, true), - Arguments.of(NOT_EQUALS, FieldType.PHASE_REGULATING, false, twoWindingsTransformer, false), Arguments.of(NOT_EQUALS, FieldType.HAS_PHASE_TAP_CHANGER, true, twoWindingsTransformer, false), // null PhaseTapChanger - Arguments.of(NOT_EQUALS, FieldType.PHASE_REGULATING, false, twoWindingsTransformer2, false), Arguments.of(NOT_EQUALS, FieldType.HAS_PHASE_TAP_CHANGER, false, twoWindingsTransformer2, false) ); } diff --git a/src/test/java/org/gridsuite/filter/expertfilter/EnumExpertRuleTest.java b/src/test/java/org/gridsuite/filter/expertfilter/EnumExpertRuleTest.java index 89001e7..e33b523 100644 --- a/src/test/java/org/gridsuite/filter/expertfilter/EnumExpertRuleTest.java +++ b/src/test/java/org/gridsuite/filter/expertfilter/EnumExpertRuleTest.java @@ -7,6 +7,7 @@ import org.gridsuite.filter.utils.RegulationType; import org.gridsuite.filter.utils.expertfilter.FieldType; import org.gridsuite.filter.utils.expertfilter.OperatorType; +import org.gridsuite.filter.utils.expertfilter.RatioRegulationModeType; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -34,8 +35,8 @@ public void setUp() { @MethodSource({ "provideArgumentsForTestWithException" }) - void testEvaluateRuleWithException(OperatorType operator, FieldType field, Identifiable equipment, Class expectedException) { - EnumExpertRule rule = EnumExpertRule.builder().operator(operator).field(field).build(); + void testEvaluateRuleWithException(OperatorType operator, FieldType field, Identifiable equipment, String value, Set values, Class expectedException) { + EnumExpertRule rule = EnumExpertRule.builder().operator(operator).field(field).value(value).values(values).build(); assertThrows(expectedException, () -> rule.evaluateRule(equipment, filterLoader, new HashMap<>())); } @@ -72,25 +73,41 @@ static Stream provideArgumentsForTestWithException() { TwoWindingsTransformer twoWindingsTransformer = Mockito.mock(TwoWindingsTransformer.class); Mockito.when(twoWindingsTransformer.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + RatioTapChanger ratioTapChanger = Mockito.mock(RatioTapChanger.class); + Mockito.when(twoWindingsTransformer.getRatioTapChanger()).thenReturn(ratioTapChanger); + Mockito.when(ratioTapChanger.getRegulationMode()).thenReturn(RatioTapChanger.RegulationMode.VOLTAGE); + + PhaseTapChanger phaseTapChanger = Mockito.mock(PhaseTapChanger.class); + Mockito.when(twoWindingsTransformer.getPhaseTapChanger()).thenReturn(phaseTapChanger); + Mockito.when(phaseTapChanger.getRegulationMode()).thenReturn(PhaseTapChanger.RegulationMode.CURRENT_LIMITER); + StaticVarCompensator svar = Mockito.mock(StaticVarCompensator.class); Mockito.when(svar.getType()).thenReturn(IdentifiableType.STATIC_VAR_COMPENSATOR); return Stream.of( // --- Test an unsupported field for each equipment --- // - Arguments.of(EQUALS, FieldType.RATED_S, network, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, voltageLevel, PowsyblException.class), - Arguments.of(EQUALS, FieldType.P0, generator, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, load, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, shuntCompensator, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, bus, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, busbarSection, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, battery, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, substation, PowsyblException.class), - Arguments.of(EQUALS, FieldType.P0, twoWindingsTransformer, PowsyblException.class), - Arguments.of(EQUALS, FieldType.RATED_S, svar, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, network, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, voltageLevel, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.P0, generator, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, load, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, shuntCompensator, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, bus, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, busbarSection, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, battery, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, substation, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.P0, twoWindingsTransformer, null, null, PowsyblException.class), + Arguments.of(EQUALS, FieldType.RATED_S, svar, null, null, PowsyblException.class), // --- Test an unsupported operator for this rule type --- // - Arguments.of(IS, FieldType.ENERGY_SOURCE, generator, PowsyblException.class) + Arguments.of(IS, FieldType.ENERGY_SOURCE, generator, null, null, PowsyblException.class), + Arguments.of(IS, FieldType.RATIO_REGULATION_MODE, twoWindingsTransformer, null, null, PowsyblException.class), + Arguments.of(IS, FieldType.PHASE_REGULATION_MODE, twoWindingsTransformer, null, null, PowsyblException.class), + + // --- Test an unsupported equipment type for field type RATIO_REGULATION_MODE --- // + Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, battery, null, null, PowsyblException.class), + + // --- Test an unsupported equipment type for field type PHASE_REGULATION_MODE --- // + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, shuntCompensator, null, null, PowsyblException.class) ); } @@ -508,42 +525,96 @@ private static Stream provideArgumentsForTwoWindingTransformerTest() Mockito.when(twoWindingsTransformer.getRatioTapChanger()).thenReturn(ratioTapChanger); Mockito.when(ratioTapChanger.isRegulating()).thenReturn(true); Mockito.when(ratioTapChanger.hasLoadTapChangingCapabilities()).thenReturn(false); - Mockito.when(ratioTapChanger.getRegulationMode()).thenReturn(RatioTapChanger.RegulationMode.VOLTAGE); Mockito.when(ratioTapChanger.getRegulationValue()).thenReturn(225.); + TwoWindingsTransformer twoWindingsTransformer2 = Mockito.mock(TwoWindingsTransformer.class); + Mockito.when(twoWindingsTransformer2.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + Mockito.when(twoWindingsTransformer2.getRatioTapChanger()).thenReturn(null); + + Mockito.when(twoWindingsTransformer.getRatioTapChanger()).thenReturn(ratioTapChanger); PhaseTapChanger phaseTapChanger = Mockito.mock(PhaseTapChanger.class); Mockito.when(twoWindingsTransformer.getPhaseTapChanger()).thenReturn(phaseTapChanger); - Mockito.when(phaseTapChanger.isRegulating()).thenReturn(false); + Mockito.when(phaseTapChanger.isRegulating()).thenReturn(true); Mockito.when(phaseTapChanger.getRegulationMode()).thenReturn(PhaseTapChanger.RegulationMode.CURRENT_LIMITER); Mockito.when(phaseTapChanger.getRegulationValue()).thenReturn(100.); + Mockito.when(twoWindingsTransformer2.getPhaseTapChanger()).thenReturn(null); + Substation substation = Mockito.mock(Substation.class); Mockito.when(substation.getCountry()).thenReturn(Optional.of(Country.FR)); Mockito.when(twoWindingsTransformer.getSubstation()).thenReturn(Optional.of(substation)); + TwoWindingsTransformer twoWindingsTransformer3 = Mockito.mock(TwoWindingsTransformer.class); + Mockito.when(twoWindingsTransformer3.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + RatioTapChanger ratioTapChanger3 = Mockito.mock(RatioTapChanger.class); + Mockito.when(twoWindingsTransformer3.getRatioTapChanger()).thenReturn(ratioTapChanger3); + Mockito.when(ratioTapChanger3.isRegulating()).thenReturn(false); + Mockito.when(ratioTapChanger3.hasLoadTapChangingCapabilities()).thenReturn(true); + + TwoWindingsTransformer twoWindingsTransformer4 = Mockito.mock(TwoWindingsTransformer.class); + Mockito.when(twoWindingsTransformer4.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + RatioTapChanger ratioTapChanger4 = Mockito.mock(RatioTapChanger.class); + Mockito.when(twoWindingsTransformer4.getRatioTapChanger()).thenReturn(ratioTapChanger4); + Mockito.when(ratioTapChanger4.isRegulating()).thenReturn(true); + Mockito.when(ratioTapChanger4.hasLoadTapChangingCapabilities()).thenReturn(true); + + TwoWindingsTransformer twoWindingsTransformer5 = Mockito.mock(TwoWindingsTransformer.class); + Mockito.when(twoWindingsTransformer5.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + PhaseTapChanger phaseTapChanger5 = Mockito.mock(PhaseTapChanger.class); + Mockito.when(twoWindingsTransformer5.getPhaseTapChanger()).thenReturn(phaseTapChanger5); + Mockito.when(phaseTapChanger5.isRegulating()).thenReturn(false); + Mockito.when(phaseTapChanger5.getRegulationMode()).thenReturn(PhaseTapChanger.RegulationMode.FIXED_TAP); + + TwoWindingsTransformer twoWindingsTransformer6 = Mockito.mock(TwoWindingsTransformer.class); + Mockito.when(twoWindingsTransformer6.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + PhaseTapChanger phaseTapChanger6 = Mockito.mock(PhaseTapChanger.class); + Mockito.when(twoWindingsTransformer6.getPhaseTapChanger()).thenReturn(phaseTapChanger6); + Mockito.when(phaseTapChanger6.isRegulating()).thenReturn(false); + Mockito.when(phaseTapChanger6.getRegulationMode()).thenReturn(PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL); + + TwoWindingsTransformer twoWindingsTransformer7 = Mockito.mock(TwoWindingsTransformer.class); + Mockito.when(twoWindingsTransformer7.getType()).thenReturn(IdentifiableType.TWO_WINDINGS_TRANSFORMER); + PhaseTapChanger phaseTapChanger7 = Mockito.mock(PhaseTapChanger.class); + Mockito.when(twoWindingsTransformer7.getPhaseTapChanger()).thenReturn(phaseTapChanger7); + Mockito.when(phaseTapChanger7.isRegulating()).thenReturn(true); + Mockito.when(phaseTapChanger7.getRegulationMode()).thenReturn(PhaseTapChanger.RegulationMode.FIXED_TAP); + return Stream.of( // --- EQUALS --- // Arguments.of(EQUALS, FieldType.COUNTRY, Country.FR.name(), null, twoWindingsTransformer, true), Arguments.of(EQUALS, FieldType.COUNTRY, Country.DE.name(), null, twoWindingsTransformer, false), - Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, RatioTapChanger.RegulationMode.VOLTAGE.name(), null, twoWindingsTransformer, true), + Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.VOLTAGE_REGULATION.name(), null, twoWindingsTransformer, false), + Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.FIXED_RATIO.name(), null, twoWindingsTransformer, false), + Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.FIXED_RATIO.name(), null, twoWindingsTransformer3, true), + Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.FIXED_RATIO.name(), null, twoWindingsTransformer4, false), + Arguments.of(EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.VOLTAGE_REGULATION.name(), null, twoWindingsTransformer2, false), Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.CURRENT_LIMITER.name(), null, twoWindingsTransformer, true), + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.FIXED_TAP.name(), null, twoWindingsTransformer, false), + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name(), null, twoWindingsTransformer, false), + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name(), null, twoWindingsTransformer2, false), + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.CURRENT_LIMITER.name(), null, twoWindingsTransformer5, false), + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.FIXED_TAP.name(), null, twoWindingsTransformer6, true), + Arguments.of(EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name(), null, twoWindingsTransformer7, false), // --- NOT_EQUALS --- // Arguments.of(NOT_EQUALS, FieldType.COUNTRY, Country.DE.name(), null, twoWindingsTransformer, true), Arguments.of(NOT_EQUALS, FieldType.COUNTRY, Country.FR.name(), null, twoWindingsTransformer, false), - Arguments.of(NOT_EQUALS, FieldType.RATIO_REGULATION_MODE, RatioTapChanger.RegulationMode.REACTIVE_POWER.name(), null, twoWindingsTransformer, true), + Arguments.of(NOT_EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.FIXED_RATIO.name(), null, twoWindingsTransformer, true), + Arguments.of(NOT_EQUALS, FieldType.RATIO_REGULATION_MODE, RatioRegulationModeType.VOLTAGE_REGULATION.name(), null, twoWindingsTransformer, true), + Arguments.of(NOT_EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.CURRENT_LIMITER.name(), null, twoWindingsTransformer, false), Arguments.of(NOT_EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.FIXED_TAP.name(), null, twoWindingsTransformer, true), + Arguments.of(NOT_EQUALS, FieldType.PHASE_REGULATION_MODE, PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name(), null, twoWindingsTransformer, true), // --- IN --- // Arguments.of(IN, FieldType.COUNTRY, null, Set.of(Country.FR.name(), Country.DE.name()), twoWindingsTransformer, true), Arguments.of(IN, FieldType.COUNTRY, null, Set.of(Country.BE.name(), Country.DE.name()), twoWindingsTransformer, false), - Arguments.of(IN, FieldType.RATIO_REGULATION_MODE, null, Set.of(RatioTapChanger.RegulationMode.VOLTAGE.name(), RatioTapChanger.RegulationMode.REACTIVE_POWER.name()), twoWindingsTransformer, true), + Arguments.of(IN, FieldType.RATIO_REGULATION_MODE, null, Set.of(RatioRegulationModeType.VOLTAGE_REGULATION.name(), RatioRegulationModeType.FIXED_RATIO.name()), twoWindingsTransformer, false), Arguments.of(IN, FieldType.PHASE_REGULATION_MODE, null, Set.of(PhaseTapChanger.RegulationMode.FIXED_TAP.name(), PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name()), twoWindingsTransformer, false), // --- NOT_IN --- // Arguments.of(NOT_IN, FieldType.COUNTRY, null, Set.of(Country.BE.name(), Country.DE.name()), twoWindingsTransformer, true), Arguments.of(NOT_IN, FieldType.COUNTRY, null, Set.of(Country.FR.name(), Country.DE.name()), twoWindingsTransformer, false), - Arguments.of(NOT_IN, FieldType.RATIO_REGULATION_MODE, null, Set.of(RatioTapChanger.RegulationMode.VOLTAGE.name()), twoWindingsTransformer, false), + Arguments.of(NOT_IN, FieldType.RATIO_REGULATION_MODE, null, Set.of(RatioRegulationModeType.VOLTAGE_REGULATION.name()), twoWindingsTransformer, true), Arguments.of(NOT_IN, FieldType.PHASE_REGULATION_MODE, null, Set.of(PhaseTapChanger.RegulationMode.FIXED_TAP.name(), PhaseTapChanger.RegulationMode.ACTIVE_POWER_CONTROL.name()), twoWindingsTransformer, true) ); }