Skip to content

Commit 72617ac

Browse files
authored
Merge pull request #483 from open-ephys/issue-314
Mark AxisMap and AxisSign as not browsable
2 parents e24f6db + b073185 commit 72617ac

File tree

7 files changed

+9
-25
lines changed

7 files changed

+9
-25
lines changed

OpenEphys.Onix1.Design/PolledBno055Dialog.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV1e.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public ConfigureHeadstageNeuropixelsV1e()
5050
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
5151
/// </summary>
5252
[Category(DevicesCategory)]
53-
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
53+
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
5454
[Description("Specifies the configuration for the Bno055 device.")]
5555
public ConfigurePolledBno055 Bno055 { get; set; } =
5656
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorZ };

OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV1f.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public ConfigureHeadstageNeuropixelsV1f()
6060
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
6161
/// </summary>
6262
[Category(DevicesCategory)]
63-
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
63+
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
6464
[Description("Specifies the configuration for the Bno055 device.")]
6565
public ConfigureBno055 Bno055 { get; set; } = new();
6666

OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV2e.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ConfigureHeadstageNeuropixelsV2e()
4949
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
5050
/// </summary>
5151
[Category(DevicesCategory)]
52-
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
52+
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
5353
[Description("Specifies the configuration for the Bno055 device.")]
5454
public ConfigurePolledBno055 Bno055 { get; set; } =
5555
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY };

OpenEphys.Onix1/ConfigureHeadstageNeuropixelsV2eBeta.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ConfigureHeadstageNeuropixelsV2eBeta()
4949
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
5050
/// </summary>
5151
[Category(DevicesCategory)]
52-
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
52+
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
5353
[Description("Specifies the configuration for the Bno055 device.")]
5454
public ConfigurePolledBno055 Bno055 { get; set; } =
5555
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY };

OpenEphys.Onix1/ConfigurePolledBno055.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public ConfigurePolledBno055(ConfigurePolledBno055 configurePolledBno055)
6262
/// </remarks>
6363
[Category(ConfigurationCategory)]
6464
[Description("Specifies the axis map that will be applied during configuration.")]
65+
[Browsable(false)]
6566
public Bno055AxisMap AxisMap { get; set; } = Bno055AxisMap.XYZ;
6667

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

7981
/// <summary>
@@ -229,24 +231,6 @@ public enum Bno055AxisSign : uint
229231
MirrorX = 0b00000_100,
230232
}
231233

232-
// NB: Can be used to remove axis map and sign properties from MultiDeviceFactories that include a
233-
// ConfigurePolledBno055 when having those options would cause confusion and potential
234-
// commutator malfunction
235-
internal class PolledBno055SingleDeviceFactoryConverter : SingleDeviceFactoryConverter
236-
{
237-
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
238-
{
239-
var properties = (from property in base.GetProperties(context, value, attributes).Cast<PropertyDescriptor>()
240-
where !property.IsReadOnly &&
241-
!(property.PropertyType == typeof(Bno055AxisMap)) &&
242-
!(property.PropertyType == typeof(Bno055AxisSign)) &&
243-
property.ComponentType != typeof(SingleDeviceFactory)
244-
select property)
245-
.ToArray();
246-
return new PropertyDescriptorCollection(properties).Sort(properties.Select(p => p.Name).ToArray());
247-
}
248-
}
249-
250234
/// <inheritdoc cref = "ConfigurePolledBno055"/>
251235
[Obsolete("This operator is obsolete. Use ConfigurePolledBno055 instead. Will be removed in version 1.0.0.")]
252236
public class ConfigureNeuropixelsV1eBno055 : ConfigurePolledBno055

OpenEphys.Onix1/ConfigureUclaMiniscopeV4.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public ConfigureUclaMiniscopeV4()
4747
/// Gets or sets the Bno055 9-axis inertial measurement unit configuration.
4848
/// </summary>
4949
[Category(DevicesCategory)]
50-
[TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))]
50+
[TypeConverter(typeof(SingleDeviceFactoryConverter))]
5151
[Description("Specifies the configuration for the Bno055 device.")]
5252
public ConfigurePolledBno055 Bno055 { get; set; } =
5353
new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZYX, AxisSign = Bno055AxisSign.MirrorZ };

0 commit comments

Comments
 (0)