-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add voltage level details to display production and consumption figures #622
Conversation
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
… to voltage level details Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <93923177+So-Fras@users.noreply.github.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/DefaultLabelProvider.java
Outdated
Show resolved
Hide resolved
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.
Just realizing we could have done this by buses quite easily... next step!
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/DefaultLabelProvider.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/DefaultLabelProvider.java
Outdated
Show resolved
Hide resolved
network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/DefaultLabelProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
List<String> voltageLevelDetails = new ArrayList<>(); | ||
VoltageLevel voltageLevel = network.getVoltageLevel(vlNode.getEquipmentId()); | ||
|
||
double activeProductionValue = voltageLevel.getGeneratorStream().mapToDouble(generator -> !Double.isNaN(-generator.getTerminal().getP()) ? -generator.getTerminal().getP() : 0).sum(); |
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.
This stream operation (and the 3 others) can be simplified that way. Besides it will avoid the complexity issue raised by sonar.
double activeProductionValue = voltageLevel.getGeneratorStream().mapToDouble(generator -> !Double.isNaN(-generator.getTerminal().getP()) ? -generator.getTerminal().getP() : 0).sum(); | |
double activeProductionValue = voltageLevel.getGeneratorStream().mapToDouble(generator -> -generator.getTerminal().getP()).filter(p -> !Double.isNaN(p)).sum(); |
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
|
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?