Skip to content

Commit

Permalink
Merge pull request #412 from NeurodataWithoutBorders/axona-recording-…
Browse files Browse the repository at this point in the history
…and-lfp

Add Axona Recording Interface
  • Loading branch information
CodyCBakerPhD authored Oct 16, 2023
2 parents 0bde0f8 + 11f1bbe commit 6f2a308
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
3 changes: 2 additions & 1 deletion guideGlobalMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"MCSRawRecordingInterface",
"MEArecRecordingInterface",
"PlexonRecordingInterface",
"PlexonSortingInterface"
"PlexonSortingInterface",
"AxonaRecordingInterface"
]
}
33 changes: 33 additions & 0 deletions schemas/json/generated/AxonaRecordingInterface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"required": [],
"properties": {
"AxonaRecordingInterface": {
"required": [
"file_path"
],
"properties": {
"file_path": {
"format": "file",
"type": "string"
},
"verbose": {
"type": "boolean",
"default": true
},
"es_key": {
"type": "string",
"default": "ElectricalSeries"
}
},
"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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import MCSRawRecordingInterfaceSchema from "../../../../../../schemas/json/gener
import MEArecRecordingInterfaceSchema from "../../../../../../schemas/json/generated/MEArecRecordingInterface.json";
import PlexonRecordingInterfaceSchema from "../../../../../../schemas/json/generated/PlexonRecordingInterface.json";
import PlexonSortingInterfaceSchema from "../../../../../../schemas/json/generated/PlexonSortingInterface.json";
import AxonaRecordingInterfaceSchema from "../../../../../../schemas/json/generated/AxonaRecordingInterface.json";

export default {
title: "Pages/Guided Mode/Source Data",
Expand Down Expand Up @@ -88,6 +89,8 @@ globalStateCopy.schema.source_data.properties.PlexonRecordingInterface =
PlexonRecordingInterfaceSchema.properties.PlexonRecordingInterface;
globalStateCopy.schema.source_data.properties.PlexonSortingInterface =
PlexonSortingInterfaceSchema.properties.PlexonSortingInterface;
globalStateCopy.schema.source_data.properties.AxonaRecordingInterface =
AxonaRecordingInterfaceSchema.properties.AxonaRecordingInterface;

const results = globalStateCopy.results;
for (let sub in results) {
Expand Down Expand Up @@ -256,3 +259,9 @@ const PlexonSortingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState))
PlexonSortingInterfaceGlobalCopy.interfaces.interface = PlexonSortingInterface;
PlexonSortingInterfaceGlobalCopy.schema.source_data = PlexonSortingInterfaceSchema;
PlexonSortingInterface.args = { activePage, globalState: PlexonSortingInterfaceGlobalCopy };

export const AxonaRecordingInterface = PageTemplate.bind({});
const AxonaRecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState));
AxonaRecordingInterfaceGlobalCopy.interfaces.interface = AxonaRecordingInterface;
AxonaRecordingInterfaceGlobalCopy.schema.source_data = AxonaRecordingInterfaceSchema;
AxonaRecordingInterface.args = { activePage, globalState: AxonaRecordingInterfaceGlobalCopy };
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,16 @@ export class GuidedSourceDataPage extends ManagedPage {
const schema = this.info.globalState.schema.source_data;
delete schema.description;

console.log("Schema", schema);

const schemaResolved = getSourceDataSchema(schema);

console.log("Schema", schemaResolved);

const form = new JSONSchemaForm({
identifier: instanceId,
mode: "accordion",
schema: getSourceDataSchema(schema),
schema: schemaResolved,
results: info.source_data,
ignore: [
"verbose",
Expand Down

0 comments on commit 6f2a308

Please sign in to comment.