Skip to content
Open
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
99 changes: 69 additions & 30 deletions OpenEphys.Onix1.Design/GenericStimulusSequenceDialog.Designer.cs

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

26 changes: 21 additions & 5 deletions OpenEphys.Onix1.Design/GenericStimulusSequenceDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ namespace OpenEphys.Onix1.Design
/// </summary>
public partial class GenericStimulusSequenceDialog : Form
{
internal object Device
{
get => propertyGrid.SelectedObject;
set => propertyGrid.SelectedObject = value;
}

readonly int NumberOfChannels;
readonly bool UseProbeGroup;
readonly bool UseTable;
Expand All @@ -29,23 +35,26 @@ public partial class GenericStimulusSequenceDialog : Form
}

/// <summary>
/// Opens a dialog allowing for easy changing of stimulus sequence parameters, with visual feedback on what the resulting stimulus sequence looks like.
/// Opens a dialog allowing for easy changing of stimulus sequence parameters,
/// with visual feedback on what the resulting stimulus sequence looks like.
/// </summary>
public GenericStimulusSequenceDialog(int numberOfChannels, bool useProbeGroup, bool useTable = false)
public GenericStimulusSequenceDialog(object device, int numberOfChannels, bool useProbeGroup, bool useTable = false)
{
InitializeComponent();
Shown += FormShown;

Device = device;

NumberOfChannels = numberOfChannels;
UseProbeGroup = useProbeGroup;
UseTable = useTable;

if (!UseProbeGroup)
{
tableLayoutPanel1.Controls.Remove(panelProbe);
GroupBox gb = tableLayoutPanel1.Controls[nameof(groupBoxDefineStimuli)] as GroupBox;
tableLayoutPanel1.SetRow(gb, 0);
tableLayoutPanel1.SetRowSpan(gb, 2);
var control = tableLayoutPanel1.Controls[nameof(tabControlProperties)] as TabControl;
tableLayoutPanel1.SetRow(control, 0);
tableLayoutPanel1.SetRowSpan(control, 3);
}

if (!UseTable)
Expand Down Expand Up @@ -524,5 +533,12 @@ void ResetZoom()
zedGraphWaveform.Refresh();
}

void PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
var propertyGrid = (PropertyGrid)s;
UpdateControls(propertyGrid.SelectedObject);
}

internal virtual void UpdateControls(object obj) { throw new NotImplementedException(); }
}
}
4 changes: 2 additions & 2 deletions OpenEphys.Onix1.Design/Headstage64Dialog.Designer.cs

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

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public Headstage64ElectricalStimulatorOptions()
/// <param name="electricalStimulator"></param>
public Headstage64ElectricalStimulatorOptions(ConfigureHeadstage64ElectricalStimulator electricalStimulator)
: this()
{
UpdateControls(electricalStimulator);
}

internal void UpdateControls(ConfigureHeadstage64ElectricalStimulator electricalStimulator)
{
textBoxPhaseOneCurrent.Text = electricalStimulator.PhaseOneCurrent.ToString();
textBoxPhaseOneDuration.Text = electricalStimulator.PhaseOneDuration.ToString();
Expand Down
Loading