4 * Created on: Nov 7, 2010
16 #include "DeviceConfig.hh"
22 * DataReader is able to read old data from the device.
26 DataReader(std::string device_id);
27 virtual ~DataReader();
28 DataRange *get_data_range();
30 * Get monthly summary data.
31 * Depending from the device type, it may be daily mean value, daily delta, highest value, etc...
33 DataRange *get_yearly_summary(Date *date, EnumSummaryCalculationType calc_type);
34 DataRange *get_yearly_summary(Date *date);
35 DataRange *get_yearly_summary(Date *start_date, Date *end_date);
37 * Get monthly summary data.
38 * Depending from the device type, it may be daily mean value, daily delta, highest value, etc...
40 DataRange *get_monthly_summary(Date *date, EnumSummaryCalculationType calc_type);
41 DataRange *get_monthly_summary(Date *date);
42 DataRange *get_monthly_summary(Date *start_date, Date *end_date);
45 * Get daily summary data calculated from the daily data items.
46 * Depending from the device type, it may be daily mean value, daily delta, highest value, etc...
49 * Get Daily summary from the latest date
51 DataRange *get_daily_summary();
53 * Get Daily summary specified by the calc_type from the latest date.
55 DataRange *get_daily_summary(EnumSummaryCalculationType calc_type);
56 DataRange *get_daily_summary(Date *date, EnumSummaryCalculationType calc_type);
57 DataRange *get_daily_summary(Date *date);
58 DataRange *get_daily_summary(Date *start_date, Date *end_date);
60 DataRange *get_hourly_summary(Date *date, EnumSummaryCalculationType calc_type);
61 DataRange *get_hourly_summary(Date *date);
62 DataRange *get_hourly_summary(Date *start_date, Date *end_date);
64 DataRange *get_data(Date *start_date, Date *end_date);
65 std::string get_device_id();
66 bool get_device_type(std::string& type_param);
67 Data *get_latest_data();
69 std::string device_id;
70 std::string device_dir;
71 std::string device_ch_dir;
72 DeviceConfig *device_config;
73 EnumSummaryCalculationType summary_calc_type;
74 Data *find_oldest_data(std::vector<std::string> year_vector);
75 Data *find_latest_data(std::vector<std::string> year_vector);
76 DataRange *get_summary(Date *date_param,
77 EnumSummaryCalculationType calc_type_param,
78 EnumSummaryPeriod period_type_param);
82 #endif /* DATAREADER_H_ */