refs #628 Use the metaclass mixins in all value classes.

This commit is contained in:
Mathew Sutcliffe
2016-04-02 17:34:18 +01:00
parent 4f3637a046
commit 4bd4baa535
82 changed files with 629 additions and 560 deletions

View File

@@ -46,18 +46,17 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftEngine)
int m_number = 1;
bool m_on = true;
BLACK_METACLASS(CAircraftEngine,
BLACK_METAMEMBER(number, 0, DisabledForJson),
BLACK_METAMEMBER(on)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftEngine)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftEngine, (
attr(o.m_number, flags<DisabledForJson>()),
attr(o.m_on, "on")
))
#endif // guard

View File

@@ -46,10 +46,10 @@ namespace BlackMisc
//! Engine number 1..x on?
bool isEngineOn(int engineNumber) const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::toJson
QJsonObject toJson() const;
//! \copydoc BlackMisc::Mixin::JsonByTuple::convertFromJson
//! \copydoc BlackMisc::Mixin::JsonByMetaClass::convertFromJson
void convertFromJson(const QJsonObject &json);
};

View File

@@ -255,7 +255,6 @@ namespace BlackMisc
static CAircraftIcaoCode fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftIcaoCode)
QString m_designator; //!< "B737"
QString m_iataCode; //!< "320"
QString m_family; //!< "A350" (not a real ICAO code, but a family)
@@ -273,25 +272,26 @@ namespace BlackMisc
//! Create a combined string like L2J
static QString createdCombinedString(const QString &type, int engineCount, const QString &engine);
BLACK_METACLASS(CAircraftIcaoCode,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(designator),
BLACK_METAMEMBER(iataCode),
BLACK_METAMEMBER(family),
BLACK_METAMEMBER(combinedType),
BLACK_METAMEMBER(manufacturer),
BLACK_METAMEMBER(modelDescription),
BLACK_METAMEMBER(wtc),
BLACK_METAMEMBER(military),
BLACK_METAMEMBER(realWorld),
BLACK_METAMEMBER(legacy),
BLACK_METAMEMBER(rank)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftIcaoCode)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftIcaoCode, (
o.m_dbKey,
o.m_timestampMSecsSinceEpoch,
o.m_designator,
o.m_iataCode,
o.m_family,
o.m_combinedType,
o.m_manufacturer,
o.m_modelDescription,
o.m_wtc,
o.m_military,
o.m_realWorld,
o.m_legacy,
o.m_rank
))
#endif // guard

View File

@@ -100,7 +100,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftLights)
bool m_strobeOn = false;
bool m_landingOn = false;
bool m_taxiOn = false;
@@ -108,18 +107,18 @@ namespace BlackMisc
bool m_navOn = false;
bool m_logoOn = false;
BLACK_METACLASS(CAircraftLights,
BLACK_METAMEMBER_NAMED(strobeOn, "strobe_on"),
BLACK_METAMEMBER_NAMED(landingOn, "landing_on"),
BLACK_METAMEMBER_NAMED(taxiOn, "taxi_on"),
BLACK_METAMEMBER_NAMED(beaconOn, "beacon_on"),
BLACK_METAMEMBER_NAMED(navOn, "nav_on"),
BLACK_METAMEMBER_NAMED(logoOn, "logo_on")
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftLights)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftLights, (
attr(o.m_strobeOn, "strobe_on"),
attr(o.m_landingOn, "landing_on"),
attr(o.m_taxiOn, "taxi_on"),
attr(o.m_beaconOn, "beacon_on"),
attr(o.m_navOn, "nav_on"),
attr(o.m_logoOn, "logo_on")
))
#endif // guard

View File

@@ -114,7 +114,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftParts)
CAircraftLights m_lights;
CAircraftEngineList m_engines;
int m_flapsPercentage = 0;
@@ -122,19 +121,19 @@ namespace BlackMisc
bool m_spoilersOut = false;
bool m_isOnGround = false;
BLACK_METACLASS(CAircraftParts,
BLACK_METAMEMBER_NAMED(lights, "lights"),
BLACK_METAMEMBER_NAMED(gearDown, "gear_down"),
BLACK_METAMEMBER_NAMED(flapsPercentage, "flaps_pct"),
BLACK_METAMEMBER_NAMED(spoilersOut, "spoilers_out"),
BLACK_METAMEMBER_NAMED(engines, "engines"),
BLACK_METAMEMBER_NAMED(isOnGround, "on_ground"),
BLACK_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForJson | DisabledForComparison)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftParts, (
attr(o.m_lights, "lights"),
attr(o.m_gearDown, "gear_down"),
attr(o.m_flapsPercentage, "flaps_pct"),
attr(o.m_spoilersOut, "spoilers_out"),
attr(o.m_engines, "engines"),
attr(o.m_isOnGround, "on_ground"),
attr(o.m_timestampMSecsSinceEpoch, flags < DisabledForJson | DisabledForComparison > ())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftParts)
#endif // guard

View File

@@ -147,7 +147,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAircraftSituation)
CCallsign m_correspondingCallsign;
BlackMisc::Geo::CCoordinateGeodetic m_position;
BlackMisc::Aviation::CAltitude m_altitude;
@@ -155,21 +154,21 @@ namespace BlackMisc
BlackMisc::PhysicalQuantities::CAngle m_pitch;
BlackMisc::PhysicalQuantities::CAngle m_bank;
BlackMisc::PhysicalQuantities::CSpeed m_groundspeed;
BLACK_METACLASS(CAircraftSituation,
BLACK_METAMEMBER(correspondingCallsign),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(altitude),
BLACK_METAMEMBER(heading),
BLACK_METAMEMBER(pitch),
BLACK_METAMEMBER(bank),
BLACK_METAMEMBER(groundspeed),
BLACK_METAMEMBER(timestampMSecsSinceEpoch)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAircraftSituation, (
o.m_correspondingCallsign,
o.m_position,
o.m_altitude,
o.m_heading,
o.m_pitch,
o.m_bank,
o.m_groundspeed,
o.m_timestampMSecsSinceEpoch
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAircraftSituation)
#endif // guard

View File

@@ -177,7 +177,6 @@ namespace BlackMisc
static CAirlineIcaoCode fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirlineIcaoCode)
QString m_designator; //!< "DLH"
QString m_iataCode; //!< "LH"
QString m_name; //!< "Lufthansa"
@@ -186,21 +185,22 @@ namespace BlackMisc
bool m_isVa = false; //!< virtual airline
bool m_isOperating = true; //!< still operating?
bool m_isMilitary = false; //!< air force or such
BLACK_METACLASS(CAirlineIcaoCode,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(designator),
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(country),
BLACK_METAMEMBER(telephonyDesignator),
BLACK_METAMEMBER(isVa),
BLACK_METAMEMBER(isOperating),
BLACK_METAMEMBER(isMilitary)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAirlineIcaoCode)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAirlineIcaoCode, (
o.m_dbKey,
o.m_timestampMSecsSinceEpoch,
o.m_designator,
o.m_name,
o.m_country,
o.m_telephonyDesignator,
o.m_isVa,
o.m_isOperating,
o.m_isMilitary
))
#endif // guard

View File

@@ -115,22 +115,21 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirport)
CAirportIcaoCode m_icao;
QString m_descriptiveName;
BlackMisc::Geo::CCoordinateGeodetic m_position;
BLACK_METACLASS(CAirport,
BLACK_METAMEMBER(icao),
BLACK_METAMEMBER(descriptiveName),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(distanceToOwnAircraft),
BLACK_METAMEMBER(bearingToOwnAircraft)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAirport, (
o.m_icao,
o.m_descriptiveName,
o.m_position,
o.m_distanceToOwnAircraft,
o.m_bearingToOwnAircraft
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAirport)
#endif // guard

View File

@@ -57,15 +57,15 @@ namespace BlackMisc
int comparePropertyByIndex(const CAirportIcaoCode &compareValue, const CPropertyIndex &index) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAirportIcaoCode)
QString m_icaoCode;
BLACK_METACLASS(CAirportIcaoCode,
BLACK_METAMEMBER(icaoCode, 0, CaseInsensitiveComparison)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAirportIcaoCode, (
attr(o.m_icaoCode, flags<CaseInsensitiveComparison>())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAirportIcaoCode)
#endif // guard

View File

@@ -14,6 +14,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/length.h"
#include "blackmisc/metaclass.h"
namespace BlackMisc
{
@@ -27,11 +28,11 @@ namespace BlackMisc
class BLACKMISC_EXPORT CAltitude :
public PhysicalQuantities::CLength,
public Mixin::MetaType<CAltitude>,
public Mixin::EqualsByTuple<CAltitude>,
public Mixin::CompareByTuple<CAltitude>,
public Mixin::HashByTuple<CAltitude>,
public Mixin::DBusByTuple<CAltitude>,
public Mixin::JsonByTuple<CAltitude>,
public Mixin::EqualsByMetaClass<CAltitude>,
public Mixin::CompareByMetaClass<CAltitude>,
public Mixin::HashByMetaClass<CAltitude>,
public Mixin::DBusByMetaClass<CAltitude>,
public Mixin::JsonByMetaClass<CAltitude>,
public Mixin::String<CAltitude>,
public Mixin::Icon<CAltitude>,
public Mixin::Index<CAltitude>
@@ -100,13 +101,15 @@ namespace BlackMisc
BlackMisc::CIcon toIcon() const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAltitude)
ReferenceDatum m_datum; //!< MSL or AGL?
BLACK_METACLASS(CAltitude,
BLACK_METAMEMBER(datum)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAltitude, (o.m_datum))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude)
#endif // guard

