import net.sf.openrocket.logging.LogHelper;
import net.sf.openrocket.models.atmosphere.AtmosphericConditions;
import net.sf.openrocket.startup.Application;
+import net.sf.openrocket.util.ArrayUtils;
import net.sf.openrocket.util.BugException;
import net.sf.openrocket.util.Coordinate;
import net.sf.openrocket.util.Inertia;
private double averageThrust;
private double totalImpulse;
+ /**
+ * Deep copy constructor.
+ * Constructs a new ThrustCurveMotor from an existing ThrustCurveMotor.
+ * @param m
+ */
+ protected ThrustCurveMotor( ThrustCurveMotor m ) {
+ this.digest = m.digest;
+ this.manufacturer = m.manufacturer;
+ this.designation = m.designation;
+ this.description = m.description;
+ this.type = m.type;
+ this.delays = ArrayUtils.copyOf(m.delays, m.delays.length);
+ this.diameter = m.diameter;
+ this.length = m.length;
+ this.time = ArrayUtils.copyOf(m.time, m.time.length);
+ this.thrust = ArrayUtils.copyOf(m.thrust, m.thrust.length);
+ this.cg = new Coordinate[ m.cg.length ];
+ for( int i = 0; i< cg.length; i++ ) {
+ this.cg[i] = m.cg[i].clone();
+ }
+ this.maxThrust = m.maxThrust;
+ this.burnTime = m.burnTime;
+ this.averageThrust = m.averageThrust;
+ this.totalImpulse = m.totalImpulse;
+ }
/**
* Sole constructor. Sets all the properties of the motor.
private final double unitRotationalInertia;
private final double unitLongitudinalInertia;
+ private final Motor parentMotor;
private int modID = 0;
stepCG = cg[0];
unitRotationalInertia = Inertia.filledCylinderRotational(getDiameter() / 2);
unitLongitudinalInertia = Inertia.filledCylinderLongitudinal(getDiameter() / 2, getLength());
+ parentMotor = ThrustCurveMotor.this;
+ }
+
+ @Override
+ public Motor getParentMotor(){
+ return parentMotor;
}
@Override