Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,32 @@
*/
@Configuration
public class MapperBeans {
public static final String KEY_DISCONNECTED_GENERATOR = "disconnectedTerminalGenerator";
public static final String KEY_ADD_CONSTANT_RATION = "addConstantRatio";

@Bean
public SeverityMapper powsyblAdnGeneratorsAndBatteriesSeverity() {
// in generatorConversion and batteryConversion
return new SeverityMapper("disconnectedTerminalGenerator", TypedValue.TRACE_SEVERITY);
return new SeverityMapper(KEY_DISCONNECTED_GENERATOR, TypedValue.DETAIL_SEVERITY);
}

@Bean
public SeverityMapper powsyblAdnLinesSeverity() {
// in branchConversion.twoWindingsTransformerConversion
return new SeverityMapper("lineConversion", "addConstantRatio", TypedValue.TRACE_SEVERITY);
return new SeverityMapper("lineConversion", KEY_ADD_CONSTANT_RATION, TypedValue.DETAIL_SEVERITY);
}

@Bean
public SeverityMapper powsyblAdnTwoWindingsTransformersSeverity() {
// in branchConversion.twoWindingsTransformerConversion
return new SeverityMapper("twoWindingsTransformerConversion", "addConstantRatio", TypedValue.TRACE_SEVERITY);
return new SeverityMapper("twoWindingsTransformerConversion", KEY_ADD_CONSTANT_RATION, TypedValue.DETAIL_SEVERITY);
}

@Bean
public AdnSummarizeMapper powsyblAdnGeneratorsSummary() {
return new AdnSummarizeMapper("generators",
"generatorConversion",
"disconnectedTerminalGenerator",
KEY_DISCONNECTED_GENERATOR,
"shortcircuit.server.disconnectedTerminalEquipmentSummary",
ShortCircuitRunContext::getAdnSummarizeCounterGenerator);
}
Expand All @@ -43,7 +46,7 @@ public AdnSummarizeMapper powsyblAdnGeneratorsSummary() {
public AdnSummarizeMapper powsyblAdnBatteriesSummary() {
return new AdnSummarizeMapper("batteries",
"batteryConversion",
"disconnectedTerminalGenerator",
KEY_DISCONNECTED_GENERATOR,
"shortcircuit.server.disconnectedTerminalEquipmentSummary",
ShortCircuitRunContext::getAdnSummarizeCounterBattery);
}
Expand All @@ -53,7 +56,7 @@ public AdnSummarizeMapper powsyblAdnLinesSummary() {
// in branchConversion.twoWindingsTransformerConversion
return new AdnSummarizeMapper("lines",
"lineConversion",
"addConstantRatio",
KEY_ADD_CONSTANT_RATION,
"shortcircuit.server.addConstantRatioSummary",
ShortCircuitRunContext::getAdnSummarizeCounterLines);
}
Expand All @@ -63,7 +66,7 @@ public AdnSummarizeMapper powsyblAdnTwoWindingsTransformersSummary() {
// in branchConversion.twoWindingsTransformerConversion
return new AdnSummarizeMapper("two windings transformers",
"twoWindingsTransformerConversion",
"addConstantRatio",
KEY_ADD_CONSTANT_RATION,
"shortcircuit.server.addConstantRatioSummary",
ShortCircuitRunContext::getAdnSummarizeCounterT2W);
}
Expand Down
32 changes: 16 additions & 16 deletions src/test/resources/reporter_adn_modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,55 +37,55 @@
"children" : [ {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERAT3" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERAT8" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERAT4" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERATG" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERATF" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERATH" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERAT.HU6" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENER.TG2" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "GENERATJ" }
}
}, {
Expand All @@ -101,19 +101,19 @@
"children" : [ {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "BATTERY1" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "BATTERYA" }
}
}, {
"messageKey" : "disconnectedTerminalGenerator",
"values" : {
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"generator" : { "value" : "BATTERY2" }
}
}, {
Expand All @@ -134,7 +134,7 @@
"vlId2" : { "value" : "MABCDP7" },
"vlId1" : { "value" : "AABCDP7" },
"nominalVoltage2" : { "value" : 300.0, "type" : "VOLTAGE" },
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"rfix" : { "value" : 1.1234567 },
"nominalVoltage1" : { "value" : 400.0, "type" : "VOLTAGE" },
"branch" : { "value" : "ABCDEFGHIJKLM" }
Expand All @@ -145,7 +145,7 @@
"vlId2" : { "value" : "P.ABCP7" },
"vlId1" : { "value" : "HABCDP7" },
"nominalVoltage2" : { "value" : 400.0, "type" : "VOLTAGE" },
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"rfix" : { "value" : 0.95 },
"nominalVoltage1" : { "value" : 300.0, "type" : "VOLTAGE" },
"branch" : { "value" : "ABDCEFGHI.ABC" }
Expand All @@ -156,7 +156,7 @@
"vlId2" : { "value" : "ABCDEP7" },
"vlId1" : { "value" : "FGHIJP7" },
"nominalVoltage2" : { "value" : 400.0, "type" : "VOLTAGE" },
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"rfix" : { "value" : 0.95 },
"nominalVoltage1" : { "value" : 300.0, "type" : "VOLTAGE" },
"branch" : { "value" : "ABCDEFGHIJKLM" }
Expand All @@ -167,7 +167,7 @@
"vlId2" : { "value" : "QSDFGHJ" },
"vlId1" : { "value" : "WXCVBN7" },
"nominalVoltage2" : { "value" : 400.0, "type" : "VOLTAGE" },
"reportSeverity" : { "value" : "TRACE", "type" : "SEVERITY" },
"reportSeverity" : { "value" : "DETAIL", "type" : "SEVERITY" },
"rfix" : { "value" : 0.95 },
"nominalVoltage1" : { "value" : 300.0, "type" : "VOLTAGE" },
"branch" : { "value" : "AZERTYUIOPKLM" }
Expand Down
22 changes: 11 additions & 11 deletions src/test/resources/reporter_shortcircuit_modified.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand All @@ -77,7 +77,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand All @@ -89,7 +89,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand All @@ -101,7 +101,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand Down Expand Up @@ -142,7 +142,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand All @@ -154,7 +154,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand All @@ -166,7 +166,7 @@
"messageKey": "disconnectedTerminalGenerator",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"generator": {
Expand Down Expand Up @@ -238,7 +238,7 @@
"messageKey": "addConstantRatio",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"branch": {
Expand All @@ -250,7 +250,7 @@
"messageKey": "addConstantRatio",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"branch": {
Expand All @@ -262,7 +262,7 @@
"messageKey": "addConstantRatio",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"branch": {
Expand All @@ -274,7 +274,7 @@
"messageKey": "addConstantRatio",
"values": {
"reportSeverity": {
"value": "TRACE",
"value": "DETAIL",
"type": "SEVERITY"
},
"branch": {
Expand Down