Skip to content

Commit

Permalink
renamed getGUI() method to getCooja(), to better reflect its purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
fros4943 committed Nov 20, 2013
1 parent 6255371 commit 2a92838
Show file tree
Hide file tree
Showing 33 changed files with 130 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public boolean setConfigXML(Simulation simulation, Collection<Element> configXML
if (name.equals("motetype_identifier")) {
/* Ignored: handled by simulation */
} else if (name.equals("interface_config")) {
Class<? extends MoteInterface> moteInterfaceClass = simulation.getGUI().tryLoadClass(
Class<? extends MoteInterface> moteInterfaceClass = simulation.getCooja().tryLoadClass(
this, MoteInterface.class, element.getText().trim());

if (moteInterfaceClass == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public Collection<Element> getConfigXML(Simulation simulation) {
// Source file
if (fileSource != null) {
element = new Element("source");
File file = simulation.getGUI().createPortablePath(fileSource);
File file = simulation.getCooja().createPortablePath(fileSource);
element.setText(file.getPath().replaceAll("\\\\", "/"));
config.add(element);
element = new Element("commands");
Expand All @@ -251,7 +251,7 @@ public Collection<Element> getConfigXML(Simulation simulation) {

// Firmware file
element = new Element("firmware");
File file = simulation.getGUI().createPortablePath(fileFirmware);
File file = simulation.getCooja().createPortablePath(fileFirmware);
element.setText(file.getPath().replaceAll("\\\\", "/"));
config.add(element);

Expand Down Expand Up @@ -280,20 +280,20 @@ public boolean setConfigXML(Simulation simulation,
} else if (name.equals("source")) {
fileSource = new File(element.getText());
if (!fileSource.exists()) {
fileSource = simulation.getGUI().restorePortablePath(fileSource);
fileSource = simulation.getCooja().restorePortablePath(fileSource);
}
} else if (name.equals("commands")) {
compileCommands = element.getText();
} else if (name.equals("firmware")) {
fileFirmware = new File(element.getText());
if (!fileFirmware.exists()) {
fileFirmware = simulation.getGUI().restorePortablePath(fileFirmware);
fileFirmware = simulation.getCooja().restorePortablePath(fileFirmware);
}
} else if (name.equals("moteinterface")) {
String intfClass = element.getText().trim();

Class<? extends MoteInterface> moteInterfaceClass =
simulation.getGUI().tryLoadClass(this, MoteInterface.class, intfClass);
simulation.getCooja().tryLoadClass(this, MoteInterface.class, intfClass);

if (moteInterfaceClass == null) {
logger.warn("Can't find mote interface class: " + intfClass);
Expand Down
8 changes: 4 additions & 4 deletions tools/cooja/apps/mrm/java/se/sics/mrm/MRM.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ public void update(Observable o, Object arg) {
});

/* Register plugins */
sim.getGUI().registerPlugin(AreaViewer.class);
sim.getGUI().registerPlugin(FormulaViewer.class);
sim.getCooja().registerPlugin(AreaViewer.class);
sim.getCooja().registerPlugin(FormulaViewer.class);
Visualizer.registerVisualizerSkin(MRMVisualizerSkin.class);
}

public void removed() {
super.removed();

/* Unregister plugins */
sim.getGUI().unregisterPlugin(AreaViewer.class);
sim.getGUI().unregisterPlugin(FormulaViewer.class);
sim.getCooja().unregisterPlugin(AreaViewer.class);
sim.getCooja().unregisterPlugin(FormulaViewer.class);
Visualizer.unregisterVisualizerSkin(MRMVisualizerSkin.class);

currentChannelModel.deleteSettingsObserver(channelModelObserver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public boolean setConfigXML(Simulation simulation, Collection<Element> configXML
if (intfClass.equals("se.sics.cooja.mspmote.interfaces.SkySerial")) {
intfClass = MspSerial.class.getName();
}
Class<? extends MoteInterface> moteInterfaceClass = simulation.getGUI().tryLoadClass(
Class<? extends MoteInterface> moteInterfaceClass = simulation.getCooja().tryLoadClass(
this, MoteInterface.class, intfClass);

if (moteInterfaceClass == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public Collection<Element> getConfigXML(Simulation simulation) {
// Source file
if (fileSource != null) {
element = new Element("source");
File file = simulation.getGUI().createPortablePath(fileSource);
File file = simulation.getCooja().createPortablePath(fileSource);
element.setText(file.getPath().replaceAll("\\\\", "/"));
element.setAttribute("EXPORT", "discard");
config.add(element);
Expand All @@ -214,7 +214,7 @@ public Collection<Element> getConfigXML(Simulation simulation) {

// Firmware file
element = new Element("firmware");
File file = simulation.getGUI().createPortablePath(fileFirmware);
File file = simulation.getCooja().createPortablePath(fileFirmware);
element.setText(file.getPath().replaceAll("\\\\", "/"));
element.setAttribute("EXPORT", "copy");
config.add(element);
Expand Down Expand Up @@ -244,7 +244,7 @@ public boolean setConfigXML(Simulation simulation,
} else if (name.equals("source")) {
fileSource = new File(element.getText());
if (!fileSource.exists()) {
fileSource = simulation.getGUI().restorePortablePath(fileSource);
fileSource = simulation.getCooja().restorePortablePath(fileSource);
}
} else if (name.equals("command")) {
/* Backwards compatibility: command is now commands */
Expand All @@ -255,7 +255,7 @@ public boolean setConfigXML(Simulation simulation,
} else if (name.equals("firmware")) {
fileFirmware = new File(element.getText());
if (!fileFirmware.exists()) {
fileFirmware = simulation.getGUI().restorePortablePath(fileFirmware);
fileFirmware = simulation.getCooja().restorePortablePath(fileFirmware);
}
} else if (name.equals("elf")) {
/* Backwards compatibility: elf is now firmware */
Expand Down Expand Up @@ -283,7 +283,7 @@ public boolean setConfigXML(Simulation simulation,
}

Class<? extends MoteInterface> moteInterfaceClass =
simulation.getGUI().tryLoadClass(this, MoteInterface.class, intfClass);
simulation.getCooja().tryLoadClass(this, MoteInterface.class, intfClass);

if (moteInterfaceClass == null) {
logger.warn("Can't find mote interface class: " + intfClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public Collection<Element> getConfigXML() {
config.add(element);

element = new Element("codefile");
File file = mspMote.getSimulation().getGUI().createPortablePath(codeFile);
File file = mspMote.getSimulation().getCooja().createPortablePath(codeFile);
element.setText(file.getPath().replaceAll("\\\\", "/"));
config.add(element);

Expand Down Expand Up @@ -204,7 +204,7 @@ public boolean setConfigXML(Collection<Element> configXML, boolean visAvailable)
for (Element element : configXML) {
if (element.getName().equals("codefile")) {
File file = new File(element.getText());
file = mspMote.getSimulation().getGUI().restorePortablePath(file);
file = mspMote.getSimulation().getCooja().restorePortablePath(file);

try {
codeFile = file.getCanonicalFile();
Expand Down
6 changes: 3 additions & 3 deletions tools/cooja/config/scripts/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ while (counter<10) {
YIELD_THEN_WAIT_UNTIL(msg.equals("wait"));

/* Toggle Log Listener filter */
plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.LogListener");
plugin = mote.getSimulation().getCooja().getStartedPlugin("se.sics.cooja.plugins.LogListener");
if (plugin != null) {
plugins++;
log.log("LogListener: Setting filter: " + plugin.getFilter() + "\n");
Expand All @@ -39,7 +39,7 @@ while (counter<10) {
YIELD_THEN_WAIT_UNTIL(msg.equals("wait"));

/* Extract PowerTracker statistics */
plugin = mote.getSimulation().getGUI().getStartedPlugin("PowerTracker");
plugin = mote.getSimulation().getCooja().getStartedPlugin("PowerTracker");
if (plugin != null) {
plugins++;
stats = plugin.radioStatistics();
Expand All @@ -56,7 +56,7 @@ while (counter<10) {
YIELD_THEN_WAIT_UNTIL(msg.equals("wait"));

/* Select time in Radio Logger */
plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.RadioLogger");
plugin = mote.getSimulation().getCooja().getStartedPlugin("se.sics.cooja.plugins.RadioLogger");
if (plugin != null) {
plugins++;
log.log("RadioLogger: Showing logged radio packet at mid simulation\n");
Expand Down
Loading

0 comments on commit 2a92838

Please sign in to comment.