WSF
WsfConstellationOptions.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 2020 Infoscitex, a DCS 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 WSFCONSTELLATIONOPTIONS_HPP
13#define WSFCONSTELLATIONOPTIONS_HPP
14
15#include "wsf_space_export.h"
16
17#include <ostream>
18#include <string>
19
20#include "UtPath.hpp"
21#include "UtUnitTypes.hpp"
22#include "WsfSpaceOrbitSize.hpp"
23
26class WSF_SPACE_EXPORT WsfConstellationOptions
27{
28public:
30
32
33 static WsfConstellationOptions CreateWalkerDelta(unsigned int aNumTotalSats,
34 unsigned int aNumPlanes,
35 unsigned int aWalkerF);
36 static WsfConstellationOptions CreateWalkerStar(unsigned int aNumTotalSats, unsigned int aNumPlanes, unsigned int aWalkerF);
37 static WsfConstellationOptions CreateGeneral(unsigned int aNumPlanes,
38 unsigned int aNumSatsPerPlane,
39 const UtAngleValue& aAnomalyAlias,
40 const UtAngleValue& aRAAN_Range);
41
42 bool IsSetup() const;
43 std::string ValidateSetup() const;
44
46 bool IsWalkerDelta() const { return mConstellationType == ConstellationType::cWALKER_DELTA; }
47
49 bool IsWalkerStar() const { return mConstellationType == ConstellationType::cWALKER_STAR; }
50
52 bool IsGeneral() const { return mConstellationType == ConstellationType::cGENERAL; }
53
55 unsigned int GetTotalSats() const { return mNumTotalSats; }
56
58 unsigned int GetNumPlanes() const { return mNumPlanes; }
59
61 unsigned int GetSatsPerPlane() const { return mSatsPerPlane; }
62
64 unsigned int GetWalkerF() const { return mWalkerF; }
65
67 const UtAngleValue& GetAnomalyAlias() const { return mAnomalyAlias; }
68
70 const UtAngleValue& GetRAAN_Range() const { return mRAAN_Range; }
71
73 const UtLengthValue& GetSemiMajorAxis() const { return mOrbitSize.GetSemiMajorAxis(); }
74
76 const UtLengthValue& GetCircularAltitude() const { return mOrbitSize.GetCircularAltitude(); }
77
79 const UtTimeValue& GetOrbitalPeriod() const { return mOrbitSize.GetOrbitalPeriod(); }
80
82 double GetRevolutionsPerDay() const { return mOrbitSize.GetRevolutionsPerDay(); }
83
85 bool SpecifiedAsSemiMajorAxis() const { return mOrbitSize.SpecifiedAsSemiMajorAxis(); }
86
88 bool SpecifiedAsCircularAltitude() const { return mOrbitSize.SpecifiedAsCircularAltitude(); }
89
91 bool SpecifiedAsOrbitalPeriod() const { return mOrbitSize.SpecifiedAsOrbitalPeriod(); }
92
94 bool SpecifiedAsRevolutionsPerDay() const { return mOrbitSize.SpecifiedAsRevsPerDay(); }
95
97 const UtAngleValue& GetInclination() const { return mInclination; }
98
100 const UtAngleValue& GetInitialRAAN() const { return mInitialRAAN; }
101
103 const UtAngleValue& GetInitialAnomaly() const { return mInitialAnomaly; }
104
106 const std::string& GetConstellationName() const { return mConstellationName; }
107
109 const std::string& GetPlatformType() const { return mPlatformType; }
110
112 const UtPath& GetBasePath() const { return mBasePath; }
113
115 void SetSemiMajorAxis(const UtLengthValue& aSemiMajorAxis) { mOrbitSize.SetSemiMajorAxis(aSemiMajorAxis); }
116
118 void SetCircularAltitude(const UtLengthValue& aCircularAltitude)
119 {
120 mOrbitSize.SetCircularAltitude(aCircularAltitude);
121 }
122
124 void SetOrbitalPeriod(const UtTimeValue& aOrbitalPeriod) { mOrbitSize.SetOrbitalPeriod(aOrbitalPeriod); }
125
127 void SetRevolutionsPerDay(double aRevolutionsPerDay) { mOrbitSize.SetRevolutionsPerDay(aRevolutionsPerDay); }
128
130 void SetInclination(const UtAngleValue& aInclination) { mInclination = aInclination; }
131
133 void SetInitialRAAN(const UtAngleValue& aInitialRAAN) { mInitialRAAN = aInitialRAAN; }
134
136 void SetInitialAnomaly(const UtAngleValue& aInitialAnomaly) { mInitialAnomaly = aInitialAnomaly; }
137
139 void SetConstellationName(const std::string& aConstellationName) { mConstellationName = aConstellationName; }
140
142 void SetPlatformType(const std::string& aPlatformType) { mPlatformType = aPlatformType; }
143
145 void SetBasePath(const UtPath& aBasePath) { mBasePath = aBasePath; }
146
147 void OutputOptions(std::ostream& aStream) const;
148
149 std::string GetGeneratedFilePrefix() const;
150
151 std::string GetMemberName(unsigned int aPlane, unsigned int aSatellite) const;
152 UtAngleValue GetMemberRAAN(unsigned int aPlane) const;
153 UtAngleValue GetMemberAnomaly(unsigned int aPlane, unsigned int aSatellite) const;
154
155 constexpr static const char* cBASE_NAME{"Constellation Name"};
156 constexpr static const char* cPLATFORM_TYPE{"Platform Type"};
157 constexpr static const char* cGENERATION_PATH{"Path to generated files"};
158 constexpr static const char* cREVS_PER_DAY{"Revs. Per Day"};
159 constexpr static const char* cINCLINATION{"Inclination"};
160 constexpr static const char* cNUM_PLANES{"Number of Planes"};
161 constexpr static const char* cSATS_PER_PLANE{"Satellites per Plane"};
162 constexpr static const char* cINITIAL_RAAN{"Initial RAAN"};
163 constexpr static const char* cRAAN_RANGE{"RAAN Range"};
164 constexpr static const char* cINITIAL_ANOMALY{"Initial Anomaly"};
165 constexpr static const char* cANOMALY_ALIAS{"Anomaly Alias"};
166 constexpr static const char* cALTITUDE{"Orbit Altitude"};
167 constexpr static const char* cSEMI_MAJOR_AXIS{"Semi-major Axis"};
168 constexpr static const char* cPERIOD{"Orbital Period"};
169 constexpr static const char* cHEADER_START_MARKER{
170 "# New file created by AFSIM Wizard using the Constellation Maker\n/*\n"};
171
172private:
173 enum class ConstellationType
174 {
175 cINVALID,
176 cGENERAL,
177 cWALKER_DELTA,
178 cWALKER_STAR
179 };
180
181 WsfConstellationOptions() = default;
182 WsfConstellationOptions(ConstellationType aType,
183 unsigned int aNumTotalSats,
184 unsigned int aNumPlanes,
185 unsigned int aSatsPerPlane,
186 unsigned int aWalkerF,
187 const UtAngleValue& aAnomalyAlias,
188 const UtAngleValue& aRAAN_Range)
189 : mConstellationType{aType}
190 , mNumTotalSats{aNumTotalSats}
191 , mNumPlanes{aNumPlanes}
192 , mSatsPerPlane{aSatsPerPlane}
193 , mWalkerF{aWalkerF}
194 , mAnomalyAlias{aAnomalyAlias}
195 , mRAAN_Range{aRAAN_Range}
196 {
197 }
198
199 static bool ValidWalkerInputs(unsigned int aNumTotalSats, unsigned int aNumPlanes, unsigned int aWalkerF);
200 static UtAngleValue AnomalyAliasFromWalkerF(unsigned int aWalkerF, unsigned int aNumSatsTotal);
201
202
203 // Walker constellations are defined via t/p/f; the total number of satellites,
204 // the number of planes, and an inter-plane phasing given as an integer f in
205 // the range [0, p - 1]. The two kinds of Walker constellation differ in the
206 // range of RAAN over which the planes are distributed. The following members
207 // are immutable so that this object can maintain the dependencies
208 // between them.
209 ConstellationType mConstellationType{ConstellationType::cINVALID};
210 unsigned int mNumTotalSats{0};
211 unsigned int mNumPlanes{0};
212 unsigned int mSatsPerPlane{0};
213 unsigned int mWalkerF{0};
214 UtAngleValue mAnomalyAlias{};
215 UtAngleValue mRAAN_Range{};
216
217 // These member variables define the rest of the parameters of the constellation,
218 // but do not have any interdependencies, so they may be modified freely.
219 wsf::space::OrbitSize mOrbitSize{};
220 UtAngleValue mInclination{-90.0, UtUnitAngle::cDEGREES};
221 UtAngleValue mInitialRAAN{-90.0, UtUnitAngle::cDEGREES};
222 UtAngleValue mInitialAnomaly{-90.0, UtUnitAngle::cDEGREES};
223 std::string mConstellationName{};
224 std::string mPlatformType{};
225 UtPath mBasePath{"./"};
226};
227
228#endif // WSFCONSTELLATIONOPTIONS_HPP
static constexpr const char * cHEADER_START_MARKER
Definition WsfConstellationOptions.hpp:169
static constexpr const char * cGENERATION_PATH
Definition WsfConstellationOptions.hpp:157
void SetOrbitalPeriod(const UtTimeValue &aOrbitalPeriod)
Set the orbital period of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:124
void SetInclination(const UtAngleValue &aInclination)
Set the inclination of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:130
static constexpr const char * cSEMI_MAJOR_AXIS
Definition WsfConstellationOptions.hpp:167
void SetInitialRAAN(const UtAngleValue &aInitialRAAN)
Set the RAAN of the zeroth plane in this constellation design.
Definition WsfConstellationOptions.hpp:133
const UtAngleValue & GetAnomalyAlias() const
Return the inter-plane phasing angle in this constellation design.
Definition WsfConstellationOptions.hpp:67
const UtLengthValue & GetSemiMajorAxis() const
Return the semi-major axis of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:73
bool SpecifiedAsCircularAltitude() const
Return if the orbit size was specified via the circular altitude.
Definition WsfConstellationOptions.hpp:88
bool IsGeneral() const
Return if these options are for a general design.
Definition WsfConstellationOptions.hpp:52
void SetCircularAltitude(const UtLengthValue &aCircularAltitude)
Set the circular altitude of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:118
double GetRevolutionsPerDay() const
Return the number of revolutions per day of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:82
unsigned int GetSatsPerPlane() const
Return the number of members per plane in this constellation design.
Definition WsfConstellationOptions.hpp:61
void SetRevolutionsPerDay(double aRevolutionsPerDay)
Set the number of revolutions per day of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:127
const UtAngleValue & GetRAAN_Range() const
Return the range in RAAN over which the orbital planes are distributed in this constellation design.
Definition WsfConstellationOptions.hpp:70
const UtPath & GetBasePath() const
Return the base path to which any generated files will be placed for this constellation design.
Definition WsfConstellationOptions.hpp:112
static constexpr const char * cANOMALY_ALIAS
Definition WsfConstellationOptions.hpp:165
unsigned int GetTotalSats() const
Return the total number of members in this constellation design.
Definition WsfConstellationOptions.hpp:55
static WsfConstellationOptions CreateWalkerDelta(unsigned int aNumTotalSats, unsigned int aNumPlanes, unsigned int aWalkerF)
Definition WsfConstellationOptions.cpp:46
const UtAngleValue & GetInclination() const
Return the inclination of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:97
const UtAngleValue & GetInitialAnomaly() const
Return the true anomaly of the zeroth member of the zeroth plane in this constellation design.
Definition WsfConstellationOptions.hpp:103
static constexpr const char * cPERIOD
Definition WsfConstellationOptions.hpp:168
bool SpecifiedAsRevolutionsPerDay() const
Return if the orbit size was specified via the number of revolutions per day.
Definition WsfConstellationOptions.hpp:94
void SetConstellationName(const std::string &aConstellationName)
Set the name of this constellation design.
Definition WsfConstellationOptions.hpp:139
bool SpecifiedAsOrbitalPeriod() const
Return if the orbit size was specified via the orbital period.
Definition WsfConstellationOptions.hpp:91
void SetPlatformType(const std::string &aPlatformType)
Set the platform type of the members of this constellation design.
Definition WsfConstellationOptions.hpp:142
static constexpr const char * cSATS_PER_PLANE
Definition WsfConstellationOptions.hpp:161
static constexpr const char * cINITIAL_RAAN
Definition WsfConstellationOptions.hpp:162
unsigned int GetWalkerF() const
Return the Walker inter-plane phasing parameter in this constellation design.
Definition WsfConstellationOptions.hpp:64
static constexpr const char * cINITIAL_ANOMALY
Definition WsfConstellationOptions.hpp:164
bool IsWalkerDelta() const
Return if these options are for a Walker Delta design.
Definition WsfConstellationOptions.hpp:46
std::string ValidateSetup() const
Definition WsfConstellationOptions.cpp:126
static constexpr const char * cBASE_NAME
Definition WsfConstellationOptions.hpp:155
const UtAngleValue & GetInitialRAAN() const
Return the RAAN of the zeroth orbital plane in this constellation design.
Definition WsfConstellationOptions.hpp:100
void SetSemiMajorAxis(const UtLengthValue &aSemiMajorAxis)
Set the semi-major axis of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:115
const std::string & GetPlatformType() const
Return the type of platform that would be used for members of this constellation design.
Definition WsfConstellationOptions.hpp:109
static WsfConstellationOptions CreateWalkerStar(unsigned int aNumTotalSats, unsigned int aNumPlanes, unsigned int aWalkerF)
Definition WsfConstellationOptions.cpp:78
void SetInitialAnomaly(const UtAngleValue &aInitialAnomaly)
Set the true anomaly of the zeroth member of the zeroth orbital plane in this constellation design.
Definition WsfConstellationOptions.hpp:136
const UtLengthValue & GetCircularAltitude() const
Return the circular altitude of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:76
static WsfConstellationOptions CreateGeneral(unsigned int aNumPlanes, unsigned int aNumSatsPerPlane, const UtAngleValue &aAnomalyAlias, const UtAngleValue &aRAAN_Range)
Create a set of options for General constellation.
Definition WsfConstellationOptions.cpp:99
static constexpr const char * cINCLINATION
Definition WsfConstellationOptions.hpp:159
static constexpr const char * cREVS_PER_DAY
Definition WsfConstellationOptions.hpp:158
bool IsSetup() const
Return if this object has been fully set up.
Definition WsfConstellationOptions.cpp:114
static constexpr const char * cNUM_PLANES
Definition WsfConstellationOptions.hpp:160
static constexpr const char * cALTITUDE
Definition WsfConstellationOptions.hpp:166
static constexpr const char * cRAAN_RANGE
Definition WsfConstellationOptions.hpp:163
const UtTimeValue & GetOrbitalPeriod() const
Return the orbital period of the orbits in this constellation design.
Definition WsfConstellationOptions.hpp:79
WsfConstellationOptions(const WsfConstellationOptions &aOther)=default
bool SpecifiedAsSemiMajorAxis() const
Return if the orbit size was specified via semi-major axis.
Definition WsfConstellationOptions.hpp:85
static constexpr const char * cPLATFORM_TYPE
Definition WsfConstellationOptions.hpp:156
WsfConstellationOptions & operator=(const WsfConstellationOptions &aOther)=default
unsigned int GetNumPlanes() const
Return the number of orbital planes in this constellation design.
Definition WsfConstellationOptions.hpp:58
const std::string & GetConstellationName() const
Return the name of the constellation design.
Definition WsfConstellationOptions.hpp:106
void SetBasePath(const UtPath &aBasePath)
Set the base path of any generated files for this constellation design.
Definition WsfConstellationOptions.hpp:145
bool IsWalkerStar() const
Return if these options are for a Walker Star design.
Definition WsfConstellationOptions.hpp:49
Copyrights Multiple, All Rights Reserved