Query the current substate of a parallel region

41 views
Skip to first unread message

Ulrich Schuster

unread,
Nov 23, 2014, 4:16:33 PM11/23/14
to squirrel-st...@googlegroups.com
Hi there

I just started using the squirrel framework - it's great! Thanks very much for developing and sharing!

I am still exploring the framework. My goal is to use is as a mock of a mobile device, so I can test backend functions without actual devices in the field. I have two active regions - on to mimic the wireless connection, which might go down any time; and one for the controller. For a transition between controller states CTRL_A and CTRL_B, I want to set up a guard that enables the transition only if the device is online - that is, if the the WIRELESS region is in state ONLINE. How can I query the current state in the neighboring parallel region from within a Condition<> object?

Thanks very much for your help!
Uli

He Henry

unread,
Nov 25, 2014, 11:01:57 AM11/25/14
to squirrel-st...@googlegroups.com
Hi Ulrich,

Sorry for late reply. I am glad you like the library.

I am not quite understand your question, what means "How can I query the current state in the neighboring parallel region from within a Condition<> object"? It would be helpful if you can write some pseudocode to describe your question. And in case you want to query substates of a parallel state, you can try "StateMachine.getSubStatesOn(AParallelState)" which will return substates of current parallel state.

Thanks,
Henry

在 2014年11月24日星期一UTC+8上午5时16分33秒,Ulrich Schuster写道:
Reply all
Reply to author
Forward
0 new messages