11using System ;
2- using System . Collections . Generic ;
32using System . Drawing ;
43using System . Linq ;
54using System . Windows . Forms ;
@@ -17,24 +16,24 @@ public partial class NeuropixelsV2eChannelConfigurationDialog : ChannelConfigura
1716 internal event EventHandler OnFileLoad ;
1817
1918 /// <summary>
20- /// Public <see cref="NeuropixelsV2QuadShankProbeConfiguration "/> object that is manipulated by
19+ /// Public <see cref="NeuropixelsV2ProbeConfiguration "/> object that is manipulated by
2120 /// <see cref="NeuropixelsV2eChannelConfigurationDialog"/>.
2221 /// </summary>
23- public NeuropixelsV2QuadShankProbeConfiguration ProbeConfiguration ;
22+ public NeuropixelsV2ProbeConfiguration ProbeConfiguration ;
2423
2524 /// <summary>
2625 /// Initializes a new instance of <see cref="NeuropixelsV2eChannelConfigurationDialog"/>.
2726 /// </summary>
28- /// <param name="probeConfiguration">A <see cref="NeuropixelsV2QuadShankProbeConfiguration "/> object holding the current configuration settings.</param>
29- public NeuropixelsV2eChannelConfigurationDialog ( NeuropixelsV2QuadShankProbeConfiguration probeConfiguration )
27+ /// <param name="probeConfiguration">A <see cref="NeuropixelsV2ProbeConfiguration "/> object holding the current configuration settings.</param>
28+ public NeuropixelsV2eChannelConfigurationDialog ( NeuropixelsV2ProbeConfiguration probeConfiguration )
3029 : base ( probeConfiguration . ProbeGroup )
3130 {
3231 zedGraphChannels . ZoomButtons = MouseButtons . None ;
3332 zedGraphChannels . ZoomButtons2 = MouseButtons . None ;
3433
3534 zedGraphChannels . ZoomStepFraction = 0.5 ;
3635
37- ProbeConfiguration = probeConfiguration ;
36+ ProbeConfiguration = new ( probeConfiguration ) ;
3837
3938 ZoomInBoundaryX = 600 ;
4039 ZoomInBoundaryY = 600 ;
@@ -44,25 +43,21 @@ public NeuropixelsV2eChannelConfigurationDialog(NeuropixelsV2QuadShankProbeConfi
4443 RefreshZedGraph ( ) ;
4544 }
4645
47- internal override ProbeGroup DefaultChannelLayout ( )
46+ internal override void LoadDefaultChannelLayout ( )
4847 {
49- return new NeuropixelsV2eProbeGroup ( ) ;
48+ base . LoadDefaultChannelLayout ( ) ;
49+ OnFileOpenHandler ( ) ;
5050 }
5151
52- internal override void LoadDefaultChannelLayout ( )
52+ internal override ProbeGroup DefaultChannelLayout ( )
5353 {
54- ProbeConfiguration = new ( ProbeConfiguration . Probe , ProbeConfiguration . Reference ) ;
55- ProbeGroup = ProbeConfiguration . ProbeGroup ;
56-
57- OnFileOpenHandler ( ) ;
54+ return new NeuropixelsV2eProbeGroup ( ProbeConfiguration . ProbeType ) ;
5855 }
5956
6057 internal override bool OpenFile < T > ( )
6158 {
6259 if ( base . OpenFile < NeuropixelsV2eProbeGroup > ( ) )
6360 {
64- ProbeConfiguration = new ( ( NeuropixelsV2eProbeGroup ) ProbeGroup , ProbeConfiguration . Reference , ProbeConfiguration . Probe ) ;
65-
6661 OnFileOpenHandler ( ) ;
6762
6863 return true ;
@@ -173,7 +168,7 @@ internal override void DrawScale()
173168
174169 const float scaleBarWidth = 1 ;
175170
176- curve . Line . Width = scaleBarWidth ;
171+ curve . Line . Width = scaleBarWidth ;
177172 curve . Label . IsVisible = false ;
178173 curve . Symbol . IsVisible = false ;
179174 curve . Tag = ScalePointsTag ;
@@ -197,7 +192,7 @@ internal override void HighlightEnabledContacts()
197192 var contactsToEnable = contactObjects . Where ( c =>
198193 {
199194 var tag = c . Tag as ContactTag ;
200- var channel = NeuropixelsV2QuadShankElectrode . GetChannelNumber ( tag . ContactIndex ) ;
195+ var channel = NeuropixelsV2Electrode . GetChannelNumber ( tag . ContactIndex , ProbeConfiguration . ProbeType ) ;
201196 return ProbeConfiguration . ChannelMap [ channel ] . Index == tag . ContactIndex ;
202197 } ) ;
203198
@@ -227,7 +222,7 @@ internal override void UpdateContactLabels()
227222 textObjsToUpdate = textObjs . Where ( c =>
228223 {
229224 var tag = c . Tag as ContactTag ;
230- var channel = NeuropixelsV2QuadShankElectrode . GetChannelNumber ( tag . ContactIndex ) ;
225+ var channel = NeuropixelsV2Electrode . GetChannelNumber ( tag . ContactIndex , ProbeConfiguration . ProbeType ) ;
231226 return ProbeConfiguration . ChannelMap [ channel ] . Index == tag . ContactIndex ;
232227 } ) ;
233228
@@ -242,7 +237,7 @@ internal override string ContactString(int deviceChannelIndex, int index)
242237 return index . ToString ( ) ;
243238 }
244239
245- internal void EnableElectrodes ( NeuropixelsV2QuadShankElectrode [ ] electrodes )
240+ internal void EnableElectrodes ( NeuropixelsV2Electrode [ ] electrodes )
246241 {
247242 ProbeConfiguration . SelectElectrodes ( electrodes ) ;
248243 }
0 commit comments