Skip to content

Commit d053b91

Browse files
committed
Handle going to recharging
1 parent 9842733 commit d053b91

7 files changed

Lines changed: 18 additions & 6 deletions

File tree

backend/api/Database/Models/Robot.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public enum RobotStatus
141141
Recharging,
142142
Lockdown,
143143
GoingToLockdown,
144+
GoingToRecharging,
144145
}
145146

146147
public enum RobotCapabilitiesEnum

frontend/src/components/Displays/RobotDisplays/RobotStatusIcon.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export const RobotStatusChip = ({ status, isarConnected, itemSize }: StatusProps
4646
iconColor = tokens.colors.text.static_icons__default.hex
4747
break
4848
}
49+
case RobotStatus.GoingToRecharging: {
50+
statusIcon = Icons.Ongoing
51+
iconColor = tokens.colors.text.static_icons__default.hex
52+
break
53+
}
4954
case RobotStatus.BlockedProtectiveStop: {
5055
statusIcon = Icons.Blocked
5156
iconColor = tokens.colors.interactive.danger__resting.hex

frontend/src/components/Pages/FrontPage/MissionOverview/MissionControlSection.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RobotCard, RobotCardPlaceholder } from './RobotCard'
44
import { useAssetContext } from 'components/Contexts/AssetContext'
55
import { tokens } from '@equinor/eds-tokens'
66
import {
7-
OngoingLockdownMissionCard,
7+
OngoingEmergencyMissionCard,
88
OngoingMissionCard,
99
OngoingMissionPlaceholderCard,
1010
OngoingReturnHomeMissionCard,
@@ -86,7 +86,8 @@ const MissionControlCard = ({ robot }: { robot: Robot }) => {
8686
)
8787
break
8888
case RobotStatus.GoingToLockdown:
89-
missionCard = <OngoingLockdownMissionCard robot={robot} isOpen={isOpen} setIsOpen={setIsOpen} />
89+
case RobotStatus.GoingToRecharging:
90+
missionCard = <OngoingEmergencyMissionCard robot={robot} isOpen={isOpen} setIsOpen={setIsOpen} />
9091
break
9192
case RobotStatus.ReturnHomePaused:
9293
missionCard = (

frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface ReturnHomeProps {
3939
isPaused: boolean
4040
}
4141

42-
interface GoingToLockdownProps {
42+
interface OngoingEmergencyMissionCardProps {
4343
robot: Robot
4444
isOpen?: boolean
4545
setIsOpen?: (isOpen: boolean | ((prev: boolean) => boolean)) => void
@@ -271,7 +271,7 @@ export const OngoingReturnHomeMissionCard = ({ robot, isOpen, setIsOpen, isPause
271271
)
272272
}
273273

274-
export const OngoingLockdownMissionCard = ({ robot, isOpen, setIsOpen }: GoingToLockdownProps) => {
274+
export const OngoingEmergencyMissionCard = ({ robot, isOpen, setIsOpen }: OngoingEmergencyMissionCardProps) => {
275275
const { TranslateText } = useLanguageContext()
276276
const missionName = TranslateText('Return robot to home')
277277

frontend/src/language/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,7 @@
335335
"Robot ready for missions": "Robot ready for missions",
336336
"InterventionNeeded": "Intervention Needed",
337337
"ReturnHomePaused": "Returning home paused",
338-
"Current Inspection Area": "Current Inspection Area"
338+
"Current Inspection Area": "Current Inspection Area",
339+
"GoingToRecharging": "Returning to recharge",
340+
"GoingToLockdown": "Returning due to lockdown"
339341
}

frontend/src/language/no.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,7 @@
335335
"Robot ready for missions": "Roboten klar for oppdrag",
336336
"InterventionNeeded": "Intervensjon nødvendig",
337337
"ReturnHomePaused": "Kjøring hjem pauset",
338-
"Current Inspection Area": "Nåværende inspeksjonsområde"
338+
"Current Inspection Area": "Nåværende inspeksjonsområde",
339+
"GoingToRecharging": "Returnerer for å lade",
340+
"GoingToLockdown": "Returnerer på grunn av lockdown"
339341
}

frontend/src/models/Robot.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export enum RobotStatus {
1919
InterventionNeeded = 'InterventionNeeded',
2020
Lockdown = 'Lockdown',
2121
GoingToLockdown = 'GoingToLockdown',
22+
GoingToRecharging = 'GoingToRecharging',
2223
}
2324

2425
export interface Robot {

0 commit comments

Comments
 (0)