@@ -15,24 +15,24 @@ public partial class NeuropixelsV2eChannelConfigurationDialog : ChannelConfigura
1515 internal event EventHandler OnFileLoad ;
1616
1717 /// <summary>
18- /// Public <see cref="NeuropixelsV2QuadShankProbeConfiguration "/> object that is manipulated by
18+ /// Public <see cref="NeuropixelsV2ProbeConfiguration "/> object that is manipulated by
1919 /// <see cref="NeuropixelsV2eChannelConfigurationDialog"/>.
2020 /// </summary>
21- public NeuropixelsV2QuadShankProbeConfiguration ProbeConfiguration ;
21+ public NeuropixelsV2ProbeConfiguration ProbeConfiguration ;
2222
2323 /// <summary>
2424 /// Initializes a new instance of <see cref="NeuropixelsV2eChannelConfigurationDialog"/>.
2525 /// </summary>
26- /// <param name="probeConfiguration">A <see cref="NeuropixelsV2QuadShankProbeConfiguration "/> object holding the current configuration settings.</param>
27- public NeuropixelsV2eChannelConfigurationDialog ( NeuropixelsV2QuadShankProbeConfiguration probeConfiguration )
26+ /// <param name="probeConfiguration">A <see cref="NeuropixelsV2ProbeConfiguration "/> object holding the current configuration settings.</param>
27+ public NeuropixelsV2eChannelConfigurationDialog ( NeuropixelsV2ProbeConfiguration probeConfiguration )
2828 : base ( probeConfiguration . ProbeGroup )
2929 {
3030 zedGraphChannels . ZoomButtons = MouseButtons . None ;
3131 zedGraphChannels . ZoomButtons2 = MouseButtons . None ;
3232
3333 zedGraphChannels . ZoomStepFraction = 0.5 ;
3434
35- ProbeConfiguration = probeConfiguration ;
35+ ProbeConfiguration = new ( probeConfiguration ) ;
3636
3737 HighlightEnabledContacts ( ) ;
3838 UpdateContactLabels ( ) ;
@@ -42,13 +42,16 @@ public NeuropixelsV2eChannelConfigurationDialog(NeuropixelsV2QuadShankProbeConfi
4242
4343 internal override ProbeGroup DefaultChannelLayout ( )
4444 {
45- return new NeuropixelsV2eProbeGroup ( ) ;
45+ return new NeuropixelsV2eProbeGroup ( ProbeConfiguration . ProbeType ) ;
4646 }
4747
4848 internal override void LoadDefaultChannelLayout ( )
4949 {
50- ProbeConfiguration = new ( ProbeConfiguration . Probe , ProbeConfiguration . Reference ) ;
51- ProbeGroup = ProbeConfiguration . ProbeGroup ;
50+ base . LoadDefaultChannelLayout ( ) ;
51+ ProbeConfiguration = new ( ( NeuropixelsV2eProbeGroup ) ProbeGroup ,
52+ ProbeConfiguration . Probe ,
53+ ProbeConfiguration . ProbeType ,
54+ ProbeConfiguration . Reference ) ;
5255
5356 OnFileOpenHandler ( ) ;
5457 }
@@ -57,8 +60,6 @@ internal override bool OpenFile<T>()
5760 {
5861 if ( base . OpenFile < NeuropixelsV2eProbeGroup > ( ) )
5962 {
60- ProbeConfiguration = new ( ( NeuropixelsV2eProbeGroup ) ProbeGroup , ProbeConfiguration . Reference , ProbeConfiguration . Probe ) ;
61-
6263 OnFileOpenHandler ( ) ;
6364
6465 return true ;
@@ -106,7 +107,7 @@ internal override void DrawScale()
106107
107108 internal override void HighlightEnabledContacts ( )
108109 {
109- if ( ProbeConfiguration == null || ProbeConfiguration . ChannelMap == null )
110+ if ( ProbeConfiguration == null )
110111 return ;
111112
112113 var contactObjects = zedGraphChannels . GraphPane . GraphObjList . OfType < BoxObj > ( )
@@ -119,11 +120,13 @@ internal override void HighlightEnabledContacts()
119120 contact . Fill . Color = DisabledContactFill ;
120121 }
121122
123+ var channelMap = ProbeConfiguration . ChannelMap ;
124+
122125 var contactsToEnable = contactObjects . Where ( c =>
123126 {
124127 var tag = c . Tag as ContactTag ;
125- var channel = NeuropixelsV2QuadShankElectrode . GetChannelNumber ( tag . ContactIndex ) ;
126- return ProbeConfiguration . ChannelMap [ channel ] . Index == tag . ContactIndex ;
128+ var channel = NeuropixelsV2Electrode . GetChannelNumber ( tag . ContactIndex , ProbeConfiguration . ProbeType ) ;
129+ return channelMap [ channel ] . Index == tag . ContactIndex ;
127130 } ) ;
128131
129132 foreach ( var contact in contactsToEnable )
@@ -149,11 +152,13 @@ internal override void UpdateContactLabels()
149152 textObj . FontSpec . FontColor = DisabledContactTextColor ;
150153 }
151154
155+ var channelMap = ProbeConfiguration . ChannelMap ;
156+
152157 textObjsToUpdate = textObjs . Where ( c =>
153158 {
154159 var tag = c . Tag as ContactTag ;
155- var channel = NeuropixelsV2QuadShankElectrode . GetChannelNumber ( tag . ContactIndex ) ;
156- return ProbeConfiguration . ChannelMap [ channel ] . Index == tag . ContactIndex ;
160+ var channel = NeuropixelsV2Electrode . GetChannelNumber ( tag . ContactIndex , ProbeConfiguration . ProbeType ) ;
161+ return channelMap [ channel ] . Index == tag . ContactIndex ;
157162 } ) ;
158163
159164 foreach ( var textObj in textObjsToUpdate )
@@ -167,7 +172,7 @@ internal override string ContactString(int deviceChannelIndex, int index)
167172 return index . ToString ( ) ;
168173 }
169174
170- internal void EnableElectrodes ( NeuropixelsV2QuadShankElectrode [ ] electrodes )
175+ internal void EnableElectrodes ( NeuropixelsV2Electrode [ ] electrodes )
171176 {
172177 ProbeConfiguration . SelectElectrodes ( electrodes ) ;
173178 }
0 commit comments