Fixes from unit tests.
Don't serializemotors during ci builds. This will likely pound thrustcurve.org too much. Couple of bugs found by unittests :)
This commit is contained in:
parent
6532743c3f
commit
e0c7c34cb0
@ -59,7 +59,7 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Executible Eclipse-Jar-In-Jar style JAR -->
|
<!-- Executible Eclipse-Jar-In-Jar style JAR -->
|
||||||
<target name="jar" depends="build,serialize-motors" description="Create the OpenRocket Core">
|
<target name="jar" depends="build" description="Create the OpenRocket Core">
|
||||||
<mkdir dir="${jar.dir}" />
|
<mkdir dir="${jar.dir}" />
|
||||||
<jar destfile="${jar.file}" basedir="${dist.dir}">
|
<jar destfile="${jar.file}" basedir="${dist.dir}">
|
||||||
|
|
||||||
|
@ -158,15 +158,9 @@ public class ThrustCurveMotorSet implements Comparable<ThrustCurveMotorSet> {
|
|||||||
if (!simplifiedDesignation.equalsIgnoreCase(simplifyDesignation(m.getDesignation())))
|
if (!simplifiedDesignation.equalsIgnoreCase(simplifyDesignation(m.getDesignation())))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!designation.equalsIgnoreCase(m.getDesignation()))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (caseInfo != null && !caseInfo.equalsIgnoreCase(m.getCaseInfo()))
|
if (caseInfo != null && !caseInfo.equalsIgnoreCase(m.getCaseInfo()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (available != m.isAvailable())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public class MassCalculator implements Monitorable {
|
|||||||
|
|
||||||
//private static final Logger log = LoggerFactory.getLogger(MassCalculator.class);
|
//private static final Logger log = LoggerFactory.getLogger(MassCalculator.class);
|
||||||
|
|
||||||
public boolean debug=false;
|
public boolean debug=true;
|
||||||
|
|
||||||
public static final double MIN_MASS = 0.001 * MathUtil.EPSILON;
|
public static final double MIN_MASS = 0.001 * MathUtil.EPSILON;
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import net.sf.openrocket.util.BugException;
|
import net.sf.openrocket.util.BugException;
|
||||||
import net.sf.openrocket.util.Coordinate;
|
import net.sf.openrocket.util.Coordinate;
|
||||||
|
import net.sf.openrocket.util.Inertia;
|
||||||
import net.sf.openrocket.util.MathUtil;
|
import net.sf.openrocket.util.MathUtil;
|
||||||
|
|
||||||
public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Serializable {
|
public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Serializable {
|
||||||
@ -46,7 +47,6 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
|||||||
private String propellantInfo;
|
private String propellantInfo;
|
||||||
|
|
||||||
private double initialMass;
|
private double initialMass;
|
||||||
private double propellantMass;
|
|
||||||
private double maxThrust;
|
private double maxThrust;
|
||||||
private double burnTimeEstimate;
|
private double burnTimeEstimate;
|
||||||
private double averageThrust;
|
private double averageThrust;
|
||||||
@ -130,11 +130,6 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setPropellantMass(double v) {
|
|
||||||
motor.propellantMass = v;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder setStandardDelays(double[] d) {
|
public Builder setStandardDelays(double[] d) {
|
||||||
motor.delays = d;
|
motor.delays = d;
|
||||||
return this;
|
return this;
|
||||||
@ -215,7 +210,9 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
|||||||
throw new IllegalArgumentException("Illegal motor type=" + motor.type);
|
throw new IllegalArgumentException("Illegal motor type=" + motor.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
motor.unitRotationalInertia = Inertia.filledCylinderRotational( motor.diameter / 2);
|
||||||
|
motor.unitLongitudinalInertia = Inertia.filledCylinderLongitudinal( motor.diameter / 2, motor.length);
|
||||||
|
|
||||||
motor.computeStatistics();
|
motor.computeStatistics();
|
||||||
|
|
||||||
return motor;
|
return motor;
|
||||||
@ -555,7 +552,7 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getPropellantMass(){
|
public double getPropellantMass(){
|
||||||
return propellantMass;
|
return (getLaunchMass() - getBurnoutMass());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -126,7 +126,7 @@ public class SerializeThrustcurveMotors {
|
|||||||
builder.setInitialMass(mi.getTot_mass_g() / 1000.0);
|
builder.setInitialMass(mi.getTot_mass_g() / 1000.0);
|
||||||
}
|
}
|
||||||
if (mi.getProp_mass_g() != null) {
|
if (mi.getProp_mass_g() != null) {
|
||||||
builder.setPropellantMass(mi.getProp_mass_g() / 1000.0);
|
// builder.setPropellantMass(mi.getProp_mass_g() / 1000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.setCaseInfo(mi.getCase_info());
|
builder.setCaseInfo(mi.getCase_info());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user