You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice the Elapsed Time on the OpenEVSE tab in the Status Panel jumps up by 1 minute in value near 30 seconds and by 1 hour near 30 minute values. I suspect the code in ESP8266_WiFi_v2.x/src/html/view_models/TimeViewModel.js is rounding values rather than using floor/ceiling or simply truncating the value. I've ordered an ISP programmer to update my OpenEVSE firmware 4.8.0 to 5.0.1 and a serial interface to update the ESP8266 4.7.5 in case the web update fails so I am unable to make and verify changes at this time. I have reviewed Issue #66 and found the code which I would update Math.round to Math.trunc in lines 79, 81, and 83 to show the time without the rounding artifacts. I'm also learning my way around GitHub so I could be making mistakes about the suggested corrections. Please let me know how I should proceed in contributing to this open source project.
Note that this rounding jumps in the elapsed timer can be observed in the online simulator.
Current code :
var time = self.elapsedNow().getTime();
time = Math.round(time / 1000);
var seconds = time % 60;
time = Math.round(time / 60);
var minutes = time % 60;
var hours = Math.round(time / 60);
return hours+":"+addZero(minutes)+":"+addZero(seconds);
Suggested :
var time = self.elapsedNow().getTime();
time = Math.trunc(time / 1000);
var seconds = time % 60;
time = Math.trunc(time / 60);
var minutes = time % 60;
var hours = Math.trunc(time / 60);
return hours+":"+addZero(minutes)+":"+addZero(seconds);
Edited to add versions and simulator observation.
The text was updated successfully, but these errors were encountered:
Versions: OpenEVSE v5 Advanced purchased Dec2018 / 4.8.0 wifi 2.7.5
I notice the Elapsed Time on the OpenEVSE tab in the Status Panel jumps up by 1 minute in value near 30 seconds and by 1 hour near 30 minute values. I suspect the code in ESP8266_WiFi_v2.x/src/html/view_models/TimeViewModel.js is rounding values rather than using floor/ceiling or simply truncating the value. I've ordered an ISP programmer to update my OpenEVSE firmware 4.8.0 to 5.0.1 and a serial interface to update the ESP8266 4.7.5 in case the web update fails so I am unable to make and verify changes at this time. I have reviewed Issue #66 and found the code which I would update Math.round to Math.trunc in lines 79, 81, and 83 to show the time without the rounding artifacts. I'm also learning my way around GitHub so I could be making mistakes about the suggested corrections. Please let me know how I should proceed in contributing to this open source project.
Note that this rounding jumps in the elapsed timer can be observed in the online simulator.
Current code :
var time = self.elapsedNow().getTime();
time = Math.round(time / 1000);
var seconds = time % 60;
time = Math.round(time / 60);
var minutes = time % 60;
var hours = Math.round(time / 60);
return hours+":"+addZero(minutes)+":"+addZero(seconds);
Suggested :
var time = self.elapsedNow().getTime();
time = Math.trunc(time / 1000);
var seconds = time % 60;
time = Math.trunc(time / 60);
var minutes = time % 60;
var hours = Math.trunc(time / 60);
return hours+":"+addZero(minutes)+":"+addZero(seconds);
Edited to add versions and simulator observation.
The text was updated successfully, but these errors were encountered: