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

Class Description: DtLasingController Lases a target location or entity. More...

Inheritance diagram for DtLasingController:
Inheritance graph
[legend]

List of all members.

Classes

class  DtLasingControllerInput
 Base class for lasing controller target inputs. More...
class  DtLasingControllerPortInput
 Derived input that uses a port. More...
class  DtLasingControllerWeaponInterfaceInput
 Derived input that uses a DtWeaponComponentInterface. More...

Public Member Functions

 DtLasingController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 constructor
virtual ~DtLasingController ()
 destructor
virtual bool init ()
 Calls setRadio()
virtual DtString type () const
 This returns a string from compTypes.h, and identifies the type of component.
virtual void tick ()
 Determines whether or not the laser should be on or off.
virtual void setDesignatorCode (const int code)
 Set or query the controllers laser code.
virtual const int designatorCode () const
virtual void clearTask ()
 If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false, and calls clearCurrentTaskMesage() to clear out the current task message.
virtual bool createProcessSR ()
 This function gets the name of the process state repository being shared by all components in the lasing system and then gets a pointer to it via the entity's processStateRepositoryManager.
virtual void startLasing ()
 Turn Lasing on or off.
virtual void stopLasing ()
virtual void laseTarget (DtVrfObject *targetObject)
 Updates the laser state for the target.
virtual bool lasing ()
 Determine if the laser is on or off.
virtual void registerTaskMsgCallbacks ()
 Registers its interest in set target request messages.
virtual void registerSetLaseAutonomousMsgCallbacks ()
virtual void registerSetLaserCodeRequestMsgCallbacks ()
virtual void processLaseTargetTaskMessage (DtSimMessage *msg)
virtual void processSetLaseAutonomousRequestMessage (DtSimMessage *msg)
virtual void processSetLaserCodeRequestMessage (DtSimMessage *msg)
virtual void processRequestLaserCode (const DtVrfObjectMessage *msg)

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
static void laseTargetTaskCallback (DtSimMessage *msg, void *usrData)
static void setLaseAutonomousRequestCallback (DtSimMessage *msg, void *usrData)
static void setLaserCodeRequestCallback (DtSimMessage *msg, void *usrData)
static void requestLaserCodeCallback (const DtVrfObjectMessage *msg, void *usr)

Protected Member Functions

 DtLasingController ()
 Default constructor; should not be called.
 DtLasingController (const DtLasingController &orig)
 copy constructor; shallow; does not copy the ports.
const DtLasingControlleroperator= (const DtLasingController &orig)
 assignment operator; see comments on copy constructor!
virtual bool lineOfSight (DtVrfObject *target)
 Determines whether or not the controller has line of sight with the target.
virtual void tickLaser ()
virtual void setRadio (DtSimBaseRadio *radio)
 Override this so we can register interest in setTargetMessages messages.
virtual bool createPublisher ()
virtual bool createTargetInput ()
virtual double laserPower () const
virtual double laserWavelength () const
virtual bool laseTargetValid (DtVrfObject *target, DtString &invalidReason)
virtual DtVrfObjectchooseAutonomousLaseTarget ()
virtual int defaultLaserCode () const
virtual void processObjectAboutToBeRemovedCallback (DtVrfObject *vrfObject)
 Called by objectAboutToBeRemovedCallback, calls stopLasing if the object being removed is the same as the current target object.

Static Protected Member Functions

static void objectAboutToBeRemovedCallback (DtVrfObject *vrfObject, void *usr)
 Registered on the objectManager by startLasing() in order to detect when a target object is being removed.

Protected Attributes

DtVrfObjectmyCurrentLasedTarget
DtLasingPSRmyProcessState
 Current target we're lasing--point or entity.
const
DtLasingControllerDescriptor
myComponentDescriptor
DtBoolean myFirstTick
DtDesignatorPublisher * myDesPublisher
DtLasingControllerInputmyLasingInput
 Depending on whether this DtLasingController is integrated with a weapon system or not, it can have either a port input or a weapon interface input.

Detailed Description

Class Description: DtLasingController Lases a target location or entity.

Determines the visibility of the target and publishes the designator information on the network Uses Descriptor Type: DtLasingControllerDescriptor


Constructor & Destructor Documentation

Default constructor; should not be called.

copy constructor; shallow; does not copy the ports.

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

constructor

destructor


Member Function Documentation

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

assignment operator; see comments on copy constructor!

virtual bool DtLasingController::init ( ) [virtual]

Calls setRadio()

Reimplemented from DtControllerComponent.

virtual DtString DtLasingController::type ( ) const [virtual]

This returns a string from compTypes.h, and identifies the type of component.

