Added the control plugin behaviour to executeJAR

This commit is contained in:
Andreas Löscher 2014-11-07 11:45:38 +01:00
parent 4dcc3ba7fa
commit 0e729592f3

View file

@ -230,18 +230,18 @@ public class ExecuteJAR {
logger.info("Checking mote types: '" + Cooja.getDescriptionOf(t.getClass()) + "'"); logger.info("Checking mote types: '" + Cooja.getDescriptionOf(t.getClass()) + "'");
} }
/* Check dependencies: Contiki Test Editor */ /* Check dependencies: Contiki Control Plugin */
boolean hasTestEditor = false; boolean hasController = false;
for (Plugin startedPlugin : gui.getStartedPlugins()) { for (Plugin startedPlugin : gui.startedPlugins) {
if (startedPlugin instanceof ScriptRunner) { int pluginType = startedPlugin.getClass().getAnnotation(PluginType.class).value();
hasTestEditor = true; if (pluginType == PluginType.SIM_CONTROL_PLUGIN) {
break; hasController = true;
} }
} }
logger.info("Checking that Contiki Test Editor exists: " + hasTestEditor); logger.info("Checking that Contiki Control Plugin exists: " + hasController);
if (!hasTestEditor) { if (!hasController) {
throw new RuntimeException( throw new RuntimeException(
"The simulation needs at least one active Contiki Test Editor plugin.\n" + "The simulation needs at least one active control plugin.\n" +
"The plugin is needed to control the non-visualized simulation." "The plugin is needed to control the non-visualized simulation."
); );
} }