From 9e741a7369d557fa16c5c58c35bc6928d19b9d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Tue, 31 May 2022 14:36:47 -0700 Subject: [PATCH] Add reslew stage to goto-field --- src/renderer/views/HAL/goto_field.tsx | 25 +++++++++++++++++++++++-- src/renderer/views/HAL/macros.json | 7 ++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/renderer/views/HAL/goto_field.tsx b/src/renderer/views/HAL/goto_field.tsx index 2a6ca93..ab3acd2 100644 --- a/src/renderer/views/HAL/goto_field.tsx +++ b/src/renderer/views/HAL/goto_field.tsx @@ -5,7 +5,7 @@ * @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) */ -import { Box, Divider, Paper, Stack, Typography } from '@mui/material'; +import { Box, Checkbox, Divider, FormControlLabel, Paper, Stack, Typography } from '@mui/material'; import React from 'react'; import { CommandButton } from 'renderer/components/commandButton'; import { MacroStageSelect } from 'renderer/components/macroStageSelect'; @@ -18,6 +18,7 @@ import MacroStepper from './macro_stepper'; export default function GotoFieldView(): JSX.Element | null { const [guiderTime, setGuiderTime] = React.useState(macros.goto_field.defaults.guider_time); + const [fixedAltAz, setFixedAltAz] = React.useState(false); const [commandString, setCommandString] = React.useState('hal goto-field'); const keywords = useKeywords(['jaeger.configuration_loaded']); @@ -31,6 +32,14 @@ export default function GotoFieldView(): JSX.Element | null { } }; + const getCommandString = () => { + let cmdString = `${commandString} --guider-time ${guiderTime || 15}`; + if (fixedAltAz) { + cmdString += ' --fixed-altaz'; + } + return cmdString; + }; + const checkConfiguration = async () => { // If the design is cloned, show a confirmation dialog. @@ -83,9 +92,21 @@ export default function GotoFieldView(): JSX.Element | null { value={guiderTime} onChange={(e) => setGuiderTime(e.target.value)} /> + setFixedAltAz(e.target.checked)} + size='small' + /> + } + label='Fix Alt/Az' + />