X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Ffile%2Fopenrocket%2FOpenRocketLoader.java;h=4c5eb72a0ebd7a9967e53600f0e278dbb43f7c37;hb=4ef2e330ffbabc05d31b604123545f7573153a63;hp=7719e0e2c4fbed9fe14d67430aea934464435426;hpb=601e76c57135056b8e0997019c49f3c695d61e45;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/file/openrocket/OpenRocketLoader.java b/src/net/sf/openrocket/file/openrocket/OpenRocketLoader.java index 7719e0e2..4c5eb72a 100644 --- a/src/net/sf/openrocket/file/openrocket/OpenRocketLoader.java +++ b/src/net/sf/openrocket/file/openrocket/OpenRocketLoader.java @@ -74,6 +74,7 @@ import net.sf.openrocket.startup.Application; import net.sf.openrocket.unit.UnitGroup; import net.sf.openrocket.util.BugException; import net.sf.openrocket.util.Coordinate; +import net.sf.openrocket.util.GeodeticComputationStrategy; import net.sf.openrocket.util.LineStyle; import net.sf.openrocket.util.Reflection; @@ -158,7 +159,7 @@ public class OpenRocketLoader extends RocketLoader { class DocumentConfig { /* Remember to update OpenRocketSaver as well! */ - public static final String[] SUPPORTED_VERSIONS = { "0.9", "1.0", "1.1", "1.2" }; + public static final String[] SUPPORTED_VERSIONS = { "0.9", "1.0", "1.1", "1.2", "1.3" }; //////// Component constructors @@ -1289,6 +1290,8 @@ class SimulationConditionsHandler extends ElementHandler { public SimulationConditionsHandler(Rocket rocket) { conditions = new SimulationOptions(rocket); + // Set up default loading settings (which may differ from the new defaults) + conditions.setGeodeticComputation(GeodeticComputationStrategy.NONE); } public SimulationOptions getConditions() { @@ -1364,6 +1367,20 @@ class SimulationConditionsHandler extends ElementHandler { } else { conditions.setLaunchLatitude(d); } + } else if (element.equals("launchlongitude")) { + if (Double.isNaN(d)) { + warnings.add("Illegal launch longitude."); + } else { + conditions.setLaunchLongitude(d); + } + } else if (element.equals("geodeticmethod")) { + GeodeticComputationStrategy gcs = + (GeodeticComputationStrategy) DocumentConfig.findEnum(content, GeodeticComputationStrategy.class); + if (gcs != null) { + conditions.setGeodeticComputation(gcs); + } else { + warnings.add("Unknown geodetic computation method '" + content + "'"); + } } else if (element.equals("atmosphere")) { atmosphereHandler.storeSettings(conditions, warnings); } else if (element.equals("timestep")) {