HomeWaterLeaksDetection
Consumption.h
Go to the documentation of this file.
1 #ifndef UNTITLED_CONSUMPTION_COUNTER_H
2 #define UNTITLED_CONSUMPTION_COUNTER_H
3 
4 #include "Arduino.h"
5 #include "DateTime.h"
6 #include "PulseCounter.h"
7 
8 //================Consumption class======================
9 
13 class Consumption {
14 
15 //====================public data=======================
16 public:
19  enum Type {
20  DAY,
21  WEEK,
22  MONTH
23  };
24 
25 //====================private data======================
26 private:
28  RTCDateTime initialDateTime;
29  int count;
31 
32 //==================public methods======================
33 public:
38 
45  void update();
46 
49  int getConsumptionCount() const;
50 };
51 
52 #endif
Consumption::pulseCounter
PulseCounter * pulseCounter
instance of PulseCounter (input [l])
Definition: Consumption.h:27
DateTime.h
Consumption::MONTH
@ MONTH
monthly water consumption
Definition: Consumption.h:22
Consumption::Type
Type
Type of the monitoring period.
Definition: Consumption.h:19
Consumption::getConsumptionCount
int getConsumptionCount() const
Returns the current number of pulses detected so far within the monitoring period.
Definition: Consumption.cpp:44
Consumption::type
Type type
type of the monitoring period
Definition: Consumption.h:30
Consumption::initialDateTime
RTCDateTime initialDateTime
instance of RTCDateTime (real-time module)
Definition: Consumption.h:28
Consumption::update
void update()
Updates the variables.
Definition: Consumption.cpp:11
Consumption
Definition: Consumption.h:13
PulseCounter
Definition: PulseCounter.h:29
PulseCounter.h
Consumption::WEEK
@ WEEK
weekly water consumption
Definition: Consumption.h:21
Consumption::Consumption
Consumption(PulseCounter *pulseCounter, Type type)
Constructor of the class.
Definition: Consumption.cpp:3
Consumption::count
int count
number of pulses detected within the monitoring period
Definition: Consumption.h:29
Consumption::DAY
@ DAY
daily water consumption
Definition: Consumption.h:20