View File

@@ -246,7 +246,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CAtcStation)
CCallsign m_callsign;
BlackMisc::Network::CUser m_controller;
BlackMisc::PhysicalQuantities::CFrequency m_frequency;
@@ -258,25 +257,26 @@ namespace BlackMisc
CInformationMessage m_atis { CInformationMessage::ATIS };
CInformationMessage m_metar { CInformationMessage::METAR };
BlackMisc::Audio::CVoiceRoom m_voiceRoom;
BLACK_METACLASS(CAtcStation,
BLACK_METAMEMBER(callsign),
BLACK_METAMEMBER(controller),
BLACK_METAMEMBER(frequency),
BLACK_METAMEMBER(position),
BLACK_METAMEMBER(range),
BLACK_METAMEMBER(isOnline),
BLACK_METAMEMBER(atis),
BLACK_METAMEMBER(bookedFromUtc),
BLACK_METAMEMBER(bookedUntilUtc),
BLACK_METAMEMBER(metar),
BLACK_METAMEMBER(voiceRoom),
BLACK_METAMEMBER(distanceToOwnAircraft),
BLACK_METAMEMBER(bearingToOwnAircraft)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CAtcStation, (
o.m_callsign,
o.m_controller,
o.m_frequency,
o.m_position,
o.m_range,
o.m_isOnline,
o.m_atis,
o.m_bookedFromUtc,
o.m_bookedUntilUtc,
o.m_metar,
o.m_voiceRoom,
o.m_distanceToOwnAircraft,
o.m_bearingToOwnAircraft
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAtcStation)
#endif // guard

View File

@@ -154,21 +154,21 @@ namespace BlackMisc
static QString unifyCallsign(const QString &callsign);
private:
BLACK_ENABLE_TUPLE_CONVERSION(CCallsign)
QString m_callsignAsSet;
QString m_callsign;
QString m_telephonyDesignator;
TypeHint m_typeHint = NoHint;
BLACK_METACLASS(CCallsign,
BLACK_METAMEMBER(callsign, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(callsignAsSet, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(telephonyDesignator, 0, DisabledForComparison | DisabledForHashing),
BLACK_METAMEMBER(typeHint, 0, DisabledForComparison | DisabledForHashing)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CCallsign, (
attr(o.m_callsign, flags <CaseInsensitiveComparison> ()),
attr(o.m_callsignAsSet, flags <DisabledForComparison | DisabledForHashing>()),
attr(o.m_telephonyDesignator, flags <DisabledForComparison | DisabledForHashing>()),
attr(o.m_typeHint, flags <DisabledForComparison | DisabledForHashing>())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsign)
#endif // guard

View File

@@ -166,13 +166,14 @@ namespace BlackMisc
//! \remarks Just a helper method, that is why no CFrequency is returned
static double channelSpacingToFrequencyKHz(ChannelSpacing channelSpacing);
BLACK_ENABLE_TUPLE_CONVERSION(CComSystem)
BLACK_METACLASS(CComSystem,
BLACK_METAMEMBER(channelSpacing)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CComSystem, (o.m_channelSpacing))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CComSystem)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CComSystem::ChannelSpacing)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CComSystem::ComUnit)

View File

@@ -186,7 +186,6 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CFlightPlan)
QString m_equipmentIcao;
CAirportIcaoCode m_originAirportIcao;
CAirportIcaoCode m_destinationAirportIcao;
@@ -201,26 +200,27 @@ namespace BlackMisc
QString m_route;
QString m_remarks;
QDateTime m_lastSentOrLoaded;
BLACK_METACLASS(CFlightPlan,
BLACK_METAMEMBER(equipmentIcao),
BLACK_METAMEMBER(originAirportIcao),
BLACK_METAMEMBER(destinationAirportIcao),
BLACK_METAMEMBER(alternateAirportIcao),
BLACK_METAMEMBER(takeoffTimePlanned),
BLACK_METAMEMBER(takeoffTimeActual),
BLACK_METAMEMBER(enrouteTime),
BLACK_METAMEMBER(fuelTime),
BLACK_METAMEMBER(cruiseAltitude),
BLACK_METAMEMBER(cruiseTrueAirspeed),
BLACK_METAMEMBER(flightRules),
BLACK_METAMEMBER(route),
BLACK_METAMEMBER(remarks),
BLACK_METAMEMBER(lastSentOrLoaded)
);
};
} // namespace
} // namespace
Q_DECLARE_METATYPE(BlackMisc::Aviation::CFlightPlan)
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CFlightPlan, (
o.m_equipmentIcao,
o.m_originAirportIcao,
o.m_destinationAirportIcao,
o.m_alternateAirportIcao,
o.m_takeoffTimePlanned,
o.m_takeoffTimeActual,
o.m_enrouteTime,
o.m_fuelTime,
o.m_cruiseAltitude,
o.m_cruiseTrueAirspeed,
o.m_flightRules,
o.m_route,
o.m_remarks,
o.m_lastSentOrLoaded
))
#endif // guard

