diff --git a/docs/Contrails.md b/docs/Contrails.md new file mode 100644 index 00000000..11f56864 --- /dev/null +++ b/docs/Contrails.md @@ -0,0 +1,61 @@ +## Contrails + +XPMP2 can add contrails to planes. This is achieved by instantiating +one additional object per contrail at the same position as the actual plane. +This object `Resources/Contrail/Contrail.obj` has no tris, +but only holds a reference to a particle system file, `Contrail.pss`. +The contrail is then created through X-Plane's +[particle system](https://developer.x-plane.com/article/x-plane-11-particle-system/). + +### Disable + +If you don't want contrails at all, you need to return `0` for the two config items +`XPMP_CFG_ITM_CONTR_MIN_ALT` and `XPMP_CFG_ITM_CONTR_MAX_ALT`. +In that case you don't even need to provide the `Resources/Contrail` folder +with your deployment. + +### Deployment + +If you want to make use of contrails, you need to ship the +`Resources/Contrail` folder with all its 3 files with your plugin. + +### Default + +By default, ie. without any provision in code, a single contrail will be +generated for jet aircraft flying in an altitude between 25,000 and 45,000 ft. + +### Configuration of Automatic Contrails + +XPMP2 asks for four contrail-related configuration items, with which +you can fine-tune how XPMP2 automatically generates contrails. +This should be sufficient for most usages, even complex plugins like LiveTraffic +only provide pass-through configuration options for these four parameters, +but no self-development implementation. + +Config item | Default | Description +------------|---------|------------------- +`XPMP_CFG_ITM_CONTR_MIN_ALT` | 25000 | Minimum altitude in feet for automatic contrail generation +`XPMP_CFG_ITM_CONTR_MAX_ALT` | 45000 | Maximum altitude in feet for automatic contrail generation; set both min and max altitude to `0` to switch off automatic contrails +`XPMP_CFG_ITM_CONTR_LIFE` | 25 | Default maximum lifetime of contrail puffs in seconds, determines contrail length +`XPMP_CFG_ITM_CONTR_MULTI` | 0 | Boolean: Shall multiple contrails be auto-created (one per engine), or just one? + +Keep in mind that contrails, using the particle system, may have the potential +to affect performance. That's why by default just a single contrail is generated. + +### More Control + +If you need more control and want to direct yourself when how many contrails +are shown, you should switch off the auto-generation by returning `0` to +both `XPMP_CFG_ITM_CONTR_MIN_ALT` and `XPMP_CFG_ITM_CONTR_MAX_ALT`, +and then call either of the following two member functions of `XPMP2::Aircraft`: + +- `ContrailTrigger()` tells XPMP2 to check the plane's engine type, + and if it is jet then a contrail (or even multiple, depending on + config `XPMP_CFG_ITM_CONTR_MULTI`) are created. This is the function + internally used by the auto-generation mechanism once a plane is in the + right altitude. +- `ContrailRequest (unsigned num, unsigned dist_m = 0, unsigned lifeTime = 0)` + allows even more control by specifying the number of contrails, its spacing, + and the life time. + +Last but not least, there's `ContrailRemove()` to remove contrails. diff --git a/docs/Deploying.md b/docs/Deploying.md index cf7cfab3..123cf259 100644 --- a/docs/Deploying.md +++ b/docs/Deploying.md @@ -40,6 +40,10 @@ You should ship all the files provided in the `Resources` folder: It defines dataRef replacements. You don't need to ship this file if you do not enable that functionality in your plugin. +- `Contrail` folder with 3 files, `Contrail.obj/.png/.pss`; + this is needed for drawing contrails. If missing, contrails aren't + available. The folder is not needed if you + [disable contrails](Contrails.html#disable). These files have all to be installed in the same folder. It is good practice to install these files in a folder named `Resources` in diff --git a/docs/html/Client_8cpp.html b/docs/html/Client_8cpp.html deleted file mode 100644 index c4c2f925..00000000 --- a/docs/html/Client_8cpp.html +++ /dev/null @@ -1,721 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/Client.cpp File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Macros | -Functions | -Variables
-
-
Client.cpp File Reference
-
-
- -

Main Client functionality, processing received data. -More...

-
#include "XPMP2-Remote.h"
-
- - - - - - - - - - - - - -

-Macros

#define INFO_NEW_SENDER_PLUGIN   "First data received from %.*s (%u) @ %s"
 
#define INFO_SENDER_PLUGIN_LOST   "Sender %.*s (%u) @ %s fell silent, removed"
 
#define WARN_LOST_PLANE_CONTACT   "Lost contact to plane 0x%06X of %.*s (%u) @ %s"
 
#define INFO_GOT_AI_CONTROL   "Have TCAS / AI control now"
 
#define INFO_DEACTIVATED   "Deactivated, stopped listening to network"
 
#define memcpy_min(to, from)   std::memcpy(to,from,std::min(sizeof(from),sizeof(to)))
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

std::unique_lock< std::mutex > glockDataMain (gmutexData, std::defer_lock)
 The lock used by main thread functions to acquire data access. More...
 
void ClientTryGetAI ()
 Try getting TCAS/AI control. More...
 
void ClientCBRetryGetAI (void *)
 Callback for requesting TCAS: Maybe now we have a chance? More...
 
void ClientReleaseAI ()
 Stop TCAS/AI control. More...
 
void ClientProcSettings (const std::uint32_t from[4], const std::string &sFrom, const XPMP2::RemoteMsgSettingsTy &_msgSettings)
 Handles a received Settings message, which also identifies a sending plugin. More...
 
void ClientFlightLoopBegins ()
 Called at the beginning of each flight loop processing: Get the data lock, create waiting planes. More...
 
void ClientFlightLoopEnds () noexcept
 Called at the end of each flight loop processing: Release the data lock. More...
 
void ClientProcAcDetails (const std::uint32_t _from[4], size_t _msgLen, const XPMP2::RemoteMsgAcDetailTy &_msgAcDetails)
 Handle A/C Details messages, called by XPMP2 via callback. More...
 
void ClientProcAcPosUpdate (const std::uint32_t _from[4], size_t _msgLen, const XPMP2::RemoteMsgAcPosUpdateTy &_msgAcPosUpdate)
 Handle A/C Position Update message, called by XPMP2 via callback. More...
 
void ClientProcAcAnim (const std::uint32_t _from[4], size_t _msgLen, const XPMP2::RemoteMsgAcAnimTy &_msgAcAnim)
 Handle A/C Animation dataRef messages, called by XPMP2 via callback. More...
 
void ClientProcAcRemove (const std::uint32_t _from[4], size_t _msgLen, const XPMP2::RemoteMsgAcRemoveTy &_msgAcRemove)
 Handle A/C Removal message, called by XPMP2 via callback. More...
 
void ClientInit ()
 Initializes the module. More...
 
void ClientCleanup ()
 Shuts down the module gracefully. More...
 
void ClientToggleActive (int nForce)
 Toggles the cient's activitiy status, as based on menu command. More...
 
- - - - - - - - - - - - - - - -

-Variables

std::chrono::time_point< std::chrono::steady_clock > nowFlightLoop
 Contains 'now' at the time the flight loop starts. More...
 
bool bWaitingForAI = false
 have we requested AI access and are now waiting for a callback? More...
 
std::mutex gmutexData
 
std::atomic_flag gbSkipSettingsUpdate = ATOMIC_FLAG_INIT
 Indicates if it is needed in the main thread to process updates to settings. More...
 
std::atomic_flag gbSkipAcMaintenance = ATOMIC_FLAG_INIT
 Indicates if it is needed in the main thread to process new aircraft. More...
 
-

Detailed Description

-

Main Client functionality, processing received data.

-
Author
Birger Hoppe
- -

Macro Definition Documentation

- -

◆ INFO_DEACTIVATED

- -
-
- - - - -
#define INFO_DEACTIVATED   "Deactivated, stopped listening to network"
-
- -
-
- -

◆ INFO_GOT_AI_CONTROL

- -
-
- - - - -
#define INFO_GOT_AI_CONTROL   "Have TCAS / AI control now"
-
- -
-
- -

◆ INFO_NEW_SENDER_PLUGIN

- -
-
- - - - -
#define INFO_NEW_SENDER_PLUGIN   "First data received from %.*s (%u) @ %s"
-
- -
-
- -

◆ INFO_SENDER_PLUGIN_LOST

- -
-
- - - - -
#define INFO_SENDER_PLUGIN_LOST   "Sender %.*s (%u) @ %s fell silent, removed"
-
- -
-
- -

◆ memcpy_min

- -
-
- - - - - - - - - - - - - - - - - - -
#define memcpy_min( to,
 from 
)   std::memcpy(to,from,std::min(sizeof(from),sizeof(to)))
-
- -
-
- -

◆ WARN_LOST_PLANE_CONTACT

- -
-
- - - - -
#define WARN_LOST_PLANE_CONTACT   "Lost contact to plane 0x%06X of %.*s (%u) @ %s"
-
- -
-
-

Function Documentation

- -

◆ ClientCBRetryGetAI()

- -
-
- - - - - - - - -
void ClientCBRetryGetAI (void * )
-
- -

Callback for requesting TCAS: Maybe now we have a chance?

- -
-
- -

◆ ClientCleanup()

- -
-
- - - - - - - -
void ClientCleanup ()
-
- -

Shuts down the module gracefully.

- -
-
- -

◆ ClientFlightLoopBegins()

- -
-
- - - - - - - -
void ClientFlightLoopBegins ()
-
- -

Called at the beginning of each flight loop processing: Get the data lock, create waiting planes.

- -
-
- -

◆ ClientFlightLoopEnds()

- -
-
- - - - - -
- - - - - - - -
void ClientFlightLoopEnds ()
-
-noexcept
-
- -

Called at the end of each flight loop processing: Release the data lock.

- -
-
- -

◆ ClientInit()

- -
-
- - - - - - - -
void ClientInit ()
-
- -

Initializes the module.

- -
-
- -

◆ ClientProcAcAnim()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void ClientProcAcAnim (const std::uint32_t _from[4],
size_t _msgLen,
const XPMP2::RemoteMsgAcAnimTy_msgAcAnim 
)
-
- -

Handle A/C Animation dataRef messages, called by XPMP2 via callback.

- -
-
- -

◆ ClientProcAcDetails()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void ClientProcAcDetails (const std::uint32_t _from[4],
size_t _msgLen,
const XPMP2::RemoteMsgAcDetailTy_msgAcDetails 
)
-
- -

Handle A/C Details messages, called by XPMP2 via callback.

-
    -
  1. If the aircraft does not exist create it
      -
    1. Else update it's data
    2. -
    -
  2. -
- -
-
- -

◆ ClientProcAcPosUpdate()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void ClientProcAcPosUpdate (const std::uint32_t _from[4],
size_t _msgLen,
const XPMP2::RemoteMsgAcPosUpdateTy_msgAcPosUpdate 
)
-
- -

Handle A/C Position Update message, called by XPMP2 via callback.

- -
-
- -

◆ ClientProcAcRemove()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void ClientProcAcRemove (const std::uint32_t _from[4],
size_t _msgLen,
const XPMP2::RemoteMsgAcRemoveTy_msgAcRemove 
)
-
- -

Handle A/C Removal message, called by XPMP2 via callback.

- -
-
- -

◆ ClientProcSettings()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void ClientProcSettings (const std::uint32_t from[4],
const std::string & sFrom,
const XPMP2::RemoteMsgSettingsTy_msgSettings 
)
-
- -

Handles a received Settings message, which also identifies a sending plugin.

-
    -
  1. Plugin information is stored in gmapSender.
      -
    1. A "merged" version of all sender plugins' settings is created, make a per-field decision for the more significant value. This merged version shall become our local settings.
    2. -
    3. In a last step the changes to current actual settings are determined and necessary action taken.
    4. -
    -
  2. -
- -
-
- -

◆ ClientReleaseAI()

- -
-
- - - - - - - -
void ClientReleaseAI ()
-
- -

Stop TCAS/AI control.

- -
-
- -

◆ ClientToggleActive()

- -
-
- - - - - - - - -
void ClientToggleActive (int nForce = 0)
-
- -

Toggles the cient's activitiy status, as based on menu command.

-
Parameters
- - -
nForce3-way toggle: -1? force off,0toggle,+1` force on
-
-
- -
-
- -

◆ ClientTryGetAI()

- -
-
- - - - - - - -
void ClientTryGetAI ()
-
- -

Try getting TCAS/AI control.

- -
-
- -

◆ glockDataMain()

- -
-
- - - - - - - - - - - - - - - - - - -
std::unique_lock<std::mutex> glockDataMain (gmutexData ,
std::defer_lock  
)
-
- -

The lock used by main thread functions to acquire data access.

- -
-
-

Variable Documentation

- -

◆ bWaitingForAI

- -
-
- - - - -
bool bWaitingForAI = false
-
- -

have we requested AI access and are now waiting for a callback?

- -
-
- -

◆ gbSkipAcMaintenance

- -
-
- - - - -
std::atomic_flag gbSkipAcMaintenance = ATOMIC_FLAG_INIT
-
- -

Indicates if it is needed in the main thread to process new aircraft.

- -
-
- -

◆ gbSkipSettingsUpdate

- -
-
- - - - -
std::atomic_flag gbSkipSettingsUpdate = ATOMIC_FLAG_INIT
-
- -

Indicates if it is needed in the main thread to process updates to settings.

- -
-
- -

◆ gmutexData

- -
-
- - - - -
std::mutex gmutexData
-
-

the mutex controlling access to all data between network and main thread

- -
-
- -

◆ nowFlightLoop

- -
-
- - - - -
std::chrono::time_point<std::chrono::steady_clock> nowFlightLoop
-
- -

Contains 'now' at the time the flight loop starts.

- -
-
-
- - - - diff --git a/docs/html/Client_8h.html b/docs/html/Client_8h.html deleted file mode 100644 index 11405e2e..00000000 --- a/docs/html/Client_8h.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/Client.h File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Classes | -Typedefs | -Functions
-
-
Client.h File Reference
-
-
- -

Main Client functionality, processing received data. -More...

- -

Go to the source code of this file.

- - - - - - - - - - -

-Classes

class  RemoteAC
 Representation of a remote aircraft. More...
 
struct  SenderAddrTy
 Uniquely identifies a sending plugin. More...
 
struct  SenderTy
 
- - - - - - - -

-Typedefs

typedef std::map< XPMPPlaneID, RemoteACmapRemoteAcTy
 Map of remote aircraft; key is the plane id as sent by the sending plugin (while the _modeS_id of the local copy could differ) More...
 
typedef std::map< SenderAddrTy, SenderTymapSenderTy
 map of sender information More...
 
- - - - - - - - - - - - - - - - - - - - - - -

-Functions

void ClientInit ()
 Initializes the module. More...
 
void ClientCleanup ()
 Shuts down the module gracefully. More...
 
void ClientTryGetAI ()
 Try getting TCAS/AI control. More...
 
void ClientReleaseAI ()
 Stop TCAS/AI control. More...
 
void ClientToggleActive (int nForce=0)
 Toggles the cient's activitiy status, as based on menu command. More...
 
void ClientFlightLoopBegins ()
 Called at the beginning of each flight loop processing: Get the data lock, create waiting planes. More...
 
void ClientFlightLoopEnds () noexcept
 Called at the end of each flight loop processing: Release the data lock. More...
 
-

Detailed Description

-

Main Client functionality, processing received data.

-
Author
Birger Hoppe
- -

Typedef Documentation

- -

◆ mapRemoteAcTy

- -
-
- - - - -
typedef std::map<XPMPPlaneID,RemoteAC> mapRemoteAcTy
-
- -

Map of remote aircraft; key is the plane id as sent by the sending plugin (while the _modeS_id of the local copy could differ)

- -
-
- -

◆ mapSenderTy

- -
-
- - - - -
typedef std::map<SenderAddrTy,SenderTy> mapSenderTy
-
- -

map of sender information

- -
-
-

Function Documentation

- -

◆ ClientCleanup()

- -
-
- - - - - - - -
void ClientCleanup ()
-
- -

Shuts down the module gracefully.

- -
-
- -

◆ ClientFlightLoopBegins()

- -
-
- - - - - - - -
void ClientFlightLoopBegins ()
-
- -

Called at the beginning of each flight loop processing: Get the data lock, create waiting planes.

- -
-
- -

◆ ClientFlightLoopEnds()

- -
-
- - - - - -
- - - - - - - -
void ClientFlightLoopEnds ()
-
-noexcept
-
- -

Called at the end of each flight loop processing: Release the data lock.

- -
-
- -

◆ ClientInit()

- -
-
- - - - - - - -
void ClientInit ()
-
- -

Initializes the module.

- -
-
- -

◆ ClientReleaseAI()

- -
-
- - - - - - - -
void ClientReleaseAI ()
-
- -

Stop TCAS/AI control.

- -
-
- -

◆ ClientToggleActive()

- -
-
- - - - - - - - -
void ClientToggleActive (int nForce = 0)
-
- -

Toggles the cient's activitiy status, as based on menu command.

-
Parameters
- - -
nForce3-way toggle: -1? force off,0toggle,+1` force on
-
-
- -
-
- -

◆ ClientTryGetAI()

- -
-
- - - - - - - -
void ClientTryGetAI ()
-
- -

Try getting TCAS/AI control.

