|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsidnet.core.misc.Node
public class Node
Field Summary | |
---|---|
NodesList |
neighboursList
list of neighbours. |
long |
packetReceivedCount
|
long |
packetSentCount
|
Constructor Summary | |
---|---|
Node(int id,
EnergyManagement energyManagement,
PanelContext hostingPanelContext,
LocationContext fieldContext,
ColorProfile colorCode,
SimManager simControl)
Creates a new instance of Node |
Method Summary | |
---|---|
void |
addQuery(Query query)
Adds a query to the query list. |
void |
addSensor(Sensor sensor)
|
void |
appendTerminalText(java.lang.String s)
Appends the supplied string to the console associated with the Terminal of the calling node |
void |
enableRelocation(Field field)
|
CallbackInterface |
getAppCallback()
|
double |
getEffectiveCoverage_ft()
|
EnergyManagement |
getEnergyManagement()
|
GPS |
getGPS()
|
int |
getID()
Gets the unique ID that has been associated with the node. |
NetAddress |
getIP()
Get the IP address of the node |
Location2D |
getLocation2D()
Get the geographical location of the sensor node in real metric units, not in screen coordinates |
LocationContext |
getLocationContext()
Returns the LocationContext in which the getLocation2D returns the measurements |
NCS_Location2D |
getNCS_Location2D()
Returns the location of this node as an NCS (Normalized Coordinate System) |
NodeGUIimpl |
getNodeGUI()
Gets the handle over the NodeGUIimpl which contains functions related to GUI |
java.util.List<Query> |
getQueryList()
Returns the list of queries that have been posted by the client through this node. |
Sensor |
getSensor(int sensorIndex)
|
SimControl |
getSimControl()
Return the SimControl handle |
byte |
getType()
Get the TYPE of a node |
boolean |
isFaulty()
|
void |
malfunctioned()
|
double |
readAnalogSensorData(int sensorIndex)
Reads sensor data |
void |
setAppCallback(CallbackInterface appCallback)
|
void |
setGPS(GPS gps)
|
void |
setIP(NetAddress ip)
|
void |
setLocation2D(Location2D fieldLocation)
|
void |
setQueryList(java.util.LinkedList<Query> terminalQueryList)
Not member of NodeAPI |
void |
setType(byte type)
Set the TYPE of a node |
void |
updateLocation2D(Location2D fieldLocation)
Should be called at runtime if node placement changes programmatically Will not work if the node relocation is not enabled (aka, the nodeGUI.field is null |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public long packetReceivedCount
public long packetSentCount
public NodesList neighboursList
Constructor Detail |
---|
public Node(int id, EnergyManagement energyManagement, PanelContext hostingPanelContext, LocationContext fieldContext, ColorProfile colorCode, SimManager simControl)
Method Detail |
---|
public java.util.List<Query> getQueryList()
NodeAPI
getQueryList
in interface NodeAPI
public void addQuery(Query query)
NodeAPI
addQuery
in interface NodeAPI
public void setQueryList(java.util.LinkedList<Query> terminalQueryList)
public int getID()
NodeAPI
getID
in interface NodeAPI
public NetAddress getIP()
getIP
in interface NodeAPI
getIP
in interface NodeHardwareInterface
public void setType(byte type)
setType
in interface NodeAPI
short
- type The type, as a short, numerical value, to identify a node's type in a heterogeneous networkpublic byte getType()
getType
in interface NodeAPI
public void enableRelocation(Field field)
public SimControl getSimControl()
NodeAPI
getSimControl
in interface NodeAPI
public Location2D getLocation2D()
NodeAPI
getLocation2D
in interface NodeAPI
public NCS_Location2D getNCS_Location2D()
NodeAPI
getNCS_Location2D
in interface NodeAPI
public LocationContext getLocationContext()
NodeAPI
getLocationContext
in interface NodeAPI
public void malfunctioned()
public boolean isFaulty()
public double readAnalogSensorData(int sensorIndex)
NodeAPI
readAnalogSensorData
in interface NodeAPI
sensorIndex
- indexes through the registered sensors, in case a node has more than one sensing capabilities. Otherwise, set to 0public void appendTerminalText(java.lang.String s)
NodeAPI
appendTerminalText
in interface NodeAPI
public NodeGUIimpl getNodeGUI()
NodeAPI
getNodeGUI
in interface NodeAPI
public void setIP(NetAddress ip)
setIP
in interface NodeHardwareInterface
public EnergyManagement getEnergyManagement()
getEnergyManagement
in interface NodeAPI
getEnergyManagement
in interface NodeHardwareInterface
public void setGPS(GPS gps)
setGPS
in interface NodeHardwareInterface
public GPS getGPS()
getGPS
in interface NodeHardwareInterface
public void addSensor(Sensor sensor)
addSensor
in interface NodeHardwareInterface
public Sensor getSensor(int sensorIndex)
getSensor
in interface NodeHardwareInterface
public void setAppCallback(CallbackInterface appCallback)
setAppCallback
in interface NodeAPI
public CallbackInterface getAppCallback()
getAppCallback
in interface NodeAPI
public void updateLocation2D(Location2D fieldLocation)
public void setLocation2D(Location2D fieldLocation)
public double getEffectiveCoverage_ft()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |