mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:50:05 +00:00
P-VTEC parsing
This commit is contained in:
parent
e5c40b9eb5
commit
be1d7323bd
10 changed files with 835 additions and 5 deletions
76
wxdata/include/scwx/awips/phenomenon.hpp
Normal file
76
wxdata/include/scwx/awips/phenomenon.hpp
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace awips
|
||||
{
|
||||
|
||||
enum class Phenomenon
|
||||
{
|
||||
AshfallLand,
|
||||
AirStagnation,
|
||||
BeachHazard,
|
||||
BriskWind,
|
||||
Blizzard,
|
||||
CoastalFlood,
|
||||
DebrisFlow,
|
||||
DustStorm,
|
||||
BlowingDust,
|
||||
ExtremeCold,
|
||||
ExcessiveHeat,
|
||||
ExtremeWind,
|
||||
Flood,
|
||||
FlashFlood,
|
||||
DenseFogLand,
|
||||
FloodForecastPoints,
|
||||
Frost,
|
||||
FireWeather,
|
||||
Freeze,
|
||||
Gale,
|
||||
HurricaneForceWind,
|
||||
Heat,
|
||||
Hurricane,
|
||||
HighWind,
|
||||
Hydrologic,
|
||||
HardFreeze,
|
||||
IceStorm,
|
||||
LakeEffectSnow,
|
||||
LowWater,
|
||||
LakeshoreFlood,
|
||||
LakeWind,
|
||||
Marine,
|
||||
DenseFogMarine,
|
||||
AshfallMarine,
|
||||
DenseSmokeMarine,
|
||||
RipCurrentRisk,
|
||||
SmallCraft,
|
||||
HazardousSeas,
|
||||
DenseSmokeLand,
|
||||
Storm,
|
||||
StormSurge,
|
||||
SnowSquall,
|
||||
HighSurf,
|
||||
SevereThunderstorm,
|
||||
Tornado,
|
||||
TropicalStorm,
|
||||
Tsunami,
|
||||
Typhoon,
|
||||
HeavyFreezingSpray,
|
||||
WindChill,
|
||||
Wind,
|
||||
WinterStorm,
|
||||
WinterWeather,
|
||||
FreezingFog,
|
||||
FreezingRain,
|
||||
FreezingSpray,
|
||||
Unknown
|
||||
};
|
||||
|
||||
Phenomenon GetPhenomenon(const std::string& code);
|
||||
std::string GetPhenomenonCode(Phenomenon phenomenon);
|
||||
std::string GetPhenomenonText(Phenomenon phenomenon);
|
||||
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
75
wxdata/include/scwx/awips/pvtec.hpp
Normal file
75
wxdata/include/scwx/awips/pvtec.hpp
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/awips/phenomenon.hpp>
|
||||
#include <scwx/awips/significance.hpp>
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace awips
|
||||
{
|
||||
|
||||
class PVtecImpl;
|
||||
|
||||
class PVtec
|
||||
{
|
||||
public:
|
||||
enum class ProductType
|
||||
{
|
||||
Operational,
|
||||
Test,
|
||||
Experimental,
|
||||
OperationalWithExperimentalVtec,
|
||||
Unknown
|
||||
};
|
||||
|
||||
enum class Action
|
||||
{
|
||||
New,
|
||||
Continued,
|
||||
ExtendedInArea,
|
||||
ExtendedInTime,
|
||||
ExtendedInAreaAndTime,
|
||||
Upgraded,
|
||||
Canceled,
|
||||
Expired,
|
||||
Routine,
|
||||
Correction,
|
||||
Unknown
|
||||
};
|
||||
|
||||
explicit PVtec();
|
||||
~PVtec();
|
||||
|
||||
PVtec(const PVtec&) = delete;
|
||||
PVtec& operator=(const PVtec&) = delete;
|
||||
|
||||
PVtec(PVtec&&) noexcept;
|
||||
PVtec& operator=(PVtec&&) noexcept;
|
||||
|
||||
ProductType fixed_identifier() const;
|
||||
Action action() const;
|
||||
std::string office_id() const;
|
||||
Phenomenon phenomenon() const;
|
||||
Significance significance() const;
|
||||
int16_t event_tracking_number() const;
|
||||
|
||||
std::chrono::system_clock::time_point event_begin() const;
|
||||
std::chrono::system_clock::time_point event_end() const;
|
||||
|
||||
bool Parse(const std::string& s);
|
||||
|
||||
static ProductType GetProductType(const std::string& code);
|
||||
static std::string GetProductTypeCode(ProductType productType);
|
||||
|
||||
static Action GetAction(const std::string& code);
|
||||
static std::string GetActionCode(Action action);
|
||||
|
||||
private:
|
||||
std::unique_ptr<PVtecImpl> p;
|
||||
};
|
||||
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
27
wxdata/include/scwx/awips/significance.hpp
Normal file
27
wxdata/include/scwx/awips/significance.hpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace awips
|
||||
{
|
||||
|
||||
enum class Significance
|
||||
{
|
||||
Warning,
|
||||
Watch,
|
||||
Advisory,
|
||||
Statement,
|
||||
Forecast,
|
||||
Outlook,
|
||||
Synopsis,
|
||||
Unknown
|
||||
};
|
||||
|
||||
Significance GetSignificance(const std::string& code);
|
||||
std::string GetSignificanceCode(Significance significance);
|
||||
std::string GetSignificanceText(Significance significance);
|
||||
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue