aboutsummaryrefslogtreecommitdiff
path: root/src/time.h
diff options
context:
space:
mode:
authorSanJacobs2022-04-17 23:23:39 +0200
committerSanJacobs2022-04-17 23:23:39 +0200
commit74ff7c3a783e3c111a48715108a5b6a3d25e49b8 (patch)
treeda17ff8330e09c648a49e58dd18ed36200f39f0e /src/time.h
parentb3d7b6afcaab0e481debafed00fea692373b780e (diff)
downloadsatscalc-74ff7c3a783e3c111a48715108a5b6a3d25e49b8.tar.gz
satscalc-74ff7c3a783e3c111a48715108a5b6a3d25e49b8.tar.bz2
satscalc-74ff7c3a783e3c111a48715108a5b6a3d25e49b8.zip
Refactor and bugfix
Diffstat (limited to 'src/time.h')
-rwxr-xr-xsrc/time.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/time.h b/src/time.h
index 4dfa1ff..213615f 100755
--- a/src/time.h
+++ b/src/time.h
@@ -4,6 +4,7 @@
#include <ios>
#include <iomanip>
#include <string.h>
+#include <vector>
struct moment{
signed int minutes;
@@ -14,7 +15,7 @@ struct moment{
bool operator<(const moment& other) const;
bool operator>(const moment& other) const;
- bool operator=(const moment& other) const;
+ bool operator==(const moment& other) const;
};
struct timeblock{
@@ -22,9 +23,35 @@ struct timeblock{
moment end;
};
+struct workday{
+ moment call;
+ moment wrap;
+ moment planned_wrap;
+ timeblock blocks[12];
+ //
+ // 1. sleepbreach
+ // 2. Call
+ // 3. Early morning
+ // 4. start of day
+ // 5. 1st hr overtime
+ // 6. post-1 hour overtime
+ // 7. 14-hour mark
+ // 8. 22:00
+ // 9. midnight crossing
+ // 10. 06:00
+ // 11. wrap
+ //
+ workday(moment calltime, moment wraptime, moment planned_wraptime) {
+
+ }
+ workday(moment previous_wrap, moment calltime, moment wraptime, moment planned_wraptime) {
+
+ }
+};
+
std::string padint(const int input, const int minimum_signs);
-timeblock timesplit(timeblock &input_block, const moment splitpoint);
+timeblock timesplit(timeblock& input_block, const moment splitpoint);
// Splits a timeblock at splitpoint.
// It changes the input_block to end at splitpoint, and returns a new timeblock
// that lasts from splitpoint to where the input_block used to end.
@@ -34,8 +61,8 @@ void wind(moment &input_moment, const int minutes, const int hours, const int da
int days_in(const int month, const int year);
std::string timeprint(const moment input_moment);
-
std::string timeprint(const timeblock input_timeblock);
+long sortable_time(const timeblock input_timeblock);
moment timeinput(const int or_year, const int or_month, const int or_day);
moment timeinput();