WSF
WeaponObserver Class Reference

#include <WeaponObserver.hpp>

Public Types

enum  EngagementState { cIDLE , cIN_FLIGHT , cTERMINATED }

Public Member Functions

 WeaponObserver ()
virtual ~WeaponObserver ()
void Initialize (WsfSimulation &aSimulation)
bool EngagementLethal () const
 Returns a flag to indicate that the intended target was killed by the weapon.
bool WeaponTimedOut () const
 Returns a flag to indicate that the weapon timed out with no lethal terminal effect.
double TimeOfFlight () const
 Returns the time of flight of the weapon, in seconds.

Simulation observer callbacks

virtual void MoverBurnedOut (double aSimTime, WsfMover *aMoverPtr)
 Simulation observer.
virtual void GuidanceComputerPhaseChanged (double aSimTime, WsfGuidanceComputer *aComputerPtr)
 Simulation observer.
virtual void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr)
 Simulation observer.
virtual void PlatformDeleted (double aSimTime, WsfPlatform *aPlatformPtr)
 Simulation observer.
virtual void WeaponFired (double aSimTime, const WsfWeaponEngagement *aEngagementPtr, const WsfTrack *aTargetTrackPtr)
 Simulation observer.
virtual void WeaponTerminated (double aSimTime, const WsfWeaponEngagement *aEngagementPtr)
 Simulation observer.
void LaunchAborted (double aSimTime)
EngagementState GetState () const
 Returns the state of the most recent engagement, which still may be in progress.
void ResetState ()
 Externally reset the Observer state to Idle.
void SetInFlight (double aSimTime, WsfPlatform *aPlatformPtr)
 Externally mark the state as IN_FLIGHT.
bool AllDone () const
 Returns a flag to indicate an externally-provided "All Done" status.
void SetAllDone ()
 Externally sets the "All Done" status.
void DisableGroundFusing ()
 Disable Ground Fusing (ignore MSL and AGL collisions).
double HorizontalRange () const
 Returns horizontal distance from launch point to impact point.
void GetImpactRelToLaunch (double aOffset[3]) const
 Returns (Forward, Right, Down) offset of impact relative to launch position and attitude.
void GetLaunchLocLLA (double &aLaunchLat, double &aLaunchLon, double &aLaunchAlt) const
 Returns the latitude, longitude and altitude of the launch platform at time of launch.
void GetImpactLocLLA (double &aImpactLat, double &aImpactLon, double &aImpactAlt) const
 Returns the latitude, longitude and altitude of the weapon at termination.
double GetFinalSpeed () const
 Returns the final of the weapon at termination.
double GetFinalFlightPathAngle () const
 Returns the final flight path angle of the weapon at termination.
double GetLaunchTime () const
 Return the time of launch.
WsfPlatformGetWeaponPlatform () const
void SetToolPtr (Tool *aToolPtr)
void GetBurnOutInfo (double &aTimeOfFlight, double &aRange, double &aAltitude, double &aSpeed, double &aFlightPathAngle)

Detailed Description

WeaponObserver is an observation utility to capture data on a weapon engagement. The instance will return information upon a weapon in flight, and after the weapon terminates, will allow queries on time of flight, hit or miss indication, etc.

Member Enumeration Documentation

◆ EngagementState

Enumeration indicating the state of the engagement, usually so that concerned parties can take action only after the engagement is terminated.

Enumerator
cIDLE 

A weapon is not currently in flight.

cIN_FLIGHT 

A weapon is in flight.

cTERMINATED 

A previous weapon has terminated, and data may be extracted on the result of the engagement.

Constructor & Destructor Documentation

◆ WeaponObserver()

WeaponObserver::WeaponObserver ( )

References cIDLE.

◆ ~WeaponObserver()

WeaponObserver::~WeaponObserver ( )
virtual

Member Function Documentation

◆ AllDone()

bool WeaponObserver::AllDone ( ) const
inline

Returns a flag to indicate an externally-provided "All Done" status.

◆ DisableGroundFusing()

void WeaponObserver::DisableGroundFusing ( )
inline

Disable Ground Fusing (ignore MSL and AGL collisions).

◆ EngagementLethal()

bool WeaponObserver::EngagementLethal ( ) const
inline

Returns a flag to indicate that the intended target was killed by the weapon.

References WsfWeaponEffects::cKILLED, and cTERMINATED.

◆ GetBurnOutInfo()

void WeaponObserver::GetBurnOutInfo ( double & aTimeOfFlight,
double & aRange,
double & aAltitude,
double & aSpeed,
double & aFlightPathAngle )

Accessor to get burnout state information.

Parameters
aTimeOfFlightTime of Flight at burnout
aRangeGreat Circle range at burnout
aAltitudeAltitude at burnout
aSpeedSpeed at burnout
aFlightPathAngleFlight path Angle (radians) at burnout

◆ GetFinalFlightPathAngle()

double WeaponObserver::GetFinalFlightPathAngle ( ) const
inline

