mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 21:45:34 +08:00
Ref T265, Ref T430, Ref T473 "supported parts" in model
* added part member * unified parsing from DB "CAircraftModel::fromDatabaseJsonBaseImpl"
This commit is contained in:
committed by
Mat Sutcliffe
parent
2d3e2e2d99
commit
ecb77191e5
@@ -119,6 +119,7 @@ namespace BlackMisc
|
||||
IndexModelTypeAsString,
|
||||
IndexModelMode,
|
||||
IndexModelModeAsString,
|
||||
IndexSupportedParts,
|
||||
IndexModelModeAsIcon,
|
||||
IndexHasQueriedModelString,
|
||||
IndexMembersDbStatus
|
||||
@@ -139,6 +140,9 @@ namespace BlackMisc
|
||||
//! Constructor.
|
||||
CAircraftModel(const QString &model, ModelType type, const QString &description, const Aviation::CAircraftIcaoCode &icao, const Aviation::CLivery &livery = Aviation::CLivery());
|
||||
|
||||
//! Constructor.
|
||||
CAircraftModel(const QString &model, ModelType type, const CSimulatorInfo &simulator, const QString &name, const QString &description);
|
||||
|
||||
//! Constructor.
|
||||
CAircraftModel(const QString &model, ModelType type, const CSimulatorInfo &simulator, const QString &name, const QString &description, const Aviation::CAircraftIcaoCode &icao, const Aviation::CLivery &livery = Aviation::CLivery());
|
||||
|
||||
@@ -289,6 +293,12 @@ namespace BlackMisc
|
||||
//! CG value available?
|
||||
bool hasCG() const { return !m_cg.isNull(); }
|
||||
|
||||
//! Supported parts
|
||||
const QString &getSupportedParts() const { return m_supportedParts; }
|
||||
|
||||
//! Supported parts
|
||||
void setSupportedParts(const QString &supportedParts);
|
||||
|
||||
//! Model type
|
||||
ModelType getModelType() const { return m_modelType; }
|
||||
|
||||
@@ -473,7 +483,17 @@ namespace BlackMisc
|
||||
//! Hint, that model was automatically generated (e.g. by auto stashing)
|
||||
static const QString &autoGenerated();
|
||||
|
||||
//! Clean up parts string
|
||||
static QString cleanUpPartsString(const QString &p);
|
||||
|
||||
//! Supported parts
|
||||
//! \remark Engine, Flaps, Gear, Lights, Spoilers
|
||||
static const QString &supportedParts();
|
||||
|
||||
private:
|
||||
//! Common implemenation of all fromDatabaseJson functions
|
||||
static CAircraftModel fromDatabaseJsonBaseImpl(const QJsonObject &json, const QString &prefix, const Aviation::CAircraftIcaoCode &aircraftIcao, const Aviation::CLivery &livery, const CDistributor &distributor);
|
||||
|
||||
Aviation::CCallsign m_callsign; //!< aircraft's callsign if any
|
||||
Aviation::CAircraftIcaoCode m_aircraftIcao; //!< ICAO code if available
|
||||
Aviation::CLivery m_livery; //!< livery information
|
||||
@@ -485,6 +505,7 @@ namespace BlackMisc
|
||||
QString m_description; //!< descriptive text
|
||||
QString m_fileName; //!< file name
|
||||
QString m_iconPath; //!< a file representing the aircraft as icon
|
||||
QString m_supportedParts; //!< supported parts
|
||||
qint64 m_fileTimestamp = -1; //!< file timestamp of originating file (if applicable)
|
||||
ModelType m_modelType = TypeUnknown; //!< model string is coming representing ...?
|
||||
ModelMode m_modelMode = Include; //!< model mode (include / exclude)
|
||||
@@ -500,6 +521,7 @@ namespace BlackMisc
|
||||
BLACK_METAMEMBER(simulator),
|
||||
BLACK_METAMEMBER(distributor),
|
||||
BLACK_METAMEMBER(cg),
|
||||
BLACK_METAMEMBER(supportedParts),
|
||||
BLACK_METAMEMBER(modelString, 0, CaseInsensitiveComparison),
|
||||
BLACK_METAMEMBER(name),
|
||||
BLACK_METAMEMBER(description, 0, DisabledForComparison),
|
||||
|
||||
Reference in New Issue
Block a user