Skip to content

Commit

Permalink
Comment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-guillet committed May 28, 2023
1 parent 970c415 commit d9f339e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions IO.SDK.Tests/APITests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@ TEST(API, UTCToString)
ASSERT_STREQ("2000-01-01 12:00:00.000000 (UTC)", res);
}

TEST(API, SitePropagation)
TEST(API, SiteAndSpacecraftPropagation)
{
//Configure site
IO::SDK::API::DTO::ScenarioDTO scenario{};
scenario.Name = "scenatiosites";
scenario.Window.start = 668085625.01523638;
scenario.Window.end = 668174330.814560;

//Define celestial body involved in the propagation
scenario.CelestialBodies[0].Id = 399;
scenario.CelestialBodies[1].Id = 10;

//Configure site
scenario.Sites[0].id = 399033;
scenario.Sites[0].name = "S33";
std::string sitePath(SitePath);
Expand All @@ -43,6 +48,8 @@ TEST(API, SitePropagation)
scenario.Sites[0].coordinates.longitude = -1.4137166941154069;
scenario.Sites[0].coordinates.latitude = 0.49741883681838395;
scenario.Sites[0].coordinates.altitude = 0.0;

//Configure spacecraft
scenario.Spacecraft.id = -1111;
scenario.Spacecraft.name = "spc1";
scenario.Spacecraft.dryOperatingMass = 1000.0;
Expand All @@ -65,13 +72,18 @@ TEST(API, SitePropagation)

TEST(API, SpacecraftPropagation)
{
//Configure Scenario
IO::SDK::API::DTO::ScenarioDTO scenario{};
scenario.Name = "scenatiosites";
scenario.Window.start = 668085625.015240;
scenario.Window.end = 668174469.185440;

//Add involved celestia bodies
scenario.CelestialBodies[0].Id = 10;
scenario.CelestialBodies[1].Id = 399;
scenario.CelestialBodies[2].Id = 301;

//Add and configure spacecraft
scenario.Spacecraft.id = -1111;
scenario.Spacecraft.name = "spc1";
scenario.Spacecraft.dryOperatingMass = 1000.0;
Expand All @@ -80,30 +92,34 @@ TEST(API, SpacecraftPropagation)
scenario.Spacecraft.directoryPath = spacecraftPath.c_str();
scenario.Spacecraft.initialOrbitalParameter.centerOfMotion.Id = 399;
scenario.Spacecraft.initialOrbitalParameter.epoch = 667915269.18539762;
scenario.Spacecraft.initialOrbitalParameter.inertialFrame = "J2000";
scenario.Spacecraft.initialOrbitalParameter.inertialFrame = IO::SDK::Frames::InertialFrames::GetICRF().ToCharArray();
scenario.Spacecraft.initialOrbitalParameter.position.x = 5056554.1874925727;
scenario.Spacecraft.initialOrbitalParameter.position.y = 4395595.4942363985;
scenario.Spacecraft.initialOrbitalParameter.position.z = 0.0;
scenario.Spacecraft.initialOrbitalParameter.velocity.x = -3708.6305608890916;
scenario.Spacecraft.initialOrbitalParameter.velocity.y = 4266.2914313011433;
scenario.Spacecraft.initialOrbitalParameter.velocity.z = 6736.8538488755494;

//Add a fuel tank to spacecraft
scenario.Spacecraft.fuelTank[0].id = 1;
scenario.Spacecraft.fuelTank[0].serialNumber = "ft1";
scenario.Spacecraft.fuelTank[0].capacity = 9000;
scenario.Spacecraft.fuelTank[0].quantity = 9000;

//Add engine to spacecraft
scenario.Spacecraft.engines[0].id = 1;
scenario.Spacecraft.engines[0].name = "eng1";
scenario.Spacecraft.engines[0].serialNumber = "eng1";
scenario.Spacecraft.engines[0].fuelTankSerialNumber = "ft1";
scenario.Spacecraft.engines[0].fuelFlow = 50.0;
scenario.Spacecraft.engines[0].isp = 450.0;

//Add payload to spacecraft
scenario.Spacecraft.payloads[0].serialNumber = "pl1";
scenario.Spacecraft.payloads[0].name = "pl1";
scenario.Spacecraft.payloads[0].mass = 50;

//Configure orbital maneuver
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.position.x = 4390853.7278876612;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.position.y = 5110607.0005866792;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.position.z = 917659.86391987884;
Expand All @@ -112,10 +128,11 @@ TEST(API, SpacecraftPropagation)
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.velocity.z = 6933.1803797017265;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.centerOfMotion.Id = 399;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.epoch = 667915269.18539762;
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.inertialFrame = "J2000";
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].targetOrbit.inertialFrame = IO::SDK::Frames::InertialFrames::GetICRF().ToCharArray();
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].engines[0] = "eng1";
scenario.Spacecraft.orbitalPlaneChangingManeuvers[0].maneuverOrder = 0;

//Execute propagation
PropagateProxy(scenario);

IO::SDK::Time::TDB tdbStart(
Expand Down

0 comments on commit d9f339e

Please sign in to comment.