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

DtLauncherController is a controller that accepts input from a target sensor, and provides ammunition type, load status, and trigger inputs to a missile launcher actuator. More...

Inheritance diagram for DtLauncherController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLauncherController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtLauncherController ()
 destructor
virtual bool init ()
 Overridden to register a detonation callback and to initialize myCreateMissileInfo.
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual void tick ()
 Calculate new control values.
virtual void tickMunitionLoader (const DtVrfObject *target)
 This method sets the flags myLoading, myUnloading, myLoaded as the load state of the weapon changes.
virtual bool createMissileIdPort ()
 These are called in init to create the ports used to communicate with the actuator.
virtual DtObjectIdOutputPortmissileIdPort () const
virtual bool createTargetPointPort ()
virtual DtVectorOutputPorttargetPointPort () const
virtual bool createTargetEntityIdPort ()
virtual DtObjectIdOutputPorttargetEntityIdPort () const
virtual void fire ()
 Creates and initializes a new missile object.
virtual void missileDetonated (DtDetonationInteraction *detInter)
 For removing missile entities from local list after they are destroyed.
virtual void disconnectMissileFromLauncher (const DtEntityIdentifier &missId)
 Takes a DtEntityIdentifier of a missile as an argument.
virtual void disconnectMissileFromLauncher (DtVrfObject *missile)
virtual DtVrfObjectmostRecentMissileFired ()
 Returns the most recent missile fired (and still connected) or NULL.
virtual double abandonPassedMissileDistance ()
virtual void setAbandonPassedMissileDistance (const double &distance)

Static Public Member Functions

static void detonationCallback (DtDetonationInteraction *detInter, void *usr)
 This callback function is registered with the exercise connection to handle incoming DtDetonationInteractions.
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 ()
 Overridden to create the launcher's ports.
virtual void removeMissileFromActiveList (const DtEntityIdentifier &removeId)
 Removes the DtObjectId of a given missile from myActiveMissiles list.
 DtLauncherController ()
 default constructor; not implemented
 DtLauncherController (const DtLauncherController &orig)
 copy constructor; not implemented
const DtLauncherControlleroperator= (const DtLauncherController &orig)
 assignment operator; not implemented

Protected Attributes

DtIfCreateVrfObject myCreateMissileInfo
DtList myActiveMissiles
double myAbandonPassedMissileDistance
 If the missile passes its target within this distance, it will be abandoned and disconnected from the launcher.
bool myFirstTick
Ports and Port Groups
DtObjectIdOutputPortmyMissileIdPort
 Output Port Name: missile-id
Output Port Description: Object id of the missile.
DtObjectIdOutputPortmyTargetEntityIdPort
 Output Port Name: target-entity
Output Port Description: Object id of the target.
DtVectorOutputPortmyTargetPointPort
 Output Port Name: target-point
Output Port Description: Local position of the target.

Detailed Description

DtLauncherController is a controller that accepts input from a target sensor, and provides ammunition type, load status, and trigger inputs to a missile launcher actuator.

End User Description: It also provides azimuth and elevation inputs to corresponding azimuth and elevation mount actuators (moveable components upon which the launcher may be mounted). The launcher controller designates its target as the first target that appears in the entity's sector of responsibility. Based on the target type, it loads the appropriate munition type. If a change in target occurs, requiring a change in munition type, or fuse type, or both (that is, the new target detected is of a different type than the original target), the weapon unloads the old munition, and then loads the new type of munition. If no target is available, and the preload-weapon parameter is set, then the first munition type specified in the munition table is loaded.

When a guided missile is fired, reloading is suspended while the missile is active. Once the missile detonates or passes the target, reloading may resume.

The target is acquired when the azimuth and elevation of the weapon align with the azimuth and elevation to the target, within the ranges specified by the munition-maneuver-margin parameter. The controller reorients the weapon in azimuth and elevation as needed.

Once a target has been acquired, the weapon is loaded, and the entity has permission to fire (given by the entity's rules of engagement, for example, "fire-at-will"), the weapon controller fires. It creates a new missile entity, sets the ID of the missile entity in the missile ID port, sets the trigger port to true, and depletes the resource associated with the missile type.

Uses Descriptor Type: DtWeaponControllerDescriptor


Constructor & Destructor Documentation

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

default constructor; not implemented

copy constructor; not implemented


Member Function Documentation

virtual bool DtLauncherController::init ( ) [virtual]

Overridden to register a detonation callback and to initialize myCreateMissileInfo.

Reimplemented from DtWeaponController.

virtual DtString DtLauncherController::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:
DtLauncherControllerType

Reimplemented from DtWeaponController.

Reimplemented in DtVerticalLauncherController.

virtual void DtLauncherController::tick ( ) [virtual]

Calculate new control values.

Reimplemented from DtWeaponController.

virtual void DtLauncherController::tickMunitionLoader ( const DtVrfObject target) [virtual]

This method sets the flags myLoading, myUnloading, myLoaded as the load state of the weapon changes.

The parameter is the entity object of the current target for the weapon. This override of the base performs pre-loading of the launcher even if there is no target. Overrides DtWeaponController::tickMunitionLoader(). Before calling down to the base class's version of this function, it checks to see if the last guided missile fired has missed its target. If no such missile exists, or if it is a fire-and-forget type of missile, the function calls down to the base class's tickMunitionLoader() to continue the loading process. If the last missile fired is a guided missile, and it has not passed its target, it returns without calling the base class tickMunitionLoader(). This has the effect of suspending load operations while an operator-guided missile is still active. Otherwise, if the missile has passed it's target disconnectMissileFromLauncher is called.

Reimplemented from DtWeaponController.

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

virtual void DtLauncherController::fire ( ) [virtual]

Creates and initializes a new missile object.

It sets the DtObjectId of the new missile object in myMissileIdPort, sets the trigger value to true in myTriggerPort, and adds the missile's ID to the myActiveMissiles list. Finally, it looks up the resource corresponding to the missile type in the entity's local state repository, and decrements the count on that resource.

Reimplemented from DtWeaponController.

virtual void DtLauncherController::missileDetonated ( DtDetonationInteraction detInter) [virtual]

For removing missile entities from local list after they are destroyed.

Takes a DtDetonationInteraction as an argument. It goes through its list of active missiles (myActiveMissiles), searching for an ID that matches the munition ID specified in the DtDetonationInteraction. If it is found, it calls removeMissileFromActiveList(), to remove and delete the missile DtObjectId in the myActiveMissiles list.

static void DtLauncherController::detonationCallback ( DtDetonationInteraction detInter,
void *  usr 
) [static]

This callback function is registered with the exercise connection to handle incoming DtDetonationInteractions.

It calls missileDetonated() to process the interaction.

virtual void DtLauncherController::disconnectMissileFromLauncher ( const DtEntityIdentifier &  missId) [virtual]

Takes a DtEntityIdentifier of a missile as an argument.

If the missile is found in the myActiveMissiles list, it looks up the missile object by DtEntityIdentifier in the DtVrfObjectManager. If found, it calls DtMissileStateRepository::setDisconnectedFromLauncher(), and removes and deletes the missile DtEntityIdentifier from the myActiveMissiles list. The second version of this function takes a missile object as an argument. It calls down to the first version of the function to perform the actual work.

Returns the most recent missile fired (and still connected) or NULL.

virtual void DtLauncherController::setAbandonPassedMissileDistance ( const double &  distance) [virtual]
static DtSimComponent* DtLauncherController::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.

Reimplemented from DtWeaponController.

Reimplemented in DtVerticalLauncherController.

virtual bool DtLauncherController::createPorts ( ) [protected, virtual]

Overridden to create the launcher's ports.

Reimplemented from DtWeaponController.

virtual void DtLauncherController::removeMissileFromActiveList ( const DtEntityIdentifier &  removeId) [protected, virtual]

Removes the DtObjectId of a given missile from myActiveMissiles list.

It deletes the DtObjectId data in the list entry.

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

assignment operator; not implemented


Member Data Documentation

Output Port Name: missile-id
Output Port Description: Object id of the missile.


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

Output Port Name: target-entity
Output Port Description: Object id of the target.


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

Output Port Name: target-point
Output Port Description: Local position of the target.


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

If the missile passes its target within this distance, it will be abandoned and disconnected from the launcher.

Defaults to 100 meters.

Reimplemented from DtBaseWeaponController.


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)