Skip to content

Commit

Permalink
rename subType by equipmentSubtype
Browse files Browse the repository at this point in the history
Signed-off-by: Rehili Ghazwa <[email protected]>
  • Loading branch information
ghazwarhili committed Jan 31, 2025
1 parent 595e851 commit d5454f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public class NetworkConversionService {
private static final Logger LOGGER = LoggerFactory.getLogger(NetworkConversionService.class);

private static final Set<IdentifiableType> EXCLUDED_TYPES_FOR_INDEXING = Set.of(IdentifiableType.SWITCH);
private static final Set<IdentifiableType> SUB_TYPES_FOR_INDEXING = Set.of(IdentifiableType.HVDC_LINE);

private RestTemplate caseServerRest;

Expand Down Expand Up @@ -126,7 +125,7 @@ static EquipmentInfos toEquipmentInfos(Identifiable<?> i, UUID networkUuid, Stri
.id(i.getId())
.name(i.getNameOrId())
.type(i.getType().name())
.subType(EquipmentInfos.getSubTypeEquipment(i))
.equipmentSubType(EquipmentInfos.getEquipmentSubType(i))
.voltageLevels(EquipmentInfos.getVoltageLevelsInfos(i))
.substations(EquipmentInfos.getSubstationsInfos(i))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public void setUniqueId(String uniqueId) {
@Field("equipmentType")
String type;

@Field(type = FieldType.Nested)
Set<String> subType;
@Field(type = FieldType.Keyword)
Set<String> equipmentSubType;

@Field(type = FieldType.Nested, includeInParent = true)
Set<VoltageLevelInfos> voltageLevels;
Expand Down Expand Up @@ -114,7 +114,7 @@ public static Set<VoltageLevel> getVoltageLevels(@NonNull Identifiable<?> identi
throw NetworkConversionException.createEquipmentTypeUnknown(identifiable.getClass().getSimpleName());
}

public static Set<String> getSubTypeEquipment(@NonNull Identifiable<?> identifiable) {
public static Set<String> getEquipmentSubType(@NonNull Identifiable<?> identifiable) {
if (identifiable instanceof HvdcLine) {
HvdcLine hvdcLine = (HvdcLine) identifiable;
String hvdcType1 = hvdcLine.getConverterStation1().getHvdcType().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void testEquipmentInfos() {
.id("BBE1AA1")
.name("BBE1AA1")
.type(IdentifiableType.VOLTAGE_LEVEL.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1AA1").name("BBE1AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -101,7 +101,7 @@ void testEquipmentInfos() {
.id("BBE1AA")
.name("BBE1AA")
.type(IdentifiableType.SUBSTATION.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(
VoltageLevelInfos.builder().id("BBE1TR1").name("BBE1TR1").build(),
VoltageLevelInfos.builder().id("BBE1TR2").name("BBE1TR2").build(),
Expand All @@ -121,7 +121,7 @@ void testEquipmentInfos() {
.id("FRA1AA1_switch")
.name("FRA1AA1_switch")
.type(IdentifiableType.SWITCH.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("FRA1AA1").name("FRA1AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("FRA1AA").name("FRA1AA").build()))
.build();
Expand All @@ -135,7 +135,7 @@ void testEquipmentInfos() {
.id("BBE1AA1 _load")
.name("BBE1AA1 _load")
.type(IdentifiableType.LOAD.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1AA1").name("BBE1AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -149,7 +149,7 @@ void testEquipmentInfos() {
.id("BBE1AA1 ")
.name("BBE1AA1 ")
.type(IdentifiableType.BUS.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1AA1").name("BBE1AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -163,7 +163,7 @@ void testEquipmentInfos() {
.id("BBE1AA1 _generator")
.name("BBE1AA1 _generator")
.type(IdentifiableType.GENERATOR.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1AA1").name("BBE1AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -177,7 +177,7 @@ void testEquipmentInfos() {
.id("FRA1AA_BBE1AA_hvdcline")
.name("FRA1AA_BBE1AA_hvdcline")
.type(IdentifiableType.HVDC_LINE.name())
.subType(Set.of(HvdcConverterStation.HvdcType.VSC.name()))
.equipmentSubType(Set.of(HvdcConverterStation.HvdcType.VSC.name()))
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("FRA1AA1").name("FRA1AA1").build(), VoltageLevelInfos.builder().id("BBE1AA5").name("BBE1AA5").build()))
.substations(Set.of(SubstationInfos.builder().id("FRA1AA").name("FRA1AA").build(), SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -191,7 +191,7 @@ void testEquipmentInfos() {
.id("BBE1AA2 BBE3AA1 2")
.name("BBE1AA2 BBE3AA1 2")
.type(IdentifiableType.TWO_WINDINGS_TRANSFORMER.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1AA2").name("BBE1AA2").build(), VoltageLevelInfos.builder().id("BBE1AA1").name("BBE1AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -205,7 +205,7 @@ void testEquipmentInfos() {
.id("BBE1AA_w3t")
.name("BBE1AA_w3t")
.type(IdentifiableType.THREE_WINDINGS_TRANSFORMER.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1TR1").name("BBE1TR1").build(), VoltageLevelInfos.builder().id("BBE1TR2").name("BBE1TR2").build(), VoltageLevelInfos.builder().id("BBE1TR3").name("BBE1TR3").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build()))
.build();
Expand All @@ -219,7 +219,7 @@ void testEquipmentInfos() {
.id("BBE1AA1 BBE2AA1 1")
.name("BBE1AA1 BBE2AA1 1")
.type(IdentifiableType.LINE.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("BBE1AA1").name("BBE1AA1").build(), VoltageLevelInfos.builder().id("BBE2AA1").name("BBE2AA1").build()))
.substations(Set.of(SubstationInfos.builder().id("BBE1AA").name("BBE1AA").build(), SubstationInfos.builder().id("BBE2AA").name("BBE2AA").build()))
.build();
Expand All @@ -238,7 +238,7 @@ void testEquipmentInfos() {
.id("LINE_S1VL1")
.name("LINE_S1VL1")
.type(IdentifiableType.LINE.name())
.subType(Set.of())
.equipmentSubType(Set.of())
.voltageLevels(Set.of(VoltageLevelInfos.builder().id("S1VL1").name("S1VL1").build()))
.substations(Set.of(SubstationInfos.builder().id("S1").name("S1").build()))
.build();
Expand Down

0 comments on commit d5454f0

Please sign in to comment.