27template< u
int8_t N, u
int8_t OffPeakDuration = 8 >
33 constexpr uint16_t uiPeakDurationInSec{ OffPeakDuration * 3600 };
35 for (uint8_t
i = 0;
i != N; ++
i)
40 _rg[
i][0] = ((
rg_ForceLoad[
i].getStartOffset() >= 0) ? 0 : uiPeakDurationInSec) +
rg_ForceLoad[
i].getStartOffset() * (bOffsetInMinutes ? 60ul : 3600ul);
49 _rg[
i][1] =
_rg[
i][0] +
rg_ForceLoad[
i].getDuration() * (bDurationInMinutes ? 60ul : 3600ul) * 1000ul;
73 Serial.print(F(
"\tDuration of off-peak period is "));
75 Serial.println(F(
" hours."));
77 Serial.print(F(
"\tTemperature threshold is "));
79 Serial.println(F(
"°C."));
83 Serial.print(F(
"\tLoad #"));
85 Serial.println(F(
":"));
87 Serial.print(F(
"\t\tStart "));
91 Serial.print(F(
" hours/minutes after begin of off-peak period "));
96 Serial.print(F(
" hours/minutes before the end of off-peak period "));
100 Serial.println(F(
"till the end of the period."));
104 Serial.print(F(
"for a duration of "));
106 Serial.println(F(
" hour/minute(s)."));
108 Serial.print(F(
"\t\tCalculated offset in seconds: "));
110 Serial.print(F(
"\t\tCalculated duration in seconds: "));
Template class for Load-Overriding.
const auto & operator[](uint8_t i) const
constexpr _rg_OffsetForce()
Configuration values to be set by the end-user.
constexpr pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS]
constexpr uint8_t NO_OF_DUMPLOADS
constexpr uint8_t ul_OFF_PEAK_DURATION
constexpr int16_t iTemperatureThreshold
constexpr auto rg_OffsetForce
void printDualTariffConfiguration()
Print the settings for off-peak period.