![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Enumeration Type as argument of an Event Topic Summary: Created On: 10-Oct-2007 11:18 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||
Hi,
I have problems to pass an enumeration type as argument of an event (declared as Reception function). I am able to build the projet, but in the simulation of the statechart, when I generate the event and try to read the parameter of the event using the params-> mechanism, the interpretation is wrong. I have tested the enum type in a primitive function and it works fine. Also I have an event whose argument is a predefined type(unsigned char) and it works. Thanks in advance |
|||
![]() |
|||
![]() |
|||
Hi. The answer is in creating serialisation and deserialisation functions for the enumeration type. These ensure that animation displays the interpreted value of the numerical value. I'll supply more details on this tomorrow, if that's OK. If you are in a mighty rush support may beat me to it.
------------------------- ----------------------- Matthew Thomas Panasonic Manufacturing UK Ltd |
|||
![]() |
|||
![]() |
|||
Hi, my problem is not how to display the interpreted value. I would like to use the enumeration as a basic type, that means, be able to get the value of a variable of this type when it is an atributte of a event.
Working whit Rhapsody System Designer Edition, I declare an event, for example Ev_receiveParam(MyEnum color) and I associate it to a transition. But try to get the parameter using the mechanism params->color in the transition?s action doesnt?t work. However, I have not problems to access to variables of this type defined in primitive functions. |
|||
![]() |
|||
![]() |
|||
I'd suggest that you post a small screen shot of the part of the state diagram that includes params->color and whatever error message you get (by "doesn't work" I presume you mean you get a compiler error?).
|
|||
![]() |
|||
![]() |
|||
Charlie Lane is right of course: a better definition of the problem will help to give you a more focussed answer. I had promised to provide information on the serialisation functions - and from your description I think they may still be relevant. Even if they are not, they are of general use and should live in the customer community.
As I am away from the tool, the best I can do is provide you with a zip file provided to me by support some time ago. I found it useful. It contains a model with examples of serialisation functions tailored to getting that to work with TestConductor. As it includes serialisation of enums in an event, it may be relevant to you. The enumeration data type tDay, used in event evDay, has a serialisation and unserialisation function (serializeDay in Package TypesPkg, unserializeDay in Package TypesPkg). To get the whole picture with these functions, search for references of the tDay type, and note the serialisation and unserialisation functions. Serialisation returns a string from the enum value, unserialisation does the reverse - taking a string and returning the enum value. Also look for the peppering of overridden properties, e.g. of the enum types themselves (CPP_CG:Type:AnimSerializeOperation). You also need to override the properties of the events. I'd be more comprehensive, but as I say, I'm away from the tool. Any questions I'll help if I can. Cheers, Matt
------------------------- ----------------------- Matthew Thomas Panasonic Manufacturing UK Ltd |
|||
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Enumeration Type as argument of an Event
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.