HomeWaterLeaksDetection
TotalLeakDetection Class Reference

#include <TotalLeakDetection.h>

Public Member Functions

 TotalLeakDetection (PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
 Constructor of the class. More...
 
 ~TotalLeakDetection ()
 Descrutor of the class. More...
 
void reset () override
 Resets the algorithm. More...
 
const String getRow (int row) const override
 Returns the content of the row given as a parameter. More...
 
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 appropriate value according to the id given as a parameter. More...
 
- Public Member Functions inherited from HighLeakDetection
 HighLeakDetection (PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
 Constructor of the class. More...
 
 ~HighLeakDetection ()
 Descrutor of the class. More...
 
void update () override
 Updates the algorithm. More...
 
String getFormatOfSettingsToSave () override
 Returns the current settings of the algorithm. More...
 
float getPercentLeakDetectionReset () const
 Returns percentage information about how close a high-water leak is from being detected. More...
 
float getPercentLeakDetected () const
 Returns percentage information about how close the algorithm is from being reset. More...
 
- Public Member Functions inherited from ALeakDetectable
 ALeakDetectable (PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
 Constructor of the class. More...
 
virtual ~ALeakDetectable ()
 Destructor of the class. More...
 
int isActive () const
 Returns a flag whether of not a leak has been detected and the bypass is off. More...
 
void changeStateOfHomeAlarm (bool state)
 Changes the state of the home alarm. More...
 
LeakDetectionConfig_t getAlarmConfig ()
 Returns the current alarm config. More...
 
LeakDetectionConfig_t getNormalConfig ()
 Returns the current normal config. More...
 
void updateNormalConfig (LeakDetectionConfig_t newNormalConfig)
 Updates the normal settings. More...
 
void updateAlarmConfig (LeakDetectionConfig_t newAlarmConfig)
 Updates the alarm settings. More...
 

Protected Member Functions

float getPercentLeakDetectionReset () const
 Returns percentage information about how close a total-water leak is from being detected. More...
 
void testResetLeak () override
 Tests if a total-water leak has occurred, and if so, it will set the appropriate variables and flags. More...
 
void testActiveLeak () override
 Tests if the total-water the algorithm should be reset if the current monitoring period is over. More...
 
- Protected Member Functions inherited from ALeakDetectable
void applyNewConfig ()
 Applies the new config configuration. More...
 
String getType () const
 Returns the type of the water leak detection algorithm. More...
 

Protected Attributes

std::map< int, String(*)(const TotalLeakDetection &highLeakDetection)> htmlData
 A map of different values (keys) and their associated functions which returns the appropriate values. More...
 
- Protected Attributes inherited from HighLeakDetection
int pulseCount
 number of pulses detected so far More...
 
std::map< int, String(*)(const HighLeakDetection &highLeakDetection)> htmlData
 A map of different values (keys) and their associated functions which returns the appropriate values. More...
 
- Protected Attributes inherited from ALeakDetectable
PulseCounterpulseCounter
 instance of a pulse counter (input of the system) More...
 
LeakDetectionConfig_t normalConfig
 normal configuarion for when the house is occupied More...
 
LeakDetectionConfig_t alarmConfig
 alarm configuration for when there's nobody in the house More...
 
LeakDetectionConfig_tconfig
 pointer to the current configuration More...
 
int bypass
 bypass pin More...
 
int oldBypassValue
 old bypass value (used for sending e-mails) More...
 
int active
 indication if a leak has been detected + bypass is off More...
 
int stateOfHomeAlarm
 the current state of the home alarm More...
 
bool detected
 indication if a leak has been detected More...
 
int resetWhenDetected
 the reset value (%) when a leak was detected More...
 
String timeOfDetection
 time when the leak has been detected More...
 
Type type
 the type of the water leak detection algorithm More...
 
LeakDetectionConfig_t newNormalConfig
 new parameters of the normal config when the user changes them More...
 
LeakDetectionConfig_t newAlarmConfig
 new parameters of the alarm config when the user changes them More...
 
int requestUpdateNormalConfig
 flag if the new normal config should be applied More...
 
int requestUpdateAlarmConfig
 flag if the new alarms config should be applied More...
 

Private Attributes

time_t startDayPulseTime
 the start of the monoring period More...
 

Friends

String HTML_bypass (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing information about the state of the bypass. More...
 
String HTML_detected (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing information about a total-water leak being detected (1) More...
 
String HTML_detectedText (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing information about a total-water leak being detected (2) More...
 
String HTML_detectedTime (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the detection time of a total-water leak. More...
 
String HTML_activePercentage (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the [%] information about how close a leak is from being detected. More...
 
String HTML_activePercentageColor (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing a color according to [%] information about how close a leak is from being detected. More...
 
String HTML_resetPercentage (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the [%] information about how close the algorithm is from being reset. More...
 
String HTML_detectionLimit (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the limit (detection) in terms of the normal configuration. More...
 
String HTML_resetLimitDays (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (days) in the normal configuration. More...
 
String HTML_resetLimitHours (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (hours) in the normal configuration. More...
 
String HTML_resetLimitMins (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (mins) in the normal configuration. More...
 
String HTML_resetLimitSecs (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (secs) in the normal configuration. More...
 
String HTML_detectionLimitAlarm (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the limit (detection) in terms of the alarm configuration. More...
 
String HTML_resetLimitDaysAlarm (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (days) in the alarm configuration. More...
 
String HTML_resetLimitHoursAlarm (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (hours) in the alarm configuration. More...
 
String HTML_resetLimitMinsAlarm (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (mins) in the alarm configuration. More...
 
String HTML_resetLimitSecsAlarm (const TotalLeakDetection &totalLeakDetection)
 Associated function for returing the reset time (secs) in the alarm configuration. More...
 

Additional Inherited Members

- Public Types inherited from ALeakDetectable
enum  Type { Low, High, Total }
 The type of the water leak detection algorithm. More...
 
- Static Public Attributes inherited from HTMLDataSource
static const String UNDEFINED_DATA = String("UNDEFINED")
 string "UNDEFINED" More...
 

Detailed Description

Author
silhavyj A17B0362P

This class implements the total-water leak detection algorithm. It takes adventage of the already implemented in the high-water leak detection algorithm and overwrites some required parts of it.

Definition at line 15 of file TotalLeakDetection.h.

Constructor & Destructor Documentation

◆ TotalLeakDetection()

TotalLeakDetection::TotalLeakDetection ( PulseCounter pulseCounter,
Type  type,
LeakDetectionConfig_t  normalConfig,
LeakDetectionConfig_t  alarmConfig 
)

Constructor of the class.

Parameters
pulseCounterinstance of PulseCounter (input)
typeof the algorithm (total-water)
normalConfigdefault normal settings
alarmConfigdefault alarm settings

Definition at line 23 of file TotalLeakDetection.cpp.

28 #ifdef WEB_SERVER
29  // functions providing data to the webserver
30  htmlData[8] = &HTML_bypass;
31  htmlData[9] = &HTML_detected;
37 
43 
49 #endif
50  reset(); // reset the algorithm
51 }

References HTML_activePercentage, HTML_activePercentageColor, HTML_bypass, HTML_detected, HTML_detectedText, HTML_detectedTime, HTML_detectionLimit, HTML_detectionLimitAlarm, HTML_resetLimitDays, HTML_resetLimitDaysAlarm, HTML_resetLimitHours, HTML_resetLimitHoursAlarm, HTML_resetLimitMins, HTML_resetLimitMinsAlarm, HTML_resetLimitSecs, HTML_resetLimitSecsAlarm, HTML_resetPercentage, htmlData, and reset().

◆ ~TotalLeakDetection()

TotalLeakDetection::~TotalLeakDetection ( )
inline

Descrutor of the class.

Definition at line 53 of file TotalLeakDetection.h.

53 {};

Member Function Documentation

◆ getHTMLData()

const String TotalLeakDetection::getHTMLData ( const int  id) const
overridevirtual

Since this class is registered as a source of data for the HTML content, it needs return the appropriate value according to the id given as a parameter.

Parameters
id- the id of the piece of data
Returns
If the class holds this piece of information, it will return it. Otherwise, "UNDEFINED" will be returned.

Reimplemented from HighLeakDetection.

◆ getPercentLeakDetectionReset()

float TotalLeakDetection::getPercentLeakDetectionReset ( ) const
protected

Returns percentage information about how close a total-water leak is from being detected.

The particular value is worked out based on the current settings. This piece of information is then displayed to the user.

Returns
information about how close a total-water leak is from being detected

Definition at line 103 of file TotalLeakDetection.cpp.

103  {
104  if (this->active == HIGH) return 0;
105 
106  time_t currentTime = millis();
107  time_t deltaTime = DELTA_TIME(currentTime, startDayPulseTime);
108 
109  float percentDetected = deltaTime / (float)config->limitResetTime;
110  percentDetected *= 100;
111  return min(100, percentDetected);
112 }

References ALeakDetectable::active, ALeakDetectable::config, DELTA_TIME, LeakDetectionConfig_t::limitResetTime, and startDayPulseTime.

Referenced by testActiveLeak().

◆ getRow()

const String TotalLeakDetection::getRow ( int  row) const
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.

Parameters
rownumber of the row
Returns
content to be displayed on that row of the LCD

Reimplemented from HighLeakDetection.

◆ reset()

void TotalLeakDetection::reset ( )
overridevirtual

Resets the algorithm.

Reimplemented from HighLeakDetection.

Definition at line 53 of file TotalLeakDetection.cpp.

53  {
55  startDayPulseTime = millis(); // start of the 24hrs
56 }

References HighLeakDetection::reset(), and startDayPulseTime.

Referenced by TotalLeakDetection().

◆ testActiveLeak()

void TotalLeakDetection::testActiveLeak ( )
overrideprotectedvirtual

Tests if the total-water the algorithm should be reset if the current monitoring period is over.

Reimplemented from HighLeakDetection.

Definition at line 69 of file TotalLeakDetection.cpp.

69  {
71 
72  if (detected) {
73  // store the reset % when a leak was detected
74  // if it has not been done yet
75  if (timeOfDetection == "") {
78 
79  // send e-mail to the user
80  #ifdef EMAIL_NOTIFICATION
81  sendEmailLeakDetected();
82  #endif
83  }
84  active = !bypass; // if the bypass is off, close the main valve
85  }
86  // indication LED
87  digitalWrite(TOTAL_ILOCK_LED_PIN, detected);
88 }

References ALeakDetectable::active, ALeakDetectable::bypass, ALeakDetectable::config, ALeakDetectable::detected, DateTime::getDateTimeStr(), DateTime::getInstance(), getPercentLeakDetectionReset(), LeakDetectionConfig_t::limitPulseAction, HighLeakDetection::pulseCount, ALeakDetectable::resetWhenDetected, ALeakDetectable::timeOfDetection, and TOTAL_ILOCK_LED_PIN.

◆ testResetLeak()

void TotalLeakDetection::testResetLeak ( )
overrideprotectedvirtual

Tests if a total-water leak has occurred, and if so, it will set the appropriate variables and flags.

Reimplemented from HighLeakDetection.

Definition at line 58 of file TotalLeakDetection.cpp.

58  {
59  time_t currentTime = millis();
60  time_t deltaTime = DELTA_TIME(currentTime, startDayPulseTime);
61 
62  if (deltaTime >= config->limitResetTime && !detected) {
63  pulseCount = 0;
64  startDayPulseTime = currentTime;
65  ALeakDetectable::applyNewConfig(); // check if new settings should be applied
66  }
67 }

References ALeakDetectable::applyNewConfig(), ALeakDetectable::config, DELTA_TIME, ALeakDetectable::detected, LeakDetectionConfig_t::limitResetTime, HighLeakDetection::pulseCount, and startDayPulseTime.

Friends And Related Function Documentation

◆ HTML_activePercentage

String HTML_activePercentage ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the [%] information about how close a leak is from being detected.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
[%] information about how close a leak is from being detected

Referenced by TotalLeakDetection().

◆ HTML_activePercentageColor

String HTML_activePercentageColor ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing a color according to [%] information about how close a leak is from being detected.

For instance, 0 - 59% -> gray 60 - 79% -> yellow 80 - 89% -> orange
90 - 100% ->red

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
color according to the state of the algorithm - detected [%]

Referenced by TotalLeakDetection().

◆ HTML_bypass

String HTML_bypass ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing information about the state of the bypass.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
"OFF"/"ON" according to the current state of the bypass

Referenced by TotalLeakDetection().

◆ HTML_detected

String HTML_detected ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing information about a total-water leak being detected (1)

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
"ON" if a total-water leak has occurred, "OFF" otherwise

Referenced by TotalLeakDetection().

◆ HTML_detectedText

String HTML_detectedText ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing information about a total-water leak being detected (2)

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
"Detected" if a total-water leak has occurred, "Undetected" otherwise

Referenced by TotalLeakDetection().

◆ HTML_detectedTime

String HTML_detectedTime ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the detection time of a total-water leak.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
the time of detection in a string format

Referenced by TotalLeakDetection().

◆ HTML_detectionLimit

String HTML_detectionLimit ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the limit (detection) in terms of the normal configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
the limit (detection) in the normal configuration

Referenced by TotalLeakDetection().

◆ HTML_detectionLimitAlarm

String HTML_detectionLimitAlarm ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the limit (detection) in terms of the alarm configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
the limit (detection) in the alarm configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitDays

String HTML_resetLimitDays ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (days) in the normal configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (days) in the normal configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitDaysAlarm

String HTML_resetLimitDaysAlarm ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (days) in the alarm configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (days) in the alarm configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitHours

String HTML_resetLimitHours ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (hours) in the normal configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (hours) in the normal configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitHoursAlarm

String HTML_resetLimitHoursAlarm ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (hours) in the alarm configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (hours) in the alarm configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitMins

String HTML_resetLimitMins ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (mins) in the normal configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (mins) in the normal configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitMinsAlarm

String HTML_resetLimitMinsAlarm ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (mins) in the alarm configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (mins) in the alarm configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitSecs

String HTML_resetLimitSecs ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (secs) in the normal configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (secs) in the normal configuration

Referenced by TotalLeakDetection().

◆ HTML_resetLimitSecsAlarm

String HTML_resetLimitSecsAlarm ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the reset time (secs) in the alarm configuration.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
reset time (secs) in the alarm configuration

Referenced by TotalLeakDetection().

◆ HTML_resetPercentage

String HTML_resetPercentage ( const TotalLeakDetection totalLeakDetection)
friend

Associated function for returing the [%] information about how close the algorithm is from being reset.

Parameters
totalLeakDetection- the instance of the TotalLeakDetection class
Returns
[%] information about how close the algorithm is from being reset

Referenced by TotalLeakDetection().

Member Data Documentation

◆ htmlData

std::map<int, String (*)(const TotalLeakDetection& highLeakDetection)> TotalLeakDetection::htmlData
protected

A map of different values (keys) and their associated functions which returns the appropriate values.

Definition at line 83 of file TotalLeakDetection.h.

Referenced by TotalLeakDetection().

◆ startDayPulseTime

time_t TotalLeakDetection::startDayPulseTime
private

the start of the monoring period

Definition at line 19 of file TotalLeakDetection.h.

Referenced by getPercentLeakDetectionReset(), reset(), and testResetLeak().


The documentation for this class was generated from the following files:
ALeakDetectable::alarmConfig
LeakDetectionConfig_t alarmConfig
alarm configuration for when there's nobody in the house
Definition: ALeakDetectable.h:67
ALeakDetectable::timeOfDetection
String timeOfDetection
time when the leak has been detected
Definition: ALeakDetectable.h:75
ALeakDetectable::type
Type type
the type of the water leak detection algorithm
Definition: ALeakDetectable.h:76
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.
ALeakDetectable::bypass
int bypass
bypass pin
Definition: ALeakDetectable.h:69
TotalLeakDetection::HTML_detectionLimitAlarm
friend String HTML_detectionLimitAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the limit (detection) in terms of the alarm configuration.
HighLeakDetection::HighLeakDetection
HighLeakDetection(PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
Constructor of the class.
Definition: HighLeakDetection.cpp:23
TotalLeakDetection::HTML_resetLimitSecs
friend String HTML_resetLimitSecs(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (secs) in the normal configuration.
TotalLeakDetection::HTML_resetLimitHoursAlarm
friend String HTML_resetLimitHoursAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (hours) in the alarm configuration.
LeakDetectionConfig_t::limitResetTime
time_t limitResetTime
limit reset time e.g. 5 mins, 24h, ....
Definition: LeakDetectionConfig.h:18
TotalLeakDetection::HTML_detected
friend String HTML_detected(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about a total-water leak being detected (1)
LeakDetectionConfig_t::limitPulseAction
int limitPulseAction
limit action in pulses
Definition: LeakDetectionConfig.h:20
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.
TOTAL_ILOCK_LED_PIN
#define TOTAL_ILOCK_LED_PIN
total-water leak bypass button
Definition: Pins.h:34
ALeakDetectable::resetWhenDetected
int resetWhenDetected
the reset value (%) when a leak was detected
Definition: ALeakDetectable.h:74
ALeakDetectable::config
LeakDetectionConfig_t * config
pointer to the current configuration
Definition: ALeakDetectable.h:68
ALeakDetectable::detected
bool detected
indication if a leak has been detected
Definition: ALeakDetectable.h:73
HighLeakDetection::reset
void reset() override
Resets the algorithm.
Definition: HighLeakDetection.cpp:53
ALeakDetectable::applyNewConfig
void applyNewConfig()
Applies the new config configuration.
Definition: ALeakDetectable.cpp:34
HighLeakDetection::pulseCount
int pulseCount
number of pulses detected so far
Definition: HighLeakDetection.h:26
TotalLeakDetection::HTML_resetLimitDaysAlarm
friend String HTML_resetLimitDaysAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (days) in the alarm configuration.
DateTime::getInstance
static DateTime * getInstance()
Returns the instance of the class.
Definition: DateTime.cpp:26
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.
TotalLeakDetection::HTML_bypass
friend String HTML_bypass(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about the state of the bypass.
DateTime::getDateTimeStr
String getDateTimeStr() const
Returns the current datatime in a string format.
Definition: DateTime.cpp:47
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
ALeakDetectable::active
int active
indication if a leak has been detected + bypass is off
Definition: ALeakDetectable.h:71
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 ...
DELTA_TIME
#define DELTA_TIME(time1, time2)
Calculates the time difference between two times given as parameters.
Definition: DateTime.h:35
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