diff --git a/Include/LTAircraft.h b/Include/LTAircraft.h index 6147ea82..a7a286d4 100644 --- a/Include/LTAircraft.h +++ b/Include/LTAircraft.h @@ -236,7 +236,7 @@ struct BezierCurve // Represents an aircraft as displayed in XP by use of the // XP Multiplayer Lib // -class LTAircraft : XPCAircraft +class LTAircraft : public XPCAircraft { public: class FlightModel { @@ -368,8 +368,6 @@ class LTAircraft : XPCAircraft void LabelUpdate(); // stringify e.g. for debugging info purposes operator std::string() const; - // the XPMP model used for displaying this aircraft - std::string GetModelName() const; // change the model (e.g. when model-defining static data changed) void ChangeModel (const LTFlightData::FDStaticData& statData); // current position diff --git a/Include/LTOpenSky.h b/Include/LTOpenSky.h index 70eba81a..f50d9dfa 100644 --- a/Include/LTOpenSky.h +++ b/Include/LTOpenSky.h @@ -84,7 +84,8 @@ constexpr double OPSKY_WAIT_BETWEEN = 0.5; // seconds to pause between #define OPSKY_MD_AC_TYPE_ICAO "typecode" #define OPSKY_MD_CAT_DESCR "categoryDescription" #define OPSKY_MD_TEXT_VEHICLE "Surface Vehicle" -#define OPSKY_MD_TEX_NO_CAT "No ADS-B Emitter Category Information" +#define OPSKY_MD_TEXT_NO_CAT "No ADS-B Emitter Category Information" +#define OPSKY_MD_MDL_UNKNOWN "[?]" #define OPSKY_ROUTE_URL "https://opensky-network.org/api/routes?callsign=" #define OPSKY_ROUTE_GROUP "ROUTE" // made-up group of route information fields diff --git a/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPAircraft.h b/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPAircraft.h index 0dc1ee31..946e8b3a 100644 --- a/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPAircraft.h +++ b/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPAircraft.h @@ -174,8 +174,13 @@ class Aircraft { /// return the XPMP2 plane id XPMPPlaneID GetPlaneID () const { return mPlane; } - /// return the last used sim/multiplayer/plane-index + /// @brief return the current multiplayer-index + /// @note This is a 0-based index into our internal tables! + /// It is one less than the number used in sim/multiplayer/plane dataRefs, + /// use Aircraft::GetAIPlaneIdx() for that purpose. int GetMultiIdx () const { return multiIdx; } + /// @brief return the plane's index in XP's sim/multiplayer/plane dataRefs + int GetAIPlaneIdx () const { return multiIdx >= 0 ? multiIdx+1 : -1; } /// Is this plane currently also being tracked by X-Plane's AI/multiplayer, ie. will appear on TCAS? bool IsCurrentlyShownAsAI () const { return multiIdx >= 0; } /// Will this plane show up on TCAS / in multiplayer views? (It will if transponder is not switched off) @@ -194,7 +199,7 @@ class Aircraft { /// return a pointer to the CSL model in use (Note: The CSLModel structure is not public.) XPMP2::CSLModel* GetModel () const { return pCSLMdl; } /// return the name of the CSL model in use - std::string GetModelName () const; + const std::string& GetModelName () const; /// quality of the match with the CSL model int GetMatchQuality () const { return matchQuality; } /// Vertical offset, ie. the value that needs to be added to drawInfo.y to make the aircraft appear on the ground diff --git a/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPMultiplayer.h b/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPMultiplayer.h index 50e5db90..8a09b44f 100644 --- a/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPMultiplayer.h +++ b/Lib/XPMP2/XPMP2.framework/Versions/1.0/Headers/XPMPMultiplayer.h @@ -1,7 +1,28 @@ /// @file XPMPMultiplayer.h /// @brief Initialization and general control functions for XPMP2 -/// @note This file bases on and should be compile-compatible to the header -/// provided with the original libxplanemp. +/// +/// @note This file bases on and should be largely compile-compatible to +/// the header provided with the original libxplanemp. +/// @note Some functions are marked deprecated, reason is given with +/// each function. They are only provided for backward +/// compatibility. +/// +/// @details This is one of two main header files for using XPMP2. +/// (The other is `XPMPAircraft.h`). +/// XPMP2 is a library allowing an X-Plane plugin to have +/// planes rendered in X-Plane's 3D world based on OBJ8 +/// CSL models, which need to be installed separatela. +/// The plugin shall subclass XPMP2::Aircraft:: and override +/// the abstract virtual function XPMP2::Aircraft::UpdatePosition() +/// to provide updated position and attitude information. +/// XPMP2 takes care of reading and initializaing CSL models, +/// instanciating and updating the aircraft objects in X-Plane, +/// display in a map layer, provisioning information via X-Plane's +/// AI/multiplayer (and more) dataRefs. +/// +/// @see For more developer's information see +/// https://twinfan.github.io/XPMP2/ +/// /// @author Ben Supnik and Chris Serio /// @copyright Copyright (c) 2004, Ben Supnik and Chris Serio. /// @author Birger Hoppe @@ -31,25 +52,6 @@ extern "C" { #endif -/* - Multiplayer - THEORY OF OPERATION - - The multiplayer API allows plug-ins to control aircraft visible to other plug-ins and - the user via x-plane. It effectively provides glue between a series of observers - that wish to render or in other ways act upon those planes. - - A plug-in can control zero or more planes, and zero or more plug-ins can control planes. - However, each plane is controlled by exactly one plug-in. A plug-in thus dynamically - allocates planes to control. A plug-in registers a callback which is used to pull - information. The plug-in may decide to not return information or state that that - information is unchanged. - - A plug-in can also read the current aircrafts or any of their data. Aircraft data is - cached to guarantee minimum computing of data. - - Each 'kind' of data has an enumeration and corresponding structure.*/ - - /************************************************************************************ * MARK: PLANE DATA TYPES ************************************************************************************/ @@ -57,24 +59,14 @@ extern "C" { /// XPMPPosition_t /// /// @brief This data structure contains the basic position info for an aircraft. -/// @details Lat and lon are the position of the aircraft in the world. They are double-precision to -/// provide reasonably precise positioning anywhere.\n -/// Elevation is in feet above mean sea level.\n -/// Pitch, roll, and heading define the aircraft's orientation. Heading is in degrees, positive -/// is clockwise from north. Pitch is the number of degrees, positive is nose up, and roll -/// is positive equals roll right.\n -/// Offset scale should be between 0 & 1 and indicates how much of the surface -/// contact correction offset should be applied. 1 is fully corrected, 0 is no -/// correction. This is so XSB can blend the correction out as the aircraft -/// leaves circling altitude.\n -/// clampToGround enables the ground-clamping inside of libxplanemp. If false, -/// libxplanemp will not clamp this particular aircraft.\n -/// @note There is no notion of aircraft velocity or acceleration; you will be queried for -/// your position every rendering frame. Higher level APIs can use velocity and acceleration. +/// @note This structure is only used with deprecated concepts +/// (class XPCAircraft and direct use of callback functions.) +/// @note There is no notion of aircraft velocity or acceleration; you will be queried for +/// your position every rendering frame. Higher level APIs can use velocity and acceleration. struct XPMPPlanePosition_t { long size = sizeof(XPMPPlanePosition_t); ///< size of structure - double lat = 0.0; ///< current position of aircraft - double lon = 0.0; ///< current position of aircraft + double lat = 0.0; ///< current position of aircraft (latitude) + double lon = 0.0; ///< current position of aircraft (longitude) double elevation = 0.0; ///< current altitude of aircraft [ft above MSL] float pitch = 0.0f; ///< pitch [degrees, psitive up] float roll = 0.0f; ///< roll [degrees, positive right] @@ -83,8 +75,8 @@ struct XPMPPlanePosition_t { float offsetScale = 1.0f; ///< how much of the surface contact correction offset should be applied [0..1] bool clampToGround = false; ///< enables ground-clamping for this aircraft (can be expensive, see Aircraft::bClampToGround) int aiPrio = 1; ///< Priority for AI/TCAS consideration, the lower the earlier - float label_color[4] = {1.0f,1.0f,0.0f,1.0f}; ///< label base color (RGB) - int multiIdx = 0; ///< OUT: set by xplanemp to inform application about multiplay index in use + float label_color[4] = {1.0f,1.0f,0.0f,1.0f}; ///< label base color (RGB), defaults to yellow + int multiIdx = 0; ///< OUT: set by XPMP2 to inform application about multiplayer index in use, `< 1` means 'none' }; @@ -98,17 +90,9 @@ enum { xpmp_Lights_Pattern_EADS = 1, ///< Airbus+EADS: strobe flashes twice (-*-*-----*-*--), short beacon xpmp_Lights_Pattern_GA = 2 ///< GA: one strobe flash, long beacon (-*--------*---) }; -typedef unsigned int XPMPLightsPattern; +typedef unsigned int XPMPLightsPattern; ///< Light flash pattern (unused in XPMP2) + -/* - * XPMPLightStatus - * - * This enum defines the settings for the lights bitfield in XPMPPlaneSurfaces_t - * - * The upper 16 bit of the light code (timeOffset) should be initialized only once - * with a random number by the application. This number will be used to have strobes - * flashing at different times. - */ #if LIN #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" // because we don't want to change the anonymous structure following here as that would require code change in legacy plugins @@ -116,6 +100,9 @@ typedef unsigned int XPMPLightsPattern; #pragma warning(push) #pragma warning(disable: 4202 4201) #endif +/// Defines, which lights of the aircraft are on +/// @note This structure is only used with deprecated concepts +/// (class XPCAircraft and direct use of callback functions.) union xpmp_LightStatus { unsigned int lightFlags = 0x150000; ///< this defaults to taxi | beacon | nav lights on struct { @@ -137,7 +124,10 @@ union xpmp_LightStatus { #pragma warning(pop) #endif + /// @brief External physical configuration of the plane +/// @note This structure is only used with deprecated concepts +/// (class XPCAircraft and direct use of callback functions.) /// @details This data structure will contain information about the external physical configuration of the plane, /// things you would notice if you are seeing it from outside. This includes flap position, gear position, /// etc. @@ -170,29 +160,19 @@ struct XPMPPlaneSurfaces_t { }; -/* - * XPMPTransponderMode - * - * These enumerations define the way the transponder of a given plane is operating. - * - */ +/// @brief These enumerations define the way the transponder of a given plane is operating. /// @note Only information used by XPMP2 is `"mode != xpmpTransponderMode_Standby"`, /// in which case the plane is considered for TCAS display. enum XPMPTransponderMode { - xpmpTransponderMode_Standby, ///< transponder is in standby, not currently sending ->plane not visible on TCAS + xpmpTransponderMode_Standby, ///< transponder is in standby, not currently sending -> aircraft not visible on TCAS xpmpTransponderMode_Mode3A, ///< transponder is on xpmpTransponderMode_ModeC, ///< transponder is on xpmpTransponderMode_ModeC_Low, ///< transponder is on xpmpTransponderMode_ModeC_Ident ///< transponder is on }; -/* - * XPMPPlaneRadar_t - * - * This structure defines information about an aircraft visible to radar. Eventually it can include - * information about radar profiles, stealth technology, radar jamming, etc. - * - */ + +/// @brief defines information about an aircraft visible to radar. /// @note Only information used by XPMP2 is `"mode != xpmpTransponderMode_Standby"`, /// in which case the plane is considered for TCAS display. struct XPMPPlaneRadar_t { @@ -201,14 +181,10 @@ struct XPMPPlaneRadar_t { XPMPTransponderMode mode = xpmpTransponderMode_ModeC; ///< current radar mode }; -/* - * XPMPTexts_t; - * - * This structure define textual information of planes to be passed on - * via shared dataRefs to other plugins. It is not used within xplanemp - * in any way, just passed on. - * - */ + +/// @brief Textual information of planes to be passed on +/// via shared dataRefs to other plugins. +/// @details The texts are not used within XPMP2 in any way, just passed on. struct XPMPInfoTexts_t { long size = sizeof(XPMPInfoTexts_t); char tailNum[10] = {0}; ///< registration, tail number @@ -222,11 +198,14 @@ struct XPMPInfoTexts_t { char aptTo [5] = {0}; ///< Destination airport (ICAO) }; + /// @brief This enum defines the different categories of aircraft information we can query about. /// @note While these enums are defined in a way that they could be combined together, /// there is no place, which makes use of this possibility. Each value will be used /// individually only. Because of this, the definition has been changed in XPMP2 /// to an actual enum type for clarity. +/// @note This enum is only used with deprecated concepts +/// (class XPCAircraft and direct use of callback functions.) enum XPMPPlaneDataType { xpmpDataType_Position = 1L << 1, ///< position data in XPMPPlanePosition_t xpmpDataType_Surfaces = 1L << 2, ///< physical appearance in XPMPPlaneSurfaces_t @@ -234,12 +213,10 @@ enum XPMPPlaneDataType { xpmpDataType_InfoTexts = 1L << 4, ///< informational texts in XPMPInfoTexts_t }; -/* - * XPMPPlaneCallbackResult - * - * This definfes the different responses to asking for information. - * - */ + +/// @brief Definfes the different responses to asking for information. +/// @note This enum is only used with deprecated concepts +/// (class XPCAircraft and direct use of callback functions.) enum XPMPPlaneCallbackResult { xpmpData_Unavailable = 0, /* The information has never been specified. */ xpmpData_Unchanged = 1, /* The information from the last time the plug-in was asked. */ @@ -252,14 +229,6 @@ enum XPMPPlaneCallbackResult { /// but just an ever increasing number. Don't use it as a pointer. typedef void * XPMPPlaneID; -/************************************************************************************ - * Some additional functional by den_rain - ************************************************************************************/ - -void actualVertOffsetInfo(const char *inMtl, char *outType, double *outOffset); -void setUserVertOffset(const char *inMtlCode, double inOffset); -void removeUserVertOffset(const char *inMtlCode); - /************************************************************************************ * MARK: INITIALIZATION @@ -270,34 +239,35 @@ void removeUserVertOffset(const char *inMtlCode); #define XPMP_CFG_SEC_DEBUG "debug" ///< Config section "debug" // Config key definitions -#define XPMP_CFG_ITM_CLAMPALL "clamp_all_to_ground" ///< Ensure no plane sinks below ground, no matter of Aircraft::bClampToGround -#define XPMP_CFG_ITM_SKIP_NOPLANE "skip_assign_noplane" ///< For faking TCAS, all AI/multiplayer planes are assigned the `NoPlane.acf` type when XPMP2 takes over control. This option allows to skip assining `NoPlane.acf`...just in case. -#define XPMP_CFG_ITM_COPY_NOPLANE "copy_noplane" ///< On startup, shall `NoPlane.acf` be copied from the resource directory to `/Aircraft/`? This is highly recommended to reduce side-effects of using `NoPlane` as AI Aircraft model. -#define XPMP_CFG_ITM_LOGLEVEL "log_level" ///< General level of logging into Log.txt (0 = Debug, 1 = Info, 2 = Warning, 3 = Error, 4 = Fatal) -#define XPMP_CFG_ITM_MODELMATCHING "model_matching" ///< Write information on model matching into Log.txt +#define XPMP_CFG_ITM_CLAMPALL "clamp_all_to_ground" ///< Config key: Ensure no plane sinks below ground, no matter of Aircraft::bClampToGround +#define XPMP_CFG_ITM_SKIP_NOPLANE "skip_assign_noplane" ///< Config key: For faking TCAS, all AI/multiplayer planes are assigned the `NoPlane.acf` type when XPMP2 takes over control. This option allows to skip assining `NoPlane.acf`...just in case. +#define XPMP_CFG_ITM_COPY_NOPLANE "copy_noplane" ///< Config key: On startup, shall `NoPlane.acf` be copied from the resource directory to `/Aircraft/`? This is highly recommended to reduce side-effects of using `NoPlane` as AI Aircraft model. +#define XPMP_CFG_ITM_LOGLEVEL "log_level" ///< Config key: General level of logging into Log.txt (0 = Debug, 1 = Info, 2 = Warning, 3 = Error, 4 = Fatal) +#define XPMP_CFG_ITM_MODELMATCHING "model_matching" ///< Config key: Write information on model matching into Log.txt /// @brief Definition for the type of configuration callback function /// @details The plugin using XPMP2 can provide such a callback function via XPMPMultiplayerInitLegacyData(). /// It will be called max. every 2s to fetch each of the following configuraton values:\n +/// \n /// `section | key                 | type | default | description`\n /// `------- | ------------------- | ---- | ------- | -------------------------------------------------------------------------`\n /// `planes  | clamp_all_to_ground | int  |    1    | Ensure no plane sinks below ground, no matter of Aircraft::bClampToGround`\n /// `planes  | skip_assign_noplane | int  |    0    | If non-zero, then AI planes will not be assigned the NoPlane.acf type.`\n -/// `planes  | copy_noplane | int  |    1    | Shall NoPlane.acf be copied to Aircraft folder if missing/newer? (Recommended!)`\n +/// `planes  | copy_noplane        | int  |    1    | Shall NoPlane.acf be copied to Aircraft folder if missing/newer? (Recommended!)`\n /// `debug   | log_level           | int  |    2    | General level of logging into Log.txt (0 = Debug, 1 = Info, 2 = Warning, 3 = Error, 4 = Fatal)`\n /// `debug   | model_matching      | int  |    0    | Write information on model matching into Log.txt`\n /// @note There is no immediate requirement to check the value of `_section` in your implementation. /// `_key` by itself is unique. Compare it with any of the `XPMP_CFG_ITM_*` values and return your value. -/// @param _section Configuration section, ie. group of values. +/// @param _section Configuration section, ie. group of values, any of the `XPMP_CFG_SEC_*` values /// @param _key Any of the `XPMP_CFG_ITM_*` values to indicate which config value is to be returned. -/// @param _default A default provided by XPMP. Have your callback return '_default' if you don't want to explicitely set a value or don't know the `_key`. -/// @return Your callback shall return your config value for config item `_key' +/// @param _default A default provided by XPMP2. Have your callback return '_default' if you don't want to explicitely set a value or don't know the `_key`. +/// @return Your callback shall return your config value for config item `_key` typedef int (*XPMPIntPrefsFuncTy)(const char* _section, const char* _key, int _default); /// @brief Deprecated legacy initialization of XPMP2. /// @note Parameters changed compared to libxplanemp! /// @details Effectively calls, in this order, -/// XPMPMultiplayerInit() (with `resourceDir` being `nullptr`) and XPMPLoadCSLPackage(). +/// XPMPMultiplayerInit() and XPMPLoadCSLPackage(). /// @see XPMPMultiplayerInit() and XPMPLoadCSLPackage() for details on the parameters. [[deprecated("Use XPMPMultiplayerInit and XPMPLoadCSLPackages")]] const char * XPMPMultiplayerInitLegacyData(const char* inCSLFolder, @@ -309,7 +279,7 @@ const char * XPMPMultiplayerInitLegacyData(const char* inCSLFolder, /// @brief Initializes the XPMP2 library. This shall be your first call to the library. /// @note Parameters changed compared to libxplanemp! /// @param inPluginName Your plugin's name, used only in output to `Log.txt` -/// @param resourceDir The directory where XPMP2 finds all required supplemental files (Doc8643.txt, MapIcons.png, NoPlane.acf...) +/// @param resourceDir The directory where XPMP2 finds all required supplemental files (`Doc8643.txt`, `MapIcons.png`, `NoPlane.acf`, `related.txt`) /// @param inIntPrefsFunc A pointer to a callback function providing integer config values. See ::XPMPIntPrefsFuncTy for details. /// @param inDefaultICAO A fallback aircraft type if no type can be deduced otherwise for an aircraft. /// @return Empty string in case of success, otherwise a human-readable error message. @@ -319,57 +289,51 @@ const char * XPMPMultiplayerInit(const char* inPluginName, const char* inDefaultICAO = nullptr); /// @brief Overrides the plugin's name to be used in Log output -/// @details The name in use defaults to the plugin's name as set in XPluginStart(). -/// Replaces the compile-time macro `XPMP_CLIENT_LONGNAME` from earlier releases. +/// @details The same as providing a plugin name with XPMPMultiplayerInit(). +/// If no name is provided, it defaults to the plugin's name as set in XPluginStart(). +/// @note Replaces the compile-time macro `XPMP_CLIENT_LONGNAME` needed in `libxplanemp`. void XPMPSetPluginName (const char* inPluginName); -/* - * XPMPMultiplayerCleanup - * - * Clean up the multiplayer library. Call this from XPluginStop to reverse the actions of - * XPMPMultiplayerInit as much as possible. - */ + +/// @brief Clean up the multiplayer library +/// @details This shall be your last call to XPMP2. +/// Call this latest from XPluginStop for proper and controlled +/// cleanup of resources used by XPMP2. void XPMPMultiplayerCleanup(); -/* - * XPMPMultiplayerOBJ7SupportEnable - * - * Sets the light texture to use for old OBJ7 models and initializes the required OpenGL hooks - * for OBJ7 rendering. An empty string is returned on success, or a human-readable error message - * otherwise. Calling this function is required if you are going to use OBJ7 CSLs. - * - * UNSUPPORTED, will alsways return "OBJ7 format is no longer supported" - */ + +/// @brief Used to set the light textures for old OBJ7 models. +/// @note Unsupported with XPMP2, will always return "OBJ7 format is no longer supported" +[[deprecated("Unsupported feature, will alsways return 'OBJ7 format is no longer supported'")]] const char * XPMPMultiplayerOBJ7SupportEnable(const char * inTexturePath); + /************************************************************************************ * MARK: AI / Multiplayer plane control ************************************************************************************/ -/* - * XPMPMultiplayerEnable - * - * Enable drawing of multiplayer planes. Call this once from your XPluginEnable routine to - * grab multiplayer; an empty string is returned on success, or a human-readable error message - * otherwise. - * - */ + +/// @brief Tries to grab control of AI/multiplayer planes from X-Plane +/// @details Only one plugin can have AI/multiplayer control at any one time. +/// So be prepared to properly handle an non-empty response +/// that indicates that you did not get control now.\n +/// If successful, XPMP2's aircraft will appear on TCAS and are +/// available to 3rd-party plugins relying on multiplayer dataRefs.\n +/// Typically, a plugin calls this function early in the initialization, +/// just before the first aircraft are created. But it could also +/// be bound to a menu item, for example. +/// @return Empty string on success, human-readable error message otherwise const char * XPMPMultiplayerEnable(); -/* - * XPMPMultiplayerDisable - * - * Disable drawing of multiplayer planes. Call this from XPluginDisable to release multiplayer. - * Reverses the actions on XPMPMultiplayerEnable. - */ + +/// @brief Release AI/multiplayer control. +/// @details Afterwards, XPMP2's aircraft will no longer appear on TCAS or +/// on 3rd-party plugins relying on multiplayer dataRefs.\n +/// Is called during XPMPMultiplayerCleanup() automatically. void XPMPMultiplayerDisable(); -/* - * XPMPHasControlOfAIAircraft - * - * Does XPMP control AI aircrafts (after a call to XPMPMultiplayerEnable) - * and, hence, can fake TCAS display? - */ + +/// Has XPMP2 control of AI/multiplayer aircraft? (See XPMPMultiplayerEnable()) bool XPMPHasControlOfAIAircraft(); /************************************************************************************ @@ -377,8 +341,21 @@ bool XPMPHasControlOfAIAircraft(); ************************************************************************************/ /// @brief Loads CSL packages from the given folder, searching up to 5 folder levels deep. -/// @details This function mainly searches the given folder for packages and reads the structure. -/// Actual loading of objects is done asynchronously when needed only. +/// @details This function mainly searches the given folder for packages. +/// It traverses all folders in search for `xsb_aircraft.txt` files. +/// It will find all `xsb_aircraft.txt` files situated at or below +/// the given root path, up to 5 levels deep.\n +/// As soon as such a file is found it is read and processed. +/// Depth search then ends. (But searching parallel folders may +/// still continue.)\n +/// The `xsb_aircraft.txt` is loaded and processed. Duplicate models +/// (by CSL model name, tag `OBJ8_AIRCRAFT`) are ignored. +/// For others the existence of the `.obj` file is validated +/// (but not the existence of files in turn needed by the `.obj` +/// file, like textures.) and if successful the model is added to an +/// internal catalogue.\n +/// Actual loading of objects is done later and asynchronously +/// when needed only during aircraft creation. /// @param inCSLFolder Root folder to start the search. const char * XPMPLoadCSLPackage(const char * inCSLFolder); diff --git a/Lib/XPMP2/XPMP2.framework/Versions/1.0/Resources/Info.plist b/Lib/XPMP2/XPMP2.framework/Versions/1.0/Resources/Info.plist index 6f08c266..e1b8aa1d 100644 --- a/Lib/XPMP2/XPMP2.framework/Versions/1.0/Resources/Info.plist +++ b/Lib/XPMP2/XPMP2.framework/Versions/1.0/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 19D76 + 19E287 CFBundleDevelopmentRegion en CFBundleExecutable diff --git a/Lib/XPMP2/XPMP2.framework/Versions/1.0/XPMP2 b/Lib/XPMP2/XPMP2.framework/Versions/1.0/XPMP2 index a7bd2340..be8afb7e 100644 Binary files a/Lib/XPMP2/XPMP2.framework/Versions/1.0/XPMP2 and b/Lib/XPMP2/XPMP2.framework/Versions/1.0/XPMP2 differ diff --git a/Lib/XPMP2/libXPMP2.a b/Lib/XPMP2/libXPMP2.a index f7997e6d..23161f90 100644 Binary files a/Lib/XPMP2/libXPMP2.a and b/Lib/XPMP2/libXPMP2.a differ diff --git a/LiveTraffic.xcodeproj/project.xcworkspace/xcuserdata/birger.xcuserdatad/xcdebugger/Expressions.xcexplist b/LiveTraffic.xcodeproj/project.xcworkspace/xcuserdata/birger.xcuserdatad/xcdebugger/Expressions.xcexplist index a9b89ac0..48e7ab19 100644 --- a/LiveTraffic.xcodeproj/project.xcworkspace/xcuserdata/birger.xcuserdatad/xcdebugger/Expressions.xcexplist +++ b/LiveTraffic.xcodeproj/project.xcworkspace/xcuserdata/birger.xcuserdatad/xcdebugger/Expressions.xcexplist @@ -45,13 +45,13 @@ contextName = "Apt::FindEdgesForHeading(double, double, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, TaxiEdge::edgeTy) const:LTApt.cpp"> + value = "lst[1385]"> + value = "vecTaxiEdges[222]"> @@ -84,10 +84,10 @@ contextName = "LTFlightData::AddDynData(LTFlightData::FDDynamicData const&, int, int, positionTy*):LTFlightData.cpp"> + value = "dynDataDeque"> + value = "posDeque"> @@ -215,10 +215,10 @@ value = "cull"> + value = "tcas"> + value = "iter->second"> @@ -313,6 +313,11 @@ + + + + @@ -335,6 +340,14 @@ + + + + + + @@ -381,7 +394,7 @@ value = "from"> + value = "turn"> @@ -390,7 +403,7 @@ value = "ppos"> + value = "ppos.v[6]"> @@ -480,10 +493,10 @@ value = "mapFd"> + value = "dataRefs"> + value = "sizeof(bool)"> @@ -505,13 +518,13 @@ contextName = "LTAircraft::GetPlanePosition(XPMPPlanePosition_t*):LTAircraft.cpp"> + value = "prevPos"> + value = "ppos"> @@ -960,10 +973,10 @@ value = "_startTime"> + value = "_deltaDist"> + value = "_targetTime"> diff --git a/Src/ACInfoWnd.cpp b/Src/ACInfoWnd.cpp index 79ac2b20..c9619312 100644 --- a/Src/ACInfoWnd.cpp +++ b/Src/ACInfoWnd.cpp @@ -694,7 +694,7 @@ void ACIWnd::UpdateStatValues() stat.pDoc8643->classification.c_str() : "-"); XPSetWidgetDescriptor(widgetIds[ACI_TXT_MANU], strAtMost(stat.man, 25).c_str()); XPSetWidgetDescriptor(widgetIds[ACI_TXT_MODEL], strAtMost(stat.mdl, 25).c_str()); - XPSetWidgetDescriptor(widgetIds[ACI_TXT_OP], strAtMost(stat.opIcao + " " + stat.op,25).c_str()); + XPSetWidgetDescriptor(widgetIds[ACI_TXT_OP], strAtMost((stat.opIcao.empty() ? stat.op : stat.opIcao + ": " + stat.op),25).c_str()); XPSetWidgetDescriptor(widgetIds[ACI_TXT_CALLSIGN], stat.call.c_str()); XPSetWidgetDescriptor(widgetIds[ACI_TXT_FLIGHT_ROUTE], stat.flightRoute().c_str()); diff --git a/Src/LTAircraft.cpp b/Src/LTAircraft.cpp index 9d1692f7..191a266e 100644 --- a/Src/LTAircraft.cpp +++ b/Src/LTAircraft.cpp @@ -2803,14 +2803,6 @@ XPMPPlaneCallbackResult LTAircraft::GetInfoTexts(XPMPInfoTexts_t* outInfo) return xpmpData_Unavailable; } -// fetches and then returns the name of the aircraft model in use -std::string LTAircraft::GetModelName() const -{ - char buf[256]; - XPMPGetPlaneModelName(mPlane, buf, sizeof(buf)); - return std::string(buf); -} - // change the model (e.g. when model-defining static data changed) void LTAircraft::ChangeModel (const LTFlightData::FDStaticData& statData) { diff --git a/Src/LTFlightData.cpp b/Src/LTFlightData.cpp index ac211ae5..bf1b3fff 100644 --- a/Src/LTFlightData.cpp +++ b/Src/LTFlightData.cpp @@ -2295,7 +2295,7 @@ bool LTFlightData::DetermineAcModel() // pretty clear indicator for a ground vehicle (statData.catDescr.find(OPSKY_MD_TEXT_VEHICLE) != std::string::npos || // I'm having the feeling that if nearly all is empty and the category description is "No Info" then it's often also a ground vehicle - (statData.catDescr.find(OPSKY_MD_TEX_NO_CAT) != std::string::npos && + (statData.catDescr.find(OPSKY_MD_TEXT_NO_CAT) != std::string::npos && statData.man.empty() && statData.mdl.empty() && statData.opIcao.empty()) || // ADSBEx doesn't send as clear an indicator, but data analysis // suggests that EngType/Mount == 0 is a good indicator @@ -2304,9 +2304,16 @@ bool LTFlightData::DetermineAcModel() (statData.op.empty() && statData.reg.empty() && statData.destAp.empty())) ) { - // assume surface vehicle - statData.acTypeIcao = dataRefs.GetDefaultCarIcaoType(); - return prevType != statData.acTypeIcao; + // We would now decide for surface vehicle + // but we only do so if we had no other type before + // (ie. if we previously had decided for standard a/c then we keep that!) + if (prevType.empty()) { + statData.acTypeIcao = dataRefs.GetDefaultCarIcaoType(); + return true; + } else { + statData.acTypeIcao = std::move(prevType); + return false; + } } // we have no better idea than standard diff --git a/Src/LTOpenSky.cpp b/Src/LTOpenSky.cpp index f1cf048d..f65fec25 100644 --- a/Src/LTOpenSky.cpp +++ b/Src/LTOpenSky.cpp @@ -245,6 +245,16 @@ bool OpenSkyAcMasterdata::FetchAllData (const positionTy& /*pos*/) break; case HTTP_NOT_FOUND: // doesn't know a/c, don't query again invIcaos.emplace_back(info.acKey.icao); + + // We add "model=[?], owner=[?]". By this way we don't trigger the car detection, + // that means: If we don't know the transponder at all we'd rather decide on standard a/c but not car + if (data.length() > 1) // concatenate both JSON groups + data += ", "; + data += "\"" OPSKY_MD_GROUP "\": { \"" OPSKY_MD_TRANSP_ICAO "\": \""; + data += currKey; + data += "\", \"" OPSKY_MD_MDL "\": \"" OPSKY_MD_MDL_UNKNOWN "\", " + "\"" OPSKY_MD_OP "\": \"" OPSKY_MD_MDL_UNKNOWN "\" }"; + bChannelOK = true; // but technically a valid response break; case HTTP_BAD_REQUEST: // uh uh...done something wrong, don't do that again diff --git a/docs/Notes.txt b/docs/Notes.txt index 83019c37..43bbe399 100644 --- a/docs/Notes.txt +++ b/docs/Notes.txt @@ -5,6 +5,22 @@ LTApt - Instead of wasting space with all nodes supporting Dijkstra, consider a map holding Dijkstra info per visited node +Download History +========== +Download counter when providing v2.00: 77.048 +Download counter when providing v1.52: 76.467 +Download counter when providing v1.51: 75.073 +Download counter when providing v1.50: 72.486 +Download counter when providing v1.24: 64.921 +Download counter when providing v1.23: 63.965 +Download counter when providing v1.22: 39.778 +Download counter when providing v1.21: 36.845 +Download counter when providing v1.20: 32.592 +Download counter when providing v1.16: 23.480 +Download counter when providing v1.15: 21.292 +Download counter when providing v1.10: 16.649 +Download counter when providing v1.00: 12.192 +Download counter when providing v0.94: 10.917 DOCUMENTATION =========== diff --git a/docs/readme.html b/docs/readme.html index 07618519..4581f576 100755 --- a/docs/readme.html +++ b/docs/readme.html @@ -86,12 +86,58 @@