Returns the final flight path angle of the weapon at termination.

◆ GetFinalSpeed()

double WeaponObserver::GetFinalSpeed ( ) const
inline

Returns the final of the weapon at termination.

◆ GetImpactLocLLA()

void WeaponObserver::GetImpactLocLLA ( double & aImpactLat,
double & aImpactLon,
double & aImpactAlt ) const
inline

Returns the latitude, longitude and altitude of the weapon at termination.

◆ GetImpactRelToLaunch()

void WeaponObserver::GetImpactRelToLaunch ( double aOffset[3]) const

Returns (Forward, Right, Down) offset of impact relative to launch position and attitude.

Calculates the (downrange, crossrange, vertical offset) of the impact location of a weapon, relative to the wings-level launch heading of the firing entity. (This does not guarantee that the impact was a target kill.)

Parameters
aOffsetThe relative offset of the impact, (forward, right, down) from the launch position.

◆ GetLaunchLocLLA()

void WeaponObserver::GetLaunchLocLLA ( double & aLaunchLat,
double & aLaunchLon,
double & aLaunchAlt ) const
inline

Returns the latitude, longitude and altitude of the launch platform at time of launch.

◆ GetLaunchTime()

double WeaponObserver::GetLaunchTime ( ) const
inline

Return the time of launch.

◆ GetState()

EngagementState WeaponObserver::GetState ( ) const
inline

Returns the state of the most recent engagement, which still may be in progress.

◆ GetWeaponPlatform()

WsfPlatform * WeaponObserver::GetWeaponPlatform ( ) const

Return the pointer to the weapon platform.

Note
This may be zero.

◆ GuidanceComputerPhaseChanged()

void WeaponObserver::GuidanceComputerPhaseChanged ( double aSimTime,
WsfGuidanceComputer * aComputerPtr )
virtual

Simulation observer.

Referenced by Initialize().

◆ HorizontalRange()

double WeaponObserver::HorizontalRange ( ) const

Returns horizontal distance from launch point to impact point.

Calculates the horizontal range traversed by an explicit weapon during its flyout, from launch to impact. (This does not guarantee that the impact was a target kill.)

◆ Initialize()

◆ LaunchAborted()

void WeaponObserver::LaunchAborted ( double aSimTime)

The current launch was aborted (the weapon was never fired).

Parameters
aSimTimeThe current simulation time.

References WsfWeaponEffects::cINVALID, and cTERMINATED.

◆ MoverBurnedOut()

void WeaponObserver::MoverBurnedOut ( double aSimTime,
WsfMover * aMoverPtr )
virtual

Simulation observer.

References cIN_FLIGHT, WsfPlatform::GetIndex(), and WsfPlatformPart::GetPlatform().

Referenced by Initialize().

◆ PlatformAdded()

void WeaponObserver::PlatformAdded ( double aSimTime,
WsfPlatform * aPlatformPtr )
virtual

Simulation observer.

Referenced by Initialize().

◆ PlatformDeleted()

void WeaponObserver::PlatformDeleted ( double aSimTime,
WsfPlatform * aPlatformPtr )
virtual

Simulation observer.

References cIN_FLIGHT, cTERMINATED, and WsfPlatform::GetIndex().

Referenced by Initialize().

◆ ResetState()

void WeaponObserver::ResetState ( )

Externally reset the Observer state to Idle.

References cIDLE, and WsfWeaponEffects::cINVALID.

◆ SetAllDone()

void WeaponObserver::SetAllDone ( )
inline

Externally sets the "All Done" status.

◆ SetInFlight()

void WeaponObserver::SetInFlight ( double aSimTime,
WsfPlatform * aPlatformPtr )

Externally mark the state as IN_FLIGHT.

Externally reset the Observer state to Inflight. Normally this is done when the WeaponFired event is detected, but no such event occurs when the thing fired is not a weapon (does not have a weapon_effect). (See SpaceLaunchComputerGenerator::PlatformAdded).

References cIDLE, cIN_FLIGHT, WsfWeaponEffects::cINVALID, cTERMINATED, and WsfPlatform::GetIndex().

◆ SetToolPtr()

void WeaponObserver::SetToolPtr ( Tool * aToolPtr)

Specify what weapon Tool is to interact with this object. The purpose for this method is to allow the Observer objects to register for such methods as PlatformAdded(), and callbacks to be made back into virtual methods for the Tool class object methods of the same name.

◆ TimeOfFlight()

double WeaponObserver::TimeOfFlight ( ) const
inline

Returns the time of flight of the weapon, in seconds.

◆ WeaponFired()

void WeaponObserver::WeaponFired ( double aSimTime,
const WsfWeaponEngagement * aEngagementPtr,
const WsfTrack * aTargetTrackPtr )
virtual

◆ WeaponTerminated()

◆ WeaponTimedOut()

bool WeaponObserver::WeaponTimedOut ( ) const
inline

Returns a flag to indicate that the weapon timed out with no lethal terminal effect.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved