MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/application/schematic/AlarmTimer.hh
2024-06-07 11:12:56 +03:00

57 lines
1.9 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* AlarmTimer.hh
*
* Created on: 26 мая 2021 г.
* Author: sozonov
*/
#ifndef UMLIBRARY_APPLICATION_SCHEMATIC_ALARMTIMER_HH_
#define UMLIBRARY_APPLICATION_SCHEMATIC_ALARMTIMER_HH_
#include "../ISetupStep.hh"
#include "../../schematic/AlarmTimerLogic.hh"
namespace application { namespace schematic {
//!Таймер. При достижении, заданного настройкой тайм-аута вызывается функция alarm и таймер останавливается.
struct AlarmTimer : public ISetupStep {
typedef systemic::IFunctor<void> Action;
//Входы
Action * alarm = nullptr; //!Сигнал о переходе через верхнюю либо нижнюю границу.
bool input( Environment & env );
void build( Environment & env );
struct Links {
Environment::Id alarm; //!<Достижение значения тайм-аута.
Environment::SignalId time; //!<Текущее значение таймера в секундах.
Environment::Id start; //!<Запуск таймера.
Environment::Id stop; //!<Останов таймера.
Environment::Id reset; //!<Сброс таймера.
Environment::StatusId state; //!<Статус запущен/остановлен.
};
//!Начальные значения.
struct Setting {
float time_out; //!<Тайм-аут в секундах.
};
const Links & links;
const Setting & setting;
const configuration::ProcessConfig & params;
AlarmTimer( const Links & links, const Setting & setting, const configuration::ProcessConfig & params) :
links(links), setting(setting), params(params) {}
};
}}
#endif /* UMLIBRARY_APPLICATION_SCHEMATIC_ALARMTIMER_HH_ */