diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index eb10af152..13625787f 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -1882,19 +1882,30 @@ public class GUI extends Observable { } /** - * Returns started plugin with given class name, if any. + * Returns started plugin that ends with given class name, if any. * * @param classname Class name * @return Plugin instance */ - public Plugin getStartedPlugin(String classname) { + public Plugin getPlugin(String classname) { for (Plugin p: startedPlugins) { - if (p.getClass().getName().equals(classname)) { + if (p.getClass().getName().endsWith(classname)) { return p; } } return null; } + + /** + * Returns started plugin with given class name, if any. + * + * @param classname Class name + * @return Plugin instance + * @deprecated + */ + public Plugin getStartedPlugin(String classname) { + return getPlugin(classname); + } public Plugin[] getStartedPlugins() { return startedPlugins.toArray(new Plugin[0]); diff --git a/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java b/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java index 886b605fe..4482c2934 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java +++ b/tools/cooja/java/se/sics/cooja/plugins/LogScriptEngine.java @@ -434,6 +434,8 @@ public class LogScriptEngine { Hashtable hash = new Hashtable(); engine.put("global", hash); + engine.put("sim", simulation); + engine.put("gui", simulation.getGUI()); scriptMote = new ScriptMote(); engine.put("node", scriptMote);