Skip to content

Commit bb4856c

Browse files
committed
Merge branch 'main' into 51_fix-oav-view
2 parents 88688c9 + d0ea31f commit bb4856c

File tree

2 files changed

+160
-2
lines changed

2 files changed

+160
-2
lines changed
Lines changed: 4 additions & 0 deletions
Loading

src/screens/OavMover.tsx

Lines changed: 156 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
import {
22
Box,
33
Button,
4-
Drawer,
4+
Dialog,
5+
DialogContent,
6+
DialogTitle,
57
Grid2,
8+
IconButton,
69
Stack,
710
TextField,
8-
Tooltip,
11+
Typography,
912
useTheme,
13+
Drawer,
14+
Tooltip,
1015
} from "@mui/material";
1116
import { OavVideoStream } from "../components/OavVideoStream";
1217
import {
1318
ArrowBackRounded,
1419
ArrowDownwardRounded,
1520
ArrowForwardRounded,
1621
ArrowUpwardRounded,
22+
Close,
23+
Help,
1724
} from "@mui/icons-material";
1825
import { useState } from "react";
1926

@@ -23,6 +30,7 @@ import { CoordNumberInput } from "../components/CoordNumberInput";
2330
import { PvDescription } from "../pv/PvComponent";
2431
import { SelectionWithPlanRunner } from "../components/SelectionControl";
2532
import { BacklightPositions, ZoomLevels } from "../pv/enumPvValues";
33+
import oxfordChipDiagram from "../assets/Oxford Chip Diagram.excalidraw.svg";
2634

2735
const buttonStyle = {
2836
color: "white",
@@ -258,6 +266,148 @@ export function SideDrawer() {
258266
);
259267
}
260268

269+
export function CoordinateSystem() {
270+
const [open, setOpen] = React.useState(false);
271+
272+
const handleClickOpen = () => {
273+
setOpen(true);
274+
};
275+
const handleClose = () => {
276+
setOpen(false);
277+
};
278+
279+
const buttonStyle = {
280+
color: "white",
281+
padding: "12px",
282+
backgroundColor: "#1c2025",
283+
width: "100%",
284+
height: "85%",
285+
};
286+
287+
return (
288+
<>
289+
<Box>
290+
<Grid2 container rowSpacing={0} spacing={1}>
291+
<Grid2 size={10}>
292+
<b>Co-ordinate System Setup</b>
293+
</Grid2>
294+
<Grid2>
295+
<Help onClick={handleClickOpen} />
296+
</Grid2>
297+
<Grid2 size={4}>
298+
<Button
299+
style={buttonStyle}
300+
onClick={() =>
301+
submitAndRunPlanImmediately("moveto", {
302+
place: "zero",
303+
})
304+
}
305+
>
306+
Go to Origin
307+
</Button>
308+
</Grid2>
309+
<Grid2 size={4}>
310+
<Button
311+
style={buttonStyle}
312+
onClick={() =>
313+
submitAndRunPlanImmediately("moveto", {
314+
place: "f1",
315+
})
316+
}
317+
>
318+
Go to Fiducial 1
319+
</Button>
320+
</Grid2>
321+
<Grid2 size={4}>
322+
<Button
323+
style={buttonStyle}
324+
onClick={() =>
325+
submitAndRunPlanImmediately("moveto", {
326+
place: "f2",
327+
})
328+
}
329+
>
330+
Go to Fiducial 2
331+
</Button>
332+
</Grid2>
333+
<Grid2 size={4}>
334+
<Button style={buttonStyle}>Set Fiducial 0</Button>
335+
</Grid2>
336+
<Grid2 size={4}>
337+
<Button
338+
style={buttonStyle}
339+
onClick={() =>
340+
submitAndRunPlanImmediately("fiducial", {
341+
point: "1",
342+
})
343+
}
344+
>
345+
Set Fiducial 1
346+
</Button>
347+
</Grid2>
348+
<Grid2 size={4}>
349+
<Button
350+
style={buttonStyle}
351+
onClick={() =>
352+
submitAndRunPlanImmediately("fiducial", {
353+
point: "2",
354+
})
355+
}
356+
>
357+
Set Fiducial 2
358+
</Button>
359+
</Grid2>
360+
<Grid2 size={6}>
361+
<Button
362+
style={buttonStyle}
363+
onClick={() => submitAndRunPlanImmediately("cs_maker", {})}
364+
>
365+
Make Coordinate System
366+
</Button>
367+
</Grid2>
368+
<Grid2 size={6}>
369+
<Button
370+
style={buttonStyle}
371+
onClick={() => submitAndRunPlanImmediately("block_check", {})}
372+
>
373+
Block Check
374+
</Button>
375+
</Grid2>
376+
</Grid2>
377+
</Box>
378+
<Dialog
379+
onClose={handleClose}
380+
aria-labelledby="customized-dialog-title"
381+
open={open}
382+
>
383+
<DialogTitle sx={{ m: 0, p: 2 }} id="customized-dialog-title">
384+
How to use Co-ordinate System Setup
385+
</DialogTitle>
386+
<IconButton
387+
aria-label="close"
388+
onClick={handleClose}
389+
sx={(theme) => ({
390+
position: "absolute",
391+
right: 8,
392+
top: 8,
393+
color: theme.palette.grey[500],
394+
})}
395+
>
396+
<Close />
397+
</IconButton>
398+
<DialogContent dividers>
399+
<img src={oxfordChipDiagram} alt="" />
400+
<Typography gutterBottom>
401+
Fiducial alignment for an Oxford type chip. Fiducial 0 is the
402+
origin, the top left corner. Fiducial 1 is the top right corner and
403+
Fiducial 2 is the bottom left corner.
404+
</Typography>
405+
</DialogContent>
406+
</Dialog>
407+
</>
408+
);
409+
}
410+
261411
export function OavMover() {
262412
const [crosshairX, setCrosshairX] = useState<number>(200);
263413
const [crosshairY, setCrosshairY] = useState<number>(200);
@@ -306,6 +456,10 @@ export function OavMover() {
306456
label="zoom-level"
307457
pv="ca://BL24I-EA-OAV-01:FZOOM:MP:SELECT"
308458
/>
459+
<hr />
460+
<CoordinateSystem />
461+
<hr />
462+
<SideDrawer />
309463
</Grid2>
310464
</Grid2>
311465
// </div>

0 commit comments

Comments
 (0)