forked from rszimm/sprinklers_pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logging.h
32 lines (27 loc) · 769 Bytes
/
Logging.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
// Logging.h
// This manages the Logging to SQL for the Sprinkling System.
// Author: Richard Zimmerman
// Copyright (c) 2013 Richard Zimmerman
//
#ifndef LOGGING_H_
#define LOGGING_H_
#include "port.h"
class sqlite3;
class Logging
{
public:
enum GROUPING {NONE, HOURLY, DAILY, MONTHLY};
Logging();
~Logging();
bool Init();
void Close();
// Log an actual row to the database
bool LogZoneEvent(time_t start, int zone, int duration, int schedule, int sadj, int wunderground);
// Retrieve data sutible for graphing
bool GraphZone(FILE * stream_file, time_t start, time_t end, GROUPING group);
// Retrieve data suitble for putting into a table
bool TableZone(FILE* stream_file, time_t start, time_t end);
private:
sqlite3 *m_db;
};
#endif /* LOGGING_H_ */