48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
/*
|
||
* SignalTable2DInitializer.cpp
|
||
*
|
||
* Created on: 2 февр. 2023 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
#include "SignalTable2D.hh"
|
||
#include "../../systemic/ApplyParameter.hpp"
|
||
|
||
|
||
bool application::schematic::SignalTable2D::input(
|
||
Environment & env ) {
|
||
|
||
|
||
|
||
return ( status_a = env.statuses.get( links.status_a ) )
|
||
and ( status_b = env.statuses.get( links.status_b ) )
|
||
and ( parameter = systemic::getSetting<SetterValueTable>( env.cparams, provider, links.table ) );
|
||
|
||
}
|
||
|
||
void application::schematic::SignalTable2D::build(
|
||
Environment & env ) {
|
||
|
||
systemic::LocalSetting<SetterValueTable> ls( parameter );
|
||
|
||
systemic::IStatus * statuses[2] = { status_a, status_b };
|
||
Object * obj = memories::instance_object<Object>( env.static_object_ma, statuses );
|
||
SetterValueTable * setter = memories::instance_object<SetterValueTable>( env.static_object_ma, obj );
|
||
|
||
setter->configure( ls.setting );
|
||
|
||
env.signals.add( links.value, obj );
|
||
|
||
if( links.apply_table ) {
|
||
|
||
typedef systemic::IFunctor<void> Action;
|
||
typedef systemic::ApplyParameter<SetterValueTable> ApplyMapperParams;
|
||
systemic::ApplyParameter<SetterValueTable> * apply = memories::instance_object<ApplyMapperParams>(env.static_object_ma, *setter, parameter );
|
||
|
||
env.rholder.share<Action>( *apply, links.apply_table );
|
||
|
||
}
|
||
|
||
}
|
||
|