Implements DtTaskControllerComponent.

virtual void DtLasingController::tick ( ) [virtual]

Determines whether or not the laser should be on or off.

If the laser is on, it checks if it should be turned off because the target is missing or destroyed. If the laser is off, it checks if it is capable of lasing,with autonomous set to true, and if it has a target from the sensor port. The final thing the laser checks if it determines it should lase its target is if the target is in range and it has line of sight. Publishes the designator state on the network

Reimplemented from DtSimComponent.

virtual void DtLasingController::setDesignatorCode ( const int  code) [virtual]

Set or query the controllers laser code.

virtual const int DtLasingController::designatorCode ( ) const [virtual]
virtual void DtLasingController::clearTask ( ) [virtual]

If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false, and calls clearCurrentTaskMesage() to clear out the current task message.

Reimplemented from DtSingleTaskControllerComponent.

This function gets the name of the process state repository being shared by all components in the lasing system and then gets a pointer to it via the entity's processStateRepositoryManager.

virtual void DtLasingController::startLasing ( ) [virtual]

Turn Lasing on or off.

virtual void DtLasingController::stopLasing ( ) [virtual]
virtual void DtLasingController::laseTarget ( DtVrfObject targetObject) [virtual]

Updates the laser state for the target.

Calls startLasing() if not already lasing.

virtual bool DtLasingController::lasing ( ) [virtual]

Determine if the laser is on or off.

static DtSimComponent* DtLasingController::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = 0,
DtReaderWriterRegistry parentRegistry = 0 
) [static]

Registers its interest in set target request messages.

Reimplemented from DtTaskControllerComponent.

static void DtLasingController::laseTargetTaskCallback ( DtSimMessage msg,
void *  usrData 
) [static]
static void DtLasingController::setLaseAutonomousRequestCallback ( DtSimMessage msg,
void *  usrData 
) [static]
static void DtLasingController::setLaserCodeRequestCallback ( DtSimMessage msg,
void *  usrData 
) [static]
static void DtLasingController::requestLaserCodeCallback ( const DtVrfObjectMessage msg,
void *  usr 
) [static]
virtual void DtLasingController::processRequestLaserCode ( const DtVrfObjectMessage msg) [virtual]
virtual bool DtLasingController::lineOfSight ( DtVrfObject target) [protected, virtual]

Determines whether or not the controller has line of sight with the target.

virtual void DtLasingController::tickLaser ( ) [protected, virtual]
virtual void DtLasingController::setRadio ( DtSimBaseRadio radio) [protected, virtual]

Override this so we can register interest in setTargetMessages messages.

Reimplemented from DtTaskControllerComponent.

virtual bool DtLasingController::createPublisher ( ) [protected, virtual]
virtual bool DtLasingController::createTargetInput ( ) [protected, virtual]
virtual double DtLasingController::laserPower ( ) const [protected, virtual]
Returns:
The power specified in the component descriptor. Override this method if you want to publish the laser with a different power.
virtual double DtLasingController::laserWavelength ( ) const [protected, virtual]
Returns:
The wavelength specified in the component descriptor. Override this method if you want to publish the laser with a different wavelength.
virtual bool DtLasingController::laseTargetValid ( DtVrfObject target,
DtString invalidReason 
) [protected, virtual]
Returns:
True if the specified target entity is a valid lase target for this controller.
Parameters:
invalidReasonThis string will be filled in with a text reason for the target being invalid, if the return value is false.
Returns:
A valid lase target for the "lase autonomous" mode, or NULL if there is not valid target available.
virtual int DtLasingController::defaultLaserCode ( ) const [protected, virtual]
Returns:
The default laser code. Calls generateLaserCodeFromName().
static void DtLasingController::objectAboutToBeRemovedCallback ( DtVrfObject vrfObject,
void *  usr 
) [static, protected]

Registered on the objectManager by startLasing() in order to detect when a target object is being removed.

virtual void DtLasingController::processObjectAboutToBeRemovedCallback ( DtVrfObject vrfObject) [protected, virtual]

Called by objectAboutToBeRemovedCallback, calls stopLasing if the object being removed is the same as the current target object.


Member Data Documentation

Current target we're lasing--point or entity.

Container for state data associated with this component. This state is saved and restored as part of a scenario (or checkpoint).

Reimplemented from DtSimComponent.

DtBoolean DtLasingController::myFirstTick [protected]
DtDesignatorPublisher* DtLasingController::myDesPublisher [protected]

Depending on whether this DtLasingController is integrated with a weapon system or not, it can have either a port input or a weapon interface input.

myLasingInput holds this input object.


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)