updated plugin due to structure changes

This commit is contained in:
fros4943 2007-01-09 09:19:23 +00:00
parent ae088432fe
commit a0f581c7a4

View file

@ -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) {