[Ovmsdev] StdMetrics.ms_v_env_parktime
Mark Webb-Johnson
mark at webb-johnson.net
Sun Nov 26 13:11:52 HKT 2017
For ms_v_charge_minutes, yes. I’ve changed that, and pushed.
The ms_v_charge_state is a description of the charge state (along with the ms_v_charge_substate). I think that needs to be controlled by the vehicle module. I do see a duplication with the boolean states (such as pilot signal, charging, heating, etc), but the ms_v_charge_state may reflect the _last_ charge state change, not necessarily current charge state (for example; done/stopped). Need to think about this. Not so simple.
Regards, Mark.
> On 24 Nov 2017, at 7:11 PM, Geir Øyvind Vælidalo <geir at validalo.net> wrote:
>
> I agree, Mark. That was a clean solution.
>
> Shouldn't we do the same with ms_v_charge_state and ms_v_charge_minutes too?
>
> Geir
>
>
>> I think in general things like this should be handled in the common
>> vehicle code, rather than all vehicle modules. In this case, the vehicle
>> module control v.e.on and park time can be maintained centrally
>> (irrespective of the vehicle type).
>>
>> Given the v3 server code, it makes more sense for park time in v3 to mean
>> number of seconds since vehicle was parked (like in the protocol for v2).
>>
>> Iâve added that logic into vehicle.cpp, and updated the other vehicle
>> modules not to change it at all. Iâve also fixed ovms_server_v2 to
>> handle it correctly.
>>
>> Regards, Mark.
>>
>>> On 24 Nov 2017, at 5:55 AM, Geir Ãyvind Vælidalo <geir at validalo.net>
>>> wrote:
>>>
>>> «Quick» question:
>>>
>>> StdMetrics.ms_v_env_parktime, is it seconds since the car was parked,
>>> which means we should update it in Ticker1? Or is it the time when the
>>> car was parked?
>>> Looking at V2 and the OVMS-V2conversion in V3, it looks to me like the
>>> first, but looking at the Twizy-module it looks like the latter.
>>>
>>> I guess setting the start time should be enough. When sending packets to
>>> V2-server, we could easily calculate the seconds:
>>> time(NULL)-ms_v_env_parktime. Unless ms_v_env_parktime is 0, then
>>> weâre not parked.
>>> The same could then be done for ms_v_charge_minutes too.
>>>
>>> Geir
>>> _______________________________________________
>>> OvmsDev mailing list
>>> OvmsDev at lists.teslaclub.hk
>>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>>
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk
>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>>
>
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
More information about the OvmsDev
mailing list