XPPlanes
X-Plane plugin to display additional planes based on network data
Public Types | Public Member Functions | Public Attributes | List of all members
GlobVars Struct Reference

All global config settings and variables are kept in one structure for convenient access and central definition. More...

#include <Global.h>

Public Types

enum  StatusTy { STATUS_INACTIVE = 0 , STATUS_WAITING , STATUS_ACTIVE }
 Plugin status (type definition) More...
 

Public Member Functions

 GlobVars (logLevelTy _logLvl=logINFO, bool _logMdlMatch=false)
 Constructor. More...
 
bool ShallHideOsById () const
 Hide ownship data based on id? More...
 
bool ShallHideOsByReg () const
 Hide ownship data based on registration? More...
 
bool ConfigFileLoad ()
 Read from a config file. More...
 
bool ConfigFileSave ()
 Write to a config file. More...
 
void ThisThreadIsXP ()
 Set current thread as main xp Thread. More...
 
bool IsXPThread () const
 Is this thread XP's main thread? More...
 

Public Attributes

logLevelTy logLvl
 Logging level. More...
 
bool bLogMdlMatch = false
 Debug model matching? More...
 
bool bClampAll = false
 Clamp all planes to the ground? Default is false as clamping is kinda expensive due to Y-Testing; then clamping is only activated when plane is thought to be on the ground. More...
 
bool bObjReplDataRefs = true
 Replace dataRefs in .obj files on load? More...
 
bool bObjReplTextures = true
 Replace textures in .obj files on load if needed? More...
 
int bufferPeriod = 5
 Buffering period in seconds. More...
 
int gracePeriod = 30
 Remove a plane after how many seconds without fresh data? More...
 
int iHideOwnship = HIDEOS_BY_ID | HIDEOS_BY_REG
 Hide ownship data? (bitfield, see HIDEOS_BY_ID and HIDEOS_BY_REG) More...
 
bool bDrawLabels = true
 Shall we draw aircraft labels? More...
 
int maxLabelDist = 5556
 Maximum distance for drawing labels? [m], defaults to 3nm. More...
 
bool bLabelCutOffAtVisibility = true
 Cut off labels at XP's reported visibility mit? More...
 
bool bAITcasControl = true
 Do we want to control X-Plane's AI/Multiplayer planes for TCAS? More...
 
bool bMapEnabled = true
 Do we feed X-Plane's maps with our aircraft positions? More...
 
bool bMapLabels = true
 Do we show labels with the aircraft icons? More...
 
std::string listenMCGroup = "239.255.1.1"
 The multicast group that we use, which is the same X-Plane is using itself for its BEACON. More...
 
int listenMCPort = 49900
 The port we use is different from the port the X-Plane BEACON uses, so we don't get into conflict. More...
 
int listenBcstPort = 49800
 The port for receiving UDP broadcast messages. More...
 
int remoteTTL = 8
 Time-to-live, or mumber of hops for a multicast message. More...
 
int remoteBufSize = 8192
 Buffer size, ie. max message length we send over multicast. More...
 
mapPlanesTy mapPlanes
 Global map of all created planes. More...
 
mapListFlightDataTy mapListFD
 Global map of available (potentially future) flight data. More...
 
std::mutex mtxListFD
 Mutex protecting access to the above mapListFD. More...
 
XPLMPluginID pluginId = 0
 This plugin's id. More...
 
std::thread::id xpThread
 id of X-Plane's thread (when it is OK to use XP API calls) More...
 
float now = NAN
 Current X-Xplane's time. More...
 
XPLMMenuID hMenu = NULL
 plugin's menu handle More...
 
volatile StatusTy eStatus = STATUS_INACTIVE
 Plugin status. More...
 

Detailed Description

All global config settings and variables are kept in one structure for convenient access and central definition.

Member Enumeration Documentation

◆ StatusTy

Plugin status (type definition)

Enumerator
STATUS_INACTIVE 

plugin inactive or starting up

STATUS_WAITING 

waiting for first network messages

STATUS_ACTIVE 

receiving data, displaying planes

Constructor & Destructor Documentation

◆ GlobVars()

GlobVars::GlobVars ( logLevelTy  _logLvl = logINFO,
bool  _logMdlMatch = false 
)
inline

Constructor.

Member Function Documentation

◆ ConfigFileLoad()

bool GlobVars::ConfigFileLoad ( )

Read from a config file.

