diff --git a/Arduino/BTCDieselHeater/src/OLED/TimerChartScreen.cpp b/Arduino/BTCDieselHeater/src/OLED/TimerChartScreen.cpp index 16ab8e0..fc7500d 100644 --- a/Arduino/BTCDieselHeater/src/OLED/TimerChartScreen.cpp +++ b/Arduino/BTCDieselHeater/src/OLED/TimerChartScreen.cpp @@ -57,6 +57,9 @@ CTimerChartScreen::onSelect() bool CTimerChartScreen::show() { + if(CTimerManager::hasTimerChanged()) { + CTimerManager::condenseMap(condensed); + } _display.clearDisplay(); CTransientFont AF(_display, &miniFontInfo); // temporarily use a mini font diff --git a/Arduino/BTCDieselHeater/src/RTC/TimerManager.cpp b/Arduino/BTCDieselHeater/src/RTC/TimerManager.cpp index 7640ca7..48698d3 100644 --- a/Arduino/BTCDieselHeater/src/RTC/TimerManager.cpp +++ b/Arduino/BTCDieselHeater/src/RTC/TimerManager.cpp @@ -40,6 +40,7 @@ int CTimerManager::activeTimer = 0; int CTimerManager::activeDow = 0; int CTimerManager::nextTimer = 0; int CTimerManager::nextStart = 0; +bool CTimerManager::timerChanged = false; // create a bitmap that describes the pattern of on/off times void @@ -205,6 +206,7 @@ CTimerManager::condenseMap(uint8_t timerMap[7][120]) timerMap[dow][opIndex++] = condense; } } + timerChanged = false; } int @@ -291,6 +293,7 @@ CTimerManager::setTimer(sTimer& timerInfo) NVstore.save(); createMap(); manageTime(0,0,0); + timerChanged = true; return 1; } return 0; @@ -309,5 +312,8 @@ CTimerManager::conflictTest(int ID) timerInfo.enabled = 0; // cancel enabled status if it conflicts with others CTimerManager::setTimer(timerInfo); // stage the timer settings, without being enabled } + createMap(); + manageTime(0,0,0); + timerChanged = true; return conflictID; } diff --git a/Arduino/BTCDieselHeater/src/RTC/TimerManager.h b/Arduino/BTCDieselHeater/src/RTC/TimerManager.h index a41d306..e7bc2bb 100644 --- a/Arduino/BTCDieselHeater/src/RTC/TimerManager.h +++ b/Arduino/BTCDieselHeater/src/RTC/TimerManager.h @@ -49,6 +49,7 @@ public: static int getNextTimer(); static void getTimer(int idx, sTimer& timerInfo); static int setTimer(sTimer& timerInfo); + static bool hasTimerChanged() { return timerChanged; }; private: static int activeTimer; static int activeDow; @@ -56,6 +57,7 @@ private: static int nextTimer; static int nextStart; static uint8_t weekTimerIDs[7][_dayMinutes]; // b[7] = repeat flag, b[3..0] = timer ID + static bool timerChanged; }; #endif //__TIMERMANAGER_H__ \ No newline at end of file