Mercurial > public > ostc4
comparison Discovery/Src/t3.c @ 998:5a690195b6b7 GasConsumption
Added dual operation of scrubber timers:
In the previous version only one scrubber timer could be selected for operation. In the new version the activation of both timers is possible. In that case both timers will be displayed as well. To enable this a new activation item has been added to the scrubber menu.
| author | Ideenmodellierer |
|---|---|
| date | Wed, 23 Apr 2025 14:52:03 +0200 |
| parents | 8507a87f6401 |
| children | 8c0134a287da |
comparison
equal
deleted
inserted
replaced
| 997:2f7531a8e922 | 998:5a690195b6b7 |
|---|---|
| 1996 return t3_selection_customview; | 1996 return t3_selection_customview; |
| 1997 } | 1997 } |
| 1998 | 1998 |
| 1999 int printScrubberText(char *text, size_t size, const SScrubberData *scrubberData, SSettings *settings) | 1999 int printScrubberText(char *text, size_t size, const SScrubberData *scrubberData, SSettings *settings) |
| 2000 { | 2000 { |
| 2001 int16_t currentTimerMinutes = scrubberData[settings->scubberActiveId].TimerCur; | 2001 uint8_t timerId = 0; |
| 2002 char colour = '\020'; | 2002 int16_t currentTimerMinutes = 0; |
| 2003 if (currentTimerMinutes <= 0) { | 2003 char colour = 0; |
| 2004 colour = '\025'; | 2004 uint8_t textIndex = 0; |
| 2005 } else if (currentTimerMinutes <= 30) { | 2005 |
| 2006 colour = '\024'; | 2006 for(timerId = 0; timerId < 2; timerId++) |
| 2007 } | 2007 { |
| 2008 | 2008 if(settings->scubberActiveId & (1 << timerId)) |
| 2009 if (settings->scrubTimerMode == SCRUB_TIMER_MINUTES || currentTimerMinutes < 0) { | 2009 { |
| 2010 return snprintf(text, size, "%c%3i'", colour, currentTimerMinutes); | 2010 currentTimerMinutes = scrubberData[timerId].TimerCur; |
| 2011 } else { | 2011 colour = '\020'; |
| 2012 return snprintf(text, size, "%c%u\016\016%%\017", colour, currentTimerMinutes * 100 / settingsGetPointer()->scrubberData[settings->scubberActiveId].TimerMax); | 2012 if (currentTimerMinutes <= 0) |
| 2013 } | 2013 { |
| 2014 colour = '\025'; | |
| 2015 } | |
| 2016 else if (currentTimerMinutes <= 30) | |
| 2017 { | |
| 2018 colour = '\024'; | |
| 2019 } | |
| 2020 if (settings->scrubTimerMode == SCRUB_TIMER_MINUTES || currentTimerMinutes < 0) | |
| 2021 { | |
| 2022 textIndex += snprintf(&text[textIndex], size, "%c%3i'", colour, currentTimerMinutes); | |
| 2023 } | |
| 2024 else | |
| 2025 { | |
| 2026 textIndex += snprintf(&text[textIndex], size, "%c%u\016\016%%\017", colour, currentTimerMinutes * 100 / settingsGetPointer()->scrubberData[timerId].TimerMax); | |
| 2027 } | |
| 2028 if((settings->scubberActiveId == 3) && (timerId == 0)) /* both timers are active => print separator */ | |
| 2029 { | |
| 2030 textIndex += snprintf(&text[textIndex], size, " | "); | |
| 2031 } | |
| 2032 } | |
| 2033 } | |
| 2034 return textIndex; | |
| 2014 } | 2035 } |
| 2015 | 2036 |
| 2016 void t3_AF_updateBorderConditions() | 2037 void t3_AF_updateBorderConditions() |
| 2017 { | 2038 { |
| 2018 uint16_t nextstopLengthSeconds = 0; | 2039 uint16_t nextstopLengthSeconds = 0; |
