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.setCrollDamp(forces.getCrollDamp());
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()));

View File

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

View File

@ -5,6 +5,9 @@ import static net.sf.openrocket.util.MathUtil.pow2;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.sf.openrocket.aerodynamics.AerodynamicForces;
import net.sf.openrocket.aerodynamics.FlightConditions;
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.PolyInterpolator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FinSetCalc extends RocketComponentCalc {
/** logger for debugging*/
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);
/** Number of divisions in the fin chords. */
@ -57,25 +59,27 @@ public class FinSetCalc extends RocketComponentCalc {
private final double cantAngle;
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);
if (!(component instanceof FinSet)) {
throw new IllegalArgumentException("Illegal component type " + component);
}
FinSet fin = (FinSet) component;
thickness = fin.getThickness();
bodyRadius = fin.getBodyRadius();
finCount = fin.getFinCount();
baseRotation = fin.getBaseRotation();
cantAngle = fin.getCantAngle();
span = fin.getSpan();
finArea = fin.getFinArea();
crossSection = fin.getCrossSection();
thickness = component.getThickness();
bodyRadius = component.getBodyRadius();
finCount = component.getFinCount();
baseRotation = component.getBaseRotation();
cantAngle = component.getCantAngle();
span = component.getSpan();
finArea = component.getFinArea();
crossSection = component.getCrossSection();
calculateFinGeometry(fin);
calculateFinGeometry(component);
calculatePoly();
calculateInterferenceFinCount(fin);
calculateInterferenceFinCount(component);
}
/*
@ -439,8 +443,7 @@ public class FinSetCalc extends RocketComponentCalc {
private static final PolyInterpolator cnaInterpolator = new PolyInterpolator(
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 */
static {
// Up to Mach 5