87 lines
2.3 KiB
C++
87 lines
2.3 KiB
C++
/*
|
||
* AddFailureSetup.h
|
||
*
|
||
* Created on: 8 окт. 2019 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
#ifndef SOURCE_APPLICATION_SAFETY_ADDFAILURESETUP_H_
|
||
#define SOURCE_APPLICATION_SAFETY_ADDFAILURESETUP_H_
|
||
|
||
#include "../ISetupStep.hh"
|
||
|
||
#include "../../processing/failure/FailureDiagnostics.hh"
|
||
#include "../../systemic/IStatus.hh"
|
||
|
||
#include "../../units/LogicalEntities.hpp"
|
||
|
||
namespace application { namespace safety {
|
||
|
||
struct AddFailureSetupWithoutReset : public ISetupStep {
|
||
|
||
typedef processing::failure::FailureDiagnostics FD;
|
||
|
||
FD * diagnostic = nullptr;
|
||
systemic::IStatus * failure_status = nullptr;
|
||
|
||
struct Links {
|
||
Environment::StatusId failure_id; //!<Условие возникновения отказа.
|
||
Environment::Id diagnoster_id; //!<Процесс диагностики отказов.
|
||
};
|
||
|
||
struct Setting {
|
||
units::ErrorCode failure_id; //!<Идентификатор отказа.
|
||
|
||
};
|
||
|
||
bool input( Environment & env );
|
||
void build( Environment & env );
|
||
|
||
const Links & links;
|
||
const Setting & setting;
|
||
|
||
AddFailureSetupWithoutReset( const Links & links, const Setting & setting ) : links(links), setting(setting) {}
|
||
};
|
||
|
||
}
|
||
}
|
||
|
||
#include "../../systemic/IFunctor.hh"
|
||
|
||
//with reset
|
||
namespace application { namespace safety {
|
||
|
||
struct AddFailureSetupWithReset : 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 failure_id; //!<Условие возникновения отказа.
|
||
Environment::Id reset_id; //!<Функция сборса отказа.
|
||
Environment::Id diagnoster_id; //!<Процесс диагностики отказов.
|
||
};
|
||
|
||
struct Setting {
|
||
units::ErrorCode failure_id; //!<Идентификатор отказа.
|
||
};
|
||
|
||
bool input( Environment & env );
|
||
void build( Environment & env );
|
||
|
||
const Links & links;
|
||
const Setting & setting;
|
||
|
||
AddFailureSetupWithReset( const Links & links, const Setting & setting ) : links(links), setting(setting) {}
|
||
};
|
||
|
||
}
|
||
}
|
||
|
||
#endif /* SOURCE_APPLICATION_SAFETY_ADDFAILURESETUP_H_ */
|