Skip to content

Commit

Permalink
Remove centerOfMotion from original centerOfMotion (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-guillet authored May 28, 2023
1 parent 466eaa8 commit 970c415
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 36 deletions.
7 changes: 0 additions & 7 deletions IO.SDK.Tests/APITests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ TEST(API, SitePropagation)
scenario.Window.start = 668085625.01523638;
scenario.Window.end = 668174330.814560;
scenario.CelestialBodies[0].Id = 399;
scenario.CelestialBodies[0].centerOfMotionId = 10;
scenario.CelestialBodies[1].Id = 10;
scenario.Sites[0].id = 399033;
scenario.Sites[0].name = "S33";
Expand All @@ -49,7 +48,6 @@ TEST(API, SitePropagation)
scenario.Spacecraft.dryOperatingMass = 1000.0;
scenario.Spacecraft.maximumOperatingMass = 3000.0;
scenario.Spacecraft.initialOrbitalParameter.centerOfMotion.Id = 399;
scenario.Spacecraft.initialOrbitalParameter.centerOfMotion.centerOfMotionId = 10;
scenario.Spacecraft.initialOrbitalParameter.epoch = 668085625.01523638;
scenario.Spacecraft.initialOrbitalParameter.inertialFrame = "J2000";
scenario.Spacecraft.initialOrbitalParameter.position.x = 6800.0;
Expand All @@ -73,17 +71,14 @@ TEST(API, SpacecraftPropagation)
scenario.Window.end = 668174469.185440;
scenario.CelestialBodies[0].Id = 10;
scenario.CelestialBodies[1].Id = 399;
scenario.CelestialBodies[1].centerOfMotionId = 10;
scenario.CelestialBodies[2].Id = 301;
scenario.CelestialBodies[2].centerOfMotionId = 399;
scenario.Spacecraft.id = -1111;
scenario.Spacecraft.name = "spc1";
scenario.Spacecraft.dryOperatingMass = 1000.0;
scenario.Spacecraft.maximumOperatingMass = 10000.0;
std::string spacecraftPath(SpacecraftPath);
scenario.Spacecraft.directoryPath = spacecraftPath.c_str();
scenario.Spacecraft.initialOrbitalParameter.centerOfMotion.Id = 399;
scenario.Spacecraft.initialOrbitalParameter.centerOfMotion.centerOfMotionId = 10;
scenario.Spacecraft.initialOrbitalParameter.epoch = 667915269.18539762;
scenario.Spacecraft.initialOrbitalParameter.inertialFrame = "J2000";
scenario.Spacecraft.initialOrbitalParameter.position.x = 5056554.1874925727;
Expand Down Expand Up @@ -116,7 +111,6 @@ TEST(API, SpacecraftPropagation)
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.velocity.y = 3033.2639866911495;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.velocity.z = 6933.1803797017265;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.centerOfMotion.Id = 399;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.centerOfMotion.centerOfMotionId = 10;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.epoch = 667915269.18539762;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.inertialFrame = "J2000";
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].engines[0] = "eng1";
Expand Down Expand Up @@ -364,7 +358,6 @@ TEST(API, WriteEphemeris)
sv[i].velocity.z = i;
sv[i].epoch = i;
sv[i].centerOfMotion.Id = 399;
sv[i].centerOfMotion.centerOfMotionId = 10;
sv[i].inertialFrame = "J2000";
}

Expand Down
60 changes: 31 additions & 29 deletions IO.SDK/Aberrations.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,44 @@
*/
#ifndef ABERRATION_H
#define ABERRATION_H
#include<string>

#include <string>
#include <map>

namespace IO::SDK
{
enum class AberrationsEnum
{
None,
LT,
LTS,
CN,
CNS,
XLT,
XLTS,
XCN,
XCNS
};
enum class AberrationsEnum
{
None,
LT,
LTS,
CN,
CNS,
XLT,
XLTS,
XCN,
XCNS
};

class Aberrations
{
class Aberrations
{
private:
static inline std::map<AberrationsEnum, const char*> AberrationStrings{
{ AberrationsEnum::None, "NONE" },
{ AberrationsEnum::LT, "LT" },
{ AberrationsEnum::LTS, "LT+S" },
{ AberrationsEnum::CN, "CN" },
{ AberrationsEnum::CNS, "CN+S" },
{ AberrationsEnum::XLT, "XLT" },
{ AberrationsEnum::XLTS, "XLT+S" },
{ AberrationsEnum::XCN, "XCN" },
{ AberrationsEnum::XCNS, "XCN+S" }
static inline std::map<AberrationsEnum, const char *> AberrationStrings{
{AberrationsEnum::None, "NONE"},
{AberrationsEnum::LT, "LT"},
{AberrationsEnum::LTS, "LT+S"},
{AberrationsEnum::CN, "CN"},
{AberrationsEnum::CNS, "CN+S"},
{AberrationsEnum::XLT, "XLT"},
{AberrationsEnum::XLTS, "XLT+S"},
{AberrationsEnum::XCN, "XCN"},
{AberrationsEnum::XCNS, "XCN+S"}
};
public:
static std::string ToString(AberrationsEnum e) ;
static AberrationsEnum ToEnum(const std::string& e) ;
};
public:
static std::string ToString(AberrationsEnum e);

static AberrationsEnum ToEnum(const std::string &e);
};
}
#endif // ! ABERRATION_H

Expand Down

0 comments on commit 970c415

Please sign in to comment.