You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.1 KiB
C

/*
* AlertBase.h
*
* Author: Aleksey Gerasimenko
* gerasimenko.aleksey.n@gmail.com
*/
#include <math.h>
#include <stdint.h>
#ifndef ALERT_ALARMBASE_H_
#define ALERT_ALARMBASE_H_
namespace ALERT
{
struct AlertBaseConfiguration
{
float level;
float period;
AlertBaseConfiguration():
level(-1.0),
period(-1.0)
{}
};//AlertBaseConfiguration
class AlertBase
{
//public:
// enum mode_t {UNDEFINED, CONFIGURATE, OPERATIONAL};
//protected:
// mode_t m_mode;
protected:
float m_time_sample;
protected:
float m_level;
protected:
float m_period;
float m_timer;
//public:
// mode_t mode;
public:
AlertBase();
virtual void setup(float time_sample) = 0;
virtual void configure(const AlertBaseConfiguration& config) = 0;
//public:
//mode_t get_mode() const;
//bool compare(mode_t mode) const;
public:
virtual void reset() = 0;
virtual void execute(float reference) = 0;
protected:
virtual void _execute_undef(float reference) = 0;
virtual void _execute_operational(float reference) = 0;
//
};//AlertBase
//
} /* namespace ALERT */
//
#endif /* ALERT_ALARMBASE_H_ */