@@ -6,8 +6,10 @@ import {
66 Typography ,
77 useTheme ,
88} from "@mui/material" ;
9+ import { AbortButton , RunPlanButton } from "blueapi/BlueapiComponents" ;
910import { ParameterInput } from "components/ParameterInputs" ;
1011import { JungfrauRotationContext } from "context/jungfrau/JungfrauRotationContext" ;
12+ import React from "react" ;
1113import { useContext , useState } from "react" ;
1214
1315function fullStorageDirectory ( visit : string , subDir : string ) : string {
@@ -16,14 +18,76 @@ function fullStorageDirectory(visit: string, subDir: string): string {
1618 return `/dls/i24/data/${ year } /${ visit } /jungfrau/${ subDir } ` ;
1719}
1820
21+ function RunButtons ( {
22+ visit,
23+ storageDirectory,
24+ } : {
25+ visit : string ;
26+ storageDirectory : string ;
27+ } ) : JSX . Element {
28+ const {
29+ expTime,
30+ detDist,
31+ fileName,
32+ shutterOpenT,
33+ omegaStart,
34+ omegaIncrement,
35+ scanWidth,
36+ transFract,
37+ } = useContext ( JungfrauRotationContext ) ;
38+ return (
39+ < React . Fragment >
40+ < Stack direction = { "row" } spacing = { 4 } justifyContent = { "center" } >
41+ < RunPlanButton
42+ btnLabel = "Run single rotation"
43+ planName = "run_single_rotation_plan"
44+ planParams = { {
45+ exposure_time_s : expTime ,
46+ omega_start_deg : omegaStart ,
47+ omega_increment_deg : omegaIncrement ,
48+ total_scan_width_deg : scanWidth ,
49+ detector_distance_mm : detDist ,
50+ visit : visit ,
51+ file_name : fileName ,
52+ storage_directory : storageDirectory ,
53+ shutter_opening_time_s : shutterOpenT ,
54+ transmission : transFract [ 0 ] ,
55+ } }
56+ title = "Run single rotation scan"
57+ btnSize = "large"
58+ />
59+ < RunPlanButton
60+ btnLabel = "Run multiple rotations"
61+ planName = "run_multi_rotation_plan"
62+ planParams = { {
63+ exposure_time_s : expTime ,
64+ omega_start_deg : omegaStart ,
65+ omega_increment_deg : omegaIncrement ,
66+ total_scan_width_deg : scanWidth ,
67+ detector_distance_mm : detDist ,
68+ visit : visit ,
69+ file_name : fileName ,
70+ storage_directory : storageDirectory ,
71+ shutter_opening_time_s : shutterOpenT ,
72+ transmission_fractions : transFract ,
73+ } }
74+ title = "Run multiple rotation scans ar different transmissions"
75+ btnSize = "large"
76+ />
77+ < AbortButton />
78+ </ Stack >
79+ </ React . Fragment >
80+ ) ;
81+ }
82+
1983export function CollectionSetupJf ( ) {
2084 const theme = useTheme ( ) ;
2185 const context = useContext ( JungfrauRotationContext ) ;
2286 const [ visit , setVisit ] = useState < string > ( "cm40647-5" ) ;
2387 const storageDirectory = fullStorageDirectory ( visit , context . directory ) ;
2488 return (
2589 < Box sx = { { flexGrow : 1 } } >
26- < Stack direction = { "column" } alignItems = { "center" } spacing = { 2 } >
90+ < Stack direction = { "column" } alignItems = { "center" } spacing = { 3 } >
2791 < Typography
2892 variant = "h2"
2993 sx = { {
@@ -103,6 +167,15 @@ export function CollectionSetupJf() {
103167 tooltip = "Total scan width, in deg"
104168 />
105169 </ Grid >
170+ < Grid container spacing = { 2 } marginTop = { 3 } justifyContent = { "center" } >
171+ < ParameterInput
172+ value = { context . transFract }
173+ onSet = { context . setTransFract }
174+ label = "Transmission (fraction)"
175+ tooltip = "Request transmission value(s) for collection, expressed as a fraction. If running a single rotation, just input one value, if running multiples please pass a list."
176+ />
177+ </ Grid >
178+ < RunButtons visit = { visit } storageDirectory = { storageDirectory } />
106179 </ Stack >
107180 </ Box >
108181 ) ;
0 commit comments