If rocket CP weight is less than or equal to 0, display it as N/A in ComponentAnalysisDialog. This brings it in agreement with the CP display in the RocketPanel, and more clearly expresses a problem with the deisgn.

This commit is contained in:
JoePfeiffer 2022-12-24 20:11:34 -07:00
parent 19aed2a216
commit b89a5aa35c

View File

@ -571,7 +571,12 @@ public class ComponentAnalysisDialog extends JDialog implements StateChangeListe
}
if (forces.getCP() != null) {
row.cpx = forces.getCP().x;
if ((comp instanceof Rocket) &&
(forces.getCP().weight < MathUtil.EPSILON)) {
row.cpx = Double.NaN;
} else {
row.cpx = forces.getCP().x;
}
row.cna = forces.getCNa();
}