90 lines
5.1 KiB
C
90 lines
5.1 KiB
C
#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;
|
|
int duration;
|
|
} carryover[8];
|
|
|
|
int id;
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
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"
|
|
<< " duration: " << co.carryover[(int)Qt::Monday].duration << "\n"
|
|
<< " 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"
|
|
<< " duration: " << co.carryover[(int)Qt::Tuesday].duration << "\n"
|
|
<< " 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"
|
|
<< " duration: " << co.carryover[(int)Qt::Wednesday].duration << "\n"
|
|
<< " 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"
|
|
<< " duration: " << co.carryover[(int)Qt::Thursday].duration << "\n"
|
|
<< " 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"
|
|
<< " duration: " << co.carryover[(int)Qt::Saturday].duration << "\n"
|
|
<< " 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"
|
|
<< " duration: " << co.carryover[(int)Qt::Sunday].duration << "\n"
|
|
<< " anytime: " << co.carryover[(int)Qt::Sunday].seemless << "\n"
|
|
<< " never: " << co.carryover[(int)Qt::Sunday].never << "\n";
|
|
|
|
return debug;
|
|
}
|
|
};
|
|
|
|
#endif // TARIFF_CARRYOVER_H_INCLUDED
|