aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanJacobs2022-07-20 03:39:58 +0200
committerSanJacobs2022-07-20 03:39:58 +0200
commit879de06940dd30c38fd95067ee19c72913909c64 (patch)
treefee8fa41ed23d002a216a41e7fc386eb062a88c6
parent0ea7ccd956f99d63d61730ffa6c59ad3f4077cd0 (diff)
downloadsatscalc-879de06940dd30c38fd95067ee19c72913909c64.tar.gz
satscalc-879de06940dd30c38fd95067ee19c72913909c64.tar.bz2
satscalc-879de06940dd30c38fd95067ee19c72913909c64.zip
OK, maybe the bug is real after all!
-rwxr-xr-xsrc/time.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/time.cpp b/src/time.cpp
index c5b3b34..d42b780 100755
--- a/src/time.cpp
+++ b/src/time.cpp
@@ -159,20 +159,28 @@ workday::workday(const moment& previous_wrap,
int j = 0;
for(int i = 0; i<10; i++) {
const moment* each_moment = &splitpoints[i];
+ std::cout << "Splitting: " << timeprint(*each_moment) << "\t\tJ: " << j << "\t\tI: " << i << std::endl;
if(*each_moment > call && *each_moment < wrap) {
blocks[j++] = timesplit(initial_block, *each_moment);
}
}
+ std::cout << "Splitting finished." << std::endl;
+
blocks[j++] = initial_block;
total_timeblocks = j;
+ std::cout << "Splitting completely finished." << std::endl;
+
// THE VALUE-FACTOR CALCULATION PART
// TODO: Implement a good system for this fuckin' paragraph:
// A. 50 % tillegg for arbeid inntil 2 timer før, eller inntil 3 timer etter ordinær arbeidstid når arbeidstiden ikke er forskjøvet og overtiden er varslet. Dersom det varsles overtid både før og etter ordinær arbeidstid betales de to første timene med 50 % tillegg og de øvrige med 100 % tillegg.
for(timeblock& each_block : blocks){ // C++11 stuff right here.
+ // FIXME: I think this is the source of the crash and infinite loop, because it reaches garbage data.
+ // Limit it to total_timeblocks!
+ std::cout << "pricing: " << timeprint(each_block) << std::endl;
if(each_block.hourcount() == 8) {
each_block.valuefactor = 7.5/8.0;
if(each_block.start.getweekday() == saturday) each_block.valuefactor *= 1.5;