10 namespace swift::misc::simulation
14 const QString &aircraftDesignator,
15 const QString &airlineDesignator)
16 : m_sessionId(sessionId.trimmed()), m_modelSetId(modelSetId.trimmed()), m_description(description),
17 m_aircraftDesignator(aircraftDesignator.trimmed().toUpper()),
18 m_airlineDesignator(airlineDesignator.trimmed().toUpper()), m_entryType(type)
32 m_entryType =
static_cast<int>(type);
40 const QString &aircraftDesignator,
const QString &airlineDesignator)
const
48 return !m_aircraftDesignator.
isEmpty() && !m_airlineDesignator.
isEmpty();
57 default: qFatal(
"Wrong Type");
return CIcon::iconByIndex(CIcons::StandardIconUnknown16);
63 static const QString f(
"found");
64 static const QString m(
"missing");
70 case Missing:
return m;
71 default: qFatal(
"Wrong Type");
return x;
115 case IndexAircraftDesignator: m_aircraftDesignator = variant.
value<
QString>();
break;
117 case IndexCount: m_count = variant.
toInt();
break;
118 case IndexAirlineDesignator: m_airlineDesignator = variant.
value<
QString>();
break;
119 case IndexDescription: m_description = variant.
value<
QString>();
break;
136 case IndexEntryTypeAsIcon:
137 case IndexEntryTypeAsString:
138 case IndexEntryType:
return Compare::compare(m_entryType, compareValue.m_entryType);
140 case IndexCount:
return Compare::compare(m_count, compareValue.m_count);
141 case IndexAircraftDesignator:
143 case IndexAirlineDesignator:
145 case IndexHasAircraftAirlineCombination:
150 Q_ASSERT_X(
false, Q_FUNC_INFO,
"Compare failed");
157 static const QString s(
"%1 Session: '%2' model set: '%3' aircraft: '%4' airline: '%5' description: '%6'");
159 m_airlineDesignator, m_description);
Value object for icons. An icon is stored in the global icon repository and identified by its index....
static const CIcon & iconByIndex(CIcons::IconIndex index)
Icon for given index.
Non-owning reference to a CPropertyIndex with a subset of its features.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
int comparePropertyByIndex(CPropertyIndexRef index, const ITimestampBased &compareValue) const
Compare for index.
static bool canHandleIndex(CPropertyIndexRef index)
Can given index be handled.
void setCurrentUtcTime()
Set the current time as timestamp.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
ColumnIndex
Base class enums.
int comparePropertyByIndex(CPropertyIndexRef index, const Derived &compareValue) const
Compare for index.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
Value object for a matching statistics entry.
void setSessionId(const QString &sessionId)
Set session id.
const QString & getModelSetId() const
Get model set id.
const QString & getDescription() const
Get description.
bool matches(EntryType type, const QString &sessionId, const QString &aircraftDesignator, const QString &airlineDesignator) const
Matches given value?
int comparePropertyByIndex(CPropertyIndexRef index, const CMatchingStatisticsEntry &compareValue) const
Compare by index.
const QString & getSessionId() const
Session id.
bool isMissing() const
Missing entry?
static const QString & entryTypeToString(EntryType type)
Convert entry type.
const QString & getAirlineDesignator() const
Get missing airline designator.
EntryType
Represents type of entry.
CMatchingStatisticsEntry()=default
Default constructor.
static const swift::misc::CIcon & entryTypeToIcon(EntryType type)
Convert entry type.
QVariant propertyByIndex(swift::misc::CPropertyIndexRef index) const
Property by index.
void setEntryType(EntryType type)
Set the entry type.
bool hasAircraftAirlineCombination() const
Missing aircraft/airline combination?
const QString & getAircraftDesignator() const
Get missing aircraft designator.
EntryType getEntryType() const
Type of entry.
QString convertToQString(bool i18n=false) const
Cast as QString.
void setModelSetId(const QString &modelSetId)
Set model set id.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
void increaseCount()
Count increased by one.
int getCount() const
Current count.
QString arg(Args &&... args) const const
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool isEmpty() const const
QVariant fromValue(T &&value)
int toInt(bool *ok) const const
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.