WSF
WeaponObserver.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WEAPONOBSERVER_HPP
13#define WEAPONOBSERVER_HPP
14
15#include "WeaponToolsExport.hpp"
16
17class Tool;
18#include "UtCallbackHolder.hpp"
19class WsfMover;
21class WsfTrack;
22#include "WsfWeaponEffects.hpp"
24
28
30{
31public:
33 virtual ~WeaponObserver();
34
35 void Initialize(WsfSimulation& aSimulation);
36
46
48 bool EngagementLethal() const { return mState == cTERMINATED && mResult == WsfWeaponEffects::cKILLED; }
49
51 bool WeaponTimedOut() const { return mWeaponTimedOut; }
52
54 double TimeOfFlight() const { return mTimeOfFlight; }
55
57
58
59 virtual void MoverBurnedOut(double aSimTime, WsfMover* aMoverPtr);
60
61 virtual void GuidanceComputerPhaseChanged(double aSimTime, WsfGuidanceComputer* aComputerPtr);
62
63 virtual void PlatformAdded(double aSimTime, WsfPlatform* aPlatformPtr);
64
65 virtual void PlatformDeleted(double aSimTime, WsfPlatform* aPlatformPtr);
66
67 virtual void WeaponFired(double aSimTime, const WsfWeaponEngagement* aEngagementPtr, const WsfTrack* aTargetTrackPtr);
68
69 virtual void WeaponTerminated(double aSimTime, const WsfWeaponEngagement* aEngagementPtr);
70
72
73 void LaunchAborted(double aSimTime);
74
76 EngagementState GetState() const { return mState; }
77
79 void ResetState();
80
82 void SetInFlight(double aSimTime, WsfPlatform* aPlatformPtr);
83
85 bool AllDone() const { return mAllDone; }
86
88 void SetAllDone() { mAllDone = true; }
89
91 void DisableGroundFusing() { mDisableGroundFusing = true; }
92
94 double HorizontalRange() const;
95
97 void GetImpactRelToLaunch(double aOffset[3]) const;
98
100 void GetLaunchLocLLA(double& aLaunchLat, double& aLaunchLon, double& aLaunchAlt) const
101 {
102 aLaunchLat = mLaunchLat;
103 aLaunchLon = mLaunchLon;
104 aLaunchAlt = mLaunchAlt;
105 }
106
108 void GetImpactLocLLA(double& aImpactLat, double& aImpactLon, double& aImpactAlt) const
109 {
110 aImpactLat = mImpactLat;
111 aImpactLon = mImpactLon;
112 aImpactAlt = mImpactAlt;
113 }
114
116 double GetFinalSpeed() const { return mFinalSpeed; }
117
119 double GetFinalFlightPathAngle() const { return mFinalFlightPathAngle; }
120
122 double GetLaunchTime() const { return mLaunchTime; }
123
124 WsfPlatform* GetWeaponPlatform() const;
125
126 void SetToolPtr(Tool* aToolPtr);
127
128 void GetBurnOutInfo(double& aTimeOfFlight, double& aRange, double& aAltitude, double& aSpeed, double& aFlightPathAngle);
129
130private:
131 WsfSimulation* mSimulationPtr;
132 UtCallbackHolder mCallbacks;
133 bool mAllDone;
134 bool mDisableGroundFusing;
135 EngagementState mState;
136 bool mWeaponTimedOut;
137 size_t mWeaponPlatformIndex;
138 double mLaunchTime;
139 double mImpactTime;
140 double mTimeOfFlight;
142
143 double mLaunchLat;
144 double mLaunchLon;
145 double mLaunchAlt;
146 double mLaunchHdg;
147 double mImpactLat;
148 double mImpactLon;
149 double mImpactAlt;
150
151 double mBO_TimeOfFlight;
152 double mBO_GreatCircleRange;
153 double mBO_Altitude;
154 double mBO_Speed;
155 double mBO_FlightPathAngle;
156
157 double mFinalSpeed;
158 double mFinalFlightPathAngle;
159 Tool* mToolPtr;
160};
161
162#endif
#define WT_EXPORT
Definition WeaponToolsExport.hpp:26
Definition Tool.hpp:39
double TimeOfFlight() const
Returns the time of flight of the weapon, in seconds.
Definition WeaponObserver.hpp:54
void GetLaunchLocLLA(double &aLaunchLat, double &aLaunchLon, double &aLaunchAlt) const
Returns the latitude, longitude and altitude of the launch platform at time of launch.
Definition WeaponObserver.hpp:100
void GetImpactLocLLA(double &aImpactLat, double &aImpactLon, double &aImpactAlt) const
Returns the latitude, longitude and altitude of the weapon at termination.
Definition WeaponObserver.hpp:108
void SetAllDone()
Externally sets the "All Done" status.
Definition WeaponObserver.hpp:88
void DisableGroundFusing()
Disable Ground Fusing (ignore MSL and AGL collisions).
Definition WeaponObserver.hpp:91
EngagementState
Definition WeaponObserver.hpp:40
@ cIDLE
A weapon is not currently in flight.
Definition WeaponObserver.hpp:41
@ cTERMINATED
Definition WeaponObserver.hpp:43
@ cIN_FLIGHT
A weapon is in flight.
Definition WeaponObserver.hpp:42
WeaponObserver()
Definition WeaponObserver.cpp:36
bool WeaponTimedOut() const
Returns a flag to indicate that the weapon timed out with no lethal terminal effect.
Definition WeaponObserver.hpp:51
double GetFinalSpeed() const
Returns the final of the weapon at termination.
Definition WeaponObserver.hpp:116
EngagementState GetState() const
Returns the state of the most recent engagement, which still may be in progress.
Definition WeaponObserver.hpp:76
bool AllDone() const
Returns a flag to indicate an externally-provided "All Done" status.
Definition WeaponObserver.hpp:85
double GetFinalFlightPathAngle() const
Returns the final flight path angle of the weapon at termination.
Definition WeaponObserver.hpp:119
double GetLaunchTime() const
Return the time of launch.
Definition WeaponObserver.hpp:122
bool EngagementLethal() const
Returns a flag to indicate that the intended target was killed by the weapon.
Definition WeaponObserver.hpp:48
void Initialize(WsfSimulation &aSimulation)
Definition WeaponObserver.cpp:68
Definition WsfGuidanceComputer.hpp:52
Definition WsfMover.hpp:37
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
The main controller for a simulation.
Definition WsfSimulation.hpp:109
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Result
Definition WsfWeaponEffects.hpp:63
@ cKILLED
Did result in total damage (kill) to the intended platform (a 'hit').
Definition WsfWeaponEffects.hpp:67
Definition WsfWeaponEngagement.hpp:43
Copyrights Multiple, All Rights Reserved