From ec3a4790e690b545f3d4e00205ed14330185b432 Mon Sep 17 00:00:00 2001 From: bparks13 Date: Thu, 22 Aug 2024 14:01:33 -0400 Subject: [PATCH] Assign remaining properties to categories - For aggregates, use `Devices` category for encapsulated devices --- OpenEphys.Onix1/ConfigureBreakoutBoard.cs | 8 ++++---- OpenEphys.Onix1/ConfigureHeadstage64.cs | 12 +++++++----- OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs | 4 ++-- .../ConfigureNeuropixelsV2eBetaHeadstage.cs | 6 ++++-- OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs | 6 ++++-- OpenEphys.Onix1/CreateContext.cs | 2 ++ OpenEphys.Onix1/MultiDeviceFactory.cs | 2 ++ 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/OpenEphys.Onix1/ConfigureBreakoutBoard.cs b/OpenEphys.Onix1/ConfigureBreakoutBoard.cs index 6d4575b4..815fec9d 100644 --- a/OpenEphys.Onix1/ConfigureBreakoutBoard.cs +++ b/OpenEphys.Onix1/ConfigureBreakoutBoard.cs @@ -14,7 +14,7 @@ public class ConfigureBreakoutBoard : MultiDeviceFactory /// [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the heartbeat device in the ONIX breakout board.")] - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] public ConfigureHeartbeat Heartbeat { get; set; } = new(); /// @@ -22,7 +22,7 @@ public class ConfigureBreakoutBoard : MultiDeviceFactory /// [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the analog IO device in the ONIX breakout board.")] - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] public ConfigureBreakoutAnalogIO AnalogIO { get; set; } = new(); /// @@ -30,7 +30,7 @@ public class ConfigureBreakoutBoard : MultiDeviceFactory /// [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the digital IO device in the ONIX breakout board.")] - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] public ConfigureBreakoutDigitalIO DigitalIO { get; set; } = new(); /// @@ -38,7 +38,7 @@ public class ConfigureBreakoutBoard : MultiDeviceFactory /// [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the memory monitor device in the ONIX breakout board.")] - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] public ConfigureMemoryMonitor MemoryMonitor { get; set; } = new(); internal override IEnumerable GetDevices() diff --git a/OpenEphys.Onix1/ConfigureHeadstage64.cs b/OpenEphys.Onix1/ConfigureHeadstage64.cs index 0d1a4c70..a61e809f 100644 --- a/OpenEphys.Onix1/ConfigureHeadstage64.cs +++ b/OpenEphys.Onix1/ConfigureHeadstage64.cs @@ -41,7 +41,7 @@ public ConfigureHeadstage64() /// /// Gets or sets the Rhd2164 configuration. /// - [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(); @@ -49,7 +49,7 @@ public ConfigureHeadstage64() /// /// Gets or sets the Bno055 9-axis inertial measurement unit configuration. /// - [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(); @@ -57,7 +57,7 @@ public ConfigureHeadstage64() /// /// Gets or sets the SteamVR V1 basestation 3D tracking array configuration. /// - [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 }; @@ -65,7 +65,7 @@ public ConfigureHeadstage64() /// /// Gets or sets onboard electrical stimulator configuration. /// - [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(); @@ -73,7 +73,7 @@ public ConfigureHeadstage64() /// /// Gets or sets onboard optical stimulator configuration. /// - [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(); @@ -85,6 +85,7 @@ public ConfigureHeadstage64() /// The port is the physical connection to the ONIX breakout board and must be specified prior to operation. /// [Description("Specifies the physical connection of the headstage to the ONIX breakout board.")] + [Category(ConfigurationCategory)] public PortName Port { get { return port; } @@ -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; diff --git a/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs b/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs index 83b3ea56..cbaf7518 100644 --- a/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs +++ b/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs @@ -25,7 +25,7 @@ public ConfigureNeuropixelsV1eHeadstage() /// /// Gets or sets the NeuropixelsV1e configuration. /// - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the NeuropixelsV1e device.")] public ConfigureNeuropixelsV1e NeuropixelsV1e { get; set; } = new(); @@ -33,7 +33,7 @@ public ConfigureNeuropixelsV1eHeadstage() /// /// Gets or sets the Bno055 9-axis inertial measurement unit configuration. /// - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigureNeuropixelsV1eBno055 Bno055 { get; set; } = new(); diff --git a/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs b/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs index 9464ac86..a57f0495 100644 --- a/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs +++ b/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs @@ -24,7 +24,7 @@ public ConfigureNeuropixelsV2eBetaHeadstage() /// /// Gets or sets the NeuropixelsV2eBeta configuration. /// - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the NeuropixelsV2eBeta device.")] public ConfigureNeuropixelsV2eBeta NeuropixelsV2eBeta { get; set; } = new(); @@ -32,7 +32,7 @@ public ConfigureNeuropixelsV2eBetaHeadstage() /// /// Gets or sets the Bno055 9-axis inertial measurement unit configuration. /// - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigureNeuropixelsV2eBno055 Bno055 { get; set; } = new(); @@ -44,6 +44,7 @@ public ConfigureNeuropixelsV2eBetaHeadstage() /// The port is the physical connection to the ONIX breakout board and must be specified prior to operation. /// [Description("Specifies the physical connection of the headstage to the ONIX breakout board.")] + [Category(ConfigurationCategory)] public PortName Port { get { return port; } @@ -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; diff --git a/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs b/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs index be2fab48..ea726ab8 100644 --- a/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs +++ b/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs @@ -25,7 +25,7 @@ public ConfigureNeuropixelsV2eHeadstage() /// /// Gets or sets the NeuropixelsV2e configuration. /// - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the NeuropixelsV2e device.")] public ConfigureNeuropixelsV2e NeuropixelsV2e { get; set; } = new(); @@ -33,7 +33,7 @@ public ConfigureNeuropixelsV2eHeadstage() /// /// Gets or sets the Bno055 9-axis inertial measurement unit configuration. /// - [Category(ConfigurationCategory)] + [Category(DevicesCategory)] [TypeConverter(typeof(SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigureNeuropixelsV2eBno055 Bno055 { get; set; } = new(); @@ -45,6 +45,7 @@ public ConfigureNeuropixelsV2eHeadstage() /// The port is the physical connection to the ONIX breakout board and must be specified prior to operation. /// [Description("Specifies the physical connection of the headstage to the ONIX breakout board.")] + [Category(ConfigurationCategory)] public PortName Port { get { return port; } @@ -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; diff --git a/OpenEphys.Onix1/CreateContext.cs b/OpenEphys.Onix1/CreateContext.cs index 87b2ff84..2fb77112 100644 --- a/OpenEphys.Onix1/CreateContext.cs +++ b/OpenEphys.Onix1/CreateContext.cs @@ -18,6 +18,7 @@ public class CreateContext /// Gets or sets a string specifying the device driver used to communicate with hardware. /// [Description("Specifies the device driver used to communicate with hardware.")] + [Category(DeviceFactory.ConfigurationCategory)] public string Driver { get; set; } = ContextTask.DefaultDriver; /// @@ -30,6 +31,7 @@ public class CreateContext /// managed by the specified selected in the host computer. /// [Description("The index of the host interconnect between the ONI controller and host computer.")] + [Category(DeviceFactory.ConfigurationCategory)] public int Index { get; set; } = ContextTask.DefaultIndex; /// diff --git a/OpenEphys.Onix1/MultiDeviceFactory.cs b/OpenEphys.Onix1/MultiDeviceFactory.cs index 48503b90..44772616 100644 --- a/OpenEphys.Onix1/MultiDeviceFactory.cs +++ b/OpenEphys.Onix1/MultiDeviceFactory.cs @@ -29,6 +29,8 @@ public abstract class MultiDeviceFactory : DeviceFactory, INamedElement const string BaseTypePrefix = "Configure"; string _name; + internal const string DevicesCategory = "Devices"; + internal MultiDeviceFactory() { var baseName = GetType().Name;