diff --git a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/GeneratorField.java b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/GeneratorField.java index 6fed86d25..0d3f6602c 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/GeneratorField.java +++ b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/GeneratorField.java @@ -19,11 +19,7 @@ import org.gridsuite.modification.server.modifications.ModificationUtils; import static org.gridsuite.modification.server.NetworkModificationException.Type.MODIFY_GENERATOR_ERROR; -import static org.gridsuite.modification.server.modifications.GeneratorModification.modifyGeneratorActiveLimitsAttributes; -import static org.gridsuite.modification.server.modifications.GeneratorModification.modifyGeneratorShortCircuitAttributes; -import static org.gridsuite.modification.server.modifications.GeneratorModification.modifyGeneratorStartUpAttributes; -import static org.gridsuite.modification.server.modifications.GeneratorModification.modifyTargetQ; -import static org.gridsuite.modification.server.modifications.GeneratorModification.modifyTargetV; +import static org.gridsuite.modification.server.modifications.GeneratorModification.*; /** * @author Seddik Yengui @@ -89,7 +85,7 @@ public static void setNewValue(Generator generator, String generatorField, Doubl case REACTIVE_POWER_SET_POINT -> modifyTargetQ(generator, attrModif); case VOLTAGE_SET_POINT -> modifyTargetV(generator, attrModif); case PLANNED_ACTIVE_POWER_SET_POINT -> - modifyGeneratorStartUpAttributes(attrModif, null, null, null, generator, null, null); + modifyGeneratorStartUpAttributes(attrModif, null, null, null, generator, null, null); case MARGINAL_COST -> modifyGeneratorStartUpAttributes(null, attrModif, null, null, generator, null, null); case PLANNED_OUTAGE_RATE -> diff --git a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/ShuntCompensatorField.java b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/ShuntCompensatorField.java index 5b60793cb..4bbea3112 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/ShuntCompensatorField.java +++ b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/ShuntCompensatorField.java @@ -16,10 +16,7 @@ import org.gridsuite.modification.server.dto.OperationType; import org.gridsuite.modification.server.dto.ShuntCompensatorType; -import static org.gridsuite.modification.server.modifications.ShuntCompensatorModification.modifyMaxSusceptance; -import static org.gridsuite.modification.server.modifications.ShuntCompensatorModification.modifyMaximumQAtNominalVoltage; -import static org.gridsuite.modification.server.modifications.ShuntCompensatorModification.modifyMaximumSectionCount; -import static org.gridsuite.modification.server.modifications.ShuntCompensatorModification.modifySectionCount; +import static org.gridsuite.modification.server.modifications.ShuntCompensatorModification.*; /** * @author Seddik Yengui diff --git a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/VoltageLevelField.java b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/VoltageLevelField.java index 07cc36476..69f366ad4 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/VoltageLevelField.java +++ b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/VoltageLevelField.java @@ -12,10 +12,7 @@ import org.gridsuite.modification.server.dto.AttributeModification; import org.gridsuite.modification.server.dto.OperationType; -import static org.gridsuite.modification.server.modifications.VoltageLevelModification.modifLowVoltageLimit; -import static org.gridsuite.modification.server.modifications.VoltageLevelModification.modifyHighVoltageLimit; -import static org.gridsuite.modification.server.modifications.VoltageLevelModification.modifyNominalV; -import static org.gridsuite.modification.server.modifications.VoltageLevelModification.modifyVoltageLevelShortCircuit; +import static org.gridsuite.modification.server.modifications.VoltageLevelModification.*; /** * @author Seddik Yengui diff --git a/src/main/java/org/gridsuite/modification/server/modifications/ByFormulaModification.java b/src/main/java/org/gridsuite/modification/server/modifications/ByFormulaModification.java index f581d39ba..eb8ebbc3d 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/ByFormulaModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/ByFormulaModification.java @@ -286,7 +286,7 @@ private void applyFormula(Identifiable identifiable, .withUntypedValue(KEY_VALUE, newValue) .withSeverity(TypedValue.TRACE_SEVERITY) .build()); - } catch (Exception e) { // ATTENTION : ce catch attrape bien mes throw mais sans utiliser les messages donc c'est un peu gâché; En faire un spécifique pour les NetworkModificationException ? + } catch (Exception e) { notEditableEquipments.add(identifiable.getId()); equipmentNotModifiedCount += 1; reports.add(ReportNode.newRootReportNode() diff --git a/src/main/java/org/gridsuite/modification/server/modifications/GeneratorModification.java b/src/main/java/org/gridsuite/modification/server/modifications/GeneratorModification.java index 6fec37804..271455f14 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/GeneratorModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/GeneratorModification.java @@ -94,7 +94,7 @@ private void modifyGenerator(Generator generator, GeneratorModificationInfos mod modifyGeneratorLimitsAttributes(modificationInfos, generator, subReportNode); modifyGeneratorSetpointsAttributes(modificationInfos, generator, subReportNode); modifyGeneratorShortCircuitAttributes(modificationInfos.getDirectTransX(), modificationInfos.getStepUpTransformerX(), generator, subReportNode); - modifyGeneratorStartUpAttributesAndLog(modificationInfos, generator, subReportNode); + modifyGeneratorStartUpAttributes(modificationInfos, generator, subReportNode); modifyGeneratorConnectivityAttributes(modificationInfos, generator, subReportNode); PropertiesUtils.applyProperties(generator, subReportNode, modificationInfos.getProperties(), "GeneratorProperties"); } @@ -223,8 +223,8 @@ private ReportNode modifyGeneratorActivePowerControlAttributes(GeneratorModifica return ModificationUtils.getInstance().modifyActivePowerControlAttributes(activePowerControl, activePowerControlAdder, modificationInfos.getParticipate(), modificationInfos.getDroop(), subReportNode, subReportNodeSetpoints); } - private void modifyGeneratorStartUpAttributesAndLog(GeneratorModificationInfos modificationInfos, Generator generator, - ReportNode subReportNode) { + private void modifyGeneratorStartUpAttributes(GeneratorModificationInfos modificationInfos, Generator generator, + ReportNode subReportNode) { List reports = new ArrayList<>(); modifyGeneratorStartUpAttributes(modificationInfos.getPlannedActivePowerSetPoint(), modificationInfos.getMarginalCost(), diff --git a/src/main/java/org/gridsuite/modification/server/modifications/ShuntCompensatorModification.java b/src/main/java/org/gridsuite/modification/server/modifications/ShuntCompensatorModification.java index 67c7cbe76..899ace841 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/ShuntCompensatorModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/ShuntCompensatorModification.java @@ -167,9 +167,9 @@ private void applyModificationOnLinearModel(ReportNode subReportNode, ShuntCompe } public static void modifyMaxSusceptance(AttributeModification maxSusceptance, - int maximumSectionCount, - List reports, - ShuntCompensatorLinearModel model) { + int maximumSectionCount, + List reports, + ShuntCompensatorLinearModel model) { double newSusceptancePerSection = maxSusceptance.getValue() / maximumSectionCount; if (reports != null) { double oldSusceptancePerSection = model.getBPerSection(); diff --git a/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java b/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java index ae272ab6f..b51672d5e 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java @@ -66,7 +66,13 @@ protected void modifyCharacteristics(Branch branch, BranchModificationInfos b // Transformer specific fields TwoWindingsTransformerModificationInfos twoWindingsTransformerModificationInfos = (TwoWindingsTransformerModificationInfos) branchModificationInfos; - modifyTransformerFields(twoWindingsTransformer, twoWindingsTransformerModificationInfos.getG(), twoWindingsTransformerModificationInfos.getB(), twoWindingsTransformerModificationInfos.getRatedS(), twoWindingsTransformerModificationInfos.getRatedU1(), twoWindingsTransformerModificationInfos.getRatedU2(), characteristicsReporter); + modifyTransformerFields(twoWindingsTransformer, + twoWindingsTransformerModificationInfos.getG(), + twoWindingsTransformerModificationInfos.getB(), + twoWindingsTransformerModificationInfos.getRatedS(), + twoWindingsTransformerModificationInfos.getRatedU1(), + twoWindingsTransformerModificationInfos.getRatedU2(), + characteristicsReporter); } public static void modifyTransformerFields(TwoWindingsTransformer transformer,