From 823abf9d943a94e0fe36af04292faa4140096a00 Mon Sep 17 00:00:00 2001 From: Jens Dede Date: Sat, 26 Apr 2014 16:00:23 +0200 Subject: [PATCH] Fix exported simulation: add jsyntaxpane JAR, start simulation with maximum speed --- .../java/org/contikios/cooja/util/ExecuteJAR.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/org/contikios/cooja/util/ExecuteJAR.java b/tools/cooja/java/org/contikios/cooja/util/ExecuteJAR.java index 46dabf38d..9ba6bd01a 100644 --- a/tools/cooja/java/org/contikios/cooja/util/ExecuteJAR.java +++ b/tools/cooja/java/org/contikios/cooja/util/ExecuteJAR.java @@ -187,7 +187,15 @@ public class ExecuteJAR { logger.info("Starting simulation"); Cooja.setLookAndFeel(); - Cooja.quickStartSimulationConfig(new File(executeDir, SIMCONFIG_FILENAME), false, null); + Simulation sim = Cooja.quickStartSimulationConfig(new File(executeDir, SIMCONFIG_FILENAME), false, null); + if (sim != null){ + /* Set simulation speed to maximum and start simulation */ + sim.setSpeedLimit(null); + sim.startSimulation(); + } else { + logger.fatal("Cannot load simulation, aborting"); + System.exit(1); + } } /** @@ -284,7 +292,8 @@ public class ExecuteJAR { /* Unpacking COOJA core JARs */ String[] coreJARs = new String[] { - "tools/cooja/lib/jdom.jar", "tools/cooja/lib/log4j.jar", "tools/cooja/dist/cooja.jar" + "tools/cooja/lib/jdom.jar", "tools/cooja/lib/log4j.jar", + "tools/cooja/dist/cooja.jar", "tools/cooja/lib/jsyntaxpane.jar" }; for (String jar: coreJARs) { File jarFile = new File(Cooja.getExternalToolsSetting("PATH_CONTIKI"), jar);