-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from open-ephys/issue-106-gui
Add GUI for Neuropixels V1e
- Loading branch information
Showing
42 changed files
with
6,244 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
|
||
namespace OpenEphys.Onix1.Design | ||
{ | ||
/// <summary> | ||
/// Simple dialog that attaches the <see cref="ConfigureBno055"/> to a property grid. | ||
/// </summary> | ||
public partial class Bno055Dialog : GenericDeviceDialog | ||
{ | ||
/// <summary> | ||
/// Gets or sets the <see cref="ConfigureBno055"/>, allowing for changes made in the dialog to be reflected in the main editor. | ||
/// </summary> | ||
public ConfigureBno055 ConfigureNode | ||
{ | ||
get => (ConfigureBno055)propertyGrid.SelectedObject; | ||
set => propertyGrid.SelectedObject = value; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new dialog for the <see cref="ConfigureBno055"/> operator. | ||
/// </summary> | ||
/// <param name="configureNode"></param> | ||
public Bno055Dialog(ConfigureBno055 configureNode) | ||
{ | ||
InitializeComponent(); | ||
Shown += FormShown; | ||
|
||
ConfigureNode = new(configureNode); | ||
} | ||
|
||
private void FormShown(object sender, EventArgs e) | ||
{ | ||
if (!TopLevel) | ||
{ | ||
splitContainer1.Panel2Collapsed = true; | ||
splitContainer1.Panel2.Hide(); | ||
|
||
MaximumSize = new System.Drawing.Size(0, 0); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Bonsai.Design; | ||
using System.ComponentModel; | ||
using System.Windows.Forms; | ||
using System; | ||
|
||
namespace OpenEphys.Onix1.Design | ||
{ | ||
/// <summary> | ||
/// Class that opens a new dialog for a <see cref="ConfigureBno055"/>. | ||
/// </summary> | ||
public class Bno055Editor : WorkflowComponentEditor | ||
{ | ||
/// <inheritdoc/> | ||
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 ConfigureBno055 configureBno055) | ||
{ | ||
using var editorDialog = new Bno055Dialog(configureBno055); | ||
|
||
if (editorDialog.ShowDialog() == DialogResult.OK) | ||
{ | ||
configureBno055.Enable = editorDialog.ConfigureNode.Enable; | ||
|
||
return true; | ||
} | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
|
||
namespace OpenEphys.Onix1.Design | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
39 changes: 39 additions & 0 deletions
39
OpenEphys.Onix1.Design/NeuropixelsV1eBno055Dialog.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="ConfigureNeuropixelsV1eBno055"/>. | ||
/// </summary> | ||
public partial class NeuropixelsV1eBno055Dialog : GenericDeviceDialog | ||
{ | ||
/// <summary> | ||
/// Gets or sets the <see cref="ConfigureNeuropixelsV1eBno055"/> object attached to | ||
/// the property grid. | ||
/// </summary> | ||
public ConfigureNeuropixelsV1eBno055 ConfigureNode | ||
{ | ||
get => (ConfigureNeuropixelsV1eBno055)propertyGrid.SelectedObject; | ||
set => propertyGrid.SelectedObject = value; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new <see cref="NeuropixelsV1eBno055Dialog"/> instance with the given | ||
/// <see cref="ConfigureNeuropixelsV1eBno055"/> object. | ||
/// </summary> | ||
/// <param name="configureNode">A <see cref="ConfigureNeuropixelsV1eBno055"/> object that contains configuration settings.</param> | ||
public NeuropixelsV1eBno055Dialog(ConfigureNeuropixelsV1eBno055 configureNode) | ||
{ | ||
InitializeComponent(); | ||
Shown += FormShown; | ||
|
||
ConfigureNode = new(configureNode); | ||
} | ||
|
||
private void FormShown(object sender, EventArgs e) | ||
{ | ||
if (!TopLevel) | ||
{ | ||
splitContainer1.Panel2Collapsed = true; | ||
splitContainer1.Panel2.Hide(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using Bonsai.Design; | ||
using System.Windows.Forms; | ||
|
||
namespace OpenEphys.Onix1.Design | ||
{ | ||
internal class NeuropixelsV1eBno055Editor : 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) | ||
{ | ||
using var editorDialog = new NeuropixelsV1eBno055Dialog(configureBno055); | ||
|
||
if (editorDialog.ShowDialog() == DialogResult.OK) | ||
{ | ||
configureBno055.Enable = editorDialog.ConfigureNode.Enable; | ||
|
||
return true; | ||
} | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
OpenEphys.Onix1.Design/NeuropixelsV1eChannelConfigurationDialog.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.