Go to the documentation of this file. 1 #ifndef LEAKS_CONTROLLER_H
2 #define LEAKS_CONTROLLER_H
37 #ifdef EMAIL_NOTIFICATION
71 std::map<ALeakDetectable::Type, ALeakDetectable*>
leaks;
148 int getValveState()
const {
return valveState; }
162 const String getLogDescription()
const;
166 const String getLogID()
const;
171 const String
getRow(
int row)
const override;
friend String HTML_monthlyConsumption(const LeaksController &leaksController)
Associated function for returing the monthly water consumption in liters.
void addLeakDetection(ALeakDetectable::Type type, ALeakDetectable *leak)
Adds another water leak detection algorithm to the collection.
std::map< ALeakDetectable::Type, ALeakDetectable * > leaks
collection (map) of water leak detection algorithms
int valveState
state of the main valve
Consumption * monthlyConsumptionCounter
monthly water consumption
LeaksController()
Constructor of the class.
int manualValveClose
state of the "manual close" button
int getNumberOfLeakDetections() const
Return the number of water leak detection algorithm.
LeaksController(LeaksController const &)
Copy constructor of the class.
friend String HTML_valve(const LeaksController &leaksController)
Associated function for returing the current state of the main valve.
void setMonthlyConsumptionCounter(Consumption *monthlyConsumptionCounter)
Sets an instance of Consumption (monthly water consumption)
int stateOfHomeAlarm
state of the home alarm
LeaksController & operator=(LeaksController const &)
Assignment operator of the class.
std::map< int, String(*)(const LeaksController &leaksController)> htmlData
A map of different values (keys) and their associated functions which returns the appropriate values.
friend String HTML_manualClose(const LeaksController &leaksController)
Associated function for returing the current state of the "manual close" button.
void setDailyConsumptionCounter(Consumption *dailyConsumptionCounter)
Sets an instance of Consumption (daily water consumption)
static LeaksController * instance
the instance of the class
void update() override
Updates the class.
#define RESET_PIN
reset button
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...
Type
The type of the water leak detection algorithm.
void setPulseCounter(PulseCounter *pulseCounter)
Sets an instance of PulseCounter.
friend String HTML_alarm(const LeaksController &leaksController)
Associated function for returing the current state of the home alarm.
Consumption * dailyConsumptionCounter
daily water consumption
Button manualResetButton
instance of Button (the reset buttton)
String getFormatOfSettingsToSave()
Returns all settings.
const String getRow(int row) const override
Returns the content of the row given as a parameter.
friend String HTML_dailyConsumption(const LeaksController &leaksController)
Associated function for returing the daily water consumption in liters.
static LeaksController * getInstance()
Returns the instance of the class.
void changeSettings(ALeakDetectable::Type type, unsigned long detected, unsigned long reset, bool alarm)
Changes settings of a water leak detection algorithm.
PulseCounter * pulseCounter
instance of PulseCounter (output from the sensor)