mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +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:
108
src/blackmisc/simulation/simulatorinternals.h
Normal file
108
src/blackmisc/simulation/simulatorinternals.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/* 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_SIMULATORINTERNALS_H
|
||||
#define BLACKMISC_SIMULATION_SIMULATORINTERNALS_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/containerbase.h"
|
||||
#include "blackmisc/dictionary.h"
|
||||
#include "blackmisc/metaclass.h"
|
||||
#include "blackmisc/namevariantpairlist.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/valueobject.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
#include <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
//! Simulator internals for flight simulators.
|
||||
//! Those are set up at runtime and represent information about the simulator (like a small registry)
|
||||
class BLACKMISC_EXPORT CSimulatorInternals : public CValueObject<CSimulatorInternals>
|
||||
{
|
||||
public:
|
||||
//! Specific values
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexData = BlackMisc::CPropertyIndex::GlobalIndexCSimulatorInternals
|
||||
};
|
||||
|
||||
//! Default constructor
|
||||
CSimulatorInternals() {}
|
||||
|
||||
//! All values
|
||||
BlackMisc::CNameVariantPairList getData() const { return this->m_data;}
|
||||
|
||||
//! Settings
|
||||
void setData(const BlackMisc::CNameVariantPairList &data) { this->m_data = data; }
|
||||
|
||||
//! 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;
|
||||
|
||||
//! 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
|
||||
QString getSimulatorInstallationDirectory() const;
|
||||
|
||||
//! Path where simulator is installed
|
||||
void setSimulatorInstallationDirectory(const QString fullFilePath);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Register metadata
|
||||
void static registerMetadata();
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString()
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BlackMisc::CNameVariantPairList m_data;
|
||||
|
||||
BLACK_METACLASS(
|
||||
CSimulatorInternals,
|
||||
BLACK_METAMEMBER(data)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorInternals)
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user