Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State machine execution logic #135

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

psoetens
Copy link
Member

@psoetens psoetens commented Feb 4, 2016

This PR modifies the state machine execution logic in a non-backwards compatible way, but does introduce clear semantics of what is done when and in which step of the TaskContext.

Open questions:

  • Shouldn't events be enabled already in entry{} ?
    • today they are not, and since we sleep after entry{} there's no way to intercept an event that came in during entry{} and respond to that. So the thing causing the event needs to move into run{}, but then a default transition will be taken if present because the event did not have time yet to be processed if it's send().
  • Should the user have the choice where the SM goes to sleep ?
    • between exit{} and entry{}
    • between entry{} and run{}
    • between run{} and transitions {}

psoetens and others added 6 commits February 3, 2016 19:11
Upon each step, first the run state is executed and then transitions are checked.
If a transition is valid, it is executed upto the entry state of the next state.
Executing run is then a task for the next step again.

Signed-off-by: Peter Soetens <[email protected]>

Conflicts:
	rtt/scripting/StateMachine.cpp
We should only runState when the previous run finished.

Signed-off-by: Peter Soetens <[email protected]>
…tivate()

The removed line triggered a failed assert in StateMachine::enableEvents().

Signed-off-by: Johannes Meyer <[email protected]>
This patch prevents that the OperationCaller falls back to a RemoteOperationCaller implementation
and logs a warning during the test.

Signed-off-by: Johannes Meyer <[email protected]>
Yielding in the run program of state INIT already triggers the global transition
to the FINI state, before the send event can be processed and trigger a transition
to NEXT. This patch adds a condition to the global transition that only evaluates to
true after the run program has finished.

Signed-off-by: Johannes Meyer <[email protected]>
@meyerj meyerj changed the title Master statemachine execution logic State machine execution logic Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants