From b9826e06eeb8e8675245436d4fcaa83fda19c996 Mon Sep 17 00:00:00 2001 From: "T. van der Zwan" Date: Mon, 9 Sep 2013 17:14:49 +0000 Subject: [PATCH] Added doxygen comments --- libsrc/bootsequence/AbstractBootSequence.h | 24 +++++++++++++++++++++- libsrc/bootsequence/KittBootSequence.h | 22 +++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/libsrc/bootsequence/AbstractBootSequence.h b/libsrc/bootsequence/AbstractBootSequence.h index bd2d944b..8ef7e712 100644 --- a/libsrc/bootsequence/AbstractBootSequence.h +++ b/libsrc/bootsequence/AbstractBootSequence.h @@ -9,20 +9,42 @@ // Hyperion includes #include +/// +/// The AbstractBootSequence is an 'abstract' implementation of the BootSequence that handles the +/// event generation and Hyperion connection. Subclasses only need to specify the interval and +/// return the colors for the leds for each iteration. +/// class AbstractBootSequence : public QObject, public BootSequence { Q_OBJECT public: + /// + /// Constructs the AbstractBootSequence with the given parameters + /// + /// @param hyperion The Hyperion instance + /// @param interval The interval between new led colors + /// @param iterationCnt The number of iteration performed by the boot sequence + /// AbstractBootSequence(Hyperion * hyperion, const int64_t interval, const unsigned iterationCnt); + /// + /// Starts the boot-sequence + /// virtual void start(); protected slots: + /// + /// Timer slot for handling each interval of the boot-sequence + /// void update(); - protected: + /// + /// Child-classes must implement this by returning the next led colors in the sequence + /// + /// @return The next led colors in the boot sequence + /// virtual const std::vector& nextColors() = 0; private: diff --git a/libsrc/bootsequence/KittBootSequence.h b/libsrc/bootsequence/KittBootSequence.h index 809027b9..ccd26845 100644 --- a/libsrc/bootsequence/KittBootSequence.h +++ b/libsrc/bootsequence/KittBootSequence.h @@ -8,14 +8,31 @@ #include #include - +/// +/// The KITT BootSequence is a boot sequence inspired by the Knight Rider car: Knight Industries Two +/// Thousand (aka KITT) +/// class KittBootSequence : public AbstractBootSequence { public: + /// + /// Constructs the KITT BootSequence + /// + /// @param[in] hyperion The Hyperion instance + /// @param[in] duration_ms The length of the sequence [ms] + /// KittBootSequence(Hyperion * hyperion, const unsigned duration_ms); + /// + /// Destructor, deletes the processor + /// virtual ~KittBootSequence(); + /// + /// Returns the next led color sequence + /// + /// @return The next colors for the leds + /// virtual const std::vector& nextColors(); private: @@ -28,9 +45,12 @@ private: /// The vector with led-colors std::vector _ledColors; + /// Direction the red-light is currently moving bool _forwardMove = true; + /// The location of the current red-light unsigned _currentLight = 0; + /// Moves the current light to the next (increase or decrease depending on direction) void moveNextLight(); };