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

DtRotaryWingWaitController is a controller that models waiting behavior for rotary-wing entities. More...

Inheritance diagram for DtRotaryWingWaitController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtRotaryWingWaitController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtRotaryWingWaitController ()
 destructor
virtual DtString type () const
 Returns a string identifies the class type of component.
virtual bool init ()
 Override to create the DtWaitingPSR process state repository.
virtual void tick ()
 See if we've waited long enough.
virtual void registerTaskMsgCallbacks ()
 Overrides this so it can register its interest in wait* commands.
virtual void processWaitTask (DtSimMessage *msg)
 Instances of this component will register these callback with their own 'this' pointer as user data with the msg executive requesting notification of wait tasks.
virtual void processWaitDurationTask (DtSimMessage *msg)
 Sets the member variable myWaitTime to the current elapsed simulation time plus the seconds to wait indicated in the message.
virtual void processWaitElapsedTask (DtSimMessage *msg)
 Sets the member variable myWaitTime to the elapsed simulation time indicated in the message.

Static Public Member Functions

static void waitCallback (DtSimMessage *msg, void *usr)
static void waitDurationCallback (DtSimMessage *msg, void *usr)
static void waitElapsedCallback (DtSimMessage *msg, void *usr)
static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

 DtRotaryWingWaitController ()
 Default constructor; should not be called.
 DtRotaryWingWaitController (const DtRotaryWingWaitController &orig)
 copy constructor; shallow; does not copy the ports.
const DtRotaryWingWaitControlleroperator= (const DtRotaryWingWaitController &orig)
 assignment operator; see comments on copy constructor!
virtual void pilotProperties ()
 Sets the pilot properties for the wait controller: The position selector is 1.0 The velocity selector is 1.0 The acceleration selector is 0.0 The heading selector is 0.0.
virtual bool createWaitingPSR ()
 Create and inits myProcessState member.

Protected Attributes

DtWaitingPSRmyWaitingProcessState

Detailed Description

DtRotaryWingWaitController is a controller that models waiting behavior for rotary-wing entities.

End User Description: It registers for wait, wait duration, and wait elapsed messages and calls entity->taskComplete() when elapsed time or proper duration expires. It doesn't do anything with an actual wait.

Uses Descriptor Type: DtRotaryWingPilotDescriptor


Constructor & Destructor Documentation

DtRotaryWingWaitController::DtRotaryWingWaitController ( 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; should not be called.

Here because the compiler will generate an unprotected one otherwise.

copy constructor; shallow; does not copy the ports.


Member Function Documentation

virtual DtString DtRotaryWingWaitController::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:
DtRotaryWingWaitType

Implements DtRotaryWingTaskController.

virtual bool DtRotaryWingWaitController::init ( ) [virtual]

Override to create the DtWaitingPSR process state repository.

Reimplemented from DtRotaryWingTaskController.

virtual void DtRotaryWingWaitController::tick ( ) [virtual]

See if we've waited long enough.

Checks the tasked() flag. If it is true, it checks the myWaitState member variable. If myWaitState is “Waiting” or “NotWaiting”, tick() returns. If myWaitState is “WaitingElapsed” or “WaitingDuration”, tick() checks to see if the current elapsed simulation time is greater than or equal to myWaitTime. If it is, tick() calls taskComplete() and sets the entity’s aggressiveness to the default. If it is not, tick() returns.

Reimplemented from DtSimComponent.

Overrides this so it can register its interest in wait* commands.

Reimplemented from DtTaskControllerComponent.

virtual void DtRotaryWingWaitController::processWaitTask ( DtSimMessage msg) [virtual]

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

Sets the member variable myWaitTime to 0.0. It sets the member variable myWaitState to “Waiting”, calls startTask(), tells the entity to hover in the current location, reduces its aggressiveness, and deletes the task message.

Sets the member variable myWaitTime to the current elapsed simulation time plus the seconds to wait indicated in the message.

It sets the member variable myWaitState to “WaitingDuration”, calls startTask(), tells the entity to hover in the current location, reduces its aggressiveness, and deletes the task message.

Sets the member variable myWaitTime to the elapsed simulation time indicated in the message.

It sets the member variable myWaitState to “WaitingElapsed”, calls startTask(), tells the entity to hover in the current location, reduces its aggressiveness, and deletes the task message.

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

assignment operator; see comments on copy constructor!

virtual void DtRotaryWingWaitController::pilotProperties ( ) [protected, virtual]

Sets the pilot properties for the wait controller: The position selector is 1.0 The velocity selector is 1.0 The acceleration selector is 0.0 The heading selector is 0.0.

The aggressiveness value is set to the default aggressiveness.

virtual bool DtRotaryWingWaitController::createWaitingPSR ( ) [protected, virtual]

Create and inits myProcessState member.

static void DtRotaryWingWaitController::waitCallback ( DtSimMessage msg,
void *  usr 
) [static]
static void DtRotaryWingWaitController::waitDurationCallback ( DtSimMessage msg,
void *  usr 
) [static]
static void DtRotaryWingWaitController::waitElapsedCallback ( DtSimMessage msg,
void *  usr 
) [static]
static DtSimComponent* DtRotaryWingWaitController::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.

Member Data Documentation


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)