39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
/*
|
||
* ReversCounter.cpp
|
||
*
|
||
* Created on: 20 мая 2021 г.
|
||
* Author: sozonov
|
||
*/
|
||
#include "../../systemic/MemberFuntion.hpp"
|
||
#include "../../systemic/ValueLazyFast.hpp"
|
||
#include "ReversCounter.hh"
|
||
|
||
bool application::schematic::ActionCounter::input( Environment & env ) {
|
||
|
||
return grab( border_cross, env.rholder.getShared<Action>( links.border_cross ) );
|
||
|
||
}
|
||
|
||
void application::schematic::ActionCounter::build( Environment & env ) {
|
||
|
||
typedef ::application::schematic::CallBackReversCounter ReversCount;
|
||
|
||
ReversCount * revers_count = memories::instance_object<ReversCount>(env.static_data_ma, *border_cross, setting.direction,
|
||
setting.module, setting.reset_value);
|
||
|
||
typedef systemic::detail::MemberFuntion<ReversCounter, void, &ReversCounter::reset > ActionReset;
|
||
ActionReset * action_reset = memories::instance_object<ActionReset>( env.static_setup_ma, *revers_count );
|
||
env.rholder.share<Action>( *action_reset, links.reset );
|
||
|
||
typedef systemic::detail::MemberFuntion<ReversCounter, void, &ReversCounter::count > ActionCount;
|
||
ActionCount * action_count = memories::instance_object<ActionCount>( env.static_setup_ma, *revers_count );
|
||
env.rholder.share<Action>( *action_count, links.count);
|
||
|
||
typedef systemic::detail::ValueLazyFast< float, ReversCount, &ReversCount::getCountf > GetCountValue;
|
||
env.signals.add( links.value, memories::instance_object<GetCountValue>( env.static_setup_ma, *revers_count ) );
|
||
|
||
|
||
}
|
||
|
||
|