Skip to content

Commit 6b16840

Browse files
committed
Add acquisition valid chip
1 parent 0addebd commit 6b16840

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/renderer/views/guider/guide.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,20 @@ const AxesGroup = () => {
5757
};
5858

5959
const AstrometryFitStack = () => {
60-
const keywords = useKeywords(['cherno.astrometry_fit', 'cherno.guide_rms']);
60+
const keywords = useKeywords([
61+
'cherno.astrometry_fit',
62+
'cherno.guide_rms',
63+
'cherno.acquisition_valid'
64+
]);
6165

6266
const [fwhm, setFwhm] = React.useState('-');
6367
const [fwhmColor, setFwhmColor] = React.useState<any>('default');
6468

6569
const [rms, setRms] = React.useState('-');
6670
const [rmsColor, setRmsColor] = React.useState<any>('default');
6771

72+
const [acquired, setAcquired] = React.useState<boolean | undefined>(undefined);
73+
6874
React.useEffect(() => {
6975
const astrometry_fit = keywords['cherno.astrometry_fit'];
7076
if (astrometry_fit) {
@@ -101,12 +107,21 @@ const AstrometryFitStack = () => {
101107
}
102108
}
103109
}
110+
111+
if (keywords['cherno.acquisition_valid']) {
112+
setAcquired(keywords['cherno.acquisition_valid'].values[0]);
113+
}
104114
}, [keywords]);
105115

106116
return (
107117
<Stack pl={3} spacing={1} direction='row' alignItems={'center'} justifyContent={'center'}>
108118
<Chip label={`RMS ${rms} \u00b5m`} color={rmsColor} />
109119
<Chip label={`FWHM ${fwhm}`} color={fwhmColor} />
120+
<Chip
121+
sx={{ display: acquired !== undefined ? undefined : 'none' }}
122+
label={acquired === true ? 'Acquired' : 'Acquisition failed'}
123+
color={acquired === true ? 'success' : 'error'}
124+
/>
110125
</Stack>
111126
);
112127
};

0 commit comments

Comments
 (0)