-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44e6e38
commit d7bf308
Showing
38 changed files
with
623 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<Platforms>x64</Platforms> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="Resources\README.pdf" /> | ||
<EmbeddedResource Include="Resources\VSOP2013.ctl" /> | ||
<EmbeddedResource Include="Resources\VSOP2013.f" /> | ||
<EmbeddedResource Include="Resources\VSOP2013-secular.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p1.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p2.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p3.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p4.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p5.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p6.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p7.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p8.dat" /> | ||
<EmbeddedResource Include="Resources\VSOP2013p9.dat" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="MessagePack" Version="2.5.108" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\VSOP2013\VSOP2013.csproj" /> | ||
</ItemGroup> | ||
|
||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using MessagePack; | ||
using System.Diagnostics; | ||
using System.Runtime.Serialization.Formatters.Binary; | ||
|
||
namespace VSOP2013.DataConverter | ||
{ | ||
internal class Program | ||
{ | ||
private static void Main(string[] args) | ||
{ | ||
var lz4Options = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4Block); | ||
|
||
#region Read Original Data | ||
|
||
Stopwatch sw = new Stopwatch(); | ||
sw.Start(); | ||
|
||
List<PlanetTable> VSOP2013DATA = DataReader.ReadData(); | ||
|
||
sw.Stop(); | ||
double ticks = sw.ElapsedTicks; | ||
double Freq = Stopwatch.Frequency; | ||
double milliseconds = (ticks / Freq) * 1000; | ||
Console.WriteLine($"Data Read OK...Elapsed milliseconds: {milliseconds} ms"); | ||
Console.WriteLine("Press Enter to dump data..."); | ||
Console.ReadLine(); | ||
|
||
#endregion Read Original Data | ||
|
||
#region Dump Data | ||
|
||
string OutputDirPath = Directory.GetCurrentDirectory() + @"\Data"; | ||
if (!Directory.Exists(OutputDirPath)) | ||
{ | ||
Directory.CreateDirectory(OutputDirPath); | ||
} | ||
DirectoryInfo OutputDir = new DirectoryInfo(Directory.GetCurrentDirectory() + @"\Data"); | ||
|
||
sw.Restart(); | ||
|
||
ParallelLoopResult result = Parallel.For(0, 9, ip => | ||
{ | ||
string filename = Path.Combine(OutputDir.FullName, string.Format("VSOP2013_{0}.BIN", VSOP2013DATA[ip].body.ToString())); | ||
if (File.Exists(filename)) | ||
{ | ||
File.Delete(filename); | ||
} | ||
using (FileStream fs = new FileStream(filename, FileMode.OpenOrCreate)) | ||
{ | ||
BinaryFormatter bf = new BinaryFormatter(); | ||
MessagePackSerializer.Serialize(fs, VSOP2013DATA[ip], lz4Options); | ||
} | ||
}); | ||
|
||
sw.Stop(); | ||
ticks = sw.ElapsedTicks; | ||
milliseconds = (ticks / Freq) * 1000; | ||
Console.WriteLine($"Data Dumped OK. Elapsed: {milliseconds}ms"); | ||
Console.WriteLine("Press Enter to test dumped data..."); | ||
Console.ReadLine(); | ||
|
||
#endregion Dump Data | ||
|
||
#region Test | ||
|
||
sw.Restart(); | ||
|
||
result = Parallel.For(0, 9, ip => | ||
{ | ||
string filename = Path.Combine(OutputDir.FullName, string.Format("VSOP2013_{0}.BIN", ((VSOPBody)ip).ToString())); | ||
using (FileStream fs = new FileStream(filename, FileMode.OpenOrCreate)) | ||
{ | ||
|
||
VSOP2013DATA.Add(MessagePackSerializer.Deserialize<PlanetTable>(fs, lz4Options)); | ||
} | ||
}); | ||
|
||
sw.Stop(); | ||
ticks = sw.ElapsedTicks; | ||
milliseconds = (ticks / Freq) * 1000; | ||
Console.WriteLine($"Data Reload Test OK. Elapsed: {milliseconds}ms"); | ||
Console.ReadLine(); | ||
|
||
#endregion Test | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
copy bin\Debug\net6.0\Data ..\VSOP2013\Resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.