Add helpers GetSteps(), noSpecialDays(), specialDays() and tariffIs24_7()
to make the source more readable.
This commit is contained in:
parent
d11cffb8bd
commit
6e0a74c8cc
@ -45,6 +45,20 @@ public:
|
||||
// (e.g. Schoenau/Koenigsee)
|
||||
//
|
||||
QList<int> GetTimeSteps(Configuration *cfg) const;
|
||||
QList<int> GetSteps(Configuration *cfg) const { return GetTimeSteps(cfg); }
|
||||
|
||||
// additional helper functions
|
||||
bool noSpecialDays(Configuration const *cfg) const {
|
||||
return (cfg->SpecialDays.size() == 0) && (cfg->SpecialDaysWorktime.size() == 0);
|
||||
}
|
||||
bool specialDays(Configuration const *cfg) const {
|
||||
return !noSpecialDays(cfg);
|
||||
}
|
||||
bool tariffIs24_7(Configuration const *cfg) const {
|
||||
return (cfg->YearPeriod.size() == 0 &&
|
||||
cfg->SpecialDays.size() == 0 &&
|
||||
cfg->SpecialDaysWorktime.size() == 0);
|
||||
}
|
||||
|
||||
private:
|
||||
// Introduced for PaymentMethod::Steps (e.g. Schoenau)
|
||||
|
Loading…
Reference in New Issue
Block a user