Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I want to write a very simple application and its supposed to help me track my flying hours. What I need is when I start at the gates, I will start my application too. It should record the icao code of the source and then log all my flight times and then finally when I stop at my destination, it should log my destination ICAO code and then compute the time.

I am able to read the time and thus make the calculation, but I am not able to find the following

1. current ICAO code where the aircraft is stationed

2. Whether the plane is airborne or back on the ground!!

I am coding in C# using the SDK provided with FSUIPC. I am also able to read the information of heading, Altitude, IAS, these are some of the things I have tried. But I got stuck on how to read the ICAO code. I will be using GPS flight plan for most of my flights.

Any help / hint / code snippets would help great!!

Posted

I am able to read the time and thus make the calculation, but I am not able to find the following

1. current ICAO code where the aircraft is stationed

2. Whether the plane is airborne or back on the ground!!

Well, (2) is easy -- it is the "on ground" flag at offset 0366.

For (1) you'd need to use the Latitude and Longitude and find the airport using a database of all airports.

I will be using GPS flight plan for most of my flights.

Ah, if you've loaded a flight plan into FS9, then you may be able to read the origin ICAO, before takeoff, in offset 6081. However, I'm not sure any of those GPS offsets work proprtly -- the list was provided by someone else. None of those are available in FSX.

Alternatively, and more reliably, you could find the current plan (if it has been saved and referenced by the current flight) by reading the FLT file (identified with path in the offsets) and getting the PLN filename, then reading that. That should work with FSX too. But it does depend on having the plan AND flight saved, then loaded.

Regards

Pete

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.