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))
|
else if (manufacturer != null && !m.getManufacturer().matches(manufacturer))
|
||||||
matchDescription = false;
|
matchDescription = false;
|
||||||
else if (designation != null &&
|
else if (designation != null &&
|
||||||
!designation.equalsIgnoreCase(m.getDesignation()) &&
|
!m.getDesignation().toUpperCase().contains(designation.toUpperCase()) &&
|
||||||
!designation.equalsIgnoreCase(m.getCommonName()))
|
!designation.toUpperCase().contains(m.getCommonName().toUpperCase()))
|
||||||
matchDescription = false;
|
matchDescription = false;
|
||||||
else if (!Double.isNaN(diameter) && (Math.abs(diameter - m.getDiameter()) > 0.005))
|
else if (!Double.isNaN(diameter) && (Math.abs(diameter - m.getDiameter()) > 0.005))
|
||||||
matchDescription = false;
|
matchDescription = false;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package net.sf.openrocket.file.openrocket.importt;
|
package net.sf.openrocket.file.openrocket.importt;
|
||||||
|
|
||||||
|
import java.lang.Double;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@ -42,7 +44,7 @@ class MotorHandler extends AbstractElementHandler {
|
|||||||
* Return the motor to use, or null.
|
* Return the motor to use, or null.
|
||||||
*/
|
*/
|
||||||
public Motor getMotor(WarningSet warnings) {
|
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