VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtEmbarkationController Class Reference

DtEmbarkationController is a controller that supports base level embarkation/disembarkation for entities in the system. More...

Inheritance diagram for DtEmbarkationController:
Inheritance graph
[legend]

Public Member Functions

 DtEmbarkationController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,
virtual ~DtEmbarkationController ()
 destructor
virtual bool init ()
 Initializes any state that is needed.
virtual DtString type () const
 Returns a string identifies the class type of component.
- Public Member Functions inherited from DtSingleTaskControllerComponent
 DtSingleTaskControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString& name,
virtual ~DtSingleTaskControllerComponent ()
 destructor
virtual void postTick ()
 Override to check if we're tasked and we want to give up (only performs the check if we're in play mode (dT() > 0)).
virtual bool beginProcessingTask (const DtTaskMessage &task, DtSimTaskStatePtr taskState)
 Called by the task manager when this controller should start executing the specified task.
virtual void taskNotify (const DtSimTask &task)
 This is called to let us know when some other component receives a task In the case of this component, we don't care what the task actually is.
virtual void taskComplete (bool success=true)
 If we are currently tasked, this will cause us to notify the entity that we're done and delete the task.
virtual int sendSubtask (DtSimTask &task)
 Sends subtask to ourself.
virtual void clearSubtask (int subtaskId)
 Clears subtask with the given subtaskId (subtaskId is returned sendSubtask()).
virtual void addPendingSubtaskId (int subtaskId)
 Adds given subtask Id to list of pending subtasks.
virtual bool findPendingSubtaskId (int subtaskId)
 Checks to see if given subtaskId exists in our list of pending subtasks.
virtual void removePendingSubtaskId (int subtaskId)
 Removes pending subtask from list of subtasks for this component.
virtual void removeAllPendingSubtaskIds ()
 Clear all pending subtasks from our list of subtasks.
virtual std::vector< int > currentPendingSubstaskIds () const
 Returns the list of all currently pending subtask ids for this controller.
virtual DtTaskMessagecurrentTaskMessage () const
 Get a pointer to the message that was used to task this entity.
virtual DtSimTaskStatePtr currentTaskState () const
virtual bool decideToGiveUpTask () const
 This function is used to determine if the controller should give up trying to execute the current task.
virtual void giveUpTask ()
 Called when controller is tasked and decideToGiveUp() returns true.
virtual bool taskActive (int taskId) const
 
virtual bool clearTopLevelTasks ()
 If this controller has any top level tasks (not subtasks), they are cleared.
virtual void clearConflictingTopLevelTasks (const DtSimTaskMessageType &conflictType)
 Clears any top level tasks on this controller that conflict with the conflict task type.
virtual void clearTasksByType (const DtSimTaskMessageType &taskType)
 Clears any tasks of the specified type running in this controller.
virtual void clearTaskById (int taskId)
 Clears any task of the specified ID running in this controller.
virtual DtSuspendedTaskInfosuspendTaskById (int taskId)
virtual std::list
< DtTaskMessage * > 
currentTaskMessages () const
 
virtual DtTaskWithTaskStateListPtr topLevelTasks () const
 
- Public Member Functions inherited from DtTaskControllerComponent
 DtTaskControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *compDesc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString& name,
virtual ~DtTaskControllerComponent ()
 destructor
virtual bool showCurrentTaskInGui () const
virtual void setRadio (DtSimBaseRadio *radio)
 Calls registerTaskMsgCallbacks.
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 Adds a new function for processing the specified task type.
virtual void addTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 Deprecated form of addTaskProcessorCallback.
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtMessageCallbackFcn fcn, void *usr)
 Undoes anything done by addTaskProcessorCallback().
virtual void removeTaskProcessorCallback (const DtSimTaskMessageType &taskType, DtTaskMessageCallbackFcn fcn, void *usr)
 Deprecated form of removeTaskProcessorCallback.
virtual void sendTaskCanceled (DtTaskMessage *taskMsg)
 Sends the task canceled report for the specified message.
virtual void setTasked (bool tasked)
 The current tasked state of this controller.
virtual bool tasked () const
 The current tasked state of this controller.
- Public Member Functions inherited from DtControllerComponent
 DtControllerComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString& name,
virtual ~DtControllerComponent ()
 destructor
virtual DtSimBaseRadioradio ()
 The radio this component is listening to.
- Public Member Functions inherited from DtSimComponent
 DtSimComponent (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
virtual ~DtSimComponent ()
 destructor
void setParentSystem (DtComponentSystem *system)
 Sets the parent system of this component.
virtual bool postAddComponentsInit ()
 Called after all components have been created, initialized and added to the component manager.
virtual void registerAttributeFunctions ()
 Called to register functions that provide system attribute values.
virtual void timedTick ()
 This version of tick checks to see if the time to tick has arrived.
virtual void setMinTickPeriod (double minTickPeriod)
 specifies a minimum tick period (which can also be thought of as
virtual double minTickPeriod () const
 access the minimum tick period
virtual void setMinTickPeriodVariance (double minTickPeriodVariance)
 set the variance in the minimum tick time
virtual double minTickPeriodVariance () const
 access the variance in the minimum tick period
virtual void setNextTickTime (double nextTickTime)
 The next tick time is normally calculated internally.
virtual double nextTickTime () const
 access the next tick time
virtual double calculateNextTickTime () const
 The next tick time is equal to mySimManager->exerciseClock()-> approximateElapsedRealTime() + myMinTickPeriod + a random # between -myMinTickPeriodVariance/2.
virtual double calculateFirstTickTime () const
 Returns the first time value that the component should tick at.
virtual void setEntity (DtVrfObject *entity)
 The entity's state repository is the place that actuator components make updates and other components look to see our current state.
virtual DtSimComponentnextComponent ()
 List management functions.
virtual DtSimComponentprevComponent ()
virtual void setListItem (DtListItem *item)
 Used by DtComponentList.
virtual DtListItem * listItem ()
virtual void putData (FILE *fp, int indentLevel=0)
 putData writes our type, which is provided by the virtual type accessor of the deriving class.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 getData is just used to get us past the type in the data stream, since it's not actual stored.
virtual void addInputPort (DtInputPort *port)
 Adds this input port to the components input port list so that other components can look it up and attach to it.
virtual void removeInputPort (DtInputPort *port)
virtual DtInputPortlookupInputPort (const DtString &portName)
 Returns a pointer to the input port registered on this component with the specified name.
virtual DtList inputPortList () const
 Returns the list of DtInputPorts registered on this component.
virtual void addOutputPort (DtOutputPort *port)
 Adds this output port to the components output port list so that other components can look it up and attach to it.
virtual void removeOutputPort (DtOutputPort *port)
virtual DtOutputPortlookupOutputPort (const DtString &portName)
 Returns a pointer to the output port registered on this component with the specified name.
virtual DtList outputPortList () const
 Returns the list of DtOutputPorts registered on this component.
virtual void addInputPortGroup (DtInputPortGroup *group)
 Adds this input port to the components input port list so that other components can look it up and attach to it.
virtual void removeInputPortGroup (DtInputPortGroup *group)
virtual DtInputPortGrouplookupInputPortGroup (const DtString &groupName)
 Returns a pointer the input port group registered on this component with the specified name.
virtual DtList inputPortGroupList () const
 Returns the list of DtInputPortGroups registered on this component.
virtual void addOutputPortGroup (DtOutputPortGroup *group)
 Adds this output port group to the components output port group list so that other components can look it up and attach to it.
virtual void removeOutputPortGroup (DtOutputPortGroup *group)
virtual DtOutputPortGrouplookupOutputPortGroup (const DtString &groupName)
 Returns a pointer the output port group registered on this component with the specified name.
virtual DtList outputPortGroupList () const
 Returns the list of DtOutputPortGroups registered on this component.
virtual int priority () const
 Return the current connection priority for this component.
virtual void setPriority (int priority)
 Sets a new connection priority for this component, and changes all current outgoing connections from this component to the new value.
double dT () const
 This is the delta-t for this component, which may or may not be the same as the exerciseClock dT.
virtual void setDT (double deltaT)
 Note that while dT is calculated internally, this makes it possible to 'lie' to the component about dT if necessary.
virtual void setComponentDescriptor (DtComponentDescriptor *componentDescriptor)
 The component descriptor specified in the order of battle file or parameter file that was used to create this component.
virtual const
DtComponentDescriptor
componentDescriptor () const
virtual bool tickWhileDestroyed () const
 If the component returns true here, it will be ticked regardless of the destroyed state of the host entity.
DtVrfProcessStateRepositoryManagerpsrManager ()
virtual DtString componentFullName () const
virtual DtPhysicalWorldphysicalWorld ()
 Gets the physical world that this component's entity exists in.
virtual const DtPhysicalWorldphysicalWorld () const
virtual DtAttachedTerrainterrainAttachedTo ()
 Gets the terrain that this component's entity is attached to, if any.
virtual const DtAttachedTerrainterrainAttachedTo () const
virtual DtVrfObjectentity ()
 Gets the entity.
virtual const DtVrfObjectentity () const
virtual DtSimManagersimManager ()
 Gets the sim manager.
virtual const DtSimManagersimManager () const
virtual const Coordinate_System * coordinateSystem () const
 Gets the coordinate system, as it should always exist if the physical world is in a valid state!
virtual Coordinate_System * coordinateSystem ()
virtual
DtVrfObjectStateRepository
localStateRepository ()
 Gets the local state repository.
virtual const
DtVrfObjectStateRepository
localStateRepository () const
virtual bool isEnabled ()
 Is this component enabled or not.
virtual void setIsEnabled (bool yesNo)
 Is this component enabled or not.
virtual DtOutputStream & objectConsoleDebug () const
virtual DtOutputStream & objectConsoleVerbose () const
virtual DtOutputStream & objectConsoleInfo () const
virtual DtOutputStream & objectConsoleWarn () const
virtual DtOutputStream & objectConsoleError () const
virtual DtSimResourceManagerresourceManager ()
virtual const
DtSimResourceManager
resourceManager () const
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 default constructor
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 real constructor Setting the readonly flag prevents object from writing itself to the stream.
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 assignment operator
bool operator== (const DtReaderWriter &) const
 Equivalence operator.
bool operator!= (const DtReaderWriter &rhs)
virtual ~DtReaderWriter ()
 destructor
virtual void putSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Top level call to write itself to file.
virtual void getSelf (DtlObjPtr args, const DtFilename &searchPath=DtFilename::nullFilename(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 Top level to read itself from an input stream.
virtual void writeSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 Called from putSelf, calls myRegistry.putSelf which in turn calls putSelf on each reader/writer in the registry.
virtual DtSymbolString name () const
 Accessor for name of this readable/writable object.
virtual void addAlias (const DtSymbolString &alias)
 Add an alias as an alternative name for this object.
virtual bool hasAlias (const DtSymbolString &alias)
virtual const aliasContaineraliases () const
virtual void setReadonly (bool flag)
 Set read-only flag.
virtual bool isReadonly () const
virtual bool variableIsBound () const
virtual void unbindVariable ()
 Sets the myVariableIsBound flag to false.
virtual void setName (const DtString &)
 Set the name of the object.
virtual const char * readerWriterType () const
 Used to supply a string type that this reader writer type is.
virtual DtString prettyPrint () const
 Routine to return a human readable form of the reader/writer variable.
virtual void bindVariables (DtVariableBindingsList variableBindings)
 Runs a variable binding pass on this reader writer and any of its children.
virtual std::list
< DtVariableNameType
unboundVariables () const
bool invalid () const
virtual bool hasChild (const DtReaderWriter *p) const
 Returns true if this variable has a child p in it's chain.
virtual void setValueSpecified (bool specified, bool recurse=false)
 The specified flags are used for optional values.
virtual bool valueSpecified () const
 The specified flags are used for optional values.
virtual bool isVariableReference () const
 Specifies whether or not this reader writer is really a variable that is specified elsewhere.
virtual void setIsVariableReference (bool value)
virtual void clearAllVariableReferenceFlags ()
 Clears out all variable reference flags from all readerwriter items in registry recursively.
virtual DtSymbolString variableName () const
 The variable name, if this object is a variable reference.
virtual void setVariableName (const DtSymbolString variableName)
 The variable name, if this object is a variable reference.
const DtReaderWriterRegistryregistry () const
 Collection of child DtReaderWriter nodes owned by this object.
DtReaderWriterRegistryregistry ()
 Collection of child DtReaderWriter nodes owned by this object.

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 (const DtString&,DtVrfObject*,DtSimManager*,

Protected Member Functions

virtual void registerTaskMsgCallbacks ()
 Override for interest in both embarkation tasks and sets.
virtual void unregisterTaskMsgCallbacks ()
 Override for uninterest in both embarkation tasks and sets.
virtual void preFirstTickInit ()
 Calls setupExistingConditions()
virtual void tick ()
 Ticks and performs current state.
virtual void clearCurrentTaskMessage ()
 Resets state flag to DtIdle.
virtual void suspendTask ()
 Overridden from parent to sent a giveUpSlot message to the object it was embarking on.
virtual void clearTask ()
 Override to clear out any subtasks we might have.
virtual void processDisembarkTask (DtSimMessage *msg)
 Tasks.
virtual void processEmbarkTask (DtSimMessage *msg)
 Sets state to be DtMoveToIngress.
virtual void processEmbarkObjectCallback (DtSimMessage *msg)
virtual void processDisembarkObjectCallback (DtSimMessage *msg)
virtual void processEmbarkationInformationCallback (DtSimMessage *msg)
virtual void processLoadEntity (DtSimMessage *msg)
 Sets.
virtual void processUnloadEntity (DtSimMessage *msg)
virtual void unload (const DtVector &point)
 Unloads entity at specified egress point.
virtual void processDeleteVrfObjectCallback (DtVrfObject *obj)
virtual void processTaskComplete (DtSimMessage *msg)
virtual void moveToEgress ()
 Moves the item to the egress point to prepare for disembarking.
virtual void movingToEgress ()
 Called while entity is moving to egress point. Currently no-ops.
virtual void disembark ()
 Disembarks item by calling unload() and then resets state to idle.
virtual void sendTask (const DtSimTask &task, const DtString &toName)
 Sends task to specified receiver.
virtual void removeControlPoint ()
 Removes the control point from object manager (if exists)
virtual void moveToIngress (const DtString &parentName)
 Starts a moveTo tasks, given the myIngressPoint (that is created as part of this method) as the target.
virtual void createControlPoint (const DtVector &location, const DtString &parent)
virtual void createRoute (const std::vector< DtVector > &, const DtString &parent)
virtual void moveToEmbarkationPoint ()
 Sets state to DtMovingToEmbarkationPoint and starts task to move to embarkation point.
virtual void atEmbarkationPoint ()
 Embarks object on target (using myEmbarkationParent, myEmbarkationPoint member variables) by calling embark() method.
virtual void waitingToStop ()
 Called while the entity is waiting to come to a complete stop.
virtual void movingToIngress ()
 Called while the entity is moving to ingress point.
virtual void embarkObject (bool overridePosition, const DtVector &loadPosition, const DtString &parentName, int appearance=0xFFFFFFFF, const DtTaitBryan &orientation=DtTaitBryan(), const DtVector &acceleration=DtVector(), const DtVector &velocty=DtVector())
 Called as part of processLoad() message.
virtual void unloadObject (const DtVector &unloadPoint)
 Called as part of processUnload.
virtual void embark (const DtVector &loadPosition, const DtString &parentName, int appearance=0xFFFFFFFF, const DtTaitBryan &orientation=DtTaitBryan(), const DtVector &acceleration=DtVector(), const DtVector &velocty=DtVector())
 Called to complete embarkation via task.
virtual void movingToEmbarkationPoint ()
 Called when moving to embarkation point.
virtual void stoppedAtEmbarkedPoint ()
 Last step – embark on object.
virtual void setState (DtVrfEmbarkationPSR::DtEmbarkationControllerState)
 Sets state in PSR and returns state from PSR.
virtual
DtVrfEmbarkationPSR::DtEmbarkationControllerState 
state () const
virtual bool createPSR ()
 Creates myProcessState data member, and adds it to our process state repository manager.
virtual void setupExistingConditions ()
 Called only during first tick, sets up any internal variables that are needed.
virtual void completeEmbarkationInformationRequest (const DtIfEmbarkationInformation *)
 Called when embarkation information has been received and we have been cleared to embark.
virtual void embarkationRefused (const DtIfEmbarkationInformation *)
 Called when embarkation information has been received and we have been declined an embarkation slot.
virtual void completeDisembarkationInformationRequest (const DtIfEmbarkationInformation *)
 Called when disembarkation information has been received and we have been cleared to disembark.
virtual void disembarkationRefused (const DtIfEmbarkationInformation *)
 Called when disembarkation information has been received and we have been declined the request to disembark.
virtual DtTaitBryan embarkedOrientation (const DtTaitBryan &, const DtString &parent) const
 Takes the orientation from embarkation information and transforms it to an embarkable orientation.
virtual void moveToIngressPoint (const DtIfEmbarkationInformation *info)
 Creates a control point and give a DtMoveTo subtask to move to the ingress point.
virtual void moveAlongToIngressPoint (const DtIfEmbarkationInformation *info)
 Creates a route and give a DtMoveAlong subtask to move along the route.
virtual void moveToEgressPoint (const DtIfEmbarkationInformation *info)
 Creates a control point and give a DtMoveTo subtask to move to the egress point.
virtual void moveAlongToEgressPoint (const DtIfEmbarkationInformation *info)
 Creates a route and give a DtMoveAlong subtask to move along the route to the egress point.
virtual void issueMoveToEgressTask ()
 Override to issue a task that is different than the DtMoveTo for a single control point.
virtual void issueMoveToIngressTask ()
virtual void issueMoveAlongToEgressTask ()
 Override to issue a task that is different than the default DtMoveAlong task.
virtual void issueMoveAlongToIngressTask ()
virtual void issueMoveToEmbarkationPointTask ()
 Override to issue a task that is different than the default DtMoveTo task.
virtual DtVector currentBodyPosition (const DtString &parent) const
 Current body position and orientation on embarked parent.
virtual DtTaitBryan currentBodyOrientation (const DtString &parent) const
virtual DtVector currentBodyVelocity (const DtString &parent) const
virtual DtVector currentBodyAcceleration (const DtString &parent) const
virtual bool requestEmbarkationInformationFrom (const DtString &parent, bool start=false)
 Sends a request to find out ingress and embarkation location of the host entity.
virtual bool requestDisembarkationInformationFrom (const DtString &parent, bool start=false)
virtual void requestGiveUpSlot (const DtString &parent)
 Sends a request to give up a slot that might be reserved in our name.
virtual void waitingForEmbarkationInformation ()
virtual void waitingForDisembarkationInformation ()
virtual void placeObject ()
 Places object on terrain after embarkation to refresh support points.
virtual void setLocation (const DtVector &)
 Sends setLocation request to this entity for the specified world location.
virtual void calculateAndSetHeading (const DtVector &start, const DtVector &end)
 Calculates the heading needed to disbark given the current state.
virtual void sendSetRequest (DtSetDataRequest &request)
 Sends set request.
virtual void processDisembarkationState (const DtVector &bodyExitPosition)
virtual void movingToFinalDestination ()
virtual void moveToFinalDestination ()
virtual void preprocessEmbarkTask ()
 Currently noops, but, give an opportunity to do any preprocessing before embark or disembark task starts.
virtual void preprocessDisembarkTask ()
virtual bool checkEmbarkOk (const DtString &parent) const
 Returns false if entity is to embark on another entity that is not embarked on the same entity as this one (or, if they are not both disembarked)
virtual void updateDisembarkedAppearance ()
 Updates the appearance of a disembarked object (from its current appearance).
virtual void updateEmbarkedAppearance (int)
 Updates the appearance of an embarked entity.
virtual void updateLifeformEmbarkedAppearance (int)
virtual void attachToEmbarkedParent (const DtString &newParent)
 Only called when disembarkation causes the entity to be embarked on a new parent (i.e.
virtual DtVector fallbackOffloadPoint ()
 If an entity tries to be disembarked, but, it never hears back as to where it can disembark, this is the spot that it will be disembarked to.
virtual void enable ()
 Override to add set data request and message callbacks.
virtual void disable ()
 Override to remove set data request and message callbacks.
- Protected Member Functions inherited from DtSingleTaskControllerComponent
virtual void clearPendingSubtasks ()
 Iterates over collection of all pending subtasks for this controller, and calls clearSubtask() for each subtask type.
virtual void clearSubtasksByType (const DtSimTaskMessageType &taskType)
 Clear all subtasks of a given type.
- Protected Member Functions inherited from DtTaskControllerComponent
virtual void suspendSubtasksOfTask (int taskId, DtSuspendedTaskInfo *suspendInfo)
 Suspends all running subtasks of taskId, and puts the suspend info for each of them as subtasks into the provided suspendInfo.
- Protected Member Functions inherited from DtControllerComponent
 DtControllerComponent ()
 default constructor
 DtControllerComponent (const DtControllerComponent &orig)
 copy constructor
const DtControllerComponentoperator= (const DtControllerComponent &orig)
 assignment operator
- Protected Member Functions inherited from DtSimComponent
bool testInvariant () const
virtual bool createPortGroups ()
 Called by init.
virtual bool createPorts ()
 Called by init.
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 Copies values from the specified DtReaderWriter.
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 Checks to see if this RW object is a variable reference that can be bound using the provided bindings.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 Deriving class overrides these to get/put class specific data.

Static Protected Member Functions

static void disembarkTaskCallback (DtSimMessage *msg, void *usr)
static void embarkTaskCallback (DtSimMessage *msg, void *usr)
static void embarkObjectCallback (DtSimMessage *msg, void *usr)
 Processes DtIfEmbark and disembark messages.
static void disembarkObjectCallback (DtSimMessage *msg, void *usr)
static void embarkationInformationCallback (DtSimMessage *msg, void *usr)
 Called when embarkation information is received over the network.
static void setLoadEntityCallback (DtSimMessage *msg, void *usrData)
static void setUnloadEntityCallback (DtSimMessage *msg, void *usrData)
static void deleteVrfObjectCallback (DtVrfObject *msg, void *usr)
 If an object is deleted and it is the object we are trying to embark on, then stop the current embark task.
static void taskCompleteReportCallback (DtSimMessage *msg, void *usr)
 Monitor taskReportComplete callback to see when our moveTo task is complete during embarkation so we can then set state to DtMoveToEmbarkPoint.

Protected Attributes

std::list< DtStringmyEmbarkedObjects
DtVrfObjectmyControlPoint
 If this entity is embarking to an ingress point (or moving to the embarkation point), this object will be the point they are aiming for.
DtVrfEmbarkationPSRmyProcessState
 Container for state data associated with this component.
bool myWaiting
 If myWaiting is true, the controller is waiting for some condition to be met, so, the controller will not start working until the conditions are met.
DtEmbarkationDescriptormyEmbarkationDescriptor
double myRequestTime
int myRequestRetries
bool myAreCallbacksRegistered

Private Member Functions

 DtEmbarkationController ()
 default constructor; not implemented
 DtEmbarkationController (const DtEmbarkationController &orig)
 copy constructor; not implemented
const DtEmbarkationControlleroperator= (const DtEmbarkationController &orig)
 assignment operator; not implemented

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString > 
aliasContainer
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
- Protected Types inherited from DtTaskControllerComponent
typedef std::pair
< DtTaskMessageCallbackFcn,
void * > 
DtTaskCallbackMapPair
 This map stores callbacks that have been registered to processes various tasks.
typedef std::map
< DtSimTaskMessageType,
DtTaskCallbackMapPair
DtTaskCallbackMap
- Static Protected Attributes inherited from DtSimComponent
static DtSimComponentFactorymyFactory

Detailed Description

DtEmbarkationController is a controller that supports base level embarkation/disembarkation for entities in the system.

Developer Description: If an entity requires specialized handling of any of the tasks or sets that are used for embarkation functionality, then override this class to handle that.

Uses Descriptor Type: DtEmbarkationDescriptor

DtEmbarkationController model description

Constructor & Destructor Documentation

DtEmbarkationController::DtEmbarkationController ( 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)

virtual DtEmbarkationController::~DtEmbarkationController ( )
virtual

destructor

DtEmbarkationController::DtEmbarkationController ( )
private

default constructor; not implemented

DtEmbarkationController::DtEmbarkationController ( const DtEmbarkationController orig)
private

copy constructor; not implemented

Member Function Documentation

virtual bool DtEmbarkationController::init ( )
virtual

Initializes any state that is needed.

Reimplemented from DtControllerComponent.

Reimplemented in DtFixedWingEmbarkationController, and DtDisaggregatedEmbarkationController.

virtual DtString DtEmbarkationController::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
DtEmbarkationControllerType

Implements DtTaskControllerComponent.

Reimplemented in DtDisaggregatedEmbarkationController, DtFixedWingEmbarkationController, and DtRotaryWingEmbarkationController.

static DtSimComponent* DtEmbarkationController::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 in DtDisaggregatedEmbarkationController, DtFixedWingEmbarkationController, and DtRotaryWingEmbarkationController.

virtual void DtEmbarkationController::registerTaskMsgCallbacks ( )
protectedvirtual

Override for interest in both embarkation tasks and sets.

Reimplemented from DtTaskControllerComponent.

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::unregisterTaskMsgCallbacks ( )
protectedvirtual

Override for uninterest in both embarkation tasks and sets.

virtual void DtEmbarkationController::preFirstTickInit ( )
protectedvirtual

Calls setupExistingConditions()

Reimplemented from DtSimComponent.

virtual void DtEmbarkationController::tick ( )
protectedvirtual

Ticks and performs current state.

Reimplemented from DtSimComponent.

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::clearCurrentTaskMessage ( )
protectedvirtual

Resets state flag to DtIdle.

Reimplemented from DtSingleTaskControllerComponent.

virtual void DtEmbarkationController::suspendTask ( )
protectedvirtual

Overridden from parent to sent a giveUpSlot message to the object it was embarking on.

Reimplemented from DtSingleTaskControllerComponent.

virtual void DtEmbarkationController::clearTask ( )
protectedvirtual

Override to clear out any subtasks we might have.

Reimplemented from DtSingleTaskControllerComponent.

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::processDisembarkTask ( DtSimMessage msg)
protectedvirtual

Tasks.

Calls down to immediately disembark the item to the egress point

static void DtEmbarkationController::disembarkTaskCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected
virtual void DtEmbarkationController::processEmbarkTask ( DtSimMessage msg)
protectedvirtual

Sets state to be DtMoveToIngress.

The DtMoveToIngress state will start at DtMoveToTask as a subtask to move to the ingress point. Once that task is complete, the state will be changed to DtMoveToEmbarkationPoint, after which the entity will be considered embarked.

static void DtEmbarkationController::embarkTaskCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected
static void DtEmbarkationController::embarkObjectCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected

Processes DtIfEmbark and disembark messages.

If there is a load override, does not query the occupancy controller for embark point

virtual void DtEmbarkationController::processEmbarkObjectCallback ( DtSimMessage msg)
protectedvirtual
static void DtEmbarkationController::disembarkObjectCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected
virtual void DtEmbarkationController::processDisembarkObjectCallback ( DtSimMessage msg)
protectedvirtual
static void DtEmbarkationController::embarkationInformationCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected

Called when embarkation information is received over the network.

If our name is attached and we are awaiting embarkation information, then complete the embarkation (or disembarkation) process

virtual void DtEmbarkationController::processEmbarkationInformationCallback ( DtSimMessage msg)
protectedvirtual
virtual void DtEmbarkationController::processLoadEntity ( DtSimMessage msg)
protectedvirtual

Sets.

virtual void DtEmbarkationController::processUnloadEntity ( DtSimMessage msg)
protectedvirtual
static void DtEmbarkationController::setLoadEntityCallback ( DtSimMessage msg,
void *  usrData 
)
staticprotected
static void DtEmbarkationController::setUnloadEntityCallback ( DtSimMessage msg,
void *  usrData 
)
staticprotected
virtual void DtEmbarkationController::unload ( const DtVector point)
protectedvirtual

Unloads entity at specified egress point.

Reimplemented in DtRotaryWingEmbarkationController.

static void DtEmbarkationController::deleteVrfObjectCallback ( DtVrfObject msg,
void *  usr 
)
staticprotected

If an object is deleted and it is the object we are trying to embark on, then stop the current embark task.

virtual void DtEmbarkationController::processDeleteVrfObjectCallback ( DtVrfObject obj)
protectedvirtual
static void DtEmbarkationController::taskCompleteReportCallback ( DtSimMessage msg,
void *  usr 
)
staticprotected

Monitor taskReportComplete callback to see when our moveTo task is complete during embarkation so we can then set state to DtMoveToEmbarkPoint.

virtual void DtEmbarkationController::processTaskComplete ( DtSimMessage msg)
protectedvirtual
virtual void DtEmbarkationController::moveToEgress ( )
protectedvirtual

Moves the item to the egress point to prepare for disembarking.

Currently simply sets state to DtDisembark

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::movingToEgress ( )
protectedvirtual

Called while entity is moving to egress point. Currently no-ops.

Reimplemented in DtFixedWingEmbarkationController.

virtual void DtEmbarkationController::disembark ( )
protectedvirtual

Disembarks item by calling unload() and then resets state to idle.

Reimplemented in DtRotaryWingEmbarkationController.

virtual void DtEmbarkationController::sendTask ( const DtSimTask task,
const DtString toName 
)
protectedvirtual

Sends task to specified receiver.

virtual void DtEmbarkationController::removeControlPoint ( )
protectedvirtual

Removes the control point from object manager (if exists)

virtual void DtEmbarkationController::moveToIngress ( const DtString parentName)
protectedvirtual

Starts a moveTo tasks, given the myIngressPoint (that is created as part of this method) as the target.

It then sets it's state to DtMovingToIngress

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::createControlPoint ( const DtVector location,
const DtString parent 
)
protectedvirtual
virtual void DtEmbarkationController::createRoute ( const std::vector< DtVector > &  ,
const DtString parent 
)
protectedvirtual
virtual void DtEmbarkationController::moveToEmbarkationPoint ( )
protectedvirtual

Sets state to DtMovingToEmbarkationPoint and starts task to move to embarkation point.

virtual void DtEmbarkationController::atEmbarkationPoint ( )
protectedvirtual

Embarks object on target (using myEmbarkationParent, myEmbarkationPoint member variables) by calling embark() method.

Sends DtStopMovingTask and, when the task report complete is received, sets state to DtStoppedAtEmbarkationPoint

Reimplemented in DtDisaggregatedEmbarkationController, DtFixedWingEmbarkationController, and DtRotaryWingEmbarkationController.

virtual void DtEmbarkationController::waitingToStop ( )
protectedvirtual

Called while the entity is waiting to come to a complete stop.

virtual void DtEmbarkationController::movingToIngress ( )
protectedvirtual

Called while the entity is moving to ingress point.

If ingress is actually a route, when the entity gets to the first point of the route, embark it so it will avoid obstacles

Reimplemented in DtFixedWingEmbarkationController.

virtual void DtEmbarkationController::embarkObject ( bool  overridePosition,
const DtVector loadPosition,
const DtString parentName,
int  appearance = 0xFFFFFFFF,
const DtTaitBryan &  orientation = DtTaitBryan(),
const DtVector acceleration = DtVector(),
const DtVector velocty = DtVector() 
)
protectedvirtual

Called as part of processLoad() message.

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::unloadObject ( const DtVector unloadPoint)
protectedvirtual

Called as part of processUnload.

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::embark ( const DtVector loadPosition,
const DtString parentName,
int  appearance = 0xFFFFFFFF,
const DtTaitBryan &  orientation = DtTaitBryan(),
const DtVector acceleration = DtVector(),
const DtVector velocty = DtVector() 
)
protectedvirtual

Called to complete embarkation via task.

Reimplemented in DtFixedWingEmbarkationController, and DtRotaryWingEmbarkationController.

virtual void DtEmbarkationController::movingToEmbarkationPoint ( )
protectedvirtual

Called when moving to embarkation point.

Sets state to DtAtEmbarkationPoint

virtual void DtEmbarkationController::stoppedAtEmbarkedPoint ( )
protectedvirtual

Last step – embark on object.

virtual void DtEmbarkationController::setState ( DtVrfEmbarkationPSR::DtEmbarkationControllerState  )
protectedvirtual

Sets state in PSR and returns state from PSR.

virtual DtVrfEmbarkationPSR::DtEmbarkationControllerState DtEmbarkationController::state ( ) const
protectedvirtual
virtual bool DtEmbarkationController::createPSR ( )
protectedvirtual

Creates myProcessState data member, and adds it to our process state repository manager.

Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.

virtual void DtEmbarkationController::setupExistingConditions ( )
protectedvirtual

Called only during first tick, sets up any internal variables that are needed.

virtual void DtEmbarkationController::completeEmbarkationInformationRequest ( const DtIfEmbarkationInformation )
protectedvirtual

Called when embarkation information has been received and we have been cleared to embark.

virtual void DtEmbarkationController::embarkationRefused ( const DtIfEmbarkationInformation )
protectedvirtual

Called when embarkation information has been received and we have been declined an embarkation slot.

virtual void DtEmbarkationController::completeDisembarkationInformationRequest ( const DtIfEmbarkationInformation )
protectedvirtual

Called when disembarkation information has been received and we have been cleared to disembark.

virtual void DtEmbarkationController::disembarkationRefused ( const DtIfEmbarkationInformation )
protectedvirtual

Called when disembarkation information has been received and we have been declined the request to disembark.

virtual DtTaitBryan DtEmbarkationController::embarkedOrientation ( const DtTaitBryan &  ,
const DtString parent 
) const
protectedvirtual

Takes the orientation from embarkation information and transforms it to an embarkable orientation.

virtual void DtEmbarkationController::moveToIngressPoint ( const DtIfEmbarkationInformation info)
protectedvirtual

Creates a control point and give a DtMoveTo subtask to move to the ingress point.

virtual void DtEmbarkationController::moveAlongToIngressPoint ( const DtIfEmbarkationInformation info)
protectedvirtual

Creates a route and give a DtMoveAlong subtask to move along the route.

virtual void DtEmbarkationController::moveToEgressPoint ( const DtIfEmbarkationInformation info)
protectedvirtual

Creates a control point and give a DtMoveTo subtask to move to the egress point.

virtual void DtEmbarkationController::moveAlongToEgressPoint ( const DtIfEmbarkationInformation info)
protectedvirtual

Creates a route and give a DtMoveAlong subtask to move along the route to the egress point.

virtual void DtEmbarkationController::issueMoveToEgressTask ( )
protectedvirtual

Override to issue a task that is different than the DtMoveTo for a single control point.

virtual void DtEmbarkationController::issueMoveToIngressTask ( )
protectedvirtual
virtual void DtEmbarkationController::issueMoveAlongToEgressTask ( )
protectedvirtual

Override to issue a task that is different than the default DtMoveAlong task.

Reimplemented in DtFixedWingEmbarkationController.

virtual void DtEmbarkationController::issueMoveAlongToIngressTask ( )
protectedvirtual
virtual void DtEmbarkationController::issueMoveToEmbarkationPointTask ( )
protectedvirtual

Override to issue a task that is different than the default DtMoveTo task.

Reimplemented in DtRotaryWingEmbarkationController.

virtual DtVector DtEmbarkationController::currentBodyPosition ( const DtString parent) const
protectedvirtual

Current body position and orientation on embarked parent.

virtual DtTaitBryan DtEmbarkationController::currentBodyOrientation ( const DtString parent) const
protectedvirtual
virtual DtVector DtEmbarkationController::currentBodyVelocity ( const DtString parent) const
protectedvirtual
virtual DtVector DtEmbarkationController::currentBodyAcceleration ( const DtString parent) const
protectedvirtual
virtual bool DtEmbarkationController::requestEmbarkationInformationFrom ( const DtString parent,
bool  start = false 
)
protectedvirtual

Sends a request to find out ingress and embarkation location of the host entity.

The entity can return with the requested information, and, possibly a new parent to embark on. It also sets the machine state to DtWaitingForEmbarkationInformtaion (or Disembarkation). If return information has not been received in the timeout period of time, then, a new request will be made. If a receipt has not been received in the retry amount of times, then, the embarkation will fail

If start is true, then reset retries to 1

virtual bool DtEmbarkationController::requestDisembarkationInformationFrom ( const DtString parent,
bool  start = false 
)
protectedvirtual
virtual void DtEmbarkationController::requestGiveUpSlot ( const DtString parent)
protectedvirtual

Sends a request to give up a slot that might be reserved in our name.

virtual void DtEmbarkationController::waitingForEmbarkationInformation ( )
protectedvirtual
virtual void DtEmbarkationController::waitingForDisembarkationInformation ( )
protectedvirtual
virtual void DtEmbarkationController::placeObject ( )
protectedvirtual

Places object on terrain after embarkation to refresh support points.

virtual void DtEmbarkationController::setLocation ( const DtVector )
protectedvirtual

Sends setLocation request to this entity for the specified world location.

Reimplemented in DtFixedWingEmbarkationController.

virtual void DtEmbarkationController::calculateAndSetHeading ( const DtVector start,
const DtVector end 
)
protectedvirtual

Calculates the heading needed to disbark given the current state.

If disembarking along a route, calculates the heading from first to second point, else calculates heading from center of entity to egress point or Calculates the heading needed to move from current embarkation position to embarked space, and sets it. If moving along an ingress route (or, about to) calculates and sets the heading to the next point

virtual void DtEmbarkationController::sendSetRequest ( DtSetDataRequest request)
protectedvirtual

Sends set request.

virtual void DtEmbarkationController::processDisembarkationState ( const DtVector bodyExitPosition)
protectedvirtual
virtual void DtEmbarkationController::movingToFinalDestination ( )
protectedvirtual
virtual void DtEmbarkationController::moveToFinalDestination ( )
protectedvirtual
virtual void DtEmbarkationController::preprocessEmbarkTask ( )
protectedvirtual

Currently noops, but, give an opportunity to do any preprocessing before embark or disembark task starts.

Reimplemented in DtDisaggregatedEmbarkationController.

virtual void DtEmbarkationController::preprocessDisembarkTask ( )
protectedvirtual
virtual bool DtEmbarkationController::checkEmbarkOk ( const DtString parent) const
protectedvirtual

Returns false if entity is to embark on another entity that is not embarked on the same entity as this one (or, if they are not both disembarked)

virtual void DtEmbarkationController::updateDisembarkedAppearance ( )
protectedvirtual

Updates the appearance of a disembarked object (from its current appearance).

Currently will only set DI posture to standing

virtual void DtEmbarkationController::updateEmbarkedAppearance ( int  )
protectedvirtual

Updates the appearance of an embarked entity.

If appearance is not 0xFFFFFFFF will set that appearance directly, unless the entity is a lifeform. It will then call updateLifeformEmbarkedAppearance, which will only set the posture component of the appearance

virtual void DtEmbarkationController::updateLifeformEmbarkedAppearance ( int  )
protectedvirtual
virtual void DtEmbarkationController::attachToEmbarkedParent ( const DtString newParent)
protectedvirtual

Only called when disembarkation causes the entity to be embarked on a new parent (i.e.

if disembarking from a helicopter that is embarked on a carrier, the disembarking entity is now considered embarked on the carrier)

virtual DtVector DtEmbarkationController::fallbackOffloadPoint ( )
protectedvirtual

If an entity tries to be disembarked, but, it never hears back as to where it can disembark, this is the spot that it will be disembarked to.

This is in body position. Currently, that is 0, 0, 0 if the embarkation parent information cannot be found, or it will try and place it outside of the bounding volume of the parent

virtual void DtEmbarkationController::enable ( )
protectedvirtual

Override to add set data request and message callbacks.

Reimplemented from DtTaskControllerComponent.

virtual void DtEmbarkationController::disable ( )
protectedvirtual

Override to remove set data request and message callbacks.

Reimplemented from DtTaskControllerComponent.

const DtEmbarkationController& DtEmbarkationController::operator= ( const DtEmbarkationController orig)
private

assignment operator; not implemented

Member Data Documentation

std::list<DtString> DtEmbarkationController::myEmbarkedObjects
protected
DtVrfObject* DtEmbarkationController::myControlPoint
protected

If this entity is embarking to an ingress point (or moving to the embarkation point), this object will be the point they are aiming for.

This object will be attached to the parent object that is the ultimate target of the embarkation to account for the parent object moving.

DtVrfEmbarkationPSR* DtEmbarkationController::myProcessState
protected

Container for state data associated with this component.

This state is saved and restored as part of a scenario (or checkpoint).

bool DtEmbarkationController::myWaiting
protected

If myWaiting is true, the controller is waiting for some condition to be met, so, the controller will not start working until the conditions are met.

This can be the case where an object is waiting for the control point it is moving to be created or an object that it is waiting to disembark to be created on the network.

DtEmbarkationDescriptor* DtEmbarkationController::myEmbarkationDescriptor
protected
double DtEmbarkationController::myRequestTime
protected
int DtEmbarkationController::myRequestRetries
protected
bool DtEmbarkationController::myAreCallbacksRegistered
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)