Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

904

January 10th, 2012 23:00

How to define a Set structure attribute in dynamic model

Hi

  How to define a Set structure attribute in the dynamic model.

  In the documentation, it just point out attribute's type is limited to basic type such as string,int... How can i define a set structure which contains string for a attribute in mdl files.

BRs

David Wang

11 Posts

January 11th, 2012 00:00

Define the attribute as table just like this:

   table attributename string;

it will be constructed as MR_IS_SET.

30 Posts

January 18th, 2012 01:00

Hello David

You can do it as follow:

defintion of the enum:

enum state_e { UNKNOWN=1,UP=2,DOWN=3};

using of the enum:

attribute state_e SC_ccmStatusThr "The value it has to match to fire an event." = DOWN;

It is also possible to change from integer to a string with this enum.

computed attribute state_e SC_ccmStatus "Convert to string." = state_e(SC_ccmStatusInt) else UNKNOWN;

Regards,

Christian

No Events found!

Top