Skip to content

Display feeder info on 3wt leg inside VL#761

Open
quinarygio wants to merge 9 commits intomainfrom
686-display-feeder-info-on-the-3wt-leg-inside-a-vl
Open

Display feeder info on 3wt leg inside VL#761
quinarygio wants to merge 9 commits intomainfrom
686-display-feeder-info-on-the-3wt-leg-inside-a-vl

Conversation

@quinarygio
Copy link
Copy Markdown
Contributor

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)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

#686

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?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
@quinarygio quinarygio linked an issue Dec 4, 2025 that may be closed by this pull request
@quinarygio quinarygio marked this pull request as draft December 4, 2025 15:22
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
.filter(sw -> sw.getAdjacentNodes().stream().anyMatch(n -> n instanceof Middle3WTNode)).count();

this.blockHeight = (nbNodes - 1) * componentHeight;
this.blockHeight = (2 * nbSwitch3wt + nbNodes - 1) * componentHeight;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The calculation should take into account the space for arrows, use LayoutParameters.getFeederSpan() for that.

Suggested change
this.blockHeight = (2 * nbSwitch3wt + nbNodes - 1) * componentHeight;
this.blockHeight = (nbNodes - 1) * componentHeight;
if (blockWith3wt) this.blockHeight += layoutParameters.getFeederSpan();

// already encountered
long nbNodes = block.getNodeStream().filter(n -> !encounteredNodes.contains(n) && n.getType() != BUS)
.count();
long nbSwitch3wt = block.getNodeStream().filter(n -> !encounteredNodes.contains(n) && n.getType() == NodeType.SWITCH)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you don't need to count these kind of switches, you only need to check if there's one 3wt in the block nodes. And if there is, you add one extra feeder span to the height.

Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
…e-a-vl

Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
@sonarqubecloud
Copy link
Copy Markdown

@quinarygio quinarygio marked this pull request as ready for review December 22, 2025 11:26
@alicecaron alicecaron moved this to Waiting for review in Release 03/2026 Dec 31, 2025

for (int i = 0; i < blockNodes.size(); i++) {
Node n = blockNodes.get(i);
if (n.getType() == NodeType.SWITCH && n.getAdjacentNodes().stream().anyMatch(Middle3WTNode.class::isInstance)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

that's only working for some usecases. Indeed, it may be something else than a switch, and there might be more than one switch. If you try nominal_voltage_style_vl3.svg with two breakers before the disconnector, don't you end up with something strange?

I'm wondering if we could keep the code here unchanged but rather change the span of the block is there's one 3wt inside. Did you try something like that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I already changed the span of the block when there is a 3wt inside. Now I changed the condition to change the position of all the switches and feeders and added a test with more than one switch.

Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting for review

Development

Successfully merging this pull request may close these issues.

Display feeder info on the 3WT leg inside a VL

4 participants