-
Notifications
You must be signed in to change notification settings - Fork 56
fix removing voltageLevel when equipments are still present #3860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
3903d6e
ac88da7
5b15e1e
3df67a6
dd4ba3a
4662124
9fff3bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,7 +135,9 @@ core.iidm.modification.voltageConnectedOnLine = Le poste ${voltageLevelId} conne | |
| core.iidm.modification.voltageLevelCreated = Poste ${voltageLevelId} créé. | ||
| core.iidm.modification.voltageLevelNotFound = Poste ${voltageLevelId} introuvable. | ||
| core.iidm.modification.voltageLevelRemoved = Le poste ${vlId} a été supprimé. | ||
| core.iidm.modification.voltageLevelRemovingEquipmentsLeft = Le poste ${vlId} contient toujours des équipements. | ||
| core.iidm.modification.voltageLevelRemovingEquipmentsLeft = Le poste ${vlId} contient toujours des équipements. | ||
| core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithQuadripoles = Le poste ${vlId} contient toujours des équipements dont des quadripoles, il n'est pas supprimé. | ||
| core.iidm.modification.voltageLevelRemovingEquipmentsLeftWithoutQuadripoles = Le poste ${vlId} contient toujours des équipements mais aucun quadripoles, il n'est pas supprimé. | ||
|
Comment on lines
+139
to
+140
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a typo in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Beware, this file should be edited in UTF-8. |
||
| core.iidm.modification.wrongSwitchKind = Les organes de coupures doivent être de type DISCONNECTOR ou BREAKER. | ||
| core.iidm.modification.noBusbarSection = Aucune section de jeu de barres donnée | ||
| core.iidm.modification.wrongNetwork = Toutes les sections de jeu de barres doivent être dans le réseau passé en entrée. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,17 +199,26 @@ private static <L extends LoadingLimits, A extends LoadingLimitsAdder<L, A>> voi | |
| } | ||
|
|
||
| static void removeVoltageLevelAndSubstation(VoltageLevel voltageLevel, ReportNode reportNode) { | ||
| Optional<Substation> substation = voltageLevel.getSubstation(); | ||
| String vlId = voltageLevel.getId(); | ||
| boolean noMoreBranches = voltageLevel.getConnectableStream().noneMatch(c -> c.getType() != IdentifiableType.LINE | ||
| || c.getType() != IdentifiableType.TWO_WINDINGS_TRANSFORMER || c.getType() != IdentifiableType.THREE_WINDINGS_TRANSFORMER || | ||
| c.getType() != IdentifiableType.HVDC_CONVERTER_STATION); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check can be done in the |
||
| boolean noMoreEquipments = voltageLevel.getConnectableStream().noneMatch(c -> c.getType() != IdentifiableType.BUSBAR_SECTION); | ||
| if (!noMoreEquipments) { | ||
| voltageLevelRemovingEquipmentsLeftReport(reportNode, vlId); | ||
| LOGGER.warn("Voltage level {} still contains equipments", vlId); | ||
| if (noMoreBranches) { | ||
| voltageLevelRemovingEquipmentsLeftWithoutQuadripoleReport(reportNode, vlId); | ||
| LOGGER.warn("Voltage level {} still contains equipments but no quadripoles, it is not removed", vlId); | ||
| } else { | ||
| voltageLevelRemovingEquipmentsLeftWithQuadripoleReport(reportNode, vlId); | ||
| LOGGER.warn("Voltage level {} still contains equipments including quadripoles, it is not removed", vlId); | ||
| } | ||
| return; | ||
| } | ||
| // substation must be gotten before removing the voltageLevel | ||
| Optional<Substation> substation = voltageLevel.getSubstation(); | ||
| voltageLevel.remove(); | ||
| voltageLevelRemovedReport(reportNode, vlId); | ||
| LOGGER.info("Voltage level {} removed", vlId); | ||
|
|
||
| substation.ifPresent(s -> { | ||
| if (s.getVoltageLevelStream().count() == 0) { | ||
| String substationId = s.getId(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| + Testing reportNode for reverting create line on line and not removing the voltage level | ||
| Line CJ_1 removed | ||
| Line CJ_2 removed | ||
| Line testLine removed | ||
| Line CJ_NEW created | ||
| Voltage level CJ_VL still contains equipments including quadripoles, it is not removed | ||
| Voltage level VLTEST removed | ||
|
Comment on lines
+1
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you are expecting everything to be deleted even if the voltage level cannot be deleted ? Wouldn't it be better to check before deleting instead of starting and noticing that one of the element cannot be deleted ? |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quadripoles->branchesCan you fix the keys and the messages?