diff --git a/frontend/src/components/Displays/RobotDisplays/BatteryStatusDisplay.tsx b/frontend/src/components/Displays/RobotDisplays/BatteryStatusDisplay.tsx index 5be830e38..8f5b96327 100644 --- a/frontend/src/components/Displays/RobotDisplays/BatteryStatusDisplay.tsx +++ b/frontend/src/components/Displays/RobotDisplays/BatteryStatusDisplay.tsx @@ -2,6 +2,7 @@ import { tokens } from '@equinor/eds-tokens' import { Icon, Typography } from '@equinor/eds-core-react' import styled from 'styled-components' import { Icons } from 'utils/icons' +import { BatteryStatus } from 'models/Battery' const BatteryAlignment = styled.div` display: flex; @@ -12,6 +13,7 @@ const StyledTypography = styled(Typography)<{ $fontSize?: 24 | 16 | 18 | 32 | 40 ` interface BatteryStatusDisplayProps { batteryLevel?: number + batteryState?: BatteryStatus itemSize?: 24 | 16 | 18 | 32 | 40 | 48 | undefined batteryWarningLimit?: number textAlignedBottom?: boolean @@ -19,6 +21,7 @@ interface BatteryStatusDisplayProps { export const BatteryStatusDisplay = ({ batteryLevel, + batteryState, itemSize, batteryWarningLimit, textAlignedBottom, @@ -27,6 +30,8 @@ export const BatteryStatusDisplay = ({ const getBatteryIcon = (batteryLevel?: number) => { switch (true) { + case batteryState === BatteryStatus.Charging: + return Icons.BatteryCharging case batteryLevel === null || batteryLevel === undefined: return Icons.BatteryUnknown case !batteryWarningLimit || batteryLevel! > batteryWarningLimit: diff --git a/frontend/src/components/Pages/FrontPage/MissionOverview/RobotCard.tsx b/frontend/src/components/Pages/FrontPage/MissionOverview/RobotCard.tsx index a03fa9fcb..a7dfb05d5 100644 --- a/frontend/src/components/Pages/FrontPage/MissionOverview/RobotCard.tsx +++ b/frontend/src/components/Pages/FrontPage/MissionOverview/RobotCard.tsx @@ -145,6 +145,7 @@ export const RobotCard = ({ robot }: { robot: Robot }) => { {TranslateText('Battery')} diff --git a/frontend/src/components/Pages/RobotPage/RobotPage.tsx b/frontend/src/components/Pages/RobotPage/RobotPage.tsx index 16f66db7c..c21848214 100644 --- a/frontend/src/components/Pages/RobotPage/RobotPage.tsx +++ b/frontend/src/components/Pages/RobotPage/RobotPage.tsx @@ -137,6 +137,7 @@ export const RobotPage = () => { {selectedRobot.pressureLevel !== null && diff --git a/frontend/src/models/Robot.ts b/frontend/src/models/Robot.ts index 99e9f09da..9b83abb2b 100644 --- a/frontend/src/models/Robot.ts +++ b/frontend/src/models/Robot.ts @@ -28,7 +28,7 @@ export interface Robot { serialNumber?: string currentInstallation: Installation batteryLevel?: number - batteryStatus?: BatteryStatus + batteryState?: BatteryStatus pressureLevel?: number pose?: Pose status: RobotStatus