Skip to content

TCAS Concentrator #16

@TwinFan

Description

@TwinFan

Current Situation / Problem
Only one X-Plane plugin can take control of TCAS targets at a time. This is a X-Plane design limitation. See Overriding TCAS and XPLMAcquirePlanes.

Suggested Solution
A separate plugin, a TCAS concentrator, acts as kind of a proxy in that it is the plugin to actually have control of X-Plane's TCAS targets, receives plane positions from collaborating plugins which draw planes (like LiveTraffic, xPilot and the like), orders these planes by distance and forwards the first 63 to X-Plane's TCAS target system.

Design Approach

Collaborating Plugin

  • Can identify if there is a TCAS concentrator available and if it is in control of TCAS targets (via a provided dataRef)
    • If there is an active concentrator: Forwards all plane positions to the concentrator (via a binary dataRef)
    • Otherwise can follow the legacy approach (try to acquire TCAS control and set the TCAS targets itself)

TCAS Concentrator

  • Publishes its status (has control or not) via dataRef
  • Offers a binary-write dataRef, with which collaborating plugins send aircraft information
    • For performance reasons, the data should come in a binary C structure, one per aircraft
    • includes a priority as XPMP2 supports now already
    • includes a flag if the plane should appear in a TCAS map layer (see below)
    • includes a label (used in the map)
    • basic version handling needs to be included, e.g. by the classic approach of including a size field
  • Keeps a list of all aircraft positions from all collaborating plugins, including a plugin id
    • Sorts by prioritized distance
    • forwards the data of the first up to 63 aircraft to X-Plane's TCAS target dataRefs
    • remove aircraft not updated for more than 10 frames (as X-Plane does it, too)
  • provides a "TCAS" map layer
    • This is needed to handle the map flexibly: In X-Plane's TCAS targets handling, it is either possible to have X-Plane draw standard plane icons in the internal map automatically, or to switch that off, e.g. to have the map layer provided by the plugin. The concentrator should provide this flexibility, too. But if one collaborating plugin wants automatic plane icons, the other not, then X-Plane's standard functionality is of no use any longer.
    • There is just one map layer provided by the concentrator. (A design which creates and administers several map layers is possible...but probably overkill given the main goal of the concentrator.)
    • Icons can be chosen like XPMP2 does it already based on ICAO aircraft type (which is a TCAS target field anyway), which would be added functionality beyond X-Plane's standard approach
  • Much code could be taken over from, ideally shared with XPMP2:
    • prioritized distance handling
    • TCAS target dataRef handling
    • even the TCAS fallback for pre-11.50 version could be supported
    • map drawing
    • The TCAS Concentrator plugin should be an additional target in the XPMP2 project.
  • Will need a few menu items for configuration and actions:
    • Setting: try acquiring TCAS immediately at startup (this is against the TCAS plugin coordination rules, but the concentrator would do it for the benefit of many)
      • which also means: we need a config file
    • "TCAS Control" (as LiveTraffic does it) to indicate, acquire, and release TCAS control
  • A simple list of admnistered aircraft is probably helpful also for debug purposes

XPMP2

  • should support TCAS Concentrator automatically out of the box
    • provide a config setting to switch it off...but what for?
  • A call to XPMPMultiplayerEnable should
    • return success in case an active TCAS concentrator is found and feed that in the future
    • otherwise perform as today
  • Feeding the TCAS connector needs to be verified every frame: It could have given up TCAS control or have gotten deactivated
  • if feed to TCAS, send all planes over there, otherwise do as now

Benefits
The planes of more than one multiplayer plugin can appear on TCAS systems and can be made available to 3rd party plugins reading this data (like map or camera tools).

Additional context
The idea has also been formulated by Kuroneko.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions