From 862e8949a0877a11fd53a05bc4b360e2f681b1fa Mon Sep 17 00:00:00 2001 From: VArt67 <132200455+VArt67@users.noreply.github.com> Date: Tue, 5 Mar 2024 20:45:52 +0100 Subject: [PATCH] corrected history "max power of day" --- src/plugins/history.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/history.h b/src/plugins/history.h index d8b080b0..2b5f0d32 100644 --- a/src/plugins/history.h +++ b/src/plugins/history.h @@ -53,12 +53,12 @@ class HistoryData { mYieldDay.refreshCycle = 60; mLastValueTs = 0; mPgPeriod=0; + mMaximumDay = 0; } void tickerSecond() { - ; float curPwr = 0; - float maxPwr = 0; + //float maxPwr = 0; float yldDay = -0.1; uint32_t ts = 0; @@ -68,7 +68,7 @@ class HistoryData { if (iv == NULL) continue; curPwr += iv->getChannelFieldValue(CH0, FLD_PAC, rec); - maxPwr += iv->getChannelFieldValue(CH0, FLD_MP, rec); + //maxPwr += iv->getChannelFieldValue(CH0, FLD_MP, rec); yldDay += iv->getChannelFieldValue(CH0, FLD_YD, rec); if (rec->ts > ts) ts = rec->ts; @@ -79,9 +79,11 @@ class HistoryData { if (curPwr > 0) { mLastValueTs = ts; addValue(&mCurPwr, roundf(curPwr)); - } - if (maxPwr > 0) - mMaximumDay = roundf(maxPwr); + if (curPwr > mMaximumDay) + mMaximumDay = roundf(curPwr); + } + //if (maxPwr > 0) + // mMaximumDay = roundf(maxPwr); } if ((++mCurPwrDay.loopCnt % mCurPwrDay.refreshCycle) == 0) {