Conversation
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
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; |
There was a problem hiding this comment.
The calculation should take into account the space for arrows, use LayoutParameters.getFeederSpan() for that.
| 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) |
There was a problem hiding this comment.
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>
|
|
|
||
| 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)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
|



Please check if the PR fulfills these requirements
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?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: