FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
SettingsDialog.tsx
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2025-present FERS Contributors (see AUTHORS.md).
3
4import {
5 Dialog,
6 DialogTitle,
7 DialogContent,
8 DialogActions,
9 Button,
10 Typography,
11 Box,
12} from '@mui/material';
13import { useScenarioStore } from '@/stores/scenarioStore';
14import { NumberField } from './inspectors/InspectorControls';
15
16interface SettingsDialogProps {
17 open: boolean;
18 onClose: () => void;
19}
20
21export default function SettingsDialog({ open, onClose }: SettingsDialogProps) {
22 const { targetPlaybackDuration, setTargetPlaybackDuration } =
23 useScenarioStore();
24 return (
25 <Dialog open={open} onClose={onClose} maxWidth="xs" fullWidth>
26 <DialogTitle>Application Settings</DialogTitle>
27 <DialogContent>
28 <Box
29 sx={{
30 display: 'flex',
31 flexDirection: 'column',
32 gap: 2,
33 pt: 1,
34 }}
35 >
36 <Typography>
37 Global application settings. Scenario parameters are
38 edited in the Property Inspector.
39 </Typography>
40 <NumberField
41 label="Target Preview Playback Duration (s)"
42 value={targetPlaybackDuration}
43 onChange={(val) => setTargetPlaybackDuration(val)}
44 />
45 <Typography variant="caption">
46 Set a fixed real-world duration for the simulation
47 preview. Leave blank for default behavior (real-time
48 playback, with a minimum of 5 seconds for short
49 simulations).
50 </Typography>
51 </Box>
52 </DialogContent>
53 <DialogActions>
54 <Button onClick={onClose}>Close</Button>
55 </DialogActions>
56 </Dialog>
57 );
58}