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

DtDetonationController is used to detonate a bomb like munition. More...

Inheritance diagram for DtDetonationController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtDetonationController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtDetonationController ()
 destructor
virtual bool postAddComponentsInit ()
 Override to call lookupAndCacheProcessSR() (another component creates it - we just look it up and keep a pointer to it).
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Initialize the component.
virtual void tick ()
 Calculate new control values.
virtual bool createTriggerPort ()
 These are called in init to create the ports used to communicate with the actuator.
virtual DtBooleanOutputPorttriggerPort () const
virtual bool createQuantityOutputPort ()
virtual DtIntegerOutputPortquantityOutputPort () const
virtual void setDetonationTime (DtTime detTime)
virtual DtTime detonationTime () const
virtual void detonate ()
 Sets myTriggerPort to true and myLoaded to false.
virtual void beginSensing ()
 If the fuse is a proximity fuse we want to activate the objects to detect port to let the object's sensor know what to sense.
virtual bool tripped (const DtRwSensorContactInfo *potentialVictim)
 Checks to see if the sensor contact has come with in range of the detonator's proximity trigger.
virtual bool setMunitionToDetonate (DtSimMunition &munition)
 Finds the munition to use with this detonator from the entity's ammo resources.
virtual void processSetDetonation (DtSimMessage *msg)
virtual void processSetArmed (DtSimMessage *msg)
virtual void processSetRestore (DtSimMessage *msg)
virtual DtDetonatorFuze fuseStringToEnum (const DtString &fuseString)
 Given a string return the detonatorFuze enumeration that goes with it.
virtual DtString fuseStringToEnum (DtDetonatorFuze fuse)
 Given a detonatorFuze enumeration return the string that goes with it.

Static Public Member Functions

static void setDetonationCallback (DtSimMessage *msg, void *usrData)
 Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of detonation tasks.
static void setArmedCallback (DtSimMessage *msg, void *usr)
 Calls processSetArmed().
static void setRestoreCallback (DtSimMessage *msg, void *usrData)
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 ()
 Called by init to create the output ports.
virtual bool createTypesToDetectPort ()
virtual void lookupAndCacheProcessSR ()
 This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in

myProcessState.


virtual void registerRadioMessageCallbacks ()
 Registers for setArmedDataRequest and setDetonate messages from the local entity's radio.
 DtDetonationController ()
 Not implemented.
 DtDetonationController (const DtDetonationController &orig)
 Not implemented.
const DtDetonationControlleroperator= (const DtDetonationController &orig)
 Not implemented.

Protected Attributes

DtSimMunition myCurrentMunition
 The muntition and fuse to be used in the detonation.
DtDetonatorFuze myCurrentFuze
DtTime myDetonationTime
bool myAmArmed
double myDetonationProximity
DtWarheadDetonationActuatorPSRmyProcessState
 Pointer to a process state repository used to store state data associated with this component.
const
DtDetonationControllerDescriptor
myDetonationDescriptor
bool myFirstTick
Ports and Port Groups
DtSensorContactListMultiInputPortmyDetectedObjectsInputPort
 Input Port Name: detected-objects
Input Port Description: List of contacts that fall within our range.
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.
DtBooleanOutputPortmyTriggerPort
 Output Port Name: trigger
Output Port Description: Sends a new True value when trigger is pulled.
DtIntegerOutputPortmyQuantityOutputPort
 Output Port Name: quantity
Output Port Description: Sends the number of rounds to be fired with a single trigger pull.

Detailed Description

DtDetonationController is used to detonate a bomb like munition.

End User Description: The munition doesn't require any kind of loading. This controller checks if the munition is armed and if the fuse has been triggered. If these 2 conditions are met, it sets the trigger output port to true. It registers for detonationTasks which will be used to detonate the munition Uses Descriptor Type: DtDetonationControllerDescriptor


Constructor & Destructor Documentation

