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

109 lines
3.2 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.

/*
* StatusLogicSetup.h
*
* Created on: 1 окт. 2019 г.
* Author: user
*/
#ifndef SOURCE_APPLICATION_SCHEMATIC_STATUSLOGICSETUP_H_
#define SOURCE_APPLICATION_SCHEMATIC_STATUSLOGICSETUP_H_
#include "../ISetupStep.hh"
#include "../../systemic/IStatus.hh"
#include "../../schematic/StatusLogic.hpp"
namespace application { namespace schematic {
//!Унарное отрицание значения статуса. Реализует логику "not a".
struct StatusNot : public ISetupStep {
typedef systemic::IStatus Status;
typedef systemic::detail::StatusNot Logic;
Status * a = nullptr;
bool input( Environment & env );
void build( Environment & env );
struct Links {
Environment::StatusId a; //!<Исходный статус "a".
Environment::StatusId logic_not; //!<Отрицание исходного статуса "a".
};
const Links & links;
StatusNot( const Links & links );
};
//!Логическое "И" статусов. Реализует логику "a and b".
struct StatusAnd : public ISetupStep {
typedef systemic::IStatus Status;
typedef systemic::detail::StatusAnd<2> Logic;
Status * a = nullptr;
Status * b = nullptr;
bool input( Environment & env );
void build( Environment & env );
struct Links {
Environment::StatusId a; //!<Исходный статус "a".
Environment::StatusId logic_and; //!<Логическое "И" статусов "a" и "b".
Environment::StatusId b; //!<Исходный статус "b".
};
const Links & links;
StatusAnd( const Links & links );
};
//!Логическое "ИЛИ" статусов. Реализует логику "a or b".
struct StatusOr : public ISetupStep {
typedef systemic::IStatus Status;
typedef systemic::detail::StatusOr<2> Logic;
Status * a = nullptr;
Status * b = nullptr;
bool input( Environment & env );
void build( Environment & env );
struct Links {
Environment::StatusId a; //!<Исходный статус "a".
Environment::StatusId logic_or; //!<Логическое "ИЛИ" статусов "a" и "b".
Environment::StatusId b; //!<Исходный статус "b".
};
const Links & links;
StatusOr( const Links & links );
};
////!Логическое "исключающее ИЛИ" статусов. Реализует логику "a xor b".
//struct StatusXor : public ISetupStep {
//
// typedef systemic::IStatus Status;
// typedef systemic::detail::StatusXor<2> Logic;
//
// Status * a = nullptr;
// Status * b = nullptr;
//
// bool input( Environment & env );
// void build( Environment & env );
//
// struct Links {
// Environment::StatusId a; //!<Исходный статус "a".
// Environment::StatusId logic_xor; //!<Логическое "ИЛИ" статусов "a" и "b".
// Environment::StatusId b; //!<Исходный статус "b".
// };
//
// const Links & links;
// StatusXor( const Links & links );
//};
} /* namespace schematic */
} /* namespace application */
#endif /* SOURCE_APPLICATION_SCHEMATIC_STATUSLOGICSETUP_H_ */