lincomatic / open_evse

Firmware for Open EVSE
GNU General Public License v3.0
114 stars 163 forks source link

Clear g_WattSeconds only after adding to g_WattHours_accumulated and #56

Closed Mike4U closed 8 years ago

Mike4U commented 8 years ago

only when state changes from A to B i.e. from unconnected to connected.

Clear g_WattSeconds only after adding to g_WattHours_accumulated and only when state changes from A to B i.e. from unconnected to connected.

The reasoning?

  1. From a programming standpoint kwhs aren’t lost if always accumulated before clearing.
  2. The user can look at the display at any time and see how many kw have been consumed, even and especially after unplugging. Zeroing the kwsecs should only happen when the user first plugs in to the car. Messing with the button and menus shouldn’t effect the kw value (unless in that menu) wether charging or not. Any failures or faults shouldn’t clear the accumulated kw.
Mike4U commented 8 years ago

Redid this to the development branch. Sorry to be learning Github on your project.

lincomatic commented 8 years ago

Sorry for taking forever to review this... I was hoping CraigK would look at it, because I don't really use the kW tracking stuff, and don't know how it behaves. However, he seems to be MIA.

Unfortunately, your changes are applied to an old version of the code, so I can't merge it. Looking at the current code in the dev branch, it appears that maybe the latest code already behaves the way you want, as far as only clearing kwsecs when entering STATE A. However, g_WattSeconds when enter Sleep() (and thus, when you enter the menus)... I agree with you that it shouldn't be zeroed there, so I am going to push a change get rid of that.

Thanks again for your help.

Mike4U commented 8 years ago

Hi, Hope CraigK is not really MIA. The last web person I was developing software with, known to me only as ’solder’ died of a heart attack at only 35. I found out about it by luck after trying to contact him for about a month. Downside of web development.

later

On Apr 12, 2016, at 4:42 PM, lincomatic notifications@github.com wrote:

Sorry for taking forever to review this... I was hoping CraigK would look at it, because I don't really use the kW tracking stuff, and don't know how it behaves. However, he seems to be MIA.

Unfortunately, your changes are applied to an old version of the code, so I can't merge it. Looking at the current code in the dev branch, it appears that maybe the latest code already behaves the way you want, as far as only clearing kwsecs when entering STATE A. However, g_WattSeconds when enter Sleep() (and thus, when you enter the menus)... I agree with you that it shouldn't be zeroed there, so I am going to push a change get rid of that.

Thanks again for your help.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub