WSF
WsfEW_TrackEffect.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// Updated by Infoscitex, a DCS Company
13// ****************************************************************************
14
15#ifndef WSFEW_TRACKEFFECT_HPP
16#define WSFEW_TRACKEFFECT_HPP
17
18#include "wsf_mil_export.h"
19
20#include <cfloat>
21
22#include "UtCallbackHolder.hpp"
23#include "UtMath.hpp"
24class UtInput;
25
27#include "WsfEW_PulseEffect.hpp"
28class WsfSensor;
29class WsfSensorMode;
30class WsfTrack;
31
33
34class WSF_MIL_EXPORT WsfEW_TrackEffect : public WsfEW_PulseEffect
35{
36public:
39 ~WsfEW_TrackEffect() override = default;
40
41 WsfEW_Effect* Clone() const override;
42 bool Initialize(WsfSimulation& aSimulation) override;
43 bool ProcessInput(UtInput& aInput) override;
44
45 void ApplyUnmitigatedEffect(WsfEW_Effects& aEW_Effects) const override;
46
47 void ApplyMitigatedEffect(WsfEW_Effect* aEW_EffectPtr, WsfEW_Effects& aEW_Effects) const override;
48
49 void UpdateEffects(double aSimTime,
50 const WsfEM_Interaction& aTargetInteraction,
51 const WsfEM_Interaction& aJammerToTgtInteraction,
52 const ut::optional<WsfEM_Interaction>& aTgtToJammerInteraction,
53 WsfEW_Effects& aEW_Effects,
54 WsfEW_Effect* aEW_EffectPtr = nullptr) override;
55
56 void UpdateJammerPulseDensity(WsfEM_Xmtr* aJammerXmtrPtr, WsfEM_Xmtr* aRadarXmtrPtr) override;
57
58protected:
59 class WSF_MIL_EXPORT TrackEffectData : public WsfEW_PulseEffect::PulseData
60 {
61 public:
62 enum
63 {
70 };
71
73 {
75 {
76 TblIndVarU<double> mJtoS;
77 TblDepVar1<double> mMinTime;
78 TblDepVar1<double> mMaxTime;
79 };
80
82 : mTrackError(0.0)
83 , mWalkoffRate(0.0)
84 , mHoldoutTarget(DBL_MAX)
85 , mHoldoutTime(DBL_MAX)
86 , mRecycleTime(DBL_MAX)
87 , mDelayTime(0.0)
88 , mLastCycleTime(0.0)
89 , mRecycle(false)
90 , mDelayTable()
93 {
94 }
95
96 void Recycle(double aSimTime)
97 {
98 mTrackError = 0.0;
99 mLastCycleTime = aSimTime;
100 }
101
102 double GetDelayTime(WsfEW_Effect* aEffectPtr, double aJammerToSignal);
103 double GetHoldoutTime(WsfEW_Effect* aEffectPtr, double aJammerToSignal);
104 double GetRecycleTime(WsfEW_Effect* aEffectPtr, double aJammerToSignal);
105
106 double mTrackError;
114 double mDelayTime;
116 bool mRecycle;
117
121 };
122
125 ~TrackEffectData() override = default;
126
127 bool ProcessInput(UtInput& aInput) override;
128 bool Initialize(WsfSimulation& aSimulation) override;
129
130 EW_EffectData* Clone() const override;
131
132 void Reset() override;
133
140
141 protected:
142 TrackEffectData(const TrackEffectData& aSrc);
143 };
144
146
148
149 double GetLastUpdateTime(WsfStringId aSystemTypeId) const;
150 void SetLastUpdateTime(WsfStringId aSystemTypeId, double aLastUpdateTime);
151
152 double GetRequiredJtoS(WsfStringId aSystemTypeId) const;
153
154 double GetPreviousJtoS(WsfStringId aSystemTypeId) const;
155 void SetPreviousJtoS(WsfStringId aSystemTypeId, double aPreviousJtoS);
156
157 double GetRequiredStoN(WsfStringId aSystemTypeId) const;
158 void SetRequiredStoN(WsfStringId aSystemTypeId, double aRequiredStoN);
159
160 double GetPreviousStoN(WsfStringId aSystemTypeId) const;
161 void SetPreviousStoN(WsfStringId aSystemTypeId, double aPreviousStoN);
162
163 double GetRangeError(WsfStringId aSystemTypeId) const;
164 void SetRangeError(WsfStringId aSystemTypeId, double aRange);
165
166 double GetRangeWalkoffRate(WsfStringId aSystemTypeId) const;
167 void SetRangeWalkoffRate(WsfStringId aSystemTypeId, double aWalkoffRate);
168
169 double GetAzimuthError(WsfStringId aSystemTypeId) const;
170 void SetAzimuthError(WsfStringId aSystemTypeId, double aAzimuth);
171
172 double GetElevationError(WsfStringId aSystemTypeId) const;
173 void SetElevationError(WsfStringId aSystemTypeId, double aElevation);
174
175 double GetVelocityError(WsfStringId aSystemTypeId) const;
176 void SetVelocityError(WsfStringId aSystemTypeId, double aVelocity);
177
178 TrackEffectData::WalkoffData& GetWalkoffData(WsfStringId aSystemTypeId, int aType) const;
179
180 EffectData* NewEffectData() override;
181 EffectData* PropagateEffectDataPtr(WsfStringId aSystemTypeId) override;
183
184
185 void SensorModeDeactivated(double aSimTime, WsfSensor* aSensorPtr, WsfSensorMode* aModePtr);
186
187 void SensorTrackDropped(double aSimTime, WsfSensor* aSensorPtr, const WsfTrack* aTrackPtr);
188
189private:
190 using TrackEffectDataMap =
191 std::map<WsfStringId, TrackEffectData*>;
192 TrackEffectDataMap mTrackEffectDataMap;
193 bool mApplyCurrentEffect;
194
195 UtCallbackHolder mCallbacks;
196};
197
198#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfEM_Interaction.hpp:68
Definition WsfEM_Xmtr.hpp:55
Base effect data used to derive from in inheriting effect classes.
Definition WsfEW_Effect.hpp:317
Definition WsfEW_Effect.hpp:45
Definition WsfEW_Effects.hpp:41
void ApplyUnmitigatedEffect(WsfEW_Effects &aEW_Effects) const override
Definition WsfEW_PowerEffect.cpp:72
void ApplyMitigatedEffect(WsfEW_Effect *aEW_EffectPtr, WsfEW_Effects &aEW_Effects) const override
Definition WsfEW_PowerEffect.cpp:233
Definition WsfEW_PulseEffect.hpp:75
EffectData * PropagateEffectDataPtr(WsfStringId aSystemTypeId) override
Definition WsfEW_PulseEffect.cpp:104
EffectData * NewEffectData() override
Definition WsfEW_PulseEffect.hpp:104
WsfEW_Effect * Clone() const override
Definition WsfEW_PulseEffect.cpp:42
virtual void UpdateJammerPulseDensity(WsfEM_Xmtr *aJammerXmtrPtr, WsfEM_Xmtr *aRadarXmtrPtr)
Definition WsfEW_PulseEffect.cpp:111
WsfEW_PulseEffect()
Definition WsfEW_PulseEffect.cpp:24
bool Initialize(WsfSimulation &aSimulation) override
Definition WsfEW_PulseEffect.cpp:48
void UpdateEffects(double aSimTime, const WsfEM_Interaction &aTargetInteraction, const WsfEM_Interaction &aJammerToTgtInteraction, const ut::optional< WsfEM_Interaction > &aTgtToJammerInteraction, WsfEW_Effects &aEW_Effects, WsfEW_Effect *aEW_EffectPtr=nullptr) override
Definition WsfEW_PulseEffect.cpp:67
bool ProcessInput(UtInput &aInput) override
Definition WsfEW_PulseEffect.cpp:61
double mPreviousStoN
Definition WsfEW_TrackEffect.hpp:138
double mPreviousJtoS
Definition WsfEW_TrackEffect.hpp:136
double mRequiredJtoS
Definition WsfEW_TrackEffect.hpp:135
double mRequiredStoN
Definition WsfEW_TrackEffect.hpp:137
void Reset() override
Definition WsfEW_TrackEffect.cpp:1176
double mLastUpdateTime
Definition WsfEW_TrackEffect.hpp:134
WalkoffData mWalkoffData[cLAST_ERROR_TYPE]
Definition WsfEW_TrackEffect.hpp:139
@ cLAST_ERROR_TYPE
Definition WsfEW_TrackEffect.hpp:69
@ cMAINTAIN_DROP
Definition WsfEW_TrackEffect.hpp:68
@ cAZIMUTH
Definition WsfEW_TrackEffect.hpp:65
@ cVELOCITY
Definition WsfEW_TrackEffect.hpp:67
@ cELEVATION
Definition WsfEW_TrackEffect.hpp:66
@ cRANGE
Definition WsfEW_TrackEffect.hpp:64
TrackEffectData()
Definition WsfEW_TrackEffect.cpp:701
~TrackEffectData() override=default
TrackEffectData & operator=(const TrackEffectData &)=delete
TrackEffectData::WalkoffData & GetWalkoffData(WsfStringId aSystemTypeId, int aType) const
Definition WsfEW_TrackEffect.cpp:684
double GetLastUpdateTime(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:503
void SetLastUpdateTime(WsfStringId aSystemTypeId, double aLastUpdateTime)
Definition WsfEW_TrackEffect.cpp:513
void SensorModeDeactivated(double aSimTime, WsfSensor *aSensorPtr, WsfSensorMode *aModePtr)
Definition WsfEW_TrackEffect.cpp:437
void SetRequiredStoN(WsfStringId aSystemTypeId, double aRequiredStoN)
Definition WsfEW_TrackEffect.cpp:561
WsfEW_TrackEffect()
Definition WsfEW_TrackEffect.cpp:37
double GetRequiredStoN(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:551
void SetAzimuthError(WsfStringId aSystemTypeId, double aAzimuth)
Definition WsfEW_TrackEffect.cpp:637
double GetRangeWalkoffRate(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:608
void SetElevationError(WsfStringId aSystemTypeId, double aElevation)
Definition WsfEW_TrackEffect.cpp:656
double GetPreviousStoN(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:570
void SetRangeWalkoffRate(WsfStringId aSystemTypeId, double aWalkoffRate)
Definition WsfEW_TrackEffect.cpp:618
double GetAzimuthError(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:627
void SensorTrackDropped(double aSimTime, WsfSensor *aSensorPtr, const WsfTrack *aTrackPtr)
Definition WsfEW_TrackEffect.cpp:456
double GetPreviousJtoS(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:532
void SetPreviousStoN(WsfStringId aSystemTypeId, double aPreviousStoN)
Definition WsfEW_TrackEffect.cpp:580
double GetVelocityError(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:665
~WsfEW_TrackEffect() override=default
double GetElevationError(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:646
void SetVelocityError(WsfStringId aSystemTypeId, double aVelocity)
Definition WsfEW_TrackEffect.cpp:675
void SetPreviousJtoS(WsfStringId aSystemTypeId, double aPreviousJtoS)
Definition WsfEW_TrackEffect.cpp:542
double GetRangeError(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:589
double GetRequiredJtoS(WsfStringId aSystemTypeId) const
Definition WsfEW_TrackEffect.cpp:522
WsfEW_TrackEffect & operator=(const WsfEW_TrackEffect &)=delete
void SetRangeError(WsfStringId aSystemTypeId, double aRange)
Definition WsfEW_TrackEffect.cpp:599
Definition WsfSensorMode.hpp:36
Definition WsfSensor.hpp:92
The main controller for a simulation.
Definition WsfSimulation.hpp:109
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
TblDepVar1< double > mMinTime
Definition WsfEW_TrackEffect.hpp:77
TblDepVar1< double > mMaxTime
Definition WsfEW_TrackEffect.hpp:78
TblIndVarU< double > mJtoS
Definition WsfEW_TrackEffect.hpp:76
Definition WsfEW_TrackEffect.hpp:73
double mDelayTime
Definition WsfEW_TrackEffect.hpp:114
JtoSTimeTable mRecycleTable
Definition WsfEW_TrackEffect.hpp:120
JtoSTimeTable mHoldOutTable
Definition WsfEW_TrackEffect.hpp:119
double mLastCycleTime
Time to delay effect if conditions are met.
Definition WsfEW_TrackEffect.hpp:115
double mHoldoutTarget
Rate at which error is increased.
Definition WsfEW_TrackEffect.hpp:108
void Recycle(double aSimTime)
Definition WsfEW_TrackEffect.hpp:96
double mRecycleTime
Definition WsfEW_TrackEffect.hpp:112
WalkoffData()
Definition WsfEW_TrackEffect.hpp:81
JtoSTimeTable mDelayTable
Indicates whether the walk-off should recycle to the minimum error or stay at holdout (hook).
Definition WsfEW_TrackEffect.hpp:118
double mWalkoffRate
Error to induce on a track if conditions are met.
Definition WsfEW_TrackEffect.hpp:107
double mHoldoutTime
Definition WsfEW_TrackEffect.hpp:110
bool mRecycle
Time the last cycle started.
Definition WsfEW_TrackEffect.hpp:116
double mTrackError
Definition WsfEW_TrackEffect.hpp:106
Copyrights Multiple, All Rights Reserved