mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T275, move simulator info into env. provider
This commit is contained in:
@@ -153,7 +153,7 @@ namespace BlackMisc
|
||||
|
||||
CSimulatorPluginInfo ISimulationEnvironmentProvider::getSimulatorPluginInfo() const
|
||||
{
|
||||
QReadLocker l(&m_lockModel);
|
||||
QReadLocker l(&m_lockSimInfo);
|
||||
return m_simulatorPluginInfo;
|
||||
}
|
||||
|
||||
@@ -207,9 +207,37 @@ namespace BlackMisc
|
||||
|
||||
void ISimulationEnvironmentProvider::setNewPluginInfo(const CSimulatorPluginInfo &info, const CAircraftModel &defaultModel)
|
||||
{
|
||||
QWriteLocker l(&m_lockModel);
|
||||
m_simulatorPluginInfo = info;
|
||||
m_defaultModel = defaultModel;
|
||||
{
|
||||
QWriteLocker l1(&m_lockSimInfo);
|
||||
m_simulatorPluginInfo = info;
|
||||
}
|
||||
this->setDefaultModel(defaultModel);
|
||||
}
|
||||
|
||||
void ISimulationEnvironmentProvider::setSimulatorDetails(const QString &name, const QString &details, const QString &version)
|
||||
{
|
||||
QWriteLocker l(&m_lockSimInfo);
|
||||
m_simulatorName = name;
|
||||
m_simulatorDetails = details;
|
||||
m_simulatorVersion = version;
|
||||
}
|
||||
|
||||
QString ISimulationEnvironmentProvider::getSimulatorName() const
|
||||
{
|
||||
QReadLocker l(&m_lockSimInfo);
|
||||
return m_simulatorName;
|
||||
}
|
||||
|
||||
QString ISimulationEnvironmentProvider::getSimulatorVersion() const
|
||||
{
|
||||
QReadLocker l(&m_lockSimInfo);
|
||||
return m_simulatorVersion;
|
||||
}
|
||||
|
||||
QString ISimulationEnvironmentProvider::getSimulatorDetails() const
|
||||
{
|
||||
QReadLocker l(&m_lockSimInfo);
|
||||
return m_simulatorDetails;
|
||||
}
|
||||
|
||||
void ISimulationEnvironmentProvider::setDefaultModel(const CAircraftModel &defaultModel)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace BlackMisc
|
||||
namespace Simulation
|
||||
{
|
||||
//! Direct in memory access to elevation data
|
||||
//! \remark we are interested in elevations of airports
|
||||
//! \remark we are interested in elevations at airports mostly
|
||||
class BLACKMISC_EXPORT ISimulationEnvironmentProvider : public IProvider
|
||||
{
|
||||
public:
|
||||
@@ -101,6 +101,22 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
void setNewPluginInfo(const CSimulatorPluginInfo &info, const CAircraftModel &defaultModel);
|
||||
|
||||
//! Set version and simulator details from running simulator
|
||||
//! \threadsafe
|
||||
void setSimulatorDetails(const QString &name, const QString &details, const QString &version);
|
||||
|
||||
//! Simulator name as set from the running simulator
|
||||
//! \threadsafe
|
||||
QString getSimulatorName() const;
|
||||
|
||||
//! Simulator version as set from the running simulator
|
||||
//! \threadsafe
|
||||
QString getSimulatorVersion() const;
|
||||
|
||||
//! Simulator details as set from the running simulator
|
||||
//! \threadsafe
|
||||
QString getSimulatorDetails() const;
|
||||
|
||||
//! Default model
|
||||
//! \threadsafe
|
||||
void setDefaultModel(const CAircraftModel &defaultModel);
|
||||
@@ -145,16 +161,20 @@ namespace BlackMisc
|
||||
static PhysicalQuantities::CLength minRange(const PhysicalQuantities::CLength &range);
|
||||
|
||||
private:
|
||||
int m_maxElevations = 100; //!< How many elevations we keep
|
||||
CAircraftModel m_defaultModel; //!< default model
|
||||
CSimulatorPluginInfo m_simulatorPluginInfo; //!< info object
|
||||
QString m_simulatorName; //!< name of simulator
|
||||
QString m_simulatorDetails; //!< describes version etc.
|
||||
QString m_simulatorVersion; //!< Simulator version
|
||||
CAircraftModel m_defaultModel; //!< default model
|
||||
int m_maxElevations = 100; //!< How many elevations we keep
|
||||
Geo::CCoordinateGeodeticList m_elvCoordinates;
|
||||
QMap<Aviation::CCallsign, PhysicalQuantities::CLength> m_cgs; //! CGs
|
||||
mutable int m_elvFound = 0; //!< statistics only
|
||||
mutable int m_elvMissed = 0; //!< statistics only
|
||||
mutable QReadWriteLock m_lockElvCoordinates; //!< lock m_coordinates
|
||||
mutable QReadWriteLock m_lockCG; //!< lock CGs
|
||||
mutable QReadWriteLock m_lockModel; //!< lock models
|
||||
mutable QReadWriteLock m_lockCG; //!< lock CGs
|
||||
mutable QReadWriteLock m_lockModel; //!< lock models
|
||||
mutable QReadWriteLock m_lockSimInfo; //!< lock plugin info
|
||||
};
|
||||
|
||||
//! Class which can be directly used to access an \sa ISimulationEnvironmentProvider object
|
||||
|
||||
Reference in New Issue
Block a user