mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Ref T339, simulator info message (version) for SUP supervisor
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "simulationenvironmentprovider.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
@@ -210,6 +211,24 @@ namespace BlackMisc
|
||||
return this->getSimulatorPluginInfo().getSimulatorInfo();
|
||||
}
|
||||
|
||||
QString ISimulationEnvironmentProvider::getSimulatorNameAndVersion() const
|
||||
{
|
||||
QString n;
|
||||
QString v;
|
||||
{
|
||||
QReadLocker l(&m_lockSimInfo);
|
||||
n = m_simulatorName;
|
||||
v = m_simulatorVersion;
|
||||
}
|
||||
|
||||
if (!n.isEmpty() && !v.isEmpty()) { return n % QStringLiteral(" ") % v; }
|
||||
if (!n.isEmpty()) { return n; }
|
||||
|
||||
const CSimulatorInfo simInfo = this->getSimulatorInfo();
|
||||
if (!simInfo.isUnspecified()) { return simInfo.toQString(true); }
|
||||
return "not available";
|
||||
}
|
||||
|
||||
CAircraftModel ISimulationEnvironmentProvider::getDefaultModel() const
|
||||
{
|
||||
QReadLocker l(&m_lockModel);
|
||||
@@ -407,6 +426,12 @@ namespace BlackMisc
|
||||
return this->provider()->getSimulatorInfo();
|
||||
}
|
||||
|
||||
QString CSimulationEnvironmentAware::getSimulatorNameAndVersion() const
|
||||
{
|
||||
if (!this->hasProvider()) { return "not avialbale"; }
|
||||
return this->provider()->getSimulatorNameAndVersion();
|
||||
}
|
||||
|
||||
CAircraftModel CSimulationEnvironmentAware::getDefaultModel() const
|
||||
{
|
||||
if (!this->hasProvider()) { return CAircraftModel(); }
|
||||
|
||||
@@ -78,6 +78,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
CSimulatorInfo getSimulatorInfo() const;
|
||||
|
||||
//! Version and simulator details info
|
||||
//! \threadsafe
|
||||
QString getSimulatorNameAndVersion() const;
|
||||
|
||||
//! Default model
|
||||
//! \threadsafe
|
||||
CAircraftModel getDefaultModel() const;
|
||||
@@ -129,14 +133,17 @@ namespace BlackMisc
|
||||
|
||||
//! Simulator name as set from the running simulator
|
||||
//! \threadsafe
|
||||
//! \remark something like "Name: 'Lockheed Martin® Prepar3D® v4"
|
||||
QString getSimulatorName() const;
|
||||
|
||||
//! Simulator version as set from the running simulator
|
||||
//! \threadsafe
|
||||
//! \remark something like "4.1.7.22841"
|
||||
QString getSimulatorVersion() const;
|
||||
|
||||
//! Simulator details as set from the running simulator
|
||||
//! \threadsafe
|
||||
//! \remark something like "Name: 'Lockheed Martin® Prepar3D® v4' Version: 4.1.7.22841 SimConnect: 4.1.0.0"
|
||||
QString getSimulatorDetails() const;
|
||||
|
||||
//! Default model
|
||||
@@ -199,7 +206,7 @@ namespace BlackMisc
|
||||
QString m_simulatorVersion; //!< Simulator version
|
||||
CAircraftModel m_defaultModel; //!< default model
|
||||
int m_maxElevations = 100; //!< How many elevations we keep
|
||||
Geo::CCoordinateGeodeticList m_elvCoordinates; //!< elevation cache
|
||||
Geo::CCoordinateGeodeticList m_elvCoordinates; //!< elevation cache
|
||||
Aviation::CTimestampPerCallsign m_pendingElevationRequests; //!< pending elevation requests
|
||||
Aviation::CLengthPerCallsign m_cgsPerCallsign; //!< CGs per callsign
|
||||
QHash<QString, PhysicalQuantities::CLength> m_cgsPerModel; //!< CGs per model string
|
||||
@@ -252,6 +259,9 @@ namespace BlackMisc
|
||||
//! \copydoc ISimulationEnvironmentProvider::getSimulatorPluginInfo
|
||||
CSimulatorInfo getSimulatorInfo() const;
|
||||
|
||||
//! \copydoc ISimulationEnvironmentProvider::getSimulatorNameAndVersion
|
||||
QString getSimulatorNameAndVersion() const;
|
||||
|
||||
//! \copydoc ISimulationEnvironmentProvider::getDefaultModel
|
||||
CAircraftModel getDefaultModel() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user