updated plugin due to structure changes
This commit is contained in:
parent
ae088432fe
commit
a0f581c7a4
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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.*;
|
import java.awt.event.*;
|
||||||
|
@ -54,20 +54,22 @@ import se.sics.cooja.contikimote.ContikiMoteType;
|
||||||
* @author Fredrik Osterlind
|
* @author Fredrik Osterlind
|
||||||
*/
|
*/
|
||||||
@ClassDescription("Debug using GDB")
|
@ClassDescription("Debug using GDB")
|
||||||
@VisPluginType(VisPluginType.MOTE_PLUGIN)
|
@PluginType(PluginType.MOTE_PLUGIN)
|
||||||
public class MoteDebugger extends VisPlugin {;
|
public class MoteDebugger extends VisPlugin {;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private static Logger logger = Logger.getLogger(MoteDebugger.class);
|
private static Logger logger = Logger.getLogger(MoteDebugger.class);
|
||||||
private ContikiMote moteToDebug;
|
private ContikiMote moteToDebug;
|
||||||
|
private Simulation mySimulation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new VisDebug.
|
* Creates a new VisDebug.
|
||||||
* @param mote Contiki mote to debug next tick
|
* @param mote Contiki mote to debug next tick
|
||||||
*/
|
*/
|
||||||
public MoteDebugger(Mote mote) {
|
public MoteDebugger(Mote mote, Simulation simulation, GUI gui) {
|
||||||
super("VisDebug (" + mote + ")");
|
super("VisDebug (" + mote + ")", gui);
|
||||||
this.moteToDebug = (ContikiMote) mote;
|
this.moteToDebug = (ContikiMote) mote;
|
||||||
|
this.mySimulation = simulation;
|
||||||
|
|
||||||
JButton debugButton = new JButton("Debug now");
|
JButton debugButton = new JButton("Debug now");
|
||||||
debugButton.addActionListener(new ActionListener() {
|
debugButton.addActionListener(new ActionListener() {
|
||||||
|
@ -149,7 +151,7 @@ public class MoteDebugger extends VisPlugin {;
|
||||||
Thread.sleep(2500);
|
Thread.sleep(2500);
|
||||||
logger.info("Ticking chosen mote now! (setting state to active)");
|
logger.info("Ticking chosen mote now! (setting state to active)");
|
||||||
moteToDebug.setState(Mote.State.ACTIVE);
|
moteToDebug.setState(Mote.State.ACTIVE);
|
||||||
moteToDebug.tick(GUI.currentSimulation.getSimulationTime());
|
moteToDebug.tick(mySimulation.getSimulationTime());
|
||||||
|
|
||||||
gdbProcess.waitFor();
|
gdbProcess.waitFor();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
Loading…
Reference in a new issue