Only use direct children for auto tab calc

This commit is contained in:
SiboVG 2022-08-25 21:36:43 +02:00
parent 467b1dee1d
commit c41ed866cd

View File

@ -258,19 +258,17 @@ public abstract class FinSetConfig extends RocketComponentConfig {
List<CenteringRing> rings = new ArrayList<>(); List<CenteringRing> rings = new ArrayList<>();
// Do deep recursive iteration to find centering rings and determine radius of inner tube // Do deep recursive iteration to find centering rings and determine radius of inner tube
Iterator<RocketComponent> iter = parent.iterator(false); for (RocketComponent child : parent.getChildren()) {
while (iter.hasNext()) { if (child instanceof InnerTube) {
RocketComponent rocketComponent = iter.next(); if (!isComponentInsideFinSpan(child)) {
if (rocketComponent instanceof InnerTube) {
if (!isComponentInsideFinSpan(rocketComponent)) {
continue; continue;
} }
InnerTube tube = (InnerTube) rocketComponent; InnerTube tube = (InnerTube) child;
if (tube.getOuterRadius() > maxTubeRad) { if (tube.getOuterRadius() > maxTubeRad) {
maxTubeRad = tube.getOuterRadius(); maxTubeRad = tube.getOuterRadius();
} }
} else if (rocketComponent instanceof CenteringRing) { } else if (child instanceof CenteringRing) {
CenteringRing ring = (CenteringRing) rocketComponent; CenteringRing ring = (CenteringRing) child;
if (ring.getOuterRadius() > maxRingRad) { if (ring.getOuterRadius() > maxRingRad) {
maxRingRad = ring.getOuterRadius(); maxRingRad = ring.getOuterRadius();
} }
@ -295,9 +293,9 @@ public abstract class FinSetConfig extends RocketComponentConfig {
//Be nice to the user and set the tab relative position enum back the way they had it. //Be nice to the user and set the tab relative position enum back the way they had it.
tabOffsetMethod.setSelectedItem(temp); tabOffsetMethod.setSelectedItem(temp);
} else { } else {
tabLength.setValue(component.getLength());
tabOffsetMethod.setSelectedItem(AxialMethod.TOP); tabOffsetMethod.setSelectedItem(AxialMethod.TOP);
tabOffset.setValue(0); tabOffset.setValue(0);
tabLength.setValue(component.getLength());
} }
// Compute tab height // Compute tab height