42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
/*
|
|
* FailureDiagnosticsInitializer.cpp
|
|
*
|
|
* Created on: 19 àâã. 2021 ã.
|
|
* Author: titov
|
|
*/
|
|
|
|
#include "FailureDiagnosticsSetup.hh"
|
|
|
|
#include "../../processing/failure/FailureDiagnostics.hh"
|
|
|
|
bool application::safety::FailureDiagnosticsSetup::input(
|
|
Environment & env ) {
|
|
|
|
return grab( memory, env.rholder.getShared<std::pmr::memory_resource>( links.memory_id ) )
|
|
and grab( manager, env.rholder.getShared<FMI>( links.manager_id ) );
|
|
|
|
}
|
|
|
|
void application::safety::FailureDiagnosticsSetup::build(
|
|
Environment & env ) {
|
|
//todo: Íàðóøåíèå òðåáîâàíèé ê ÂÏÎ â ÷àñòè óïðàâëåíèÿ ðåñóðñàìè.
|
|
Local<FMI> man( manager, *env.rholder.getShared<FMI>(links.manager_id) );
|
|
Local<std::pmr::memory_resource> mem( memory, *env.rholder.getShared<std::pmr::memory_resource>(links.memory_id) );
|
|
|
|
typedef processing::failure::FailureDiagnostics FD;
|
|
|
|
FD * diag = memories::instance_object<FD>( env.static_object_ma, *manager, memory );
|
|
|
|
systemic::ProcScheduler::ProcessParameter proc = {
|
|
.priority = params.priority,
|
|
.period = params.period, .phase = params.phase,
|
|
.controlled = false
|
|
};
|
|
|
|
env.scheduler.registerProcess( params.processor_id, *diag,
|
|
proc );
|
|
|
|
env.rholder.share( *diag, links.diagnoster_id );
|
|
}
|
|
|