FSUIPC Client DLL
.NET interface for FSUIPC
AITrafficServices Class Reference

A class that provides information about the AI aircraft in Flight Simulator. This reads the TCAS tables from FSUIPC and presents the information in a .NET friendly collection of AIPlaneInfo classes. More...

Public Member Functions

AIPlaneInfo GetPlaneInfoByID (int ID)
 Retrieves a specific AIPlaneInfo object with the specified ID. More...
 
void UpdateExtendedPlaneIndentifiers (bool TailNumber, bool AirlineAndFlightNumber, bool AircraftTypeAndModel, bool AircraftTitle)
 
void RefreshAITrafficInformation ()
 Refreshes the information for ground and air AI traffic More...
 
void RefreshAITrafficInformation (FsAirportCollection Airports, AirportComponents Components)
 Refreshes the information for ground and air AI traffic More...
 
void RefreshAITrafficInformation (FsAirport Airport, AirportComponents Components)
 Refreshes the information for ground and air AI traffic More...
 
void RefreshAITrafficInformation (bool UpdateGroundTraffic, bool UpdateAirborneTraffic)
 Refreshes the information for ground and air AI traffic as specified More...
 
void RefreshAITrafficInformation (bool UpdateGroundTraffic, bool UpdateAirborneTraffic, FsAirport Airport, AirportComponents Components)
 Refreshes the information for ground and air AI traffic as specified More...
 
void RefreshAITrafficInformation (bool UpdateGroundTraffic, bool UpdateAirborneTraffic, FsAirportCollection Airports, AirportComponents Components)
 Refreshes the information for ground and air AI traffic as specified More...
 
void ApplyFilter (bool ApplyToGroundTraffic, bool ApplyToAirborneTraffic, double StartBearing, double EndBearing, double? MinAltitude, double? MaxAltitude, double? WithinDistance)
 Applies a filter to the ground and/or airborne traffic lists. All traffic falling outside of the specified criteria is deleted from the traffic lists. More...
 
List< FsRunwayIDGetArrivalRunwaysInUse (string AirportICAOCode)
 
Dictionary< string, List< FsRunwayID > > GetArrivalRunwaysInUse ()
 
List< FsRunwayIDGetDepartureRunwaysInUse (string AirportICAOCode)
 
Dictionary< string, List< FsRunwayID > > GetDepartureRunwaysInUse ()
 
void OverrideAirborneTrafficINISettings (ATCIdentifier? ATCId, byte? RangeInNM)
 
void OverrideGroundTrafficINISettings (ATCIdentifier? ATCId, bool? PreferActive, byte? RangeInAirInNM, byte? RangeOnGroundInNM)
 
void AddTCASTarget (int ID, string ATCIdentifier, AITrafficStatus State, FsLatitude Latitude, FsLongitude Longitude, double AltitudeFeet, double HeadingDegreesTrue, short GroundSpeedKnots, short VerticalSpeedFeet, short Com1)
 Adds a TCAS Target to the internal FSUIPC AI Traffic Tables. This does not add AI planes to Flight Sim. Add as many targets as you like and send them to FSUIPC with SendTCASTargets(). To erase an aircraft provide the specific id for that entry, and set the ATCIdentifier parameter to a zero-length string. In any case, FSUIPC will automatically erase any externally supplied aircraft after about 8–12 seconds if it receives no further updates in that time. Even if the aircraft is static you'll need to supply updates for it regularly. For FSX this feature REQUIRES FSUIPC4 version 4.536 or above. More...
 
void SendTCASTargets ()
 Sends the TCAS targets added with AddTCASTarget() to FSUIPC. For FSX this feature REQUIRES FSUIPC4 version 4.536 or above. More...
 

Properties

AIPlaneInfoCollection GroundTraffic [get]
 A .NET List of AIPlaneInfo objects representing AI traffic on the ground in order of distance from the player. The closest AI plane is the first in the list. More...
 
AIPlaneInfoCollection AirborneTraffic [get]
 A .NET List of AIPlaneInfo objects representing AI traffic in the air in order of distance from the player. The closest AI plane is the first in the list. More...
 
AIPlaneInfoCollection AllTraffic [get]
 A .NET List of AIPlaneInfo objects representing all AI traffic in order of distance from the player. The closest AI plane is the first in the list. More...
 

Detailed Description

A class that provides information about the AI aircraft in Flight Simulator. This reads the TCAS tables from FSUIPC and presents the information in a .NET friendly collection of AIPlaneInfo classes.

This class cannot be instantiated, you must obtain a reference to the active instance via the property on the FSUIPCConnection class.

Member Function Documentation

◆ AddTCASTarget()

