Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi all!

I was wondering if it's possible to get a filtered list of AI traffic through fsuipc or simconnect. I want to get info (lat/lon and stuff) of all ai traffic in the sky and filter out all planes on the ground. Anyone knows if its possible to filter on trafficstate and get all planes flying in a range of about 200km?

Thanks for any info!

Timon

Posted

I can't answer for FSUIPC or Simconnect but if you are talking about FSX the

FSX radar gauge, which uses information derived from the fs9gps gauge, has

the ability to filter based on Air, Ground, All criteria.

It also provides additional information such as range from the user, altitude,

speed, ID, and much more.

I don't recall if the radar gauge was part of the Acceleration upgrade or was

in the initial FSX release. In any case, it is an XML gauge and one can easily

inspect the relative statements that gather the desired AI information to enable

you to create your own special purpose gauge.

Paul

Posted

Hi all!

I was wondering if it's possible to get a filtered list of AI traffic through fsuipc or simconnect. I want to get info (lat/lon and stuff) of all ai traffic in the sky and filter out all planes on the ground. Anyone knows if its possible to filter on trafficstate and get all planes flying in a range of about 200km?

Thanks for any info!

Timon

You can get this from FSUIPC (and from SimConnect but I don't know anything about SimConnect). FSUIPC maintains two separate tables of AI Traffic, one for ground and one for airborne. The default range for Airborne traffic in FSUIPC is 40NM. This is a setting in the FSUIPC INI file, but can also be overridden in code. I don't know if it goes out to 200nm though.

To use FSUIPC (which will mean your application could also work on FS9) you need to download the FSUIPC SDK from

http://www.schiratti.com/dowson.html

This contains the documentation and interfaces for various languages. If you want to use a .NET language then also get my FSUIPC Client DLL for .NET from here:

http://forum.simflight.com/topic/40989-fsuipc-client-dll-for-net-version-20/

My DLL also provides a much simplified interface to the FSUIPC AI Traffic information as well as extra derived info not provided directly from FSUIPC.

Paul

Posted
1319317092[/url]' post='432644']

You can get this from FSUIPC (and from SimConnect but I don't know anything about SimConnect). FSUIPC maintains two separate tables of AI Traffic, one for ground and one for airborne. The default range for Airborne traffic in FSUIPC is 40NM. This is a setting in the FSUIPC INI file, but can also be overridden in code. I don't know if it goes out to 200nm though.

To use FSUIPC (which will mean your application could also work on FS9) you need to download the FSUIPC SDK from

http://www.schiratti.com/dowson.html

This contains the documentation and interfaces for various languages. If you want to use a .NET language then also get my FSUIPC Client DLL for .NET from here:

http://forum.simflig...net-version-20/

My DLL also provides a much simplified interface to the FSUIPC AI Traffic information as well as extra derived info not provided directly from FSUIPC.

Paul

Thank you both for the info! Im currently using simconnect which works but as I said, unfiltered.. This means im choking fsx if I ask for a 40nm mile list of all ai traffic props near a busy aurport. My hopes are that fsuipc will use some kind of buffer, offloading fsx itself. Your answer seems to indicate that it will do exactly that. Thanks again im certainly diving into it. Im currently on Delphi7 but I don't think that will be an issue.

Timon

Posted

Im currently using simconnect which works but as I said, unfiltered.. This means im choking fsx if I ask for a 40nm mile list of all ai traffic props near a busy aurport. My hopes are that fsuipc will use some kind of buffer, offloading fsx itself. Your answer seems to indicate that it will do exactly that.

Timon

Hi Timon,

I'm fairly sure that FSUIPC4 uses SimConnect to get the AI Traffic information. (SimConnect is used for most of the data in FSUIPC4). If SimConnect itself has a problem with lots of AI Traffic then FSUIPC may not help much. You could try it an see, or wait until Pete gets back from his holiday for more details about this.

Paul

Posted

I'm fairly sure that FSUIPC4 uses SimConnect to get the AI Traffic information. (SimConnect is used for most of the data in FSUIPC4). If SimConnect itself has a problem with lots of AI Traffic then FSUIPC may not help much. You could try it an see, or wait until Pete gets back from his holiday for more details about this.

I've never known FSX / SimConnect to "choke" with too much AI data using FSUIPC, and I've got lots of traffic (MyTrafficX plus UT2). FSUIPC4 does it's best to regulate the updates in any case, and being internal to FSX it has no process-crossing delays or overheads.

Regards

Pete

Posted (edited)

Well, im currently using the following method to extract data from simconnect to my app:

1 SimConnect_AddToDataDefinition (2sec)

2 SimConnect_SubscribeToSystemEvent and

3 SimConnect_RequestDataOnSimObjectType (setting range to 20.000)

4. receive data on SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE

This will choke(as in: stutters FSX, and ultimatly crash) FSX when more than, lets say, 20 airplanes are getting returned.. I must say that my executable currently runs in its own process. I have yet to run it as an fsx in-process executable, if possible.. Maybe that will make things faster.

If FSUIPC is caching this data and has a smart way to query it preventing the stutters (and it probably is Peter, if I understand you correctly) I might need to start using that method :)

Timon

Edited by Timonr
Posted

Have been adapting my code to get AI plane info from FSUIPC. Works like a charm so far! Thanks all for the insights !

Have 3 small questions, I hope you don't mind me asking them. I couldn't find this in de docs:

- Simconnect returns an object-id unique for the airplane. I could uniquely match airplanes using this id. Is the first id from the Fsuipc TCAS table reliable to use as object-id? The documentation mentions to only use this dword to check if the slot is used, or not...

- lat/lon is returned as a float. Any way to convert this to " normal" string representation ?

- Are pitch and bank SHORT's in radials?

Thanks again

Posted

- Simconnect returns an object-id unique for the airplane. I could uniquely match airplanes using this id. Is the first id from the Fsuipc TCAS table reliable to use as object-id? The documentation mentions to only use this dword to check if the slot is used, or not...

It's the FS ID but sign reversed for FS9 compatibility. The ID can be used at offset 2900.

- lat/lon is returned as a float. Any way to convert this to " normal" string representation ?

A float is a normal 32-bit floating point number, so just print it as such, eg, sprintf with %f and cast to double. All languages surely support both 32- and 64-bit floating point numbers -- they've been standard in Intel processors since way back.

- Are pitch and bank SHORT's in radials?

No. FS degree units exactly as documented. Please do use the documentation.

Regards

Pete

Posted
1319628255[/url]' post='432779']

It's the FS ID but sign reversed for FS9 compatibility. The ID can be used at offset 2900.

A float is a normal 32-bit floating point number, so just print it as such, eg, sprintf with %f and cast to double. All languages surely support both 32- and 64-bit floating point numbers -- they've been standard in Intel processors since way back.

No. FS degree units exactly as documented. Please do use the documentation.

Regards

Pete

Ok. You've been really helpful, thanks! :)

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.