[feature][XPlane] Set own aircraft model string when own aircraft changes.

Summary:
Refactored parts of CAircraftModelLoaderXPlane::parseFlyableAirplanes into static method extractAcfProperties that can be called by xswiftbus.

Used extractAcfProperties in xswiftbus to provide the model string to the driver. Implemented CSimulatorXPlane::ps_emitOwnAircraftModelChanged.

Implements T74.

Reviewers: rwinklmeier

Reviewed By: rwinklmeier

Subscribers: jenkins

Tags: #swift_pilot_client

Differential Revision: https://dev.swift-project.org/D23
This commit is contained in:
Mathew Sutcliffe
2017-05-14 15:01:59 +01:00
parent 50b8fbe8fe
commit bc80fd3bd5
8 changed files with 91 additions and 62 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "service.h"
#include "blackmisc/simulation/xplane/aircraftmodelloaderxplane.h"
#include <XPLM/XPLMPlanes.h>
#include <XPLM/XPLMUtilities.h>
#include <QDebug>
@@ -31,7 +32,9 @@ namespace XSwiftBus
char filename[256];
char path[512];
XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
emit aircraftModelChanged(path, filename, getAircraftLivery(), getAircraftIcaoCode());
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());
}
void CService::addTextMessage(const QString &text, double red, double green, double blue)