Skip to content

Commit a8c83d0

Browse files
cjshajonnew
andauthored
Distinguish between Device Group & Device properties (#223)
Distinguish between Device & Device Group properties - This is done on the OpenEphys.Onix1 overview page - "Aggregate", "Multi-Device" -> "Device Group" - Add css classes for badges - Define what devices are on the configuration operator pages - I wanted to link to properties in the tables which motivated me to fix the xref issue #70. This fix seems to work well enough for now. That's what the changes are related to in the .js files are concerning. - Reduce excessive formatting (specifically hyperlinks don't need to be wrapped in back ticks) - Remove comments that appear in HTML inspector Co-authored-by: jonnew <[email protected]>
1 parent 0566958 commit a8c83d0

File tree

14 files changed

+281
-111
lines changed

14 files changed

+281
-111
lines changed

api/configure.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
22
uid: configure
3-
title: Configuration Operators
3+
title: Device Group Configuration Operators
44
---
55

6-
Aggregate configuration operators belong in a top-level chain of operators between
7-
[`CreateContext`](xref:OpenEphys.Onix1.CreateContext) and [`StartAcquisition`](xref:OpenEphys.Onix1.StartAcquisition) to
8-
configure ONIX hardware hubs. These are known as aggregate configuration operators because they configure an aggregation
9-
of devices (also referred to as a hub) on a given headstage, miniscope, breakout board, etc..
6+
Device Group configuration operators belong in a top-level configuration chain between
7+
[CreateContext](xref:OpenEphys.Onix1.CreateContext) and
8+
[StartAcquisition](xref:OpenEphys.Onix1.StartAcquisition) to configure ONIX hardware. These are
9+
known as Device Group configuration operators because they configure a group of devices on a given
10+
headstage, miniscope, breakout board, etc. Devices represent physical element
11+
interfacing with the environment (e.g., an external sensor with a digital
12+
communication interface like the BNO055, Neuropixels probes, or RHS2116 stimulus
13+
trigger) or internal data sources (e.g., a controller based digital logic module
14+
that generates system status reports like the port status controller).

api/device-configure.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@ title: Device Configuration Operators
44
---
55

66
> [!TIP]
7-
> 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:
8-
> - The `address` and `name` properties of aggregate configuration operators undergo automatic configuration which reduces the risk of erroneous configuration.
9-
> - 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.
7+
> Device configuration operators are not recommended for using off-the-shelf
8+
> Open Ephys hardware. Use [Device Group configuration
9+
> operators](xref:configure) instead. They confer the following benefits:
10+
> - The `address` and `name` properties of Device Group configuration operators
11+
> undergo automatic configuration which reduces the risk of erroneous
12+
> configuration.
13+
> - The workflow is less cluttered with configuration operators as one Device
14+
> Group configuration operator corresponds to multiple device operators. This
15+
> improves workflow legibility and expedites the workflow scripting process.
1016
11-
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.
17+
Device configuration operators belong in a top-level configuration chain between
18+
[CreateContext](xref:OpenEphys.Onix1.CreateContext) and
19+
[StartAcquisition](xref:OpenEphys.Onix1.StartAcquisition) to configure devices
20+
that can be found on ONIX hardware. Devices represent physical element
21+
interfacing with the environment (e.g., an external sensor with a digital
22+
communication interface like the BNO055, Neuropixels probes, or RHS2116 stimulus
23+
trigger) or internal data sources (e.g., a controller based digital logic module
24+
that generates system status reports like the port status controller).

api/overview.md

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,61 @@
11
---
22
uid: OpenEphys.Onix1
3-
title: OpenEphys.Onix1
3+
title: Library Reference
44
---
55

6-
> [!TIP]
7-
> Quickly access these pages in Bonsai by pressing <kbd>F1</kbd> while an OpenEphys.Onix1 operator
8-
> is selected in the workflow or Toolbox.
6+
[OpenEphys.Onix1](https://github.com/open-ephys/bonsai-onix1) is a Bonsai
7+
package that exposes a set of Bonsai Operators for control of and data
8+
acquisition from ONIX hardware. This library reference that documents each of
9+
the operators available in the package in a standardized format. This reference
10+
is generated from the [source code](https://github.com/open-ephys/bonsai-onix1).
911

10-
OpenEphys.Onix1 is a Bonsai package for control of and data acquisition from ONIX hardware. This
11-
section of the docs is dedicated to facilitate construction of workflows using OpenEphys.Onix1. It
12-
contains helpful information about OpenEphys.Onix1 operators and the data elements they produce.
13-
such as in-depth descriptions of their properties and their data types. The data elements produced
14-
by OpenEphys.Onix1 operators where you can find information such as equations for converting
15-
electrophysiology signals from the DAC step-size to volts. Take the
16-
<xref:OpenEphys.Onix1.Rhs2116DataFrame> for example.
12+
> [!TIP]
13+
> You can access the reference for a particular operator from within the Bonsai
14+
> editor pressing <kbd>F1</kbd> while an OpenEphys.Onix1 operator is selected in
15+
> the workflow or Toolbox.
1716
1817
## Property Categories
18+
The behavior of Bonsai operators is governed by their "Properties".
19+
Properties can be viewed and changed using Property Editor on the right side of
20+
the workflow:
21+
22+
![Bonsai property editor](../images/properties-pane.webp){width=650px}
23+
24+
Properties in this library fall into several categories which are useful for
25+
distinguishing when a property change will be applied to hardware and the scope
26+
of the property's effect. The following tags are used throughout the
27+
documentation designate these property categories:
1928

20-
In the OpenEphys.Onix1 package, properties belong to specific categories that define when the
21-
property effects the hardware.
29+
<span class="badge oe-badge-border oe-badge-yellow"
30+
id="configuration">Configuration</span> properties have an effect on hardware
31+
when a workflow is started and are used to initialize the hardware state. If
32+
they are changed while a workflow is running, they will not have an effect until
33+
the workflow is restarted. For example, CreateContext's
34+
<xref:OpenEphys.Onix1.CreateContext.Index> Configuration property is used to
35+
specify the hardware prior to starting a recording, and editing this property
36+
has no effect until the workflow is started or restarted.
2237

23-
<span class="badge bg-warning-subtle border border-warning-subtle text-warning-emphasis rounded-pill"
24-
id="configuration">configuration</span> properties have an effect on hardware when a workflow is started and are used to
25-
initialize the hardware state. Even if they are changed while a workflow is running, they will not have an effect until
26-
the workflow is restarted.
38+
<span class="badge oe-badge-border oe-badge-blue"
39+
id="acquisition">Acquisition</span> properties have an immediate effect on
40+
hardware when the workflow is running. For example, the
41+
<xref:OpenEphys.Onix1.Headstage64ElectricalStimulatorTrigger.InterPulseInterval>
42+
property allows dynamically configuring the duration between electrical
43+
stimulation pulses. Along with its other Acquisition properties, the entire
44+
electrical stimulation pattern can be modulated in real-time while the workflow
45+
is running.
2746

28-
<span class="badge bg-primary-subtle border border-primary-subtle text-primary-emphasis rounded-pill"
29-
id="acquisition">acquisition</span> properties have an immediate effect on hardware when the workflow is running. For
30-
instance, stimulus waveform properties can be dynamically modified according to parameters in your workflow.
47+
<span class="badge oe-badge-border oe-badge-green" id="device-group">Device
48+
Group</span> properties are only available through [Device Group configuration
49+
operators](xref:configure). These properties are used to configure a group of
50+
devices. For example, ConfigureNeuropixelsV2eHeadstage's
51+
<xref:OpenEphys.Onix1.ConfigureHeadstageNeuropixelsV2e.Port> property
52+
configures the port name for all devices on the NeuropixelsV2e Headstage (which
53+
in turn automatically configures each device's address).
3154

32-
`Devices` properties refer to the individual devices available within a particular aggregate operator. Aggregate
33-
operators include <xref:OpenEphys.Onix1.ConfigureHeadstage64>, <xref:OpenEphys.Onix1.ConfigureBreakoutBoard>, and more.
34-
Explore other available options under the [aggregate configuration operators](xref:configure) page.
55+
<span class="badge oe-badge-border oe-badge-purple" id="device">Device</span>
56+
properties are available through [Device configuration
57+
operators](xref:device-configure) and Device Group configuration operators which
58+
typically combine multiple individual devices. These properties are used to
59+
configure a single device. For example, ConfigureBreakoutBoard's
60+
<xref:OpenEphys.Onix1.ConfigureBreakoutBoard.AnalogIO> properties configure the
61+
Breakout Board's Analog I/O device.

articles/getting-started/onix-configuration.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,11 @@ element](xref:data-elements) named <xref:OpenEphys.Onix1.ContextTask>.
3838

3939
Hardware configuration is performed when `ContextTask` passes through a [configuration
4040
operator](xref:configure). A configuration operator allows the user to configure hardware by editing
41-
its properties. There are two types of configuration operators: [device configuration
42-
operators](xref:device-configure) and [device group configuration operators](xref:configure).
41+
its properties. There are two types of configuration operators: [Device configuration
42+
operators](xref:device-configure) and [Device Group configuration operators](xref:configure).
4343
Device configuration operators allow configuration of a single device contained by a headstage,
44-
miniscope, or breakout board whereas device group configuration operators allow configuration of all
44+
miniscope, or breakout board whereas Device Group configuration operators allow configuration of all
4545
devices contained by a headstage, miniscope, or breakout board.
46-
<!--We recommend using device group configuration operators for concision and
47-
ease-of-use, though device operators can be helpful in more advanced workflows that require writing
48-
to hardware while the workflow is running.
49-
50-
Any number of configuration operators can be chained following a CreateContext operator. If you use
51-
only device group configuration operators, you'll have between one and three total
52-
configuration operators: one for the breakout board and one for each port that is connected to a
53-
headstage or miniscope. -->
5446

5547
::: workflow
5648
![/workflows/getting-started/configure.bonsai workflow](../../workflows/getting-started/configure.bonsai)
@@ -64,8 +56,6 @@ related to data acquisition such as ReadSize and WriteSize. Setting the ReadSize
6456
particular workflow is a balancing act of minimizing latency of data data transfers from the ONIX
6557
system and avoiding data accumulation in the ONIX system's hardware buffer.
6658

67-
<!-- TODO: Need a separate tutorial or guide on this -->
68-
6959
::: workflow
7060
![/workflows/getting-started/start-acquisition.bonsai workflow](../../workflows/getting-started/start-acquisition.bonsai)
7161
:::

images/properties-pane.webp

41.9 KB
Loading

img-src/properties-pane.png

47.8 KB
Loading

img-src/properties-pane.svg

Lines changed: 77 additions & 0 deletions
Loading

template/ManagedReference.extension.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function extractEnumData(model) {
1313
.map(child => ({
1414
'field&value': child.syntax.content[0].value,
1515
'description': [child.summary, child.remarks].join(''),
16+
'id': child.uid.replaceAll('.', '_'),
1617
}));
1718
}
1819

@@ -40,7 +41,8 @@ function processChildProperty(child, sharedModel) {
4041
'enum': enumFields,
4142
},
4243
'configuration': configuration,
43-
'acquisition': acquisition
44+
'acquisition': acquisition,
45+
'id': child.uid.replaceAll('.', '_'),
4446
}
4547
}
4648

@@ -80,6 +82,7 @@ function extractConstituentOperatorsData(model) {
8082
'constituentOperator': true,
8183
'hasProperties': properties === undefined || properties.length === 0 ? false : true,
8284
'properties': properties,
85+
'id': child.uid.replaceAll('.', '_'),
8386
};
8487
}
8588
);
@@ -121,7 +124,7 @@ exports.preTransform = function (model) {
121124
if (operator.hub) {
122125
properties = extractConstituentOperatorsData(model);
123126
properties.unshift({
124-
'object': 'Configuration',
127+
'object': model.name[0].value.replace('Configure', ''),
125128
'constituentOperator': false,
126129
'hasProperties': true,
127130
'properties': sortPropertiesData([
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
var common = require('./ManagedReference.common.js');
2+
13
exports.getOptions = function (model) {
4+
var ignoreChildrenBookmarks = model._splitReference && model.type && common.getCategory(model.type) === 'ns';
5+
26
return {
3-
isShared: true
7+
isShared: true,
8+
bookmarks: common.getBookmarks(model, ignoreChildrenBookmarks)
49
};
510
}

template/partials/class.tmpl.partial

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<div class="Important alert alert-info">
33
<h5>TIP</h5>
44
<p>
5-
This is a device configuration operator. <a class="xref" href="configure.html">Aggregate configuration operators</a> are recommended in lieu of <a class="xref" href="device-configure.html">device configuration operators</a> for interfacing with Open Ephys Onix hardware.
5+
This is a <a class="xref" href="device-configure.html">Device configuration operator</a>. <a class="xref" href="configure.html">Device Group configuration operators</a> are recommended instead of Device configuration operators for interfacing with Open Ephys Onix hardware.
66
</p>
77
</div>
88
{{/oe.operator.configureDevice}}
99

1010
<div>
11-
<h1 id="{{id}}" data-uid="{{oe.uid}}" class="text-break" style="display: inline-block;">
11+
<h1 class="text-break" style="display: inline-block;">
1212
{{oe.name}}
1313
{{#sourceurl}}<a class="header-action link-secondary" title="View source" href="{{sourceurl}}"><i class="bi bi-code-slash"></i></a>{{/sourceurl}}
1414
</h1>
@@ -31,41 +31,33 @@
3131

3232
{{#oe.operator.hub}}
3333

34-
<h3>Configuration</h3>
35-
3634
{{#oe.properties}}
37-
{{^constituentOperator}}
3835

39-
<p>These are properties of the aggregate operator:</p>
36+
<h3 class="text-break" style="display: inline-block;" id="{{{id}}}">{{{object}}}</h3>
4037

41-
{{#hasProperties}}
42-
{{>partials/propertyTable}}
43-
{{/hasProperties}}
44-
{{^hasProperties}}
45-
<p>This operator does not have any configuration options.</p>
46-
{{/hasProperties}}
38+
{{^constituentOperator}}
39+
<a class="xref" href="~/api/OpenEphys.Onix1.html#device-group">
40+
<button class="badge oe-badge-border oe-badge-green">Device Group</button>
41+
</a>
42+
<p>These are properties of the {{{oe.name}}} <a class="xref" href="~/api/configure.html">Device Group configuration operator</a>:</p>
4743
{{/constituentOperator}}
48-
{{/oe.properties}}
4944

50-
<h3>Devices</h3>
51-
52-
{{#oe.properties}}
5345
{{#constituentOperator}}
54-
55-
<h4>{{{object}}}</h4>
56-
57-
<p>{{{object}}} is a {{{type}}} operator encapsulated by the {{oe.name}} operator with the following properties:</p>
46+
<a class="xref" href="~/api/OpenEphys.Onix1.html#device">
47+
<button class="badge oe-badge-border oe-badge-purple">Device</button>
48+
</a>
49+
<p>{{{object}}} is a {{{type}}} device operator contained by the {{{oe.name}}} operator with the following properties:</p>
50+
{{/constituentOperator}}
5851

5952
{{#hasProperties}}
6053
{{>partials/propertyTable}}
6154
{{/hasProperties}}
62-
6355
{{^hasProperties}}
64-
<p>This operator does not have any configuration options.</p>
56+
<p>This operator does not have any properties to set.</p>
6557
{{/hasProperties}}
6658

67-
{{/constituentOperator}}
6859
{{/oe.properties}}
60+
6961
{{/oe.operator.hub}}
7062

7163
{{#oe}}

0 commit comments

Comments
 (0)