mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
FG: Add version number check
This commit is contained in:
committed by
Klaus Basan
parent
a34b222c3e
commit
d61814f8e9
@@ -38,6 +38,11 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
QString CFGSwiftBusServiceProxy::getVersionNumber()
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getVersionNumber"));
|
||||
}
|
||||
|
||||
void CFGSwiftBusServiceProxy::getOwnAircraftSituationData(FlightgearData *o_flightgearData)
|
||||
{
|
||||
QPointer<CFGSwiftBusServiceProxy> myself(this);
|
||||
|
||||
@@ -97,6 +97,9 @@ namespace BlackSimPlugin
|
||||
void airportsInRangeUpdated(const QStringList &icaoCodes, const QStringList &names, const QList<double> &lats, const QList<double> &lons, const QList<double> &alts);
|
||||
|
||||
public slots:
|
||||
//! Get Flightgear version number
|
||||
QString getVersionNumber();
|
||||
|
||||
//! Get own aircraft situation data
|
||||
void getOwnAircraftSituationData(FlightgearData *o_flightgearData);
|
||||
|
||||
|
||||
@@ -955,6 +955,13 @@ namespace BlackSimPlugin
|
||||
bool result = service.isValid() && traffic.isValid();
|
||||
if (! result) { return; }
|
||||
|
||||
QString flightgearVersion = service.getVersionNumber();
|
||||
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;
|
||||
return;
|
||||
}
|
||||
if (!traffic.initialize())
|
||||
{
|
||||
CLogMessage(this).error(u"Connection to FGSwiftBus successful, but could not initialize FGSwiftBus.");
|
||||
|
||||
Reference in New Issue
Block a user