1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2025-present FERS Contributors (see AUTHORS.md).
11} from '@mui/material';
12import { useScenarioStore, GlobalParameters } from '@/stores/scenarioStore';
13import { NumberField, Section } from './InspectorControls';
15interface GlobalParametersInspectorProps {
16 item: GlobalParameters;
19export function GlobalParametersInspector({
21}: GlobalParametersInspectorProps) {
22 const { updateItem } = useScenarioStore.getState();
23 const handleChange = (path: string, value: unknown) =>
24 updateItem(item.id, path, value);
27 <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
29 label="Simulation Name"
33 value={item.simulation_name}
35 handleChange('simulation_name', e.target.value)
39 label="Start Time (s)"
41 onChange={(v) => handleChange('start', v)}
46 onChange={(v) => handleChange('end', v)}
49 label="Output Sampling Rate (Hz)"
51 onChange={(v) => handleChange('rate', v)}
54 label="Internal Sim Sampling Rate (Hz)"
55 value={item.simSamplingRate}
56 onChange={(v) => handleChange('simSamplingRate', v)}
59 label="Speed of Light (m/s)"
61 onChange={(v) => handleChange('c', v)}
65 value={item.random_seed}
66 onChange={(v) => handleChange('random_seed', v)}
71 onChange={(v) => handleChange('adc_bits', v)}
74 label="Oversample Ratio"
75 value={item.oversample_ratio}
76 onChange={(v) => handleChange('oversample_ratio', v)}
79 <Section title="Georeference">
81 label="Origin Latitude (deg)"
82 value={item.origin.latitude}
83 onChange={(v) => handleChange('origin.latitude', v)}
86 label="Origin Longitude (deg)"
87 value={item.origin.longitude}
88 onChange={(v) => handleChange('origin.longitude', v)}
91 label="Origin Altitude (m)"
92 value={item.origin.altitude}
93 onChange={(v) => handleChange('origin.altitude', v)}
95 <FormControl fullWidth size="small">
96 <InputLabel>Coordinate System</InputLabel>
98 label="Coordinate System"
99 value={item.coordinateSystem.frame}
102 'coordinateSystem.frame',
107 <MenuItem value="ENU">ENU (East-North-Up)</MenuItem>
108 <MenuItem value="UTM">UTM</MenuItem>
109 <MenuItem value="ECEF">ECEF</MenuItem>
112 {item.coordinateSystem.frame === 'UTM' && (
116 value={item.coordinateSystem.zone ?? null}
118 handleChange('coordinateSystem.zone', v)
121 <FormControl fullWidth size="small">
122 <InputLabel>UTM Hemisphere</InputLabel>
124 label="UTM Hemisphere"
125 value={item.coordinateSystem.hemisphere ?? 'N'}
128 'coordinateSystem.hemisphere',
133 <MenuItem value="N">North</MenuItem>
134 <MenuItem value="S">South</MenuItem>