WSF
FlightPathAnalysisFunction.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 FLIGHTPATHANALYSISFUNCTION_HPP
13#define FLIGHTPATHANALYSISFUNCTION_HPP
14
15#include <string>
16#include <vector>
17
18#include "MapPlotFunction.hpp"
19#include "SupTMProjection.hpp"
20class WsfPlatform;
21class WsfSensor;
22#include "mover/WsfTSPI.hpp"
23
25{
26public:
31
33 using Point = std::vector<double>;
34
35 static constexpr double cUNDEFINED = 1.0E+30;
36
37 explicit FlightPathAnalysisFunction(const WsfScenario& aScenario);
38 ~FlightPathAnalysisFunction() override = default;
39
40 bool Execute(WsfSimulation& aSimulation) override;
41 bool ProcessInput(UtInput& aInput) override;
42
43private:
44 class PathPoint
45 {
46 public:
47 PathPoint()
48 : mLat(0.0)
49 , mLon(0.0)
50 , mAlt(0.0)
51 , mSpeed(0.0)
52 , mHeading(0.0)
53 , mPitch(0.0)
54 , mRoll(0.0)
55 , mAltIsAGL(false)
56 {
57 }
58
59 double mLat;
60 double mLon;
61 double mAlt;
62 double mSpeed;
63 double mHeading;
64 double mPitch;
65 double mRoll;
66 bool mAltIsAGL;
67 };
68 class Selector
69 {
70 public:
71 enum SelectorType
72 {
73 cSENSOR_TYPE,
74 cSENSOR_CATEGORY,
75 cPLATFORM_TYPE,
76 cPLATFORM_CATEGORY
77 };
78 SelectorType mType;
79 WsfStringId mValue;
80 };
81
82 using SelectorList = std::vector<Selector>;
83
84 bool ConvertALARM_LatLon(const std::string& aString, bool aIsLat, double& aOutput);
85
86 void ConvertCartesianToSpherical(double aDownRange, double aCrossRange, double& aLatitude, double& aLongitude);
87
88 void ConvertSphericalToCartesian(double aLatitude, double aLongitude, double& aDownRange, double& aCrossRange);
89
90 void EvaluatePoint(double aSimTime, WsfPlatform* aTargetPtr, std::vector<double>& aDataValues);
91
92 void EvaluateSensor(double aSimTime, WsfSensor* aSensorPtr, WsfPlatform* aTargetPtr, std::vector<double>& aDataValues);
93
94 void InitializeSensorPlatforms();
95
96 bool InSelectorList(WsfSensor* aSensorPtr, const SelectorList& aSelectorList);
97
98 void ReadALARM_FPA_File(const std::string& aFileName);
99
100 void ReadTSPI_File(const std::string& aFileName);
101
102 void ReadSelector(UtInput& aInput, SelectorList& aSelectorList);
103
104 void ResetPathPoints();
105
106 void WriteGnuPlotFile(const std::vector<Point>& aVarValues);
107
108 WsfSimulation* mSimulationPtr;
109 std::vector<Variable> mVarList;
110 std::vector<std::string> mVarLabels;
111 std::vector<double> mVarMinValues;
112
113 std::vector<PathPoint> mPathPoints;
114 std::string mALARM_FPA_FileName;
115 std::string mTSPI_FileName;
116 WsfTSPI mTSPI_Point;
118 double mSampleInterval;
119
120 double mSensorPlatformYaw;
121 double mSensorPlatformPitch;
122 double mSensorPlatformRoll;
123 std::string mModeName;
124 size_t mModeIndex;
125 bool mAutomaticTargetCueing;
126 bool mReverseEvaluations;
127
128 WsfStringId mTargetPlatformId;
129
130 std::string mRangeUnits;
131
133 SupTMProjection mProjection;
134
135 std::string mGnuPlotFile;
136 std::string mHeaderLine1;
137 std::string mHeaderLine2;
138 std::string mHeaderLine3;
139
140 SelectorList mExclusionList;
141 SelectorList mInclusionList;
142
143 std::vector<WsfSensor*> mSensors;
144
145 double mOriginToENU_Transform[3][3];
146};
147
148#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
bool Execute(WsfSimulation &aSimulation) override
Definition FlightPathAnalysisFunction.cpp:85
static constexpr double cUNDEFINED
Definition FlightPathAnalysisFunction.hpp:35
~FlightPathAnalysisFunction() override=default
FlightPathAnalysisFunction(const WsfScenario &aScenario)
Definition FlightPathAnalysisFunction.cpp:49
bool ProcessInput(UtInput &aInput) override
Definition FlightPathAnalysisFunction.cpp:415
std::vector< double > Point
The list of values at a specified sample point.
Definition FlightPathAnalysisFunction.hpp:33
Variable
Definition FlightPathAnalysisFunction.hpp:28
@ cVAR_REQUIRED_JAMMER_POWER
Definition FlightPathAnalysisFunction.hpp:29
MapPlotFunction()=default
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 WsfSensor.hpp:92
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Copyrights Multiple, All Rights Reserved