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.

99 lines
3.0 KiB

#pragma once
#include "layereddataz.h"
3 years ago
class NEMOData: public LayeredDataZ
3 years ago
{
3 years ago
enum Type
{
TYPE_UNKNOWN,
TYPE_DT,
TYPE_DT1,
3 years ago
TYPE_NRT,
TYPE_NRT6,
TYPE_BALTICDT,
TYPE_BALTICNRT,
TYPE_BALTICNRT1,
TYPE_BLKSEADT,
TYPE_BLKSEANRT,
TYPE_MEDSEADT,
TYPE_MEDSEANRT,
TYPE_BISCDT,
TYPE_BISCNRT,
TYPE_ENWSDT,
TYPE_ENWSNRT
3 years ago
};
Type type = TYPE_UNKNOWN;
3 years ago
public:
static constexpr const char* name = "NEMO";
NEMOData() = default;
MString DataTitle() const
3 years ago
{
switch(type)
3 years ago
{
case(TYPE_DT): return "NEMO Delayed time, daily mean (DT)";
case(TYPE_DT1): return "NEMO Delayed time, daily mean, part 2 (DT1)";
case(TYPE_NRT): return "NEMO Near-real time, daily mean (NRT)";
case(TYPE_NRT6): return "NEMO Near-real time, 6h resolution (NRT6)";
case(TYPE_BALTICDT): return "NEMO Delayed time, Baltic region, daily mean (BALTICDT)";
case(TYPE_BALTICNRT): return "NEMO Near-real time, Baltic region, daily mean (BALTICNRT)";
case(TYPE_BALTICNRT1): return "NEMO Near-real time, Baltic region, 1h resolution (BALTICNRT1)";
case(TYPE_BLKSEADT): return "NEMO Delayed time, Black Sea region, daily mean (BLKSEADT)";
case(TYPE_BLKSEANRT): return "NEMO Near-real time time, Black Sea region, daily mean (BLKSEANRT)";
case(TYPE_MEDSEADT): return "NEMO Delayed time, Mediterranean Sea region, daily mean (MEDSEADT)";
case(TYPE_MEDSEANRT): return "NEMO Near-real time, Mediterranean Sea region, daily mean (MEDSEANRT)";
case(TYPE_BISCDT): return "NEMO Delayed time, Atlantic-Iberian Biscay Irish region, daily mean (BISCDT)";
case(TYPE_BISCNRT): return "NEMO Near-real time, Atlantic-Iberian Biscay Irish region, daily mean (BISCNRT)";
case(TYPE_ENWSDT): return "NEMO Delayed time, Atlantic - European North West Shelf region, daily mean (ENWSDT)";
case(TYPE_ENWSNRT): return "NEMO Near-real time, Atlantic - European North West Shelf region, daily mean (ENWSNRT)";
default: return "No title";
3 years ago
}
}
// TODO: RetVal
MString Open(const CLArgs& args)
3 years ago
{
MString dataset = args.contains("dataset") ? args.at("dataset") : "DT";
GPL.UsePrefix("NEMO");
if(dataset == "DT")
3 years ago
type = TYPE_DT;
else if(dataset == "DT1")
type = TYPE_DT1;
else if(dataset == "NRT")
type = TYPE_NRT;
else if(dataset == "NRT6")
type = TYPE_NRT6;
else if(dataset == "BALTICDT")
type = TYPE_BALTICDT;
else if(dataset == "BALTICNRT")
type = TYPE_BALTICNRT;
else if(dataset == "BALTICNRT1")
type = TYPE_BALTICNRT1;
else if(dataset == "BLKSEADT")
type = TYPE_BLKSEADT;
else if(dataset == "BLKSEANRT")
type = TYPE_BLKSEANRT;
else if(dataset == "MEDSEADT")
type = TYPE_MEDSEADT;
else if(dataset == "MEDSEANRT")
type = TYPE_MEDSEANRT;
else if(dataset == "BISCDT")
type = TYPE_BISCDT;
else if(dataset == "BISCNRT")
type = TYPE_BISCNRT;
else if(dataset == "ENWSDT")
type = TYPE_ENWSDT;
else if(dataset == "ENWSNRT")
type = TYPE_ENWSNRT;
else
return "Unknown dataset: " + dataset;
SetTitle(DataTitle());
return LayeredDataZ::Open(dataset);
3 years ago
}
};