- -
-
-
- - - - diff --git a/docs/html/Client_8h_source.html b/docs/html/Client_8h_source.html deleted file mode 100644 index 14e20ce0..00000000 --- a/docs/html/Client_8h_source.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/Client.h Source File - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
Client.h
-
-
-Go to the documentation of this file.
1 
-
21 #pragma once
-
22 
-
23 //
-
24 // MARK: Aircraft Administration
-
25 //
-
26 
-
27 struct SenderTy;
-
28 
-
30 class RemoteAC : public XPMP2::Aircraft {
-
31 protected:
-
32  // A few defining information taken over from the sender
- -
34  std::uint16_t pkgHash = 0;
-
35  std::string sShortId;
-
36  bool bDeleteMe = false;
-
37 
-
40  XPLMDrawInfo_t histPos[2];
-
42  std::chrono::time_point<std::chrono::steady_clock> histTs[2];
-
43 
-
44  // World coordinates
-
45  double lat = NAN;
-
46  double lon = NAN;
-
47  double alt_ft = NAN;
-
48  std::chrono::duration<int,std::ratio<1, 10000>> diffTime;
-
49  bool bWorldCoordUpdated = false;
-
50 
-
51  // Did the CSL model change? Will force model-reload during UpdatePosition()
-
52  bool bCSLModelChanged = false;
-
53 
-
54  // The sending plugin this plane came from
- -
56 
-
57 public:
-
59  RemoteAC (SenderTy& _sender, const XPMP2::RemoteAcDetailTy& _acDetails);
-
61  virtual ~RemoteAC();
-
62 
-
64  void Create ();
-
65 
-
67  void Update (const XPMP2::RemoteAcDetailTy& _acDetails);
-
69  void Update (const XPMP2::RemoteAcPosUpdateTy& _acPosUpd);
-
71  void Update (const XPMP2::RemoteAcAnimTy& _acAnim);
-
72 
-
74  void UpdatePosition (float, int) override;
-
75 
-
77  void MarkForDeletion () { bDeleteMe = true; }
-
79  bool IsToBeDeleted () const { return bDeleteMe; }
-
80 };
-
81 
-
83 typedef std::map<XPMPPlaneID,RemoteAC> mapRemoteAcTy;
-
84 
-
85 //
-
86 // MARK: Sender Administration
-
87 //
-
88 
-
90 struct SenderAddrTy {
-
91  const XPLMPluginID pluginId;
-
92  std::uint32_t from[4];
-
93  bool operator< (const SenderAddrTy& o) const;
-
95  SenderAddrTy (XPLMPluginID _id, const std::uint32_t _from[4]) :
-
96  pluginId(_id) { memcpy(from, _from, sizeof(from)); }
-
97 };
-
98 
-
99 struct SenderTy {
-
100  std::string sFrom;
-
101  const bool bLocal;
- -
103  std::chrono::time_point<std::chrono::steady_clock> lastMsg;
- -
105 
-
107  SenderTy (const std::string& _from, const XPMP2::RemoteMsgSettingsTy& _s);
-
108 
-
110  static SenderTy* Find (XPLMPluginID _id, const std::uint32_t _from[4]);
-
111 };
-
112 
-
114 typedef std::map<SenderAddrTy,SenderTy> mapSenderTy;
-
115 
-
116 //
-
117 // MARK: Global Functions
-
118 //
-
119 
-
121 void ClientInit();
-
123 void ClientCleanup();
-
124 
-
126 void ClientTryGetAI ();
-
128 void ClientReleaseAI ();
-
129 
-
132 void ClientToggleActive (int nForce = 0);
-
133 
-
135 void ClientFlightLoopBegins ();
-
137 void ClientFlightLoopEnds () noexcept;
-
void ClientFlightLoopEnds() noexcept
Called at the end of each flight loop processing: Release the data lock.
Definition: Client.cpp:456
-
void ClientToggleActive(int nForce=0)
Toggles the cient's activitiy status, as based on menu command.
Definition: Client.cpp:597
-
void ClientCleanup()
Shuts down the module gracefully.
Definition: Client.cpp:589
-
std::map< SenderAddrTy, SenderTy > mapSenderTy
map of sender information
Definition: Client.h:114
-
void ClientFlightLoopBegins()
Called at the beginning of each flight loop processing: Get the data lock, create waiting planes.
Definition: Client.cpp:400
-
void ClientReleaseAI()
Stop TCAS/AI control.
Definition: Client.cpp:327
-
void ClientTryGetAI()
Try getting TCAS/AI control.
Definition: Client.cpp:306
-
void ClientInit()
Initializes the module.
Definition: Client.cpp:581
-
std::map< XPMPPlaneID, RemoteAC > mapRemoteAcTy
Map of remote aircraft; key is the plane id as sent by the sending plugin (while the _modeS_id of the...
Definition: Client.h:83
-
unsigned XPMPPlaneID
Unique ID for an aircraft created by a plugin.
Definition: XPMPMultiplayer.h:252
-
Representation of a remote aircraft.
Definition: Client.h:30
-
double lon
longitude
Definition: Client.h:46
-
std::chrono::duration< int, std::ratio< 1, 10000 > > diffTime
time difference to previous historic position as passed in by the sender
Definition: Client.h:48
-
double lat
latitude
Definition: Client.h:45
-
SenderTy & sender
Definition: Client.h:55
-
bool bWorldCoordUpdated
shall freshly set values be used in the next UpdatePosition callback?
Definition: Client.h:49
-
void Create()
Actually create the aircraft, ultimately calls XPMP2::Aircraft::Create()
Definition: Client.cpp:57
-
bool bCSLModelChanged
Definition: Client.h:52
-
RemoteAC(SenderTy &_sender, const XPMP2::RemoteAcDetailTy &_acDetails)
Constructor for use in network thread: Does not Create the aircraft but only stores the passed inform...
Definition: Client.cpp:37
-
void MarkForDeletion()
Mark this aircraft as to-be-deleted in the next flight loop (can't do in worker thread)
Definition: Client.h:77
-
virtual ~RemoteAC()
Destructor.
Definition: Client.cpp:53
-
bool IsToBeDeleted() const
To be deleted?
Definition: Client.h:79
-
void Update(const XPMP2::RemoteAcDetailTy &_acDetails)
Update data from an a/c detail structure.
Definition: Client.cpp:66
-
bool bDeleteMe
flag that this a/c needs to removed
Definition: Client.h:36
-
XPLMDrawInfo_t histPos[2]
We keep 2 historic positions to be able to calculate simple linear extrapolation.
Definition: Client.h:40
-
std::uint16_t pkgHash
hash value of CSL model package
Definition: Client.h:34
-
void UpdatePosition(float, int) override
Called by XPMP2 for position updates, extrapolates from historic positions.
Definition: Client.cpp:166
-
XPMPPlaneID senderId
sender's plane id (might be different here in case of deduplication)
Definition: Client.h:33
-
std::chrono::time_point< std::chrono::steady_clock > histTs[2]
Timestamps when these two positions were valid.
Definition: Client.h:42
-
std::string sShortId
CSL model's short id.
Definition: Client.h:35
-
double alt_ft
altitude [ft]
Definition: Client.h:47
-
Actual representation of all aircraft in XPMP2.
Definition: XPMPAircraft.h:181
-
Uniquely identifies a sending plugin.
Definition: Client.h:90
-
SenderAddrTy(XPLMPluginID _id, const std::uint32_t _from[4])
Constructor just fills values.
Definition: Client.h:95
-
std::uint32_t from[4]
numerical part of sender's IP address (only differentiating in rare cases of two plugins on different...
Definition: Client.h:92
-
bool operator<(const SenderAddrTy &o) const
Definition: Client.cpp:254
-
const XPLMPluginID pluginId
sender's plugin id within X-Plane (first to speed up memcmp as usually this will already differ betwe...
Definition: Client.h:91
-
Definition: Client.h:99
-
const bool bLocal
is this a local sender on the same computer?
Definition: Client.h:101
-
std::chrono::time_point< std::chrono::steady_clock > lastMsg
Definition: Client.h:103
-
std::string sFrom
string representaton of the sender's IP address
Definition: Client.h:100
-
SenderTy(const std::string &_from, const XPMP2::RemoteMsgSettingsTy &_s)
Constructor copies values and sets lastMsg to now.
Definition: Client.cpp:260
-
static SenderTy * Find(XPLMPluginID _id, const std::uint32_t _from[4])
Find a sender based on plugin id and IP address.
Definition: Client.cpp:271
-
XPMP2::RemoteMsgSettingsTy settings
that plugin's settings
Definition: Client.h:102
-
mapRemoteAcTy mapAc
map of aircraft sent by this plugin
Definition: Client.h:104
-
A/C animation dataRef changes.
Definition: XPMPRemote.h:329
-
A/C details, packed into an array message.
Definition: XPMPRemote.h:183
-
A/C Position updates based on global coordinates.
Definition: XPMPRemote.h:274
-
Settings message, identifying a sending plugin, regularly providing its settings.
Definition: XPMPRemote.h:154
-
- - - - diff --git a/docs/html/XPMP2-Remote_2README_8md.html b/docs/html/Contrails_8md.html similarity index 93% rename from docs/html/XPMP2-Remote_2README_8md.html rename to docs/html/Contrails_8md.html index 1c35f8a3..367ecace 100644 --- a/docs/html/XPMP2-Remote_2README_8md.html +++ b/docs/html/Contrails_8md.html @@ -5,7 +5,7 @@ -XPMP2: XPMP2-Remote/README.md File Reference +XPMP2: docs/Contrails.md File Reference @@ -40,7 +40,7 @@
-
XPMP2-Remote/README.md File Reference
+
docs/Contrails.md File Reference
diff --git a/docs/html/FMOD__Logo_8cpp.html b/docs/html/FMOD__Logo_8cpp.html deleted file mode 100644 index 51d82976..00000000 --- a/docs/html/FMOD__Logo_8cpp.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/lib/fmod/logo/FMOD_Logo.cpp File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Namespaces | -Functions | -Variables
-
-
FMOD_Logo.cpp File Reference
-
-
- -

Compressed version of the FMOD logo with code to create a texture ID in X-Plane for display with Dear ImGui. -More...

-
#include "FMOD_Logo.h"
-#include <cassert>
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include "XPLMGraphics.h"
-
- - - -

-Namespaces

 
- - - - - - - -

-Functions

uint8_t * FMODLogo::LoadRGBA (bool bBlack=true)
 Load the data of the FMOD logo, expanded into RGBA data. More...
 
bool FMODLogo::GetTexture (int &texId, bool bBlack=true)
 The one "public" function to return a texture id for the logo. More...
 
- - - - - - - -

-Variables

constexpr size_t FMODLogo::RLE_SIZE = 5527
 number of array entries in the RLE array More...
 
const uint16_t FMODLogo::ALPHA_RLE [RLE_SIZE]
 Run-length encoded data of the Alpha value of each pixel in the FMOD logo. More...
 
-

Detailed Description

-

Compressed version of the FMOD logo with code to create a texture ID in X-Plane for display with Dear ImGui.

-
See also
FMOD attribution requirements
-
-FMOD Logo download
-

The FMOD logo is essential a single-color image, either black (RGB 0x06 0x08 0x0b) or white (0xff 0xff 0xff), with only the alpha value varying across the image. The below array ALPHA_RLE is a run-length encoded dump of these alpha values. The provided functions recreate the full RGBA data, so that it can be used with OpenGL functionality to be turned into a texture.

-

Usage
-

        #include "FMOD_Logo.inc"
-        ...
-        int logoId = 0;
-        if (FMODLogo::GetTexture(logoId)) {
-            ImGui::Image((void*)(intptr_t)logoId, ImVec2(FMODLogo::IMG_WIDTH, FMODLogo::IMG_HEIGHT));
-        }
-
-
Author
of the code: Birger Hoppe
- -
- - - - diff --git a/docs/html/FMOD__Logo_8h.html b/docs/html/FMOD__Logo_8h.html deleted file mode 100644 index 8bfe60ab..00000000 --- a/docs/html/FMOD__Logo_8h.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/lib/fmod/logo/FMOD_Logo.h File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Namespaces | -Functions | -Variables
-
-
FMOD_Logo.h File Reference
-
-
- -

Compressed version of the FMOD logo with code to create a texture ID in X-Plane for display with Dear ImGui. -More...

-
#include <cstdint>
-
-

Go to the source code of this file.

- - - - -

-Namespaces

 
- - - - - - - -

-Functions

bool FMODLogo::GetTexture (int &texId, bool bBlack=true)
 The one "public" function to return a texture id for the logo. More...
 
uint8_t * FMODLogo::LoadRGBA (bool bBlack=true)
 Load the data of the FMOD logo, expanded into RGBA data. More...
 
- - - - - - - - - - -

-Variables

constexpr int FMODLogo::IMG_WIDTH = 728
 Logo image width. More...
 
constexpr int FMODLogo::IMG_HEIGHT = 192
 Logo image height. More...
 
constexpr int FMODLogo::IMG_SIZE = IMG_WIDTH * IMG_HEIGHT
 Logo image size in number of pixels. More...
 
-

Detailed Description

-

Compressed version of the FMOD logo with code to create a texture ID in X-Plane for display with Dear ImGui.

-
See also
FMOD attribution requirements
-
-FMOD Logo download
-

The FMOD logo is essential a single-color image, either black (RGB 0x06 0x08 0x0b) or white (0xff 0xff 0xff), with only the alpha value varying across the image. The below array ALPHA_RLE is a run-length encoded dump of these alpha values. The provided functions recreate the full RGBA data, so that it can be used with OpenGL functionality to be turned into a texture.

-

Usage
-

        #include "FMOD_Logo.h"
-        ...
-        int logoId = 0;
-        if (FMODLogo::GetTexture(logoId)) {
-            ImGui::Image((void*)(intptr_t)logoId, ImVec2(FMODLogo::IMG_WIDTH, FMODLogo::IMG_HEIGHT));
-        }
-
-
Author
of the code: Birger Hoppe
- -
- - - - diff --git a/docs/html/FMOD__Logo_8h_source.html b/docs/html/FMOD__Logo_8h_source.html deleted file mode 100644 index 0df2ac9f..00000000 --- a/docs/html/FMOD__Logo_8h_source.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/lib/fmod/logo/FMOD_Logo.h Source File - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
FMOD_Logo.h
-
-
-Go to the documentation of this file.
1 
-
43 #pragma once
-
44 
-
45 #include <cstdint>
-
46 
-
47 namespace FMODLogo {
-
48 
-
49 // Dimensions of the FMOD logo
-
50 constexpr int IMG_WIDTH = 728;
-
51 constexpr int IMG_HEIGHT = 192;
-
52 constexpr int IMG_SIZE = IMG_WIDTH * IMG_HEIGHT;
-
53 
-
60 bool GetTexture (int& texId, bool bBlack = true);
-
61 
-
70 uint8_t* LoadRGBA (bool bBlack = true);
-
71 
-
72 }; // namespace FMODLogo
-
Definition: FMOD_Logo.cpp:63
-
constexpr int IMG_WIDTH
Logo image width.
Definition: FMOD_Logo.h:50
-
constexpr int IMG_HEIGHT
Logo image height.
Definition: FMOD_Logo.h:51
-
constexpr int IMG_SIZE
Logo image size in number of pixels.
Definition: FMOD_Logo.h:52
-
uint8_t * LoadRGBA(bool bBlack)
Load the data of the FMOD logo, expanded into RGBA data.
Definition: FMOD_Logo.cpp:419
-
bool GetTexture(int &id, bool bBlack)
The one "public" function to return a texture id for the logo.
Definition: FMOD_Logo.cpp:459
-
- - - - diff --git a/docs/html/XPMP2-Remote_2Utilities_8cpp.html b/docs/html/XPMP2-Remote_2Utilities_8cpp.html deleted file mode 100644 index d1f00f5a..00000000 --- a/docs/html/XPMP2-Remote_2Utilities_8cpp.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/Utilities.cpp File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Macros | -Functions | -Variables
-
-
Utilities.cpp File Reference
-
-
- -

Miscellaneous utility functions, including logging. -More...

-
#include "XPMP2-Remote.h"
-
- - - -

-Macros

#define PATH_DELIM_STD   '/'
 
- - - - - - - - - - - - - - - - - - - -

-Functions

float GetMiscNetwTime ()
 Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt. More...
 
bool CheckEverySoOften (float &_lastCheck, float _interval, float _now)
 Convenience function to check on something at most every x seconds. More...
 
std::string GetPluginName (XPLMPluginID who)
 Return a plugin's name. More...
 
std::string str_n (const char *s, size_t max)
 Copy at most n chars from location, or less if zero-terminated. More...
 
const char * LogGetString (const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
 Returns ptr to static buffer filled with formatted log string. More...
 
void LogMsg (const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
 Log Text to log file. More...
 
- - - - - - -

-Variables

XPMP2RCGlobals rcGlob
 The one global variable object. More...
 
const char * LOG_LEVEL []
 
-

Detailed Description

-

Miscellaneous utility functions, including logging.

-
Author
Birger Hoppe
- -

Macro Definition Documentation

- -

◆ PATH_DELIM_STD

- -
-
- - - - -
#define PATH_DELIM_STD   '/'
-
- -
-
-

Function Documentation

- -

◆ CheckEverySoOften()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
bool CheckEverySoOften (float & _lastCheck,
float _interval,
float _now 
)
-
- -

Convenience function to check on something at most every x seconds.

-
Parameters
- - - - -
_lastCheckProvide a float which holds the time of last check (init with 0.0f)
_interval[seconds] How often to perform the check?
_nowCurrent time, possibly from a call to GetTotalRunningTime()
-
-
-
Returns
true if more than _interval time has passed since _lastCheck
- -
-
- -

◆ GetMiscNetwTime()

- -
-
- - - - - - - -
float GetMiscNetwTime ()
-
- -

Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt.

- -
-
- -

◆ GetPluginName()

- -
-
- - - - - - - - -
std::string GetPluginName (XPLMPluginID who)
-
- -

Return a plugin's name.

- -
-
- -

◆ LogGetString()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const char* LogGetString (const char * szPath,
int ln,
const char * szFunc,
logLevelTy lvl,
const char * szMsg,
va_list args 
)
-
- -

Returns ptr to static buffer filled with formatted log string.

- -
-
- -

◆ LogMsg()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LogMsg (const char * szPath,
int ln,
const char * szFunc,
logLevelTy lvl,
const char * szMsg,
 ... 
)
-
- -

Log Text to log file.

- -
-
- -

◆ str_n()

- -
-
- - - - - - - - - - - - - - - - - - -
std::string str_n (const char * s,
size_t max 
)
-
- -

Copy at most n chars from location, or less if zero-terminated.

-

Unlike std::string(char*, n) this will not copy null chars

- -
-
-

Variable Documentation

- -

◆ LOG_LEVEL

- -
-
- - - - -
const char* LOG_LEVEL[]
-
-Initial value:
= {
-
"DEBUG", "INFO ", "WARN ", "ERROR", "FATAL", "MSG "
-
}
-
-
-
- -

◆ rcGlob

- -
-
- - - - -
XPMP2RCGlobals rcGlob
-
- -

The one global variable object.

-

the one and only instance of XPMP2RCGlobals

- -
-
-
- - - - diff --git a/docs/html/XPMP2-Remote_2Utilities_8h.html b/docs/html/XPMP2-Remote_2Utilities_8h.html deleted file mode 100644 index 41ba9f33..00000000 --- a/docs/html/XPMP2-Remote_2Utilities_8h.html +++ /dev/null @@ -1,611 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/Utilities.h File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Macros | -Enumerations | -Functions
-
-
Utilities.h File Reference
-
-
- -

Miscellaneous utility functions, including logging. -More...

- -

Go to the source code of this file.

- - - - - - - - - - - - - - - - - - - - - - - -

-Macros

#define ERR_ASSERT   "ASSERT FAILED: %s"
 
#define ERR_EXCEPTION   "EXCEPTION CAUGHT: %s"
 
#define STR_N(s)   str_n(s,sizeof(s))
 Simplify using str_n() with char arrays. More...
 
#define XPMP2RC_FMTARGS(FMT)
 To apply printf-style warnings to our functions. More...
 
#define LOG_MSG(lvl, ...)
 Log a message if lvl is greater or equal currently defined log level. More...
 
#define THROW_ERROR(...)   throw XPMP2::XPMP2Error(__FILE__, __LINE__, __func__, __VA_ARGS__);
 Throws an exception using XPMP2Error. More...
 
#define LOG_ASSERT(cond)
 Throw in an assert-style (logging takes place in XPMP2Error constructor) More...
 
#define SET_THREAD_NAME(sName)
 
- - - - -

-Enumerations

enum  logLevelTy : std::uint8_t {
-  logDEBUG = 0 -, logINFO -, logWARN -, logERR -,
-  logFATAL -, logMSG -
- }
 Logging level. More...
 
- - - - - - - - - - - - - - - - - - - - - - -

-Functions

float GetMiscNetwTime ()
 Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt. More...
 
bool CheckEverySoOften (float &_lastCheck, float _interval, float _now)
 Convenience function to check on something at most every x seconds. More...
 
bool CheckEverySoOften (float &_lastCheck, float _interval)
 Convenience function to check on something at most every x seconds. More...
 
std::string GetPluginName (XPLMPluginID who)
 Return a plugin's name. More...
 
std::string str_n (const char *s, size_t max)
 Copy at most n chars from location, or less if zero-terminated. More...
 
const char * LogGetString (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
 Returns ptr to static buffer filled with formatted log string. More...
 
void LogMsg (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2RC_FMTARGS(5)
 Log Text to log file. More...
 
-

Detailed Description

-

Miscellaneous utility functions, including logging.

-
Author
Birger Hoppe
- -

Macro Definition Documentation

- -

◆ ERR_ASSERT

- -
-
- - - - -
#define ERR_ASSERT   "ASSERT FAILED: %s"
-
- -
-
- -

◆ ERR_EXCEPTION

- -
-
- - - - -
#define ERR_EXCEPTION   "EXCEPTION CAUGHT: %s"
-
- -
-
- -

◆ LOG_ASSERT

- -
-
- - - - - - - - -
#define LOG_ASSERT( cond)
-
-Value:
if (!(cond)) { \
-
THROW_ERROR(ERR_ASSERT,#cond); \
-
}
-
#define ERR_ASSERT
Definition: Utilities.h:27
-
-

Throw in an assert-style (logging takes place in XPMP2Error constructor)

-
Note
This conditional check always takes place, independend of any build or logging settings!
- -
-
- -

◆ LOG_MSG

- -
-
- - - - - - - - - - - - - - - - - - -
#define LOG_MSG( lvl,
 ... 
)
-
-Value:
{ \
-
if (lvl >= rcGlob.mergedS.logLvl) \
-
{LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
-
}
-
XPMP2RCGlobals rcGlob
The one global variable object.
Definition: Utilities.cpp:24
-
void LogMsg(const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2RC_FMTARGS(5)
Log Text to log file.
Definition: Utilities.cpp:135
-
XPMP2::RemoteMsgSettingsTy mergedS
Config values reconciled from sending plugins.
Definition: XPMP2-Remote.h:122
-
std::uint8_t logLvl
logging level
Definition: XPMPRemote.h:159
-
-

Log a message if lvl is greater or equal currently defined log level.

-
Note
First parameter after lvl must be the message text, which can be a format string with its parameters following like in sprintf
- -
-
- -

◆ SET_THREAD_NAME

- -
-
- - - - - - - - -
#define SET_THREAD_NAME( sName)
-
- -
-
- -

◆ STR_N

- -
-
- - - - - - - - -
#define STR_N( s)   str_n(s,sizeof(s))
-
- -

Simplify using str_n() with char arrays.

- -
-
- -

◆ THROW_ERROR

- -
-
- - - - - - - - -
#define THROW_ERROR( ...)   throw XPMP2::XPMP2Error(__FILE__, __LINE__, __func__, __VA_ARGS__);
-
- -

Throws an exception using XPMP2Error.

-
Note
First parameter after lvl must be the message text, which can be a format string with its parameters following like in sprintf
- -
-
- -

◆ XPMP2RC_FMTARGS

- -
-
- - - - - - - - -
#define XPMP2RC_FMTARGS( FMT)
-
- -

To apply printf-style warnings to our functions.

-
See also
Taken from imgui.h's definition of IM_FMTARGS
- -
-
-

Enumeration Type Documentation

- -

◆ logLevelTy

- -
-
- - - - -
enum logLevelTy : std::uint8_t
-
- -

Logging level.

- - - - - - - -
Enumerator
logDEBUG 

Debug, highest level of detail.

-
logINFO 

regular info messages

-
logWARN 

warnings, i.e. unexpected, but uncritical events, maybe leading to unwanted display, but still: display of aircraft

-
logERR 

errors mean, aircraft can potentially not be displayed

-
logFATAL 

fatal is shortly before a crash

-
logMSG 

will always be output, no matter what has been configured, cannot be suppressed

-
- -
-
-

Function Documentation

- -

◆ CheckEverySoOften() [1/2]

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
bool CheckEverySoOften (float & _lastCheck,
float _interval 
)
-
-inline
-
- -

Convenience function to check on something at most every x seconds.

-
Parameters
- - - -
_lastCheckProvide a float which holds the time of last check (init with 0.0f)
_interval[seconds] How often to perform the check?
-
-
-
Returns
true if more than _interval time has passed since _lastCheck
- -
-
- -

◆ CheckEverySoOften() [2/2]

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
bool CheckEverySoOften (float & _lastCheck,
float _interval,
float _now 
)
-
- -

Convenience function to check on something at most every x seconds.

-
Parameters
- - - - -
_lastCheckProvide a float which holds the time of last check (init with 0.0f)
_interval[seconds] How often to perform the check?
_nowCurrent time, possibly from a call to GetTotalRunningTime()
-
-
-
Returns
true if more than _interval time has passed since _lastCheck
- -
-
- -

◆ GetMiscNetwTime()

- -
-
- - - - - - - -
float GetMiscNetwTime ()
-
- -

Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt.

- -
-
- -

◆ GetPluginName()

- -
-
- - - - - - - - -
std::string GetPluginName (XPLMPluginID who)
-
- -

Return a plugin's name.

- -
-
- -

◆ LogGetString()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const char* LogGetString (const char * szFile,
int ln,
const char * szFunc,
logLevelTy lvl,
const char * szMsg,
va_list args 
)
-
- -

Returns ptr to static buffer filled with formatted log string.

- -
-
- -

◆ LogMsg()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LogMsg (const char * szFile,
int ln,
const char * szFunc,
logLevelTy lvl,
const char * szMsg,
 ... 
)
-
- -

Log Text to log file.

- -
-
- -

◆ str_n()

- -
-
- - - - - - - - - - - - - - - - - - -
std::string str_n (const char * s,
size_t max 
)
-
- -

Copy at most n chars from location, or less if zero-terminated.

-

Unlike std::string(char*, n) this will not copy null chars

- -
-
-
- - - - diff --git a/docs/html/XPMP2-Remote_2Utilities_8h_source.html b/docs/html/XPMP2-Remote_2Utilities_8h_source.html deleted file mode 100644 index 19a227bc..00000000 --- a/docs/html/XPMP2-Remote_2Utilities_8h_source.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/Utilities.h Source File - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
Utilities.h
-
-
-Go to the documentation of this file.
1 
-
21 #pragma once
-
22 
-
23 //
-
24 // MARK: General texts
-
25 //
-
26 
-
27 #define ERR_ASSERT "ASSERT FAILED: %s"
-
28 #define ERR_EXCEPTION "EXCEPTION CAUGHT: %s"
-
29 
-
30 //
-
31 // MARK: Misc
-
32 //
-
33 
-
35 float GetMiscNetwTime ();
-
36 
-
42 bool CheckEverySoOften (float& _lastCheck, float _interval, float _now);
-
43 
-
48 inline bool CheckEverySoOften (float& _lastCheck, float _interval)
-
49 { return CheckEverySoOften(_lastCheck, _interval, GetMiscNetwTime()); }
-
50 
-
52 std::string GetPluginName (XPLMPluginID who);
-
53 
-
54 //
-
55 // MARK: String functions
-
56 //
-
57 
-
60 std::string str_n (const char* s, size_t max);
-
61 
-
63 #define STR_N(s) str_n(s,sizeof(s))
-
64 
-
65 //
-
66 // MARK: Logging Support
-
67 //
-
68 
-
71 #if defined(__clang__) || defined(__GNUC__)
-
72 #define XPMP2RC_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1)))
-
73 #else
-
74 #define XPMP2RC_FMTARGS(FMT)
-
75 #endif
-
76 
-
78 enum logLevelTy : std::uint8_t {
-
79  logDEBUG = 0,
- - - - -
84  logMSG
-
85 };
-
86 
-
88 const char* LogGetString ( const char* szFile, int ln, const char* szFunc, logLevelTy lvl, const char* szMsg, va_list args );
-
89 
-
91 void LogMsg ( const char* szFile, int ln, const char* szFunc, logLevelTy lvl, const char* szMsg, ... ) XPMP2RC_FMTARGS(5);
-
92 
-
93 //
-
94 // MARK: Logging macros
-
95 //
-
96 
-
100 #define LOG_MSG(lvl,...) { \
-
101  if (lvl >= rcGlob.mergedS.logLvl) \
-
102  {LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
-
103 }
-
104 
-
108 #define THROW_ERROR(...) \
-
109 throw XPMP2::XPMP2Error(__FILE__, __LINE__, __func__, __VA_ARGS__);
-
110 
-
113 #define LOG_ASSERT(cond) \
-
114  if (!(cond)) { \
-
115  THROW_ERROR(ERR_ASSERT,#cond); \
-
116  }
-
117 
-
118 //
-
119 // MARK: Compiler differences
-
120 //
-
121 
-
122 // MARK: Thread names
-
123 #ifdef DEBUG
-
124 // This might not work on older Windows version, which is why we don't publish it in release builds
-
125 #if IBM
-
126 #define SET_THREAD_NAME(sName) SetThreadDescription(GetCurrentThread(), L##sName)
-
127 #elif APL
-
128 #define SET_THREAD_NAME(sName) pthread_setname_np(sName)
-
129 #elif LIN
-
130 #define SET_THREAD_NAME(sName) pthread_setname_np(pthread_self(),sName)
-
131 #endif
-
132 #else
-
133 #define SET_THREAD_NAME(sName)
-
134 #endif
-
const char * LogGetString(const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
Returns ptr to static buffer filled with formatted log string.
Definition: Utilities.cpp:90
-
float GetMiscNetwTime()
Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log....
Definition: Utilities.cpp:31
-
std::string GetPluginName(XPLMPluginID who)
Return a plugin's name.
Definition: Utilities.cpp:54
-
void LogMsg(const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2RC_FMTARGS(5)
Log Text to log file.
Definition: Utilities.cpp:135
-
logLevelTy
Logging level.
Definition: Utilities.h:78
-
@ logDEBUG
Debug, highest level of detail.
Definition: Utilities.h:79
-
@ logINFO
regular info messages
Definition: Utilities.h:80
-
@ logWARN
warnings, i.e. unexpected, but uncritical events, maybe leading to unwanted display,...
Definition: Utilities.h:81
-
@ logFATAL
fatal is shortly before a crash
Definition: Utilities.h:83
-
@ logERR
errors mean, aircraft can potentially not be displayed
Definition: Utilities.h:82
-
@ logMSG
will always be output, no matter what has been configured, cannot be suppressed
Definition: Utilities.h:84
-
#define XPMP2RC_FMTARGS(FMT)
To apply printf-style warnings to our functions.
Definition: Utilities.h:74
-
std::string str_n(const char *s, size_t max)
Copy at most n chars from location, or less if zero-terminated.
Definition: Utilities.cpp:66
-
bool CheckEverySoOften(float &_lastCheck, float _interval, float _now)
Convenience function to check on something at most every x seconds.
Definition: Utilities.cpp:43
-
- - - - diff --git a/docs/html/XPMP2-Remote_8cpp.html b/docs/html/XPMP2-Remote_8cpp.html deleted file mode 100644 index 9ee30c38..00000000 --- a/docs/html/XPMP2-Remote_8cpp.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/XPMP2-Remote.cpp File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Classes | -Functions | -Variables
-
-
XPMP2-Remote.cpp File Reference
-
-
- -

XPMP2 Remote Client: Displays aircraft served from other XPMP2-based plugins in the network. -More...

-
#include "XPMP2-Remote.h"
-
- - - - -

-Classes

struct  CmdMenuDefTy
 Command definition per menu item. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

int CBIntPrefsFunc (const char *, [[maybe_unused]] const char *item, int defaultVal)
 
void MenuUpdateCheckmarks ()
 Sets all menu checkmarks according to current status. More...
 
void MenuUpdateSenders ()
 (Re)Create the submenu listing information about connected senders More...
 
int CmdCallback (XPLMCommandRef cmdRef, XPLMCommandPhase inPhase, void *)
 Callback function for menu. More...
 
void MenuLabelsCB (void *, void *inItemRef)
 Callback function for the Labels submenu. More...
 
float FlightLoopCallback (float, float, int, void *)
 Regular tasks, called by flight loop. More...
 
PLUGIN_API int XPluginStart (char *outName, char *outSig, char *outDesc)
 
PLUGIN_API void XPluginStop (void)
 
PLUGIN_API int XPluginEnable (void)
 
PLUGIN_API void XPluginDisable (void)
 
PLUGIN_API void XPluginReceiveMessage (XPLMPluginID who, long inMsg, void *)
 
- - - - - - - - - - - - - - - - - - - - - - - - - - -

-Variables

XPLMMenuID hMenu = nullptr
 menu id of our plugin's menu More...
 
XPLMMenuID hLabels = nullptr
 menu id of the Labels submenu More...
 
XPLMMenuID hSenders = nullptr
 menu id of the Senders submenu More...
 
int numSendersInMenu = 0
 how many lines to we currently server in the menu? More...
 
constexpr std::uintptr_t MENU_ACTIVE = 0
 
constexpr std::uintptr_t MENU_TCAS = 1
 
constexpr std::uintptr_t MENU_LABELS = 2
 
constexpr std::uintptr_t MENU_SENDER = 3
 
struct CmdMenuDefTy CMD_MENU_DEF [2]
 
XPLMFlightLoopID flId = nullptr
 ID of our flight loop callback for regular tasks. More...
 
-

Detailed Description

-

XPMP2 Remote Client: Displays aircraft served from other XPMP2-based plugins in the network.

-

This plugin is intended to be used in a multi-computer simulator setup, usually in the PCs used for external visuals.
- The typical setup would be:

-

Technically, this works as follows:

-
See also
For multi-computer setup of external visual: https://x-plane.com/manuals/desktop/#networkingmultiplecomputersformultipledisplays
-
-For Networked Multiplayer: https://x-plane.com/manuals/desktop/#networkedmultiplayer
-
Author
Birger Hoppe
- -

Class Documentation

- -

◆ CmdMenuDefTy

- -
-
- - - - -
struct CmdMenuDefTy
-
-

Command definition per menu item.

-
- - - - - - - - - - - - - -
Class Members
-const char * -cmdName -command's name
-const char * -description -human-readable command description
-XPLMCommandRef -hCmd -command reference assigned by X-Plane
-const char * -menuName -(initial) menu item's name
- -
-
-

Function Documentation

- -

◆ CBIntPrefsFunc()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int CBIntPrefsFunc (const char * ,
[[maybe_unused] ] const char * item,
int defaultVal 
)
-
-

This is a callback the XPMP2 calls regularly to learn about configuration settings. Only 3 are left, all of them integers.

- -
-
- -

◆ CmdCallback()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int CmdCallback (XPLMCommandRef cmdRef,
XPLMCommandPhase inPhase,
void *  
)
-
- -

Callback function for menu.

- -
-
- -

◆ FlightLoopCallback()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
float FlightLoopCallback (float ,
float ,
int ,
void *  
)
-
- -

Regular tasks, called by flight loop.

- -
-
- -

◆ MenuLabelsCB()

- -
-
- - - - - - - - - - - - - - - - - - -
void MenuLabelsCB (void * ,
void * inItemRef 
)
-
- -

Callback function for the Labels submenu.

- -
-
- -

◆ MenuUpdateCheckmarks()

- -
-
- - - - - - - -
void MenuUpdateCheckmarks ()
-
- -

Sets all menu checkmarks according to current status.

- -
-
- -

◆ MenuUpdateSenders()

- -
-
- - - - - - - -
void MenuUpdateSenders ()
-
- -

(Re)Create the submenu listing information about connected senders

- -
-
- -

◆ XPluginDisable()

- -
-
- - - - - - - - -
PLUGIN_API void XPluginDisable (void )
-
- -
-
- -

◆ XPluginEnable()

- -
-
- - - - - - - - -
PLUGIN_API int XPluginEnable (void )
-
- -
-
- -

◆ XPluginReceiveMessage()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PLUGIN_API void XPluginReceiveMessage (XPLMPluginID who,
long inMsg,
void *  
)
-
- -
-
- -

◆ XPluginStart()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PLUGIN_API int XPluginStart (char * outName,
char * outSig,
char * outDesc 
)
-
- -
-
- -

◆ XPluginStop()

- -
-
- - - - - - - - -
PLUGIN_API void XPluginStop (void )
-
- -
-
-

Variable Documentation

- -

◆ CMD_MENU_DEF

- -
-
- - - - -
struct CmdMenuDefTy CMD_MENU_DEF[2]
-
-Initial value:
= {
-
{ "XPMP2-Remote/Activate", "Active", "Toggle if Remote Client is active" },
-
{ "XPMP2-Remote/TCAS", "TCAS Control", "Toggle if Remote Client shall have TCAS control" },
-
}
-
-
-
- -

◆ flId

- -
-
- - - - -
XPLMFlightLoopID flId = nullptr
-
- -

ID of our flight loop callback for regular tasks.

- -
-
- -

◆ hLabels

- -
-
- - - - -
XPLMMenuID hLabels = nullptr
-
- -

menu id of the Labels submenu

- -
-
- -

◆ hMenu

- -
-
- - - - -
XPLMMenuID hMenu = nullptr
-
- -

menu id of our plugin's menu

- -
-
- -

◆ hSenders

- -
-
- - - - -
XPLMMenuID hSenders = nullptr
-
- -

menu id of the Senders submenu

- -
-
- -

◆ MENU_ACTIVE

- -
-
- - - - - -
- - - - -
constexpr std::uintptr_t MENU_ACTIVE = 0
-
-constexpr
-
- -
-
- -

◆ MENU_LABELS

- -
-
- - - - - -
- - - - -
constexpr std::uintptr_t MENU_LABELS = 2
-
-constexpr
-
- -
-
- -

◆ MENU_SENDER

- -
-
- - - - - -
- - - - -
constexpr std::uintptr_t MENU_SENDER = 3
-
-constexpr
-
- -
-
- -

◆ MENU_TCAS

- -
-
- - - - - -
- - - - -
constexpr std::uintptr_t MENU_TCAS = 1
-
-constexpr
-
- -
-
- -

◆ numSendersInMenu

- -
-
- - - - -
int numSendersInMenu = 0
-
- -

how many lines to we currently server in the menu?

- -
-
-
- - - - diff --git a/docs/html/XPMP2-Remote_8h.html b/docs/html/XPMP2-Remote_8h.html deleted file mode 100644 index 5ce2b450..00000000 --- a/docs/html/XPMP2-Remote_8h.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/XPMP2-Remote.h File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Classes | -Variables
-
-
XPMP2-Remote.h File Reference
-
-
- -

XPMP2 Remote Client: Displays aircraft served from other XPMP2-based plugins in the network. -More...

-
#include <cassert>
-#include <cstdio>
-#include <cstdarg>
-#include <cstring>
-#include <cmath>
-#include <string>
-#include <map>
-#include <chrono>
-#include <memory>
-#include <atomic>
-#include <algorithm>
-#include <thread>
-#include <mutex>
-#include "XPLMDataAccess.h"
-#include "XPLMUtilities.h"
-#include "XPLMPlugin.h"
-#include "XPLMMenus.h"
-#include "XPLMProcessing.h"
-#include "XPMPAircraft.h"
-#include "XPMPMultiplayer.h"
-#include "XPMPRemote.h"
-#include "Utilities.h"
-#include "Client.h"
-
-

Go to the source code of this file.

- - - - - -

-Classes

struct  XPMP2RCGlobals
 Holds all global variables. More...
 
- - - - - - - - - - - - - - - - -

-Variables

constexpr const char * REMOTE_CLIENT_NAME = "XPMP2 Remote Client"
 Plugin name. More...
 
constexpr const char * REMOTE_CLIENT_LOG = "XPMP2_RC"
 ID used in own log entries. More...
 
constexpr const char * REMOTE_CLIENT_LOG2 = "RC"
 Short ID used in XPMP2 log entries. More...
 
constexpr float REMOTE_CLIENT_VER = 1.20f
 Version number for the XPMP2 Remote plugin. More...
 
XPMP2RCGlobals rcGlob
 the one and only instance of XPMP2RCGlobals More...
 
-

Detailed Description

-

XPMP2 Remote Client: Displays aircraft served from other XPMP2-based plugins in the network.

-

This plugin is intended to be used in a multi-computer simulator setup, usually in the PCs used for external visuals.
- The typical setup would be:

-

Technically, this works as follows:

-
See also
For multi-computer setup of external visual: https://x-plane.com/manuals/desktop/#networkingmultiplecomputersformultipledisplays
-
-For Networked Multiplayer: https://x-plane.com/manuals/desktop/#networkedmultiplayer
-
Author
Birger Hoppe
- -

Variable Documentation

- -

◆ rcGlob

- -
-
- - - - - -
- - - - -
XPMP2RCGlobals rcGlob
-
-extern
-
- -

the one and only instance of XPMP2RCGlobals

-

the one and only instance of XPMP2RCGlobals

- -
-
- -

◆ REMOTE_CLIENT_LOG

- -
-
- - - - - -
- - - - -
constexpr const char* REMOTE_CLIENT_LOG = "XPMP2_RC"
-
-constexpr
-
- -

ID used in own log entries.

- -
-
- -

◆ REMOTE_CLIENT_LOG2

- -
-
- - - - - -
- - - - -
constexpr const char* REMOTE_CLIENT_LOG2 = "RC"
-
-constexpr
-
- -

Short ID used in XPMP2 log entries.

- -
-
- -

◆ REMOTE_CLIENT_NAME

- -
-
- - - - - -
- - - - -
constexpr const char* REMOTE_CLIENT_NAME = "XPMP2 Remote Client"
-
-constexpr
-
- -

Plugin name.

- -
-
- -

◆ REMOTE_CLIENT_VER

- -
-
- - - - - -
- - - - -
constexpr float REMOTE_CLIENT_VER = 1.20f
-
-constexpr
-
- -

Version number for the XPMP2 Remote plugin.

- -
-
-
- - - - diff --git a/docs/html/XPMP2-Remote_8h_source.html b/docs/html/XPMP2-Remote_8h_source.html deleted file mode 100644 index ed1f9bc8..00000000 --- a/docs/html/XPMP2-Remote_8h_source.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote/XPMP2-Remote.h Source File - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
XPMP2-Remote.h
-
-
-Go to the documentation of this file.
1 
-
62 #pragma once
-
63 
-
64 // Standard C headers
-
65 #include <cassert>
-
66 #include <cstdio>
-
67 #include <cstdarg>
-
68 #include <cstring>
-
69 #include <cmath>
-
70 
-
71 // Standard C++ headers
-
72 #include <string>
-
73 #include <map>
-
74 #include <chrono>
-
75 #include <memory>
-
76 #include <atomic>
-
77 #include <algorithm>
-
78 #include <thread>
-
79 #include <mutex>
-
80 
-
81 // X-Plane SDK
-
82 #include "XPLMDataAccess.h"
-
83 #include "XPLMUtilities.h"
-
84 #include "XPLMPlugin.h"
-
85 #include "XPLMMenus.h"
-
86 #include "XPLMProcessing.h"
-
87 
-
88 // Include XPMP2 headers
-
89 #include "XPMPAircraft.h"
-
90 #include "XPMPMultiplayer.h"
-
91 #include "XPMPRemote.h"
-
92 
-
93 // Include XPMP2-Remote headers
-
94 #include "Utilities.h"
-
95 #include "Client.h"
-
96 
-
97 // Windows: I prefer the proper SDK variants of min and max
-
98 #ifdef min
-
99 #undef min
-
100 #endif
-
101 #ifdef max
-
102 #undef max
-
103 #endif
-
104 
-
105 //
-
106 // MARK: Constants
-
107 //
-
108 
-
109 constexpr const char* REMOTE_CLIENT_NAME = "XPMP2 Remote Client";
-
110 constexpr const char* REMOTE_CLIENT_LOG = "XPMP2_RC";
-
111 constexpr const char* REMOTE_CLIENT_LOG2 = "RC";
-
112 constexpr float REMOTE_CLIENT_VER = 1.20f;
-
113 
-
114 //
-
115 // MARK: Globals
-
116 //
-
117 
- -
120 
- - - - - - -
129 
- -
132 
-
134  float now = 0.0f;
-
135 
-
137  std::thread::id xpThread;
-
139  bool IsXPThread() const { return std::this_thread::get_id() == xpThread; }
-
140 };
-
141 
-
143 extern XPMP2RCGlobals rcGlob;
-
Main Client functionality, processing received data.
-
std::map< SenderAddrTy, SenderTy > mapSenderTy
map of sender information
Definition: Client.h:114
-
Miscellaneous utility functions, including logging.
-
constexpr const char * REMOTE_CLIENT_LOG2
Short ID used in XPMP2 log entries.
Definition: XPMP2-Remote.h:111
-
constexpr const char * REMOTE_CLIENT_LOG
ID used in own log entries.
Definition: XPMP2-Remote.h:110
-
constexpr const char * REMOTE_CLIENT_NAME
Plugin name.
Definition: XPMP2-Remote.h:109
-
constexpr float REMOTE_CLIENT_VER
Version number for the XPMP2 Remote plugin.
Definition: XPMP2-Remote.h:112
-
XPMP2RCGlobals rcGlob
the one and only instance of XPMP2RCGlobals
Definition: Utilities.cpp:24
-
XPMP2::Aircraft represent an aircraft as managed by XPMP2.
-
Initialization and general control functions for XPMP2.
-
Semi-public remote network functionality for master/client operations.
-
Holds all global variables.
Definition: XPMP2-Remote.h:119
-
enum XPMP2RCGlobals::DrawLabelsTy eDrawLabels
Shall aircraft labels be drawn at remote site?
-
bool IsXPThread() const
Is this thread XP's main thread?
Definition: XPMP2-Remote.h:139
-
float now
Latest timestamp read from network_time_sec.
Definition: XPMP2-Remote.h:134
-
std::thread::id xpThread
Definition: XPMP2-Remote.h:137
-
mapSenderTy gmapSender
The global map of all sending plugins we've ever heard of.
Definition: XPMP2-Remote.h:131
-
XPMP2::RemoteMsgSettingsTy mergedS
Config values reconciled from sending plugins.
Definition: XPMP2-Remote.h:122
-
DrawLabelsTy
Shall aircraft labels be drawn at remote site?
Definition: XPMP2-Remote.h:124
-
@ LABELS_ON
Always draw labels.
Definition: XPMP2-Remote.h:126
-
@ LABELS_OFF
Don't draw labels.
Definition: XPMP2-Remote.h:127
-
@ LABELS_SYNCH
Synchronize drawing of labels with sending client.
Definition: XPMP2-Remote.h:125
-
Settings message, identifying a sending plugin, regularly providing its settings.
Definition: XPMPRemote.h:154
-
- - - - diff --git a/docs/html/XPMP2-Sample_2README_8md.html b/docs/html/XPMP2-Sample_2README_8md.html deleted file mode 100644 index 887f5381..00000000 --- a/docs/html/XPMP2-Sample_2README_8md.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/README.md File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-
XPMP2-Sample/README.md File Reference
-
-
-
- - - - diff --git a/docs/html/XPMP2-Sample_8cpp.html b/docs/html/XPMP2-Sample_8cpp.html deleted file mode 100644 index 4339e890..00000000 --- a/docs/html/XPMP2-Sample_8cpp.html +++ /dev/null @@ -1,1435 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/XPMP2-Sample.cpp File Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-Classes | -Enumerations | -Functions | -Variables
-
-
XPMP2-Sample.cpp File Reference
-
-
- -

Example plugin demonstrating XPMP2 techniques. -More...

-
#include <cstdio>
-#include <cstdarg>
-#include <cstring>
-#include <cmath>
-#include "XPLMDataAccess.h"
-#include "XPLMUtilities.h"
-#include "XPLMPlugin.h"
-#include "XPLMGraphics.h"
-#include "XPLMMenus.h"
-#include "XPCAircraft.h"
-#include "XPMPAircraft.h"
-#include "XPMPMultiplayer.h"
-
- - - - - - - - - - -

-Classes

struct  positionTy
 Summarizes the 3 values of a position in the local coordinate system. More...
 
class  SampleAircraft
 Subclassing XPMP2::Aircraft to create our own class. More...
 
class  LegacySampleAircraft
 Subclassing XPCAircraft to create our own class. More...
 
- - - - -

-Enumerations

enum  MenuItemsTy {
-  MENU_PLANES = 0 -, MENU_VISIBLE -, MENU_FREEZE -, MENU_CYCLE_MDL -,
-  MENU_REMATCH_MDL -, MENU_AI -
- }
 List of all menu item indexes. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

void LogMsg (const char *szMsg,...)
 Log a message to X-Plane's Log.txt with sprintf-style parameters. More...
 
int CBIntPrefsFunc (const char *, [[maybe_unused]] const char *item, int defaultVal)
 This is a callback the XPMP2 calls regularly to learn about configuration settings. More...
 
void CBPlaneNotifier (XPMPPlaneID inPlaneID, XPMPPlaneNotification inNotification, void *)
 
float GetTimeFragment ()
 Returns a number between 0.0 and 1.0, increasing over the course of 10 seconds, then restarting. More...
 
float GetTimeUpDown ()
 Returns a number between 0.0 and 1.0, going up and down over the course of 10 seconds. More...
 
double deg2rad (const double deg)
 Convert from degree to radians. More...
 
char * strScpy (char *dest, const char *src, size_t size)
 Save string copy. More...
 
positionTy FindCenterPos (float dist)
 Finds a position 200m in front of the user's plane serving as the center for further operations. More...
 
void CirclePos (positionTy &pos, float heading, float radius)
 Put the position on a circle around itself. More...
 
void ConvLocalToWorld (const positionTy &pos, double &lat, double &lon, double &alt)
 Convert local position to world coordinates. More...
 
XPMPPlaneCallbackResult SetPositionData (XPMPPlanePosition_t &data)
 Handles requests for plane's position data. More...
 
XPMPPlaneCallbackResult SetSurfaceData (XPMPPlaneSurfaces_t &data)
 Handles requests for plane's surface data. More...
 
XPMPPlaneCallbackResult SetRadarData (XPMPPlaneRadar_t &data)
 Handles requests for plane's radar data (doesn't actually change over time) More...
 
XPMPPlaneCallbackResult SetInfoData (XPMPInfoTexts_t &data)
 Handles requests for plane's informational texts. More...
 
XPMPPlaneCallbackResult CBPlaneData (XPMPPlaneID inPlane, XPMPPlaneDataType inDataType, void *ioData, void *)
 Callback function handed to XPMP2, will be called in every drawing frame to deliver plane position and configuration. More...
 
bool ArePlanesCreated ()
 Is any plane object created? More...
 
void PlanesCreate ()
 Create our 3 planes (if they don't exist already) More...
 
void PlanesRemove ()
 Remove all planes. More...
 
void PlanesShowHide ()
 Show/hide the planes (temporarily, without destroying the plane objects) More...
 
void PlanesCycleModels ()
 Cycle the CSL models of the 3 planes. More...
 
void PlanesRematch ()
 Rematch CSL models based on existing definition. More...
 
void MenuUpdateCheckmarks ()
 
void CPRequestAIAgain (void *)
 Callback function for the case that we might get AI access later. More...
 
void CBMenu (void *, void *inItemRef)
 Callback function for menu. More...
 
PLUGIN_API int XPluginStart (char *outName, char *outSig, char *outDesc)
 
PLUGIN_API void XPluginStop (void)
 
PLUGIN_API int XPluginEnable (void)
 
PLUGIN_API void XPluginDisable (void)
 
PLUGIN_API void XPluginReceiveMessage (XPLMPluginID, long inMsg, void *)
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Variables

std::string PLANE_MODEL [3][3]
 
bool gbFreeze = false
 Freeze all movements at the moment? More...
 
constexpr float PLANE_DIST_M = 200.0f
 Distance of our simulated planes to the user's plane's position? [m]. More...
 
constexpr float PLANE_RADIUS_M = 100.0f
 Radius of the circle the planes do [m]. More...
 
constexpr float PLANE_STACK_ALT_M = 50.0f
 Altitude difference to stack the 3 planes one above the other [m]. More...
 
constexpr float PLANE_CIRCLE_TIME_S = 20.0f
 Time it shall take to fly/roll a full circle [seconds]. More...
 
constexpr float PLANE_CIRCLE_TIME_MIN = PLANE_CIRCLE_TIME_S / 60.0f
 Time it shall take to fly/roll a full circle [minutes]. More...
 
constexpr float PLANE_TIRE_CIRCUMFENCE_M = 3.2f
 Assumed circumfence of one plane's tire (rough guess for commercial jet planes) More...
 
constexpr float PLANE_PROP_RPM = 300.0f
 Engine / prop rotation assumptions: rotations per minute. More...
 
constexpr double PI = 3.1415926535897932384626433832795028841971693993751
 PI. More...
 
SampleAircraftpSamplePlane = nullptr
 The one aircraft of this type that we manage. More...
 
LegacySampleAircraftpLegacyPlane = nullptr
 The one aircraft of this type that we manage. More...
 
XPMPPlaneID hStdPlane = 0
 We handle just one aircraft with standard functions, this one: More...
 
XPLMMenuID hMenu = nullptr
 menu id of our plugin's menu More...
 
bool gbVisible = true
 Planes currently visible? More...
 
bool gbMapLabels = true
 Labels currently shown in map view? More...
 
int gModelIdxBase = 0
 for cycling CSL models: what is the index used for the first plane? More...
 
-

Detailed Description

-

Example plugin demonstrating XPMP2 techniques.

-

This plugin creates 3 planes, one with each of the available ways of using the XPMP2 library. All planes move in a circle around a position 200m in front of the user's plane (even if the user plane moves).

-
    -
  1. Subclassing XPMP2::Aircraft, which is the recommended way. This plane flies highest, 100m above the user plane.
  2. -
  3. Subclassing the legacy class XPCAircraft. This plane flies in the middle, 50m above the user plane.
  4. -
  5. Using direct C functions. This plane always rolls on the ground, no matter how high the user plane flies.
  6. -
-

Three menu items are provided:

-
    -
  1. "Toggle Planes" creates/removes the planes.
  2. -
  3. "Toggle Visibility" shows/temporary hides the planes without destroying them.
  4. -
  5. "Cycle Models" changes the CSL model used per plane. Also, it flips the visibility of labels in the map view...just for a change.
  6. -
-

For the plugin to work properly some CSL models are necessary in some folders under Resources (all folders under Resources are scanned for xsb_aircraft.txt file, so the actual structure underneath Resources does not matter).

-

The directory structure would look as follows:
- XPMP2-Sample/
-   lin_x64/
-     XPMP2-Sample.xpl
-   mac_x64/
-     XPMP2-Sample.xpl
-   win_x64/
-     XPMP2-Sample.xpl
-   Resources/
- CSL/ <-- install CSL models here
-     Doc8643.txt
- MapIcons.png
- Obj8DataRefs.txt
-     related.txt
-

Author
Birger Hoppe
- -

Class Documentation

- -

◆ positionTy

- -
-
- - - - -
struct positionTy
-
-

Summarizes the 3 values of a position in the local coordinate system.

-
- - - - - - - - - - -
Class Members
-double -x -
-double -y -
-double -z -
- -
-
-

Enumeration Type Documentation

- -

◆ MenuItemsTy

- -
-
- - - - -
enum MenuItemsTy
-
- -

List of all menu item indexes.

- - - - - - - -
Enumerator
MENU_PLANES 

Menu Item "Toggle Planes".

-
MENU_VISIBLE 

Menu Item "Toggle Visibility".

-
MENU_FREEZE 

Menu Item "Freeze".

-
MENU_CYCLE_MDL 

Menu Item "Cycle Models".

-
MENU_REMATCH_MDL 

Menu Item "Rematch Models".

-
MENU_AI 

Menu Item "Toggle AI control".

-
- -
-
-

Function Documentation

- -

◆ ArePlanesCreated()

- -
-
- - - - - -
- - - - - - - -
bool ArePlanesCreated ()
-
-inline
-
- -

Is any plane object created?

- -
-
- -

◆ CBIntPrefsFunc()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
int CBIntPrefsFunc (const char * ,
[[maybe_unused] ] const char * item,
int defaultVal 
)
-
- -

This is a callback the XPMP2 calls regularly to learn about configuration settings.

- -
-
- -

◆ CBMenu()

- -
-
- - - - - - - - - - - - - - - - - - -
void CBMenu (void * ,
void * inItemRef 
)
-
- -

Callback function for menu.

- -
-
- -

◆ CBPlaneData()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
XPMPPlaneCallbackResult CBPlaneData (XPMPPlaneID inPlane,
XPMPPlaneDataType inDataType,
void * ioData,
void *  
)
-
- -

Callback function handed to XPMP2, will be called in every drawing frame to deliver plane position and configuration.

- -
-
- -

◆ CBPlaneNotifier()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void CBPlaneNotifier (XPMPPlaneID inPlaneID,
XPMPPlaneNotification inNotification,
void *  
)
-
-

This is the callback for the plane notifier function, which just logs some info to Log.txt

Note
Plane notifier functions are completely optional and actually rarely used, because you should know already by other means when your plugin creates/modifies/deletes a plane. So this is for pure demonstration (and testing) purposes.
- -
-
- -

◆ CirclePos()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void CirclePos (positionTypos,
float heading,
float radius 
)
-
- -

Put the position on a circle around itself.

- -
-
- -

◆ ConvLocalToWorld()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ConvLocalToWorld (const positionTypos,
double & lat,
double & lon,
double & alt 
)
-
- -

Convert local position to world coordinates.

- -
-
- -

◆ CPRequestAIAgain()

- -
-
- - - - - - - - -
void CPRequestAIAgain (void * )
-
- -

Callback function for the case that we might get AI access later.

- -
-
- -

◆ deg2rad()

- -
-
- - - - - -
- - - - - - - - -
double deg2rad (const double deg)
-
-inline
-
- -

Convert from degree to radians.

- -
-
- -

◆ FindCenterPos()

- -
-
- - - - - - - - -
positionTy FindCenterPos (float dist)
-
- -

Finds a position 200m in front of the user's plane serving as the center for further operations.

- -
-
- -

◆ GetTimeFragment()

- -
-
- - - - - - - -
float GetTimeFragment ()
-
- -

Returns a number between 0.0 and 1.0, increasing over the course of 10 seconds, then restarting.

- -
-
- -

◆ GetTimeUpDown()

- -
-
- - - - - - - -
float GetTimeUpDown ()
-
- -

Returns a number between 0.0 and 1.0, going up and down over the course of 10 seconds.

- -
-
- -

◆ LogMsg()

- -
-
- - - - - - - - - - - - - - - - - - -
void LogMsg (const char * szMsg,
 ... 
)
-
- -

Log a message to X-Plane's Log.txt with sprintf-style parameters.

- -
-
- -

◆ MenuUpdateCheckmarks()

- -
-
- - - - - - - -
void MenuUpdateCheckmarks ()
-
- -
-
- -

◆ PlanesCreate()

- -
-
- - - - - - - -
void PlanesCreate ()
-
- -

Create our 3 planes (if they don't exist already)

- -
-
- -

◆ PlanesCycleModels()

- -
-
- - - - - - - -
void PlanesCycleModels ()
-
- -

Cycle the CSL models of the 3 planes.

- -
-
- -

◆ PlanesRematch()

- -
-
- - - - - - - -
void PlanesRematch ()
-
- -

Rematch CSL models based on existing definition.

-

This will pick a different (partly random) CSL model for those planes, for which no exact match has been found. The A321 is defined without operator code, so each re-match will pick any of the available A321 models.

- -
-
- -

◆ PlanesRemove()

- -
-
- - - - - - - -
void PlanesRemove ()
-
- -

Remove all planes.

- -
-
- -

◆ PlanesShowHide()

- -
-
- - - - - - - -
void PlanesShowHide ()
-
- -

Show/hide the planes (temporarily, without destroying the plane objects)

- -
-
- -

◆ SetInfoData()

- -
-
- - - - - - - - -
XPMPPlaneCallbackResult SetInfoData (XPMPInfoTexts_tdata)
-
- -

Handles requests for plane's informational texts.

-

Handling this requests is completely optional. The texts are provided on shared dataRefs and used only by few other plugins, one of it is FSTramp.
- Here in the example we keep it simple and just return the ICAO plane type.

See also
LegacySampleAircraft::GetInfoTexts(), which basically is the very same thing.
- -
-
- -

◆ SetPositionData()

- -
-
- - - - - - - - -
XPMPPlaneCallbackResult SetPositionData (XPMPPlanePosition_tdata)
-
- -

Handles requests for plane's position data.

-
See also
LegacySampleAircraft::GetPlanePosition(), which basically is the very same thing.
- -
-
- -

◆ SetRadarData()

- -
-
- - - - - - - - -
XPMPPlaneCallbackResult SetRadarData (XPMPPlaneRadar_tdata)
-
- -

Handles requests for plane's radar data (doesn't actually change over time)

-
See also
LegacySampleAircraft::GetPlaneRadar(), which basically is the very same thing.
- -
-
- -

◆ SetSurfaceData()

- -
-
- - - - - - - - -
XPMPPlaneCallbackResult SetSurfaceData (XPMPPlaneSurfaces_tdata)
-
- -

Handles requests for plane's surface data.

-
See also
LegacySampleAircraft::GetPlaneSurfaces(), which basically is the very same thing.
- -
-
- -

◆ strScpy()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
char* strScpy (char * dest,
const char * src,
size_t size 
)
-
-inline
-
- -

Save string copy.

- -
-
- -

◆ XPluginDisable()

- -
-
- - - - - - - - -
PLUGIN_API void XPluginDisable (void )
-
- -
-
- -

◆ XPluginEnable()

- -
-
- - - - - - - - -
PLUGIN_API int XPluginEnable (void )
-
- -
-
- -

◆ XPluginReceiveMessage()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PLUGIN_API void XPluginReceiveMessage (XPLMPluginID ,
long inMsg,
void *  
)
-
- -
-
- -

◆ XPluginStart()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
PLUGIN_API int XPluginStart (char * outName,
char * outSig,
char * outDesc 
)
-
- -
-
- -

◆ XPluginStop()

- -
-
- - - - - - - - -
PLUGIN_API void XPluginStop (void )
-
- -
-
-

Variable Documentation

- -

◆ gbFreeze

- -
-
- - - - -
bool gbFreeze = false
-
- -

Freeze all movements at the moment?

- -
-
- -

◆ gbMapLabels

- -
-
- - - - -
bool gbMapLabels = true
-
- -

Labels currently shown in map view?

- -
-
- -

◆ gbVisible

- -
-
- - - - -
bool gbVisible = true
-
- -

Planes currently visible?

- -
-
- -

◆ gModelIdxBase

- -
-
- - - - -
int gModelIdxBase = 0
-
- -

for cycling CSL models: what is the index used for the first plane?

- -
-
- -

◆ hMenu

- -
-
- - - - -
XPLMMenuID hMenu = nullptr
-
- -

menu id of our plugin's menu

- -
-
- -

◆ hStdPlane

- -
-
- - - - -
XPMPPlaneID hStdPlane = 0
-
- -

We handle just one aircraft with standard functions, this one:

- -
-
- -

◆ PI

- -
-
- - - - - -
- - - - -
constexpr double PI = 3.1415926535897932384626433832795028841971693993751
-
-constexpr
-
- -

PI.

- -
-
- -

◆ PLANE_CIRCLE_TIME_MIN

- -
-
- - - - - -
- - - - -
constexpr float PLANE_CIRCLE_TIME_MIN = PLANE_CIRCLE_TIME_S / 60.0f
-
-constexpr
-
- -

Time it shall take to fly/roll a full circle [minutes].

- -
-
- -

◆ PLANE_CIRCLE_TIME_S

- -
-
- - - - - -
- - - - -
constexpr float PLANE_CIRCLE_TIME_S = 20.0f
-
-constexpr
-
- -

Time it shall take to fly/roll a full circle [seconds].

- -
-
- -

◆ PLANE_DIST_M

- -
-
- - - - - -
- - - - -
constexpr float PLANE_DIST_M = 200.0f
-
-constexpr
-
- -

Distance of our simulated planes to the user's plane's position? [m].

- -
-
- -

◆ PLANE_MODEL

- -
-
- - - - -
std::string PLANE_MODEL[3][3]
-
-Initial value:
= {
-
{ "DH8A", "BER", "" },
-
{ "B06", "TXB", "" },
-
{ "A321", "", "" },
-
}
-

Initial type / airline / livery to be used to create our 3 planes

See also
https://www.icao.int/publications/DOC8643/Pages/Search.aspx for ICAO aircraft types
-
-https://forums.x-plane.org/index.php?/files/file/37041-bluebell-obj8-csl-packages/ for the Bluebell package, which includes the models named here
- -
-
- -

◆ PLANE_PROP_RPM

- -
-
- - - - - -
- - - - -
constexpr float PLANE_PROP_RPM = 300.0f
-
-constexpr
-
- -

Engine / prop rotation assumptions: rotations per minute.

- -
-
- -

◆ PLANE_RADIUS_M

- -
-
- - - - - -
- - - - -
constexpr float PLANE_RADIUS_M = 100.0f
-
-constexpr
-
- -

Radius of the circle the planes do [m].

- -
-
- -

◆ PLANE_STACK_ALT_M

- -
-
- - - - - -
- - - - -
constexpr float PLANE_STACK_ALT_M = 50.0f
-
-constexpr
-
- -

Altitude difference to stack the 3 planes one above the other [m].

- -
-
- -

◆ PLANE_TIRE_CIRCUMFENCE_M

- -
-
- - - - - -
- - - - -
constexpr float PLANE_TIRE_CIRCUMFENCE_M = 3.2f
-
-constexpr
-
- -

Assumed circumfence of one plane's tire (rough guess for commercial jet planes)

- -
-
- -

◆ pLegacyPlane

- -
-
- - - - -
LegacySampleAircraft* pLegacyPlane = nullptr
-
- -

The one aircraft of this type that we manage.

- -
-
- -

◆ pSamplePlane

- -
-
- - - - -
SampleAircraft* pSamplePlane = nullptr
-
- -

The one aircraft of this type that we manage.

- -
-
-
- - - - diff --git a/docs/html/classLegacySampleAircraft-members.html b/docs/html/classLegacySampleAircraft-members.html deleted file mode 100644 index 9d331d03..00000000 --- a/docs/html/classLegacySampleAircraft-members.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - - -XPMP2: Member List - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-
LegacySampleAircraft Member List
-
-
- -

This is the complete list of members for LegacySampleAircraft, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
acIcaoAirlineXPMP2::Aircraft
acIcaoTypeXPMP2::Aircraft
acInfoTextsXPMP2::Aircraft
acLiveryXPMP2::Aircraft
acPosXPCAircraft
acRadarXPMP2::Aircraft
acRelGrpXPMP2::Aircraftprotected
acSurfacesXPCAircraft
aiPrioXPMP2::Aircraft
Aircraft(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")XPMP2::Aircraft
Aircraft()XPMP2::Aircraft
Aircraft(const Aircraft &)=deleteXPMP2::Aircraft
aSndChXPMP2::Aircraftprotected
AssignModel(const std::string &_cslId, CSLModel *_pCSLModel=nullptr)XPMP2::Aircraft
bChnLowPassXPMP2::Aircraftprotected
bChnMutedXPMP2::Aircraftprotected
bClampToGroundXPMP2::Aircraft
bDrawLabelXPMP2::Aircraft
bOnGrndXPMP2::Aircraft
bRenderXPMP2::Aircraftprotected
bValidXPMP2::Aircraftprotected
bVisibleXPMP2::Aircraftprotected
camBearingXPMP2::Aircraftprotected
camDistXPMP2::Aircraftprotected
camTimLstUpdXPMP2::Aircraftprotected
ChangeModel(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)XPMP2::Aircraft
chnListXPMP2::Aircraftprotected
ChnListTy typedefXPMP2::Aircraft
ClampToGround()XPMP2::Aircraftprotected
colLabelXPMP2::Aircraft
ComputeMapLabel()XPMP2::Aircraftprotectedvirtual
Create(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)XPMP2::Aircraft
CreateInstances()XPMP2::Aircraftprotected
DestroyInstances()XPMP2::Aircraftprotected
DoMove()XPMP2::Aircraftprotected
drawInfoXPMP2::Aircraft
FlightLoopCB(float, float, int, void *)XPMP2::Aircraftprotectedstatic
gearDeflectRatioXPMP2::Aircraft
GetAoA() constXPMP2::Aircraftinlinevirtual
GetCameraBearing() constXPMP2::Aircraftinline
GetCameraDist() constXPMP2::Aircraftinline
GetEngineRotAngle() constXPMP2::Aircraftinline
GetEngineRotAngle(size_t idx) constXPMP2::Aircraftinline
GetEngineRotRad() constXPMP2::Aircraftinline
GetEngineRotRad(size_t idx) constXPMP2::Aircraftinline
GetEngineRotRpm() constXPMP2::Aircraftinline
GetEngineRotRpm(size_t idx) constXPMP2::Aircraftinline
GetFlapRatio() constXPMP2::Aircraftinline
GetFlightId() constXPMP2::Aircraftvirtual
GetGearRatio() constXPMP2::Aircraftinline
GetGS_kn() constXPMP2::Aircraftinline
GetHeading() constXPMP2::Aircraftinline
GetInfoTexts(XPMPInfoTexts_t *outInfoTexts)LegacySampleAircraftinlinevirtual
GetLift() constXPMP2::Aircraftinlinevirtual
GetLightsBeacon() constXPMP2::Aircraftinline
GetLightsLanding() constXPMP2::Aircraftinline
GetLightsNav() constXPMP2::Aircraftinline
GetLightsStrobe() constXPMP2::Aircraftinline
GetLightsTaxi() constXPMP2::Aircraftinline
GetLocation(double &lat, double &lon, double &alt_ft) constXPMP2::Aircraft
GetLocation() constXPMP2::Aircraftinline
GetMass() constXPMP2::Aircraftinline
GetMatchQuality() constXPMP2::Aircraftinline
GetModel() constXPMP2::Aircraftinline
GetModelInfo() constXPMP2::Aircraftinline
GetModelName() constXPMP2::Aircraft
GetModeS_ID() constXPMP2::Aircraftinline
GetNoseGearDeflection() constXPMP2::Aircraftinline
GetNoseWheelAngle() constXPMP2::Aircraftinline
GetPitch() constXPMP2::Aircraftinline
GetPlanePosition(XPMPPlanePosition_t *outPosition)LegacySampleAircraftinlinevirtual
GetPlaneRadar(XPMPPlaneRadar_t *outRadar)LegacySampleAircraftinlinevirtual
GetPlaneSurfaces(XPMPPlaneSurfaces_t *outSurfaces)LegacySampleAircraftinlinevirtual
GetPropRotAngle() constXPMP2::Aircraftinline
GetPropRotRad() constXPMP2::Aircraftinline
GetPropRotRpm() constXPMP2::Aircraftinline
GetReversDeployRatio() constXPMP2::Aircraftinline
GetRoll() constXPMP2::Aircraftinline
GetSlatRatio() constXPMP2::Aircraftinline
GetSpeedbrakeRatio() constXPMP2::Aircraftinline
GetSpoilerRatio() constXPMP2::Aircraftinline
GetTcasTargetIdx() constXPMP2::Aircraftinline
GetThrustRatio() constXPMP2::Aircraftinline
GetThrustReversRatio() constXPMP2::Aircraftinline
GetTireDeflection() constXPMP2::Aircraftinline
GetTireRotAngle() constXPMP2::Aircraftinline
GetTireRotRad() constXPMP2::Aircraftinline
GetTireRotRpm() constXPMP2::Aircraftinline
GetTouchDown() constXPMP2::Aircraftinline
GetVertOfs() constXPMP2::Aircraft
GetWakeCat() constXPMP2::Aircraft
GetWingArea() constXPMP2::Aircraftinline
GetWingSpan() constXPMP2::Aircraftinline
GetWingSweepRatio() constXPMP2::Aircraftinline
GetYokeHeadingRatio() constXPMP2::Aircraftinline
GetYokePitchRatio() constXPMP2::Aircraftinline
GetYokeRollRatio() constXPMP2::Aircraftinline
gs_knXPMP2::Aircraftprotected
hProbeXPMP2::Aircraftprotected
IsCurrentlyShownAsAI() constXPMP2::Aircraft
IsCurrentlyShownAsTcasTarget() constXPMP2::Aircraftinline
IsGroundVehicle() constXPMP2::Aircraft
IsInstanciated() constXPMP2::Aircraftinline
IsOnGrnd() constXPMP2::Aircraftinline
IsRelatedTo(const std::string &_icaoType) constXPMP2::Aircraft
IsRendered() constXPMP2::Aircraftinline
IsValid() constXPMP2::Aircraftinline
IsVisible() constXPMP2::Aircraftinline
labelXPMP2::Aircraft
LegacySampleAircraft(const char *inICAOCode, const char *inAirline, const char *inLivery, XPMPPlaneID _modeS_id=0, const char *inModelName=nullptr)LegacySampleAircraftinline
listInstXPMP2::Aircraftprotected
MapDrawIcon(XPLMMapLayerID inLayer, float acSize)XPMP2::Aircraft
MapDrawLabel(XPLMMapLayerID inLayer, float yOfs)XPMP2::Aircraft
MapFindIcon()XPMP2::Aircraft
mapIconColXPMP2::Aircraftprotected
mapIconRowXPMP2::Aircraftprotected
mapLabelXPMP2::Aircraftprotected
MapPreparePos(XPLMMapProjectionID projection, const float boundsLTRB[4])XPMP2::Aircraft
mapXXPMP2::Aircraftprotected
mapYXPMP2::Aircraftprotected
matchQualityXPMP2::Aircraftprotected
modeS_idXPMP2::Aircraftprotected
operator=(const Aircraft &)=deleteXPMP2::Aircraft
pCSLMdlXPMP2::Aircraftprotected
prev_tsXPMP2::Aircraftprotected
prev_xXPMP2::Aircraftprotected
prev_yXPMP2::Aircraftprotected
prev_zXPMP2::Aircraftprotected
ReMatchModel()XPMP2::Aircraftinline
ResetTcasTargetIdx()XPMP2::Aircraftinline
SetDrawLabel(bool _b)XPMP2::Aircraftinline
SetEngineRotAngle(float _deg)XPMP2::Aircraft
SetEngineRotAngle(size_t idx, float _deg)XPMP2::Aircraft
SetEngineRotRad(float _rad)XPMP2::Aircraft
SetEngineRotRad(size_t idx, float _rad)XPMP2::Aircraft
SetEngineRotRpm(float _rpm)XPMP2::Aircraft
SetEngineRotRpm(size_t idx, float _rpm)XPMP2::Aircraft
SetFlapRatio(float _f)XPMP2::Aircraftinline
SetGearRatio(float _f)XPMP2::Aircraftinline
SetHeading(float _deg)XPMP2::Aircraftinline
SetInvalid()XPMP2::Aircraftvirtual
SetLightsBeacon(bool _b)XPMP2::Aircraftinline
SetLightsLanding(bool _b)XPMP2::Aircraftinline
SetLightsNav(bool _b)XPMP2::Aircraftinline
SetLightsStrobe(bool _b)XPMP2::Aircraftinline
SetLightsTaxi(bool _b)XPMP2::Aircraftinline
SetLocalLoc(float _x, float _y, float _z)XPMP2::Aircraftinline
SetLocation(double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)XPMP2::Aircraftinline
SetLocation(double lat, double lon, double alt_ft)XPMP2::Aircraft
SetMass(float _kg)XPMP2::Aircraftinline
SetNoseGearDeflection(float _mtr)XPMP2::Aircraftinline
SetNoseWheelAngle(float _f)XPMP2::Aircraftinline
SetOnGrnd(bool on_grnd, float setTouchDownTime=NAN)XPMP2::Aircraft
SetPitch(float _deg)XPMP2::Aircraftinline
SetPropRotAngle(float _deg)XPMP2::Aircraftinline
SetPropRotRad(float _rad)XPMP2::Aircraftinline
SetPropRotRpm(float _rpm)XPMP2::Aircraftinline
SetRender(bool _bRender)XPMP2::Aircraftvirtual
SetReversDeployRatio(float _f)XPMP2::Aircraftinline
SetRoll(float _deg)XPMP2::Aircraftinline
SetSlatRatio(float _f)XPMP2::Aircraftinline
SetSpeedbrakeRatio(float _f)XPMP2::Aircraftinline
SetSpoilerRatio(float _f)XPMP2::Aircraftinline
SetTcasTargetIdx(int _idx)XPMP2::Aircraftinlineprotectedvirtual
SetThrustRatio(float _f)XPMP2::Aircraftinline
SetThrustReversRatio(float _f)XPMP2::Aircraftinline
SetTireDeflection(float _mtr)XPMP2::Aircraftinline
SetTireRotAngle(float _deg)XPMP2::Aircraftinline
SetTireRotRad(float _rad)XPMP2::Aircraftinline
SetTireRotRpm(float _rpm)XPMP2::Aircraftinline
SetTouchDown(bool _b)XPMP2::Aircraftinline
SetVisible(bool _bVisible)XPMP2::Aircraftvirtual
SetWingArea(float _m2)XPMP2::Aircraftinline
SetWingSpan(float _m)XPMP2::Aircraftinline
SetWingSweepRatio(float _f)XPMP2::Aircraftinline
SetYokeHeadingRatio(float _f)XPMP2::Aircraftinline
SetYokePitchRatio(float _f)XPMP2::Aircraftinline
SetYokeRollRatio(float _f)XPMP2::Aircraftinline
ShallDrawLabel() constXPMP2::Aircraftinline
ShowAsAIPlane() constXPMP2::Aircraftinline
skipCounterXPMP2::Aircraftprotected
SND_ENG enum valueXPMP2::Aircraft
SND_FLAPS enum valueXPMP2::Aircraft
SND_GEAR enum valueXPMP2::Aircraft
SND_NUM_EVENTS enum valueXPMP2::Aircraft
SND_REVERSE_THRUST enum valueXPMP2::Aircraft
SND_TIRE enum valueXPMP2::Aircraft
sndMinDistXPMP2::Aircraft
SoundEventsTy enum nameXPMP2::Aircraft
SoundGetName(SoundEventsTy sndEvent, float &volAdj) constXPMP2::Aircraftvirtual
SoundMuteAll(bool bMute)XPMP2::Aircraft
SoundPlay(const std::string &sndName, float vol=1.0f)XPMP2::Aircraft
SoundRemoveAll()XPMP2::Aircraftprotectedvirtual
SoundSetup()XPMP2::Aircraftprotectedvirtual
SoundStop(FMOD_CHANNEL *pChn)XPMP2::Aircraft
SoundUpdate()XPMP2::Aircraftprotectedvirtual
SoundVolume(FMOD_CHANNEL *pChn, float vol)XPMP2::Aircraft
tcasTargetIdxXPMP2::Aircraftprotected
tsResetTouchDownXPMP2::Aircraftprotected
UpdateDistBearingCamera(const XPLMCameraPosition_t &posCam)XPMP2::Aircraftprotected
UpdatePosition(float _elapsedSinceLastCall, int _flCounter)XPCAircraftvirtual
vXPMP2::Aircraft
v_xXPMP2::Aircraftprotected
v_yXPMP2::Aircraftprotected
v_zXPMP2::Aircraftprotected
vertOfsRatioXPMP2::Aircraft
wakeXPMP2::Aircraft
WakeApplyDefaults(bool _bOverwriteAllFields=true)XPMP2::Aircraft
XPCAircraft(const char *_icaoType, const char *_icaoAirline, const char *_livery, XPMPPlaneID _modeS_id=0, const char *_modelId=nullptr)XPCAircraft
~Aircraft()XPMP2::Aircraftvirtual
- - - - diff --git a/docs/html/classLegacySampleAircraft.html b/docs/html/classLegacySampleAircraft.html deleted file mode 100644 index 65278131..00000000 --- a/docs/html/classLegacySampleAircraft.html +++ /dev/null @@ -1,881 +0,0 @@ - - - - - - - -XPMP2: LegacySampleAircraft Class Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-Public Member Functions | -List of all members
-
-
LegacySampleAircraft Class Reference
-
-
- -

Subclassing XPCAircraft to create our own class. - More...

-
- + Inheritance diagram for LegacySampleAircraft:
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

 LegacySampleAircraft (const char *inICAOCode, const char *inAirline, const char *inLivery, XPMPPlaneID _modeS_id=0, const char *inModelName=nullptr)
 Constructor just passes on all parameters to library. More...
 
virtual XPMPPlaneCallbackResult GetPlanePosition (XPMPPlanePosition_t *outPosition)
 Called before rendering to query plane's current position, overwritten to provide your implementation. More...
 
virtual XPMPPlaneCallbackResult GetPlaneSurfaces (XPMPPlaneSurfaces_t *outSurfaces)
 Called before rendering to query plane's current configuration, overwritten to provide your implementation. More...
 
virtual XPMPPlaneCallbackResult GetPlaneRadar (XPMPPlaneRadar_t *outRadar)
 Called before rendering to query plane's current radar visibility, overwritten to provide your implementation. More...
 
virtual XPMPPlaneCallbackResult GetInfoTexts (XPMPInfoTexts_t *outInfoTexts)
 Called before rendering to query plane's textual information, overwritten to provide your implementation (optional) More...
 
- Public Member Functions inherited from XPCAircraft
 XPCAircraft (const char *_icaoType, const char *_icaoAirline, const char *_livery, XPMPPlaneID _modeS_id=0, const char *_modelId=nullptr)
 Legacy constructor creates a plane and puts it under control of XPlaneMP. More...
 
virtual void UpdatePosition (float _elapsedSinceLastCall, int _flCounter)
 Just calls all 4 previous Get... functions and copies the provided values into drawInfo and v More...
 
- Public Member Functions inherited from XPMP2::Aircraft
 Aircraft (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")
 Constructor creates a new aircraft object, which will be managed and displayed. More...
 
 Aircraft ()
 Default constructor creates an empty, invalid(!) and invisible shell; call XPMP2::Aircraft::Create() to actually create a plane. More...
 
virtual ~Aircraft ()
 Destructor cleans up all resources acquired. More...
 
 Aircraft (const Aircraft &)=delete
 Aircraft must not be copied as they reference non-copyable resources like XP instances. More...
 
Aircraftoperator= (const Aircraft &)=delete
 Aircraft must not be copied as they reference non-copyable resources like XP instances. More...
 
void Create (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)
 Creates a plane, only a valid operation if object was created using the default constructor. More...
 
XPMPPlaneID GetModeS_ID () const
 return the XPMP2 plane id More...
 
bool IsGroundVehicle () const
 Is this object a ground vehicle? More...
 
bool IsRelatedTo (const std::string &_icaoType) const
 Is this object "related" to the given ICAO code? (named in the same line in related.txt) More...
 
int GetTcasTargetIdx () const
 return the current TCAS target index (into sim/cockpit2/tcas/targets), 1-based, -1 if not used More...
 
bool IsCurrentlyShownAsTcasTarget () const
 Is this plane currently also being tracked as a TCAS target, ie. will appear on TCAS? More...
 
bool IsCurrentlyShownAsAI () const
 Is this plane currently also being tracked by X-Plane's classic AI/multiplayer? More...
 
bool ShowAsAIPlane () const
 Is this plane to be drawn on TCAS? (It will if transponder is not switched off) More...
 
void ResetTcasTargetIdx ()
 Reset TCAS target slot index to -1 More...
 
virtual std::string GetFlightId () const
 Return a value for dataRef .../tcas/target/flight_id. More...
 
int ChangeModel (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)
 (Potentially) changes the plane's model after doing a new match attempt More...
 
int ReMatchModel ()
 Finds a match again, using the existing parameters, eg. after more models have been loaded. More...
 
bool AssignModel (const std::string &_cslId, CSLModel *_pCSLModel=nullptr)
 Assigns the given model. More...
 
XPMP2::CSLModelGetModel () const
 return a pointer to the CSL model in use (Note: The CSLModel structure is not public.) More...
 
const std::string & GetModelName () const
 return the name of the CSL model in use More...
 
CSLModelInfo_t GetModelInfo () const
 return an information structure for the CSL model associated with the aircraft More...
 
int GetMatchQuality () const
 quality of the match with the CSL model More...
 
float GetVertOfs () const
 Vertical offset, ie. the value that needs to be added to drawInfo.y to make the aircraft appear on the ground. More...
 
bool IsValid () const
 Is the a/c object valid? More...
 
virtual void SetInvalid ()
 Mark the plane invalid, e.g. after exceptions occured on the data. More...
 
virtual void SetVisible (bool _bVisible)
 Make the plane (in)visible. More...
 
bool IsVisible () const
 Is the plane visible? More...
 
virtual void SetRender (bool _bRender)
 Switch rendering of the CSL model on or off. More...
 
bool IsRendered () const
 Is this plane to be rendered? More...
 
bool IsInstanciated () const
 Are instances created for this aircraft? More...
 
void SetDrawLabel (bool _b)
 Define if this aircraft's label is to be drawn (provided label drawing is enabled globally) More...
 
bool ShallDrawLabel () const
 Shall this aircraft's label be drawn? More...
 
float GetCameraDist () const
 Distance to camera [m]. More...
 
float GetCameraBearing () const
 Bearing from camera [°]. More...
 
bool IsOnGrnd () const
 Is the aircraft on the ground? More...
 
void SetOnGrnd (bool on_grnd, float setTouchDownTime=NAN)
 Set if the aircraft is on the ground. More...
 
void SetLocation (double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)
 Converts world coordinates to local coordinates, writes to Aircraft::drawInfo. More...
 
void SetLocation (double lat, double lon, double alt_ft)
 Legacy version of above version of SetLocatiion(), here without setting ground flag. More...
 
void GetLocation (double &lat, double &lon, double &alt_ft) const
 Converts aircraft's local coordinates to lat/lon values. More...
 
void SetLocalLoc (float _x, float _y, float _z)
 Sets location in local world coordinates. More...
 
const XPLMDrawInfo_t & GetLocation () const
 Gets all location info (including local coordinates) More...
 
float GetPitch () const
 pitch [degree] More...
 
void SetPitch (float _deg)
 pitch [degree] More...
 
float GetHeading () const
 heading [degree] More...
 
void SetHeading (float _deg)
 heading [degree] More...
 
float GetRoll () const
 roll [degree] More...
 
void SetRoll (float _deg)
 roll [degree] More...
 
float GetGS_kn () const
 Rough estimate of a ground speed based on v_x/z More...
 
float GetGearRatio () const
 Gear deploy ratio. More...
 
void SetGearRatio (float _f)
 Gear deploy ratio. More...
 
float GetNoseWheelAngle () const
 Nose Wheel angle in degrees. More...
 
void SetNoseWheelAngle (float _f)
 Nose Wheel angle in degrees. More...
 
float GetFlapRatio () const
 Flaps deploy ratio. More...
 
void SetFlapRatio (float _f)
 Flaps deploy ratio. More...
 
float GetSpoilerRatio () const
 Spoilers deploy ratio. More...
 
void SetSpoilerRatio (float _f)
 Spoilers deploy ratio. More...
 
float GetSpeedbrakeRatio () const
 Speedbrakes deploy ratio. More...
 
void SetSpeedbrakeRatio (float _f)
 Speedbrakes deploy ratio. More...
 
float GetSlatRatio () const
 Slats deploy ratio. More...
 
void SetSlatRatio (float _f)
 Slats deploy ratio. More...
 
float GetWingSweepRatio () const
 Wing sweep ratio. More...
 
void SetWingSweepRatio (float _f)
 Wing sweep ratio. More...
 
float GetThrustRatio () const
 Thrust ratio. More...
 
void SetThrustRatio (float _f)
 Thrust ratio. More...
 
float GetYokePitchRatio () const
 Yoke pitch ratio. More...
 
void SetYokePitchRatio (float _f)
 Yoke pitch ratio. More...
 
float GetYokeHeadingRatio () const
 Yoke heading ratio. More...
 
void SetYokeHeadingRatio (float _f)
 Yoke heading ratio. More...
 
float GetYokeRollRatio () const
 Yoke roll ratio. More...
 
void SetYokeRollRatio (float _f)
 Yoke roll ratio. More...
 
float GetThrustReversRatio () const
 Thrust reversers ratio. More...
 
void SetThrustReversRatio (float _f)
 Thrust reversers ratio. More...
 
bool GetLightsTaxi () const
 Taxi lights. More...
 
void SetLightsTaxi (bool _b)
 Taxi lights. More...
 
bool GetLightsLanding () const
 Landing lights. More...
 
void SetLightsLanding (bool _b)
 Landing lights. More...
 
bool GetLightsBeacon () const
 Beacon lights. More...
 
void SetLightsBeacon (bool _b)
 Beacon lights. More...
 
bool GetLightsStrobe () const
 Strobe lights. More...
 
void SetLightsStrobe (bool _b)
 Strobe lights. More...
 
bool GetLightsNav () const
 Navigation lights. More...
 
void SetLightsNav (bool _b)
 Navigation lights. More...
 
float GetNoseGearDeflection () const
 Vertical nose gear deflection [meter]. More...
 
void SetNoseGearDeflection (float _mtr)
 Vertical nose gear deflection [meter]. More...
 
float GetTireDeflection () const
 Vertical (main) gear deflection [meter]. More...
 
void SetTireDeflection (float _mtr)
 Vertical (main) gear deflection [meter]. More...
 
float GetTireRotAngle () const
 Tire rotation angle [degree]. More...
 
void SetTireRotAngle (float _deg)
 Tire rotation angle [degree]. More...
 
float GetTireRotRpm () const
 Tire rotation speed [rpm]. More...
 
void SetTireRotRpm (float _rpm)
 
float GetTireRotRad () const
 Tire rotation speed [rad/s]. More...
 
void SetTireRotRad (float _rad)
 
float GetEngineRotAngle () const
 Engine rotation angle [degree]. More...
 
void SetEngineRotAngle (float _deg)
 Engine rotation angle [degree], also sets engines 1..4. More...
 
float GetEngineRotRpm () const
 Engine rotation speed [rpm]. More...
 
void SetEngineRotRpm (float _rpm)
 Engine rotation speed [rpm], also sets [rad/s] and engines 1..4. More...
 
float GetEngineRotRad () const
 Engine rotation speed [rad/s]. More...
 
void SetEngineRotRad (float _rad)
 Engine rotation speed [rad/s], also sets [rpm] and engines 1..4. More...
 
float GetEngineRotAngle (size_t idx) const
 < Engine rotation angle [degree] for engine idx (1..4) More...
 
void SetEngineRotAngle (size_t idx, float _deg)
 Engine rotation angle [degree] for engine idx (1..4) More...
 
float GetEngineRotRpm (size_t idx) const
 < Engine rotation speed [rpm] for engine idx (1..4) More...
 
void SetEngineRotRpm (size_t idx, float _rpm)
 Engine rotation speed [rpm] for engine idx (1..4), also sets [rad/s]. More...
 
float GetEngineRotRad (size_t idx) const
 < Engine rotation speed [rad/s] for engine idx (1..4) More...
 
void SetEngineRotRad (size_t idx, float _rad)
 Engine rotation speed [rad/s] for engine idx (1..4), also sets [rpm]. More...
 
float GetPropRotAngle () const
 Propellor rotation angle [degree]. More...
 
void SetPropRotAngle (float _deg)
 Propellor rotation angle [degree]. More...
 
float GetPropRotRpm () const
 Propellor rotation speed [rpm]. More...
 
void SetPropRotRpm (float _rpm)
 
float GetPropRotRad () const
 Propellor rotation speed [rad/s]. More...
 
void SetPropRotRad (float _rad)
 
float GetReversDeployRatio () const
 Thrust reversers deploy ratio. More...
 
void SetReversDeployRatio (float _f)
 Thrust reversers deploy ratio. More...
 
bool GetTouchDown () const
 Moment of touch down. More...
 
void SetTouchDown (bool _b)
 Moment of touch down. More...
 
void WakeApplyDefaults (bool _bOverwriteAllFields=true)
 Fill in default wake turbulence support data based on Doc8643 wake turbulence category. More...
 
float GetWingSpan () const
 Wing span [m]. More...
 
void SetWingSpan (float _m)
 Wing span [m]. More...
 
float GetWingArea () const
 Wing area [m²]. More...
 
void SetWingArea (float _m2)
 Wing area [m²]. More...
 
int GetWakeCat () const
 Category between 0=light and 3=Super, derived from WTC. More...
 
float GetMass () const
 Mass [kg]. More...
 
void SetMass (float _kg)
 Mass [kg]. More...
 
virtual float GetAoA () const
 Angle of Attach, returns pitch (but you can override in your class) More...
 
virtual float GetLift () const
 Lift produced. You should override to blend in/out for take-off/landing, but XPMP2 has no dynamic info of your plane, not even an on-the-ground flag. More...
 
void MapFindIcon ()
 Determine which map icon to use for this aircraft. More...
 
void MapPreparePos (XPLMMapProjectionID projection, const float boundsLTRB[4])
 Prepare map coordinates. More...
 
void MapDrawIcon (XPLMMapLayerID inLayer, float acSize)
 Actually draw the map icon. More...
 
void MapDrawLabel (XPLMMapLayerID inLayer, float yOfs)
 Actually draw the map label. More...
 
FMOD_CHANNEL * SoundPlay (const std::string &sndName, float vol=1.0f)
 Play a sound; a looping sound plays until explicitely stopped. More...
 
void SoundStop (FMOD_CHANNEL *pChn)
 Stop a continuously playing sound. More...
 
void SoundVolume (FMOD_CHANNEL *pChn, float vol)
 Sets the sound's volume (after applying master volume and Sound File's adjustments) More...
 
void SoundMuteAll (bool bMute)
 Mute/Unmute all sounds of the airplane temporarily. More...
 
virtual std::string SoundGetName (SoundEventsTy sndEvent, float &volAdj) const
 Returns the name of the sound to play per event. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Additional Inherited Members

- Public Types inherited from XPMP2::Aircraft
enum  SoundEventsTy {
-  SND_ENG = 0 -, SND_REVERSE_THRUST -, SND_TIRE -, SND_GEAR -,
-  SND_FLAPS -, SND_NUM_EVENTS -
- }
 Types of sound supported directly by XPMP2. More...
 
typedef std::list< FMOD_CHANNEL * > ChnListTy
 List of FMOD channels, also beyond sounds created for SoundEvetsTy. More...
 
- Public Attributes inherited from XPCAircraft
XPMPPlanePosition_t acPos
 Last position data. GetPlanePosition() passes a pointer to this member variable. More...
 
XPMPPlaneSurfaces_t acSurfaces
 Last surface data. GetPlaneSurfaces() passes a pointer to this member variable. More...
 
- Public Attributes inherited from XPMP2::Aircraft
std::string acIcaoType
 ICAO aircraft type designator of this plane. More...
 
std::string acIcaoAirline
 ICAO Airline code of this plane. More...
 
std::string acLivery
 Livery code of this plane. More...
 
XPLMDrawInfo_t drawInfo
 Holds position (in local coordinates!) and orientation (pitch, heading roll) of the aircraft. More...
 
bool bOnGrnd = false
 Is the aircraft on the ground? More...
 
std::vector< float > v
 actual dataRef values to be provided to the CSL model More...
 
std::string label
 aircraft label shown in the 3D world next to the plane More...
 
float colLabel [4] = {1.0f,1.0f,0.0f,1.0f}
 label base color (RGB) More...
 
bool bDrawLabel = true
 Shall this aircraft's label be drawn? More...
 
float vertOfsRatio = 1.0f
 How much of the vertical offset shall be applied? (This allows phasing out the vertical offset in higher altitudes.) [0..1]. More...
 
float gearDeflectRatio = 0.5f
 By how much of the gear deflection shall the plane's altitude be reduced? More...
 
bool bClampToGround = false
 Shall this plane be clamped to ground (ie. never sink below ground)? More...
 
int aiPrio = 1
 Priority for display in one of the limited number of TCAS target slots. More...
 
XPMPPlaneRadar_t acRadar
 Current radar status. More...
 
struct XPMP2::Aircraft::wakeTy wake
 wake-support data More...
 
XPMPInfoTexts_t acInfoTexts
 Informational texts passed on via multiplayer shared dataRefs. More...
 
int sndMinDist = 50.0
 Minimum distance in [m] to play sound in full volume, the larger the 'louder' the aircraft. More...
 
- Protected Member Functions inherited from XPMP2::Aircraft
void DoMove ()
 Internal: This puts the instance into XP's sky and makes it move. More...
 
void UpdateDistBearingCamera (const XPLMCameraPosition_t &posCam)
 Internal: Update the plane's distance/bearing from the camera location. More...
 
void ClampToGround ()
 Clamp to ground: Make sure the plane is not below ground, corrects Aircraft::drawInfo if needed. More...
 
bool CreateInstances ()
 Create the instances required to represent the plane, return if successful. More...
 
void DestroyInstances ()
 Destroy all instances. More...
 
virtual void ComputeMapLabel ()
 Put together the map label. More...
 
virtual void SetTcasTargetIdx (int _idx)
 Define the TCAS target index in use. More...
 
virtual void SoundSetup ()
 Sound-related initializations, called by Create() and ChangeModel() More...
 
virtual void SoundUpdate ()
 Update sound, like position and volume, called once per frame. More...
 
virtual void SoundRemoveAll ()
 Remove all sound, e.g. during destruction. More...
 
- Static Protected Member Functions inherited from XPMP2::Aircraft
static float FlightLoopCB (float, float, int, void *)
 Internal: Flight loop callback function controlling update and movement of all planes. More...
 
- Protected Attributes inherited from XPMP2::Aircraft
XPMPPlaneID modeS_id = 0
 A plane is uniquely identified by a 24bit number [0x01..0xFFFFFF]. More...
 
bool bValid = true
 is this object valid? (Will be reset in case of exceptions) More...
 
bool bVisible = true
 Shall this plane be drawn at the moment and be visible to TCAS/interfaces? More...
 
bool bRender = true
 Shall the CSL model be drawn in 3D world? (if !bRender && bVivile then still visible on TCAS/interfaces, Remote Client uses this for local senders' planes to take over TCAS but not drawing) More...
 
XPMP2::CSLModelpCSLMdl = nullptr
 the CSL model in use More...
 
int matchQuality = -1
 quality of the match with the CSL model More...
 
int acRelGrp = 0
 related group, ie. line in related.txt in which this a/c appears, if any More...
 
float prev_x = 0.0f
 
float prev_y = 0.0f
 
float prev_z = 0.0f
 
float prev_ts = 0.0f
 last update of prev_x/y/z in XP's network time More...
 
float v_x = 0.0f
 
float v_y = 0.0f
 
float v_z = 0.0f
 Cartesian velocity in m/s per axis. More...
 
float gs_kn = 0.0f
 
float tsResetTouchDown = NAN
 ground speed in [kn] based on above v_x/z More...
 
std::list< XPLMInstanceRef > listInst
 X-Plane instance handles for all objects making up the model. More...
 
int tcasTargetIdx = -1
 Which sim/cockpit2/tcas/targets-index does this plane occupy? [1..63], -1 if none. More...
 
float camTimLstUpd = 0.0f
 Timestamp of last update of camera dist/bearing. More...
 
float camDist = 0.0f
 Distance to camera in meters (updated internally regularly) More...
 
float camBearing = 0.0f
 Bearing from camera in degrees (updated internally regularly) More...
 
XPLMProbeRef hProbe = nullptr
 Y Probe for terrain testing, needed in ground clamping. More...
 
int mapIconRow = 0
 map icon coordinates, row More...
 
int mapIconCol = 0
 map icon coordinates, column More...
 
float mapX = 0.0f
 temporary: map coordinates (NAN = not to be drawn) More...
 
float mapY = 0.0f
 temporary: map coordinates (NAN = not to be drawn) More...
 
std::string mapLabel
 label for map drawing More...
 
SndChTy aSndCh [SND_NUM_EVENTS]
 Operational values per sound channel, that is triggered by a standard sound event. More...
 
bool bChnLowPass = false
 Is Low Pass Filter currently being active? More...
 
bool bChnMuted = false
 Is sound for this aircraft currently muted? More...
 
ChnListTy chnList
 List of channels produced via calls to SoundPlay() More...
 
int skipCounter = 0
 Counts how often we skipped expensive computations. More...
 
-

Detailed Description

-

Subclassing XPCAircraft to create our own class.

-

Constructor & Destructor Documentation

- -

◆ LegacySampleAircraft()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LegacySampleAircraft::LegacySampleAircraft (const char * inICAOCode,
const char * inAirline,
const char * inLivery,
XPMPPlaneID _modeS_id = 0,
const char * inModelName = nullptr 
)
-
-inline
-
- -

Constructor just passes on all parameters to library.

- -
-
-

Member Function Documentation

- -

◆ GetInfoTexts()

- -
-
- - - - - -
- - - - - - - - -
virtual XPMPPlaneCallbackResult LegacySampleAircraft::GetInfoTexts (XPMPInfoTexts_toutInfoTexts)
-
-inlinevirtual
-
- -

Called before rendering to query plane's textual information, overwritten to provide your implementation (optional)

-

Handling this requests is completely optional. The texts are provided on shared dataRefs and used only by few other plugins, one of it is FSTramp.
- Here in the example we keep it simple and just return some known data.

- -

Reimplemented from XPCAircraft.

- -
-
- -

◆ GetPlanePosition()

- -
-
- - - - - -
- - - - - - - - -
virtual XPMPPlaneCallbackResult LegacySampleAircraft::GetPlanePosition (XPMPPlanePosition_toutPosition)
-
-inlinevirtual
-
- -

Called before rendering to query plane's current position, overwritten to provide your implementation.

- -

Implements XPCAircraft.

- -
-
- -

◆ GetPlaneRadar()

- -
-
- - - - - -
- - - - - - - - -
virtual XPMPPlaneCallbackResult LegacySampleAircraft::GetPlaneRadar (XPMPPlaneRadar_toutRadar)
-
-inlinevirtual
-
- -

Called before rendering to query plane's current radar visibility, overwritten to provide your implementation.

- -

Implements XPCAircraft.

- -
-
- -

◆ GetPlaneSurfaces()

- -
-
- - - - - -
- - - - - - - - -
virtual XPMPPlaneCallbackResult LegacySampleAircraft::GetPlaneSurfaces (XPMPPlaneSurfaces_toutSurfaces)
-
-inlinevirtual
-
- -

Called before rendering to query plane's current configuration, overwritten to provide your implementation.

- -

Implements XPCAircraft.

- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/docs/html/classLegacySampleAircraft.png b/docs/html/classLegacySampleAircraft.png deleted file mode 100644 index aa1262b0..00000000 Binary files a/docs/html/classLegacySampleAircraft.png and /dev/null differ diff --git a/docs/html/classRemoteAC-members.html b/docs/html/classRemoteAC-members.html deleted file mode 100644 index 24b4e457..00000000 --- a/docs/html/classRemoteAC-members.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - -XPMP2: Member List - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-
RemoteAC Member List
-
-
- -

This is the complete list of members for RemoteAC, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
acIcaoAirlineXPMP2::Aircraft
acIcaoTypeXPMP2::Aircraft
acInfoTextsXPMP2::Aircraft
acLiveryXPMP2::Aircraft
acRadarXPMP2::Aircraft
acRelGrpXPMP2::Aircraftprotected
aiPrioXPMP2::Aircraft
Aircraft(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")XPMP2::Aircraft
Aircraft()XPMP2::Aircraft
Aircraft(const Aircraft &)=deleteXPMP2::Aircraft
alt_ftRemoteACprotected
aSndChXPMP2::Aircraftprotected
AssignModel(const std::string &_cslId, CSLModel *_pCSLModel=nullptr)XPMP2::Aircraft
bChnLowPassXPMP2::Aircraftprotected
bChnMutedXPMP2::Aircraftprotected
bClampToGroundXPMP2::Aircraft
bCSLModelChangedRemoteACprotected
bDeleteMeRemoteACprotected
bDrawLabelXPMP2::Aircraft
bOnGrndXPMP2::Aircraft
bRenderXPMP2::Aircraftprotected
bValidXPMP2::Aircraftprotected
bVisibleXPMP2::Aircraftprotected
bWorldCoordUpdatedRemoteACprotected
camBearingXPMP2::Aircraftprotected
camDistXPMP2::Aircraftprotected
camTimLstUpdXPMP2::Aircraftprotected
ChangeModel(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)XPMP2::Aircraft
chnListXPMP2::Aircraftprotected
ChnListTy typedefXPMP2::Aircraft
ClampToGround()XPMP2::Aircraftprotected
colLabelXPMP2::Aircraft
ComputeMapLabel()XPMP2::Aircraftprotectedvirtual
Create()RemoteAC
XPMP2::Aircraft::Create(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)XPMP2::Aircraft
CreateInstances()XPMP2::Aircraftprotected
DestroyInstances()XPMP2::Aircraftprotected
diffTimeRemoteACprotected
DoMove()XPMP2::Aircraftprotected
drawInfoXPMP2::Aircraft
FlightLoopCB(float, float, int, void *)XPMP2::Aircraftprotectedstatic
gearDeflectRatioXPMP2::Aircraft
GetAoA() constXPMP2::Aircraftinlinevirtual
GetCameraBearing() constXPMP2::Aircraftinline
GetCameraDist() constXPMP2::Aircraftinline
GetEngineRotAngle() constXPMP2::Aircraftinline
GetEngineRotAngle(size_t idx) constXPMP2::Aircraftinline
GetEngineRotRad() constXPMP2::Aircraftinline
GetEngineRotRad(size_t idx) constXPMP2::Aircraftinline
GetEngineRotRpm() constXPMP2::Aircraftinline
GetEngineRotRpm(size_t idx) constXPMP2::Aircraftinline
GetFlapRatio() constXPMP2::Aircraftinline
GetFlightId() constXPMP2::Aircraftvirtual
GetGearRatio() constXPMP2::Aircraftinline
GetGS_kn() constXPMP2::Aircraftinline
GetHeading() constXPMP2::Aircraftinline
GetLift() constXPMP2::Aircraftinlinevirtual
GetLightsBeacon() constXPMP2::Aircraftinline
GetLightsLanding() constXPMP2::Aircraftinline
GetLightsNav() constXPMP2::Aircraftinline
GetLightsStrobe() constXPMP2::Aircraftinline
GetLightsTaxi() constXPMP2::Aircraftinline
GetLocation(double &lat, double &lon, double &alt_ft) constXPMP2::Aircraft
GetLocation() constXPMP2::Aircraftinline
GetMass() constXPMP2::Aircraftinline
GetMatchQuality() constXPMP2::Aircraftinline
GetModel() constXPMP2::Aircraftinline
GetModelInfo() constXPMP2::Aircraftinline
GetModelName() constXPMP2::Aircraft
GetModeS_ID() constXPMP2::Aircraftinline
GetNoseGearDeflection() constXPMP2::Aircraftinline
GetNoseWheelAngle() constXPMP2::Aircraftinline
GetPitch() constXPMP2::Aircraftinline
GetPropRotAngle() constXPMP2::Aircraftinline
GetPropRotRad() constXPMP2::Aircraftinline
GetPropRotRpm() constXPMP2::Aircraftinline
GetReversDeployRatio() constXPMP2::Aircraftinline
GetRoll() constXPMP2::Aircraftinline
GetSlatRatio() constXPMP2::Aircraftinline
GetSpeedbrakeRatio() constXPMP2::Aircraftinline
GetSpoilerRatio() constXPMP2::Aircraftinline
GetTcasTargetIdx() constXPMP2::Aircraftinline
GetThrustRatio() constXPMP2::Aircraftinline
GetThrustReversRatio() constXPMP2::Aircraftinline
GetTireDeflection() constXPMP2::Aircraftinline
GetTireRotAngle() constXPMP2::Aircraftinline
GetTireRotRad() constXPMP2::Aircraftinline
GetTireRotRpm() constXPMP2::Aircraftinline
GetTouchDown() constXPMP2::Aircraftinline
GetVertOfs() constXPMP2::Aircraft
GetWakeCat() constXPMP2::Aircraft
GetWingArea() constXPMP2::Aircraftinline
GetWingSpan() constXPMP2::Aircraftinline
GetWingSweepRatio() constXPMP2::Aircraftinline
GetYokeHeadingRatio() constXPMP2::Aircraftinline
GetYokePitchRatio() constXPMP2::Aircraftinline
GetYokeRollRatio() constXPMP2::Aircraftinline
gs_knXPMP2::Aircraftprotected
histPosRemoteACprotected
histTsRemoteACprotected
hProbeXPMP2::Aircraftprotected
IsCurrentlyShownAsAI() constXPMP2::Aircraft
IsCurrentlyShownAsTcasTarget() constXPMP2::Aircraftinline
IsGroundVehicle() constXPMP2::Aircraft
IsInstanciated() constXPMP2::Aircraftinline
IsOnGrnd() constXPMP2::Aircraftinline
IsRelatedTo(const std::string &_icaoType) constXPMP2::Aircraft
IsRendered() constXPMP2::Aircraftinline
IsToBeDeleted() constRemoteACinline
IsValid() constXPMP2::Aircraftinline
IsVisible() constXPMP2::Aircraftinline
labelXPMP2::Aircraft
latRemoteACprotected
listInstXPMP2::Aircraftprotected
lonRemoteACprotected
MapDrawIcon(XPLMMapLayerID inLayer, float acSize)XPMP2::Aircraft
MapDrawLabel(XPLMMapLayerID inLayer, float yOfs)XPMP2::Aircraft
MapFindIcon()XPMP2::Aircraft
mapIconColXPMP2::Aircraftprotected
mapIconRowXPMP2::Aircraftprotected
mapLabelXPMP2::Aircraftprotected
MapPreparePos(XPLMMapProjectionID projection, const float boundsLTRB[4])XPMP2::Aircraft
mapXXPMP2::Aircraftprotected
mapYXPMP2::Aircraftprotected
MarkForDeletion()RemoteACinline
matchQualityXPMP2::Aircraftprotected
modeS_idXPMP2::Aircraftprotected
operator=(const Aircraft &)=deleteXPMP2::Aircraft
pCSLMdlXPMP2::Aircraftprotected
pkgHashRemoteACprotected
prev_tsXPMP2::Aircraftprotected
prev_xXPMP2::Aircraftprotected
prev_yXPMP2::Aircraftprotected
prev_zXPMP2::Aircraftprotected
ReMatchModel()XPMP2::Aircraftinline
RemoteAC(SenderTy &_sender, const XPMP2::RemoteAcDetailTy &_acDetails)RemoteAC
ResetTcasTargetIdx()XPMP2::Aircraftinline
senderRemoteACprotected
senderIdRemoteACprotected
SetDrawLabel(bool _b)XPMP2::Aircraftinline
SetEngineRotAngle(float _deg)XPMP2::Aircraft
SetEngineRotAngle(size_t idx, float _deg)XPMP2::Aircraft
SetEngineRotRad(float _rad)XPMP2::Aircraft
SetEngineRotRad(size_t idx, float _rad)XPMP2::Aircraft
SetEngineRotRpm(float _rpm)XPMP2::Aircraft
SetEngineRotRpm(size_t idx, float _rpm)XPMP2::Aircraft
SetFlapRatio(float _f)XPMP2::Aircraftinline
SetGearRatio(float _f)XPMP2::Aircraftinline
SetHeading(float _deg)XPMP2::Aircraftinline
SetInvalid()XPMP2::Aircraftvirtual
SetLightsBeacon(bool _b)XPMP2::Aircraftinline
SetLightsLanding(bool _b)XPMP2::Aircraftinline
SetLightsNav(bool _b)XPMP2::Aircraftinline
SetLightsStrobe(bool _b)XPMP2::Aircraftinline
SetLightsTaxi(bool _b)XPMP2::Aircraftinline
SetLocalLoc(float _x, float _y, float _z)XPMP2::Aircraftinline
SetLocation(double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)XPMP2::Aircraftinline
SetLocation(double lat, double lon, double alt_ft)XPMP2::Aircraft
SetMass(float _kg)XPMP2::Aircraftinline
SetNoseGearDeflection(float _mtr)XPMP2::Aircraftinline
SetNoseWheelAngle(float _f)XPMP2::Aircraftinline
SetOnGrnd(bool on_grnd, float setTouchDownTime=NAN)XPMP2::Aircraft
SetPitch(float _deg)XPMP2::Aircraftinline
SetPropRotAngle(float _deg)XPMP2::Aircraftinline
SetPropRotRad(float _rad)XPMP2::Aircraftinline
SetPropRotRpm(float _rpm)XPMP2::Aircraftinline
SetRender(bool _bRender)XPMP2::Aircraftvirtual
SetReversDeployRatio(float _f)XPMP2::Aircraftinline
SetRoll(float _deg)XPMP2::Aircraftinline
SetSlatRatio(float _f)XPMP2::Aircraftinline
SetSpeedbrakeRatio(float _f)XPMP2::Aircraftinline
SetSpoilerRatio(float _f)XPMP2::Aircraftinline
SetTcasTargetIdx(int _idx)XPMP2::Aircraftinlineprotectedvirtual
SetThrustRatio(float _f)XPMP2::Aircraftinline
SetThrustReversRatio(float _f)XPMP2::Aircraftinline
SetTireDeflection(float _mtr)XPMP2::Aircraftinline
SetTireRotAngle(float _deg)XPMP2::Aircraftinline
SetTireRotRad(float _rad)XPMP2::Aircraftinline
SetTireRotRpm(float _rpm)XPMP2::Aircraftinline
SetTouchDown(bool _b)XPMP2::Aircraftinline
SetVisible(bool _bVisible)XPMP2::Aircraftvirtual
SetWingArea(float _m2)XPMP2::Aircraftinline
SetWingSpan(float _m)XPMP2::Aircraftinline
SetWingSweepRatio(float _f)XPMP2::Aircraftinline
SetYokeHeadingRatio(float _f)XPMP2::Aircraftinline
SetYokePitchRatio(float _f)XPMP2::Aircraftinline
SetYokeRollRatio(float _f)XPMP2::Aircraftinline
ShallDrawLabel() constXPMP2::Aircraftinline
ShowAsAIPlane() constXPMP2::Aircraftinline
skipCounterXPMP2::Aircraftprotected
SND_ENG enum valueXPMP2::Aircraft
SND_FLAPS enum valueXPMP2::Aircraft
SND_GEAR enum valueXPMP2::Aircraft
SND_NUM_EVENTS enum valueXPMP2::Aircraft
SND_REVERSE_THRUST enum valueXPMP2::Aircraft
SND_TIRE enum valueXPMP2::Aircraft
sndMinDistXPMP2::Aircraft
SoundEventsTy enum nameXPMP2::Aircraft
SoundGetName(SoundEventsTy sndEvent, float &volAdj) constXPMP2::Aircraftvirtual
SoundMuteAll(bool bMute)XPMP2::Aircraft
SoundPlay(const std::string &sndName, float vol=1.0f)XPMP2::Aircraft
SoundRemoveAll()XPMP2::Aircraftprotectedvirtual
SoundSetup()XPMP2::Aircraftprotectedvirtual
SoundStop(FMOD_CHANNEL *pChn)XPMP2::Aircraft
SoundUpdate()XPMP2::Aircraftprotectedvirtual
SoundVolume(FMOD_CHANNEL *pChn, float vol)XPMP2::Aircraft
sShortIdRemoteACprotected
tcasTargetIdxXPMP2::Aircraftprotected
tsResetTouchDownXPMP2::Aircraftprotected
Update(const XPMP2::RemoteAcDetailTy &_acDetails)RemoteAC
Update(const XPMP2::RemoteAcPosUpdateTy &_acPosUpd)RemoteAC
Update(const XPMP2::RemoteAcAnimTy &_acAnim)RemoteAC
UpdateDistBearingCamera(const XPLMCameraPosition_t &posCam)XPMP2::Aircraftprotected
UpdatePosition(float, int) overrideRemoteACvirtual
vXPMP2::Aircraft
v_xXPMP2::Aircraftprotected
v_yXPMP2::Aircraftprotected
v_zXPMP2::Aircraftprotected
vertOfsRatioXPMP2::Aircraft
wakeXPMP2::Aircraft
WakeApplyDefaults(bool _bOverwriteAllFields=true)XPMP2::Aircraft
~Aircraft()XPMP2::Aircraftvirtual
~RemoteAC()RemoteACvirtual
- - - - diff --git a/docs/html/classRemoteAC.html b/docs/html/classRemoteAC.html deleted file mode 100644 index 87afdb14..00000000 --- a/docs/html/classRemoteAC.html +++ /dev/null @@ -1,1284 +0,0 @@ - - - - - - - -XPMP2: RemoteAC Class Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-Public Member Functions | -Protected Attributes | -List of all members
-
-
RemoteAC Class Reference
-
-
- -

Representation of a remote aircraft. - More...

- -

#include <Client.h>

-
- + Inheritance diagram for RemoteAC:
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

 RemoteAC (SenderTy &_sender, const XPMP2::RemoteAcDetailTy &_acDetails)
 Constructor for use in network thread: Does not Create the aircraft but only stores the passed information. More...
 
virtual ~RemoteAC ()
 Destructor. More...
 
void Create ()
 Actually create the aircraft, ultimately calls XPMP2::Aircraft::Create() More...
 
void Update (const XPMP2::RemoteAcDetailTy &_acDetails)
 Update data from an a/c detail structure. More...
 
void Update (const XPMP2::RemoteAcPosUpdateTy &_acPosUpd)
 Update data from an a/c position update. More...
 
void Update (const XPMP2::RemoteAcAnimTy &_acAnim)
 Update data from an a/c animation dataRefs message. More...
 
void UpdatePosition (float, int) override
 Called by XPMP2 for position updates, extrapolates from historic positions. More...
 
void MarkForDeletion ()
 Mark this aircraft as to-be-deleted in the next flight loop (can't do in worker thread) More...
 
bool IsToBeDeleted () const
 To be deleted? More...
 
- Public Member Functions inherited from XPMP2::Aircraft
 Aircraft (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")
 Constructor creates a new aircraft object, which will be managed and displayed. More...
 
 Aircraft ()
 Default constructor creates an empty, invalid(!) and invisible shell; call XPMP2::Aircraft::Create() to actually create a plane. More...
 
virtual ~Aircraft ()
 Destructor cleans up all resources acquired. More...
 
 Aircraft (const Aircraft &)=delete
 Aircraft must not be copied as they reference non-copyable resources like XP instances. More...
 
Aircraftoperator= (const Aircraft &)=delete
 Aircraft must not be copied as they reference non-copyable resources like XP instances. More...
 
void Create (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)
 Creates a plane, only a valid operation if object was created using the default constructor. More...
 
XPMPPlaneID GetModeS_ID () const
 return the XPMP2 plane id More...
 
bool IsGroundVehicle () const
 Is this object a ground vehicle? More...
 
bool IsRelatedTo (const std::string &_icaoType) const
 Is this object "related" to the given ICAO code? (named in the same line in related.txt) More...
 
int GetTcasTargetIdx () const
 return the current TCAS target index (into sim/cockpit2/tcas/targets), 1-based, -1 if not used More...
 
bool IsCurrentlyShownAsTcasTarget () const
 Is this plane currently also being tracked as a TCAS target, ie. will appear on TCAS? More...
 
bool IsCurrentlyShownAsAI () const
 Is this plane currently also being tracked by X-Plane's classic AI/multiplayer? More...
 
bool ShowAsAIPlane () const
 Is this plane to be drawn on TCAS? (It will if transponder is not switched off) More...
 
void ResetTcasTargetIdx ()
 Reset TCAS target slot index to -1 More...
 
virtual std::string GetFlightId () const
 Return a value for dataRef .../tcas/target/flight_id. More...
 
int ChangeModel (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)
 (Potentially) changes the plane's model after doing a new match attempt More...
 
int ReMatchModel ()
 Finds a match again, using the existing parameters, eg. after more models have been loaded. More...
 
bool AssignModel (const std::string &_cslId, CSLModel *_pCSLModel=nullptr)
 Assigns the given model. More...
 
XPMP2::CSLModelGetModel () const
 return a pointer to the CSL model in use (Note: The CSLModel structure is not public.) More...
 
const std::string & GetModelName () const
 return the name of the CSL model in use More...
 
CSLModelInfo_t GetModelInfo () const
 return an information structure for the CSL model associated with the aircraft More...
 
int GetMatchQuality () const
 quality of the match with the CSL model More...
 
float GetVertOfs () const
 Vertical offset, ie. the value that needs to be added to drawInfo.y to make the aircraft appear on the ground. More...
 
bool IsValid () const
 Is the a/c object valid? More...
 
virtual void SetInvalid ()
 Mark the plane invalid, e.g. after exceptions occured on the data. More...
 
virtual void SetVisible (bool _bVisible)
 Make the plane (in)visible. More...
 
bool IsVisible () const
 Is the plane visible? More...
 
virtual void SetRender (bool _bRender)
 Switch rendering of the CSL model on or off. More...
 
bool IsRendered () const
 Is this plane to be rendered? More...
 
bool IsInstanciated () const
 Are instances created for this aircraft? More...
 
void SetDrawLabel (bool _b)
 Define if this aircraft's label is to be drawn (provided label drawing is enabled globally) More...
 
bool ShallDrawLabel () const
 Shall this aircraft's label be drawn? More...
 
float GetCameraDist () const
 Distance to camera [m]. More...
 
float GetCameraBearing () const
 Bearing from camera [°]. More...
 
bool IsOnGrnd () const
 Is the aircraft on the ground? More...
 
void SetOnGrnd (bool on_grnd, float setTouchDownTime=NAN)
 Set if the aircraft is on the ground. More...
 
void SetLocation (double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)
 Converts world coordinates to local coordinates, writes to Aircraft::drawInfo. More...
 
void SetLocation (double lat, double lon, double alt_ft)
 Legacy version of above version of SetLocatiion(), here without setting ground flag. More...
 
void GetLocation (double &lat, double &lon, double &alt_ft) const
 Converts aircraft's local coordinates to lat/lon values. More...
 
void SetLocalLoc (float _x, float _y, float _z)
 Sets location in local world coordinates. More...
 
const XPLMDrawInfo_t & GetLocation () const
 Gets all location info (including local coordinates) More...
 
float GetPitch () const
 pitch [degree] More...
 
void SetPitch (float _deg)
 pitch [degree] More...
 
float GetHeading () const
 heading [degree] More...
 
void SetHeading (float _deg)
 heading [degree] More...
 
float GetRoll () const
 roll [degree] More...
 
void SetRoll (float _deg)
 roll [degree] More...
 
float GetGS_kn () const
 Rough estimate of a ground speed based on v_x/z More...
 
float GetGearRatio () const
 Gear deploy ratio. More...
 
void SetGearRatio (float _f)
 Gear deploy ratio. More...
 
float GetNoseWheelAngle () const
 Nose Wheel angle in degrees. More...
 
void SetNoseWheelAngle (float _f)
 Nose Wheel angle in degrees. More...
 
float GetFlapRatio () const
 Flaps deploy ratio. More...
 
void SetFlapRatio (float _f)
 Flaps deploy ratio. More...
 
float GetSpoilerRatio () const
 Spoilers deploy ratio. More...
 
void SetSpoilerRatio (float _f)
 Spoilers deploy ratio. More...
 
float GetSpeedbrakeRatio () const
 Speedbrakes deploy ratio. More...
 
void SetSpeedbrakeRatio (float _f)
 Speedbrakes deploy ratio. More...
 
float GetSlatRatio () const
 Slats deploy ratio. More...
 
void SetSlatRatio (float _f)
 Slats deploy ratio. More...
 
float GetWingSweepRatio () const
 Wing sweep ratio. More...
 
void SetWingSweepRatio (float _f)
 Wing sweep ratio. More...
 
float GetThrustRatio () const
 Thrust ratio. More...
 
void SetThrustRatio (float _f)
 Thrust ratio. More...
 
float GetYokePitchRatio () const
 Yoke pitch ratio. More...
 
void SetYokePitchRatio (float _f)
 Yoke pitch ratio. More...
 
float GetYokeHeadingRatio () const
 Yoke heading ratio. More...
 
void SetYokeHeadingRatio (float _f)
 Yoke heading ratio. More...
 
float GetYokeRollRatio () const
 Yoke roll ratio. More...
 
void SetYokeRollRatio (float _f)
 Yoke roll ratio. More...
 
float GetThrustReversRatio () const
 Thrust reversers ratio. More...
 
void SetThrustReversRatio (float _f)
 Thrust reversers ratio. More...
 
bool GetLightsTaxi () const
 Taxi lights. More...
 
void SetLightsTaxi (bool _b)
 Taxi lights. More...
 
bool GetLightsLanding () const
 Landing lights. More...
 
void SetLightsLanding (bool _b)
 Landing lights. More...
 
bool GetLightsBeacon () const
 Beacon lights. More...
 
void SetLightsBeacon (bool _b)
 Beacon lights. More...
 
bool GetLightsStrobe () const
 Strobe lights. More...
 
void SetLightsStrobe (bool _b)
 Strobe lights. More...
 
bool GetLightsNav () const
 Navigation lights. More...
 
void SetLightsNav (bool _b)
 Navigation lights. More...
 
float GetNoseGearDeflection () const
 Vertical nose gear deflection [meter]. More...
 
void SetNoseGearDeflection (float _mtr)
 Vertical nose gear deflection [meter]. More...
 
float GetTireDeflection () const
 Vertical (main) gear deflection [meter]. More...
 
void SetTireDeflection (float _mtr)
 Vertical (main) gear deflection [meter]. More...
 
float GetTireRotAngle () const
 Tire rotation angle [degree]. More...
 
void SetTireRotAngle (float _deg)
 Tire rotation angle [degree]. More...
 
float GetTireRotRpm () const
 Tire rotation speed [rpm]. More...
 
void SetTireRotRpm (float _rpm)
 
float GetTireRotRad () const
 Tire rotation speed [rad/s]. More...
 
void SetTireRotRad (float _rad)
 
float GetEngineRotAngle () const
 Engine rotation angle [degree]. More...
 
void SetEngineRotAngle (float _deg)
 Engine rotation angle [degree], also sets engines 1..4. More...
 
float GetEngineRotRpm () const
 Engine rotation speed [rpm]. More...
 
void SetEngineRotRpm (float _rpm)
 Engine rotation speed [rpm], also sets [rad/s] and engines 1..4. More...
 
float GetEngineRotRad () const
 Engine rotation speed [rad/s]. More...
 
void SetEngineRotRad (float _rad)
 Engine rotation speed [rad/s], also sets [rpm] and engines 1..4. More...
 
float GetEngineRotAngle (size_t idx) const
 < Engine rotation angle [degree] for engine idx (1..4) More...
 
void SetEngineRotAngle (size_t idx, float _deg)
 Engine rotation angle [degree] for engine idx (1..4) More...
 
float GetEngineRotRpm (size_t idx) const
 < Engine rotation speed [rpm] for engine idx (1..4) More...
 
void SetEngineRotRpm (size_t idx, float _rpm)
 Engine rotation speed [rpm] for engine idx (1..4), also sets [rad/s]. More...
 
float GetEngineRotRad (size_t idx) const
 < Engine rotation speed [rad/s] for engine idx (1..4) More...
 
void SetEngineRotRad (size_t idx, float _rad)
 Engine rotation speed [rad/s] for engine idx (1..4), also sets [rpm]. More...
 
float GetPropRotAngle () const
 Propellor rotation angle [degree]. More...
 
void SetPropRotAngle (float _deg)
 Propellor rotation angle [degree]. More...
 
float GetPropRotRpm () const
 Propellor rotation speed [rpm]. More...
 
void SetPropRotRpm (float _rpm)
 
float GetPropRotRad () const
 Propellor rotation speed [rad/s]. More...
 
void SetPropRotRad (float _rad)
 
float GetReversDeployRatio () const
 Thrust reversers deploy ratio. More...
 
void SetReversDeployRatio (float _f)
 Thrust reversers deploy ratio. More...
 
bool GetTouchDown () const
 Moment of touch down. More...
 
void SetTouchDown (bool _b)
 Moment of touch down. More...
 
void WakeApplyDefaults (bool _bOverwriteAllFields=true)
 Fill in default wake turbulence support data based on Doc8643 wake turbulence category. More...
 
float GetWingSpan () const
 Wing span [m]. More...
 
void SetWingSpan (float _m)
 Wing span [m]. More...
 
float GetWingArea () const
 Wing area [m²]. More...
 
void SetWingArea (float _m2)
 Wing area [m²]. More...
 
int GetWakeCat () const
 Category between 0=light and 3=Super, derived from WTC. More...
 
float GetMass () const
 Mass [kg]. More...
 
void SetMass (float _kg)
 Mass [kg]. More...
 
virtual float GetAoA () const
 Angle of Attach, returns pitch (but you can override in your class) More...
 
virtual float GetLift () const
 Lift produced. You should override to blend in/out for take-off/landing, but XPMP2 has no dynamic info of your plane, not even an on-the-ground flag. More...
 
void MapFindIcon ()
 Determine which map icon to use for this aircraft. More...
 
void MapPreparePos (XPLMMapProjectionID projection, const float boundsLTRB[4])
 Prepare map coordinates. More...
 
void MapDrawIcon (XPLMMapLayerID inLayer, float acSize)
 Actually draw the map icon. More...
 
void MapDrawLabel (XPLMMapLayerID inLayer, float yOfs)
 Actually draw the map label. More...
 
FMOD_CHANNEL * SoundPlay (const std::string &sndName, float vol=1.0f)
 Play a sound; a looping sound plays until explicitely stopped. More...
 
void SoundStop (FMOD_CHANNEL *pChn)
 Stop a continuously playing sound. More...
 
void SoundVolume (FMOD_CHANNEL *pChn, float vol)
 Sets the sound's volume (after applying master volume and Sound File's adjustments) More...
 
void SoundMuteAll (bool bMute)
 Mute/Unmute all sounds of the airplane temporarily. More...
 
virtual std::string SoundGetName (SoundEventsTy sndEvent, float &volAdj) const
 Returns the name of the sound to play per event. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Protected Attributes

XPMPPlaneID senderId = 0
 sender's plane id (might be different here in case of deduplication) More...
 
std::uint16_t pkgHash = 0
 hash value of CSL model package More...
 
std::string sShortId
 CSL model's short id. More...
 
bool bDeleteMe = false
 flag that this a/c needs to removed More...
 
XPLMDrawInfo_t histPos [2]
 We keep 2 historic positions to be able to calculate simple linear extrapolation. More...
 
std::chrono::time_point< std::chrono::steady_clock > histTs [2]
 Timestamps when these two positions were valid. More...
 
double lat = NAN
 latitude More...
 
double lon = NAN
 longitude More...
 
double alt_ft = NAN
 altitude [ft] More...
 
std::chrono::duration< int, std::ratio< 1, 10000 > > diffTime
 time difference to previous historic position as passed in by the sender More...
 
bool bWorldCoordUpdated = false
 shall freshly set values be used in the next UpdatePosition callback? More...
 
bool bCSLModelChanged = false
 
SenderTysender
 
- Protected Attributes inherited from XPMP2::Aircraft
XPMPPlaneID modeS_id = 0
 A plane is uniquely identified by a 24bit number [0x01..0xFFFFFF]. More...
 
bool bValid = true
 is this object valid? (Will be reset in case of exceptions) More...
 
bool bVisible = true
 Shall this plane be drawn at the moment and be visible to TCAS/interfaces? More...
 
bool bRender = true
 Shall the CSL model be drawn in 3D world? (if !bRender && bVivile then still visible on TCAS/interfaces, Remote Client uses this for local senders' planes to take over TCAS but not drawing) More...
 
XPMP2::CSLModelpCSLMdl = nullptr
 the CSL model in use More...
 
int matchQuality = -1
 quality of the match with the CSL model More...
 
int acRelGrp = 0
 related group, ie. line in related.txt in which this a/c appears, if any More...
 
float prev_x = 0.0f
 
float prev_y = 0.0f
 
float prev_z = 0.0f
 
float prev_ts = 0.0f
 last update of prev_x/y/z in XP's network time More...
 
float v_x = 0.0f
 
float v_y = 0.0f
 
float v_z = 0.0f
 Cartesian velocity in m/s per axis. More...
 
float gs_kn = 0.0f
 
float tsResetTouchDown = NAN
 ground speed in [kn] based on above v_x/z More...
 
std::list< XPLMInstanceRef > listInst
 X-Plane instance handles for all objects making up the model. More...
 
int tcasTargetIdx = -1
 Which sim/cockpit2/tcas/targets-index does this plane occupy? [1..63], -1 if none. More...
 
float camTimLstUpd = 0.0f
 Timestamp of last update of camera dist/bearing. More...
 
float camDist = 0.0f
 Distance to camera in meters (updated internally regularly) More...
 
float camBearing = 0.0f
 Bearing from camera in degrees (updated internally regularly) More...
 
XPLMProbeRef hProbe = nullptr
 Y Probe for terrain testing, needed in ground clamping. More...
 
int mapIconRow = 0
 map icon coordinates, row More...
 
int mapIconCol = 0
 map icon coordinates, column More...
 
float mapX = 0.0f
 temporary: map coordinates (NAN = not to be drawn) More...
 
float mapY = 0.0f
 temporary: map coordinates (NAN = not to be drawn) More...
 
std::string mapLabel
 label for map drawing More...
 
SndChTy aSndCh [SND_NUM_EVENTS]
 Operational values per sound channel, that is triggered by a standard sound event. More...
 
bool bChnLowPass = false
 Is Low Pass Filter currently being active? More...
 
bool bChnMuted = false
 Is sound for this aircraft currently muted? More...
 
ChnListTy chnList
 List of channels produced via calls to SoundPlay() More...
 
int skipCounter = 0
 Counts how often we skipped expensive computations. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Additional Inherited Members

- Public Types inherited from XPMP2::Aircraft
enum  SoundEventsTy {
-  SND_ENG = 0 -, SND_REVERSE_THRUST -, SND_TIRE -, SND_GEAR -,
-  SND_FLAPS -, SND_NUM_EVENTS -
- }
 Types of sound supported directly by XPMP2. More...
 
typedef std::list< FMOD_CHANNEL * > ChnListTy
 List of FMOD channels, also beyond sounds created for SoundEvetsTy. More...
 
- Public Attributes inherited from XPMP2::Aircraft
std::string acIcaoType
 ICAO aircraft type designator of this plane. More...
 
std::string acIcaoAirline
 ICAO Airline code of this plane. More...
 
std::string acLivery
 Livery code of this plane. More...
 
XPLMDrawInfo_t drawInfo
 Holds position (in local coordinates!) and orientation (pitch, heading roll) of the aircraft. More...
 
bool bOnGrnd = false
 Is the aircraft on the ground? More...
 
std::vector< float > v
 actual dataRef values to be provided to the CSL model More...
 
std::string label
 aircraft label shown in the 3D world next to the plane More...
 
float colLabel [4] = {1.0f,1.0f,0.0f,1.0f}
 label base color (RGB) More...
 
bool bDrawLabel = true
 Shall this aircraft's label be drawn? More...
 
float vertOfsRatio = 1.0f
 How much of the vertical offset shall be applied? (This allows phasing out the vertical offset in higher altitudes.) [0..1]. More...
 
float gearDeflectRatio = 0.5f
 By how much of the gear deflection shall the plane's altitude be reduced? More...
 
bool bClampToGround = false
 Shall this plane be clamped to ground (ie. never sink below ground)? More...
 
int aiPrio = 1
 Priority for display in one of the limited number of TCAS target slots. More...
 
XPMPPlaneRadar_t acRadar
 Current radar status. More...
 
struct XPMP2::Aircraft::wakeTy wake
 wake-support data More...
 
XPMPInfoTexts_t acInfoTexts
 Informational texts passed on via multiplayer shared dataRefs. More...
 
int sndMinDist = 50.0
 Minimum distance in [m] to play sound in full volume, the larger the 'louder' the aircraft. More...
 
- Protected Member Functions inherited from XPMP2::Aircraft
void DoMove ()
 Internal: This puts the instance into XP's sky and makes it move. More...
 
void UpdateDistBearingCamera (const XPLMCameraPosition_t &posCam)
 Internal: Update the plane's distance/bearing from the camera location. More...
 
void ClampToGround ()
 Clamp to ground: Make sure the plane is not below ground, corrects Aircraft::drawInfo if needed. More...
 
bool CreateInstances ()
 Create the instances required to represent the plane, return if successful. More...
 
void DestroyInstances ()
 Destroy all instances. More...
 
virtual void ComputeMapLabel ()
 Put together the map label. More...
 
virtual void SetTcasTargetIdx (int _idx)
 Define the TCAS target index in use. More...
 
virtual void SoundSetup ()
 Sound-related initializations, called by Create() and ChangeModel() More...
 
virtual void SoundUpdate ()
 Update sound, like position and volume, called once per frame. More...
 
virtual void SoundRemoveAll ()
 Remove all sound, e.g. during destruction. More...
 
- Static Protected Member Functions inherited from XPMP2::Aircraft
static float FlightLoopCB (float, float, int, void *)
 Internal: Flight loop callback function controlling update and movement of all planes. More...
 
-

Detailed Description

-

Representation of a remote aircraft.

-

Constructor & Destructor Documentation

- -

◆ RemoteAC()

- -
-
- - - - - - - - - - - - - - - - - - -
RemoteAC::RemoteAC (SenderTy_sender,
const XPMP2::RemoteAcDetailTy_acDetails 
)
-
- -

Constructor for use in network thread: Does not Create the aircraft but only stores the passed information.

- -
-
- -

◆ ~RemoteAC()

- -
-
- - - - - -
- - - - - - - -
RemoteAC::~RemoteAC ()
-
-virtual
-
- -

Destructor.

- -
-
-

Member Function Documentation

- -

◆ Create()

- -
-
- - - - - - - -
void RemoteAC::Create ()
-
- -

Actually create the aircraft, ultimately calls XPMP2::Aircraft::Create()

- -
-
- -

◆ IsToBeDeleted()

- -
-
- - - - - -
- - - - - - - -
bool RemoteAC::IsToBeDeleted () const
-
-inline
-
- -

To be deleted?

- -
-
- -

◆ MarkForDeletion()

- -
-
- - - - - -
- - - - - - - -
void RemoteAC::MarkForDeletion ()
-
-inline
-
- -

Mark this aircraft as to-be-deleted in the next flight loop (can't do in worker thread)

- -
-
- -

◆ Update() [1/3]

- -
-
- - - - - - - - -
void RemoteAC::Update (const XPMP2::RemoteAcAnimTy_acAnim)
-
- -

Update data from an a/c animation dataRefs message.

- -
-
- -

◆ Update() [2/3]

- -
-
- - - - - - - - -
void RemoteAC::Update (const XPMP2::RemoteAcDetailTy_acDetails)
-
- -

Update data from an a/c detail structure.

- -
-
- -

◆ Update() [3/3]

- -
-
- - - - - - - - -
void RemoteAC::Update (const XPMP2::RemoteAcPosUpdateTy_acPosUpd)
-
- -

Update data from an a/c position update.

- -
-
- -

◆ UpdatePosition()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
void RemoteAC::UpdatePosition (float _elapsed,
int  
)
-
-overridevirtual
-
- -

Called by XPMP2 for position updates, extrapolates from historic positions.

- -

Implements XPMP2::Aircraft.

- -
-
-

Member Data Documentation

- -

◆ alt_ft

- -
-
- - - - - -
- - - - -
double RemoteAC::alt_ft = NAN
-
-protected
-
- -

altitude [ft]

- -
-
- -

◆ bCSLModelChanged

- -
-
- - - - - -
- - - - -
bool RemoteAC::bCSLModelChanged = false
-
-protected
-
- -
-
- -

◆ bDeleteMe

- -
-
- - - - - -
- - - - -
bool RemoteAC::bDeleteMe = false
-
-protected
-
- -

flag that this a/c needs to removed

- -
-
- -

◆ bWorldCoordUpdated

- -
-
- - - - - -
- - - - -
bool RemoteAC::bWorldCoordUpdated = false
-
-protected
-
- -

shall freshly set values be used in the next UpdatePosition callback?

- -
-
- -

◆ diffTime

- -
-
- - - - - -
- - - - -
std::chrono::duration<int,std::ratio<1, 10000> > RemoteAC::diffTime
-
-protected
-
- -

time difference to previous historic position as passed in by the sender

- -
-
- -

◆ histPos

- -
-
- - - - - -
- - - - -
XPLMDrawInfo_t RemoteAC::histPos[2]
-
-protected
-
- -

We keep 2 historic positions to be able to calculate simple linear extrapolation.

-

Index 0 is the older one, index 1 the newer one

- -
-
- -

◆ histTs

- -
-
- - - - - -
- - - - -
std::chrono::time_point<std::chrono::steady_clock> RemoteAC::histTs[2]
-
-protected
-
- -

Timestamps when these two positions were valid.

- -
-
- -

◆ lat

- -
-
- - - - - -
- - - - -
double RemoteAC::lat = NAN
-
-protected
-
- -

latitude

- -
-
- -

◆ lon

- -
-
- - - - - -
- - - - -
double RemoteAC::lon = NAN
-
-protected
-
- -

longitude

- -
-
- -

◆ pkgHash

- -
-
- - - - - -
- - - - -
std::uint16_t RemoteAC::pkgHash = 0
-
-protected
-
- -

hash value of CSL model package

- -
-
- -

◆ sender

- -
-
- - - - - -
- - - - -
SenderTy& RemoteAC::sender
-
-protected
-
- -
-
- -

◆ senderId

- -
-
- - - - - -
- - - - -
XPMPPlaneID RemoteAC::senderId = 0
-
-protected
-
- -

sender's plane id (might be different here in case of deduplication)

- -
-
- -

◆ sShortId

- -
-
- - - - - -
- - - - -
std::string RemoteAC::sShortId
-
-protected
-
- -

CSL model's short id.

- -
-
-
The documentation for this class was generated from the following files: -
- - - - diff --git a/docs/html/classRemoteAC.png b/docs/html/classRemoteAC.png deleted file mode 100644 index 3faef348..00000000 Binary files a/docs/html/classRemoteAC.png and /dev/null differ diff --git a/docs/html/classSampleAircraft-members.html b/docs/html/classSampleAircraft-members.html deleted file mode 100644 index fa83c638..00000000 --- a/docs/html/classSampleAircraft-members.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - -XPMP2: Member List - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-
SampleAircraft Member List
-
-
- -

This is the complete list of members for SampleAircraft, including all inherited members.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
acIcaoAirlineXPMP2::Aircraft
acIcaoTypeXPMP2::Aircraft
acInfoTextsXPMP2::Aircraft
acLiveryXPMP2::Aircraft
acRadarXPMP2::Aircraft
acRelGrpXPMP2::Aircraftprotected
aiPrioXPMP2::Aircraft
Aircraft(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")XPMP2::Aircraft
Aircraft()XPMP2::Aircraft
Aircraft(const Aircraft &)=deleteXPMP2::Aircraft
aSndChXPMP2::Aircraftprotected
AssignModel(const std::string &_cslId, CSLModel *_pCSLModel=nullptr)XPMP2::Aircraft
bChnLowPassXPMP2::Aircraftprotected
bChnMutedXPMP2::Aircraftprotected
bClampToGroundXPMP2::Aircraft
bDrawLabelXPMP2::Aircraft
bOnGrndXPMP2::Aircraft
bRenderXPMP2::Aircraftprotected
bValidXPMP2::Aircraftprotected
bVisibleXPMP2::Aircraftprotected
camBearingXPMP2::Aircraftprotected
camDistXPMP2::Aircraftprotected
camTimLstUpdXPMP2::Aircraftprotected
ChangeModel(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)XPMP2::Aircraft
chnListXPMP2::Aircraftprotected
ChnListTy typedefXPMP2::Aircraft
ClampToGround()XPMP2::Aircraftprotected
colLabelXPMP2::Aircraft
ComputeMapLabel()XPMP2::Aircraftprotectedvirtual
Create(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)XPMP2::Aircraft
CreateInstances()XPMP2::Aircraftprotected
DestroyInstances()XPMP2::Aircraftprotected
DoMove()XPMP2::Aircraftprotected
drawInfoXPMP2::Aircraft
FlightLoopCB(float, float, int, void *)XPMP2::Aircraftprotectedstatic
gearDeflectRatioXPMP2::Aircraft
GetAoA() constXPMP2::Aircraftinlinevirtual
GetCameraBearing() constXPMP2::Aircraftinline
GetCameraDist() constXPMP2::Aircraftinline
GetEngineRotAngle() constXPMP2::Aircraftinline
GetEngineRotAngle(size_t idx) constXPMP2::Aircraftinline
GetEngineRotRad() constXPMP2::Aircraftinline
GetEngineRotRad(size_t idx) constXPMP2::Aircraftinline
GetEngineRotRpm() constXPMP2::Aircraftinline
GetEngineRotRpm(size_t idx) constXPMP2::Aircraftinline
GetFlapRatio() constXPMP2::Aircraftinline
GetFlightId() constXPMP2::Aircraftvirtual
GetGearRatio() constXPMP2::Aircraftinline
GetGS_kn() constXPMP2::Aircraftinline
GetHeading() constXPMP2::Aircraftinline
GetLift() constXPMP2::Aircraftinlinevirtual
GetLightsBeacon() constXPMP2::Aircraftinline
GetLightsLanding() constXPMP2::Aircraftinline
GetLightsNav() constXPMP2::Aircraftinline
GetLightsStrobe() constXPMP2::Aircraftinline
GetLightsTaxi() constXPMP2::Aircraftinline
GetLocation(double &lat, double &lon, double &alt_ft) constXPMP2::Aircraft
GetLocation() constXPMP2::Aircraftinline
GetMass() constXPMP2::Aircraftinline
GetMatchQuality() constXPMP2::Aircraftinline
GetModel() constXPMP2::Aircraftinline
GetModelInfo() constXPMP2::Aircraftinline
GetModelName() constXPMP2::Aircraft
GetModeS_ID() constXPMP2::Aircraftinline
GetNoseGearDeflection() constXPMP2::Aircraftinline
GetNoseWheelAngle() constXPMP2::Aircraftinline
GetPitch() constXPMP2::Aircraftinline
GetPropRotAngle() constXPMP2::Aircraftinline
GetPropRotRad() constXPMP2::Aircraftinline
GetPropRotRpm() constXPMP2::Aircraftinline
GetReversDeployRatio() constXPMP2::Aircraftinline
GetRoll() constXPMP2::Aircraftinline
GetSlatRatio() constXPMP2::Aircraftinline
GetSpeedbrakeRatio() constXPMP2::Aircraftinline
GetSpoilerRatio() constXPMP2::Aircraftinline
GetTcasTargetIdx() constXPMP2::Aircraftinline
GetThrustRatio() constXPMP2::Aircraftinline
GetThrustReversRatio() constXPMP2::Aircraftinline
GetTireDeflection() constXPMP2::Aircraftinline
GetTireRotAngle() constXPMP2::Aircraftinline
GetTireRotRad() constXPMP2::Aircraftinline
GetTireRotRpm() constXPMP2::Aircraftinline
GetTouchDown() constXPMP2::Aircraftinline
GetVertOfs() constXPMP2::Aircraft
GetWakeCat() constXPMP2::Aircraft
GetWingArea() constXPMP2::Aircraftinline
GetWingSpan() constXPMP2::Aircraftinline
GetWingSweepRatio() constXPMP2::Aircraftinline
GetYokeHeadingRatio() constXPMP2::Aircraftinline
GetYokePitchRatio() constXPMP2::Aircraftinline
GetYokeRollRatio() constXPMP2::Aircraftinline
gs_knXPMP2::Aircraftprotected
hProbeXPMP2::Aircraftprotected
IsCurrentlyShownAsAI() constXPMP2::Aircraft
IsCurrentlyShownAsTcasTarget() constXPMP2::Aircraftinline
IsGroundVehicle() constXPMP2::Aircraft
IsInstanciated() constXPMP2::Aircraftinline
IsOnGrnd() constXPMP2::Aircraftinline
IsRelatedTo(const std::string &_icaoType) constXPMP2::Aircraft
IsRendered() constXPMP2::Aircraftinline
IsValid() constXPMP2::Aircraftinline
IsVisible() constXPMP2::Aircraftinline
labelXPMP2::Aircraft
listInstXPMP2::Aircraftprotected
MapDrawIcon(XPLMMapLayerID inLayer, float acSize)XPMP2::Aircraft
MapDrawLabel(XPLMMapLayerID inLayer, float yOfs)XPMP2::Aircraft
MapFindIcon()XPMP2::Aircraft
mapIconColXPMP2::Aircraftprotected
mapIconRowXPMP2::Aircraftprotected
mapLabelXPMP2::Aircraftprotected
MapPreparePos(XPLMMapProjectionID projection, const float boundsLTRB[4])XPMP2::Aircraft
mapXXPMP2::Aircraftprotected
mapYXPMP2::Aircraftprotected
matchQualityXPMP2::Aircraftprotected
modeS_idXPMP2::Aircraftprotected
operator=(const Aircraft &)=deleteXPMP2::Aircraft
pCSLMdlXPMP2::Aircraftprotected
prev_tsXPMP2::Aircraftprotected
prev_xXPMP2::Aircraftprotected
prev_yXPMP2::Aircraftprotected
prev_zXPMP2::Aircraftprotected
ReMatchModel()XPMP2::Aircraftinline
ResetTcasTargetIdx()XPMP2::Aircraftinline
SampleAircraft(const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")SampleAircraftinline
SetDrawLabel(bool _b)XPMP2::Aircraftinline
SetEngineRotAngle(float _deg)XPMP2::Aircraft
SetEngineRotAngle(size_t idx, float _deg)XPMP2::Aircraft
SetEngineRotRad(float _rad)XPMP2::Aircraft
SetEngineRotRad(size_t idx, float _rad)XPMP2::Aircraft
SetEngineRotRpm(float _rpm)XPMP2::Aircraft
SetEngineRotRpm(size_t idx, float _rpm)XPMP2::Aircraft
SetFlapRatio(float _f)XPMP2::Aircraftinline
SetGearRatio(float _f)XPMP2::Aircraftinline
SetHeading(float _deg)XPMP2::Aircraftinline
SetInvalid()XPMP2::Aircraftvirtual
SetLightsBeacon(bool _b)XPMP2::Aircraftinline
SetLightsLanding(bool _b)XPMP2::Aircraftinline
SetLightsNav(bool _b)XPMP2::Aircraftinline
SetLightsStrobe(bool _b)XPMP2::Aircraftinline
SetLightsTaxi(bool _b)XPMP2::Aircraftinline
SetLocalLoc(float _x, float _y, float _z)XPMP2::Aircraftinline
SetLocation(double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)XPMP2::Aircraftinline
SetLocation(double lat, double lon, double alt_ft)XPMP2::Aircraft
SetMass(float _kg)XPMP2::Aircraftinline
SetNoseGearDeflection(float _mtr)XPMP2::Aircraftinline
SetNoseWheelAngle(float _f)XPMP2::Aircraftinline
SetOnGrnd(bool on_grnd, float setTouchDownTime=NAN)XPMP2::Aircraft
SetPitch(float _deg)XPMP2::Aircraftinline
SetPropRotAngle(float _deg)XPMP2::Aircraftinline
SetPropRotRad(float _rad)XPMP2::Aircraftinline
SetPropRotRpm(float _rpm)XPMP2::Aircraftinline
SetRender(bool _bRender)XPMP2::Aircraftvirtual
SetReversDeployRatio(float _f)XPMP2::Aircraftinline
SetRoll(float _deg)XPMP2::Aircraftinline
SetSlatRatio(float _f)XPMP2::Aircraftinline
SetSpeedbrakeRatio(float _f)XPMP2::Aircraftinline
SetSpoilerRatio(float _f)XPMP2::Aircraftinline
SetTcasTargetIdx(int _idx)XPMP2::Aircraftinlineprotectedvirtual
SetThrustRatio(float _f)XPMP2::Aircraftinline
SetThrustReversRatio(float _f)XPMP2::Aircraftinline
SetTireDeflection(float _mtr)XPMP2::Aircraftinline
SetTireRotAngle(float _deg)XPMP2::Aircraftinline
SetTireRotRad(float _rad)XPMP2::Aircraftinline
SetTireRotRpm(float _rpm)XPMP2::Aircraftinline
SetTouchDown(bool _b)XPMP2::Aircraftinline
SetVisible(bool _bVisible)XPMP2::Aircraftvirtual
SetWingArea(float _m2)XPMP2::Aircraftinline
SetWingSpan(float _m)XPMP2::Aircraftinline
SetWingSweepRatio(float _f)XPMP2::Aircraftinline
SetYokeHeadingRatio(float _f)XPMP2::Aircraftinline
SetYokePitchRatio(float _f)XPMP2::Aircraftinline
SetYokeRollRatio(float _f)XPMP2::Aircraftinline
ShallDrawLabel() constXPMP2::Aircraftinline
ShowAsAIPlane() constXPMP2::Aircraftinline
skipCounterXPMP2::Aircraftprotected
SND_ENG enum valueXPMP2::Aircraft
SND_FLAPS enum valueXPMP2::Aircraft
SND_GEAR enum valueXPMP2::Aircraft
SND_NUM_EVENTS enum valueXPMP2::Aircraft
SND_REVERSE_THRUST enum valueXPMP2::Aircraft
SND_TIRE enum valueXPMP2::Aircraft
sndMinDistXPMP2::Aircraft
SoundEventsTy enum nameXPMP2::Aircraft
SoundGetName(SoundEventsTy sndEvent, float &volAdj) constXPMP2::Aircraftvirtual
SoundMuteAll(bool bMute)XPMP2::Aircraft
SoundPlay(const std::string &sndName, float vol=1.0f)XPMP2::Aircraft
SoundRemoveAll()XPMP2::Aircraftprotectedvirtual
SoundSetup()XPMP2::Aircraftprotectedvirtual
SoundStop(FMOD_CHANNEL *pChn)XPMP2::Aircraft
SoundUpdate()XPMP2::Aircraftprotectedvirtual
SoundVolume(FMOD_CHANNEL *pChn, float vol)XPMP2::Aircraft
tcasTargetIdxXPMP2::Aircraftprotected
tsResetTouchDownXPMP2::Aircraftprotected
UpdateDistBearingCamera(const XPLMCameraPosition_t &posCam)XPMP2::Aircraftprotected
UpdatePosition(float, int)SampleAircraftinlinevirtual
vXPMP2::Aircraft
v_xXPMP2::Aircraftprotected
v_yXPMP2::Aircraftprotected
v_zXPMP2::Aircraftprotected
vertOfsRatioXPMP2::Aircraft
wakeXPMP2::Aircraft
WakeApplyDefaults(bool _bOverwriteAllFields=true)XPMP2::Aircraft
~Aircraft()XPMP2::Aircraftvirtual
- - - - diff --git a/docs/html/classSampleAircraft.html b/docs/html/classSampleAircraft.html deleted file mode 100644 index f56824eb..00000000 --- a/docs/html/classSampleAircraft.html +++ /dev/null @@ -1,775 +0,0 @@ - - - - - - - -XPMP2: SampleAircraft Class Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
-Public Member Functions | -List of all members
-
-
SampleAircraft Class Reference
-
-
- -

Subclassing XPMP2::Aircraft to create our own class. - More...

-
- + Inheritance diagram for SampleAircraft:
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Public Member Functions

 SampleAircraft (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")
 Constructor just passes on all parameters to library. More...
 
virtual void UpdatePosition (float, int)
 Custom implementation for the virtual function providing updates values. More...
 
- Public Member Functions inherited from XPMP2::Aircraft
 Aircraft (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="")
 Constructor creates a new aircraft object, which will be managed and displayed. More...
 
 Aircraft ()
 Default constructor creates an empty, invalid(!) and invisible shell; call XPMP2::Aircraft::Create() to actually create a plane. More...
 
virtual ~Aircraft ()
 Destructor cleans up all resources acquired. More...
 
 Aircraft (const Aircraft &)=delete
 Aircraft must not be copied as they reference non-copyable resources like XP instances. More...
 
Aircraftoperator= (const Aircraft &)=delete
 Aircraft must not be copied as they reference non-copyable resources like XP instances. More...
 
void Create (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery, XPMPPlaneID _modeS_id=0, const std::string &_cslId="", CSLModel *_pCSLModel=nullptr)
 Creates a plane, only a valid operation if object was created using the default constructor. More...
 
XPMPPlaneID GetModeS_ID () const
 return the XPMP2 plane id More...
 
bool IsGroundVehicle () const
 Is this object a ground vehicle? More...
 
bool IsRelatedTo (const std::string &_icaoType) const
 Is this object "related" to the given ICAO code? (named in the same line in related.txt) More...
 
int GetTcasTargetIdx () const
 return the current TCAS target index (into sim/cockpit2/tcas/targets), 1-based, -1 if not used More...
 
bool IsCurrentlyShownAsTcasTarget () const
 Is this plane currently also being tracked as a TCAS target, ie. will appear on TCAS? More...
 
bool IsCurrentlyShownAsAI () const
 Is this plane currently also being tracked by X-Plane's classic AI/multiplayer? More...
 
bool ShowAsAIPlane () const
 Is this plane to be drawn on TCAS? (It will if transponder is not switched off) More...
 
void ResetTcasTargetIdx ()
 Reset TCAS target slot index to -1 More...
 
virtual std::string GetFlightId () const
 Return a value for dataRef .../tcas/target/flight_id. More...
 
int ChangeModel (const std::string &_icaoType, const std::string &_icaoAirline, const std::string &_livery)
 (Potentially) changes the plane's model after doing a new match attempt More...
 
int ReMatchModel ()
 Finds a match again, using the existing parameters, eg. after more models have been loaded. More...
 
bool AssignModel (const std::string &_cslId, CSLModel *_pCSLModel=nullptr)
 Assigns the given model. More...
 
XPMP2::CSLModelGetModel () const
 return a pointer to the CSL model in use (Note: The CSLModel structure is not public.) More...
 
const std::string & GetModelName () const
 return the name of the CSL model in use More...
 
CSLModelInfo_t GetModelInfo () const
 return an information structure for the CSL model associated with the aircraft More...
 
int GetMatchQuality () const
 quality of the match with the CSL model More...
 
float GetVertOfs () const
 Vertical offset, ie. the value that needs to be added to drawInfo.y to make the aircraft appear on the ground. More...
 
bool IsValid () const
 Is the a/c object valid? More...
 
virtual void SetInvalid ()
 Mark the plane invalid, e.g. after exceptions occured on the data. More...
 
virtual void SetVisible (bool _bVisible)
 Make the plane (in)visible. More...
 
bool IsVisible () const
 Is the plane visible? More...
 
virtual void SetRender (bool _bRender)
 Switch rendering of the CSL model on or off. More...
 
bool IsRendered () const
 Is this plane to be rendered? More...
 
bool IsInstanciated () const
 Are instances created for this aircraft? More...
 
void SetDrawLabel (bool _b)
 Define if this aircraft's label is to be drawn (provided label drawing is enabled globally) More...
 
bool ShallDrawLabel () const
 Shall this aircraft's label be drawn? More...
 
float GetCameraDist () const
 Distance to camera [m]. More...
 
float GetCameraBearing () const
 Bearing from camera [°]. More...
 
bool IsOnGrnd () const
 Is the aircraft on the ground? More...
 
void SetOnGrnd (bool on_grnd, float setTouchDownTime=NAN)
 Set if the aircraft is on the ground. More...
 
void SetLocation (double lat, double lon, double alt_ft, bool on_grnd, float setTouchDownTime=NAN)
 Converts world coordinates to local coordinates, writes to Aircraft::drawInfo. More...
 
void SetLocation (double lat, double lon, double alt_ft)
 Legacy version of above version of SetLocatiion(), here without setting ground flag. More...
 
void GetLocation (double &lat, double &lon, double &alt_ft) const
 Converts aircraft's local coordinates to lat/lon values. More...
 
void SetLocalLoc (float _x, float _y, float _z)
 Sets location in local world coordinates. More...
 
const XPLMDrawInfo_t & GetLocation () const
 Gets all location info (including local coordinates) More...
 
float GetPitch () const
 pitch [degree] More...
 
void SetPitch (float _deg)
 pitch [degree] More...
 
float GetHeading () const
 heading [degree] More...
 
void SetHeading (float _deg)
 heading [degree] More...
 
float GetRoll () const
 roll [degree] More...
 
void SetRoll (float _deg)
 roll [degree] More...
 
float GetGS_kn () const
 Rough estimate of a ground speed based on v_x/z More...
 
float GetGearRatio () const
 Gear deploy ratio. More...
 
void SetGearRatio (float _f)
 Gear deploy ratio. More...
 
float GetNoseWheelAngle () const
 Nose Wheel angle in degrees. More...
 
void SetNoseWheelAngle (float _f)
 Nose Wheel angle in degrees. More...
 
float GetFlapRatio () const
 Flaps deploy ratio. More...
 
void SetFlapRatio (float _f)
 Flaps deploy ratio. More...
 
float GetSpoilerRatio () const
 Spoilers deploy ratio. More...
 
void SetSpoilerRatio (float _f)
 Spoilers deploy ratio. More...
 
float GetSpeedbrakeRatio () const
 Speedbrakes deploy ratio. More...
 
void SetSpeedbrakeRatio (float _f)
 Speedbrakes deploy ratio. More...
 
float GetSlatRatio () const
 Slats deploy ratio. More...
 
void SetSlatRatio (float _f)
 Slats deploy ratio. More...
 
float GetWingSweepRatio () const
 Wing sweep ratio. More...
 
void SetWingSweepRatio (float _f)
 Wing sweep ratio. More...
 
float GetThrustRatio () const
 Thrust ratio. More...
 
void SetThrustRatio (float _f)
 Thrust ratio. More...
 
float GetYokePitchRatio () const
 Yoke pitch ratio. More...
 
void SetYokePitchRatio (float _f)
 Yoke pitch ratio. More...
 
float GetYokeHeadingRatio () const
 Yoke heading ratio. More...
 
void SetYokeHeadingRatio (float _f)
 Yoke heading ratio. More...
 
float GetYokeRollRatio () const
 Yoke roll ratio. More...
 
void SetYokeRollRatio (float _f)
 Yoke roll ratio. More...
 
float GetThrustReversRatio () const
 Thrust reversers ratio. More...
 
void SetThrustReversRatio (float _f)
 Thrust reversers ratio. More...
 
bool GetLightsTaxi () const
 Taxi lights. More...
 
void SetLightsTaxi (bool _b)
 Taxi lights. More...
 
bool GetLightsLanding () const
 Landing lights. More...
 
void SetLightsLanding (bool _b)
 Landing lights. More...
 
bool GetLightsBeacon () const
 Beacon lights. More...
 
void SetLightsBeacon (bool _b)
 Beacon lights. More...
 
bool GetLightsStrobe () const
 Strobe lights. More...
 
void SetLightsStrobe (bool _b)
 Strobe lights. More...
 
bool GetLightsNav () const
 Navigation lights. More...
 
void SetLightsNav (bool _b)
 Navigation lights. More...
 
float GetNoseGearDeflection () const
 Vertical nose gear deflection [meter]. More...
 
void SetNoseGearDeflection (float _mtr)
 Vertical nose gear deflection [meter]. More...
 
float GetTireDeflection () const
 Vertical (main) gear deflection [meter]. More...
 
void SetTireDeflection (float _mtr)
 Vertical (main) gear deflection [meter]. More...
 
float GetTireRotAngle () const
 Tire rotation angle [degree]. More...
 
void SetTireRotAngle (float _deg)
 Tire rotation angle [degree]. More...
 
float GetTireRotRpm () const
 Tire rotation speed [rpm]. More...
 
void SetTireRotRpm (float _rpm)
 
float GetTireRotRad () const
 Tire rotation speed [rad/s]. More...
 
void SetTireRotRad (float _rad)
 
float GetEngineRotAngle () const
 Engine rotation angle [degree]. More...
 
void SetEngineRotAngle (float _deg)
 Engine rotation angle [degree], also sets engines 1..4. More...
 
float GetEngineRotRpm () const
 Engine rotation speed [rpm]. More...
 
void SetEngineRotRpm (float _rpm)
 Engine rotation speed [rpm], also sets [rad/s] and engines 1..4. More...
 
float GetEngineRotRad () const
 Engine rotation speed [rad/s]. More...
 
void SetEngineRotRad (float _rad)
 Engine rotation speed [rad/s], also sets [rpm] and engines 1..4. More...
 
float GetEngineRotAngle (size_t idx) const
 < Engine rotation angle [degree] for engine idx (1..4) More...
 
void SetEngineRotAngle (size_t idx, float _deg)
 Engine rotation angle [degree] for engine idx (1..4) More...
 
float GetEngineRotRpm (size_t idx) const
 < Engine rotation speed [rpm] for engine idx (1..4) More...
 
void SetEngineRotRpm (size_t idx, float _rpm)
 Engine rotation speed [rpm] for engine idx (1..4), also sets [rad/s]. More...
 
float GetEngineRotRad (size_t idx) const
 < Engine rotation speed [rad/s] for engine idx (1..4) More...
 
void SetEngineRotRad (size_t idx, float _rad)
 Engine rotation speed [rad/s] for engine idx (1..4), also sets [rpm]. More...
 
float GetPropRotAngle () const
 Propellor rotation angle [degree]. More...
 
void SetPropRotAngle (float _deg)
 Propellor rotation angle [degree]. More...
 
float GetPropRotRpm () const
 Propellor rotation speed [rpm]. More...
 
void SetPropRotRpm (float _rpm)
 
float GetPropRotRad () const
 Propellor rotation speed [rad/s]. More...
 
void SetPropRotRad (float _rad)
 
float GetReversDeployRatio () const
 Thrust reversers deploy ratio. More...
 
void SetReversDeployRatio (float _f)
 Thrust reversers deploy ratio. More...
 
bool GetTouchDown () const
 Moment of touch down. More...
 
void SetTouchDown (bool _b)
 Moment of touch down. More...
 
void WakeApplyDefaults (bool _bOverwriteAllFields=true)
 Fill in default wake turbulence support data based on Doc8643 wake turbulence category. More...
 
float GetWingSpan () const
 Wing span [m]. More...
 
void SetWingSpan (float _m)
 Wing span [m]. More...
 
float GetWingArea () const
 Wing area [m²]. More...
 
void SetWingArea (float _m2)
 Wing area [m²]. More...
 
int GetWakeCat () const
 Category between 0=light and 3=Super, derived from WTC. More...
 
float GetMass () const
 Mass [kg]. More...
 
void SetMass (float _kg)
 Mass [kg]. More...
 
virtual float GetAoA () const
 Angle of Attach, returns pitch (but you can override in your class) More...
 
virtual float GetLift () const
 Lift produced. You should override to blend in/out for take-off/landing, but XPMP2 has no dynamic info of your plane, not even an on-the-ground flag. More...
 
void MapFindIcon ()
 Determine which map icon to use for this aircraft. More...
 
void MapPreparePos (XPLMMapProjectionID projection, const float boundsLTRB[4])
 Prepare map coordinates. More...
 
void MapDrawIcon (XPLMMapLayerID inLayer, float acSize)
 Actually draw the map icon. More...
 
void MapDrawLabel (XPLMMapLayerID inLayer, float yOfs)
 Actually draw the map label. More...
 
FMOD_CHANNEL * SoundPlay (const std::string &sndName, float vol=1.0f)
 Play a sound; a looping sound plays until explicitely stopped. More...
 
void SoundStop (FMOD_CHANNEL *pChn)
 Stop a continuously playing sound. More...
 
void SoundVolume (FMOD_CHANNEL *pChn, float vol)
 Sets the sound's volume (after applying master volume and Sound File's adjustments) More...
 
void SoundMuteAll (bool bMute)
 Mute/Unmute all sounds of the airplane temporarily. More...
 
virtual std::string SoundGetName (SoundEventsTy sndEvent, float &volAdj) const
 Returns the name of the sound to play per event. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Additional Inherited Members

- Public Types inherited from XPMP2::Aircraft
enum  SoundEventsTy {
-  SND_ENG = 0 -, SND_REVERSE_THRUST -, SND_TIRE -, SND_GEAR -,
-  SND_FLAPS -, SND_NUM_EVENTS -
- }
 Types of sound supported directly by XPMP2. More...
 
typedef std::list< FMOD_CHANNEL * > ChnListTy
 List of FMOD channels, also beyond sounds created for SoundEvetsTy. More...
 
- Public Attributes inherited from XPMP2::Aircraft
std::string acIcaoType
 ICAO aircraft type designator of this plane. More...
 
std::string acIcaoAirline
 ICAO Airline code of this plane. More...
 
std::string acLivery
 Livery code of this plane. More...
 
XPLMDrawInfo_t drawInfo
 Holds position (in local coordinates!) and orientation (pitch, heading roll) of the aircraft. More...
 
bool bOnGrnd = false
 Is the aircraft on the ground? More...
 
std::vector< float > v
 actual dataRef values to be provided to the CSL model More...
 
std::string label
 aircraft label shown in the 3D world next to the plane More...
 
float colLabel [4] = {1.0f,1.0f,0.0f,1.0f}
 label base color (RGB) More...
 
bool bDrawLabel = true
 Shall this aircraft's label be drawn? More...
 
float vertOfsRatio = 1.0f
 How much of the vertical offset shall be applied? (This allows phasing out the vertical offset in higher altitudes.) [0..1]. More...
 
float gearDeflectRatio = 0.5f
 By how much of the gear deflection shall the plane's altitude be reduced? More...
 
bool bClampToGround = false
 Shall this plane be clamped to ground (ie. never sink below ground)? More...
 
int aiPrio = 1
 Priority for display in one of the limited number of TCAS target slots. More...
 
XPMPPlaneRadar_t acRadar
 Current radar status. More...
 
struct XPMP2::Aircraft::wakeTy wake
 wake-support data More...
 
XPMPInfoTexts_t acInfoTexts
 Informational texts passed on via multiplayer shared dataRefs. More...
 
int sndMinDist = 50.0
 Minimum distance in [m] to play sound in full volume, the larger the 'louder' the aircraft. More...
 
- Protected Member Functions inherited from XPMP2::Aircraft
void DoMove ()
 Internal: This puts the instance into XP's sky and makes it move. More...
 
void UpdateDistBearingCamera (const XPLMCameraPosition_t &posCam)
 Internal: Update the plane's distance/bearing from the camera location. More...
 
void ClampToGround ()
 Clamp to ground: Make sure the plane is not below ground, corrects Aircraft::drawInfo if needed. More...
 
bool CreateInstances ()
 Create the instances required to represent the plane, return if successful. More...
 
void DestroyInstances ()
 Destroy all instances. More...
 
virtual void ComputeMapLabel ()
 Put together the map label. More...
 
virtual void SetTcasTargetIdx (int _idx)
 Define the TCAS target index in use. More...
 
virtual void SoundSetup ()
 Sound-related initializations, called by Create() and ChangeModel() More...
 
virtual void SoundUpdate ()
 Update sound, like position and volume, called once per frame. More...
 
virtual void SoundRemoveAll ()
 Remove all sound, e.g. during destruction. More...
 
- Static Protected Member Functions inherited from XPMP2::Aircraft
static float FlightLoopCB (float, float, int, void *)
 Internal: Flight loop callback function controlling update and movement of all planes. More...
 
- Protected Attributes inherited from XPMP2::Aircraft
XPMPPlaneID modeS_id = 0
 A plane is uniquely identified by a 24bit number [0x01..0xFFFFFF]. More...
 
bool bValid = true
 is this object valid? (Will be reset in case of exceptions) More...
 
bool bVisible = true
 Shall this plane be drawn at the moment and be visible to TCAS/interfaces? More...
 
bool bRender = true
 Shall the CSL model be drawn in 3D world? (if !bRender && bVivile then still visible on TCAS/interfaces, Remote Client uses this for local senders' planes to take over TCAS but not drawing) More...
 
XPMP2::CSLModelpCSLMdl = nullptr
 the CSL model in use More...
 
int matchQuality = -1
 quality of the match with the CSL model More...
 
int acRelGrp = 0
 related group, ie. line in related.txt in which this a/c appears, if any More...
 
float prev_x = 0.0f
 
float prev_y = 0.0f
 
float prev_z = 0.0f
 
float prev_ts = 0.0f
 last update of prev_x/y/z in XP's network time More...
 
float v_x = 0.0f
 
float v_y = 0.0f
 
float v_z = 0.0f
 Cartesian velocity in m/s per axis. More...
 
float gs_kn = 0.0f
 
float tsResetTouchDown = NAN
 ground speed in [kn] based on above v_x/z More...
 
std::list< XPLMInstanceRef > listInst
 X-Plane instance handles for all objects making up the model. More...
 
int tcasTargetIdx = -1
 Which sim/cockpit2/tcas/targets-index does this plane occupy? [1..63], -1 if none. More...
 
float camTimLstUpd = 0.0f
 Timestamp of last update of camera dist/bearing. More...
 
float camDist = 0.0f
 Distance to camera in meters (updated internally regularly) More...
 
float camBearing = 0.0f
 Bearing from camera in degrees (updated internally regularly) More...
 
XPLMProbeRef hProbe = nullptr
 Y Probe for terrain testing, needed in ground clamping. More...
 
int mapIconRow = 0
 map icon coordinates, row More...
 
int mapIconCol = 0
 map icon coordinates, column More...
 
float mapX = 0.0f
 temporary: map coordinates (NAN = not to be drawn) More...
 
float mapY = 0.0f
 temporary: map coordinates (NAN = not to be drawn) More...
 
std::string mapLabel
 label for map drawing More...
 
SndChTy aSndCh [SND_NUM_EVENTS]
 Operational values per sound channel, that is triggered by a standard sound event. More...
 
bool bChnLowPass = false
 Is Low Pass Filter currently being active? More...
 
bool bChnMuted = false
 Is sound for this aircraft currently muted? More...
 
ChnListTy chnList
 List of channels produced via calls to SoundPlay() More...
 
int skipCounter = 0
 Counts how often we skipped expensive computations. More...
 
-

Detailed Description

-

Subclassing XPMP2::Aircraft to create our own class.

-

Constructor & Destructor Documentation

- -

◆ SampleAircraft()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SampleAircraft::SampleAircraft (const std::string & _icaoType,
const std::string & _icaoAirline,
const std::string & _livery,
XPMPPlaneID _modeS_id = 0,
const std::string & _cslId = "" 
)
-
-inline
-
- -

Constructor just passes on all parameters to library.

- -
-
-

Member Function Documentation

- -

◆ UpdatePosition()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
virtual void SampleAircraft::UpdatePosition (float ,
int  
)
-
-inlinevirtual
-
- -

Custom implementation for the virtual function providing updates values.

- -

Implements XPMP2::Aircraft.

- -
-
-
The documentation for this class was generated from the following file: -
- - - - diff --git a/docs/html/classSampleAircraft.png b/docs/html/classSampleAircraft.png deleted file mode 100644 index f26f061b..00000000 Binary files a/docs/html/classSampleAircraft.png and /dev/null differ diff --git a/docs/html/dir_05cb372b8b5d29a91f8ab8956535a165.html b/docs/html/dir_05cb372b8b5d29a91f8ab8956535a165.html deleted file mode 100644 index 39f281d9..00000000 --- a/docs/html/dir_05cb372b8b5d29a91f8ab8956535a165.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample Directory Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
XPMP2-Sample Directory Reference
-
-
- - - - -

-Directories

directory  lib
 
- - - - -

-Files

file  XPMP2-Sample.cpp
 Example plugin demonstrating XPMP2 techniques.
 
-
- - - - diff --git a/docs/html/dir_51881af2d47c8c327d633c4b13cbc753.html b/docs/html/dir_51881af2d47c8c327d633c4b13cbc753.html deleted file mode 100644 index abef1205..00000000 --- a/docs/html/dir_51881af2d47c8c327d633c4b13cbc753.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/lib/fmod Directory Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
fmod Directory Reference
-
-
- - - - -

-Directories

directory  logo
 
-
- - - - diff --git a/docs/html/dir_697d5b740a2e246e51f61ae622e5094c.html b/docs/html/dir_697d5b740a2e246e51f61ae622e5094c.html deleted file mode 100644 index dfcebe62..00000000 --- a/docs/html/dir_697d5b740a2e246e51f61ae622e5094c.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/lib Directory Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
lib Directory Reference
-
-
- - - - -

-Directories

directory  fmod
 
-
- - - - diff --git a/docs/html/dir_7370f38adb3ae597f7d725dcce8bc0c8.html b/docs/html/dir_7370f38adb3ae597f7d725dcce8bc0c8.html deleted file mode 100644 index b70b8efc..00000000 --- a/docs/html/dir_7370f38adb3ae597f7d725dcce8bc0c8.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Sample/lib/fmod/logo Directory Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
logo Directory Reference
-
-
- - - - - - - - -

-Files

file  FMOD_Logo.cpp
 Compressed version of the FMOD logo with code to create a texture ID in X-Plane for display with Dear ImGui.
 
file  FMOD_Logo.h [code]
 Compressed version of the FMOD logo with code to create a texture ID in X-Plane for display with Dear ImGui.
 
-
- - - - diff --git a/docs/html/dir_ee4fc00837492ac40974302c5064a581.html b/docs/html/dir_ee4fc00837492ac40974302c5064a581.html deleted file mode 100644 index df8ee8c7..00000000 --- a/docs/html/dir_ee4fc00837492ac40974302c5064a581.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - -XPMP2: XPMP2-Remote Directory Reference - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - - -
-
-
-
XPMP2-Remote Directory Reference
-
-
- - - - - - - - - - - - - - - - - - - - -

-Files

file  Client.cpp
 Main Client functionality, processing received data.
 
file  Client.h [code]
 Main Client functionality, processing received data.
 
file  Utilities.cpp
 Miscellaneous utility functions, including logging.
 
file  Utilities.h [code]
 Miscellaneous utility functions, including logging.
 
file  XPMP2-Remote.cpp
 XPMP2 Remote Client: Displays aircraft served from other XPMP2-based plugins in the network.
 
file  XPMP2-Remote.h [code]
 XPMP2 Remote Client: Displays aircraft served from other XPMP2-based plugins in the network.
 
-
- - - - diff --git a/docs/html/globals_b.html b/docs/html/globals_b.html deleted file mode 100644 index a9bd290f..00000000 --- a/docs/html/globals_b.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - -XPMP2: File Members - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
Here is a list of all file members with links to the files they belong to:
- -

- b -

-
- - - - diff --git a/docs/html/globals_g.html b/docs/html/globals_g.html deleted file mode 100644 index c2889be6..00000000 --- a/docs/html/globals_g.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - -XPMP2: File Members - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
Here is a list of all file members with links to the files they belong to:
- -

- g -

-
- - - - diff --git a/docs/html/globals_h.html b/docs/html/globals_h.html deleted file mode 100644 index 47eb4619..00000000 --- a/docs/html/globals_h.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - -XPMP2: File Members - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
Here is a list of all file members with links to the files they belong to:
- -

- h -

-
- - - - diff --git a/docs/html/globals_n.html b/docs/html/globals_n.html deleted file mode 100644 index fef9cd2e..00000000 --- a/docs/html/globals_n.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - -XPMP2: File Members - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
Here is a list of all file members with links to the files they belong to:
- -

- n -

-
- - - - diff --git a/docs/html/globals_r.html b/docs/html/globals_r.html deleted file mode 100644 index 815d0bb5..00000000 --- a/docs/html/globals_r.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - -XPMP2: File Members - - - - - - -
-
- - - - - - -
-
XPMP2 -
-
X-Plane multiplayer library 2 - using instancing
-
-
- - - - - - -
-
-
Here is a list of all file members with links to the files they belong to:
- -

- r -

-
- - - - diff --git a/docs/html/index.html b/docs/html/index.html index cc2219c7..048cf0b4 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -44,7 +44,7 @@

-

+

API

Required Header Files

A new plugin, which wants to use the XPMP2 library, needs to include the following 2 header files, provided in the inc folder:

@@ -65,7 +65,7 @@

Additional Header Files

Sound Support by FMOD

XPMP2's Audio Engine is FMOD Core API by Firelight Technologies Pty Ltd. Understand FMOD licensing and attribution requirements first, as they will apply to your plugin if using XPMP2 with sound support.

Because of the licensing requirements, XPMP2 by default is built without sound support. See the Sound Support documentation for details how to enable sound support and how to include it into your plugin.

-

+

Quick Links to Detailed Documentation:

+
+
+
Contrails
+
+
+

XPMP2 can add contrails to planes. This is achieved by instantiating one additional object per contrail at the same position as the actual plane. This object Resources/Contrail/Contrail.obj has no tris, but only holds a reference to a particle system file, Contrail.pss. The contrail is then created through X-Plane's particle system.

+

Disable

+

If you don't want contrails at all, you need to return 0 for the two config items XPMP_CFG_ITM_CONTR_MIN_ALT and XPMP_CFG_ITM_CONTR_MAX_ALT. In that case you don't even need to provide the Resources/Contrail folder with your deployment.

+

Deployment

+

If you want to make use of contrails, you need to ship the Resources/Contrail folder with all its 3 files with your plugin.

+

Default

+

By default, ie. without any provision in code, a single contrail will be generated for jet aircraft flying in an altitude between 25,000 and 45,000 ft.

+

Configuration of Automatic Contrails

+

XPMP2 asks for four contrail-related configuration items, with which you can fine-tune how XPMP2 automatically generates contrails. This should be sufficient for most usages, even complex plugins like LiveTraffic only provide pass-through configuration options for these four parameters, but no self-development implementation.

+ + + + + + + + + + + +
Config item Default Description
XPMP_CFG_ITM_CONTR_MIN_ALT 25000 Minimum altitude in feet for automatic contrail generation
XPMP_CFG_ITM_CONTR_MAX_ALT 45000 Maximum altitude in feet for automatic contrail generation; set both min and max altitude to 0 to switch off automatic contrails
XPMP_CFG_ITM_CONTR_LIFE 25 Default maximum lifetime of contrail puffs in seconds, determines contrail length
XPMP_CFG_ITM_CONTR_MULTI 0 Boolean: Shall multiple contrails be auto-created (one per engine), or just one?
+

Keep in mind that contrails, using the particle system, may have the potential to affect performance. That's why by default just a single contrail is generated.

+

More Control

+

If you need more control and want to direct yourself when how many contrails are shown, you should switch off the auto-generation by returning 0 to both XPMP_CFG_ITM_CONTR_MIN_ALT and XPMP_CFG_ITM_CONTR_MAX_ALT, and then call either of the following two member functions of XPMP2::Aircraft:

+
    +
  • ContrailTrigger() tells XPMP2 to check the plane's engine type, and if it is jet then a contrail (or even multiple, depending on config XPMP_CFG_ITM_CONTR_MULTI) are created. This is the function internally used by the auto-generation mechanism once a plane is in the right altitude.
  • +
  • ContrailRequest (unsigned num, unsigned dist_m = 0, unsigned lifeTime = 0) allows even more control by specifying the number of contrails, its spacing, and the life time.
  • +
+

Last but not least, there's ContrailRemove() to remove contrails.

+
+
+ + + + diff --git a/docs/html/md_docs_CopyingObjFiles.html b/docs/html/md_docs_CopyingObjFiles.html index b9000b29..530444d9 100644 --- a/docs/html/md_docs_CopyingObjFiles.html +++ b/docs/html/md_docs_CopyingObjFiles.html @@ -60,7 +60,7 @@ models  replace_texture     int     1    Replace textures in OBJ8 files upon load if needed (specified on the OBJ8 line in xsb_aircraft.txt), creating new OBJ8 files -

+

General Notes on Copied Files

If copying takes place, then a new .obj file is written into the same folder next to the original one. The file name of the copy is as follows:

Each copied file includes a comment in line 4 stating its origin:

# Created by <PluginLogAcronym>/XPMP2 based on Resources/plugins/LiveTraffic/Resources/X-CSL/A320/A320fCFMfan.obj
-

+

Replacing dataRefs

This is off by default, because well curated packages won't need it. To enable it return 1 when called for configuration item XPMP_CFG_ITM_REPLDATAREFS.

When enabled, a copy for each .obj file will be created just before it is to be loaded. In each copy, dataRefs are replaced based on the definition in <resourceDir>/Obj8DataRefs.txt. That file just lists dataRef names to be replaced with the replacement dataRef like this:

cjs/world_traffic/engine_rotation_angle1 libxplanemp/engines/engine_rotation_angle_deg1
cjs/world_traffic/main_gear_deflection libxplanemp/gear/tire_vertical_deflection_mtr

The Obj8DataRefs.txt file available with XPMP2 defines a number of replacements to unlock more features in the Bluebell CSL models. The simple text format allows you to add/change replacement definitions easily and ship your version with your plugin.

-

+

Replacing Texture

This is on by default. You could switch it off by returning 0 when asked for configuration item XPMP_CFG_ITM_REPLTEXTURE.

A copy will only be initiated if additional textures are defined as 4th (and optionally 5th) parameter with the OBJ8 command in xsb_aircraft.txt.

diff --git a/docs/html/md_docs_Deploying.html b/docs/html/md_docs_Deploying.html index e45392df..fd847ff3 100644 --- a/docs/html/md_docs_Deploying.html +++ b/docs/html/md_docs_Deploying.html @@ -43,12 +43,12 @@
Deploying XPMP2-based Plugins
-

+

FMOD Sound Support (XP11/Windows)

If you built XPMP2 and your plugin with FMOD Sound Support, and you want to allow running your plugin with X-Plane 11 under Windows, then you should ship the fmod.dll, too, as

win_x64/fmod.dll

next to your plugin's Windows version. Find api/core/lib/x64/fmod.dll in the Windows version of the FMOD Core API that you had downloaded from FMOD.

The reason is that X-Plane updated the FMOD versions included in X-Plane between XP11 and XP12. While XPMP2 is built in a way that it can run with either version, XP11 ships a DLL by the name of fmod64.dll while XPMP2 expects it by the name fmod.dll as XP12 provides it.

-

+

Resources

XPMP2 needs a couple additional files to work. In your calls to XPMPMultiplayerInit and XPMPLoadCSLPackage you provide the locations to the folders holding these files.

You should ship all the files provided in the Resources folder:

@@ -57,13 +57,14 @@

  • MapIcons.png contains the aircraft icons displayed in the additional map layer. Without this file that map layer cannot be created.
  • related.txt defines "similar looking" aircraft types, so that an A320 model could be used if no exact match for the A319 at hand is found. Without that file this "related" matching cannot take place.
  • Obj8DataRefs.txt is only required for the "Copying .OBJ Files" functionality: It defines dataRef replacements. You don't need to ship this file if you do not enable that functionality in your plugin.
  • +
  • Contrail folder with 3 files, Contrail.obj/.png/.pss; this is needed for drawing contrails. If missing, contrails aren't available. The folder is not needed if you disable contrails.
  • These files have all to be installed in the same folder. It is good practice to install these files in a folder named Resources in the plugin's folder. Your plugin provides XPMP2 with the folder location in the resourceDir parameter of the XPMPMultiplayerInit call (see XPMPMultiplayer.h for more details).

    You do not need to and shall not ship the XPMP2 Remote Client with your plugin. This plugin is maintained and provided centrally. Please refer your users to

    -

    +

    CSL Models

    CSL Models are not shipped with XPMP2. They are available as separate downloads. Recommended sources are:

      diff --git a/docs/html/md_docs_HowTo.html b/docs/html/md_docs_HowTo.html index 54667ab7..19ed58d5 100644 --- a/docs/html/md_docs_HowTo.html +++ b/docs/html/md_docs_HowTo.html @@ -44,7 +44,7 @@

    This page probably requires more attention... but there is a working sample plugin available in the XPMP2-Sample folder for you to study:

    -

    +

    Sample Plugin

    This package comes with a sample plugin in the XPMP2-Sample folder. It is a complete plugin including build projects and CMake setup. It displays 3 aircraft flying circles in front of the user's plane. Each of the 3 aircraft is using a different technology: the now recommended way of subclassing XPMP2::Aircraft, the legacy way of subclassing XPCAircraft (as used by LiveTraffic v1.x), and by calling standard C functions.

    For the sample plugin to work you need to follow instruction in Deploying XPMP2-based Plugins for

    @@ -66,10 +66,10 @@

    Obj8DataRefs.txt
    related.txt
    win_x64/XPMP2-Sample.xpl
    -

    +

    Binaries and Header Files

    You don't need to build the library yourself if you don't want. Archives with headers and release/debug builds are available in the Release section here on GitHub.

    -

    +

    Anatomy of Your Plugin using XPMP2

    Generically you should probably use XPMP2 as follows:

    -

    +

    Subclass <tt>XPMP2::Aircraft</tt>

    New plugin implementations are strongly advised to directly sub-class from the new class XPMP2::Aircraft, which is the actual aircraft representation.

    See the SampleAircraft class defined in XPMP2-Sample/XPMP2-Sample.cpp for an example implementation.

    diff --git a/docs/html/md_docs_Matching.html b/docs/html/md_docs_Matching.html index 1c73b030..7f6af6c7 100644 --- a/docs/html/md_docs_Matching.html +++ b/docs/html/md_docs_Matching.html @@ -48,7 +48,7 @@
  • upon creation of a new plane, preferably by instantiating a new object of your aircraft class derived from XPMP2::Aircraft,
  • when specifically instructed, e.g. by calling XPMP2::Aircraft::ChangeModel or XPMP2::Aircraft::ReMatchModel.
  • -

    +

    Input

    Matching is based on 3 input parameters:

    This page explains the technical background of the XPMP2 Remote functionality. For end user documentation refer to LiveTraffic/XPMP2 Remote Client documentation.

    -

    +

    Support in your Plugin

    You do not need to do anything specifically in your plugin to support the Remote functionality. Just build and link with the latest XPMP2 library. Don't even ship the Remote Client, but refer to the download location, which is maintained centrally.

    Optionally, you could respond to the new XPMP_CFG_ITM_SUPPORT_REMOTE configuration item in your XPMPIntPrefsFuncTy configuration callback function, e.g. to provide the user with an option to switch Remote support on regardless of network configuration. However, the default, "auto-detect", works in by far most scenarios already. And in the few others the users would still have the chance to use the XPMP2.prf config file as documented.

    Optionally, you could react to an inter-plugin message XPLM_MSG_RELEASE_PLANES from the XPMP2 Remote Client and cede TCAS/AI control in that case because the Remote Client will take care of your TCAS in that case, too, but will also have the chance to pick up planes of other XPMP2-based plugins. See LiveTraffic's XPluginReceiveMessage function for an example.

    -

    +

    Basic Ideas

    • There are senders (the actual XPMP2-based plugins) disseminating position information via UDP multicst into the local network.
    • @@ -93,10 +93,10 @@

    -

    +

    Application Architecture

    XPMP2 Remote Architecture

    -

    +

    Network Message "Protocol"

    • Plugin's settings RemoteMsgSettingsTy (grey)
        diff --git a/docs/html/md_docs_SharedDataRefs.html b/docs/html/md_docs_SharedDataRefs.html index 959302d8..fad4d60b 100644 --- a/docs/html/md_docs_SharedDataRefs.html +++ b/docs/html/md_docs_SharedDataRefs.html @@ -45,7 +45,7 @@

        Textual aircraft and flight information is provided via shared dataRefs of type xplmType_Data as suggested by FSTramp. This information is offered to 3rd party plugins, which want to show (information of) AI planes like camera or map plugins.

        DRE and DRT are informed about these dataRef names as soon as the first aircraft is created. So you can use either to have a peek.

        -

        +

        Information offered by XPMP2-based Plugin

        The names of the shared dataRefs follow the naming conventions known from pre-XP11.50 times when there were just 19 multiplayer planes support with similarly named dataRefs for position and configuration information. For each plane there is a set of dataRefs, each dataRef contains up to 40 byte data to be interpreted as a zero-terminated C string.

        XPMP2 creates and maintains up to 63 sets of these dataRefs, starting at sim/multiplayer/position/plane1_tailnum and ending at sim/multiplayer/position/plane63_apt_to.

        @@ -75,7 +75,7 @@

        plane#_cslModel n/a CSL Model name *)

        *) _cslModel differs from the others in that it is not related to live flight information but to the way the plane is rendered by the XPMP2-based plugin. It returns the CSL model used as returned by XPMP2::Aircraft::GetModelName(), that is: last folder name plus model id.

        -

        +

        Usage by 3rd-Party Plugins

        A plugin that wants to use this data

          @@ -87,7 +87,7 @@

        • can then query current information via XPLMGetDatab as usual. Provide at least a 40 character buffer to be on the safe side.
        -

        +

        Additional links

        • Download page for "FSTrampFree" where the above shared dataRefs were originally suggested for implementation
        • diff --git a/docs/html/md_docs_TCAS.html b/docs/html/md_docs_TCAS.html index 74899428..76a3b92a 100644 --- a/docs/html/md_docs_TCAS.html +++ b/docs/html/md_docs_TCAS.html @@ -52,7 +52,7 @@
        • In a call to XPLMSetActiveAircraftCount X-Plane is informed about the exact number of provided planes. (This might not be strictly necessary, but probably a cleaner approach than to wait 10 cylces for not updated dataRefs to be taken out of X-Plane's consideration.)

        When TCS Override is not available (like up to X-Plane 11.41), then TCAS is provided by writing the classic multiplayer dataRefs directly.

        -

        +

        Slotting

        There is a limited number of "slots" available for TCAS/multiplayer purposes. With TCAS Override, this is currently 63, with classic multiplayer dataRefs, this is up to 19, though for many 3rd party plugins the number of actually configured AI Aircraft (X-Planes Flight Setup) plays a role, too.

        XPMP2 will show the aircraft closest to current camera location. This set of aircraft will change over time. But XPMP2 will try to keep a plane, which once was shown on TCAS, in the same slot to make it easier for 3rd party plugins to follow one plane.

        @@ -63,7 +63,7 @@

      • XPMP2 will fill a continuous set of slots starting at 1. If a plane is removed, which occupied a slot in the middle then another plane will take it (potentially moving down from the upper range to the lower range).
      • Also, if a plane is moved between lower and upper range because it moved ranks in the order by distance, then it changes slots.
      -

      +

      TCAS Target dataRefs

      XPMP2 writes the folloing TCAS target dataRefs when it has TCAS control:

      @@ -118,7 +118,7 @@

      weight_on_wheels -
      -

      +

      Classic AI/Multiplayer support

      ...is provided by X-Plane automatically when feeding above TCAS target dataRefs. That means: The lower 19 planes are mirrored into the well-known sim/multiplayer/position/plane#_* dataRefs. Plugins still relying on these dataRefs will mainly "just work". And this without any workarounds like defining AI Aircraft in X-Plane's settings!

      Please note that XPLMCountAircraft can now return values larger than 20, up to 64 at the moment.

      diff --git a/docs/html/md_docs_Wake.html b/docs/html/md_docs_Wake.html index d905a6b5..ef66ab2e 100644 --- a/docs/html/md_docs_Wake.html +++ b/docs/html/md_docs_Wake.html @@ -50,7 +50,7 @@
    • Lift
    • Angle of Attack (AoA)
    -

    +

    Defaults

    As a trade-off between complexity (knowing exact wing dimensions and weight/lift of any plane) and results (strength of the wake) XPMP2 applies defaults to the aircraft dimensions based on the Wake Turbulence Category (WTC) listed in the Doc8643 data, which is looked up based on the icaoType. If the icaoType isn't found then a default WTC of M is assumed.

    So even if you don't provide any overrides in your plugin implementation, there's are reasonable factors in place to provide about matching wakes:

    @@ -71,7 +71,7 @@

    with Weight = Empty Weight + 80% * (MTOW - Empty Weight)

    Default Lift is Weight multiplied by 9.81, ie. standard gravity. No g load is taken into account.

    Default AoA is the plane's pitch, which should be fairly accurate.

    -

    +

    Overriding Values in Your Plugin

    A plugin using XPMP2 can opt to provide its own values for even more precice results. Search XPMP2Aircraft.h for "Wake support" to find the group of functions to support wake tubulence definition.

    WakeApplyDefaults() sets wing span, area, and weight as per above defaults.

    diff --git a/docs/html/md_docs_XSBAircraftFormat.html b/docs/html/md_docs_XSBAircraftFormat.html index 4b3bba6c..cf3ff7c9 100644 --- a/docs/html/md_docs_XSBAircraftFormat.html +++ b/docs/html/md_docs_XSBAircraftFormat.html @@ -45,7 +45,7 @@

    The xsb_aircraft.txt file describes the content of one CSL model package. XPMP2 reads the file to learn about available CSL models and which ICAO aircraft type designators, airlines, and special liveries they match.

    The original file format supported more commands necessary to support older formats like .acf or OBJ7. XPMP2 only supported OBJ8 models and processes only the commands listed here. Others are ignored. They may raise warnings in Log.txt but otherwise do no harm.

    -

    +

    Example

    The following is taken from the beginning of Bluebell's xsb_aircraft.txt file in its BB_Airbus folder:

    EXPORT_NAME __Bluebell_Airbus
    @@ -59,7 +59,7 @@

    OBJ8 SOLID YES __Bluebell_Airbus/A306/A306_AHK.obj
    VERT_OFFSET 4.6
    AIRLINE A306 AHK
    -

    +

    Structure

    A xsb_aircraft.txt file starts defining one (or even more) package name(s) using the EXPORT_NAME command. Packages are identified by these names, which are then used as a root name to define the .obj file locations.

    Then follow one or typically many aircraft definitions. Each aircraft definition starts with an OBJ8_AIRCRAFT command defining a package-unique id. XPMP2 expects the combination of EXPORT_NAME and OBJ8_AIRCRAFT name to be unique and ignores any duplicates (with a warning written to Log.txt).

    @@ -73,7 +73,7 @@

    -

    +

    Commands

    EXPORT_NAME

    EXPORT_NAME <package_name>
    diff --git a/docs/html/md_docs_index.html b/docs/html/md_docs_index.html index 2cbdb17e..4c53f798 100644 --- a/docs/html/md_docs_index.html +++ b/docs/html/md_docs_index.html @@ -53,6 +53,7 @@
  • [ ] Additional map layer
  • [X] Wake Turbulence Support
  • [X] Sound Support by FMOD
  • +
  • [X] Contrails
  • [X] Shared dataRefs providing textual aircraft / flight information to interested 3rd party plugins
  • [X] XPMP2 Remote functionality
  • @@ -72,14 +73,14 @@ -

    +

    Requirements

    • XPMP2 implements instancing, so it requires X-Plane 11.10 or later
    • CSL models in OBJ8 format (ie. older OBJ7 models are no longer supported)
    • Potentially an FMOD license if built with sound support, see below in Sound Support by FMOD
    -

    +

    Coding, Building, Deployment

    These aspects are relevant for developers using XPMP2 in their own plugin:

    Building XPMP2

    @@ -97,7 +98,7 @@

    Backward Compatibility

    If you are familiar with the original libxplanemp and are using it already in your plugins, then you will find these information on backward compatibility useful, which explain how you can replace libxplanemp with XPMP2 with limited effort.

    Deploying Your Plugin

    Apart from the binaries that you build you will need to ship the files provided here in the 'Resources' folder. Also, users will need to install CSL models. Find more details here.

    -

    +

    CSL Models and Packages

    These aspects are relevant for CSL model developers and package providers:

    xsb_aircraft.txt File Format

    @@ -106,7 +107,7 @@

    dataRefs available to CSL Models

    To drive CSL models' ANIMations, a long list of dataRefs is provided by XPMP2. See its documentation here.

    Copying .obj files on load

    CSL packages come in different flavours. Popular ones for general use are the Bluebell and the X-CSL packages. Both come with different history. For XPMP2 to use all their features it needs to change their .obj files. Performing these changes is built into XPMP2. See here for details.

    -

    +

    Links to outside locations

    TCAS Override

    The TCAS Override approach explains how TCAS information is provided, the classic multiplayer dataRefs are maintained and how 3rd party plugins can access this information. XPMP2 publishes data via the sim/cockpit2/tcas/targets dataRefs.

    diff --git a/docs/html/namespaceFMODLogo.html b/docs/html/namespaceFMODLogo.html deleted file mode 100644 index f076afe8..00000000 --- a/docs/html/namespaceFMODLogo.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - -XPMP2: FMODLogo Namespace Reference - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    -
    - -
    -
    FMODLogo Namespace Reference
    -
    -
    - - - - - - - - -

    -Functions

    uint8_t * LoadRGBA (bool bBlack=true)
     Load the data of the FMOD logo, expanded into RGBA data. More...
     
    bool GetTexture (int &texId, bool bBlack=true)
     The one "public" function to return a texture id for the logo. More...
     
    - - - - - - - - - - - - - - - - -

    -Variables

    constexpr size_t RLE_SIZE = 5527
     number of array entries in the RLE array More...
     
    const uint16_t ALPHA_RLE [RLE_SIZE]
     Run-length encoded data of the Alpha value of each pixel in the FMOD logo. More...
     
    constexpr int IMG_WIDTH = 728
     Logo image width. More...
     
    constexpr int IMG_HEIGHT = 192
     Logo image height. More...
     
    constexpr int IMG_SIZE = IMG_WIDTH * IMG_HEIGHT
     Logo image size in number of pixels. More...
     
    -

    Function Documentation

    - -

    ◆ GetTexture()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    bool FMODLogo::GetTexture (int & texId,
    bool bBlack = true 
    )
    -
    - -

    The one "public" function to return a texture id for the logo.

    -

    On first call will load the logo and create a texture from it, on subsequent calls will return the already loaded id.

    Parameters
    - - - -
    [out]texIdreceives the texture id for the (black or white) FMOD logo
    bBlack[opt] Black or White logo? (Will return different texture ids)
    -
    -
    -
    Returns
    true if successful
    - -
    -
    - -

    ◆ LoadRGBA()

    - -
    -
    - - - - - - - - -
    uint8_t * FMODLogo::LoadRGBA (bool bBlack = true)
    -
    - -

    Load the data of the FMOD logo, expanded into RGBA data.

    -

    This function is internally used by GetTexture(). It is not typically used publicly but provided just in case what you need is not an OpenGL texture but the raw RGBA data. Data is provided in 4-byte blocks, one byte per RGBA value. The returned array has size IMG_SIZE * 4. Caller has to free the data using delete[].

    Returns
    pointer to raw RGBA data, 4 bytes per pixel.
    - -
    -
    -

    Variable Documentation

    - -

    ◆ ALPHA_RLE

    - -
    -
    - - - - -
    const uint16_t FMODLogo::ALPHA_RLE[RLE_SIZE]
    -
    - -

    Run-length encoded data of the Alpha value of each pixel in the FMOD logo.

    - -
    -
    - -

    ◆ IMG_HEIGHT

    - -
    -
    - - - - - -
    - - - - -
    constexpr int FMODLogo::IMG_HEIGHT = 192
    -
    -constexpr
    -
    - -

    Logo image height.

    - -
    -
    - -

    ◆ IMG_SIZE

    - -
    -
    - - - - - -
    - - - - -
    constexpr int FMODLogo::IMG_SIZE = IMG_WIDTH * IMG_HEIGHT
    -
    -constexpr
    -
    - -

    Logo image size in number of pixels.

    - -
    -
    - -

    ◆ IMG_WIDTH

    - -
    -
    - - - - - -
    - - - - -
    constexpr int FMODLogo::IMG_WIDTH = 728
    -
    -constexpr
    -
    - -

    Logo image width.

    - -
    -
    - -

    ◆ RLE_SIZE

    - -
    -
    - - - - - -
    - - - - -
    constexpr size_t FMODLogo::RLE_SIZE = 5527
    -
    -constexpr
    -
    - -

    number of array entries in the RLE array

    - -
    -
    -
    - - - - diff --git a/docs/html/pages.html b/docs/html/pages.html index 213e1c77..603e53be 100644 --- a/docs/html/pages.html +++ b/docs/html/pages.html @@ -47,19 +47,20 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + +
     Backwards Compatibilty
     Building XPMP2 and the Sample Plugin
     Copying <tt>.obj</tt> Files for Replacing Animation dataRefs and Textures
     dataRefs available to CSL Models
     Deploying XPMP2-based Plugins
     How to Use XPMP2
     XPMP2 - Developer's documentation
     Model Matching
     XPMP2 Remote Functionality
     Shared dataRefs providing Textual Aircraft / Flight Information
     Sound Support by FMOD
     TCAS and AI/multiplayer Support
     Wake Turbulence Support
     <tt>xsb_aircraft.txt</tt> File format
     Deprecated List
     Contrails
     Copying <tt>.obj</tt> Files for Replacing Animation dataRefs and Textures
     dataRefs available to CSL Models
     Deploying XPMP2-based Plugins
     How to Use XPMP2
     XPMP2 - Developer's documentation
     Model Matching
     XPMP2 Remote Functionality
     Shared dataRefs providing Textual Aircraft / Flight Information
     Sound Support by FMOD
     TCAS and AI/multiplayer Support
     Wake Turbulence Support
     <tt>xsb_aircraft.txt</tt> File format
     Deprecated List
    diff --git a/docs/html/src_2Utilities_8cpp.html b/docs/html/src_2Utilities_8cpp.html deleted file mode 100644 index 948d6bfb..00000000 --- a/docs/html/src_2Utilities_8cpp.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - -XPMP2: src/Utilities.cpp File Reference - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - - -
    -
    - -
    -
    Utilities.cpp File Reference
    -
    -
    - -

    Miscellaneous utility functions, including logging. -More...

    -
    #include "XPMP2.h"
    -
    - - - - -

    -Namespaces

     XPMP2
     Defined by FMOD.
     
    - - - -

    -Macros

    #define S_ISDIR(m)   (((m) & _S_IFMT) == _S_IFDIR)
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    int XPMP2::PrefsFuncIntDefault (const char *, const char *, int _default)
     Default config function just always returns the provided default value. More...
     
    bool XPMP2::ExistsFile (const std::string &filename)
     Does a file path exist? More...
     
    bool XPMP2::IsDir (const std::string &path)
     Is path a directory? More...
     
    bool XPMP2::CreateDir (const std::string &path)
     Create directory if it does not exist. More...
     
    bool XPMP2::CopyFileIfNewer (const std::string &source, const std::string &destDir)
     Copy file if source is newer or destination missing. More...
     
    std::list< std::string > XPMP2::GetDirContents (const std::string &path)
     List of files in a directory (wrapper around XPLMGetDirectoryContents) More...
     
    std::istream & XPMP2::safeGetline (std::istream &is, std::string &t)
     Read a line from a text file, no matter if ending on CRLF or LF. More...
     
    const std::string & XPMP2::GetXPSystemPath ()
     Returns XP's system directory, including a trailing slash. More...
     
    std::string XPMP2::StripXPSysDir (const std::string &path)
     If a path starts with X-Plane's system directory it is stripped. More...
     
    void XPMP2::RemoveExtension (std::string &path)
     Removes everything after the last dot, the dot including. More...
     
    std::string & XPMP2::str_tolower (std::string &s)
     change a std::string to uppercase More...
     
    std::vector< std::string > XPMP2::str_tokenize (const std::string s, const std::string tokens, bool bSkipEmpty=true)
     separates string into tokens More...
     
    std::uint16_t XPMP2::PJWHash16 (const char *s)
     Produces a reproducible(!) hash value for strings. More...
     
    float XPMP2::headDiff (float head1, float head2)
     (Shortest) difference between 2 angles: How much to turn to go from h1 to h2? More...
     
    float XPMP2::GetMiscNetwTime ()
     Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt. More...
     
    std::string XPMP2::GetMiscNetwTimeStr (float _time=NAN)
     Return the network time as a string like used in the XP's Log.txt. More...
     
    const char * XPMP2::GetGraphicsDriverTxt ()
     Text string for current graphics driver in use. More...
     
    bool XPMP2::IsPaused ()
     X-Plane in a Pause state? More...
     
    bool XPMP2::IsViewExternal ()
     Is current X-Plane view an external view (outside a cockpit)? More...
     
    bool XPMP2::CheckEverySoOften (float &_lastCheck, float _interval, float _now)
     Convenience function to check on something at most every x seconds. More...
     
    const char * XPMP2::LogGetString (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
     Returns ptr to static buffer filled with formatted log string. More...
     
    void XPMP2::LogMsg (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2_FMTARGS(5)
     Log Text to log file. More...
     
    - - - - - - -

    -Variables

    GlobVars XPMP2::glob
     The one and only global variable structure. More...
     
    const char * XPMP2::LOG_LEVEL []
     
    -

    Detailed Description

    -

    Miscellaneous utility functions, including logging.

    -
    Author
    Birger Hoppe
    - -

    Macro Definition Documentation

    - -

    ◆ S_ISDIR

    - -
    -
    - - - - - - - - -
    #define S_ISDIR( m)   (((m) & _S_IFMT) == _S_IFDIR)
    -
    - -
    -
    -
    - - - - diff --git a/docs/html/src_2Utilities_8h.html b/docs/html/src_2Utilities_8h.html deleted file mode 100644 index 23cc56a2..00000000 --- a/docs/html/src_2Utilities_8h.html +++ /dev/null @@ -1,565 +0,0 @@ - - - - - - - -XPMP2: src/Utilities.h File Reference - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - - -
    -
    - -
    -
    Utilities.h File Reference
    -
    -
    - -

    Miscellaneous utility functions, including logging. -More...

    - -

    Go to the source code of this file.

    - - - - - -

    -Namespaces

     XPMP2
     Defined by FMOD.
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Macros

    #define ERR_ASSERT   "ASSERT FAILED: %s"
     
    #define ERR_EXCEPTION   "EXCEPTION CAUGHT: %s"
     
    #define PATH_DELIM_STD   '/'
     
    #define WHITESPACE   " \t\f\v\r\n"
     
    #define XPMP2_FMTARGS(FMT)
     To apply printf-style warnings to our functions. More...
     
    #define LOG_MSG(lvl, ...)
     Log a message if lvl is greater or equal currently defined log level. More...
     
    #define LOG_MATCHING(lvl, ...)
     Log a message about matching if logging of model matching is enabled. More...
     
    #define THROW_ERROR(...)   throw XPMP2Error(__FILE__, __LINE__, __func__, __VA_ARGS__);
     Throws an exception using XPMP2Error. More...
     
    #define LOG_ASSERT(cond)
     Throw in an assert-style (logging takes place in XPMP2Error constructor) More...
     
    #define CATCH_AC(ac)
     Standard catch clauses for dealing with aircraft: logs message, sets aircraft invalid. More...
     
    #define STRCPY_S(dest, src)   strncpy_s(dest,sizeof(dest),src,sizeof(dest)-1)
     Simpler access to strncpy_s if dest is a char array (not a pointer!) More...
     
    #define STRCPY_ATMOST(dest, src)   strncpy_s(dest,sizeof(dest),strAtMost(src,sizeof(dest)-1).c_str(),sizeof(dest)-1)
     
    #define SET_THREAD_NAME(sName)
     
    - - - - -

    -Enumerations

    enum  XPMP2::logLevelTy {
    -  XPMP2::logDEBUG = 0 -, XPMP2::logINFO -, XPMP2::logWARN -, XPMP2::logERR -,
    -  XPMP2::logFATAL -, XPMP2::logMSG -
    - }
     Logging level. More...
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    int XPMP2::PrefsFuncIntDefault (const char *, const char *, int _default)
     Default config function just always returns the provided default value. More...
     
    float XPMP2::PrefsFuncFloatDefault (const char *, const char *, float _default)
     
    bool XPMP2::ExistsFile (const std::string &filename)
     Does a file path exist? More...
     
    bool XPMP2::IsDir (const std::string &path)
     Is path a directory? More...
     
    bool XPMP2::CreateDir (const std::string &path)
     Create directory if it does not exist. More...
     
    bool XPMP2::CopyFileIfNewer (const std::string &source, const std::string &destDir)
     Copy file if source is newer or destination missing. More...
     
    std::list< std::string > XPMP2::GetDirContents (const std::string &path)
     List of files in a directory (wrapper around XPLMGetDirectoryContents) More...
     
    std::istream & XPMP2::safeGetline (std::istream &is, std::string &t)
     Read a line from a text file, no matter if ending on CRLF or LF. More...
     
    const std::string & XPMP2::GetXPSystemPath ()
     Returns XP's system directory, including a trailing slash. More...
     
    std::string XPMP2::StripXPSysDir (const std::string &path)
     If a path starts with X-Plane's system directory it is stripped. More...
     
    void XPMP2::RemoveExtension (std::string &path)
     Removes everything after the last dot, the dot including. More...
     
    std::string & XPMP2::str_tolower (std::string &s)
     change a std::string to uppercase More...
     
    std::string & XPMP2::rtrim (std::string &s, const char *t=WHITESPACE)
     trimming of string (from right) More...
     
    std::string & XPMP2::ltrim (std::string &s, const char *t=WHITESPACE)
     trimming of string (from left) More...
     
    std::string & XPMP2::trim (std::string &s, const char *t=WHITESPACE)
     trimming of string (from both ends) More...
     
    std::string XPMP2::leftOf (const std::string &s, const std::string &terminators)
     Returns everything left of any of terminators. More...
     
    std::vector< std::string > XPMP2::str_tokenize (const std::string s, const std::string tokens, bool bSkipEmpty=true)
     separates string into tokens More...
     
    template<class T >
    XPMP2::rad2deg (const T _rad)
     Convert radians to degrees, normalized to [0..360) More...
     
    template<class T >
    XPMP2::deg2rad (const T _deg)
     Convert degree to radians. More...
     
    template<class T >
    XPMP2::sqr (const T a)
     Square. More...
     
    template<class T >
    XPMP2::dist (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
     Pythagorean distance between two points in a 3-D world. More...
     
    float XPMP2::atan2deg (float x, float y)
     atan2 converted to degrees: the angle between (0|0) and the given point More...
     
    float XPMP2::angleLocCoord (float x1, float z1, float x2, float z2)
     Angle of line from point (x1|z1) to point (x2|z2) More...
     
    float XPMP2::headDiff (float head1, float head2)
     (Shortest) difference between 2 angles: How much to turn to go from h1 to h2? More...
     
    template<class numT >
    numT XPMP2::headNormalize (numT _head)
     Normalize a heading value to [0..360), works for both float and double values. More...
     
    float XPMP2::GetMiscNetwTime ()
     Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt. More...
     
    std::string XPMP2::GetMiscNetwTimeStr (float _time=NAN)
     Return the network time as a string like used in the XP's Log.txt. More...
     
    const char * XPMP2::GetGraphicsDriverTxt ()
     Text string for current graphics driver in use. More...
     
    bool XPMP2::IsPaused ()
     X-Plane in a Pause state? More...
     
    bool XPMP2::IsViewExternal ()
     Is current X-Plane view an external view (outside a cockpit)? More...
     
    bool XPMP2::CheckEverySoOften (float &_lastCheck, float _interval, float _now)
     Convenience function to check on something at most every x seconds. More...
     
    bool XPMP2::CheckEverySoOften (float &_lastCheck, float _interval)
     Convenience function to check on something at most every x seconds. More...
     
    const char * XPMP2::LogGetString (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
     Returns ptr to static buffer filled with formatted log string. More...
     
    void XPMP2::LogMsg (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2_FMTARGS(5)
     Log Text to log file. More...
     
    std::string XPMP2::TOPOSIX (const std::string &p)
     On Lin/Win there is no need for a conversion, but we do treat p now as std::string More...
     
    std::string XPMP2::FROMPOSIX (const std::string &p)
     On Lin/Win there is no need for a conversion, but we do treat p now as std::string More...
     
    - - - - - - - - - - - - -

    -Variables

    constexpr const char * XPMP2::RSRC_RELATED = "related.txt"
     
    constexpr const char * XPMP2::RSRC_DOC8643 = "Doc8643.txt"
     
    constexpr const char * XPMP2::RSRC_MAP_ICONS = "MapIcons.png"
     
    constexpr const char * XPMP2::RSRC_OBJ8DATAREFS = "Obj8DataRefs.txt"
     
    constexpr double XPMP2::PI = 3.1415926535897932384626433832795028841971693993751
     Pi. More...
     
    -

    Detailed Description

    -

    Miscellaneous utility functions, including logging.

    -
    Author
    Birger Hoppe
    - -

    Macro Definition Documentation

    - -

    ◆ CATCH_AC

    - -
    -
    - - - - - - - - -
    #define CATCH_AC( ac)
    -
    -Value:
    catch (const std::exception& e) { \
    -
    LOG_MSG(logFATAL, ERR_EXCEPTION, e.what()); \
    -
    (ac).SetInvalid(); \
    -
    } \
    -
    catch (...) { \
    -
    LOG_MSG(logFATAL, ERR_EXCEPTION, "<unknown>"); \
    -
    (ac).SetInvalid(); \
    -
    }
    -
    @ logFATAL
    fatal is shortly before a crash
    Definition: Utilities.h:83
    -
    #define ERR_EXCEPTION
    Definition: Utilities.h:31
    -
    -

    Standard catch clauses for dealing with aircraft: logs message, sets aircraft invalid.

    - -
    -
    - -

    ◆ ERR_ASSERT

    - -
    -
    - - - - -
    #define ERR_ASSERT   "ASSERT FAILED: %s"
    -
    - -
    -
    - -

    ◆ ERR_EXCEPTION

    - -
    -
    - - - - -
    #define ERR_EXCEPTION   "EXCEPTION CAUGHT: %s"
    -
    - -
    -
    - -

    ◆ LOG_ASSERT

    - -
    -
    - - - - - - - - -
    #define LOG_ASSERT( cond)
    -
    -Value:
    if (!(cond)) { \
    -
    THROW_ERROR(ERR_ASSERT,#cond); \
    -
    }
    -
    #define ERR_ASSERT
    Definition: Utilities.h:30
    -
    -

    Throw in an assert-style (logging takes place in XPMP2Error constructor)

    -
    Note
    This conditional check always takes place, independend of any build or logging settings!
    - -
    -
    - -

    ◆ LOG_MATCHING

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    #define LOG_MATCHING( lvl,
     ... 
    )
    -
    -Value:
    { \
    -
    if (XPMP2::glob.bLogMdlMatch && lvl >= glob.logLvl) \
    -
    {LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
    -
    }
    -
    void LogMsg(const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2RC_FMTARGS(5)
    Log Text to log file.
    Definition: Utilities.cpp:135
    -
    GlobVars glob
    The one and only global variable structure.
    Definition: Utilities.cpp:29
    -
    logLevelTy logLvl
    Logging level.
    Definition: XPMP2.h:123
    -
    -

    Log a message about matching if logging of model matching is enabled.

    -
    Note
    First parameter after lvl must be the message text, which can be a format string with its parameters following like in sprintf
    - -
    -
    - -

    ◆ LOG_MSG

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    #define LOG_MSG( lvl,
     ... 
    )
    -
    -Value:
    { \
    -
    if (lvl >= XPMP2::glob.logLvl) \
    -
    {LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
    -
    }
    -
    -

    Log a message if lvl is greater or equal currently defined log level.

    -
    Note
    First parameter after lvl must be the message text, which can be a format string with its parameters following like in sprintf
    - -
    -
    - -

    ◆ PATH_DELIM_STD

    - -
    -
    - - - - -
    #define PATH_DELIM_STD   '/'
    -
    - -
    -
    - -

    ◆ SET_THREAD_NAME

    - -
    -
    - - - - - - - - -
    #define SET_THREAD_NAME( sName)
    -
    - -
    -
    - -

    ◆ STRCPY_ATMOST

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    #define STRCPY_ATMOST( dest,
     src 
    )   strncpy_s(dest,sizeof(dest),strAtMost(src,sizeof(dest)-1).c_str(),sizeof(dest)-1)
    -
    - -
    -
    - -

    ◆ STRCPY_S

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    #define STRCPY_S( dest,
     src 
    )   strncpy_s(dest,sizeof(dest),src,sizeof(dest)-1)
    -
    - -

    Simpler access to strncpy_s if dest is a char array (not a pointer!)

    - -
    -
    - -

    ◆ THROW_ERROR

    - -
    -
    - - - - - - - - -
    #define THROW_ERROR( ...)   throw XPMP2Error(__FILE__, __LINE__, __func__, __VA_ARGS__);
    -
    - -

    Throws an exception using XPMP2Error.

    -
    Note
    First parameter after lvl must be the message text, which can be a format string with its parameters following like in sprintf
    - -
    -
    - -

    ◆ WHITESPACE

    - -
    -
    - - - - -
    #define WHITESPACE   " \t\f\v\r\n"
    -
    - -
    -
    - -

    ◆ XPMP2_FMTARGS

    - -
    -
    - - - - - - - - -
    #define XPMP2_FMTARGS( FMT)
    -
    - -

    To apply printf-style warnings to our functions.

    -
    See also
    Taken from imgui.h's definition of IM_FMTARGS
    - -
    -
    -
    - - - - diff --git a/docs/html/src_2Utilities_8h_source.html b/docs/html/src_2Utilities_8h_source.html deleted file mode 100644 index 97fc9a55..00000000 --- a/docs/html/src_2Utilities_8h_source.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - - -XPMP2: src/Utilities.h Source File - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - - -
    -
    -
    -
    Utilities.h
    -
    -
    -Go to the documentation of this file.
    1 
    -
    21 #ifndef _Utilities_h_
    -
    22 #define _Utilities_h_
    -
    23 
    -
    24 namespace XPMP2 {
    -
    25 
    -
    26 //
    -
    27 // MARK: General texts
    -
    28 //
    -
    29 
    -
    30 #define ERR_ASSERT "ASSERT FAILED: %s"
    -
    31 #define ERR_EXCEPTION "EXCEPTION CAUGHT: %s"
    -
    32 
    -
    33 // Required supplemental files
    -
    34 constexpr const char* RSRC_RELATED = "related.txt";
    -
    35 constexpr const char* RSRC_DOC8643 = "Doc8643.txt";
    -
    36 constexpr const char* RSRC_MAP_ICONS = "MapIcons.png";
    -
    37 constexpr const char* RSRC_OBJ8DATAREFS = "Obj8DataRefs.txt";
    -
    38 
    -
    39 //
    -
    40 // MARK: Default configuration callbacks
    -
    41 //
    -
    42 
    -
    43 int PrefsFuncIntDefault (const char *, const char *, int _default);
    -
    44 float PrefsFuncFloatDefault (const char *, const char *, float _default);
    -
    45 
    -
    46 //
    -
    47 // MARK: File access helpers
    -
    48 //
    -
    49 
    -
    50 #if IBM
    -
    51 #define PATH_DELIM_STD '\\'
    -
    52 #else
    -
    53 #define PATH_DELIM_STD '/'
    -
    54 #endif
    -
    55 
    -
    57 bool ExistsFile (const std::string& filename);
    -
    58 
    -
    60 bool IsDir (const std::string& path);
    -
    61 
    -
    64 bool CreateDir(const std::string& path);
    -
    65 
    -
    68 bool CopyFileIfNewer(const std::string& source, const std::string& destDir);
    -
    69 
    -
    71 std::list<std::string> GetDirContents (const std::string& path);
    -
    72 
    -
    74 std::istream& safeGetline(std::istream& is, std::string& t);
    -
    75 
    -
    77 const std::string& GetXPSystemPath ();
    -
    78 
    -
    80 std::string StripXPSysDir (const std::string& path);
    -
    81 
    -
    83 void RemoveExtension (std::string& path);
    -
    84 
    -
    85 //
    -
    86 // MARK: String helpers
    -
    87 //
    -
    88 
    -
    89 #define WHITESPACE " \t\f\v\r\n"
    -
    90 
    -
    92 std::string& str_tolower(std::string& s);
    -
    93 
    -
    96 inline std::string& rtrim(std::string& s, const char* t = WHITESPACE)
    -
    97 {
    -
    98  s.erase(s.find_last_not_of(t) + 1);
    -
    99  return s;
    -
    100 }
    -
    101 
    -
    104 inline std::string& ltrim(std::string& s, const char* t = WHITESPACE)
    -
    105 {
    -
    106  s.erase(0, s.find_first_not_of(t));
    -
    107  return s;
    -
    108 }
    -
    109 
    -
    112 inline std::string& trim(std::string& s, const char* t = WHITESPACE)
    -
    113 {
    -
    114  return ltrim(rtrim(s, t), t);
    -
    115 }
    -
    116 
    -
    118 inline std::string leftOf(const std::string& s, const std::string& terminators)
    -
    119 {
    -
    120  return s.substr(0, std::min(s.find_first_of(terminators), s.size()));
    -
    121 }
    -
    122 
    -
    124 std::vector<std::string> str_tokenize (const std::string s,
    -
    125  const std::string tokens,
    -
    126  bool bSkipEmpty = true);
    -
    127 
    -
    128 //
    -
    129 // MARK: Math helpers
    -
    130 //
    -
    131 
    -
    133 constexpr double PI = 3.1415926535897932384626433832795028841971693993751;
    -
    134 
    -
    136 template <class T>
    -
    137 inline T rad2deg (const T _rad)
    -
    138 { return (_rad < T(0) ? T(360) : T(0)) + _rad * T(180) / T(PI); }
    -
    139 
    -
    141 template <class T>
    -
    142 inline T deg2rad (const T _deg)
    -
    143 { return _deg * T(PI) / T(180); }
    -
    144 
    -
    146 template <class T>
    -
    147 inline T sqr (const T a) { return a*a; }
    -
    148 
    -
    150 template <class T>
    -
    151 inline T dist (const T x1, const T y1, const T z1,
    -
    152  const T x2, const T y2, const T z2)
    -
    153 {
    -
    154  return std::sqrt(sqr(x1-x2) + sqr(y1-y2) + sqr(z1-z2));
    -
    155 }
    -
    156 
    -
    158 inline float atan2deg (float x, float y)
    -
    159 { return rad2deg(atan2(x,y)); }
    -
    160 
    -
    168 inline float angleLocCoord (float x1, float z1, float x2, float z2)
    -
    169 { return rad2deg(atan2(z2-z1,x2-x1) + float(PI/2.0)); }
    -
    170 
    -
    172 float headDiff (float head1, float head2);
    -
    173 
    -
    175 template <class numT>
    -
    176 numT headNormalize (numT _head)
    -
    177 {
    -
    178  if (_head < numT(0))
    -
    179  _head += std::ceil(_head/-numT(360)) * numT(360);
    -
    180  else if (_head >= numT(360))
    -
    181  _head -= std::floor(_head/numT(360)) * numT(360);
    -
    182  return _head;
    -
    183 }
    -
    184 
    -
    185 //
    -
    186 // MARK: Misc
    -
    187 //
    -
    188 
    -
    190 float GetMiscNetwTime ();
    -
    191 
    -
    194 std::string GetMiscNetwTimeStr (float _time = NAN);
    -
    195 
    -
    197 const char* GetGraphicsDriverTxt ();
    -
    198 
    -
    200 bool IsPaused ();
    -
    201 
    -
    203 bool IsViewExternal ();
    -
    204 
    -
    210 bool CheckEverySoOften (float& _lastCheck, float _interval, float _now);
    -
    211 
    -
    216 inline bool CheckEverySoOften (float& _lastCheck, float _interval)
    -
    217 { return CheckEverySoOften(_lastCheck, _interval, GetMiscNetwTime()); }
    -
    218 
    -
    219 //
    -
    220 // MARK: Logging Support
    -
    221 //
    -
    222 
    -
    225 #if defined(__clang__) || defined(__GNUC__)
    -
    226 #define XPMP2_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1)))
    -
    227 #else
    -
    228 #define XPMP2_FMTARGS(FMT)
    -
    229 #endif
    -
    230 
    - -
    233  logDEBUG = 0,
    - - - - -
    238  logMSG
    -
    239 };
    -
    240 
    -
    242 const char* LogGetString ( const char* szFile, int ln, const char* szFunc, logLevelTy lvl, const char* szMsg, va_list args );
    -
    243 
    -
    245 void LogMsg ( const char* szFile, int ln, const char* szFunc, logLevelTy lvl, const char* szMsg, ... ) XPMP2_FMTARGS(5);
    -
    246 
    -
    247 //
    -
    248 // MARK: Logging macros
    -
    249 //
    -
    250 
    -
    254 #define LOG_MSG(lvl,...) { \
    -
    255  if (lvl >= XPMP2::glob.logLvl) \
    -
    256  {LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
    -
    257 }
    -
    258 
    -
    262 #define LOG_MATCHING(lvl,...) { \
    -
    263  if (XPMP2::glob.bLogMdlMatch && lvl >= glob.logLvl) \
    -
    264  {LogMsg(__FILE__, __LINE__, __func__, lvl, __VA_ARGS__);} \
    -
    265 }
    -
    266 
    -
    270 #define THROW_ERROR(...) \
    -
    271 throw XPMP2Error(__FILE__, __LINE__, __func__, __VA_ARGS__);
    -
    272 
    -
    275 #define LOG_ASSERT(cond) \
    -
    276  if (!(cond)) { \
    -
    277  THROW_ERROR(ERR_ASSERT,#cond); \
    -
    278  }
    -
    279 
    -
    281 #define CATCH_AC(ac) \
    -
    282  catch (const std::exception& e) { \
    -
    283  LOG_MSG(logFATAL, ERR_EXCEPTION, e.what()); \
    -
    284  (ac).SetInvalid(); \
    -
    285  } \
    -
    286  catch (...) { \
    -
    287  LOG_MSG(logFATAL, ERR_EXCEPTION, "<unknown>"); \
    -
    288  (ac).SetInvalid(); \
    -
    289  }
    -
    290 
    -
    291 
    -
    292 //
    -
    293 // MARK: Compiler differences
    -
    294 //
    -
    295 
    -
    296 #if APL == 1 || LIN == 1
    -
    297 // not quite the same but close enough for our purposes
    -
    298 inline void strncpy_s(char * dest, size_t destsz, const char * src, size_t count)
    -
    299 {
    -
    300  strncpy(dest, src, std::min(destsz,count)); dest[destsz - 1] = 0;
    -
    301 }
    -
    302 
    -
    303 // these simulate the VC++ version, not the C standard versions!
    -
    304 inline struct tm *gmtime_s(struct tm * result, const time_t * time)
    -
    305 { return gmtime_r(time, result); }
    -
    306 inline struct tm *localtime_s(struct tm * result, const time_t * time)
    -
    307 { return localtime_r(time, result); }
    -
    308 
    -
    309 #endif
    -
    310 
    -
    312 #define STRCPY_S(dest,src) strncpy_s(dest,sizeof(dest),src,sizeof(dest)-1)
    -
    313 #define STRCPY_ATMOST(dest,src) strncpy_s(dest,sizeof(dest),strAtMost(src,sizeof(dest)-1).c_str(),sizeof(dest)-1)
    -
    314 
    -
    315 // XCode/Linux don't provide the _s functions, not even with __STDC_WANT_LIB_EXT1__ 1
    -
    316 #if APL
    -
    317 inline int strerror_s( char *buf, size_t bufsz, int errnum )
    -
    318 { return strerror_r(errnum, buf, bufsz); }
    -
    319 #elif LIN
    -
    320 inline int strerror_s( char *buf, size_t bufsz, int errnum )
    -
    321 { strerror_r(errnum, buf, bufsz); return 0; }
    -
    322 #endif
    -
    323 
    -
    324 // In case of Mac we need to prepare for HFS-to-Posix path conversion
    -
    325 #if APL
    -
    327 std::string TOPOSIX (const std::string& p);
    -
    329 std::string FROMPOSIX (const std::string& p);
    -
    330 #else
    -
    332 inline std::string TOPOSIX (const std::string& p) { return p; }
    -
    334 inline std::string FROMPOSIX (const std::string& p) { return p; }
    -
    335 #endif
    -
    336 
    -
    337 // MARK: Thread names
    -
    338 #ifdef DEBUG
    -
    339 // This might not work on older Windows version, which is why we don't publish it in release builds
    -
    340 #if IBM
    -
    341 #define SET_THREAD_NAME(sName) SetThreadDescription(GetCurrentThread(), L##sName)
    -
    342 #elif APL
    -
    343 #define SET_THREAD_NAME(sName) pthread_setname_np(sName)
    -
    344 #elif LIN
    -
    345 #define SET_THREAD_NAME(sName) pthread_setname_np(pthread_self(),sName)
    -
    346 #endif
    -
    347 #else
    -
    348 #define SET_THREAD_NAME(sName)
    -
    349 #endif
    -
    350 
    -
    351 } // namespace XPMP2
    -
    352 
    -
    353 #endif
    -
    logLevelTy
    Logging level.
    Definition: Utilities.h:78
    -
    Defined by FMOD.
    Definition: XPMPAircraft.h:73
    -
    T rad2deg(const T _rad)
    Convert radians to degrees, normalized to [0..360)
    Definition: Utilities.h:137
    -
    logLevelTy
    Logging level.
    Definition: Utilities.h:232
    -
    @ logFATAL
    fatal is shortly before a crash
    Definition: Utilities.h:237
    -
    @ logMSG
    will always be output, no matter what has been configured, cannot be suppressed
    Definition: Utilities.h:238
    -
    @ logDEBUG
    Debug, highest level of detail.
    Definition: Utilities.h:233
    -
    @ logWARN
    warnings, i.e. unexpected, but uncritical events, maybe leading to unwanted display,...
    Definition: Utilities.h:235
    -
    @ logERR
    errors mean, aircraft can potentially not be displayed
    Definition: Utilities.h:236
    -
    @ logINFO
    regular info messages
    Definition: Utilities.h:234
    -
    std::string leftOf(const std::string &s, const std::string &terminators)
    Returns everything left of any of terminators.
    Definition: Utilities.h:118
    -
    const char * LogGetString(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args)
    Returns ptr to static buffer filled with formatted log string.
    Definition: Utilities.cpp:742
    -
    constexpr const char * RSRC_OBJ8DATAREFS
    Definition: Utilities.h:37
    -
    std::string TOPOSIX(const std::string &p)
    On Lin/Win there is no need for a conversion, but we do treat p now as std::string
    Definition: Utilities.h:332
    -
    constexpr double PI
    Pi.
    Definition: Utilities.h:133
    -
    void LogMsg(const char *szPath, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...)
    Log Text to log file.
    Definition: Utilities.cpp:782
    -
    bool CheckEverySoOften(float &_lastCheck, float _interval, float _now)
    Convenience function to check on something at most every x seconds.
    Definition: Utilities.cpp:698
    -
    std::string & ltrim(std::string &s, const char *t=WHITESPACE)
    trimming of string (from left)
    Definition: Utilities.h:104
    -
    std::string GetMiscNetwTimeStr(float _time)
    Return the network time as a string like used in the XP's Log.txt.
    Definition: Utilities.cpp:654
    -
    std::string FROMPOSIX(const std::string &p)
    On Lin/Win there is no need for a conversion, but we do treat p now as std::string
    Definition: Utilities.h:334
    -
    float angleLocCoord(float x1, float z1, float x2, float z2)
    Angle of line from point (x1|z1) to point (x2|z2)
    Definition: Utilities.h:168
    -
    void RemoveExtension(std::string &path)
    Removes everything after the last dot, the dot including.
    Definition: Utilities.cpp:457
    -
    std::list< std::string > GetDirContents(const std::string &path)
    List of files in a directory (wrapper around XPLMGetDirectoryContents)
    Definition: Utilities.cpp:388
    -
    constexpr const char * RSRC_RELATED
    Definition: Utilities.h:34
    -
    T sqr(const T a)
    Square.
    Definition: Utilities.h:147
    -
    float GetMiscNetwTime()
    Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log....
    Definition: Utilities.cpp:645
    -
    const std::string & GetXPSystemPath()
    Returns XP's system directory, including a trailing slash.
    Definition: Utilities.cpp:434
    -
    numT headNormalize(numT _head)
    Normalize a heading value to [0..360), works for both float and double values.
    Definition: Utilities.h:176
    -
    const char * GetGraphicsDriverTxt()
    Text string for current graphics driver in use.
    Definition: Utilities.cpp:671
    -
    float headDiff(float head1, float head2)
    (Shortest) difference between 2 angles: How much to turn to go from h1 to h2?
    Definition: Utilities.cpp:622
    -
    bool ExistsFile(const std::string &filename)
    Does a file path exist?
    Definition: Utilities.cpp:304
    -
    bool CreateDir(const std::string &path)
    Create directory if it does not exist.
    Definition: Utilities.cpp:320
    -
    std::string & str_tolower(std::string &s)
    change a std::string to uppercase
    Definition: Utilities.cpp:568
    -
    float PrefsFuncFloatDefault(const char *, const char *, float _default)
    -
    bool CopyFileIfNewer(const std::string &source, const std::string &destDir)
    Copy file if source is newer or destination missing.
    Definition: Utilities.cpp:335
    -
    constexpr const char * RSRC_MAP_ICONS
    Definition: Utilities.h:36
    -
    bool IsPaused()
    X-Plane in a Pause state?
    Definition: Utilities.cpp:684
    -
    bool IsViewExternal()
    Is current X-Plane view an external view (outside a cockpit)?
    Definition: Utilities.cpp:691
    -
    T dist(const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
    Pythagorean distance between two points in a 3-D world.
    Definition: Utilities.h:151
    -
    std::string & trim(std::string &s, const char *t=WHITESPACE)
    trimming of string (from both ends)
    Definition: Utilities.h:112
    -
    std::string StripXPSysDir(const std::string &path)
    If a path starts with X-Plane's system directory it is stripped.
    Definition: Utilities.cpp:447
    -
    T deg2rad(const T _deg)
    Convert degree to radians.
    Definition: Utilities.h:142
    -
    std::string & rtrim(std::string &s, const char *t=WHITESPACE)
    trimming of string (from right)
    Definition: Utilities.h:96
    -
    bool IsDir(const std::string &path)
    Is path a directory?
    Definition: Utilities.cpp:311
    -
    float atan2deg(float x, float y)
    atan2 converted to degrees: the angle between (0|0) and the given point
    Definition: Utilities.h:158
    -
    int PrefsFuncIntDefault(const char *, const char *, int _default)
    Default config function just always returns the provided default value.
    Definition: Utilities.cpp:161
    -
    constexpr const char * RSRC_DOC8643
    Definition: Utilities.h:35
    -
    std::vector< std::string > str_tokenize(const std::string s, const std::string tokens, bool bSkipEmpty)
    separates string into tokens
    Definition: Utilities.cpp:575
    -
    std::istream & safeGetline(std::istream &is, std::string &t)
    Read a line from a text file, no matter if ending on CRLF or LF.
    Definition: Utilities.cpp:421
    -
    #define WHITESPACE
    Definition: Utilities.h:89
    -
    #define XPMP2_FMTARGS(FMT)
    To apply printf-style warnings to our functions.
    Definition: Utilities.h:228
    -
    - - - - diff --git a/docs/html/structSenderAddrTy-members.html b/docs/html/structSenderAddrTy-members.html deleted file mode 100644 index 4e3aa545..00000000 --- a/docs/html/structSenderAddrTy-members.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - -XPMP2: Member List - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    -
    -
    -
    SenderAddrTy Member List
    -
    -
    - -

    This is the complete list of members for SenderAddrTy, including all inherited members.

    - - - - - -
    fromSenderAddrTy
    operator<(const SenderAddrTy &o) constSenderAddrTy
    pluginIdSenderAddrTy
    SenderAddrTy(XPLMPluginID _id, const std::uint32_t _from[4])SenderAddrTyinline
    - - - - diff --git a/docs/html/structSenderAddrTy.html b/docs/html/structSenderAddrTy.html deleted file mode 100644 index ad1b34a6..00000000 --- a/docs/html/structSenderAddrTy.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - -XPMP2: SenderAddrTy Struct Reference - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    -
    - -
    -
    SenderAddrTy Struct Reference
    -
    -
    - -

    Uniquely identifies a sending plugin. - More...

    - -

    #include <Client.h>

    - - - - - - - -

    -Public Member Functions

    bool operator< (const SenderAddrTy &o) const
     
     SenderAddrTy (XPLMPluginID _id, const std::uint32_t _from[4])
     Constructor just fills values. More...
     
    - - - - - - - -

    -Public Attributes

    const XPLMPluginID pluginId
     sender's plugin id within X-Plane (first to speed up memcmp as usually this will already differ between plugins) More...
     
    std::uint32_t from [4]
     numerical part of sender's IP address (only differentiating in rare cases of two plugins on different PCs having the same plugin id) More...
     
    -

    Detailed Description

    -

    Uniquely identifies a sending plugin.

    -

    Constructor & Destructor Documentation

    - -

    ◆ SenderAddrTy()

    - -
    -
    - - - - - -
    - - - - - - - - - - - - - - - - - - -
    SenderAddrTy::SenderAddrTy (XPLMPluginID _id,
    const std::uint32_t _from[4] 
    )
    -
    -inline
    -
    - -

    Constructor just fills values.

    - -
    -
    -

    Member Function Documentation

    - -

    ◆ operator<()

    - -
    -
    - - - - - - - - -
    bool SenderAddrTy::operator< (const SenderAddrTyo) const
    -
    -

    uses memcmp to compare this

    - -
    -
    -

    Member Data Documentation

    - -

    ◆ from

    - -
    -
    - - - - -
    std::uint32_t SenderAddrTy::from[4]
    -
    - -

    numerical part of sender's IP address (only differentiating in rare cases of two plugins on different PCs having the same plugin id)

    - -
    -
    - -

    ◆ pluginId

    - -
    -
    - - - - -
    const XPLMPluginID SenderAddrTy::pluginId
    -
    - -

    sender's plugin id within X-Plane (first to speed up memcmp as usually this will already differ between plugins)

    - -
    -
    -
    The documentation for this struct was generated from the following files: -
    - - - - diff --git a/docs/html/structSenderTy-members.html b/docs/html/structSenderTy-members.html deleted file mode 100644 index 0a25f84a..00000000 --- a/docs/html/structSenderTy-members.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - -XPMP2: Member List - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    -
    -
    -
    SenderTy Member List
    -
    -
    - -

    This is the complete list of members for SenderTy, including all inherited members.

    - - - - - - - - -
    bLocalSenderTy
    Find(XPLMPluginID _id, const std::uint32_t _from[4])SenderTystatic
    lastMsgSenderTy
    mapAcSenderTy
    SenderTy(const std::string &_from, const XPMP2::RemoteMsgSettingsTy &_s)SenderTy
    settingsSenderTy
    sFromSenderTy
    - - - - diff --git a/docs/html/structSenderTy.html b/docs/html/structSenderTy.html deleted file mode 100644 index c6f59038..00000000 --- a/docs/html/structSenderTy.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - -XPMP2: SenderTy Struct Reference - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    - -
    - -

    #include <Client.h>

    - - - - - -

    -Public Member Functions

     SenderTy (const std::string &_from, const XPMP2::RemoteMsgSettingsTy &_s)
     Constructor copies values and sets lastMsg to now. More...
     
    - - - - -

    -Static Public Member Functions

    static SenderTyFind (XPLMPluginID _id, const std::uint32_t _from[4])
     Find a sender based on plugin id and IP address. More...
     
    - - - - - - - - - - - - - - - -

    -Public Attributes

    std::string sFrom
     string representaton of the sender's IP address More...
     
    const bool bLocal
     is this a local sender on the same computer? More...
     
    XPMP2::RemoteMsgSettingsTy settings
     that plugin's settings More...
     
    std::chrono::time_point< std::chrono::steady_clock > lastMsg
     
    mapRemoteAcTy mapAc
     map of aircraft sent by this plugin More...
     
    -

    Constructor & Destructor Documentation

    - -

    ◆ SenderTy()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    SenderTy::SenderTy (const std::string & _from,
    const XPMP2::RemoteMsgSettingsTy_s 
    )
    -
    - -

    Constructor copies values and sets lastMsg to now.

    - -
    -
    -

    Member Function Documentation

    - -

    ◆ Find()

    - -
    -
    - - - - - -
    - - - - - - - - - - - - - - - - - - -
    SenderTy * SenderTy::Find (XPLMPluginID _id,
    const std::uint32_t _from[4] 
    )
    -
    -static
    -
    - -

    Find a sender based on plugin id and IP address.

    - -
    -
    -

    Member Data Documentation

    - -

    ◆ bLocal

    - -
    -
    - - - - -
    const bool SenderTy::bLocal
    -
    - -

    is this a local sender on the same computer?

    - -
    -
    - -

    ◆ lastMsg

    - -
    -
    - - - - -
    std::chrono::time_point<std::chrono::steady_clock> SenderTy::lastMsg
    -
    - -
    -
    - -

    ◆ mapAc

    - -
    -
    - - - - -
    mapRemoteAcTy SenderTy::mapAc
    -
    - -

    map of aircraft sent by this plugin

    - -
    -
    - -

    ◆ settings

    - -
    -
    - - - - -
    XPMP2::RemoteMsgSettingsTy SenderTy::settings
    -
    - -

    that plugin's settings

    - -
    -
    - -

    ◆ sFrom

    - -
    -
    - - - - -
    std::string SenderTy::sFrom
    -
    - -

    string representaton of the sender's IP address

    - -
    -
    -
    The documentation for this struct was generated from the following files: -
    - - - - diff --git a/docs/html/structXPMP2RCGlobals-members.html b/docs/html/structXPMP2RCGlobals-members.html deleted file mode 100644 index ae018969..00000000 --- a/docs/html/structXPMP2RCGlobals-members.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - -XPMP2: Member List - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    -
    -
    -
    XPMP2RCGlobals Member List
    -
    - - - - - diff --git a/docs/html/structXPMP2RCGlobals.html b/docs/html/structXPMP2RCGlobals.html deleted file mode 100644 index e1cbdc41..00000000 --- a/docs/html/structXPMP2RCGlobals.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - -XPMP2: XPMP2RCGlobals Struct Reference - - - - - - -
    -
    - - - - - - -
    -
    XPMP2 -
    -
    X-Plane multiplayer library 2 - using instancing
    -
    -
    - - - - - - -
    -
    - -
    -
    XPMP2RCGlobals Struct Reference
    -
    -
    - -

    Holds all global variables. - More...

    - -

    #include <XPMP2-Remote.h>

    - - - - - -

    -Public Types

    enum  DrawLabelsTy { LABELS_SYNCH = 0 -, LABELS_ON -, LABELS_OFF - }
     Shall aircraft labels be drawn at remote site? More...
     
    - - - - -

    -Public Member Functions

    bool IsXPThread () const
     Is this thread XP's main thread? More...
     
    - - - - - - - - - - - - - - - -

    -Public Attributes

    XPMP2::RemoteMsgSettingsTy mergedS
     Config values reconciled from sending plugins. More...
     
    enum XPMP2RCGlobals::DrawLabelsTy eDrawLabels = LABELS_SYNCH
     Shall aircraft labels be drawn at remote site? More...
     
    mapSenderTy gmapSender
     The global map of all sending plugins we've ever heard of. More...
     
    float now = 0.0f
     Latest timestamp read from network_time_sec. More...
     
    std::thread::id xpThread
     
    -

    Detailed Description

    -

    Holds all global variables.

    -

    Member Enumeration Documentation

    - -

    ◆ DrawLabelsTy

    - -
    -
    - -

    Shall aircraft labels be drawn at remote site?

    - - - - -
    Enumerator
    LABELS_SYNCH 

    Synchronize drawing of labels with sending client.

    -
    LABELS_ON 

    Always draw labels.

    -
    LABELS_OFF 

    Don't draw labels.

    -
    - -
    -
    -

    Member Function Documentation

    - -

    ◆ IsXPThread()

    - -
    -
    - - - - - -
    - - - - - - - -
    bool XPMP2RCGlobals::IsXPThread () const
    -
    -inline
    -
    - -

    Is this thread XP's main thread?

    - -
    -
    -

    Member Data Documentation

    - -

    ◆ eDrawLabels

    - -
    -
    - - - - -
    enum XPMP2RCGlobals::DrawLabelsTy XPMP2RCGlobals::eDrawLabels = LABELS_SYNCH
    -
    - -

    Shall aircraft labels be drawn at remote site?

    - -
    -
    - -

    ◆ gmapSender

    - -
    -
    - - - - -
    mapSenderTy XPMP2RCGlobals::gmapSender
    -
    - -

    The global map of all sending plugins we've ever heard of.

    - -
    -
    - -

    ◆ mergedS

    - -
    -
    - - - - -
    XPMP2::RemoteMsgSettingsTy XPMP2RCGlobals::mergedS
    -
    - -

    Config values reconciled from sending plugins.

    - -
    -
    - -

    ◆ now

    - -
    -
    - - - - -
    float XPMP2RCGlobals::now = 0.0f
    -
    - -

    Latest timestamp read from network_time_sec.

    -

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

    - -
    -
    - -

    ◆ xpThread

    - -
    -
    - - - - -
    std::thread::id XPMP2RCGlobals::xpThread
    -
    - -
    -
    -
    The documentation for this struct was generated from the following file: -
    - - - - diff --git a/docs/index.md b/docs/index.md index 4b0bd12f..00eaa81a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,6 +12,7 @@ Content and availability status: - [ ] Additional map layer - [X] [Wake Turbulence Support](Wake.html) - [X] [Sound Support by FMOD](Sound.html) + - [X] [Contrails](Contrails.html) - [X] [Shared dataRefs](SharedDataRefs.html) providing textual aircraft / flight information to interested 3rd party plugins - [X] [XPMP2 Remote](Remote.html) functionality - [ ] Coding, Building, Deployment