Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for FirmwareUpdate dataformat #88

Merged
merged 12 commits into from
Mar 6, 2024
2 changes: 1 addition & 1 deletion Backend/Data/sc1-data-format
Submodule sc1-data-format updated 1 files
+106 −116 format.json
6 changes: 3 additions & 3 deletions Frontend/src/Components/BatteryPack/BatteryPack.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default function BatteryPack(props) {
const headerBg = getColor("header", colorMode);
const borderColor = getColor("border", colorMode);

const fanEnableText = ((props.data?.fan_enable[0] ?? -1.0) === -1.0) ? 'N/A' : (props.data.fan_enable[0] ? 'EN' : 'DIS');
const fanEnableColor = (props.data?.fan_enable[0] ?? false) ? getColor("greenBg", colorMode) : getColor("redBg", colorMode);
const fanEnableTextColor = (props.data?.fan_enable[0] ?? false) ? getColor("txtGreenBg", colorMode) : getColor("txtRedBg", colorMode);
const fanEnableText = ((props.data?.fan_speed[0] ?? -1.0) === -1.0) ? 'N/A' : (props.data.fan_speed[0] ? 'EN' : 'DIS');
const fanEnableColor = (props.data?.fan_speed[0] ?? false) ? getColor("greenBg", colorMode) : getColor("redBg", colorMode);
const fanEnableTextColor = (props.data?.fan_speed[0] ?? false) ? getColor("txtGreenBg", colorMode) : getColor("txtRedBg", colorMode);

const chargeEnableText = ((props.data?.charge_enable[0] ?? -1.0) === -1.0) ? 'N/A' : (props.data.charge_enable[0] ? 'High' : 'Low');
const chargeEnableColor = ((props.data?.charge_enable[0] ?? -1.0) == CONSTANTS.charge_enable.MAX) ? getColor("greenBg", colorMode) : getColor("redBg", colorMode);
Expand Down
51 changes: 4 additions & 47 deletions Frontend/src/Components/Faults/FaultsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,8 @@ export default function Faults(props) {
props.data?.motor_controller_temp[0] < CONSTANTS.motor_controller_temp.MIN ||
props.data?.dcdc_temp[0] > CONSTANTS.dcdc_temp.MAX ||
props.data?.dcdc_temp[0] < CONSTANTS.dcdc_temp.MIN ||
props.data?.driverIO_temp[0] > CONSTANTS.driverIO_temp.MAX ||
props.data?.driverIO_temp[0] < CONSTANTS.driverIO_temp.MIN ||
props.data?.mainIO_temp[0] > CONSTANTS.mainIO_temp.MAX ||
props.data?.mainIO_temp[0] < CONSTANTS.mainIO_temp.MIN ||
props.data?.cabin_temp[0] > CONSTANTS.cabin_temp.MAX ||
props.data?.cabin_temp[0] < CONSTANTS.cabin_temp.MIN ||
props.data?.road_temp[0] > CONSTANTS.road_temp.MAX ||
props.data?.road_temp[0] < CONSTANTS.road_temp.MIN ||
props.data?.brake_temp[0] > CONSTANTS.brake_temp.MAX ||
Expand Down Expand Up @@ -350,27 +346,13 @@ export default function Faults(props) {
"DCDC",
"DCDC"
);
_updateTempArrays(
lowTempStrings,
highTempStrings,
"driverIO_temp",
"Driver IO",
"driver IO"
);
_updateTempArrays(
lowTempStrings,
highTempStrings,
"mainIO_temp",
"Main IO",
"main IO"
);
_updateTempArrays(
lowTempStrings,
highTempStrings,
"cabin_temp",
"Cabin",
"cabin"
);
_updateTempArrays(
lowTempStrings,
highTempStrings,
Expand Down Expand Up @@ -482,9 +464,6 @@ export default function Faults(props) {
const getMCUString = () => {
let MCUStrings = [];

if (_checkBooleanData("mcu_check")) {
MCUStrings.push("MCU check");
}
if (_checkBooleanData("mcu_stat_fdbk")) {
MCUStrings.push("MCU status feedback");
}
Expand Down Expand Up @@ -648,7 +627,7 @@ export default function Faults(props) {
return (
<Center w="100%" h="100%">
<SimpleGrid
columns={8}
columns={7}
rows={3}
spacingX="1.6vw"
spacingY="3.3vh"
Expand Down Expand Up @@ -698,22 +677,14 @@ export default function Faults(props) {
) : (
<Box h={imageHeight} />
)}
{_checkBooleanData("mcu_check")
|| _checkBooleanData("mcu_stat_fdbk")
{_checkBooleanData("mcu_stat_fdbk")
|| _checkBooleanData("mcu_hv_en") ? (
<Tooltip label={getMCUString()}>
<Image fit={fitType} boxSize={imageHeight} src={Images.MCUCheck} />
</Tooltip>
) : (
<Box h={imageHeight} />
)}
{_checkBooleanData("door") ? (
<Tooltip label={"Door is open"}>
<Image fit={fitType} boxSize={imageHeight} src={Images.Door} />
</Tooltip>
) : (
<Box h={imageHeight} />
)}
{_checkBooleanData("driver_eStop") ||
_checkBooleanData("external_eStop") ? (
<Tooltip label={getEStopString()}>
Expand All @@ -722,18 +693,6 @@ export default function Faults(props) {
) : (
<Box h={imageHeight} />
)}
{_checkBooleanData("main_power_warning")
|| _checkBooleanData("main_power_critical")
|| _checkBooleanData("main_power_valid")
|| _checkBooleanData("driver_power_warning")
|| _checkBooleanData("driver_power_critical")
|| _checkBooleanData("driver_power_valid") ? (
<Tooltip label={getMainDriverPowerString()}>
<Image fit={fitType} boxSize={imageHeight} src={Images.PowerWarnings} />
</Tooltip>
) : (
<Box h={imageHeight} />
)}
{_checkBooleanData("bps_fault") ? (
<Tooltip label={"BPS fault"}>
<Image fit={fitType} boxSize={imageHeight} src={Images.BPSFault} />
Expand All @@ -748,8 +707,8 @@ export default function Faults(props) {
) : (
<Box h={imageHeight} />
)}
{_checkBooleanData("imd_status") ? (
<Tooltip label={"IMD status (battery isolation) fault"}>
{_checkBooleanData("isolation") ? (
<Tooltip label={"Isolation fault"}>
<Image fit={fitType} boxSize={imageHeight} src={Images.IMDStatus} />
</Tooltip>
) : (
Expand Down Expand Up @@ -780,8 +739,6 @@ export default function Faults(props) {
) : (
<Box h={imageHeight} />
)}
{/* Box to horizontally center the lowest row of faults */}
<Box h={imageHeight} />
{props.data?.pack_voltage[0] > CONSTANTS.pack_voltage.MAX ? (
<Tooltip label={"High battery pack voltage"}>
<Image fit={fitType} boxSize={imageHeight} src={Images.HighVoltage} />
Expand Down
Loading