Rework the CustomExpression evaluation to use SimulationListeners. Removed the OpenR...
[debian/openrocket] / core / src / net / sf / openrocket / simulation / BasicEventSimulationEngine.java
index b0139fbbd35f684bc20f2384b4c84b27bdc23e0b..139fb6883b69c7d21b54b8f0f505e2c04479a5ca 100644 (file)
@@ -18,6 +18,7 @@ import net.sf.openrocket.rocketcomponent.MotorMount;
 import net.sf.openrocket.rocketcomponent.RecoveryDevice;
 import net.sf.openrocket.rocketcomponent.RocketComponent;
 import net.sf.openrocket.rocketcomponent.Stage;
+import net.sf.openrocket.simulation.customexpression.CustomExpression;
 import net.sf.openrocket.simulation.exception.MotorIgnitionException;
 import net.sf.openrocket.simulation.exception.SimulationException;
 import net.sf.openrocket.simulation.exception.SimulationLaunchException;
@@ -89,12 +90,6 @@ public class BasicEventSimulationEngine implements SimulationEngine {
                                }
                                SimulationListenerHelper.firePostStep(status);
                                
-                               // Calculate values for custom expressions
-                               FlightDataBranch data = status.getFlightData();
-                               ArrayList<CustomExpression> allExpressions = status.getSimulationConditions().getSimulation().getCustomExpressions();
-                               for (CustomExpression expression : allExpressions ) {
-                                       data.setValue(expression.getType(), expression.evaluate(status));
-                               }
                                
                                // Check for NaN values in the simulation status
                                checkNaN();