WSF
WsfExplicitWeapon.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 WSFEXPLICITWEAPON_HPP
13#define WSFEXPLICITWEAPON_HPP
14
15#include "wsf_mil_export.h"
16
17#include <list>
18#include <utility>
19
20#include "UtCallback.hpp"
21class UtInput;
23#include "WsfStringId.hpp"
24#include "WsfVariable.hpp"
25#include "WsfWeapon.hpp"
26
28
29class WSF_MIL_EXPORT WsfExplicitWeapon : public WsfWeapon
30{
31public:
33 ~WsfExplicitWeapon() override;
34
36
37
38 WsfWeapon* Clone() const override;
39 bool Initialize(double aSimTime) override;
40 bool Initialize2(double aSimTime) override;
41 bool ProcessInput(UtInput& aInput) override;
42 void TurnOff(double aSimTime) override;
43
45
46 FireResult Fire(double aSimTime, const FireTarget& aTarget, const FireOptions& aSettings) override;
47
48 void AbortSalvo(double aSimTime, const WsfTrackId& aTrackId) override;
49
50 double GetQuantityRemaining() const override;
51
53
56
59
60 virtual void GetLaunchDeltaV(double aDV[3]) const;
61 virtual void SetLaunchDeltaV(const double aLaunchDeltaV[3]);
62
63 size_t LastIndexFired() const { return mLastIndexLaunched; }
64
66 int GetOffsetId() const { return mIdOffset; }
67
68 void SetOffsetId(int aOffset) { mIdOffset = aOffset; }
69
70 virtual int ProcessDeferredLaunchEvent(double aSimTime, WsfPlatform* aWeaponPlatformPtr, WsfPlatform* aTempPlatformPtr);
71
74
75 void SetPlatform(WsfPlatform* aPlatformPtr) override;
76
77 // ITAR - This functionality was refactored from the WsfMover to meet EAR99 requirements, may need moved again
78 virtual bool UseDeferredLaunching() const;
79
83 {
84 public:
85 DeferredLaunch(WsfPlatform* aRealPlatformPtr, WsfPlatform* aTempPlatformPtr, WsfTrack* aLaunchTrackPtr);
86
90
94
97 };
98
104
105protected:
108
109 virtual bool AddWeaponToSimulation(double aSimTime,
110 WsfPlatform* aWeaponPlatformPtr,
111 const WsfTrack* aLaunchingTrackPtr,
112 const FireOptions& aSettings);
113
114 void InitializeCommandChains(double aSimTime, WsfPlatform* aPlatformPtr);
115
116 virtual void SetLaunchState(double aSimTime, WsfPlatform* aPlatformPtr, const FireOptions& aOptions);
117
118 virtual bool WeaponPlatformUserInitialize(double aSimTime, WsfPlatform* aWeaponPlatformPtr, const WsfTrack* aTrackPtr);
119
122 FireP(double aSimTime, const FireTarget& aTarget, const FireOptions& aSettings, WsfPlatform* aWeaponPlatformPtr);
123
125
128
132
136 std::vector<DeferredLaunch> mDeferredLaunches;
137
140
143
144 std::vector<CommandChain> mCommandChains;
145
148
153};
154
155#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
void SetPlatform(WsfPlatform *aPlatformPtr) override
Definition WsfArticulatedPart.cpp:332
WsfTrack * mLaunchTrackPtr
The track supplied on the fire command.
Definition WsfExplicitWeapon.hpp:96
WsfPlatform * mTempPlatformPtr
Definition WsfExplicitWeapon.hpp:93
WsfPlatform * mRealPlatformPtr
Definition WsfExplicitWeapon.hpp:89
DeferredLaunch(WsfPlatform *aRealPlatformPtr, WsfPlatform *aTempPlatformPtr, WsfTrack *aLaunchTrackPtr)
Definition WsfExplicitWeapon.cpp:1073
size_t mLastIndexLaunched
The platform index of the last platform successfully launched.
Definition WsfExplicitWeapon.hpp:139
void SetIsWeaponToolsGenerationMode(bool aValue)
Definition WsfExplicitWeapon.hpp:73
virtual void SetLaunchState(double aSimTime, WsfPlatform *aPlatformPtr, const FireOptions &aOptions)
Definition WsfExplicitWeapon.cpp:281
double mDeferredLaunchDelay
Definition WsfExplicitWeapon.hpp:131
std::vector< CommandChain > mCommandChains
Definition WsfExplicitWeapon.hpp:144
size_t LastIndexFired() const
Definition WsfExplicitWeapon.hpp:63
WsfExplicitWeapon & operator=(const WsfExplicitWeapon &)=delete
bool mRequireInterceptPoint
Launch computer data required.
Definition WsfExplicitWeapon.hpp:150
bool mWeaponToolsGenMode
Definition WsfExplicitWeapon.hpp:152
bool IsWeaponToolsGenerationMode() const
Definition WsfExplicitWeapon.hpp:72
virtual bool AddWeaponToSimulation(double aSimTime, WsfPlatform *aWeaponPlatformPtr, const WsfTrack *aLaunchingTrackPtr, const FireOptions &aSettings)
Definition WsfExplicitWeapon.cpp:884
bool mRequireLoftAngle
Definition WsfExplicitWeapon.hpp:151
double mLaunchDeltaV_PCS[3]
The initial velocity vector relative to the launcher.
Definition WsfExplicitWeapon.hpp:127
WsfExplicitWeapon(WsfScenario &aScenario)
Definition WsfExplicitWeapon.cpp:99
std::vector< DeferredLaunch > mDeferredLaunches
Definition WsfExplicitWeapon.hpp:136
void SetOffsetId(int aOffset)
Definition WsfExplicitWeapon.hpp:68
void SetIgnoreLaunchPlatformVelocity(bool aValue)
Indicate if the launch platform velocity should be ignored when setting the initial weapon velocity.
Definition WsfExplicitWeapon.hpp:58
void InitializeCommandChains(double aSimTime, WsfPlatform *aPlatformPtr)
Set up the command chains in the launched weapon.
Definition WsfExplicitWeapon.cpp:996
bool mIgnoreLaunchPlatformVelocity
If true, align all initial velocity along the body orientation (ignore tip-off angle).
Definition WsfExplicitWeapon.hpp:147
double GetDeferredLaunchDelay() const
Definition WsfExplicitWeapon.hpp:52
WsfScriptContext * mContextPtr
Definition WsfExplicitWeapon.hpp:124
int GetOffsetId() const
Get offset for the start of the dis entity id range for this weapon type.
Definition WsfExplicitWeapon.hpp:66
int mIdOffset
The offset value from which the platform DIS entity id value will be derived.
Definition WsfExplicitWeapon.hpp:142
virtual bool WeaponPlatformUserInitialize(double aSimTime, WsfPlatform *aWeaponPlatformPtr, const WsfTrack *aTrackPtr)
Allow for user initialization of the weapon's platform.
Definition WsfExplicitWeapon.cpp:1062
virtual WsfWeapon::FireResult FireP(double aSimTime, const FireTarget &aTarget, const FireOptions &aSettings, WsfPlatform *aWeaponPlatformPtr)
Called by Fire once it is determined that a weapon can be launched.
Definition WsfExplicitWeapon.cpp:488
bool GetIgnoreLaunchPlatformVelocity() const
Should the launch platform velocity should be ignored when setting the initial weapon velocity.
Definition WsfExplicitWeapon.hpp:55
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfScriptContext.hpp:71
Definition WsfTrackId.hpp:33
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Weapon firing options.
Definition WsfWeapon.hpp:275
Result of WsfWeapon::Fire().
Definition WsfWeapon.hpp:319
A target for a weapon to fire upon.
Definition WsfWeapon.hpp:243
bool ProcessInput(UtInput &aInput) override
Definition WsfWeapon.cpp:276
WsfWeapon(const WsfScenario &aScenario)
Definition WsfWeapon.cpp:48
WsfWeapon * Clone() const override=0
bool Initialize(double aSimTime) override
Definition WsfWeapon.cpp:187
bool Initialize2(double aSimTime) override
Definition WsfWeapon.cpp:256
virtual FireResult Fire(double aSimTime, const FireTarget &aTarget, const FireOptions &aSettings)
Definition WsfWeapon.cpp:828
virtual void AbortSalvo(double aSimTime, const WsfTrackId &aTrackId)
Definition WsfWeapon.cpp:975
virtual double GetQuantityRemaining() const
Definition WsfWeapon.cpp:1014
void TurnOff(double aSimTime) override
Definition WsfWeapon.cpp:446
Definition WsfExplicitWeapon.hpp:100
WsfStringId mCommandChainName
Definition WsfExplicitWeapon.hpp:101
WsfStringId mCommanderName
Definition WsfExplicitWeapon.hpp:102
Copyrights Multiple, All Rights Reserved