![]() |
VR-Forces 4.0.4 Class Documentation
|
DtSpotReportGeneratorController is a controller that sends spot reports based on the contact list in the entity state repository. More...

Public Member Functions | |
| DtSpotReportGeneratorController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtSpotReportGeneratorController () |
| Destructor. | |
| virtual bool | init () |
| Init. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual void | tick () |
| This components simulation tick. | |
| virtual void | processSetSpotReporting (DtSimMessage *msg) |
| virtual void | setLocalEnabled (bool on) |
| When called, this controller will no longer send spot reports according to the global spot reports setting. | |
| virtual void | setGlobalEnabledOverridingLocal () |
| When called, this controller will use the global spot reports setting to determine if it should send spot reports. | |
Static Public Member Functions | |
| static void | setSpotReportingCallback (DtSimMessage *msg, void *usr) |
| Calls processSetSpotReporting(). | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual bool | createPorts () |
| Creates and initializes ports. | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual void | registerRadioMessageCallbacks () |
| Registers for setSpotReportingRequest messages from the local entity's radio. | |
| virtual void | generateAndSendSpotReports () |
| Walks the fusedSensorContacts list. | |
| virtual DtSpotReport * | createSpotReportForContact (const DtRwSensorContactInfo &contactInfo) |
| Creates a new spot report instance using the report type returned from spotReportTypeString(), and fills it in with data from the contact info. | |
| virtual void | updateSpotReportForContact (DtSpotReport &spotReport, const DtRwSensorContactInfo &contact) |
| Updates an existing spot report with data from a sensor contact. | |
| virtual void | sendSpotReport (DtSpotReport &spotReport, bool superiorOnly) |
| Uses the default radio on the entity to send the spot report. | |
| virtual bool | spotReportNeedsUpdateAndResend (const DtSpotReport &spotRep, const DtRwSensorContactInfo &contact) |
| virtual DtString | spotReportTypeString () const |
| Returns the type string that will be used in the DtSimReport factory to generate new instances of spot reports. | |
| virtual void | readGlobalEnabledSetting (const DtBoolSetting *enabledSetting) |
| If myProcessState::globalEnabledOverridingLocal() is true, the global state from the given settings object will be applied to this controller. | |
| virtual bool | reportingEnabled () const |
| Returns true if the sending of spot reports is enabled. | |
| virtual void | turnSpotReportingOn () |
| Performs the internal processing necessary to change the spot reporting enabled state. | |
| virtual void | turnSpotReportingOff () |
| Performs the internal processing necessary to change the spot reporting enabled state. | |
Static Protected Member Functions | |
| static void | settingConsumerCallback (const DtSettingsObject *settingsObject, void *usr) |
| This is the DtSettingsConsumerFcn registered with the DtVrfSimSettingsManager to get updates when the global spot reports enabled setting changes. | |
Protected Attributes | |
| const DtSpotReportGeneratorControllerDescriptor * | myDescriptor |
| Pointer to this components descriptor. | |
| DtSpotReportGeneratorControllerPSR * | myProcessState |
| Container for state data associated with this component. | |
| int | myCurrentForceType |
| DtSensorContactInfoListChangeMonitor | myContactListMonitor |
| bool | myHostilitiesChangeFlag |
| Flag which gets set to true when hostilities changed, and cleared the following tick. | |
| bool | myGlobalEnabled |
| Holds a copy of the global spot reports enabled setting. | |
Ports and Port Groups | |
Port I/O Interface: Inputs: DtSensorContactListMultiInputPort : detected-objects Outputs: DtObjectTypesListOutputPort() : object-types-to-spot-report. | |
| DtObjectTypesListOutputPort * | myTypesToDetectOutputPort |
| Output Port Name: object-types-to-spot-report Output Port Description: List of types of object the spot report controller should generate spot reports on. | |
Private Member Functions | |
| DtSpotReportGeneratorController () | |
| Not Implemented. | |
| DtSpotReportGeneratorController (const DtSpotReportGeneratorController &orig) | |
| Not Implemented. | |
| DtSpotReportGeneratorController & | operator= (const DtSpotReportGeneratorController &orig) |
| Not Implemented. | |
| virtual void | processHostilitiesChanged (DtU8 force) |
| Callback method invoked by the hostility manager when the hostilities between various forces have changed. | |
| static void | hostilitiesChangedCallback (DtU8 force, void *usr) |
| Callback method invoked by the hostility manager when the hostilities between various forces have changed. | |
DtSpotReportGeneratorController is a controller that sends spot reports based on the contact list in the entity state repository.
End User Description: This controller monitors the object contact list in the state repository, and sends spot reports to the network when new contacts are detected on the list. A spot report is sent for each sensor contact listed. Spot reports are resent on a periodic basis, based on a setting in the descriptor. Spot reports are sent to the local radio network using the default radio. The contents of a spot report are defined in the DtSpotReport class.
Spot reporting can be enabled and disabled though the DtSetSpotReportingRequest set data request.
Uses Descriptor Type: DtSpotReportGeneratorControllerDescriptor
Not Implemented.
| DtSpotReportGeneratorController::DtSpotReportGeneratorController | ( | const DtSpotReportGeneratorController & | orig | ) | [private] |
Not Implemented.
| DtSpotReportGeneratorController::DtSpotReportGeneratorController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtSpotReportGeneratorController::~DtSpotReportGeneratorController | ( | ) | [virtual] |
Destructor.
| DtSpotReportGeneratorController& DtSpotReportGeneratorController::operator= | ( | const DtSpotReportGeneratorController & | orig | ) | [private] |
Not Implemented.
| virtual bool DtSpotReportGeneratorController::init | ( | ) | [virtual] |
Init.
Call immediately after construction. If forwardSubordinateReports is true in the descriptor, calls registerSpotReportCallback().
Reimplemented from DtControllerComponent.
| virtual DtString DtSpotReportGeneratorController::type | ( | ) | const [virtual] |
Returns a string identifies the class type of component.
Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.
Reimplemented from DtControllerComponent.
| virtual void DtSpotReportGeneratorController::tick | ( | ) | [virtual] |
This components simulation tick.
If any connected sensor has provided new data since the last tick, fuseSensorContacts() and generateAndSendSpotReports() are called.
Reimplemented from DtSimComponent.
| static void DtSpotReportGeneratorController::setSpotReportingCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls processSetSpotReporting().
| virtual void DtSpotReportGeneratorController::processSetSpotReporting | ( | DtSimMessage * | msg | ) | [virtual] |
| virtual void DtSpotReportGeneratorController::setLocalEnabled | ( | bool | on | ) | [virtual] |
When called, this controller will no longer send spot reports according to the global spot reports setting.
It will use the local setting specified until setGlobalEnabledOverridingLocal().
| virtual void DtSpotReportGeneratorController::setGlobalEnabledOverridingLocal | ( | ) | [virtual] |
When called, this controller will use the global spot reports setting to determine if it should send spot reports.
If the global setting is already in use, this will have no effect. If the local setting is in use and it is different from the global setting, spot reports will be enabled or disabled to match the global setting. To change the enabled setting for this controller only, call setLocalEnabled.
| static DtSimComponent* DtSpotReportGeneratorController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual void DtSpotReportGeneratorController::turnSpotReportingOn | ( | ) | [protected, virtual] |
Performs the internal processing necessary to change the spot reporting enabled state.
To change the state from another class, setLocalEnabled or setGlobalEnabledOverridingLocal should be called.
| virtual void DtSpotReportGeneratorController::turnSpotReportingOff | ( | ) | [protected, virtual] |
Performs the internal processing necessary to change the spot reporting enabled state.
To change the state from another class, setLocalEnabled or setGlobalEnabledOverridingLocal should be called.
| virtual bool DtSpotReportGeneratorController::createPorts | ( | ) | [protected, virtual] |
Creates and initializes ports.
Reimplemented from DtSimComponent.
| virtual bool DtSpotReportGeneratorController::createPSR | ( | ) | [protected, virtual] |
Creates myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
| virtual void DtSpotReportGeneratorController::registerRadioMessageCallbacks | ( | ) | [protected, virtual] |
Registers for setSpotReportingRequest messages from the local entity's radio.
| virtual void DtSpotReportGeneratorController::generateAndSendSpotReports | ( | ) | [protected, virtual] |
Walks the fusedSensorContacts list.
Any contacts that are not in the past spot report list trigger a new spot report to be generated using createSpotReportForContact() and send using sendSpotReport(). Any contacts that are in both lists are checked by a call to spotReportNeedsUpdateAndResend. If returns true, then updateSpotReportForContact() is called and the updated report is sent with sendSpotReport(). Any contacts that have been removed from the fusedSensorContacts list since the last update have their corresponding spot reports removed from the spot report list.
| virtual DtSpotReport* DtSpotReportGeneratorController::createSpotReportForContact | ( | const DtRwSensorContactInfo & | contactInfo | ) | [protected, virtual] |
Creates a new spot report instance using the report type returned from spotReportTypeString(), and fills it in with data from the contact info.
Override this method to add custom data to a spot report.
| virtual void DtSpotReportGeneratorController::updateSpotReportForContact | ( | DtSpotReport & | spotReport, |
| const DtRwSensorContactInfo & | contact | ||
| ) | [protected, virtual] |
Updates an existing spot report with data from a sensor contact.
| virtual void DtSpotReportGeneratorController::sendSpotReport | ( | DtSpotReport & | spotReport, |
| bool | superiorOnly | ||
| ) | [protected, virtual] |
Uses the default radio on the entity to send the spot report.
| superiorOnly | If this is true, then the spot report is addressed directly to the entity's superior. Otherwise, it is broadcast to the local network. |
| virtual bool DtSpotReportGeneratorController::spotReportNeedsUpdateAndResend | ( | const DtSpotReport & | spotRep, |
| const DtRwSensorContactInfo & | contact | ||
| ) | [protected, virtual] |
| virtual DtString DtSpotReportGeneratorController::spotReportTypeString | ( | ) | const [protected, virtual] |
Returns the type string that will be used in the DtSimReport factory to generate new instances of spot reports.
If you wish to use a custom spot report, override this method to return the new type. In order for this component to work, the report created MUST be a subclass of DtSpotReport.
| static void DtSpotReportGeneratorController::settingConsumerCallback | ( | const DtSettingsObject * | settingsObject, |
| void * | usr | ||
| ) | [static, protected] |
This is the DtSettingsConsumerFcn registered with the DtVrfSimSettingsManager to get updates when the global spot reports enabled setting changes.
It calls readGlobalEnabledSetting.
| virtual void DtSpotReportGeneratorController::readGlobalEnabledSetting | ( | const DtBoolSetting * | enabledSetting | ) | [protected, virtual] |
If myProcessState::globalEnabledOverridingLocal() is true, the global state from the given settings object will be applied to this controller.
| static void DtSpotReportGeneratorController::hostilitiesChangedCallback | ( | DtU8 | force, |
| void * | usr | ||
| ) | [static, protected] |
Callback method invoked by the hostility manager when the hostilities between various forces have changed.
| virtual void DtSpotReportGeneratorController::processHostilitiesChanged | ( | DtU8 | force | ) | [protected, virtual] |
Callback method invoked by the hostility manager when the hostilities between various forces have changed.
| virtual bool DtSpotReportGeneratorController::reportingEnabled | ( | ) | const [protected, virtual] |
Returns true if the sending of spot reports is enabled.
If DtSpotReportGeneratorControllerPSR::globalEnabledOverridingLocal is true, myGlobalEnabled is returned and otherwise DtSpotReportGeneratorControllerPSR::localEnabled is returned.
Output Port Name: object-types-to-spot-report
Output Port Description: List of types of object the spot report controller should generate spot reports on.
Connects to the sensors.
Output Port Range:
Output Port Default Value:
Output Group Parent:
const DtSpotReportGeneratorControllerDescriptor* DtSpotReportGeneratorController::myDescriptor [protected] |
Pointer to this components descriptor.
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
int DtSpotReportGeneratorController::myCurrentForceType [protected] |
DtSensorContactInfoListChangeMonitor DtSpotReportGeneratorController::myContactListMonitor [protected] |
Flag which gets set to true when hostilities changed, and cleared the following tick.
bool DtSpotReportGeneratorController::myGlobalEnabled [protected] |
Holds a copy of the global spot reports enabled setting.
When the global value changes, this value will be updated by