It is currently Wed Feb 08, 2012 11:33 pm



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Query current state
PostPosted: Tue Jul 13, 2010 4:42 pm 

Joined: Fri Jun 12, 2009 2:01 pm
Posts: 1
Is there a way to in a coded test case to ask the current state of a state chart?

I know how to check if I'm in a specific state:

RTC_ASSERT_NAME("Disengaged", this->itsModeLogic.IS_IN(Disengaged));

I don't know how to simply obtain the current state.


Offline
 Profile  
 
 Post subject: Re: Query current state
PostPosted: Wed Jul 14, 2010 6:54 am 

Joined: Mon Jan 25, 2010 11:40 am
Posts: 12
Hi stevzie,

by default Rhapsody generates int variables (like rootstate_substate, rootstate_active) which are
protected in order to store the current states. If you want to have direct access to these state variables
you can add an operation to your class containing the statechart that returns the values of these variables,
e.g.

int getCurrentState() { return rootstate_active; }

However, please be aware that in general more than one state is active, and that Rhapsody uses several
variables to store the current state, so make sure you are querying the relevant variables.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:


suspicion-preferred