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.
This commit is contained in:
Kevin Ruland 2012-08-09 15:55:13 +00:00
parent cb2a3d0e90
commit 65074713cc
3 changed files with 12 additions and 3 deletions

View File

@ -2,11 +2,11 @@
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry excluding="**/.svn/**/*" including="l10n/**/*" kind="src" path="core-resources"/>
<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"/>
<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"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
<classpathentry kind="lib" path="/OpenRocket/lib/exp4j-0.2.9.jar"/>
<classpathentry kind="lib" path="libs/exp4j-rdg.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

BIN
android/libs/exp4j-rdg.jar Normal file

Binary file not shown.

View File

@ -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<CustomExpression> 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) {