|
WSF
|
#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. | |
| WsfPlatform * | GetWeaponPlatform () const |
| void | SetToolPtr (Tool *aToolPtr) |
| void | GetBurnOutInfo (double &aTimeOfFlight, double &aRange, double &aAltitude, double &aSpeed, double &aFlightPathAngle) |
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.
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. |
| WeaponObserver::WeaponObserver | ( | ) |
References cIDLE.
|
virtual |
|
inline |
Returns a flag to indicate an externally-provided "All Done" status.
|
inline |
Disable Ground Fusing (ignore MSL and AGL collisions).
|
inline |
Returns a flag to indicate that the intended target was killed by the weapon.
References WsfWeaponEffects::cKILLED, and cTERMINATED.
| void WeaponObserver::GetBurnOutInfo | ( | double & | aTimeOfFlight, |
| double & | aRange, | ||
| double & | aAltitude, | ||
| double & | aSpeed, | ||
| double & | aFlightPathAngle ) |
Accessor to get burnout state information.
| aTimeOfFlight | Time of Flight at burnout |
| aRange | Great Circle range at burnout |
| aAltitude | Altitude at burnout |
| aSpeed | Speed at burnout |
| aFlightPathAngle | Flight path Angle (radians) at burnout |
|
inline |
Returns the final flight path angle of the weapon at termination.
|
inline |
Returns the final of the weapon at termination.
|
inline |
Returns the latitude, longitude and altitude of the weapon at termination.
| 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.)
| aOffset | The relative offset of the impact, (forward, right, down) from the launch position. |
|
inline |
Returns the latitude, longitude and altitude of the launch platform at time of launch.
|
inline |
Return the time of launch.
|
inline |
Returns the state of the most recent engagement, which still may be in progress.
| WsfPlatform * WeaponObserver::GetWeaponPlatform | ( | ) | const |
Return the pointer to the weapon platform.
|
virtual |
Simulation observer.
Referenced by Initialize().
| 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.)
| void WeaponObserver::Initialize | ( | WsfSimulation & | aSimulation | ) |
References GuidanceComputerPhaseChanged(), WsfObserver::GuidanceComputerPhaseChanged(), MoverBurnedOut(), WsfObserver::MoverBurnedOut(), PlatformAdded(), WsfObserver::PlatformAdded(), PlatformDeleted(), WsfObserver::PlatformDeleted(), WeaponFired(), WsfObserver::WeaponFired(), WeaponTerminated(), and WsfObserver::WeaponTerminated().
| void WeaponObserver::LaunchAborted | ( | double | aSimTime | ) |
The current launch was aborted (the weapon was never fired).
| aSimTime | The current simulation time. |
References WsfWeaponEffects::cINVALID, and cTERMINATED.
|
virtual |
Simulation observer.
References cIN_FLIGHT, WsfPlatform::GetIndex(), and WsfPlatformPart::GetPlatform().
Referenced by Initialize().
|
virtual |
Simulation observer.
Referenced by Initialize().
|
virtual |
Simulation observer.
References cIN_FLIGHT, cTERMINATED, and WsfPlatform::GetIndex().
Referenced by Initialize().
| void WeaponObserver::ResetState | ( | ) |
Externally reset the Observer state to Idle.
References cIDLE, and WsfWeaponEffects::cINVALID.
|
inline |
Externally sets the "All Done" status.
| 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().
| 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.
|
inline |
Returns the time of flight of the weapon, in seconds.
|
virtual |
Simulation observer.
References WsfComponentList::RoleIterator< T >::AtEnd(), cIDLE, cIN_FLIGHT, WsfWeaponEffects::cINVALID, WsfWeaponFuse::cNO_LIMIT, cTERMINATED, WsfWeaponEngagement::GetFiringPlatform(), and WsfWeaponEngagement::GetWeaponPlatformIndex().
Referenced by Initialize().
|
virtual |
Simulation observer.
References WsfComponentList::RoleIterator< T >::AtEnd(), cIN_FLIGHT, cTERMINATED, WsfWeaponFuse::cTOF_LIMIT, WsfWeaponEngagement::GetCompletionTime(), WsfWeaponEngagement::GetFiringPlatform(), WsfWeaponEngagement::GetTargetResult(), and WsfWeaponEngagement::GetWeaponPlatformIndex().
Referenced by Initialize().
|
inline |
Returns a flag to indicate that the weapon timed out with no lethal terminal effect.