|
WSF
|
#include <WsfWeaponTrackProcessor.hpp>


Classes | |
| struct | Sensor |
Public Types | |
| enum | EngagementPhase { cMID_COURSE , cTERMINAL } |
| using | ComponentList = WsfComponentListT<WsfProcessorComponent> |
| Public Types inherited from WsfPlatformPart | |
| enum | { cLEVEL_ONE_DEBUG = 0x00000001 , cLEVEL_TWO_DEBUG = 0x00000002 } |
| using | InternalMessageQueue = std::queue<WsfMessage*> |
| using | RecipientMessageQueue = std::queue<std::pair<WsfPlatformPart*, WsfMessage*>> |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
| Public Types inherited from WsfComponentT< WsfPlatform > | |
| typedef WsfPlatform | ParentType |
| This is needed to support the WsfComponentList template. | |
Public Member Functions | |
| WsfWeaponTrackProcessor (WsfScenario &aScenario) | |
| ~WsfWeaponTrackProcessor () override | |
| WsfProcessor * | Clone () const override |
| bool | Initialize (double aSimTime) override |
| bool | Initialize2 (double aSimTime) override |
| bool | ProcessInput (UtInput &aInput) override |
| bool | ProcessMessage (double aSimTime, const WsfMessage &aMessage) override |
| void | Update (double aSimTime) override |
| EngagementPhase | GetEngagementPhase () const |
| void | SetPlatform (WsfPlatform *aPlatformPtr) override |
| void | SetCurrentTarget (double aSimTime, WsfTrack *aTrackPtr) |
| Public Member Functions inherited from WsfProcessor | |
| WsfProcessor (const WsfScenario &aScenario) | |
| ~WsfProcessor () override=default | |
| ComponentList & | GetComponents () |
| const ComponentList & | GetComponents () const |
| virtual void | ProcessCallback (double aSimTime, const WsfCallback &aCallback) |
| WsfComponent * | CloneComponent () const override |
| const int * | GetComponentRoles () const override |
| void * | QueryInterface (int aRole) override |
| int | GetComponentInitializationOrder () const override |
| const char * | GetScriptClassName () const override |
| bool | PreInitialize (double aSimTime) override |
| void | PreInput () override |
| void | TurnOff (double aSimTime) override |
| void | TurnOn (double aSimTime) override |
| void | SetNonOperational (double aSimTime) override |
| void | SetOperational (double aSimTime) override |
| void | PartBroken (double aSimTime) override |
| double | GetUpdateInterval () const override |
| void | SetUpdateInterval (double aUpdateInterval) override |
| Public Member Functions inherited from WsfPlatformPart | |
| WsfPlatformPart (const WsfScenario &aScenario, int aPartType) | |
| WsfPlatformPart & | operator= (const WsfPlatformPart &aRhs)=delete |
| ~WsfPlatformPart () override | |
| bool | DebugEnabled () const |
| Returns 'true' if debugging is enabled for this instance. | |
| void | SetDebugEnabled (bool aDebugEnabled) |
| unsigned int | GetDebugMask () |
| bool | IsExternallyControlled () const |
| virtual void | SetExternallyControlled (double aSimTime, bool aIsExternallyControlled) |
| int | GetPartType () const |
| const char * | GetScriptClassName () const override |
| WsfSimulation * | GetSimulation () const |
| const WsfScenario & | GetScenario () const |
| WsfStringId | GetComponentName () const override |
| void | ComponentParentChanged (WsfPlatform *aPlatformPtr) override |
| WsfPlatform * | GetPlatform () const |
| virtual void | PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr) |
| virtual void | PlatformDeleted (WsfPlatform *aPlatformPtr) |
| double | GetLastStatusChangeTime () const |
| void | SetLastStatusChangeTime (double aSimTime) |
| Allows a system to set the time at which the device was initialized. | |
| bool | CanBeMadeOperational () const |
| Returns an indication that this system can be made operational. | |
| bool | CanBeMadeNonOperational () const |
| Returns an indication that this system can be made non-operational. | |
| bool | CanBeTurnedOn () const |
| Returns an indication that this system can be turned on. | |
| bool | CanBeTurnedOff () const |
| Returns an indication that this system can be turned off. | |
| bool | IsTurnedOn () const |
| bool | InitiallyTurnedOn () const |
| Is the system to be turned 'on' when added to the simulation? | |
| void | SetInitiallyTurnedOn (bool aInitiallyTurnedOn) |
| Sets if the system is turned on when added to the simulation. | |
| virtual void | Restore (double aSimTime) |
| bool | IsOperational () const |
| bool | SetOperational (double aSimTime, bool aMakeOperational) |
| double | GetDamageFactor () const |
| bool | SetDamageFactor (double aSimTime, double aDamageFactor) |
| bool | IsCritical () const |
| void | SetCritical (bool aValue) |
| virtual void | OnPlatformBrokenEvent (double aSimTime) |
| Owning platform has issued a broken event. | |
| bool | IsBroken () const |
| WsfInternalLinks & | GetInternalLinks () |
| Return the internal links for this part. | |
| virtual bool | HasInternalLinks () const |
| Does this platform part have a communication link to other platform parts? | |
| virtual bool | ReceiveMessage (double aSimTime, const WsfMessage &aMessage) |
| virtual void | SendMessage (double aSimTime, const WsfMessage &aMessage) |
| virtual void | SendMessageTo (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId) |
| void | SendMessageToProcessor (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId) |
| virtual void | SendQueuedMessages (double aSimTime) |
| const WsfCategoryList & | GetCategories () const |
| Get the categories to which this part belongs. | |
| void | AddCategory (WsfStringId aCategoryId) |
| Adds the provided category to the platform part's category list. | |
| bool | IsCategoryMember (WsfStringId aCategoryId) const |
| const WsfGroupList & | GetGroups () const |
| Get the groups to which this platform part belongs. | |
| void | JoinGroup (WsfGroup *aGroupPtr) |
| Join the given group. | |
| void | LeaveGroup (WsfGroup *aGroupPtr) |
| Leave the given group. | |
| bool | IsGroupMember (WsfStringId aGroupId) |
| unsigned int | GetUpdateEventEpoch () const |
| void | IncrementUpdateEventEpoch () |
| bool | UpdateEventActive () const |
| Is an 'Update' event active? | |
| void | SetUpdateEventActive (bool aUpdateEventActive) |
| Indicate if the 'Update' event is active. | |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
| Public Member Functions inherited from WsfComponentT< WsfPlatform > | |
| WsfComponentT () | |
| WsfComponentT (const WsfComponentT &) noexcept | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| ParentType * | GetComponentParent () const |
| void | SetComponentParent (ParentType *aParentPtr) |
| Public Member Functions inherited from WsfComponent | |
| virtual | ~WsfComponent ()=default |
| template<typename T> | |
| bool | QueryInterfaceT (T *&aRolePtr) |
| bool | ComponentHasRole (int aRole) |
| Returns true if the component has the specified role. | |
| Public Member Functions inherited from WsfUniqueId | |
| WsfUniqueId () | |
| Construtor initializes the unique identifier to 0. | |
| WsfUniqueId (const WsfUniqueId &) | |
| Copy constructor initializes the unique identifier to 0. | |
| WsfUniqueId & | operator= (const WsfUniqueId &) |
| unsigned int | GetUniqueId () const |
| Get the unique identifier assigned to this object. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| Public Member Functions inherited from WsfAuxDataEnabled | |
| WsfAuxDataEnabled ()=default | |
| WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default | |
| WsfAuxDataEnabled & | operator= (const WsfAuxDataEnabled &aRhs) |
| WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default | |
| WsfAuxDataEnabled & | operator= (WsfAuxDataEnabled &&)=default |
| virtual | ~WsfAuxDataEnabled () noexcept |
| void | SetAuxData (const WsfAttributeContainer &aAuxData) |
| void | DeleteAuxData () |
| Delete the aux data container from the object. | |
| void | MergeAuxData (const WsfAuxDataEnabled &aSrc) |
| Merge the object's aux data with aux data from an existing object. | |
| void | UpdateAuxData (const WsfAuxDataEnabled &aSrc) |
| Update the object's aux data with aux data from an existing object. | |
| bool | HasAuxData () const |
| Returns true if this object has aux data. | |
| bool | ProcessInput (UtInput &aInput) |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| (De)serialization for XIO | |
| WsfAttributeContainer & | GetAuxData () |
| const WsfAttributeContainer & | GetAuxData () const noexcept |
| const WsfAttributeContainer & | GetAuxDataConst () const noexcept |
Protected Member Functions | |
| WsfWeaponTrackProcessor (const WsfWeaponTrackProcessor &aSrc) | |
| WsfWeaponTrackProcessor & | operator= (const WsfWeaponTrackProcessor &)=delete |
| virtual void | GetInterceptData (double aSimTime, double &aTimeToGo, double &aRangeToGo, double &aRangeToTgt) |
| virtual void | ProcessTrackDrop (double aSimTime, const WsfTrackId &aTrackId) |
| virtual void | ProcessTrackUpdate (double aSimTime, const WsfTrack &aTrack) |
| virtual void | UpdateTargetTrack (double aSimTime, bool aAdjustUpdateInterval) |
| WsfProcessor (const WsfProcessor &aSrc) | |
| Copy constructor (for Clone()). | |
| WsfProcessor & | operator= (const WsfProcessor &aRhs)=delete |
| WsfPlatformPart (const WsfPlatformPart &aSrc) | |
| Copy constructor (for Clone()). | |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
| Protected Member Functions inherited from WsfUniqueId | |
| void | AssignUniqueId (WsfSimulation *aSimulationPtr) |
Static Protected Member Functions | |
| static bool | FindIntercept (const double aWpnLocWCS[3], double aWpnSpeed, const double aTgtLocWCS[3], const double aTgtVelWCS[3], double aIntLocWCS[3]) |
Additional Inherited Members | |
| Static Public Attributes inherited from WsfAuxDataEnabled | |
| static UtCallbackListN< void(const WsfAuxDataEnabled *)> | AuxDataAccessed |
| static UtCallbackListN< void(const WsfAuxDataEnabled *)> | AuxDataDestroyed |
A processor that is responsible for maintaining the current perception of the target.
This processor is designed to be used on weapons (like missiles or smart bombs) to maintain the 'Current Target' track object on the platform to which the processor is attached (The 'Current Target' is used by WsfGuidanceProcessor to determine the guidance commands which are then fed to the mover or by some missile movers which have their own embedded guidance computer).
The processor accepts track input from multiple source and forms the current target track. For command guidance this is simply taking a track from datalink and making it the current target. For active guidance this is simply taking the track from the seeker and making it the current target. For track-via-missile this may mean taking a combination of the two in order to make the current target.
| WsfWeaponTrackProcessor::WsfWeaponTrackProcessor | ( | WsfScenario & | aScenario | ) |
References cMID_COURSE, WsfProcessor::SetUpdateInterval(), and WsfProcessor::WsfProcessor().
Referenced by Clone(), operator=(), and WsfWeaponTrackProcessor().
|
override |
|
protected |
References WsfProcessor::WsfProcessor(), and WsfWeaponTrackProcessor().
|
overridevirtual |
Create a clone of this object.
Implements WsfProcessor.
References WsfProcessor::WsfProcessor(), and WsfWeaponTrackProcessor().
|
staticprotected |
Determine minimum-time intercept point.
Given a weapon location and speed and a target location and velocity vector, determine the intercept location (and therefore the desired weapon heading and the time-to-intercept). This method assumes the bodies move at a constant speed and that the weapon can turn instantly to the best heading.
| aWpnLocWCS | [input] The WCS location of the weapon. |
| aWpnSpeed | [input] The speed of the weapon. |
| aTgtLocWCS | [input] The WCS location of the target. |
| aTgtVelWCS | [input] The WCS velocity of the target. |
| aIntLocWCS | [output] The WCS location of the intercept. (valid only if the function return value is 'true') |
Referenced by GetInterceptData(), and operator=().
|
inline |
|
protectedvirtual |
|
overridevirtual |
Perform phase 1 initialization of the part. This is invoked by WsfPlatform::Initialize() during phase 1 initialization of the platform. During phase 1 initialization, platform components must not assume the existence of ANY data that is the responsibility of another platform component. In particular, the platform location and initial tracks cannot be assumed to be valid.
| aSimTime | The current simulation time. |
Reimplemented from WsfProcessor.
References WsfComponentList::GetComponent(), WsfPlatformPart::GetPlatform(), WsfProcessor::Initialize(), WsfWeaponTrackProcessor::Sensor::mSensorName, WsfWeaponTrackProcessor::Sensor::mSensorPtr, WsfWeaponTrackProcessor::Sensor::mTurnOnRange, WsfWeaponTrackProcessor::Sensor::mTurnOnTime, and ok.
|
overridevirtual |
Perform phase 2 initialization of the part. This is invoked by WsfPlatform::Initialize() during phase 2 initialization of the platform. During phase 2, platform components may assume that the platform location has been defined, initial tracks have been loaded and that all components have completed phase 1 initialization.
| aSimTime | The current simulation time. |
Reimplemented from WsfProcessor.
References WsfTrackListT< T >::FindTrack(), WsfTrackManager::GetCurrentTarget(), WsfPlatform::GetMasterTrackList(), WsfPlatformPart::GetPlatform(), WsfPlatform::GetTrackManager(), WsfProcessor::Initialize2(), ok, and trackPtr.
|
protecteddelete |
|
overridevirtual |
Process input from a generic source.
Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
Reimplemented from WsfProcessor.
References WsfWeaponTrackProcessor::Sensor::mSensorName, WsfWeaponTrackProcessor::Sensor::mSensorPtr, WsfWeaponTrackProcessor::Sensor::mTurnOnRange, WsfWeaponTrackProcessor::Sensor::mTurnOnTime, WsfWeaponTrackProcessor::Sensor::mUseTargetLocation, and WsfProcessor::ProcessInput().
|
overridevirtual |
Process a received message.
| aSimTime | The current simulation time. |
| aMessage | The message that is being sent. |
Reimplemented from WsfPlatformPart.
References WsfTrackMessage::GetTrack(), WsfTrackDropMessage::GetTrackId(), WsfMessage::GetType(), WsfTrackDropMessage::GetTypeId(), WsfTrackMessage::GetTypeId(), ProcessTrackDrop(), and ProcessTrackUpdate().
|
protectedvirtual |
Drop a track from the track list and update the current target state.
| aSimTime | [input] The current simulation time. |
| aTrackId | [input] The track ID of the track being dropped. |
References WsfTrackManager::ClearCurrentTarget(), WsfPlatformPart::DebugEnabled(), WsfPlatform::GetMasterTrackList(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), WsfPlatform::GetTrackManager(), WsfObserver::LocalTrackDropped(), WsfTrackListT< T >::RemoveTrack(), trackPtr, and UpdateTargetTrack().
Referenced by operator=(), and ProcessMessage().
|
protectedvirtual |
Update the track list and, if necessary, the current target state.
| aSimTime | [input] The current simulation time. |
| aTrack | [input] The updated track. |
References WsfTrackManager::AddTrackReport(), WsfPlatformPart::DebugEnabled(), WsfTrackManager::FindCorrelatedTrack(), WsfObject::GetName(), WsfObject::GetNameId(), WsfTrack::GetOriginatorNameId(), WsfTrackId::GetOwningPlatformId(), WsfPlatformPart::GetPlatform(), WsfTrack::GetSensorModeId(), WsfTrack::GetSensorNameId(), WsfTrack::GetTargetIndex(), WsfTrack::GetTrackId(), WsfPlatform::GetTrackManager(), WsfTrack::GetUpdateTime(), targetIndex(), trackPtr, and UpdateTargetTrack().
Referenced by operator=(), and ProcessMessage().
| void WsfWeaponTrackProcessor::SetCurrentTarget | ( | double | aSimTime, |
| WsfTrack * | aTrackPtr ) |
References WsfPlatformPart::DebugEnabled(), WsfObject::GetName(), WsfTrack::GetOriginatorNameId(), WsfPlatformPart::GetPlatform(), WsfTrack::GetSensorModeId(), WsfTrack::GetSensorNameId(), WsfTrack::GetTrackId(), WsfPlatform::GetTrackManager(), WsfTrack::GetUpdateTime(), and WsfTrackManager::SetCurrentTarget().
Referenced by UpdateTargetTrack().
|
overridevirtual |
Set the platform to which this part is associated.
| aPlatformPtr | Pointer to the containing platform. |
Reimplemented from WsfPlatformPart.
References WsfPlatform::GetScriptContext(), and WsfPlatformPart::SetPlatform().
|
overridevirtual |
Update the state of the processor. This method should perform any actions that are necessary so that the system reflects its condition at the supplied time.
| aSimTime | The current simulation time. |
Reimplemented from WsfProcessor.
References WsfPlatformPart::DebugEnabled(), WsfWeaponEngagement::Find(), WsfPlatform::GetCreationTime(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfPlatformPart::GetSimulation(), WsfPlatformPart::IsOperational(), WsfPlatformPart::IsTurnedOn(), WsfWeaponTrackProcessor::Sensor::mSensorPtr, WsfWeaponTrackProcessor::Sensor::mTurnOnRange, WsfWeaponTrackProcessor::Sensor::mTurnOnTime, WsfWeaponTrackProcessor::Sensor::mUseTargetLocation, WsfWeaponEngagement::SetExtendedResult(), WsfSensor::StartTracking(), WsfWeaponEngagement::Terminate(), WsfSimulation::TurnPartOn(), and UpdateTargetTrack().
|
protectedvirtual |
Form the current perception of the target.
| aSimTime | [input] The current simulation time. |
| aAdjustUpdateInterval | [input] If 'true' and in mid-course, this method will adjust the update interval (if necessary) to better resolve the time at which the switch to terminal phase should occur. |
References cMID_COURSE, cTERMINAL, WsfPlatformPart::DebugEnabled(), WsfTrackManager::GetCurrentTarget(), GetInterceptData(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfPlatformPart::GetSimulation(), WsfPlatform::GetTrackManager(), WsfProcessor::GetUpdateInterval(), SetCurrentTarget(), WsfProcessor::SetUpdateInterval(), and trackPtr.
Referenced by operator=(), ProcessTrackDrop(), ProcessTrackUpdate(), and Update().