Skip to content
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

OperatingStatus extension is on an Identifiable #598

Merged
merged 5 commits into from
Apr 3, 2024
Merged

Conversation

So-Fras
Copy link
Member

@So-Fras So-Fras commented Mar 28, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
Bug fix

What is the current behavior?
The OperatingStatus extension on an HVDCLine is currently read on the ConverterStation. Thus the code always returns null and the extension is never read.

What is the new behavior (if this is a feature change)?
The extension is read on the HVDCLine.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
@So-Fras So-Fras requested a review from flo-dup March 28, 2024 13:01
@So-Fras So-Fras added bug Something isn't working SLD labels Mar 28, 2024
So-Fras and others added 2 commits April 2, 2024 12:53
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
break;
}
case HVDC -> addOperatingStatusDecorator(nodeDecorators, node, direction, network.getHvdcLine(feederNode.getEquipmentId()));
default -> { /* Do nothing */ }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a code smell before because you did nothing without telling why. Now that you added the comment it ensures that it was not an empty statement by mistake. But it's more valuable to also add more context like "no decorator for other feeder types"

switch (operatingStatus.getStatus()) {
case PLANNED_OUTAGE -> nodeDecorators.add(getBranchStatusDecorator(node, direction, PLANNED_OUTAGE_BRANCH_NODE_DECORATOR));
case FORCED_OUTAGE -> nodeDecorators.add(getBranchStatusDecorator(node, direction, FORCED_OUTAGE_BRANCH_NODE_DECORATOR));
default -> { /* Do nothing */ }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, and as there is only one other enum value, it's better to have it displayed instead of default

Suggested change
default -> { /* Do nothing */ }
case IN_OPERATION -> { /* no decorator for in operation equipments */ }

Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Copy link

sonarqubecloud bot commented Apr 3, 2024

@So-Fras So-Fras merged commit 6a71106 into main Apr 3, 2024
6 checks passed
@So-Fras So-Fras deleted the operating_status_hvdc branch April 3, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SLD
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants