swift
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
swift::misc::simulation::CSimulatorInfo Class Reference

Simple hardcoded info about the corresponding simulator. More...

Inheritance diagram for swift::misc::simulation::CSimulatorInfo:
[legend]

Public Types

enum  SimulatorFlag {
  None = 0 , FSX = 1 << 0 , FS9 = 1 << 1 , XPLANE = 1 << 2 ,
  P3D = 1 << 3 , FG = 1 << 4 , MSFS = 1 << 5 , MSFS2024 = 1 << 6 ,
  FSX_P3D = FSX | P3D , AllFsFamily = FSX | FS9 | P3D | MSFS | MSFS2024 , All = FSX | FS9 | XPLANE | P3D | FG | MSFS | MSFS2024
}
 Simulator.
 
- Public Types inherited from swift::misc::CValueObject< CSimulatorInfo >
using base_type = CEmpty
 Base class.
 
- Public Types inherited from swift::misc::CEmpty
using base_type = CEmpty
 Base class is alias of itself.
 
- Public Types inherited from swift::misc::mixin::Index< Derived >
enum  ColumnIndex { IndexPixmap = 10 , IndexIcon , IndexString }
 Base class enums.
 

Public Member Functions

 CSimulatorInfo ()
 Default constructor.
 
 CSimulatorInfo (const QString &identifierString)
 Constructor.
 
 CSimulatorInfo (const QStringList &simulators)
 Constructor.
 
 CSimulatorInfo (Simulator s)
 Constructor.
 
 CSimulatorInfo (int flagsAsInt)
 Constructor.
 
 CSimulatorInfo (bool isFSX, bool isFS9, bool xp, bool isP3D, bool fg, bool msfs, bool msfs2024)
 Constructor.
 
bool isUnspecified () const
 Unspecified simulator.
 
bool isFSX () const
 FSX?
 
bool isFS9 () const
 FS9?
 
bool isXPlane () const
 XPlane.
 
bool isP3D () const
 P3D?
 
bool isFG () const
 FG?
 
bool isMSFS () const
 MSFS?
 
bool isMSFS2024 () const
 MSFS2024?
 
bool isAnySimulator () const
 Any simulator?
 
bool isSingleSimulator () const
 Single simulator selected.
 
bool isNoSimulator () const
 No simulator?
 
bool isMultipleSimulators () const
 Represents > 1 simulator.
 
bool isAllSimulators () const
 Is all simulators?
 
bool isMicrosoftSimulator () const
 Microsoft Simulator?
 
bool isMicrosoftOrPrepare3DSimulator () const
 Microsoft Simulator or P3D?
 
bool isFsxP3DFamily () const
 FSX family, i.e. FSX or P3D?
 
int numberSimulators () const
 Number simulators selected.
 
bool matchesAll (const CSimulatorInfo &otherInfo) const
 Matches all simulators.
 
bool matchesAny (const CSimulatorInfo &otherInfo) const
 Matches any simulator.
 
bool matchesAnyOrNone (const CSimulatorInfo &otherInfo) const
 Matches any simulator or None (NULL) More...
 
Simulator getSimulator () const
 Simulator.
 
void setSimulator (Simulator s)
 Simulator.
 
void addSimulator (Simulator s)
 Add simulator flags.
 
void addSimulator (const CSimulatorInfo &simulatorInfo)
 Add simulator.
 
void setAllSimulators ()
 All simulators.
 
int comparePropertyByIndex (CPropertyIndexRef index, const CSimulatorInfo &compareValue) const
 Cast as QString. More...
 
QString convertToQString (bool i18n=false) const
 Cast as QString. More...
 
CIcons::IconIndex toIcon () const
 As icon, not implemented by all classes. More...
 
CSimulatorInfo add (const CSimulatorInfo &other)
 Add simulator.
 
QSet< CSimulatorInfoasSingleSimulatorSet () const
 As a set of single simulator info objects.
 
void invertSimulators ()
 All simulators selected become unselected and vice versa.
 
CStatusMessage validateSimulatorsForModel () const
 Validate simulators for an aircraft model.
 
- Public Member Functions inherited from swift::misc::mixin::MetaType< Derived >
int getMetaTypeId () const
 Returns the Qt meta type ID of this object. More...
 
QString getClassName () const
 Class name.
 
bool isA (int metaTypeId) const
 Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses.
 
- Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< Derived, Tags >
void marshallToDbus (QDBusArgument &arg, Tags...) const
 Marshall without begin/endStructure, for when composed within another object.
 
void unmarshallFromDbus (const QDBusArgument &arg, Tags...)
 Unmarshall without begin/endStructure, for when composed within another object.
 
- Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< Derived >
void marshalToDataStream (QDataStream &stream) const
 Marshal a value to a QDataStream.
 
void unmarshalFromDataStream (QDataStream &stream)
 Unmarshal a value from a QDataStream.
 
- Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< Derived >
QJsonObject toJson () const
 Cast to JSON object.
 
QString toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const
 Convenience function JSON as string.
 
void convertFromJson (const QJsonObject &json)
 Assign from JSON object.
 
void convertFromJson (const QString &jsonString, bool acceptCacheFormat=false)
 Assign from JSON object string.
 
