X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Frocketcomponent%2FStreamer.java;h=dd071a40716481ef9d3abbd1806a27da1fb9c2ff;hb=10c2e190c2e70564be6768a1acafa232dfff8e5c;hp=134f3ee9d24ed610f7c531258786e3407ec22cc4;hpb=720d4935bc6bec453e6478ad5227356c626610a2;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/rocketcomponent/Streamer.java b/src/net/sf/openrocket/rocketcomponent/Streamer.java index 134f3ee9..dd071a40 100644 --- a/src/net/sf/openrocket/rocketcomponent/Streamer.java +++ b/src/net/sf/openrocket/rocketcomponent/Streamer.java @@ -3,12 +3,12 @@ package net.sf.openrocket.rocketcomponent; import net.sf.openrocket.util.MathUtil; public class Streamer extends RecoveryDevice { - + public static final double DEFAULT_CD = 0.6; public static final double MAX_COMPUTED_CD = 0.4; - + private double stripLength; private double stripWidth; @@ -22,18 +22,18 @@ public class Streamer extends RecoveryDevice { public double getStripLength() { return stripLength; } - + public void setStripLength(double stripLength) { if (MathUtil.equals(this.stripLength, stripLength)) return; this.stripLength = stripLength; fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } - + public double getStripWidth() { return stripWidth; } - + public void setStripWidth(double stripWidth) { if (MathUtil.equals(this.stripWidth, stripWidth)) return; @@ -46,18 +46,18 @@ public class Streamer extends RecoveryDevice { public void setLength(double length) { setStripWidth(length); } - + public double getAspectRatio() { if (stripWidth > 0.0001) - return stripLength/stripWidth; + return stripLength / stripWidth; return 1000; } public void setAspectRatio(double ratio) { if (MathUtil.equals(getAspectRatio(), ratio)) return; - + ratio = Math.max(ratio, 0.01); double area = getArea(); stripWidth = Math.sqrt(area / ratio); @@ -65,12 +65,12 @@ public class Streamer extends RecoveryDevice { fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE); } - + @Override public double getArea() { return stripWidth * stripLength; } - + public void setArea(double area) { if (MathUtil.equals(getArea(), area)) return; @@ -82,22 +82,27 @@ public class Streamer extends RecoveryDevice { } - + @Override public double getComponentCD(double mach) { double density = this.getMaterial().getDensity(); double cd; - cd = 0.034 * ((density + 0.025)/0.105) * (stripLength+1) / stripLength; + cd = 0.034 * ((density + 0.025) / 0.105) * (stripLength + 1) / stripLength; cd = MathUtil.min(cd, MAX_COMPUTED_CD); return cd; } - + @Override public String getComponentName() { return "Streamer"; } - + + @Override + public boolean allowsChildren() { + return false; + } + @Override public boolean isCompatible(Class type) { return false;