Skip to content

Commit

Permalink
Add preload ahead to auto mode
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Apr 5, 2024
1 parent f99fd1d commit 6bb67e8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/renderer/HAL/Auto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ import IOSSwitch from 'renderer/Components/IOSwitch';
import { useKeywordContext } from 'renderer/hooks';
import useIsMacroRunning from 'renderer/hooks/useIsMacroRunning';
import useStageStatus from 'renderer/hooks/useStageStatus';
import { ExposureTimeInput } from './Components/ExposureTimeInput';
import PauseResumeButton from './Components/PauseResumeButton';
import SnackAlert, { SnackAlertRefType } from './Components/SnackAlert';

export default function AutoMode() {
const macroName = 'auto';

const [count, setCount] = React.useState('1');
const [preload, setPreload] = React.useState('300');

const [error, setError] = React.useState(false);
const [cancelled, setCancelled] = React.useState(false);

const [message, setMessage] = React.useState('');
const [message, setMessage] = React.useState();

const { 'hal.auto_mode_message': autoModeMessageKw } = useKeywordContext();

Expand Down Expand Up @@ -87,7 +89,7 @@ export default function AutoMode() {
if (isRunning) {
commandString = 'hal auto --stop';
} else {
commandString = `hal auto --count ${count}`;
commandString = `hal auto --preload-ahead ${preload} --count ${count}`;
}
window.electron.tron.send(commandString);
},
Expand All @@ -113,6 +115,14 @@ export default function AutoMode() {
>
{message}
</Typography>
<ExposureTimeInput
label='Preload'
value={preload}
onChange={(e) => setPreload(e.target.value)}
width='50px'
isNumber={false}
disabled={isRunning}
/>
<TextField
label='Count'
size='small'
Expand Down

0 comments on commit 6bb67e8

Please sign in to comment.