-
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.
- Made NeuropixelsV1 dialogs more generalized, so they can be shared between V1e and V1f - Added V1 Probe Configuration to match V2 to aid in modularity of dialogs
- Loading branch information
Showing
23 changed files
with
4,490 additions
and
279 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...V1eChannelConfigurationDialog.Designer.cs → ...sV1ChannelConfigurationDialog.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
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,89 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace OpenEphys.Onix1.Design | ||
{ | ||
/// <summary> | ||
/// Partial class to create a GUI for <see cref="ConfigureNeuropixelsV1e"/>. | ||
/// </summary> | ||
public partial class NeuropixelsV1Dialog : Form | ||
{ | ||
readonly NeuropixelsV1ProbeConfigurationDialog ProbeConfigurationDialog; | ||
|
||
/// <summary> | ||
/// Public <see cref="IConfigureNeuropixelsV1"/> interface that is manipulated by | ||
/// <see cref="NeuropixelsV1Dialog"/>. | ||
/// </summary> | ||
public IConfigureNeuropixelsV1 ConfigureNode { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="NeuropixelsV1Dialog"/>. | ||
/// </summary> | ||
/// <param name="configureNode">A <see cref="ConfigureNeuropixelsV1e"/> object holding the current configuration settings.</param> | ||
public NeuropixelsV1Dialog(IConfigureNeuropixelsV1 configureNode) | ||
{ | ||
InitializeComponent(); | ||
Shown += FormShown; | ||
|
||
if (configureNode is ConfigureNeuropixelsV1e configureV1e) | ||
{ | ||
ConfigureNode = new ConfigureNeuropixelsV1e(configureV1e); | ||
} | ||
else if (configureNode is ConfigureNeuropixelsV1f configureV1f) | ||
{ | ||
ConfigureNode = new ConfigureNeuropixelsV1f(configureV1f); | ||
Text += ": " + GetProbeName(configureV1f.ProbeName); | ||
} | ||
|
||
ProbeConfigurationDialog = new(ConfigureNode.ProbeConfiguration, ConfigureNode.AdcCalibrationFile, ConfigureNode.GainCalibrationFile) | ||
{ | ||
TopLevel = false, | ||
FormBorderStyle = FormBorderStyle.None, | ||
Dock = DockStyle.Fill, | ||
Parent = this | ||
}; | ||
|
||
panelProbe.Controls.Add(ProbeConfigurationDialog); | ||
|
||
this.AddMenuItemsFromDialogToFileOption(ProbeConfigurationDialog); | ||
} | ||
|
||
private string GetProbeName(NeuropixelsV1Probe probe) | ||
{ | ||
return probe switch | ||
{ | ||
NeuropixelsV1Probe.ProbeA => "Probe A", | ||
NeuropixelsV1Probe.ProbeB => "Probe B", | ||
_ => "Invalid probe was specified." | ||
}; | ||
} | ||
|
||
private void FormShown(object sender, EventArgs e) | ||
{ | ||
if (!TopLevel) | ||
{ | ||
tableLayoutPanel1.Controls.Remove(flowLayoutPanel1); | ||
tableLayoutPanel1.RowCount = 1; | ||
|
||
menuStrip.Visible = false; | ||
} | ||
|
||
ProbeConfigurationDialog.Show(); | ||
} | ||
|
||
internal void Okay_Click(object sender, EventArgs e) | ||
{ | ||
SaveVariables(); | ||
|
||
DialogResult = DialogResult.OK; | ||
} | ||
|
||
internal void SaveVariables() | ||
{ | ||
ConfigureNode.ProbeConfiguration = ProbeConfigurationDialog.ProbeConfiguration; | ||
|
||
ConfigureNode.GainCalibrationFile = ProbeConfigurationDialog.textBoxGainCalibrationFile.Text; | ||
ConfigureNode.AdcCalibrationFile = ProbeConfigurationDialog.textBoxAdcCalibrationFile.Text; | ||
} | ||
} | ||
} |
Oops, something went wrong.