Skip to content

Commit

Permalink
Refactor default model factory (#311)
Browse files Browse the repository at this point in the history
* Refactor default model factory
* Use the default model factory for EquipmentConnectionPoint
* Use MacroConnectionsAdder instead of AbstractBlackBoxModel methods for macro connections creation
* Replace call to context with late init final field in event model
* Add reporter to MacroConnectionsAdder

Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte authored Dec 13, 2023
1 parent 88a8161 commit c96f529
Show file tree
Hide file tree
Showing 56 changed files with 760 additions and 496 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void assertEventModel(AbstractEvent em, String dynamicId, String equipmentStatic
assertEquals(lib, em.getLib());
} else {
Exception e = assertThrows(PowsyblException.class, em::getLib);
assertEquals("The associated library depends on context", e.getMessage());
assertEquals("Field has not been initialized", e.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<dyn:connect var1="omegaRef_grp_@INDEX@" var2="generator_omegaRefPu"/>
<dyn:connect var1="running_grp_@INDEX@" var2="generator_running"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfEquipment">
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized">
<dyn:connect var1="numcc_node_@INDEX@" var2="@@NAME@@@NODE@_numcc"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations">
Expand Down Expand Up @@ -123,14 +123,14 @@
<dyn:macroConnect connector="MC_CurrentLimitAutomatonMeasureSide2-DefaultLine" id1="CLA_2_5" id2="NETWORK" name2="_BUS____2-BUS____5-1_AC"/>
<dyn:macroConnect connector="MC_CurrentLimitAutomatonControl-DefaultLine" id1="CLA_2_5" id2="NETWORK" name2="_BUS____2-BUS____5-1_AC"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="0" id2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="1" id2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="2" id2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations" id1="FREQ_SYNC" index1="3" id2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations" id1="FREQ_SYNC" index1="4" id2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_EventQuadripoleDisconnection-DefaultLine" id1="Disconnect__BUS____1-BUS____5-1_AC" id2="NETWORK" name2="_BUS____1-BUS____5-1_AC"/>
</dyn:dynamicModelsArchitecture>
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dyn:connect var1="omegaRef_grp_@INDEX@" var2="generator_omegaRefPu"/>
<dyn:connect var1="running_grp_@INDEX@" var2="generator_running"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfEquipment">
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized">
<dyn:connect var1="numcc_node_@INDEX@" var2="@@NAME@@@NODE@_numcc"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations">
Expand Down Expand Up @@ -110,14 +110,14 @@
<dyn:macroConnect connector="MC_GeneratorSynchronousThreeWindingsProportionalRegulations-DefaultEquipmentConnectionPoint" id1="_GEN____6_SM" id2="NETWORK"/>
<dyn:macroConnect connector="MC_GeneratorSynchronousThreeWindingsProportionalRegulations-DefaultEquipmentConnectionPoint" id1="_GEN____8_SM" id2="NETWORK"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="0" id2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="1" id2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="2" id2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations" id1="FREQ_SYNC" index1="3" id2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations" id1="FREQ_SYNC" index1="4" id2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_EventQuadripoleDisconnection-DefaultLine" id1="Disconnect__BUS____1-BUS____5-1_AC" id2="NETWORK" name2="_BUS____1-BUS____5-1_AC"/>
</dyn:dynamicModelsArchitecture>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<dyn:connect var1="omegaRef_grp_@INDEX@" var2="generator_omegaRefPu"/>
<dyn:connect var1="running_grp_@INDEX@" var2="generator_running"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfEquipment">
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized">
<dyn:connect var1="numcc_node_@INDEX@" var2="@@NAME@@@NODE@_numcc"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations">
Expand Down Expand Up @@ -106,13 +106,13 @@
<dyn:macroConnect connector="MC_GeneratorSynchronousThreeWindingsProportionalRegulations-DefaultEquipmentConnectionPoint" id1="_GEN____6_SM" id2="NETWORK"/>
<dyn:macroConnect connector="MC_GeneratorSynchronousThreeWindingsProportionalRegulations-DefaultEquipmentConnectionPoint" id1="_GEN____8_SM" id2="NETWORK"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="0" id2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="1" id2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="2" id2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations" id1="FREQ_SYNC" index1="3" id2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousThreeWindingsProportionalRegulations" id1="FREQ_SYNC" index1="4" id2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____8_SM"/>
</dyn:dynamicModelsArchitecture>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dyn:connect var1="omegaRef_grp_@INDEX@" var2="generator_omegaRefPu"/>
<dyn:connect var1="running_grp_@INDEX@" var2="generator_running"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfEquipment">
<dyn:macroConnector id="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized">
<dyn:connect var1="numcc_node_@INDEX@" var2="@@NAME@@@NODE@_numcc"/>
</dyn:macroConnector>
<dyn:macroConnector id="MC_EventInjectionDisconnection-GeneratorSynchronousFourWindingsProportionalRegulations">
Expand All @@ -51,18 +51,18 @@
<dyn:macroConnect connector="MC_GeneratorSynchronousFourWindingsProportionalRegulations-DefaultEquipmentConnectionPoint" id1="_GEN____9_SM" id2="NETWORK"/>
<dyn:macroConnect connector="MC_GeneratorSynchronousFourWindingsProportionalRegulations-DefaultEquipmentConnectionPoint" id1="_GEN____2_SM" id2="NETWORK"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="0" id2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="0" id2="NETWORK" name2="_GEN____6_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="1" id2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="1" id2="NETWORK" name2="_GEN____8_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="2" id2="_GEN___12_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN___12_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="2" id2="NETWORK" name2="_GEN___12_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="3" id2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="3" id2="NETWORK" name2="_GEN____1_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="4" id2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="4" id2="NETWORK" name2="_GEN____3_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="5" id2="_GEN____9_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="5" id2="NETWORK" name2="_GEN____9_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="5" id2="NETWORK" name2="_GEN____9_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-GeneratorSynchronousFourWindingsProportionalRegulations" id1="FREQ_SYNC" index1="6" id2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfEquipment" id1="FREQ_SYNC" index1="6" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_DYNModelOmegaRef-DefaultBusOfFrequencySynchronized" id1="FREQ_SYNC" index1="6" id2="NETWORK" name2="_GEN____2_SM"/>
<dyn:macroConnect connector="MC_EventInjectionDisconnection-GeneratorSynchronousFourWindingsProportionalRegulations" id1="Disconnect__GEN___12_SM" id2="_GEN___12_SM"/>
</dyn:dynamicModelsArchitecture>
Loading

0 comments on commit c96f529

Please sign in to comment.