Files
Matthias Mitscherlich 9cbd2232a3 updated the clock to show special I LOVE YOU date messages
tweaked the LED strip for more stability
2024-03-29 10:42:33 +01:00

111 lines
3.6 KiB
C++

// --------------------------------------------------------------------------------------------------------------------
/// \file clock.h
/// \brief File description
// --------------------------------------------------------------------------------------------------------------------
//
// vbchaos software design
//
// --------------------------------------------------------------------------------------------------------------------
/// $Revision: $
/// $Author: $
/// $Date: $
// (c) 2023 vbchaos
// --------------------------------------------------------------------------------------------------------------------
#ifndef MAIN_APPLICATION_INC_CLOCK_H_
#define MAIN_APPLICATION_INC_CLOCK_H_
/**
* clock implementation
* \defgroup clock
* \brief {group_description}
* \addtogroup {Layer}
*
* Detailed description
* @{
*/
// --------------------------------------------------------------------------------------------------------------------
// Include files
// --------------------------------------------------------------------------------------------------------------------
// CompilerIncludes
// All include files that are provided by the compiler directly
#include <string>
#include <list>
// ProjectIncludes
// All include files that are provided by the project
#include "time.h"
// --------------------------------------------------------------------------------------------------------------------
// Constant and macro definitions
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Type definitions.
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Function declarations
// --------------------------------------------------------------------------------------------------------------------
class Clock
{
// -----------------------------------------------------------------------------------------------------------------
// Public Section
// -----------------------------------------------------------------------------------------------------------------
public:
typedef enum
{
TEN_BEFORE_HALF,
TWENTY_OVER
}Mode_t;
// Class Constructor
Clock(Mode_t mode);
void generateWordlist(std::list<std::string>* wordlist);
time_t getTime(void);
// -----------------------------------------------------------------------------------------------------------------
// Protected Section
// -----------------------------------------------------------------------------------------------------------------
protected:
// -----------------------------------------------------------------------------------------------------------------
// Private Section
// -----------------------------------------------------------------------------------------------------------------
private:
Mode_t clockmode;
time_t currentTime;
std::string toNumbers[20] {"zero", "one", "two", "three", "four",
"five", "six", "seven", "eight",
"nine", "ten", "eleven", "twelve",
"thirteen", "fourteen", "fifteen",
"sixteen", "seventeen", "eighteen",
"nineteen"};
int calculateHours(struct tm time);
std::list<struct tm> loveulist;
};
/** @} */
#endif /* MAIN_APPLICATION_INC_CLOCK_H_ */