Release Notes

v2.0

-

v2.00

+

v2.01

-

Please follow +

Please follow upgrade instructions - for upgrading an existing LiveTraffic installation to version 2.0. + for upgrading an existing LiveTraffic v1.5 (or earlier) installation to version 2.0.

+ +

For updating coming from v2.00 copy lin|mac|win_x64/LiveTraffic.xpl + and Resources/NoPlane.acf

+ +
    +
  • CSL Models: If VERT_OFFSET is not specified in xsb_aircraft.txt + then it is extracted from the model's .obj file. + Will help some X-CSL models back onto the ground.
  • +
  • CHANGE XPMP2 #8 + Matching now prefers a matching related a/c type plus matching livery + over a model with matching exact a/c type but without livery.
    + This will show correct livery more often at the price of + picking a related a/c type only if nothing better is available. +
  • FIXED #178 + planes transforming to cars on touch-down.
  • +
  • CHANGED identification of cars: If no info about an object is available + at all (e.g. not maintained yet at OpenSky), then will decide for + default plane, not car.
  • +
  • Aircraft Info Window + reports CSL Model again with last segment + of path where model is taken from, allows to identify the package used + (like Bluebell vs. X-CSL).
  • +
  • Removed residual jet smoke from under planes (by updating NoPlane.acf).
  • +
  • For plugin developers: +
      +
    • FIXED XPMP2 #7 + multiplayer slot indexes returned to plugin being off by 1, + are now 1-based again
    • +
    • Y value published in sim/multiplayer/plane... datarefs + is in line again with altitude reported via LTAPI, + ie. without VERT_OFFSET.
    • +
    • ADDED #180: + LiveTraffic's version number and date are provided via + dataRefs livetraffic/ver/nr and .../date.
    • +
    • LTAPI + provides respective version number/date functions, too.
    • +
    • LTAPI + should also return last path segment together with model name + in cslModel.
    • +
    +
  • +
+ + +

v2.00

+
  • Supports X-Plane 11 only.