WSL/SLF GitLab Repository

Commit 72822861 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Another (small) fix for Windows compilation (changing a #ifdef to be MS VC++ specific).

The TIME_ZONE keys are now used by ALL plugins (I thought I already did it...)
parent 7fdab238
......@@ -20,7 +20,7 @@
using namespace std;
#ifdef MSVC
#ifdef _MSC_VER
//This is C99, Microsoft should move on and suppport it, it is almost 15 years old!!
double round(const double& x) {
//middle value point test
......
......@@ -54,21 +54,21 @@ BormaIO::BormaIO(void (*delObj)(void*), const Config& i_cfg) : IOInterface(delOb
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = default_tz;
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
}
BormaIO::BormaIO(const std::string& configfile) : IOInterface(NULL), cfg(configfile)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = default_tz;
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
}
BormaIO::BormaIO(const Config& cfgreader) : IOInterface(NULL), cfg(cfgreader)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = default_tz;
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
}
BormaIO::~BormaIO() throw()
......
......@@ -48,22 +48,22 @@ const double GeotopIO::plugin_nodata = -9999.0; //plugin specific nodata value
GeotopIO::GeotopIO(void (*delObj)(void*), const Config& i_cfg) : IOInterface(delObj), cfg(i_cfg)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TZ","Output",out_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_tz,Config::nothrow);
}
GeotopIO::GeotopIO(const std::string& configfile) : IOInterface(NULL), cfg(configfile)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TZ","Output",out_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_tz,Config::nothrow);
}
GeotopIO::GeotopIO(const Config& cfgreader) : IOInterface(NULL), cfg(cfgreader)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TZ","Output",out_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_tz,Config::nothrow);
}
GeotopIO::~GeotopIO() throw()
......
......@@ -241,8 +241,8 @@ void SMETIO::parseInputOutputSection()
{
//default timezones
in_dflt_TZ = out_dflt_TZ = IOUtils::nodata;
cfg.getValue("TZ","Input",in_dflt_TZ,Config::nothrow);
cfg.getValue("TZ","Output",out_dflt_TZ,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_dflt_TZ,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_dflt_TZ,Config::nothrow);
// Parse the [Input] and [Output] sections within Config object cfg
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
......@@ -554,6 +554,7 @@ void SMETIO::readHeader(const char& eoln, const std::string& filename, bool& loc
}
//Now extract info from mapHeader
IOUtils::getValueForKey(mapHeader, "nodata", plugin_nodata);
IOUtils::getValueForKey(mapHeader, "station_id", sd.stationID);
IOUtils::getValueForKey(mapHeader, "station_name", sd.stationName, IOUtils::nothrow);
timezone = in_dflt_TZ;
......
......@@ -100,6 +100,7 @@ class SMETIO : public IOInterface {
std::string outpath; //read from the Config [Output] section
bool outputIsAscii, outputIsGzipped;//read from the Config [Output] section
double in_dflt_TZ, out_dflt_TZ; //default time zones
double plugin_nodata;
Config cfg;
std::ifstream fin; //Input file streams
......
......@@ -58,24 +58,24 @@ SNIO::SNIO(void (*delObj)(void*), const Config& i_cfg) : IOInterface(delObj), cf
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = out_tz = 0.;
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TZ","Output",out_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_tz,Config::nothrow);
}
SNIO::SNIO(const std::string& configfile) : IOInterface(NULL), cfg(configfile)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = out_tz = 0.;
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TZ","Output",out_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_tz,Config::nothrow);
}
SNIO::SNIO(const Config& cfgreader) : IOInterface(NULL), cfg(cfgreader)
{
IOUtils::getProjectionParameters(cfg, coordin, coordinparam, coordout, coordoutparam);
in_tz = out_tz = 0.;
cfg.getValue("TZ","Input",in_tz,Config::nothrow);
cfg.getValue("TZ","Output",out_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Input",in_tz,Config::nothrow);
cfg.getValue("TIME_ZONE","Output",out_tz,Config::nothrow);
}
SNIO::~SNIO() throw()
......
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