|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
cz.cuni.amis.pogamut.base.agent.module.SensorModule<USAR2004Bot>
cz.cuni.amis.pogamut.usar2004.agent.module.master.SensorMasterModule
public class SensorMasterModule
Master module for gathering every sensor message server sends. They are saved respectively by their type and than name. There is a listener for SEN messages that updates data in SensorContainer. Note that this is equvalent with SensorsContainerQueued. The difference is that the non queued version throws out records as soon as new comes along. It writes them over. This is needed when we do not care about precision - when we want to know what is happening right now!
| Field Summary | |
|---|---|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.SensorMasterModule.SensorMessageListener |
sensorListener
|
protected SensorsContainer |
sensorModules
|
protected static SensorMasterModule |
singleton
|
| Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule |
|---|
worldView |
| Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
|---|
agent, controller, eventBus, log |
| Constructor Summary | |
|---|---|
SensorMasterModule(USAR2004Bot bot)
Private ctor |
|
| Method Summary | |
|---|---|
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 SensorMasterModule |
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)
Iterates through local hashmap values and seeks match. |
protected boolean |
updateSensorCollection(SensorMessage message)
Returns a flag that indicates if sensorUpdate was successful. |
| Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
|---|
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected cz.cuni.amis.pogamut.usar2004.agent.module.master.SensorMasterModule.SensorMessageListener sensorListener
protected static SensorMasterModule singleton
protected SensorsContainer sensorModules
| Constructor Detail |
|---|
public SensorMasterModule(USAR2004Bot bot)
bot - USAR2004Bot variable for creating instance of each new record
in sensorModules(due to inheritance)| Method Detail |
|---|
public static SensorMasterModule 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 to return.
public List<SuperSensor> getSensorsByClass(Class c)
c - Class representing the type of which the return list should be
public 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>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||