From 385195b7b4843a396fcbfe7fda0e65ad0171df4a Mon Sep 17 00:00:00 2001 From: Petter Rasmussen Date: Tue, 30 Apr 2024 17:20:33 +0200 Subject: [PATCH] Add pressure table to robot page --- .../Pages/RobotPage/PressureTable.tsx | 76 +++++++++++++++++++ .../components/Pages/RobotPage/RobotPage.tsx | 3 + frontend/src/language/en.json | 10 ++- frontend/src/language/no.json | 10 ++- 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 frontend/src/components/Pages/RobotPage/PressureTable.tsx diff --git a/frontend/src/components/Pages/RobotPage/PressureTable.tsx b/frontend/src/components/Pages/RobotPage/PressureTable.tsx new file mode 100644 index 000000000..ea117dc74 --- /dev/null +++ b/frontend/src/components/Pages/RobotPage/PressureTable.tsx @@ -0,0 +1,76 @@ +import { Table, Typography } from '@equinor/eds-core-react' +import { useLanguageContext } from 'components/Contexts/LanguageContext' +import styled from 'styled-components' +import { tokens } from '@equinor/eds-tokens' + +const TableWithHeader = styled.div` + display: grid; + grid-columns: auto; + gap: 1rem; + margin: 2rem 0rem; + max-width: 25rem; +` + +const StyledTable = styled.div` + display: grid; + overflow-x: auto; + overflow-y: hidden; +` + +const StyledTableRow = styled(Table.Row)` + &:nth-child(1), + &:nth-child(5) { + background-color: ${tokens.colors.interactive.danger__highlight.hex}; + } + &:nth-child(2), + &:nth-child(4) { + background-color: ${tokens.colors.interactive.warning__highlight.hex}; + } + &:nth-child(3) { + background-color: ${tokens.colors.interactive.success__highlight.hex}; + } +` + +export const PressureTable = () => { + const { TranslateText } = useLanguageContext() + return ( + <> + + {TranslateText('Pressure')} + {TranslateText('Recommended pressure')} + + + + + {TranslateText('Pressure level')} + {TranslateText('Pressure limit')} + + + + + {TranslateText('HighHigh')} + {'> 90'} + + + {TranslateText('High')} + {'75-90'} + + + {TranslateText('Ok')} + {'25-75'} + + + {TranslateText('Low')} + {'10-25'} + + + {TranslateText('LowLow')} + {'< 10'} + + +
+
+
+ + ) +} diff --git a/frontend/src/components/Pages/RobotPage/RobotPage.tsx b/frontend/src/components/Pages/RobotPage/RobotPage.tsx index e447af84e..00a6122af 100644 --- a/frontend/src/components/Pages/RobotPage/RobotPage.tsx +++ b/frontend/src/components/Pages/RobotPage/RobotPage.tsx @@ -5,6 +5,7 @@ import { BackButton } from 'utils/BackButton' import { Header } from 'components/Header/Header' import { RobotImage } from 'components/Displays/RobotDisplays/RobotImage' import { MoveRobotArm } from './RobotArmMovement' +import { PressureTable } from './PressureTable' import { PressureStatusDisplay } from 'components/Displays/RobotDisplays/PressureStatusDisplay' import { BatteryStatusDisplay } from 'components/Displays/RobotDisplays/BatteryStatusDisplay' import { RobotStatusChip } from 'components/Displays/RobotDisplays/RobotStatusChip' @@ -44,6 +45,7 @@ const RobotInfo = styled.div` @media (max-width: 800px) { flex-direction: column; } + margin: 0rem 0rem 2rem 0rem; ` const StatusContent = styled.div<{ $alignItems?: string }>` display: flex; @@ -112,6 +114,7 @@ export const RobotPage = () => { )} + {selectedRobot.model.type === RobotType.TaurobInspector && } {TranslateText('Actions')} diff --git a/frontend/src/language/en.json b/frontend/src/language/en.json index fa7ea2b82..4e967145b 100644 --- a/frontend/src/language/en.json +++ b/frontend/src/language/en.json @@ -231,5 +231,13 @@ "Connection Issues": "Connection Issues", "Stop button pressed during return home warning text": "You are about to stop a mission that will send the robot back to the start position. You must manually drive the robot to the start position to start a new mission.", "Failed Telemetry": "Failed Telemetry", - "Stop button pressed during localization warning text": "You are about to stop a mission that localizes the robot. You will not be able to run an inspection mission until you have successfully localized the robot." + "Stop button pressed during localization warning text": "You are about to stop a mission that localizes the robot. You will not be able to run an inspection mission until you have successfully localized the robot.", + "HighHigh": "HighHigh", + "High": "High", + "Ok": "Ok", + "Low": "Low", + "LowLow": "LowLow", + "Recommended pressure": "Recommended pressure is 67 mBar.", + "Pressure": "Pressure", + "Pressure limit": "Pressure limits [mBar]" } diff --git a/frontend/src/language/no.json b/frontend/src/language/no.json index c68b81456..22e60bd37 100644 --- a/frontend/src/language/no.json +++ b/frontend/src/language/no.json @@ -231,5 +231,13 @@ "Connection Issues": "Tilkoblingsproblemer", "Stop button pressed during return home warning text": "Du er i ferd med å stoppe et oppdrag som sender roboten tilbake til startposisjonen. Du må kjøre roboten manuelt til startposisjonen for å starte et nytt oppdrag.", "Failed Telemetry": "Mislykket telemetri", - "Stop button pressed during localization warning text": "Du er i ferd med å stoppe et oppdrag som lokaliserer roboten. Du vil ikke kunne kjøre et inspeksjonsoppdrag før du har lokalisert roboten." + "Stop button pressed during localization warning text": "Du er i ferd med å stoppe et oppdrag som lokaliserer roboten. Du vil ikke kunne kjøre et inspeksjonsoppdrag før du har lokalisert roboten.", + "HighHigh": "HøyHøy", + "High": "Høy", + "Ok": "Ok", + "Low": "Lav", + "LowLow": "LavLav", + "Recommended pressure": "Anbefalt trykk er 67 mBar.", + "Pressure": "Trykk", + "Pressure limit": "Trykkgrenser [mBar]" }