@@ -4,39 +4,26 @@ import { PvComponent } from "../pv/PvComponent";
44import { forceString , parseNumericPv } from "../pv/util" ;
55import { WorkerStatus } from "../components/WorkerStatus" ;
66
7+ type StateBoxProps = { bgColor : string ; title : string ; titleColor : string } ;
8+
79// These should be in a permanent sidebar
810// See https://github.com/DiamondLightSource/mx-daq-ui/issues/46
911// Maybe I should leave this for separate PR when I put in drawer ...
10- function PmacStagesState ( ) {
11- const theme = useTheme ( ) ;
12- const bgColor = theme . palette . background . paper ;
12+ function PmacStagesState ( props : StateBoxProps ) {
1313 return (
1414 < Grid2
15- bgcolor = { bgColor }
15+ bgcolor = { props . bgColor }
1616 justifyContent = { "center" }
1717 sx = { {
1818 maxWidth : 500 ,
1919 position : "relative" ,
2020 padding : 2 ,
21- // left: 500,
2221 display : "flex" ,
2322 } }
24- // justify={"center"}
2523 >
26- { /* // <Box
27- // sx={{
28- // maxWidth: 400,
29- // padding: 2,
30- // position: "relative",
31- // zIndex: 1,
32- // left: 250,
33- // }}
34- // component={"section"}
35- // bgColor={bgColor}
36- // > */ }
3724 < Stack alignItems = { "center" } >
38- < Box alignItems = { "center" } color = { theme . palette . info . main } >
39- < b > Serial Fixed Target Stages </ b >
25+ < Box color = { props . titleColor } >
26+ < b > { props . title } </ b >
4027 </ Box >
4128 < Stack spacing = { 2 } direction = "row" >
4229 < Stack alignItems = { "center" } spacing = { 1 } >
@@ -59,7 +46,7 @@ function PmacStagesState() {
5946 decimals = { 4 }
6047 />
6148 </ Stack >
62- < Stack alignItems = { "center" } spacing = { 1 } >
49+ < Stack alignItems = { "center" } spacing = { 1 } justifyContent = { "center" } >
6350 < PvComponent
6451 label = "Scan Status"
6552 pv = "ca://BL24I-MO-STEP-14:signal:P2401"
@@ -84,8 +71,8 @@ export function BeamlineStatsTabPanel() {
8471 < Box sx = { { flexGrow : 1 } } >
8572 < Stack spacing = { 4 } alignItems = { "center" } >
8673 < WorkerStatus />
87- < Grid2 container spacing = { 2 } justifyContent = "center" >
88- < Grid2 size = { 3 } sx = { { bgcolor : bgColor } } >
74+ < Grid2 container spacing = { 3 } justifyContent = "center" >
75+ < Box bgcolor = { bgColor } >
8976 < PvComponent
9077 label = "Flux"
9178 pv = "ca://BL24I-EA-FLUX-01:XBPM-03"
@@ -102,41 +89,45 @@ export function BeamlineStatsTabPanel() {
10289 ) ;
10390 } }
10491 />
105- </ Grid2 >
106- < Grid2 size = { 3 } sx = { { bgcolor : bgColor } } >
92+ </ Box >
93+ < Box bgcolor = { bgColor } >
10794 < PvComponent
10895 label = "Energy"
10996 pv = "ca://BL24I-MO-DCM-01:ENERGY.RBV"
11097 transformValue = { parseNumericPv }
11198 decimals = { 4 }
11299 />
113- </ Grid2 >
114- < Grid2 size = { 6 } sx = { { bgcolor : bgColor } } >
100+ </ Box >
101+ < Box bgcolor = { bgColor } >
115102 < PvComponent
116103 label = "Filter Transmission"
117104 pv = "ca://BL24I-OP-ATTN-01:MATCH"
118105 transformValue = { parseNumericPv }
119106 decimals = { 4 }
120107 />
121- </ Grid2 >
108+ </ Box >
122109 </ Grid2 >
123110 < Grid2 container spacing = { 4 } justifyContent = "center" >
124- < Grid2 size = { 6 } sx = { { bgcolor : bgColor } } >
111+ < Box bgcolor = { bgColor } >
125112 < PvComponent
126- label = "Expt Shutter"
113+ label = "Experiment Shutter"
127114 pv = "ca://BL24I-PS-SHTR-01:CON"
128115 transformValue = { forceString }
129116 />
130- </ Grid2 >
131- < Grid2 size = { 6 } sx = { { bgcolor : bgColor } } >
117+ </ Box >
118+ < Box bgcolor = { bgColor } >
132119 < PvComponent
133120 label = "Fast Shutter"
134121 pv = "ca://BL24I-EA-SHTR-01:STA"
135122 transformValue = { forceString }
136123 />
137- </ Grid2 >
124+ </ Box >
138125 </ Grid2 >
139- < PmacStagesState />
126+ < PmacStagesState
127+ bgColor = { bgColor }
128+ title = "Serial Fixed Target Stages"
129+ titleColor = { theme . palette . info . main }
130+ />
140131 </ Stack >
141132 </ Box >
142133 ) ;
0 commit comments