Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Axona Recording Interface #412

Merged
merged 11 commits into from
Oct 16, 2023
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
Loading