mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
#include "aircraftcfgentries.h"
|
#include "aircraftcfgentries.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
|
|
||||||
namespace BlackSim
|
namespace BlackSim
|
||||||
{
|
{
|
||||||
namespace FsCommon
|
namespace FsCommon
|
||||||
@@ -24,19 +26,19 @@ namespace BlackSim
|
|||||||
/*
|
/*
|
||||||
* Operator ==
|
* Operator ==
|
||||||
*/
|
*/
|
||||||
bool CAircraftCfgEntries::operator ==(const CAircraftCfgEntries &otherEntry) const
|
bool CAircraftCfgEntries::operator ==(const CAircraftCfgEntries &other) const
|
||||||
{
|
{
|
||||||
if (this == &otherEntry) return true;
|
if (this == &other) return true;
|
||||||
return this->m_title == otherEntry.m_title;
|
return TupleConverter<CAircraftCfgEntries>::toTuple(*this) == TupleConverter<CAircraftCfgEntries>::toTuple(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Operator !=
|
* Operator !=
|
||||||
*/
|
*/
|
||||||
bool CAircraftCfgEntries::operator !=(const CAircraftCfgEntries &otherEntry) const
|
bool CAircraftCfgEntries::operator !=(const CAircraftCfgEntries &other) const
|
||||||
{
|
{
|
||||||
if (this == &otherEntry) return false;
|
if (this == &other) return false;
|
||||||
return !((*this) == otherEntry);
|
return !((*this) == other);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -89,14 +91,7 @@ namespace BlackSim
|
|||||||
*/
|
*/
|
||||||
uint CAircraftCfgEntries::getValueHash() const
|
uint CAircraftCfgEntries::getValueHash() const
|
||||||
{
|
{
|
||||||
QList<uint> hashs;
|
return qHash(TupleConverter<CAircraftCfgEntries>::toTuple(*this));
|
||||||
hashs << qHash(this->m_atcModel);
|
|
||||||
hashs << qHash(this->m_atcParkingCode);
|
|
||||||
hashs << qHash(this->m_atcType);
|
|
||||||
hashs << qHash(this->m_filePath);
|
|
||||||
hashs << qHash(this->m_index);
|
|
||||||
hashs << qHash(this->m_title);
|
|
||||||
return BlackMisc::calculateHash(hashs, "CAircraftCfgEntries");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -114,16 +109,7 @@ namespace BlackSim
|
|||||||
int CAircraftCfgEntries::compareImpl(const CValueObject &otherBase) const
|
int CAircraftCfgEntries::compareImpl(const CValueObject &otherBase) const
|
||||||
{
|
{
|
||||||
const auto &other = static_cast<const CAircraftCfgEntries &>(otherBase);
|
const auto &other = static_cast<const CAircraftCfgEntries &>(otherBase);
|
||||||
if (this->m_index != other.m_index)
|
return compare(TupleConverter<CAircraftCfgEntries>::toTuple(*this), TupleConverter<CAircraftCfgEntries>::toTuple(other));
|
||||||
{
|
|
||||||
return (this->m_index > other.m_index) ? 1 : -1;
|
|
||||||
}
|
|
||||||
int result;
|
|
||||||
if ((result = this->m_atcModel.compare(other.m_atcModel, Qt::CaseInsensitive))) return result;
|
|
||||||
if ((result = this->m_atcParkingCode.compare(other.m_atcParkingCode, Qt::CaseInsensitive))) return result;
|
|
||||||
if ((result = this->m_atcType.compare(other.m_atcType, Qt::CaseInsensitive))) return result;;
|
|
||||||
if ((result = this->m_filePath.compare(other.m_filePath, Qt::CaseInsensitive))) return result;;
|
|
||||||
return this->m_title.compare(other.m_title, Qt::CaseInsensitive);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -139,12 +125,7 @@ namespace BlackSim
|
|||||||
*/
|
*/
|
||||||
void CAircraftCfgEntries::marshallToDbus(QDBusArgument &argument) const
|
void CAircraftCfgEntries::marshallToDbus(QDBusArgument &argument) const
|
||||||
{
|
{
|
||||||
argument << this->m_atcModel;
|
argument << TupleConverter<CAircraftCfgEntries>::toTuple(*this);
|
||||||
argument << this->m_atcParkingCode;
|
|
||||||
argument << this->m_atcType;
|
|
||||||
argument << this->m_filePath;
|
|
||||||
argument << this->m_index;
|
|
||||||
argument << this->m_title;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -152,12 +133,7 @@ namespace BlackSim
|
|||||||
*/
|
*/
|
||||||
void CAircraftCfgEntries::unmarshallFromDbus(const QDBusArgument &argument)
|
void CAircraftCfgEntries::unmarshallFromDbus(const QDBusArgument &argument)
|
||||||
{
|
{
|
||||||
argument >> this->m_atcModel;
|
argument >> TupleConverter<CAircraftCfgEntries>::toTuple(*this);
|
||||||
argument >> this->m_atcParkingCode;
|
|
||||||
argument >> this->m_atcType;
|
|
||||||
argument >> this->m_filePath;
|
|
||||||
argument >> this->m_index;
|
|
||||||
argument >> this->m_title;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ namespace BlackSim
|
|||||||
class CAircraftCfgEntries: public BlackMisc::CValueObject
|
class CAircraftCfgEntries: public BlackMisc::CValueObject
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftCfgEntries)
|
||||||
qint32 m_index; //!< current index in given config
|
qint32 m_index; //!< current index in given config
|
||||||
QString m_filePath; //!< file path of aircraft.cfg
|
QString m_filePath; //!< file path of aircraft.cfg
|
||||||
QString m_title; //!< Title in aircraft.cfg
|
QString m_title; //!< Title in aircraft.cfg
|
||||||
@@ -76,10 +77,10 @@ namespace BlackSim
|
|||||||
virtual ~CAircraftCfgEntries() {}
|
virtual ~CAircraftCfgEntries() {}
|
||||||
|
|
||||||
//! \brief operator ==
|
//! \brief operator ==
|
||||||
bool operator ==(const CAircraftCfgEntries &otherEntry) const;
|
bool operator ==(const CAircraftCfgEntries &other) const;
|
||||||
|
|
||||||
//! \brief operator !=
|
//! \brief operator !=
|
||||||
bool operator !=(const CAircraftCfgEntries &otherEntry) const;
|
bool operator !=(const CAircraftCfgEntries &other) const;
|
||||||
|
|
||||||
//! \copydoc CValueObject::propertyByIndex
|
//! \copydoc CValueObject::propertyByIndex
|
||||||
QVariant propertyByIndex(int index) const;
|
QVariant propertyByIndex(int index) const;
|
||||||
@@ -135,6 +136,7 @@ namespace BlackSim
|
|||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
BLACK_DECLARE_TUPLE_CONVERSION(BlackSim::FsCommon::CAircraftCfgEntries, (o.m_index, o.m_filePath, o.m_title, o.m_atcType, o.m_atcModel, o.m_atcParkingCode))
|
||||||
Q_DECLARE_METATYPE(BlackSim::FsCommon::CAircraftCfgEntries)
|
Q_DECLARE_METATYPE(BlackSim::FsCommon::CAircraftCfgEntries)
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include "aircraftmapping.h"
|
#include "aircraftmapping.h"
|
||||||
#include "blackmisc/blackmiscfreefunctions.h"
|
#include "blackmisc/blackmiscfreefunctions.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
|
|
||||||
namespace BlackSim
|
namespace BlackSim
|
||||||
{
|
{
|
||||||
namespace FsCommon
|
namespace FsCommon
|
||||||
@@ -15,7 +17,7 @@ namespace BlackSim
|
|||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
CAircraftMapping::CAircraftMapping() :
|
CAircraftMapping::CAircraftMapping() :
|
||||||
m_mappingId(CAircraftMapping::InvalidId), m_proposalId(CAircraftMapping::InvalidId), m_lastChanged(-1), m_simulator(BlackSim::CSimulator::UnspecifiedSim())
|
m_mappingId(CAircraftMapping::InvalidId), m_proposalId(CAircraftMapping::InvalidId), m_lastChanged(-1), m_simulatorInfo(BlackSim::CSimulatorInfo::UnspecifiedSim())
|
||||||
{
|
{
|
||||||
// void
|
// void
|
||||||
}
|
}
|
||||||
@@ -26,10 +28,10 @@ namespace BlackSim
|
|||||||
CAircraftMapping::CAircraftMapping(
|
CAircraftMapping::CAircraftMapping(
|
||||||
qint32 mappingId, qint32 proposalId, const QString &fsAircraftKey, const QString &icaoAircraftDesignator,
|
qint32 mappingId, qint32 proposalId, const QString &fsAircraftKey, const QString &icaoAircraftDesignator,
|
||||||
const QString &icaoAirline, const QString &icaoAircraftType, const QString &icaoWakeTurbulenceCategory, const QString &painting,
|
const QString &icaoAirline, const QString &icaoAircraftType, const QString &icaoWakeTurbulenceCategory, const QString &painting,
|
||||||
const QString &lastChanged, BlackSim::CSimulator simulator) :
|
const QString &lastChanged, BlackSim::CSimulatorInfo simulator) :
|
||||||
m_mappingId(mappingId), m_proposalId(proposalId), m_fsAircraftKey(fsAircraftKey), m_icaoAircraftDesignator(icaoAircraftDesignator),
|
m_mappingId(mappingId), m_proposalId(proposalId), m_fsAircraftKey(fsAircraftKey), m_aircraftDesignator(icaoAircraftDesignator),
|
||||||
m_icaoAirlineDesignator(icaoAirline), m_icaoAircraftType(icaoAircraftType), m_icaoWakeTurbulenceCategory(icaoWakeTurbulenceCategory), m_painting(painting),
|
m_airlineDesignator(icaoAirline), m_aircraftCombinedType(icaoAircraftType), m_wakeTurbulenceCategory(icaoWakeTurbulenceCategory), m_aircraftColor(painting),
|
||||||
m_lastChanged(lastChanged), m_simulator(simulator), m_changed(false)
|
m_lastChanged(lastChanged), m_simulatorInfo(simulator), m_changed(false)
|
||||||
{
|
{
|
||||||
// void
|
// void
|
||||||
}
|
}
|
||||||
@@ -40,14 +42,7 @@ namespace BlackSim
|
|||||||
bool CAircraftMapping::operator ==(const CAircraftMapping &otherMapping) const
|
bool CAircraftMapping::operator ==(const CAircraftMapping &otherMapping) const
|
||||||
{
|
{
|
||||||
if (this == &otherMapping) return true;
|
if (this == &otherMapping) return true;
|
||||||
return
|
return TupleConverter<CAircraftMapping>::toTuple(*this) == TupleConverter<CAircraftMapping>::toTuple(otherMapping);
|
||||||
this->m_mappingId == otherMapping.m_mappingId &&
|
|
||||||
this->m_proposalId == otherMapping.m_proposalId &&
|
|
||||||
this->m_changed == otherMapping.m_changed &&
|
|
||||||
this->m_icaoAircraftDesignator == otherMapping.m_icaoAircraftDesignator &&
|
|
||||||
this->m_icaoAircraftType == otherMapping.m_icaoAircraftType &&
|
|
||||||
this->m_icaoAirlineDesignator == otherMapping.m_icaoAirlineDesignator &&
|
|
||||||
this->m_icaoWakeTurbulenceCategory == otherMapping.m_icaoWakeTurbulenceCategory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -67,7 +62,7 @@ namespace BlackSim
|
|||||||
QString s("{%1, %2, %3, %4, %5}");
|
QString s("{%1, %2, %3, %4, %5}");
|
||||||
s = s.arg(this->m_fsAircraftKey).
|
s = s.arg(this->m_fsAircraftKey).
|
||||||
arg(this->m_mappingId).arg(this->m_proposalId).
|
arg(this->m_mappingId).arg(this->m_proposalId).
|
||||||
arg(this->m_icaoAircraftDesignator).arg(this->m_simulator.toQString(i18n));
|
arg(this->m_aircraftDesignator).arg(this->m_simulatorInfo.toQString(i18n));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,19 +75,19 @@ namespace BlackSim
|
|||||||
|
|
||||||
if (this->m_fsAircraftKey.isEmpty())
|
if (this->m_fsAircraftKey.isEmpty())
|
||||||
msg.append("Missing sim key. ");
|
msg.append("Missing sim key. ");
|
||||||
if (this->m_icaoAircraftDesignator.isEmpty())
|
if (this->m_aircraftDesignator.isEmpty())
|
||||||
msg.append("Missing designator. ");
|
msg.append("Missing designator. ");
|
||||||
if (this->m_simulator.isUnspecified())
|
if (this->m_simulatorInfo.isUnspecified())
|
||||||
msg.append("Unknown simulator. ");
|
msg.append("Unknown simulator. ");
|
||||||
|
|
||||||
if (this->m_icaoAircraftType.isEmpty())
|
if (this->m_aircraftCombinedType.isEmpty())
|
||||||
msg.append("Missing type. ");
|
msg.append("Missing type. ");
|
||||||
else if (this->m_icaoAircraftType.length() != 3)
|
else if (this->m_aircraftCombinedType.length() != 3)
|
||||||
msg.append("Wrong type length (req.3). ");
|
msg.append("Wrong type length (req.3). ");
|
||||||
|
|
||||||
if (this->m_icaoWakeTurbulenceCategory.isEmpty() || this->m_icaoWakeTurbulenceCategory.length() != 1)
|
if (this->m_wakeTurbulenceCategory.isEmpty() || this->m_wakeTurbulenceCategory.length() != 1)
|
||||||
msg.append("Invalid WTC. ");
|
msg.append("Invalid WTC. ");
|
||||||
else if (this->m_icaoWakeTurbulenceCategory != "L" && this->m_icaoWakeTurbulenceCategory != "M" && this->m_icaoWakeTurbulenceCategory != "H")
|
else if (this->m_wakeTurbulenceCategory != "L" && this->m_wakeTurbulenceCategory != "M" && this->m_wakeTurbulenceCategory != "H")
|
||||||
msg.append("Invalid WTC code. ");
|
msg.append("Invalid WTC code. ");
|
||||||
|
|
||||||
return msg.trimmed();
|
return msg.trimmed();
|
||||||
@@ -114,19 +109,7 @@ namespace BlackSim
|
|||||||
*/
|
*/
|
||||||
uint CAircraftMapping::getValueHash() const
|
uint CAircraftMapping::getValueHash() const
|
||||||
{
|
{
|
||||||
QList<uint> hashs;
|
return qHash(TupleConverter<CAircraftMapping>::toTuple(*this));
|
||||||
hashs << qHash(this->m_changed);
|
|
||||||
hashs << qHash(this->m_fsAircraftKey);
|
|
||||||
hashs << qHash(this->m_icaoAircraftDesignator);
|
|
||||||
hashs << qHash(this->m_icaoAircraftType);
|
|
||||||
hashs << qHash(this->m_icaoAirlineDesignator);
|
|
||||||
hashs << qHash(this->m_icaoWakeTurbulenceCategory);
|
|
||||||
hashs << qHash(this->m_lastChanged);
|
|
||||||
hashs << qHash(this->m_mappingId);
|
|
||||||
hashs << qHash(this->m_painting);
|
|
||||||
hashs << qHash(this->m_proposalId);
|
|
||||||
hashs << qHash(this->m_simulator);
|
|
||||||
return BlackMisc::calculateHash(hashs, "CAircraftMapping");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -144,20 +127,20 @@ namespace BlackSim
|
|||||||
return m_proposalId;
|
return m_proposalId;
|
||||||
case IndexAircraftKey:
|
case IndexAircraftKey:
|
||||||
return m_fsAircraftKey;
|
return m_fsAircraftKey;
|
||||||
case IndexIcaoAircraftDesignator:
|
case IndexAircraftDesignator:
|
||||||
return m_icaoAircraftDesignator;
|
return m_aircraftDesignator;
|
||||||
case IndexIcaoAirlineDesignator:
|
case IndexAirlineDesignator:
|
||||||
return m_icaoAirlineDesignator;
|
return m_airlineDesignator;
|
||||||
case IndexAircraftType:
|
case IndexAircraftCombinedType:
|
||||||
return m_icaoAircraftType;
|
return m_aircraftCombinedType;
|
||||||
case IndexWakeTurbulenceCategory:
|
case IndexWakeTurbulenceCategory:
|
||||||
return m_icaoWakeTurbulenceCategory;
|
return m_wakeTurbulenceCategory;
|
||||||
case IndexPainting:
|
case IndexAirlineColor:
|
||||||
return this->m_painting;
|
return this->m_aircraftColor;
|
||||||
case IndexLastChanged:
|
case IndexLastChanged:
|
||||||
return this->getLastChangedFormatted();
|
return this->getLastChangedFormatted();
|
||||||
case IndexSimulator:
|
case IndexSimulatorInfo:
|
||||||
return this->m_simulator.toQVariant();
|
return this->m_simulatorInfo.toQVariant();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -197,24 +180,24 @@ namespace BlackSim
|
|||||||
m_fsAircraftKey = value.toString();
|
m_fsAircraftKey = value.toString();
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
case IndexIcaoAircraftDesignator:
|
case IndexAircraftDesignator:
|
||||||
this->setIcaoAircraftDesignator(value.toString());
|
this->setAircraftDesignator(value.toString());
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
case IndexIcaoAirlineDesignator:
|
case IndexAirlineDesignator:
|
||||||
this->setIcaoAirline(value.toString());
|
this->setAirlineDesignator(value.toString());
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
case IndexAircraftType:
|
case IndexAircraftCombinedType:
|
||||||
this->setIcaoAircraftType(value.toString());
|
this->setAircraftCombinedType(value.toString());
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
case IndexWakeTurbulenceCategory:
|
case IndexWakeTurbulenceCategory:
|
||||||
this->setIcaoWakeTurbulenceCategory(value.toString());
|
this->setWakeTurbulenceCategory(value.toString());
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
case IndexPainting:
|
case IndexAirlineColor:
|
||||||
this->m_painting = value.toString();
|
this->m_aircraftColor = value.toString();
|
||||||
changed = true;
|
changed = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -224,37 +207,20 @@ namespace BlackSim
|
|||||||
if (changed) this->setChanged(changed);
|
if (changed) this->setChanged(changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Marshall to Dbus
|
||||||
|
*/
|
||||||
void CAircraftMapping::marshallToDbus(QDBusArgument &argument) const
|
void CAircraftMapping::marshallToDbus(QDBusArgument &argument) const
|
||||||
{
|
{
|
||||||
argument << this->m_changed;
|
argument << TupleConverter<CAircraftMapping>::toTuple(*this);
|
||||||
argument << this->m_fsAircraftKey;
|
|
||||||
argument << this->m_icaoAircraftDesignator;
|
|
||||||
argument << this->m_icaoAircraftType;
|
|
||||||
argument << this->m_icaoAirlineDesignator;
|
|
||||||
argument << this->m_icaoWakeTurbulenceCategory;
|
|
||||||
argument << this->m_lastChanged;
|
|
||||||
argument << this->m_mappingId;
|
|
||||||
argument << this->m_painting;
|
|
||||||
argument << this->m_proposalId;
|
|
||||||
argument << this->m_simulator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unmarshall from DBus
|
* Unmarshall from Dbus
|
||||||
*/
|
*/
|
||||||
void CAircraftMapping::unmarshallFromDbus(const QDBusArgument &argument)
|
void CAircraftMapping::unmarshallFromDbus(const QDBusArgument &argument)
|
||||||
{
|
{
|
||||||
argument >> this->m_changed;
|
argument >> TupleConverter<CAircraftMapping>::toTuple(*this);
|
||||||
argument >> this->m_fsAircraftKey;
|
|
||||||
argument >> this->m_icaoAircraftDesignator;
|
|
||||||
argument >> this->m_icaoAircraftType;
|
|
||||||
argument >> this->m_icaoAirlineDesignator;
|
|
||||||
argument >> this->m_icaoWakeTurbulenceCategory;
|
|
||||||
argument >> this->m_lastChanged;
|
|
||||||
argument >> this->m_mappingId;
|
|
||||||
argument >> this->m_painting;
|
|
||||||
argument >> this->m_proposalId;
|
|
||||||
argument >> this->m_simulator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -270,14 +236,8 @@ namespace BlackSim
|
|||||||
*/
|
*/
|
||||||
int CAircraftMapping::compareImpl(const CValueObject &otherBase) const
|
int CAircraftMapping::compareImpl(const CValueObject &otherBase) const
|
||||||
{
|
{
|
||||||
const CAircraftMapping &other = static_cast<const CAircraftMapping &>(otherBase);
|
const auto &other = static_cast<const CAircraftMapping &>(otherBase);
|
||||||
int result;
|
return compare(TupleConverter<CAircraftMapping>::toTuple(*this), TupleConverter<CAircraftMapping>::toTuple(other));
|
||||||
if ((result = compare(this->m_simulator, other.m_simulator))) return result;
|
|
||||||
if ((result = this->m_icaoAircraftDesignator.compare(other.m_icaoAircraftDesignator, Qt::CaseInsensitive))) return result;
|
|
||||||
if ((result = this->m_icaoAirlineDesignator.compare(other.m_icaoAirlineDesignator, Qt::CaseInsensitive))) return result;
|
|
||||||
if ((result = this->m_icaoAircraftType.compare(other.m_icaoAircraftType, Qt::CaseInsensitive))) return result;;
|
|
||||||
if ((result = this->m_icaoWakeTurbulenceCategory.compare(other.m_icaoWakeTurbulenceCategory, Qt::CaseInsensitive))) return result;;
|
|
||||||
return this->m_fsAircraftKey.compare(other.m_fsAircraftKey, Qt::CaseInsensitive);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define BLACKSIM_FSCOMMON_AIRCRAFTMAPPING_H
|
#define BLACKSIM_FSCOMMON_AIRCRAFTMAPPING_H
|
||||||
|
|
||||||
#include "aircraftcfgentries.h"
|
#include "aircraftcfgentries.h"
|
||||||
#include "../simulator.h"
|
#include "../simulatorinfo.h"
|
||||||
#include "blackmisc/valueobject.h"
|
#include "blackmisc/valueobject.h"
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -41,16 +41,17 @@ namespace BlackSim
|
|||||||
int compareImpl(const CValueObject &otherBase) const override;
|
int compareImpl(const CValueObject &otherBase) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftMapping)
|
||||||
qint32 m_mappingId; //!< Kind of primary key for this particular mapping
|
qint32 m_mappingId; //!< Kind of primary key for this particular mapping
|
||||||
qint32 m_proposalId; //!< If proposal id of the proposal
|
qint32 m_proposalId; //!< If proposal id of the proposal
|
||||||
QString m_fsAircraftKey; //!< Id by which the simulator can create the aircraft
|
QString m_fsAircraftKey; //!< Id by which the simulator can create the aircraft
|
||||||
QString m_icaoAircraftDesignator; //!< Aircraft designator such as B737
|
QString m_aircraftDesignator; //!< Aircraft designator such as B737
|
||||||
QString m_icaoAirlineDesignator; //!< Airline designator such as DLH
|
QString m_airlineDesignator; //!< Airline designator such as DLH
|
||||||
QString m_icaoAircraftType; //!< Engine, type, number of engines L2J, L1P
|
QString m_aircraftCombinedType; //!< Engine, type, number of engines L2J, L1P
|
||||||
QString m_icaoWakeTurbulenceCategory; //!< Wake turbulence category H, L, M
|
QString m_wakeTurbulenceCategory; //!< Wake turbulence category H, L, M
|
||||||
QString m_painting; //!< Aircrafts painting designator, could be same as airline or specific
|
QString m_aircraftColor; //!< Aircrafts painting designator, could be same as airline or specific
|
||||||
QString m_lastChanged; //!< Simple timestamp as YYYYMMDDhhmmss
|
QString m_lastChanged; //!< Simple timestamp as YYYYMMDDhhmmss
|
||||||
BlackSim::CSimulator m_simulator; //!< Mapping is for simulator
|
BlackSim::CSimulatorInfo m_simulatorInfo; //!< Mapping is for simulator
|
||||||
bool m_changed; //! Changed flag
|
bool m_changed; //! Changed flag
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -60,13 +61,13 @@ namespace BlackSim
|
|||||||
IndexMappingId = 0,
|
IndexMappingId = 0,
|
||||||
IndexProposalId,
|
IndexProposalId,
|
||||||
IndexAircraftKey,
|
IndexAircraftKey,
|
||||||
IndexIcaoAircraftDesignator,
|
IndexAircraftDesignator,
|
||||||
IndexIcaoAirlineDesignator,
|
IndexAirlineDesignator,
|
||||||
IndexAircraftType,
|
IndexAircraftCombinedType,
|
||||||
IndexWakeTurbulenceCategory,
|
IndexWakeTurbulenceCategory,
|
||||||
IndexPainting,
|
IndexAirlineColor,
|
||||||
IndexLastChanged,
|
IndexLastChanged,
|
||||||
IndexSimulator
|
IndexSimulatorInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Default mapping
|
//! \brief Default mapping
|
||||||
@@ -85,7 +86,7 @@ namespace BlackSim
|
|||||||
* \param lastChanged
|
* \param lastChanged
|
||||||
* \param simulator
|
* \param simulator
|
||||||
*/
|
*/
|
||||||
CAircraftMapping(qint32 mappingId, qint32 proposalId, const QString &fsAircraftKey, const QString &icaoAircraftDesignator, const QString &icaoAirline, const QString &icaoAircraftType, const QString &icaoWakeTurbulenceCategory, const QString &painting, const QString &lastChanged, CSimulator simulator);
|
CAircraftMapping(qint32 mappingId, qint32 proposalId, const QString &fsAircraftKey, const QString &icaoAircraftDesignator, const QString &icaoAirline, const QString &icaoAircraftType, const QString &icaoWakeTurbulenceCategory, const QString &painting, const QString &lastChanged, CSimulatorInfo simulator);
|
||||||
|
|
||||||
//! \brief Virtual destructor
|
//! \brief Virtual destructor
|
||||||
virtual ~CAircraftMapping()
|
virtual ~CAircraftMapping()
|
||||||
@@ -107,19 +108,19 @@ namespace BlackSim
|
|||||||
QString getFsAircraftKey() const { return this->m_fsAircraftKey; }
|
QString getFsAircraftKey() const { return this->m_fsAircraftKey; }
|
||||||
|
|
||||||
//! \brief ICAO designator (B737)
|
//! \brief ICAO designator (B737)
|
||||||
QString getIcaoAircraftDesignator() const { return this->m_icaoAircraftDesignator; }
|
QString getAircraftDesignator() const { return this->m_aircraftDesignator; }
|
||||||
|
|
||||||
//! \brief ICAO airline (DLH)
|
//! \brief ICAO airline (DLH)
|
||||||
QString getIcaoAirline() const { return this->m_icaoAirlineDesignator; }
|
QString getAirlineDesignator() const { return this->m_airlineDesignator; }
|
||||||
|
|
||||||
//! \brief ICAO aircraft type (L2J)
|
//! \brief ICAO aircraft type (L2J)
|
||||||
QString getIcaoAircraftType() const { return this->m_icaoAircraftType; }
|
QString getAircraftCombinedType() const { return this->m_aircraftCombinedType; }
|
||||||
|
|
||||||
//! \brief ICAO wake turbulence category
|
//! \brief ICAO wake turbulence category (L,M,H)
|
||||||
QString getIcaoWakeTurbulenceCategory() const { return this->m_icaoWakeTurbulenceCategory; }
|
QString getWakeTurbulenceCategory() const { return this->m_wakeTurbulenceCategory; }
|
||||||
|
|
||||||
//! \brief Painting, basically the airline code for GA planes
|
//! \brief Painting, basically the airline code for GA planes
|
||||||
QString getPainting() const { return this->m_painting; }
|
QString getAircraftColor() const { return this->m_aircraftColor; }
|
||||||
|
|
||||||
//! \brief Last changed timestamp YYYYMMDDhhmmss
|
//! \brief Last changed timestamp YYYYMMDDhhmmss
|
||||||
QString getLastChanged() const { return this->m_lastChanged; }
|
QString getLastChanged() const { return this->m_lastChanged; }
|
||||||
@@ -128,7 +129,7 @@ namespace BlackSim
|
|||||||
QString getLastChangedFormatted() const;
|
QString getLastChangedFormatted() const;
|
||||||
|
|
||||||
//! \brief Simulator
|
//! \brief Simulator
|
||||||
BlackSim::CSimulator getSimulator() const { return this->m_simulator; }
|
BlackSim::CSimulatorInfo getSimulatorInfo() const { return this->m_simulatorInfo; }
|
||||||
|
|
||||||
//! \brief Simulator
|
//! \brief Simulator
|
||||||
QString getSimulatorText() const;
|
QString getSimulatorText() const;
|
||||||
@@ -156,25 +157,25 @@ namespace BlackSim
|
|||||||
void setFsAircraftKey(const QString &aircraftKey) { this->m_fsAircraftKey = aircraftKey; }
|
void setFsAircraftKey(const QString &aircraftKey) { this->m_fsAircraftKey = aircraftKey; }
|
||||||
|
|
||||||
//! \brief ICAO designator (B737)
|
//! \brief ICAO designator (B737)
|
||||||
void setIcaoAircraftDesignator(const QString &icaoDesignator) { this->m_icaoAircraftDesignator = icaoDesignator.toUpper(); }
|
void setAircraftDesignator(const QString &icaoDesignator) { this->m_aircraftDesignator = icaoDesignator.toUpper(); }
|
||||||
|
|
||||||
//! \brief ICAO airline (DLH)
|
//! \brief ICAO airline (DLH)
|
||||||
void setIcaoAirline(const QString &airline) { this->m_icaoAirlineDesignator = airline.toUpper(); }
|
void setAirlineDesignator(const QString &airline) { this->m_airlineDesignator = airline.toUpper(); }
|
||||||
|
|
||||||
//! \brief ICAO aircraft type (L2J)
|
//! \brief ICAO aircraft type (L2J)
|
||||||
void setIcaoAircraftType(const QString &aircraftType) { this->m_icaoAircraftType = aircraftType.toUpper(); }
|
void setAircraftCombinedType(const QString &aircraftType) { this->m_aircraftCombinedType = aircraftType.toUpper(); }
|
||||||
|
|
||||||
//! \brief ICAO wake turbulence category
|
//! \brief ICAO wake turbulence category
|
||||||
void setIcaoWakeTurbulenceCategory(const QString &wtc) { this->m_icaoWakeTurbulenceCategory = wtc.toUpper(); }
|
void setWakeTurbulenceCategory(const QString &wtc) { this->m_wakeTurbulenceCategory = wtc.toUpper(); }
|
||||||
|
|
||||||
//! \brief Painting, basically the airline code for GA planes
|
//! \brief Painting, basically the airline code for GA planes
|
||||||
void setPainting(const QString &painting) { this->m_painting = painting; }
|
void setAircraftColor(const QString &painting) { this->m_aircraftColor = painting; }
|
||||||
|
|
||||||
//! \brief Last changed timestamp YYYYMMDDhhmmss
|
//! \brief Last changed timestamp YYYYMMDDhhmmss
|
||||||
void setLastChanged(qint32 lastChanged) { this->m_lastChanged = lastChanged; }
|
void setLastChanged(qint32 lastChanged) { this->m_lastChanged = lastChanged; }
|
||||||
|
|
||||||
//! \brief Simulator
|
//! \brief Simulator
|
||||||
void setSimulator(BlackSim::CSimulator simulator) { this->m_simulator = simulator; }
|
void setSimulator(BlackSim::CSimulatorInfo simulator) { this->m_simulatorInfo = simulator; }
|
||||||
|
|
||||||
//! \brief Set simulator text
|
//! \brief Set simulator text
|
||||||
void setSimulatorText(const QString &simulator);
|
void setSimulatorText(const QString &simulator);
|
||||||
@@ -211,6 +212,7 @@ namespace BlackSim
|
|||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
BLACK_DECLARE_TUPLE_CONVERSION(BlackSim::FsCommon::CAircraftMapping, (o.m_mappingId, o.m_proposalId, o.m_fsAircraftKey, o.m_aircraftDesignator, o.m_airlineDesignator, o.m_aircraftCombinedType, o.m_wakeTurbulenceCategory, o.m_aircraftColor, o.m_lastChanged, o.m_simulatorInfo))
|
||||||
Q_DECLARE_METATYPE(BlackSim::FsCommon::CAircraftMapping)
|
Q_DECLARE_METATYPE(BlackSim::FsCommon::CAircraftMapping)
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
Reference in New Issue
Block a user