48 lines
1.6 KiB
C++
48 lines
1.6 KiB
C++
/*
|
|
* NullEstimate.cpp
|
|
*
|
|
* Created on: 17 èþë. 2020 ã.
|
|
* Author: LeonidTitov
|
|
*/
|
|
|
|
#include "NullEstimate.hh"
|
|
|
|
bool application::procedures::NullEstimate::input( Environment & env ) {
|
|
|
|
typedef technological::adapter::TieInterface<vector::IStandingVectorSet> VectorInterface;
|
|
|
|
return ( position = env.signals.get( links.position ) )
|
|
and ( vector_control = env.rholder.getShared<VectorInterface>( links.vector_ctrl ) )
|
|
and ( buffer = env.rholder.getShared<std::pmr::monotonic_buffer_resource>( links.buffer ) )
|
|
and ( parameter = systemic::getSetting<technological::function::NullEstimationByVoltage>( env.cparams, provider, links.params ) );
|
|
|
|
}
|
|
|
|
void application::procedures::NullEstimate::build( Environment & env ) {
|
|
|
|
typedef technological::function::NullEstimationByVoltage NEBV;
|
|
|
|
systemic::LocalSetting<NEBV> ls( parameter );
|
|
|
|
NEBV * procedure = memories::instance_object<NEBV>( env.static_object_ma, *vector_control, *position, *buffer );
|
|
|
|
procedure->configure( ls.setting );
|
|
|
|
systemic::ProcScheduler::ProcessParameter proc = {
|
|
.priority = params.priority,
|
|
.period = params.period, .phase = params.phase,
|
|
.controlled = true
|
|
};
|
|
env.scheduler.registerProcess( params.processor_id, *procedure,
|
|
proc );
|
|
|
|
env.rholder.share<technological::ITechFunction>( *procedure, links.procedure );
|
|
env.rholder.share<processing::calc::IComputingTaskHolder>( *procedure, links.task );
|
|
|
|
}
|
|
|
|
application::procedures::NullEstimate::NullEstimate(
|
|
const Links & links, const configuration::ProcessConfig & params ) : links(links), params(params) {}
|
|
|
|
|