Skip to content

Commit 8ded0ba

Browse files
authored
Merge pull request #289 from open-ephys/issue-203
Add unique documentation to Generate() overrides
2 parents d439fe8 + b0bc622 commit 8ded0ba

File tree

4 files changed

+70
-29
lines changed

4 files changed

+70
-29
lines changed

OpenEphys.Onix1/BreakoutAnalogOutput.cs

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,29 @@ public class BreakoutAnalogOutput : Sink<Mat>
2929
/// Gets or sets the data type used to represent analog samples.
3030
/// </summary>
3131
/// <remarks>
32-
/// If <see cref="BreakoutAnalogIODataType.S16"/> is selected, each DAC value is represented by a signed, twos-complement encoded
33-
/// 16-bit integer. In this case, the output voltage always corresponds to <see cref="BreakoutAnalogIOVoltageRange.TenVolts"/>.
34-
/// When <see cref="BreakoutAnalogIODataType.Volts"/> is selected, 32-bit floating point voltages between -10 and 10 volts are sent
35-
/// directly to the DACs.
32+
/// If <see cref="BreakoutAnalogIODataType.S16"/> is selected, each DAC value is represented by a
33+
/// signed, twos-complement encoded 16-bit integer. In this case, the output voltage always
34+
/// corresponds to <see cref="BreakoutAnalogIOVoltageRange.TenVolts"/>. When <see
35+
/// cref="BreakoutAnalogIODataType.Volts"/> is selected, 32-bit floating point voltages between -10
36+
/// and 10 volts are sent directly to the DACs.
3637
/// </remarks>
3738
[Description("The data type used to represent analog samples.")]
3839
[Category(DeviceFactory.ConfigurationCategory)]
3940
public BreakoutAnalogIODataType DataType { get; set; } = BreakoutAnalogIODataType.S16;
4041

4142
/// <summary>
42-
/// Send samples to analog outputs.
43+
/// Send an matrix of samples to all enabled analog outputs.
4344
/// </summary>
44-
/// <param name="source"> A sequence of 12xN sample matrices containing the analog data to write to channels 0 to 11.</param>
45-
/// <returns> A sequence of 12xN sample matrices containing the analog data that were written to channels 0 to 11.</returns>
45+
/// <remarks>
46+
/// If a matrix contains multiple samples, they will be written to hardware as quickly as
47+
/// communication allows. The data within each input matrix must have <see cref="Depth.S16"/> when
48+
/// <c>DataType</c> is set to <see cref="BreakoutAnalogIODataType.S16"/> or <see cref="Depth.F32"/>
49+
/// when <c>DataType</c> is set to <see cref="BreakoutAnalogIODataType.Volts"/>.
50+
/// </remarks>
51+
/// <param name="source"> A sequence of 12xN sample matrices containing the analog data to write to
52+
/// channels 0 to 11.</param>
53+
/// <returns> A sequence of 12xN sample matrices containing the analog data that were written to
54+
/// channels 0 to 11.</returns>
4655
public override unsafe IObservable<Mat> Process(IObservable<Mat> source)
4756
{
4857
var dataType = DataType;
@@ -103,10 +112,17 @@ public override unsafe IObservable<Mat> Process(IObservable<Mat> source)
103112
}
104113

105114
/// <summary>
106-
/// Send samples to analog outputs.
115+
/// Send an 12-element array of values to update all enabled analog outputs.
107116
/// </summary>
108-
/// <param name="source"> A sequence of 12x1 element arrays each containing the analog data to write to channels 0 to 11.</param>
109-
/// <returns> A sequence of 12x1 element arrays each containing the analog data to write to channels 0 to 11.</returns>
117+
/// <remarks>
118+
/// This overload should be used when <c>DataType</c> is set to <see
119+
/// cref="BreakoutAnalogIODataType.S16"/> and values should be within -32,768 to 32,767, which
120+
/// correspond to -10.0 to 10.0 volts.
121+
/// </remarks>
122+
/// <param name="source"> A sequence of 12x1 element arrays each containing the analog data to write
123+
/// to channels 0 to 11.</param>
124+
/// <returns> A sequence of 12x1 element arrays each containing the analog data to write to channels 0
125+
/// to 11.</returns>
110126
public IObservable<short[]> Process(IObservable<short[]> source)
111127
{
112128
if (DataType != BreakoutAnalogIODataType.S16)
@@ -130,10 +146,16 @@ public IObservable<short[]> Process(IObservable<short[]> source)
130146
}
131147

