device
Class Simulation

java.lang.Object
  extended by device.Device
      extended by device.RobotDevice
          extended by device.Simulation
All Implemented Interfaces:
IDevice, java.lang.Runnable

public class Simulation
extends RobotDevice

Stage Gui to draw online robot(s) position


Field Summary
(package private) static Simulation instance
           
(package private)  java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Boolean> isDirtyList
           
(package private)  java.util.concurrent.ConcurrentHashMap<java.lang.String,Position> objList
          Objects of interest in the simulation
 
Fields inherited from class device.RobotDevice
device, deviceNode, logger
 
Fields inherited from class device.Device
deviceList, host, id, index, isRunning, isThreaded, port, sleeptime, thread
 
Fields inherited from interface device.external.IDevice
DEVICE_ACTARRAY_CODE, DEVICE_AIO_CODE, DEVICE_AUDIO_CODE, DEVICE_AUDIODSP_CODE, DEVICE_AUDIOMIXER_CODE, DEVICE_BLINKENLIGHT_CODE, DEVICE_BLOBFINDER_CODE, DEVICE_BUMPER_CODE, DEVICE_CAMERA_CODE, DEVICE_DEVICE_CODE, DEVICE_DIO_CODE, DEVICE_ENERGY_CODE, DEVICE_FIDUCIAL_CODE, DEVICE_GPS_CODE, DEVICE_GRAPHICS2D_CODE, DEVICE_GRAPHICS3D_CODE, DEVICE_GRIPPER_CODE, DEVICE_HEALTH_CODE, DEVICE_IMU_CODE, DEVICE_IR_CODE, DEVICE_JOYSTICK_CODE, DEVICE_LASER_CODE, DEVICE_LIMB_CODE, DEVICE_LOCALIZE_CODE, DEVICE_LOG_CODE, DEVICE_MAP_CODE, DEVICE_MCOM_CODE, DEVICE_NOMAD_CODE, DEVICE_NULL_CODE, DEVICE_OPAQUE_CODE, DEVICE_PLANNER_CODE, DEVICE_POINTCLOUD3D_CODE, DEVICE_POSITION1D_CODE, DEVICE_POSITION2D_CODE, DEVICE_POSITION3D_CODE, DEVICE_POWER_CODE, DEVICE_PTZ_CODE, DEVICE_RANGER_CODE, DEVICE_RFID_CODE, DEVICE_SERVICE_ADV_CODE, DEVICE_SIMULATION_CODE, DEVICE_SONAR_CODE, DEVICE_SOUND_CODE, DEVICE_SPEECH_CODE, DEVICE_SPEECH_RECOGNITION_CODE, DEVICE_TRUTH_CODE, DEVICE_WAVEFORM_CODE, DEVICE_WIFI_CODE, DEVICE_WSN_CODE
 
Constructor Summary
protected Simulation()
           
protected Simulation(DeviceNode roboClient, Device device)
           
 
Method Summary
static Simulation getInstance()
          Returns null if no Gui instance is instantiated.
static Simulation getInstance(DeviceNode roboClient, Device device)
          Returns a Singleton instance of the Gui
 int getIsDirtyListCount()
           
 int getObjListCount()
           
 Position getPositionOf(java.lang.String key)
          Returns the last known object Position.
 void initPositionOf(java.lang.String key)
           
 void setPositionOf(java.lang.String key, Position value)
          Set a Gui object's position.
 void shutdown()
          Shutdown Gui and clean up
 void sync()
           
protected  void update()
          Might be to be implemented by subclass to do something
 
Methods inherited from class device.RobotDevice
getDevice, getDeviceNode, getLogger, toString
 
Methods inherited from class device.Device
equals, getDevice, getDeviceIterator, getDeviceList, getDeviceListArray, getHost, getId, getIndex, getPort, getSleepTime, getThreadName, isInList, isRunning, isSupported, isThreaded, matches, matchesList, run, runThreaded, setDeviceList, setHost, setName, setPort, setSleepTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

instance

static Simulation instance

objList

java.util.concurrent.ConcurrentHashMap<java.lang.String,Position> objList
Objects of interest in the simulation


isDirtyList

java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Boolean> isDirtyList
Constructor Detail

Simulation

protected Simulation()

Simulation

protected Simulation(DeviceNode roboClient,
                     Device device)
Method Detail

getInstance

public static Simulation getInstance(DeviceNode roboClient,
                                     Device device)
Returns a Singleton instance of the Gui

Parameters:
roboClient - The device node containing the simulation device.
device -
Returns:
The simulation instance.

getInstance

public static Simulation getInstance()
Returns null if no Gui instance is instantiated.

Returns:
null or Gui instance.

update

protected void update()
Description copied from class: Device
Might be to be implemented by subclass to do something

Overrides:
update in class Device

shutdown

public void shutdown()
Shutdown Gui and clean up

Specified by:
shutdown in interface IDevice
Overrides:
shutdown in class Device

setPositionOf

public void setPositionOf(java.lang.String key,
                          Position value)
Set a Gui object's position. The object will be either added or updated with respect to the internal data structure.

Parameters:
key - The Stage object id (usually set by the 'name' tag in the world file).
value - The new Position of that object.

getPositionOf

public Position getPositionOf(java.lang.String key)
Returns the last known object Position.

Parameters:
key - The Stage object id (usually set by the 'name' tag in the world file).
Returns:
Last known Position.

initPositionOf

public void initPositionOf(java.lang.String key)

getObjListCount

public int getObjListCount()

getIsDirtyListCount

public int getIsDirtyListCount()

sync

public void sync()