-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWind.h
38 lines (29 loc) · 817 Bytes
/
Wind.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef __WIND_H__
#define __WIND_H__
#include "Now.h"
#include <map>
#include <utility>
#include "Database.h"
#define MAX_WIND_DURATION ( 60 * ONE_MINUTE )
class Wind
{
typedef std::map< time_t, std::pair< double, double> > windDirection_t;
typedef std::map< time_t, double > windSpeed_t;
public:
Wind( Now *now, Database &_db );
~Wind( );
void update( double speed, double direction );
double getAverageSpeed( time_t duration );
int getAverageDirection( time_t duration );
double getMaxSpeed( time_t duration );
int getDirectionAtMaxSpeed( time_t duration );
void dump();
void restore();
private:
windDirection_t windDirection;
windSpeed_t windSpeed;
Now *now;
Debug dbg;
Database db;
};
#endif // __WIND_H__