Merge pull request #1205 from JoePfeiffer/fix-1174
Make motor database search more robust, especially when loading files
This commit is contained in:
commit
930881dae6
@ -45,8 +45,8 @@ public class ThrustCurveMotorSetDatabase implements MotorDatabase {
|
||||
else if (manufacturer != null && !m.getManufacturer().matches(manufacturer))
|
||||
matchDescription = false;
|
||||
else if (designation != null &&
|
||||
!designation.equalsIgnoreCase(m.getDesignation()) &&
|
||||
!designation.equalsIgnoreCase(m.getCommonName()))
|
||||
!m.getDesignation().toUpperCase().contains(designation.toUpperCase()) &&
|
||||
!designation.toUpperCase().contains(m.getCommonName().toUpperCase()))
|
||||
matchDescription = false;
|
||||
else if (!Double.isNaN(diameter) && (Math.abs(diameter - m.getDiameter()) > 0.005))
|
||||
matchDescription = false;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package net.sf.openrocket.file.openrocket.importt;
|
||||
|
||||
import java.lang.Double;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
@ -42,7 +44,7 @@ class MotorHandler extends AbstractElementHandler {
|
||||
* Return the motor to use, or null.
|
||||
*/
|
||||
public Motor getMotor(WarningSet warnings) {
|
||||
return context.getMotorFinder().findMotor(type, manufacturer, designation, diameter, length, digest, warnings);
|
||||
return context.getMotorFinder().findMotor(type, manufacturer, designation, Double.NaN, Double.NaN, digest, warnings);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user