Hi all,
Some of the code I copied from Kona/Kia code had both
kwh/100km and km/kwh metrics in the code as 'Other'.
Adding the various power consumption Units is not
particularly hard (I will have a pull-request soon) - though
the conversions between them all required some thought!
... but it also made me think these two metrics that are
(with the consumption units added) defined like this:
m_v_trip_consumption1 =
MyMetrics.InitFloat("xiq.v.trip.consumption.KWh/100km", 10,
0, kWHP100K);
m_v_trip_consumption2 = MyMetrics.InitFloat("xiq.v.trip.consumption.km/kWh",
10, 0, kPkWH);
These are effectively the same metric but in different
units!
I'm wondering if we would be better to have scripting and
Duktape support for converting metrics to different unit!
This might be also quite useful for those strange countries
that insist on using miles as a measurement.
On top of the 'metric list' and 'metric set' we could add a
'metric get' which gets a single value.. and add unit support
for get/set.
I've also got a pull request that improves the precision of
the km<->mi conversions and factors it out.
//.ichael