public class SensorMasterModuleQueued extends cz.cuni.amis.pogamut.base.agent.module.SensorModule<USAR2004Bot>
| Modifier and Type | Field and Description |
|---|---|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.SensorMasterModuleQueued.SensorMessageListener |
sensorListener |
protected SensorsContainerQueued |
sensorModules |
protected static SensorMasterModuleQueued |
singleton |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp() |
protected SuperSensor |
createNewSensor(SensorMessage message)
Asks SensorType enum if it knows SensorType represented by string
type.
|
protected void |
fileMessage(SensorMessage message)
Updates previous State on genuine Sensor or creates a new Record.
|
static SensorMasterModuleQueued |
getModuleInstance(USAR2004Bot bot)
Method for obtaining the singleton.
|
List<MessageDescriptor> |
getNonEmptyDescripton()
For each type of sensor it adds all individuals to the returnee List as a
couple (Type, Name)
|
SuperSensor |
getSensorByTypeName(String type,
String name)
Gets sensor message representatives from local hashmap specified by type
and by name.
|
List<SuperSensor> |
getSensorsByClass(Class c)
Adds every object that can be casted to initial class to the output list.
|
List<SuperSensor> |
getSensorsBySensorType(SensorType type)
Iterates through local hashmap values and seeks match.
|
List<SuperSensor> |
getSensorsByType(String type)
Gets sensor message representatives from local hashmap.
|
Boolean |
isReady()
Collection of sensor data check.
|
boolean |
isSensorReady(SensorType type)
Returns value based on the sensor module element count.
|
protected boolean |
updateSensorCollection(SensorMessage message)
Returns a flag that indicates if sensorUpdate was successful.
|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.SensorMasterModuleQueued.SensorMessageListener sensorListener
protected static SensorMasterModuleQueued singleton
protected SensorsContainerQueued sensorModules
public static SensorMasterModuleQueued getModuleInstance(USAR2004Bot bot)
bot - USAR2004Bot parameter for creation of the singleton instance
when called for the first time.public Boolean isReady()
public List<SuperSensor> getSensorsByType(String type)
type - String representing the type of sensor to return.public List<SuperSensor> getSensorsBySensorType(SensorType type)
type - SensorType representing the type of sensor to return.public boolean isSensorReady(SensorType type)
type - SensorType representing the type of sensor.public List<SuperSensor> getSensorsByClass(Class c)
c - Class representing the type of which the return list should bepublic SuperSensor getSensorByTypeName(String type, String name)
type - String representing the type of sensor to return.name - String representing the name of sensor to return.public List<MessageDescriptor> getNonEmptyDescripton()
protected SuperSensor createNewSensor(SensorMessage message)
type - String representing possible valid SensorType.protected boolean updateSensorCollection(SensorMessage message)
message - new SensorMessage object.protected void fileMessage(SensorMessage message)
message - This ought to be SensorMessage caught by listener.protected void cleanUp()
cleanUp in class cz.cuni.amis.pogamut.base.agent.module.AgentModule<USAR2004Bot>Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.