eeros_architecture:sequencer:sequencer
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:sequencer [2017/08/09 10:15] – [Sequencer] graf | eeros_architecture:sequencer:sequencer [2021/04/20 15:33] – [Sequencer] ursgraf | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== Sequencer ====== | ====== Sequencer ====== | ||
The sequencer is responsible to run the main sequence. There is a single instance of the sequencer and therefore only one main sequence. Further, the sequencer contains a list with all sequences. Whenever you define a sequence it will automatically be added to this list. The list helps to retrieve a reference to a given sequence. This can be helpful is you wish to pass information into this sequence.\\ | The sequencer is responsible to run the main sequence. There is a single instance of the sequencer and therefore only one main sequence. Further, the sequencer contains a list with all sequences. Whenever you define a sequence it will automatically be added to this list. The list helps to retrieve a reference to a given sequence. This can be helpful is you wish to pass information into this sequence.\\ | ||
- | Get the instance of the sequencer. | + | First, get the instance of the sequencer. |
<code cpp> | <code cpp> | ||
- | auto& sequencer = Sequencer::getInstance(); // get instance | + | auto& sequencer = Sequencer::instance(); |
</ | </ | ||
- | The next step is to define a meaningfull | + | The next step is to define a meaningfull sequence (see [[.: |
<code cpp> | <code cpp> | ||
MainSequence mainSequence(" | MainSequence mainSequence(" | ||
- | | + | |
- | | + | ... |
- | | + | |
</ | </ | ||
+ | ===== Forcing the Sequencer to Stop Immediately ===== | ||
+ | For a system under development you often want to abort a running system. This case must be handled carefully. As described in [[getting_started: | ||
+ | <code cpp> | ||
+ | void signalHandler(int signum) { | ||
+ | SafetySystem:: | ||
+ | Sequencer:: | ||
+ | } | ||
+ | </ | ||
+ | not only the safety system will gracefully shutdown but the sequencer running any set of sequences will abort as well. Please make sure that your program waits for those sequences to abort before your main program stops. This can be accomplished as follows: | ||
+ | <code cpp> | ||
+ | ... | ||
+ | sequencer.wait(); | ||
+ | ... | ||
+ | </ | ||
eeros_architecture/sequencer/sequencer.txt · Last modified: 2021/12/23 17:40 by ursgraf