[#1600] Calculate auto tab for all inner tubes
This commit is contained in:
parent
2b8515a321
commit
69dceca653
@ -233,6 +233,15 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
|||||||
autoCalc.addActionListener(new ActionListener() {
|
autoCalc.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
calculateAutoTab(em, mts, mtl, tabHeightModel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
panel.add(autoCalc, "skip 1, spanx");
|
||||||
|
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calculateAutoTab(EnumModel<AxialMethod> em, DoubleModel mts, DoubleModel mtl, DoubleModel tabHeightModel) {
|
||||||
log.info(Markers.USER_MARKER, "Computing " + component.getComponentName() + " tab height.");
|
log.info(Markers.USER_MARKER, "Computing " + component.getComponentName() + " tab height.");
|
||||||
|
|
||||||
double inRad = 0.0;
|
double inRad = 0.0;
|
||||||
@ -242,16 +251,13 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
|||||||
document.startUndo("Compute fin tabs");
|
document.startUndo("Compute fin tabs");
|
||||||
|
|
||||||
List<CenteringRing> rings = new ArrayList<>();
|
List<CenteringRing> rings = new ArrayList<>();
|
||||||
// Do deep recursive iteration to find centering rings and determine
|
// Do deep recursive iteration to find centering rings and determine radius of inner tube
|
||||||
// radius of inner tube
|
|
||||||
Iterator<RocketComponent> iter = parent.iterator(false);
|
Iterator<RocketComponent> iter = parent.iterator(false);
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
RocketComponent rocketComponent = iter.next();
|
RocketComponent rocketComponent = iter.next();
|
||||||
if (rocketComponent instanceof InnerTube) {
|
if (rocketComponent instanceof InnerTube) {
|
||||||
InnerTube it = (InnerTube) rocketComponent;
|
InnerTube it = (InnerTube) rocketComponent;
|
||||||
if (it.isMotorMount()) {
|
|
||||||
inRad = it.getOuterRadius();
|
inRad = it.getOuterRadius();
|
||||||
}
|
|
||||||
} else if (rocketComponent instanceof CenteringRing) {
|
} else if (rocketComponent instanceof CenteringRing) {
|
||||||
rings.add((CenteringRing) rocketComponent);
|
rings.add((CenteringRing) rocketComponent);
|
||||||
}
|
}
|
||||||
@ -282,11 +288,6 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
panel.add(autoCalc, "skip 1, spanx");
|
|
||||||
|
|
||||||
return panel;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scenarios:
|
* Scenarios:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user