#include <string>
#include <vector>
-#include <time.h>
-struct Data {
- public:
- virtual ~Data();
- struct tm *date_time;
- std::vector<double> data_list;
-};
+#include "Data.hh"
+#include "Date.hh"
+#include "DeviceConfig.hh"
-struct DataRange {
- public:
- virtual ~DataRange();
- Data *first_data;
- Data *last_data;
-};
+#include <time.h>
namespace w1 {
class W1DataList {
W1DataList(std::string device_id);
virtual ~W1DataList();
DataRange *get_data_range();
+ /**
+ * Get summary data calculated from the daily data items that is meaning full.
+ * Depending from the device type, it may be daily mean value, daily delta, highest value, etc...
+ */
+ Data *get_daily_summary(plp::Date *date);
+ DataRange *get_daily_summary(plp::Date *start_date, plp::Date *end_date);
+ DataRange *get_data(plp::Date *start_date, plp::Date *end_date);
protected:
- std::string device_id;
- std::string device_dir;
- Data *find_first_data(std::vector<std::string> year_vector);
- Data *find_last_data(std::vector<std::string> year_vector);
-
+ std::string device_id;
+ std::string device_dir;
+ std::string device_ch_dir;
+ w1::DeviceConfig *device_config;
+ enum_summary_calculation summary_calc_type;
+ Data *find_oldest_data(std::vector<std::string> year_vector);
+ Data *find_newest_data(std::vector<std::string> year_vector);
};
}