◆ ConfigFileSave()

bool GlobVars::ConfigFileSave ( )

Write to a config file.

◆ IsXPThread()

bool GlobVars::IsXPThread ( ) const
inline

Is this thread XP's main thread?

◆ ShallHideOsById()

bool GlobVars::ShallHideOsById ( ) const
inline

Hide ownship data based on id?

◆ ShallHideOsByReg()

bool GlobVars::ShallHideOsByReg ( ) const
inline

Hide ownship data based on registration?

◆ ThisThreadIsXP()

void GlobVars::ThisThreadIsXP ( )
inline

Set current thread as main xp Thread.

Member Data Documentation

◆ bAITcasControl

bool GlobVars::bAITcasControl = true

Do we want to control X-Plane's AI/Multiplayer planes for TCAS?

◆ bClampAll

bool GlobVars::bClampAll = false

Clamp all planes to the ground? Default is false as clamping is kinda expensive due to Y-Testing; then clamping is only activated when plane is thought to be on the ground.

◆ bDrawLabels

bool GlobVars::bDrawLabels = true

Shall we draw aircraft labels?

◆ bLabelCutOffAtVisibility

bool GlobVars::bLabelCutOffAtVisibility = true

Cut off labels at XP's reported visibility mit?

◆ bLogMdlMatch

bool GlobVars::bLogMdlMatch = false

Debug model matching?

◆ bMapEnabled

bool GlobVars::bMapEnabled = true

Do we feed X-Plane's maps with our aircraft positions?

◆ bMapLabels

bool GlobVars::bMapLabels = true

Do we show labels with the aircraft icons?

◆ bObjReplDataRefs

bool GlobVars::bObjReplDataRefs = true

Replace dataRefs in .obj files on load?

◆ bObjReplTextures

bool GlobVars::bObjReplTextures = true

Replace textures in .obj files on load if needed?

◆ bufferPeriod

int GlobVars::bufferPeriod = 5

Buffering period in seconds.

◆ eStatus

volatile StatusTy GlobVars::eStatus = STATUS_INACTIVE

Plugin status.

◆ gracePeriod

int GlobVars::gracePeriod = 30

Remove a plane after how many seconds without fresh data?

◆ hMenu

XPLMMenuID GlobVars::hMenu = NULL

plugin's menu handle

◆ iHideOwnship

int GlobVars::iHideOwnship = HIDEOS_BY_ID | HIDEOS_BY_REG

Hide ownship data? (bitfield, see HIDEOS_BY_ID and HIDEOS_BY_REG)

◆ listenBcstPort

int GlobVars::listenBcstPort = 49800

The port for receiving UDP broadcast messages.

◆ listenMCGroup

std::string GlobVars::listenMCGroup = "239.255.1.1"

The multicast group that we use, which is the same X-Plane is using itself for its BEACON.

See also
<X-Plane>/Instructions/Exchanging Data with X-Plane.rtfd, chapter "DISCOVER X-PLANE BY A BEACON"

◆ listenMCPort

int GlobVars::listenMCPort = 49900

The port we use is different from the port the X-Plane BEACON uses, so we don't get into conflict.

◆ logLvl

logLevelTy GlobVars::logLvl
Initial value:
=
@ logDEBUG
Debug, highest level of detail.
Definition: Utilities.h:130

Logging level.

◆ mapListFD

mapListFlightDataTy GlobVars::mapListFD

Global map of available (potentially future) flight data.

◆ mapPlanes

mapPlanesTy GlobVars::mapPlanes

Global map of all created planes.

◆ maxLabelDist

int GlobVars::maxLabelDist = 5556

Maximum distance for drawing labels? [m], defaults to 3nm.

◆ mtxListFD

std::mutex GlobVars::mtxListFD

Mutex protecting access to the above mapListFD.

◆ now

float GlobVars::now = NAN

Current X-Xplane's time.

◆ pluginId

XPLMPluginID GlobVars::pluginId = 0

This plugin's id.

◆ remoteBufSize

int GlobVars::remoteBufSize = 8192

Buffer size, ie. max message length we send over multicast.

◆ remoteTTL

int GlobVars::remoteTTL = 8

Time-to-live, or mumber of hops for a multicast message.

◆ xpThread

std::thread::id GlobVars::xpThread

id of X-Plane's thread (when it is OK to use XP API calls)


The documentation for this struct was generated from the following files: