mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 10:15:43 +08:00
refs #628 Use the metaclass mixins in all value classes.
This commit is contained in:
@@ -131,7 +131,6 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CCloudLayer)
|
||||
BlackMisc::Aviation::CAltitude m_base;
|
||||
BlackMisc::Aviation::CAltitude m_top;
|
||||
int m_precipitationRate = 0;
|
||||
@@ -139,20 +138,21 @@ namespace BlackMisc
|
||||
Clouds m_clouds = NoClouds;
|
||||
Coverage m_coverage;
|
||||
int m_coveragePercent;
|
||||
|
||||
BLACK_METACLASS(CCloudLayer,
|
||||
BLACK_METAMEMBER(base),
|
||||
BLACK_METAMEMBER(top),
|
||||
BLACK_METAMEMBER(precipitationRate),
|
||||
BLACK_METAMEMBER(precipitation),
|
||||
BLACK_METAMEMBER(clouds),
|
||||
BLACK_METAMEMBER(coverage),
|
||||
BLACK_METAMEMBER(coveragePercent)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer)
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CCloudLayer::Coverage)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CCloudLayer, (
|
||||
attr(o.m_base),
|
||||
attr(o.m_top),
|
||||
attr(o.m_precipitationRate),
|
||||
attr(o.m_precipitation),
|
||||
attr(o.m_clouds),
|
||||
attr(o.m_coverage),
|
||||
attr(o.m_coveragePercent)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -98,7 +98,6 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CGridPoint)
|
||||
Geo::CLatitude m_latitude;
|
||||
Geo::CLongitude m_longitude;
|
||||
CCloudLayerList m_cloudLayers;
|
||||
@@ -106,18 +105,18 @@ namespace BlackMisc
|
||||
CVisibilityLayerList m_visibilityLayers;
|
||||
CWindLayerList m_windLayers;
|
||||
|
||||
BLACK_METACLASS(CGridPoint,
|
||||
BLACK_METAMEMBER(latitude),
|
||||
BLACK_METAMEMBER(longitude),
|
||||
BLACK_METAMEMBER(cloudLayers),
|
||||
BLACK_METAMEMBER(temperatureLayers),
|
||||
BLACK_METAMEMBER(visibilityLayers),
|
||||
BLACK_METAMEMBER(windLayers)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CGridPoint)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CGridPoint, (
|
||||
attr(o.m_latitude),
|
||||
attr(o.m_longitude),
|
||||
attr(o.m_cloudLayers),
|
||||
attr(o.m_temperatureLayers),
|
||||
attr(o.m_visibilityLayers),
|
||||
attr(o.m_windLayers)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -140,7 +140,6 @@ namespace BlackMisc
|
||||
static CMetar CAVOK();
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CMetar)
|
||||
QString m_metarMessage;
|
||||
ReportType m_reportType = METAR;
|
||||
BlackMisc::Aviation::CAirportIcaoCode m_airport;
|
||||
@@ -154,25 +153,26 @@ namespace BlackMisc
|
||||
PhysicalQuantities::CTemperature m_temperature;
|
||||
PhysicalQuantities::CTemperature m_dewPoint;
|
||||
PhysicalQuantities::CPressure m_altimeter;
|
||||
|
||||
BLACK_METACLASS(CMetar,
|
||||
BLACK_METAMEMBER(metarMessage),
|
||||
BLACK_METAMEMBER(reportType),
|
||||
BLACK_METAMEMBER(airport),
|
||||
BLACK_METAMEMBER(reportDay),
|
||||
BLACK_METAMEMBER(reportTime),
|
||||
BLACK_METAMEMBER(isAutomated),
|
||||
BLACK_METAMEMBER(windLayer),
|
||||
BLACK_METAMEMBER(visibility),
|
||||
BLACK_METAMEMBER(presentWeathers),
|
||||
BLACK_METAMEMBER(cloudLayers),
|
||||
BLACK_METAMEMBER(temperature),
|
||||
BLACK_METAMEMBER(dewPoint),
|
||||
BLACK_METAMEMBER(altimeter)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CMetar)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CMetar, (
|
||||
attr(o.m_metarMessage),
|
||||
attr(o.m_reportType),
|
||||
attr(o.m_airport),
|
||||
attr(o.m_reportDay),
|
||||
attr(o.m_reportTime),
|
||||
attr(o.m_isAutomated),
|
||||
attr(o.m_windLayer),
|
||||
attr(o.m_visibility),
|
||||
attr(o.m_presentWeathers),
|
||||
attr(o.m_cloudLayers),
|
||||
attr(o.m_temperature),
|
||||
attr(o.m_dewPoint),
|
||||
attr(o.m_altimeter)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -124,10 +124,15 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CPresentWeather)
|
||||
Intensity m_intensity = Moderate;
|
||||
Descriptor m_descriptor = None;
|
||||
int m_weatherPhenomena;
|
||||
|
||||
BLACK_METACLASS(CPresentWeather,
|
||||
BLACK_METAMEMBER(intensity),
|
||||
BLACK_METAMEMBER(descriptor),
|
||||
BLACK_METAMEMBER(weatherPhenomena)
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -136,10 +141,5 @@ namespace BlackMisc
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CPresentWeather)
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CPresentWeather::Intensity)
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CPresentWeather::Descriptor)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CPresentWeather, (
|
||||
attr(o.m_intensity),
|
||||
attr(o.m_descriptor),
|
||||
attr(o.m_weatherPhenomena)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -80,21 +80,21 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CTemperatureLayer)
|
||||
BlackMisc::Aviation::CAltitude m_level;
|
||||
PhysicalQuantities::CTemperature m_temperature;
|
||||
PhysicalQuantities::CTemperature m_dewPoint;
|
||||
double m_relativeHumidity = 0;
|
||||
|
||||
BLACK_METACLASS(CTemperatureLayer,
|
||||
BLACK_METAMEMBER(level),
|
||||
BLACK_METAMEMBER(temperature),
|
||||
BLACK_METAMEMBER(dewPoint),
|
||||
BLACK_METAMEMBER(relativeHumidity)
|
||||
);
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CTemperatureLayer)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CTemperatureLayer, (
|
||||
attr(o.m_level),
|
||||
attr(o.m_temperature),
|
||||
attr(o.m_dewPoint),
|
||||
attr(o.m_relativeHumidity)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -72,20 +72,20 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CVisibilityLayer)
|
||||
BlackMisc::Aviation::CAltitude m_base;
|
||||
BlackMisc::Aviation::CAltitude m_top;
|
||||
PhysicalQuantities::CLength m_visibility;
|
||||
|
||||
BLACK_METACLASS(CVisibilityLayer,
|
||||
BLACK_METAMEMBER(base),
|
||||
BLACK_METAMEMBER(top),
|
||||
BLACK_METAMEMBER(visibility)
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CVisibilityLayer)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CVisibilityLayer, (
|
||||
attr(o.m_base),
|
||||
attr(o.m_top),
|
||||
attr(o.m_visibility)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -52,21 +52,21 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CWeatherDataPluginInfo)
|
||||
QString m_identifier;
|
||||
QString m_name;
|
||||
QString m_description;
|
||||
bool m_valid { false };
|
||||
|
||||
BLACK_METACLASS(CWeatherDataPluginInfo,
|
||||
BLACK_METAMEMBER(identifier, 0, CaseInsensitiveComparison),
|
||||
BLACK_METAMEMBER(name, 0, DisabledForComparison | DisabledForHashing),
|
||||
BLACK_METAMEMBER(description, 0, DisabledForComparison | DisabledForHashing),
|
||||
BLACK_METAMEMBER(valid, 0, DisabledForComparison | DisabledForHashing)
|
||||
);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CWeatherDataPluginInfo, (
|
||||
attr(o.m_identifier, flags <CaseInsensitiveComparison> ()),
|
||||
attr(o.m_name, flags < DisabledForComparison | DisabledForHashing > ()),
|
||||
attr(o.m_description, flags < DisabledForComparison | DisabledForHashing > ()),
|
||||
attr(o.m_valid, flags < DisabledForComparison | DisabledForHashing > ())
|
||||
))
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CWeatherDataPluginInfo)
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -109,7 +109,6 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CWindLayer)
|
||||
BlackMisc::Aviation::CAltitude m_level;
|
||||
PhysicalQuantities::CAngle m_directionMain;
|
||||
PhysicalQuantities::CAngle m_directionFrom;
|
||||
@@ -118,20 +117,20 @@ namespace BlackMisc
|
||||
PhysicalQuantities::CSpeed m_speed;
|
||||
PhysicalQuantities::CSpeed m_gustSpeed;
|
||||
|
||||
BLACK_METACLASS(CWindLayer,
|
||||
BLACK_METAMEMBER(level),
|
||||
BLACK_METAMEMBER(directionMain),
|
||||
BLACK_METAMEMBER(directionFrom),
|
||||
BLACK_METAMEMBER(directionTo),
|
||||
BLACK_METAMEMBER(directionVariable),
|
||||
BLACK_METAMEMBER(speed),
|
||||
BLACK_METAMEMBER(gustSpeed)
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Weather::CWindLayer)
|
||||
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Weather::CWindLayer, (
|
||||
attr(o.m_level),
|
||||
attr(o.m_directionMain),
|
||||
attr(o.m_directionFrom),
|
||||
attr(o.m_directionTo),
|
||||
attr(o.m_directionVariable),
|
||||
attr(o.m_speed),
|
||||
attr(o.m_gustSpeed)
|
||||
))
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user