Skip to content

Commit 59346f0

Browse files
committed
Add jungfrau do darks
1 parent 7ce2b13 commit 59346f0

File tree

4 files changed

+81
-4
lines changed

4 files changed

+81
-4
lines changed

src/components/Extruder/CollectionSetupEx.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Button, Grid2, Stack } from "@mui/material";
1+
import { Box, Grid2, Stack } from "@mui/material";
22
import React from "react";
33
import { ParameterInput } from "../ParameterInputs";
44
import {
@@ -7,7 +7,6 @@ import {
77
PumpProbeSetup,
88
} from "./PumpProbeSelection";
99
import { AbortButton, RunPlanButton } from "../../blueapi/BlueapiComponents";
10-
import { DetailsRounded } from "@mui/icons-material";
1110

1211
/**Main collection input window for the extruderpanel. */
1312
export function CollectionSetupEx() {
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import {
2+
Box,
3+
Button,
4+
Card,
5+
CardContent,
6+
Stack,
7+
Typography,
8+
useTheme,
9+
} from "@mui/material";
10+
import React from "react";
11+
import { ParameterInput } from "../ParameterInputs";
12+
import { RunPlanButton } from "../../blueapi/BlueapiComponents";
13+
14+
export function CollectDarksPanel() {
15+
const theme = useTheme();
16+
const [expTime, setExpTime] = React.useState<number>(0.001);
17+
const [pedestalFrames, setPedestalFrames] = React.useState<number>(20);
18+
const [pedestalLoops, setPedestalLoops] = React.useState<number>(200);
19+
// const [filePath, setFilePath] = React.useState<string>("");
20+
return (
21+
<Box sx={{ flexGrow: 1, marginLeft: 15, marginRight: 5 }}>
22+
<Card variant="outlined" sx={{ minWidth: 300, minHeight: 600 }}>
23+
<CardContent>
24+
<Typography
25+
variant="h2"
26+
sx={{
27+
color: theme.palette.primary.contrastText,
28+
fontSize: 24,
29+
fontWeight: "fontWeightBold",
30+
}}
31+
>
32+
Collect darks
33+
</Typography>
34+
<Stack spacing={1} margin={2} alignContent={"center"}>
35+
<ParameterInput
36+
value={expTime}
37+
onSet={setExpTime}
38+
label="Exposure time (s)"
39+
tooltip="Set exposure time for darks collection."
40+
/>
41+
<ParameterInput
42+
value={pedestalFrames}
43+
onSet={setPedestalFrames}
44+
label="Pedestal frames"
45+
tooltip="Number of pedestal frames to collect."
46+
/>
47+
<ParameterInput
48+
value={pedestalLoops}
49+
onSet={setPedestalLoops}
50+
label="Pedestal loops"
51+
tooltip="Number of pedestal loops."
52+
/>
53+
</Stack>
54+
<RunPlanButton
55+
btnLabel="Pedestal darks"
56+
planName="do_pedestal_darks"
57+
planParams={{
58+
exp_time_s: expTime,
59+
pedestal_frame: pedestalFrames,
60+
pedestal_loops: pedestalLoops,
61+
}}
62+
title="Collect pedestal darks"
63+
btnSize="large"
64+
/>
65+
</CardContent>
66+
</Card>
67+
</Box>
68+
);
69+
}

src/routes/JungfrauRotation.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { Box, Typography, useTheme } from "@mui/material";
1+
import { Box, Grid2, Typography, useTheme } from "@mui/material";
2+
import { ParamsPanel } from "../screens/CollectionPanel";
3+
import { CollectDarksPanel } from "../components/JungFrau/CollectDarksPanel";
24

35
export function JfRotation() {
46
const theme = useTheme();
@@ -14,6 +16,12 @@ export function JfRotation() {
1416
>
1517
Jungfrau Rotation Scans Setup
1618
</Typography>
19+
<Grid2 container marginTop={2} spacing={2}>
20+
<Grid2 size={5}>
21+
<CollectDarksPanel />
22+
</Grid2>
23+
<ParamsPanel expt="jf" />
24+
</Grid2>
1725
</Box>
1826
);
1927
}

src/screens/CollectionPanel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { CollectionSetupFt } from "../components/FixedTarget/CollectionSetupFt";
33
import { CollectionSetupEx } from "../components/Extruder/CollectionSetupEx";
44

55
type ExptType = {
6-
expt: "extruder" | "fixed-target";
6+
expt: "extruder" | "fixed-target" | "jf";
77
};
88

99
function FallbackScreen() {
@@ -22,6 +22,7 @@ export function ParamsPanel(expt: ExptType) {
2222
return <CollectionSetupFt />;
2323
case "extruder":
2424
return <CollectionSetupEx />;
25+
case "jf":
2526
default:
2627
return <FallbackScreen />;
2728
}

0 commit comments

Comments
 (0)