Hi all,
I basically have a QStateMachine with 3 states: A, B and C.
I want to model state machine transitions like:
1) A -> B [event e1]
2) A -> C [event e1]
3) B -> C [event e2]
And I want to add exclusive guard on transitions #1 and #2 like:
1) if (myModel.v)
3) if (!myModel.v)
The final goal is to manage locking of access from A to C by inserting password:
when I am in A and fire e1 (for example by clicking on a button in my GUI):
- if "myModel.v" is not set (i.e. C is still locked by password) go to state B (to insert password)
- if "myModel.v" is set (that is C was unlocked) go to state C.
What is the best way to add these guards on transitions?
Can you give me a small example?
Thank you,
Nicola
Bookmarks