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()) + "'");
}
/* Check dependencies: Contiki Test Editor */
boolean hasTestEditor = false;
for (Plugin startedPlugin : gui.getStartedPlugins()) {
if (startedPlugin instanceof ScriptRunner) {
hasTestEditor = true;
break;
/* Check dependencies: Contiki Control Plugin */
boolean hasController = false;
for (Plugin startedPlugin : gui.startedPlugins) {
int pluginType = startedPlugin.getClass().getAnnotation(PluginType.class).value();
if (pluginType == PluginType.SIM_CONTROL_PLUGIN) {
hasController = true;
}
}
logger.info("Checking that Contiki Test Editor exists: " + hasTestEditor);
if (!hasTestEditor) {
logger.info("Checking that Contiki Control Plugin exists: " + hasController);
if (!hasController) {
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."
);
}