Skip to content

Commit

Permalink
Merge pull request #226 from open-ephys/issue-206
Browse files Browse the repository at this point in the history
Add Acquisition, Configuration, or Devices category to public properties
  • Loading branch information
bparks13 authored Aug 22, 2024
2 parents e5e5a97 + ec3a479 commit 6e47c63
Show file tree
Hide file tree
Showing 31 changed files with 99 additions and 25 deletions.
1 change: 1 addition & 0 deletions OpenEphys.Onix1/Bno055Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Bno055Data : Source<Bno055DataFrame>
/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(Bno055.NameConverter))]
[Description(SingleDeviceFactory.DeviceNameDescription)]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion OpenEphys.Onix1/BreakoutAnalogInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class BreakoutAnalogInput : Source<BreakoutAnalogInputDataFrame>
/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(BreakoutAnalogIO.NameConverter))]
[Description(SingleDeviceFactory.DeviceNameDescription)]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand All @@ -30,6 +31,7 @@ public class BreakoutAnalogInput : Source<BreakoutAnalogInputDataFrame>
/// millisecond of data from each channel.
/// </remarks>
[Description("The number of analog samples that are buffered for each channel before data is propagated.")]
[Category(DeviceFactory.ConfigurationCategory)]
public int BufferSize { get; set; } = 100;

/// <summary>
Expand All @@ -43,11 +45,11 @@ public class BreakoutAnalogInput : Source<BreakoutAnalogInputDataFrame>
/// are represented as 32-bit floating point voltages.
/// </remarks>
[Description("The data type used to represent analog samples.")]
[Category(DeviceFactory.ConfigurationCategory)]
public BreakoutAnalogIODataType DataType { get; set; } = BreakoutAnalogIODataType.S16;

static Mat CreateVoltageScale(int bufferSize, float[] voltsPerDivision)
{

using var scaleHeader = Mat.CreateMatHeader(
voltsPerDivision,
rows: voltsPerDivision.Length,
Expand Down
2 changes: 2 additions & 0 deletions OpenEphys.Onix1/BreakoutAnalogOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class BreakoutAnalogOutput : Sink<Mat>
/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(BreakoutAnalogIO.NameConverter))]
[Description(SingleDeviceFactory.DeviceNameDescription)]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand All @@ -30,6 +31,7 @@ public class BreakoutAnalogOutput : Sink<Mat>
/// directly to the DACs.
/// </remarks>
[Description("The data type used to represent analog samples.")]
[Category(DeviceFactory.ConfigurationCategory)]
public BreakoutAnalogIODataType DataType { get; set; } = BreakoutAnalogIODataType.S16;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions OpenEphys.Onix1/BreakoutDigitalInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class BreakoutDigitalInput : Source<BreakoutDigitalInputDataFrame>
/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(BreakoutDigitalIO.NameConverter))]
[Description(SingleDeviceFactory.DeviceNameDescription)]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions OpenEphys.Onix1/BreakoutDigitalOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class BreakoutDigitalOutput : Sink<BreakoutDigitalPortState>
/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(BreakoutDigitalIO.NameConverter))]
[Description(SingleDeviceFactory.DeviceNameDescription)]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand Down
24 changes: 12 additions & 12 deletions OpenEphys.Onix1/ConfigureBreakoutAnalogIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,84 +117,84 @@ public ConfigureBreakoutAnalogIO()
/// <summary>
/// Gets or sets the direction of channel 0.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 0.")]
public BreakoutAnalogIODirection Direction0 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 1.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 1.")]
public BreakoutAnalogIODirection Direction1 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 2.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 2.")]
public BreakoutAnalogIODirection Direction2 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 3.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 3.")]
public BreakoutAnalogIODirection Direction3 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 4.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 4.")]
public BreakoutAnalogIODirection Direction4 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 5.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 5.")]
public BreakoutAnalogIODirection Direction5 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 6.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 6.")]
public BreakoutAnalogIODirection Direction6 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 7.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 7.")]
public BreakoutAnalogIODirection Direction7 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 8.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 8.")]
public BreakoutAnalogIODirection Direction8 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 9.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 9.")]
public BreakoutAnalogIODirection Direction9 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 10.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 10.")]
public BreakoutAnalogIODirection Direction10 { get; set; }

/// <summary>
/// Gets or sets the direction of channel 11.
/// </summary>
[Category(AcquisitionCategory)]
[Category(ConfigurationCategory)]
[Description("The direction of channel 11.")]
public BreakoutAnalogIODirection Direction11 { get; set; }

