Added clock and wordclock - functional
the matrix needs an update, though. Not all words are well put
This commit is contained in:
@@ -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_ */
|
||||
Reference in New Issue
Block a user