102 lines
3.8 KiB
C++
102 lines
3.8 KiB
C++
/*
|
||
* AddFailure.hh
|
||
*
|
||
* Created on: 2 мар. 2023 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
#ifndef UMLIBRARY_APPLICATION_SAFETY_ADDFAILURE_HH_
|
||
#define UMLIBRARY_APPLICATION_SAFETY_ADDFAILURE_HH_
|
||
|
||
#include "../ISetupStep.hh"
|
||
|
||
#include "../../processing/failure/FailureDiagnostics.hh"
|
||
#include "../../systemic/IStatus.hh"
|
||
|
||
#include "../../units/LogicalEntities.hpp"
|
||
|
||
namespace application { namespace safety {
|
||
|
||
//!Модуль регистрирует условие для диагностики отказа в соответсвующем процессе.
|
||
/*!Модуль позволяет добавить отказ по заданному условию "condtion" с кодом отказа "failure_id".
|
||
* Отказ будет диагностироваться во время работы процесса диагностики отказов "diagnostic".
|
||
* Дополнительный статус "stored" позволяет контролировать наличие зафиксированного события отказа.
|
||
*/
|
||
struct AddFailure : public ISetupStep {
|
||
|
||
typedef processing::failure::FailureDiagnostics FD;
|
||
|
||
FD * diagnostic = nullptr;
|
||
systemic::IStatus * failure_status = nullptr;
|
||
|
||
struct Links {
|
||
Environment::StatusId condition; //!<Условие возникновения отказа.
|
||
Environment::Id diagnostic; //!<Процесс диагностики отказов.
|
||
Environment::StatusId stored; //!<Состояние отказа.
|
||
};
|
||
|
||
struct Setting {
|
||
units::ErrorCode failure_id; //!<Идентификатор отказа.
|
||
|
||
};
|
||
|
||
bool input( Environment & env );
|
||
void build( Environment & env );
|
||
|
||
const Links & links;
|
||
const Setting & setting;
|
||
|
||
AddFailure( const Links & links, const Setting & setting ) : links(links), setting(setting) {}
|
||
};
|
||
|
||
}
|
||
}
|
||
|
||
#include "../../systemic/IFunctor.hh"
|
||
|
||
//with reset
|
||
namespace application { namespace safety {
|
||
|
||
//!Модуль регистрирует условие для диагностики отказа в соответсвующем процессе.
|
||
/*!Модуль позволяет добавить отказ по заданному условию "condtion" с кодом отказа "failure_id".
|
||
* Отказ будет диагностироваться во время работы процесса диагностики отказов "diagnostic".
|
||
* Дополнительный статус "stored" позволяет контролировать наличие зафиксированного события отказа.
|
||
* Дополнительно модуль позволяет задать условие сброса отказа, которое будет проверенно в момент сброса.
|
||
*/
|
||
struct AddFailureWithReset : public ISetupStep {
|
||
|
||
typedef processing::failure::FailureDiagnostics FD;
|
||
|
||
FD * diagnostic = nullptr;
|
||
systemic::IStatus * failure_status = nullptr;
|
||
|
||
typedef systemic::IFunctor<bool> ResetFunction;
|
||
ResetFunction * reset = nullptr;
|
||
|
||
struct Links {
|
||
Environment::StatusId condition; //!<Условие возникновения отказа.
|
||
Environment::Id reset; //!<Функция сборса отказа.
|
||
Environment::Id diagnostic; //!<Процесс диагностики отказов.
|
||
Environment::StatusId stored; //!<Состояние отказа.
|
||
};
|
||
|
||
struct Setting {
|
||
units::ErrorCode failure_id; //!<Идентификатор отказа.
|
||
};
|
||
|
||
bool input( Environment & env );
|
||
void build( Environment & env );
|
||
|
||
const Links & links;
|
||
const Setting & setting;
|
||
|
||
AddFailureWithReset( const Links & links, const Setting & setting ) : links(links), setting(setting) {}
|
||
};
|
||
|
||
}
|
||
}
|
||
|
||
|
||
|
||
#endif /* UMLIBRARY_APPLICATION_SAFETY_ADDFAILURE_HH_ */
|