![]() |
VR-Forces 4.0.4 Class Documentation
|
DtDetonationController is used to detonate a bomb like munition. More...

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 DtBooleanOutputPort * | triggerPort () const |
| virtual bool | createQuantityOutputPort () |
| virtual DtIntegerOutputPort * | quantityOutputPort () 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 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 () |
| 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 DtDetonationController & | operator= (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 |
| DtWarheadDetonationActuatorPSR * | myProcessState |
| Pointer to a process state repository used to store state data associated with this component. | |
| const DtDetonationControllerDescriptor * | myDetonationDescriptor |
| bool | myFirstTick |
Ports and Port Groups | |
| DtSensorContactListMultiInputPort * | myDetectedObjectsInputPort |
| Input Port Name: detected-objects Input Port Description: List of contacts that fall within our range. | |
| 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. | |
| DtBooleanOutputPort * | myTriggerPort |
| Output Port Name: trigger Output Port Description: Sends a new True value when trigger is pulled. | |
| DtIntegerOutputPort * | myQuantityOutputPort |
| Output Port Name: quantity Output Port Description: Sends the number of rounds to be fired with a single trigger pull. | |
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
| DtDetonationController::DtDetonationController | ( | 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 DtDetonationController::~DtDetonationController | ( | ) | [virtual] |
destructor
| DtDetonationController::DtDetonationController | ( | ) | [protected] |
Not implemented.
| DtDetonationController::DtDetonationController | ( | const DtDetonationController & | orig | ) | [protected] |
Not implemented.
| virtual bool DtDetonationController::postAddComponentsInit | ( | ) | [virtual] |
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.
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.
| virtual bool DtDetonationController::createTriggerPort | ( | ) | [virtual] |
These are called in init to create the ports used to communicate with the actuator.
| virtual DtBooleanOutputPort* DtDetonationController::triggerPort | ( | ) | const [virtual] |
| virtual bool DtDetonationController::createQuantityOutputPort | ( | ) | [virtual] |
| virtual DtIntegerOutputPort* DtDetonationController::quantityOutputPort | ( | ) | const [virtual] |
| 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.
| virtual bool DtDetonationController::setMunitionToDetonate | ( | DtSimMunition & | munition | ) | [virtual] |
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.
| virtual void DtDetonationController::processSetDetonation | ( | DtSimMessage * | msg | ) | [virtual] |
| static void DtDetonationController::setArmedCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Calls processSetArmed().
| 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*,
| 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 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
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.
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:
DtBooleanOutputPort* DtDetonationController::myTriggerPort [protected] |
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] |
DtTime DtDetonationController::myDetonationTime [protected] |
bool DtDetonationController::myAmArmed [protected] |
double DtDetonationController::myDetonationProximity [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).
const DtDetonationControllerDescriptor* DtDetonationController::myDetonationDescriptor [protected] |
bool DtDetonationController::myFirstTick [protected] |