mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
@@ -19,13 +19,23 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
namespace Weather
|
namespace Weather
|
||||||
{
|
{
|
||||||
CGridPoint::CGridPoint(const Geo::CCoordinateGeodetic &position,
|
CGridPoint::CGridPoint(const QString &identifier,
|
||||||
|
const Geo::CCoordinateGeodetic &position) :
|
||||||
|
m_identifier(identifier),
|
||||||
|
m_position(position)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
CGridPoint::CGridPoint(const QString &identifier,
|
||||||
|
const Geo::CCoordinateGeodetic &position,
|
||||||
const CCloudLayerList &cloudLayers,
|
const CCloudLayerList &cloudLayers,
|
||||||
const CTemperatureLayerList &temperatureLayers,
|
const CTemperatureLayerList &temperatureLayers,
|
||||||
const CVisibilityLayerList &visibilityLayers,
|
const CVisibilityLayerList &visibilityLayers,
|
||||||
const CWindLayerList &windLayers) :
|
const CWindLayerList &windLayers) :
|
||||||
m_position(position), m_cloudLayers(cloudLayers),
|
m_identifier(identifier),
|
||||||
m_temperatureLayers(temperatureLayers), m_visibilityLayers(visibilityLayers),
|
m_position(position),
|
||||||
|
m_cloudLayers(cloudLayers),
|
||||||
|
m_temperatureLayers(temperatureLayers),
|
||||||
|
m_visibilityLayers(visibilityLayers),
|
||||||
m_windLayers(windLayers)
|
m_windLayers(windLayers)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@@ -43,6 +53,8 @@ namespace BlackMisc
|
|||||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
|
case IndexIdentifier:
|
||||||
|
return CVariant::fromValue(m_identifier);
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
return CVariant::fromValue(m_position);
|
return CVariant::fromValue(m_position);
|
||||||
case IndexCloudLayers:
|
case IndexCloudLayers:
|
||||||
@@ -62,6 +74,9 @@ namespace BlackMisc
|
|||||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
|
case IndexIdentifier:
|
||||||
|
setIdentifier(variant.value<QString>());
|
||||||
|
break;
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
setPosition(variant.value<CCoordinateGeodetic>());
|
setPosition(variant.value<CCoordinateGeodetic>());
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ namespace BlackMisc
|
|||||||
//! Properties by index
|
//! Properties by index
|
||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexPosition = BlackMisc::CPropertyIndex::GlobalIndexCGridPoint,
|
IndexIdentifier = BlackMisc::CPropertyIndex::GlobalIndexCGridPoint,
|
||||||
|
IndexPosition,
|
||||||
IndexCloudLayers,
|
IndexCloudLayers,
|
||||||
IndexTemperatureLayers,
|
IndexTemperatureLayers,
|
||||||
IndexWindLayers
|
IndexWindLayers
|
||||||
@@ -44,12 +45,23 @@ namespace BlackMisc
|
|||||||
CGridPoint() = default;
|
CGridPoint() = default;
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CGridPoint(const Geo::CCoordinateGeodetic &position,
|
CGridPoint(const QString &identifier,
|
||||||
|
const Geo::CCoordinateGeodetic &position);
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
CGridPoint(const QString &identifier,
|
||||||
|
const Geo::CCoordinateGeodetic &position,
|
||||||
const CCloudLayerList &cloudLayers,
|
const CCloudLayerList &cloudLayers,
|
||||||
const CTemperatureLayerList &temperatureLayers,
|
const CTemperatureLayerList &temperatureLayers,
|
||||||
const CVisibilityLayerList &visibilityLayers,
|
const CVisibilityLayerList &visibilityLayers,
|
||||||
const CWindLayerList &windLayers);
|
const CWindLayerList &windLayers);
|
||||||
|
|
||||||
|
//! Set identifier
|
||||||
|
void setIdentifier(const QString &identifier) { m_identifier = identifier; }
|
||||||
|
|
||||||
|
//! Get identifier
|
||||||
|
QString getIdentifier() const { return m_identifier; }
|
||||||
|
|
||||||
//! Set position
|
//! Set position
|
||||||
void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { m_position = position; }
|
void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { m_position = position; }
|
||||||
|
|
||||||
@@ -93,6 +105,8 @@ namespace BlackMisc
|
|||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Identifier is intentionally string based. MSFS uses ICAO but others don't.
|
||||||
|
QString m_identifier;
|
||||||
BlackMisc::Geo::CCoordinateGeodetic m_position;
|
BlackMisc::Geo::CCoordinateGeodetic m_position;
|
||||||
CCloudLayerList m_cloudLayers;
|
CCloudLayerList m_cloudLayers;
|
||||||
CTemperatureLayerList m_temperatureLayers;
|
CTemperatureLayerList m_temperatureLayers;
|
||||||
@@ -101,6 +115,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
CGridPoint,
|
CGridPoint,
|
||||||
|
BLACK_METAMEMBER(identifier),
|
||||||
BLACK_METAMEMBER(position),
|
BLACK_METAMEMBER(position),
|
||||||
BLACK_METAMEMBER(cloudLayers),
|
BLACK_METAMEMBER(cloudLayers),
|
||||||
BLACK_METAMEMBER(temperatureLayers),
|
BLACK_METAMEMBER(temperatureLayers),
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
static const CGridPoint gridPointGLOB =
|
static const CGridPoint gridPointGLOB =
|
||||||
{
|
{
|
||||||
|
"GLOB",
|
||||||
{},
|
{},
|
||||||
CCloudLayerList { cloudLayer },
|
CCloudLayerList { cloudLayer },
|
||||||
CTemperatureLayerList { temperatureLayer },
|
CTemperatureLayerList { temperatureLayer },
|
||||||
@@ -97,6 +98,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
static const CGridPoint gridPointGLOB
|
static const CGridPoint gridPointGLOB
|
||||||
{
|
{
|
||||||
|
"GLOB",
|
||||||
{},
|
{},
|
||||||
CCloudLayerList { cloudLayer1, cloudLayer2 },
|
CCloudLayerList { cloudLayer1, cloudLayer2 },
|
||||||
CTemperatureLayerList { temperatureLayer },
|
CTemperatureLayerList { temperatureLayer },
|
||||||
|
|||||||
Reference in New Issue
Block a user