View File

@@ -14,6 +14,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/angle.h"
#include "blackmisc/metaclass.h"
namespace BlackMisc
{
@@ -27,11 +28,11 @@ namespace BlackMisc
class BLACKMISC_EXPORT CHeading :
public PhysicalQuantities::CAngle,
public Mixin::MetaType<CHeading>,
public Mixin::EqualsByTuple<CHeading>,
public Mixin::CompareByTuple<CHeading>,
public Mixin::HashByTuple<CHeading>,
public Mixin::DBusByTuple<CHeading>,
public Mixin::JsonByTuple<CHeading>,
public Mixin::EqualsByMetaClass<CHeading>,
public Mixin::CompareByMetaClass<CHeading>,
public Mixin::HashByMetaClass<CHeading>,
public Mixin::DBusByMetaClass<CHeading>,
public Mixin::JsonByMetaClass<CHeading>,
public Mixin::String<CHeading>,
public Mixin::Index<CHeading>
{
@@ -74,13 +75,15 @@ namespace BlackMisc
ReferenceNorth getReferenceNorth() const { return m_north; }
private:
BLACK_ENABLE_TUPLE_CONVERSION(CHeading)
ReferenceNorth m_north; //!< magnetic or true?
BLACK_METACLASS(CHeading,
BLACK_METAMEMBER(north)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CHeading, (o.m_north))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CHeading)
#endif // guard

View File

@@ -93,20 +93,19 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CInformationMessage)
InformationType m_type;
QString m_message;
QDateTime m_receivedTimestamp;
BLACK_METACLASS(CInformationMessage,
BLACK_METAMEMBER(type),
BLACK_METAMEMBER(message),
BLACK_METAMEMBER(receivedTimestamp)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CInformationMessage, (
o.m_type,
o.m_message,
o.m_receivedTimestamp
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CInformationMessage)
#endif // guard

View File

@@ -158,27 +158,26 @@ namespace BlackMisc
static const QString &colorLiveryMarker();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CLivery)
CAirlineIcaoCode m_airline; //!< corresponding airline, if any
QString m_combinedCode; //!< livery code and pseudo airline ICAO code
QString m_description; //!< describes the livery
BlackMisc::CRgbColor m_colorFuselage; //! color of fuselage
BlackMisc::CRgbColor m_colorTail; //! color of tail
bool m_military = false; //! Military livery?
BLACK_METACLASS(CLivery,
BLACK_METAMEMBER(dbKey),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(airline),
BLACK_METAMEMBER(combinedCode, 0, CaseInsensitiveComparison),
BLACK_METAMEMBER(description),
BLACK_METAMEMBER(colorFuselage),
BLACK_METAMEMBER(colorTail)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CLivery, (
attr(o.m_dbKey),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_airline),
attr(o.m_combinedCode, flags <CaseInsensitiveComparison> ()),
attr(o.m_description),
attr(o.m_colorFuselage),
attr(o.m_colorTail)
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CLivery)
#endif // guard

