#include "EventsSequencer.hpp"
Public Member Functions | |
EventsSequencer () | |
bool | IsPerpetual () const |
bool | IsPPointer () const |
bool | IsPaused () const |
void | begin (bool inPerpetual) |
void | AddEvent (unsigned long inId, COMMANDERS_EVENT_TYPE inType, int inData, unsigned long inDelay) |
void | AddEvents (const EventsSequencerItem *apEvents) |
void | StartItem (EventsSequencerItem *inItem = NULL) |
void | Start () |
void | Stop () |
void | Pause () |
void | Continue () |
bool | loop () |
void | printSequencer () |
Static Public Member Functions | |
static void | loops () |
static void | printAllSequencers () |
Public Attributes | |
EventsSequencerItem * | pFirst |
EventsSequencerItem * | pCurrent |
This class represents an event sequencer : a list of events raised at given intervals. This is the way to program some animations using several lights/motors and other accessories.
The sequence can be started from the beginning or from any item of the list. When started, it can be completely stopped, or just paused. When paused, the timer is stopped and restart at its previous position when unpaused.
Definition at line 45 of file EventsSequencer.hpp.
EventsSequencer::EventsSequencer | ( | ) |
Default constructor
Definition at line 6 of file EventsSequencer.cpp.
void EventsSequencer::AddEvent | ( | unsigned long | inId, |
COMMANDERS_EVENT_TYPE | inType, | ||
int | inData, | ||
unsigned long | inDelay | ||
) |
Add a new event to the list.
inId | id of the event |
inType | type |
inData | associated data |
inDelay | time in milliseconds before the next event. |
Definition at line 20 of file EventsSequencer.cpp.
void EventsSequencer::AddEvents | ( | const EventsSequencerItem * | apEvents | ) |
Add an event list in program memory PROGMEM.
apEvents | List of events declared with PROGMEM |
Definition at line 40 of file EventsSequencer.cpp.
|
inline |
Begin of the EventsSequencer.
inPerpetual | if true, the sequencer will never stop, returning to the first item after the last one. |
Definition at line 132 of file EventsSequencer.hpp.
|
inline |
Continue the execution after a pause.
Definition at line 160 of file EventsSequencer.hpp.
|
inline |
Checks if the sequence is paused : the Pause() function has been called..
Definition at line 127 of file EventsSequencer.hpp.
|
inline |
Checks if the sequence is perpetual : at the end, restart from the begginning.
Definition at line 119 of file EventsSequencer.hpp.
|
inline |
Checks if the sequence storage is in a PROGMEM container
Definition at line 123 of file EventsSequencer.hpp.
bool EventsSequencer::loop | ( | ) |
Main loop of this sequencer
Definition at line 125 of file EventsSequencer.cpp.
|
static |
Main loop of all sequencers
Definition at line 161 of file EventsSequencer.cpp.
|
inline |
Pause the execution.
Definition at line 157 of file EventsSequencer.hpp.
|
static |
Print all Sequencers on the console.
Definition at line 204 of file EventsSequencer.cpp.
void EventsSequencer::printSequencer | ( | ) |
Print this Sequencer on the console.
Definition at line 173 of file EventsSequencer.cpp.
|
inline |
Sets the current item to first to start the execution.
Definition at line 151 of file EventsSequencer.hpp.
void EventsSequencer::StartItem | ( | EventsSequencerItem * | inItem = NULL | ) |
Sets the current item to first to start the execution.
Definition at line 88 of file EventsSequencer.cpp.
|
inline |
Stops the execution by nulling the current item.
Definition at line 154 of file EventsSequencer.hpp.
EventsSequencerItem* EventsSequencer::pCurrent |
Current executed item.
Definition at line 110 of file EventsSequencer.hpp.
EventsSequencerItem* EventsSequencer::pFirst |
First item of the chained list of sequences.
Definition at line 107 of file EventsSequencer.hpp.