Skip to content

Commit 43aab8b

Browse files
committed
Update look and feel based on work in main
- Ensure reference contacts are correctly highlighted - Update adc/gain calibration file parsing - Fix anchors for controls to allow resizing more fluidly - Add icons to dialogs - Add zoom in boundary - Reduce scale bar thickness - Fix splitter panel distance
1 parent ae66daf commit 43aab8b

11 files changed

+3550
-190
lines changed

OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,34 @@ internal virtual void HighlightEnabledContacts()
632632

633633
foreach (var contact in contactsToEnable)
634634
{
635-
var tag = (ContactTag)contact.Tag;
635+
contact.Fill.Color = EnabledContactFill;
636+
}
637+
}
638+
639+
HighlightReferenceContacts();
640+
}
641+
642+
internal void HighlightReferenceContacts()
643+
{
644+
if (ChannelConfiguration == null)
645+
return;
636646

637-
contact.Fill.Color = ReferenceContacts.Any(x => x == tag.ContactIndex) ? ReferenceContactFill : EnabledContactFill;
647+
var contactObjects = zedGraphChannels.GraphPane.GraphObjList.OfType<BoxObj>()
648+
.Where(c => c is not PolyObj);
649+
650+
var referenceContacts = contactObjects.Where(c =>
651+
{
652+
if (c.Tag is ContactTag tag)
653+
{
654+
return ReferenceContacts.Any(r => tag.ContactIndex == r);
638655
}
656+
657+
return false;
658+
});
659+
660+
foreach (var contact in referenceContacts)
661+
{
662+
contact.Fill.Color = ReferenceContactFill;
639663
}
640664
}
641665

OpenEphys.Onix1.Design/NeuropixelsV1eChannelConfigurationDialog.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public partial class NeuropixelsV1eChannelConfigurationDialog : ChannelConfigura
3131
public NeuropixelsV1eChannelConfigurationDialog(NeuropixelsV1eProbeConfiguration probeConfiguration)
3232
: base(probeConfiguration.ChannelConfiguration)
3333
{
34-
zedGraphChannels.IsEnableHPan = false;
3534
zedGraphChannels.ZoomButtons = MouseButtons.None;
3635
zedGraphChannels.ZoomButtons2 = MouseButtons.None;
3736

@@ -41,6 +40,9 @@ public NeuropixelsV1eChannelConfigurationDialog(NeuropixelsV1eProbeConfiguration
4140

4241
ProbeConfiguration = probeConfiguration;
4342

43+
ZoomInBoundaryX = 400;
44+
ZoomInBoundaryY = 400;
45+
4446
HighlightEnabledContacts();
4547
UpdateContactLabels();
4648
DrawScale();
@@ -166,7 +168,9 @@ internal override void DrawScale()
166168

167169
var curve = zedGraphChannels.GraphPane.AddCurve(ScalePointsTag, pointList, Color.Black, SymbolType.None);
168170

169-
curve.Line.Width = zoomedOut ? 2 : 4;
171+
const float scaleBarWidth = 1;
172+
173+
curve.Line.Width = scaleBarWidth;
170174
curve.Label.IsVisible = false;
171175
curve.Symbol.IsVisible = false;
172176
}
@@ -195,10 +199,10 @@ internal override void HighlightEnabledContacts()
195199

196200
foreach (var contact in contactsToEnable)
197201
{
198-
var tag = (ContactTag)contact.Tag;
199-
200-
contact.Fill.Color = ReferenceContacts.Any(x => x == tag.ContactIndex) ? ReferenceContactFill : EnabledContactFill;
202+
contact.Fill.Color = EnabledContactFill;
201203
}
204+
205+
HighlightReferenceContacts();
202206
}
203207

204208
internal override void UpdateContactLabels()

OpenEphys.Onix1.Design/NeuropixelsV1eDialog.Designer.cs

Lines changed: 114 additions & 117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenEphys.Onix1.Design/NeuropixelsV1eDialog.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ private void ParseAdcCalibrationFile()
142142
{
143143
StreamReader adcFile = new(ConfigureNode.AdcCalibrationFile);
144144

145-
adcCalibrationSN.Text = ulong.Parse(adcFile.ReadLine()).ToString();
145+
var adcCalibration = NeuropixelsV1Helper.ParseAdcCalibrationFile(adcFile);
146146

147-
Adcs = NeuropixelsV1Helper.ParseAdcCalibrationFile(adcFile);
147+
adcCalibrationSN.Text = adcCalibration.SN.ToString();
148+
Adcs = adcCalibration.Adcs;
148149

149150
dataGridViewAdcs.DataSource = Adcs;
150151

@@ -161,10 +162,9 @@ private void ParseGainCalibrationFile()
161162
{
162163
StreamReader gainCalibrationFile = new(ConfigureNode.GainCalibrationFile);
163164

164-
gainCalibrationSN.Text = ulong.Parse(gainCalibrationFile.ReadLine()).ToString();
165-
166165
var gainCorrection = NeuropixelsV1Helper.ParseGainCalibrationFile(gainCalibrationFile, ConfigureNode.ProbeConfiguration.SpikeAmplifierGain, ConfigureNode.ProbeConfiguration.LfpAmplifierGain);
167166

167+
gainCalibrationSN.Text = gainCorrection.SN.ToString();
168168
ApGainCorrection = gainCorrection.AP;
169169
LfpGainCorrection = gainCorrection.LFP;
170170

@@ -359,16 +359,6 @@ private void ButtonClick(object sender, EventArgs e)
359359
textBoxGainCalibrationFile.Text = ofd.FileName;
360360
}
361361
}
362-
else if (button.Name == nameof(buttonClearGainCalibrationFile))
363-
{
364-
textBoxGainCalibrationFile.Text = "";
365-
ApGainCorrection = default;
366-
LfpGainCorrection = default;
367-
368-
panelProbe.Visible = false;
369-
370-
CheckStatus();
371-
}
372362
else if (button.Name == nameof(buttonChooseAdcCalibrationFile))
373363
{
374364
var ofd = new OpenFileDialog()
@@ -383,14 +373,6 @@ private void ButtonClick(object sender, EventArgs e)
383373
textBoxAdcCalibrationFile.Text = ofd.FileName;
384374
}
385375
}
386-
else if (button.Name == nameof(buttonClearAdcCalibrationFile))
387-
{
388-
textBoxAdcCalibrationFile.Text = "";
389-
Adcs = null;
390-
dataGridViewAdcs.DataSource = null;
391-
392-
CheckStatus();
393-
}
394376
else if (button.Name == nameof(buttonResetZoom))
395377
{
396378
ResetZoom();

0 commit comments

Comments
 (0)