diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/component.mk b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/component.mk similarity index 91% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/component.mk rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/component.mk index d469e29..3816c28 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/component.mk +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/component.mk @@ -7,7 +7,7 @@ # please read the ESP-IDF documents if you need to do this. # -ifdef CONFIG_OVMS_VEHICLE_RENAULTZOE_PH2 +ifdef CONFIG_OVMS_VEHICLE_RENAULTZOE_PH2_OBD COMPONENT_ADD_INCLUDEDIRS:=src COMPONENT_SRCDIRS:=src COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/docs/index.rst b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/docs/index.rst similarity index 97% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/docs/index.rst rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/docs/index.rst index e84420f..e5842a8 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/docs/index.rst +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/docs/index.rst @@ -1,8 +1,8 @@ ======================= -Renault Zoe Phase 2 +Renault Zoe Phase 2 (OBD port) ======================= -Vehicle Type: **RZ2** +Vehicle Type: **RZ2O** This vehicle type supports the Renault Zoe(PH2) through OBD connection. All values are read-only, no control possible because of CAN Gateway. diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/BCM_pids.cpp similarity index 98% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/BCM_pids.cpp index 106de88..43eabbe 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/BCM_pids.cpp @@ -23,9 +23,9 @@ ; THE SOFTWARE. */ -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingBCM(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingBCM(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x6300: { // TPMS pressure - front left if ((CAN_UINT(0) * 7.5) < 7672) { diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/EVC_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/EVC_pids.cpp similarity index 98% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/EVC_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/EVC_pids.cpp index 737e997..cb51de2 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/EVC_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/EVC_pids.cpp @@ -23,9 +23,9 @@ ; THE SOFTWARE. */ -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingEVC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingEVC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x2006: { //Odometer (Total Vehicle Distance) StandardMetrics.ms_v_pos_odometer->SetValue((float) CAN_UINT24(0), Kilometers); diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/HVAC_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/HVAC_pids.cpp similarity index 95% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/HVAC_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/HVAC_pids.cpp index 9f5aadf..cfea7de 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/HVAC_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/HVAC_pids.cpp @@ -22,9 +22,9 @@ ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ; THE SOFTWARE. */ -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingHVAC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingHVAC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x4009: { //Cabin temperature StandardMetrics.ms_v_env_cabintemp->SetValue(float((CAN_UINT(0) - 400) / 10), Celcius); diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/INV_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/INV_pids.cpp similarity index 95% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/INV_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/INV_pids.cpp index dcc3742..b0143d1 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/INV_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/INV_pids.cpp @@ -23,9 +23,9 @@ ; THE SOFTWARE. */ -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingINV(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingINV(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x700C: { // Inverter temperature StandardMetrics.ms_v_inv_temp->SetValue(float((CAN_UINT24(0) * 0.001953125) - 40), Celcius); diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/LBC_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/LBC_pids.cpp similarity index 99% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/LBC_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/LBC_pids.cpp index 6646085..df6fa86 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/LBC_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/LBC_pids.cpp @@ -23,9 +23,9 @@ ; THE SOFTWARE. */ -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingLBC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingLBC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x9005: { //Battery voltage StandardMetrics.ms_v_bat_voltage->SetValue((float) (CAN_UINT(0) * 0.1), Volts); diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/TDB_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/TDB_pids.cpp similarity index 92% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/TDB_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/TDB_pids.cpp index 895f129..4ee9203 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/TDB_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/TDB_pids.cpp @@ -24,9 +24,9 @@ */ /* -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingCLUSTER(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingCLUSTER(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x2101: { // Cluster - trip counter mt_pos_car_trip->SetValue(CAN_UINT32(0), Kilometers); diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/UCM_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/UCM_pids.cpp similarity index 92% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/UCM_pids.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/UCM_pids.cpp index 07e2514..21e4a5e 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/UCM_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/UCM_pids.cpp @@ -22,9 +22,9 @@ ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ; THE SOFTWARE. */ -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" -void OvmsVehicleRenaultZoePh2::IncomingUCM(uint16_t type, uint16_t pid, const char* data, uint16_t len) { +void OvmsVehicleRenaultZoePh2OBD::IncomingUCM(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x6079: { //12V Battery Current StandardMetrics.ms_v_charge_12v_current->SetValue((float) (CAN_UINT(0) * 0.1), Amps); diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/ph2_poller.h b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/ph2_poller.h similarity index 100% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/ph2_poller.h rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/ph2_poller.h diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/rz2_web.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/rz2_web.cpp similarity index 77% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/rz2_web.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/rz2_web.cpp index 592785b..51a641e 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/rz2_web.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/rz2_web.cpp @@ -36,14 +36,14 @@ #include "ovms_notify.h" #include "ovms_webserver.h" -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" using namespace std; #define _attr(text) (c.encode_html(text).c_str()) #define _html(text) (c.encode_html(text).c_str()) -void OvmsVehicleRenaultZoePh2::WebCfgCommon(PageEntry_t& p, PageContext_t& c) +void OvmsVehicleRenaultZoePh2OBD::WebCfgCommon(PageEntry_t& p, PageContext_t& c) { std::string error, rangeideal, battcapacity; bool UseBMScalculation, UseBMSsoc; @@ -62,11 +62,11 @@ void OvmsVehicleRenaultZoePh2::WebCfgCommon(PageEntry_t& p, PageContext_t& c) } if (error == "") { // store: - MyConfig.SetParamValue("xrz2", "rangeideal", rangeideal); - MyConfig.SetParamValue("xrz2", "battcapacity", battcapacity); - //MyConfig.SetParamValueBool("xrz2", "UseCarTrip", UseCarTrip); - MyConfig.SetParamValueBool("xrz2", "UseBMScalculation", UseBMScalculation); - MyConfig.SetParamValueBool("xrz2", "UseBMSsoc", UseBMSsoc); + MyConfig.SetParamValue("xrz2o", "rangeideal", rangeideal); + MyConfig.SetParamValue("xrz2o", "battcapacity", battcapacity); + //MyConfig.SetParamValueBool("xrz2o", "UseCarTrip", UseCarTrip); + MyConfig.SetParamValueBool("xrz2o", "UseBMScalculation", UseBMScalculation); + MyConfig.SetParamValueBool("xrz2o", "UseBMSsoc", UseBMSsoc); c.head(200); c.alert("success", "
Renault Zoe Ph2 battery setup saved.
"); @@ -81,11 +81,11 @@ void OvmsVehicleRenaultZoePh2::WebCfgCommon(PageEntry_t& p, PageContext_t& c) } else { // read configuration: - rangeideal = MyConfig.GetParamValue("xrz2", "rangeideal", "350"); - battcapacity = MyConfig.GetParamValue("xrz2", "battcapacity", "52000"); - //UseCarTrip = MyConfig.GetParamValueBool("xrz2", "UseCarTrip", false); - UseBMScalculation = MyConfig.GetParamValueBool("xrz2", "UseBMScalculation", false); - UseBMSsoc = MyConfig.GetParamValueBool("xrz2", "UseBMSsoc", false); + rangeideal = MyConfig.GetParamValue("xrz2o", "rangeideal", "350"); + battcapacity = MyConfig.GetParamValue("xrz2o", "battcapacity", "52000"); + //UseCarTrip = MyConfig.GetParamValueBool("xrz2o", "UseCarTrip", false); + UseBMScalculation = MyConfig.GetParamValueBool("xrz2o", "UseBMScalculation", false); + UseBMSsoc = MyConfig.GetParamValueBool("xrz2o", "UseBMSsoc", false); c.head(200); } @@ -135,19 +135,19 @@ void OvmsVehicleRenaultZoePh2::WebCfgCommon(PageEntry_t& p, PageContext_t& c) /** * WebInit: register pages */ -void OvmsVehicleRenaultZoePh2::WebInit() +void OvmsVehicleRenaultZoePh2OBD::WebInit() { - MyWebServer.RegisterPage("/xrz2/battmon", "BMS View", OvmsWebServer::HandleBmsCellMonitor, PageMenu_Vehicle, PageAuth_Cookie); - MyWebServer.RegisterPage("/xrz2/settings", "Setup", WebCfgCommon, PageMenu_Vehicle, PageAuth_Cookie); + MyWebServer.RegisterPage("/xrz2o/battmon", "BMS View", OvmsWebServer::HandleBmsCellMonitor, PageMenu_Vehicle, PageAuth_Cookie); + MyWebServer.RegisterPage("/xrz2o/settings", "Setup", WebCfgCommon, PageMenu_Vehicle, PageAuth_Cookie); } /** * WebDeInit: deregister pages */ -void OvmsVehicleRenaultZoePh2::WebDeInit() +void OvmsVehicleRenaultZoePh2OBD::WebDeInit() { - MyWebServer.DeregisterPage("/xrz2/battmon"); - MyWebServer.DeregisterPage("/xrz2/battery"); + MyWebServer.DeregisterPage("/xrz2o/battmon"); + MyWebServer.DeregisterPage("/xrz2o/battery"); } diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/vehicle_renaultzoe_ph2_obd.cpp similarity index 88% rename from OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp rename to OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/vehicle_renaultzoe_ph2_obd.cpp index d7d86e3..6f14449 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2_obd/src/vehicle_renaultzoe_ph2_obd.cpp @@ -39,11 +39,11 @@ #include "ovms_peripherals.h" #include "ovms_netmanager.h" -#include "vehicle_renaultzoe_ph2.h" +#include "vehicle_renaultzoe_ph2_obd.h" #include "ph2_poller.h" -OvmsVehicleRenaultZoePh2::OvmsVehicleRenaultZoePh2() { - ESP_LOGI(TAG, "Start Renault Zoe Ph2 vehicle module"); +OvmsVehicleRenaultZoePh2OBD::OvmsVehicleRenaultZoePh2OBD() { + ESP_LOGI(TAG, "Start Renault Zoe Ph2 (OBD) vehicle module"); //Init variables supressing push on boot up StandardMetrics.ms_v_type->SetValue("RZ2"); @@ -53,7 +53,7 @@ OvmsVehicleRenaultZoePh2::OvmsVehicleRenaultZoePh2() { StandardMetrics.ms_v_charge_substate->SetValue("stopped"); StandardMetrics.ms_v_env_on->SetValue(false); - MyConfig.RegisterParam("xrz2", "Renault Zoe Ph2 configuration", true, true); + MyConfig.RegisterParam("xrz2o", "Renault Zoe Ph2 (OBD) configuration", true, true); ConfigChanged(NULL); // Init Zoe Ph2 OBD Connection (CAN Gateway) @@ -106,20 +106,20 @@ OvmsVehicleRenaultZoePh2::OvmsVehicleRenaultZoePh2() { #endif } -OvmsVehicleRenaultZoePh2::~OvmsVehicleRenaultZoePh2() { - ESP_LOGI(TAG, "Stop Renault Zoe Ph2 vehicle module"); +OvmsVehicleRenaultZoePh2OBD::~OvmsVehicleRenaultZoePh2OBD() { + ESP_LOGI(TAG, "Stop Renault Zoe Ph2 (OBD) vehicle module"); } -void OvmsVehicleRenaultZoePh2::ConfigChanged(OvmsConfigParam* param) { - if (param && param->GetName() != "xrz2") +void OvmsVehicleRenaultZoePh2OBD::ConfigChanged(OvmsConfigParam* param) { + if (param && param->GetName() != "xrz2o") return; // get values from config store - m_range_ideal = MyConfig.GetParamValueInt("xrz2", "rangeideal", 350); - m_battery_capacity = MyConfig.GetParamValueInt("xrz2", "battcapacity", 52000); - m_UseCarTrip = MyConfig.GetParamValueBool("xrz2", "UseCarTrip", false); - m_UseBMScalculation = MyConfig.GetParamValueBool("xrz2", "UseBMScalculation", false); - m_UseBMSsoc = MyConfig.GetParamValueBool("xrz2", "UseBMSsoc", false); + m_range_ideal = MyConfig.GetParamValueInt("xrz2o", "rangeideal", 350); + m_battery_capacity = MyConfig.GetParamValueInt("xrz2o", "battcapacity", 52000); + m_UseCarTrip = MyConfig.GetParamValueBool("xrz2o", "UseCarTrip", false); + m_UseBMScalculation = MyConfig.GetParamValueBool("xrz2o", "UseBMScalculation", false); + m_UseBMSsoc = MyConfig.GetParamValueBool("xrz2o", "UseBMSsoc", false); StandardMetrics.ms_v_bat_range_ideal->SetValue(m_range_ideal, Kilometers); if (m_battery_capacity == 52000) { Bat_cell_capacity = 78.0 * 2 * (StandardMetrics.ms_v_bat_soh->AsFloat() / 100.0); @@ -130,10 +130,10 @@ void OvmsVehicleRenaultZoePh2::ConfigChanged(OvmsConfigParam* param) { if (m_battery_capacity == 22000) { Bat_cell_capacity = 36.0 * 2 * (StandardMetrics.ms_v_bat_soh->AsFloat() / 100.0); } - ESP_LOGI(TAG, "Renault Zoe Ph2 reload configuration: Range ideal: %d, Battery capacity: %d, Use Car trip counter: %s, Use BMS as energy counter: %s, Use BMS for SOC: %s", m_range_ideal, m_battery_capacity, m_UseCarTrip ? "Yes" : "No", m_UseBMScalculation ? "yes" : "no", m_UseBMSsoc ? "yes" : "no"); + ESP_LOGI(TAG, "Renault Zoe Ph2 (OBD) reload configuration: Range ideal: %d, Battery capacity: %d, Use Car trip counter: %s, Use BMS as energy counter: %s, Use BMS for SOC: %s", m_range_ideal, m_battery_capacity, m_UseCarTrip ? "Yes" : "No", m_UseBMScalculation ? "yes" : "no", m_UseBMSsoc ? "yes" : "no"); } -void OvmsVehicleRenaultZoePh2::ZoeWakeUp() { +void OvmsVehicleRenaultZoePh2OBD::ZoeWakeUp() { ESP_LOGI(TAG,"Zoe woke up (CAN Bus activity detected)"); mt_bus_awake->SetValue(true);; StandardMetrics.ms_v_env_charging12v->SetValue(true); @@ -144,7 +144,7 @@ void OvmsVehicleRenaultZoePh2::ZoeWakeUp() { /** * Handles incoming CAN-frames on bus 1 */ -void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) { +void OvmsVehicleRenaultZoePh2OBD::IncomingFrameCan1(CAN_frame_t* p_frame) { uint8_t *data = p_frame->data.u8; //ESP_LOGI(TAG, "PID:%x DATA: %02x %02x %02x %02x %02x %02x %02x %02x", p_frame->MsgID, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); //ESP_LOGD(TAG, "Status CAN Bus: %s", mt_bus_awake->AsBool() ? "true" : "false"); @@ -177,7 +177,7 @@ void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) { /** * Handles incoming poll results */ -void OvmsVehicleRenaultZoePh2::IncomingPollReply(canbus* bus, uint16_t type, uint16_t pid, uint8_t* data, uint8_t length, uint16_t remain) { +void OvmsVehicleRenaultZoePh2OBD::IncomingPollReply(canbus* bus, uint16_t type, uint16_t pid, uint8_t* data, uint8_t length, uint16_t remain) { string& rxbuf = zoe_obd_rxbuf; //ESP_LOGV(TAG, "pid: %04x length: %d m_poll_ml_remain: %d m_poll_ml_frame: %d", pid, length, m_poll_ml_remain, m_poll_ml_frame); @@ -224,7 +224,7 @@ void OvmsVehicleRenaultZoePh2::IncomingPollReply(canbus* bus, uint16_t type, uin } } -int OvmsVehicleRenaultZoePh2::calcMinutesRemaining(float charge_voltage, float charge_current) { +int OvmsVehicleRenaultZoePh2OBD::calcMinutesRemaining(float charge_voltage, float charge_current) { float bat_soc = mt_bat_lbc_soc->AsFloat(100); float remaining_wh = m_battery_capacity - (m_battery_capacity * bat_soc / 100.0); @@ -235,7 +235,7 @@ int OvmsVehicleRenaultZoePh2::calcMinutesRemaining(float charge_voltage, float c } //Handle Charging values -void OvmsVehicleRenaultZoePh2::ChargeStatistics() { +void OvmsVehicleRenaultZoePh2OBD::ChargeStatistics() { float charge_current = fabs(StandardMetrics.ms_v_bat_current->AsFloat(0, Amps)); float charge_voltage = StandardMetrics.ms_v_bat_voltage->AsFloat(0, Volts); float battery_power = fabs(StandardMetrics.ms_v_bat_power->AsFloat(0, kW)); @@ -287,7 +287,7 @@ void OvmsVehicleRenaultZoePh2::ChargeStatistics() { } } -void OvmsVehicleRenaultZoePh2::EnergyStatisticsOVMS() { +void OvmsVehicleRenaultZoePh2OBD::EnergyStatisticsOVMS() { float voltage = StandardMetrics.ms_v_bat_voltage->AsFloat(0, Volts); float current = StandardMetrics.ms_v_bat_current->AsFloat(0, Amps); @@ -302,12 +302,12 @@ void OvmsVehicleRenaultZoePh2::EnergyStatisticsOVMS() { } } -void OvmsVehicleRenaultZoePh2::EnergyStatisticsBMS() { +void OvmsVehicleRenaultZoePh2OBD::EnergyStatisticsBMS() { StandardMetrics.ms_v_bat_energy_used->SetValue(StandardMetrics.ms_v_bat_energy_used_total->AsFloat() - mt_bat_used_start->AsFloat()); StandardMetrics.ms_v_bat_energy_recd->SetValue(StandardMetrics.ms_v_bat_energy_recd_total->AsFloat() - mt_bat_recd_start->AsFloat()); } -void OvmsVehicleRenaultZoePh2::Ticker10(uint32_t ticker) { +void OvmsVehicleRenaultZoePh2OBD::Ticker10(uint32_t ticker) { if (StandardMetrics.ms_v_charge_pilot->AsBool() && !StandardMetrics.ms_v_env_on->AsBool()) { ChargeStatistics(); } else { @@ -319,7 +319,7 @@ void OvmsVehicleRenaultZoePh2::Ticker10(uint32_t ticker) { } } -void OvmsVehicleRenaultZoePh2::Ticker1(uint32_t ticker) { +void OvmsVehicleRenaultZoePh2OBD::Ticker1(uint32_t ticker) { if (StandardMetrics.ms_v_env_on->AsBool() && !CarIsDriving && !m_UseCarTrip) { CarIsDriving = true; //Start trip after power on @@ -379,13 +379,13 @@ void OvmsVehicleRenaultZoePh2::Ticker1(uint32_t ticker) { } } -class OvmsVehicleRenaultZoePh2Init { - public: OvmsVehicleRenaultZoePh2Init(); -} MyOvmsVehicleRenaultZoePh2Init __attribute__ ((init_priority (9000))); +class OvmsVehicleRenaultZoePh2OBDInit { + public: OvmsVehicleRenaultZoePh2OBDInit(); +} MyOvmsVehicleRenaultZoePh2OBDInit __attribute__ ((init_priority (9000))); -OvmsVehicleRenaultZoePh2Init::OvmsVehicleRenaultZoePh2Init() +OvmsVehicleRenaultZoePh2OBDInit::OvmsVehicleRenaultZoePh2OBDInit() { - ESP_LOGI(TAG, "Registering Vehicle: Renault Zoe Ph2 (9000)"); - MyVehicleFactory.RegisterVehicle