diff --git a/frontend/unified/src/App.tsx b/frontend/unified/src/App.tsx index 7dc9aa42..dde8a391 100644 --- a/frontend/unified/src/App.tsx +++ b/frontend/unified/src/App.tsx @@ -58,6 +58,7 @@ const BEAMLINE_TECHNIQUES_SUBSET = { Technique.Mib, ], [Beamline.E01]: [Technique.Dpc, Technique.Nbed, Technique.Ptyrex], + [Beamline.P99]: [Technique.Ptypy], }; const BEAMLINES_DEFAULT_TECHNIQUE = { @@ -69,6 +70,7 @@ const BEAMLINES_DEFAULT_TECHNIQUE = { [Beamline["I13-1"]]: Technique.Ptycho, [Beamline["I13-2"]]: Technique.Ptycho, [Beamline.I14]: Technique.Dpc, + [Beamline.P99]: Technique.Ptypy, }; const filterTemplates = (technique: Technique) => { diff --git a/frontend/unified/src/components/ParameterConfiguration/ParameterConfiguration.tsx b/frontend/unified/src/components/ParameterConfiguration/ParameterConfiguration.tsx index 7fff8e69..4d69390a 100644 --- a/frontend/unified/src/components/ParameterConfiguration/ParameterConfiguration.tsx +++ b/frontend/unified/src/components/ParameterConfiguration/ParameterConfiguration.tsx @@ -12,6 +12,7 @@ import { Visit, visitToText } from "@diamondlightsource/sci-react-ui"; import { InstrumentSession } from "../SessionSelector"; import { Fbp180ParameterConfiguration } from "./Fbp180ParameterConfiguration"; import PtypyI08ParameterConfiguration from "./PtypyI08ParameterConfiguration"; +import PtypyP99ParameterConfiguration from "./PtypyP99ParameterConfiguration"; type ParameterConfigurationProps = { technique: Technique; @@ -147,7 +148,16 @@ export const ParameterConfiguration: React.FC = ({ [Technique.Ptycho]: {}, [Technique.Ptypy]: { "ptypy-i08-1-from-config": ( - + + ), + "ptypy-p99-from-config": ( + ), }, [Technique.Ptyrex]: { diff --git a/frontend/unified/src/components/ParameterConfiguration/PtypyP99ParameterConfiguration.tsx b/frontend/unified/src/components/ParameterConfiguration/PtypyP99ParameterConfiguration.tsx new file mode 100644 index 00000000..69b8a8bb --- /dev/null +++ b/frontend/unified/src/components/ParameterConfiguration/PtypyP99ParameterConfiguration.tsx @@ -0,0 +1,104 @@ +import { + Card, + Checkbox, + FormControlLabel, + Stack, + TextField, +} from "@mui/material"; +import { useEffect, useState } from "react"; + +const PtypyP99ParameterConfiguration = ({ + setParameters, + setResourceParameters, +}: { + setParameters: (_: object) => void; + setResourceParameters: (_: object) => void; +}) => { + const [id, setId] = useState(""); + const [inPath, setInPath] = useState( + "processing/writenData/reconstruction_test_data" + ); + const [outPath, setOutPath] = useState("processing/workflows/ptypy"); + const [nprocs, setNprocs] = useState("1"); + const [memory, setMemory] = useState("20Gi"); + const [useGpu, setUseGpu] = useState(false); + + useEffect(() => { + setParameters({ + id: id, + inpath: inPath, + outpath: outPath, + usegpu: useGpu, + }); + setResourceParameters({ + memory: memory, + nprocs: nprocs, + }); + }, [ + setParameters, + setResourceParameters, + id, + inPath, + outPath, + useGpu, + memory, + nprocs, + ]); + + return ( + + + setId(e.target.value)} + size="small" + /> + setInPath(e.target.value)} + size="small" + /> + setOutPath(e.target.value)} + size="small" + /> + setMemory(e.target.value)} + size="small" + /> + setNprocs(e.target.value)} + size="small" + /> + setUseGpu(e.target.checked)} + /> + } + label="Use GPU" + /> + + + ); +}; + +export default PtypyP99ParameterConfiguration; diff --git a/frontend/unified/src/data/templates.ts b/frontend/unified/src/data/templates.ts index f50eb908..5913d00c 100644 --- a/frontend/unified/src/data/templates.ts +++ b/frontend/unified/src/data/templates.ts @@ -36,6 +36,11 @@ export const templateOptions: Option[] = [ value: "ptypy-i08-1-from-config", desc: "Runs a PtyPy reconstruction job inside a container based on data collected at I08-1.", }, + { + label: "Ptypy Reconstruction for P99", + value: "ptypy-p99-from-config", + desc: "Runs a PtyPy reconstruction job inside a container based on data collected at P99.", + }, { label: "ptycho", value: "ptycho-recon", diff --git a/frontend/unified/src/types.ts b/frontend/unified/src/types.ts index 5297c8e3..0736ee60 100644 --- a/frontend/unified/src/types.ts +++ b/frontend/unified/src/types.ts @@ -24,6 +24,7 @@ export enum Beamline { Epsic = "e01", E01 = "e01", E02 = "e02", + P99 = "p99", } export type Option = { label: string; value: string; desc?: string };