-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New types of pulsed measurements, fixed STDP plot bug
- Loading branch information
Showing
31 changed files
with
1,570 additions
and
556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Children } from "react" | ||
|
||
interface Props { | ||
children: React.ReactNode | ||
} | ||
|
||
export default function Modal(props: Props) { | ||
return ( | ||
<> | ||
<div | ||
className="modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto" | ||
id="exampleModalCenter" | ||
tabIndex={-1} | ||
aria-labelledby="exampleModalCenterTitle" | ||
aria-modal="true" | ||
role="dialog" | ||
> | ||
<div className="modal-dialog modal-dialog-centered relative w-auto pointer-events-none"> | ||
<div className="modal-content border-none shadow-lg relative flex flex-col w-full pointer-events-auto bg-white bg-clip-padding rounded-md outline-none text-current"> | ||
<div className="modal-header flex flex-shrink-0 items-center justify-between p-4 border-b border-gray-200 rounded-t-md"> | ||
<h5 | ||
className="text-xl font-medium leading-normal text-gray-800" | ||
id="exampleModalScrollableLabel" | ||
> | ||
Modal title | ||
</h5> | ||
<button | ||
type="button" | ||
className="btn-close box-content w-4 h-4 p-1 text-black border-none rounded-none opacity-50 focus:shadow-none focus:outline-none focus:opacity-100 hover:text-black hover:opacity-75 hover:no-underline" | ||
data-bs-dismiss="modal" | ||
aria-label="Close" | ||
></button> | ||
</div> | ||
<div className="modal-body relative p-4"> | ||
<p>This is a vertically centered modal.</p> | ||
</div> | ||
<div className="modal-footer flex flex-shrink-0 flex-wrap items-center justify-end p-4 border-t border-gray-200 rounded-b-md"> | ||
<button | ||
type="button" | ||
className="inline-block px-6 py-2.5 bg-purple-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-purple-700 hover:shadow-lg focus:bg-purple-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-purple-800 active:shadow-lg transition duration-150 ease-in-out" | ||
data-bs-dismiss="modal" | ||
> | ||
Close | ||
</button> | ||
<button | ||
type="button" | ||
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out ml-1" | ||
> | ||
Save changes | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} |
68 changes: 68 additions & 0 deletions
68
frontend/src/routes/wgfmu/MeasurementsControls/Pulse/CollectionControls/EpscControls.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { boolean } from "mathjs" | ||
import { useState } from "react" | ||
import { HiLockClosed, HiLockOpen } from "react-icons/hi" | ||
import { Slider, Number } from "../../../../../components/Input" | ||
import { useAppDispatch, useAppSelector } from "../../../../../store/hooks" | ||
import { EpscControls as EpscControlsInterface } from "../../types" | ||
import { | ||
selectEpscParams, | ||
setEpscParamsField, | ||
setMultiPulseParamsField as setParamsField, | ||
updateState, | ||
} from "./collectionControlsSlice" | ||
|
||
type ValidateInterface = { | ||
[k in keyof EpscControlsInterface]: boolean | ||
} | ||
|
||
export default function EpscControls() { | ||
const dispatch = useAppDispatch() | ||
const params = useAppSelector(selectEpscParams) | ||
|
||
const [valid, setValid] = useState<ValidateInterface>({ | ||
frequencies: true, | ||
interTrainsTime: true, | ||
spikeTime: true, | ||
}) // wether or not this settings are valid | ||
|
||
const [samplingPointsTied, setSamplingPointsTied] = useState(true) | ||
|
||
const onValidateCurry = (id: keyof EpscControlsInterface) => { | ||
return (isValid: boolean) => setValid({ ...valid, [id]: isValid }) | ||
} | ||
|
||
return ( | ||
<> | ||
<div className="py-4 w-full border-b border-solid border-neutral-600"> | ||
<Number | ||
label="Inter trains time" | ||
onChange={(value) => { | ||
dispatch(setEpscParamsField({ val: value, key: "interTrainsTime" })) | ||
}} | ||
value={params.interTrainsTime} | ||
onValidate={onValidateCurry("interTrainsTime")} | ||
type={{ | ||
type: "sci", | ||
unit: "s", | ||
}} | ||
min={0} | ||
/> | ||
</div> | ||
<div className="py-4 w-full"> | ||
<Number | ||
label="Spike time" | ||
onChange={(value) => { | ||
dispatch(setEpscParamsField({ val: value, key: "spikeTime" })) | ||
}} | ||
value={params.spikeTime} | ||
onValidate={onValidateCurry("spikeTime")} | ||
type={{ | ||
type: "sci", | ||
unit: "s", | ||
}} | ||
min={0} | ||
/> | ||
</div> | ||
</> | ||
) | ||
} |
Oops, something went wrong.