@@ -61,30 +61,34 @@ private List<String> getSubstationsIds(UUID networkUuid, String variantId, List<
61
61
.map (Substation ::getId ).toList ();
62
62
}
63
63
64
- public AllElementsInfos getAllElementsInfos (UUID networkUuid , String variantId , @ NonNull List <String > substationsId ) {
64
+ public AllElementsInfos getAllElementsInfos (UUID networkUuid , String variantId , @ NonNull List <String > substationsId , Map < String , Map < String , String >> additionalParametersByType ) {
65
65
Network network = getNetwork (networkUuid , PreloadingStrategy .ALL_COLLECTIONS_NEEDED_FOR_BUS_VIEW , variantId );
66
66
return AllElementsInfos .builder ()
67
- .substations (getSubstationsInfos (network , substationsId , InfoTypeParameters . TAB , null ))
68
- .voltageLevels (getVoltageLevelsInfos (network , substationsId , InfoTypeParameters . TAB , null ))
69
- .hvdcLines (getHvdcLinesInfos (network , substationsId , InfoTypeParameters . TAB , null ))
70
- .lines (getElementsInfos (network , substationsId , ElementType .LINE , InfoTypeParameters . TAB , null ))
71
- .loads (getElementsInfos (network , substationsId , ElementType .LOAD , InfoTypeParameters . TAB , null ))
72
- .generators (getElementsInfos (network , substationsId , ElementType .GENERATOR , InfoTypeParameters . TAB , null ))
73
- .twoWindingsTransformers (getElementsInfos (network , substationsId , ElementType .TWO_WINDINGS_TRANSFORMER , InfoTypeParameters . TAB , null ))
74
- .threeWindingsTransformers (getElementsInfos (network , substationsId , ElementType .THREE_WINDINGS_TRANSFORMER , InfoTypeParameters . TAB , null ))
75
- .batteries (getElementsInfos (network , substationsId , ElementType .BATTERY , InfoTypeParameters . TAB , null ))
76
- .danglingLines (getElementsInfos (network , substationsId , ElementType .DANGLING_LINE , InfoTypeParameters . TAB , null ))
77
- .tieLines (getTieLinesInfos (network , substationsId , InfoTypeParameters . TAB , null ))
78
- .lccConverterStations (getElementsInfos (network , substationsId , ElementType .LCC_CONVERTER_STATION , InfoTypeParameters . TAB , null ))
79
- .shuntCompensators (getElementsInfos (network , substationsId , ElementType .SHUNT_COMPENSATOR , InfoTypeParameters . TAB , null ))
80
- .staticVarCompensators (getElementsInfos (network , substationsId , ElementType .STATIC_VAR_COMPENSATOR , InfoTypeParameters . TAB , null ))
81
- .vscConverterStations (getElementsInfos (network , substationsId , ElementType .VSC_CONVERTER_STATION , InfoTypeParameters . TAB , null ))
82
- .buses (getBusesInfos (network , substationsId , InfoTypeParameters . TAB ))
83
- .busbarSections (getElementsInfos (network , substationsId , ElementType .BUSBAR_SECTION , InfoTypeParameters . TAB , null ))
84
- .branches (getElementsInfos (network , substationsId , ElementType .BRANCH , InfoTypeParameters . TAB , null ))
67
+ .substations (getSubstationsInfos (network , substationsId , getInfoTypeParameters ( additionalParametersByType , ElementType . SUBSTATION ) , null ))
68
+ .voltageLevels (getVoltageLevelsInfos (network , substationsId , getInfoTypeParameters ( additionalParametersByType , ElementType . VOLTAGE_LEVEL ) , null ))
69
+ .hvdcLines (getHvdcLinesInfos (network , substationsId , getInfoTypeParameters ( additionalParametersByType , ElementType . HVDC_LINE ) , null ))
70
+ .lines (getElementsInfos (network , substationsId , ElementType .LINE , getInfoTypeParameters ( additionalParametersByType , ElementType . LINE ) , null ))
71
+ .loads (getElementsInfos (network , substationsId , ElementType .LOAD , getInfoTypeParameters ( additionalParametersByType , ElementType . LOAD ) , null ))
72
+ .generators (getElementsInfos (network , substationsId , ElementType .GENERATOR , getInfoTypeParameters ( additionalParametersByType , ElementType . GENERATOR ) , null ))
73
+ .twoWindingsTransformers (getElementsInfos (network , substationsId , ElementType .TWO_WINDINGS_TRANSFORMER , getInfoTypeParameters ( additionalParametersByType , ElementType . TWO_WINDINGS_TRANSFORMER ) , null ))
74
+ .threeWindingsTransformers (getElementsInfos (network , substationsId , ElementType .THREE_WINDINGS_TRANSFORMER , getInfoTypeParameters ( additionalParametersByType , ElementType . THREE_WINDINGS_TRANSFORMER ) , null ))
75
+ .batteries (getElementsInfos (network , substationsId , ElementType .BATTERY , getInfoTypeParameters ( additionalParametersByType , ElementType . BATTERY ) , null ))
76
+ .danglingLines (getElementsInfos (network , substationsId , ElementType .DANGLING_LINE , getInfoTypeParameters ( additionalParametersByType , ElementType . DANGLING_LINE ) , null ))
77
+ .tieLines (getTieLinesInfos (network , substationsId , getInfoTypeParameters ( additionalParametersByType , ElementType . TIE_LINE ) , null ))
78
+ .lccConverterStations (getElementsInfos (network , substationsId , ElementType .LCC_CONVERTER_STATION , getInfoTypeParameters ( additionalParametersByType , ElementType . LCC_CONVERTER_STATION ) , null ))
79
+ .shuntCompensators (getElementsInfos (network , substationsId , ElementType .SHUNT_COMPENSATOR , getInfoTypeParameters ( additionalParametersByType , ElementType . SHUNT_COMPENSATOR ) , null ))
80
+ .staticVarCompensators (getElementsInfos (network , substationsId , ElementType .STATIC_VAR_COMPENSATOR , getInfoTypeParameters ( additionalParametersByType , ElementType . STATIC_VAR_COMPENSATOR ) , null ))
81
+ .vscConverterStations (getElementsInfos (network , substationsId , ElementType .VSC_CONVERTER_STATION , getInfoTypeParameters ( additionalParametersByType , ElementType . VSC_CONVERTER_STATION ) , null ))
82
+ .buses (getBusesInfos (network , substationsId , getInfoTypeParameters ( additionalParametersByType , ElementType . BUS ) ))
83
+ .busbarSections (getElementsInfos (network , substationsId , ElementType .BUSBAR_SECTION , getInfoTypeParameters ( additionalParametersByType , ElementType . BUSBAR_SECTION ) , null ))
84
+ .branches (getElementsInfos (network , substationsId , ElementType .BRANCH , getInfoTypeParameters ( additionalParametersByType , ElementType . BRANCH ) , null ))
85
85
.build ();
86
86
}
87
87
88
+ private static InfoTypeParameters getInfoTypeParameters (Map <String , Map <String , String >> additionalParametersByType , ElementType elementType ) {
89
+ return new InfoTypeParameters (ElementInfos .InfoType .TAB , additionalParametersByType .get (String .valueOf (elementType )));
90
+ }
91
+
88
92
private List <String > getVoltageLevelsIds (UUID networkUuid , String variantId , @ NonNull List <String > substationsIds , List <Double > nominalVoltages ) {
89
93
Network network = getNetwork (networkUuid , getPreloadingStrategy (substationsIds ), variantId );
90
94
return getVoltageLevelStream (network , substationsIds , nominalVoltages ).map (VoltageLevel ::getId ).toList ();
0 commit comments