Expand Down
4 changes: 4 additions & 0 deletions OpenEphys.Onix1/ConfigureBreakoutBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ public class ConfigureBreakoutBoard : MultiDeviceFactory
/// </summary>
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the heartbeat device in the ONIX breakout board.")]
[Category(DevicesCategory)]
public ConfigureHeartbeat Heartbeat { get; set; } = new();

/// <summary>
/// Gets or sets the breakout board's analog IO configuration.
/// </summary>
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the analog IO device in the ONIX breakout board.")]
[Category(DevicesCategory)]
public ConfigureBreakoutAnalogIO AnalogIO { get; set; } = new();

/// <summary>
/// Gets or sets the breakout board's digital IO configuration.
/// </summary>
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the digital IO device in the ONIX breakout board.")]
[Category(DevicesCategory)]
public ConfigureBreakoutDigitalIO DigitalIO { get; set; } = new();

/// <summary>
/// Gets or sets the hardware memory monitor configuration.
/// </summary>
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the memory monitor device in the ONIX breakout board.")]
[Category(DevicesCategory)]
public ConfigureMemoryMonitor MemoryMonitor { get; set; } = new();

internal override IEnumerable<IDeviceConfiguration> GetDevices()
Expand Down
12 changes: 7 additions & 5 deletions OpenEphys.Onix1/ConfigureHeadstage64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,39 @@ public ConfigureHeadstage64()
/// <summary>
/// Gets or sets the Rhd2164 configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Rhd2164 device in the headstage-64.")]
public ConfigureRhd2164 Rhd2164 { get; set; } = new();

/// <summary>
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device in the headstage-64.")]
public ConfigureBno055 Bno055 { get; set; } = new();

/// <summary>
/// Gets or sets the SteamVR V1 basestation 3D tracking array configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the TS4231 device in the headstage-64.")]
public ConfigureTS4231V1 TS4231 { get; set; } = new() { Enable = false };

/// <summary>
/// Gets or sets onboard electrical stimulator configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the ElectricalStimulator device in the headstage-64.")]
public ConfigureHeadstage64ElectricalStimulator ElectricalStimulator { get; set; } = new();

