From a0f581c7a487711249bf1533966cea709c786db5 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 9 Jan 2007 09:19:23 +0000 Subject: [PATCH] updated plugin due to structure changes --- .../userplatform_debug/java/MoteDebugger.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/cooja/examples/userplatform_debug/java/MoteDebugger.java b/tools/cooja/examples/userplatform_debug/java/MoteDebugger.java index f15d78f84..d0da7df12 100644 --- a/tools/cooja/examples/userplatform_debug/java/MoteDebugger.java +++ b/tools/cooja/examples/userplatform_debug/java/MoteDebugger.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: MoteDebugger.java,v 1.3 2006/10/05 11:53:13 fros4943 Exp $ + * $Id: MoteDebugger.java,v 1.4 2007/01/09 09:19:23 fros4943 Exp $ */ import java.awt.event.*; @@ -54,20 +54,22 @@ import se.sics.cooja.contikimote.ContikiMoteType; * @author Fredrik Osterlind */ @ClassDescription("Debug using GDB") -@VisPluginType(VisPluginType.MOTE_PLUGIN) +@PluginType(PluginType.MOTE_PLUGIN) public class MoteDebugger extends VisPlugin {; private static final long serialVersionUID = 1L; private static Logger logger = Logger.getLogger(MoteDebugger.class); private ContikiMote moteToDebug; + private Simulation mySimulation; /** * Creates a new VisDebug. * @param mote Contiki mote to debug next tick */ - public MoteDebugger(Mote mote) { - super("VisDebug (" + mote + ")"); + public MoteDebugger(Mote mote, Simulation simulation, GUI gui) { + super("VisDebug (" + mote + ")", gui); this.moteToDebug = (ContikiMote) mote; + this.mySimulation = simulation; JButton debugButton = new JButton("Debug now"); debugButton.addActionListener(new ActionListener() { @@ -149,7 +151,7 @@ public class MoteDebugger extends VisPlugin {; Thread.sleep(2500); logger.info("Ticking chosen mote now! (setting state to active)"); moteToDebug.setState(Mote.State.ACTIVE); - moteToDebug.tick(GUI.currentSimulation.getSimulationTime()); + moteToDebug.tick(mySimulation.getSimulationTime()); gdbProcess.waitFor(); } catch (Exception ex) {