robotology / blockfactory

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

Load the plugin library also from the automatically generated code #2

Closed diegoferigo closed 5 years ago

diegoferigo commented 5 years ago

Before separating this repository, the class autogenerated by Simulink Coder was linked together with the library that contains the blocks. This allowed to instantiate the blocks directly, including their headers to the header of the autogenerated class (using the TLC functionalities).

This inclusion would be possible also now, after the split, if the class of the block would expose a parameter with the full header name instead of only the block class name. To do so, however, the block developer should remember to add this new parameter since it would be difficult to do it automatically.

Since we already have the factory working for loading the block library from the Simulink S-Function, I would rather use this approach also from the autogenerated class. In this way there isn't anymore the need to specify the block header since only its interface would suffice.

traversaro commented 5 years ago

Side-note: we may need to revise this in the future if we want to ever support source code FMUs as a target, see:

However, I agree that this is the best solution at the moment.