Skip to content

Commit

Permalink
feat(client/widget): Display heater temperature if heater is not faul…
Browse files Browse the repository at this point in the history
…ty in seed ECAM widget
  • Loading branch information
fussel178 committed Feb 11, 2023
1 parent 7f4558e commit 55b7f21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export function useSeedEcamData(seed: 'seedA' | 'seedB') {
rail3V3Volts: seedHeartbeat.adc_measurements_sbc[1] / 1000,
rail5Volts: seedHeartbeat.adc_measurements_sbc[7] / 1000,
heaterAllowed: (seedHeartbeat?.bat_status & 0b1000000) > 0,
heaterFault: seedHeartbeat?.bat_heater_fault > 0
heaterFault: seedHeartbeat?.bat_heater_fault > 0,
heaterTemps: seedHeartbeat?.adc_measurements_cop[4] / 10
};

// TODO: Incorporate bat_used into mainBusVoltage calculation
Expand Down
6 changes: 5 additions & 1 deletion client/src/widgets/seed-ecam-widget/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ export function Widget({ seed, voltThreshold }: WidgetProps) {
'heaterBlock',
data.rxsmVolts > voltThreshold && data.heaterAllowed
)}
heaterAmps={data.heaterFault ? '-Fault-' : '-Ok-'}
heaterAmps={
data.heaterFault
? '-Fault-'
: `${data.heaterTemps.toFixed(1)} K`
}
{...activeInactive(
'dcdcOutBlock',
data.rail3V3Volts > voltThreshold
Expand Down

0 comments on commit 55b7f21

Please sign in to comment.