From 5daa3e3981e64cd097ced28556cc70e702a8bee5 Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Wed, 10 Dec 2025 14:38:45 +0000 Subject: [PATCH 1/4] Added Focus tab --- src/screens/OavMover/OavMove.tsx | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/screens/OavMover/OavMove.tsx b/src/screens/OavMover/OavMove.tsx index 0960b04..97d5c3c 100644 --- a/src/screens/OavMover/OavMove.tsx +++ b/src/screens/OavMover/OavMove.tsx @@ -190,6 +190,41 @@ function WindowMove(props: TabPanelProps) { ); } +function FocusMove(props: TabPanelProps) { + if (props.value !== props.index) return null; + + return ( + + + + + + + ); +} + export function MoveArrows() { const theme = useTheme(); @@ -223,11 +258,13 @@ export function MoveArrows() { + + ); } From 4ba412df4d239fcc99cb51f7622bd271c8ab4be9 Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Wed, 10 Dec 2025 14:38:45 +0000 Subject: [PATCH 2/4] Added Focus tab --- src/screens/OavMover/OAVMoveController.tsx | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/screens/OavMover/OAVMoveController.tsx b/src/screens/OavMover/OAVMoveController.tsx index 0960b04..97d5c3c 100644 --- a/src/screens/OavMover/OAVMoveController.tsx +++ b/src/screens/OavMover/OAVMoveController.tsx @@ -190,6 +190,41 @@ function WindowMove(props: TabPanelProps) { ); } +function FocusMove(props: TabPanelProps) { + if (props.value !== props.index) return null; + + return ( + + + + + + + ); +} + export function MoveArrows() { const theme = useTheme(); @@ -223,11 +258,13 @@ export function MoveArrows() { + + ); } From 1aed79af22b49b4fe8a6d9a60d299ed11f0b66b8 Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Mon, 15 Dec 2025 16:51:51 +0000 Subject: [PATCH 3/4] Readded shrinking arrows --- src/screens/OavMover/OAVMoveController.tsx | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/screens/OavMover/OAVMoveController.tsx b/src/screens/OavMover/OAVMoveController.tsx index 97d5c3c..19fbf60 100644 --- a/src/screens/OavMover/OAVMoveController.tsx +++ b/src/screens/OavMover/OAVMoveController.tsx @@ -26,6 +26,16 @@ const arrowsBoxStyle = { gap: "10px", }; +const arrowsScreenSizing = { + minWidth: { + lg: "32px", + xl: "64px", + }, + width: { + lg: "32px", + }, +}; + function BlockMove(props: TabPanelProps) { if (props.value !== props.index) return null; @@ -75,6 +85,7 @@ function NudgeMove(props: TabPanelProps) { planName={"move_nudge_on_arrow_click"} planParams={{ direction: "up", size_of_move: "big" }} btnVariant="outlined" + sx={arrowsScreenSizing} /> } planName={"move_nudge_on_arrow_click"} planParams={{ direction: "left", size_of_move: "small" }} btnVariant="outlined" + sx={arrowsScreenSizing} /> } planName={"move_nudge_on_arrow_click"} planParams={{ direction: "right", size_of_move: "big" }} btnVariant="outlined" + sx={arrowsScreenSizing} /> ); @@ -138,6 +156,7 @@ function WindowMove(props: TabPanelProps) { planName={"move_window_on_arrow_click"} planParams={{ direction: "up", size_of_move: "big" }} btnVariant="outlined" + sx={arrowsScreenSizing} /> } planName={"move_window_on_arrow_click"} planParams={{ direction: "left", size_of_move: "small" }} btnVariant="outlined" + sx={arrowsScreenSizing} /> } planName={"move_window_on_arrow_click"} planParams={{ direction: "right", size_of_move: "big" }} btnVariant="outlined" + sx={arrowsScreenSizing} /> ); From dc37618310c0f3429bee6ba51f0e2db2874a2787 Mon Sep 17 00:00:00 2001 From: Tamoor Shahid Date: Tue, 20 Jan 2026 15:32:30 +0000 Subject: [PATCH 4/4] Made focus tab responsive and edited grid tags --- src/screens/OavMover/OAVMoveController.tsx | 9 ++- src/screens/OavMover/OAVSideBar.tsx | 12 +-- src/screens/OavMover/OAVStageController.tsx | 87 ++++++++++++--------- 3 files changed, 62 insertions(+), 46 deletions(-) diff --git a/src/screens/OavMover/OAVMoveController.tsx b/src/screens/OavMover/OAVMoveController.tsx index 19fbf60..37ec2f3 100644 --- a/src/screens/OavMover/OAVMoveController.tsx +++ b/src/screens/OavMover/OAVMoveController.tsx @@ -221,7 +221,11 @@ function FocusMove(props: TabPanelProps) { return ( + <>
-
+ ); } diff --git a/src/screens/OavMover/OAVStageController.tsx b/src/screens/OavMover/OAVStageController.tsx index 55eb24b..445d2ca 100644 --- a/src/screens/OavMover/OAVStageController.tsx +++ b/src/screens/OavMover/OAVStageController.tsx @@ -1,4 +1,4 @@ -import { Box, Grid2, useTheme } from "@mui/material"; +import { Grid2, useTheme } from "@mui/material"; import { OavVideoStream } from "../../components/OavVideoStream"; import { submitAndRunPlanImmediately } from "../../blueapi/blueapi"; @@ -16,43 +16,60 @@ export function OavMover() { const fullVisit = readVisitFromPv(); return ( -
- - - - { - const [x_um, y_um] = [x / pixelsPerMicron, y / pixelsPerMicron]; + + + { + const [x_um, y_um] = [x / pixelsPerMicron, y / pixelsPerMicron]; + console.log( + `Clicked on position (${x}, ${y}) (px relative to beam centre) in original stream. Relative position in um (${x_um}, ${y_um}). Submitting to BlueAPI...`, + ); + const [x_int, y_int] = [Math.round(x), Math.round(y)]; + if (Number.isNaN(x_um) || Number.isNaN(y_um)) { + console.log("Not submitting plan while disconnected from PVs!"); + } else { + // This is an example but not useful for actual production use. + submitAndRunPlanImmediately({ + planName: "gui_gonio_move_on_click", + planParams: { position_px: [x_int, y_int] }, + instrumentSession: parseInstrumentSession(fullVisit), + }).catch((error) => { console.log( - `Clicked on position (${x}, ${y}) (px relative to beam centre) in original stream. Relative position in um (${x_um}, ${y_um}). Submitting to BlueAPI...`, + `Failed to run plan gui_gonio_move_on_click, see console and logs for full error. Reason: ${error}`, ); - const [x_int, y_int] = [Math.round(x), Math.round(y)]; - if (Number.isNaN(x_um) || Number.isNaN(y_um)) { - console.log( - "Not submitting plan while disconnected from PVs!", - ); - } else { - // This is an example but not useful for actual production use. - submitAndRunPlanImmediately({ - planName: "gui_gonio_move_on_click", - planParams: { position_px: [x_int, y_int] }, - instrumentSession: parseInstrumentSession(fullVisit), - }).catch((error) => { - console.log( - `Failed to run plan gui_gonio_move_on_click, see console and logs for full error. Reason: ${error}`, - ); - }); - } - }} - /> - - + }); + } + }} + /> + + + -
+ ); } + +/* + +xs, sm, md, lg, xl + +Anything below lg (1200px) will be one column. +Lg and above will have a side bar. +Lg will still have a compact side bar like focus tab being 2x2 grid. +XL can afford to be normal like 4 button wide focus tab. +Anything larger will just have to deal with it for now. + +*/