Jump to content
The simFlight Network Forums

Cant read nearest icao in c#

Recommended Posts

Thanks, I just had to make a slight change.

Attached is a new DLL.

It should now detect if the multiplayer IVAO traffic is at a gate.

For the FsGate object, IsAIPlaneAtGate will be true and AIPlaneAssigned will contain the AIPlaneInfo for the IVAO plane.

For the AIPlaneInfo object, the IsAtGate property will be true and the GateInfo will be the FsGate object where it's at. Note that the other gate info such as GateName, GateNumber and ID will not be filled in. These are the assigned gates from the FSUIPC traffic table so will still be blank.

Let me know if there are any problems. I can't test it on IVAO but it did work with a plane I manually injected.

Here is the change log from RC6: (Please note the breaking change).

Version 3.0 RC7

* Added new contructor to FsLatLonPoint to accept Lat and Lon in DecimalDegrees

* Added new FsAltitide class to convert between Feet, Metres and FS Altitude Units

* Added FSUIPCConnection.MoveAircraft() method. This will move the plane to the specified location,
  an optionally set a new Altitiude, Speed, Pitch and Bank if specified. 
  Can also accept a Runway, Gate or Helipad from the FsDatabase, or an FsPositionSnapshot object.

* Added method MoveAircraftHere() to FsRunway, FsGate and FsHelipad objects in the database. 

* Added property IsOnGround to AiPlaneInfo object. This lets you know if the AI Plane is on the ground or not.

* BREAKING CHANGE: AiPlaneInfo - properties beginning with 'Destination' changed to 'Arrival'

* Added FsPositionSnaphot class that holds information about the position of the player aircraft. 
  This includes lon/lat/ias/bank/pitch/altitude/onground/heading
  This can be used manually or generated automatically by using the FSUIPCConnection.GetPositionSnaphot() method.

* Injected AI Traffic (e.g. IVAO multiplayer traffic) will now have thier gate information filled in
  if they are at a gate. (And the Airport Database is loaded).



Share this post

Link to post
Share on other sites

Hi Paul and Pete...long time no read. I hope you are both doing fine. 

I got a question because of a weird problem I am facing:

I am creating multiple aircraft using the AICreateNonATCAircraft facility via SimConnect. The second parameter passed into this method is defined as "szTailNumber", so this is a unique string I am supplying which is supposed to be set for the tail number of all aircraft. I need this later while reading through a list of AIPlaneInfo objects to differentiate aircraft which are showing my string in the ATCIdentifier property, so I can find out which ones are my mine and which are not and deal with them appropriately.

The odd thing is, though, that aircraft which have an "atc_airline" entry set in their aircraft.cfgs will show this instead of my unique string in the ATCIdentifier property  while aircraft, that don't have this entry present, will show my string correctly. The TailNumber property is never filled for any of those objects.

Can one of you maybe tell me if this supposed to be normal behaviour or if you see another way to find out which are my created aircraft from the AIPlaneInfo object?

Greets, Benny

EDIT: Although I don't understand the behaviour described above, I found out I can use the FSUIPC returned ID of the object, multiply it by -1 and check it against my stored value in the datatable, to find out if I created this object. So, at least at the moment this gives me the intended behaviour.

Share this post

Link to post
Share on other sites

Hi Benny,

Yes this is normal behaviour for ACTIdentifier. As the DLL says this is the Airline + Flight Number, or if there isn't one (GA Aircraft) then it's the tail number.

To always get the tail number you have two choices:


1. Override the FSUIPC.INI file file settings in code to always bring back the tail number in ATCIdentifier.

Call this before you refresh the traffic info:

            FSUIPCConnection.AITrafficServices.OverrideAirbourneTrafficINISettings(ATCIdentifier.TailNumber, null);

There is a similar one for ground traffic.

Note that this will affect all FSUIPC applications reading AI Traffic.


2. The other method is to use the extended information properties:

Call this once after you  open the connection:

            FSUIPCConnection.AITrafficServices.UpdateExtendedPlaneIndentifiers(true, false, false, false);

This will fill the property AIPlaneInfo.TailNumber.

However, this will be a bit slow the first time you refresh the AI traffic as the DLL has to make additional calls to FSUIPC for each aircraft. After that the additional calls will only be made when a new plane is seen. But, this won't be very noticeable if you're only getting the tail number.



Share this post

Link to post
Share on other sites

Thanks Paul for the quick reply. I knew I read something about this somewhere, but only looked through some of the original FSUIPC documents and couldn't find it at frist glance. Will try this immediately.

Greets, Benny

Share this post

Link to post
Share on other sites

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


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.