X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fsimulation%2FFlightDataType.java;h=eb8a8d90da6e1c82b8ac28b9f441e29d717cc8aa;hb=dc2aa2b0bd1e22f097fc38038baedf345e834e2e;hp=9a7df76420029953393c65401126f9c56b9a2d55;hpb=65eedea8e0080d564e5bfd84b35ae70bdfd4f65b;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/simulation/FlightDataType.java b/core/src/net/sf/openrocket/simulation/FlightDataType.java index 9a7df764..eb8a8d90 100644 --- a/core/src/net/sf/openrocket/simulation/FlightDataType.java +++ b/core/src/net/sf/openrocket/simulation/FlightDataType.java @@ -37,7 +37,7 @@ public class FlightDataType implements Comparable { //// Vertical position and motion //// Altitude - public static final FlightDataType TYPE_ALTITUDE = newType(trans.get("FlightDataType.TYPE_ALTITUDE"), "a", UnitGroup.UNITS_DISTANCE, 10); + public static final FlightDataType TYPE_ALTITUDE = newType(trans.get("FlightDataType.TYPE_ALTITUDE"), "h", UnitGroup.UNITS_DISTANCE, 10); //// Vertical velocity public static final FlightDataType TYPE_VELOCITY_Z = newType(trans.get("FlightDataType.TYPE_VELOCITY_Z"), "Vz", UnitGroup.UNITS_VELOCITY, 11); //// Vertical acceleration @@ -180,6 +180,7 @@ public class FlightDataType implements Comparable { // An array of all the built in types public static final FlightDataType[] ALL_TYPES = { + TYPE_TIME, TYPE_ALTITUDE , TYPE_VELOCITY_Z , TYPE_ACCELERATION_Z, @@ -243,7 +244,15 @@ public class FlightDataType implements Comparable { * @return a data type. */ public static synchronized FlightDataType getType(String s, String symbol, UnitGroup u) { + // modified to include the unit FlightDataType type = EXISTING_TYPES.get(s.toLowerCase(Locale.ENGLISH)); + + // added this for backward compatibility. Will update type if symbol undefined + //if (type != null && type.getSymbol() != symbol){ + // EXISTING_TYPES.remove(type); + // type = null; + //} + if (type != null) { return type; } @@ -264,7 +273,7 @@ public class FlightDataType implements Comparable { private final String name; private final String symbol; private final UnitGroup units; - private final int priority; + private int priority; private final int hashCode; @@ -281,7 +290,9 @@ public class FlightDataType implements Comparable { } - + public void setPriority(int p){ + this.priority = p; + } public String getName() { return name; @@ -297,7 +308,7 @@ public class FlightDataType implements Comparable { @Override public String toString() { - return name; + return name; //+" ("+symbol+") "+units.getDefaultUnit().toString(); } @Override