2013-08-25 18:20:19 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// QT includes
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
// Bootsequence include
|
2013-09-09 17:24:36 +02:00
|
|
|
#include "AbstractBootSequence.h"
|
2013-08-25 18:20:19 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// The RainborBootSequence shows a 'rainbow' (all lights have a different color). The rainbow is
|
|
|
|
/// rotated over each led during the length of the sequence.
|
|
|
|
///
|
2013-09-09 17:24:36 +02:00
|
|
|
class RainbowBootSequence : public AbstractBootSequence
|
2013-08-25 18:20:19 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
/// Constructs the rainbow boot-sequence. Hyperion is used for writing the led colors. The given
|
|
|
|
/// duration is the length of the sequence.
|
|
|
|
///
|
|
|
|
/// @param[in] hyperion The Hyperion instance
|
|
|
|
/// @param[in] duration_ms The length of the sequence [ms]
|
|
|
|
///
|
|
|
|
RainbowBootSequence(Hyperion * hyperion, const unsigned duration_ms);
|
|
|
|
|
2013-09-09 17:24:36 +02:00
|
|
|
protected:
|
2013-08-25 18:20:19 +02:00
|
|
|
///
|
|
|
|
/// Moves the rainbow one led further
|
|
|
|
///
|
2013-11-11 10:00:37 +01:00
|
|
|
const std::vector<ColorRgb>& nextColors();
|
2013-08-25 18:20:19 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// The current color of the boot sequence (the rainbow)
|
2013-11-11 10:00:37 +01:00
|
|
|
std::vector<ColorRgb> _ledColors;
|
2013-08-25 18:20:19 +02:00
|
|
|
/// The counter of the number of iterations left
|
|
|
|
int _iterationCounter;
|
|
|
|
};
|
|
|
|
|