<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Michael,<div><br></div><div>From the condition in the <font face="monospace">v_type->SetValue, the type is only set if NewVehicle(type) is not NULL.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">So the question is whether we should raise the signal or not? I guess that is debatable, and probably better not to (as otherwise it is being raised with type as the parameter, but the type is not actually being set as the vehicle type).<br></font><div><br></div><div>Regards, Mark</div><div><br><blockquote type="cite"><div>On 26 Nov 2023, at 9:26 AM, Michael Geddes <frog@bunyip.wheelycreek.net> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div>This code is from OvmsVehicleFactor::SetVehicle<br></div><div><br></div><font face="monospace"> m_currentvehicle = NewVehicle(type);<br> if (m_currentvehicle)<br> {<br> m_currentvehicle->m_ready = true;<br> }<br> m_currentvehicletype = std::string(type);<br> StandardMetrics.ms_v_type->SetValue(m_currentvehicle ? type : "");<br> MyEvents.SignalEvent("vehicle.type.set", (void*)type, strlen(type)+1);<br></font><div><br></div><div>My question is about what happens when NewVehicle() returns NULL.</div><div><br></div><div>Should m_currecntvehicletype, v.type and the SignalEvent all be set as blank? Any particular reason why only the v.type is set as blank?</div><div><br></div><div>//.ichael</div></div>
_______________________________________________<br>OvmsDev mailing list<br>OvmsDev@lists.openvehicles.com<br>http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br></div></blockquote></div><br></div></body></html>