HomeWaterLeaksDetection
|
#include <DailyOverview.h>
Public Member Functions | |
DailyOverview (HighLeakDetection *highLeakDetection, LowLeakDetection *lowLeakDetection, TotalLeakDetection *totalLeakDetection, Consumption *dailyConsumption, Consumption *monthlyConsumption) | |
Constructor of the class. More... | |
void | update () override |
Updates the class. More... | |
const String | getRow (int row) const override |
Returns the content of the row given as a parameter. More... | |
Private Member Functions | |
void | reset () |
Resets all the variables at the end of the day. More... | |
Private Attributes | |
HighLeakDetection * | highLeakDetection |
instance of a high-water leak detection algorithm More... | |
LowLeakDetection * | lowLeakDetection |
instance of a low-water leak detection algorithm More... | |
TotalLeakDetection * | totalLeakDetection |
instance of a total-water leak detection algorithm More... | |
Consumption * | dailyConsumption |
instance of Consumption (daily water consumption) More... | |
Consumption * | monthlyConsumption |
instance of Consumption (monthly water consumption) More... | |
RTCDateTime | initialDateTime |
instance of RTCDateTime (real-time module) More... | |
float | maxHighLeakPercentage |
max [%] high-water leak detection within the monitoring period (extreme) More... | |
float | maxLowLeakPercentage |
max [%] low-water leak detection within the monitoring period (extreme) More... | |
float | maxTotalLeakPercentage |
max [%] total-water leak detection within the monitoring period (extreme) More... | |
This class collects information to be sent to the user as a daily overview. Such information includes daily water consumption, how close each type of water leak was from being detected [%], etc.
Definition at line 23 of file DailyOverview.h.
DailyOverview::DailyOverview | ( | HighLeakDetection * | highLeakDetection, |
LowLeakDetection * | lowLeakDetection, | ||
TotalLeakDetection * | totalLeakDetection, | ||
Consumption * | dailyConsumption, | ||
Consumption * | monthlyConsumption | ||
) |
Constructor of the class.
It takes already existing instances as parameters so it can gather information off them
highLeakDetection | instance of HighLeakDetection |
lowLeakDetection | instance of LowLeakDetection |
totalLeakDetection | instance of LowLeakDetection |
dailyConsumption | instance of Consumption (daily) |
monthlyConsumption | instance of Consumption (monthly) |
Definition at line 3 of file DailyOverview.cpp.
References DAILY_OVERVIEW_INIT_HOUR, DAILY_OVERVIEW_INIT_MIN, dailyConsumption, DateTime::getDateTime(), DateTime::getInstance(), highLeakDetection, initialDateTime, lowLeakDetection, monthlyConsumption, reset(), and totalLeakDetection.
|
overridevirtual |
Returns the content of the row given as a parameter.
This class represents one page on the LCD display. Each of the 4 rows has different content identified by the number of the row.
row | number of the row |
Implements IDisplayable.
|
private |
Resets all the variables at the end of the day.
Definition at line 29 of file DailyOverview.cpp.
References maxHighLeakPercentage, maxLowLeakPercentage, and maxTotalLeakPercentage.
Referenced by DailyOverview(), and update().
|
overridevirtual |
Updates the class.
It updates the class along with all the information it is collecting. Also, using the RTCDateTime, it resets all the variables at the end of the day.
Implements IControllable.
Definition at line 35 of file DailyOverview.cpp.
References EmailSender::DAILY_OVERVIEW, dailyConsumption, Consumption::getConsumptionCount(), DateTime::getDateTime(), EmailSender::getInstance(), DateTime::getInstance(), LowLeakDetection::getPercentLeakDetected(), HighLeakDetection::getPercentLeakDetected(), highLeakDetection, initialDateTime, lowLeakDetection, maxHighLeakPercentage, maxLowLeakPercentage, maxTotalLeakPercentage, monthlyConsumption, PULSE_TO_LITER, reset(), EmailSender::sendEmail(), and totalLeakDetection.
|
private |
instance of Consumption (daily water consumption)
Definition at line 34 of file DailyOverview.h.
Referenced by DailyOverview(), and update().
|
private |
instance of a high-water leak detection algorithm
Definition at line 30 of file DailyOverview.h.
Referenced by DailyOverview(), and update().
|
private |
instance of RTCDateTime (real-time module)
Definition at line 36 of file DailyOverview.h.
Referenced by DailyOverview(), and update().
|
private |
instance of a low-water leak detection algorithm
Definition at line 31 of file DailyOverview.h.
Referenced by DailyOverview(), and update().
|
private |
max [%] high-water leak detection within the monitoring period (extreme)
Definition at line 38 of file DailyOverview.h.
|
private |
max [%] low-water leak detection within the monitoring period (extreme)
Definition at line 39 of file DailyOverview.h.
|
private |
max [%] total-water leak detection within the monitoring period (extreme)
Definition at line 40 of file DailyOverview.h.
|
private |
instance of Consumption (monthly water consumption)
Definition at line 35 of file DailyOverview.h.
Referenced by DailyOverview(), and update().
|
private |
instance of a total-water leak detection algorithm
Definition at line 32 of file DailyOverview.h.
Referenced by DailyOverview(), and update().