Skip to content

Commit

Permalink
Add Acquisition or Configuration category to public properties
Browse files Browse the repository at this point in the history
  • Loading branch information
bparks13 committed Aug 20, 2024
1 parent 048e90e commit 147eef7
Show file tree
Hide file tree
Showing 26 changed files with 66 additions and 2 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
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(ConfigurationCategory)]
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(ConfigurationCategory)]
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(ConfigurationCategory)]
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(ConfigurationCategory)]
public ConfigureMemoryMonitor MemoryMonitor { get; set; } = new();

internal override IEnumerable<IDeviceConfiguration> GetDevices()
Expand Down
1 change: 1 addition & 0 deletions OpenEphys.Onix1/ConfigureFmcLinkController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public ConfigureFmcLinkController()
[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
2 changes: 2 additions & 0 deletions OpenEphys.Onix1/ConfigureNeuropixelsV1e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public 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 @@ -108,6 +109,7 @@ public 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
2 changes: 2 additions & 0 deletions OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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 @@ -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.8V to 5.0V " +
"for proper operation. Higher voltages can damage the headstage.")]
[Category(ConfigurationCategory)]
public double? PortVoltage
{
get => LinkController.PortVoltage;
Expand Down
1 change: 0 additions & 1 deletion OpenEphys.Onix1/ConfigureNeuropixelsV2eLinkController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace OpenEphys.Onix1
{
class ConfigureNeuropixelsV2eLinkController : ConfigureFmcLinkController
{

protected override bool ConfigurePortVoltage(DeviceContext device)
{
const double MinVoltage = 3.3;
Expand Down
2 changes: 2 additions & 0 deletions OpenEphys.Onix1/DeviceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ internal SingleDeviceFactory(Type deviceType)
/// aggregates or virtual devices.
/// </remarks>
[Description(DeviceNameDescription)]
[Category(ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand All @@ -62,6 +63,7 @@ internal SingleDeviceFactory(Type deviceType)
/// representation of a <see cref="oni.Device.Address"/>, but can also represent abstract device addresses.
/// </remarks>
[Description(DeviceAddressDescription)]
[Category(ConfigurationCategory)]
public uint DeviceAddress { get; set; }

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

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

/// <summary>
Expand All @@ -46,6 +47,7 @@ public class Headstage64ElectricalStimulatorTrigger: Sink<bool>
/// If set to true, then the electrical stimulator circuit will respect triggers. If set to false, triggers will be ignored.
/// </remarks>
[Description("Specifies whether the electrical stimulator will respect triggers.")]
[Category(DeviceFactory.AcquisitionCategory)]
public bool Enable
{
get => enable.Value;
Expand All @@ -62,6 +64,7 @@ public bool Enable
/// in order for electrical stimuli to be delivered properly. It takes ~10 milliseconds for these supplies to stabilize.
/// </remarks>
[Description("Stimulator power on/off.")]
[Category(DeviceFactory.AcquisitionCategory)]
public bool PowerEnable
{
get => powerEnable.Value;
Expand All @@ -73,6 +76,7 @@ public bool PowerEnable
/// </summary>
[Description("A delay from receiving a trigger to the start of stimulus sequence application (uSec).")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint TriggerDelay
{
get => triggerDelay.Value;
Expand All @@ -87,6 +91,7 @@ public uint TriggerDelay
[Range(-Headstage64ElectricalStimulator.AbsMaxMicroAmps, Headstage64ElectricalStimulator.AbsMaxMicroAmps)]
[Editor(DesignTypes.SliderEditor, typeof(UITypeEditor))]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double PhaseOneCurrent
{
get => phaseOneCurrent.Value;
Expand All @@ -100,6 +105,7 @@ public double PhaseOneCurrent
[Range(-Headstage64ElectricalStimulator.AbsMaxMicroAmps, Headstage64ElectricalStimulator.AbsMaxMicroAmps)]
[Editor(DesignTypes.SliderEditor, typeof(UITypeEditor))]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double InterPhaseCurrent
{
get => interPhaseCurrent.Value;
Expand All @@ -113,6 +119,7 @@ public double InterPhaseCurrent
[Range(-Headstage64ElectricalStimulator.AbsMaxMicroAmps, Headstage64ElectricalStimulator.AbsMaxMicroAmps)]
[Editor(DesignTypes.SliderEditor, typeof(UITypeEditor))]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double PhaseTwoCurrent
{
get => phaseTwoCurrent.Value;
Expand All @@ -124,6 +131,7 @@ public double PhaseTwoCurrent
/// </summary>
[Description("The duration of the first phase of each pulse in μsec.")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint PhaseOneDuration
{
get => phaseOneDuration.Value;
Expand All @@ -135,6 +143,7 @@ public uint PhaseOneDuration
/// </summary>
[Description("The duration of the interphase interval of each pulse (uSec).")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint InterPhaseInterval
{
get => interPhaseInterval.Value;
Expand All @@ -146,6 +155,7 @@ public uint InterPhaseInterval
/// </summary>
[Description("The duration of the second phase of each pulse (uSec).")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint PhaseTwoDuration
{
get => phaseTwoDuration.Value;
Expand All @@ -157,6 +167,7 @@ public uint PhaseTwoDuration
/// </summary>
[Description("The duration of the inter-pulse interval within a single burst (uSec).")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint InterPulseInterval
{
get => interPulseInterval.Value;
Expand All @@ -168,6 +179,7 @@ public uint InterPulseInterval
/// </summary>
[Description("The duration of the inter-burst interval within a stimulus train (uSec).")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint InterBurstInterval
{
get => interBurstInterval.Value;
Expand All @@ -179,6 +191,7 @@ public uint InterBurstInterval
/// </summary>
[Description("The number of pulses per burst.")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint BurstPulseCount
{
get => burstPulseCount.Value;
Expand All @@ -190,6 +203,7 @@ public uint BurstPulseCount
/// </summary>
[Description("The number of bursts in each train.")]
[Range(0, uint.MaxValue)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint TrainBurstCount
{
get => trainBurstCount.Value;
Expand Down
11 changes: 11 additions & 0 deletions OpenEphys.Onix1/Headstage64OpticalStimulatorTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Headstage64OpticalStimulatorTrigger : Sink<bool>

/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(Headstage64OpticalStimulator.NameConverter))]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

/// <summary>
Expand All @@ -42,6 +43,7 @@ public class Headstage64OpticalStimulatorTrigger : Sink<bool>
/// If set to true, then the optical stimulator circuit will respect triggers. If set to false, triggers will be ignored.
/// </remarks>
[Description("Specifies whether the optical stimulator will respect triggers.")]
[Category(DeviceFactory.AcquisitionCategory)]
public bool Enable
{
get => enable.Value;
Expand All @@ -55,6 +57,7 @@ public bool Enable
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(0.0, 1000.0)]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double Delay
{
get => delay.Value;
Expand All @@ -75,6 +78,7 @@ public double Delay
[Editor(DesignTypes.SliderEditor, typeof(UITypeEditor))]
[Range(0, 300)]
[Precision(3, 0)]
[Category(DeviceFactory.AcquisitionCategory)]
public double MaxCurrent
{
get => maxCurrent.Value;
Expand All @@ -88,6 +92,7 @@ public double MaxCurrent
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(0, 100)]
[Precision(1, 12.5)]
[Category(DeviceFactory.AcquisitionCategory)]
public double ChannelOneCurrent
{
get => channelOneCurrent.Value;
Expand All @@ -101,6 +106,7 @@ public double ChannelOneCurrent
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(0, 100)]
[Precision(1, 12.5)]
[Category(DeviceFactory.AcquisitionCategory)]
public double ChannelTwoCurrent
{
get => channelTwoCurrent.Value;
Expand All @@ -114,6 +120,7 @@ public double ChannelTwoCurrent
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(0.001, 1000.0)]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double PulseDuration
{
get => pulseDuration.Value;
Expand All @@ -127,6 +134,7 @@ public double PulseDuration
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(0.01, 10000.0)]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double PulsesPerSecond
{
get => pulsesPerSecond.Value;
Expand All @@ -140,6 +148,7 @@ public double PulsesPerSecond
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(1, int.MaxValue)]
[Precision(0, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint PulsesPerBurst
{
get => pulsesPerBurst.Value;
Expand All @@ -154,6 +163,7 @@ public uint PulsesPerBurst
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(0.0, 10000.0)]
[Precision(3, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public double InterBurstInterval
{
get => interBurstInterval.Value;
Expand All @@ -167,6 +177,7 @@ public double InterBurstInterval
[Editor(DesignTypes.NumericUpDownEditor, DesignTypes.UITypeEditor)]
[Range(1, int.MaxValue)]
[Precision(0, 1)]
[Category(DeviceFactory.AcquisitionCategory)]
public uint BurstsPerTrain
{
get => burstsPerTrain.Value;
Expand Down
1 change: 1 addition & 0 deletions OpenEphys.Onix1/HeartbeatData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class HeartbeatData : Source<HeartbeatDataFrame>
/// <inheritdoc cref = "SingleDeviceFactory.DeviceName"/>
[TypeConverter(typeof(Heartbeat.NameConverter))]
[Description(SingleDeviceFactory.DeviceNameDescription)]
[Category(DeviceFactory.ConfigurationCategory)]
public string DeviceName { get; set; }

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

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions OpenEphys.Onix1/MultiDeviceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ internal MultiDeviceFactory()
/// the <see cref="SingleDeviceFactory.DeviceName"/> of each device in the the group.
/// </remarks>
[Description("The unique device group name.")]
[Category(ConfigurationCategory)]
public string Name
{
get { return _name; }
Expand Down
Loading

0 comments on commit 147eef7

Please sign in to comment.