fixes little bug found at github build and adds a little more docs

This commit is contained in:
Luiz Victor Linhares Rocha 2016-10-13 15:42:08 -03:00
parent c9dadc10fa
commit ecb467db36
3 changed files with 25 additions and 21 deletions

View File

@ -261,7 +261,7 @@ public class BarrowmanCalculator extends AbstractAerodynamicCalculator {
f.setCroll(forces.getCroll()); f.setCroll(forces.getCroll());
f.setCrollDamp(forces.getCrollDamp()); f.setCrollDamp(forces.getCrollDamp());
f.setCrollForce(forces.getCrollForce()); f.setCrollForce(forces.getCrollForce());
map.replace(component, f); //have you forgotten to add this? map.put(component, f);
} }
total.setCP(total.getCP().average(forces.getCP())); total.setCP(total.getCP().average(forces.getCP()));

View File

@ -20,6 +20,7 @@ import net.sf.openrocket.util.Mutable;
*/ */
public class WarningSet extends AbstractSet<Warning> implements Cloneable, Monitorable { public class WarningSet extends AbstractSet<Warning> implements Cloneable, Monitorable {
/** the actual array of warnings*/
private ArrayList<Warning> warnings = new ArrayList<Warning>(); private ArrayList<Warning> warnings = new ArrayList<Warning>();
private Mutable mutable = new Mutable(); private Mutable mutable = new Mutable();

View File

@ -5,6 +5,9 @@ import static net.sf.openrocket.util.MathUtil.pow2;
import java.util.Arrays; import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.sf.openrocket.aerodynamics.AerodynamicForces; import net.sf.openrocket.aerodynamics.AerodynamicForces;
import net.sf.openrocket.aerodynamics.FlightConditions; import net.sf.openrocket.aerodynamics.FlightConditions;
import net.sf.openrocket.aerodynamics.Warning; import net.sf.openrocket.aerodynamics.Warning;
@ -17,14 +20,13 @@ import net.sf.openrocket.util.LinearInterpolator;
import net.sf.openrocket.util.MathUtil; import net.sf.openrocket.util.MathUtil;
import net.sf.openrocket.util.PolyInterpolator; import net.sf.openrocket.util.PolyInterpolator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FinSetCalc extends RocketComponentCalc { public class FinSetCalc extends RocketComponentCalc {
/** logger for debugging*/
private final static Logger logger = LoggerFactory.getLogger(FinSetCalc.class); private final static Logger logger = LoggerFactory.getLogger(FinSetCalc.class);
/** considers the stall angle as 20º*/
private static final double STALL_ANGLE = (20 * Math.PI / 180); private static final double STALL_ANGLE = (20 * Math.PI / 180);
/** Number of divisions in the fin chords. */ /** Number of divisions in the fin chords. */
@ -57,25 +59,27 @@ public class FinSetCalc extends RocketComponentCalc {
private final double cantAngle; private final double cantAngle;
private final FinSet.CrossSection crossSection; private final FinSet.CrossSection crossSection;
public FinSetCalc(RocketComponent component) { /**
* builds a calculator of aerodynamic forces a specified fin
* @param component The fin in consideration
*/
///why is this accepting RocketComponent when it rejects?
///why not put FinSet in the parameter instead?
public FinSetCalc(FinSet component) {
super(component); super(component);
if (!(component instanceof FinSet)) {
throw new IllegalArgumentException("Illegal component type " + component);
}
FinSet fin = (FinSet) component; thickness = component.getThickness();
thickness = fin.getThickness(); bodyRadius = component.getBodyRadius();
bodyRadius = fin.getBodyRadius(); finCount = component.getFinCount();
finCount = fin.getFinCount(); baseRotation = component.getBaseRotation();
baseRotation = fin.getBaseRotation(); cantAngle = component.getCantAngle();
cantAngle = fin.getCantAngle(); span = component.getSpan();
span = fin.getSpan(); finArea = component.getFinArea();
finArea = fin.getFinArea(); crossSection = component.getCrossSection();
crossSection = fin.getCrossSection();
calculateFinGeometry(fin); calculateFinGeometry(component);
calculatePoly(); calculatePoly();
calculateInterferenceFinCount(fin); calculateInterferenceFinCount(component);
} }
/* /*
@ -439,8 +443,7 @@ public class FinSetCalc extends RocketComponentCalc {
private static final PolyInterpolator cnaInterpolator = new PolyInterpolator( private static final PolyInterpolator cnaInterpolator = new PolyInterpolator(
new double[] { CNA_SUBSONIC, CNA_SUPERSONIC }, new double[] { CNA_SUBSONIC, CNA_SUPERSONIC },
new double[] { CNA_SUBSONIC, CNA_SUPERSONIC }, new double[] { CNA_SUBSONIC, CNA_SUPERSONIC },
new double[] { CNA_SUBSONIC } new double[] { CNA_SUBSONIC });
);
/* Pre-calculate the values for K1, K2 and K3 */ /* Pre-calculate the values for K1, K2 and K3 */
static { static {
// Up to Mach 5 // Up to Mach 5