2024-07-19 13:58:22 +02:00
|
|
|
#ifndef TARIFF_CARRYOVER_H_INCLUDED
|
|
|
|
#define TARIFF_CARRYOVER_H_INCLUDED
|
|
|
|
|
|
|
|
#include <QTime>
|
|
|
|
|
|
|
|
struct ATBCarryOver {
|
|
|
|
struct week {
|
|
|
|
int day;
|
|
|
|
bool seemless;
|
|
|
|
bool never;
|
|
|
|
QTime static_start;
|
|
|
|
QTime static_end;
|
2024-07-21 20:58:12 +02:00
|
|
|
int duration;
|
2024-07-19 13:58:22 +02:00
|
|
|
} carryover[8];
|
|
|
|
|
|
|
|
int id;
|
|
|
|
|
2024-09-11 11:35:17 +02:00
|
|
|
explicit ATBCarryOver()
|
|
|
|
: id(-1) {
|
|
|
|
|
|
|
|
for (int i = 0 ; i < 8; ++i) {
|
|
|
|
carryover[i].day = -1;
|
|
|
|
carryover[i].seemless = false;
|
|
|
|
carryover[i].never = false;
|
|
|
|
carryover[i].static_start = QTime(23, 59, 59);
|
|
|
|
carryover[i].static_end = QTime(0, 0, 0);
|
|
|
|
carryover[i].duration = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-19 13:58:22 +02:00
|
|
|
friend QDebug operator<<(QDebug debug, ATBCarryOver const &co) {
|
|
|
|
QDebugStateSaver saver(debug);
|
|
|
|
|
|
|
|
debug.nospace()
|
|
|
|
<< " id:" << co.id << "\n"
|
|
|
|
<< " **** Monday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Monday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Monday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Monday].static_end.toString(Qt::ISODate) << "\n"
|
2024-07-21 20:58:12 +02:00
|
|
|
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
2024-07-19 13:58:22 +02:00
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Monday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Monday].never << "\n"
|
|
|
|
<< " **** Tuesday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Tuesday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Tuesday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Tuesday].static_end.toString(Qt::ISODate) << "\n"
|
2024-09-11 11:35:17 +02:00
|
|
|
<< " duration: " << co.carryover[(int)Qt::Tuesday].duration << "\n"
|
2024-07-19 13:58:22 +02:00
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Tuesday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Tuesday].never << "\n"
|
|
|
|
<< " **** Wednesday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Wednesday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Wednesday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Wednesday].static_end.toString(Qt::ISODate) << "\n"
|
2024-09-11 11:35:17 +02:00
|
|
|
<< " duration: " << co.carryover[(int)Qt::Wednesday].duration << "\n"
|
2024-07-19 13:58:22 +02:00
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Wednesday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Wednesday].never << "\n"
|
|
|
|
<< " **** Thursday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Thursday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Thursday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Thursday].static_end.toString(Qt::ISODate) << "\n"
|
2024-09-11 11:35:17 +02:00
|
|
|
<< " duration: " << co.carryover[(int)Qt::Thursday].duration << "\n"
|
2024-07-19 13:58:22 +02:00
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Thursday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Thursday].never << "\n"
|
|
|
|
<< " **** Friday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Friday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Friday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Friday].static_end.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Friday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Friday].never << "\n"
|
|
|
|
<< " **** Saturday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Saturday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Saturday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Saturday].static_end.toString(Qt::ISODate) << "\n"
|
2024-09-11 11:35:17 +02:00
|
|
|
<< " duration: " << co.carryover[(int)Qt::Saturday].duration << "\n"
|
2024-07-19 13:58:22 +02:00
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Saturday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Saturday].never << "\n"
|
|
|
|
<< " **** Sunday **** \n"
|
|
|
|
<< " day: " << co.carryover[(int)Qt::Sunday].day << "\n"
|
|
|
|
<< " static_start: " << co.carryover[(int)Qt::Sunday].static_start.toString(Qt::ISODate) << "\n"
|
|
|
|
<< " static_end: " << co.carryover[(int)Qt::Sunday].static_end.toString(Qt::ISODate) << "\n"
|
2024-09-11 11:35:17 +02:00
|
|
|
<< " duration: " << co.carryover[(int)Qt::Sunday].duration << "\n"
|
2024-07-19 13:58:22 +02:00
|
|
|
<< " anytime: " << co.carryover[(int)Qt::Sunday].seemless << "\n"
|
|
|
|
<< " never: " << co.carryover[(int)Qt::Sunday].never << "\n";
|
|
|
|
|
|
|
|
return debug;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TARIFF_CARRYOVER_H_INCLUDED
|