[Ovmsdev] Tesla Powered RAV4 EV support

Michael Balzer dexter at expeedo.de
Sun Jul 4 02:06:55 HKT 2021


Michael,

Am 03.07.21 um 06:48 schrieb Michael Iimura:
> L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:100:50: 
> error: invalid use of member 
> 'OvmsVehicleToyotaRav4Ev::m_v_bat_cool_in_temp' in static member function
>    c.printf("<p>Battery Coolant Inlet: %.1f C</p>", 
> m_v_bat_cool_in_temp->AsFloat());
>                                                   ^
> In file included from 
> L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.cpp:38:0:
> L:/OVMS/home/miimura/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_toyotarav4ev/src/vehicle_toyotarav4ev.h:90:22: 
> note: declared here
>      OvmsMetricFloat *m_v_bat_cool_in_temp;
>                       ^
> Anybody have a clue what I'm doing wrong here?

as Steve already explained, if you want to access a member variable, you 
need to get the object (vehicle) pointer. You could do so by calling 
MyVehicleFactory.ActiveVehicle().

But do you really want a static metric value in a web page? Why not use 
a standard metric display so you can see the dynamic value changes?

To do so, you simply need to add class "receiver" to e.g. your main 
panel div, then do:

   c.printf("<p>Battery Coolant Inlet: <span class=\"metric\" 
data-metric=\"xr4.v.b.t.cltin\">?</span> C</p>");

Or, using the metric number widget to get some default layout & style:

       <div  class="receiver">
         ...
         <div  class="metric number"  data-metric="xr4.v.b.t.cltin"  data-prec="1">
           <span  class="label">Battery Coolant Inlet:</span>
           <span  class="value">?</span>
           <span  class="unit">°C</span>
         </div>
         ...
       </div>

See 
https://docs.openvehicles.com/en/latest/components/ovms_webserver/docs/metrics.html 
for the full reference.

Regards,
Michael

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20210703/fc59eda8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20210703/fc59eda8/attachment-0001.sig>


More information about the OvmsDev mailing list