Skip to content

Commit 5cb0765

Browse files
author
Tamoor Shahid
committed
Merge remote-tracking branch 'origin/main' into 47-Adding_Coordinate_System
2 parents 8d94777 + 2e8ca8f commit 5cb0765

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

src/screens/OavMover.tsx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
TextField,
1111
Typography,
1212
useTheme,
13+
Drawer,
14+
Tooltip,
1315
} from "@mui/material";
1416
import { OavVideoStream } from "../components/OavVideoStream";
1517
import {
@@ -29,6 +31,13 @@ import { PvDescription } from "../pv/PvComponent";
2931
import { SelectionWithPlanRunner } from "../components/SelectionControl";
3032
import { BacklightPositions, ZoomLevels } from "../pv/enumPvValues";
3133

34+
const buttonStyle = {
35+
color: "white",
36+
margin: "5px",
37+
padding: "15px",
38+
backgroundColor: "#1c2025",
39+
};
40+
3241
function BacklightControl(props: PvDescription) {
3342
const theme = useTheme();
3443
return (
@@ -189,6 +198,73 @@ export function PixelsToMicrons({
189198
);
190199
}
191200

201+
export function PresetMovements() {
202+
return (
203+
<Box sx={{ textAlign: `center` }}>
204+
<p>
205+
<b>Preset Positions</b>
206+
</p>
207+
<Grid2>
208+
<Tooltip title={"Move into position for collection"}>
209+
<Button
210+
style={buttonStyle}
211+
onClick={() =>
212+
submitAndRunPlanImmediately("moveto_preset", {
213+
place: "collect_position",
214+
})
215+
}
216+
>
217+
Collect Position
218+
</Button>
219+
</Tooltip>
220+
221+
<Tooltip title={"Move hardware for sample loading"}>
222+
<Button
223+
style={buttonStyle}
224+
onClick={() =>
225+
submitAndRunPlanImmediately("moveto_preset", {
226+
place: "load_position",
227+
})
228+
}
229+
>
230+
Load Position
231+
</Button>
232+
</Tooltip>
233+
<Tooltip title={"Align microdrop"}>
234+
<Button
235+
style={buttonStyle}
236+
onClick={() =>
237+
submitAndRunPlanImmediately("moveto_preset", {
238+
place: "microdrop_position",
239+
})
240+
}
241+
>
242+
Microdrop Align
243+
</Button>
244+
</Tooltip>
245+
</Grid2>
246+
</Box>
247+
);
248+
}
249+
250+
export function SideDrawer() {
251+
const [open, setOpen] = useState(false);
252+
const toggleDrawer = (newOpen: boolean) => () => {
253+
setOpen(newOpen);
254+
};
255+
256+
return (
257+
<>
258+
<Button style={buttonStyle} onClick={toggleDrawer(true)}>
259+
Preset Positions
260+
</Button>
261+
<Drawer open={open} onClose={toggleDrawer(false)}>
262+
<PresetMovements />
263+
</Drawer>
264+
</>
265+
);
266+
}
267+
192268
export function CoordinateSystem() {
193269
const [open, setOpen] = React.useState(false);
194270

@@ -385,6 +461,8 @@ export function OavMover() {
385461
/>
386462
<hr />
387463
<CoordinateSystem />
464+
<hr />
465+
<SideDrawer />
388466
</Grid2>
389467
</Grid2>
390468
</div>

0 commit comments

Comments
 (0)