VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtSpotReportGeneratorController Class Reference

DtSpotReportGeneratorController is a controller that sends spot reports based on the contact list in the entity state repository. More...

Inheritance diagram for DtSpotReportGeneratorController:
Inheritance graph
[legend]

List of all members.

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 DtSimComponentcreator (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 DtSpotReportcreateSpotReportForContact (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.
DtSpotReportGeneratorControllerPSRmyProcessState
 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.

DtObjectTypesListOutputPortmyTypesToDetectOutputPort
 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.
DtSpotReportGeneratorControlleroperator= (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.

Detailed Description

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


Constructor & Destructor Documentation

Not Implemented.

Not Implemented.

DtSpotReportGeneratorController::DtSpotReportGeneratorController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
)

(const DtString&,DtVrfObject*,DtSimManager*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Destructor.


Member Function Documentation

DtSpotReportGeneratorController& DtSpotReportGeneratorController::operator= ( const DtSpotReportGeneratorController orig) [private]

Not Implemented.

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.

Returns:
DtSpotReportGeneratorControllerType

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]

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().

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*,

Parameters:
nameReader writer name of this component.
ownerThe DtVrfObject that owns this component
simManagerThe simulation manager (provides access to terrain, message interface, simulation clock).
descThe component descriptor used to initialize this component.
parentRegistryPointer to the parent reader writer registry (the containing object that reads/writes this object).
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)

Returns:
New instance of this class.
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.

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.

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.

Parameters:
superiorOnlyIf 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]
Returns:
true if the spot report (which was previously sent) needs to be updated and resent. Default implementation checks the report time against the resend period in the descriptor. Override this method if you need spot reports resent on "significant changes" to the contacted entity, or something similar.
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.

Returns:
DtSpotReportTypeString
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.


Member Data Documentation

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:

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).

Flag which gets set to true when hostilities changed, and cleared the following tick.

Holds a copy of the global spot reports enabled setting.

When the global value changes, this value will be updated by


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)