void AddTCASTarget ( int  ID,
string  ATCIdentifier,
AITrafficStatus  State,
FsLatitude  Latitude,
FsLongitude  Longitude,
double  AltitudeFeet,
double  HeadingDegreesTrue,
short  GroundSpeedKnots,
short  VerticalSpeedFeet,
short  Com1 
)
inline

Adds a TCAS Target to the internal FSUIPC AI Traffic Tables. This does not add AI planes to Flight Sim. Add as many targets as you like and send them to FSUIPC with SendTCASTargets(). To erase an aircraft provide the specific id for that entry, and set the ATCIdentifier parameter to a zero-length string. In any case, FSUIPC will automatically erase any externally supplied aircraft after about 8–12 seconds if it receives no further updates in that time. Even if the aircraft is static you'll need to supply updates for it regularly. For FSX this feature REQUIRES FSUIPC4 version 4.536 or above.

Parameters
IDYour own ID
ATCIdentifierThe ATC Identifier string (e.g. flight no or call sign etc...). Set to a zero-length string to erase the TCAS target from FSUIPC.
StateThe state of the plane
LatitudeThe Latitude of the plane
LongitudeThe Longitude of the plane
AltitudeFeetThe Altitude of the plane in Feet
HeadingDegreesTrueThe True heading (not magnetic) of the plane in degrees.
GroundSpeedKnotsThe ground speed of the plane in knots
VerticalSpeedFeetThe vortical speed of the plane in Feet per Second
Com1COM1 frequency, 4 digits in BCD format. A frequency of 123.45 is represented by 0x2345. The leading 1 is assumed

◆ ApplyFilter()

void ApplyFilter ( bool  ApplyToGroundTraffic,
bool  ApplyToAirborneTraffic,
double  StartBearing,
double  EndBearing,
double?  MinAltitude,
double?  MaxAltitude,
double?  WithinDistance 
)
inline

Applies a filter to the ground and/or airborne traffic lists. All traffic falling outside of the specified criteria is deleted from the traffic lists.

Parameters
ApplyToGroundTrafficApply the filter to the ground traffic list
ApplyToAirborneTrafficApply the filter to the airborne traffic list
StartBearingSpecifies the start of a bearing arc. Only AI Traffic within this bearing arc in relation to the player is kept. This is TRUE bearing in degrees.

For no bearing restriction set this to 0 and the EndBearing to 360

Parameters
EndBearingSpecifies the end of a bearing arc. Only AI Traffic within this bearing arc in relation to the player is kept. This is TRUE bearing in degrees.

For no bearing restriction set this to 360 and the StartBearing to 0

Parameters
MinAltitudeOnly AI Traffic above this altitude is kept. This is in Feet. Set to null (Nothing in VB) for no minimum limit.
MaxAltitudeOnly AI Traffic below this altitude is kept. This is in Feet. Set to null (Nothing in VB) for no maximum limit.
WithinDistanceOnly AI Traffic within this distance is kept. This is in Nautical Miles. Set to null (Nothing in VB) for no distance limit.

◆ GetArrivalRunwaysInUse() [1/2]

List<FsRunwayID> GetArrivalRunwaysInUse ( string  AirportICAOCode)
inline

Gets a list of the runways in use for arriving aircraft for the given airport code.

Note that this information is derived from the AI traffic information and is therefore only as current as the last RefreshAITrfficInformation() call. Airports will only show active runways if they have AI planes currently assigned to a runway . This information is not harmed by filtering the AI traffic.

Note also that this is NOT using the FSUIPC facilities at D000. FSUIPC takes ages to give this information back whereas this DLL can return it instantly.

Parameters
AirportICAOCodeThe ICAO code for the airport you want active arrival runways for.
Returns
A List of FSRunway objects representing the runways in use.

◆ GetArrivalRunwaysInUse() [2/2]

Dictionary<string, List<FsRunwayID> > GetArrivalRunwaysInUse ( )
inline

Gets a list of the runways in use for arriving aircraft for the given airport code.

Note that this information is derived from the AI traffic information and is therefore only as current as the last RefreshAITrfficInformation() call. Airports will only show active runways if they have AI planes currently assigned to a runway . This information is not harmed by filtering the AI traffic.

Note also that this is NOT using the FSUIPC facilities at D000. FSUIPC takes ages to give this information back whereas this DLL can return it instantly.

Returns
A dictionary of Lists of FSRunway objects representing the runways in use. The key is the ICAO code of the airport.

◆ GetDepartureRunwaysInUse() [1/2]

List<FsRunwayID> GetDepartureRunwaysInUse ( string  AirportICAOCode)
inline

