30 const std::vector<IO::channel_t>& channels,
32 : name(std::move(blockname))
33 , isInputDependent(isdependent)
36 for (
const auto& channel : channels) {
37 port.channel_info = channel;
39 port.buff_value = 0.0;
41 ports[channel.flags].push_back(port);
49 return this->ports[type].size();
55 return this->ports[type][index].channel_info.name;
62 return this->ports[type][index].channel_info.description;
67 this->ports[
IO::INPUT][index].buff_value += data;
76 this->ports[
IO::INPUT][index].buff_value = 0.0;
77 return this->ports[
IO::INPUT][index].value;
87 return this->ports[direction][index].value;
double & readinput(size_t index)
void writeoutput(size_t index, const double &data)
Block(std::string blockname, const std::vector< channel_t > &channels, bool isdependent)
std::string getChannelName(IO::flags_t type, size_t index) const
std::string getChannelDescription(IO::flags_t type, size_t index) const
size_t getCount(flags_t type) const
void writeinput(size_t index, const double &data)
const double & readPort(IO::flags_t direction, size_t index)