From d878c7892b25e1fe18800bc87d6a08addd95ce12 Mon Sep 17 00:00:00 2001 From: Lisrte Date: Mon, 25 Mar 2024 16:07:29 +0100 Subject: [PATCH] Bump to powsybl-core 6.3.0-alpha-1 (#338) Signed-off-by: lisrte --- .../powsybl/dynawo/commons/CommonReports.java | 33 ++-- .../dynawo/commons/dynawologs/LogEntry.java | 2 +- .../dynawo/commons/dynawologs/LogUtils.java | 2 +- .../commons/dynawologs/CsvLogParserTest.java | 2 +- .../powsybl/dynaflow/DynaFlowProvider.java | 16 +- .../dynaflow/DynaFlowSecurityAnalysis.java | 10 +- .../DynaFlowSecurityAnalysisProvider.java | 15 +- .../com/powsybl/dynaflow/DynaflowReports.java | 40 ++++ .../java/com/powsybl/dynaflow/Reports.java | 37 ---- .../dynaflow_default_serialization.json | 2 +- ...dynaflow_parameters_set_serialization.json | 2 +- .../{Reporters.groovy => DslReports.groovy} | 15 +- .../dsl/DynaWaltzCurveGroovyExtension.groovy | 4 +- ...ynaWaltzDynamicModelGroovyExtension.groovy | 7 +- .../DynaWaltzEventModelGroovyExtension.groovy | 7 +- .../dsl/AbstractModelSupplierTest.java | 9 +- .../dsl/DynamicModelsSupplierTest.java | 171 +++++++++--------- .../dsl/EventModelsSupplierTest.java | 57 +++--- .../dynawaltz/dsl/ieee/AbstractIeeeTest.java | 2 +- .../powsybl/dynawaltz/DynaWaltzContext.java | 28 +-- .../powsybl/dynawaltz/DynaWaltzProvider.java | 34 ++-- .../powsybl/dynawaltz/DynawaltzReports.java | 89 ++++----- .../powsybl/dynawaltz/ModelsSimplifier.java | 4 +- .../builders/AbstractDynamicModelBuilder.java | 12 +- .../AbstractEquipmentModelBuilder.java | 16 +- .../dynawaltz/builders/BuilderConfig.java | 4 +- .../dynawaltz/builders/BuilderEquipment.java | 10 +- .../builders/BuilderEquipmentsList.java | 12 +- .../dynawaltz/builders/BuilderReports.java | 124 +++++++++++++ .../builders/EventBuilderConfig.java | 4 +- .../powsybl/dynawaltz/builders/Reporters.java | 136 -------------- .../AbstractAutomationSystemModelBuilder.java | 12 +- .../TapChangerAutomationSystem.java | 2 +- .../TapChangerAutomationSystemBuilder.java | 22 +-- .../TapChangerBlockingAutomationSystem.java | 2 +- ...hangerBlockingAutomationSystemBuilder.java | 24 +-- .../UnderVoltageAutomationSystemBuilder.java | 24 +-- ...stractOverloadManagementSystemBuilder.java | 14 +- ...ynamicOverloadManagementSystemBuilder.java | 22 +-- ...LevelsOverloadManagementSystemBuilder.java | 26 +-- .../AbstractPhaseShifterModelBuilder.java | 8 +- .../PhaseShifterIAutomationSystemBuilder.java | 22 +-- .../PhaseShifterPAutomationSystemBuilder.java | 22 +-- .../models/buses/AbstractBusBuilder.java | 6 +- .../models/buses/InfiniteBusBuilder.java | 22 +-- .../models/buses/StandardBusBuilder.java | 22 +-- .../events/AbstractEventModelBuilder.java | 10 +- .../EventActivePowerVariationBuilder.java | 16 +- .../events/EventDisconnectionBuilder.java | 18 +- .../models/events/NodeFaultEventBuilder.java | 20 +- .../generators/AbstractGeneratorBuilder.java | 6 +- .../GeneratorFictitiousBuilder.java | 22 +-- .../GridFormingConverterBuilder.java | 22 +-- .../SynchronizedGeneratorBuilder.java | 22 +-- .../SynchronousGeneratorBuilder.java | 22 +-- .../models/generators/WeccBuilder.java | 22 +-- .../models/hvdc/AbstractHvdcBuilder.java | 16 +- .../dynawaltz/models/hvdc/HvdcPBuilder.java | 22 +-- .../dynawaltz/models/hvdc/HvdcVscBuilder.java | 22 +-- .../dynawaltz/models/lines/LineBuilder.java | 22 +-- .../loads/AbstractLoadModelBuilder.java | 6 +- .../models/loads/BaseLoadBuilder.java | 22 +-- .../loads/LoadOneTransformerBuilder.java | 22 +-- .../LoadOneTransformerTapChangerBuilder.java | 22 +-- .../loads/LoadTwoTransformersBuilder.java | 22 +-- ...LoadTwoTransformersTapChangersBuilder.java | 22 +-- .../MacroConnectionsAdder.java | 12 +- .../BaseStaticVarCompensatorBuilder.java | 22 +-- .../TransformerFixedRatioBuilder.java | 22 +-- .../dynawaltz/DynaWaltzProviderTest.java | 6 +- .../dynawaltz/ModelsSimplifierTest.java | 6 +- .../models/BuilderEquipmentSetterTest.java | 11 +- .../xml/AbstractDynamicModelXmlTest.java | 10 +- ...mptyTapChangerAutomationSystemXmlTest.java | 6 +- ...hangerBlockingAutomationSystemXmlTest.java | 12 +- .../com/powsybl/dynawo/it/DynaFlowTest.java | 35 ++-- .../com/powsybl/dynawo/it/DynaWaltzTest.java | 2 +- .../security-analysis/timeline_report_as.txt | 72 ++++---- .../security-analysis/timeline_report_lf.txt | 2 +- .../resources/loadflow_timeline_report.txt | 10 +- pom.xml | 2 +- 81 files changed, 883 insertions(+), 881 deletions(-) create mode 100644 dynaflow/src/main/java/com/powsybl/dynaflow/DynaflowReports.java delete mode 100644 dynaflow/src/main/java/com/powsybl/dynaflow/Reports.java rename dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/{Reporters.groovy => DslReports.groovy} (53%) create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderReports.java delete mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/Reporters.java diff --git a/commons/src/main/java/com/powsybl/dynawo/commons/CommonReports.java b/commons/src/main/java/com/powsybl/dynawo/commons/CommonReports.java index f5ef8397e..9a24fff4f 100644 --- a/commons/src/main/java/com/powsybl/dynawo/commons/CommonReports.java +++ b/commons/src/main/java/com/powsybl/dynawo/commons/CommonReports.java @@ -7,9 +7,8 @@ */ package com.powsybl.dynawo.commons; -import com.powsybl.commons.reporter.Report; -import com.powsybl.commons.reporter.Reporter; -import com.powsybl.commons.reporter.TypedValue; +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.report.TypedValue; import com.powsybl.dynawo.commons.dynawologs.LogEntry; import com.powsybl.dynawo.commons.timeline.TimelineEntry; @@ -24,27 +23,27 @@ public final class CommonReports { private CommonReports() { } - public static Reporter createDynawoLogReporter(Reporter reporter) { - return reporter.createSubReporter("dynawoLog", "Dynawo Log"); + public static ReportNode createDynawoLogReportNode(ReportNode reportNode) { + return reportNode.newReportNode() + .withMessageTemplate("dynawoLog", "Dynawo Log") + .add(); } - public static void reportTimelineEntry(Reporter reporter, TimelineEntry timelineEntry) { - reporter.report(Report.builder() - .withKey("dynawoTimelineEntry") - .withDefaultMessage("[t=${time}] ${message} on equipment '${identifiableId}'") + public static void reportTimelineEntry(ReportNode reportNode, TimelineEntry timelineEntry) { + reportNode.newReportNode() + .withMessageTemplate("dynawoTimelineEntry", "[t=${time}] ${message} on equipment '${identifiableId}'") .withTypedValue("time", timelineEntry.time(), TIME_MS) .withTypedValue("identifiableId", timelineEntry.modelName(), ID) - .withValue("message", timelineEntry.message()) + .withUntypedValue("message", timelineEntry.message()) .withSeverity(TypedValue.TRACE_SEVERITY) - .build()); + .add(); } - public static void reportLogEntry(Reporter reporter, LogEntry logEntry) { - reporter.report(Report.builder() - .withKey("dynawoLogEntry") - .withDefaultMessage("${message}") - .withValue("message", logEntry.message()) + public static void reportLogEntry(ReportNode reportNode, LogEntry logEntry) { + reportNode.newReportNode() + .withMessageTemplate("dynawoLogEntry", "${message}") + .withUntypedValue("message", logEntry.message()) .withSeverity(logEntry.severity()) - .build()); + .add(); } } diff --git a/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogEntry.java b/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogEntry.java index 928221c4f..cef225643 100644 --- a/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogEntry.java +++ b/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogEntry.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawo.commons.dynawologs; -import com.powsybl.commons.reporter.TypedValue; +import com.powsybl.commons.report.TypedValue; /** * @author Laurent Issertial {@literal } diff --git a/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogUtils.java b/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogUtils.java index 760c431de..cefcccdf9 100644 --- a/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogUtils.java +++ b/commons/src/main/java/com/powsybl/dynawo/commons/dynawologs/LogUtils.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawo.commons.dynawologs; -import com.powsybl.commons.reporter.TypedValue; +import com.powsybl.commons.report.TypedValue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/commons/src/test/java/com/powsybl/dynawo/commons/dynawologs/CsvLogParserTest.java b/commons/src/test/java/com/powsybl/dynawo/commons/dynawologs/CsvLogParserTest.java index f9fc16b28..417198618 100644 --- a/commons/src/test/java/com/powsybl/dynawo/commons/dynawologs/CsvLogParserTest.java +++ b/commons/src/test/java/com/powsybl/dynawo/commons/dynawologs/CsvLogParserTest.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawo.commons.dynawologs; -import com.powsybl.commons.reporter.TypedValue; +import com.powsybl.commons.report.TypedValue; import org.junit.jupiter.api.Test; import java.net.URISyntaxException; diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java index a9ccce1ee..ba61308c5 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowProvider.java @@ -13,7 +13,7 @@ import com.powsybl.commons.extensions.Extension; import com.powsybl.commons.extensions.ExtensionJsonSerializer; import com.powsybl.commons.parameters.Parameter; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.computation.*; import com.powsybl.dynaflow.json.DynaFlowConfigSerializer; import com.powsybl.dynaflow.json.JsonDynaFlowParametersSerializer; @@ -110,7 +110,7 @@ public String getVersion() { @Override public CompletableFuture run(Network network, ComputationManager computationManager, String workingStateId, - LoadFlowParameters loadFlowParameters, Reporter reporter) { + LoadFlowParameters loadFlowParameters, ReportNode reportNode) { Objects.requireNonNull(network); Objects.requireNonNull(computationManager); Objects.requireNonNull(workingStateId); @@ -120,7 +120,7 @@ public CompletableFuture run(Network network, ComputationManager ExecutionEnvironment env = new ExecutionEnvironment(config.createEnv(), WORKING_DIR_PREFIX, config.isDebug()); Command versionCmd = getVersionCommand(config); DynawoUtil.requireDynaMinVersion(env, computationManager, versionCmd, DYNAFLOW_LAUNCHER_PROGRAM_NAME, true); - return computationManager.execute(env, new DynaFlowHandler(network, workingStateId, dynaFlowParameters, loadFlowParameters, config, reporter)); + return computationManager.execute(env, new DynaFlowHandler(network, workingStateId, dynaFlowParameters, loadFlowParameters, config, reportNode)); } @Override @@ -181,16 +181,16 @@ private static class DynaFlowHandler extends AbstractExecutionHandler tl = new XmlTimeLineParser().parse(timelineFile); - tl.forEach(e -> CommonReports.reportTimelineEntry(dfReporter, e)); + tl.forEach(e -> CommonReports.reportTimelineEntry(dfReportNode, e)); } } } diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysis.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysis.java index 3fc45e826..ab7cba442 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysis.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysis.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; import com.powsybl.commons.json.JsonUtil; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.computation.*; import com.powsybl.contingency.ContingenciesProvider; import com.powsybl.contingency.Contingency; @@ -135,11 +135,11 @@ public boolean removeInterceptor(SecurityAnalysisInterceptor interceptor) { public CompletableFuture run(String workingVariantId, SecurityAnalysisParameters securityAnalysisParameters, ContingenciesProvider contingenciesProvider, - Reporter reporter) { + ReportNode reportNode) { Objects.requireNonNull(workingVariantId); Objects.requireNonNull(securityAnalysisParameters); Objects.requireNonNull(contingenciesProvider); - Objects.requireNonNull(reporter); + Objects.requireNonNull(reportNode); DynaFlowConfig config = Objects.requireNonNull(configSupplier.get()); ExecutionEnvironment env = new ExecutionEnvironment(config.createEnv(), WORKING_DIR_PREFIX, config.isDebug()); @@ -174,8 +174,8 @@ public SecurityAnalysisReport after(Path workingDir, ExecutionReport report) thr // Report the timeline events from the timeline files written by dynawo Path timelineDir = workingDir.resolve(DYNAWO_TIMELINE_FOLDER); contingencies.forEach(c -> { - Reporter contingencyReporter = Reports.createDynaFlowTimelineReporter(reporter, c.getId()); - getTimeline(timelineDir, c).forEach(e -> CommonReports.reportTimelineEntry(contingencyReporter, e)); + ReportNode contingencyReportNode = DynaflowReports.createDynaFlowTimelineReportNode(reportNode, c.getId()); + getTimeline(timelineDir, c).forEach(e -> CommonReports.reportTimelineEntry(contingencyReportNode, e)); }); return new SecurityAnalysisReport( diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java index c0ef6278b..bbcacc572 100644 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaFlowSecurityAnalysisProvider.java @@ -7,14 +7,15 @@ package com.powsybl.dynaflow; import com.google.auto.service.AutoService; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.action.Action; +import com.powsybl.commons.report.ReportNode; import com.powsybl.computation.ComputationManager; import com.powsybl.contingency.ContingenciesProvider; import com.powsybl.dynawo.commons.PowsyblDynawoVersion; import com.powsybl.iidm.network.Network; import com.powsybl.security.*; -import com.powsybl.security.action.Action; import com.powsybl.security.interceptors.SecurityAnalysisInterceptor; +import com.powsybl.security.limitreduction.LimitReduction; import com.powsybl.security.monitor.StateMonitor; import com.powsybl.security.strategy.OperatorStrategy; import org.slf4j.Logger; @@ -57,7 +58,8 @@ public CompletableFuture run(Network network, List operatorStrategies, List actions, List monitors, - Reporter reporter) { + List limitReductions, + ReportNode reportNode) { if (detector != null) { LOG.error("LimitViolationDetector is not used in Dynaflow implementation."); } @@ -70,11 +72,14 @@ public CompletableFuture run(Network network, if (actions != null && !actions.isEmpty()) { LOG.error("Actions are not implemented in Dynaflow"); } + if (limitReductions != null && !limitReductions.isEmpty()) { + LOG.error("Limit reductions are not implemented in Dynaflow"); + } DynaFlowSecurityAnalysis securityAnalysis = new DynaFlowSecurityAnalysis(network, filter, computationManager, configSupplier); interceptors.forEach(securityAnalysis::addInterceptor); - Reporter dfsaReporter = Reports.createDynaFlowSecurityAnalysisReporter(reporter, network.getId()); - return securityAnalysis.run(workingVariantId, parameters, contingenciesProvider, dfsaReporter); + ReportNode dfsaReportNode = DynaflowReports.createDynaFlowSecurityAnalysisReportNode(reportNode, network.getId()); + return securityAnalysis.run(workingVariantId, parameters, contingenciesProvider, dfsaReportNode); } @Override diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/DynaflowReports.java b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaflowReports.java new file mode 100644 index 000000000..9223cbc4f --- /dev/null +++ b/dynaflow/src/main/java/com/powsybl/dynaflow/DynaflowReports.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynaflow; + +import com.powsybl.commons.report.ReportNode; + +/** + * @author Florian Dupuy {@literal } + */ +public final class DynaflowReports { + + private DynaflowReports() { + } + + public static ReportNode createDynaFlowReportNode(ReportNode reportNode, String networkId) { + return reportNode.newReportNode() + .withMessageTemplate("dynaflow", "Dynaflow loadflow on network '${networkId}'") + .withUntypedValue("networkId", networkId) + .add(); + } + + public static ReportNode createDynaFlowSecurityAnalysisReportNode(ReportNode reportNode, String networkId) { + return reportNode.newReportNode() + .withMessageTemplate("dynaflowSa", "Dynaflow security analysis on network '${networkId}'") + .withUntypedValue("networkId", networkId) + .add(); + } + + public static ReportNode createDynaFlowTimelineReportNode(ReportNode reportNode, String contingencyId) { + return reportNode.newReportNode() + .withMessageTemplate("dynaflowSaContingency", "Contingency '${contingencyId}'") + .withUntypedValue("contingencyId", contingencyId) + .add(); + } +} diff --git a/dynaflow/src/main/java/com/powsybl/dynaflow/Reports.java b/dynaflow/src/main/java/com/powsybl/dynaflow/Reports.java deleted file mode 100644 index c88b08fb3..000000000 --- a/dynaflow/src/main/java/com/powsybl/dynaflow/Reports.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * SPDX-License-Identifier: MPL-2.0 - */ -package com.powsybl.dynaflow; - -import com.powsybl.commons.reporter.Reporter; - -/** - * @author Florian Dupuy {@literal } - */ -public final class Reports { - - private Reports() { - } - - public static Reporter createDynaFlowReporter(Reporter reporter, String networkId) { - return reporter.createSubReporter("dynaflow", - "Dynaflow loadflow on network '${networkId}'", - "networkId", networkId); - } - - public static Reporter createDynaFlowSecurityAnalysisReporter(Reporter reporter, String networkId) { - return reporter.createSubReporter("dynaflowSa", - "Dynaflow security analysis on network '${networkId}'", - "networkId", networkId); - } - - public static Reporter createDynaFlowTimelineReporter(Reporter reporter, String contingencyId) { - return reporter.createSubReporter("dynaflowSaContingency", - "Contingency '${contingencyId}'", - "contingencyId", contingencyId); - } -} diff --git a/dynaflow/src/test/resources/dynaflow_default_serialization.json b/dynaflow/src/test/resources/dynaflow_default_serialization.json index 3ccf51804..d1f587fe7 100644 --- a/dynaflow/src/test/resources/dynaflow_default_serialization.json +++ b/dynaflow/src/test/resources/dynaflow_default_serialization.json @@ -7,7 +7,7 @@ "twtSplitShuntAdmittance" : false, "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, - "writeSlackBus" : false, + "writeSlackBus" : true, "dc" : false, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", diff --git a/dynaflow/src/test/resources/dynaflow_parameters_set_serialization.json b/dynaflow/src/test/resources/dynaflow_parameters_set_serialization.json index 8771080ce..605143a3c 100644 --- a/dynaflow/src/test/resources/dynaflow_parameters_set_serialization.json +++ b/dynaflow/src/test/resources/dynaflow_parameters_set_serialization.json @@ -7,7 +7,7 @@ "twtSplitShuntAdmittance" : false, "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, - "writeSlackBus" : false, + "writeSlackBus" : true, "dc" : false, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", diff --git a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/Reporters.groovy b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DslReports.groovy similarity index 53% rename from dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/Reporters.groovy rename to dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DslReports.groovy index db42ee06f..9f28bce91 100644 --- a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/Reporters.groovy +++ b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DslReports.groovy @@ -7,19 +7,20 @@ */ package com.powsybl.dynawaltz.dsl +import com.powsybl.commons.report.ReportNode; -import com.powsybl.commons.reporter.Reporter /** * @author Laurent Issertial {@literal } */ -final class Reporters { +final class DslReports { - private Reporters() { + private DslReports() { } - static Reporter createModelBuilderReporter(Reporter reporter, String name) { - reporter.createSubReporter("DSLModelBuilder", - 'DSL model builder for ${name}', - "name", name) + static ReportNode createModelBuilderReportNode(ReportNode reportNode, String name) { + reportNode.newReportNode() + .withMessageTemplate("DSLModelBuilder", 'DSL model builder for ${name}') + .withUntypedValue("name", name) + .add() } } diff --git a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzCurveGroovyExtension.groovy b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzCurveGroovyExtension.groovy index 63f698aba..36b0f4fc1 100644 --- a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzCurveGroovyExtension.groovy +++ b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzCurveGroovyExtension.groovy @@ -7,7 +7,7 @@ package com.powsybl.dynawaltz.dsl import com.google.auto.service.AutoService -import com.powsybl.commons.reporter.Reporter +import com.powsybl.commons.report.ReportNode import com.powsybl.dsl.DslException import com.powsybl.dynamicsimulation.Curve import com.powsybl.dynamicsimulation.groovy.CurveGroovyExtension @@ -79,7 +79,7 @@ class DynaWaltzCurveGroovyExtension implements CurveGroovyExtension { } @Override - void load(Binding binding, Consumer consumer, Reporter reporter) { + void load(Binding binding, Consumer consumer, ReportNode reportNode) { binding.curve = { Closure closure -> def cloned = closure.clone() CurvesSpec curveSpec = new CurvesSpec() diff --git a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzDynamicModelGroovyExtension.groovy b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzDynamicModelGroovyExtension.groovy index 8e00fe363..7196518f5 100644 --- a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzDynamicModelGroovyExtension.groovy +++ b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzDynamicModelGroovyExtension.groovy @@ -8,7 +8,7 @@ package com.powsybl.dynawaltz.dsl import com.google.auto.service.AutoService -import com.powsybl.commons.reporter.Reporter +import com.powsybl.commons.report.ReportNode import com.powsybl.dynamicsimulation.DynamicModel import com.powsybl.dynamicsimulation.groovy.DynamicModelGroovyExtension import com.powsybl.dynawaltz.DynaWaltzProvider @@ -18,6 +18,7 @@ import com.powsybl.dynawaltz.builders.ModelConfigsHandler import com.powsybl.iidm.network.Network import java.util.function.Consumer + /** * @author Laurent Issertial {@literal } */ @@ -42,13 +43,13 @@ class DynaWaltzDynamicModelGroovyExtension implements DynamicModelGroovyExtensio @Override - void load(Binding binding, Consumer consumer, Reporter reporter) { + void load(Binding binding, Consumer consumer, ReportNode reportNode) { builderConfigs.forEach {conf -> conf.libs.forEach {lib -> binding.setVariable(lib , { Closure closure -> def cloned = closure.clone() ModelBuilder builder = conf.builderConstructor - .createBuilder(binding.getVariable("network") as Network, lib, Reporters.createModelBuilderReporter(reporter, lib)) + .createBuilder(binding.getVariable("network") as Network, lib, DslReports.createModelBuilderReportNode(reportNode, lib)) cloned.delegate = builder cloned() builder.build()?.tap { diff --git a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzEventModelGroovyExtension.groovy b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzEventModelGroovyExtension.groovy index 1310c7024..816673fcd 100644 --- a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzEventModelGroovyExtension.groovy +++ b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/DynaWaltzEventModelGroovyExtension.groovy @@ -8,7 +8,7 @@ package com.powsybl.dynawaltz.dsl import com.google.auto.service.AutoService -import com.powsybl.commons.reporter.Reporter +import com.powsybl.commons.report.ReportNode import com.powsybl.dynamicsimulation.EventModel import com.powsybl.dynamicsimulation.groovy.EventModelGroovyExtension import com.powsybl.dynawaltz.DynaWaltzProvider @@ -18,6 +18,7 @@ import com.powsybl.dynawaltz.builders.ModelConfigsHandler import com.powsybl.iidm.network.Network import java.util.function.Consumer + /** * @author Laurent Issertial {@literal } */ @@ -40,13 +41,13 @@ class DynaWaltzEventModelGroovyExtension implements EventModelGroovyExtension { } @Override - void load(Binding binding, Consumer consumer, Reporter reporter) { + void load(Binding binding, Consumer consumer, ReportNode reportNode) { builderConfigs.forEach { binding.setVariable(it.tag, { Closure closure -> def cloned = closure.clone() ModelBuilder builder = it.builderConstructor.createBuilder( binding.getVariable("network") as Network, - Reporters.createModelBuilderReporter(reporter, it.tag)) + DslReports.createModelBuilderReportNode(reportNode, it.tag)) cloned.delegate = builder cloned() builder.build()?.tap { diff --git a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/AbstractModelSupplierTest.java b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/AbstractModelSupplierTest.java index 7776a7b20..c9507e507 100644 --- a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/AbstractModelSupplierTest.java +++ b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/AbstractModelSupplierTest.java @@ -7,9 +7,10 @@ */ package com.powsybl.dynawaltz.dsl; -import com.powsybl.commons.reporter.ReporterModel; +import com.powsybl.commons.report.ReportNode; import com.powsybl.commons.test.TestUtil; +import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; import java.util.Objects; @@ -21,15 +22,15 @@ */ abstract class AbstractModelSupplierTest { - protected final ReporterModel reporter = new ReporterModel("dslTests", "DSL tests"); + protected final ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("dslTests", "DSL tests").build(); protected InputStream getResourceAsStream(String name) { return Objects.requireNonNull(AbstractModelSupplierTest.class.getResourceAsStream(name)); } - protected void checkReporter(String report) { + protected void checkReportNode(String report) throws IOException { StringWriter sw = new StringWriter(); - reporter.export(sw); + reportNode.print(sw); assertEquals(report, TestUtil.normalizeLineSeparator(sw.toString())); } } diff --git a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/DynamicModelsSupplierTest.java b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/DynamicModelsSupplierTest.java index 949001571..de01d2460 100644 --- a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/DynamicModelsSupplierTest.java +++ b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/DynamicModelsSupplierTest.java @@ -43,6 +43,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; import java.util.List; import java.util.stream.Stream; @@ -77,21 +78,21 @@ void testAutomationSystemDynamicModels(String groovyScriptName, Class modelClass, Network network, String terminalVarName, String report) { + void testGeneratorPrefixes(String groovyScriptName, Class modelClass, Network network, String terminalVarName, String report) throws IOException { DynamicModelsSupplier supplier = new GroovyDynamicModelsSupplier(getResourceAsStream(groovyScriptName), EXTENSIONS); - List dynamicModels = supplier.get(network, reporter); + List dynamicModels = supplier.get(network, reportNode); assertEquals(1, dynamicModels.size()); assertTrue(modelClass.isInstance(dynamicModels.get(0))); assertEquals(terminalVarName, modelClass.cast(dynamicModels.get(0)).getTerminalVarName()); - checkReporter(report); + checkReportNode(report); } void assertEquipmentBlackBoxModel(EquipmentBlackBoxModel bbm, String dynamicId, String staticId, String parameterId, String lib) { @@ -153,139 +154,139 @@ private static Stream provideWarningsModel() { Arguments.of("/warnings/missingStaticId.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for LoadAlphaBeta - 'staticId' field is not set - 'dynamicModelId' field is not set, staticId (unknown staticId) will be used instead - Model unknownDynamicId cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for LoadAlphaBeta + 'staticId' field is not set + 'dynamicModelId' field is not set, staticId (unknown staticId) will be used instead + Model unknownDynamicId cannot be instantiated """), Arguments.of("/warnings/missingParameterId.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for LoadAlphaBeta - 'parameterSetId' field is not set - 'dynamicModelId' field is not set, staticId LOAD will be used instead - Model LOAD cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for LoadAlphaBeta + 'parameterSetId' field is not set + 'dynamicModelId' field is not set, staticId LOAD will be used instead + Model LOAD cannot be instantiated """), Arguments.of("/warnings/missingEquipment.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for LoadAlphaBeta - 'staticId' field value 'GEN' not found for equipment type(s) LOAD - 'dynamicModelId' field is not set, staticId GEN will be used instead - Model GEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for LoadAlphaBeta + 'staticId' field value 'GEN' not found for equipment type(s) LOAD + 'dynamicModelId' field is not set, staticId GEN will be used instead + Model GEN cannot be instantiated """), Arguments.of("/warnings/missingDangling.groovy", HvdcTestNetwork.createVsc(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for HvdcPVDangling - 'dangling' field is not set - Model BBM_HVDC_L cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for HvdcPVDangling + 'dangling' field is not set + Model BBM_HVDC_L cannot be instantiated """), Arguments.of("/warnings/missingDanglingProperty.groovy", HvdcTestNetwork.createVsc(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for HvdcPV - 'dangling' field is set but HvdcPV does not possess this option - Model BBM_HVDC_L cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for HvdcPV + 'dangling' field is set but HvdcPV does not possess this option + Model BBM_HVDC_L cannot be instantiated """), Arguments.of("/warnings/underVoltageMissingGenerator.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for UnderVoltage - 'generator' field value 'NGEN' not found for equipment type(s) GENERATOR - Model UV_GEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for UnderVoltage + 'generator' field value 'NGEN' not found for equipment type(s) GENERATOR + Model UV_GEN cannot be instantiated """), Arguments.of("/warnings/phaseShifterMissingTransformer.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for PhaseShifterI - 'transformer' field value 'NGEN' not found for equipment type(s) TWO_WINDINGS_TRANSFORMER - Model PS_NGEN_NHV1 cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for PhaseShifterI + 'transformer' field value 'NGEN' not found for equipment type(s) TWO_WINDINGS_TRANSFORMER + Model PS_NGEN_NHV1 cannot be instantiated """), Arguments.of("/warnings/claMissingMeasurement.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for OverloadManagementSystem - 'iMeasurement' field value 'NGEN' not found for equipment type(s) BRANCH - Model CLA_NGEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for OverloadManagementSystem + 'iMeasurement' field value 'NGEN' not found for equipment type(s) BRANCH + Model CLA_NGEN cannot be instantiated """), Arguments.of("/warnings/claMissingMeasurementSide.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for OverloadManagementSystem - 'iMeasurementSide' field is not set - Model CLA_NGEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for OverloadManagementSystem + 'iMeasurementSide' field is not set + Model CLA_NGEN cannot be instantiated """), Arguments.of("/warnings/claMissingControlled.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for OverloadManagementSystem - 'controlledBranch' field value 'GEN' not found for equipment type(s) BRANCH - Model CLA_NGEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for OverloadManagementSystem + 'controlledBranch' field value 'GEN' not found for equipment type(s) BRANCH + Model CLA_NGEN cannot be instantiated """), Arguments.of("/warnings/cla2MissingMeasurement2.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for TwoLevelsOverloadManagementSystem - 'iMeasurement2' field value 'NGEN' not found for equipment type(s) BRANCH - Model CLA_NGEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for TwoLevelsOverloadManagementSystem + 'iMeasurement2' field value 'NGEN' not found for equipment type(s) BRANCH + Model CLA_NGEN cannot be instantiated """), Arguments.of("/warnings/cla2MissingMeasurementSide2.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for TwoLevelsOverloadManagementSystem - 'iMeasurement2Side' field is not set - Model CLA_NGEN cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for TwoLevelsOverloadManagementSystem + 'iMeasurement2Side' field is not set + Model CLA_NGEN cannot be instantiated """), Arguments.of("/warnings/tapChangerMissingBus.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for TapChangerBlockingAutomaton - 'uMeasurements' field value 'LOAD' not found for equipment type(s) BUS/BUSBAR_SECTION - 'uMeasurements' field value 'Wrong_ID' not found for equipment type(s) BUS/BUSBAR_SECTION - 'uMeasurements' list is empty - Model ZAB cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for TapChangerBlockingAutomaton + 'uMeasurements' field value 'LOAD' not found for equipment type(s) BUS/BUSBAR_SECTION + 'uMeasurements' field value 'Wrong_ID' not found for equipment type(s) BUS/BUSBAR_SECTION + 'uMeasurements' list is empty + Model ZAB cannot be instantiated """), Arguments.of("/warnings/tapChangerMissingBusList.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for TapChangerBlockingAutomaton - 'uMeasurements' field value '[LOAD, Wrong_ID]' not found for equipment type(s) BUS/BUSBAR_SECTION - 'uMeasurements' field value '[NGEN_NHV1]' not found for equipment type(s) BUS/BUSBAR_SECTION - 'uMeasurements' list is empty - Model ZAB cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for TapChangerBlockingAutomaton + 'uMeasurements' field value '[LOAD, Wrong_ID]' not found for equipment type(s) BUS/BUSBAR_SECTION + 'uMeasurements' field value '[NGEN_NHV1]' not found for equipment type(s) BUS/BUSBAR_SECTION + 'uMeasurements' list is empty + Model ZAB cannot be instantiated """), Arguments.of("/warnings/tapChangerCompatible.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for TapChangerBlockingAutomaton - 'transformers' field value 'GEN' not found for equipment type(s) TWO_WINDINGS_TRANSFORMER/LOAD, id will be used as pure dynamic model id - 'uMeasurements' field value 'GEN' not found for equipment type(s) BUS/BUSBAR_SECTION - 'uMeasurements' list is empty - Model ZAB cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for TapChangerBlockingAutomaton + 'transformers' field value 'GEN' not found for equipment type(s) TWO_WINDINGS_TRANSFORMER/LOAD, id will be used as pure dynamic model id + 'uMeasurements' field value 'GEN' not found for equipment type(s) BUS/BUSBAR_SECTION + 'uMeasurements' list is empty + Model ZAB cannot be instantiated """), Arguments.of("/warnings/hvdcVscWrongStaticType.groovy", HvdcTestNetwork.createLcc(), """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for HvdcVSC - 'staticId' field value 'L' not found for equipment type(s) VSC HVDC_LINE - Model BBM_HVDC cannot be instantiated + + Groovy Dynamic Models Supplier + + DSL model builder for HvdcVSC + 'staticId' field value 'L' not found for equipment type(s) VSC HVDC_LINE + Model BBM_HVDC cannot be instantiated """) ); } @@ -295,16 +296,16 @@ private static Stream provideGenerator() { Arguments.of("/dynamicModels/gen.groovy", SynchronousGenerator.class, EurostagTutorialExample1Factory.create(), "generator_terminal", """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for GeneratorSynchronousThreeWindings - Model BBM_GEN instantiation successful + + Groovy Dynamic Models Supplier + + DSL model builder for GeneratorSynchronousThreeWindings + Model BBM_GEN instantiation successful """), Arguments.of("/dynamicModels/genTfo.groovy", SynchronousGenerator.class, EurostagTutorialExample1Factory.create(), "transformer_terminal1", """ + DSL tests - + Groovy Dynamic Models Supplier - + DSL model builder for GeneratorSynchronousThreeWindingsPmConstVRNordicTfo - Model BBM_GEN instantiation successful + + Groovy Dynamic Models Supplier + + DSL model builder for GeneratorSynchronousThreeWindingsPmConstVRNordicTfo + Model BBM_GEN instantiation successful """) ); } diff --git a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/EventModelsSupplierTest.java b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/EventModelsSupplierTest.java index daae12680..224310852 100644 --- a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/EventModelsSupplierTest.java +++ b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/EventModelsSupplierTest.java @@ -23,6 +23,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.io.IOException; import java.util.List; import java.util.stream.Stream; @@ -47,10 +48,10 @@ void testEventModels(String groovyScriptName, Class mod @ParameterizedTest(name = "{0}") @MethodSource("provideWarningsModel") - void testDslWarnings(String groovyScriptName, Network network, String report) { + void testDslWarnings(String groovyScriptName, Network network, String report) throws IOException { EventModelsSupplier supplier = new GroovyEventModelsSupplier(getResourceAsStream(groovyScriptName), EXTENSIONS); - assertTrue(supplier.get(network, reporter).isEmpty()); - checkReporter(report); + assertTrue(supplier.get(network, reportNode).isEmpty()); + checkReportNode(report); } void assertEventModel(AbstractEvent em, String dynamicId, String equipmentStaticId, String lib, double startTime) { @@ -81,51 +82,51 @@ private static Stream provideWarningsModel() { Arguments.of("/eventWarnings/missingStaticId.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Event Models Supplier - + DSL model builder for NodeFault - 'staticId' field value 'GEN' not found for equipment type(s) BUS - Model NodeFault_GEN cannot be instantiated + + Groovy Event Models Supplier + + DSL model builder for NodeFault + 'staticId' field value 'GEN' not found for equipment type(s) BUS + Model NodeFault_GEN cannot be instantiated """), Arguments.of("/eventWarnings/missingStartTime.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Event Models Supplier - + DSL model builder for NodeFault - 'startTime' field is not set - Model NodeFault_NGEN cannot be instantiated + + Groovy Event Models Supplier + + DSL model builder for NodeFault + 'startTime' field is not set + Model NodeFault_NGEN cannot be instantiated """), Arguments.of("/eventWarnings/missingNodeFaultParameters.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Event Models Supplier - + DSL model builder for NodeFault - faultTime should be strictly positive (0.0) - Model NodeFault_NGEN cannot be instantiated + + Groovy Event Models Supplier + + DSL model builder for NodeFault + faultTime should be strictly positive (0.0) + Model NodeFault_NGEN cannot be instantiated """), Arguments.of("/eventWarnings/missingAPVParameters.groovy", SvcTestCaseFactory.create(), """ + DSL tests - + Groovy Event Models Supplier - + DSL model builder for Step - 'staticId' field value 'SVC2' not found for equipment type(s) GENERATOR/LOAD - 'deltaP' field is not set - Model Step_SVC2 cannot be instantiated + + Groovy Event Models Supplier + + DSL model builder for Step + 'staticId' field value 'SVC2' not found for equipment type(s) GENERATOR/LOAD + 'deltaP' field is not set + Model Step_SVC2 cannot be instantiated """), Arguments.of("/eventWarnings/missingDisconnectionEquipment.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Event Models Supplier - + DSL model builder for Disconnect - 'staticId' field value 'NGEN' not found for equipment type(s) Disconnectable equipment - Model Disconnect_NGEN cannot be instantiated + + Groovy Event Models Supplier + + DSL model builder for Disconnect + 'staticId' field value 'NGEN' not found for equipment type(s) Disconnectable equipment + Model Disconnect_NGEN cannot be instantiated """), Arguments.of("/eventWarnings/missingDisconnectionSide.groovy", EurostagTutorialExample1Factory.create(), """ + DSL tests - + Groovy Event Models Supplier - + DSL model builder for Disconnect - 'disconnectOnly' field is set but GENERATOR GEN does not possess this option - Model Disconnect_GEN cannot be instantiated + + Groovy Event Models Supplier + + DSL model builder for Disconnect + 'disconnectOnly' field is set but GENERATOR GEN does not possess this option + Model Disconnect_GEN cannot be instantiated """) ); } diff --git a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/ieee/AbstractIeeeTest.java b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/ieee/AbstractIeeeTest.java index 10fa9d61b..a27013195 100644 --- a/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/ieee/AbstractIeeeTest.java +++ b/dynawaltz-dsl/src/test/java/com/powsybl/dynawaltz/dsl/ieee/AbstractIeeeTest.java @@ -29,7 +29,7 @@ import java.util.Objects; import java.util.concurrent.ForkJoinPool; -import static com.powsybl.commons.reporter.Reporter.NO_OP; +import static com.powsybl.commons.report.ReportNode.NO_OP; import static org.junit.jupiter.api.Assertions.assertEquals; /** diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index 71873889b..7042d5cdc 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -7,7 +7,7 @@ package com.powsybl.dynawaltz; import com.powsybl.commons.PowsyblException; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.Curve; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawaltz.models.AbstractPureDynamicBlackBoxModel; @@ -65,26 +65,26 @@ public class DynaWaltzContext { public DynaWaltzContext(Network network, String workingVariantId, List dynamicModels, List eventModels, List curves, DynamicSimulationParameters parameters, DynaWaltzParameters dynaWaltzParameters) { - this(network, workingVariantId, dynamicModels, eventModels, curves, parameters, dynaWaltzParameters, Reporter.NO_OP); + this(network, workingVariantId, dynamicModels, eventModels, curves, parameters, dynaWaltzParameters, ReportNode.NO_OP); } public DynaWaltzContext(Network network, String workingVariantId, List dynamicModels, List eventModels, - List curves, DynamicSimulationParameters parameters, DynaWaltzParameters dynaWaltzParameters, Reporter reporter) { + List curves, DynamicSimulationParameters parameters, DynaWaltzParameters dynaWaltzParameters, ReportNode reportNode) { - Reporter contextReporter = DynawaltzReports.createDynaWaltzContextReporter(reporter); + ReportNode contextReportNode = DynawaltzReports.createDynaWaltzContextReportNode(reportNode); this.network = Objects.requireNonNull(network); this.workingVariantId = Objects.requireNonNull(workingVariantId); this.parameters = Objects.requireNonNull(parameters); this.dynaWaltzParameters = Objects.requireNonNull(dynaWaltzParameters); Stream uniqueIdsDynamicModels = Objects.requireNonNull(dynamicModels).stream() - .filter(distinctByDynamicId(contextReporter).and(distinctByStaticId(contextReporter))); + .filter(distinctByDynamicId(contextReportNode).and(distinctByStaticId(contextReportNode))); this.dynamicModels = dynaWaltzParameters.isUseModelSimplifiers() - ? simplifyModels(uniqueIdsDynamicModels, contextReporter).toList() + ? simplifyModels(uniqueIdsDynamicModels, contextReportNode).toList() : uniqueIdsDynamicModels.toList(); this.eventModels = Objects.requireNonNull(eventModels).stream() - .filter(distinctByDynamicId(contextReporter)) + .filter(distinctByDynamicId(contextReportNode)) .toList(); this.staticIdBlackBoxModelMap = getInputBlackBoxDynamicModelStream() .filter(EquipmentBlackBoxModel.class::isInstance) @@ -103,7 +103,7 @@ public DynaWaltzContext(Network network, String workingVariantId, List new MacroStaticReference(k, bbm.getVarsMapping())); @@ -119,10 +119,10 @@ public DynaWaltzContext(Network network, String workingVariantId, List simplifyModels(Stream inputBbm, Reporter reporter) { + private Stream simplifyModels(Stream inputBbm, ReportNode reportNode) { Stream outputBbm = inputBbm; for (ModelsSimplifier modelsSimplifier : ServiceLoader.load(ModelsSimplifier.class)) { - outputBbm = modelsSimplifier.simplifyModels(outputBbm, network, dynaWaltzParameters, reporter); + outputBbm = modelsSimplifier.simplifyModels(outputBbm, network, dynaWaltzParameters, reportNode); } return outputBbm; } @@ -194,22 +194,22 @@ public T getPureDynamicModel(String dynamicId, Class connec } } - protected static Predicate distinctByStaticId(Reporter reporter) { + protected static Predicate distinctByStaticId(ReportNode reportNode) { Set seen = new HashSet<>(); return bbm -> { if (bbm instanceof EquipmentBlackBoxModel eBbm && !seen.add(eBbm.getStaticId())) { - DynawaltzReports.reportDuplicateStaticId(reporter, eBbm.getStaticId(), eBbm.getLib(), eBbm.getDynamicModelId()); + DynawaltzReports.reportDuplicateStaticId(reportNode, eBbm.getStaticId(), eBbm.getLib(), eBbm.getDynamicModelId()); return false; } return true; }; } - protected static Predicate distinctByDynamicId(Reporter reporter) { + protected static Predicate distinctByDynamicId(ReportNode reportNode) { Set seen = new HashSet<>(); return bbm -> { if (!seen.add(bbm.getDynamicModelId())) { - DynawaltzReports.reportDuplicateDynamicId(reporter, bbm.getDynamicModelId(), bbm.getName()); + DynawaltzReports.reportDuplicateDynamicId(reportNode, bbm.getDynamicModelId(), bbm.getName()); return false; } return true; diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzProvider.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzProvider.java index 49493e02b..78745992d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzProvider.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzProvider.java @@ -8,7 +8,7 @@ import com.google.auto.service.AutoService; import com.powsybl.commons.config.PlatformConfig; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.computation.*; import com.powsybl.dynamicsimulation.*; import com.powsybl.dynawaltz.models.BlackBoxModel; @@ -110,15 +110,15 @@ public static Command getVersionCommand(DynaWaltzConfig dynaWaltzConfig) { @Override public CompletableFuture run(Network network, DynamicModelsSupplier dynamicModelsSupplier, EventModelsSupplier eventModelsSupplier, CurvesSupplier curvesSupplier, String workingVariantId, - ComputationManager computationManager, DynamicSimulationParameters parameters, Reporter reporter) { + ComputationManager computationManager, DynamicSimulationParameters parameters, ReportNode reportNode) { Objects.requireNonNull(dynamicModelsSupplier); Objects.requireNonNull(eventModelsSupplier); Objects.requireNonNull(curvesSupplier); Objects.requireNonNull(workingVariantId); Objects.requireNonNull(parameters); - Objects.requireNonNull(reporter); + Objects.requireNonNull(reportNode); DynaWaltzParameters dynaWaltzParameters = getDynaWaltzSimulationParameters(parameters); - return run(network, dynamicModelsSupplier, eventModelsSupplier, curvesSupplier, workingVariantId, computationManager, parameters, dynaWaltzParameters, reporter); + return run(network, dynamicModelsSupplier, eventModelsSupplier, curvesSupplier, workingVariantId, computationManager, parameters, dynaWaltzParameters, reportNode); } private DynaWaltzParameters getDynaWaltzSimulationParameters(DynamicSimulationParameters parameters) { @@ -130,43 +130,43 @@ private DynaWaltzParameters getDynaWaltzSimulationParameters(DynamicSimulationPa } private CompletableFuture run(Network network, DynamicModelsSupplier dynamicModelsSupplier, EventModelsSupplier eventsModelsSupplier, CurvesSupplier curvesSupplier, - String workingVariantId, ComputationManager computationManager, DynamicSimulationParameters parameters, DynaWaltzParameters dynaWaltzParameters, Reporter reporter) { + String workingVariantId, ComputationManager computationManager, DynamicSimulationParameters parameters, DynaWaltzParameters dynaWaltzParameters, ReportNode reportNode) { - Reporter dsReporter = DynawaltzReports.createDynaWaltzReporter(reporter, network.getId()); + ReportNode dsReportNode = DynawaltzReports.createDynaWaltzReportNode(reportNode, network.getId()); network.getVariantManager().setWorkingVariant(workingVariantId); ExecutionEnvironment execEnv = new ExecutionEnvironment(Collections.emptyMap(), WORKING_DIR_PREFIX, dynaWaltzConfig.isDebug()); Command versionCmd = getVersionCommand(dynaWaltzConfig); DynawoUtil.requireDynaMinVersion(execEnv, computationManager, versionCmd, DynawoConstants.DYNAWO_CMD_NAME, false); - List blackBoxModels = dynamicModelsSupplier.get(network, dsReporter).stream() + List blackBoxModels = dynamicModelsSupplier.get(network, dsReportNode).stream() .filter(BlackBoxModel.class::isInstance) .map(BlackBoxModel.class::cast) .collect(Collectors.toList()); - List blackBoxEventModels = eventsModelsSupplier.get(network, dsReporter).stream() + List blackBoxEventModels = eventsModelsSupplier.get(network, dsReportNode).stream() .filter(BlackBoxModel.class::isInstance) .map(BlackBoxModel.class::cast) .collect(Collectors.toList()); - DynaWaltzContext context = new DynaWaltzContext(network, workingVariantId, blackBoxModels, blackBoxEventModels, curvesSupplier.get(network, dsReporter), parameters, dynaWaltzParameters, reporter); - return computationManager.execute(execEnv, new DynaWaltzHandler(context, reporter)); + DynaWaltzContext context = new DynaWaltzContext(network, workingVariantId, blackBoxModels, blackBoxEventModels, curvesSupplier.get(network, dsReportNode), parameters, dynaWaltzParameters, reportNode); + return computationManager.execute(execEnv, new DynaWaltzHandler(context, reportNode)); } private final class DynaWaltzHandler extends AbstractExecutionHandler { private final DynaWaltzContext context; private final Network dynawoInput; - private final Reporter reporter; + private final ReportNode reportNode; private final List timeline = new ArrayList<>(); private final Map curves = new HashMap<>(); private DynamicSimulationResult.Status status = DynamicSimulationResult.Status.SUCCESS; private String statusText = ""; - public DynaWaltzHandler(DynaWaltzContext context, Reporter reporter) { + public DynaWaltzHandler(DynaWaltzContext context, ReportNode reportNode) { this.context = context; this.dynawoInput = context.getDynaWaltzParameters().isMergeLoads() ? LoadsMerger.mergeLoads(context.getNetwork()) : context.getNetwork(); - this.reporter = reporter; + this.reportNode = reportNode; } @Override @@ -225,8 +225,8 @@ public DynamicSimulationResult after(Path workingDir, ExecutionReport report) th private void setDynawoLog(Path outputsFolder) { Path logFile = outputsFolder.resolve(LOGS_FOLDER).resolve(LOGS_FILENAME); if (Files.exists(logFile)) { - Reporter logReporter = CommonReports.createDynawoLogReporter(reporter); - new CsvLogParser().parse(logFile).forEach(e -> CommonReports.reportLogEntry(logReporter, e)); + ReportNode logReportNode = CommonReports.createDynawoLogReportNode(reportNode); + new CsvLogParser().parse(logFile).forEach(e -> CommonReports.reportLogEntry(logReportNode, e)); } else { LOGGER.warn("Dynawo logs file not found"); } @@ -255,9 +255,9 @@ private void setDumpFile(Path outputsFolder, Path dumpFileFolder, Path fileName) private void setTimeline(Path outputsFolder) { Path timelineFile = outputsFolder.resolve(DYNAWO_TIMELINE_FOLDER).resolve(TIMELINE_FILENAME); if (Files.exists(timelineFile)) { - Reporter timelineReporter = DynawaltzReports.createDynaWaltzTimelineReporter(reporter); + ReportNode timelineReportNode = DynawaltzReports.createDynaWaltzTimelineReportNode(reportNode); new CsvTimeLineParser().parse(timelineFile).forEach(e -> { - CommonReports.reportTimelineEntry(timelineReporter, e); + CommonReports.reportTimelineEntry(timelineReportNode, e); timeline.add(new TimelineEvent(e.time(), e.modelName(), e.message())); }); } else { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynawaltzReports.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynawaltzReports.java index 927db67a4..186c3513c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynawaltzReports.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynawaltzReports.java @@ -7,9 +7,8 @@ */ package com.powsybl.dynawaltz; -import com.powsybl.commons.reporter.Report; -import com.powsybl.commons.reporter.Reporter; -import com.powsybl.commons.reporter.TypedValue; +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.report.TypedValue; /** * @author Laurent Issertial {@literal } @@ -19,62 +18,64 @@ public final class DynawaltzReports { private DynawaltzReports() { } - public static Reporter createDynaWaltzReporter(Reporter reporter, String networkId) { - return reporter.createSubReporter("dynawaltz", - "Dynawaltz dynamic simulation on network '${networkId}'", - "networkId", networkId); + public static ReportNode createDynaWaltzReportNode(ReportNode reportNode, String networkId) { + return reportNode.newReportNode() + .withMessageTemplate("dynawaltz", "Dynawaltz dynamic simulation on network '${networkId}'") + .withUntypedValue("networkId", networkId) + .add(); } - public static Reporter createDynaWaltzContextReporter(Reporter reporter) { - return reporter.createSubReporter("dynawaltzContext", - "Dynawaltz models processing"); + public static ReportNode createDynaWaltzContextReportNode(ReportNode reportNode) { + return reportNode.newReportNode() + .withMessageTemplate("dynawaltzContext", "Dynawaltz models processing") + .add(); } - public static Reporter createDynaWaltzTimelineReporter(Reporter reporter) { - return reporter.createSubReporter("dynawaltzTimeline", - "Dynawaltz Timeline"); + public static ReportNode createDynaWaltzTimelineReportNode(ReportNode reportNode) { + return reportNode.newReportNode() + .withMessageTemplate("dynawaltzTimeline", "Dynawaltz Timeline") + .add(); } - public static void reportDuplicateStaticId(Reporter reporter, String duplicateId, String modelName, String dynamicId) { - reporter.report(Report.builder() - .withKey("duplicateStaticId") - .withDefaultMessage("Duplicate static id found: ${duplicateId} -> model ${modelName} ${dynamicId} will be skipped") - .withValue("duplicateId", duplicateId) - .withValue("modelName", modelName) - .withValue("dynamicId", dynamicId) + public static void reportDuplicateStaticId(ReportNode reportNode, String duplicateId, String modelName, String dynamicId) { + reportNode.newReportNode() + .withMessageTemplate("duplicateStaticId", "Duplicate static id found: ${duplicateId} -> model ${modelName} ${dynamicId} will be skipped") + .withUntypedValue("duplicateId", duplicateId) + .withUntypedValue("modelName", modelName) + .withUntypedValue("dynamicId", dynamicId) .withSeverity(TypedValue.WARN_SEVERITY) - .build()); + .add(); } - public static void reportDuplicateDynamicId(Reporter reporter, String duplicateId, String modelName) { - reporter.report(Report.builder() - .withKey("duplicateDynamicId") - .withDefaultMessage("Duplicate dynamic id found: ${duplicateId} -> model ${modelName} will be skipped") - .withValue("duplicateId", duplicateId) - .withValue("modelName", modelName) + public static void reportDuplicateDynamicId(ReportNode reportNode, String duplicateId, String modelName) { + reportNode.newReportNode() + .withMessageTemplate("duplicateDynamicId", + "Duplicate dynamic id found: ${duplicateId} -> model ${modelName} will be skipped") + .withUntypedValue("duplicateId", duplicateId) + .withUntypedValue("modelName", modelName) .withSeverity(TypedValue.WARN_SEVERITY) - .build()); + .add(); } - public static void reportEmptyAutomaton(Reporter reporter, String automatonName, String dynamicId, String expectedModels) { - reporter.report(Report.builder() - .withKey("emptyAutomaton") - .withDefaultMessage("${automatonName} ${dynamicId} equipment is not a ${expectedModels}, the automation system will be skipped") - .withValue("automatonName", automatonName) - .withValue("dynamicId", dynamicId) - .withValue("expectedModels", expectedModels) + public static void reportEmptyAutomaton(ReportNode reportNode, String automatonName, String dynamicId, String expectedModels) { + reportNode.newReportNode() + .withMessageTemplate("emptyAutomaton", + "${automatonName} ${dynamicId} equipment is not a ${expectedModels}, the automation system will be skipped") + .withUntypedValue("automatonName", automatonName) + .withUntypedValue("dynamicId", dynamicId) + .withUntypedValue("expectedModels", expectedModels) .withSeverity(TypedValue.WARN_SEVERITY) - .build()); + .add(); } - public static void reportEmptyListAutomaton(Reporter reporter, String automatonName, String dynamicId, String expectedModels) { - reporter.report(Report.builder() - .withKey("emptyListAutomaton") - .withDefaultMessage("None of ${automatonName} ${dynamicId} equipments are ${expectedModels}, the automation system will be skipped") - .withValue("automatonName", automatonName) - .withValue("dynamicId", dynamicId) - .withValue("expectedModels", expectedModels) + public static void reportEmptyListAutomaton(ReportNode reportNode, String automatonName, String dynamicId, String expectedModels) { + reportNode.newReportNode() + .withMessageTemplate("emptyListAutomaton", + "None of ${automatonName} ${dynamicId} equipments are ${expectedModels}, the automation system will be skipped") + .withUntypedValue("automatonName", automatonName) + .withUntypedValue("dynamicId", dynamicId) + .withUntypedValue("expectedModels", expectedModels) .withSeverity(TypedValue.WARN_SEVERITY) - .build()); + .add(); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/ModelsSimplifier.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/ModelsSimplifier.java index b616f6e31..9e15b52df 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/ModelsSimplifier.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/ModelsSimplifier.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.models.BlackBoxModel; import com.powsybl.iidm.network.Network; @@ -18,5 +18,5 @@ */ public interface ModelsSimplifier { - Stream simplifyModels(Stream models, Network network, DynaWaltzParameters dynaWaltzParameters, Reporter reporter); + Stream simplifyModels(Stream models, Network network, DynaWaltzParameters dynaWaltzParameters, ReportNode reportNode); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractDynamicModelBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractDynamicModelBuilder.java index 35205f032..ff1a62574 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractDynamicModelBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractDynamicModelBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.builders; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.Network; import java.util.Objects; @@ -18,12 +18,12 @@ public abstract class AbstractDynamicModelBuilder { protected final Network network; - protected final Reporter reporter; + protected final ReportNode reportNode; protected boolean isInstantiable = true; - protected AbstractDynamicModelBuilder(Network network, Reporter reporter) { + protected AbstractDynamicModelBuilder(Network network, ReportNode reportNode) { this.network = Objects.requireNonNull(network); - this.reporter = Objects.requireNonNull(reporter); + this.reportNode = Objects.requireNonNull(reportNode); } protected abstract void checkData(); @@ -31,9 +31,9 @@ protected AbstractDynamicModelBuilder(Network network, Reporter reporter) { protected final boolean isInstantiable() { checkData(); if (isInstantiable) { - Reporters.reportModelInstantiation(reporter, getModelId()); + BuilderReports.reportModelInstantiation(reportNode, getModelId()); } else { - Reporters.reportModelInstantiationFailure(reporter, getModelId()); + BuilderReports.reportModelInstantiationFailure(reportNode, getModelId()); } return isInstantiable; } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractEquipmentModelBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractEquipmentModelBuilder.java index 437440ef2..54435c474 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractEquipmentModelBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/AbstractEquipmentModelBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.builders; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.Identifiable; import com.powsybl.iidm.network.IdentifiableType; import com.powsybl.iidm.network.Network; @@ -24,14 +24,14 @@ public abstract class AbstractEquipmentModelBuilder, R protected final ModelConfig modelConfig; protected final BuilderEquipment builderEquipment; - protected AbstractEquipmentModelBuilder(Network network, ModelConfig modelConfig, IdentifiableType equipmentType, Reporter reporter) { - super(network, reporter); + protected AbstractEquipmentModelBuilder(Network network, ModelConfig modelConfig, IdentifiableType equipmentType, ReportNode reportNode) { + super(network, reportNode); this.modelConfig = Objects.requireNonNull(modelConfig); this.builderEquipment = new BuilderEquipment<>(equipmentType); } - protected AbstractEquipmentModelBuilder(Network network, ModelConfig modelConfig, String equipmentType, Reporter reporter) { - super(network, reporter); + protected AbstractEquipmentModelBuilder(Network network, ModelConfig modelConfig, String equipmentType, ReportNode reportNode) { + super(network, reportNode); this.modelConfig = modelConfig; this.builderEquipment = new BuilderEquipment<>(equipmentType); } @@ -58,13 +58,13 @@ public R parameterSetId(String parameterSetId) { @Override protected void checkData() { - isInstantiable = builderEquipment.checkEquipmentData(reporter); + isInstantiable = builderEquipment.checkEquipmentData(reportNode); if (parameterSetId == null) { - Reporters.reportFieldNotSet(reporter, "parameterSetId"); + BuilderReports.reportFieldNotSet(reportNode, "parameterSetId"); isInstantiable = false; } if (dynamicModelId == null) { - Reporters.reportFieldReplacement(reporter, "dynamicModelId", "staticId", builderEquipment.hasStaticId() ? builderEquipment.getStaticId() : "(unknown staticId)"); + BuilderReports.reportFieldReplacement(reportNode, "dynamicModelId", "staticId", builderEquipment.hasStaticId() ? builderEquipment.getStaticId() : "(unknown staticId)"); dynamicModelId = builderEquipment.getStaticId(); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderConfig.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderConfig.java index 95106acbe..d5e3a3ef1 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderConfig.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderConfig.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.builders; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.DynamicModel; import com.powsybl.iidm.network.Network; @@ -21,7 +21,7 @@ public class BuilderConfig { @FunctionalInterface public interface ModelBuilderConstructor { - ModelBuilder createBuilder(Network network, String lib, Reporter reporter); + ModelBuilder createBuilder(Network network, String lib, ReportNode reportNode); } private final ModelBuilderConstructor builderConstructor; diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipment.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipment.java index 1030b2a2a..fa6e6452a 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipment.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipment.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.builders; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.Identifiable; import com.powsybl.iidm.network.IdentifiableType; @@ -64,15 +64,15 @@ public void addEquipment(T equipment, Predicate equipmentChecker) { } } - public boolean checkEquipmentData(Reporter reporter) { + public boolean checkEquipmentData(ReportNode reportNode) { if (!hasStaticId()) { - Reporters.reportFieldNotSet(reporter, fieldName); + BuilderReports.reportFieldNotSet(reportNode, fieldName); return false; } else if (equipment == null) { if (fromStaticId) { - Reporters.reportStaticIdUnknown(reporter, fieldName, staticId, equipmentType); + BuilderReports.reportStaticIdUnknown(reportNode, fieldName, staticId, equipmentType); } else { - Reporters.reportDifferentNetwork(reporter, EQUIPMENT_FIELD_NAME, staticId, equipmentType); + BuilderReports.reportDifferentNetwork(reportNode, EQUIPMENT_FIELD_NAME, staticId, equipmentType); } return false; } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipmentsList.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipmentsList.java index f69cbbe6d..53d3bb6eb 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipmentsList.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderEquipmentsList.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.builders; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.iidm.network.Identifiable; import com.powsybl.iidm.network.IdentifiableType; @@ -57,21 +57,21 @@ public void addEquipments(Iterable staticIds, Function equipm }); } - public boolean checkEquipmentData(Reporter reporter) { + public boolean checkEquipmentData(ReportNode reportNode) { boolean emptyList = equipments.isEmpty(); if (missingEquipmentIds.isEmpty() && emptyList) { - Reporters.reportFieldNotSet(reporter, fieldName); + BuilderReports.reportFieldNotSet(reportNode, fieldName); return false; } else if (!missingIdsHasDynamicIds) { missingEquipmentIds.forEach(missingId -> - Reporters.reportStaticIdUnknown(reporter, fieldName, missingId, equipmentType)); + BuilderReports.reportStaticIdUnknown(reportNode, fieldName, missingId, equipmentType)); if (emptyList) { - Reporters.reportEmptyList(reporter, fieldName); + BuilderReports.reportEmptyList(reportNode, fieldName); } return !emptyList; } else { missingEquipmentIds.forEach(missingId -> - Reporters.reportUnknownStaticIdHandling(reporter, fieldName, missingId, equipmentType)); + BuilderReports.reportUnknownStaticIdHandling(reportNode, fieldName, missingId, equipmentType)); return true; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderReports.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderReports.java new file mode 100644 index 000000000..19f6791c4 --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/BuilderReports.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.builders; + +import com.powsybl.commons.report.ReportNode; +import com.powsybl.commons.report.TypedValue; +import com.powsybl.iidm.network.IdentifiableType; + +/** + * @author Laurent Issertial {@literal } + */ +public final class BuilderReports { + + private static final String FIELD_NAME = "fieldName"; + + private BuilderReports() { + } + + public static void reportLibNotFound(ReportNode reportNode, String builderName, String lib) { + reportNode.newReportNode() + .withMessageTemplate("libNotFound", "Library ${lib} not found for ${builderName}") + .withUntypedValue("builderName", builderName) + .withUntypedValue("lib", lib) + .withSeverity(TypedValue.INFO_SEVERITY) + .add(); + } + + public static void reportModelInstantiation(ReportNode reportNode, String dynamicId) { + reportNode.newReportNode() + .withMessageTemplate("modelInstantiation", "Model ${dynamicId} instantiation successful") + .withUntypedValue("dynamicId", dynamicId) + .withSeverity(TypedValue.TRACE_SEVERITY) + .add(); + } + + public static void reportModelInstantiationFailure(ReportNode reportNode, String dynamicId) { + reportNode.newReportNode() + .withMessageTemplate("modelInstantiation", "Model ${dynamicId} cannot be instantiated") + .withUntypedValue("dynamicId", dynamicId) + .withSeverity(TypedValue.WARN_SEVERITY) + .add(); + } + + public static void reportFieldReplacement(ReportNode reportNode, String fieldName, String replacementName, String replacement) { + reportNode.newReportNode() + .withMessageTemplate("fieldReplacement", "'${fieldName}' field is not set, ${replacementName} ${replacement} will be used instead") + .withUntypedValue(FIELD_NAME, fieldName) + .withUntypedValue("replacementName", replacementName) + .withUntypedValue("replacement", replacement) + .withSeverity(TypedValue.TRACE_SEVERITY) + .add(); + } + + public static void reportFieldNotSet(ReportNode reportNode, String fieldName) { + reportNode.newReportNode() + .withMessageTemplate("fieldNotSet", "'${fieldName}' field is not set") + .withUntypedValue(FIELD_NAME, fieldName) + .withSeverity(TypedValue.WARN_SEVERITY) + .add(); + } + + public static void reportStaticIdUnknown(ReportNode reportNode, String fieldName, String staticId, String equipmentType) { + reportNode.newReportNode() + .withMessageTemplate("unknownStaticIdToDynamic", "'${fieldName}' field value '${staticId}' not found for equipment type(s) ${equipmentType}") + .withUntypedValue("equipmentType", equipmentType) + .withUntypedValue(FIELD_NAME, fieldName) + .withUntypedValue("staticId", staticId) + .withSeverity(TypedValue.WARN_SEVERITY) + .add(); + } + + public static void reportDifferentNetwork(ReportNode reportNode, String fieldName, String staticId, String equipmentType) { + reportNode.newReportNode() + .withMessageTemplate("wrongNetwork", "'${fieldName}' field value ${equipmentType} ${staticId} does not belong to the builder network") + .withUntypedValue("equipmentType", equipmentType) + .withUntypedValue(FIELD_NAME, fieldName) + .withUntypedValue("staticId", staticId) + .withSeverity(TypedValue.WARN_SEVERITY) + .add(); + } + + public static void reportUnknownStaticIdHandling(ReportNode reportNode, String fieldName, String staticId, String equipmentType) { + reportNode.newReportNode() + .withMessageTemplate("staticIdUnknown", "'${fieldName}' field value '${staticId}' not found for equipment type(s) ${equipmentType}, id will be used as pure dynamic model id") + .withUntypedValue("equipmentType", equipmentType) + .withUntypedValue(FIELD_NAME, fieldName).withUntypedValue("staticId", staticId) + .withSeverity(TypedValue.INFO_SEVERITY) + .add(); + } + + public static void reportCrossThreshold(ReportNode reportNode, String fieldName, double fieldValue, String threshold) { + reportNode.newReportNode() + .withMessageTemplate("crossThreshold", "${fieldName} should be ${threshold} (${fieldValue})") + .withUntypedValue(FIELD_NAME, fieldName) + .withUntypedValue("fieldValue", fieldValue) + .withUntypedValue("threshold", threshold) + .withSeverity(TypedValue.WARN_SEVERITY).add(); + } + + public static void reportEmptyList(ReportNode reportNode, String fieldName) { + reportNode.newReportNode() + .withMessageTemplate("emptyList", "'${fieldName}' list is empty") + .withUntypedValue(FIELD_NAME, fieldName) + .withSeverity(TypedValue.WARN_SEVERITY) + .add(); + } + + public static void reportFieldSetWithWrongEquipment(ReportNode reportNode, String fieldName, IdentifiableType equipmentType, String staticId) { + reportFieldSetWithWrongEquipment(reportNode, fieldName, equipmentType.toString() + " " + staticId); + } + + public static void reportFieldSetWithWrongEquipment(ReportNode reportNode, String fieldName, String equipment) { + reportNode.newReportNode() + .withMessageTemplate("fieldSetWithWrongEquipment", "'${fieldName}' field is set but ${equipment} does not possess this option") + .withUntypedValue(FIELD_NAME, fieldName).withUntypedValue("equipment", equipment).withSeverity(TypedValue.WARN_SEVERITY) + .add(); + } + +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/EventBuilderConfig.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/EventBuilderConfig.java index 56c78381d..9f095b4c9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/EventBuilderConfig.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/EventBuilderConfig.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.builders; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.EventModel; import com.powsybl.iidm.network.Network; @@ -18,7 +18,7 @@ public class EventBuilderConfig { @FunctionalInterface public interface EventModelBuilderConstructor { - ModelBuilder createBuilder(Network network, Reporter reporter); + ModelBuilder createBuilder(Network network, ReportNode reportNode); } private final EventModelBuilderConstructor builderConstructor; diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/Reporters.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/Reporters.java deleted file mode 100644 index 3e8ac3941..000000000 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/builders/Reporters.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright (c) 2023, RTE (http://www.rte-france.com/) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * SPDX-License-Identifier: MPL-2.0 - */ -package com.powsybl.dynawaltz.builders; - -import com.powsybl.commons.reporter.Report; -import com.powsybl.commons.reporter.Reporter; -import com.powsybl.commons.reporter.TypedValue; -import com.powsybl.iidm.network.IdentifiableType; - -/** - * @author Laurent Issertial {@literal } - */ -public final class Reporters { - - private static final String FIELD_NAME = "fieldName"; - - private Reporters() { - } - - public static void reportLibNotFound(Reporter reporter, String builderName, String lib) { - reporter.report(Report.builder() - .withKey("libNotFound") - .withDefaultMessage("Library ${lib} not found for ${builderName}") - .withValue("builderName", builderName) - .withValue("lib", lib) - .withSeverity(TypedValue.INFO_SEVERITY) - .build()); - } - - public static void reportModelInstantiation(Reporter reporter, String dynamicId) { - reporter.report(Report.builder() - .withKey("modelInstantiation") - .withDefaultMessage("Model ${dynamicId} instantiation successful") - .withValue("dynamicId", dynamicId) - .withSeverity(TypedValue.TRACE_SEVERITY) - .build()); - } - - public static void reportModelInstantiationFailure(Reporter reporter, String dynamicId) { - reporter.report(Report.builder() - .withKey("modelInstantiation") - .withDefaultMessage("Model ${dynamicId} cannot be instantiated") - .withValue("dynamicId", dynamicId) - .withSeverity(TypedValue.WARN_SEVERITY) - .build()); - } - - public static void reportFieldReplacement(Reporter reporter, String fieldName, String replacementName, String replacement) { - reporter.report(Report.builder() - .withKey("fieldReplacement") - .withDefaultMessage("'${fieldName}' field is not set, ${replacementName} ${replacement} will be used instead") - .withValue(FIELD_NAME, fieldName) - .withValue("replacementName", replacementName) - .withValue("replacement", replacement) - .withSeverity(TypedValue.TRACE_SEVERITY) - .build()); - } - - public static void reportFieldNotSet(Reporter reporter, String fieldName) { - reporter.report(Report.builder() - .withKey("fieldNotSet") - .withDefaultMessage("'${fieldName}' field is not set") - .withValue(FIELD_NAME, fieldName) - .withSeverity(TypedValue.WARN_SEVERITY) - .build()); - } - - public static void reportStaticIdUnknown(Reporter reporter, String fieldName, String staticId, String equipmentType) { - reporter.report(Report.builder() - .withKey("unknownStaticIdToDynamic") - .withDefaultMessage("'${fieldName}' field value '${staticId}' not found for equipment type(s) ${equipmentType}") - .withValue("equipmentType", equipmentType) - .withValue(FIELD_NAME, fieldName) - .withValue("staticId", staticId) - .withSeverity(TypedValue.WARN_SEVERITY) - .build()); - } - - public static void reportDifferentNetwork(Reporter reporter, String fieldName, String staticId, String equipmentType) { - reporter.report(Report.builder() - .withKey("wrongNetwork") - .withDefaultMessage("'${fieldName}' field value ${equipmentType} ${staticId} does not belong to the builder network") - .withValue("equipmentType", equipmentType) - .withValue(FIELD_NAME, fieldName) - .withValue("staticId", staticId) - .withSeverity(TypedValue.WARN_SEVERITY) - .build()); - } - - public static void reportUnknownStaticIdHandling(Reporter reporter, String fieldName, String staticId, String equipmentType) { - reporter.report(Report.builder() - .withKey("staticIdUnknown") - .withDefaultMessage("'${fieldName}' field value '${staticId}' not found for equipment type(s) ${equipmentType}, id will be used as pure dynamic model id") - .withValue("equipmentType", equipmentType) - .withValue(FIELD_NAME, fieldName).withValue("staticId", staticId) - .withSeverity(TypedValue.INFO_SEVERITY) - .build()); - } - - public static void reportCrossThreshold(Reporter reporter, String fieldName, double fieldValue, String threshold) { - reporter.report(Report.builder() - .withKey("crossThreshold") - .withDefaultMessage("${fieldName} should be ${threshold} (${fieldValue})") - .withValue(FIELD_NAME, fieldName) - .withValue("fieldValue", fieldValue) - .withValue("threshold", threshold) - .withSeverity(TypedValue.WARN_SEVERITY).build()); - } - - public static void reportEmptyList(Reporter reporter, String fieldName) { - reporter.report(Report.builder() - .withKey("emptyList") - .withDefaultMessage("'${fieldName}' list is empty") - .withValue(FIELD_NAME, fieldName) - .withSeverity(TypedValue.WARN_SEVERITY) - .build()); - } - - public static void reportFieldSetWithWrongEquipment(Reporter reporter, String fieldName, IdentifiableType equipmentType, String staticId) { - reportFieldSetWithWrongEquipment(reporter, fieldName, equipmentType.toString() + " " + staticId); - } - - public static void reportFieldSetWithWrongEquipment(Reporter reporter, String fieldName, String equipment) { - reporter.report(Report.builder() - .withKey("fieldSetWithWrongEquipment") - .withDefaultMessage("'${fieldName}' field is set but ${equipment} does not possess this option") - .withValue(FIELD_NAME, fieldName).withValue("equipment", equipment).withSeverity(TypedValue.WARN_SEVERITY) - .build()); - } - -} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/AbstractAutomationSystemModelBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/AbstractAutomationSystemModelBuilder.java index b33ae3736..53a691109 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/AbstractAutomationSystemModelBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/AbstractAutomationSystemModelBuilder.java @@ -7,12 +7,12 @@ */ package com.powsybl.dynawaltz.models.automationsystems; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.DynamicModel; import com.powsybl.dynawaltz.builders.AbstractDynamicModelBuilder; import com.powsybl.dynawaltz.builders.ModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Objects; @@ -26,8 +26,8 @@ public abstract class AbstractAutomationSystemModelBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected TapChangerAutomationSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected TapChangerAutomationSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); load = new BuilderEquipment<>(IdentifiableType.LOAD); } @@ -70,7 +70,7 @@ public TapChangerAutomationSystemBuilder side(TransformerSide side) { @Override protected void checkData() { super.checkData(); - isInstantiable &= load.checkEquipmentData(reporter); + isInstantiable &= load.checkEquipmentData(reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystem.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystem.java index f5f026ae0..e066d1043 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystem.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystem.java @@ -87,7 +87,7 @@ public void createMacroConnections(MacroConnectionsAdder adder) { } } else { isConnected = false; - DynawaltzReports.reportEmptyListAutomaton(adder.getReporter(), this.getName(), getDynamicModelId(), TapChangerModel.class.getSimpleName()); + DynawaltzReports.reportEmptyListAutomaton(adder.getReportNode(), this.getName(), getDynamicModelId(), TapChangerModel.class.getSimpleName()); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java index 85c698864..1147038a9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.automationsystems; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.*; import com.powsybl.iidm.network.*; @@ -30,32 +30,32 @@ public class TapChangerBlockingAutomationSystemBuilder extends AbstractAutomatio private final BuilderIdListEquipmentList> uMeasurementPoints; public static TapChangerBlockingAutomationSystemBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static TapChangerBlockingAutomationSystemBuilder of(Network network, Reporter reporter) { - return new TapChangerBlockingAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static TapChangerBlockingAutomationSystemBuilder of(Network network, ReportNode reportNode) { + return new TapChangerBlockingAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static TapChangerBlockingAutomationSystemBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static TapChangerBlockingAutomationSystemBuilder of(Network network, String lib, Reporter reporter) { + public static TapChangerBlockingAutomationSystemBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, TapChangerBlockingAutomationSystemBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, TapChangerBlockingAutomationSystemBuilder.class.getSimpleName(), lib); return null; } - return new TapChangerBlockingAutomationSystemBuilder(network, modelConfig, reporter); + return new TapChangerBlockingAutomationSystemBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected TapChangerBlockingAutomationSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected TapChangerBlockingAutomationSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); tapChangerEquipments = new BuilderEquipmentsList<>(TAP_CHANGER_TYPE, TRANSFORMER_FIELD, true); uMeasurementPoints = new BuilderIdListEquipmentList<>(MEASUREMENT_POINT_TYPE, U_MEASUREMENTS_FIELD); } @@ -93,8 +93,8 @@ public TapChangerBlockingAutomationSystemBuilder uMeasurements(Collection generator; public static UnderVoltageAutomationSystemBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static UnderVoltageAutomationSystemBuilder of(Network network, Reporter reporter) { - return new UnderVoltageAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static UnderVoltageAutomationSystemBuilder of(Network network, ReportNode reportNode) { + return new UnderVoltageAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static UnderVoltageAutomationSystemBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static UnderVoltageAutomationSystemBuilder of(Network network, String lib, Reporter reporter) { + public static UnderVoltageAutomationSystemBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, UnderVoltageAutomationSystemBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, UnderVoltageAutomationSystemBuilder.class.getSimpleName(), lib); return null; } - return new UnderVoltageAutomationSystemBuilder(network, MODEL_CONFIGS.getModelConfig(lib), reporter); + return new UnderVoltageAutomationSystemBuilder(network, MODEL_CONFIGS.getModelConfig(lib), reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected UnderVoltageAutomationSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected UnderVoltageAutomationSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); generator = new BuilderEquipment<>(IdentifiableType.GENERATOR, "generator"); } @@ -67,7 +67,7 @@ public UnderVoltageAutomationSystemBuilder generator(String staticId) { @Override protected void checkData() { super.checkData(); - isInstantiable &= generator.checkEquipmentData(reporter); + isInstantiable &= generator.checkEquipmentData(reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/AbstractOverloadManagementSystemBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/AbstractOverloadManagementSystemBuilder.java index 3df825d9c..3e58043fc 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/AbstractOverloadManagementSystemBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/AbstractOverloadManagementSystemBuilder.java @@ -7,10 +7,10 @@ */ package com.powsybl.dynawaltz.models.automationsystems.overloadmanagments; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; import com.powsybl.dynawaltz.builders.ModelConfig; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.dynawaltz.models.automationsystems.AbstractAutomationSystemModelBuilder; import com.powsybl.iidm.network.Branch; import com.powsybl.iidm.network.Network; @@ -27,8 +27,8 @@ public abstract class AbstractOverloadManagementSystemBuilder> controlledEquipment; - protected AbstractOverloadManagementSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter, BuilderEquipment> iMeasurement, BuilderEquipment> controlledEquipment) { - super(network, modelConfig, reporter); + protected AbstractOverloadManagementSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode, BuilderEquipment> iMeasurement, BuilderEquipment> controlledEquipment) { + super(network, modelConfig, reportNode); this.iMeasurement = iMeasurement; this.controlledEquipment = controlledEquipment; } @@ -41,10 +41,10 @@ public T controlledBranch(String staticId) { @Override protected void checkData() { super.checkData(); - isInstantiable &= controlledEquipment.checkEquipmentData(reporter); - isInstantiable &= iMeasurement.checkEquipmentData(reporter); + isInstantiable &= controlledEquipment.checkEquipmentData(reportNode); + isInstantiable &= iMeasurement.checkEquipmentData(reportNode); if (iMeasurementSide == null) { - Reporters.reportFieldNotSet(reporter, "iMeasurementSide"); + BuilderReports.reportFieldNotSet(reportNode, "iMeasurementSide"); isInstantiable = false; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java index 28e7f6d09..ea0bdd6ee 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java @@ -7,12 +7,12 @@ */ package com.powsybl.dynawaltz.models.automationsystems.overloadmanagments; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.TwoSides; @@ -27,32 +27,32 @@ public class DynamicOverloadManagementSystemBuilder extends AbstractOverloadMana private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static DynamicOverloadManagementSystemBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static DynamicOverloadManagementSystemBuilder of(Network network, Reporter reporter) { - return new DynamicOverloadManagementSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static DynamicOverloadManagementSystemBuilder of(Network network, ReportNode reportNode) { + return new DynamicOverloadManagementSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static DynamicOverloadManagementSystemBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static DynamicOverloadManagementSystemBuilder of(Network network, String lib, Reporter reporter) { + public static DynamicOverloadManagementSystemBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, DynamicOverloadManagementSystemBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, DynamicOverloadManagementSystemBuilder.class.getSimpleName(), lib); return null; } - return new DynamicOverloadManagementSystemBuilder(network, modelConfig, reporter); + return new DynamicOverloadManagementSystemBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected DynamicOverloadManagementSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter, new BuilderEquipment<>(BRANCH_TYPE, "iMeasurement"), + protected DynamicOverloadManagementSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode, new BuilderEquipment<>(BRANCH_TYPE, "iMeasurement"), new BuilderEquipment<>(BRANCH_TYPE, "controlledBranch")); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java index 47c384fac..f3650abe4 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java @@ -7,12 +7,12 @@ */ package com.powsybl.dynawaltz.models.automationsystems.overloadmanagments; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Branch; import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.TwoSides; @@ -31,32 +31,32 @@ public class DynamicTwoLevelsOverloadManagementSystemBuilder extends AbstractOve protected TwoSides iMeasurement2Side; public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network, Reporter reporter) { - return new DynamicTwoLevelsOverloadManagementSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network, ReportNode reportNode) { + return new DynamicTwoLevelsOverloadManagementSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network, String lib, Reporter reporter) { + public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, DynamicTwoLevelsOverloadManagementSystemBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, DynamicTwoLevelsOverloadManagementSystemBuilder.class.getSimpleName(), lib); return null; } - return new DynamicTwoLevelsOverloadManagementSystemBuilder(network, modelConfig, reporter); + return new DynamicTwoLevelsOverloadManagementSystemBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected DynamicTwoLevelsOverloadManagementSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter, new BuilderEquipment<>(BRANCH_TYPE, "iMeasurement1"), + protected DynamicTwoLevelsOverloadManagementSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode, new BuilderEquipment<>(BRANCH_TYPE, "iMeasurement1"), new BuilderEquipment<>(BRANCH_TYPE, "controlledBranch1")); iMeasurement2 = new BuilderEquipment<>(BRANCH_TYPE, "iMeasurement2"); } @@ -84,9 +84,9 @@ public DynamicTwoLevelsOverloadManagementSystemBuilder iMeasurement2Side(TwoSide @Override protected void checkData() { super.checkData(); - isInstantiable &= iMeasurement2.checkEquipmentData(reporter); + isInstantiable &= iMeasurement2.checkEquipmentData(reportNode); if (iMeasurement2Side == null) { - Reporters.reportFieldNotSet(reporter, "iMeasurement2Side"); + BuilderReports.reportFieldNotSet(reportNode, "iMeasurement2Side"); isInstantiable = false; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/AbstractPhaseShifterModelBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/AbstractPhaseShifterModelBuilder.java index 47f20e7a7..f2a8ade9d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/AbstractPhaseShifterModelBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/AbstractPhaseShifterModelBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.automationsystems.phaseshifters; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.models.automationsystems.AbstractAutomationSystemModelBuilder; @@ -22,8 +22,8 @@ abstract class AbstractPhaseShifterModelBuilder transformer; - protected AbstractPhaseShifterModelBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected AbstractPhaseShifterModelBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); transformer = new BuilderEquipment<>(IdentifiableType.TWO_WINDINGS_TRANSFORMER, "transformer"); } @@ -35,6 +35,6 @@ public T transformer(String staticId) { @Override protected void checkData() { super.checkData(); - isInstantiable &= transformer.checkEquipmentData(reporter); + isInstantiable &= transformer.checkEquipmentData(reportNode); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java index 0d9dcaa22..c8e0cb55d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.automationsystems.phaseshifters; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class PhaseShifterIAutomationSystemBuilder extends AbstractPhaseShifterMo private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static PhaseShifterIAutomationSystemBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static PhaseShifterIAutomationSystemBuilder of(Network network, Reporter reporter) { - return new PhaseShifterIAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static PhaseShifterIAutomationSystemBuilder of(Network network, ReportNode reportNode) { + return new PhaseShifterIAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static PhaseShifterIAutomationSystemBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static PhaseShifterIAutomationSystemBuilder of(Network network, String lib, Reporter reporter) { + public static PhaseShifterIAutomationSystemBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, PhaseShifterIAutomationSystemBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, PhaseShifterIAutomationSystemBuilder.class.getSimpleName(), lib); return null; } - return new PhaseShifterIAutomationSystemBuilder(network, modelConfig, reporter); + return new PhaseShifterIAutomationSystemBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected PhaseShifterIAutomationSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected PhaseShifterIAutomationSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java index 08661ef81..341b80859 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.automationsystems.phaseshifters; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class PhaseShifterPAutomationSystemBuilder extends AbstractPhaseShifterMo private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static PhaseShifterPAutomationSystemBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static PhaseShifterPAutomationSystemBuilder of(Network network, Reporter reporter) { - return new PhaseShifterPAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static PhaseShifterPAutomationSystemBuilder of(Network network, ReportNode reportNode) { + return new PhaseShifterPAutomationSystemBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static PhaseShifterPAutomationSystemBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static PhaseShifterPAutomationSystemBuilder of(Network network, String lib, Reporter reporter) { + public static PhaseShifterPAutomationSystemBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, PhaseShifterPAutomationSystemBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, PhaseShifterPAutomationSystemBuilder.class.getSimpleName(), lib); return null; } - return new PhaseShifterPAutomationSystemBuilder(network, modelConfig, reporter); + return new PhaseShifterPAutomationSystemBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected PhaseShifterPAutomationSystemBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected PhaseShifterPAutomationSystemBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBusBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBusBuilder.java index 83b8f5651..6f6880fba 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBusBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBusBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.buses; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.AbstractEquipmentModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.iidm.network.Bus; @@ -19,8 +19,8 @@ */ public abstract class AbstractBusBuilder> extends AbstractEquipmentModelBuilder { - protected AbstractBusBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.BUS, reporter); + protected AbstractBusBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.BUS, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/InfiniteBusBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/InfiniteBusBuilder.java index f55f0eb60..bf050fb8e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/InfiniteBusBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/InfiniteBusBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.buses; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class InfiniteBusBuilder extends AbstractBusBuilder { private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static InfiniteBusBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static InfiniteBusBuilder of(Network network, Reporter reporter) { - return new InfiniteBusBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static InfiniteBusBuilder of(Network network, ReportNode reportNode) { + return new InfiniteBusBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static InfiniteBusBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static InfiniteBusBuilder of(Network network, String lib, Reporter reporter) { + public static InfiniteBusBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, InfiniteBusBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, InfiniteBusBuilder.class.getSimpleName(), lib); return null; } - return new InfiniteBusBuilder(network, modelConfig, reporter); + return new InfiniteBusBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected InfiniteBusBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected InfiniteBusBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StandardBusBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StandardBusBuilder.java index 953b5205b..271c4d7b0 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StandardBusBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StandardBusBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.buses; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class StandardBusBuilder extends AbstractBusBuilder { private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static StandardBusBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static StandardBusBuilder of(Network network, Reporter reporter) { - return new StandardBusBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static StandardBusBuilder of(Network network, ReportNode reportNode) { + return new StandardBusBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static StandardBusBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static StandardBusBuilder of(Network network, String lib, Reporter reporter) { + public static StandardBusBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, StandardBusBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, StandardBusBuilder.class.getSimpleName(), lib); return null; } - return new StandardBusBuilder(network, modelConfig, reporter); + return new StandardBusBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected StandardBusBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected StandardBusBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/AbstractEventModelBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/AbstractEventModelBuilder.java index 246016683..e9a528bc2 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/AbstractEventModelBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/AbstractEventModelBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.events; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.EventModel; import com.powsybl.dynawaltz.builders.*; import com.powsybl.iidm.network.Identifiable; @@ -23,8 +23,8 @@ abstract class AbstractEventModelBuilder, R extends Ab protected String staticId; protected Double startTime; - protected AbstractEventModelBuilder(Network network, BuilderEquipment builderEquipment, Reporter reporter) { - super(network, reporter); + protected AbstractEventModelBuilder(Network network, BuilderEquipment builderEquipment, ReportNode reportNode) { + super(network, reportNode); this.builderEquipment = builderEquipment; this.eventId = generateDefaultEventId(); } @@ -42,9 +42,9 @@ public R startTime(double startTime) { @Override protected void checkData() { - isInstantiable &= builderEquipment.checkEquipmentData(reporter); + isInstantiable &= builderEquipment.checkEquipmentData(reportNode); if (startTime == null) { - Reporters.reportFieldNotSet(reporter, "startTime"); + BuilderReports.reportFieldNotSet(reportNode, "startTime"); isInstantiable = false; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventActivePowerVariationBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventActivePowerVariationBuilder.java index d52e041be..026c175d7 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventActivePowerVariationBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventActivePowerVariationBuilder.java @@ -7,9 +7,9 @@ */ package com.powsybl.dynawaltz.models.events; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Injection; import com.powsybl.iidm.network.Network; @@ -23,15 +23,15 @@ public class EventActivePowerVariationBuilder extends AbstractEventModelBuilder< protected Double deltaP; public static EventActivePowerVariationBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static EventActivePowerVariationBuilder of(Network network, Reporter reporter) { - return new EventActivePowerVariationBuilder(network, reporter); + public static EventActivePowerVariationBuilder of(Network network, ReportNode reportNode) { + return new EventActivePowerVariationBuilder(network, reportNode); } - EventActivePowerVariationBuilder(Network network, Reporter reporter) { - super(network, new BuilderEquipment<>("GENERATOR/LOAD"), reporter); + EventActivePowerVariationBuilder(Network network, ReportNode reportNode) { + super(network, new BuilderEquipment<>("GENERATOR/LOAD"), reportNode); } public EventActivePowerVariationBuilder deltaP(double deltaP) { @@ -43,7 +43,7 @@ public EventActivePowerVariationBuilder deltaP(double deltaP) { protected void checkData() { super.checkData(); if (deltaP == null) { - Reporters.reportFieldNotSet(reporter, "deltaP"); + BuilderReports.reportFieldNotSet(reportNode, "deltaP"); isInstantiable = false; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventDisconnectionBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventDisconnectionBuilder.java index df12f43ca..b54f65c5e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventDisconnectionBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/EventDisconnectionBuilder.java @@ -7,9 +7,9 @@ */ package com.powsybl.dynawaltz.models.events; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.*; import java.util.EnumSet; @@ -34,15 +34,15 @@ private enum DisconnectionType { protected TwoSides disconnectSide = null; public static EventDisconnectionBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static EventDisconnectionBuilder of(Network network, Reporter reporter) { - return new EventDisconnectionBuilder(network, reporter); + public static EventDisconnectionBuilder of(Network network, ReportNode reportNode) { + return new EventDisconnectionBuilder(network, reportNode); } - EventDisconnectionBuilder(Network network, Reporter reporter) { - super(network, new BuilderEquipment<>("Disconnectable equipment"), reporter); + EventDisconnectionBuilder(Network network, ReportNode reportNode) { + super(network, new BuilderEquipment<>("Disconnectable equipment"), reportNode); } public EventDisconnectionBuilder disconnectOnly(TwoSides side) { @@ -76,11 +76,11 @@ protected void checkData() { if (builderEquipment.hasEquipment()) { setDisconnectionType(builderEquipment.getEquipment().getType()); if (disconnectionType == DisconnectionType.NONE) { - Reporters.reportStaticIdUnknown(reporter, "staticId", builderEquipment.getStaticId(), "Disconnectable equipment"); + BuilderReports.reportStaticIdUnknown(reportNode, "staticId", builderEquipment.getStaticId(), "Disconnectable equipment"); isInstantiable = false; } if (DisconnectionType.INJECTION == disconnectionType && disconnectSide != null) { - Reporters.reportFieldSetWithWrongEquipment(reporter, "disconnectOnly", builderEquipment.getEquipment().getType(), builderEquipment.getStaticId()); + BuilderReports.reportFieldSetWithWrongEquipment(reportNode, "disconnectOnly", builderEquipment.getEquipment().getType(), builderEquipment.getStaticId()); isInstantiable = false; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEventBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEventBuilder.java index 3ca8611e0..5bc39f4b9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEventBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEventBuilder.java @@ -7,9 +7,9 @@ */ package com.powsybl.dynawaltz.models.events; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.BuilderEquipment; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Bus; import com.powsybl.iidm.network.IdentifiableType; import com.powsybl.iidm.network.Network; @@ -26,15 +26,15 @@ public class NodeFaultEventBuilder extends AbstractEventModelBuilder(IdentifiableType.BUS), reporter); + NodeFaultEventBuilder(Network network, ReportNode reportNode) { + super(network, new BuilderEquipment<>(IdentifiableType.BUS), reportNode); } public NodeFaultEventBuilder faultTime(double faultTime) { @@ -65,15 +65,15 @@ protected String getTag() { protected void checkData() { super.checkData(); if (faultTime <= 0) { - Reporters.reportCrossThreshold(reporter, "faultTime", faultTime, "strictly positive"); + BuilderReports.reportCrossThreshold(reportNode, "faultTime", faultTime, "strictly positive"); isInstantiable = false; } if (rPu < 0) { - Reporters.reportCrossThreshold(reporter, "rPu", rPu, "positive"); + BuilderReports.reportCrossThreshold(reportNode, "rPu", rPu, "positive"); isInstantiable = false; } if (xPu < 0) { - Reporters.reportCrossThreshold(reporter, "xPu", xPu, "positive"); + BuilderReports.reportCrossThreshold(reportNode, "xPu", xPu, "positive"); isInstantiable = false; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorBuilder.java index f4c69a856..404386ff5 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.generators; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.AbstractEquipmentModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.iidm.network.Generator; @@ -19,8 +19,8 @@ */ public abstract class AbstractGeneratorBuilder> extends AbstractEquipmentModelBuilder { - protected AbstractGeneratorBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.GENERATOR, reporter); + protected AbstractGeneratorBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.GENERATOR, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GeneratorFictitiousBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GeneratorFictitiousBuilder.java index 94e03fe57..9023abdac 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GeneratorFictitiousBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GeneratorFictitiousBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.generators; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class GeneratorFictitiousBuilder extends AbstractGeneratorBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected GeneratorFictitiousBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected GeneratorFictitiousBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverterBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverterBuilder.java index a36ee055e..eb6f27ea5 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverterBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverterBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.generators; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class GridFormingConverterBuilder extends AbstractGeneratorBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected GridFormingConverterBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected GridFormingConverterBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGeneratorBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGeneratorBuilder.java index 182dad610..91284f660 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGeneratorBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGeneratorBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.generators; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class SynchronizedGeneratorBuilder extends AbstractGeneratorBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected SynchronizedGeneratorBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected SynchronizedGeneratorBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronousGeneratorBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronousGeneratorBuilder.java index 0bb9d122b..0918c9a1e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronousGeneratorBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronousGeneratorBuilder.java @@ -8,11 +8,11 @@ package com.powsybl.dynawaltz.models.generators; import com.powsybl.commons.PowsyblException; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -26,32 +26,32 @@ public class SynchronousGeneratorBuilder extends AbstractGeneratorBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected SynchronousGeneratorBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected SynchronousGeneratorBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } protected EnumGeneratorComponent getGeneratorComponent() { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccBuilder.java index 58ef65203..884582a43 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.generators; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class WeccBuilder extends AbstractGeneratorBuilder { private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static WeccBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static WeccBuilder of(Network network, Reporter reporter) { - return new WeccBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static WeccBuilder of(Network network, ReportNode reportNode) { + return new WeccBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static WeccBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static WeccBuilder of(Network network, String lib, Reporter reporter) { + public static WeccBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, WeccBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, WeccBuilder.class.getSimpleName(), lib); return null; } - return new WeccBuilder(network, modelConfig, reporter); + return new WeccBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected WeccBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected WeccBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdcBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdcBuilder.java index 121819f84..cc5516997 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdcBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdcBuilder.java @@ -7,10 +7,10 @@ */ package com.powsybl.dynawaltz.models.hvdc; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.AbstractEquipmentModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.*; /** @@ -20,12 +20,12 @@ public abstract class AbstractHvdcBuilder { private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static HvdcPBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static HvdcPBuilder of(Network network, Reporter reporter) { - return new HvdcPBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static HvdcPBuilder of(Network network, ReportNode reportNode) { + return new HvdcPBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static HvdcPBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static HvdcPBuilder of(Network network, String lib, Reporter reporter) { + public static HvdcPBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, HvdcPBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, HvdcPBuilder.class.getSimpleName(), lib); return null; } - return new HvdcPBuilder(network, modelConfig, reporter); + return new HvdcPBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected HvdcPBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.HVDC_LINE, reporter); + protected HvdcPBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.HVDC_LINE, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscBuilder.java index ee8fdad6e..33d34382e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.hvdc; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.HvdcConverterStation; import com.powsybl.iidm.network.HvdcLine; import com.powsybl.iidm.network.IdentifiableType; @@ -28,32 +28,32 @@ public class HvdcVscBuilder extends AbstractHvdcBuilder { private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static HvdcVscBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static HvdcVscBuilder of(Network network, Reporter reporter) { - return new HvdcVscBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static HvdcVscBuilder of(Network network, ReportNode reportNode) { + return new HvdcVscBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static HvdcVscBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static HvdcVscBuilder of(Network network, String lib, Reporter reporter) { + public static HvdcVscBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, HvdcVscBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, HvdcVscBuilder.class.getSimpleName(), lib); return null; } - return new HvdcVscBuilder(network, modelConfig, reporter); + return new HvdcVscBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected HvdcVscBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, "VSC " + IdentifiableType.HVDC_LINE, reporter); + protected HvdcVscBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, "VSC " + IdentifiableType.HVDC_LINE, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/LineBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/LineBuilder.java index 652fa3248..3247d3ec8 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/LineBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/LineBuilder.java @@ -7,12 +7,12 @@ */ package com.powsybl.dynawaltz.models.lines; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.AbstractEquipmentModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.IdentifiableType; import com.powsybl.iidm.network.Line; import com.powsybl.iidm.network.Network; @@ -28,32 +28,32 @@ public class LineBuilder extends AbstractEquipmentModelBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected LineBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.LINE, reporter); + protected LineBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.LINE, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoadModelBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoadModelBuilder.java index 30d11a3c6..057442dd9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoadModelBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoadModelBuilder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.loads; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.AbstractEquipmentModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.iidm.network.IdentifiableType; @@ -19,8 +19,8 @@ */ public abstract class AbstractLoadModelBuilder> extends AbstractEquipmentModelBuilder { - protected AbstractLoadModelBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.LOAD, reporter); + protected AbstractLoadModelBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.LOAD, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoadBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoadBuilder.java index 0556d6a66..9dc771202 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoadBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoadBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.loads; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class BaseLoadBuilder extends AbstractLoadModelBuilder { private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static BaseLoadBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static BaseLoadBuilder of(Network network, Reporter reporter) { - return new BaseLoadBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static BaseLoadBuilder of(Network network, ReportNode reportNode) { + return new BaseLoadBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static BaseLoadBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static BaseLoadBuilder of(Network network, String lib, Reporter reporter) { + public static BaseLoadBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, BaseLoadBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, BaseLoadBuilder.class.getSimpleName(), lib); return null; } - return new BaseLoadBuilder(network, modelConfig, reporter); + return new BaseLoadBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected BaseLoadBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected BaseLoadBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerBuilder.java index 5f301e8e3..582d3b6d0 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.loads; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class LoadOneTransformerBuilder extends AbstractLoadModelBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected LoadOneTransformerBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected LoadOneTransformerBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChangerBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChangerBuilder.java index 11145f24a..e89afd04d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChangerBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChangerBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.loads; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class LoadOneTransformerTapChangerBuilder extends AbstractLoadModelBuilde private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static LoadOneTransformerTapChangerBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static LoadOneTransformerTapChangerBuilder of(Network network, Reporter reporter) { - return new LoadOneTransformerTapChangerBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static LoadOneTransformerTapChangerBuilder of(Network network, ReportNode reportNode) { + return new LoadOneTransformerTapChangerBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static LoadOneTransformerTapChangerBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static LoadOneTransformerTapChangerBuilder of(Network network, String lib, Reporter reporter) { + public static LoadOneTransformerTapChangerBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, LoadOneTransformerTapChangerBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, LoadOneTransformerTapChangerBuilder.class.getSimpleName(), lib); return null; } - return new LoadOneTransformerTapChangerBuilder(network, modelConfig, reporter); + return new LoadOneTransformerTapChangerBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected LoadOneTransformerTapChangerBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected LoadOneTransformerTapChangerBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersBuilder.java index d9a4faea1..fcfa723f6 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.loads; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class LoadTwoTransformersBuilder extends AbstractLoadModelBuilder getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected LoadTwoTransformersBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected LoadTwoTransformersBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangersBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangersBuilder.java index 76c2e2b89..352591fdf 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangersBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangersBuilder.java @@ -7,11 +7,11 @@ */ package com.powsybl.dynawaltz.models.loads; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.Network; import java.util.Set; @@ -25,32 +25,32 @@ public class LoadTwoTransformersTapChangersBuilder extends AbstractLoadModelBuil private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static LoadTwoTransformersTapChangersBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static LoadTwoTransformersTapChangersBuilder of(Network network, Reporter reporter) { - return new LoadTwoTransformersTapChangersBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static LoadTwoTransformersTapChangersBuilder of(Network network, ReportNode reportNode) { + return new LoadTwoTransformersTapChangersBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static LoadTwoTransformersTapChangersBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static LoadTwoTransformersTapChangersBuilder of(Network network, String lib, Reporter reporter) { + public static LoadTwoTransformersTapChangersBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, LoadTwoTransformersTapChangersBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, LoadTwoTransformersTapChangersBuilder.class.getSimpleName(), lib); return null; } - return new LoadTwoTransformersTapChangersBuilder(network, modelConfig, reporter); + return new LoadTwoTransformersTapChangersBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected LoadTwoTransformersTapChangersBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, reporter); + protected LoadTwoTransformersTapChangersBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MacroConnectionsAdder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MacroConnectionsAdder.java index 55c41e3f5..3d34b18bb 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MacroConnectionsAdder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/macroconnections/MacroConnectionsAdder.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models.macroconnections; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.models.BlackBoxModel; import com.powsybl.dynawaltz.models.Model; import com.powsybl.dynawaltz.models.VarConnection; @@ -40,19 +40,19 @@ public interface PureDynamicModelGetter { T getPureDynamicModel(String dynamicId, Class connectableClass, boolean throwException); } - private final Reporter reporter; + private final ReportNode reportNode; private final DynamicModelGetter dynamicModelGetter; private final PureDynamicModelGetter pureDynamicModelGetter; private Consumer macroConnectAdder; private BiConsumer> macroConnectorAdder; public MacroConnectionsAdder(DynamicModelGetter dynamicModelGetter, PureDynamicModelGetter pureDynamicModelGetter, Consumer macroConnectAdder, - BiConsumer> macroConnectorAdder, Reporter reporter) { + BiConsumer> macroConnectorAdder, ReportNode reportNode) { this.dynamicModelGetter = dynamicModelGetter; this.pureDynamicModelGetter = pureDynamicModelGetter; this.macroConnectAdder = macroConnectAdder; this.macroConnectorAdder = macroConnectorAdder; - this.reporter = reporter; + this.reportNode = reportNode; } /** @@ -226,7 +226,7 @@ public void setMacroConnectorAdder(BiConsumer getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected BaseStaticVarCompensatorBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.STATIC_VAR_COMPENSATOR, reporter); + protected BaseStaticVarCompensatorBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.STATIC_VAR_COMPENSATOR, reportNode); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatioBuilder.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatioBuilder.java index 09e7ba595..3f08e0fd4 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatioBuilder.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatioBuilder.java @@ -7,12 +7,12 @@ */ package com.powsybl.dynawaltz.models.transformers; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynawaltz.builders.AbstractEquipmentModelBuilder; import com.powsybl.dynawaltz.builders.ModelConfig; import com.powsybl.dynawaltz.builders.ModelConfigsHandler; import com.powsybl.dynawaltz.builders.ModelConfigs; -import com.powsybl.dynawaltz.builders.Reporters; +import com.powsybl.dynawaltz.builders.BuilderReports; import com.powsybl.iidm.network.IdentifiableType; import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.TwoWindingsTransformer; @@ -28,32 +28,32 @@ public class TransformerFixedRatioBuilder extends AbstractEquipmentModelBuilder< private static final ModelConfigs MODEL_CONFIGS = ModelConfigsHandler.getInstance().getModelConfigs(CATEGORY); public static TransformerFixedRatioBuilder of(Network network) { - return of(network, Reporter.NO_OP); + return of(network, ReportNode.NO_OP); } - public static TransformerFixedRatioBuilder of(Network network, Reporter reporter) { - return new TransformerFixedRatioBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reporter); + public static TransformerFixedRatioBuilder of(Network network, ReportNode reportNode) { + return new TransformerFixedRatioBuilder(network, MODEL_CONFIGS.getDefaultModelConfig(), reportNode); } public static TransformerFixedRatioBuilder of(Network network, String lib) { - return of(network, lib, Reporter.NO_OP); + return of(network, lib, ReportNode.NO_OP); } - public static TransformerFixedRatioBuilder of(Network network, String lib, Reporter reporter) { + public static TransformerFixedRatioBuilder of(Network network, String lib, ReportNode reportNode) { ModelConfig modelConfig = MODEL_CONFIGS.getModelConfig(lib); if (modelConfig == null) { - Reporters.reportLibNotFound(reporter, TransformerFixedRatioBuilder.class.getSimpleName(), lib); + BuilderReports.reportLibNotFound(reportNode, TransformerFixedRatioBuilder.class.getSimpleName(), lib); return null; } - return new TransformerFixedRatioBuilder(network, modelConfig, reporter); + return new TransformerFixedRatioBuilder(network, modelConfig, reportNode); } public static Set getSupportedLibs() { return MODEL_CONFIGS.getSupportedLibs(); } - protected TransformerFixedRatioBuilder(Network network, ModelConfig modelConfig, Reporter reporter) { - super(network, modelConfig, IdentifiableType.TWO_WINDINGS_TRANSFORMER, reporter); + protected TransformerFixedRatioBuilder(Network network, ModelConfig modelConfig, ReportNode reportNode) { + super(network, modelConfig, IdentifiableType.TWO_WINDINGS_TRANSFORMER, reportNode); } @Override diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/DynaWaltzProviderTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/DynaWaltzProviderTest.java index a2d7fd841..7f2a4ba5d 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/DynaWaltzProviderTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/DynaWaltzProviderTest.java @@ -7,7 +7,7 @@ package com.powsybl.dynawaltz; import com.powsybl.commons.PowsyblException; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.commons.test.AbstractSerDeTest; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalCommandExecutor; @@ -32,7 +32,7 @@ import java.util.Map; import java.util.concurrent.ForkJoinPool; -import static com.powsybl.commons.reporter.Reporter.NO_OP; +import static com.powsybl.commons.report.ReportNode.NO_OP; import static org.junit.jupiter.api.Assertions.*; /** @@ -52,7 +52,7 @@ public void setUp() throws IOException { public static class CurvesSupplierMock implements CurvesSupplier { @Override - public List get(Network network, Reporter reporter) { + public List get(Network network, ReportNode reportNode) { return Collections.singletonList(new DynaWaltzCurve("bus", "uPu")); } } diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/ModelsSimplifierTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/ModelsSimplifierTest.java index e52cb78cd..3155fa2eb 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/ModelsSimplifierTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/ModelsSimplifierTest.java @@ -9,7 +9,7 @@ import com.google.auto.service.AutoService; import com.google.common.collect.Lists; -import com.powsybl.commons.reporter.Reporter; +import com.powsybl.commons.report.ReportNode; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawaltz.models.generators.AbstractGenerator; import com.powsybl.dynawaltz.models.generators.GeneratorFictitiousBuilder; @@ -68,7 +68,7 @@ void simplifyModels() { @AutoService(ModelsSimplifier.class) public static class ModelsSimplifierFilter implements ModelsSimplifier { @Override - public Stream simplifyModels(Stream models, Network network, DynaWaltzParameters dynaWaltzParameters, Reporter reporter) { + public Stream simplifyModels(Stream models, Network network, DynaWaltzParameters dynaWaltzParameters, ReportNode reportNode) { return models.filter(m -> !m.getDynamicModelId().equalsIgnoreCase("BBM_LOAD")); } } @@ -76,7 +76,7 @@ public Stream simplifyModels(Stream models, Networ @AutoService(ModelsSimplifier.class) public static class ModelsSimplifierSubstitution implements ModelsSimplifier { @Override - public Stream simplifyModels(Stream models, Network network, DynaWaltzParameters dynaWaltzParameters, Reporter reporter) { + public Stream simplifyModels(Stream models, Network network, DynaWaltzParameters dynaWaltzParameters, ReportNode reportNode) { return models.map(m -> { if ("BBM_GEN".equalsIgnoreCase(m.getDynamicModelId()) && m instanceof AbstractGenerator gen) { return GeneratorFictitiousBuilder.of(network) diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/models/BuilderEquipmentSetterTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/models/BuilderEquipmentSetterTest.java index 7c0045607..95e61ee9f 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/models/BuilderEquipmentSetterTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/models/BuilderEquipmentSetterTest.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.models; -import com.powsybl.commons.reporter.ReporterModel; +import com.powsybl.commons.report.ReportNode; import com.powsybl.commons.test.TestUtil; import com.powsybl.dynawaltz.models.lines.LineBuilder; import com.powsybl.iidm.network.Line; @@ -16,6 +16,7 @@ import com.powsybl.iidm.network.test.SvcTestCaseFactory; import org.junit.jupiter.api.Test; +import java.io.IOException; import java.io.StringWriter; import static org.junit.jupiter.api.Assertions.*; @@ -26,20 +27,20 @@ class BuilderEquipmentSetterTest { @Test - void addEquipmentFromAnotherNetwork() { + void addEquipmentFromAnotherNetwork() throws IOException { Network network = SvcTestCaseFactory.create(); Line ln1 = network.getLine("L1"); Network network2 = PhaseShifterTestCaseFactory.create(); Line ln2 = network2.getLine("L1"); - ReporterModel reporter = new ReporterModel("builderTests", "Builder tests"); + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("builderTests", "Builder tests").build(); BlackBoxModel bbm1 = LineBuilder.of(network) .dynamicModelId("BBM_LINE_NETWORK_1") .equipment(ln1) .parameterSetId("sl") .build(); - BlackBoxModel bbm2 = LineBuilder.of(network, reporter) + BlackBoxModel bbm2 = LineBuilder.of(network, reportNode) .dynamicModelId("BBM_LINE_NETWORK_2") .equipment(ln2) .parameterSetId("sl") @@ -48,7 +49,7 @@ void addEquipmentFromAnotherNetwork() { assertNotNull(bbm1); assertNull(bbm2); StringWriter sw = new StringWriter(); - reporter.export(sw); + reportNode.print(sw); assertEquals(""" + Builder tests 'equipment' field value LINE L1 does not belong to the builder network diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java index 035a4385e..c92778183 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/AbstractDynamicModelXmlTest.java @@ -7,7 +7,7 @@ */ package com.powsybl.dynawaltz.xml; -import com.powsybl.commons.reporter.ReporterModel; +import com.powsybl.commons.report.ReportNode; import com.powsybl.commons.test.AbstractSerDeTest; import com.powsybl.commons.test.TestUtil; import com.powsybl.dynamicsimulation.Curve; @@ -48,7 +48,7 @@ public abstract class AbstractDynamicModelXmlTest extends AbstractSerDeTest { protected List eventModels = new ArrayList<>(); protected List curves = new ArrayList<>(); protected DynaWaltzContext context; - protected ReporterModel reporter = new ReporterModel("testDyd", "Test DYD"); + protected ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("testDyd", "Test DYD").build(); @BeforeEach void setup() { @@ -79,16 +79,16 @@ public void validate(String schemaDefinition, String expectedResourceName, Path void setupDynawaltzContext() { DynamicSimulationParameters parameters = DynamicSimulationParameters.load(); DynaWaltzParameters dynawoParameters = DynaWaltzParameters.load(); - context = new DynaWaltzContext(network, network.getVariantManager().getWorkingVariantId(), dynamicModels, eventModels, curves, parameters, dynawoParameters, reporter); + context = new DynaWaltzContext(network, network.getVariantManager().getWorkingVariantId(), dynamicModels, eventModels, curves, parameters, dynawoParameters, reportNode); } protected abstract void setupNetwork(); protected abstract void addDynamicModels(); - protected void checkReporter(String report) { + protected void checkReport(String report) throws IOException { StringWriter sw = new StringWriter(); - reporter.export(sw); + reportNode.print(sw); assertEquals(report, TestUtil.normalizeLineSeparator(sw.toString())); } } diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerAutomationSystemXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerAutomationSystemXmlTest.java index 690fef153..e167ba9bc 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerAutomationSystemXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerAutomationSystemXmlTest.java @@ -45,10 +45,10 @@ void writeModel() throws SAXException, IOException, XMLStreamException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_empty_dyd.xml", tmpDir.resolve(DynaWaltzConstants.DYD_FILENAME)); - checkReporter(""" + checkReport(""" + Test DYD - + Dynawaltz models processing - TapChangerAutomaton BBM_TC equipment is not a LoadWithTransformers, the automation system will be skipped + + Dynawaltz models processing + TapChangerAutomaton BBM_TC equipment is not a LoadWithTransformers, the automation system will be skipped """); } } diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java index ed50db613..e10b80a9b 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/EmptyTapChangerBlockingAutomationSystemXmlTest.java @@ -57,11 +57,11 @@ void writeModel() throws SAXException, IOException, XMLStreamException { DydXml.write(tmpDir, context); ParametersXml.write(tmpDir, context); validate("dyd.xsd", "tap_changer_blocking_empty_dyd.xml", tmpDir.resolve(DynaWaltzConstants.DYD_FILENAME)); - checkReporter(""" - + Test DYD - + Dynawaltz models processing - TapChangerAutomaton BBM_TC equipment is not a LoadWithTransformers, the automation system will be skipped - None of TapChangerBlockingAutomaton BBM_TapChangerBlocking equipments are TapChangerModel, the automation system will be skipped - """); + checkReport(""" + + Test DYD + + Dynawaltz models processing + TapChangerAutomaton BBM_TC equipment is not a LoadWithTransformers, the automation system will be skipped + None of TapChangerBlockingAutomaton BBM_TapChangerBlocking equipments are TapChangerModel, the automation system will be skipped + """); } } diff --git a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java index f7cd5367c..bf9244c38 100644 --- a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java +++ b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaFlowTest.java @@ -9,8 +9,7 @@ import com.google.common.io.ByteStreams; import com.powsybl.commons.datasource.ResourceDataSource; import com.powsybl.commons.datasource.ResourceSet; -import com.powsybl.commons.reporter.Reporter; -import com.powsybl.commons.reporter.ReporterModel; +import com.powsybl.commons.report.ReportNode; import com.powsybl.commons.test.ComparisonUtils; import com.powsybl.commons.test.TestUtil; import com.powsybl.contingency.Contingency; @@ -78,8 +77,8 @@ void testLf() throws IOException { .setPermanentLimit(200) .add(); - ReporterModel reporter = new ReporterModel("root", "testLf root reporter"); - LoadFlowResult result = loadFlowProvider.run(network, computationManager, VariantManagerConstants.INITIAL_VARIANT_ID, loadFlowParameters, reporter) + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("root", "testLf root report").build(); + LoadFlowResult result = loadFlowProvider.run(network, computationManager, VariantManagerConstants.INITIAL_VARIANT_ID, loadFlowParameters, reportNode) .join(); assertTrue(result.isOk()); @@ -89,7 +88,7 @@ void testLf() throws IOException { assertEquals("B4", componentResult.getSlackBusId()); StringWriter sw = new StringWriter(); - reporter.export(sw); + reportNode.print(sw); System.out.println(sw); InputStream refStream = Objects.requireNonNull(getClass().getResourceAsStream("/loadflow_timeline_report.txt")); String refLogExport = TestUtil.normalizeLineSeparator(new String(ByteStreams.toByteArray(refStream), StandardCharsets.UTF_8)); @@ -111,32 +110,32 @@ void testSaBb() throws IOException { network.getVoltageLevelStream().forEach(vl -> vl.setLowVoltageLimit(vl.getNominalV() * 0.97)); // Launching a load flow before the security analysis is required - ReporterModel reporterLf = new ReporterModel("root", "Root message"); - loadFlowProvider.run(network, computationManager, VariantManagerConstants.INITIAL_VARIANT_ID, loadFlowParameters, reporterLf).join(); + ReportNode reportNodeLf = ReportNode.newRootReportNode().withMessageTemplate("root", "Root message").build(); + loadFlowProvider.run(network, computationManager, VariantManagerConstants.INITIAL_VARIANT_ID, loadFlowParameters, reportNodeLf).join(); - StringWriter swReporterLf = new StringWriter(); - reporterLf.export(swReporterLf); + StringWriter swReportNodeLf = new StringWriter(); + reportNodeLf.print(swReportNodeLf); InputStream refStreamLf = Objects.requireNonNull(getClass().getResourceAsStream("/ieee14/security-analysis/timeline_report_lf.txt")); String refLogExportLf = TestUtil.normalizeLineSeparator(new String(ByteStreams.toByteArray(refStreamLf), StandardCharsets.UTF_8)); - String logExportLf = TestUtil.normalizeLineSeparator(swReporterLf.toString()); + String logExportLf = TestUtil.normalizeLineSeparator(swReportNodeLf.toString()); assertEquals(refLogExportLf, logExportLf); List contingencies = network.getLineStream() .map(l -> Contingency.line(l.getId())) .toList(); - ReporterModel reporter = new ReporterModel("root", "Root message"); + ReportNode reportNode = ReportNode.newRootReportNode().withMessageTemplate("root", "Root message").build(); SecurityAnalysisResult result = securityAnalysisProvider.run(network, VariantManagerConstants.INITIAL_VARIANT_ID, new DefaultLimitViolationDetector(), new LimitViolationFilter(), computationManager, securityAnalysisParameters, n -> contingencies, Collections.emptyList(), - Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), reporter) + Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), reportNode) .join() .getResult(); - StringWriter swReporterAs = new StringWriter(); - reporter.export(swReporterAs); - InputStream refStreamReporterAs = Objects.requireNonNull(getClass().getResourceAsStream("/ieee14/security-analysis/timeline_report_as.txt")); - String refLogExportAs = TestUtil.normalizeLineSeparator(new String(ByteStreams.toByteArray(refStreamReporterAs), StandardCharsets.UTF_8)); - String logExportAs = TestUtil.normalizeLineSeparator(swReporterAs.toString()); + StringWriter swReportAs = new StringWriter(); + reportNode.print(swReportAs); + InputStream refStreamReportAs = Objects.requireNonNull(getClass().getResourceAsStream("/ieee14/security-analysis/timeline_report_as.txt")); + String refLogExportAs = TestUtil.normalizeLineSeparator(new String(ByteStreams.toByteArray(refStreamReportAs), StandardCharsets.UTF_8)); + String logExportAs = TestUtil.normalizeLineSeparator(swReportAs.toString()); assertEquals(refLogExportAs, logExportAs); StringWriter serializedResult = new StringWriter(); @@ -154,7 +153,7 @@ void testSaNb() throws IOException { .toList(); SecurityAnalysisResult result = securityAnalysisProvider.run(network, VariantManagerConstants.INITIAL_VARIANT_ID, new DefaultLimitViolationDetector(), new LimitViolationFilter(), computationManager, securityAnalysisParameters, n -> contingencies, Collections.emptyList(), - Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Reporter.NO_OP) + Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), ReportNode.NO_OP) .join() .getResult(); diff --git a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaWaltzTest.java b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaWaltzTest.java index e341a812f..88362c577 100644 --- a/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaWaltzTest.java +++ b/dynawo-integration-tests/src/test/java/com/powsybl/dynawo/it/DynaWaltzTest.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.stream.Stream; -import static com.powsybl.commons.reporter.Reporter.NO_OP; +import static com.powsybl.commons.report.ReportNode.NO_OP; import static org.junit.jupiter.api.Assertions.*; /** diff --git a/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_as.txt b/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_as.txt index 75b44fcd7..6a21ee2a2 100644 --- a/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_as.txt +++ b/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_as.txt @@ -1,37 +1,37 @@ + Root message - + Dynaflow security analysis on network 'ieee14bus' - + Contingency '_BUS___10-BUS___11-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS___10-BUS___11-1_AC' - + Contingency '_BUS___12-BUS___13-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS___12-BUS___13-1_AC' - + Contingency '_BUS___13-BUS___14-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS___13-BUS___14-1_AC' - + Contingency '_BUS____1-BUS____2-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____1-BUS____2-1_AC' - + Contingency '_BUS____1-BUS____5-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____1-BUS____5-1_AC' - + Contingency '_BUS____2-BUS____3-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____3-1_AC' - + Contingency '_BUS____2-BUS____4-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____4-1_AC' - + Contingency '_BUS____2-BUS____5-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____5-1_AC' - + Contingency '_BUS____3-BUS____4-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____3-BUS____4-1_AC' - + Contingency '_BUS____4-BUS____5-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____4-BUS____5-1_AC' - + Contingency '_BUS____6-BUS___11-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___11-1_AC' - + Contingency '_BUS____6-BUS___12-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___12-1_AC' - + Contingency '_BUS____6-BUS___13-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___13-1_AC' - + Contingency '_BUS____7-BUS____8-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____7-BUS____8-1_AC' - [t=10.0] GENERATOR : disconnecting on equipment '_GEN____8_SM' - + Contingency '_BUS____7-BUS____9-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____7-BUS____9-1_AC' - + Contingency '_BUS____9-BUS___10-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____9-BUS___10-1_AC' - + Contingency '_BUS____9-BUS___14-1_AC' - [t=10.0] LINE : opening both sides on equipment '_BUS____9-BUS___14-1_AC' + + Dynaflow security analysis on network 'ieee14bus' + + Contingency '_BUS___10-BUS___11-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS___10-BUS___11-1_AC' + + Contingency '_BUS___12-BUS___13-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS___12-BUS___13-1_AC' + + Contingency '_BUS___13-BUS___14-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS___13-BUS___14-1_AC' + + Contingency '_BUS____1-BUS____2-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____1-BUS____2-1_AC' + + Contingency '_BUS____1-BUS____5-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____1-BUS____5-1_AC' + + Contingency '_BUS____2-BUS____3-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____3-1_AC' + + Contingency '_BUS____2-BUS____4-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____4-1_AC' + + Contingency '_BUS____2-BUS____5-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____2-BUS____5-1_AC' + + Contingency '_BUS____3-BUS____4-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____3-BUS____4-1_AC' + + Contingency '_BUS____4-BUS____5-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____4-BUS____5-1_AC' + + Contingency '_BUS____6-BUS___11-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___11-1_AC' + + Contingency '_BUS____6-BUS___12-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___12-1_AC' + + Contingency '_BUS____6-BUS___13-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____6-BUS___13-1_AC' + + Contingency '_BUS____7-BUS____8-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____7-BUS____8-1_AC' + [t=10.0] GENERATOR : disconnecting on equipment '_GEN____8_SM' + + Contingency '_BUS____7-BUS____9-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____7-BUS____9-1_AC' + + Contingency '_BUS____9-BUS___10-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____9-BUS___10-1_AC' + + Contingency '_BUS____9-BUS___14-1_AC' + [t=10.0] LINE : opening both sides on equipment '_BUS____9-BUS___14-1_AC' diff --git a/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_lf.txt b/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_lf.txt index a39965d5c..266e76f93 100644 --- a/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_lf.txt +++ b/dynawo-integration-tests/src/test/resources/ieee14/security-analysis/timeline_report_lf.txt @@ -1,2 +1,2 @@ + Root message - + Dynaflow loadflow on network 'ieee14bus' + Dynaflow loadflow on network 'ieee14bus' diff --git a/dynawo-integration-tests/src/test/resources/loadflow_timeline_report.txt b/dynawo-integration-tests/src/test/resources/loadflow_timeline_report.txt index 6e91453e0..4f193192e 100644 --- a/dynawo-integration-tests/src/test/resources/loadflow_timeline_report.txt +++ b/dynawo-integration-tests/src/test/resources/loadflow_timeline_report.txt @@ -1,5 +1,5 @@ -+ testLf root reporter - + Dynaflow loadflow on network 'ieee14cdf-solved' - [t=90.0] Overload 60 : opening line on equipment 'L6-13-1' - [t=90.0] LINE : opening both sides on equipment 'L6-13-1' - [t=90.0] Overload 60 : opening line on equipment 'L6-13-1' ++ testLf root report + + Dynaflow loadflow on network 'ieee14cdf-solved' + [t=90.0] Overload 60 : opening line on equipment 'L6-13-1' + [t=90.0] LINE : opening both sides on equipment 'L6-13-1' + [t=90.0] Overload 60 : opening line on equipment 'L6-13-1' diff --git a/pom.xml b/pom.xml index 61e350373..2eb3a9532 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 17 - 6.2.0 + 6.3.0-alpha-1 4.0.14 ../distribution/target/site/jacoco-aggregate/jacoco.xml,