The only way I found to get the exp4j classes to be built and included in the apk...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Thu, 9 Aug 2012 15:55:13 +0000 (15:55 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Thu, 9 Aug 2012 15:55:13 +0000 (15:55 +0000)
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

android/.classpath
android/libs/exp4j-rdg.jar [new file with mode: 0644]
android/src/net/sf/openrocket/android/simservice/SimulationService.java

index 1772b2eff66f1cdac194dd3b9ecf20bff7d6cb90..4620a5b3ea2dde3faed3c659c6f807723eac081e 100644 (file)
@@ -2,11 +2,11 @@
 <classpath>\r
        <classpathentry kind="src" path="gen"/>\r
        <classpathentry excluding="**/.svn/**/*" including="l10n/**/*" kind="src" path="core-resources"/>\r
-       <classpathentry excluding="**/.svn/**/*|net/sf/openrocket/file/CSVExport.java|net/sf/openrocket/file/motor/MotorLoaderHelper.java|net/sf/openrocket/file/rocksim/export/|net/sf/openrocket/gui/|net/sf/openrocket/plugin/|net/sf/openrocket/preset/loader/|net/sf/openrocket/preset/xml/|net/sf/openrocket/startup/ConcurrentComponentPresetDatabaseLoader.java|net/sf/openrocket/startup/ConcurrentLoadingThrustCurveMotorSetDatabase.java|net/sf/openrocket/startup/Startup.java|net/sf/openrocket/startup/Startup2.java|net/sf/openrocket/startup/VersionHelper.java|net/sf/openrocket/utils/|net/sf/openrocket/startup/OSXStartup.java" kind="src" path="core"/>\r
+       <classpathentry excluding="**/.svn/**/*|net/sf/openrocket/file/CSVExport.java|net/sf/openrocket/file/motor/MotorLoaderHelper.java|net/sf/openrocket/file/rocksim/export/|net/sf/openrocket/gui/|net/sf/openrocket/plugin/|net/sf/openrocket/preset/loader/|net/sf/openrocket/preset/xml/|net/sf/openrocket/startup/ConcurrentComponentPresetDatabaseLoader.java|net/sf/openrocket/startup/ConcurrentLoadingThrustCurveMotorSetDatabase.java|net/sf/openrocket/startup/OSXStartup.java|net/sf/openrocket/startup/Startup.java|net/sf/openrocket/startup/Startup2.java|net/sf/openrocket/startup/VersionHelper.java|net/sf/openrocket/util/ExpressionParser.java|net/sf/openrocket/utils/" kind="src" path="core"/>\r
        <classpathentry kind="src" path="src"/>\r
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>\r
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>\r
        <classpathentry kind="lib" path="libs/android-support-v4.jar"/>\r
-       <classpathentry kind="lib" path="/OpenRocket/lib/exp4j-0.2.9.jar"/>\r
+       <classpathentry kind="lib" path="libs/exp4j-rdg.jar"/>\r
        <classpathentry kind="output" path="bin/classes"/>\r
 </classpath>\r
diff --git a/android/libs/exp4j-rdg.jar b/android/libs/exp4j-rdg.jar
new file mode 100644 (file)
index 0000000..8a98016
Binary files /dev/null and b/android/libs/exp4j-rdg.jar differ
index d241cb68a3f85200baf8059c9faef95e2d1ee53f..9a1dd49116a3e08960e81a433537ef7cb5144bf9 100644 (file)
@@ -1,10 +1,15 @@
 package net.sf.openrocket.android.simservice;\r
 \r
+import java.util.List;\r
+\r
 import net.sf.openrocket.R;\r
 import net.sf.openrocket.android.CurrentRocketHolder;\r
 import net.sf.openrocket.android.util.AndroidLogWrapper;\r
 import net.sf.openrocket.document.Simulation;\r
+import net.sf.openrocket.simulation.customexpression.CustomExpression;\r
+import net.sf.openrocket.simulation.customexpression.CustomExpressionSimulationListener;\r
 import net.sf.openrocket.simulation.exception.SimulationException;\r
+import net.sf.openrocket.simulation.listeners.SimulationListener;\r
 import android.app.IntentService;\r
 import android.app.Notification;\r
 import android.app.PendingIntent;\r
@@ -39,8 +44,12 @@ public class SimulationService extends IntentService {
                SimulationTask t = (SimulationTask) intent.getSerializableExtra("net.sf.openrocket.simulationtask");\r
                try {\r
                        Simulation sim = CurrentRocketHolder.getCurrentRocket().getRocketDocument().getSimulation(t.simulationId);\r
+\r
+                       List<CustomExpression> exprs = CurrentRocketHolder.getCurrentRocket().getRocketDocument().getCustomExpressions();\r
+                       SimulationListener exprListener = new CustomExpressionSimulationListener(exprs);\r
+\r
                        AndroidLogWrapper.d(SimulationService.class, "simulating " + t.simulationId );\r
-                       sim.simulate();\r
+                       sim.simulate(exprListener);\r
                        CurrentRocketHolder.getCurrentRocket().unlockSimulation(this, t.simulationId);\r
                }\r
                catch (SimulationException simex) {\r