Skip to content

Commit

Permalink
Resolves 1287 Enable fluka simulation selection (#1289)
Browse files Browse the repository at this point in the history
* Add simulation selection

* Apply styling hack

* Apply suggestions from code review

Co-authored-by: Leszek Grzanka <[email protected]>

---------

Co-authored-by: Leszek Grzanka <[email protected]>
  • Loading branch information
hendzeld and grzanka authored Oct 20, 2023
1 parent 454266c commit 590284d
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/WrapperApp/components/Simulation/RunSimulationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function RunSimulationForm({

const [simName, setSimName] = useState(editorJson?.project.title ?? '');
const [nTasks, setNTasks] = useState(1);
const [simulator] = useState<SimulatorType>(forwardedSimulator);
const [simulator, setSelectedSimulator] = useState<SimulatorType>(forwardedSimulator);
const [arrayHeader, setArrayHeader] = useState<string>('');
const [collectHeader, setCollectHeader] = useState<string>('');
const [arrayOptions, setArrayOptions] = useState<ScriptOption[]>([]);
Expand Down Expand Up @@ -232,12 +232,24 @@ export function RunSimulationForm({
value={nTasks}
onChange={e => setNTasks(Math.max(1, parseInt(e.target.value)))}
/>
<TextField
size='small'
label='Simulation software'
value={simulator}
disabled
/>
<FormControl
fullWidth
sx={{
maxWidth: ({ spacing }) => `calc(100vw - ${spacing(14)})`,
width: '380px'
}}>
<InputLabel id='simulator-select-label'>Simulation software</InputLabel>
<Select
labelId='simulator-select-label'
size='small'
label='Simulation software'
defaultValue={forwardedSimulator}
onChange={evn => setSelectedSimulator(evn.target.value as SimulatorType)}
>
<MenuItem value={SimulatorType.SHIELDHIT}>SHIELD-HIT12A</MenuItem>
<MenuItem value={SimulatorType.FLUKA}>Fluka</MenuItem>
</Select>
</FormControl>
<ToggleButtonGroup
exclusive
fullWidth
Expand Down

0 comments on commit 590284d

Please sign in to comment.