10namespace 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;
121 case IndexAircraftDesignator: m_aircraftDesignator = variant.
value<
QString>();
break;
123 case IndexCount: m_count = variant.
toInt();
break;
124 case IndexAirlineDesignator: m_airlineDesignator = variant.
value<
QString>();
break;
125 case IndexDescription: m_description = variant.
value<
QString>();
break;
140 case IndexSessionId:
return m_sessionId.compare(compareValue.m_sessionId,
Qt::CaseInsensitive);
142 case IndexEntryTypeAsIcon:
143 case IndexEntryTypeAsString:
144 case IndexEntryType:
return Compare::compare(m_entryType, compareValue.m_entryType);
147 case IndexAircraftDesignator:
148 return m_aircraftDesignator.compare(compareValue.m_aircraftDesignator,
Qt::CaseInsensitive);
149 case IndexAirlineDesignator:
151 case IndexHasAircraftAirlineCombination:
156 Q_ASSERT_X(
false, Q_FUNC_INFO,
"Compare failed");
163 static const QString s(
"%1 Session: '%2' model set: '%3' aircraft: '%4' airline: '%5' description: '%6'");
165 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.
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.
const QString & getDescription() const
Get description.
void setSessionId(const QString &sessionId)
Set session id.
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 & getModelSetId() const
Get model set id.
bool isMissing() const
Missing entry?
static const QString & entryTypeToString(EntryType type)
Convert entry type.
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.
const QString & getSessionId() const
Session id.
void setEntryType(EntryType type)
Set the entry type.
bool hasAircraftAirlineCombination() const
Missing aircraft/airline combination?
EntryType getEntryType() const
Type of entry.
QString convertToQString(bool i18n=false) const
Cast as QString.
void setModelSetId(const QString &modelSetId)
Set model set id.
const QString & getAircraftDesignator() const
Get missing aircraft designator.
void setPropertyByIndex(swift::misc::CPropertyIndexRef index, const QVariant &variant)
Set property by index.
void increaseCount()
Count increased by one.
ColumnIndex
Property indexes.
int getCount() const
Current count.
const QString & getAirlineDesignator() const
Get missing airline designator.
int compare(T a, T b)
Compare arithmetic values.
QString arg(Args &&... args) 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.