mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-30 18:56:27 +02:00
corrected history "max power of day"
This commit is contained in:
parent
864c5f5790
commit
862e8949a0
1 changed files with 8 additions and 6 deletions
|
@ -53,12 +53,12 @@ class HistoryData {
|
||||||
mYieldDay.refreshCycle = 60;
|
mYieldDay.refreshCycle = 60;
|
||||||
mLastValueTs = 0;
|
mLastValueTs = 0;
|
||||||
mPgPeriod=0;
|
mPgPeriod=0;
|
||||||
|
mMaximumDay = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tickerSecond() {
|
void tickerSecond() {
|
||||||
;
|
|
||||||
float curPwr = 0;
|
float curPwr = 0;
|
||||||
float maxPwr = 0;
|
//float maxPwr = 0;
|
||||||
float yldDay = -0.1;
|
float yldDay = -0.1;
|
||||||
uint32_t ts = 0;
|
uint32_t ts = 0;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class HistoryData {
|
||||||
if (iv == NULL)
|
if (iv == NULL)
|
||||||
continue;
|
continue;
|
||||||
curPwr += iv->getChannelFieldValue(CH0, FLD_PAC, rec);
|
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);
|
yldDay += iv->getChannelFieldValue(CH0, FLD_YD, rec);
|
||||||
if (rec->ts > ts)
|
if (rec->ts > ts)
|
||||||
ts = rec->ts;
|
ts = rec->ts;
|
||||||
|
@ -79,9 +79,11 @@ class HistoryData {
|
||||||
if (curPwr > 0) {
|
if (curPwr > 0) {
|
||||||
mLastValueTs = ts;
|
mLastValueTs = ts;
|
||||||
addValue(&mCurPwr, roundf(curPwr));
|
addValue(&mCurPwr, roundf(curPwr));
|
||||||
}
|
if (curPwr > mMaximumDay)
|
||||||
if (maxPwr > 0)
|
mMaximumDay = roundf(curPwr);
|
||||||
mMaximumDay = roundf(maxPwr);
|
}
|
||||||
|
//if (maxPwr > 0)
|
||||||
|
// mMaximumDay = roundf(maxPwr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((++mCurPwrDay.loopCnt % mCurPwrDay.refreshCycle) == 0) {
|
if ((++mCurPwrDay.loopCnt % mCurPwrDay.refreshCycle) == 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue