Skip to content

Commit 3d71c69

Browse files
author
Tamoor Shahid
committed
Made template of Buttons in a grid and dialog box pop up
1 parent eac9c87 commit 3d71c69

File tree

1 file changed

+98
-1
lines changed

1 file changed

+98
-1
lines changed

src/screens/OavMover.tsx

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1-
import { Box, Button, Grid2, Stack, TextField, useTheme } from "@mui/material";
1+
import {
2+
Box,
3+
Button,
4+
Dialog,
5+
DialogActions,
6+
DialogContent,
7+
DialogTitle,
8+
Grid2,
9+
IconButton,
10+
Stack,
11+
TextField,
12+
Typography,
13+
useTheme,
14+
} from "@mui/material";
215
import { OavVideoStream } from "../components/OavVideoStream";
316
import {
417
ArrowBackRounded,
518
ArrowDownwardRounded,
619
ArrowForwardRounded,
720
ArrowUpwardRounded,
21+
Close,
22+
Help,
823
} from "@mui/icons-material";
924
import { useState } from "react";
1025

@@ -175,6 +190,86 @@ export function PixelsToMicrons({
175190
);
176191
}
177192

193+
export function CoordinateSystem() {
194+
const [open, setOpen] = React.useState(false);
195+
196+
const handleClickOpen = () => {
197+
setOpen(true);
198+
};
199+
const handleClose = () => {
200+
setOpen(false);
201+
};
202+
203+
return (
204+
<>
205+
<Box>
206+
<Grid2 container spacing={2}>
207+
<Grid2 size={10}>
208+
<b>Co-ordinate System Setup</b>
209+
</Grid2>
210+
<Grid2>
211+
<Help onClick={handleClickOpen} />
212+
</Grid2>
213+
<Grid2 size={4}>
214+
<Button>Move chip to origin</Button>
215+
</Grid2>
216+
<Grid2 size={4}>
217+
<Button>Go to Fiducial 1</Button>
218+
</Grid2>
219+
<Grid2 size={4}>
220+
<Button>Go to Fiducial 2</Button>
221+
</Grid2>
222+
<Grid2 size={4}>
223+
<Button>Set Fiducial 0</Button>
224+
</Grid2>
225+
<Grid2 size={4}>
226+
<Button>Set Fiducial 1</Button>
227+
</Grid2>
228+
<Grid2 size={4}>
229+
<Button>Set Fiducial 2</Button>
230+
</Grid2>
231+
<Grid2 size={8} offset={2}>
232+
<Button>Make Coordinate System</Button>
233+
</Grid2>
234+
</Grid2>
235+
</Box>
236+
<Dialog
237+
onClose={handleClose}
238+
aria-labelledby="customized-dialog-title"
239+
open={open}
240+
>
241+
<DialogTitle sx={{ m: 0, p: 2 }} id="customized-dialog-title">
242+
Modal title
243+
</DialogTitle>
244+
<IconButton
245+
aria-label="close"
246+
onClick={handleClose}
247+
sx={(theme) => ({
248+
position: "absolute",
249+
right: 8,
250+
top: 8,
251+
color: theme.palette.grey[500],
252+
})}
253+
>
254+
<Close />
255+
</IconButton>
256+
<DialogContent dividers>
257+
<Typography gutterBottom>
258+
Cras mattis consectetur purus sit amet fermentum. Cras justo odio,
259+
dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta
260+
ac consectetur ac, vestibulum at eros.
261+
</Typography>
262+
</DialogContent>
263+
<DialogActions>
264+
<Button autoFocus onClick={handleClose}>
265+
Save changes
266+
</Button>
267+
</DialogActions>
268+
</Dialog>
269+
</>
270+
);
271+
}
272+
178273
export function OavMover() {
179274
const [crosshairX, setCrosshairX] = useState<number>(200);
180275
const [crosshairY, setCrosshairY] = useState<number>(200);
@@ -226,6 +321,8 @@ export function OavMover() {
226321
label="zoom-level"
227322
pv="ca://BL24I-EA-OAV-01:FZOOM:MP:SELECT"
228323
/>
324+
<hr />
325+
<CoordinateSystem />
229326
</Grid2>
230327
</Grid2>
231328
</div>

0 commit comments

Comments
 (0)