<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Mark, Tamás,<br>
<br>
I've prepared a more or less generalized array version of my Twizy
battery chart (OvmsVehicleRenaultTwizy::WebBattMon) for you. Easier
to collect the data from actual arrays than separate metrics.<br>
<br>
This ZIP…<br>
<br>
<tt><a class="moz-txt-link-freetext"
href="https://dexters-web.de/f/ovms-dev/ovms.zip"
moz-do-not-send="true">https://dexters-web.de/f/ovms-dev/ovms.zip</a></tt><br>
<br>
…contains my local ovms web test/development folder. Unzip it into
some local web server (needs to be run via http for javascript),
then open the folder from a browser. You should see an OVMS web UI
lookalike.<br>
<br>
Config → CellChart loads "cellchart.htm". The blue button generates
and injects test data. Should look like this:<br>
<br>
<img src="cid:part2.4D578815.899B8026@expeedo.de" alt="" class=""><br>
<br>
Assuming you'll add some min/max records as well I left that code
including the reset button in there. If you can't provide that yet,
you can simply set min & max = act in the get_xxx_data
functions. Other than that you should basically just need to change
the metrics names.<br>
<br>
To generate C/C++ syntax from the file, use the script bin/mksrc:
"bin/mksrc cellchart.htm >cellchart.cpp". The chart init URL
needs to be changed for the production environment (see comment),
and the test data generator can be removed. See
OvmsVehicleRenaultTwizy::WebBattMon for reference.<br>
<br>
Maybe I should add that stuff to the repository as well…<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<div class="moz-cite-prefix">Am 06.11.18 um 15:56 schrieb Mark
Webb-Johnson:<br>
</div>
<blockquote type="cite"
cite="mid:A3E51D64-D302-4DA6-8C8C-F170B87D445D@webb-johnson.net">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Nice. I just implemented this for Model S using
your new metric type.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">96 individual brick voltages for each of the
bricks, plus two temperatures for each of the 16 modules.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Works well.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><span style="-webkit-tap-highlight-color:

rgba(0,
 0, 0, 0);"><br>
</span>On 1 Nov 2018, at 5:58 PM, Michael Balzer <<a
href="mailto:dexter@expeedo.de" moz-do-not-send="true">dexter@expeedo.de</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
Tamás,<br>
<br>
I've been creating separate metrics for all cell values on the
Twizy, but that only has 14 cells.<br>
<br>
We discussed this before, a better approach is introducing a
new metric class for arrays. I have just done that for you,
please pull.<br>
<br>
Usage example:<br>
<blockquote><tt>OvmsMetricVector<float>* vf = new
OvmsMetricVector<float>("test.volts", SM_STALE_MIN,
Volts);</tt><br>
<tt>vf->SetElemValue(3, 1.23);</tt><br>
<tt>vf->SetElemValue(17, 2.34);</tt><br>
<tt>float myvals[3] = { 5.5, 6.6, 7.7 };</tt><br>
<tt>vf->SetElemValues(10, 3, myvals);</tt><br>
</blockquote>
With this data set, you get:<br>
<blockquote><tt>OVMS# met lis test</tt><br>
<tt>test.volts
0,0,0,1.23,0,0,0,0,0,0,5.5,6.6,7.7,0,0,0,0,2.34V</tt><br>
</blockquote>
…and in the web framework:<br>
<blockquote><tt>metrics["test.volts"]</tt><br>
<tt>(18) [0, 0, 0, 1.23, 0, 0, 0, 0, 0, 0, 5.5, 6.6, 7.7, 0,
0, 0, 0, 2.34]</tt><br>
<tt>metrics["test.volts"][11]</tt><br>
<tt>6.6</tt><br>
</blockquote>
See template definition in ovms_metrics.h for more.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<div class="moz-cite-prefix">Am 31.10.18 um 20:08 schrieb
Tamás Kovács:<br>
</div>
<blockquote type="cite"
cite="mid:CAGpaXUvDSUoq-=5XRSV-RdhiFwNVrCwdPL6BpDuHSZ5mXJqFWA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<div dir="ltr">
<div dir="ltr">I have a Peugeot iOn, and i wan't to create
own metrics for battery temp (66 piece) and voltage (88
(old) or 80(new) piece) for all cell (and show on web
interface), and i don't understand how can i create it.
Now my data in array-s from can messages 6E1-6E4.<br
clear="all">
<div>My git fork: <a
href="https://github.com/KommyKT/Open-Vehicle-Monitoring-System-3/tree/peugeot"
moz-do-not-send="true">https://github.com/KommyKT/Open-Vehicle-Monitoring-System-3/tree/peugeot</a></div>
<div>vehicle_mitsubishi</div>
<br>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="160">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"><span>_______________________________________________</span><br>
<span>OvmsDev mailing list</span><br>
<span><a href="mailto:OvmsDev@lists.openvehicles.com"
moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a></span><br>
<span><a
href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev"
moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a></span><br>
</div>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="160">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
</body>
</html>