- Public Member Functions inherited from swift::misc::mixin::String< Derived >
QString toQString (bool i18n=false) const
 Cast as QString.
 
std::string toStdString (bool i18n=false) const
 To std string.
 
QString stringForStreaming () const
 String for streaming operators.
 
- Public Member Functions inherited from swift::misc::mixin::Index< Derived >
CPropertyIndexList apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false)
 Update by variant map. More...
 
void setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant)
 Set property by index.
 
QVariant propertyByIndex (CPropertyIndexRef index) const
 Property by index.
 
int comparePropertyByIndex (CPropertyIndexRef index, const Derived &compareValue) const
 Compare for index.
 
bool equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const
 Is given variant equal to value of property index?
 
- Public Member Functions inherited from swift::misc::mixin::Icon< Derived, IconIndex >
CIcons::IconIndex toIcon () const
 As icon, not implemented by all classes.
 

Static Public Member Functions

static Simulator boolToFlag (bool isFSX, bool isFS9, bool xp, bool isP3D, bool fg, bool msfs, bool msfs2024)
 Bool flags to enum.
 
static Simulator identifierToSimulator (const QString &identifier)
 Identifer, as provided by plugin.
 
static const CSimulatorInfoallSimulators ()
 All simulators.
 
static const QStringList & allSimulatorStrings ()
 All simulator strings.
 
static const QSet< CSimulatorInfo > & allSimulatorsSet ()
 All simulators as set.
 
static const CSimulatorInfoallFsFamilySimulators ()
 All simulators of the FS family (P3D FSX, FS9)
 
static CSimulatorInfo getLocallyInstalledSimulators ()
 Locally installed simulators.
 
static const CSimulatorInfoguessDefaultSimulator ()
 Guess a default simulator based on installation.
 
static CSimulatorInfo fromDatabaseJson (const QJsonObject &json, const QString &prefix)
 From database JSON.
 
static const CSimulatorInfofg ()
 Const simulator info objects.
 
static const CSimulatorInfofsx ()
 Const simulator info objects.
 
static const CSimulatorInfop3d ()
 Const simulator info objects.
 
static const CSimulatorInfofs9 ()
 Const simulator info objects.
 
static const CSimulatorInfoxplane ()
 Const simulator info objects.
 
static const CSimulatorInfomsfs ()
 Const simulator info objects.
 
static const CSimulatorInfomsfs2024 ()
 Const simulator info objects.
 
- Static Public Member Functions inherited from swift::misc::mixin::MetaType< Derived >
static void registerMetadata ()
 Register metadata.
 
- Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< Derived >
template<class DerivedObj = Derived>
static DerivedObj fromJson (const QJsonObject &json)
 Get object from QJsonObject.
 
template<class DerivedObj = Derived>
static DerivedObj fromJson (const QString &jsonString, bool acceptCacheJson=false)
 Get object from JSON string.
 
template<class DerivedObj = Derived>
static DerivedObj fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg)
 Get object from JSON string.
 

Static Public Attributes

static constexpr int NumberOfSimulators = 7
 Number of known individual simulators.
 

Additional Inherited Members

- Protected Member Functions inherited from swift::misc::CValueObject< CSimulatorInfo >
 CValueObject ()=default
 Default constructor.
 
 CValueObject (const CValueObject &)=default
 Copy constructor.
 
CValueObjectoperator= (const CValueObject &)=default
 Copy assignment operator.
 
 ~CValueObject ()=default
 Destructor.
 
 CEmpty ()=default
 Inheriting constructors.
 
 CEmpty (const CEmpty &)=default
 Inheriting constructors.
 
- Protected Member Functions inherited from swift::misc::CEmpty
 CEmpty ()=default
 Protected default constructor.
 
 CEmpty (const CEmpty &)=default
 Protected copy constructor.
 
CEmptyoperator= (const CEmpty &)=default
 Protected copy assignment operator.
 
 ~CEmpty ()=default
 Non-virtual protected destructor.
 

Detailed Description

Simple hardcoded info about the corresponding simulator.

If someone manages to remove this hardcoded simulator information and makes it entirely flexible based upon the plugin metadata feel free.

Definition at line 40 of file simulatorinfo.h.

Member Function Documentation

◆ comparePropertyByIndex()

int swift::misc::simulation::CSimulatorInfo::comparePropertyByIndex ( CPropertyIndexRef  index,
const CSimulatorInfo compareValue 
) const

Cast as QString.

Definition at line 116 of file simulatorinfo.cpp.

◆ convertToQString()

QString swift::misc::simulation::CSimulatorInfo::convertToQString ( bool  i18n = false) const

Cast as QString.

Definition at line 122 of file simulatorinfo.cpp.

◆ matchesAnyOrNone()

bool swift::misc::simulation::CSimulatorInfo::matchesAnyOrNone ( const CSimulatorInfo otherInfo) const

Matches any simulator or None (NULL)

Remarks
for cases where no specified sim. also matches

Definition at line 110 of file simulatorinfo.cpp.

◆ toIcon()

CIcons::IconIndex swift::misc::simulation::CSimulatorInfo::toIcon ( ) const

As icon, not implemented by all classes.

Definition at line 136 of file simulatorinfo.cpp.


The documentation for this class was generated from the following files: