@@ -26,45 +26,36 @@ private enum ChannelPreset
2626 }
2727
2828 /// <summary>
29- /// Public <see cref="IConfigureNeuropixelsV2"/> interface that is manipulated by
30- /// <see cref="NeuropixelsV2eDialog"/>.
29+ /// Gets or sets the probe configuration.
3130 /// </summary>
32- /// <remarks>
33- /// When a <see cref="IConfigureNeuropixelsV2"/> is passed to
34- /// <see cref="NeuropixelsV1Dialog"/>, it is copied and stored in this
35- /// variable so that any modifications made to configuration settings can be easily reversed
36- /// by not copying the new settings back to the original instance.
37- /// </remarks>
38- public NeuropixelsV1ProbeConfiguration ProbeConfiguration { get ; set ; }
31+ public NeuropixelsV1ProbeConfiguration ProbeConfiguration
32+ {
33+ get => ChannelConfiguration . ProbeConfiguration ;
34+ set => ChannelConfiguration . ProbeConfiguration = value ;
35+ }
3936
40- /// <inheritdoc cref="ConfigureNeuropixelsV1e.InvertPolarity"/>
41- public bool InvertPolarity { get ; set ; }
37+ /// <inheritdoc cref="NeuropixelsV1ProbeConfiguration.InvertPolarity"/>
38+ [ Obsolete ]
39+ public bool InvertPolarity
40+ {
41+ get => ProbeConfiguration . InvertPolarity ;
42+ set => ProbeConfiguration . InvertPolarity = value ;
43+ }
4244
4345 /// <summary>
4446 /// Initializes a new instance of <see cref="NeuropixelsV1Dialog"/>.
4547 /// </summary>
4648 /// <param name="probeConfiguration">A <see cref="NeuropixelsV1ProbeConfiguration"/> object holding the current configuration settings.</param>
47- /// <param name="adcCalibrationFile">String defining the path to the ADC calibration file.</param>
48- /// <param name="gainCalibrationFile">String defining the path to the gain calibration file.</param>
49- /// <param name="invertPolarity">Boolean denoting whether or not to invert the polarity of neural data.</param>
50- public NeuropixelsV1ProbeConfigurationDialog ( NeuropixelsV1ProbeConfiguration probeConfiguration , string adcCalibrationFile , string gainCalibrationFile , bool invertPolarity )
49+ public NeuropixelsV1ProbeConfigurationDialog ( NeuropixelsV1ProbeConfiguration probeConfiguration )
5150 {
5251 InitializeComponent ( ) ;
5352 Shown += FormShown ;
5453
55- ProbeConfiguration = new ( probeConfiguration ) ;
56-
57- ChannelConfiguration = new ( ProbeConfiguration )
58- {
59- TopLevel = false ,
60- FormBorderStyle = FormBorderStyle . None ,
61- Dock = DockStyle . Fill ,
62- Parent = this ,
63- } ;
64-
65- InvertPolarity = invertPolarity ;
54+ ChannelConfiguration = new ( probeConfiguration ) ;
55+ ChannelConfiguration
56+ . SetChildFormProperties ( this )
57+ . AddDialogToPanel ( panelProbe ) ;
6658
67- panelProbe . Controls . Add ( ChannelConfiguration ) ;
6859 this . AddMenuItemsFromDialogToFileOption ( ChannelConfiguration ) ;
6960
7061 ChannelConfiguration . OnZoom += UpdateTrackBarLocation ;
@@ -85,12 +76,14 @@ public NeuropixelsV1ProbeConfigurationDialog(NeuropixelsV1ProbeConfiguration pro
8576 checkBoxSpikeFilter . Checked = ProbeConfiguration . SpikeFilter ;
8677 checkBoxSpikeFilter . CheckedChanged += SpikeFilterIndexChanged ;
8778
88- checkBoxInvertPolarity . Checked = InvertPolarity ;
79+ checkBoxInvertPolarity . Checked = ProbeConfiguration . InvertPolarity ;
8980 checkBoxInvertPolarity . CheckedChanged += InvertPolarityIndexChanged ;
9081
91- textBoxAdcCalibrationFile . Text = adcCalibrationFile ;
82+ textBoxAdcCalibrationFile . Text = ProbeConfiguration . AdcCalibrationFileName ;
83+ textBoxAdcCalibrationFile . TextChanged += ( sender , e ) => ProbeConfiguration . AdcCalibrationFileName = ( ( TextBox ) sender ) . Text ;
9284
93- textBoxGainCalibrationFile . Text = gainCalibrationFile ;
85+ textBoxGainCalibrationFile . Text = ProbeConfiguration . GainCalibrationFileName ;
86+ textBoxGainCalibrationFile . TextChanged += ( sender , e ) => ProbeConfiguration . GainCalibrationFileName = ( ( TextBox ) sender ) . Text ;
9487
9588 comboBoxChannelPresets . DataSource = Enum . GetValues ( typeof ( ChannelPreset ) ) ;
9689 CheckForExistingChannelPreset ( ) ;
@@ -101,7 +94,7 @@ public NeuropixelsV1ProbeConfigurationDialog(NeuropixelsV1ProbeConfiguration pro
10194
10295 private void InvertPolarityIndexChanged ( object sender , EventArgs e )
10396 {
104- InvertPolarity = ( ( CheckBox ) sender ) . Checked ;
97+ ProbeConfiguration . InvertPolarity = ( ( CheckBox ) sender ) . Checked ;
10598 }
10699
107100 private void FormShown ( object sender , EventArgs e )
0 commit comments