create changelog entry
[debian/openrocket] / android / src / net / sf / openrocket / android / thrustcurve / TCMissingMotorDownloadAction.java
index ce580e9589fe7256d1f925637495a49cb42fe89b..aafaf1bd5b326662682d10e35cb1fe5ee34ce624 100644 (file)
@@ -1,10 +1,12 @@
 package net.sf.openrocket.android.thrustcurve;\r
 \r
+import java.util.List;\r
 import java.util.Set;\r
 import java.util.regex.Matcher;\r
 import java.util.regex.Pattern;\r
 \r
 import net.sf.openrocket.android.util.AndroidLogWrapper;\r
+import net.sf.openrocket.motor.ThrustCurveMotor;\r
 import net.sf.openrocket.motor.ThrustCurveMotorPlaceholder;\r
 \r
 public class TCMissingMotorDownloadAction extends TCQueryAction {\r
@@ -48,7 +50,7 @@ public class TCMissingMotorDownloadAction extends TCQueryAction {
 \r
                                handler.post( new UpdateMessage("Looking for " + motor.getManufacturer() + " " + motor.getDesignation()));\r
 \r
-                               SearchResponse res = new ThrustCurveAPI().doSearch(request);\r
+                               SearchResponse res = ThrustCurveAPI.doSearch(request);\r
 \r
                                int total = res.getResults().size();\r
                                int count = 1;\r
@@ -72,9 +74,10 @@ public class TCMissingMotorDownloadAction extends TCQueryAction {
 \r
                                        AndroidLogWrapper.d(TCQueryAction.class, mi.toString());\r
 \r
-                                       MotorBurnFile b = new ThrustCurveAPI().downloadData(mi.getMotor_id());\r
+                                       List<MotorBurnFile> listOfMotors = ThrustCurveAPI.downloadData(mi.getMotor_id());\r
 \r
-                                       writeMotor( mi, b);\r
+                                       ThrustCurveMotor bestMatch = ThrustCurveAPI.findBestMatch(motor, listOfMotors);\r
+                                       writeMotor( mi, bestMatch);\r
 \r
                                }\r
                        }\r