From: kruland2607 Date: Thu, 9 Aug 2012 15:55:13 +0000 (+0000) Subject: The only way I found to get the exp4j classes to be built and included in the apk... X-Git-Tag: upstream/12.09^2~61 X-Git-Url: https://git.gag.com/?p=debian%2Fopenrocket;a=commitdiff_plain;h=57380227f8f49f0e8076f99607b5fda8ba2d4121 The only way I found to get the exp4j classes to be built and included in the apk was to have it reside in the libs directory. Unfortunately this means it is committed twice in the repository now. Added the CustomExpressionSimulationListener to the simulation in SimulationService. Excluded OSXStartup from the build. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@963 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/android/.classpath b/android/.classpath index 1772b2ef..4620a5b3 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 00000000..8a980164 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 d241cb68..9a1dd491 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) {