Merge pull request #663 from jdede/fix-cooja-export

Fix exported simulation: add jsyntaxpane JAR, start simulation
This commit is contained in:
Fredrik Österlind 2014-04-27 10:13:10 +02:00
commit e35575f81e

View file

@ -187,7 +187,15 @@ public class ExecuteJAR {
logger.info("Starting simulation"); logger.info("Starting simulation");
Cooja.setLookAndFeel(); 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 */ /* Unpacking COOJA core JARs */
String[] coreJARs = new String[] { 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) { for (String jar: coreJARs) {
File jarFile = new File(Cooja.getExternalToolsSetting("PATH_CONTIKI"), jar); File jarFile = new File(Cooja.getExternalToolsSetting("PATH_CONTIKI"), jar);