View File

@@ -136,7 +136,6 @@ namespace BlackMisc
static const BlackMisc::PhysicalQuantities::CFrequency &FrequencyNotSet();
private:
BLACK_ENABLE_TUPLE_CONVERSION(CModulator)
QString m_name; //!< name of the unit
BlackMisc::PhysicalQuantities::CFrequency m_frequencyActive; //!< active frequency
BlackMisc::PhysicalQuantities::CFrequency m_frequencyStandby; //!< standby frequency
@@ -149,6 +148,15 @@ namespace BlackMisc
//! Easy access to derived class (CRTP template parameter)
AVIO *derived();
BLACK_METACLASS(CModulator,
BLACK_METAMEMBER(name),
BLACK_METAMEMBER(frequencyActive),
BLACK_METAMEMBER(frequencyStandby),
BLACK_METAMEMBER(volumeInput),
BLACK_METAMEMBER(volumeOutput),
BLACK_METAMEMBER(enabled)
);
};
//! \cond PRIVATE
@@ -164,12 +172,4 @@ namespace BlackMisc
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION_TEMPLATE(BlackMisc::Aviation::CModulator, (
o.m_name,
o.m_frequencyActive,
o.m_frequencyStandby,
o.m_volumeInput ,
o.m_volumeOutput,
o.m_enabled))
#endif // guard

View File

@@ -74,15 +74,17 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSelcal)
QString m_code;
static QList<BlackMisc::PhysicalQuantities::CFrequency> frequencyEquivalents;
static QStringList allCodePairs;
BLACK_METACLASS(CSelcal,
BLACK_METAMEMBER(code)
);
};
} // namespace
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CSelcal, (o.m_code))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CSelcal)
#endif // guard

View File

@@ -14,6 +14,7 @@
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/pq/angle.h"
#include "blackmisc/metaclass.h"
namespace BlackMisc
{
@@ -28,11 +29,11 @@ namespace BlackMisc
class BLACKMISC_EXPORT CTrack :
public PhysicalQuantities::CAngle,
public Mixin::MetaType<CTrack>,
public Mixin::EqualsByTuple<CTrack>,
public Mixin::CompareByTuple<CTrack>,
public Mixin::HashByTuple<CTrack>,
public Mixin::DBusByTuple<CTrack>,
public Mixin::JsonByTuple<CTrack>,
public Mixin::EqualsByMetaClass<CTrack>,
public Mixin::CompareByMetaClass<CTrack>,
public Mixin::HashByMetaClass<CTrack>,
public Mixin::DBusByMetaClass<CTrack>,
public Mixin::JsonByMetaClass<CTrack>,
public Mixin::String<CTrack>,
public Mixin::Index<CTrack>
{
@@ -85,13 +86,15 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
private:
BLACK_ENABLE_TUPLE_CONVERSION(CTrack)
ReferenceNorth m_north; //!< magnetic or true?
BLACK_METACLASS(CTrack,
BLACK_METAMEMBER(north)
);
};
}
}
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CTrack, (o.m_north))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CTrack)
#endif // guard

View File

@@ -173,19 +173,18 @@ namespace BlackMisc
//! Default value?
bool isDefaultValue() const { return this->m_transponderCode == 0; }
BLACK_ENABLE_TUPLE_CONVERSION(CTransponder)
int m_transponderCode; //!< Transponder code
TransponderMode m_transponderMode; //!< Transponder mode
BLACK_METACLASS(CTransponder,
BLACK_METAMEMBER(transponderCode),
BLACK_METAMEMBER(transponderMode)
);
};
} // ns
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CTransponder, (
o.m_transponderCode,
o.m_transponderMode
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CTransponder)
Q_DECLARE_METATYPE(BlackMisc::Aviation::CTransponder::TransponderMode)