WSL/SLF GitLab Repository
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
e5b18035
Commit
e5b18035
authored
Mar 10, 2011
by
Mathias Bavay
Browse files
More fixes for Visual C++. It could now work!
parent
b4833e45
Changes
8
Hide whitespace changes
Inline
Side-by-side
meteoio/Date.cc
View file @
e5b18035
...
...
@@ -155,32 +155,32 @@ void Date::setTimeZone(const double& in_timezone, const bool& in_dst) {
/**
* @brief Set date by elements.
* All values are checked for plausibility.
* @param _year in 4 digits
* @param _month please keep in mind that first month of the year is 1 (ie: not 0!)
* @param _day please keep in mind that first day of the month is 1 (ie: not 0!)
* @param _hour
* @param _minute
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param
i
_year in 4 digits
* @param
i
_month please keep in mind that first month of the year is 1 (ie: not 0!)
* @param
i
_day please keep in mind that first day of the month is 1 (ie: not 0!)
* @param
i
_hour
* @param
i
_minute
* @param
i
_timezone timezone as an offset to GMT (in hours, optional)
* @param
i
_dst is it DST? (default: no)
*/
void
Date
::
setDate
(
const
int
&
_year
,
const
int
&
_month
,
const
int
&
_day
,
const
int
&
_hour
,
const
int
&
_minute
,
const
double
&
_timezone
,
const
bool
&
_dst
)
void
Date
::
setDate
(
const
int
&
i
_year
,
const
int
&
i
_month
,
const
int
&
i
_day
,
const
int
&
i
_hour
,
const
int
&
i
_minute
,
const
double
&
i
_timezone
,
const
bool
&
i
_dst
)
{
plausibilityCheck
(
_year
,
_month
,
_day
,
_hour
,
_minute
);
plausibilityCheck
(
i
_year
,
i
_month
,
i
_day
,
i
_hour
,
i
_minute
);
undef
=
false
;
setTimeZone
(
_timezone
,
_dst
);
setTimeZone
(
i
_timezone
,
i
_dst
);
if
(
timezone
==
0
&&
dst
==
false
)
{
//data is GMT and no DST
//setting values and computing GMT julian date
gmt_year
=
_year
;
gmt_month
=
_month
;
gmt_day
=
_day
;
gmt_hour
=
_hour
;
gmt_minute
=
_minute
;
gmt_year
=
i
_year
;
gmt_month
=
i
_month
;
gmt_day
=
i
_day
;
gmt_hour
=
i
_hour
;
gmt_minute
=
i
_minute
;
gmt_julian
=
calculateJulianDate
(
gmt_year
,
gmt_month
,
gmt_day
,
gmt_hour
,
gmt_minute
);
}
else
{
//computing local julian date
const
double
local_julian
=
calculateJulianDate
(
_year
,
_month
,
_day
,
_hour
,
_minute
);
const
double
local_julian
=
calculateJulianDate
(
i
_year
,
i
_month
,
i
_day
,
i
_hour
,
i
_minute
);
//converting local julian date to GMT julian date
gmt_julian
=
localToGMT
(
local_julian
);
//updating values to GMT
...
...
@@ -219,12 +219,12 @@ void Date::setDate(const time_t& _time, const bool& _dst) {
/**
* @brief Set date from a modified julian date (MJD).
* @param julian_in julian date to set
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param
i
_timezone timezone as an offset to GMT (in hours, optional)
* @param
i
_dst is it DST? (default: no)
*/
void
Date
::
setModifiedJulianDate
(
const
double
&
julian_in
,
const
double
&
_timezone
,
const
bool
&
_dst
)
{
const
double
_julian
=
julian_in
+
MJD_offset
;
setDate
(
_julian
,
_timezone
,
_dst
);
void
Date
::
setModifiedJulianDate
(
const
double
&
julian_in
,
const
double
&
i
_timezone
,
const
bool
&
i
_dst
)
{
const
double
tmp
_julian
=
julian_in
+
MJD_offset
;
setDate
(
tmp
_julian
,
i
_timezone
,
i
_dst
);
}
/**
...
...
@@ -240,25 +240,25 @@ void Date::setUnixDate(const time_t& in_time, const bool& in_dst) {
/**
* @brief Set date from an Excel date.
* @param excel_in Excel date to set
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param
i
_timezone timezone as an offset to GMT (in hours, optional)
* @param
i
_dst is it DST? (default: no)
*/
void
Date
::
setExcelDate
(
const
double
excel_in
,
const
double
&
_timezone
,
const
bool
&
_dst
)
{
void
Date
::
setExcelDate
(
const
double
excel_in
,
const
double
&
i
_timezone
,
const
bool
&
i
_dst
)
{
//TODO: handle date < 1900-01-00 and date before 1900-03-01
//see http://www.mathworks.com/help/toolbox/finance/x2mdate.html
const
double
_julian
=
excel_in
+
Excel_offset
;
setDate
(
_julian
,
_timezone
,
_dst
);
const
double
tmp
_julian
=
excel_in
+
Excel_offset
;
setDate
(
tmp
_julian
,
i
_timezone
,
i
_dst
);
}
/**
* @brief Set date from an Matlab date.
* @param matlab_in Matlab date to set
* @param _timezone timezone as an offset to GMT (in hours, optional)
* @param _dst is it DST? (default: no)
* @param
i
_timezone timezone as an offset to GMT (in hours, optional)
* @param
i
_dst is it DST? (default: no)
*/
void
Date
::
setMatlabDate
(
const
double
matlab_in
,
const
double
&
_timezone
,
const
bool
&
_dst
)
{
const
double
_julian
=
matlab_in
+
Matlab_offset
;
setDate
(
_julian
,
_timezone
,
_dst
);
void
Date
::
setMatlabDate
(
const
double
matlab_in
,
const
double
&
i
_timezone
,
const
bool
&
i
_dst
)
{
const
double
tmp
_julian
=
matlab_in
+
Matlab_offset
;
setDate
(
tmp
_julian
,
i
_timezone
,
i
_dst
);
}
...
...
meteoio/IOHandler.cc
View file @
e5b18035
...
...
@@ -120,7 +120,7 @@ IOHandler::~IOHandler(){
IOHandler
::~
IOHandler
()
throw
(){
#endif
// Get rid of the objects
std
::
map
<
std
::
string
,
IOPlugin
::
IOPlugin
>::
iterator
mapit
;
std
::
map
<
std
::
string
,
IOPlugin
>::
iterator
mapit
;
for
(
mapit
=
mapPlugins
.
begin
();
mapit
!=
mapPlugins
.
end
();
mapit
++
){
deletePlugin
((
mapit
->
second
).
dynLibrary
,
(
mapit
->
second
).
io
);
}
...
...
@@ -183,7 +183,7 @@ IOInterface* IOHandler::getPlugin(const std::string& cfgkey, const std::string&
std
::
string
op_src
=
""
;
cfg
.
getValue
(
cfgkey
,
cfgsection
,
op_src
);
std
::
map
<
std
::
string
,
IOPlugin
::
IOPlugin
>::
iterator
mapit
=
mapPlugins
.
find
(
op_src
);
std
::
map
<
std
::
string
,
IOPlugin
>::
iterator
mapit
=
mapPlugins
.
find
(
op_src
);
if
(
mapit
==
mapPlugins
.
end
())
throw
IOException
(
"Can not find plugin "
+
op_src
+
" as requested in file "
+
cfg
.
getSourceName
()
+
". Has its developer declared it in IOHandler::registerPlugins?"
,
AT
);
...
...
@@ -300,7 +300,7 @@ std::string IOHandler::toString() const
os
<<
"<mapPlugins>
\n
"
;
os
<<
setw
(
10
)
<<
"Keyword"
<<
" = "
<<
IOPlugin
::
header
<<
"
\n
"
;
std
::
map
<
std
::
string
,
IOPlugin
::
IOPlugin
>::
const_iterator
it1
;
std
::
map
<
std
::
string
,
IOPlugin
>::
const_iterator
it1
;
for
(
it1
=
mapPlugins
.
begin
();
it1
!=
mapPlugins
.
end
();
it1
++
){
os
<<
setw
(
10
)
<<
it1
->
first
<<
" = "
<<
it1
->
second
;
}
...
...
meteoio/IOHandler.h
View file @
e5b18035
...
...
@@ -75,7 +75,7 @@ class IOHandler : public IOInterface {
IOInterface
*
getPlugin
(
const
std
::
string
&
cfgkey
,
const
std
::
string
&
cfgsection
=
"GENERAL"
);
Config
cfg
;
std
::
map
<
std
::
string
,
IOPlugin
::
IOPlugin
>
mapPlugins
;
std
::
map
<
std
::
string
,
IOPlugin
>
mapPlugins
;
A3DIO
fileio
;
};
...
...
meteoio/IOHandler.ph
View file @
e5b18035
...
...
@@ -31,7 +31,7 @@ using namespace mio; //HACK for POPC
namespace mio {
typedef std::map<std::string,
IOPlugin::
IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
typedef std::map<std::string, IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
//This one line above does absolutely nothing, but if removed, popc does not compile the file....
/**
...
...
@@ -76,7 +76,7 @@ parclass IOHandler {
IOInterface *getPlugin(const std::string& cfgkey, const std::string& cfgsection="GENERAL");
Config cfg;
std::map<std::string,
IOPlugin::
IOPlugin> mapPlugins;
std::map<std::string, IOPlugin> mapPlugins;
A3DIO fileio;
};
...
...
meteoio/IOManager.ph
View file @
e5b18035
...
...
@@ -28,7 +28,7 @@ using namespace mio; //HACK for POPC
namespace mio {
typedef std::map<std::string,
IOPlugin::
IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
typedef std::map<std::string, IOPlugin>::iterator PLUGIN_ITERATOR; //HACK for POPC
//This one line above does absolutely nothing, but if removed, popc does not compile the file....
...
...
meteoio/IOUtils.cc
View file @
e5b18035
...
...
@@ -159,8 +159,7 @@ bool IOUtils::validFileName(const std::string& filename)
#ifdef _WIN32
bool
IOUtils
::
fileExists
(
const
std
::
string
&
filename
)
{
CString
CSfilename
(
filename
.
c_str
());
return
(
GetFileAttributes
(
CSfilename
)
!=
INVALID_FILE_ATTRIBUTES
);
return
(
GetFileAttributes
(
filename
)
!=
INVALID_FILE_ATTRIBUTES
);
}
void
IOUtils
::
readDirectory
(
const
std
::
string
&
path
,
std
::
list
<
std
::
string
>&
dirlist
,
const
std
::
string
&
pattern
)
...
...
@@ -174,7 +173,7 @@ void IOUtils::readDirectory(const std::string& path, std::list<std::string>& dir
throw
FileAccessException
(
"Error opening directory "
+
path
,
AT
);
}
hFind
=
FindFirstFile
(
(
LPCSTR
)(
path
+
"
\\
"
+
pattern
)
,
&
ffd
);
hFind
=
FindFirstFile
(
path
+
"
\\
"
+
pattern
,
&
ffd
);
if
(
INVALID_HANDLE_VALUE
==
hFind
)
{
throw
FileAccessException
(
"Error opening directory "
+
path
,
AT
);
}
...
...
meteoio/libfit1D.h
View file @
e5b18035
...
...
@@ -81,7 +81,7 @@ class Fit1D {
const
std
::
vector
<
double
>&
Y
;
//Y of input data set to fit
std
::
vector
<
double
>
Lambda
;
//parameters of the fit
std
::
map
<
std
::
string
,
RegModel
::
RegModel
>
mapRegs
;
std
::
map
<
std
::
string
,
RegModel
>
mapRegs
;
void
registerRegressions
();
void
initLambda
();
...
...
meteoio/meteofilters/ProcessingBlock.h
View file @
e5b18035
...
...
@@ -60,10 +60,10 @@ class ProcessingBlock {
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ProcessingBlock
&
data
);
protected:
std
::
string
block_name
;
ProcessingBlock
(
const
std
::
string
&
name
);
///< protected constructor only to be called by children
ProcessingProperties
properties
;
std
::
string
block_name
;
};
class
BlockFactory
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment