robotology / blockfactory

A tiny framework to wrap algorithms for dataflow programming
https://robotology.github.io/blockfactory
GNU Lesser General Public License v2.1
40 stars 16 forks source link

Added block identifier support #38

Closed diegoferigo closed 5 years ago

diegoferigo commented 5 years ago

This PR adds preliminary support to set a string identifier to each block. This might be useful to know directly from the core::Block interface which simulation block is associated to the block object.

Currently there is no check that this identifier is unique. In the Simulink implementation the block name matches its absolute path inside the Simulink model, and this information is also transferred to the autogenerated source passing through the TLC file.

This addition opens the possibility to create a sort of database in the autogenerated sources and access the core::Block object from its name. In this way, for instance, the block mask parameters could be accessed and edited, providing a possible solution to changing them after the code has been generated (right now they are hardcoded in the sources from the TLC).

Closes #16

diegoferigo commented 5 years ago

Yes there could have been that kind of misunderstanding, thanks for the feedback! I opted for getUniqueName().