49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
/*
|
||
* DiscreteSwitch.hh
|
||
*
|
||
* Created on: 21 мая 2021 г.
|
||
* Author: sozonov
|
||
*/
|
||
|
||
#ifndef UMLIBRARY_APPLICATION_SCHEMATIC_ENABLEACTION_HH_
|
||
#define UMLIBRARY_APPLICATION_SCHEMATIC_ENABLEACTION_HH_
|
||
|
||
#include "../ISetupStep.hh"
|
||
#include "../../systemic/IStatus.hh"
|
||
|
||
#include "../../schematic/DiscreteSwitch.hh"
|
||
|
||
namespace application { namespace schematic {
|
||
|
||
//!Модуль вызова функции при наличии разрешающего статуса.
|
||
struct EnableAction : public ISetupStep {
|
||
|
||
typedef systemic::IFunctor<void> Action;
|
||
typedef systemic::IValue<bool> Status;
|
||
|
||
//Входы
|
||
//Action * input_signal = nullptr; //!<Входной сигнал.
|
||
Status * enable_status = nullptr; //!<Статус разрешающий выходной сигнал.
|
||
|
||
Action * output_signal = nullptr; //!<Выходной сигнал.
|
||
bool input( Environment & env );
|
||
void build( Environment & env );
|
||
|
||
struct Links {
|
||
Environment::Id input; //!<Действие.
|
||
Environment::StatusId enable; //!<Разрешение действия.
|
||
|
||
Environment::Id output; //!<Целевое действие.
|
||
};
|
||
|
||
const Links & links;
|
||
|
||
EnableAction( const Links & links ) : links(links) {}
|
||
};
|
||
|
||
}}
|
||
|
||
|
||
|
||
#endif /* UMLIBRARY_APPLICATION_SCHEMATIC_ENABLEACTION_HH_ */
|