You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
51 lines
1.1 KiB
2 years ago
|
#pragma once
|
||
2 years ago
|
#include "layereddata.h"
|
||
2 years ago
|
|
||
2 years ago
|
class HYCOMData: public LayeredData
|
||
2 years ago
|
{
|
||
|
enum Type
|
||
|
{
|
||
|
TYPE_UNKNOWN,
|
||
|
TYPE_REANALYSIS,
|
||
|
TYPE_HINDCAST,
|
||
|
TYPE_FORECAST
|
||
|
};
|
||
|
|
||
2 years ago
|
Type type = TYPE_UNKNOWN;
|
||
2 years ago
|
|
||
2 years ago
|
public:
|
||
2 years ago
|
static constexpr const char* name = "HYCOM";
|
||
|
|
||
2 years ago
|
HYCOMData() = default;
|
||
|
|
||
2 years ago
|
MString DataTitle() const
|
||
2 years ago
|
{
|
||
2 years ago
|
switch(type)
|
||
2 years ago
|
{
|
||
2 years ago
|
case(TYPE_REANALYSIS): return "GOFS 3.1: 41-layer HYCOM + NCODA Global 1/12 Reanalysis";
|
||
|
case(TYPE_HINDCAST): return "GOFS 3.1: 41-layer HYCOM + NCODA Global 1/12 Analysis Hindcast";
|
||
|
case(TYPE_FORECAST): return "GOFS 3.1: 41-layer HYCOM + NCODA Global 1/12 Analysis Forecast";
|
||
|
default: return "No title";
|
||
2 years ago
|
}
|
||
|
}
|
||
|
|
||
|
// TODO: RetVal
|
||
|
MString Open(const CLArgs& args)
|
||
|
{
|
||
|
MString dataset = args.contains("dataset") ? args.at("dataset") : "Forecast";
|
||
|
|
||
2 years ago
|
GPL.UsePrefix("HYCOM");
|
||
2 years ago
|
if(dataset == "Forecast")
|
||
|
type = TYPE_FORECAST;
|
||
|
else if(dataset == "Hindcast")
|
||
|
type = TYPE_HINDCAST;
|
||
|
else if(dataset == "Reanalysis")
|
||
|
type = TYPE_REANALYSIS;
|
||
|
else
|
||
|
return "Unknown dataset: " + dataset;
|
||
|
|
||
2 years ago
|
SetTitle(DataTitle());
|
||
2 years ago
|
return LayeredData::Open(dataset);
|
||
2 years ago
|
}
|
||
|
};
|