Public Member Functions | Properties

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.This class cannot be instantiated, you must obtain a reference to the active instance via the property on the FSUIPCConnection class. More...

List of all members.

Public Member Functions

AIPlaneInfo GetPlaneInfoByID (int ID)
 Retrieves a specific AIPlaneInfo object with the specified ID.
void UpdateExtendedPlaneIndentifiers (bool TailNumber, bool AirlineAndFlightNumber, bool AircraftTypeAndModel, bool AircraftTitle)
 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()
void RefreshAITrafficInformation ()
 Refreshes the information for ground and air AI traffic.
void RefreshAITrafficInformation (bool UpdateGroundTraffic, bool UpdateAirbourneTraffic)
 Refreshes the information for ground and air AI traffic as specified.
void ApplyFilter (bool FilterGroundTraffic, bool FilterAirbourneTraffic, 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 critia is deleted from the traffic lists.
List< FSRunwayGetArrivalRunwaysInUse (string AirportICAOCode)
 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.
List< FSRunwayGetDepartureRunwaysInUse (string AirportICAOCode)
 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.
void OverrideAirborneTrafficINISettings (ATCIdentifier?ATCId, byte?RangeInNM)
 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.
void OverrideGroundTrafficINISettings (ATCIdentifier?ATCId, bool?PreferActive, byte?RangeInAirInNM, byte?RangeOnGroundInNM)
 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.
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.
void SendTCASTargets ()
 Sends the TCAS targets added with AddTCASTarget() to FSUIPC. For FSX this feature REQUIRES FSUIPC4 version 4.536 or above.

Properties

List< AIPlaneInfoGroundTraffic [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.
List< AIPlaneInfoAirbourneTraffic [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.
List< AIPlaneInfoAllTraffic [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.

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

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.

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 virtical 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
void ApplyFilter ( bool  FilterGroundTraffic,
bool  FilterAirbourneTraffic,
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 critia is deleted from the traffic lists.

Parameters:
FilterGroundTrafficApply the filter to the gound traffic list
FilterAirbourneTrafficApply 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.
List<FSRunway> GetArrivalRunwaysInUse ( string  AirportICAOCode )

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.
List<FSRunway> GetDepartureRunwaysInUse ( string  AirportICAOCode )

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.
AIPlaneInfo GetPlaneInfoByID ( int  ID )

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.
void OverrideAirborneTrafficINISettings ( ATCIdentifier ATCId,
byte?  RangeInNM 
)

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.
void OverrideGroundTrafficINISettings ( ATCIdentifier ATCId,
bool?  PreferActive,
byte?  RangeInAirInNM,
byte?  RangeOnGroundInNM 
)

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.
void RefreshAITrafficInformation ( bool  UpdateGroundTraffic,
bool  UpdateAirbourneTraffic 
)

Refreshes the information for ground and air AI traffic as specified.

Parameters:
UpdateGroundTrafficSet to true to update the information for traffic on the ground
UpdateAirbourneTrafficSet to true to update the information for traffic in the air
void RefreshAITrafficInformation (  )

Refreshes the information for ground and air AI traffic.

void SendTCASTargets (  )

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

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

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

List<AIPlaneInfo> AirbourneTraffic [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.

List<AIPlaneInfo> 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.

List<AIPlaneInfo> 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.