WSF
engage/source/Platform.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
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 PLATFORM_HPP
16#define PLATFORM_HPP
17
18#include <string>
19
20class WsfPlatform;
21class WsfScenario;
22class WsfSimulation;
23
24#include "TargetConfig.hpp"
25
26namespace engage
27{
28
29class RunConfig;
30
33{
34public:
35 Platform(const RunConfig& aRunConfig, WsfSimulation& aSimulation, const std::string& aType, const std::string& aName);
36
37 Platform(const RunConfig& aRunConfig, WsfPlatform* aPlatformPtr);
38
39 bool AddToSimulation(double aSimTime, WsfSimulation& aSimulation);
40
41 void Update(double aSimTime);
42
44
45 bool IsValid() const;
47
48 double GetLocationX()
49 {
50 UpdateLocationXYZ();
51 return mLocationXYZ[0];
52 }
53 double GetLocationY()
54 {
55 UpdateLocationXYZ();
56 return mLocationXYZ[1];
57 }
58 double GetLocationZ()
59 {
60 UpdateLocationXYZ();
61 return mLocationXYZ[2];
62 }
63
64 double GetVelocityX()
65 {
66 UpdateVelocityXYZ();
67 return mVelocityXYZ[0];
68 }
69 double GetVelocityY()
70 {
71 UpdateVelocityXYZ();
72 return mVelocityXYZ[1];
73 }
74 double GetVelocityZ()
75 {
76 UpdateVelocityXYZ();
77 return mVelocityXYZ[2];
78 }
79
81 {
82 UpdateAccelerationXYZ();
83 return mAccelerationXYZ[0];
84 }
86 {
87 UpdateAccelerationXYZ();
88 return mAccelerationXYZ[1];
89 }
91 {
92 UpdateAccelerationXYZ();
93 return mAccelerationXYZ[2];
94 }
95
96 void SetLocationXYZ(double aX, double aY, double aZ);
97
98 void SetSpeedAndOrientationXYZ(double aSpeed, double aHeading, double aPitch, double aRoll);
99
100private:
101 void UpdateValidityFlags();
102 void UpdateLocationXYZ();
103 void UpdateVelocityXYZ();
104 void UpdateAccelerationXYZ();
105
106 const RunConfig& mRunConfig;
107 WsfSimulation& mSimulation;
108 WsfPlatform* mWsfPlatformPtr;
109 size_t mWsfPlatformIndex;
110
112 union
113 {
114 struct
115 {
119 };
120 unsigned int mFlags;
121 };
122
123 double mLastUpdateTime;
124
125 double mLocationXYZ[3];
126 double mVelocityXYZ[3];
127 double mAccelerationXYZ[3];
128
129 TargetConfig::FlightPathVec mFlightPath;
130 unsigned int mFlightPathIndex;
131};
132
133} // namespace engage
134
135#endif
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
The main controller for a simulation.
Definition WsfSimulation.hpp:109
void Update(double aSimTime)
Definition engage/source/Platform.cpp:87
double GetVelocityX()
Definition engage/source/Platform.hpp:64
void SetFlightPath(TargetConfig::FlightPathVec aFlightPath)
Definition engage/source/Platform.cpp:121
bool mLocationXYZ_Valid
Definition engage/source/Platform.hpp:116
bool AddToSimulation(double aSimTime, WsfSimulation &aSimulation)
Definition engage/source/Platform.cpp:70
WsfPlatform * GetWsfPlatform() const
Definition engage/source/Platform.cpp:142
void SetLocationXYZ(double aX, double aY, double aZ)
Definition engage/source/Platform.cpp:148
bool IsValid() const
Definition engage/source/Platform.cpp:127
Platform(const RunConfig &aRunConfig, WsfSimulation &aSimulation, const std::string &aType, const std::string &aName)
Definition engage/source/Platform.cpp:35
double GetAccelerationX()
Definition engage/source/Platform.hpp:80
double GetLocationZ()
Definition engage/source/Platform.hpp:58
double GetLocationY()
Definition engage/source/Platform.hpp:53
void SetSpeedAndOrientationXYZ(double aSpeed, double aHeading, double aPitch, double aRoll)
Definition engage/source/Platform.cpp:162
bool mVelocityXYZ_Valid
Definition engage/source/Platform.hpp:117
double GetVelocityZ()
Definition engage/source/Platform.hpp:74
double GetVelocityY()
Definition engage/source/Platform.hpp:69
double GetLocationX()
Definition engage/source/Platform.hpp:48
double GetAccelerationZ()
Definition engage/source/Platform.hpp:90
bool mAccelerationXYZ_Valid
Definition engage/source/Platform.hpp:118
unsigned int mFlags
Definition engage/source/Platform.hpp:120
double GetAccelerationY()
Definition engage/source/Platform.hpp:85
Definition RunConfig.hpp:33
std::vector< PathPoint > FlightPathVec
Definition TargetConfig.hpp:42
Definition ApplicationExtension.cpp:26
Copyrights Multiple, All Rights Reserved