WSF
WsfEM_Interaction.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 WSFEM_INTERACTION_HPP
13#define WSFEM_INTERACTION_HPP
14
15#include "wsf_export.h"
16
17#include <iosfwd>
18#include <ostream>
19
20#include "UtLog.hpp"
21#include "UtScriptAccessible.hpp"
22#include "WsfComponentList.hpp"
23class WsfEM_Antenna;
25class WsfEM_Rcvr;
26class WsfEM_Xmtr;
27class WsfEM_XmtrRcvr;
28class WsfEnvironment;
29class WsfPlatform;
30#include "WsfStringId.hpp"
31
32
49class WSF_EXPORT WsfEM_InteractionComponent : public WsfComponentT<WsfEM_Interaction>
50{
51 friend class WsfEM_Interaction;
52
53public:
54 virtual void Print(ut::log::MessageStream& aMsgStream, WsfEM_Interaction& aEM_Interaction) {}
55 virtual void PrintStatus(ut::log::MessageStream& aMsgStream, WsfEM_Interaction& aEM_Interaction) {}
56 virtual void Reset() {}
57
58 // These are called from WsfEventOutput::PrintEM_Interaction.
59 // It is a bit of a hack in that only addresses event_output in a very specific way.
60 virtual bool PrintEventOutput(std::ostream& aStream) { return false; }
61 virtual void PrintEventOutput_Powers(std::ostream& aStream) {}
62
63 virtual bool PrintCSV_EventOutput(std::ostream& aStream) { return false; }
64 virtual bool PrintCSV_EventOutput_Powers(std::ostream& aStream) { return false; }
65};
66
67class WSF_EXPORT WsfEM_Interaction : public UtScriptAccessible
68{
69public:
72
76 enum
77 {
78 cRCVR_RANGE_LIMITS = 0x00000001,
79 cRCVR_ALTITUDE_LIMITS = 0x00000002,
80 cRCVR_ANGLE_LIMITS = 0x00000004,
81 cRCVR_HORIZON_MASKING = 0x00000008,
82 cRCVR_TERRAIN_MASKING = 0x00000010,
83 cXMTR_RANGE_LIMITS = 0x00000020,
84 cXMTR_ALTITUDE_LIMITS = 0x00000040,
85 cXMTR_ANGLE_LIMITS = 0x00000080,
86 cXMTR_HORIZON_MASKING = 0x00000100,
87 cXMTR_TERRAIN_MASKING = 0x00000200,
88 cSIGNAL_LEVEL = 0x00000400,
89 cSTATUS_MASK = 0x0000FFFF
90 };
91
98
101 {
102 double mLat{0.0};
103 double mLon{0.0};
104 double mAlt{0.0};
105 double mLocWCS[3]{0.0, 0.0, 0.0};
106 bool mIsValid{false};
107 };
108
116 {
117 double mRange{-1.0};
118
119 double mTrueUnitVecWCS[3]{0.0, 0.0, 0.0};
120 double mTrueAz{0.0};
121 double mTrueEl{0.0};
122
123 double mUnitVecWCS[3]{0.0, 0.0, 0.0};
124 double mAz{0.0};
125 double mEl{0.0};
126 };
127
129 struct BeamData
130 {
133 double mAz{0.0};
134
137 double mEl{0.0};
138
142 double mGain{-1.0};
143
146 double mEBS_Az{0.0};
147
150 double mEBS_El{0.0};
151
155 double mWCS_ToBeamTransform[3][3]{{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}};
156 };
157
158 WsfEM_Interaction() = default;
159 ~WsfEM_Interaction() override = default;
160
161 virtual unsigned int BeginOneWayInteraction(WsfEM_Rcvr* aRcvrPtr, WsfPlatform* aTgtPtr);
162
163 virtual unsigned int BeginOneWayInteraction(WsfEM_Xmtr* aXmtrPtr,
164 WsfEM_Rcvr* aRcvrPtr,
165 bool aCheckXmtrLimits,
166 bool aCheckRcvrLimits,
167 bool aCheckMaskingFactor = true);
168
169 virtual unsigned int BeginTwoWayInteraction(WsfEM_Xmtr* aXmtrPtr, WsfPlatform* aTgtPtr, WsfEM_Rcvr* aRcvrPtr);
170
171 virtual unsigned int BeginTwoWayOTH_Interaction(WsfEM_Xmtr* aXmtrPtr,
172 WsfPlatform* aTgtPtr,
173 WsfEM_Rcvr* aRcvrPtr,
174 double aReflectionLocWCS[3]);
175
176 virtual unsigned int BeginGenericInteraction(WsfEM_Xmtr* aXmtrPtr, WsfPlatform* aTgtPtr, WsfEM_Rcvr* aRcvrPtr);
177
178 double ComputeAttenuationFactor(Geometry aGeometry);
179
181
183
185
186 void ComputeRadarSigAzEl();
187
188 double ComputeRF_OneWayPower();
189
190 double ComputeRF_TwoWayPower(double aCrossSection);
191
192 double ComputeRF_ReceivedPower(double aPowerDensity);
193
195
196 virtual void ComputeUndefinedGeometry();
197
198 double ComputeTargetDopplerFrequency(bool aFilterOwnshipFromDoppler);
199
200 double ComputeTargetDopplerSpeed(bool aFilterOwnshipFromDoppler);
201
205 WsfEM_Rcvr* GetReceiver() const { return mRcvrPtr; }
206
211 WsfEM_Xmtr* GetTransmitter() const { return mXmtrPtr; }
212
217 WsfPlatform* GetTarget() const { return mTgtPtr; }
218
219 static bool MaskedByHorizon(const WsfEM_Xmtr* aXmtrPtr, const WsfEM_Rcvr* aRcvrPtr);
220
221 static bool MaskedByHorizon(const WsfEM_XmtrRcvr* aXmtrRcvrPtr, WsfPlatform* aPlatformPtr, double aEarthRadiusScale);
222
223 static bool MaskedByHorizon(const WsfEM_XmtrRcvr* aXmtrRcvrPtr,
224 WsfPlatform* aPlatformPtr,
225 double aReflectionPointWCS[3],
226 double aEarthRadiusScale);
227
228 bool MaskedByTerrain();
229
230 virtual void Print(ut::log::MessageStream& aMsgStream);
231
232 virtual void PrintGeometry(ut::log::MessageStream& aMsgStream);
233
235 virtual void PrintStatus(ut::log::MessageStream& aMsgStream) const;
237 virtual void PrintStatusP(ut::log::MessageStream& aMsgStream) const;
238
239 double PrintableAngle(double aAngle) const;
240
241 virtual void Reset();
242
245 const char* GetScriptClassName() const override { return "WsfEM_Interaction"; }
246
247 void SetReceiverBeamPosition();
248
249 void SetReceiverBeamPosition(const BeamData& aBeamData);
250
251 void SetTransmitterBeamPosition();
252
253 void SetTransmitterBeamPosition(const BeamData& aBeamData);
254
255 bool WithinFieldOfView(WsfEM_Antenna* aAntennaPtr,
256 LocationData& aSrcLoc,
257 LocationData& aTgtLoc,
258 RelativeData& aSrcToTgt,
259 RelativeData& aTgtToSrc,
260 bool aIgnoreLimits = false);
261
262 void SetCategory(WsfStringId aCategory) { mCategoryId = aCategory; }
263 bool CategoryIsSet() const { return !mCategoryId.Empty(); }
264
265 void AddComponent(Component* aComponentPtr) { mComponents.AddComponent(aComponentPtr); }
266
267 const ComponentList& GetComponents() const { return mComponents; }
268
272 unsigned int mCheckedStatus{0};
273
277 unsigned int mFailedStatus{0};
278
281 bool mBistatic{false};
282
286
290
294
298
302
307
312
316
320
323
326
333 double mMaskingFactor{1.0};
334
337 double mInfraredSig{-1.0};
338
341 double mInfraredSigAz{0.0};
342
345 double mInfraredSigEl{0.0};
346
349 double mRadarSig{-1.0};
350
353 double mRadarSigAz{0.0};
354
357 double mRadarSigEl{0.0};
358
361 double mOpticalSig{-1.0};
362
365 double mOpticalSigAz{0.0};
366
369 double mOpticalSigEl{0.0};
370
374
378 double mXmtdPower{0.0};
379
385
389 double mRcvdPower{0.0};
390
394 double mRcvrNoisePower{0.0};
395
398 double mClutterPower{0.0};
399
403
409
414 double mSignalToNoise{0.0};
415
421
428 double mAbsorptionFactor{0.0};
429
433
437
443
447 double mPixelCount{0.0};
448
451 double mEarthRadiusScale{0.0};
452
455
458
459private:
460 void ComputeRF_PropagationFactor();
461
462 void ComputeReceiverBeamAspect();
463
464 void ComputeTransmitterBeamAspect();
465
466 void ComputeZoneAttenuation(WsfPlatform* aFromPtr, WsfPlatform* aTargetPtr, bool aIsTwoWay);
467
468 void PrintAbsTargetData(ut::log::MessageStream& aMsgStream,
469 const char* aPrefix,
470 WsfPlatform* aTgtPtr,
471 const LocationData& aLocData);
472
473 void PrintRelTargetData(ut::log::MessageStream& aMsgStream,
474 const char* aPrefix,
475 WsfPlatform* aTgtPtr,
476 const RelativeData& aRelData);
477
478 void PrintAbsXmtrRcvrData(ut::log::MessageStream& aMsgStream,
479 const char* aPrefix,
480 WsfEM_XmtrRcvr* aXmtrRcvrPtr,
481 const LocationData& aLocData);
482
483 void PrintRelXmtrRcvrData(ut::log::MessageStream& aMsgStream,
484 const char* aPrefix,
485 WsfEM_XmtrRcvr* aXmtrRcvrPtr,
486 const RelativeData& aRelData);
487
488 void PrintBeamData(ut::log::MessageStream& aMsgStream,
489 const char* aPrefix,
490 WsfEM_XmtrRcvr* aXmtrRcvrPtr,
491 const BeamData& aBeamData);
492
493 void PrintLocationData(ut::log::MessageStream& aMsgStream,
494 const char* aPrefix,
495 WsfPlatform* aPlatformPtr,
496 const LocationData& aLocationData) const;
497
498 void PrintRange(ut::log::MessageStream& aMsgStream, double aRange) const;
499
500
501 WsfEM_Xmtr* mXmtrPtr{nullptr};
502 WsfEM_Rcvr* mRcvrPtr{nullptr};
503 WsfPlatform* mTgtPtr{nullptr};
504
505 ComponentList mComponents;
506};
507
508#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
A component list that stores only components of a specified type.
Definition WsfComponentList.hpp:343
WsfComponentT()
Definition WsfComponent.hpp:124
Definition WsfEM_Antenna.hpp:49
Definition WsfEM_Interaction.hpp:50
virtual bool PrintCSV_EventOutput_Powers(std::ostream &aStream)
Definition WsfEM_Interaction.hpp:64
virtual void Reset()
Definition WsfEM_Interaction.hpp:56
virtual void PrintStatus(ut::log::MessageStream &aMsgStream, WsfEM_Interaction &aEM_Interaction)
Definition WsfEM_Interaction.hpp:55
virtual void PrintEventOutput_Powers(std::ostream &aStream)
Definition WsfEM_Interaction.hpp:61
virtual bool PrintEventOutput(std::ostream &aStream)
Definition WsfEM_Interaction.hpp:60
virtual bool PrintCSV_EventOutput(std::ostream &aStream)
Definition WsfEM_Interaction.hpp:63
virtual void Print(ut::log::MessageStream &aMsgStream, WsfEM_Interaction &aEM_Interaction)
Definition WsfEM_Interaction.hpp:54
friend class WsfEM_Interaction
Definition WsfEM_Interaction.hpp:51
Definition WsfEM_Interaction.hpp:68
RelativeData mRcvrToTgt
Definition WsfEM_Interaction.hpp:297
~WsfEM_Interaction() override=default
BeamData mXmtrBeam
Antenna gain lookup data for the transmitter.
Definition WsfEM_Interaction.hpp:325
bool mBistatic
Definition WsfEM_Interaction.hpp:281
double mPixelCount
Definition WsfEM_Interaction.hpp:447
double mInfraredSigEl
Definition WsfEM_Interaction.hpp:345
WsfEM_Rcvr * GetReceiver() const
Definition WsfEM_Interaction.hpp:205
double mDetectionThreshold
Definition WsfEM_Interaction.hpp:442
WsfEM_InteractionComponent Component
Definition WsfEM_Interaction.hpp:70
void ComputeRadarSigAzEl()
Definition WsfEM_Interaction.cpp:752
LocationData mRcvrLoc
Definition WsfEM_Interaction.hpp:289
double mInterferenceFactor
Definition WsfEM_Interaction.hpp:408
double mRcvdPower
Definition WsfEM_Interaction.hpp:389
double mOpticalSigEl
Definition WsfEM_Interaction.hpp:369
double mInterferencePower
Definition WsfEM_Interaction.hpp:402
double mRadarSig
Definition WsfEM_Interaction.hpp:349
WsfPlatform * GetTarget() const
Definition WsfEM_Interaction.hpp:217
unsigned int mFailedStatus
Definition WsfEM_Interaction.hpp:277
bool CategoryIsSet() const
Definition WsfEM_Interaction.hpp:263
double mAbsorptionFactor
Definition WsfEM_Interaction.hpp:428
double ComputeRF_TwoWayPower(double aCrossSection)
Definition WsfEM_Interaction.cpp:876
unsigned int mCheckedStatus
Definition WsfEM_Interaction.hpp:272
RelativeData mTgtToXmtr
Definition WsfEM_Interaction.hpp:311
double mRadarSigAz
Definition WsfEM_Interaction.hpp:353
RelativeData mRcvrToXmtr
Definition WsfEM_Interaction.hpp:319
double mPropagationFactor
Definition WsfEM_Interaction.hpp:420
virtual unsigned int BeginOneWayInteraction(WsfEM_Rcvr *aRcvrPtr, WsfPlatform *aTgtPtr)
Definition WsfEM_Interaction.cpp:53
double mInfraredSig
Definition WsfEM_Interaction.hpp:337
RelativeData mTgtToRcvr
Definition WsfEM_Interaction.hpp:301
double mMaskingFactor
Definition WsfEM_Interaction.hpp:333
void ComputeOpticalSigAzEl()
Definition WsfEM_Interaction.cpp:742
double mRcvrNoisePower
Definition WsfEM_Interaction.hpp:394
void AddComponent(Component *aComponentPtr)
Definition WsfEM_Interaction.hpp:265
RelativeData mXmtrToTgt
Definition WsfEM_Interaction.hpp:306
double ComputeRF_OneWayPower()
Definition WsfEM_Interaction.cpp:829
LocationData mXmtrLoc
Definition WsfEM_Interaction.hpp:285
RelativeData mXmtrToRcvr
Definition WsfEM_Interaction.hpp:315
LocationData mTgtLoc
Definition WsfEM_Interaction.hpp:293
double mZoneAttenuationValue
The computed zone-based attenuation factor.
Definition WsfEM_Interaction.hpp:457
double mClutterPower
Definition WsfEM_Interaction.hpp:398
virtual unsigned int BeginTwoWayOTH_Interaction(WsfEM_Xmtr *aXmtrPtr, WsfPlatform *aTgtPtr, WsfEM_Rcvr *aRcvrPtr, double aReflectionLocWCS[3])
Definition WsfEM_Interaction.cpp:472
Geometry
Definition WsfEM_Interaction.hpp:93
@ cXMTR_TO_RCVR
Definition WsfEM_Interaction.hpp:96
@ cXMTR_TO_TARGET
Definition WsfEM_Interaction.hpp:94
@ cTARGET_TO_RCVR
Definition WsfEM_Interaction.hpp:95
double mXmtdPower
Definition WsfEM_Interaction.hpp:378
@ cSTATUS_MASK
Bit mask of all base-class status bits.
Definition WsfEM_Interaction.hpp:89
@ cXMTR_ANGLE_LIMITS
Transmitter angle limits checked/failed.
Definition WsfEM_Interaction.hpp:85
@ cXMTR_RANGE_LIMITS
Transmitter range limits checked/failed.
Definition WsfEM_Interaction.hpp:83
@ cRCVR_RANGE_LIMITS
Receiver range limits checked/failed.
Definition WsfEM_Interaction.hpp:78
@ cRCVR_ALTITUDE_LIMITS
Receiver altitude limits checked/failed.
Definition WsfEM_Interaction.hpp:79
@ cXMTR_TERRAIN_MASKING
Transmitter terrain masking checked/failed.
Definition WsfEM_Interaction.hpp:87
@ cXMTR_HORIZON_MASKING
Transmitter horizon masking checked/failed.
Definition WsfEM_Interaction.hpp:86
@ cXMTR_ALTITUDE_LIMITS
Transmitter altitude limits checked/failed.
Definition WsfEM_Interaction.hpp:84
@ cRCVR_HORIZON_MASKING
Receiver horizon masking checked/failed.
Definition WsfEM_Interaction.hpp:81
@ cRCVR_ANGLE_LIMITS
Receiver angle limits checked/failed.
Definition WsfEM_Interaction.hpp:80
@ cRCVR_TERRAIN_MASKING
Receiver terrain masking checked/failed.
Definition WsfEM_Interaction.hpp:82
@ cSIGNAL_LEVEL
Signal level checked/failed.
Definition WsfEM_Interaction.hpp:88
double mPowerDensityAtTarget
Definition WsfEM_Interaction.hpp:384
double mBackgroundRadiantIntensity
Definition WsfEM_Interaction.hpp:432
double mInfraredSigAz
Definition WsfEM_Interaction.hpp:341
double ComputeRF_ReceivedPower(double aPowerDensity)
Definition WsfEM_Interaction.cpp:781
const char * GetScriptClassName() const override
Definition WsfEM_Interaction.hpp:245
double mOpticalReflectivity
Definition WsfEM_Interaction.hpp:373
double mContrastRadiantIntensity
Definition WsfEM_Interaction.hpp:436
WsfEM_Xmtr * GetTransmitter() const
Definition WsfEM_Interaction.hpp:211
double mSignalToNoise
Definition WsfEM_Interaction.hpp:414
BeamData mRcvrBeam
Antenna gain lookup data for the receiver.
Definition WsfEM_Interaction.hpp:322
double mEarthRadiusScale
Definition WsfEM_Interaction.hpp:451
double mRadarSigEl
Definition WsfEM_Interaction.hpp:357
WsfComponentListT< WsfEM_InteractionComponent > ComponentList
Definition WsfEM_Interaction.hpp:71
virtual void ComputeUndefinedGeometry()
Definition WsfEM_Interaction.cpp:1084
virtual unsigned int BeginGenericInteraction(WsfEM_Xmtr *aXmtrPtr, WsfPlatform *aTgtPtr, WsfEM_Rcvr *aRcvrPtr)
Definition WsfEM_Interaction.cpp:629
virtual unsigned int BeginTwoWayInteraction(WsfEM_Xmtr *aXmtrPtr, WsfPlatform *aTgtPtr, WsfEM_Rcvr *aRcvrPtr)
Definition WsfEM_Interaction.cpp:302
double ComputeAttenuationFactor(Geometry aGeometry)
Compute the attenuation loss between two points.
Definition WsfEM_Interaction.cpp:659
WsfEM_Interaction()=default
void ComputeInfraredSigAzEl()
Definition WsfEM_Interaction.cpp:732
double ComputeRF_TransmittedPower()
Definition WsfEM_Interaction.cpp:808
WsfStringId mCategoryId
If non-zero, the name of ID of the category to be used for zone-based attenuation.
Definition WsfEM_Interaction.hpp:454
double mOpticalSig
Definition WsfEM_Interaction.hpp:361
double ComputeTargetDopplerSpeed(bool aFilterOwnshipFromDoppler)
Definition WsfEM_Interaction.cpp:1224
void ComputeMaskingFactor()
Compute the masking factor.
Definition WsfEM_Interaction.cpp:690
const ComponentList & GetComponents() const
Definition WsfEM_Interaction.hpp:267
double ComputeTargetDopplerFrequency(bool aFilterOwnshipFromDoppler)
Definition WsfEM_Interaction.cpp:1257
void SetCategory(WsfStringId aCategory)
Definition WsfEM_Interaction.hpp:262
double mOpticalSigAz
Definition WsfEM_Interaction.hpp:365
Definition WsfEM_Rcvr.hpp:68
Definition WsfEM_XmtrRcvr.hpp:42
Definition WsfEM_Xmtr.hpp:55
Definition WsfEnvironment.hpp:37
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Represents the antenna gain lookup.
Definition WsfEM_Interaction.hpp:130
double mEBS_El
Definition WsfEM_Interaction.hpp:150
double mEBS_Az
Definition WsfEM_Interaction.hpp:146
double mEl
Definition WsfEM_Interaction.hpp:137
double mWCS_ToBeamTransform[3][3]
Definition WsfEM_Interaction.hpp:155
double mAz
Definition WsfEM_Interaction.hpp:133
double mGain
Definition WsfEM_Interaction.hpp:142
Represents the location of a platform or device.
Definition WsfEM_Interaction.hpp:101
double mLat
Latitude (decimal degrees).
Definition WsfEM_Interaction.hpp:102
bool mIsValid
Data is valid only if this is true.
Definition WsfEM_Interaction.hpp:106
double mLon
Longitude (decimal degrees).
Definition WsfEM_Interaction.hpp:103
double mAlt
Altitude (meters).
Definition WsfEM_Interaction.hpp:104
double mLocWCS[3]
WCS locations (meters).
Definition WsfEM_Interaction.hpp:105
Definition WsfEM_Interaction.hpp:116
double mRange
Range to the other object (meters).
Definition WsfEM_Interaction.hpp:117
double mTrueAz
The azimuth of the other object (radians).
Definition WsfEM_Interaction.hpp:120
double mUnitVecWCS[3]
Apparent WCS unit vector pointing to the other object.
Definition WsfEM_Interaction.hpp:123
double mTrueEl
The elevation of the other object (radians).
Definition WsfEM_Interaction.hpp:121
double mAz
The apparent azimuth of the other object (radians).
Definition WsfEM_Interaction.hpp:124
double mTrueUnitVecWCS[3]
True WCS unit vector pointing to the other object.
Definition WsfEM_Interaction.hpp:119
double mEl
The apparent elevation of the other object (radians).
Definition WsfEM_Interaction.hpp:125
Copyrights Multiple, All Rights Reserved