Added clock and wordclock - functional

the matrix needs an update, though. Not all words are well put
This commit is contained in:
Matthias Mitscherlich
2023-01-18 14:54:23 +01:00
parent 1ae7d6ec5a
commit 7cb84d1660
8 changed files with 667 additions and 25 deletions
+105
View File
@@ -0,0 +1,105 @@
// --------------------------------------------------------------------------------------------------------------------
/// \file clock.h
/// \brief File description
// --------------------------------------------------------------------------------------------------------------------
//
// vbchaos software design
//
// --------------------------------------------------------------------------------------------------------------------
/// $Revision: $
/// $Author: $
/// $Date: $
// (c) 2023 vbchaos
// --------------------------------------------------------------------------------------------------------------------
#ifndef MAIN_INC_CLOCK_H_
#define MAIN_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
// ProjectIncludes
// All include files that are provided by the project
#include "time.h"
// --------------------------------------------------------------------------------------------------------------------
// Constant and macro definitions
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Type definitions.
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Function declarations
// --------------------------------------------------------------------------------------------------------------------
class Clock
{
public:
enum FifthsIndication
{
None_FifthIndication = 0,
Five,
Ten,
Quarter
};
enum BeforeAfterIndication
{
None_BeforeAfter = 0,
Before,
After
};
struct TimeStructure
{
bool prefix;
bool almost;
FifthsIndication fifths;
BeforeAfterIndication beforeAfter;
bool half;
int hours;
bool hourPostfix;
};
Clock();
TimeStructure updateTime(void);
private:
time_t currentTime;
void toString(TimeStructure* timestructure);
int calculateHours(int hour);
};
/** @} */
#endif /* MAIN_INC_CLOCK_H_ */