From ae9a54bf028be2df23cfc60ba548a80a9737831e Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Sun, 18 Aug 2024 19:23:12 +0200 Subject: [PATCH] Added: pun_mutable: duration might be changed during runtime pun_round_to_next_24h_boundary duration has to be aligned with next possible 24h boundary pun_round_to_prev_24h_boundary duration has to be aligned with previous 24h boundary pun_align_with_timepoint duration has to be aligned with dedicated time point Removed: pun_requires_change Replaced by pu_mutable --- library/include/mobilisis/duration.h | 36 ++++++++++++++++++---------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/library/include/mobilisis/duration.h b/library/include/mobilisis/duration.h index 668cd8b..b307d11 100644 --- a/library/include/mobilisis/duration.h +++ b/library/include/mobilisis/duration.h @@ -1,6 +1,7 @@ #include #include +#include class ATBDuration { @@ -16,7 +17,10 @@ public: , pun_netto(false) , pun_brutto(false) , pun_fixed(false) - , pun_requires_change(false) + , pun_mutable(false) + , pun_round_to_next_24h_boundary(false) + , pun_round_to_prev_24h_boundary(false) + , pun_align_with_timepoint(QDateTime()) , pun_next_step_correction(0) { } @@ -24,17 +28,20 @@ public: QDebugStateSaver saver(debug); debug.nospace() - << " pun_id: " << td.pun_id << "\n" - << " pun_label: " << QString::fromStdString(td.pun_label) << "\n" - << " pun_duration: " << td.pun_duration << "\n" - << " pun_duration_saved: " << td.pun_duration_saved << "\n" - << " pun_duration_min: " << td.pun_duration_min << "\n" - << " pun_duration_max: " << td.pun_duration_max << "\n" - << " pun_netto: " << td.pun_netto << "\n" - << " pun_brutto: " << td.pun_brutto << "\n" - << " pun_fixed: " << td.pun_fixed << "\n" - << " pun_requires_change: " << td.pun_requires_change << "\n" - << "pun_interpolation_id: " << td.pun_interpolation_id << "\n"; + << " pun_id: " << td.pun_id << "\n" + << " pun_label: " << QString::fromStdString(td.pun_label) << "\n" + << " pun_duration: " << td.pun_duration << "\n" + << " pun_duration_saved: " << td.pun_duration_saved << "\n" + << " pun_duration_min: " << td.pun_duration_min << "\n" + << " pun_duration_max: " << td.pun_duration_max << "\n" + << " pun_interpolation_id: " << td.pun_interpolation_id << "\n" + << " pun_netto: " << td.pun_netto << "\n" + << " pun_brutto: " << td.pun_brutto << "\n" + << " pun_fixed: " << td.pun_fixed << "\n" + << " pun_mutable: " << td.pun_mutable << "\n" + << "pun_round_to_next_24h_boundary: " << td.pun_round_to_next_24h_boundary << "\n" + << "pun_round_to_prev_24h_boundary: " << td.pun_round_to_prev_24h_boundary << "\n" + << " pun_align_with_timepoint: " << td.pun_align_with_timepoint << endl; return debug; } @@ -49,6 +56,9 @@ public: bool pun_netto; // the timestep expressed by this duration is a netto timestep bool pun_brutto; // the timestep expressed by this duration is a brutto timestep bool pun_fixed; // the value given in tariff-file is fixed (constant) - bool pun_requires_change; // the value has to be changes (controlled by other parameters) + bool pun_mutable; // the value could change + bool pun_round_to_next_24h_boundary; + bool pun_round_to_prev_24h_boundary; + QDateTime pun_align_with_timepoint; int pun_next_step_correction; };