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.
 
 
 

50 lines
1.1 KiB

#pragma once
#include "layereddata.h"
class HYCOMData: public LayeredData
{
enum Type
{
TYPE_UNKNOWN,
TYPE_REANALYSIS,
TYPE_HINDCAST,
TYPE_FORECAST
};
Type type = TYPE_UNKNOWN;
public:
static constexpr const char* name = "HYCOM";
HYCOMData() = default;
MString DataTitle() const
{
switch(type)
{
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";
}
}
// TODO: RetVal
MString Open(const CLArgs& args)
{
MString dataset = args.contains("dataset") ? args.at("dataset") : "Forecast";
GPL.UsePrefix("HYCOM");
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;
SetTitle(DataTitle());
return LayeredData::Open(dataset);
}
};