diff --git a/core/src/net/sf/openrocket/file/DatabaseMotorFinderWithMissingMotors.java b/core/src/net/sf/openrocket/file/DatabaseMotorFinderWithMissingMotors.java deleted file mode 100644 index 5270151b3..000000000 --- a/core/src/net/sf/openrocket/file/DatabaseMotorFinderWithMissingMotors.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.sf.openrocket.file; - -import net.sf.openrocket.aerodynamics.WarningSet; -import net.sf.openrocket.motor.Motor; -import net.sf.openrocket.motor.Motor.Type; -import net.sf.openrocket.motor.ThrustCurveMotorPlaceholder; - -public class DatabaseMotorFinderWithMissingMotors extends DatabaseMotorFinder -implements MotorFinder { - - /** - * This implementation returns a ThrustCurveMotorPlaceholder. - */ - @Override - protected Motor handleMissingMotor(Type type, String manufacturer, String designation, double diameter, double length, String digest, WarningSet warnings) { - Motor motor = new ThrustCurveMotorPlaceholder(type, - manufacturer, - designation, - diameter, - length, - digest, - /* delay */ Double.NaN, - /*launchMass*/ Double.NaN, - /*emptyMass*/ Double.NaN); - return motor; - } -} diff --git a/core/src/net/sf/openrocket/motor/ThrustCurveMotorPlaceholder.java b/core/src/net/sf/openrocket/motor/ThrustCurveMotorPlaceholder.java deleted file mode 100644 index fd173d5d6..000000000 --- a/core/src/net/sf/openrocket/motor/ThrustCurveMotorPlaceholder.java +++ /dev/null @@ -1,239 +0,0 @@ -package net.sf.openrocket.motor; - -import net.sf.openrocket.util.BugException; - -public class ThrustCurveMotorPlaceholder implements Motor { - - private final Motor.Type type; - private final String manufacturer; - private final String designation; - private final double diameter; - private final double length; - private final String digest; - private final double delay; - private final double launchMass; - private final double emptyMass; - - - public ThrustCurveMotorPlaceholder(Type type, String manufacturer, String designation, double diameter, double length, - String digest, double delay, double launchMass, double emptyMass) { - this.type = type; - this.manufacturer = manufacturer; - this.designation = designation; - this.diameter = diameter; - this.length = length; - this.digest = digest; - this.delay = delay; - this.launchMass = launchMass; - this.emptyMass = emptyMass; - } - - - @Override - public Type getMotorType() { - return type; - } - - public String getManufacturer() { - return manufacturer; - } - - @Override - public String getDesignation() { - return designation; - } - - @Override - public String getDesignation(double designationDelay) { - return designation + "-" + ThrustCurveMotor.getDelayString(designationDelay); - } - - @Override - public String getDescription() { - return ""; - } - - @Override - public double getDiameter() { - return diameter; - } - - @Override - public double getLength() { - return length; - } - - @Override - public String getDigest() { - return digest; - } - - public double getDelay() { - return delay; - } - - @Override - public Motor clone() { - throw new BugException("Called getInstance on PlaceholderMotor"); - } - - @Override - public double getBurnTimeEstimate() { - return Double.NaN; - } - - @Override - public double getAverageThrustEstimate() { - return Double.NaN; - } - - @Override - public double getMaxThrustEstimate() { - return Double.NaN; - } - - @Override - public double getTotalImpulseEstimate() { - return Double.NaN; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - long temp; - temp = Double.doubleToLongBits(delay); - result = prime * result + (int) (temp ^ (temp >>> 32)); - result = prime * result - + ((designation == null) ? 0 : designation.hashCode()); - temp = Double.doubleToLongBits(diameter); - result = prime * result + (int) (temp ^ (temp >>> 32)); - result = prime * result + ((digest == null) ? 0 : digest.hashCode()); - temp = Double.doubleToLongBits(emptyMass); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(launchMass); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(length); - result = prime * result + (int) (temp ^ (temp >>> 32)); - result = prime * result - + ((manufacturer == null) ? 0 : manufacturer.hashCode()); - result = prime * result + ((type == null) ? 0 : type.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - ThrustCurveMotorPlaceholder other = (ThrustCurveMotorPlaceholder) obj; - if (Double.doubleToLongBits(delay) != Double - .doubleToLongBits(other.delay)) - return false; - if (designation == null) { - if (other.designation != null) - return false; - } else if (!designation.equals(other.designation)) - return false; - if (Double.doubleToLongBits(diameter) != Double - .doubleToLongBits(other.diameter)) - return false; - if (digest == null) { - if (other.digest != null) - return false; - } else if (!digest.equals(other.digest)) - return false; - if (Double.doubleToLongBits(emptyMass) != Double - .doubleToLongBits(other.emptyMass)) - return false; - if (Double.doubleToLongBits(launchMass) != Double - .doubleToLongBits(other.launchMass)) - return false; - if (Double.doubleToLongBits(length) != Double - .doubleToLongBits(other.length)) - return false; - if (manufacturer == null) { - if (other.manufacturer != null) - return false; - } else if (!manufacturer.equals(other.manufacturer)) - return false; - if (type != other.type) - return false; - return true; - } - - - @Override - public String toString() { - return "ThrustCurveMotorPlaceholder [manufacturer=" + manufacturer - + ", designation=" + designation + "]"; - } - - @Override - public double getLaunchCGx() { - return length / 2; - } - - @Override - public double getBurnoutCGx() { - return length / 2; - } - - @Override - public double getLaunchMass() { - return launchMass; - } - - @Override - public double getBurnoutMass() { - return emptyMass; - } - - @Override - public double getThrust(double pseudoIndex) { - return 0; - } - - @Override - public double getAverageThrust(double startTime, double endTime) { - return 0; - } - - @Override - public double getTotalMass(final double motorTime) { - return 0; - } - - @Override - public double getPropellantMass( final Double motorTime){ - return 0.; - } - - @Override - public double getCMx(double pseudoIndex) { - return 0; - } - - @Override - public double getBurnTime() { - return 0; - } - - @Override - public double getUnitIxx() { - return 0.; - } - - @Override - public double getUnitIyy() { - return 0.; - } - - @Override - public double getUnitIzz(){ - return 0.; - } -}