Skip to content

Commit

Permalink
Fix/RT: Show proper history Sim Time in AC Info Wnd
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Sep 8, 2024
1 parent 9f460b8 commit 62a7b2a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else()
endif()

project(LiveTraffic
VERSION 3.6.8
VERSION 3.6.9
DESCRIPTION "LiveTraffic X-Plane plugin")
set(VERSION_BETA 1)

Expand Down
1 change: 1 addition & 0 deletions Include/LTRealTraffic.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ class RealTrafficConnection : public LTFlightDataChannel
// Status
std::string GetStatusText () const override; ///< return a human-readable status
bool isHistoric () const { return curr.tOff > 0; } ///< serving historic data?
double GetTSAdjust () const { return tsAdjust; } ///< current timestamp adjustment

protected:
void Main () override; ///< virtual thread main function
Expand Down
4 changes: 2 additions & 2 deletions LiveTraffic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@
LIVETRAFFIC_VERSION_BETA = 1;
LIVETRAFFIC_VER_MAJOR = 3;
LIVETRAFFIC_VER_MINOR = 6;
LIVETRAFFIC_VER_PATCH = 8;
LIVETRAFFIC_VER_PATCH = 9;
LLVM_LTO = NO;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.15;
Expand Down Expand Up @@ -905,7 +905,7 @@
LIVETRAFFIC_VERSION_BETA = 1;
LIVETRAFFIC_VER_MAJOR = 3;
LIVETRAFFIC_VER_MINOR = 6;
LIVETRAFFIC_VER_PATCH = 8;
LIVETRAFFIC_VER_PATCH = 9;
LLVM_LTO = YES;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.15;
Expand Down
13 changes: 12 additions & 1 deletion Src/ACInfoWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,18 @@ void ACIWnd::buildInterface()
if (bOpen)
{
CollSecClear(ACI_SB_SIMULATION);
buildRow("Simulated Time", dataRefs.GetSimTimeString().c_str(), true);

std::string s;
// in case of historic RealTraffic data we adjust timestamp to the historic time
if (const RealTrafficConnection* pRTChn = dynamic_cast<const RealTrafficConnection*>(pChannel))
{
if (pRTChn->isHistoric())
s = ts2string(dataRefs.GetSimTime() - pRTChn->GetTSAdjust());
}
// otherwise show general simulated time
if (s.empty())
s = dataRefs.GetSimTimeString();
buildRow("Simulated Time", s.c_str(), true);

// last received tracking data
const double lstDat = pFD ? (pFD->GetYoungestTS() - ts) : -99999.9;
Expand Down
1 change: 1 addition & 0 deletions Src/LiveTraffic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ float LoopCBOneTimeSetup (float, float, int, void*)
// but can't because determining if user has set real weather
// only works later, in the flight loops.)
if (dataRefs.GetWeatherControl() < WC_NONE)
// TODO: Weather default: Cannot be RealTraffic if not having a RT license
DATA_REFS_LT[DR_CFG_WEATHER_CONTROL].setData(WeatherIsXPRealWeather() ?
WC_REAL_TRAFFIC : WC_NONE);

Expand Down
6 changes: 6 additions & 0 deletions Src/SettingsUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,12 @@ void LTSettingsUI::buildInterface()
// Use METAR up to which distance from fiel?
ImGui::FilteredCfgNumber("Max. METAR distance", sFilter, DR_CFG_WEATHER_MAX_METAR_DIST, 5, 100, 5, "%d nm");

// TODO: Add option to set weather by static METAR
// Idea: Set LiveTraffic's weather setting to "Off".
// Set complete weather by METAR, like wind in all altitutes,
// temperatur approximated by altitude etc....
// Set it once and once only in X-Plane in a non-changing mode.

if (!*sFilter) { ImGui::TreePop(); ImGui::Spacing(); }
} // --- Weather ---

Expand Down
4 changes: 4 additions & 0 deletions docs/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ <h3>v3.6.8 Beta</h3>
Uses METAR to set weather when user is flying below height AGL set in <i>Use METAR up to</i>,
switches to X-Plane's real weather above that height.
</li>
<li>
OpenSky is again enabled by default in new installations.<br>
If you want to use OpenSky in an existing installation just activate it in <a href="https://twinfan.gitbook.io/livetraffic/setup/installation/opensky">the channel's settings</a>.
</li>
</ul>

<h3>v3.6.7 Beta</h3>
Expand Down

0 comments on commit 62a7b2a

Please sign in to comment.