Skip to content

Commit

Permalink
add comm channel status to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
MCLiii committed Apr 28, 2024
1 parent 0987845 commit 56bbc70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Backend/core/core_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ async def single_values():
if comms.solar_car_connection['udp'] or comms.solar_car_connection['lte']:
latest_data = comms.frontend_data
latest_data['solar_car_connection'] = True
latest_data['udp_status'] = comms.solar_car_connection['udp']
latest_data['lte_status'] = comms.solar_car_connection['lte']
latest_data['timestamps'] = f'{latest_data["tstamp_hr"]:02d}:{latest_data["tstamp_mn"]:02d}:' \
f'{latest_data["tstamp_sc"]:02d}.{latest_data["tstamp_ms"]}'
format_data = {}
Expand Down
10 changes: 10 additions & 0 deletions Frontend/src/Components/Communication/Communication.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ export default function Communication(props) {
<Text fontSize='2vh' style={{ textIndent: 30 }}>&#160;Packet Delay: </Text>
<Text fontSize='2vh' backgroundColor={bgColor}>{_getFormattedPacketDelay()}</Text>
</HStack>
<CommsLabel
indent={true}
boolean={props.data?.udp_status[0]}
label='UDP'
/>
<CommsLabel
indent={true}
boolean={props.data?.lte_status[0]}
label='LTE'
/>
<CommsLabel
boolean={props.data?.mainIO_heartbeat[0]}
label='Main IO Heartbeat'
Expand Down

0 comments on commit 56bbc70

Please sign in to comment.