Skip to content

Commit 50807fd

Browse files
authored
Merge pull request #265 from TwinFan/Next
v3.5.1 Hotfix OpenSky et al.
2 parents 4d8a05b + 4e2a94a commit 50807fd

File tree

20 files changed

+1160
-959
lines changed

20 files changed

+1160
-959
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
# Let's set all project specific definitions globally
1010
env:
1111
PRJ_NAME: LiveTraffic # The plugin's name, expected to be the .xpl file's name and used as the plugin folder name
12-
version_beta: ${{ github.ref != 'refs/heads/master' && '1' || '0' }} # On non-master branches we build BETA versions
12+
# On master branches or when explicitely tagged we build prod versions, otherwise BETA
13+
version_beta: ${{ (github.ref != 'refs/heads/master' && github.ref_type != 'tag') && '1' || '0' }}
1314

1415
jobs:
1516
#####################################

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else()
2121
endif()
2222

2323
project(LiveTraffic
24-
VERSION 3.5.0
24+
VERSION 3.5.1
2525
DESCRIPTION "LiveTraffic X-Plane plugin")
2626

2727
# Building a Beta version can be demanded via ENV variable 'version_beta' being set to 1
571 Bytes
Binary file not shown.
531 Bytes
Binary file not shown.

Data/RealTraffic/RT_API.sjson/data

73 Bytes
Binary file not shown.
47 Bytes
Binary file not shown.

Include/Constants.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ constexpr const char* REMOTE_SIGNATURE = "TwinFan.plugin.XPMP2.Remote";
228228
#define MENU_HAVE_TCAS "TCAS controlled"
229229
#define MENU_HAVE_TCAS_REQUSTD "TCAS controlled (requested)"
230230
#define MENU_TOGGLE_LABELS "Labels shown"
231+
#define MENU_TOGGLE_AC_AHEAD "Hide Aircraft ahead"
231232
#define MENU_SETTINGS_UI "Settings..."
232233
#define MENU_HELP "Help"
233234
#define MENU_HELP_DOCUMENTATION "Documentation"
@@ -237,6 +238,8 @@ constexpr const char* REMOTE_SIGNATURE = "TwinFan.plugin.XPMP2.Remote";
237238
#define MENU_HELP_AC_INFO_WND "A/C Info Window"
238239
#define MENU_HELP_SETTINGS "Settings"
239240
#define MENU_HELP_INSTALL_CSL "Installaton of CSL Models"
241+
#define MENU_HELP_SUPPORT_FORUM "Support Forum"
242+
#define MENU_HELP_SUPPORT_HOWTO "Support HowTo"
240243
#define MENU_NEWVER "New Version %s available!"
241244
#ifdef DEBUG
242245
#define MENU_RELOAD_PLUGINS "Reload all Plugins (Caution!)"
@@ -270,6 +273,9 @@ constexpr const char* REMOTE_SIGNATURE = "TwinFan.plugin.XPMP2.Remote";
270273
#define HELP_SET_CSL "setup/configuration/settings-csl"
271274
#define HELP_SET_DEBUG "setup/configuration/settings-debug"
272275

276+
#define URL_SUPPORT_FORUM "https://forums.x-plane.org/index.php?/forums/forum/457-livetraffic-support/"
277+
#define URL_SUPPORT_HOWTO "https://forums.x-plane.org/index.php?/forums/topic/174691-support"
278+
273279
//MARK: File Paths
274280
// these are under the plugins directory
275281
#define PATH_FLIGHT_MODELS "Resources/FlightModels.prf"

Include/DataRefs.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ enum cmdRefsLT {
449449
CR_AC_DISPLAYED,
450450
CR_AC_TCAS_CONTROLLED,
451451
CR_LABELS_TOGGLE,
452+
CR_TOGGLE_AC_AHEAD, ///< Toggle visibility of the a/c ahead
452453
CR_SETTINGS_UI,
453454
CNT_CMDREFS_LT // always last, number of elements
454455
};
@@ -1036,9 +1037,9 @@ class DataRefs
10361037
int DecNumAc();
10371038

10381039
// Get XP System Path
1039-
inline std::string GetXPSystemPath() const { return XPSystemPath; }
1040-
inline std::string GetLTPluginPath() const { return LTPluginPath; }
1041-
inline std::string GetDirSeparator() const { return DirSeparator; }
1040+
const std::string& GetXPSystemPath() const { return XPSystemPath; }
1041+
const std::string& GetLTPluginPath() const { return LTPluginPath; }
1042+
const std::string& GetDirSeparator() const { return DirSeparator; }
10421043

10431044
// Load/save config file (basically a subset of LT dataRefs)
10441045
bool LoadConfigFile();

Include/LTOpenSky.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ constexpr size_t OPSKY_MD_TEXT_VEHICLE_LEN = 20; ///< length after which cate
103103

104104
#define OPSKY_MD_DB_NAME "OpenSky Masterdata File"
105105
#define OPSKY_MD_DB_URL "https://opensky-network.org/datasets/metadata/"
106+
#define OPSKY_MD_DB_FILE_BEGIN "aircraft-database-complete-"
106107
#define OPSKY_MD_DB_FILE "aircraft-database-complete-%04d-%02d.csv"
107108

108109
#define OPSKY_ROUTE_URL "https://opensky-network.org/api/routes?callsign="

Include/LTRealTraffic.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ constexpr double RT_VSI_AIRBORNE = 80.0; ///< if VSI is more than this then w
7979
constexpr long RT_DRCT_DEFAULT_WAIT = 8000L; ///< [ms] Default wait time between traffic requests
8080
constexpr std::chrono::seconds RT_DRCT_ERR_WAIT = std::chrono::seconds(5); ///< standard wait between errors
8181
constexpr std::chrono::minutes RT_DRCT_WX_WAIT = std::chrono::minutes(10); ///< How often to update weather?
82+
constexpr std::chrono::seconds RT_DRCT_WX_ERR_WAIT = std::chrono::seconds(60); ///< How long to wait after receiving an weather error?
8283
constexpr long RT_DRCT_WX_DIST = 10L * M_per_NM; ///< Distance for which weather is considered valid, greater than that and we re-request
83-
constexpr int RT_DRCT_MAX_WX_ERR = 10; ///< Max number of consecutive errors during weather requests we wait for...before not asking for weather any longer
84+
constexpr int RT_DRCT_MAX_WX_ERR = 5; ///< Max number of consecutive errors during initial weather requests we wait for...before not asking for weather any longer
8485

8586
/// Fields in a response of a direct connection's request
8687
enum RT_DIRECT_FIELDS_TY {
@@ -265,12 +266,13 @@ class RealTrafficConnection : public LTFlightDataChannel
265266
/// Weather data
266267
struct WxTy {
267268
double QNH = NAN; ///< baro pressure
268-
std::chrono::steady_clock::time_point time; ///< time when RealTraffic weather was received
269+
std::chrono::steady_clock::time_point next; ///< next time to request RealTraffic weather
269270
positionTy pos; ///< viewer position for which we received Realtraffic weather
270271
long tOff = 0; ///< time offset for which we requested weather
271272
int nErr = 0; ///< How many errors did we have during weather requests?
272273

273-
WxTy& operator = (const CurrTy& o); ///< fill from `current` data
274+
/// Set all relevant values
275+
void set (double qnh, const CurrTy& o, bool bResetErr = true);
274276
} rtWx; ///< Data with which latest weather was requested
275277
/// How many flights does RealTraffic have in total?
276278
long lTotalFlights = -1;

0 commit comments

Comments
 (0)