mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
@@ -13,8 +13,7 @@
|
||||
#define BLACKCORE_WEATHERDATA_H
|
||||
|
||||
#include "blackcoreexport.h"
|
||||
#include "blackmisc/geo/latitude.h"
|
||||
#include "blackmisc/geo/longitude.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/weather/gridpoint.h"
|
||||
#include "blackmisc/weather/weathergrid.h"
|
||||
#include <QObject>
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Weather
|
||||
{
|
||||
CGridPoint::CGridPoint(const Geo::CLatitude &latitude, const Geo::CLongitude longitude,
|
||||
CGridPoint::CGridPoint(const Geo::CCoordinateGeodetic &position,
|
||||
const CCloudLayerList &cloudLayers,
|
||||
const CTemperatureLayerList &temperatureLayers,
|
||||
const CVisibilityLayerList &visibilityLayers,
|
||||
const CWindLayerList &windLayers) :
|
||||
m_latitude(latitude), m_longitude(longitude), m_cloudLayers(cloudLayers),
|
||||
m_position(position), m_cloudLayers(cloudLayers),
|
||||
m_temperatureLayers(temperatureLayers), m_visibilityLayers(visibilityLayers),
|
||||
m_windLayers(windLayers)
|
||||
{ }
|
||||
@@ -34,10 +34,8 @@ namespace BlackMisc
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexLatitude:
|
||||
return CVariant::fromValue(m_latitude);
|
||||
case IndexLongitude:
|
||||
return CVariant::fromValue(m_longitude);
|
||||
case IndexPosition:
|
||||
return CVariant::fromValue(m_position);
|
||||
case IndexCloudLayers:
|
||||
return CVariant::fromValue(m_cloudLayers);
|
||||
case IndexTemperatureLayers:
|
||||
@@ -55,11 +53,9 @@ namespace BlackMisc
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexLatitude:
|
||||
setLatitude(variant.value<CLatitude>());
|
||||
case IndexPosition:
|
||||
setPosition(variant.value<CCoordinateGeodetic>());
|
||||
break;
|
||||
case IndexLongitude:
|
||||
setLongitude(variant.value<CLongitude>());
|
||||
break;
|
||||
case IndexCloudLayers:
|
||||
setCloudLayers(variant.value<CCloudLayerList>());
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/valueobject.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/geo/latitude.h"
|
||||
#include "blackmisc/geo/longitude.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/weather/cloudlayerlist.h"
|
||||
#include "blackmisc/weather/temperaturelayerlist.h"
|
||||
#include "blackmisc/weather/visibilitylayerlist.h"
|
||||
@@ -35,8 +34,7 @@ namespace BlackMisc
|
||||
//! Properties by index
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexLatitude = BlackMisc::CPropertyIndex::GlobalIndexCGridPoint,
|
||||
IndexLongitude,
|
||||
IndexPosition = BlackMisc::CPropertyIndex::GlobalIndexCGridPoint,
|
||||
IndexCloudLayers,
|
||||
IndexTemperatureLayers,
|
||||
IndexWindLayers
|
||||
@@ -46,23 +44,17 @@ namespace BlackMisc
|
||||
CGridPoint() = default;
|
||||
|
||||
//! Constructor
|
||||
CGridPoint(const Geo::CLatitude &latitude, const Geo::CLongitude longitude,
|
||||
CGridPoint(const Geo::CCoordinateGeodetic &position,
|
||||
const CCloudLayerList &cloudLayers,
|
||||
const CTemperatureLayerList &temperatureLayers,
|
||||
const CVisibilityLayerList &visibilityLayers,
|
||||
const CWindLayerList &windLayers);
|
||||
|
||||
//! Set latitude
|
||||
void setLatitude(const Geo::CLatitude &latitude) { m_latitude = latitude; }
|
||||
//! Set position
|
||||
void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { m_position = position; }
|
||||
|
||||
//! Get latitude
|
||||
Geo::CLatitude getLatitude() const { return m_latitude; }
|
||||
|
||||
//! Set longitude
|
||||
void setLongitude(const Geo::CLongitude &longitude) { m_longitude = longitude; }
|
||||
|
||||
//! Get longitude
|
||||
Geo::CLongitude getLongitude() const { return m_longitude; }
|
||||
//! Get position
|
||||
const BlackMisc::Geo::CCoordinateGeodetic getPosition() const { return m_position; }
|
||||
|
||||
//! Set cloud layers
|
||||
void setCloudLayers(const CCloudLayerList &cloudLayers) { m_cloudLayers = cloudLayers; }
|
||||
@@ -98,8 +90,7 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
private:
|
||||
Geo::CLatitude m_latitude;
|
||||
Geo::CLongitude m_longitude;
|
||||
BlackMisc::Geo::CCoordinateGeodetic m_position;
|
||||
CCloudLayerList m_cloudLayers;
|
||||
CTemperatureLayerList m_temperatureLayers;
|
||||
CVisibilityLayerList m_visibilityLayers;
|
||||
@@ -107,8 +98,7 @@ namespace BlackMisc
|
||||
|
||||
BLACK_METACLASS(
|
||||
CGridPoint,
|
||||
BLACK_METAMEMBER(latitude),
|
||||
BLACK_METAMEMBER(longitude),
|
||||
BLACK_METAMEMBER(position),
|
||||
BLACK_METAMEMBER(cloudLayers),
|
||||
BLACK_METAMEMBER(temperatureLayers),
|
||||
BLACK_METAMEMBER(visibilityLayers),
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackMisc
|
||||
|
||||
static const CGridPoint gridPointGLOB =
|
||||
{
|
||||
{}, {},
|
||||
{},
|
||||
CCloudLayerList { cloudLayer },
|
||||
CTemperatureLayerList { temperatureLayer },
|
||||
CVisibilityLayerList { visibilityLayer } ,
|
||||
@@ -97,7 +97,7 @@ namespace BlackMisc
|
||||
|
||||
static const CGridPoint gridPointGLOB
|
||||
{
|
||||
{}, {},
|
||||
{},
|
||||
CCloudLayerList { cloudLayer1, cloudLayer2 },
|
||||
CTemperatureLayerList { temperatureLayer },
|
||||
CVisibilityLayerList { visibilityLayer },
|
||||
|
||||
@@ -270,7 +270,8 @@ namespace BlackWxPlugin
|
||||
|
||||
CLatitude latitude(gfsGridPoint.latitude, CAngleUnit::deg());
|
||||
CLongitude longitude(gfsGridPoint.longitude, CAngleUnit::deg());
|
||||
BlackMisc::Weather::CGridPoint gridPoint(latitude, longitude, cloudLayers, temperatureLayers, {}, windLayers);
|
||||
auto position = CCoordinateGeodetic { latitude, longitude, {0} };
|
||||
BlackMisc::Weather::CGridPoint gridPoint(position, cloudLayers, temperatureLayers, {}, windLayers);
|
||||
m_weatherGrid.insert(gridPoint);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user