I need to add a tag value in the Type declaration as shown here:
The problem is that I keep getting the Tag name instead of the Tag value in the generated code. as follows.
My original need was to make some #define lines and I was trying to make a stereotype for this
Unfortunately, the tag value is not evaluated in the declaration field. Here is a workaround:
Let's say the name of the tag is "repeat_time":
Do not use the tag in the declaration field:
Instead, add it to the CPP_CG::Type::SpecificationEpilog
property,
(note the space before the tag name):
Note 1: Consider using a variable instead of a type, see the following picture for details:
Generated code:
//#[ type CANSM_MODEREQ_REPEAT_TIME
#define CANSM_MODEREQ_REPEAT_TIME 100
//#]
//## attribute CANSM_MODERSP_REPEAT_TIME
#define CANSM_MODERSP_REPEAT_TIME 200
Note 2: Consider using a stereotype to overload the properties.