Skip to content

Commit 9ff053d

Browse files
authored
Fix error when we try to display the loadflow report (#558)
Signed-off-by: David BRAQUART <[email protected]>
1 parent 5242eb6 commit 9ff053d

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/main/java/org/gridsuite/study/server/service/LoadFlowService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public UUID runLoadFlow(UUID studyUuid, UUID nodeUuid, UUID parametersUuid, Stri
7777
.queryParam(QUERY_PARAM_RECEIVER, receiver)
7878
.queryParam(QUERY_PARAM_REPORT_UUID, reportUuid.toString())
7979
.queryParam(QUERY_PARAM_REPORTER_ID, nodeUuid.toString())
80-
.queryParam(QUERY_PARAM_REPORT_TYPE, StudyService.ReportType.LOADFLOW.reportKey);
80+
.queryParam(QUERY_PARAM_REPORT_TYPE, StudyService.ReportType.LOAD_FLOW.reportKey);
8181
if (parametersUuid != null) {
8282
uriComponentsBuilder.queryParam("parametersUuid", parametersUuid.toString());
8383
}

src/main/java/org/gridsuite/study/server/service/NetworkModificationTreeService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ private void fillInvalidateNodeInfos(NodeEntity node, InvalidateNodeInfos invali
762762
UUID loadFlowResultUuid = repositories.get(node.getType()).getComputationResultUuid(node.getIdNode(), LOAD_FLOW);
763763
if (loadFlowResultUuid != null) {
764764
invalidateNodeInfos.addLoadFlowResultUuid(loadFlowResultUuid);
765-
reportTypes.add(StudyService.ReportType.LOADFLOW);
765+
reportTypes.add(StudyService.ReportType.LOAD_FLOW);
766766
}
767767

768768
UUID securityAnalysisResultUuid = repositories.get(node.getType()).getComputationResultUuid(node.getIdNode(), SECURITY_ANALYSIS);
@@ -786,20 +786,20 @@ private void fillInvalidateNodeInfos(NodeEntity node, InvalidateNodeInfos invali
786786
UUID shortCircuitAnalysisResultUuid = repositories.get(node.getType()).getComputationResultUuid(node.getIdNode(), SHORT_CIRCUIT);
787787
if (shortCircuitAnalysisResultUuid != null) {
788788
invalidateNodeInfos.addShortCircuitAnalysisResultUuid(shortCircuitAnalysisResultUuid);
789-
reportTypes.add(StudyService.ReportType.ALL_BUSES_SHORTCIRCUIT_ANALYSIS);
789+
reportTypes.add(StudyService.ReportType.SHORT_CIRCUIT);
790790
}
791791

792792
UUID oneBusShortCircuitAnalysisResultUuid = repositories.get(node.getType()).getComputationResultUuid(node.getIdNode(), SHORT_CIRCUIT_ONE_BUS);
793793
if (oneBusShortCircuitAnalysisResultUuid != null) {
794794
invalidateNodeInfos.addOneBusShortCircuitAnalysisResultUuid(oneBusShortCircuitAnalysisResultUuid);
795-
reportTypes.add(StudyService.ReportType.ONE_BUS_SHORTCIRCUIT_ANALYSIS);
795+
reportTypes.add(StudyService.ReportType.SHORT_CIRCUIT_ONE_BUS);
796796
}
797797

798798
if (deleteVoltageInitResults) {
799799
UUID voltageInitResultUuid = repositories.get(node.getType()).getComputationResultUuid(node.getIdNode(), VOLTAGE_INITIALIZATION);
800800
if (voltageInitResultUuid != null) {
801801
invalidateNodeInfos.addVoltageInitResultUuid(voltageInitResultUuid);
802-
reportTypes.add(StudyService.ReportType.VOLTAGE_INIT);
802+
reportTypes.add(StudyService.ReportType.VOLTAGE_INITIALIZATION);
803803
}
804804
}
805805

src/main/java/org/gridsuite/study/server/service/StudyService.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ public enum ReportNameMatchingType {
130130

131131
public enum ReportType {
132132
NETWORK_MODIFICATION("NetworkModification"),
133-
LOADFLOW("LoadFlow"),
133+
LOAD_FLOW("LoadFlow"),
134134
SECURITY_ANALYSIS("SecurityAnalysis"),
135-
ALL_BUSES_SHORTCIRCUIT_ANALYSIS("AllBusesShortCircuitAnalysis"),
136-
ONE_BUS_SHORTCIRCUIT_ANALYSIS("OneBusShortCircuitAnalysis"),
135+
SHORT_CIRCUIT("AllBusesShortCircuitAnalysis"),
136+
SHORT_CIRCUIT_ONE_BUS("OneBusShortCircuitAnalysis"),
137137
SENSITIVITY_ANALYSIS("SensitivityAnalysis"),
138138
DYNAMIC_SIMULATION("DynamicSimulation"),
139139
NON_EVACUATED_ENERGY_ANALYSIS("NonEvacuatedEnergyAnalysis"),
140-
VOLTAGE_INIT("VoltageInit");
140+
VOLTAGE_INITIALIZATION("VoltageInit");
141141

142142
public final String reportKey;
143143

@@ -1727,14 +1727,14 @@ public UUID runShortCircuit(UUID studyUuid, UUID nodeUuid, String userId) {
17271727
}
17281728

17291729
public UUID runShortCircuit(UUID studyUuid, UUID nodeUuid, String userId, String busId) {
1730-
Optional<UUID> prevResultUuidOpt = networkModificationTreeService.getComputationResultUuid(nodeUuid, SHORT_CIRCUIT_ONE_BUS);
1730+
Optional<UUID> prevResultUuidOpt = networkModificationTreeService.getComputationResultUuid(nodeUuid, ComputationType.SHORT_CIRCUIT_ONE_BUS);
17311731
prevResultUuidOpt.ifPresent(shortCircuitService::deleteShortCircuitAnalysisResult);
17321732

17331733
ShortCircuitParameters shortCircuitParameters = getShortCircuitParameters(studyUuid);
17341734
shortCircuitParameters.setWithFortescueResult(true);
17351735
UUID result = shortCircuitService.runShortCircuit(studyUuid, nodeUuid, busId, shortCircuitParameters, userId);
17361736

1737-
updateComputationResultUuid(nodeUuid, result, SHORT_CIRCUIT_ONE_BUS);
1737+
updateComputationResultUuid(nodeUuid, result, ComputationType.SHORT_CIRCUIT_ONE_BUS);
17381738

17391739
notificationService.emitStudyChanged(studyUuid, nodeUuid, NotificationService.UPDATE_TYPE_ONE_BUS_SHORT_CIRCUIT_STATUS);
17401740
return result;

src/main/java/org/gridsuite/study/server/service/SupervisionService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private Integer deleteLoadflowResults() {
137137
startTime.set(System.nanoTime());
138138
List<NetworkModificationNodeInfoEntity> nodes = networkModificationNodeInfoRepository.findAllByLoadFlowResultUuidNotNull();
139139
nodes.forEach(node -> node.setLoadFlowResultUuid(null));
140-
Map<UUID, String> subreportToDelete = formatSubreportMap(StudyService.ReportType.LOADFLOW.reportKey, nodes);
140+
Map<UUID, String> subreportToDelete = formatSubreportMap(StudyService.ReportType.LOAD_FLOW.reportKey, nodes);
141141
reportService.deleteTreeReports(subreportToDelete);
142142
loadFlowService.deleteLoadFlowResults();
143143
LOGGER.trace(DELETION_LOG_MESSAGE, ComputationType.LOAD_FLOW, TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - startTime.get()));
@@ -202,12 +202,12 @@ private Integer deleteShortcircuitResults() {
202202
List<NetworkModificationNodeInfoEntity> allBusesNodes = networkModificationNodeInfoRepository.findAllByShortCircuitAnalysisResultUuidNotNull();
203203
if (!allBusesNodes.isEmpty()) {
204204
allBusesNodes.forEach(node -> node.setShortCircuitAnalysisResultUuid(null));
205-
reportService.deleteTreeReports(formatSubreportMap(StudyService.ReportType.ALL_BUSES_SHORTCIRCUIT_ANALYSIS.reportKey, allBusesNodes));
205+
reportService.deleteTreeReports(formatSubreportMap(StudyService.ReportType.SHORT_CIRCUIT.reportKey, allBusesNodes));
206206
}
207207
List<NetworkModificationNodeInfoEntity> oneBusNodes = networkModificationNodeInfoRepository.findAllByOneBusShortCircuitAnalysisResultUuidNotNull();
208208
if (!oneBusNodes.isEmpty()) {
209209
oneBusNodes.forEach(node -> node.setOneBusShortCircuitAnalysisResultUuid(null));
210-
reportService.deleteTreeReports(formatSubreportMap(StudyService.ReportType.ONE_BUS_SHORTCIRCUIT_ANALYSIS.reportKey, oneBusNodes));
210+
reportService.deleteTreeReports(formatSubreportMap(StudyService.ReportType.SHORT_CIRCUIT_ONE_BUS.reportKey, oneBusNodes));
211211
}
212212
// Then delete all results (1-bus and all-buses), cause short-circuit-server cannot make the difference
213213
shortCircuitService.deleteShortCircuitAnalysisResults();
@@ -225,7 +225,7 @@ private Integer deleteVoltageInitResults() {
225225
List<NetworkModificationNodeInfoEntity> nodes = networkModificationNodeInfoRepository.findAllByVoltageInitResultUuidNotNull();
226226
if (!nodes.isEmpty()) {
227227
nodes.forEach(node -> node.setVoltageInitResultUuid(null));
228-
reportService.deleteTreeReports(formatSubreportMap(StudyService.ReportType.VOLTAGE_INIT.reportKey, nodes));
228+
reportService.deleteTreeReports(formatSubreportMap(StudyService.ReportType.VOLTAGE_INITIALIZATION.reportKey, nodes));
229229
}
230230
voltageInitService.deleteVoltageInitResults();
231231
LOGGER.trace(DELETION_LOG_MESSAGE, ComputationType.VOLTAGE_INITIALIZATION, TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - startTime.get()));

src/main/java/org/gridsuite/study/server/service/VoltageInitService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public UUID runVoltageInit(UUID networkUuid, String variantId, UUID parametersUu
7979
.queryParam(QUERY_PARAM_RECEIVER, receiver)
8080
.queryParam("reportUuid", reportUuid.toString())
8181
.queryParam("reporterId", nodeUuid.toString())
82-
.queryParam("reportType", StudyService.ReportType.VOLTAGE_INIT.reportKey);
82+
.queryParam("reportType", StudyService.ReportType.VOLTAGE_INITIALIZATION.reportKey);
8383

8484
if (parametersUuid != null) {
8585
uriComponentsBuilder.queryParam("parametersUuid", parametersUuid.toString());

src/main/java/org/gridsuite/study/server/service/shortcircuit/ShortCircuitService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public UUID runShortCircuit(UUID studyUuid, UUID nodeUuid, String busId, ShortCi
9999
.queryParam(QUERY_PARAM_RECEIVER, receiver)
100100
.queryParam("reportUuid", reportUuid.toString())
101101
.queryParam("reporterId", nodeUuid.toString())
102-
.queryParam("reportType", StringUtils.isBlank(busId) ? StudyService.ReportType.ALL_BUSES_SHORTCIRCUIT_ANALYSIS.reportKey :
103-
StudyService.ReportType.ONE_BUS_SHORTCIRCUIT_ANALYSIS.reportKey);
102+
.queryParam("reportType", StringUtils.isBlank(busId) ? StudyService.ReportType.SHORT_CIRCUIT.reportKey :
103+
StudyService.ReportType.SHORT_CIRCUIT_ONE_BUS.reportKey);
104104

105105
if (!StringUtils.isBlank(busId)) {
106106
uriComponentsBuilder.queryParam("busId", busId);

0 commit comments

Comments
 (0)