From d3541633e097ec0e08e8cb7174165ecc05776df5 Mon Sep 17 00:00:00 2001 From: Paul Adamsen <117673433+pauladamseniii@users.noreply.github.com> Date: Tue, 12 Sep 2023 13:00:46 -0400 Subject: [PATCH] CEC-5028 - Vehicle Safe States in Digital Twin (#441) --- .../DigitalTwinTab.test.jsx.snap | 49 +++++++++++++++++++ .../Contexts/__mocks__/VehicleContext.jsx | 9 ++++ src/components/DigitalTwin/index.js | 13 ++++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap index 474053b..f22adcc 100644 --- a/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/DigitalTwinTab.test.jsx.snap @@ -248,6 +248,55 @@ exports[`DigitalTwinTab Render 1`] = ` Yes

+
+

+ Safe States +

+

+ + Vehicle Safe State + + : + False +

+

+ + VCU Safe State + + : + True +

+

+ + MCU Front Safe State + + : + False +

+

+ + MCU Rear Safe State + + : + False +

+

+ + MCU Front Inverter Error + + : + True +

+

+ + MCU Rear Inverter Error + + : + False +

+
{ const DigitalTwin = (props) => { const classes = useStyles(); - const { battery, doors, location, trex_version, ip, updated, windows, misc_windows, sunroof, dbc_version, door_locks, vcu0x260, charging_metrics, max_range, vehicle_speed, gear } = props; + const { battery, doors, location, trex_version, ip, updated, windows, misc_windows, sunroof, dbc_version, door_locks, vcu0x260, charging_metrics, max_range, vehicle_speed, gear, safe_state } = props; return (
@@ -140,6 +140,17 @@ const DigitalTwin = (props) => { {keyValueTemplate("Parked", gear.in_park ? PARKED : NOT_PARKED)}
)} + {safe_state && ( +
+

Safe States

+ {keyValueTemplate("Vehicle Safe State", safe_state.vehicle_safe_state ? "True" : "False")} + {keyValueTemplate("VCU Safe State", safe_state.vcu_safe_state ? "True" : "False")} + {keyValueTemplate("MCU Front Safe State", safe_state.mcu_front_safe_state ? "True" : "False")} + {keyValueTemplate("MCU Rear Safe State", safe_state.mcu_rear_safe_state && safe_state.mcu_rear_decoup_state ? "True" : "False")} + {keyValueTemplate("MCU Front Inverter Error", safe_state.mcu_front_inverter_error ? "True" : "False")} + {keyValueTemplate("MCU Rear Inverter Error", safe_state.mcu_rear_inverter_error ? "True" : "False")} +
+ )}
); };