132148
/// <summary>
133-
/// Send samples to analog outputs.
149+
/// Send an 12-element array of values to update all enabled analog outputs.
134150
/// </summary>
135-
/// <param name="source"> A sequence of 12x1 element arrays each containing the analog data to write to channels 0 to 11.</param>
136-
/// <returns> A sequence of 12x1 element arrays each containing the analog data to write to channels 0 to 11.</returns>
151+
/// <remarks>
152+
/// This overload should be used when <c>DataType</c> is set to <see
153+
/// cref="BreakoutAnalogIODataType.Volts"/> and values should be within -10.0 to 10.0 volts.
154+
/// </remarks>
155+
/// <param name="source"> A sequence of 12x1 element arrays each containing the analog data to write
156+
/// to channels 0 to 11.</param>
157+
/// <returns> A sequence of 12x1 element arrays each containing the analog data to write to channels 0
158+
/// to 11.</returns>
137159
public IObservable<float[]> Process(IObservable<float[]> source)
138160
{
139161
if (DataType != BreakoutAnalogIODataType.Volts)

OpenEphys.Onix1/ConfigureBreakoutDigitalIO.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace OpenEphys.Onix1
1111
/// cref="BreakoutDigitalInput"/> and <see cref="BreakoutDigitalOutput"/>, using a shared
1212
/// <c>DeviceName</c>.
1313
/// </remarks>
14-
[Description("onfigures the ONIX breakout board's digital inputs and outputs.")]
14+
[Description("Configures the ONIX breakout board's digital inputs and outputs.")]
1515
public class ConfigureBreakoutDigitalIO : SingleDeviceFactory
1616
{
1717
/// <summary>
@@ -27,7 +27,8 @@ public ConfigureBreakoutDigitalIO()
2727
/// Gets or sets the device enable state.
2828
/// </summary>
2929
/// <remarks>
30-
/// If set to true, <see cref="BreakoutDigitalInput"/> will produce data. If set to false, <see cref="BreakoutDigitalInput"/> will not produce data.
30+
/// If set to true, <see cref="BreakoutDigitalInput"/> will produce data. If set to false, <see
31+
/// cref="BreakoutDigitalInput"/> will not produce data.
3132
/// </remarks>
3233
[Category(ConfigurationCategory)]
3334
[Description("Specifies whether the digital IO device is enabled.")]
@@ -37,12 +38,14 @@ public ConfigureBreakoutDigitalIO()
3738
/// Configures the digital input and output device in the ONIX breakout board.
3839
/// </summary>
3940
/// <remarks>
40-
/// This will schedule digital IO hardware configuration actions that can be applied by a
41-
/// <see cref="StartAcquisition"/> object prior to data collection.
41+
/// This will schedule digital IO hardware configuration actions that can be applied by a <see
42+
/// cref="StartAcquisition"/> object prior to data collection.
4243
/// </remarks>
43-
/// <param name="source">A sequence of <see cref="ContextTask"/> instances that hold configuration actions.</param>
44+
/// <param name="source">A sequence of <see cref="ContextTask"/> instances that hold configuration
45+
/// actions.</param>
4446
/// <returns>
45-
/// The original sequence modified by adding additional configuration actions required to configure a digital IO device.
47+
/// The original sequence modified by adding additional configuration actions required to configure a
48+
/// digital IO device.
4649
/// </returns>
4750
public override IObservable<ContextTask> Process(IObservable<ContextTask> source)
4851
{

OpenEphys.Onix1/NeuropixelsV1eBno055Data.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ public class NeuropixelsV1eBno055Data : Source<Bno055DataFrame>
2323
public string DeviceName { get; set; }
2424

2525
/// <summary>
26-
/// Generates a sequence of <see cref="Bno055DataFrame"/> objects at approximately 100 Hz.
26+
/// Generates a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> at approximately 100
27+
/// Hz.
2728
/// </summary>
28-
/// <returns>A sequence of <see cref="Bno055DataFrame"/> objects.</returns>
2929
/// <remarks>
30-
/// This will generate a sequence of <see cref="Bno055DataFrame"/> objects at approximately 100 Hz. This rate
31-
/// may be limited by the I2C bus.
30+
/// This will generate a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> at approximately 100 Hz.
31+
/// This rate may be limited by the hardware.
3232
/// </remarks>
33+
/// <returns>A sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see>.</returns>
3334
public override IObservable<Bno055DataFrame> Generate()
3435
{
3536
// Max of 100 Hz, but limited by I2C bus
@@ -38,8 +39,15 @@ public override IObservable<Bno055DataFrame> Generate()
3839
}
3940

4041
/// <summary>
41-
/// Generates a sequence of <see cref="Bno055DataFrame"/> objects.
42+
/// Generates a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> that is driven by an
43+
/// input sequence.
4244
/// </summary>
45+
/// <remarks>
46+
/// This will attempt to produce a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> that is updated whenever
47+
/// an item in the <paramref name="source"/> sequence is received. This rate is be limited by the
48+
/// hardware and has a maximum meaningful rate of 100 Hz.
49+
/// </remarks>
50+
/// <param name="source">A sequence to drive sampling.</param>
4351
/// <returns>A sequence of <see cref="Bno055DataFrame"/> objects.</returns>
4452
public unsafe IObservable<Bno055DataFrame> Generate<TSource>(IObservable<TSource> source)
4553
{

OpenEphys.Onix1/NeuropixelsV2eBno055Data.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ public class NeuropixelsV2eBno055Data : Source<Bno055DataFrame>
2323
public string DeviceName { get; set; }
2424

2525
/// <summary>
26-
/// Generates a sequence of <see cref="Bno055DataFrame"/> objects at approximately 100 Hz.
26+
/// Generates a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> at approximately 100
27+
/// Hz.
2728
/// </summary>
28-
/// <returns>A sequence of <see cref="Bno055DataFrame"/> objects.</returns>
2929
/// <remarks>
30-
/// This will generate a sequence of <see cref="Bno055DataFrame"/> objects at approximately 100 Hz. This rate
31-
/// may be limited by the I2C bus.
30+
/// This will generate a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> at approximately 100 Hz.
31+
/// This rate may be limited by the hardware.
3232
/// </remarks>
33+
/// <returns>A sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see>.</returns>
3334
public override IObservable<Bno055DataFrame> Generate()
3435
{
3536
// Max of 100 Hz, but limited by I2C bus
@@ -38,8 +39,15 @@ public override IObservable<Bno055DataFrame> Generate()
3839
}
3940

4041
/// <summary>
41-
/// Generates a sequence of <see cref="Bno055DataFrame"/> objects.
42+
/// Generates a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> that is driven by an
43+
/// input sequence.
4244
/// </summary>
45+
/// <remarks>
46+
/// This will attempt to produce a sequence of <see cref="Bno055DataFrame">Bno055DataFrames</see> that is updated whenever
47+
/// an item in the <paramref name="source"/> sequence is received. This rate is be limited by the
48+
/// hardware and has a maximum meaningful rate of 100 Hz.
49+
/// </remarks>
50+
/// <param name="source">A sequence to drive sampling.</param>
4351
/// <returns>A sequence of <see cref="Bno055DataFrame"/> objects.</returns>
4452
public unsafe IObservable<Bno055DataFrame> Generate<TSource>(IObservable<TSource> source)
4553
{

0 commit comments

Comments
 (0)