WSL/SLF GitLab Repository

Commit 56e6e3bc authored by Thomas Egger's avatar Thomas Egger
Browse files

Added all functionality supported by the IOInterface abstract super class to IOManager

parent 42d06b33
......@@ -360,6 +360,7 @@ void BufferedIOHandler::readMeteoData(const Date& date_start, const Date& date_e
}
void BufferedIOHandler::bufferAllData(const Date& date_start, const Date& date_end){
vec_buffer_meteo.clear();
iohandler.readMeteoData(date_start, date_end, vec_buffer_meteo);
buffer_start = date_start;
buffer_end = date_end;
......
......@@ -110,23 +110,16 @@ void IOManager::writeMeteoData(const std::vector< std::vector<MeteoData> >& vecM
}
}
void IOManager::interpolate(const Date& date, const MeteoData::Parameters& meteoparam, Grid2DObject& result)
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result)
{
string info_string;
interpolate(date, meteoparam, result, info_string);
interpolate(date, dem, meteoparam, result, info_string);
}
void IOManager::interpolate(const Date& date, const MeteoData::Parameters& meteoparam,
void IOManager::interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result, std::string& info_string)
{
DEMObject dem;
if (processing_level == IOManager::raw){
rawio.readDEM(dem);
} else {
bufferedio.readDEM(dem);
}
vector<MeteoData> vec_meteo;
getMeteoData(date, vec_meteo);
......@@ -134,4 +127,58 @@ void IOManager::interpolate(const Date& date, const MeteoData::Parameters& meteo
mi.interpolate(meteoparam, result, info_string);
}
void IOManager::read2DGrid(Grid2DObject& grid2D, const std::string& filename)
{
if (processing_level == IOManager::raw){
rawio.read2DGrid(grid2D, filename);
} else {
bufferedio.read2DGrid(grid2D, filename);
}
}
void IOManager::readDEM(DEMObject& grid2D)
{
if (processing_level == IOManager::raw){
rawio.readDEM(grid2D);
} else {
bufferedio.readDEM(grid2D);
}
}
void IOManager::readLanduse(Grid2DObject& grid2D)
{
if (processing_level == IOManager::raw){
rawio.readLanduse(grid2D);
} else {
bufferedio.readLanduse(grid2D);
}
}
void IOManager::readAssimilationData(const Date& date, Grid2DObject& grid2D)
{
if (processing_level == IOManager::raw){
rawio.readAssimilationData(date, grid2D);
} else {
bufferedio.readAssimilationData(date, grid2D);
}
}
void IOManager::readSpecialPoints(std::vector<Coords>& cpa)
{
if (processing_level == IOManager::raw){
rawio.readSpecialPoints(cpa);
} else {
bufferedio.readSpecialPoints(cpa);
}
}
void IOManager::write2DGrid(const Grid2DObject& grid2D, const std::string& name)
{
if (processing_level == IOManager::raw){
rawio.write2DGrid(grid2D, name);
} else {
bufferedio.write2DGrid(grid2D, name);
}
}
} //namespace
......@@ -35,6 +35,15 @@ class IOManager {
IOManager(const Config& i_cfg);
//Legacy support to support functionality of the IOInterface superclass:
void read2DGrid(Grid2DObject& grid_out, const std::string& parameter="");
void readDEM(DEMObject& dem_out);
void readAssimilationData(const Date& date_in, Grid2DObject& da_out);
void readLanduse(Grid2DObject& landuse_out);
void readSpecialPoints(std::vector<Coords>& pts);
void write2DGrid(const Grid2DObject& grid_in, const std::string& options="");
//end legacy support
unsigned int getStationData(const Date& date, std::vector<StationData>& vecStation);
//for an intervall of data: decide whether data should be filtered or raw
......@@ -44,10 +53,11 @@ class IOManager {
//data can be raw or processed (filtered, resampled)
unsigned int getMeteoData(const Date& i_date, std::vector<MeteoData>& vecMeteo);
void interpolate(const Date& date, const MeteoData::Parameters& meteoparam,
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result, std::string& info_string);
void interpolate(const Date& date, const MeteoData::Parameters& meteoparam, Grid2DObject& result);
void interpolate(const Date& date, const DEMObject& dem, const MeteoData::Parameters& meteoparam,
Grid2DObject& result);
void setProcessingLevel(const unsigned int& i_level);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment