Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Features/uprage native library (#96)
Browse files Browse the repository at this point in the history
* Remove propagator into native library

* minor fixes

* Upgrade native libraries
  • Loading branch information
sylvain-guillet authored Apr 30, 2024
1 parent 95ffbb4 commit 8c88897
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion IO.Astrodynamics.CLI/IO.Astrodynamics.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<FileVersion>0.0.1</FileVersion>
<PackAsTool>true</PackAsTool>
<ToolCommandName>astro</ToolCommandName>
<Version>0.1.6</Version>
<Version>0.1.7</Version>
<Title>Astrodynamics command line interface</Title>
<Authors>Sylvain Guillet</Authors>
<Description>This CLI allows end user to exploit IO.Astrodynamics framework </Description>
Expand Down
8 changes: 4 additions & 4 deletions IO.Astrodynamics.Performance/Scenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace IO.Astrodynamics.Performance;
[SkewnessColumn]
[KurtosisColumn]
[StatisticalTestColumn]
// [ShortRunJob]
[ShortRunJob]
public class Scenario
{
private readonly GeopotentialGravitationalField _geopotential;
Expand All @@ -43,18 +43,18 @@ public Scenario()
Spacecraft spc = new Spacecraft(-1001, "MySpacecraft", 100.0, 10000.0, clk,
new StateVector(new Vector3(6800000.0, 0.0, 0.0), new Vector3(0.0, 7656.2204182967143, 0.0), _earth, DateTimeExtension.J2000, Frames.Frame.ICRF));
_srp = new SolarRadiationPressure(spc);
_atm = new AtmosphericDrag(spc,_earth);
_atm = new AtmosphericDrag(spc, _earth);
List<ForceBase> forces = new List<ForceBase>();
forces.Add(new GravitationalAcceleration(_sun));
forces.Add(new GravitationalAcceleration(_moon));
forces.Add(new GravitationalAcceleration(_earth));
forces.Add(new AtmosphericDrag(spc,_earth));
forces.Add(new AtmosphericDrag(spc, _earth));
forces.Add(new SolarRadiationPressure(spc));
_integrator = new VVIntegrator(forces, TimeSpan.FromSeconds(1.0), new StateVector(new Vector3(6800000.0 - Random.Shared.NextDouble(), 0.0, 0.0),
new Vector3(0.0, 8000.0 - Random.Shared.NextDouble(), 0.0), _earth,
DateTimeExtension.J2000, Frame.ICRF));
_spacecraftPropagator = new Propagator.SpacecraftPropagator(new Window(DateTimeExtension.J2000, DateTimeExtension.J2000 + spc.InitialOrbitalParameters.Period()), spc,
new[] { _moon }, true, true, TimeSpan.FromSeconds(1.0));
new[] { _moon, _earth, _sun }, true, true, TimeSpan.FromSeconds(1.0));
}

// [Benchmark(Description = "Spacecraft spacecraftPropagator C++")]
Expand Down
19 changes: 9 additions & 10 deletions IO.Astrodynamics/API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,17 +592,16 @@ public IEnumerable<LaunchWindow> FindLaunchWindows(Maneuver.Launch launch,
ILocalizable observer, ILocalizable target, Frame frame,
Aberration aberration, TimeSpan stepSize)
{
if (observer == null) throw new ArgumentNullException(nameof(observer));
if (target == null) throw new ArgumentNullException(nameof(target));
if (frame == null) throw new ArgumentNullException(nameof(frame));
ArgumentNullException.ThrowIfNull(observer);
ArgumentNullException.ThrowIfNull(target);
ArgumentNullException.ThrowIfNull(frame);
lock (lockObject)
{
const int messageSize = 10000;
List<OrbitalParameters.OrbitalParameters> orbitalParameters = [];
int occurences = (int)(searchWindow.Length / stepSize / messageSize);

int occurrences = (int)(searchWindow.Length / stepSize / messageSize);

for (int i = 0; i <= occurences; i++)
for (int i = 0; i <= occurrences; i++)
{
var start = searchWindow.StartDate + i * messageSize * stepSize;
var end = start + messageSize * stepSize > searchWindow.EndDate ? searchWindow.EndDate : (start + messageSize * stepSize) - stepSize;
Expand Down Expand Up @@ -632,9 +631,9 @@ public IEnumerable<LaunchWindow> FindLaunchWindows(Maneuver.Launch launch,
public OrbitalParameters.OrbitalParameters ReadEphemeris(DateTime epoch, ILocalizable observer,
ILocalizable target, Frame frame, Aberration aberration)
{
if (observer == null) throw new ArgumentNullException(nameof(observer));
if (target == null) throw new ArgumentNullException(nameof(target));
if (frame == null) throw new ArgumentNullException(nameof(frame));
ArgumentNullException.ThrowIfNull(observer);
ArgumentNullException.ThrowIfNull(target);
ArgumentNullException.ThrowIfNull(frame);
lock (lockObject)
{
if (frame == null) throw new ArgumentNullException(nameof(frame));
Expand Down Expand Up @@ -731,7 +730,7 @@ public CelestialBody GetCelestialBodyInfo(int naifId)
{
lock (lockObject)
{
return GetCelestialBodyInfoProxy(naifId);
return GetCelestialBodyInfoProxy(naifId);
}
}

Expand Down
4 changes: 2 additions & 2 deletions IO.Astrodynamics/IO.Astrodynamics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@

<ItemGroup>
<None Remove="resources\IO.Astrodynamics.dll" />
<None Remove="resources\IO.Astrodynamics.lib" />
<None Remove="resources\libIO.Astrodynamics.so" />
<Content Include="resources\IO.Astrodynamics.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="resources\IO.Astrodynamics.lib" />
<Content Include="resources\IO.Astrodynamics.lib">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="resources\libIO.Astrodynamics.so" />
<Content Include="resources\libIO.Astrodynamics.so">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
2 changes: 1 addition & 1 deletion IO.Astrodynamics/IO.Astrodynamics.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>IO.Astrodynamics</id>
<authors>Sylvain Guillet</authors>
<copyright>Sylvain Guillet</copyright>
<version>3.0.2</version>
<version>3.0.3</version>
<title>Astrodynamics framework</title>
<icon>images\dragonfly-dark-trans.png</icon>
<readme>docs\README.md</readme>
Expand Down
Binary file modified IO.Astrodynamics/resources/IO.Astrodynamics.dll
Binary file not shown.
Binary file modified IO.Astrodynamics/resources/IO.Astrodynamics.lib
Binary file not shown.
Binary file modified IO.Astrodynamics/resources/libIO.Astrodynamics.so
100755 → 100644
Binary file not shown.

0 comments on commit 8c88897

Please sign in to comment.