Refactor the Query & Download thread and progress management out of TCQueryActivity...
[debian/openrocket] / core / src / net / sf / openrocket / file / openrocket / OpenRocketLoader.java
index 518f1e44c6c080eecb07cc5f6da3d7def56d6088..f8d6bed5e3f315af7a51fd90821bae0f6b24c09f 100644 (file)
@@ -1002,11 +1002,14 @@ class MotorHandler extends ElementHandler {
                
                // No motors
                if (motors.size() == 0) {
-                       String str = "No motor with designation '" + designation + "'";
-                       if (manufacturer != null)
-                               str += " for manufacturer '" + manufacturer + "'";
-                       str += " found.";
-                       warnings.add(str);
+                       Warning.MissingMotor mmw = new Warning.MissingMotor();
+                       mmw.setDesignation(designation);
+                       mmw.setDigest(digest);
+                       mmw.setDiameter(diameter);
+                       mmw.setLength(length);
+                       mmw.setManufacturer(manufacturer);
+                       mmw.setType(type);
+                       warnings.add(mmw);
                        return null;
                }
                
@@ -1517,6 +1520,8 @@ class FlightDataHandler extends ElementHandler {
                        double timeToApogee = Double.NaN;
                        double flightTime = Double.NaN;
                        double groundHitVelocity = Double.NaN;
+                       double launchRodVelocity = Double.NaN;
+                       double deploymentVelocity = Double.NaN;
                        
                        try {
                                maxAltitude = DocumentConfig.stringToDouble(attributes.get("maxaltitude"));
@@ -1547,10 +1552,17 @@ class FlightDataHandler extends ElementHandler {
                                                DocumentConfig.stringToDouble(attributes.get("groundhitvelocity"));
                        } catch (NumberFormatException ignore) {
                        }
+                       try {
+                               launchRodVelocity = DocumentConfig.stringToDouble(attributes.get("launchrodvelocity"));
+                       } catch (NumberFormatException ignore) {
+                       }
+                       try {
+                               deploymentVelocity = DocumentConfig.stringToDouble(attributes.get("deploymentvelocity"));
+                       } catch (NumberFormatException ignore) {
+                       }
                        
-                       // TODO: HIGH: Store and load launchRodVelocity
                        data = new FlightData(maxAltitude, maxVelocity, maxAcceleration, maxMach,
-                                       timeToApogee, flightTime, groundHitVelocity, Double.NaN);
+                                       timeToApogee, flightTime, groundHitVelocity, launchRodVelocity, deploymentVelocity);
                }
                
                data.getWarningSet().addAll(warningSet);