void currentStatusBuilderDisplay(const MenuData &data, Menu &menu) { // Loop through the different zones at N-second intervals showing temps and running status /************************************************************************************************************************** * There's a potential bug here if viewing status near midnight and the day rolls over; I can live with that. * Alternative would be to store long (time_t) seconds-since-1970 in MenuData and use that. Too much overhead for now. * * (Time elapsed since entering this menu) / (N-second interval) = numberOfIntervals; * numberOfIntervals % (Number of zones) = zoneToDisplayForNSeconds **************************************************************************************************************************/ byte zoneNumber = (elapsedSecsToday(now()) - data.getCurrentNumber()) / ArduinoFuoco::AppSettings::TIMED_DISPLAY_SCROLL_INTERVAL % *data.getZoneCount(); Zone* currentZone = data.getZones()[zoneNumber]; String zoneStatus = "Off"; if (currentZone->isOn()) { zoneStatus = "On"; } menu.setDisplayLine1(String("Status - Zone " + StringHelper::itoa(currentZone->getNumber()))); menu.setDisplayLine2(String("Temp: " + StringHelper::itoa(currentZone->getCurrentTemperature()) + "; " + zoneStatus)); }