mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Split of CSimulatorPluginInfo and CSimulatorSetup
refs #404, and discussion https://dev.vatsim-germany.org/issues/404#note-8 * Changed CSimulatorSetup to use CNameVariantPairList as data. The old version was an hack and had to go, CNameVariantPairList would allow complex types in the future and can be already shown in the GUI. * CNameVariantPairList was improved slightly in the same step * Functions to get CSimulatorSetup from driver / context * Removed CSimulatorSetup data from CSimulatorPluginInfo
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "blackmisc/simulation/simulatedaircraftlist.h"
|
||||
#include "blackmisc/simulation/simulatorinfolist.h"
|
||||
#include "blackmisc/simulation/setsimulator.h"
|
||||
#include "blackmisc/simulation/simulatorsetup.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/simulation/fscommon/aircraftcfgentrieslist.h"
|
||||
|
||||
@@ -39,4 +40,5 @@ void BlackMisc::Simulation::registerMetadata()
|
||||
CAircraftModelList::registerMetadata();
|
||||
CSimulatedAircraft::registerMetadata();
|
||||
CSimulatedAircraftList::registerMetadata();
|
||||
CSimulatorSetup::registerMetadata();
|
||||
}
|
||||
|
||||
@@ -14,32 +14,17 @@
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
CNameVariantPair::CNameVariantPair(const QString &name, const CVariant &variant, const CIcon &icon)
|
||||
: m_name(name), m_variant(variant), m_icon(icon)
|
||||
{ }
|
||||
|
||||
/*
|
||||
* Icon
|
||||
*/
|
||||
const CIcon &CNameVariantPair::getIcon() const
|
||||
{
|
||||
return this->m_icon;
|
||||
}
|
||||
CIcon CNameVariantPair::toIcon() const { return m_icon; }
|
||||
|
||||
/*
|
||||
* Icon?
|
||||
*/
|
||||
bool CNameVariantPair::hasIcon() const
|
||||
{
|
||||
return this->getIcon().isSet();
|
||||
return this->m_icon.isSet();
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert to string
|
||||
*/
|
||||
QString CNameVariantPair::convertToQString(bool i18n) const
|
||||
{
|
||||
QString s(this->m_name);
|
||||
@@ -47,9 +32,6 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* Property by index
|
||||
*/
|
||||
CVariant CNameVariantPair::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
@@ -60,18 +42,11 @@ namespace BlackMisc
|
||||
return CVariant(this->m_name);
|
||||
case IndexVariant:
|
||||
return this->m_variant;
|
||||
case IndexIcon:
|
||||
return this->m_icon.toCVariant();
|
||||
case IndexPixmap:
|
||||
return CVariant(this->m_icon.toPixmap());
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Property by index (setter)
|
||||
*/
|
||||
void CNameVariantPair::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
@@ -104,5 +79,4 @@ namespace BlackMisc
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Value / variant pair
|
||||
*/
|
||||
//! Value / variant pair
|
||||
class CNameVariantPair : public CValueObject<CNameVariantPair>
|
||||
{
|
||||
public:
|
||||
@@ -28,9 +26,7 @@ namespace BlackMisc
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexName = BlackMisc::CPropertyIndex::GlobalIndexCNameVariantPair,
|
||||
IndexVariant,
|
||||
IndexIcon,
|
||||
IndexPixmap
|
||||
IndexVariant
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
@@ -48,11 +44,14 @@ namespace BlackMisc
|
||||
//! Set name.
|
||||
void setName(const QString &name) { this->m_name = name; }
|
||||
|
||||
//! Name available?
|
||||
bool hasName() const { return !this->m_name.isEmpty(); }
|
||||
|
||||
//! Set variant.
|
||||
void setVariant(const CVariant &variant) { m_variant = variant; }
|
||||
|
||||
//! Icon
|
||||
const CIcon &getIcon() const;
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual BlackMisc::CIcon toIcon() const override;
|
||||
|
||||
//! Has icon
|
||||
bool hasIcon() const;
|
||||
|
||||
@@ -12,30 +12,54 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*
|
||||
* Empty constructor
|
||||
*/
|
||||
CNameVariantPairList::CNameVariantPairList() { }
|
||||
|
||||
/*
|
||||
* Construct from base class object
|
||||
*/
|
||||
CNameVariantPairList::CNameVariantPairList(const CSequence<CNameVariantPair> &other) :
|
||||
CSequence<CNameVariantPair>(other)
|
||||
{ }
|
||||
|
||||
/*
|
||||
* Name contained?
|
||||
*/
|
||||
bool CNameVariantPairList::containsName(const QString &name)const
|
||||
{
|
||||
return this->contains(&CNameVariantPair::getName, name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Name index
|
||||
*/
|
||||
int CNameVariantPairList::getNameRowIndex(const QString &name) const
|
||||
CNameVariantPair CNameVariantPairList::getValue(const QString &name) const
|
||||
{
|
||||
if (name.isEmpty()) { return CNameVariantPair(); }
|
||||
return this->findBy(&CNameVariantPair::getName, name).frontOrDefault();
|
||||
}
|
||||
|
||||
CVariant CNameVariantPairList::getVariantValue(const QString &name) const
|
||||
{
|
||||
if (name.isEmpty()) { return CVariant(); }
|
||||
return getValue(name).getVariant();
|
||||
}
|
||||
|
||||
QString CNameVariantPairList::getValueAsString(const QString &name) const
|
||||
{
|
||||
if (name.isEmpty()) { return QString(); }
|
||||
CVariant cs(getValue(name).getVariant());
|
||||
if (cs.isNull() || !cs.canConvert<QString>()) { return QString(); }
|
||||
return cs.value<QString>();
|
||||
}
|
||||
|
||||
bool CNameVariantPairList::addOrReplaceValue(const QString &name, const CVariant &value, const CIcon &icon)
|
||||
{
|
||||
if (name.isEmpty()) { return false; }
|
||||
int i = getIndexForName(name);
|
||||
if (i < 0)
|
||||
{
|
||||
this->push_back(CNameVariantPair(name, value, icon));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
(*this)[i] = CNameVariantPair(name, value, icon);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int CNameVariantPairList::getIndexForName(const QString &name) const
|
||||
{
|
||||
for (int i = 0; i < this->size(); i++)
|
||||
{
|
||||
@@ -47,9 +71,6 @@ namespace BlackMisc
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
void CNameVariantPairList::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<BlackMisc::CSequence<CNameVariantPair>>();
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Value object encapsulating a list of name/variant pairs.
|
||||
*/
|
||||
//! Value object encapsulating a list of name/variant pairs
|
||||
//! Currently name must be unique
|
||||
class CNameVariantPairList : public CSequence<CNameVariantPair>
|
||||
{
|
||||
public:
|
||||
@@ -30,12 +29,25 @@ namespace BlackMisc
|
||||
//! Construct from a base class object.
|
||||
CNameVariantPairList(const CSequence<CNameVariantPair> &other);
|
||||
|
||||
//! Get name index
|
||||
int getNameRowIndex(const QString &name) const;
|
||||
//! Get name's index, -1 if not found
|
||||
int getIndexForName(const QString &name) const;
|
||||
|
||||
//! Contains name
|
||||
bool containsName(const QString &name) const;
|
||||
|
||||
//! Get value
|
||||
CNameVariantPair getValue(const QString &name) const;
|
||||
|
||||
//! Get pair's variant value or default if not existing
|
||||
CVariant getVariantValue(const QString &name) const;
|
||||
|
||||
//! Get pair's variant value as string (empty if not existing)
|
||||
QString getValueAsString(const QString &name) const;
|
||||
|
||||
//! 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());
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
|
||||
@@ -58,10 +58,11 @@ namespace BlackMisc
|
||||
GlobalIndexCSimulatedAircraft = 4400,
|
||||
GlobalIndexCAircraftMapping = 4500,
|
||||
GlobalIndexCTextMessage = 4600,
|
||||
GlobalIndexCVoiceRoom = 5000,
|
||||
GlobalIndexCSettingKeyboardHotkey = 6000,
|
||||
GlobalIndexCAircraftCfgEntries = 7000,
|
||||
GlobalIndexAbuseMode = 20000 // property index abused as map key or otherwise
|
||||
GlobalIndexCSimulatorSetup = 4700,
|
||||
GlobalIndexCAircraftCfgEntries = 4800,
|
||||
GlobalIndexCVoiceRoom = 6000,
|
||||
GlobalIndexCSettingKeyboardHotkey = 7000,
|
||||
GlobalIndexAbuseMode = 20000 // property index abused as map key or otherwise, do be removed if no longer needed
|
||||
};
|
||||
|
||||
//! Default constructor.
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Simulation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -24,18 +25,29 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
void CFsxSimulatorSetup::init()
|
||||
CSimulatorSetup CFsxSimulatorSetup::getInitialSetup()
|
||||
{
|
||||
CSimulatorSetup::init();
|
||||
this->m_setup.addValue(SetupSimConnectCfgFile, CSimConnectUtilities::getLocalSimConnectCfgFilename());
|
||||
CSimulatorSetup s;
|
||||
s.setValue(KeyLocalSimConnectCfgFilename(), CSimConnectUtilities::getLocalSimConnectCfgFilename());
|
||||
|
||||
if (CProject::isCompiledWithFsxSupport())
|
||||
{
|
||||
// set FSX path
|
||||
QString fsxPath = CFsCommonUtil::fsxDirFromRegistry();
|
||||
if (!fsxPath.isEmpty()) this->m_setup.value(CSimulatorSetup::SetupSimPath, CVariant(fsxPath));
|
||||
if (!fsxPath.isEmpty())
|
||||
{
|
||||
s.setSimulatorInstallationDirectory(fsxPath);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
const QString &CFsxSimulatorSetup::KeyLocalSimConnectCfgFilename()
|
||||
{
|
||||
static const QString k("fsx/simConnectCfgFilename"); return k;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -21,28 +21,20 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
/*!
|
||||
* Simulator settings for FSX Flight simulators
|
||||
*/
|
||||
class CFsxSimulatorSetup : public BlackMisc::Simulation::CSimulatorSetup
|
||||
//! Simulator settings for FSX Flight simulators
|
||||
class CFsxSimulatorSetup
|
||||
{
|
||||
|
||||
public:
|
||||
//! Setup values
|
||||
enum
|
||||
{
|
||||
SetupSimConnectCfgFile = (BlackMisc::CPropertyIndex::GlobalIndexAbuseMode + 100), //!< location of simconnect.cfg file
|
||||
};
|
||||
|
||||
|
||||
//! Default constructor
|
||||
CFsxSimulatorSetup() : BlackMisc::Simulation::CSimulatorSetup() {}
|
||||
|
||||
//! Constructor
|
||||
CFsxSimulatorSetup(const BlackMisc::CPropertyIndexVariantMap &map) : BlackMisc::Simulation::CSimulatorSetup(map) {}
|
||||
//! No constructor
|
||||
CFsxSimulatorSetup() = delete;
|
||||
|
||||
//! Init, to be used where FSX runs
|
||||
void init();
|
||||
static BlackMisc::Simulation::CSimulatorSetup getInitialSetup();
|
||||
|
||||
//! Key
|
||||
static const QString &KeyLocalSimConnectCfgFilename();
|
||||
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace BlackMisc
|
||||
namespace Settings
|
||||
{
|
||||
//! Value object encapsulating information of simulator related settings.
|
||||
//! \deprecated will be removed with new MS settings
|
||||
class CSettingsSimulator : public BlackMisc::CValueObject<CSettingsSimulator>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -44,29 +44,6 @@ namespace BlackMisc
|
||||
return m_name.isEmpty();
|
||||
}
|
||||
|
||||
CVariant CSimulatorPluginInfo::getSimulatorSetupValue(int index) const
|
||||
{
|
||||
return this->m_simsetup.value(index);
|
||||
}
|
||||
|
||||
QString CSimulatorPluginInfo::getSimulatorSetupValueAsString(int index) const
|
||||
{
|
||||
CVariant qv = getSimulatorSetupValue(index);
|
||||
if (qv.canConvert<QString>())
|
||||
{
|
||||
return qv.toQString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorPluginInfo::setSimulatorSetup(const BlackMisc::CPropertyIndexVariantMap &setup)
|
||||
{
|
||||
this->m_simsetup = setup;
|
||||
}
|
||||
|
||||
QString CSimulatorPluginInfo::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
|
||||
@@ -22,22 +22,16 @@ namespace BlackMisc
|
||||
//! Describing a simulator plugin
|
||||
class CSimulatorPluginInfo : public BlackMisc::CValueObject<CSimulatorPluginInfo>
|
||||
{
|
||||
/**
|
||||
* The _name_ property identifies the plugin itself and must be uniqe.
|
||||
*/
|
||||
//! The _name_ property identifies the plugin itself and must be uniqe.
|
||||
Q_PROPERTY(QString getName READ getName)
|
||||
|
||||
/**
|
||||
* The _simulator_ property specifies which simulator the plugin handles.
|
||||
* There cannot be two plugins loaded for the same simulator.
|
||||
* swift enables some features for particular simulators. Currently recognized are:
|
||||
* fsx, fs9, xplane
|
||||
*/
|
||||
//! The _simulator_ property specifies which simulator the plugin handles.
|
||||
//! There cannot be two plugins loaded for the same simulator.
|
||||
//! swift enables some features for particular simulators. Currently recognized are:
|
||||
//! fsx, fs9, xplane
|
||||
Q_PROPERTY(QString getSimulator READ getSimulator)
|
||||
|
||||
/**
|
||||
* The _description_ property provides a short, human-readable description of the plugin.
|
||||
*/
|
||||
//! The _description_ property provides a short, human-readable description of the plugin.
|
||||
Q_PROPERTY(QString getDescription READ getDescription)
|
||||
|
||||
public:
|
||||
@@ -49,15 +43,6 @@ namespace BlackMisc
|
||||
//! Unspecified simulator
|
||||
bool isUnspecified() const;
|
||||
|
||||
//! Single setting value
|
||||
BlackMisc::CVariant getSimulatorSetupValue(int index) const;
|
||||
|
||||
//! Single setting value
|
||||
QString getSimulatorSetupValueAsString(int index) const;
|
||||
|
||||
//! Set single settings
|
||||
void setSimulatorSetup(const BlackMisc::CPropertyIndexVariantMap &setup);
|
||||
|
||||
//! Check if the provided plugin metadata is valid.
|
||||
//! Simulator plugin (driver) has to meet the following requirements:
|
||||
//! * implements org.swift.pilotclient.BlackCore.SimulatorInterface;
|
||||
@@ -88,7 +73,6 @@ namespace BlackMisc
|
||||
QString m_simulator;
|
||||
QString m_description;
|
||||
bool m_valid { false };
|
||||
BlackMisc::CPropertyIndexVariantMap m_simsetup; //!< allows to access simulator keys requried on remote side
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
@@ -97,8 +81,7 @@ BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatorPluginInfo, (
|
||||
attr(o.m_name),
|
||||
attr(o.m_simulator),
|
||||
attr(o.m_description),
|
||||
attr(o.m_valid),
|
||||
attr(o.m_simsetup, flags<DisabledForComparison>())
|
||||
attr(o.m_valid)
|
||||
))
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorPluginInfo)
|
||||
|
||||
|
||||
@@ -13,14 +13,80 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
void CSimulatorSetup::setSettings(const BlackMisc::CPropertyIndexVariantMap &map)
|
||||
void CSimulatorSetup::setValue(const QString &name, const QString &value)
|
||||
{
|
||||
this->m_setup = map;
|
||||
this->m_data.addOrReplaceValue(name, value);
|
||||
}
|
||||
|
||||
void CSimulatorSetup::init()
|
||||
QString CSimulatorSetup::getStringValue(const QString &name) const
|
||||
{
|
||||
// void
|
||||
return m_data.getValueAsString(name);
|
||||
}
|
||||
|
||||
void CSimulatorSetup::setSimulatorVersion(const QString versionInfo)
|
||||
{
|
||||
this->setValue("all/versionInfo", versionInfo);
|
||||
}
|
||||
|
||||
void CSimulatorSetup::setSimulatorInstallationDirectory(const QString fullFilePath)
|
||||
{
|
||||
this->setValue("all/installDir", fullFilePath);
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::getSimulatorVersion() const
|
||||
{
|
||||
return this->getStringValue("all/versionInfo");
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::getSimulatorInstallationDirectory() const
|
||||
{
|
||||
return this->getStringValue("all/installDir");
|
||||
}
|
||||
|
||||
void CSimulatorSetup::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<BlackMisc::Simulation::CSimulatorSetup>();
|
||||
qDBusRegisterMetaType<BlackMisc::Simulation::CSimulatorSetup>();
|
||||
registerMetaValueType<BlackMisc::Simulation::CSimulatorSetup>();
|
||||
}
|
||||
|
||||
QString CSimulatorSetup::convertToQString(bool i18n) const
|
||||
{
|
||||
return m_data.toQString(i18n);
|
||||
}
|
||||
|
||||
CVariant CSimulatorSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexData:
|
||||
return m_data.toCVariant();
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorSetup::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexData:
|
||||
this->m_data.convertFromCVariant(variant.value<QString>());
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_SIMULATION_SIMSETUP_H
|
||||
#define BLACKMISC_SIMULATION_SIMSETUP_H
|
||||
#ifndef BLACKMISC_SIMULATION_SIMULATORSETUP_H
|
||||
#define BLACKMISC_SIMULATION_SIMULATORSETUP_H
|
||||
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/namevariantpairlist.h"
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
|
||||
@@ -20,41 +20,67 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
/*!
|
||||
* \brief Simulator settings for flight simulators
|
||||
* \details Represents the generic part of a simulator setup ("common denominator"),
|
||||
* details kept in specialized classes
|
||||
*/
|
||||
class CSimulatorSetup
|
||||
//! Simulator settings for flight simulators.
|
||||
//! Those are set up at runtime and represent information about the simulator (like a small registry)
|
||||
class CSimulatorSetup : public CValueObject<CSimulatorSetup>
|
||||
{
|
||||
protected:
|
||||
BlackMisc::CPropertyIndexVariantMap m_setup; //!< values describing the simulator setup (path, config files)
|
||||
|
||||
protected:
|
||||
//! Default constructor
|
||||
CSimulatorSetup() {}
|
||||
|
||||
//! Constructor
|
||||
CSimulatorSetup(const BlackMisc::CPropertyIndexVariantMap &map) : m_setup(map) {}
|
||||
|
||||
public:
|
||||
//! Specific values
|
||||
enum
|
||||
{
|
||||
SetupSimPath = BlackMisc::CPropertyIndex::GlobalIndexAbuseMode
|
||||
IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorSetup
|
||||
};
|
||||
|
||||
//! Settings
|
||||
BlackMisc::CPropertyIndexVariantMap getSettings() const { return this->m_setup;}
|
||||
//! Default constructor
|
||||
CSimulatorSetup() {}
|
||||
|
||||
//! All values
|
||||
BlackMisc::CNameVariantPairList getData() const { return this->m_data;}
|
||||
|
||||
//! Settings
|
||||
void setSettings(const BlackMisc::CPropertyIndexVariantMap &map);
|
||||
void setData(const BlackMisc::CNameVariantPairList &data) { this->m_data = data; }
|
||||
|
||||
//! Init, to be used where simulator runs
|
||||
void init();
|
||||
//! Set value
|
||||
void setValue(const QString &name, const QString &value);
|
||||
|
||||
//! Get string value
|
||||
QString getStringValue(const QString &name) const;
|
||||
|
||||
//! Simulator version info, something like "FSX 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;
|
||||
|
||||
//! Path where simulator is installed
|
||||
QString getSimulatorInstallationDirectory() const;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
virtual CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const override;
|
||||
|
||||
//! \copydoc CValueObject::setPropertyByIndex
|
||||
virtual void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) override;
|
||||
|
||||
//! Register metadata
|
||||
void static registerMetadata();
|
||||
|
||||
protected:
|
||||
//! \copydoc CValueObject::convertToQString()
|
||||
virtual QString convertToQString(bool i18n = false) const override;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatorSetup)
|
||||
BlackMisc::CNameVariantPairList m_data;
|
||||
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatorSetup, (o.m_data))
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorSetup)
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user