View Single Post
Old 02-01-2017, 07:55 PM   #77 (permalink)
skybolt
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
I'm goofing around with the code at approximately line 10915 (I say approximately because I may have added lines.

Code:
text::stringOut(devLogSerial, PSTR("\"ranges\":["));
(this is in the 3rd JSON section, 'fuel economy').

In a nutshell, we don't want the marker or measure extend past the range. Today, IMPG can be very large, especially when engine-off-coasting. One of the ranges has to be at least as large as the largest measure and marker.

A couple of ways to handle this.

1 (alt 1) : MAX(5/3 econ; IMPG, tank/trip MPG).

This is cleaner and allows for any value (like those long downhill coasts with hundreds of mpg), but forces me to ditch my current layout showing and obsession with EPA estimates on my ranges. Also, method 1 doesn't require much in the way of code changes, simply a max wrapper, which probably already exists as a macro in C.

1 (alt 2): Same as above but simply cap the IMPG white marker (and trip measure I suppose) at 5/3 tank. Instant MPG is reflected in text and can easily show hundreds or thousands of MPG. This is probably what most people would expect to see. Ford would do this in a dashboard readout, for example.

2: Set range values manually or set a not-to-exceed value for all markers, measures and ranges. (I do this today in my modified Meelis code).

This has disadvantages: Values would either need to be hard-coded (bad!) or yet more parameters must be saved to EEPROM (inefficient and not worth the effort).


I'm experimenting with code. Working on it now.
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (02-02-2017)