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

52 lines
1.6 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.

/*
* StatusChangeAction.hh
*
* Created on: 10 июн. 2020 г.
* Author: LeonidTitov
*/
#ifndef UMLIBRARY_APPLICATION_SCHEMATIC_STATUSCHANGEACTION_HH_
#define UMLIBRARY_APPLICATION_SCHEMATIC_STATUSCHANGEACTION_HH_
#include "../ISetupStep.hh"
#include "../../systemic/IStatus.hh"
#include "../../schematic/action/StatusChangeAction.hh"
namespace application { namespace schematic {
//!Модуль осуществляет заданное действие по событию перехода статуса в заданное состояние.
struct StatusChangeAction : public ISetupStep {
typedef systemic::IFunctor<void> Action;
Action * action = nullptr;
systemic::IStatus * trigger = nullptr;
bool input( Environment & env );
void build( Environment & env );
struct Links {
Environment::StatusId trigger; //!<Контролируемый статус.
Environment::Id action; //!<Совершаемое действие.
};
//!Условия выполнения.
struct Setting {
bool expected_value; //!<Заданное состояние, при переходе в которое необходимо осуществить действие.
};
const Links & links;
const Setting & setting;
const configuration::ProcessConfig & params;
StatusChangeAction( const Links & links, const Setting & setting, const configuration::ProcessConfig & params ) : links(links), setting(setting), params(params) {}
};
}}
#endif /* UMLIBRARY_APPLICATION_SCHEMATIC_STATUSCHANGEACTION_HH_ */