CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
160 stars 54 forks source link

Provide possibility to rename Ports/Parameters in the modelDescription.xml #50

Open fajansen opened 5 years ago

fajansen commented 5 years ago

Currently the ports and parameters in the modelDescription.xml are named after the c-representation of the port/parameter name.

It would be useful to have a possibility to change the names in the modelDescription, e.g. to order them in a structure/tree for orientation, use characters not allowed in C (e.g. ':'), or fix the indexing of arrays (0-based vs. 1-based).

I see two approaches to this:

  1. Offer a way for the user to enter the mapping in the FMU generation options (as for the Visible parameters)
  2. Offer a way for the user to provide a standardized callback functions with gets called with every port/parameter and returns the name as it should show up in the modelDescription.
t-sommer commented 5 years ago

@fajansen, can you provide some examples?

fajansen commented 5 years ago

@t-sommer You mean usecases?

t-sommer commented 5 years ago

Some examples of variables you want to rename, e.g.

a -> my_a a[1] -> a[0] ...

fajansen commented 5 years ago

Your examples are good, I have the following additions:

CAN_IDENTIFIER_FRAME_NAME_SIGNAL_NAME -> CAN_IDENTIFIER::FRAME_NAME::SIGNAL_NAME Verylongnamethatwillbetruncatedbyth78 -> Verylongnamethatwillbetruncatedbythecodegenerationprocessduetovariablenamelengthrestrictions model_path_block_name_parameter_name -> model_path.block_name.parameter_name

t-sommer commented 3 years ago

@fajansen, is this still relevant?