- Implemented a DampingMoment simulation listener example
[debian/openrocket] / core / src / net / sf / openrocket / simulation / customexpression / IndexExpression.java
index ab7e1572cb32c379e9118d773a3ec4b6d9d8886b..6fb084de4154f18ab2b66436acf8334c497bf137 100644 (file)
@@ -23,7 +23,6 @@ public class IndexExpression extends CustomExpression {
                setExpression(indexText);
                this.setName("");
                this.setSymbol(typeText);
-               
        }
        
        @Override
@@ -35,7 +34,10 @@ public class IndexExpression extends CustomExpression {
                }
                
                // From the given datatype, get the time and function values and make an interpolator
-               FlightDataType type = getType();
+
+               //Note: must get in a way that flight data system will figure out units. Otherwise there will be a type conflict when we get the new data.
+               FlightDataType type = FlightDataType.getType(null, getSymbol(), null);  
+                               
                List<Double> data = status.getFlightData().get(type);
                List<Double> time = status.getFlightData().get(FlightDataType.TYPE_TIME);
                LinearInterpolator interp = new LinearInterpolator(time, data);