HomeWaterLeaksDetection
TotalLeakDetection.h
Go to the documentation of this file.
1 #ifndef TOTAL_LEAK_DETECTION_H
2 #define TOTAL_LEAK_DETECTION_H
3 
4 #include "Setup.h"
5 #include "HighLeakDetection.h"
6 
7 //==================WebServer class=====================
8 
16 
17 //====================private data======================
18 private:
20 
21 //==================protected methods===================
22 protected:
29  float getPercentLeakDetectionReset() const;
30 
33  void testResetLeak() override;
34 
37  void testActiveLeak() override;
38 
39 //==================public methods======================
40 public:
48  Type type,
51 
54 
56  void reset() override;
57 
58 //====================debugging=========================
59 #ifdef DEBUG
60  const String getLogID() const override;
63 #endif
64 
65 //==================LCD display=========================
66 #ifdef LCD_DISPLAY
67  const String getRow(int row) const override;
76 #endif
77 
78 //====================web server========================
79 #ifdef WEB_SERVER
80 protected:
83  std::map<int, String (*)(const TotalLeakDetection& highLeakDetection)> htmlData;
84 
85 public:
93  const String getHTMLData(const int id) const override;
94 
95 private:
100 
105 
110 
115 
120 
131 
136 
141 
146 
151 
156 
161 
166 
171 
176 
181 
186 #endif
187 
188 //===============email notifications====================
189 #ifdef EMAIL_NOTIFICATION
190 private:
196  void sendEmailLeakDetected() override;
197 #endif
198 };
199 
200 #endif
ALeakDetectable::alarmConfig
LeakDetectionConfig_t alarmConfig
alarm configuration for when there's nobody in the house
Definition: ALeakDetectable.h:67
TotalLeakDetection::getRow
const String getRow(int row) const override
Returns the content of the row given as a parameter.
ALeakDetectable::type
Type type
the type of the water leak detection algorithm
Definition: ALeakDetectable.h:76
TotalLeakDetection::TotalLeakDetection
TotalLeakDetection(PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
Constructor of the class.
Definition: TotalLeakDetection.cpp:23
highLeakDetection
HighLeakDetection * highLeakDetection
Definition: main.cpp:51
TotalLeakDetection::HTML_resetLimitMinsAlarm
friend String HTML_resetLimitMinsAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (mins) in the alarm configuration.
TotalLeakDetection::HTML_detectedTime
friend String HTML_detectedTime(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the detection time of a total-water leak.
TotalLeakDetection::HTML_detectionLimitAlarm
friend String HTML_detectionLimitAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the limit (detection) in terms of the alarm configuration.
TotalLeakDetection::HTML_resetLimitSecs
friend String HTML_resetLimitSecs(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (secs) in the normal configuration.
LeakDetectionConfig_t
Definition: LeakDetectionConfig.h:17
TotalLeakDetection::HTML_resetLimitHoursAlarm
friend String HTML_resetLimitHoursAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (hours) in the alarm configuration.
TotalLeakDetection::HTML_detected
friend String HTML_detected(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about a total-water leak being detected (1)
TotalLeakDetection::HTML_activePercentage
friend String HTML_activePercentage(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the [%] information about how close a leak is from being detected.
TotalLeakDetection
Definition: TotalLeakDetection.h:15
HighLeakDetection
Definition: HighLeakDetection.h:23
Setup.h
TotalLeakDetection::HTML_resetLimitDaysAlarm
friend String HTML_resetLimitDaysAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (days) in the alarm configuration.
totalLeakDetection
TotalLeakDetection * totalLeakDetection
Definition: main.cpp:53
HighLeakDetection.h
TotalLeakDetection::getHTMLData
const String getHTMLData(const int id) const override
Since this class is registered as a source of data for the HTML content, it needs return the appropri...
TotalLeakDetection::HTML_detectedText
friend String HTML_detectedText(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about a total-water leak being detected (2)
time_t
unsigned long time_t
Referring to the data type unsigned long as time_t.
Definition: DateTime.h:20
TotalLeakDetection::startDayPulseTime
time_t startDayPulseTime
the start of the monoring period
Definition: TotalLeakDetection.h:19
TotalLeakDetection::HTML_detectionLimit
friend String HTML_detectionLimit(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the limit (detection) in terms of the normal configuration.
TotalLeakDetection::HTML_resetLimitMins
friend String HTML_resetLimitMins(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (mins) in the normal configuration.
TotalLeakDetection::getPercentLeakDetectionReset
float getPercentLeakDetectionReset() const
Returns percentage information about how close a total-water leak is from being detected.
Definition: TotalLeakDetection.cpp:103
TotalLeakDetection::HTML_resetLimitSecsAlarm
friend String HTML_resetLimitSecsAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (secs) in the alarm configuration.
ALeakDetectable::Type
Type
The type of the water leak detection algorithm.
Definition: ALeakDetectable.h:57
TotalLeakDetection::HTML_bypass
friend String HTML_bypass(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about the state of the bypass.
TotalLeakDetection::HTML_resetLimitHours
friend String HTML_resetLimitHours(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (hours) in the normal configuration.
TotalLeakDetection::HTML_resetLimitDays
friend String HTML_resetLimitDays(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (days) in the normal configuration.
TotalLeakDetection::reset
void reset() override
Resets the algorithm.
Definition: TotalLeakDetection.cpp:53
PulseCounter
Definition: PulseCounter.h:29
TotalLeakDetection::testActiveLeak
void testActiveLeak() override
Tests if the total-water the algorithm should be reset if the current monitoring period is over.
Definition: TotalLeakDetection.cpp:69
TotalLeakDetection::testResetLeak
void testResetLeak() override
Tests if a total-water leak has occurred, and if so, it will set the appropriate variables and flags.
Definition: TotalLeakDetection.cpp:58
TotalLeakDetection::HTML_activePercentageColor
friend String HTML_activePercentageColor(const TotalLeakDetection &totalLeakDetection)
Associated function for returing a color according to [%] information about how close a leak is from ...
ALeakDetectable::pulseCounter
PulseCounter * pulseCounter
instance of a pulse counter (input of the system)
Definition: ALeakDetectable.h:65
TotalLeakDetection::HTML_resetPercentage
friend String HTML_resetPercentage(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the [%] information about how close the algorithm is from being rese...
ALeakDetectable::normalConfig
LeakDetectionConfig_t normalConfig
normal configuarion for when the house is occupied
Definition: ALeakDetectable.h:66
TotalLeakDetection::htmlData
std::map< int, String(*)(const TotalLeakDetection &highLeakDetection)> htmlData
A map of different values (keys) and their associated functions which returns the appropriate values.
Definition: TotalLeakDetection.h:83
TotalLeakDetection::~TotalLeakDetection
~TotalLeakDetection()
Descrutor of the class.
Definition: TotalLeakDetection.h:53