55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
/*
|
||
* SignalFromBitmapU16.cpp
|
||
*
|
||
* Created on: 13 авг. 2020 г.
|
||
* Author: s.maksimenko
|
||
*/
|
||
|
||
#include <memory_resource>
|
||
#include "SignalFromBitmapU16.hh"
|
||
#include "../../schematic/BitmapU16ToSignal.hpp"
|
||
|
||
namespace application {
|
||
namespace schematic {
|
||
|
||
SignalFromBitmapU16::SignalFromBitmapU16(
|
||
const Links & links, const Setting & sett ) : links(links), config(sett) {}
|
||
|
||
bool SignalFromBitmapU16::input ( Environment & env ) {
|
||
|
||
return grab( port_input, env.rholder.getShared<volatile PortInput>( links.port_input_u16 ) )
|
||
and grab( port_output, env.rholder.getShared<volatile PortOutput>( links.port_output_u16 ) );
|
||
|
||
}
|
||
|
||
bool SignalFromBitmapU16::prepare () {
|
||
return true;
|
||
}
|
||
|
||
void SignalFromBitmapU16::build ( Environment & env ) {
|
||
|
||
Local<volatile PortInput> local_port_input( port_input, *env.rholder.getShared<volatile PortInput>( links.port_input_u16 ) );
|
||
Local<volatile PortOutput> local_port_output( port_output, *env.rholder.getShared<volatile PortOutput>( links.port_output_u16 ) );
|
||
|
||
using ::schematic::BitmapU16ToSignal;
|
||
|
||
BitmapU16ToSignal::Setting sett;
|
||
sett.iFirstBit = config.index_first_bit;
|
||
sett.nBits = config.number_bits;
|
||
sett.bInvCode = config.inverse_code;
|
||
|
||
BitmapU16ToSignal* pBitmap2Signal =
|
||
memories::instance_object<BitmapU16ToSignal> (
|
||
env.static_setup_ma,
|
||
port_input->data, sett
|
||
);
|
||
|
||
env.signals.add ( links.signal_id, pBitmap2Signal );
|
||
}
|
||
|
||
|
||
}// namespace schematic
|
||
}// namespace application
|
||
|
||
|