Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Good evening, Mr. Henty!

When convenient, would you mind providing a quick demonstration on how to use FsILSInfo class via managed code (c#).  Again, thank you for EVERYTHING you do!

Posted

Hi,

The basic use of the airports database is covered in the example code application.

The examples below for the ILS info assume you already have an FsAirport object. I've used EGLL:

// Get airport info for EGLL
FsAirport egll = db.Airports["EGLL"];

Example 1: Getting all runways at the airport with ILS info and displaying the ILS details in a listbox:

            // Clear any ILS info in the listbox
            this.lstILS.Items.Clear();
            // Go through each runway and find those with ILS info
            foreach (FsRunway rw in egll.Runways)
            {
                if (rw.ILSInfo != null)
                {
                    // This runway has ILS Data - Show it in the list box
                    string ilsInfo = "Runway " + rw.ID + " | Freq: " + rw.ILSInfo.Frequency + " | Hdg: " + rw.ILSInfo.Heading.ToString("F0");
                    this.lstILS.Items.Add(ilsInfo);
                }
            }

 

Example 2: Getting ILS info for a specific runway at the airport:

            string runwayID = "27L";
            FsRunway rw = egll.Runways[runwayID];
            if (rw != null)
            {
                if (rw.ILSInfo != null)
                {
                    string ilsInfo = "Runway " + runwayID + " | Freq: " + rw.ILSInfo.Frequency + " | Hdg: " + rw.ILSInfo.Heading.ToString("F0");
                    MessageBox.Show(ilsInfo);
                }
                else
                {
                    MessageBox.Show("Runway " + runwayID + " has no ILS");
                }
            }

 

The FsILSInfo class has a few other properties:

http://fsuipc.paulhenty.com/Reference/html/classFSUIPC_1_1FsILSInfo.html

Paul

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.