Search code examples
crational-numberrhapsody

Adding Tag to the type declaration


I need to add a tag value in the Type declaration as shown here:

enter image description here

The problem is that I keep getting the Tag name instead of the Tag value in the generated code. as follows.

enter image description here

any clues?

My original need was to make some #define lines and I was trying to make a stereotype for this


Solution

  • 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":

    enter image description here

    Do not use the tag in the declaration field:

    enter image description here

    Instead, add it to the CPP_CG::Type::SpecificationEpilog property, (note the space before the tag name):

    enter image description here

    Note 1: Consider using a variable instead of a type, see the following picture for details:

    enter image description here

    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.