diff --git a/android/.classpath b/android/.classpath index 1772b2eff..4620a5b3e 100644 --- a/android/.classpath +++ b/android/.classpath @@ -2,11 +2,11 @@ - + - + diff --git a/android/libs/exp4j-rdg.jar b/android/libs/exp4j-rdg.jar new file mode 100644 index 000000000..8a980164b Binary files /dev/null and b/android/libs/exp4j-rdg.jar differ diff --git a/android/src/net/sf/openrocket/android/simservice/SimulationService.java b/android/src/net/sf/openrocket/android/simservice/SimulationService.java index d241cb68a..9a1dd4911 100644 --- a/android/src/net/sf/openrocket/android/simservice/SimulationService.java +++ b/android/src/net/sf/openrocket/android/simservice/SimulationService.java @@ -1,10 +1,15 @@ package net.sf.openrocket.android.simservice; +import java.util.List; + import net.sf.openrocket.R; import net.sf.openrocket.android.CurrentRocketHolder; import net.sf.openrocket.android.util.AndroidLogWrapper; import net.sf.openrocket.document.Simulation; +import net.sf.openrocket.simulation.customexpression.CustomExpression; +import net.sf.openrocket.simulation.customexpression.CustomExpressionSimulationListener; import net.sf.openrocket.simulation.exception.SimulationException; +import net.sf.openrocket.simulation.listeners.SimulationListener; import android.app.IntentService; import android.app.Notification; import android.app.PendingIntent; @@ -39,8 +44,12 @@ public class SimulationService extends IntentService { SimulationTask t = (SimulationTask) intent.getSerializableExtra("net.sf.openrocket.simulationtask"); try { Simulation sim = CurrentRocketHolder.getCurrentRocket().getRocketDocument().getSimulation(t.simulationId); + + List exprs = CurrentRocketHolder.getCurrentRocket().getRocketDocument().getCustomExpressions(); + SimulationListener exprListener = new CustomExpressionSimulationListener(exprs); + AndroidLogWrapper.d(SimulationService.class, "simulating " + t.simulationId ); - sim.simulate(); + sim.simulate(exprListener); CurrentRocketHolder.getCurrentRocket().unlockSimulation(this, t.simulationId); } catch (SimulationException simex) {