DtDetonationController::DtDetonationController ( 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

Not implemented.

Not implemented.


Member Function Documentation

Override to call lookupAndCacheProcessSR() (another component creates it - we just look it up and keep a pointer to it).

Also calls initProcessSR().

Reimplemented from DtSimComponent.

virtual DtString DtDetonationController::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:
DtDetonationControllerType

Implements DtTaskControllerComponent.

virtual bool DtDetonationController::init ( ) [virtual]

Initialize the component.

Calls registerRadioMessageCallbacks()

Reimplemented from DtControllerComponent.

virtual void DtDetonationController::tick ( ) [virtual]

Calculate new control values.

The first call to tick will restore the checkpointed values of myCurrentMunition and myCurrentFuze from the the munition loader of the DtVrfBalGunPSR.

Reimplemented from DtSimComponent.

These are called in init to create the ports used to communicate with the actuator.

virtual void DtDetonationController::setDetonationTime ( DtTime  detTime) [virtual]
virtual DtTime DtDetonationController::detonationTime ( ) const [virtual]
virtual void DtDetonationController::detonate ( ) [virtual]

Sets myTriggerPort to true and myLoaded to false.

It also looks up the resource named by myCurrentMunitionName and if found, calls DtIntegerResource::deplete().

virtual void DtDetonationController::beginSensing ( ) [virtual]

If the fuse is a proximity fuse we want to activate the objects to detect port to let the object's sensor know what to sense.

virtual bool DtDetonationController::tripped ( const DtRwSensorContactInfo potentialVictim) [virtual]

Checks to see if the sensor contact has come with in range of the detonator's proximity trigger.

Finds the munition to use with this detonator from the entity's ammo resources.

static void DtDetonationController::setDetonationCallback ( DtSimMessage msg,
void *  usrData 
) [static]

Instances of this component will register this callback with their own 'this' pointer as user data with the msg executive requesting notification of detonation tasks.

static void DtDetonationController::setArmedCallback ( DtSimMessage msg,
void *  usr 
) [static]
virtual void DtDetonationController::processSetArmed ( DtSimMessage msg) [virtual]
static void DtDetonationController::setRestoreCallback ( DtSimMessage msg,
void *  usrData 
) [static]
virtual void DtDetonationController::processSetRestore ( DtSimMessage msg) [virtual]
virtual DtDetonatorFuze DtDetonationController::fuseStringToEnum ( const DtString fuseString) [virtual]

Given a string return the detonatorFuze enumeration that goes with it.

virtual DtString DtDetonationController::fuseStringToEnum ( DtDetonatorFuze  fuse) [virtual]

Given a detonatorFuze enumeration return the string that goes with it.

static DtSimComponent* DtDetonationController::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 bool DtDetonationController::createPorts ( ) [protected, virtual]

Called by init to create the output ports.

Reimplemented from DtSimComponent.

virtual bool DtDetonationController::createTypesToDetectPort ( ) [protected, virtual]
virtual void DtDetonationController::lookupAndCacheProcessSR ( ) [protected, virtual]

This function looks up a process state repository in the process state repository manager by name, and caches a pointer to it in

myProcessState.

The name (if it exists) is given in the component descriptor (DtComponentDescriptor::processStateRepositoryName). If the name does not exist, it uses the appropriate default name defined in procSRTypes.h. Another component is responsible for creating and destroying the process state repository.

virtual void DtDetonationController::registerRadioMessageCallbacks ( ) [protected, virtual]

Registers for setArmedDataRequest and setDetonate messages from the local entity's radio.

const DtDetonationController& DtDetonationController::operator= ( const DtDetonationController orig) [protected]

Not implemented.


Member Data Documentation

Input Port Name: detected-objects
Input Port Description: List of contacts that fall within our range.

If this list is not empty then we try to detonate
Input Port Range:
Input Port Default Value:
Input Group Parent:

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:

Output Port Name: trigger
Output Port Description: Sends a new True value when trigger is pulled.


Output Port Range:
Output Port Default Value:
Output Group Parent: gun-control

Output Port Name: quantity
Output Port Description: Sends the number of rounds to be fired with a single trigger pull.


Output Port Range:
Output Port Default Value:
Output Group Parent: gun-control

The muntition and fuse to be used in the detonation.

DtDetonatorFuze DtDetonationController::myCurrentFuze [protected]

Pointer to a process state repository used to store state data associated with this component.

This process state repository is shared with other components. Another component is responsible for creating and destroying the process state repository. This state is saved and restored as part of a scenario (or checkpoint).


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)