mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "weathergrid.h"
|
#include "weathergrid.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
@@ -19,5 +20,93 @@ namespace BlackMisc
|
|||||||
CSequence<CGridPoint>(other)
|
CSequence<CGridPoint>(other)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
const CWeatherGrid &CWeatherGrid::getCavokGrid()
|
||||||
|
{
|
||||||
|
static const CVisibilityLayer visibilityLayer(
|
||||||
|
CAltitude(0, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAltitude(2728, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CLength(50, CLengthUnit::mi()));
|
||||||
|
|
||||||
|
static const CTemperatureLayer temperatureLayer(
|
||||||
|
CAltitude(0, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CTemperature(20, CTemperatureUnit::C()),
|
||||||
|
CTemperature(18, CTemperatureUnit::C()),
|
||||||
|
0);
|
||||||
|
|
||||||
|
static const CCloudLayer cloudLayer(
|
||||||
|
CAltitude(0, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAltitude(5000, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
5, CCloudLayer::NoPrecipitation, CCloudLayer::NoClouds,
|
||||||
|
CCloudLayer::None);
|
||||||
|
|
||||||
|
static const CWindLayer windLayer(
|
||||||
|
CAltitude(0, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAngle(0, CAngleUnit::deg()),
|
||||||
|
CSpeed(0, CSpeedUnit::kts()),
|
||||||
|
CSpeed(0, CSpeedUnit::kts()));
|
||||||
|
|
||||||
|
static const CGridPoint gridPointGLOB =
|
||||||
|
{
|
||||||
|
{}, {},
|
||||||
|
CCloudLayerList { cloudLayer },
|
||||||
|
CTemperatureLayerList { temperatureLayer },
|
||||||
|
CVisibilityLayerList { visibilityLayer } ,
|
||||||
|
CWindLayerList { windLayer }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const CWeatherGrid weatherGrid = { gridPointGLOB };
|
||||||
|
return weatherGrid;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CWeatherGrid &CWeatherGrid::getThunderStormGrid()
|
||||||
|
{
|
||||||
|
static const CVisibilityLayer visibilityLayer(
|
||||||
|
CAltitude(0, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAltitude(2728, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CLength(50, CLengthUnit::mi()));
|
||||||
|
|
||||||
|
static const CTemperatureLayer temperatureLayer(
|
||||||
|
CAltitude(0, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CTemperature(20, CTemperatureUnit::C()),
|
||||||
|
CTemperature(18, CTemperatureUnit::C()),
|
||||||
|
0);
|
||||||
|
|
||||||
|
static const CCloudLayer cloudLayer1(
|
||||||
|
CAltitude(630, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAltitude(4630, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
5, CCloudLayer::Rain, CCloudLayer::Thunderstorm,
|
||||||
|
CCloudLayer::Overcast);
|
||||||
|
|
||||||
|
static const CCloudLayer cloudLayer2(
|
||||||
|
CAltitude(10130, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAltitude(11130, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
0, CCloudLayer::NoPrecipitation, CCloudLayer::Cirrus,
|
||||||
|
CCloudLayer::Scattered);
|
||||||
|
|
||||||
|
static const CWindLayer windLayer1(
|
||||||
|
CAltitude(1110, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAngle(325.6, CAngleUnit::deg()),
|
||||||
|
CSpeed(18, CSpeedUnit::kts()),
|
||||||
|
CSpeed(0, CSpeedUnit::kts()));
|
||||||
|
|
||||||
|
static const CWindLayer windLayer2(
|
||||||
|
CAltitude(1130, CAltitude::MeanSeaLevel, CLengthUnit::m()),
|
||||||
|
CAngle(334.8, CAngleUnit::deg()),
|
||||||
|
CSpeed(21, CSpeedUnit::kts()),
|
||||||
|
CSpeed(8, CSpeedUnit::kts()));
|
||||||
|
|
||||||
|
static const CGridPoint gridPointGLOB
|
||||||
|
{
|
||||||
|
{}, {},
|
||||||
|
CCloudLayerList { cloudLayer1, cloudLayer2 },
|
||||||
|
CTemperatureLayerList { temperatureLayer },
|
||||||
|
CVisibilityLayerList { visibilityLayer },
|
||||||
|
CWindLayerList { windLayer1, windLayer2 }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const CWeatherGrid weatherGrid({ gridPointGLOB });
|
||||||
|
return weatherGrid;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ namespace BlackMisc
|
|||||||
|
|
||||||
//! Construct from a base class object.
|
//! Construct from a base class object.
|
||||||
CWeatherGrid(const CSequence<CGridPoint> &other);
|
CWeatherGrid(const CSequence<CGridPoint> &other);
|
||||||
|
|
||||||
|
//! CAVOK grid
|
||||||
|
static const BlackMisc::Weather::CWeatherGrid &getCavokGrid();
|
||||||
|
|
||||||
|
//! Thunderstorm grid
|
||||||
|
static const BlackMisc::Weather::CWeatherGrid &getThunderStormGrid();
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace
|
} //namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user