mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Request own aircraft info upon connecting to XSwiftBus
Summary: Ref T83 Also removed an unused parameter of the "own aircraft changed" signal of XSwiftBus. Reviewers: #swift_developers, rwinklmeier Reviewed By: #swift_developers, rwinklmeier Subscribers: jenkins Tags: #swift_pilot_client Maniphest Tasks: T83 Differential Revision: https://dev.swift-project.org/D63
This commit is contained in:
@@ -34,7 +34,7 @@ namespace XSwiftBus
|
||||
XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
|
||||
const auto model = BlackMisc::Simulation::XPlane::CAircraftModelLoaderXPlane::extractAcfProperties(path, QFileInfo(path));
|
||||
emit aircraftModelChanged(path, filename, getAircraftLivery(), getAircraftIcaoCode(),
|
||||
model.getModelString(), model.getName(), model.getDistributor().getDescription(), getAircraftDescription());
|
||||
model.getModelString(), model.getName(), getAircraftDescription());
|
||||
}
|
||||
|
||||
void CService::addTextMessage(const QString &text, double red, double green, double blue)
|
||||
@@ -77,6 +77,24 @@ namespace XSwiftBus
|
||||
return filename;
|
||||
}
|
||||
|
||||
QString CService::getAircraftModelString() const
|
||||
{
|
||||
char filename[256];
|
||||
char path[512];
|
||||
XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
|
||||
const auto model = BlackMisc::Simulation::XPlane::CAircraftModelLoaderXPlane::extractAcfProperties(path, QFileInfo(path));
|
||||
return model.getModelString();
|
||||
}
|
||||
|
||||
QString CService::getAircraftName() const
|
||||
{
|
||||
char filename[256];
|
||||
char path[512];
|
||||
XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
|
||||
const auto model = BlackMisc::Simulation::XPlane::CAircraftModelLoaderXPlane::extractAcfProperties(path, QFileInfo(path));
|
||||
return model.getName();
|
||||
}
|
||||
|
||||
int CService::getXPlaneVersionMajor() const
|
||||
{
|
||||
int version;
|
||||
|
||||
@@ -70,8 +70,8 @@ namespace XSwiftBus
|
||||
|
||||
signals:
|
||||
//! Emitted when the model or livery changes.
|
||||
void aircraftModelChanged(const QString &path, const QString &filename, const QString &livery, const QString &icao,
|
||||
const QString &modelString, const QString &name, const QString &distributor, const QString &description);
|
||||
void aircraftModelChanged(const QString &path, const QString &filename, const QString &livery,
|
||||
const QString &icao, const QString &modelString, const QString &name, const QString &description);
|
||||
|
||||
//! Airports in range updated.
|
||||
void airportsInRangeUpdated(const QStringList &icaoCodes, const QStringList &names, const QDoubleList &lats, const QDoubleList &lons, const QDoubleList &alts);
|
||||
@@ -89,6 +89,12 @@ namespace XSwiftBus
|
||||
//! Get base filename of current aircraft model
|
||||
QString getAircraftModelFilename() const;
|
||||
|
||||
//! Get canonical swift model string of current aircraft model
|
||||
QString getAircraftModelString() const;
|
||||
|
||||
//! Get name of current aircraft model
|
||||
QString getAircraftName() const;
|
||||
|
||||
//! Get path to current aircraft livery
|
||||
QString getAircraftLivery() const { return m_liveryPath.get().c_str(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user