Gets a list of the runways in use for departing aircraft for the given airport code.

Note that this information is derived from the AI traffic information and is therefore only as current as the last RefreshAITrfficInformation() call. Airports will only show active runways if they have AI planes currently assigned to a runway. This information is not harmed by filtering the AI traffic.

Note also that this is NOT using the FSUIPC facilities at D000. FSUIPC takes ages to give this information back whereas this DLL can return it instantly.

Parameters
AirportICAOCodeThe ICAO code for the airport you want active arrival runways for.
Returns
A List of FSRunway objects representing the runways in use.

◆ GetDepartureRunwaysInUse() [2/2]

Dictionary<string, List<FsRunwayID> > GetDepartureRunwaysInUse ( )
inline

Gets a list of the runways in use for departing aircraft for the given airport code.

Note that this information is derived from the AI traffic information and is therefore only as current as the last RefreshAITrfficInformation() call. Airports will only show active runways if they have AI planes currently assigned to a runway. This information is not harmed by filtering the AI traffic.

Note also that this is NOT using the FSUIPC facilities at D000. FSUIPC takes ages to give this information back whereas this DLL can return it instantly.

Returns
A dictionary of Lists of FSRunway objects representing the runways in use. The key is the ICAO code of the airport.

◆ GetPlaneInfoByID()

AIPlaneInfo GetPlaneInfoByID ( int  ID)
inline

Retrieves a specific AIPlaneInfo object with the specified ID.

Parameters
IDThe ID of the plane to bring back
Returns
The requested AIPlaneInfo or null (Nothing in VB) is the ID was not found.

◆ OverrideAirborneTrafficINISettings()

void OverrideAirborneTrafficINISettings ( ATCIdentifier ATCId,
byte?  RangeInNM 
)
inline

This method allows you to override the setting in the user's FSUIPC.INI file.

Note that because of the internal workings of FSUIPC, your override will be cancelled after 20 seconds. Therefore you need to call this method on a regular basis. The FSUIPC documentation recommends every 5 seconds.

Parameters
ATCIdThe format you want for the ATCIdentifier property. Set to null (Nothing in VB) to use the setting in the FSUIPC.INI file. This ATCIdentifier is only 15 characters long. If the info you request won't fit it will be truncated. Consider using the extended plane identifiers feature instead to get this information. See AITrafficTools.UpdateExtendedPlaneIdentifiers()
RangeInNMThe range around the player's aircraft in which AI traffic will be detected. In Nautical Miles. 0=Unlimited. Null (Nothing in VB)=Use setting in FSUIPC.INI file.

◆ OverrideGroundTrafficINISettings()

void OverrideGroundTrafficINISettings ( ATCIdentifier ATCId,
bool?  PreferActive,
byte?  RangeInAirInNM,
byte?  RangeOnGroundInNM 
)
inline

This method allows you to override the setting in the user's FSUIPC.INI file.

Note that because of the internal workings of FSUIPC, your override will be cancelled after 20 seconds. Therefore you need to call this method on a regular basis. The FSUIPC documentation recommends every 5 seconds.

Parameters
ATCIdThe format you want for the ATCIdentifier property. This ATCIdentifier is only 15 characters long. If the info you request won't fit it will be truncated. Consider using the extended plane identifiers feature instead to get this information. See AITrafficTools.UpdateExtendedPlaneIdentifiers()
PreferActiveSet to True to prioritise active aircraft (not sleeping or initialising) when the FSUIPC Traffic Tables get full. Set to False to prioritise closest aircraft regardless of state.
RangeInAirInNMThe range around the player's aircraft in which ground AI traffic will be detected while the Player is in the AIR. In Nautical Miles. 0=Unlimited. Null (Nothing in VB)=Use setting in FSUIPC.INI file.
RangeOnGroundInNMThe range around the player's aircraft in which ground AI traffic will be detected while the player is on the GROUND. In Nautical Miles. 0=Unlimited. Null (Nothing in VB)=Use setting in FSUIPC.INI file.

◆ RefreshAITrafficInformation() [1/6]

void RefreshAITrafficInformation ( )
inline

Refreshes the information for ground and air AI traffic

◆ RefreshAITrafficInformation() [2/6]

void RefreshAITrafficInformation ( FsAirportCollection  Airports,
AirportComponents  Components 
)
inline

Refreshes the information for ground and air AI traffic

Parameters
AirportsPass an optional collection of airports. They will be updated with AI Traffic positions, and the AI Traffic will have links to the relevant Airport Database objects
ComponentsSpecifies which airport components to process. E.g. To know if AI Traffic is on a runway pass the Runways component. If no components are passed only the Airport itself will be tested.

