Merge pull request #670 from teyrana/571-fin-phantom-body-message
[Resolve #571] Add message fins-on-phantom-bodies
This commit is contained in:
commit
289e0cb4bb
@ -1695,6 +1695,8 @@ Warning.RECOVERY_LAUNCH_ROD = Recovery device device deployed while on the launc
|
|||||||
Warning.RECOVERY_HIGH_SPEED = Recovery device deployment at high speed
|
Warning.RECOVERY_HIGH_SPEED = Recovery device deployment at high speed
|
||||||
Warning.TUMBLE_UNDER_THRUST = Stage began to tumble under thrust.
|
Warning.TUMBLE_UNDER_THRUST = Stage began to tumble under thrust.
|
||||||
Warning.EVENT_AFTER_LANDING = Flight Event occurred after landing:
|
Warning.EVENT_AFTER_LANDING = Flight Event occurred after landing:
|
||||||
|
Warning.ZERO_LENGTH_BODY = Zero length bodies may not result in accurate simulations.
|
||||||
|
Warning.ZERO_RADIUS_BODY = Zero length bodies may not result in accurate simulations.
|
||||||
|
|
||||||
! Scale dialog
|
! Scale dialog
|
||||||
ScaleDialog.lbl.scaleRocket = Entire rocket
|
ScaleDialog.lbl.scaleRocket = Entire rocket
|
||||||
|
@ -389,4 +389,7 @@ public abstract class Warning {
|
|||||||
|
|
||||||
public static final Warning EVENT_AFTER_LANDING = new Other(trans.get("Warning.EVENT_AFTER_LANDING"));
|
public static final Warning EVENT_AFTER_LANDING = new Other(trans.get("Warning.EVENT_AFTER_LANDING"));
|
||||||
|
|
||||||
|
public static final Warning ZERO_LENGTH_BODY = new Other(trans.get("Warning.ZERO_LENGTH_BODY"));
|
||||||
|
public static final Warning ZERO_RADIUS_BODY = new Other(trans.get("Warning.ZERO_RADIUS_BODY"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.aerodynamics.barrowman;
|
package net.sf.openrocket.aerodynamics.barrowman;
|
||||||
|
|
||||||
import static java.lang.Math.pow;
|
import static java.lang.Math.pow;
|
||||||
|
import static net.sf.openrocket.util.MathUtil.EPSILON;
|
||||||
import static net.sf.openrocket.util.MathUtil.pow2;
|
import static net.sf.openrocket.util.MathUtil.pow2;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -48,6 +49,7 @@ public class FinSetCalc extends RocketComponentCalc {
|
|||||||
|
|
||||||
private final double thickness;
|
private final double thickness;
|
||||||
private final double bodyRadius;
|
private final double bodyRadius;
|
||||||
|
private final double bodyLength;
|
||||||
private final int finCount;
|
private final int finCount;
|
||||||
private final double cantAngle;
|
private final double cantAngle;
|
||||||
private final FinSet.CrossSection crossSection;
|
private final FinSet.CrossSection crossSection;
|
||||||
@ -64,6 +66,7 @@ public class FinSetCalc extends RocketComponentCalc {
|
|||||||
FinSet fin = (FinSet) component;
|
FinSet fin = (FinSet) component;
|
||||||
|
|
||||||
thickness = fin.getThickness();
|
thickness = fin.getThickness();
|
||||||
|
bodyLength = component.getParent().getLength();
|
||||||
bodyRadius = fin.getBodyRadius();
|
bodyRadius = fin.getBodyRadius();
|
||||||
finCount = fin.getFinCount();
|
finCount = fin.getFinCount();
|
||||||
|
|
||||||
@ -98,8 +101,14 @@ public class FinSetCalc extends RocketComponentCalc {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add warnings (radius/2 == diameter/4)
|
if((EPSILON > bodyLength)) {
|
||||||
if( (0 < bodyRadius) && (thickness > bodyRadius / 2)){
|
// Add warnings: Phantom Body
|
||||||
|
warnings.add(Warning.ZERO_LENGTH_BODY);
|
||||||
|
}else if((EPSILON > bodyRadius)){
|
||||||
|
// Add warnings: Phantom Body
|
||||||
|
warnings.add(Warning.ZERO_RADIUS_BODY);
|
||||||
|
}else if( (0 < bodyRadius) && (thickness > bodyRadius / 2)){
|
||||||
|
// Add warnings (radius/2 == diameter/4)
|
||||||
warnings.add(Warning.THICK_FIN);
|
warnings.add(Warning.THICK_FIN);
|
||||||
}
|
}
|
||||||
warnings.addAll(geometryWarnings);
|
warnings.addAll(geometryWarnings);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user