Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine all polled Bno055 classes into common type #303

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
42 changes: 0 additions & 42 deletions OpenEphys.Onix1.Design/NeuropixelsV1eBno055Dialog.cs

This file was deleted.

10 changes: 5 additions & 5 deletions OpenEphys.Onix1.Design/NeuropixelsV1eHeadstageDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace OpenEphys.Onix1.Design
/// </summary>
/// <remarks>
/// Within the GUI, there is a tab for both devices encapsulated by a <see cref="ConfigureNeuropixelsV1eHeadstage"/>,
/// specifically a <see cref="ConfigureNeuropixelsV1e"/> and a <see cref="ConfigureNeuropixelsV1eBno055"/>.
/// specifically a <see cref="ConfigureNeuropixelsV1e"/> and a <see cref="ConfigurePolledBno055"/>.
/// </remarks>
public partial class NeuropixelsV1eHeadstageDialog : Form
{
Expand All @@ -17,16 +17,16 @@ public partial class NeuropixelsV1eHeadstageDialog : Form
public readonly NeuropixelsV1eDialog DialogNeuropixelsV1e;

/// <summary>
/// Public method that provides access to the <see cref="NeuropixelsV1eBno055Dialog"/>.
/// Public method that provides access to the <see cref="PolledBno055Dialog"/>.
/// </summary>
public readonly NeuropixelsV1eBno055Dialog DialogBno055;
public readonly PolledBno055Dialog DialogBno055;

/// <summary>
/// Initializes a new instance of a <see cref="NeuropixelsV1eHeadstageDialog"/>.
/// </summary>
/// <param name="configureNeuropixelsV1e">Configuration settings for a <see cref="ConfigureNeuropixelsV1e"/>.</param>
/// <param name="configureBno055">Configuration settings for a <see cref="ConfigureNeuropixelsV1eBno055"/>.</param>
public NeuropixelsV1eHeadstageDialog(ConfigureNeuropixelsV1e configureNeuropixelsV1e, ConfigureNeuropixelsV1eBno055 configureBno055)
/// <param name="configureBno055">Configuration settings for a <see cref="ConfigurePolledBno055"/>.</param>
public NeuropixelsV1eHeadstageDialog(ConfigureNeuropixelsV1e configureNeuropixelsV1e, ConfigurePolledBno055 configureBno055)
{
InitializeComponent();

Expand Down
39 changes: 0 additions & 39 deletions OpenEphys.Onix1.Design/NeuropixelsV2eBno055Dialog.Designer.cs

This file was deleted.

42 changes: 0 additions & 42 deletions OpenEphys.Onix1.Design/NeuropixelsV2eBno055Dialog.cs

This file was deleted.

35 changes: 0 additions & 35 deletions OpenEphys.Onix1.Design/NeuropixelsV2eBno055Editor.cs

This file was deleted.

8 changes: 4 additions & 4 deletions OpenEphys.Onix1.Design/NeuropixelsV2eHeadstageDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ public partial class NeuropixelsV2eHeadstageDialog : Form
public readonly NeuropixelsV2eDialog DialogNeuropixelsV2e;

/// <summary>
/// A <see cref="NeuropixelsV2eBno055Dialog"/> that configures a <see cref="ConfigureNeuropixelsV2eBno055"/>.
/// A <see cref="PolledBno055Dialog"/> that configures a <see cref="ConfigurePolledBno055"/>.
/// </summary>
public readonly NeuropixelsV2eBno055Dialog DialogBno055;
public readonly PolledBno055Dialog DialogBno055;

/// <summary>
/// Initializes a new instance of a <see cref="NeuropixelsV2eHeadstageDialog"/>.
/// </summary>
/// <param name="configureNeuropixelsV2e">Configuration settings for a <see cref="ConfigureNeuropixelsV2e"/>.</param>
/// <param name="configureBno055">Configuration settings for a <see cref="ConfigureNeuropixelsV2eBno055"/>.</param>
public NeuropixelsV2eHeadstageDialog(IConfigureNeuropixelsV2 configureNeuropixelsV2e, ConfigureNeuropixelsV2eBno055 configureBno055)
/// <param name="configureBno055">Configuration settings for a <see cref="ConfigurePolledBno055"/>.</param>
public NeuropixelsV2eHeadstageDialog(IConfigureNeuropixelsV2 configureNeuropixelsV2e, ConfigurePolledBno055 configureBno055)
{
InitializeComponent();

Expand Down

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

42 changes: 42 additions & 0 deletions OpenEphys.Onix1.Design/PolledBno055Dialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;

namespace OpenEphys.Onix1.Design
{
/// <summary>
/// Partial class to create a GUI for <see cref="ConfigurePolledBno055"/>.
/// </summary>
public partial class PolledBno055Dialog : GenericDeviceDialog
{
/// <summary>
/// Gets or sets the <see cref="ConfigurePolledBno055"/> object attached to
/// the property grid.
/// </summary>
public ConfigurePolledBno055 ConfigureNode
{
get => (ConfigurePolledBno055)propertyGrid.SelectedObject;
set => propertyGrid.SelectedObject = value;
}

/// <summary>
/// Initializes a new <see cref="PolledBno055Dialog"/> instance with the given
/// <see cref="ConfigurePolledBno055"/> object.
/// </summary>
/// <param name="configureNode">A <see cref="ConfigurePolledBno055"/> object that contains configuration settings.</param>
public PolledBno055Dialog(ConfigurePolledBno055 configureNode)
{
InitializeComponent();
Shown += FormShown;

ConfigureNode = new(configureNode);
}

private void FormShown(object sender, EventArgs e)
{
if (!TopLevel)
{
splitContainer1.Panel2Collapsed = true;
splitContainer1.Panel2.Hide();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

namespace OpenEphys.Onix1.Design
{
internal class NeuropixelsV1eBno055Editor : WorkflowComponentEditor
internal class PolledBno055Editor : WorkflowComponentEditor
{
public override bool EditComponent(ITypeDescriptorContext context, object component, IServiceProvider provider, IWin32Window owner)
{
if (provider != null)
{
var editorState = (IWorkflowEditorState)provider.GetService(typeof(IWorkflowEditorState));
if (editorState != null && !editorState.WorkflowRunning && component is ConfigureNeuropixelsV1eBno055 configureBno055)
if (editorState != null && !editorState.WorkflowRunning && component is ConfigurePolledBno055 configureBno055)
{
using var editorDialog = new NeuropixelsV1eBno055Dialog(configureBno055);
using var editorDialog = new PolledBno055Dialog(configureBno055);

if (editorDialog.ShowDialog() == DialogResult.OK)
{
Expand Down
Loading