* possible fix of 'division by zero' #1345
* fix lang #1348#1346
* fix timestamp `max AC power` #1324
* fix stylesheet overlay `max AC power` #1324
* fix download link #1340
* fix history graph
* try to fix#1331
mPgTimeOfDay=(mDisplayData->utcTs>mDisplayData->pGraphStartTime)?mDisplayData->utcTs-mDisplayData->pGraphStartTime:0;// current time of day with respect to current sunrise time
mPgTimeOfDay=(mDisplayData->utcTs>mDisplayData->pGraphStartTime)?mDisplayData->utcTs-mDisplayData->pGraphStartTime:0;// current time of day with respect to current sunrise time
if(oldTimeOfDay>mPgTimeOfDay)// new day -> reset old data
if(oldTimeOfDay>mPgTimeOfDay)// new day -> reset old data
resetPowerGraph();
resetPowerGraph();
if(0==mPgPeriod)
mPgPeriod=1;
mPgLastPos=std::min((uint8_t)(mPgTimeOfDay*(mPgWidth-1)/mPgPeriod),(uint8_t)(mPgWidth-1));// current datapoint based on currenct time of day
mPgLastPos=std::min((uint8_t)(mPgTimeOfDay*(mPgWidth-1)/mPgPeriod),(uint8_t)(mPgWidth-1));// current datapoint based on currenct time of day
}
}
@ -190,15 +195,13 @@ class DisplayMono {
uint8_tgetPowerGraphXpos(uint8_tp){
uint8_tgetPowerGraphXpos(uint8_tp){
if((p<=mPgLastPos)&&(mPgLastPos>0))
if((p<=mPgLastPos)&&(mPgLastPos>0))
return((p*(mPgWidth-1))/mPgLastPos);// scaling of x-axis
return((p*(mPgWidth-1))/mPgLastPos);// scaling of x-axis
else
return0;
return(0);
}
}
uint8_tgetPowerGraphYpos(uint8_tp){
uint8_tgetPowerGraphYpos(uint8_tp){
if(p<mPgWidth)
if((p<mPgWidth)&&(mPgMaxPwr>0))
return((mPgData[p]*(uint32_t)mPgHeight/mPgMaxPwr));// scaling of data to graph height
return((mPgData[p]*(uint32_t)mPgHeight/mPgMaxPwr));// scaling of data to graph height
<li><ahref="https://fw.ahoydtu.de/dev/"target="_blank">Download</a>& Test {#DEV_FIRMWARE}, <ahref="https://github.com/lumapu/ahoy/blob/development03/src/CHANGES.md"target="_blank">{#DEV_CHANGELOG}</a></li>
<li><ahref="https://fw.ahoydtu.de/fw/dev/"target="_blank">Download</a>& Test {#DEV_FIRMWARE}, <ahref="https://github.com/lumapu/ahoy/blob/development03/src/CHANGES.md"target="_blank">{#DEV_CHANGELOG}</a></li>