diff --git a/api/configure.md b/api/configure.md index 1ec4f22..57f20ff 100644 --- a/api/configure.md +++ b/api/configure.md @@ -3,4 +3,7 @@ uid: configure title: Configuration Operators --- -Device configuration operators belong in a top-level chain of operators between [`CreateContext`](xref:OpenEphys.Onix1.CreateContext) and [`StartAcquisition`](xref:OpenEphys.Onix1.StartAcquisition) to configure devices contained by ONIX hardware hubs. \ No newline at end of file +Aggregate configuration operators belong in a top-level chain of operators between +[`CreateContext`](xref:OpenEphys.Onix1.CreateContext) and [`StartAcquisition`](xref:OpenEphys.Onix1.StartAcquisition) to +configure ONIX hardware hubs. These are known as aggregate configuration operators because they configure an aggregation +of devices (also referred to as a hub) on a given headstage, miniscope, breakout board, etc.. \ No newline at end of file diff --git a/api/constants.md b/api/constants.md new file mode 100644 index 0000000..58bae11 --- /dev/null +++ b/api/constants.md @@ -0,0 +1,6 @@ +--- +uid: constants +title: Constants +--- + +These constants are used throughout the Bonsai package to assign names to numbered values. \ No newline at end of file diff --git a/api/data-elements.md b/api/data-elements.md new file mode 100644 index 0000000..aa64334 --- /dev/null +++ b/api/data-elements.md @@ -0,0 +1,6 @@ +--- +uid: data-elements +title: Data Elements +--- + +Data elements are produced by Bonsai operators. \ No newline at end of file diff --git a/api/device-configure.md b/api/device-configure.md index 2aa2bf3..9e138c3 100644 --- a/api/device-configure.md +++ b/api/device-configure.md @@ -3,7 +3,7 @@ uid: device-configure title: Device Configuration Operators --- -> [!IMPORTANT] +> [!TIP] > Device configuration operators are not recommended for using off-the-shelf Open Ephys hardware. Use aggregate [configuration operators](xref:configure) instead. Aggregate [configuration operators](xref:configure) confer the following benefits: > - The `address` and `name` properties of aggregate configuration operators undergo automatic configuration which reduces the risk of erroneous configuration. > - The workflow is less cluttered with configuration operators as one aggregate configuration operator corresponds to multiple device operators. This improves workflow legibility and expedites the workflow scripting process. diff --git a/api/overview.md b/api/overview.md new file mode 100644 index 0000000..caa291c --- /dev/null +++ b/api/overview.md @@ -0,0 +1,9 @@ +--- +uid: OpenEphys.Onix1 +title: OpenEphys.Onix1 +--- + +`OpenEphys.Onix1` is a Bonsai package containing interfaces for data acquisition and control of ONIX hardware. This section +of the docs is dedicated to facilitate construction of workflows using the OpenEphys.Onix1 package. + +In Bonsai, press F1 while an OpenEphys.Onix1 node is selected in the workflow editor to quickly open this reference. \ No newline at end of file diff --git a/docfx.json b/docfx.json index 5eeb847..7ba3fd3 100644 --- a/docfx.json +++ b/docfx.json @@ -3,9 +3,7 @@ { "src": [ { - "files": [ - "src/**.csproj" - ] + "files": ["src/**.csproj"] } ], "dest": "api", @@ -19,35 +17,20 @@ "index.md": "landing" } }, - "content": [ - "articles/**.{md,yml}", - "api/**.{md,yml}", - "toc.yml", - "index.md" - ], - "resource": [ - "logo.svg", - "favicon.png", - "images/**", - "workflows/**" + "content": [ + { + "files": ["articles/**.{md,yml}", "api/**.{md,yml}", "toc.yml", "index.md"], + "exclude": ["api/overview.md"] + } ], + "resource": ["logo.svg", "favicon.png", "images/**", "workflows/**"], "output": "_site", "overwrite": [ { - "files": [ - ], - "exclude": [ - "obj/**", - "_site/**" - ] + "files": ["api/overview.md"] } ], - "template": [ - "default", - "modern", - "template", - "docfx-tools/template" - ], + "template": ["default", "modern", "template", "docfx-tools/template"], "globalMetadata": { "_enableNewTab": true, "_enableSearch": true, @@ -77,4 +60,4 @@ "rules": { "InvalidBookmark": "suggestion" } -} \ No newline at end of file +} diff --git a/template/ManagedReference.html.primary.tmpl b/template/ManagedReference.html.primary.tmpl index 6c8209b..e76a192 100644 --- a/template/ManagedReference.html.primary.tmpl +++ b/template/ManagedReference.html.primary.tmpl @@ -8,4 +8,14 @@ {{#isEnum}} {{>partials/enum}} -{{/isEnum}} \ No newline at end of file +{{/isEnum}} + +{{#isNamespace}} +
+

+ {{{title}}} + +

+
+ {{{conceptual}}} +{{/isNamespace}} \ No newline at end of file diff --git a/template/partials/class.tmpl.partial b/template/partials/class.tmpl.partial index 2f36cd4..965d8c7 100644 --- a/template/partials/class.tmpl.partial +++ b/template/partials/class.tmpl.partial @@ -1,11 +1,8 @@ {{#oe.operator.configureDevice}} -
-
Caution
+
+
TIP

- This is a device configuration operator. Device configuration operators are not recommended for interfacing with off-the-shelf ONIX hardware. Use aggregate configuration operators to do that instead. -

-

- To understand the benefits of aggregate configuration operators, refer to the device configuration operators page. + This is a device configuration operator. Aggregate configuration operators are recommended in lieu of device configuration operators for interfacing with Open Ephys Onix hardware.

{{/oe.operator.configureDevice}} diff --git a/template/toc.extension.js b/template/toc.extension.js index 018d4b6..d4cbfa6 100644 --- a/template/toc.extension.js +++ b/template/toc.extension.js @@ -8,84 +8,98 @@ exports.preTransform = function (model) { if (model.items[0].name === 'OpenEphys.Onix1'){ if (model.items[0].items){ itemsItemsLength = model.items[0].items.length; - let items = [{ - 'name': 'Core Operators', - 'href' : 'core.html', - 'topicHref': 'core.html', - 'topicUid': 'core', - 'items': []}, { - 'name': 'Configuration Operators', - 'href' : 'configure.html', - 'topicHref': 'configure.html', - 'topicUid': 'configure', - 'items': []}, { - 'name': 'Data I/O Operators', - 'href' : 'dataio.html', - 'topicHref': 'dataio.html', - 'topicUid': 'dataio', - 'items': []}, { - 'name': 'Other', - 'items': [ + let items = [ + { + 'name': 'Core Operators', + 'href' : 'core.html', + 'topicHref': 'core.html', + 'topicUid': 'core', + 'items': [] + }, + { + 'name': 'Configuration Operators', + 'href' : 'configure.html', + 'topicHref': 'configure.html', + 'topicUid': 'configure', + 'items': [] + }, + { + 'name': 'Data I/O Operators', + 'href' : 'dataio.html', + 'topicHref': 'dataio.html', + 'topicUid': 'dataio', + 'items': [] + }, + { + 'name': 'Data Elements', + 'href' : 'data-elements.html', + 'topicHref': 'data-elements.html', + 'topicUid': 'data-elements', + 'items': [] + }, + { + 'name': 'Other', + 'topicUid': 'other', + 'items': + [ + { + 'name': 'Device Configuration Operators', + 'href' : 'device-configure.html', + 'topicHref': 'device-configure.html', + 'topicUid': 'device-configure', + 'items': [] + }, + { + 'name': 'Constants', + 'href' : 'constants.html', + 'topicHref': 'constants.html', + 'topicUid': 'constants', + 'items': [] + } + ] + } + ]; + for (let i = 0; i < itemsItemsLength; i++) + { + globalYml = '~/api/' + model.items[0].items[i].topicUid + '.yml'; + globalModel = model.__global._shared[globalYml]; + if (globalModel?.type === 'class' || globalModel?.type === 'struct') + { + if (model.items[0].items[i].name.includes('CreateContext') || model.items[0].items[i].name.includes('StartAcquisition')) { - 'name': 'Device Configuration Operators', - 'href' : 'device-configure.html', - 'topicHref': 'device-configure.html', - 'topicUid': 'device-configure', - 'items': [], + items[0].items.push(model.items[0].items[i]); } - ] - }]; - for (let i = 0; i < itemsItemsLength; i++) { - globalYml = '~/api/' + model.items[0].items[i].topicUid + '.yml'; - if (model.items[0].items[i].name.includes('Frame') || - model.items[0].items[i].name.includes('DeviceFactory') || - model.items[0].items[i].name.includes('ContextTask') || - model.items[0].items[i].name.includes('DeviceNameConverter') || - model.items[0].items[i].name.includes('ConfigureDS90UB9x') || - model.items[0].items[i].name.includes('ConfigureFmcLinkController') || - model.items[0].items[i].name.includes('DeviceContext') || - model.items[0].items[i].name.includes('NeuropixelsV2QuadShankElectrode') || - model.items[0].items[i].name.includes('NeuropixelsV2QuadShankProbeConfiguration') || - model.items[0].items[i].name.includes('NeuropixelsV1eAdc')){ - model.items[0].items[i].hide = true; - } - else if (model.__global._shared[globalYml] && model.__global._shared[globalYml].type === 'enum') { - model.items[0].items[i].hide = true; - } - else { - if (model.__global._shared[globalYml] && model.__global._shared[globalYml].type === 'class'){ - const inheritanceLength = model.__global._shared[globalYml].inheritance.length; - device = false; - hub = false; - for (let j = 0; j < inheritanceLength; j++){ - if (model.__global._shared[globalYml].inheritance[j].uid === 'OpenEphys.Onix1.SingleDeviceFactory'){ - device = true; - } - else if (model.__global._shared[globalYml].inheritance[j].uid === 'OpenEphys.Onix1.MultiDeviceFactory'){ - hub = true; - } - } - if (model.items[0].items[i].name.includes('CreateContext') || model.items[0].items[i].name.includes('StartAcquisition')){ - items[0].items.push(model.items[0].items[i]); - } - else if (device){ - items[3].items[0].items.push(model.items[0].items[i]); - } - else if (hub){ - items[1].items.push(model.items[0].items[i]); - } - else { - items[2].items.push(model.items[0].items[i]); - } + else if (globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.MultiDeviceFactory')) + { + items[1].items.push(model.items[0].items[i]); } + else if (globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.SingleDeviceFactory')) + { + items[4].items[0].items.push(model.items[0].items[i]); + } + else if ((globalModel.syntax?.content[0].value.includes('ElementCategory.Source') || + globalModel.syntax?.content[0].value.includes('ElementCategory.Sink') || + globalModel?.inheritance.some(inherited => inherited.uid.includes('Bonsai.Source')) || + globalModel?.inheritance.some(inherited => inherited.uid.includes('Bonsai.Sink'))) && + !globalModel.syntax?.content[0].value.includes('abstract')) + { + items[2].items.push(model.items[0].items[i]); + } + else if (model.items[0].items[i].name.includes('ContextTask') || + model.items[0].items[i].name.includes('OutputClockParameters') || + globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.DataFrame' || inherited.uid === 'OpenEphys.Onix1.BufferedDataFrame')) + { + items[3].items.push(model.items[0].items[i]); + } + } + else if (globalModel && globalModel.type === 'enum') + { + items[4].items[1].items.push(model.items[0].items[i]); } } model.items[0].items = items; } } - // if (model.items[1].name === 'OpenEphys.Onix1.Design'){ - // model.items.splice(1, 1); - // } return model; }