mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +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)
|
void CFGSwiftBusServiceProxy::getOwnAircraftSituationData(FlightgearData *o_flightgearData)
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Get Flightgear version number
|
//! Get Flightgear version number
|
||||||
QString getVersionNumber();
|
int getVersionNumber();
|
||||||
|
|
||||||
//! Get own aircraft situation data
|
//! Get own aircraft situation data
|
||||||
void getOwnAircraftSituationData(FlightgearData *o_flightgearData);
|
void getOwnAircraftSituationData(FlightgearData *o_flightgearData);
|
||||||
|
|||||||
@@ -62,6 +62,8 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#define FGSWIFTBUS_API_VERSION 1
|
||||||
|
|
||||||
using namespace BlackConfig;
|
using namespace BlackConfig;
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
@@ -1020,12 +1022,9 @@ namespace BlackSimPlugin
|
|||||||
bool result = service.isValid() && traffic.isValid();
|
bool result = service.isValid() && traffic.isValid();
|
||||||
if (! result) { return; }
|
if (! result) { return; }
|
||||||
|
|
||||||
QString flightgearVersion = service.getVersionNumber();
|
if (service.getVersionNumber() != FGSWIFTBUS_API_VERSION)
|
||||||
QString flightgearVersionMinimum = "2019.2.0";
|
|
||||||
|
|
||||||
if (flightgearVersion < flightgearVersionMinimum)
|
|
||||||
{
|
{
|
||||||
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;
|
return;
|
||||||
}
|
}
|
||||||
if (!traffic.initialize())
|
if (!traffic.initialize())
|
||||||
|
|||||||
Reference in New Issue
Block a user