mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
[FG] Enhancing version compatibility check
This commit is contained in:
committed by
Mat Sutcliffe
parent
42fd0ed86e
commit
22a70e083e
@@ -38,9 +38,9 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
QString CFGSwiftBusServiceProxy::getVersionNumber()
|
||||
int CFGSwiftBusServiceProxy::getVersionNumber()
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getVersionNumber"));
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getVersionNumber"));
|
||||
}
|
||||
|
||||
void CFGSwiftBusServiceProxy::getOwnAircraftSituationData(FlightgearData *o_flightgearData)
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace BlackSimPlugin
|
||||
|
||||
public slots:
|
||||
//! Get Flightgear version number
|
||||
QString getVersionNumber();
|
||||
int getVersionNumber();
|
||||
|
||||
//! Get own aircraft situation data
|
||||
void getOwnAircraftSituationData(FlightgearData *o_flightgearData);
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
#include <QPointer>
|
||||
#include <math.h>
|
||||
|
||||
#define FGSWIFTBUS_API_VERSION 1
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -1020,12 +1022,9 @@ namespace BlackSimPlugin
|
||||
bool result = service.isValid() && traffic.isValid();
|
||||
if (! result) { return; }
|
||||
|
||||
QString flightgearVersion = service.getVersionNumber();
|
||||
QString flightgearVersionMinimum = "2019.2.0";
|
||||
|
||||
if (flightgearVersion < flightgearVersionMinimum)
|
||||
if (service.getVersionNumber() != FGSWIFTBUS_API_VERSION)
|
||||
{
|
||||
CLogMessage(this).error(u"You are using Flightgear %1. This version of swift is only compatible with Flightgear %2 or newer. Consider upgrading!") << flightgearVersion << flightgearVersionMinimum;
|
||||
CLogMessage(this).error(u"This version of swift is not compatible with this Flightgear version. For further information check http://wiki.flightgear.org/Swift.");
|
||||
return;
|
||||
}
|
||||
if (!traffic.initialize())
|
||||
|
||||
Reference in New Issue
Block a user