eeros_architecture:sequencer:define_sequence
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
eeros_architecture:sequencer:define_sequence [2020/05/22 11:08] – [Define the Action] ursgraf | eeros_architecture:sequencer:define_sequence [2021/06/02 15:09] – [Define the Action] ursgraf | ||
---|---|---|---|
Line 56: | Line 56: | ||
} | } | ||
</ | </ | ||
- | Its mandatory to implement this function. If not, no work is done and the step or sequence terminates immediately. \\ | + | Its mandatory to implement this function. If not, no work is done and the step or sequence terminates immediately. |
+ | A step or blocking sequence can return a value of type '' | ||
There might be sequences which should never stop. This must be done as shown below: | There might be sequences which should never stop. This must be done as shown below: | ||
<code cpp> | <code cpp> | ||
public: | public: | ||
int action() { | int action() { | ||
- | while (Sequencer::running) step1(); | + | while (state == SequenceState::running) step1(); |
// while (true) step1(); | // while (true) step1(); | ||
return 0; | return 0; | ||
} | } | ||
</ | </ | ||
- | This guarantees that the sequence could be stopped by the main program | + | This guarantees that the sequence could be aborted, resumed or restarted |
===== Define Preconditions ===== | ===== Define Preconditions ===== | ||
You may want to start a sequence or step only if a certain precondition is met. Override the function // | You may want to start a sequence or step only if a certain precondition is met. Override the function // | ||
Line 113: | Line 115: | ||
As mentioned before you should never wait by using //sleep// in a action method. However, quite often it is desirable to wait for some time to pass when running sequences. How to do properly? Use the predefined step '' | As mentioned before you should never wait by using //sleep// in a action method. However, quite often it is desirable to wait for some time to pass when running sequences. How to do properly? Use the predefined step '' | ||
- | ===== Returning Values ===== | + | |
- | A step or blocking sequence can return a value of type '' | + |
eeros_architecture/sequencer/define_sequence.txt · Last modified: 2023/02/26 00:25 by ursgraf