mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
refs #808, CSimulatorInternals
* renamed from CSimulatorSetup to CSimulatorInternals * removed the FSX class, no longer needed * utility functions for CNameVariantPair
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/weather/weathergrid.h"
|
||||
|
||||
#include <QObject>
|
||||
@@ -133,7 +133,7 @@ namespace BlackCore
|
||||
ISimulator::SimulatorStatus getSimulatorStatusEnum() const;
|
||||
|
||||
//! Simulator setup
|
||||
virtual BlackMisc::Simulation::CSimulatorSetup getSimulatorSetup() const = 0;
|
||||
virtual BlackMisc::Simulation::CSimulatorInternals getSimulatorInternals() const = 0;
|
||||
|
||||
//! Airports in range
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const = 0;
|
||||
|
||||
@@ -110,11 +110,11 @@ namespace BlackCore
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getSimulatorSetup
|
||||
virtual BlackMisc::Simulation::CSimulatorSetup getSimulatorSetup() const override
|
||||
//! \copydoc IContextSimulator::getSimulatorInternals
|
||||
virtual BlackMisc::Simulation::CSimulatorInternals getSimulatorInternals() const override
|
||||
{
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return BlackMisc::Simulation::CSimulatorSetup();
|
||||
return BlackMisc::Simulation::CSimulatorInternals();
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setTimeSynchronization
|
||||
|
||||
@@ -121,16 +121,16 @@ namespace BlackCore
|
||||
return m_simulatorPlugin.first;
|
||||
}
|
||||
|
||||
CSimulatorSetup CContextSimulator::getSimulatorSetup() const
|
||||
CSimulatorInternals CContextSimulator::getSimulatorInternals() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified())
|
||||
{
|
||||
return BlackMisc::Simulation::CSimulatorSetup();
|
||||
return BlackMisc::Simulation::CSimulatorInternals();
|
||||
}
|
||||
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->getSimulatorSetup();
|
||||
return m_simulatorPlugin.second->getSimulatorInternals();
|
||||
}
|
||||
|
||||
CAirportList CContextSimulator::getAirportsInRange() const
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/simulation/simulationsettings.h"
|
||||
#include "blackmisc/worker.h"
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace BlackCore
|
||||
virtual bool startSimulatorPlugin(const BlackMisc::Simulation::CSimulatorPluginInfo &simulatorInfo) override;
|
||||
virtual void stopSimulatorPlugin(const BlackMisc::Simulation::CSimulatorPluginInfo &simulatorInfo) override;
|
||||
virtual int getSimulatorStatus() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorSetup getSimulatorSetup() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorInternals getSimulatorInternals() const override;
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSet() const override;
|
||||
virtual QStringList getModelSetStrings() const override;
|
||||
|
||||
@@ -114,9 +114,9 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Simulation::CSimulatorPluginInfo>(QLatin1Literal("getSimulatorPluginInfo"));
|
||||
}
|
||||
|
||||
CSimulatorSetup CContextSimulatorProxy::getSimulatorSetup() const
|
||||
CSimulatorInternals CContextSimulatorProxy::getSimulatorInternals() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Simulation::CSimulatorSetup>(QLatin1Literal("getSimulatorSetup"));
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Simulation::CSimulatorInternals>(QLatin1Literal("getSimulatorInternals"));
|
||||
}
|
||||
|
||||
bool CContextSimulatorProxy::setTimeSynchronization(bool enable, const CTime &offset)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfolist.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@@ -64,7 +64,7 @@ namespace BlackCore
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString modelString) const override;
|
||||
virtual int getModelSetCount() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorSetup getSimulatorSetup() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorInternals getSimulatorInternals() const override;
|
||||
virtual bool setTimeSynchronization(bool enable, const BlackMisc::PhysicalQuantities::CTime &offset) override;
|
||||
virtual bool isTimeSynchronized() const override;
|
||||
virtual BlackMisc::CInterpolationAndRenderingSetup getInterpolationAndRenderingSetup() const override;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
||||
namespace Network { class CTextMessage; }
|
||||
namespace Simulation
|
||||
{
|
||||
class CSimulatorSetup;
|
||||
class CSimulatorInternals;
|
||||
class IOwnAircraftProvider;
|
||||
class IRemoteAircraftProvider;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ namespace BlackCore
|
||||
virtual const BlackMisc::Simulation::CSimulatorPluginInfo &getSimulatorPluginInfo() const = 0;
|
||||
|
||||
//! Get the setup (simulator environemnt)
|
||||
virtual const BlackMisc::Simulation::CSimulatorSetup &getSimulatorSetup() const = 0;
|
||||
virtual const BlackMisc::Simulation::CSimulatorInternals &getSimulatorInternals() const = 0;
|
||||
|
||||
//! Connect to simulator
|
||||
virtual bool connectTo() = 0;
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace BlackCore
|
||||
return m_simulatorPluginInfo;
|
||||
}
|
||||
|
||||
const CSimulatorSetup &CSimulatorCommon::getSimulatorSetup() const
|
||||
const CSimulatorInternals &CSimulatorCommon::getSimulatorInternals() const
|
||||
{
|
||||
return m_simulatorSetup;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/weather/weathergridprovider.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -76,7 +76,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::CInterpolationAndRenderingSetup getInterpolationAndRenderingSetup() const override;
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override;
|
||||
virtual const BlackMisc::Simulation::CSimulatorPluginInfo &getSimulatorPluginInfo() const override;
|
||||
virtual const BlackMisc::Simulation::CSimulatorSetup &getSimulatorSetup() const override;
|
||||
virtual const BlackMisc::Simulation::CSimulatorInternals &getSimulatorInternals() const override;
|
||||
virtual void unload() override;
|
||||
virtual int physicallyRemoveMultipleRemoteAircraft(const BlackMisc::Aviation::CCallsignSet &callsigns) override;
|
||||
//! @}
|
||||
@@ -137,7 +137,7 @@ namespace BlackCore
|
||||
|
||||
BlackMisc::IInterpolator *m_interpolator = nullptr; //!< interpolator instance
|
||||
bool m_pausedSimFreezesInterpolation = false; //!< paused simulator will also pause interpolation (so AI aircraft will hold)
|
||||
BlackMisc::Simulation::CSimulatorSetup m_simulatorSetup; //!< setup object
|
||||
BlackMisc::Simulation::CSimulatorInternals m_simulatorSetup; //!< setup object
|
||||
BlackMisc::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< debug messages, rendering etc.
|
||||
BlackMisc::Simulation::CAircraftModel m_defaultModel; //!< default model
|
||||
qint64 m_statsUpdateAircraftTimeTotalMs = 0; //!< statistics update time
|
||||
|
||||
@@ -25,6 +25,14 @@ namespace BlackMisc
|
||||
return this->contains(&CNameVariantPair::getName, name);
|
||||
}
|
||||
|
||||
QStringList CNameVariantPairList::getNames(bool sorted) const
|
||||
{
|
||||
if (this->isEmpty()) { return QStringList(); }
|
||||
QStringList codes = this->transform(Predicates::MemberTransform(&CNameVariantPair::getName));
|
||||
if (sorted) { codes.sort(); }
|
||||
return codes;
|
||||
}
|
||||
|
||||
CNameVariantPair CNameVariantPairList::getValue(const QString &name) const
|
||||
{
|
||||
if (name.isEmpty()) { return CNameVariantPair(); }
|
||||
|
||||
@@ -45,6 +45,9 @@ namespace BlackMisc
|
||||
//! Contains name
|
||||
bool containsName(const QString &name) const;
|
||||
|
||||
//! Get all names
|
||||
QStringList getNames(bool sorted = true) const;
|
||||
|
||||
//! Get value
|
||||
CNameVariantPair getValue(const QString &name) const;
|
||||
|
||||
@@ -57,7 +60,6 @@ namespace BlackMisc
|
||||
//! Add value, if name already exists replace (true)
|
||||
//! If one is sure(!) the name does not exists, \sa push_back() can be used
|
||||
bool addOrReplaceValue(const QString &name, const CVariant &value, const CIcon &icon = CIcon());
|
||||
|
||||
};
|
||||
} //namespace
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace BlackMisc
|
||||
GlobalIndexCAircraftModel = 6800,
|
||||
GlobalIndexCSimulatedAircraft = 6900,
|
||||
GlobalIndexCTextMessage = 7000,
|
||||
GlobalIndexCSimulatorSetup = 7100,
|
||||
GlobalIndexCSimulatorInternals = 7100,
|
||||
GlobalIndexCSimulatorSettings = 7200,
|
||||
GlobalIndexCSimulatorMessageSettings = 7300,
|
||||
GlobalIndexCAircraftCfgEntries = 7400,
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorsetup.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "simulation/simulatorsetup.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
CSimulatorSetup CFsxSimulatorSetup::getInitialSetup()
|
||||
{
|
||||
CSimulatorSetup s;
|
||||
s.setValue(KeyLocalSimConnectCfgFilename(), CSimConnectUtilities::getLocalSimConnectCfgFilename());
|
||||
|
||||
if (CBuildConfig::isCompiledWithFsxSupport())
|
||||
{
|
||||
// set FSX path
|
||||
QString fsxPath = CFsCommonUtil::fsxDirFromRegistry();
|
||||
if (!fsxPath.isEmpty())
|
||||
{
|
||||
s.setSimulatorInstallationDirectory(fsxPath);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
const QString &CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename()
|
||||
{
|
||||
static const QString k("fsx/simConnectCfgFilename"); return k;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_SIMULATION_FSX_SIMSETUP_H
|
||||
#define BLACKMISC_SIMULATION_FSX_SIMSETUP_H
|
||||
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
class QString;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
//! Simulator settings for FSX Flight simulators
|
||||
class BLACKMISC_EXPORT CFsxSimulatorSetup
|
||||
{
|
||||
|
||||
public:
|
||||
//! No constructor
|
||||
CFsxSimulatorSetup() = delete;
|
||||
|
||||
//! Init, to be used where FSX runs
|
||||
static BlackMisc::Simulation::CSimulatorSetup getInitialSetup();
|
||||
|
||||
//! Key
|
||||
static const QString &KeyLocalSimConnectCfgFilename();
|
||||
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
@@ -38,7 +38,7 @@ namespace BlackMisc
|
||||
CSimulatorInfoList::registerMetadata();
|
||||
CSimulatorPluginInfo::registerMetadata();
|
||||
CSimulatorPluginInfoList::registerMetadata();
|
||||
CSimulatorSetup::registerMetadata();
|
||||
CSimulatorInternals::registerMetadata();
|
||||
CVPilotModelRule::registerMetadata();
|
||||
CVPilotModelRuleSet::registerMetadata();
|
||||
CSettings::registerMetadata();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "blackmisc/simulation/airspaceaircraftsnapshot.h"
|
||||
#include "blackmisc/simulation/distributorlist.h"
|
||||
#include "blackmisc/simulation/distributorlistpreferences.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
#include "blackmisc/simulation/simulatorinfolist.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "blackmisc/dbus.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/simulatorinternals.h"
|
||||
|
||||
#include <QDBusMetaType>
|
||||
#include <QJsonObject>
|
||||
@@ -17,49 +17,69 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
void CSimulatorSetup::setValue(const QString &name, const QString &value)
|
||||
void CSimulatorInternals::setValue(const QString &name, const QString &value)
|
||||
{
|
||||
this->m_data.addOrReplaceValue(name, value);
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::getStringValue(const QString &name) const
|
||||
CVariant CSimulatorInternals::getVariantValue(const QString &name) const
|
||||
{
|
||||
return m_data.getVariantValue(name);
|
||||
}
|
||||
|
||||
QString CSimulatorInternals::getStringValue(const QString &name) const
|
||||
{
|
||||
return m_data.getValueAsString(name);
|
||||
}
|
||||
|
||||
void CSimulatorSetup::setSimulatorVersion(const QString versionInfo)
|
||||
QStringList CSimulatorInternals::getSortedNames() const
|
||||
{
|
||||
return m_data.getNames(true);
|
||||
}
|
||||
|
||||
void CSimulatorInternals::setSimulatorVersion(const QString versionInfo)
|
||||
{
|
||||
this->setValue("all/versionInfo", versionInfo);
|
||||
}
|
||||
|
||||
void CSimulatorSetup::setSimulatorInstallationDirectory(const QString fullFilePath)
|
||||
void CSimulatorInternals::setSimulatorInstallationDirectory(const QString fullFilePath)
|
||||
{
|
||||
this->setValue("all/installDir", fullFilePath);
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::getSimulatorVersion() const
|
||||
QString CSimulatorInternals::getSimulatorName() const
|
||||
{
|
||||
return this->getStringValue("all/simulatorName");
|
||||
}
|
||||
|
||||
void CSimulatorInternals::setSimulatorName(const QString &name)
|
||||
{
|
||||
this->setValue("all/simulatorName", name);
|
||||
}
|
||||
|
||||
QString CSimulatorInternals::getSimulatorVersion() const
|
||||
{
|
||||
return this->getStringValue("all/versionInfo");
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::getSimulatorInstallationDirectory() const
|
||||
QString CSimulatorInternals::getSimulatorInstallationDirectory() const
|
||||
{
|
||||
return this->getStringValue("all/installDir");
|
||||
}
|
||||
|
||||
void CSimulatorSetup::registerMetadata()
|
||||
void CSimulatorInternals::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<BlackMisc::Simulation::CSimulatorSetup>();
|
||||
qDBusRegisterMetaType<BlackMisc::Simulation::CSimulatorSetup>();
|
||||
registerMetaValueType<BlackMisc::Simulation::CSimulatorSetup>();
|
||||
qRegisterMetaType<BlackMisc::Simulation::CSimulatorInternals>();
|
||||
qDBusRegisterMetaType<BlackMisc::Simulation::CSimulatorInternals>();
|
||||
registerMetaValueType<BlackMisc::Simulation::CSimulatorInternals>();
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::convertToQString(bool i18n) const
|
||||
QString CSimulatorInternals::convertToQString(bool i18n) const
|
||||
{
|
||||
return m_data.toQString(i18n);
|
||||
}
|
||||
|
||||
CVariant CSimulatorSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
CVariant CSimulatorInternals::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
@@ -72,9 +92,9 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorSetup::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
void CSimulatorInternals::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CSimulatorSetup>(); return; }
|
||||
if (index.isMyself()) { (*this) = variant.to<CSimulatorInternals>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_SIMULATION_SIMULATORSETUP_H
|
||||
#define BLACKMISC_SIMULATION_SIMULATORSETUP_H
|
||||
#ifndef BLACKMISC_SIMULATION_SIMULATORINTERNALS_H
|
||||
#define BLACKMISC_SIMULATION_SIMULATORINTERNALS_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/containerbase.h"
|
||||
@@ -30,19 +30,19 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
//! Simulator settings for flight simulators.
|
||||
//! Simulator internals for flight simulators.
|
||||
//! Those are set up at runtime and represent information about the simulator (like a small registry)
|
||||
class BLACKMISC_EXPORT CSimulatorSetup : public CValueObject<CSimulatorSetup>
|
||||
class BLACKMISC_EXPORT CSimulatorInternals : public CValueObject<CSimulatorInternals>
|
||||
{
|
||||
public:
|
||||
//! Specific values
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorSetup
|
||||
IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorInternals
|
||||
};
|
||||
|
||||
//! Default constructor
|
||||
CSimulatorSetup() {}
|
||||
CSimulatorInternals() {}
|
||||
|
||||
//! All values
|
||||
BlackMisc::CNameVariantPairList getData() const { return this->m_data;}
|
||||
@@ -53,20 +53,32 @@ namespace BlackMisc
|
||||
//! Set value
|
||||
void setValue(const QString &name, const QString &value);
|
||||
|
||||
//! Get value
|
||||
CVariant getVariantValue(const QString &name) const;
|
||||
|
||||
//! Get string value
|
||||
QString getStringValue(const QString &name) const;
|
||||
|
||||
//! Simulator version info, something like "FSX 10.3.2"
|
||||
//! Get sorted names
|
||||
QStringList getSortedNames() const;
|
||||
|
||||
//! Get the simulator name
|
||||
QString getSimulatorName() const;
|
||||
|
||||
//! Set simulator name
|
||||
void setSimulatorName(const QString &name);
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
QString getSimulatorVersion() const;
|
||||
|
||||
//! Simulator version info, something like "10.3.2"
|
||||
void setSimulatorVersion(const QString versionInfo);
|
||||
|
||||
//! Path where simulator is installed
|
||||
void setSimulatorInstallationDirectory(const QString fullFilePath);
|
||||
|
||||
//! Simulator version info, something like "FSX 10.3.2"
|
||||
QString getSimulatorVersion() const;
|
||||
QString getSimulatorInstallationDirectory() const;
|
||||
|
||||
//! Path where simulator is installed
|
||||
QString getSimulatorInstallationDirectory() const;
|
||||
void setSimulatorInstallationDirectory(const QString fullFilePath);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
@@ -84,13 +96,13 @@ namespace BlackMisc
|
||||
BlackMisc::CNameVariantPairList m_data;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CSimulatorSetup,
|
||||
CSimulatorInternals,
|
||||
BLACK_METAMEMBER(data)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorSetup)
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorInternals)
|
||||
|
||||
#endif // guard
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "blackmisc/network/textmessage.h"
|
||||
#include "blackmisc/simulation/fscommon/bcdconversions.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorsetup.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorinternals.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
@@ -50,7 +50,7 @@ namespace BlackSimPlugin
|
||||
Q_ASSERT_X(ownAircraftProvider, Q_FUNC_INFO, "Missing provider");
|
||||
Q_ASSERT_X(remoteAircraftProvider, Q_FUNC_INFO, "Missing provider");
|
||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing global object");
|
||||
this->m_simulatorSetup = CFsxSimulatorSetup::getInitialSetup();
|
||||
this->m_simulatorSetup = CFsxSimulatorInternals::getInitializedInternals();
|
||||
this->m_realityBubbleTimer.setInterval(20 * 1000);
|
||||
connect(&m_realityBubbleTimer, &QTimer::timeout, this, &CSimulatorFsx::ps_addAircraftCurrentlyOutOfBubble);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "simconnectdatadefinition.h"
|
||||
#include "blackmisc/simulation/fscommon/bcdconversions.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorsetup.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorinternals.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorsetup.h"
|
||||
#include "blackmisc/simulation/fsx/fsxsimulatorinternals.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include <QFileInfo>
|
||||
#include <QDesktopServices>
|
||||
@@ -145,7 +145,7 @@ namespace BlackSimPlugin
|
||||
|
||||
if (sGui->getIContextSimulator())
|
||||
{
|
||||
fileName = sGui->getIContextSimulator()->getSimulatorSetup().getStringValue(CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename());
|
||||
fileName = sGui->getIContextSimulator()->getSimulatorInternals().getStringValue(CFsxSimulatorInternals::KeyLocalSimConnectCfgFilename());
|
||||
}
|
||||
|
||||
if (fileName.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user