Contains necessary classes and functions for ELEC351
loggingMaster/dateAndTime.hpp@2:e2b885367ba8, 2017-12-27 (annotated)
- Committer:
- Luka_Danilovic
- Date:
- Wed Dec 27 15:28:20 2017 +0000
- Revision:
- 2:e2b885367ba8
- Parent:
- 0:f44c89c33601
- Child:
- 5:becb1545229d
dateAndTime: FINISHED; samplingMaster: FINISHED; recordsMaster: IN PROGRESS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Luka_Danilovic | 0:f44c89c33601 | 1 | #ifndef __dateAndTime__ //Inclusion safeguards |
Luka_Danilovic | 0:f44c89c33601 | 2 | #define __dateAndTime__ |
Luka_Danilovic | 0:f44c89c33601 | 3 | |
Luka_Danilovic | 0:f44c89c33601 | 4 | |
Luka_Danilovic | 0:f44c89c33601 | 5 | typedef struct __attribute__ ((packed)) { // Store one after another |
Luka_Danilovic | 0:f44c89c33601 | 6 | |
Luka_Danilovic | 2:e2b885367ba8 | 7 | int day, mnt, yr; // Current Date |
Luka_Danilovic | 2:e2b885367ba8 | 8 | int sec, min, hr; // Current Time |
Luka_Danilovic | 2:e2b885367ba8 | 9 | |
Luka_Danilovic | 2:e2b885367ba8 | 10 | } TDS_DT; // Type Def Struct _ Date Time |
Luka_Danilovic | 0:f44c89c33601 | 11 | |
Luka_Danilovic | 0:f44c89c33601 | 12 | |
Luka_Danilovic | 2:e2b885367ba8 | 13 | class C_DT // Class _ Date Time |
Luka_Danilovic | 0:f44c89c33601 | 14 | { |
Luka_Danilovic | 0:f44c89c33601 | 15 | |
Luka_Danilovic | 2:e2b885367ba8 | 16 | // Constructorless class - constructor not needed |
Luka_Danilovic | 0:f44c89c33601 | 17 | |
Luka_Danilovic | 0:f44c89c33601 | 18 | private: |
Luka_Danilovic | 2:e2b885367ba8 | 19 | TDS_DT date_time; // TDS_DT format of storing Date & Time |
Luka_Danilovic | 0:f44c89c33601 | 20 | |
Luka_Danilovic | 0:f44c89c33601 | 21 | public: |
Luka_Danilovic | 0:f44c89c33601 | 22 | TDS_DT getDT(); // Get Date & Time |
Luka_Danilovic | 2:e2b885367ba8 | 23 | void setD(int, int, int); // set Date |
Luka_Danilovic | 2:e2b885367ba8 | 24 | void setT(int, int, int); // Set Time |
Luka_Danilovic | 0:f44c89c33601 | 25 | |
Luka_Danilovic | 0:f44c89c33601 | 26 | }; |
Luka_Danilovic | 0:f44c89c33601 | 27 | |
Luka_Danilovic | 0:f44c89c33601 | 28 | #endif |