SofaJpl Demonstration Program (C#)

(These instructions are correct for Visual Studio Express 2013.)

In Visual Studio, click File, New Project.

From the installed C# templates, select Windows Console Application. In the Name field, enter SofaJpDemoCs. Click OK.

When the source code editor window opens, click Project, Add Reference. In the Reference Manager window, click the Browse button near the bottom. Navigate to your SofaJpl folder. Select SofaJpl.dll. Click Add. Click OK in the Reference Manager window.

From your SofaJpl folder, copy SofaWin32.dll, star_cat.vot, and star_names.vot to the Visual Studio folder where the executable will be created. It's something like Documents \ Visual Studio 2013 \ Projects \ SofaJplDemoCs \ SofaJplDemoCs \ bin \ Debug.

Note: you must copy the DLL by hand in the previous step because it's a Win32 DLL, not a .NET DLL. An attempt to add it as a Reference would cause an error message.

Copy the C# source code and paste it into the source code editor so it replaces the code already there. Near the beginning is a #define MAKE_EPHEMERIS preprocessor directive which is commented out. Un-comment this directive to activate it. Also, edit the filenames near the beginning of the source code to match the names and locations in your system.

Click Debug, Start Without Debugging. The program will compile and display its output in a console window. Once started, there's no interaction with the user. During the run you may notice a momentay pause as the multi-megabyte ASCII ephemeris is processed. During this phase, the ASCII ephemeris and header are written as a binary ephemeris. After the binary is created there's no need to repeat the work, and so the preprocessor directive should be commented out after the first run of the program.

[up one level]

(page last modified 2018-08-29)