Skip to content

Commit

Permalink
Merge branch 'main' into encode-global-variables
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Sep 27, 2023
2 parents 1a971d2 + 11d829a commit 9a16288
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 2 deletions.
3 changes: 2 additions & 1 deletion guideGlobalMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"BlackrockSortingInterface",
"CellExplorerSortingInterface",
"KiloSortSortingInterface",
"Spike2RecordingInterface"
"Spike2RecordingInterface",
"BrukerTiffSinglePlaneImagingInterface"
]
}
33 changes: 33 additions & 0 deletions schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"required": [],
"properties": {
"BrukerTiffSinglePlaneImagingInterface": {
"required": [
"folder_path"
],
"properties": {
"folder_path": {
"format": "directory",
"type": "string",
"description": "The path that points to the folder containing the Bruker TIF image files and configuration files."
},
"stream_name": {
"type": "string"
},
"verbose": {
"type": "boolean",
"default": true
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
4 changes: 4 additions & 0 deletions schemas/json/generated/OpenEphysRecordingInterface.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"verbose": {
"type": "boolean",
"default": true
},
"es_key": {
"type": "string",
"default": "ElectricalSeries"
}
},
"type": "object",
Expand Down
34 changes: 34 additions & 0 deletions schemas/json/generated/Spike2RecordingInterface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"required": [],
"properties": {
"Spike2RecordingInterface": {
"required": [
"file_path"
],
"properties": {
"file_path": {
"format": "file",
"type": "string",
"description": "Path to CED data file."
},
"verbose": {
"type": "boolean",
"default": true
},
"es_key": {
"type": "string",
"default": "ElectricalSeries"
}
},
"type": "object",
"additionalProperties": true
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
21 changes: 21 additions & 0 deletions src/renderer/src/stories/pages/guided-mode/SourceData.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import BlackrockRecordingInterfaceSchema from "../../../../../../schemas/json/ge
import BlackrockSortingInterfaceSchema from "../../../../../../schemas/json/generated/BlackrockSortingInterface.json";
import CellExplorerSortingInterfaceSchema from "../../../../../../schemas/json/generated/CellExplorerSortingInterface.json";
import KiloSortSortingInterfaceSchema from "../../../../../../schemas/json/generated/KiloSortSortingInterface.json";
import Spike2RecordingInterfaceSchema from "../../../../../../schemas/json/generated/Spike2RecordingInterface.json";
import BrukerTiffSinglePlaneImagingInterfaceSchema from "../../../../../../schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json";

export default {
title: "Pages/Guided Mode/Source Data",
Expand Down Expand Up @@ -49,6 +51,10 @@ globalStateCopy.schema.source_data.properties.CellExplorerSortingInterface =
CellExplorerSortingInterfaceSchema.properties.CellExplorerSortingInterface;
globalStateCopy.schema.source_data.properties.KiloSortSortingInterface =
KiloSortSortingInterfaceSchema.properties.KiloSortSortingInterface;
globalStateCopy.schema.source_data.properties.Spike2RecordingInterface =
Spike2RecordingInterfaceSchema.properties.Spike2RecordingInterface;
globalStateCopy.schema.source_data.properties.BrukerTiffSinglePlaneImagingInterface =
BrukerTiffSinglePlaneImagingInterfaceSchema.properties.BrukerTiffSinglePlaneImagingInterface;

const results = globalStateCopy.results;
for (let sub in results) {
Expand Down Expand Up @@ -136,3 +142,18 @@ const KiloSortSortingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState
KiloSortSortingInterfaceGlobalCopy.interfaces.interface = KiloSortSortingInterface;
KiloSortSortingInterfaceGlobalCopy.schema.source_data = KiloSortSortingInterfaceSchema;
KiloSortSortingInterface.args = { activePage, globalState: KiloSortSortingInterfaceGlobalCopy };

export const Spike2RecordingInterface = PageTemplate.bind({});
const Spike2RecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState));
Spike2RecordingInterfaceGlobalCopy.interfaces.interface = Spike2RecordingInterface;
Spike2RecordingInterfaceGlobalCopy.schema.source_data = Spike2RecordingInterfaceSchema;
Spike2RecordingInterface.args = { activePage, globalState: Spike2RecordingInterfaceGlobalCopy };

export const BrukerTiffSinglePlaneImagingInterface = PageTemplate.bind({});
const BrukerTiffSinglePlaneImagingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState));
BrukerTiffSinglePlaneImagingInterfaceGlobalCopy.interfaces.interface = BrukerTiffSinglePlaneImagingInterface;
BrukerTiffSinglePlaneImagingInterfaceGlobalCopy.schema.source_data = BrukerTiffSinglePlaneImagingInterfaceSchema;
BrukerTiffSinglePlaneImagingInterface.args = {
activePage,
globalState: BrukerTiffSinglePlaneImagingInterfaceGlobalCopy,
};
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export class GuidedSourceDataPage extends ManagedPage {
interfaces: this.info.globalState.interfaces,
}),
})
.then((res) => res.json())
.then(async (res) => {
return (0, eval)(`(${await res.text()})`);
})
.catch((e) => {
Swal.close();
stillFireSwal = false;
Expand Down

0 comments on commit 9a16288

Please sign in to comment.