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>
|
||||
|
||||
<!-- 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}" />
|
||||
<jar destfile="${jar.file}" basedir="${dist.dir}">
|
||||
|
||||
|
@ -158,15 +158,9 @@ public class ThrustCurveMotorSet implements Comparable<ThrustCurveMotorSet> {
|
||||
if (!simplifiedDesignation.equalsIgnoreCase(simplifyDesignation(m.getDesignation())))
|
||||
return false;
|
||||
|
||||
if (!designation.equalsIgnoreCase(m.getDesignation()))
|
||||
return false;
|
||||
|
||||
if (caseInfo != null && !caseInfo.equalsIgnoreCase(m.getCaseInfo()))
|
||||
return false;
|
||||
|
||||
if (available != m.isAvailable())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ public class MassCalculator implements Monitorable {
|
||||
|
||||
//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;
|
||||
|
||||
|
@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.sf.openrocket.util.BugException;
|
||||
import net.sf.openrocket.util.Coordinate;
|
||||
import net.sf.openrocket.util.Inertia;
|
||||
import net.sf.openrocket.util.MathUtil;
|
||||
|
||||
public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Serializable {
|
||||
@ -46,7 +47,6 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
||||
private String propellantInfo;
|
||||
|
||||
private double initialMass;
|
||||
private double propellantMass;
|
||||
private double maxThrust;
|
||||
private double burnTimeEstimate;
|
||||
private double averageThrust;
|
||||
@ -130,11 +130,6 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPropellantMass(double v) {
|
||||
motor.propellantMass = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setStandardDelays(double[] d) {
|
||||
motor.delays = d;
|
||||
return this;
|
||||
@ -215,7 +210,9 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
||||
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();
|
||||
|
||||
return motor;
|
||||
@ -555,7 +552,7 @@ public class ThrustCurveMotor implements Motor, Comparable<ThrustCurveMotor>, Se
|
||||
}
|
||||
|
||||
public double getPropellantMass(){
|
||||
return propellantMass;
|
||||
return (getLaunchMass() - getBurnoutMass());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -126,7 +126,7 @@ public class SerializeThrustcurveMotors {
|
||||
builder.setInitialMass(mi.getTot_mass_g() / 1000.0);
|
||||
}
|
||||
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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user