mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Check for known model so mapping component can check without loaded model set
This commit is contained in:
@@ -187,6 +187,9 @@ namespace BlackCore
|
||||
//! Model set completer string
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const = 0;
|
||||
|
||||
//! Known model?
|
||||
virtual bool isKnownModel(const QString &modelstring) const = 0;
|
||||
|
||||
//! Set time synchronization between simulator and user's computer time
|
||||
//! \remarks not all drivers implement this, e.g. if it is an intrinsic simulator feature
|
||||
virtual bool setTimeSynchronization(bool enable, const BlackMisc::PhysicalQuantities::CTime &offset) = 0;
|
||||
|
||||
@@ -130,6 +130,14 @@ namespace BlackCore
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::isKnownModel
|
||||
virtual bool isKnownModel(const QString &modelstring) const override
|
||||
{
|
||||
Q_UNUSED(modelstring);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getModelSetModelsStartingWith
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override
|
||||
{
|
||||
|
||||
@@ -247,6 +247,13 @@ namespace BlackCore
|
||||
return this->getModelSet().getModelStringList(false);
|
||||
}
|
||||
|
||||
bool CContextSimulator::isKnownModel(const QString &modelString) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
const bool known = this->getModelSet().containsModelString(modelString);
|
||||
return known;
|
||||
}
|
||||
|
||||
QStringList CContextSimulator::getModelSetCompleterStrings(bool sorted) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << sorted; }
|
||||
|
||||
@@ -86,6 +86,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::CStatusMessageList verifyPrerequisites() const override;
|
||||
virtual QStringList getModelSetStrings() const override;
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const override;
|
||||
virtual bool isKnownModel(const QString &modelString) const override;
|
||||
virtual int getModelSetCount() const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const override;
|
||||
|
||||
@@ -141,6 +141,11 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<QStringList>(QLatin1String("getModelSetCompleterStrings"), sorted);
|
||||
}
|
||||
|
||||
bool CContextSimulatorProxy::isKnownModel(const QString &modelString) const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1String("isKnownModel"), modelString);
|
||||
}
|
||||
|
||||
CAircraftModelList CContextSimulatorProxy::getModelSetModelsStartingWith(const QString &modelString) const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Simulation::CAircraftModelList>(QLatin1String("getModelSetModelsStartingWith"), modelString);
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace BlackCore
|
||||
virtual void setModelSetLoaderSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator) override;
|
||||
virtual QStringList getModelSetStrings() const override;
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const override;
|
||||
virtual bool isKnownModel(const QString &modelString) const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override;
|
||||
virtual int getModelSetCount() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorInternals getSimulatorInternals() const override;
|
||||
|
||||
Reference in New Issue
Block a user