Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions OpenEphys.Onix1.Design/PolledBno055Dialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV1e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ConfigureHeadstageNeuropixelsV1e()
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(DevicesCategory)]
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigurePolledBno055 Bno055 { get; set; } =
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorZ };
Expand Down
2 changes: 1 addition & 1 deletion OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV1f.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public ConfigureHeadstageNeuropixelsV1f()
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(DevicesCategory)]
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigureBno055 Bno055 { get; set; } = new();

Expand Down
2 changes: 1 addition & 1 deletion OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV2e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ConfigureHeadstageNeuropixelsV2e()
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(DevicesCategory)]
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigurePolledBno055 Bno055 { get; set; } =
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY };
Expand Down
2 changes: 1 addition & 1 deletion OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV2eBeta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ConfigureHeadstageNeuropixelsV2eBeta()
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(DevicesCategory)]
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigurePolledBno055 Bno055 { get; set; } =
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY };
Expand Down
20 changes: 2 additions & 18 deletions OpenEphys.Onix1/ConfigurePolledBno055.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public ConfigurePolledBno055(ConfigurePolledBno055 configurePolledBno055)
/// </remarks>
[Category(ConfigurationCategory)]
[Description("Specifies the axis map that will be applied during configuration.")]
[Browsable(false)]
public Bno055AxisMap AxisMap { get; set; } = Bno055AxisMap.XYZ;

/// <summary>
Expand All @@ -74,6 +75,7 @@ public ConfigurePolledBno055(ConfigurePolledBno055 configurePolledBno055)
/// </remarks>
[Category(ConfigurationCategory)]
[Description("Specifies axis sign that will be applied during configuration.")]
[Browsable(false)]
public Bno055AxisSign AxisSign { get; set; } = Bno055AxisSign.Default;

/// <summary>
Expand Down Expand Up @@ -229,24 +231,6 @@ public enum Bno055AxisSign : uint
MirrorX = 0b00000_100,
}

// NB: Can be used to remove axis map and sign properties from MultiDeviceFactories that include a
// ConfigurePolledBno055 when having those options would cause confusion and potential
// commutator malfunction
internal class PolledBno055SingleDeviceFactoryConverter : SingleDeviceFactoryConverter
{
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
var properties = (from property in base.GetProperties(context, value, attributes).Cast<PropertyDescriptor>()
where !property.IsReadOnly &&
!(property.PropertyType == typeof(Bno055AxisMap)) &&
!(property.PropertyType == typeof(Bno055AxisSign)) &&
property.ComponentType != typeof(SingleDeviceFactory)
select property)
.ToArray();
return new PropertyDescriptorCollection(properties).Sort(properties.Select(p => p.Name).ToArray());
}
}

/// <inheritdoc cref = "ConfigurePolledBno055"/>
[Obsolete("This operator is obsolete. Use ConfigurePolledBno055 instead. Will be removed in version 1.0.0.")]
public class ConfigureNeuropixelsV1eBno055 : ConfigurePolledBno055
Expand Down
2 changes: 1 addition & 1 deletion OpenEphys.Onix1/ConfigureUclaMiniscopeV4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ConfigureUclaMiniscopeV4()
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
/// </summary>
[Category(DevicesCategory)]
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
[Description("Specifies the configuration for the Bno055 device.")]
public ConfigurePolledBno055 Bno055 { get; set; } =
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZYX, AxisSign = Bno055AxisSign.MirrorZ };
Expand Down
Loading