Rev 193 | Rev 201 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 193 | Rev 198 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | {
|
8 | {
|
9 | int year; // year |
9 | int year; // year |
10 | int month; // month |
10 | int month; // month |
11 | int day; // day of year |
11 | int day; // day of year |
12 | double temperature; // average day °C |
12 | double temperature; // average day °C |
- | 13 | double temp_delayed; // temperature delayed (after Maekela, 2008) for response calculations |
|
13 | double preciptitation; // sum of day [mm] |
14 | double preciptitation; // sum of day [mm] |
14 | double radiation; // sum of day (MJ/m2) |
15 | double radiation; // sum of day (MJ/m2) |
15 | double vpd; // average of day [kPa] |
16 | double vpd; // average of day [kPa] |
- | 17 | QString date() { return QString("%1.%2.%3").arg(day).arg(month).arg(year); } |
|
16 | }; |
18 | }; |
17 | class Climate
|
19 | class Climate
|
18 | {
|
20 | {
|
19 | public: |
21 | public: |
20 | Climate(); |
22 | Climate(); |
21 | void setup(); ///< setup routine that opens database connection |
23 | void setup(); ///< setup routine that opens database connection |
22 | // activity
|
24 | // activity
|
23 | void nextYear(); |
25 | void nextYear(); |
- | 26 | // access to climate data
|
|
- | 27 | const ClimateDay *dayOfYear(const int dayofyear); ///< get pointer to climate structure by day of year (0-based-index) |
|
- | 28 | const ClimateDay *day(const int month, const int day); ///< gets pointer to climate structure of given day (0-based indices, i.e. month=11=december!) |
|
- | 29 | /// returns two pointer (arguments!!!) to the begin and one after end of the given month (month: 0..11)
|
|
- | 30 | void monthRange(const int month, ClimateDay **rBegin, ClimateDay **rEnd); |
|
- | 31 | int days(const int month); ///< returns number of days of given month |
|
24 | 32 | ||
25 | private: |
33 | private: |
26 | void load(); ///< load mLoadYears years from database |
34 | void load(); ///< load mLoadYears years from database |
- | 35 | void climateCalculations(); ///< more calculations done after loading of climate data |
|
27 | int mLoadYears; // count of years to load ahead |
36 | int mLoadYears; // count of years to load ahead |
28 | int mCurrentYear; // current year (relative) |
37 | int mCurrentYear; // current year (relative) |
29 | int mMinYear; // lowest year in store (relative) |
38 | int mMinYear; // lowest year in store (relative) |
30 | int mMaxYear; // highest year in store (relative) |
39 | int mMaxYear; // highest year in store (relative) |
31 | QVector<ClimateDay> mStore; ///< storage of climate data |
40 | QVector<ClimateDay> mStore; ///< storage of climate data |