WSF
WsfConstellationMaker.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 WSFCONSTELLATIONMAKER_HPP
13#define WSFCONSTELLATIONMAKER_HPP
14
15#include <memory>
16
17class UtCalendar;
18#include "UtPath.hpp"
19class UtScript;
20#include "UtUnitTypes.hpp"
21
24class WsfPlatform;
26class WsfSimulation;
27
40class WsfConstellationMaker
41{
42public:
43 static std::unique_ptr<WsfConstellationMaker> CreateWalkerDelta(unsigned int aNumTotalSats,
44 unsigned int aNumPlanes,
45 unsigned int aWalkerF);
46 static std::unique_ptr<WsfConstellationMaker> CreateWalkerStar(unsigned int aNumTotalSats,
47 unsigned int aNumPlanes,
48 unsigned int aWalkerF);
49 static std::unique_ptr<WsfConstellationMaker> CreateGeneral(unsigned int aNumPlanes,
50 unsigned int aNumSatsPerPlane,
51 UtAngleValue aAnomalyAlias,
52 UtAngleValue aRAAN_Range);
53
54 void WriteToFile() const;
55 WsfConstellation* Create(double aCreationTime,
56 WsfSimulation& aSimulation,
57 WsfScriptContext& aContext,
58 UtScript* aFilterScriptPtr,
59 UtScript* aSetupScriptPtr) const;
60 bool DetectConjunction() const;
61
63 bool IsSetup() const { return mOptions.IsSetup(); }
64
66 std::string Validate() const { return mOptions.ValidateSetup(); }
67
69 bool IsWalkerDelta() const { return mOptions.IsWalkerDelta(); }
70
72 bool IsWalkerStar() const { return mOptions.IsWalkerStar(); }
73
75 bool IsGeneral() const { return mOptions.IsGeneral(); }
76
78 unsigned int GetNumTotalSats() const { return mOptions.GetTotalSats(); }
79
81 unsigned int GetNumPlanes() const { return mOptions.GetNumPlanes(); }
82
84 unsigned int GetSatsPerPlane() const { return mOptions.GetSatsPerPlane(); }
85
86 // Return the Walker inter-plane phasing parameter angle of constellations produced by this object.
87 unsigned int GetWalkerF() const { return mOptions.GetWalkerF(); }
88
90 const UtAngleValue& GetAnomalyAlias() const { return mOptions.GetAnomalyAlias(); }
91
93 const UtAngleValue& GetRAAN_Range() const { return mOptions.GetRAAN_Range(); }
94
96 const UtLengthValue& GetSemiMajorAxis() const { return mOptions.GetSemiMajorAxis(); }
97
99 const UtLengthValue& GetCircularAltitude() const { return mOptions.GetCircularAltitude(); }
100
102 const UtTimeValue& GetOrbitalPeriod() const { return mOptions.GetOrbitalPeriod(); }
103
105 double GetRevolutionsPerDay() const { return mOptions.GetRevolutionsPerDay(); }
106
108 const UtAngleValue& GetInclination() const { return mOptions.GetInclination(); }
109
111 const UtAngleValue& GetInitialRAAN() const { return mOptions.GetInitialRAAN(); }
112
114 const UtAngleValue& GetInitialAnomaly() const { return mOptions.GetInitialAnomaly(); }
115
117 const std::string& GetConstellationName() const { return mOptions.GetConstellationName(); }
118
120 const std::string& GetPlatformType() const { return mOptions.GetPlatformType(); }
121
123 const UtPath& GetBasePath() const { return mOptions.GetBasePath(); }
124
126 void SetSemiMajorAxis(const UtLengthValue& aSemiMajorAxis) { mOptions.SetSemiMajorAxis(aSemiMajorAxis); }
127
129 void SetCircularAltitude(const UtLengthValue& aCircularAltitude) { mOptions.SetCircularAltitude(aCircularAltitude); }
130
132 void SetOrbitalPeriod(const UtTimeValue& aOrbitalPeriod) { mOptions.SetOrbitalPeriod(aOrbitalPeriod); }
133
135 void SetRevolutionsPerDay(double aRevolutionsPerDay) { mOptions.SetRevolutionsPerDay(aRevolutionsPerDay); }
136
138 void SetInclination(const UtAngleValue& aInclination) { mOptions.SetInclination(aInclination); }
139
141 void SetInitialRAAN(const UtAngleValue& aInitialRAAN) { mOptions.SetInitialRAAN(aInitialRAAN); }
142
144 void SetInitialAnomaly(const UtAngleValue& aInitialAnomaly) { mOptions.SetInitialAnomaly(aInitialAnomaly); }
145
147 void SetConstellationName(const std::string& aName) { mOptions.SetConstellationName(aName); }
148
150 void SetPlatformType(const std::string& aPlatformType) { mOptions.SetPlatformType(aPlatformType); }
151
153 void SetBasePath(const UtPath& aBasePath) { mOptions.SetBasePath(aBasePath); }
154
155private:
156 explicit WsfConstellationMaker(const WsfConstellationOptions& aOptions)
157 : mOptions{aOptions}
158 {
159 }
160
161 std::string GetGeneratedName() const;
162 void CreateContainingFolder() const;
163
164 WsfPlatform* CheckTypeExistence(WsfSimulation& aSimulation) const;
165 void CheckNameCollisions(const WsfSimulation& aSimulation) const;
166 bool FilterMember(WsfScriptContext& aContext,
167 UtScript* aFilterScriptPtr,
168 double aSimTime,
169 unsigned int aPlane,
170 unsigned int aSatellite) const;
171 WsfConstellation* AddMembersToSimulation(double aCreationTime,
172 WsfSimulation& aSimulation,
173 WsfScriptContext& aContext,
174 UtScript* aFilterScriptPtr,
175 WsfPlatform* aPlatformType) const;
176 void SetupMemberElements(WsfPlatform* aMemberPtr, unsigned int aPlane, unsigned int aSat, const UtCalendar& aEpoch) const;
177 void SetupMembers(WsfScriptContext& aContext,
178 UtScript* aFilterScriptPtr,
179 double aSimTime,
180 WsfConstellation* aConstellationPtr) const;
181
182 WsfConstellationOptions mOptions;
183};
184
185#endif // WSFCONSTELLATIONMAKER_HPP
Definition WsfConstellationMaker.hpp:41
bool DetectConjunction() const
Definition WsfConstellationMaker.cpp:221
void SetConstellationName(const std::string &aName)
Set the name of constellations produced by this object.
Definition WsfConstellationMaker.hpp:147
const UtAngleValue & GetAnomalyAlias() const
Return the inter-plane phasing angle of constellations produced by this object.
Definition WsfConstellationMaker.hpp:90
void SetBasePath(const UtPath &aBasePath)
Set the base path to any files generated by this object.
Definition WsfConstellationMaker.hpp:153
const UtAngleValue & GetInclination() const
Get the inclination of orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:108
const std::string & GetPlatformType() const
Get the type of platforms for constellations produced by this object.
Definition WsfConstellationMaker.hpp:120
void SetInitialRAAN(const UtAngleValue &aInitialRAAN)
Set the RAAN of the zeroth orbital plane for constellations produced by this object.
Definition WsfConstellationMaker.hpp:141
const UtLengthValue & GetSemiMajorAxis() const
Get the semi-major axis of the orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:96
void SetOrbitalPeriod(const UtTimeValue &aOrbitalPeriod)
Set the period of the orbits for constellations produces by this object.
Definition WsfConstellationMaker.hpp:132
void WriteToFile() const
Definition WsfConstellationMaker.cpp:151
const UtTimeValue & GetOrbitalPeriod() const
Get the period of orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:102
static std::unique_ptr< WsfConstellationMaker > CreateWalkerDelta(unsigned int aNumTotalSats, unsigned int aNumPlanes, unsigned int aWalkerF)
Definition WsfConstellationMaker.cpp:86
const UtAngleValue & GetRAAN_Range() const
Return the range in RAAN over which the orbital planes are distributed for constellations produced by...
Definition WsfConstellationMaker.hpp:93
void SetRevolutionsPerDay(double aRevolutionsPerDay)
Set the number of revolutions per day for orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:135
void SetSemiMajorAxis(const UtLengthValue &aSemiMajorAxis)
Set the semi-major axis of the orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:126
const UtLengthValue & GetCircularAltitude() const
Get the circular altitude of the orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:99
void SetCircularAltitude(const UtLengthValue &aCircularAltitude)
Set the circular altitude of the orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:129
unsigned int GetNumPlanes() const
Return the number of orbital planes of constellations produced by this object.
Definition WsfConstellationMaker.hpp:81
unsigned int GetNumTotalSats() const
Return the total number of members of constellations produced by this object.
Definition WsfConstellationMaker.hpp:78
bool IsGeneral() const
Return if the constellation has a general design.
Definition WsfConstellationMaker.hpp:75
static std::unique_ptr< WsfConstellationMaker > CreateWalkerStar(unsigned int aNumTotalSats, unsigned int aNumPlanes, unsigned int aWalkerF)
Definition WsfConstellationMaker.cpp:111
void SetInitialAnomaly(const UtAngleValue &aInitialAnomaly)
Set the true anomaly of the zeroth member of the zeroth plane for constellations produced by this obj...
Definition WsfConstellationMaker.hpp:144
const UtAngleValue & GetInitialAnomaly() const
Get the true anomaly of the zeroth member of the zeroth plane for constellations produced by this obj...
Definition WsfConstellationMaker.hpp:114
void SetInclination(const UtAngleValue &aInclination)
Set the inclination of the orbits in constellations produced by this object.
Definition WsfConstellationMaker.hpp:138
unsigned int GetWalkerF() const
Definition WsfConstellationMaker.hpp:87
bool IsWalkerDelta() const
Return if the constellation has a Walker Delta design.
Definition WsfConstellationMaker.hpp:69
std::string Validate() const
Validate the constellation design, returning any deficiencies.
Definition WsfConstellationMaker.hpp:66
unsigned int GetSatsPerPlane() const
Return the number of members per orbital plane of constellations produced by this object.
Definition WsfConstellationMaker.hpp:84
const std::string & GetConstellationName() const
Get the name of constellations produced by this object.
Definition WsfConstellationMaker.hpp:117
WsfConstellation * Create(double aCreationTime, WsfSimulation &aSimulation, WsfScriptContext &aContext, UtScript *aFilterScriptPtr, UtScript *aSetupScriptPtr) const
Definition WsfConstellationMaker.cpp:200
double GetRevolutionsPerDay() const
Get the number of revolutions per day of orbits for constellations produced by this object.
Definition WsfConstellationMaker.hpp:105
bool IsSetup() const
Return if the constellation design is fully specified.
Definition WsfConstellationMaker.hpp:63
const UtPath & GetBasePath() const
Get the base path to any files produced by this object.
Definition WsfConstellationMaker.hpp:123
const UtAngleValue & GetInitialRAAN() const
Get the RAAN of the zeroth orbital plane for constellations produced by this object.
Definition WsfConstellationMaker.hpp:111
void SetPlatformType(const std::string &aPlatformType)
Set the type of platform for members of the constellation produced by this object.
Definition WsfConstellationMaker.hpp:150
static std::unique_ptr< WsfConstellationMaker > CreateGeneral(unsigned int aNumPlanes, unsigned int aNumSatsPerPlane, UtAngleValue aAnomalyAlias, UtAngleValue aRAAN_Range)
Definition WsfConstellationMaker.cpp:131
bool IsWalkerStar() const
Return if the constellation has a Walker Star design.
Definition WsfConstellationMaker.hpp:72
Definition WsfConstellationOptions.hpp:27
Definition WsfConstellation.hpp:25
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Definition WsfScriptContext.hpp:71
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Copyrights Multiple, All Rights Reserved