MOBILISIS-Calculator/library/include/mobilisis/tariff_timebase.h

45 lines
1.2 KiB
C
Raw Normal View History

2023-12-12 12:14:14 +01:00
#ifndef TARIFF_TIME_BASE_H_INCLUDED
#define TARIFF_TIME_BASE_H_INCLUDED
#include <QString>
2023-12-15 13:28:34 +01:00
#include <QDebug>
#include <QDebugStateSaver>
2023-12-12 12:14:14 +01:00
2023-12-12 17:55:06 +01:00
struct ATBTimeBase {
2023-12-12 12:14:14 +01:00
enum class TimeBaseType {ABSOLUTE=0, RELATIVE=1};
2023-12-12 17:55:06 +01:00
ATBTimeBase() = default;
2024-01-18 14:37:13 +01:00
int tbase_id;
2023-12-12 12:14:14 +01:00
TimeBaseType tbase_type;
QString tbase_label;
2023-12-15 13:28:34 +01:00
friend QDebug operator<<(QDebug debug, ATBTimeBase const &timeBase) {
QDebugStateSaver saver(debug);
2024-01-30 10:14:21 +01:00
debug.nospace() << "TIMEBASE" << "\n";
2023-12-15 13:28:34 +01:00
switch(timeBase.tbase_type) {
case ATBTimeBase::TimeBaseType::ABSOLUTE:
debug.nospace()
2024-01-18 14:37:13 +01:00
<< " tbase_id: " << timeBase.tbase_id << "\n"
2023-12-15 13:28:34 +01:00
<< " tbase_type: " << "TimeBaseType::ABSOLUTE" << "\n"
<< "tbase_label: " << timeBase.tbase_label << "\n";
break;
case ATBTimeBase::TimeBaseType::RELATIVE:
debug.nospace()
<< " tbase_type: " << "TimeBaseType::RELATIVE" << "\n"
<< "tbase_label: " << timeBase.tbase_label << "\n";
break;
default:
debug.nospace()
<< " tbase_type: " << "TimeBaseType::???" << "\n";
break;
}
return debug;
}
2023-12-12 12:14:14 +01:00
};
#endif // TARIFF_TIME_BASE_H_INCLUDED