WSF
WsfHighEnergyLaser.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 WSFHIGHENERGYLASER_HPP
13#define WSFHIGHENERGYLASER_HPP
14
15#include "wsf_mil_export.h"
16
17#include <mutex>
18
19class UtInput;
22#include "WsfException.hpp"
23class WsfGeoPoint;
24#include "WsfObject.hpp"
25#include "WsfObjectTypeList.hpp"
26
33{
34public:
38 ~WsfHighEnergyLaser() override = default;
39
40 WsfDirectedEnergyWeapon::Beam* Clone() const override = 0;
41
42 bool ProcessInput(UtInput& aInput) override;
43
44 virtual bool Initialize(WsfDirectedEnergyWeapon* aWeaponPtr);
45
46 virtual void OutputConfiguration() const {};
47
49
50 // Controlling methods for the laser.
51 virtual void BeginLasing(double aSimTime, size_t aTargetIndex, const std::string& aTargetOffsetName = "");
52
53 void UpdateLasing(double aSimTime); // same track as before
54
55 virtual void EndLasing(double aSimTime);
56
58 bool IsLasing() const { return mIsLasing; }
59
61 double GetIncidenceAngle() const override { return mIncidenceAngle; }
62
66 virtual bool TargetOccluded() const { return mTargetOccluded; }
67
73 virtual bool TestLasing(double aDuration, size_t aTargetIndex, const std::string& aTargetOffset = "")
74 {
75 return false;
76 }
77
84 virtual bool TestLasing(double aDuration, const WsfGeoPoint& aSourceLocation, const WsfGeoPoint& aTargetLocation)
85 {
86 return false;
87 }
88
94 virtual double RequiredDurationEnergy(double aEnergy, const WsfGeoPoint& aSourceLocation, const WsfGeoPoint& aTargetLocation)
95 {
96 return 0.0;
97 }
98
104 virtual double RequiredDurationFluence(double aEnergyDensity,
105 const WsfGeoPoint& aSourceLocation,
106 const WsfGeoPoint& aTargetLocation)
107 {
108 return 0.0;
109 }
110
116 virtual double RequiredDurationEnergy(double aEnergy, int aTargetIndex, const std::string& aTargetOffset = "")
117 {
118 return 0.0;
119 }
120
126 virtual double RequiredDurationFluence(double aEnergyDensity, size_t aTargetIndex, const std::string& aTargetOffset = "")
127 {
128 return 0.0;
129 }
130
138 virtual bool UpdateEngagementGeometry(double aSimTime,
139 size_t aTargetIndex,
140 const std::string& aTargetOffset = "",
141 bool aAddJitter = true);
142
145 double GetDamageRadius() const { return mDamageRadius; }
146
151
154 virtual void SetDamageRadius(double aDamageRadius) { mDamageRadius = aDamageRadius; }
155
156 virtual void SetAtmosphericStructure(const std::string& aAtmosphericStructure)
157 {
158 mTurbulenceModel.SetCN2Form(aAtmosphericStructure);
159 }
160
162 double GetJitter() const { return mJitterExpectedValue; }
163
165 void SetJitter(double aJitter) { mJitterExpectedValue = aJitter; }
166
168 size_t GetTargetIndex() const { return mTargetIndex; }
169
171 double GetTargetRange() const { return mTargetRange; }
172
174 void SetBeamQuality(double aBeamQuality) { mBeamQuality = aBeamQuality; }
175
177 virtual double GetWindowStrehl() const { return 1.0; }
178
180 virtual void SetWindowStrehl(double aWindowStrehl) {}
181
183 virtual double GetAeroStrehl() const { return 1.0; }
184
186 virtual void SetAeroStrehl(double aAeroStrehl) {}
187
189 virtual double GetSystemStrehl() const { return 1.0; }
190
192 virtual void SetSystemStrehl(double aSystemStrehl) {}
193
195 virtual double GetSystemTransmission() const { return 1.0; }
196
198
199protected:
200 void Propagate(double aSimTime) override = 0; // Pure virtual; define in child classes
201
204
207
210
213
215 bool mDebug;
221
223};
224
225class WsfHighEnergyLaserTypes : public WsfObjectTypeList<WsfHighEnergyLaser>
226{
227public:
229
230 static WSF_MIL_EXPORT WsfHighEnergyLaserTypes& Get(WsfScenario& aScenario);
231 static WSF_MIL_EXPORT const WsfHighEnergyLaserTypes& Get(const WsfScenario& aScenario);
233
235 ~WsfHighEnergyLaserTypes() override = default;
236 WsfHighEnergyLaser* Create(const std::string& aName) const;
237};
238
239#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfDirectedEnergyWeapon.hpp:65
bool ProcessInput(UtInput &aInput) override
Definition WsfDirectedEnergyWeapon.cpp:168
void Initialize()
Initialize the beam structure elements to initial values.
Definition WsfDirectedEnergyWeapon.cpp:199
Definition WsfDirectedEnergyWeapon.hpp:27
Definition WsfGeoPoint.hpp:29
~WsfHighEnergyLaserTypes() override=default
WsfHighEnergyLaser * Create(const std::string &aName) const
Definition WsfHighEnergyLaser.cpp:59
WsfHighEnergyLaserTypes(WsfScenario &aScenario)
Definition WsfHighEnergyLaser.cpp:50
static WSF_MIL_EXPORT WsfHighEnergyLaserTypes & Get(WsfScenario &aScenario)
Return a modifiable reference to the type list associated with the specified scenario.
Definition WsfHighEnergyLaser.cpp:37
This implementation is decoupled from the weapon class to handle only laser-related effects,...
Definition WsfHighEnergyLaser.hpp:33
~WsfHighEnergyLaser() override=default
double mLastUpdateTime
Definition WsfHighEnergyLaser.hpp:216
double mIncidenceAngle
Definition WsfHighEnergyLaser.hpp:206
virtual double RequiredDurationEnergy(double aEnergy, const WsfGeoPoint &aSourceLocation, const WsfGeoPoint &aTargetLocation)
Definition WsfHighEnergyLaser.hpp:94
WsfDirectedEnergyWeapon::Beam * Clone() const override=0
Clone this object.
bool mTargetOccluded
Definition WsfHighEnergyLaser.hpp:211
double mJitterExpectedValue
Definition WsfHighEnergyLaser.hpp:219
virtual void SetAtmosphericStructure(const std::string &aAtmosphericStructure)
Definition WsfHighEnergyLaser.hpp:156
virtual bool TestLasing(double aDuration, const WsfGeoPoint &aSourceLocation, const WsfGeoPoint &aTargetLocation)
Definition WsfHighEnergyLaser.hpp:84
bool IsLasing() const
Return whether the weapon is currently lasing.
Definition WsfHighEnergyLaser.hpp:58
bool mIsLasing
Definition WsfHighEnergyLaser.hpp:214
virtual double RequiredDurationFluence(double aEnergyDensity, const WsfGeoPoint &aSourceLocation, const WsfGeoPoint &aTargetLocation)
Definition WsfHighEnergyLaser.hpp:104
WsfDirectedEnergyWeapon * GetWeapon() const
Definition WsfHighEnergyLaser.hpp:48
void SetJitter(double aJitter)
Set the expected value for the jitter of the HEL on target.
Definition WsfHighEnergyLaser.hpp:165
WsfStringId mTargetOffsetName
Definition WsfHighEnergyLaser.hpp:209
bool mDebug
Definition WsfHighEnergyLaser.hpp:215
double GetIncidenceAngle() const override
Return the incidence angle of the laser on the target.
Definition WsfHighEnergyLaser.hpp:61
double GetTargetRange() const
Get the current range to target (only valid while IsLasing is true).
Definition WsfHighEnergyLaser.hpp:171
void Propagate(double aSimTime) override=0
virtual bool TestLasing(double aDuration, size_t aTargetIndex, const std::string &aTargetOffset="")
Definition WsfHighEnergyLaser.hpp:73
WsfHighEnergyLaser & operator=(const WsfHighEnergyLaser &)=delete
double GetJitter() const
Get the expected value for the jitter of the HEL on target.
Definition WsfHighEnergyLaser.hpp:162
size_t GetTargetIndex() const
Get the current target index (valid only while IsLasing is true).
Definition WsfHighEnergyLaser.hpp:168
virtual void OutputConfiguration() const
Definition WsfHighEnergyLaser.hpp:46
bool mCalculateIncidence
Definition WsfHighEnergyLaser.hpp:205
double mBeamQuality
Definition WsfHighEnergyLaser.hpp:220
virtual void SetSystemStrehl(double aSystemStrehl)
Set the total rms system strehl.
Definition WsfHighEnergyLaser.hpp:192
bool mSysInit
The weapon object associated with the HEL.
Definition WsfHighEnergyLaser.hpp:203
wsf::AtmosphericTurbulence mTurbulenceModel
Definition WsfHighEnergyLaser.hpp:222
double mTargetRange
Definition WsfHighEnergyLaser.hpp:212
double GetDefaultDamageRadius() const
Definition WsfHighEnergyLaser.hpp:150
size_t mTargetIndex
Definition WsfHighEnergyLaser.hpp:208
double mDefaultDamageRadius
Definition WsfHighEnergyLaser.hpp:218
virtual double GetSystemTransmission() const
Get the system transmission, if available (default is 1.0).
Definition WsfHighEnergyLaser.hpp:195
double mDamageRadius
Definition WsfHighEnergyLaser.hpp:217
virtual double GetWindowStrehl() const
Get the strehl due to window effects (default is 1.0 [no effect]).
Definition WsfHighEnergyLaser.hpp:177
virtual void SetDamageRadius(double aDamageRadius)
Definition WsfHighEnergyLaser.hpp:154
virtual bool TargetOccluded() const
Definition WsfHighEnergyLaser.hpp:66
WsfDirectedEnergyWeapon * mWeaponPtr
Definition WsfHighEnergyLaser.hpp:202
virtual double RequiredDurationFluence(double aEnergyDensity, size_t aTargetIndex, const std::string &aTargetOffset="")
Definition WsfHighEnergyLaser.hpp:126
virtual double RequiredDurationEnergy(double aEnergy, int aTargetIndex, const std::string &aTargetOffset="")
Definition WsfHighEnergyLaser.hpp:116
WsfHighEnergyLaser(WsfScenario &aScenario)
Definition WsfHighEnergyLaser.cpp:74
virtual void SetAeroStrehl(double aAeroStrehl)
Set the areo strehl (strehl from aerooptics; should be between 0 and 1).
Definition WsfHighEnergyLaser.hpp:186
virtual double GetSystemStrehl() const
Get the total rms strehl from all sources.
Definition WsfHighEnergyLaser.hpp:189
double GetDamageRadius() const
Definition WsfHighEnergyLaser.hpp:145
virtual double GetAeroStrehl() const
Get the aero strehl (strehl from aerooptics; should be between 0 and 1).
Definition WsfHighEnergyLaser.hpp:183
void SetBeamQuality(double aBeamQuality)
Set the beam quality wrt a perfect Gaussian beam.
Definition WsfHighEnergyLaser.hpp:174
virtual void SetWindowStrehl(double aWindowStrehl)
Set the window strehl (should be between 0 and 1).
Definition WsfHighEnergyLaser.hpp:180
WsfObjectTypeList(WsfScenario &aScenario, unsigned int aFlags, const std::string &aBlockName)
Definition WsfObjectTypeList.hpp:76
WsfSimulation * GetSimulation() const
Definition WsfPlatformPart.cpp:689
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfAtmosphericTurbulence.hpp:55
Copyrights Multiple, All Rights Reserved