/// <summary>
/// Gets or sets onboard optical stimulator configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the OpticalStimulator device in the headstage-64.")]
public ConfigureHeadstage64OpticalStimulator OpticalStimulator { get; set; } = new();
Expand All @@ -85,6 +85,7 @@ public ConfigureHeadstage64()
/// The port is the physical connection to the ONIX breakout board and must be specified prior to operation.
/// </remarks>
[Description("Specifies the physical connection of the headstage to the ONIX breakout board.")]
[Category(ConfigurationCategory)]
public PortName Port
{
get { return port; }
Expand Down Expand Up @@ -120,6 +121,7 @@ public PortName Port
[Description("If defined, it will override automated voltage discovery and apply the specified voltage" +
"to the headstage. Warning: this device requires 5.5V to 6.0V for proper operation." +
"Supplying higher voltages may result in damage to the headstage.")]
[Category(ConfigurationCategory)]
public double? PortVoltage
{
get => PortControl.PortVoltage;
Expand Down
2 changes: 2 additions & 0 deletions OpenEphys.Onix1/ConfigureNeuropixelsV1e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public ConfigureNeuropixelsV1e(ConfigureNeuropixelsV1e configureNeuropixelsV1e)
[FileNameFilter("Gain calibration files (*_gainCalValues.csv)|*_gainCalValues.csv")]
[Description("Path to the Neuropixels 1.0 gain calibration file.")]
[Editor("Bonsai.Design.OpenFileNameEditor, Bonsai.Design", DesignTypes.UITypeEditor)]
[Category(ConfigurationCategory)]
public string GainCalibrationFile { get; set; }

/// <summary>
Expand All @@ -97,6 +98,7 @@ public ConfigureNeuropixelsV1e(ConfigureNeuropixelsV1e configureNeuropixelsV1e)
[FileNameFilter("ADC calibration files (*_ADCCalibration.csv)|*_ADCCalibration.csv")]
[Description("Path to the Neuropixels 1.0 ADC calibration file.")]
[Editor("Bonsai.Design.OpenFileNameEditor, Bonsai.Design", DesignTypes.UITypeEditor)]
[Category(ConfigurationCategory)]
public string AdcCalibrationFile { get; set; }

/// <summary>
Expand Down
6 changes: 4 additions & 2 deletions OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ public ConfigureNeuropixelsV1eHeadstage()
/// <summary>
/// Gets or sets the NeuropixelsV1e configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the NeuropixelsV1e device.")]
public ConfigureNeuropixelsV1e NeuropixelsV1e { get; set; } = new();

/// <summary>
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigureNeuropixelsV1eBno055 Bno055 { get; set; } = new();
Expand All @@ -46,6 +46,7 @@ public ConfigureNeuropixelsV1eHeadstage()
/// The port is the physical connection to the ONIX breakout board and must be specified prior to operation.
/// </remarks>
[Description("Specifies the physical connection of the headstage to the ONIX breakout board.")]
[Category(ConfigurationCategory)]
public PortName Port
{
get { return port; }
Expand All @@ -71,6 +72,7 @@ public PortName Port
[Description("If defined, overrides automated voltage discovery and applies " +
"the specified voltage to the headstage. Warning: this device requires 3.8V to 5.0V " +
"for proper operation. Higher voltages can damage the headstage.")]
[Category(ConfigurationCategory)]
public double? PortVoltage
{
get => PortControl.PortVoltage;
Expand Down
6 changes: 4 additions & 2 deletions OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public ConfigureNeuropixelsV2eBetaHeadstage()
/// <summary>
/// Gets or sets the NeuropixelsV2eBeta configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the NeuropixelsV2eBeta device.")]
public ConfigureNeuropixelsV2eBeta NeuropixelsV2eBeta { get; set; } = new();

/// <summary>
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigureNeuropixelsV2eBno055 Bno055 { get; set; } = new();
Expand All @@ -44,6 +44,7 @@ public ConfigureNeuropixelsV2eBetaHeadstage()
/// The port is the physical connection to the ONIX breakout board and must be specified prior to operation.
/// </remarks>
[Description("Specifies the physical connection of the headstage to the ONIX breakout board.")]
[Category(ConfigurationCategory)]
public PortName Port
{
get { return port; }
Expand All @@ -69,6 +70,7 @@ public PortName Port
[Description("If defined, overrides automated voltage discovery and applies " +
"the specified voltage to the headstage. Warning: this device requires 3.0V to 5.0V " +
"for proper operation. Higher voltages can damage the headstage.")]
[Category(ConfigurationCategory)]
public double? PortVoltage
{
get => PortControl.PortVoltage;
Expand Down
6 changes: 4 additions & 2 deletions OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public ConfigureNeuropixelsV2eHeadstage()
/// <summary>
/// Gets or sets the NeuropixelsV2e configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the NeuropixelsV2e device.")]
public ConfigureNeuropixelsV2e NeuropixelsV2e { get; set; } = new();

/// <summary>
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(ConfigurationCategory)]
[Category(DevicesCategory)]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigureNeuropixelsV2eBno055 Bno055 { get; set; } = new();
Expand All @@ -45,6 +45,7 @@ public ConfigureNeuropixelsV2eHeadstage()
/// The port is the physical connection to the ONIX breakout board and must be specified prior to operation.
/// </remarks>
[Description("Specifies the physical connection of the headstage to the ONIX breakout board.")]
[Category(ConfigurationCategory)]
public PortName Port
{
get { return port; }
Expand All @@ -70,6 +71,7 @@ public PortName Port
[Description("If defined, overrides automated voltage discovery and applies " +
"the specified voltage to the headstage. Warning: this device requires 3.0V to 5.5V " +
"for proper operation. Higher voltages can damage the headstage.")]
[Category(ConfigurationCategory)]
public double? PortVoltage
{
get => PortControl.PortVoltage;
Expand Down
1 change: 0 additions & 1 deletion OpenEphys.Onix1/ConfigureNeuropixelsV2ePortController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace OpenEphys.Onix1
{
class ConfigureNeuropixelsV2ePortController : ConfigurePortController
{

protected override bool ConfigurePortVoltage(DeviceContext device)
{
const double MinVoltage = 3.3;
Expand Down
1 change: 1 addition & 0 deletions OpenEphys.Onix1/ConfigurePortController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public ConfigurePortController()
[Description("Specifies the supplied port voltage. If this value is specified, it will override automated" +
"voltage discovery. Warning: Supplying excessive voltage may result in damage to devices. " +
"Consult the device datasheet and documentation for allowable voltage ranges.")]
[Category(ConfigurationCategory)]
public double? PortVoltage { get; set; } = null;

protected virtual bool CheckLinkState(DeviceContext device)
Expand Down
Loading

0 comments on commit 6e47c63

Please sign in to comment.