From 123a7081f2ec9355bac9d9d913d0544980e673ab Mon Sep 17 00:00:00 2001 From: Sebastian Schinabeck Date: Wed, 13 Nov 2013 17:05:29 +0100 Subject: [PATCH 1/2] start DGRM plugin with cooja_default.config start the DGRMconfigurator within the cooja_default.config instead of starting in DirectedGraphMedium.java --- tools/cooja/config/cooja_default.config | 3 ++- .../contikios/cooja/radiomediums/DirectedGraphMedium.java | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/cooja/config/cooja_default.config b/tools/cooja/config/cooja_default.config index f8d9ded5d..7af837fcc 100644 --- a/tools/cooja/config/cooja_default.config +++ b/tools/cooja/config/cooja_default.config @@ -3,6 +3,7 @@ org.contikios.cooja.contikimote.interfaces.ContikiRadio.RADIO_TRANSMISSION_RATE_ org.contikios.cooja.contikimote.ContikiMoteType.MOTE_INTERFACES = org.contikios.cooja.interfaces.Position org.contikios.cooja.interfaces.Battery org.contikios.cooja.contikimote.interfaces.ContikiVib org.contikios.cooja.contikimote.interfaces.ContikiMoteID org.contikios.cooja.contikimote.interfaces.ContikiRS232 org.contikios.cooja.contikimote.interfaces.ContikiBeeper org.contikios.cooja.interfaces.RimeAddress org.contikios.cooja.contikimote.interfaces.ContikiIPAddress org.contikios.cooja.contikimote.interfaces.ContikiRadio org.contikios.cooja.contikimote.interfaces.ContikiButton org.contikios.cooja.contikimote.interfaces.ContikiPIR org.contikios.cooja.contikimote.interfaces.ContikiClock org.contikios.cooja.contikimote.interfaces.ContikiLED org.contikios.cooja.contikimote.interfaces.ContikiCFS org.contikios.cooja.interfaces.Mote2MoteRelations org.contikios.cooja.interfaces.MoteAttributes org.contikios.cooja.contikimote.ContikiMoteType.C_SOURCES = org.contikios.cooja.Cooja.MOTETYPES = org.contikios.cooja.motes.ImportAppMoteType org.contikios.cooja.motes.DisturberMoteType org.contikios.cooja.contikimote.ContikiMoteType -org.contikios.cooja.Cooja.PLUGINS = org.contikios.cooja.plugins.Visualizer org.contikios.cooja.plugins.LogListener org.contikios.cooja.plugins.TimeLine org.contikios.cooja.plugins.MoteInformation org.contikios.cooja.plugins.MoteInterfaceViewer org.contikios.cooja.plugins.VariableWatcher org.contikios.cooja.plugins.EventListener org.contikios.cooja.plugins.RadioLogger org.contikios.cooja.plugins.ScriptRunner org.contikios.cooja.plugins.Notes org.contikios.cooja.plugins.BufferListener +org.contikios.cooja.Cooja.PLUGINS = org.contikios.cooja.plugins.Visualizer org.contikios.cooja.plugins.LogListener org.contikios.cooja.plugins.TimeLine org.contikios.cooja.plugins.MoteInformation org.contikios.cooja.plugins.MoteInterfaceViewer org.contikios.cooja.plugins.VariableWatcher org.contikios.cooja.plugins.EventListener org.contikios.cooja.plugins.RadioLogger org.contikios.cooja.plugins.ScriptRunner org.contikios.cooja.plugins.Notes org.contikios.cooja.plugins.BufferListener org.contikios.cooja.plugins.DGRMConfigurator org.contikios.cooja.Cooja.POSITIONERS = org.contikios.cooja.positioners.RandomPositioner org.contikios.cooja.positioners.LinearPositioner org.contikios.cooja.positioners.EllipsePositioner org.contikios.cooja.positioners.ManualPositioner org.contikios.cooja.Cooja.RADIOMEDIUMS = org.contikios.cooja.radiomediums.UDGM org.contikios.cooja.radiomediums.UDGMConstantLoss org.contikios.cooja.radiomediums.DirectedGraphMedium org.contikios.cooja.radiomediums.SilentRadioMedium + diff --git a/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java b/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java index 61f31d9d4..825d6bbf3 100644 --- a/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java +++ b/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java @@ -45,7 +45,6 @@ import org.contikios.cooja.Mote; import org.contikios.cooja.RadioConnection; import org.contikios.cooja.Simulation; import org.contikios.cooja.interfaces.Radio; -import org.contikios.cooja.plugins.DGRMConfigurator; import org.contikios.cooja.plugins.Visualizer; import org.contikios.cooja.plugins.skins.DGRMVisualizerSkin; @@ -87,16 +86,14 @@ public class DirectedGraphMedium extends AbstractRadioMedium { requestEdgeAnalysis(); - /* Register plugin and visualizer skin */ - simulation.getCooja().registerPlugin(DGRMConfigurator.class); + /* Register visualizer skin */ Visualizer.registerVisualizerSkin(DGRMVisualizerSkin.class); } public void removed() { super.removed(); - /* Unregister plugin and visualizer skin */ - simulation.getCooja().unregisterPlugin(DGRMConfigurator.class); + /* Unregister visualizer skin */ Visualizer.unregisterVisualizerSkin(DGRMVisualizerSkin.class); } From 1ef80859ea4782c2d2103d83db83a5f3b3220d35 Mon Sep 17 00:00:00 2001 From: Sebastian Schinabeck Date: Tue, 19 Nov 2013 13:12:28 +0100 Subject: [PATCH 2/2] start DGRMVisualizerSkin in cooja_default.config now instead of starting in DirectedGraphMedium --- tools/cooja/config/cooja_default.config | 1 + .../contikios/cooja/radiomediums/DirectedGraphMedium.java | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/tools/cooja/config/cooja_default.config b/tools/cooja/config/cooja_default.config index 7af837fcc..b28337631 100644 --- a/tools/cooja/config/cooja_default.config +++ b/tools/cooja/config/cooja_default.config @@ -6,4 +6,5 @@ org.contikios.cooja.Cooja.MOTETYPES = org.contikios.cooja.motes.ImportAppMoteTyp org.contikios.cooja.Cooja.PLUGINS = org.contikios.cooja.plugins.Visualizer org.contikios.cooja.plugins.LogListener org.contikios.cooja.plugins.TimeLine org.contikios.cooja.plugins.MoteInformation org.contikios.cooja.plugins.MoteInterfaceViewer org.contikios.cooja.plugins.VariableWatcher org.contikios.cooja.plugins.EventListener org.contikios.cooja.plugins.RadioLogger org.contikios.cooja.plugins.ScriptRunner org.contikios.cooja.plugins.Notes org.contikios.cooja.plugins.BufferListener org.contikios.cooja.plugins.DGRMConfigurator org.contikios.cooja.Cooja.POSITIONERS = org.contikios.cooja.positioners.RandomPositioner org.contikios.cooja.positioners.LinearPositioner org.contikios.cooja.positioners.EllipsePositioner org.contikios.cooja.positioners.ManualPositioner org.contikios.cooja.Cooja.RADIOMEDIUMS = org.contikios.cooja.radiomediums.UDGM org.contikios.cooja.radiomediums.UDGMConstantLoss org.contikios.cooja.radiomediums.DirectedGraphMedium org.contikios.cooja.radiomediums.SilentRadioMedium +org.contikios.cooja.plugins.Visualizer.SKINS = org.contikios.cooja.plugins.skins.DGRMVisualizerSkin diff --git a/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java b/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java index 825d6bbf3..c9bac3f0d 100644 --- a/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java +++ b/tools/cooja/java/org/contikios/cooja/radiomediums/DirectedGraphMedium.java @@ -46,7 +46,6 @@ import org.contikios.cooja.RadioConnection; import org.contikios.cooja.Simulation; import org.contikios.cooja.interfaces.Radio; import org.contikios.cooja.plugins.Visualizer; -import org.contikios.cooja.plugins.skins.DGRMVisualizerSkin; /** * Directed Graph Radio Medium. @@ -76,7 +75,6 @@ public class DirectedGraphMedium extends AbstractRadioMedium { public DirectedGraphMedium() { /* Do not initialize radio medium: use only for hash table */ super(null); - Visualizer.registerVisualizerSkin(DGRMVisualizerSkin.class); } public DirectedGraphMedium(Simulation simulation) { @@ -85,16 +83,10 @@ public class DirectedGraphMedium extends AbstractRadioMedium { random = simulation.getRandomGenerator(); requestEdgeAnalysis(); - - /* Register visualizer skin */ - Visualizer.registerVisualizerSkin(DGRMVisualizerSkin.class); } public void removed() { super.removed(); - - /* Unregister visualizer skin */ - Visualizer.unregisterVisualizerSkin(DGRMVisualizerSkin.class); } public void addEdge(Edge e) {