Note that this method will automatically load missing components for relevant airports.

◆ RefreshAITrafficInformation() [3/6]

void RefreshAITrafficInformation ( FsAirport  Airport,
AirportComponents  Components 
)
inline

Refreshes the information for ground and air AI traffic

Parameters
AirportPass an optional Airports. It will be updated with AI Traffic positions, and the AI Traffic will have links to the relevant Airport Database objects
ComponentsSpecifies which airport components to process. E.g. To know if AI Traffic is on a runway pass the Runways component. If no components are passed only the Airport itself will be tested.

Note that this method will automatically load missing components for relevant airports.

◆ RefreshAITrafficInformation() [4/6]

void RefreshAITrafficInformation ( bool  UpdateGroundTraffic,
bool  UpdateAirborneTraffic 
)
inline

Refreshes the information for ground and air AI traffic as specified

Parameters
UpdateGroundTrafficSet to true to update the information for traffic on the ground
UpdateAirborneTrafficSet to true to update the information for traffic in the air

◆ RefreshAITrafficInformation() [5/6]

void RefreshAITrafficInformation ( bool  UpdateGroundTraffic,
bool  UpdateAirborneTraffic,
FsAirport  Airport,
AirportComponents  Components 
)
inline

Refreshes the information for ground and air AI traffic as specified

Parameters
UpdateGroundTrafficSet to true to update the information for traffic on the ground
UpdateAirborneTrafficSet to true to update the information for traffic in the air
AirportPass an optional Airports. It will be updated with AI Traffic positions, and the AI Traffic will have links to the relevant Airport Database objects
ComponentsSpecifies which airport components to process. E.g. To know if AI Traffic is on a runway pass the Runways component. If no components are passed only the Airport itself will be tested.

Note that this method will automatically load missing components for relevant airports.

◆ RefreshAITrafficInformation() [6/6]

void RefreshAITrafficInformation ( bool  UpdateGroundTraffic,
bool  UpdateAirborneTraffic,
FsAirportCollection  Airports,
AirportComponents  Components 
)
inline

Refreshes the information for ground and air AI traffic as specified

Parameters
UpdateGroundTrafficSet to true to update the information for traffic on the ground
UpdateAirborneTrafficSet to true to update the information for traffic in the air
AirportsPass an optional collection of airports. They will be updated with AI Traffic positions, and the AI Traffic will have links to the relevant Airport Database objects
ComponentsSpecifies which airport components to process. E.g. To know if AI Traffic is on a runway pass the Runways component. If no components are passed only the Airport itself will be tested.

Note that this method will automatically load missing components for relevant airports.

◆ SendTCASTargets()

void SendTCASTargets ( )
inline

Sends the TCAS targets added with AddTCASTarget() to FSUIPC. For FSX this feature REQUIRES FSUIPC4 version 4.536 or above.

◆ UpdateExtendedPlaneIndentifiers()

void UpdateExtendedPlaneIndentifiers ( bool  TailNumber,
bool  AirlineAndFlightNumber,
bool  AircraftTypeAndModel,
bool  AircraftTitle 
)
inline

Tells the AITrafficServices to retrieve the specified extended plane identifier properties for all planes when updating the AI Traffic Information.

Getting this data from FSUIPC is very inefficient. Setting these option could cause long delays when calling RefreshAITrafficInformation() for the first time (possibly over 1 second per plane over WideFS)

However, subsequent calls will be very fast as this information is only ever retrieved once per plane. Only new AI traffic entering the system will cause a very slight delay.

The more extended information you request the longer any delays will be.

See also: AITrafficServices.OverrideAirborneTrafficINISettings() and OverrideGroundTrafficINISettings()

Parameters
TailNumberSet to true to update the TailNumber property for all planes
AirlineAndFlightNumberSet to true to update the Airline and FlightNumber properties for all planes
AircraftTypeAndModelSet to true to update the AircraftType and AircraftModel properties for all planes
AircraftTitleSet to true to update the AircraftTitle property for all planes

Property Documentation

◆ AirborneTraffic

AIPlaneInfoCollection AirborneTraffic
get

A .NET List of AIPlaneInfo objects representing AI traffic in the air in order of distance from the player. The closest AI plane is the first in the list.

◆ AllTraffic

AIPlaneInfoCollection AllTraffic
get

A .NET List of AIPlaneInfo objects representing all AI traffic in order of distance from the player. The closest AI plane is the first in the list.

◆ GroundTraffic

AIPlaneInfoCollection GroundTraffic
get

A .NET List of AIPlaneInfo objects representing AI traffic on the ground in order of distance from the player. The closest AI plane is the first in the list.