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 Box,
6 Button,
7 Dialog,
8 DialogActions,
9 DialogContent,
10 DialogTitle,
11 Typography,
12} from '@mui/material';
13import { useScenarioStore } from '@/stores/scenarioStore';
14import { NumberField } from './inspectors/InspectorControls';
15import LogLevelSelect from './LogLevelSelect';
16
17interface SettingsDialogProps {
18 open: boolean;
19 onClose: () => void;
20}
21
22export default function SettingsDialog({ open, onClose }: SettingsDialogProps) {
23 const targetPlaybackDuration = useScenarioStore(
24 (s) => s.targetPlaybackDuration
25 );
26 const setTargetPlaybackDuration = useScenarioStore(
27 (s) => s.setTargetPlaybackDuration
28 );
29 return (
30 <Dialog open={open} onClose={onClose} maxWidth="xs" fullWidth>
31 <DialogTitle>Application Settings</DialogTitle>
32 <DialogContent>
33 <Box
34 sx={{
35 display: 'flex',
36 flexDirection: 'column',
37 gap: 2,
38 pt: 1,
39 }}
40 >
41 <Typography>
42 Global application settings. Scenario parameters are
43 edited in the Property Inspector.
44 </Typography>
45 <LogLevelSelect id="settings-log-level" />
46 <NumberField
47 label="Target Preview Playback Duration (s)"
48 value={targetPlaybackDuration}
49 onChange={(val) => setTargetPlaybackDuration(val)}
50 />
51 <Typography variant="caption">
52 Set a fixed real-world duration for the simulation
53 preview. Leave blank for default behavior (real-time
54 playback, with a minimum of 5 seconds for short
55 simulations).
56 </Typography>
57 </Box>
58 </DialogContent>
59 <DialogActions>
60 <Button onClick={onClose}>Close</Button>
61 </DialogActions>
62 </Dialog>
63 );
64}