From 6677a31f91e385ce3e3285dbbc145f05bba950ff Mon Sep 17 00:00:00 2001 From: bparks13 Date: Fri, 12 Sep 2025 11:46:47 -0400 Subject: [PATCH 1/4] Update probe configuration dialogs - Add a column to separate the track bar for the channel configuration dialog --- ...xelsV1ProbeConfigurationDialog.Designer.cs | 88 ++++---- ...elsV2eProbeConfigurationDialog.Designer.cs | 202 +++++++++--------- 2 files changed, 142 insertions(+), 148 deletions(-) diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs index ea2bf3e9..2c3ddd34 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs @@ -89,7 +89,6 @@ private void InitializeComponent() this.statusStrip1.SuspendLayout(); this.menuStrip.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); - this.panelProbe.SuspendLayout(); this.panelTrackBar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBarProbePosition)).BeginInit(); this.panelOptions.SuspendLayout(); @@ -100,7 +99,7 @@ private void InitializeComponent() // label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); label1.AutoSize = true; - label1.Location = new System.Drawing.Point(19, 671); + label1.Location = new System.Drawing.Point(8, 647); label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label1.Name = "label1"; label1.Size = new System.Drawing.Size(39, 16); @@ -111,7 +110,7 @@ private void InitializeComponent() // label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); label3.AutoSize = true; - label3.Location = new System.Drawing.Point(15, 0); + label3.Location = new System.Drawing.Point(4, 0); label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label3.Name = "label3"; label3.Size = new System.Drawing.Size(46, 16); @@ -236,10 +235,10 @@ private void InitializeComponent() this.toolStripAdcCalSN, this.toolStripLabelGainCalibrationSn, this.toolStripGainCalSN}); - this.statusStrip1.Location = new System.Drawing.Point(0, 771); + this.statusStrip1.Location = new System.Drawing.Point(0, 736); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0); - this.statusStrip1.Size = new System.Drawing.Size(1320, 25); + this.statusStrip1.Size = new System.Drawing.Size(1234, 25); this.statusStrip1.TabIndex = 35; this.statusStrip1.Text = "statusStrip1"; // @@ -265,7 +264,7 @@ private void InitializeComponent() this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; this.menuStrip.Padding = new System.Windows.Forms.Padding(5, 1, 0, 1); - this.menuStrip.Size = new System.Drawing.Size(1320, 24); + this.menuStrip.Size = new System.Drawing.Size(1234, 24); this.menuStrip.TabIndex = 36; this.menuStrip.Text = "menuStrip1"; // @@ -277,43 +276,44 @@ private void InitializeComponent() // // tableLayoutPanel1 // - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel1.ColumnCount = 3; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 315F)); + this.tableLayoutPanel1.Controls.Add(this.panelTrackBar, 1, 0); this.tableLayoutPanel1.Controls.Add(this.panelProbe, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.panelOptions, 1, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panelOptions, 2, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1320, 747); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1234, 712); this.tableLayoutPanel1.TabIndex = 37; // // panelProbe // this.panelProbe.BackColor = System.Drawing.SystemColors.Control; - this.panelProbe.Controls.Add(this.panelTrackBar); this.panelProbe.Dock = System.Windows.Forms.DockStyle.Fill; this.panelProbe.Location = new System.Drawing.Point(4, 4); - this.panelProbe.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.panelProbe.Margin = new System.Windows.Forms.Padding(4); this.panelProbe.Name = "panelProbe"; - this.panelProbe.Size = new System.Drawing.Size(982, 697); + this.panelProbe.Size = new System.Drawing.Size(851, 662); this.panelProbe.TabIndex = 0; // // panelTrackBar // - this.panelTrackBar.Anchor = System.Windows.Forms.AnchorStyles.Right; this.panelTrackBar.Controls.Add(label1); this.panelTrackBar.Controls.Add(label3); this.panelTrackBar.Controls.Add(this.trackBarProbePosition); - this.panelTrackBar.Location = new System.Drawing.Point(917, 5); - this.panelTrackBar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.panelTrackBar.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelTrackBar.Location = new System.Drawing.Point(863, 4); + this.panelTrackBar.Margin = new System.Windows.Forms.Padding(4); this.panelTrackBar.Name = "panelTrackBar"; - this.panelTrackBar.Size = new System.Drawing.Size(61, 686); + this.panelTrackBar.Size = new System.Drawing.Size(52, 662); this.panelTrackBar.TabIndex = 33; // // trackBarProbePosition @@ -321,13 +321,14 @@ private void InitializeComponent() this.trackBarProbePosition.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.trackBarProbePosition.AutoSize = false; this.trackBarProbePosition.BackColor = System.Drawing.SystemColors.Control; - this.trackBarProbePosition.Location = new System.Drawing.Point(4, 9); + this.trackBarProbePosition.Location = new System.Drawing.Point(9, 9); this.trackBarProbePosition.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.trackBarProbePosition.Maximum = 100; this.trackBarProbePosition.Name = "trackBarProbePosition"; this.trackBarProbePosition.Orientation = System.Windows.Forms.Orientation.Vertical; - this.trackBarProbePosition.Size = new System.Drawing.Size(45, 670); + this.trackBarProbePosition.Size = new System.Drawing.Size(36, 645); this.trackBarProbePosition.TabIndex = 30; this.trackBarProbePosition.TickFrequency = 2; this.trackBarProbePosition.TickStyle = System.Windows.Forms.TickStyle.TopLeft; @@ -364,10 +365,10 @@ private void InitializeComponent() this.panelOptions.Controls.Add(this.comboBoxApGain); this.panelOptions.Controls.Add(apGain); this.panelOptions.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelOptions.Location = new System.Drawing.Point(993, 2); + this.panelOptions.Location = new System.Drawing.Point(922, 2); this.panelOptions.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelOptions.Name = "panelOptions"; - this.panelOptions.Size = new System.Drawing.Size(324, 701); + this.panelOptions.Size = new System.Drawing.Size(309, 666); this.panelOptions.TabIndex = 2; // // checkBoxInvertPolarity @@ -389,7 +390,7 @@ private void InitializeComponent() this.textBoxLfpCorrection.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBoxLfpCorrection.Name = "textBoxLfpCorrection"; this.textBoxLfpCorrection.ReadOnly = true; - this.textBoxLfpCorrection.Size = new System.Drawing.Size(210, 22); + this.textBoxLfpCorrection.Size = new System.Drawing.Size(195, 22); this.textBoxLfpCorrection.TabIndex = 41; // // textBoxApCorrection @@ -400,7 +401,7 @@ private void InitializeComponent() this.textBoxApCorrection.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBoxApCorrection.Name = "textBoxApCorrection"; this.textBoxApCorrection.ReadOnly = true; - this.textBoxApCorrection.Size = new System.Drawing.Size(210, 22); + this.textBoxApCorrection.Size = new System.Drawing.Size(195, 22); this.textBoxApCorrection.TabIndex = 39; // // buttonViewAdcs @@ -411,7 +412,7 @@ private void InitializeComponent() this.buttonViewAdcs.Location = new System.Drawing.Point(13, 66); this.buttonViewAdcs.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonViewAdcs.Name = "buttonViewAdcs"; - this.buttonViewAdcs.Size = new System.Drawing.Size(299, 38); + this.buttonViewAdcs.Size = new System.Drawing.Size(284, 38); this.buttonViewAdcs.TabIndex = 37; this.buttonViewAdcs.Text = "View ADC Correction Values"; this.buttonViewAdcs.UseVisualStyleBackColor = true; @@ -420,7 +421,7 @@ private void InitializeComponent() // buttonChooseAdcCalibrationFile // this.buttonChooseAdcCalibrationFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonChooseAdcCalibrationFile.Location = new System.Drawing.Point(275, 30); + this.buttonChooseAdcCalibrationFile.Location = new System.Drawing.Point(260, 30); this.buttonChooseAdcCalibrationFile.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonChooseAdcCalibrationFile.Name = "buttonChooseAdcCalibrationFile"; this.buttonChooseAdcCalibrationFile.Size = new System.Drawing.Size(37, 25); @@ -432,7 +433,7 @@ private void InitializeComponent() // buttonChooseGainCalibrationFile // this.buttonChooseGainCalibrationFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonChooseGainCalibrationFile.Location = new System.Drawing.Point(275, 133); + this.buttonChooseGainCalibrationFile.Location = new System.Drawing.Point(260, 133); this.buttonChooseGainCalibrationFile.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonChooseGainCalibrationFile.Name = "buttonChooseGainCalibrationFile"; this.buttonChooseGainCalibrationFile.Size = new System.Drawing.Size(37, 25); @@ -448,7 +449,7 @@ private void InitializeComponent() this.buttonEnableContacts.Location = new System.Drawing.Point(13, 464); this.buttonEnableContacts.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonEnableContacts.Name = "buttonEnableContacts"; - this.buttonEnableContacts.Size = new System.Drawing.Size(299, 44); + this.buttonEnableContacts.Size = new System.Drawing.Size(284, 44); this.buttonEnableContacts.TabIndex = 28; this.buttonEnableContacts.Text = "Enable Selected Electrodes"; this.buttonEnableContacts.UseVisualStyleBackColor = true; @@ -461,7 +462,7 @@ private void InitializeComponent() this.buttonClearSelections.Location = new System.Drawing.Point(13, 512); this.buttonClearSelections.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonClearSelections.Name = "buttonClearSelections"; - this.buttonClearSelections.Size = new System.Drawing.Size(299, 44); + this.buttonClearSelections.Size = new System.Drawing.Size(284, 44); this.buttonClearSelections.TabIndex = 27; this.buttonClearSelections.Text = "Clear Electrode Selection"; this.buttonClearSelections.UseVisualStyleBackColor = true; @@ -476,7 +477,7 @@ private void InitializeComponent() this.comboBoxChannelPresets.Location = new System.Drawing.Point(101, 411); this.comboBoxChannelPresets.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.comboBoxChannelPresets.Name = "comboBoxChannelPresets"; - this.comboBoxChannelPresets.Size = new System.Drawing.Size(210, 24); + this.comboBoxChannelPresets.Size = new System.Drawing.Size(195, 24); this.comboBoxChannelPresets.TabIndex = 26; // // buttonResetZoom @@ -486,7 +487,7 @@ private void InitializeComponent() this.buttonResetZoom.Location = new System.Drawing.Point(13, 562); this.buttonResetZoom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonResetZoom.Name = "buttonResetZoom"; - this.buttonResetZoom.Size = new System.Drawing.Size(299, 44); + this.buttonResetZoom.Size = new System.Drawing.Size(284, 44); this.buttonResetZoom.TabIndex = 22; this.buttonResetZoom.Text = "Reset Zoom"; this.buttonResetZoom.UseVisualStyleBackColor = true; @@ -510,7 +511,7 @@ private void InitializeComponent() this.textBoxAdcCalibrationFile.Location = new System.Drawing.Point(13, 30); this.textBoxAdcCalibrationFile.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBoxAdcCalibrationFile.Name = "textBoxAdcCalibrationFile"; - this.textBoxAdcCalibrationFile.Size = new System.Drawing.Size(255, 22); + this.textBoxAdcCalibrationFile.Size = new System.Drawing.Size(240, 22); this.textBoxAdcCalibrationFile.TabIndex = 12; this.textBoxAdcCalibrationFile.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.textBoxAdcCalibrationFile.TextChanged += new System.EventHandler(this.AdcCalibrationFileTextChanged); @@ -522,7 +523,7 @@ private void InitializeComponent() this.textBoxGainCalibrationFile.Location = new System.Drawing.Point(13, 133); this.textBoxGainCalibrationFile.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBoxGainCalibrationFile.Name = "textBoxGainCalibrationFile"; - this.textBoxGainCalibrationFile.Size = new System.Drawing.Size(255, 22); + this.textBoxGainCalibrationFile.Size = new System.Drawing.Size(240, 22); this.textBoxGainCalibrationFile.TabIndex = 9; this.textBoxGainCalibrationFile.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.textBoxGainCalibrationFile.TextChanged += new System.EventHandler(this.GainCalibrationFileTextChanged); @@ -536,7 +537,7 @@ private void InitializeComponent() this.comboBoxReference.Location = new System.Drawing.Point(101, 373); this.comboBoxReference.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.comboBoxReference.Name = "comboBoxReference"; - this.comboBoxReference.Size = new System.Drawing.Size(210, 24); + this.comboBoxReference.Size = new System.Drawing.Size(195, 24); this.comboBoxReference.TabIndex = 5; // // comboBoxLfpGain @@ -548,7 +549,7 @@ private void InitializeComponent() this.comboBoxLfpGain.Location = new System.Drawing.Point(101, 240); this.comboBoxLfpGain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.comboBoxLfpGain.Name = "comboBoxLfpGain"; - this.comboBoxLfpGain.Size = new System.Drawing.Size(210, 24); + this.comboBoxLfpGain.Size = new System.Drawing.Size(195, 24); this.comboBoxLfpGain.TabIndex = 3; // // comboBoxApGain @@ -560,26 +561,26 @@ private void InitializeComponent() this.comboBoxApGain.Location = new System.Drawing.Point(101, 174); this.comboBoxApGain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.comboBoxApGain.Name = "comboBoxApGain"; - this.comboBoxApGain.Size = new System.Drawing.Size(210, 24); + this.comboBoxApGain.Size = new System.Drawing.Size(195, 24); this.comboBoxApGain.TabIndex = 1; // // flowLayoutPanel1 // - this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2); + this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 3); this.flowLayoutPanel1.Controls.Add(this.buttonCancel); this.flowLayoutPanel1.Controls.Add(this.buttonOkay); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 707); + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 672); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1314, 38); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1228, 38); this.flowLayoutPanel1.TabIndex = 0; // // buttonCancel // this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(1200, 2); + this.buttonCancel.Location = new System.Drawing.Point(1114, 2); this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(111, 34); @@ -590,7 +591,7 @@ private void InitializeComponent() // buttonOkay // this.buttonOkay.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOkay.Location = new System.Drawing.Point(1083, 2); + this.buttonOkay.Location = new System.Drawing.Point(997, 2); this.buttonOkay.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonOkay.Name = "buttonOkay"; this.buttonOkay.Size = new System.Drawing.Size(111, 34); @@ -602,7 +603,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1320, 796); + this.ClientSize = new System.Drawing.Size(1234, 761); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.menuStrip); this.Controls.Add(this.statusStrip1); @@ -616,7 +617,6 @@ private void InitializeComponent() this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); - this.panelProbe.ResumeLayout(false); this.panelTrackBar.ResumeLayout(false); this.panelTrackBar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBarProbePosition)).EndInit(); diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs index 74206336..e6275f57 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs @@ -49,6 +49,7 @@ private void InitializeComponent() this.panelTrackBar = new System.Windows.Forms.Panel(); this.trackBarProbePosition = new System.Windows.Forms.TrackBar(); this.panelChannelOptions = new System.Windows.Forms.Panel(); + this.checkBoxInvertPolarity = new System.Windows.Forms.CheckBox(); this.textBoxGainCorrection = new System.Windows.Forms.TextBox(); this.textBoxProbeCalibrationFile = new System.Windows.Forms.TextBox(); this.comboBoxReference = new System.Windows.Forms.ComboBox(); @@ -59,7 +60,6 @@ private void InitializeComponent() this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripGainCalSN = new System.Windows.Forms.ToolStripStatusLabel(); - this.checkBoxInvertPolarity = new System.Windows.Forms.CheckBox(); label6 = new System.Windows.Forms.Label(); label7 = new System.Windows.Forms.Label(); probeCalibrationFile = new System.Windows.Forms.Label(); @@ -68,7 +68,6 @@ private void InitializeComponent() label1 = new System.Windows.Forms.Label(); invertPolarity = new System.Windows.Forms.Label(); this.menuStrip.SuspendLayout(); - this.panelProbe.SuspendLayout(); this.panelTrackBar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBarProbePosition)).BeginInit(); this.panelChannelOptions.SuspendLayout(); @@ -81,10 +80,9 @@ private void InitializeComponent() // label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); label6.AutoSize = true; - label6.Location = new System.Drawing.Point(0, 440); - label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + label6.Location = new System.Drawing.Point(3, 641); label6.Name = "label6"; - label6.Size = new System.Drawing.Size(32, 13); + label6.Size = new System.Drawing.Size(39, 16); label6.TabIndex = 28; label6.Text = "0 mm"; // @@ -92,10 +90,9 @@ private void InitializeComponent() // label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); label7.AutoSize = true; - label7.Location = new System.Drawing.Point(0, 0); - label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + label7.Location = new System.Drawing.Point(3, 0); label7.Name = "label7"; - label7.Size = new System.Drawing.Size(38, 13); + label7.Size = new System.Drawing.Size(46, 16); label7.TabIndex = 29; label7.Text = "10 mm"; label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -103,44 +100,49 @@ private void InitializeComponent() // probeCalibrationFile // probeCalibrationFile.AutoSize = true; - probeCalibrationFile.Location = new System.Drawing.Point(11, 9); - probeCalibrationFile.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - probeCalibrationFile.MaximumSize = new System.Drawing.Size(133, 29); + probeCalibrationFile.Location = new System.Drawing.Point(15, 11); + probeCalibrationFile.MaximumSize = new System.Drawing.Size(177, 36); probeCalibrationFile.Name = "probeCalibrationFile"; - probeCalibrationFile.Size = new System.Drawing.Size(109, 13); + probeCalibrationFile.Size = new System.Drawing.Size(139, 16); probeCalibrationFile.TabIndex = 32; probeCalibrationFile.Text = "Probe Calibration File:"; // // Reference // Reference.AutoSize = true; - Reference.Location = new System.Drawing.Point(11, 93); - Reference.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + Reference.Location = new System.Drawing.Point(15, 114); Reference.Name = "Reference"; - Reference.Size = new System.Drawing.Size(60, 13); + Reference.Size = new System.Drawing.Size(73, 16); Reference.TabIndex = 30; Reference.Text = "Reference:"; // // labelPresets // labelPresets.AutoSize = true; - labelPresets.Location = new System.Drawing.Point(11, 119); - labelPresets.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + labelPresets.Location = new System.Drawing.Point(15, 146); labelPresets.Name = "labelPresets"; - labelPresets.Size = new System.Drawing.Size(49, 26); + labelPresets.Size = new System.Drawing.Size(59, 32); labelPresets.TabIndex = 23; labelPresets.Text = "Channel \nPresets:"; // // label1 // label1.AutoSize = true; - label1.Location = new System.Drawing.Point(11, 51); - label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + label1.Location = new System.Drawing.Point(15, 63); label1.Name = "label1"; - label1.Size = new System.Drawing.Size(58, 26); + label1.Size = new System.Drawing.Size(71, 32); label1.TabIndex = 35; label1.Text = "Gain\r\nCorrection:"; // + // invertPolarity + // + invertPolarity.AutoSize = true; + invertPolarity.Location = new System.Drawing.Point(15, 187); + invertPolarity.Name = "invertPolarity"; + invertPolarity.Size = new System.Drawing.Size(55, 32); + invertPolarity.TabIndex = 44; + invertPolarity.Text = "Invert\r\nPolarity:"; + // // toolStripLabelGainCalibrationSN // this.toolStripLabelGainCalibrationSN.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold); @@ -157,8 +159,8 @@ private void InitializeComponent() this.fileToolStripMenuItem}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; - this.menuStrip.Padding = new System.Windows.Forms.Padding(4, 1, 0, 1); - this.menuStrip.Size = new System.Drawing.Size(834, 24); + this.menuStrip.Padding = new System.Windows.Forms.Padding(5, 1, 0, 1); + this.menuStrip.Size = new System.Drawing.Size(1234, 24); this.menuStrip.TabIndex = 0; this.menuStrip.Text = "menuStripNeuropixelsV2e"; // @@ -172,10 +174,10 @@ private void InitializeComponent() // this.buttonEnableContacts.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEnableContacts.Location = new System.Drawing.Point(11, 184); - this.buttonEnableContacts.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.buttonEnableContacts.Location = new System.Drawing.Point(15, 226); + this.buttonEnableContacts.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonEnableContacts.Name = "buttonEnableContacts"; - this.buttonEnableContacts.Size = new System.Drawing.Size(183, 36); + this.buttonEnableContacts.Size = new System.Drawing.Size(280, 44); this.buttonEnableContacts.TabIndex = 20; this.buttonEnableContacts.Text = "Enable Selected Electrodes"; this.toolTip.SetToolTip(this.buttonEnableContacts, "Click and drag to select electrodes in the probe view. \r\nPress this button to ena" + @@ -187,10 +189,10 @@ private void InitializeComponent() // this.buttonClearSelections.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.buttonClearSelections.Location = new System.Drawing.Point(11, 224); - this.buttonClearSelections.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.buttonClearSelections.Location = new System.Drawing.Point(15, 276); + this.buttonClearSelections.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonClearSelections.Name = "buttonClearSelections"; - this.buttonClearSelections.Size = new System.Drawing.Size(183, 36); + this.buttonClearSelections.Size = new System.Drawing.Size(280, 44); this.buttonClearSelections.TabIndex = 19; this.buttonClearSelections.Text = "Clear Electrode Selection"; this.toolTip.SetToolTip(this.buttonClearSelections, "Deselect all electrodes in the probe view. \r\nNote that this does not disable elec" + @@ -202,10 +204,10 @@ private void InitializeComponent() // this.buttonResetZoom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.buttonResetZoom.Location = new System.Drawing.Point(11, 264); - this.buttonResetZoom.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.buttonResetZoom.Location = new System.Drawing.Point(15, 325); + this.buttonResetZoom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonResetZoom.Name = "buttonResetZoom"; - this.buttonResetZoom.Size = new System.Drawing.Size(183, 36); + this.buttonResetZoom.Size = new System.Drawing.Size(280, 44); this.buttonResetZoom.TabIndex = 4; this.buttonResetZoom.Text = "Reset Zoom"; this.toolTip.SetToolTip(this.buttonResetZoom, "Reset the zoom in the probe view so that the probe is zoomed out and centered."); @@ -215,10 +217,10 @@ private void InitializeComponent() // buttonChooseCalibrationFile // this.buttonChooseCalibrationFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonChooseCalibrationFile.Location = new System.Drawing.Point(166, 24); - this.buttonChooseCalibrationFile.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.buttonChooseCalibrationFile.Location = new System.Drawing.Point(257, 30); + this.buttonChooseCalibrationFile.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonChooseCalibrationFile.Name = "buttonChooseCalibrationFile"; - this.buttonChooseCalibrationFile.Size = new System.Drawing.Size(28, 20); + this.buttonChooseCalibrationFile.Size = new System.Drawing.Size(37, 25); this.buttonChooseCalibrationFile.TabIndex = 34; this.buttonChooseCalibrationFile.Text = "..."; this.toolTip.SetToolTip(this.buttonChooseCalibrationFile, "Browse for a gain calibration file."); @@ -228,23 +230,23 @@ private void InitializeComponent() // panelProbe // this.panelProbe.AutoSize = true; - this.panelProbe.Controls.Add(this.panelTrackBar); this.panelProbe.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelProbe.Location = new System.Drawing.Point(2, 2); - this.panelProbe.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.panelProbe.Location = new System.Drawing.Point(3, 2); + this.panelProbe.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelProbe.Name = "panelProbe"; - this.panelProbe.Size = new System.Drawing.Size(621, 443); + this.panelProbe.Size = new System.Drawing.Size(853, 662); this.panelProbe.TabIndex = 1; // // panelTrackBar // - this.panelTrackBar.Anchor = System.Windows.Forms.AnchorStyles.None; this.panelTrackBar.Controls.Add(label6); this.panelTrackBar.Controls.Add(label7); this.panelTrackBar.Controls.Add(this.trackBarProbePosition); - this.panelTrackBar.Location = new System.Drawing.Point(581, -5); + this.panelTrackBar.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelTrackBar.Location = new System.Drawing.Point(863, 4); + this.panelTrackBar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panelTrackBar.Name = "panelTrackBar"; - this.panelTrackBar.Size = new System.Drawing.Size(37, 454); + this.panelTrackBar.Size = new System.Drawing.Size(52, 658); this.panelTrackBar.TabIndex = 30; // // trackBarProbePosition @@ -252,12 +254,12 @@ private void InitializeComponent() this.trackBarProbePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.trackBarProbePosition.AutoSize = false; - this.trackBarProbePosition.Location = new System.Drawing.Point(-6, 9); - this.trackBarProbePosition.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.trackBarProbePosition.Location = new System.Drawing.Point(8, 11); + this.trackBarProbePosition.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.trackBarProbePosition.Maximum = 100; this.trackBarProbePosition.Name = "trackBarProbePosition"; this.trackBarProbePosition.Orientation = System.Windows.Forms.Orientation.Vertical; - this.trackBarProbePosition.Size = new System.Drawing.Size(37, 435); + this.trackBarProbePosition.Size = new System.Drawing.Size(36, 645); this.trackBarProbePosition.TabIndex = 22; this.trackBarProbePosition.TickFrequency = 2; this.trackBarProbePosition.TickStyle = System.Windows.Forms.TickStyle.TopLeft; @@ -284,21 +286,32 @@ private void InitializeComponent() this.panelChannelOptions.Controls.Add(this.buttonClearSelections); this.panelChannelOptions.Controls.Add(this.buttonResetZoom); this.panelChannelOptions.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelChannelOptions.Location = new System.Drawing.Point(627, 2); - this.panelChannelOptions.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.panelChannelOptions.Location = new System.Drawing.Point(922, 2); + this.panelChannelOptions.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelChannelOptions.Name = "panelChannelOptions"; - this.panelChannelOptions.Size = new System.Drawing.Size(205, 443); + this.panelChannelOptions.Size = new System.Drawing.Size(309, 662); this.panelChannelOptions.TabIndex = 1; // + // checkBoxInvertPolarity + // + this.checkBoxInvertPolarity.AutoSize = true; + this.checkBoxInvertPolarity.Location = new System.Drawing.Point(107, 193); + this.checkBoxInvertPolarity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.checkBoxInvertPolarity.Name = "checkBoxInvertPolarity"; + this.checkBoxInvertPolarity.Size = new System.Drawing.Size(77, 20); + this.checkBoxInvertPolarity.TabIndex = 45; + this.checkBoxInvertPolarity.Text = "Enabled"; + this.checkBoxInvertPolarity.UseVisualStyleBackColor = true; + // // textBoxGainCorrection // this.textBoxGainCorrection.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxGainCorrection.Location = new System.Drawing.Point(80, 55); - this.textBoxGainCorrection.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.textBoxGainCorrection.Location = new System.Drawing.Point(107, 68); + this.textBoxGainCorrection.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBoxGainCorrection.Name = "textBoxGainCorrection"; this.textBoxGainCorrection.ReadOnly = true; - this.textBoxGainCorrection.Size = new System.Drawing.Size(115, 20); + this.textBoxGainCorrection.Size = new System.Drawing.Size(188, 22); this.textBoxGainCorrection.TabIndex = 36; this.textBoxGainCorrection.TabStop = false; // @@ -306,10 +319,10 @@ private void InitializeComponent() // this.textBoxProbeCalibrationFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxProbeCalibrationFile.Location = new System.Drawing.Point(11, 24); - this.textBoxProbeCalibrationFile.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.textBoxProbeCalibrationFile.Location = new System.Drawing.Point(15, 30); + this.textBoxProbeCalibrationFile.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBoxProbeCalibrationFile.Name = "textBoxProbeCalibrationFile"; - this.textBoxProbeCalibrationFile.Size = new System.Drawing.Size(150, 20); + this.textBoxProbeCalibrationFile.Size = new System.Drawing.Size(235, 22); this.textBoxProbeCalibrationFile.TabIndex = 33; this.textBoxProbeCalibrationFile.TextChanged += new System.EventHandler(this.FileTextChanged); // @@ -319,10 +332,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.comboBoxReference.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxReference.FormattingEnabled = true; - this.comboBoxReference.Location = new System.Drawing.Point(80, 89); - this.comboBoxReference.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.comboBoxReference.Location = new System.Drawing.Point(107, 110); + this.comboBoxReference.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.comboBoxReference.Name = "comboBoxReference"; - this.comboBoxReference.Size = new System.Drawing.Size(115, 21); + this.comboBoxReference.Size = new System.Drawing.Size(188, 24); this.comboBoxReference.TabIndex = 31; // // comboBoxChannelPresets @@ -331,10 +344,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.comboBoxChannelPresets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxChannelPresets.FormattingEnabled = true; - this.comboBoxChannelPresets.Location = new System.Drawing.Point(80, 122); - this.comboBoxChannelPresets.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.comboBoxChannelPresets.Location = new System.Drawing.Point(107, 150); + this.comboBoxChannelPresets.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.comboBoxChannelPresets.Name = "comboBoxChannelPresets"; - this.comboBoxChannelPresets.Size = new System.Drawing.Size(115, 21); + this.comboBoxChannelPresets.Size = new System.Drawing.Size(188, 24); this.comboBoxChannelPresets.TabIndex = 24; // // buttonCancel @@ -342,10 +355,10 @@ private void InitializeComponent() this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(743, 2); - this.buttonCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.buttonCancel.Location = new System.Drawing.Point(1112, 2); + this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(83, 28); + this.buttonCancel.Size = new System.Drawing.Size(111, 34); this.buttonCancel.TabIndex = 1; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; @@ -355,10 +368,10 @@ private void InitializeComponent() this.buttonOkay.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.buttonOkay.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOkay.Location = new System.Drawing.Point(656, 2); - this.buttonOkay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.buttonOkay.Location = new System.Drawing.Point(995, 2); + this.buttonOkay.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonOkay.Name = "buttonOkay"; - this.buttonOkay.Size = new System.Drawing.Size(83, 28); + this.buttonOkay.Size = new System.Drawing.Size(111, 34); this.buttonOkay.TabIndex = 0; this.buttonOkay.Text = "OK"; this.buttonOkay.UseVisualStyleBackColor = true; @@ -367,32 +380,35 @@ private void InitializeComponent() // this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel1.ColumnCount = 2; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); - this.tableLayoutPanel1.Controls.Add(this.panelChannelOptions, 1, 0); + this.tableLayoutPanel1.ColumnCount = 3; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 315F)); + this.tableLayoutPanel1.Controls.Add(this.panelTrackBar, 1, 0); this.tableLayoutPanel1.Controls.Add(this.panelProbe, 0, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panelChannelOptions, 2, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 37F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(834, 484); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 46F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1234, 712); this.tableLayoutPanel1.TabIndex = 3; // // flowLayoutPanel1 // - this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2); + this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 3); this.flowLayoutPanel1.Controls.Add(this.buttonCancel); this.flowLayoutPanel1.Controls.Add(this.buttonOkay); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 450); + this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 670); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(828, 31); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1226, 38); this.flowLayoutPanel1.TabIndex = 2; // // statusStrip1 @@ -401,10 +417,10 @@ private void InitializeComponent() this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripLabelGainCalibrationSN, this.toolStripGainCalSN}); - this.statusStrip1.Location = new System.Drawing.Point(0, 508); + this.statusStrip1.Location = new System.Drawing.Point(0, 736); this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0); - this.statusStrip1.Size = new System.Drawing.Size(834, 25); + this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0); + this.statusStrip1.Size = new System.Drawing.Size(1234, 25); this.statusStrip1.TabIndex = 3; this.statusStrip1.Text = "statusStrip1"; // @@ -415,45 +431,23 @@ private void InitializeComponent() this.toolStripGainCalSN.Text = "No file selected."; this.toolStripGainCalSN.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // checkBoxInvertPolarity - // - this.checkBoxInvertPolarity.AutoSize = true; - this.checkBoxInvertPolarity.Location = new System.Drawing.Point(80, 157); - this.checkBoxInvertPolarity.Margin = new System.Windows.Forms.Padding(2); - this.checkBoxInvertPolarity.Name = "checkBoxInvertPolarity"; - this.checkBoxInvertPolarity.Size = new System.Drawing.Size(65, 17); - this.checkBoxInvertPolarity.TabIndex = 45; - this.checkBoxInvertPolarity.Text = "Enabled"; - this.checkBoxInvertPolarity.UseVisualStyleBackColor = true; - // - // invertPolarity - // - invertPolarity.AutoSize = true; - invertPolarity.Location = new System.Drawing.Point(11, 152); - invertPolarity.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - invertPolarity.Name = "invertPolarity"; - invertPolarity.Size = new System.Drawing.Size(44, 26); - invertPolarity.TabIndex = 44; - invertPolarity.Text = "Invert\r\nPolarity:"; - // // NeuropixelsV2eProbeConfigurationDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(834, 533); + this.ClientSize = new System.Drawing.Size(1234, 761); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.menuStrip); this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "NeuropixelsV2eProbeConfigurationDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "NeuropixelsV2e Probe Configuration"; this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); - this.panelProbe.ResumeLayout(false); this.panelTrackBar.ResumeLayout(false); this.panelTrackBar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBarProbePosition)).EndInit(); From 9ea1b943d495dea38238ea121501a44d333cf9d3 Mon Sep 17 00:00:00 2001 From: bparks13 Date: Tue, 16 Sep 2025 10:11:22 -0400 Subject: [PATCH 2/4] Move scale to second pane - Only applies for dialogs that need to draw a scale (such as NeuropixelsV1e/V1f and NeuropixelsV2e/V2eBeta) - Updated the logic for constraining pan/zoom in all dialogs so that the probe is always in view - Standardized dialog sizes for consistency --- .../ChannelConfigurationDialog.cs | 468 +++++++++--------- ...NeuropixelsV1ChannelConfigurationDialog.cs | 93 +--- .../NeuropixelsV1ProbeConfigurationDialog.cs | 14 +- .../NeuropixelsV1eHeadstageDialog.Designer.cs | 24 +- .../NeuropixelsV1fHeadstageDialog.Designer.cs | 74 +-- ...europixelsV2eChannelConfigurationDialog.cs | 96 +--- .../NeuropixelsV2eHeadstageDialog.Designer.cs | 32 +- .../NeuropixelsV2eProbeConfigurationDialog.cs | 1 - .../Rhs2116ChannelConfigurationDialog.cs | 32 +- .../Rhs2116StimulusSequenceDialog.Designer.cs | 94 ++-- 10 files changed, 381 insertions(+), 547 deletions(-) diff --git a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs index 09fb44a9..e80044e6 100644 --- a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs @@ -1,11 +1,11 @@ -using System.Drawing; +using System; +using System.Collections.Generic; +using System.Drawing; using System.IO; using System.Linq; using System.Windows.Forms; -using ZedGraph; -using System; using OpenEphys.ProbeInterface.NET; -using System.Collections.Generic; +using ZedGraph; namespace OpenEphys.Onix1.Design { @@ -17,6 +17,7 @@ namespace OpenEphys.Onix1.Design public abstract partial class ChannelConfigurationDialog : Form { internal event EventHandler OnResizeZedGraph; + internal event EventHandler OnDrawProbeGroup; internal ProbeGroup ProbeGroup; @@ -50,7 +51,17 @@ public ChannelConfigurationDialog(ProbeGroup probeGroup) zedGraphChannels.MouseMoveEvent += MouseMoveEvent; zedGraphChannels.MouseUpEvent += MouseUpEvent; - InitializeZedGraphChannels(); + if (IsDrawScale()) + { + var pane = new GraphPane(); + + InitializeScalePane(pane); + + zedGraphChannels.MasterPane.Add(pane); + } + + InitializeZedGraphControl(zedGraphChannels); + InitializeProbePane(zedGraphChannels.GraphPane); DrawProbeGroup(); RefreshZedGraph(); } @@ -91,17 +102,23 @@ internal virtual void ZoomEvent(ZedGraphControl sender, ZoomState oldState, Zoom if (CheckZoomBoundaries(sender)) { CenterAxesOnCursor(sender); - CheckProbeIsInView(sender); } else { sender.ZoomOut(sender.GraphPane); } } - else if (newState.Type == ZoomState.StateType.Pan) - { - CheckProbeIsInView(sender); - } + + CheckProbeIsInView(sender); + + if (IsDrawScale()) + SyncYAxes(zedGraphChannels.MasterPane.PaneList[0], zedGraphChannels.MasterPane.PaneList[1]); + } + + static void SyncYAxes(GraphPane source, GraphPane target) + { + target.YAxis.Scale.Min = source.YAxis.Scale.Min; + target.YAxis.Scale.Max = source.YAxis.Scale.Max; } private void SetEqualAxisLimits(ZedGraphControl zedGraphControl) @@ -160,171 +177,54 @@ private void CenterAxesOnCursor(ZedGraphControl zedGraphControl) zedGraphControl.GraphPane.YAxis.Scale.Max += diffY; } - private struct ProbeEdge + private static void CheckProbeIsInView(ZedGraphControl zedGraphControl) { - public double Left; - public double Bottom; - public double Right; - public double Top; + var probe = ( + XMin: GetProbeLeft(zedGraphControl.GraphPane.GraphObjList), + XMax: GetProbeRight(zedGraphControl.GraphPane.GraphObjList), + YMin: GetProbeBottom(zedGraphControl.GraphPane.GraphObjList), + YMax: GetProbeTop(zedGraphControl.GraphPane.GraphObjList) + ); - public ProbeEdge(ZedGraphControl zedGraphControl) - { - Left = GetProbeLeft(zedGraphControl.GraphPane.GraphObjList); - Right = GetProbeRight(zedGraphControl.GraphPane.GraphObjList); - Bottom = GetProbeBottom(zedGraphControl.GraphPane.GraphObjList); - Top = GetProbeTop(zedGraphControl.GraphPane.GraphObjList); - } - } + var axis = ( + XMin: zedGraphControl.GraphPane.XAxis.Scale.Min, + XMax: zedGraphControl.GraphPane.XAxis.Scale.Max, + YMin: zedGraphControl.GraphPane.YAxis.Scale.Min, + YMax: zedGraphControl.GraphPane.YAxis.Scale.Max + ); - private struct ScaleEdge - { - public double Left; - public double Bottom; - public double Right; - public double Top; + var pane = zedGraphControl.GraphPane; - public ScaleEdge(ZedGraphControl zedGraphControl) - { - Left = zedGraphControl.GraphPane.XAxis.Scale.Min; - Right = zedGraphControl.GraphPane.XAxis.Scale.Max; - Bottom = zedGraphControl.GraphPane.YAxis.Scale.Min; - Top = zedGraphControl.GraphPane.YAxis.Scale.Max; - } - } - - private void CheckProbeIsInView(ZedGraphControl zedGraphControl) - { - var probeEdge = new ProbeEdge(zedGraphControl); - var scaleEdge = new ScaleEdge(zedGraphControl); - - var rangeX = CalculateScaleRange(zedGraphControl.GraphPane.XAxis.Scale); - var rangeY = CalculateScaleRange(zedGraphControl.GraphPane.YAxis.Scale); - - var boundaryX = rangeX / 4; - var boundaryY = rangeY / 4; - - if (IsProbeCentered(probeEdge, scaleEdge)) - { - return; - } - else if (IsProbeCenteredX(probeEdge, scaleEdge)) - { - if (IsProbeTooHigh(probeEdge, scaleEdge, boundaryY)) - { - MoveProbeDown(zedGraphControl, probeEdge, scaleEdge, boundaryY); - } - else if (IsProbeTooLow(probeEdge, scaleEdge, boundaryY)) - { - MoveProbeUp(zedGraphControl, probeEdge, scaleEdge, boundaryY); - } - } - else if (IsProbeCenteredY(probeEdge, scaleEdge)) - { - if (IsProbeTooLeft(probeEdge, scaleEdge, boundaryX)) - { - MoveProbeRight(zedGraphControl, probeEdge, scaleEdge, boundaryX); - } - else if (IsProbeTooRight(probeEdge, scaleEdge, boundaryX)) - { - MoveProbeLeft(zedGraphControl, probeEdge, scaleEdge, boundaryX); - } - } - else + static void EnsureVisible(ref double axisMin, ref double axisMax, double probeMin, double probeMax) { - if (IsProbeTooHigh(probeEdge, scaleEdge, boundaryY)) + if (axisMin > probeMin && axisMax > probeMax) { - MoveProbeDown(zedGraphControl, probeEdge, scaleEdge, boundaryY); - } - else if (IsProbeTooLow(probeEdge, scaleEdge, boundaryY)) - { - MoveProbeUp(zedGraphControl, probeEdge, scaleEdge, boundaryY); - } + double diffMin = Math.Abs(axisMin - probeMin); + double diffMax = Math.Abs(axisMax - probeMax); - if (IsProbeTooLeft(probeEdge, scaleEdge, boundaryX)) - { - MoveProbeRight(zedGraphControl, probeEdge, scaleEdge, boundaryX); + double shift = (axisMax - diffMin > probeMax) ? diffMin : diffMax; + axisMin -= shift; + axisMax -= shift; } - else if (IsProbeTooRight(probeEdge, scaleEdge, boundaryX)) + else if (axisMax < probeMax && axisMin < probeMin) { - MoveProbeLeft(zedGraphControl, probeEdge, scaleEdge, boundaryX); + double diffMin = Math.Abs(axisMin - probeMin); + double diffMax = Math.Abs(axisMax - probeMax); + + double shift = (axisMin + diffMax > probeMin) ? diffMin : diffMax; + axisMin += shift; + axisMax += shift; } } - } - - private void MoveProbeLeft(ZedGraphControl zedGraphControl, ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - bool probeSmallerThanScale = probeEdge.Right - probeEdge.Left < scaleEdge.Right - scaleEdge.Left; - - double diff = probeSmallerThanScale ? probeEdge.Right - scaleEdge.Right : probeEdge.Left - (scaleEdge.Left + boundary); - - zedGraphControl.GraphPane.XAxis.Scale.Min += diff; - zedGraphControl.GraphPane.XAxis.Scale.Max += diff; - } - private bool IsProbeTooRight(ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - return probeEdge.Left > scaleEdge.Left + boundary; - } - - private void MoveProbeRight(ZedGraphControl zedGraphControl, ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - bool probeSmallerThanScale = probeEdge.Right - probeEdge.Left < scaleEdge.Right - scaleEdge.Left; + EnsureVisible(ref axis.XMin, ref axis.XMax, probe.XMin, probe.XMax); + EnsureVisible(ref axis.YMax, ref axis.YMin, probe.YMax, probe.YMin); - var diff = probeSmallerThanScale ? probeEdge.Left - scaleEdge.Left : probeEdge.Right - (scaleEdge.Right - boundary); + pane.XAxis.Scale.Min = axis.XMin; + pane.XAxis.Scale.Max = axis.XMax; - zedGraphControl.GraphPane.XAxis.Scale.Min += diff; - zedGraphControl.GraphPane.XAxis.Scale.Max += diff; - } - - private bool IsProbeTooLeft(ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - return probeEdge.Right < scaleEdge.Right - boundary; - } - - private void MoveProbeUp(ZedGraphControl zedGraphControl, ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - var diff = probeEdge.Top - (scaleEdge.Top - boundary); - - zedGraphControl.GraphPane.YAxis.Scale.Min += diff; - zedGraphControl.GraphPane.YAxis.Scale.Max += diff; - } - - private bool IsProbeTooLow(ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - return probeEdge.Top < scaleEdge.Top - boundary; - } - - private void MoveProbeDown(ZedGraphControl zedGraphControl, ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - var diff = probeEdge.Bottom - (scaleEdge.Bottom + boundary); - - zedGraphControl.GraphPane.YAxis.Scale.Min += diff; - zedGraphControl.GraphPane.YAxis.Scale.Max += diff; - } - - private bool IsProbeTooHigh(ProbeEdge probeEdge, ScaleEdge scaleEdge, double boundary) - { - return probeEdge.Bottom > scaleEdge.Bottom + boundary; - } - - private bool IsProbeCenteredY(ProbeEdge probeEdge, ScaleEdge scaleEdge) - { - return probeEdge.Bottom >= scaleEdge.Bottom && probeEdge.Top <= scaleEdge.Top || - probeEdge.Bottom <= scaleEdge.Bottom && probeEdge.Top >= scaleEdge.Top; - } - - private bool IsProbeCenteredX(ProbeEdge probeEdge, ScaleEdge scaleEdge) - { - return probeEdge.Left >= scaleEdge.Left && probeEdge.Right <= scaleEdge.Right || - probeEdge.Left <= scaleEdge.Left && probeEdge.Right >= scaleEdge.Right; - } - - private bool IsProbeCentered(ProbeEdge probeEdge, ScaleEdge scaleEdge) - { - return (probeEdge.Left >= scaleEdge.Left && probeEdge.Right <= scaleEdge.Right && - probeEdge.Bottom >= scaleEdge.Bottom && probeEdge.Top <= scaleEdge.Top) || - (probeEdge.Left <= scaleEdge.Left && probeEdge.Right >= scaleEdge.Right && - probeEdge.Bottom <= scaleEdge.Bottom && probeEdge.Top >= scaleEdge.Top); + pane.YAxis.Scale.Min = axis.YMin; + pane.YAxis.Scale.Max = axis.YMax; } internal static double CalculateScaleRange(Scale scale) @@ -414,12 +314,7 @@ private void FormShown(object sender, EventArgs e) menuStrip.Visible = false; ConnectResizeEventHandler(); - ZedGraphChannels_Resize(null, null); - } - else - { - UpdateFontSize(); - zedGraphChannels.Refresh(); + ResizeZedGraph(); } } @@ -481,7 +376,18 @@ internal void DrawProbeGroup() HighlightEnabledContacts(); HighlightSelectedContacts(); DrawContactLabels(); - DrawScale(); + + if (IsDrawScale()) + { + DrawScale(); + } + + OnDrawProbeGroupHandler(); + } + + void OnDrawProbeGroupHandler() + { + OnDrawProbeGroup?.Invoke(this, EventArgs.Empty); } private double ZoomOutBoundaryLeft = default; @@ -782,6 +688,8 @@ internal virtual string ContactString(int deviceChannelIndex, int index) return deviceChannelIndex == -1 ? DisabledContactString : index.ToString(); } + internal virtual bool IsDrawScale() => false; + internal virtual void DrawScale() { } internal void UpdateFontSize() @@ -949,34 +857,108 @@ public static PointD[] ConvertFloatArrayToPointD(float[][] floats) return pointD; } - /// - /// Initialize the given so that almost everything other than the - /// axis itself is hidden, reducing visual clutter before plotting contacts - /// - public void InitializeZedGraphChannels() + static void InitializeZedGraphControl(ZedGraphControl zedGraph) { - zedGraphChannels.IsZoomOnMouseCenter = true; + zedGraph.IsZoomOnMouseCenter = true; + zedGraph.IsAntiAlias = true; + zedGraph.BorderStyle = BorderStyle.None; - zedGraphChannels.IsAntiAlias = true; + EnablePan(zedGraph); + EnableZoom(zedGraph); + } - zedGraphChannels.GraphPane.Title.IsVisible = false; - zedGraphChannels.GraphPane.TitleGap = 0; - zedGraphChannels.GraphPane.Border.IsVisible = false; - zedGraphChannels.GraphPane.Border.Width = 0; - zedGraphChannels.GraphPane.Chart.Border.IsVisible = false; - zedGraphChannels.GraphPane.Margin.All = -1; - zedGraphChannels.GraphPane.IsFontsScaled = true; - zedGraphChannels.BorderStyle = BorderStyle.None; + static void EnablePan(ZedGraphControl zedGraph) + { + zedGraph.IsEnableHPan = true; + zedGraph.IsEnableVPan = true; + } + + static void DisablePan(ZedGraphControl zedGraph) + { + zedGraph.IsEnableHPan = false; + zedGraph.IsEnableVPan = false; + } + + static void EnableZoom(ZedGraphControl zedGraph) + { + zedGraph.IsEnableZoom = true; + zedGraph.IsEnableWheelZoom = true; + } + + static void DisableZoom(ZedGraphControl zedGraph) + { + zedGraph.IsEnableZoom = false; + zedGraph.IsEnableWheelZoom = false; + } - zedGraphChannels.GraphPane.XAxis.IsVisible = false; - zedGraphChannels.GraphPane.XAxis.IsAxisSegmentVisible = false; - zedGraphChannels.GraphPane.XAxis.Scale.MaxAuto = true; - zedGraphChannels.GraphPane.XAxis.Scale.MinAuto = true; + static void InitializeScalePane(GraphPane pane) + { + pane.Title.IsVisible = false; + pane.TitleGap = 0; + pane.Border.IsVisible = false; + pane.Border.Width = 0; + pane.Chart.Border.IsVisible = false; + pane.Margin.All = 0; + + pane.Y2Axis.IsVisible = false; + + pane.XAxis.IsVisible = false; + pane.XAxis.IsAxisSegmentVisible = false; + pane.XAxis.Scale.MaxAuto = true; + pane.XAxis.Scale.MinAuto = true; + pane.XAxis.MajorGrid.IsZeroLine = false; + pane.XAxis.CrossAuto = false; + pane.XAxis.Cross = double.MinValue; + + pane.YAxis.IsVisible = true; + pane.YAxis.IsAxisSegmentVisible = true; + pane.YAxis.Scale.MaxAuto = true; + pane.YAxis.Scale.MinAuto = true; + pane.YAxis.CrossAuto = false; + pane.YAxis.Cross = double.MinValue; + + pane.YAxis.MajorGrid.IsZeroLine = false; + pane.YAxis.MajorGrid.IsVisible = false; + pane.YAxis.MinorGrid.IsVisible = false; - zedGraphChannels.GraphPane.YAxis.IsVisible = false; - zedGraphChannels.GraphPane.YAxis.IsAxisSegmentVisible = false; - zedGraphChannels.GraphPane.YAxis.Scale.MaxAuto = true; - zedGraphChannels.GraphPane.YAxis.Scale.MinAuto = true; + pane.YAxis.Scale.IsPreventLabelOverlap = true; + pane.YAxis.Scale.MajorStep = 100; + pane.YAxis.Scale.BaseTic = 0; + pane.YAxis.Scale.IsLabelsInside = true; + pane.YAxis.Scale.FontSpec.Size = 65f; + pane.YAxis.Scale.FontSpec.IsBold = true; + pane.YAxis.Scale.LabelGap = 0.6f; + + pane.YAxis.MinorTic.IsInside = false; + pane.YAxis.MinorTic.IsOutside = false; + pane.YAxis.MinorTic.IsOpposite = false; + + pane.YAxis.MajorTic.IsInside = true; + pane.YAxis.MajorTic.IsOutside = false; + pane.YAxis.MajorTic.IsOpposite = false; + pane.YAxis.MajorTic.Size = 40f; + pane.YAxis.MajorTic.PenWidth = 2f; + } + + static void InitializeProbePane(GraphPane graphPane) + { + graphPane.Title.IsVisible = false; + graphPane.TitleGap = 0; + graphPane.Border.IsVisible = false; + graphPane.Border.Width = 0; + graphPane.Chart.Border.IsVisible = false; + graphPane.Margin.All = -1; + graphPane.IsFontsScaled = true; + + graphPane.XAxis.IsVisible = false; + graphPane.XAxis.IsAxisSegmentVisible = false; + graphPane.XAxis.Scale.MaxAuto = true; + graphPane.XAxis.Scale.MinAuto = true; + + graphPane.YAxis.IsVisible = false; + graphPane.YAxis.IsAxisSegmentVisible = false; + graphPane.YAxis.Scale.MaxAuto = true; + graphPane.YAxis.Scale.MinAuto = true; } private void MenuItemSaveFile(object sender, EventArgs e) @@ -1007,23 +989,28 @@ internal void DisconnectResizeEventHandler() private void ZedGraphChannels_Resize(object sender, EventArgs e) { - if (zedGraphChannels.Size.Width == zedGraphChannels.Size.Height && - zedGraphChannels.Size.Height == zedGraphChannels.GraphPane.Rect.Height && - zedGraphChannels.Location.X == zedGraphChannels.GraphPane.Rect.X) + ResizeZedGraph(); + } + + internal void ResizeZedGraph() + { + ResizeAxes(); + + if (IsDrawScale()) { - if (zedGraphChannels.GraphPane.Chart.Rect != zedGraphChannels.GraphPane.Rect) - { - zedGraphChannels.GraphPane.Chart.Rect = zedGraphChannels.GraphPane.Rect; - } + var rect = zedGraphChannels.MasterPane.Rect; - return; + float squareSize = rect.Height; + + zedGraphChannels.MasterPane.PaneList[0].Rect = new RectangleF(rect.Left, rect.Top, squareSize, squareSize); + zedGraphChannels.MasterPane.PaneList[1].Rect = new RectangleF(rect.Left + squareSize, rect.Top, rect.Width - squareSize, squareSize); + + zedGraphChannels.MasterPane.PaneList[1].Margin.Left = 10; } - ResizeAxes(); - UpdateControlSizeBasedOnAxisSize(); UpdateFontSize(); - DrawScale(); RefreshZedGraph(); + Update(); OnResizeHandler(); } @@ -1032,42 +1019,40 @@ private void OnResizeHandler() OnResizeZedGraph?.Invoke(this, EventArgs.Empty); } - /// - /// After a resize event (such as changing the window size), readjust the size of the control to - /// ensure an equal aspect ratio for axes. - /// - public void ResizeAxes() + void ResizeAxes() { - SetEqualAspectRatio(); + float scalingFactor = IsDrawScale() ? 1.15f : 1.0f; + RectangleF rect = IsDrawScale() ? zedGraphChannels.MasterPane.Rect : zedGraphChannels.GraphPane.Rect; - RectangleF axisRect = zedGraphChannels.GraphPane.Rect; + float width = rect.Width; + float height = rect.Height; - if (axisRect.Width > axisRect.Height) - { - axisRect.X += (axisRect.Width - axisRect.Height) / 2; - axisRect.Width = axisRect.Height; - } - else if (axisRect.Height > axisRect.Width) + float desiredWidth = height * scalingFactor; + + if (width < desiredWidth) { - axisRect.Y += (axisRect.Height - axisRect.Width) / 2; - axisRect.Height = axisRect.Width; + height = width / scalingFactor; } else { - zedGraphChannels.GraphPane.Chart.Rect = axisRect; - return; + width = desiredWidth; } - zedGraphChannels.GraphPane.Rect = axisRect; - zedGraphChannels.GraphPane.Chart.Rect = axisRect; - } + float x = rect.Left + (rect.Width - width) / 2f; + float y = rect.Top + (rect.Height - height) / 2f; - private void UpdateControlSizeBasedOnAxisSize() - { - RectangleF axisRect = zedGraphChannels.GraphPane.Rect; + var newRect = new RectangleF(x, y, width, height); - zedGraphChannels.Size = new Size((int)axisRect.Width, (int)axisRect.Height); - zedGraphChannels.Location = new Point((int)axisRect.X, (int)axisRect.Y); + if (IsDrawScale()) + zedGraphChannels.MasterPane.Rect = newRect; + else + { + zedGraphChannels.GraphPane.Rect = newRect; + DisconnectResizeEventHandler(); + zedGraphChannels.Size = new Size((int)newRect.Width, (int)newRect.Height); + zedGraphChannels.Location = new Point((int)newRect.X, (int)newRect.Y); + ConnectResizeEventHandler(); + } } private void MenuItemOpenFile(object sender, EventArgs e) @@ -1128,6 +1113,9 @@ public void MoveToVerticalPosition(float relativePosition) zedGraphChannels.GraphPane.YAxis.Scale.Min = newMinY; zedGraphChannels.GraphPane.YAxis.Scale.Max = newMinY + currentRange; + + if (IsDrawScale()) + SyncYAxes(zedGraphChannels.MasterPane.PaneList[0], zedGraphChannels.MasterPane.PaneList[1]); } internal float GetRelativeVerticalPosition() @@ -1199,10 +1187,32 @@ private bool MouseMoveEvent(ZedGraphControl sender, MouseEventArgs e) return true; } + else if (e.Button == MouseButtons.Middle) + { + if (IsDrawScale()) + SyncYAxes(zedGraphChannels.MasterPane.PaneList[0], zedGraphChannels.MasterPane.PaneList[1]); + + CheckProbeIsInView(sender); + + return false; + } else if (e.Button == MouseButtons.None) { sender.Cursor = Cursors.Arrow; + var currentPane = sender.MasterPane.FindPane(new PointF(e.X, e.Y)); + + if (currentPane == sender.MasterPane.PaneList[0]) + { + EnablePan(sender); + EnableZoom(sender); + } + else if (IsDrawScale() && currentPane == sender.MasterPane.PaneList[1]) + { + DisablePan(sender); + DisableZoom(sender); + } + return true; } @@ -1342,8 +1352,8 @@ internal static bool HasContactAnnotations(ProbeGroup probeGroup) { foreach (var probe in probeGroup.Probes) { - if (probe.ContactAnnotations != null - && probe.ContactAnnotations.Annotations != null + if (probe.ContactAnnotations != null + && probe.ContactAnnotations.Annotations != null && probe.ContactAnnotations.Annotations.Length > 0) { return true; diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs index 64655cd4..8e745440 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Drawing; using System.Linq; using System.Windows.Forms; using OpenEphys.ProbeInterface.NET; @@ -40,8 +39,8 @@ public NeuropixelsV1ChannelConfigurationDialog(NeuropixelsV1ProbeConfiguration p ProbeConfiguration = probeConfiguration; - ZoomInBoundaryX = 400; - ZoomInBoundaryY = 400; + ZoomInBoundaryX = 200; + ZoomInBoundaryY = 200; HighlightEnabledContacts(); UpdateContactLabels(); @@ -87,7 +86,6 @@ internal override void ZoomEvent(ZedGraphControl sender, ZoomState oldState, Zoo base.ZoomEvent(sender, oldState, newState); UpdateFontSize(); - DrawScale(); RefreshZedGraph(); OnZoomHandler(); @@ -98,90 +96,21 @@ private void OnZoomHandler() OnZoom?.Invoke(this, EventArgs.Empty); } + internal override bool IsDrawScale() => true; + internal override void DrawScale() { - if (ProbeConfiguration == null) + if (ProbeConfiguration == null || zedGraphChannels.MasterPane.PaneList.Count < 2) return; - const string ScalePointsTag = "scale_points"; - const string ScaleTextTag = "scale_text"; - - zedGraphChannels.GraphPane.GraphObjList.RemoveAll(obj => obj is TextObj && obj.Tag is string tag && tag == ScaleTextTag); - zedGraphChannels.GraphPane.CurveList.RemoveAll(curve => curve.Tag is string tag && tag == ScalePointsTag); - - const int MajorTickIncrement = 100; - const int MajorTickLength = 10; - const int MinorTickIncrement = 10; - const int MinorTickLength = 5; - - if (ProbeConfiguration.ProbeGroup.Probes.ElementAt(0).SiUnits != ProbeSiUnits.um) - { - MessageBox.Show("Warning: Expected ProbeGroup units to be in microns, but it is in millimeters. Scale might not be accurate."); - } - - var fontSize = CalculateFontSize(); - - var zoomedOut = fontSize <= 2; - - fontSize = zoomedOut ? 6 : fontSize * 3; - var majorTickOffset = MajorTickLength + CalculateScaleRange(zedGraphChannels.GraphPane.XAxis.Scale) * 0.015; - majorTickOffset = majorTickOffset > 50 ? 50 : majorTickOffset; - - var x = GetProbeRight(zedGraphChannels.GraphPane.GraphObjList) + 40; - var minY = GetProbeBottom(zedGraphChannels.GraphPane.GraphObjList); - var maxY = GetProbeTop(zedGraphChannels.GraphPane.GraphObjList); - - int textPosition = 0; - - PointPairList pointList = new(); - - var countMajorTicks = 0; - - for (int i = (int)minY; i < maxY; i += MajorTickIncrement) - { - PointPair majorTickLocation = new(x + MajorTickLength, minY + MajorTickIncrement * countMajorTicks); - - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks)); - pointList.Add(majorTickLocation); - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks)); - - if (!zoomedOut || countMajorTicks % 5 == 0) - { - TextObj textObj = new($"{textPosition} µm", majorTickLocation.X + 10, majorTickLocation.Y, CoordType.AxisXYScale, AlignH.Left, AlignV.Center) - { - Tag = ScaleTextTag - }; - textObj.FontSpec.Border.IsVisible = false; - textObj.FontSpec.Size = fontSize; - zedGraphChannels.GraphPane.GraphObjList.Add(textObj); - - textPosition += zoomedOut ? 5 * MajorTickIncrement : MajorTickIncrement; - } - - if (!zoomedOut) - { - var countMinorTicks = 1; - - for (int j = i + MinorTickIncrement; j < i + MajorTickIncrement && i + MinorTickIncrement * countMinorTicks < maxY; j += MinorTickIncrement) - { - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks + MinorTickIncrement * countMinorTicks)); - pointList.Add(new PointPair(x + MinorTickLength, minY + MajorTickIncrement * countMajorTicks + MinorTickIncrement * countMinorTicks)); - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks + MinorTickIncrement * countMinorTicks)); - - countMinorTicks++; - } - } - - countMajorTicks++; - } - - var curve = zedGraphChannels.GraphPane.AddCurve(ScalePointsTag, pointList, Color.Black, SymbolType.None); + var pane = zedGraphChannels.MasterPane.PaneList[1]; - const float scaleBarWidth = 1; + pane.YAxis.Scale.Min = GetProbeBottom(zedGraphChannels.GraphPane.GraphObjList); + pane.YAxis.Scale.Max = GetProbeTop(zedGraphChannels.GraphPane.GraphObjList); - curve.Line.Width = scaleBarWidth; - curve.Label.IsVisible = false; - curve.Symbol.IsVisible = false; + pane.YAxis.Scale.Format = "#####0' " + ProbeGroup.Probes.First().SiUnits.ToString() + "'"; + pane.YAxis.Scale.Mag = 0; + pane.YAxis.Scale.MagAuto = false; } internal override void HighlightEnabledContacts() diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs index 2eb1e07f..78dceaa9 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs @@ -115,7 +115,6 @@ private void FormShown(object sender, EventArgs e) } ChannelConfiguration.Show(); - ChannelConfiguration.ConnectResizeEventHandler(); ChannelConfiguration.OnResizeZedGraph += ResizeTrackBar; } @@ -317,22 +316,22 @@ private void CheckStatus() panelProbe.Visible = adcCalibration.HasValue && gainCorrection.HasValue; - if (toolStripAdcCalSN.Text == NoFileSelected) + if (toolStripAdcCalSN.Text == NoFileSelected) toolStripLabelAdcCalibrationSN.Image = Properties.Resources.StatusWarningImage; - else if (toolStripAdcCalSN.Text == InvalidFile) + else if (toolStripAdcCalSN.Text == InvalidFile) toolStripLabelAdcCalibrationSN.Image = Properties.Resources.StatusCriticalImage; else if (toolStripGainCalSN.Text != NoFileSelected && toolStripGainCalSN.Text != InvalidFile && toolStripAdcCalSN.Text != toolStripGainCalSN.Text) toolStripLabelAdcCalibrationSN.Image = Properties.Resources.StatusBlockedImage; - else + else toolStripLabelAdcCalibrationSN.Image = Properties.Resources.StatusReadyImage; - if (toolStripGainCalSN.Text == NoFileSelected) + if (toolStripGainCalSN.Text == NoFileSelected) toolStripLabelGainCalibrationSn.Image = Properties.Resources.StatusWarningImage; - else if (toolStripGainCalSN.Text == InvalidFile) + else if (toolStripGainCalSN.Text == InvalidFile) toolStripLabelGainCalibrationSn.Image = Properties.Resources.StatusCriticalImage; else if (toolStripAdcCalSN.Text != NoFileSelected && toolStripAdcCalSN.Text != InvalidFile && toolStripAdcCalSN.Text != toolStripGainCalSN.Text) toolStripLabelGainCalibrationSn.Image = Properties.Resources.StatusBlockedImage; - else + else toolStripLabelGainCalibrationSn.Image = Properties.Resources.StatusReadyImage; } @@ -455,7 +454,6 @@ private void ResetZoom() { ChannelConfiguration.ResetZoom(); ChannelConfiguration.RefreshZedGraph(); - ChannelConfiguration.DrawScale(); } private void MoveToVerticalPosition(float relativePosition) diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1eHeadstageDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV1eHeadstageDialog.Designer.cs index e3d98c7e..e3e816e0 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1eHeadstageDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1eHeadstageDialog.Designer.cs @@ -57,7 +57,7 @@ private void InitializeComponent() this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1350, 732); + this.tabControl1.Size = new System.Drawing.Size(1328, 741); this.tabControl1.TabIndex = 0; // // tabPageNeuropixelsV1e @@ -67,7 +67,7 @@ private void InitializeComponent() this.tabPageNeuropixelsV1e.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabPageNeuropixelsV1e.Name = "tabPageNeuropixelsV1e"; this.tabPageNeuropixelsV1e.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tabPageNeuropixelsV1e.Size = new System.Drawing.Size(1342, 703); + this.tabPageNeuropixelsV1e.Size = new System.Drawing.Size(1320, 712); this.tabPageNeuropixelsV1e.TabIndex = 0; this.tabPageNeuropixelsV1e.Text = "NeuropixelsV1e"; this.tabPageNeuropixelsV1e.UseVisualStyleBackColor = true; @@ -79,7 +79,7 @@ private void InitializeComponent() this.panelNeuropixelsV1e.Location = new System.Drawing.Point(3, 2); this.panelNeuropixelsV1e.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelNeuropixelsV1e.Name = "panelNeuropixelsV1e"; - this.panelNeuropixelsV1e.Size = new System.Drawing.Size(1336, 699); + this.panelNeuropixelsV1e.Size = new System.Drawing.Size(1314, 708); this.panelNeuropixelsV1e.TabIndex = 0; // // tabPageBno055 @@ -106,7 +106,7 @@ private void InitializeComponent() // buttonCancel // this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(1238, 2); + this.buttonCancel.Location = new System.Drawing.Point(1216, 2); this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(111, 34); @@ -117,7 +117,7 @@ private void InitializeComponent() // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(1121, 2); + this.buttonOK.Location = new System.Drawing.Point(1099, 2); this.buttonOK.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(111, 34); @@ -134,14 +134,14 @@ private void InitializeComponent() this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 1, 0, 1); - this.menuStrip1.Size = new System.Drawing.Size(1356, 26); + this.menuStrip1.Size = new System.Drawing.Size(1334, 24); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 22); this.fileToolStripMenuItem.Text = "File"; // // tableLayoutPanel1 @@ -151,13 +151,13 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 26); + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1356, 778); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1334, 787); this.tableLayoutPanel1.TabIndex = 3; // // flowLayoutPanel1 @@ -166,17 +166,17 @@ private void InitializeComponent() this.flowLayoutPanel1.Controls.Add(this.buttonOK); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 738); + this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 747); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1352, 38); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1330, 38); this.flowLayoutPanel1.TabIndex = 0; // // NeuropixelsV1eHeadstageDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1356, 804); + this.ClientSize = new System.Drawing.Size(1334, 811); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.menuStrip1); this.DoubleBuffered = true; diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1fHeadstageDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV1fHeadstageDialog.Designer.cs index e6bece73..50738f3a 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1fHeadstageDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1fHeadstageDialog.Designer.cs @@ -32,6 +32,8 @@ private void InitializeComponent() this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageNeuropixelsV1A = new System.Windows.Forms.TabPage(); this.panelNeuropixelsV1A = new System.Windows.Forms.Panel(); + this.tabPageNeuropixelsV1B = new System.Windows.Forms.TabPage(); + this.panelNeuropixelsV1B = new System.Windows.Forms.Panel(); this.tabPageBno055 = new System.Windows.Forms.TabPage(); this.panelBno055 = new System.Windows.Forms.Panel(); this.buttonCancel = new System.Windows.Forms.Button(); @@ -40,15 +42,13 @@ private void InitializeComponent() this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.tabPageNeuropixelsV1B = new System.Windows.Forms.TabPage(); - this.panelNeuropixelsV1B = new System.Windows.Forms.Panel(); this.tabControl1.SuspendLayout(); this.tabPageNeuropixelsV1A.SuspendLayout(); + this.tabPageNeuropixelsV1B.SuspendLayout(); this.tabPageBno055.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); - this.tabPageNeuropixelsV1B.SuspendLayout(); this.SuspendLayout(); // // tabControl1 @@ -61,7 +61,7 @@ private void InitializeComponent() this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1350, 732); + this.tabControl1.Size = new System.Drawing.Size(1328, 741); this.tabControl1.TabIndex = 0; // // tabPageNeuropixelsV1A @@ -69,7 +69,7 @@ private void InitializeComponent() this.tabPageNeuropixelsV1A.Controls.Add(this.panelNeuropixelsV1A); this.tabPageNeuropixelsV1A.Location = new System.Drawing.Point(4, 25); this.tabPageNeuropixelsV1A.Name = "tabPageNeuropixelsV1A"; - this.tabPageNeuropixelsV1A.Size = new System.Drawing.Size(1342, 703); + this.tabPageNeuropixelsV1A.Size = new System.Drawing.Size(1320, 712); this.tabPageNeuropixelsV1A.TabIndex = 0; this.tabPageNeuropixelsV1A.Text = "NeuropixelsV1A"; this.tabPageNeuropixelsV1A.UseVisualStyleBackColor = true; @@ -80,9 +80,29 @@ private void InitializeComponent() this.panelNeuropixelsV1A.Location = new System.Drawing.Point(0, 0); this.panelNeuropixelsV1A.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelNeuropixelsV1A.Name = "panelNeuropixelsV1A"; - this.panelNeuropixelsV1A.Size = new System.Drawing.Size(1342, 703); + this.panelNeuropixelsV1A.Size = new System.Drawing.Size(1320, 712); this.panelNeuropixelsV1A.TabIndex = 0; // + // tabPageNeuropixelsV1B + // + this.tabPageNeuropixelsV1B.Controls.Add(this.panelNeuropixelsV1B); + this.tabPageNeuropixelsV1B.Location = new System.Drawing.Point(4, 25); + this.tabPageNeuropixelsV1B.Name = "tabPageNeuropixelsV1B"; + this.tabPageNeuropixelsV1B.Size = new System.Drawing.Size(1342, 703); + this.tabPageNeuropixelsV1B.TabIndex = 2; + this.tabPageNeuropixelsV1B.Text = "NeuropixelsV1B"; + this.tabPageNeuropixelsV1B.UseVisualStyleBackColor = true; + // + // panelNeuropixelsV1B + // + this.panelNeuropixelsV1B.AutoSize = true; + this.panelNeuropixelsV1B.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelNeuropixelsV1B.Location = new System.Drawing.Point(0, 0); + this.panelNeuropixelsV1B.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panelNeuropixelsV1B.Name = "panelNeuropixelsV1B"; + this.panelNeuropixelsV1B.Size = new System.Drawing.Size(1342, 703); + this.panelNeuropixelsV1B.TabIndex = 1; + // // tabPageBno055 // this.tabPageBno055.Controls.Add(this.panelBno055); @@ -107,7 +127,7 @@ private void InitializeComponent() // buttonCancel // this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(1238, 2); + this.buttonCancel.Location = new System.Drawing.Point(1216, 2); this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(111, 34); @@ -118,7 +138,7 @@ private void InitializeComponent() // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(1121, 2); + this.buttonOK.Location = new System.Drawing.Point(1099, 2); this.buttonOK.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(111, 34); @@ -135,14 +155,14 @@ private void InitializeComponent() this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 1, 0, 1); - this.menuStrip1.Size = new System.Drawing.Size(1356, 26); + this.menuStrip1.Size = new System.Drawing.Size(1334, 24); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 22); this.fileToolStripMenuItem.Text = "File"; // // tableLayoutPanel1 @@ -152,13 +172,13 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 26); + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1356, 778); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1334, 787); this.tableLayoutPanel1.TabIndex = 3; // // flowLayoutPanel1 @@ -167,37 +187,17 @@ private void InitializeComponent() this.flowLayoutPanel1.Controls.Add(this.buttonOK); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 738); + this.flowLayoutPanel1.Location = new System.Drawing.Point(2, 747); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1352, 38); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1330, 38); this.flowLayoutPanel1.TabIndex = 0; // - // tabPageNeuropixelsV1B - // - this.tabPageNeuropixelsV1B.Controls.Add(this.panelNeuropixelsV1B); - this.tabPageNeuropixelsV1B.Location = new System.Drawing.Point(4, 25); - this.tabPageNeuropixelsV1B.Name = "tabPageNeuropixelsV1B"; - this.tabPageNeuropixelsV1B.Size = new System.Drawing.Size(1342, 703); - this.tabPageNeuropixelsV1B.TabIndex = 2; - this.tabPageNeuropixelsV1B.Text = "NeuropixelsV1B"; - this.tabPageNeuropixelsV1B.UseVisualStyleBackColor = true; - // - // panelNeuropixelsV1B - // - this.panelNeuropixelsV1B.AutoSize = true; - this.panelNeuropixelsV1B.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelNeuropixelsV1B.Location = new System.Drawing.Point(0, 0); - this.panelNeuropixelsV1B.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panelNeuropixelsV1B.Name = "panelNeuropixelsV1B"; - this.panelNeuropixelsV1B.Size = new System.Drawing.Size(1342, 703); - this.panelNeuropixelsV1B.TabIndex = 1; - // // NeuropixelsV1fHeadstageDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1356, 804); + this.ClientSize = new System.Drawing.Size(1334, 811); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.menuStrip1); this.DoubleBuffered = true; @@ -209,13 +209,13 @@ private void InitializeComponent() this.Text = "NeuropixelsV1f Headstage Configuration"; this.tabControl1.ResumeLayout(false); this.tabPageNeuropixelsV1A.ResumeLayout(false); + this.tabPageNeuropixelsV1B.ResumeLayout(false); + this.tabPageNeuropixelsV1B.PerformLayout(); this.tabPageBno055.ResumeLayout(false); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.ResumeLayout(false); - this.tabPageNeuropixelsV1B.ResumeLayout(false); - this.tabPageNeuropixelsV1B.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs index b9fdceaa..43ca5c08 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Drawing; using System.Linq; using System.Windows.Forms; using OpenEphys.ProbeInterface.NET; @@ -36,11 +34,12 @@ public NeuropixelsV2eChannelConfigurationDialog(NeuropixelsV2QuadShankProbeConfi ProbeConfiguration = probeConfiguration; - ZoomInBoundaryX = 600; - ZoomInBoundaryY = 600; + ZoomInBoundaryX = 300; + ZoomInBoundaryY = 300; HighlightEnabledContacts(); UpdateContactLabels(); + DrawScale(); RefreshZedGraph(); } @@ -81,7 +80,6 @@ internal override void ZoomEvent(ZedGraphControl sender, ZoomState oldState, Zoo base.ZoomEvent(sender, oldState, newState); UpdateFontSize(); - DrawScale(); RefreshZedGraph(); OnZoomHandler(); @@ -92,91 +90,21 @@ private void OnZoomHandler() OnZoom?.Invoke(this, EventArgs.Empty); } + internal override bool IsDrawScale() => true; + internal override void DrawScale() { - if (ProbeConfiguration == null) + if (ProbeConfiguration == null || zedGraphChannels.MasterPane.PaneList.Count < 2) return; - const string ScalePointsTag = "scale_points"; - const string ScaleTextTag = "scale_text"; - - zedGraphChannels.GraphPane.GraphObjList.RemoveAll(obj => obj is TextObj && obj.Tag is string tag && tag == ScaleTextTag); - zedGraphChannels.GraphPane.CurveList.RemoveAll(curve => curve.Tag is string tag && tag == ScalePointsTag); - - const int MajorTickIncrement = 100; - const int MajorTickLength = 10; - const int MinorTickIncrement = 10; - const int MinorTickLength = 5; - - if (ProbeConfiguration.ProbeGroup.Probes.ElementAt(0).SiUnits != ProbeSiUnits.um) - { - MessageBox.Show("Warning: Expected ProbeGroup units to be in microns, but it is in millimeters. Scale might not be accurate."); - } - - var fontSize = CalculateFontSize(); - - var zoomedOut = fontSize <= 2; - - fontSize = zoomedOut ? 8 : fontSize * 4; - var majorTickOffset = MajorTickLength + CalculateScaleRange(zedGraphChannels.GraphPane.XAxis.Scale) * 0.015; - majorTickOffset = majorTickOffset > 50 ? 50 : majorTickOffset; - - var x = GetProbeRight(zedGraphChannels.GraphPane.GraphObjList) + 50; - var minY = GetProbeBottom(zedGraphChannels.GraphPane.GraphObjList); - var maxY = GetProbeTop(zedGraphChannels.GraphPane.GraphObjList); - - int textPosition = 0; - - PointPairList pointList = new(); - - var countMajorTicks = 0; - - for (int i = (int)minY; i < maxY; i += MajorTickIncrement) - { - PointPair majorTickLocation = new(x + majorTickOffset, minY + MajorTickIncrement * countMajorTicks); - - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks)); - pointList.Add(majorTickLocation); - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks)); - - if (!zoomedOut || countMajorTicks % 5 == 0) - { - TextObj textObj = new($"{textPosition} µm\n", majorTickLocation.X + 5, majorTickLocation.Y, CoordType.AxisXYScale, AlignH.Left, AlignV.Center) - { - Tag = ScaleTextTag, - }; - textObj.FontSpec.Border.IsVisible = false; - textObj.FontSpec.Size = fontSize; - zedGraphChannels.GraphPane.GraphObjList.Add(textObj); - - textPosition += zoomedOut ? 5 * MajorTickIncrement : MajorTickIncrement; - } - - if (!zoomedOut) - { - var countMinorTicks = 1; - - for (int j = i + MinorTickIncrement; j < i + MajorTickIncrement && i + MinorTickIncrement * countMinorTicks < maxY; j += MinorTickIncrement) - { - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks + MinorTickIncrement * countMinorTicks)); - pointList.Add(new PointPair(x + MinorTickLength, minY + MajorTickIncrement * countMajorTicks + MinorTickIncrement * countMinorTicks)); - pointList.Add(new PointPair(x, minY + MajorTickIncrement * countMajorTicks + MinorTickIncrement * countMinorTicks)); - - countMinorTicks++; - } - } - - countMajorTicks++; - } - - var curve = zedGraphChannels.GraphPane.AddCurve("", pointList, Color.Black, SymbolType.None); + var pane = zedGraphChannels.MasterPane.PaneList[1]; - const float scaleBarWidth = 1; + pane.YAxis.Scale.Min = GetProbeBottom(zedGraphChannels.GraphPane.GraphObjList); + pane.YAxis.Scale.Max = GetProbeTop(zedGraphChannels.GraphPane.GraphObjList); - curve.Line.Width = scaleBarWidth; - curve.Label.IsVisible = false; - curve.Symbol.IsVisible = false; - curve.Tag = ScalePointsTag; + pane.YAxis.Scale.Format = "#####0' " + ProbeGroup.Probes.First().SiUnits.ToString() + "'"; + pane.YAxis.Scale.Mag = 0; + pane.YAxis.Scale.MagAuto = false; } internal override void HighlightEnabledContacts() diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eHeadstageDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eHeadstageDialog.Designer.cs index 35654a3b..f4371599 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eHeadstageDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eHeadstageDialog.Designer.cs @@ -52,7 +52,7 @@ private void InitializeComponent() // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(996, 2); + this.buttonCancel.Location = new System.Drawing.Point(1179, 2); this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(144, 32); @@ -63,7 +63,7 @@ private void InitializeComponent() // buttonOkay // this.buttonOkay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOkay.Location = new System.Drawing.Point(846, 2); + this.buttonOkay.Location = new System.Drawing.Point(1029, 2); this.buttonOkay.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.buttonOkay.Name = "buttonOkay"; this.buttonOkay.Size = new System.Drawing.Size(144, 32); @@ -80,14 +80,14 @@ private void InitializeComponent() this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 1, 0, 1); - this.menuStrip1.Size = new System.Drawing.Size(1151, 26); + this.menuStrip1.Size = new System.Drawing.Size(1334, 24); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 22); this.fileToolStripMenuItem.Text = "File"; // // tableLayoutPanel1 @@ -97,13 +97,13 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 26); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1151, 623); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1334, 787); this.tableLayoutPanel1.TabIndex = 3; // // tabControl1 @@ -115,7 +115,7 @@ private void InitializeComponent() this.tabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1145, 577); + this.tabControl1.Size = new System.Drawing.Size(1328, 741); this.tabControl1.TabIndex = 0; // // tabPageNeuropixelsV2e @@ -125,7 +125,7 @@ private void InitializeComponent() this.tabPageNeuropixelsV2e.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabPageNeuropixelsV2e.Name = "tabPageNeuropixelsV2e"; this.tabPageNeuropixelsV2e.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tabPageNeuropixelsV2e.Size = new System.Drawing.Size(1137, 548); + this.tabPageNeuropixelsV2e.Size = new System.Drawing.Size(1320, 712); this.tabPageNeuropixelsV2e.TabIndex = 0; this.tabPageNeuropixelsV2e.Text = "NeuropixelsV2e"; this.tabPageNeuropixelsV2e.UseVisualStyleBackColor = true; @@ -136,7 +136,7 @@ private void InitializeComponent() this.panelNeuropixelsV2e.Location = new System.Drawing.Point(3, 2); this.panelNeuropixelsV2e.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelNeuropixelsV2e.Name = "panelNeuropixelsV2e"; - this.panelNeuropixelsV2e.Size = new System.Drawing.Size(1131, 544); + this.panelNeuropixelsV2e.Size = new System.Drawing.Size(1314, 708); this.panelNeuropixelsV2e.TabIndex = 0; // // tabPageBno055 @@ -146,7 +146,7 @@ private void InitializeComponent() this.tabPageBno055.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabPageBno055.Name = "tabPageBno055"; this.tabPageBno055.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tabPageBno055.Size = new System.Drawing.Size(1137, 541); + this.tabPageBno055.Size = new System.Drawing.Size(1137, 548); this.tabPageBno055.TabIndex = 1; this.tabPageBno055.Text = "Bno055"; this.tabPageBno055.UseVisualStyleBackColor = true; @@ -158,7 +158,7 @@ private void InitializeComponent() this.panelBno055.Location = new System.Drawing.Point(3, 2); this.panelBno055.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelBno055.Name = "panelBno055"; - this.panelBno055.Size = new System.Drawing.Size(1131, 537); + this.panelBno055.Size = new System.Drawing.Size(1131, 544); this.panelBno055.TabIndex = 0; // // flowLayoutPanel1 @@ -169,17 +169,17 @@ private void InitializeComponent() this.flowLayoutPanel1.Controls.Add(this.buttonOkay); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 585); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 749); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1143, 34); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1326, 34); this.flowLayoutPanel1.TabIndex = 1; // // NeuropixelsV2eHeadstageDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1151, 649); + this.ClientSize = new System.Drawing.Size(1334, 811); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.menuStrip1); this.DoubleBuffered = true; diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs index 8f497b44..a8ef8153 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs @@ -643,7 +643,6 @@ private void DeselectContacts() private void ResetZoom() { ChannelConfiguration.ResetZoom(); - ChannelConfiguration.DrawScale(); ChannelConfiguration.RefreshZedGraph(); } diff --git a/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs index a3d72399..d7521ac5 100644 --- a/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs @@ -1,7 +1,6 @@ using System; using System.Linq; using System.Windows.Forms; -using Newtonsoft.Json; using OpenEphys.ProbeInterface.NET; using ZedGraph; @@ -33,6 +32,7 @@ public Rhs2116ChannelConfigurationDialog(Rhs2116ProbeGroup probeGroup) ZoomInBoundaryX = 5; ZoomInBoundaryY = 5; + DrawProbeGroup(); RefreshZedGraph(); } @@ -105,35 +105,5 @@ internal override string ContactString(int deviceChannelIndex, int index) return s; } - - // NB: Currently there is only a text label drawn as the scale for this dialog, used to denote the - // absolute orientation of the default probe group - internal override void DrawScale() - { - const string scaleTag = "scale"; - - zedGraphChannels.GraphPane.GraphObjList.RemoveAll(obj => obj.Tag is string tag && tag == scaleTag); - - bool isDefault = JsonConvert.SerializeObject(ProbeGroup) == JsonConvert.SerializeObject(new Rhs2116ProbeGroup()); - - if (isDefault) - { - var middle = GetProbeContourLeft(zedGraphChannels.GraphPane.GraphObjList) - + (GetProbeContourRight(zedGraphChannels.GraphPane.GraphObjList) - GetProbeContourLeft(zedGraphChannels.GraphPane.GraphObjList)) / 2; - var top = GetProbeContourTop(zedGraphChannels.GraphPane.GraphObjList); - - TextObj textObj = new("Tether Side", middle, top + 0.5, CoordType.AxisXYScale, AlignH.Center, AlignV.Center) - { - ZOrder = ZOrder.A_InFront, - Tag = scaleTag - }; - - SetTextObj(textObj); - - textObj.FontSpec.Size = CalculateFontSize(4.0); - - zedGraphChannels.GraphPane.GraphObjList.Add(textObj); - } - } } } diff --git a/OpenEphys.Onix1.Design/Rhs2116StimulusSequenceDialog.Designer.cs b/OpenEphys.Onix1.Design/Rhs2116StimulusSequenceDialog.Designer.cs index 2b37b51e..fc129368 100644 --- a/OpenEphys.Onix1.Design/Rhs2116StimulusSequenceDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/Rhs2116StimulusSequenceDialog.Designer.cs @@ -38,11 +38,13 @@ private void InitializeComponent() this.panelParameters = new System.Windows.Forms.Panel(); this.textBoxStepSize = new System.Windows.Forms.TextBox(); this.groupBoxCathode = new System.Windows.Forms.GroupBox(); + this.textboxAmplitudeCathodic = new System.Windows.Forms.TextBox(); this.labelAmplitudeCathodic = new System.Windows.Forms.Label(); this.labelPulseWidthCathodic = new System.Windows.Forms.Label(); this.textboxPulseWidthCathodic = new System.Windows.Forms.TextBox(); this.textboxAmplitudeCathodicRequested = new System.Windows.Forms.TextBox(); this.groupBoxAnode = new System.Windows.Forms.GroupBox(); + this.textboxAmplitudeAnodic = new System.Windows.Forms.TextBox(); this.labelAmplitudeAnodic = new System.Windows.Forms.Label(); this.labelPulseWidthAnodic = new System.Windows.Forms.Label(); this.textboxPulseWidthAnodic = new System.Windows.Forms.TextBox(); @@ -66,7 +68,6 @@ private void InitializeComponent() this.zedGraphWaveform = new ZedGraph.ZedGraphControl(); this.tabPageTable = new System.Windows.Forms.TabPage(); this.dataGridViewStimulusTable = new System.Windows.Forms.DataGridView(); - this.panelProbe = new System.Windows.Forms.Panel(); this.menuStrip = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.stimulusWaveformToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -76,8 +77,7 @@ private void InitializeComponent() this.groupBox1 = new System.Windows.Forms.GroupBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.textboxAmplitudeAnodic = new System.Windows.Forms.TextBox(); - this.textboxAmplitudeCathodic = new System.Windows.Forms.TextBox(); + this.panelProbe = new System.Windows.Forms.Panel(); this.statusStrip.SuspendLayout(); this.panelParameters.SuspendLayout(); this.groupBoxCathode.SuspendLayout(); @@ -126,14 +126,14 @@ private void InitializeComponent() this.toolStripStatusIsValid.Image = global::OpenEphys.Onix1.Design.Properties.Resources.StatusReadyImage; this.toolStripStatusIsValid.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.toolStripStatusIsValid.Name = "toolStripStatusIsValid"; - this.toolStripStatusIsValid.Size = new System.Drawing.Size(186, 20); + this.toolStripStatusIsValid.Size = new System.Drawing.Size(153, 21); this.toolStripStatusIsValid.Text = "Valid stimulus sequence"; this.toolStripStatusIsValid.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // toolStripStatusSlotsUsed // this.toolStripStatusSlotsUsed.Name = "toolStripStatusSlotsUsed"; - this.toolStripStatusSlotsUsed.Size = new System.Drawing.Size(132, 20); + this.toolStripStatusSlotsUsed.Size = new System.Drawing.Size(104, 21); this.toolStripStatusSlotsUsed.Text = "100% of slots used"; this.toolStripStatusSlotsUsed.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -204,6 +204,15 @@ private void InitializeComponent() this.groupBoxCathode.Text = "Cathode"; this.groupBoxCathode.Visible = false; // + // textboxAmplitudeCathodic + // + this.textboxAmplitudeCathodic.Location = new System.Drawing.Point(132, 39); + this.textboxAmplitudeCathodic.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.textboxAmplitudeCathodic.Name = "textboxAmplitudeCathodic"; + this.textboxAmplitudeCathodic.ReadOnly = true; + this.textboxAmplitudeCathodic.Size = new System.Drawing.Size(55, 22); + this.textboxAmplitudeCathodic.TabIndex = 9; + // // labelAmplitudeCathodic // this.labelAmplitudeCathodic.AutoSize = true; @@ -257,6 +266,15 @@ private void InitializeComponent() this.groupBoxAnode.TabStop = false; this.groupBoxAnode.Text = "Anode"; // + // textboxAmplitudeAnodic + // + this.textboxAmplitudeAnodic.Location = new System.Drawing.Point(129, 39); + this.textboxAmplitudeAnodic.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.textboxAmplitudeAnodic.Name = "textboxAmplitudeAnodic"; + this.textboxAmplitudeAnodic.ReadOnly = true; + this.textboxAmplitudeAnodic.Size = new System.Drawing.Size(55, 22); + this.textboxAmplitudeAnodic.TabIndex = 8; + // // labelAmplitudeAnodic // this.labelAmplitudeAnodic.AutoSize = true; @@ -362,7 +380,7 @@ private void InitializeComponent() this.checkBoxAnodicFirst.Location = new System.Drawing.Point(91, 33); this.checkBoxAnodicFirst.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkBoxAnodicFirst.Name = "checkBoxAnodicFirst"; - this.checkBoxAnodicFirst.Size = new System.Drawing.Size(99, 20); + this.checkBoxAnodicFirst.Size = new System.Drawing.Size(96, 20); this.checkBoxAnodicFirst.TabIndex = 16; this.checkBoxAnodicFirst.TabStop = false; this.checkBoxAnodicFirst.Text = "Anodic First"; @@ -428,7 +446,7 @@ private void InitializeComponent() this.checkboxBiphasicSymmetrical.Location = new System.Drawing.Point(43, 14); this.checkboxBiphasicSymmetrical.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.checkboxBiphasicSymmetrical.Name = "checkboxBiphasicSymmetrical"; - this.checkboxBiphasicSymmetrical.Size = new System.Drawing.Size(147, 20); + this.checkboxBiphasicSymmetrical.Size = new System.Drawing.Size(144, 20); this.checkboxBiphasicSymmetrical.TabIndex = 5; this.checkboxBiphasicSymmetrical.TabStop = false; this.checkboxBiphasicSymmetrical.Text = "Biphasic Symmetric"; @@ -464,7 +482,7 @@ private void InitializeComponent() this.tabControlVisualization.Name = "tabControlVisualization"; this.tableLayoutPanel1.SetRowSpan(this.tabControlVisualization, 2); this.tabControlVisualization.SelectedIndex = 0; - this.tabControlVisualization.Size = new System.Drawing.Size(1090, 675); + this.tabControlVisualization.Size = new System.Drawing.Size(1090, 679); this.tabControlVisualization.TabIndex = 6; // // tabPageWaveform @@ -474,7 +492,7 @@ private void InitializeComponent() this.tabPageWaveform.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabPageWaveform.Name = "tabPageWaveform"; this.tabPageWaveform.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tabPageWaveform.Size = new System.Drawing.Size(1082, 646); + this.tabPageWaveform.Size = new System.Drawing.Size(1082, 650); this.tabPageWaveform.TabIndex = 0; this.tabPageWaveform.Text = "Stimulus Waveform"; this.tabPageWaveform.UseVisualStyleBackColor = true; @@ -492,7 +510,7 @@ private void InitializeComponent() this.zedGraphWaveform.ScrollMinX = 0D; this.zedGraphWaveform.ScrollMinY = 0D; this.zedGraphWaveform.ScrollMinY2 = 0D; - this.zedGraphWaveform.Size = new System.Drawing.Size(1076, 642); + this.zedGraphWaveform.Size = new System.Drawing.Size(1076, 646); this.zedGraphWaveform.TabIndex = 4; this.zedGraphWaveform.UseExtendedPrintDialog = true; // @@ -503,7 +521,7 @@ private void InitializeComponent() this.tabPageTable.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tabPageTable.Name = "tabPageTable"; this.tabPageTable.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.tabPageTable.Size = new System.Drawing.Size(1082, 644); + this.tabPageTable.Size = new System.Drawing.Size(1082, 646); this.tabPageTable.TabIndex = 1; this.tabPageTable.Text = "Table"; this.tabPageTable.UseVisualStyleBackColor = true; @@ -521,21 +539,12 @@ private void InitializeComponent() this.dataGridViewStimulusTable.Name = "dataGridViewStimulusTable"; this.dataGridViewStimulusTable.RowHeadersWidth = 62; this.dataGridViewStimulusTable.RowTemplate.Height = 28; - this.dataGridViewStimulusTable.Size = new System.Drawing.Size(1076, 640); + this.dataGridViewStimulusTable.Size = new System.Drawing.Size(1076, 642); this.dataGridViewStimulusTable.TabIndex = 0; this.dataGridViewStimulusTable.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.DataGridViewStimulusTable_CellEndEdit); this.dataGridViewStimulusTable.DataBindingComplete += new System.Windows.Forms.DataGridViewBindingCompleteEventHandler(this.DataGridViewStimulusTable_DataBindingComplete); this.dataGridViewStimulusTable.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.DataGridViewStimulusTable_DataError); // - // panelProbe - // - this.panelProbe.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelProbe.Location = new System.Drawing.Point(1099, 2); - this.panelProbe.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panelProbe.Name = "panelProbe"; - this.panelProbe.Size = new System.Drawing.Size(445, 367); - this.panelProbe.TabIndex = 0; - // // menuStrip // this.menuStrip.ImageScalingSize = new System.Drawing.Size(24, 24); @@ -544,7 +553,7 @@ private void InitializeComponent() this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; this.menuStrip.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2); - this.menuStrip.Size = new System.Drawing.Size(1547, 28); + this.menuStrip.Size = new System.Drawing.Size(1547, 24); this.menuStrip.TabIndex = 7; this.menuStrip.Text = "menuStrip1"; // @@ -553,7 +562,7 @@ private void InitializeComponent() this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.stimulusWaveformToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24); + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // // stimulusWaveformToolStripMenuItem @@ -562,20 +571,20 @@ private void InitializeComponent() this.openFileToolStripMenuItem, this.saveFileToolStripMenuItem}); this.stimulusWaveformToolStripMenuItem.Name = "stimulusWaveformToolStripMenuItem"; - this.stimulusWaveformToolStripMenuItem.Size = new System.Drawing.Size(220, 26); + this.stimulusWaveformToolStripMenuItem.Size = new System.Drawing.Size(178, 22); this.stimulusWaveformToolStripMenuItem.Text = "Stimulus Waveform"; // // openFileToolStripMenuItem // this.openFileToolStripMenuItem.Name = "openFileToolStripMenuItem"; - this.openFileToolStripMenuItem.Size = new System.Drawing.Size(155, 26); + this.openFileToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.openFileToolStripMenuItem.Text = "Open File"; this.openFileToolStripMenuItem.Click += new System.EventHandler(this.MenuItemLoadFile_Click); // // saveFileToolStripMenuItem // this.saveFileToolStripMenuItem.Name = "saveFileToolStripMenuItem"; - this.saveFileToolStripMenuItem.Size = new System.Drawing.Size(155, 26); + this.saveFileToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.saveFileToolStripMenuItem.Text = "Save File"; this.saveFileToolStripMenuItem.Click += new System.EventHandler(this.MenuItemSaveFile_Click); // @@ -589,21 +598,21 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.tabControlVisualization, 0, 0); this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 28); + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 308F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1547, 721); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1547, 725); this.tableLayoutPanel1.TabIndex = 8; // // groupBox1 // this.groupBox1.Controls.Add(this.panelParameters); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox1.Location = new System.Drawing.Point(1099, 373); + this.groupBox1.Location = new System.Drawing.Point(1099, 377); this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); @@ -619,29 +628,20 @@ private void InitializeComponent() this.flowLayoutPanel1.Controls.Add(this.buttonOk); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 681); + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 685); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(1541, 38); this.flowLayoutPanel1.TabIndex = 7; // - // textboxAmplitudeAnodic - // - this.textboxAmplitudeAnodic.Location = new System.Drawing.Point(129, 39); - this.textboxAmplitudeAnodic.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.textboxAmplitudeAnodic.Name = "textboxAmplitudeAnodic"; - this.textboxAmplitudeAnodic.ReadOnly = true; - this.textboxAmplitudeAnodic.Size = new System.Drawing.Size(55, 22); - this.textboxAmplitudeAnodic.TabIndex = 8; - // - // textboxAmplitudeCathodic + // panelProbe // - this.textboxAmplitudeCathodic.Location = new System.Drawing.Point(132, 39); - this.textboxAmplitudeCathodic.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.textboxAmplitudeCathodic.Name = "textboxAmplitudeCathodic"; - this.textboxAmplitudeCathodic.ReadOnly = true; - this.textboxAmplitudeCathodic.Size = new System.Drawing.Size(55, 22); - this.textboxAmplitudeCathodic.TabIndex = 9; + this.panelProbe.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelProbe.Location = new System.Drawing.Point(1099, 2); + this.panelProbe.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.panelProbe.Name = "panelProbe"; + this.panelProbe.Size = new System.Drawing.Size(445, 371); + this.panelProbe.TabIndex = 0; // // Rhs2116StimulusSequenceDialog // @@ -720,7 +720,6 @@ private void InitializeComponent() private System.Windows.Forms.MenuStrip menuStrip; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private ZedGraph.ZedGraphControl zedGraphWaveform; - private System.Windows.Forms.Panel panelProbe; private System.Windows.Forms.ToolStripMenuItem stimulusWaveformToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem openFileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem saveFileToolStripMenuItem; @@ -731,5 +730,6 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TextBox textboxAmplitudeCathodic; private System.Windows.Forms.TextBox textboxAmplitudeAnodic; + private System.Windows.Forms.Panel panelProbe; } } From 0599a37dfcc02934c9f03a2666dd6a2dc2db9d44 Mon Sep 17 00:00:00 2001 From: bparks13 Date: Tue, 23 Sep 2025 16:46:19 -0400 Subject: [PATCH 3/4] Address review comments - Change background color to WhiteSmoke to provide visual difference between background and probe - Decrease scale line thickness, and remove boldness from text - Round the X/Y values when resizing panes to avoid a visual flickering effect --- .../ChannelConfigurationDialog.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs index e80044e6..5f1c9026 100644 --- a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs @@ -62,6 +62,12 @@ public ChannelConfigurationDialog(ProbeGroup probeGroup) InitializeZedGraphControl(zedGraphChannels); InitializeProbePane(zedGraphChannels.GraphPane); + + foreach (var pane in zedGraphChannels.MasterPane.PaneList) + { + pane.Chart.Fill = new Fill(Color.WhiteSmoke); + } + DrawProbeGroup(); RefreshZedGraph(); } @@ -926,7 +932,7 @@ static void InitializeScalePane(GraphPane pane) pane.YAxis.Scale.BaseTic = 0; pane.YAxis.Scale.IsLabelsInside = true; pane.YAxis.Scale.FontSpec.Size = 65f; - pane.YAxis.Scale.FontSpec.IsBold = true; + pane.YAxis.Scale.FontSpec.IsBold = false; pane.YAxis.Scale.LabelGap = 0.6f; pane.YAxis.MinorTic.IsInside = false; @@ -937,7 +943,7 @@ static void InitializeScalePane(GraphPane pane) pane.YAxis.MajorTic.IsOutside = false; pane.YAxis.MajorTic.IsOpposite = false; pane.YAxis.MajorTic.Size = 40f; - pane.YAxis.MajorTic.PenWidth = 2f; + pane.YAxis.MajorTic.PenWidth = 1.5f; } static void InitializeProbePane(GraphPane graphPane) @@ -1004,8 +1010,6 @@ internal void ResizeZedGraph() zedGraphChannels.MasterPane.PaneList[0].Rect = new RectangleF(rect.Left, rect.Top, squareSize, squareSize); zedGraphChannels.MasterPane.PaneList[1].Rect = new RectangleF(rect.Left + squareSize, rect.Top, rect.Width - squareSize, squareSize); - - zedGraphChannels.MasterPane.PaneList[1].Margin.Left = 10; } UpdateFontSize(); @@ -1038,8 +1042,8 @@ void ResizeAxes() width = desiredWidth; } - float x = rect.Left + (rect.Width - width) / 2f; - float y = rect.Top + (rect.Height - height) / 2f; + float x = MathF.Round(rect.Left + (rect.Width - width) / 2f); + float y = MathF.Round(rect.Top + (rect.Height - height) / 2f); var newRect = new RectangleF(x, y, width, height); From 4141c4c3c32e349d5b2bee232b2276b3e28f9d9a Mon Sep 17 00:00:00 2001 From: bparks13 Date: Tue, 30 Sep 2025 11:33:55 -0400 Subject: [PATCH 4/4] Allow probe to go outside of view - Add a button that resets the zoom for the channel configuration dialog - Removed the Reset Zoom buttons from the Neuropixels device dialogs, as it is the same as the new one added to the base dialog - Leave the zoom in boundaries to the default, except for Rhs2116 where it is decreased --- .../ChannelConfigurationDialog.Designer.cs | 61 ++++++++- .../ChannelConfigurationDialog.cs | 65 ++-------- ...NeuropixelsV1ChannelConfigurationDialog.cs | 3 - ...xelsV1ProbeConfigurationDialog.Designer.cs | 118 ++++++++---------- .../NeuropixelsV1ProbeConfigurationDialog.cs | 11 -- ...europixelsV2eChannelConfigurationDialog.cs | 3 - ...elsV2eProbeConfigurationDialog.Designer.cs | 23 +--- .../NeuropixelsV2eProbeConfigurationDialog.cs | 11 -- .../Rhs2116ChannelConfigurationDialog.cs | 4 +- 9 files changed, 124 insertions(+), 175 deletions(-) diff --git a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.Designer.cs b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.Designer.cs index aa104537..825cee24 100644 --- a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.Designer.cs @@ -31,7 +31,10 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChannelConfigurationDialog)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.zedGraphChannels = new ZedGraph.ZedGraphControl(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.buttonResetZoom = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.menuStrip = new System.Windows.Forms.MenuStrip(); @@ -43,6 +46,11 @@ private void InitializeComponent() this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); this.menuStrip.SuspendLayout(); this.SuspendLayout(); // @@ -58,7 +66,7 @@ private void InitializeComponent() // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.zedGraphChannels); + this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); // // splitContainer1.Panel2 // @@ -68,6 +76,26 @@ private void InitializeComponent() this.splitContainer1.SplitterDistance = 513; this.splitContainer1.TabIndex = 0; // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer2.IsSplitterFixed = true; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.zedGraphChannels); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.flowLayoutPanel1); + this.splitContainer2.Size = new System.Drawing.Size(609, 513); + this.splitContainer2.SplitterDistance = 480; + this.splitContainer2.TabIndex = 5; + // // zedGraphChannels // this.zedGraphChannels.AutoSize = true; @@ -82,11 +110,30 @@ private void InitializeComponent() this.zedGraphChannels.ScrollMinX = 0D; this.zedGraphChannels.ScrollMinY = 0D; this.zedGraphChannels.ScrollMinY2 = 0D; - this.zedGraphChannels.Size = new System.Drawing.Size(609, 513); + this.zedGraphChannels.Size = new System.Drawing.Size(609, 480); this.zedGraphChannels.TabIndex = 4; this.zedGraphChannels.UseExtendedPrintDialog = true; this.zedGraphChannels.ZoomEvent += new ZedGraph.ZedGraphControl.ZoomEventHandler(this.ZoomEvent); // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.buttonResetZoom); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(609, 29); + this.flowLayoutPanel1.TabIndex = 0; + // + // buttonResetZoom + // + this.buttonResetZoom.Location = new System.Drawing.Point(3, 3); + this.buttonResetZoom.Name = "buttonResetZoom"; + this.buttonResetZoom.Size = new System.Drawing.Size(120, 28); + this.buttonResetZoom.TabIndex = 0; + this.buttonResetZoom.Text = "Reset Zoom"; + this.buttonResetZoom.UseVisualStyleBackColor = true; + this.buttonResetZoom.Click += new System.EventHandler(this.ButtonResetZoom_Click); + // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -168,10 +215,15 @@ private void InitializeComponent() this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Channel Configuration"; this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel1.PerformLayout(); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + this.flowLayoutPanel1.ResumeLayout(false); this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.ResumeLayout(false); @@ -190,5 +242,8 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem dropDownOpenFile; private System.Windows.Forms.ToolStripMenuItem dropDownSaveFile; private System.Windows.Forms.ToolStripMenuItem dropDownLoadDefault; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.Button buttonResetZoom; } } diff --git a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs index 5f1c9026..555e9995 100644 --- a/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs @@ -115,8 +115,6 @@ internal virtual void ZoomEvent(ZedGraphControl sender, ZoomState oldState, Zoom } } - CheckProbeIsInView(sender); - if (IsDrawScale()) SyncYAxes(zedGraphChannels.MasterPane.PaneList[0], zedGraphChannels.MasterPane.PaneList[1]); } @@ -183,56 +181,6 @@ private void CenterAxesOnCursor(ZedGraphControl zedGraphControl) zedGraphControl.GraphPane.YAxis.Scale.Max += diffY; } - private static void CheckProbeIsInView(ZedGraphControl zedGraphControl) - { - var probe = ( - XMin: GetProbeLeft(zedGraphControl.GraphPane.GraphObjList), - XMax: GetProbeRight(zedGraphControl.GraphPane.GraphObjList), - YMin: GetProbeBottom(zedGraphControl.GraphPane.GraphObjList), - YMax: GetProbeTop(zedGraphControl.GraphPane.GraphObjList) - ); - - var axis = ( - XMin: zedGraphControl.GraphPane.XAxis.Scale.Min, - XMax: zedGraphControl.GraphPane.XAxis.Scale.Max, - YMin: zedGraphControl.GraphPane.YAxis.Scale.Min, - YMax: zedGraphControl.GraphPane.YAxis.Scale.Max - ); - - var pane = zedGraphControl.GraphPane; - - static void EnsureVisible(ref double axisMin, ref double axisMax, double probeMin, double probeMax) - { - if (axisMin > probeMin && axisMax > probeMax) - { - double diffMin = Math.Abs(axisMin - probeMin); - double diffMax = Math.Abs(axisMax - probeMax); - - double shift = (axisMax - diffMin > probeMax) ? diffMin : diffMax; - axisMin -= shift; - axisMax -= shift; - } - else if (axisMax < probeMax && axisMin < probeMin) - { - double diffMin = Math.Abs(axisMin - probeMin); - double diffMax = Math.Abs(axisMax - probeMax); - - double shift = (axisMin + diffMax > probeMin) ? diffMin : diffMax; - axisMin += shift; - axisMax += shift; - } - } - - EnsureVisible(ref axis.XMin, ref axis.XMax, probe.XMin, probe.XMax); - EnsureVisible(ref axis.YMax, ref axis.YMin, probe.YMax, probe.YMin); - - pane.XAxis.Scale.Min = axis.XMin; - pane.XAxis.Scale.Max = axis.XMax; - - pane.YAxis.Scale.Min = axis.YMin; - pane.YAxis.Scale.Max = axis.YMax; - } - internal static double CalculateScaleRange(Scale scale) { return scale.Max - scale.Min; @@ -929,7 +877,6 @@ static void InitializeScalePane(GraphPane pane) pane.YAxis.Scale.IsPreventLabelOverlap = true; pane.YAxis.Scale.MajorStep = 100; - pane.YAxis.Scale.BaseTic = 0; pane.YAxis.Scale.IsLabelsInside = true; pane.YAxis.Scale.FontSpec.Size = 65f; pane.YAxis.Scale.FontSpec.IsBold = false; @@ -1196,8 +1143,6 @@ private bool MouseMoveEvent(ZedGraphControl sender, MouseEventArgs e) if (IsDrawScale()) SyncYAxes(zedGraphChannels.MasterPane.PaneList[0], zedGraphChannels.MasterPane.PaneList[1]); - CheckProbeIsInView(sender); - return false; } else if (e.Button == MouseButtons.None) @@ -1366,5 +1311,15 @@ internal static bool HasContactAnnotations(ProbeGroup probeGroup) return false; } + + private void ButtonResetZoom_Click(object sender, EventArgs e) + { + ResetZoom(); + + if (IsDrawScale()) + SyncYAxes(zedGraphChannels.MasterPane.PaneList[0], zedGraphChannels.MasterPane.PaneList[1]); + + RefreshZedGraph(); + } } } diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs index 8e745440..afe9cdf9 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1ChannelConfigurationDialog.cs @@ -39,9 +39,6 @@ public NeuropixelsV1ChannelConfigurationDialog(NeuropixelsV1ProbeConfiguration p ProbeConfiguration = probeConfiguration; - ZoomInBoundaryX = 200; - ZoomInBoundaryY = 200; - HighlightEnabledContacts(); UpdateContactLabels(); DrawScale(); diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs index 2c3ddd34..2875914d 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.Designer.cs @@ -51,9 +51,12 @@ private void InitializeComponent() this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.panelProbe = new System.Windows.Forms.Panel(); this.panelTrackBar = new System.Windows.Forms.Panel(); this.trackBarProbePosition = new System.Windows.Forms.TrackBar(); + this.panelProbe = new System.Windows.Forms.Panel(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOkay = new System.Windows.Forms.Button(); this.panelOptions = new System.Windows.Forms.Panel(); this.checkBoxInvertPolarity = new System.Windows.Forms.CheckBox(); this.textBoxLfpCorrection = new System.Windows.Forms.TextBox(); @@ -64,16 +67,12 @@ private void InitializeComponent() this.buttonEnableContacts = new System.Windows.Forms.Button(); this.buttonClearSelections = new System.Windows.Forms.Button(); this.comboBoxChannelPresets = new System.Windows.Forms.ComboBox(); - this.buttonResetZoom = new System.Windows.Forms.Button(); this.checkBoxSpikeFilter = new System.Windows.Forms.CheckBox(); this.textBoxAdcCalibrationFile = new System.Windows.Forms.TextBox(); this.textBoxGainCalibrationFile = new System.Windows.Forms.TextBox(); this.comboBoxReference = new System.Windows.Forms.ComboBox(); this.comboBoxLfpGain = new System.Windows.Forms.ComboBox(); this.comboBoxApGain = new System.Windows.Forms.ComboBox(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.buttonOkay = new System.Windows.Forms.Button(); label1 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label(); label4 = new System.Windows.Forms.Label(); @@ -91,8 +90,8 @@ private void InitializeComponent() this.tableLayoutPanel1.SuspendLayout(); this.panelTrackBar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBarProbePosition)).BeginInit(); - this.panelOptions.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); + this.panelOptions.SuspendLayout(); this.SuspendLayout(); // // label1 @@ -294,16 +293,6 @@ private void InitializeComponent() this.tableLayoutPanel1.Size = new System.Drawing.Size(1234, 712); this.tableLayoutPanel1.TabIndex = 37; // - // panelProbe - // - this.panelProbe.BackColor = System.Drawing.SystemColors.Control; - this.panelProbe.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelProbe.Location = new System.Drawing.Point(4, 4); - this.panelProbe.Margin = new System.Windows.Forms.Padding(4); - this.panelProbe.Name = "panelProbe"; - this.panelProbe.Size = new System.Drawing.Size(851, 662); - this.panelProbe.TabIndex = 0; - // // panelTrackBar // this.panelTrackBar.Controls.Add(label1); @@ -335,6 +324,51 @@ private void InitializeComponent() this.trackBarProbePosition.Value = 50; this.trackBarProbePosition.Scroll += new System.EventHandler(this.TrackBarScroll); // + // panelProbe + // + this.panelProbe.BackColor = System.Drawing.SystemColors.Control; + this.panelProbe.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelProbe.Location = new System.Drawing.Point(4, 4); + this.panelProbe.Margin = new System.Windows.Forms.Padding(4); + this.panelProbe.Name = "panelProbe"; + this.panelProbe.Size = new System.Drawing.Size(851, 662); + this.panelProbe.TabIndex = 0; + // + // flowLayoutPanel1 + // + this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 3); + this.flowLayoutPanel1.Controls.Add(this.buttonCancel); + this.flowLayoutPanel1.Controls.Add(this.buttonOkay); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 672); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(1228, 38); + this.flowLayoutPanel1.TabIndex = 0; + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(1114, 2); + this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(111, 34); + this.buttonCancel.TabIndex = 1; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // buttonOkay + // + this.buttonOkay.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOkay.Location = new System.Drawing.Point(997, 2); + this.buttonOkay.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonOkay.Name = "buttonOkay"; + this.buttonOkay.Size = new System.Drawing.Size(111, 34); + this.buttonOkay.TabIndex = 0; + this.buttonOkay.Text = "OK"; + this.buttonOkay.UseVisualStyleBackColor = true; + // // panelOptions // this.panelOptions.BackColor = System.Drawing.SystemColors.ControlLightLight; @@ -351,7 +385,6 @@ private void InitializeComponent() this.panelOptions.Controls.Add(this.buttonClearSelections); this.panelOptions.Controls.Add(this.comboBoxChannelPresets); this.panelOptions.Controls.Add(labelPresets); - this.panelOptions.Controls.Add(this.buttonResetZoom); this.panelOptions.Controls.Add(this.checkBoxSpikeFilter); this.panelOptions.Controls.Add(this.textBoxAdcCalibrationFile); this.panelOptions.Controls.Add(adcCalibrationFile); @@ -480,19 +513,6 @@ private void InitializeComponent() this.comboBoxChannelPresets.Size = new System.Drawing.Size(195, 24); this.comboBoxChannelPresets.TabIndex = 26; // - // buttonResetZoom - // - this.buttonResetZoom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.buttonResetZoom.Location = new System.Drawing.Point(13, 562); - this.buttonResetZoom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.buttonResetZoom.Name = "buttonResetZoom"; - this.buttonResetZoom.Size = new System.Drawing.Size(284, 44); - this.buttonResetZoom.TabIndex = 22; - this.buttonResetZoom.Text = "Reset Zoom"; - this.buttonResetZoom.UseVisualStyleBackColor = true; - this.buttonResetZoom.Click += new System.EventHandler(this.ResetZoom_Click); - // // checkBoxSpikeFilter // this.checkBoxSpikeFilter.AutoSize = true; @@ -564,41 +584,6 @@ private void InitializeComponent() this.comboBoxApGain.Size = new System.Drawing.Size(195, 24); this.comboBoxApGain.TabIndex = 1; // - // flowLayoutPanel1 - // - this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 3); - this.flowLayoutPanel1.Controls.Add(this.buttonCancel); - this.flowLayoutPanel1.Controls.Add(this.buttonOkay); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 672); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1228, 38); - this.flowLayoutPanel1.TabIndex = 0; - // - // buttonCancel - // - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(1114, 2); - this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(111, 34); - this.buttonCancel.TabIndex = 1; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - // - // buttonOkay - // - this.buttonOkay.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOkay.Location = new System.Drawing.Point(997, 2); - this.buttonOkay.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.buttonOkay.Name = "buttonOkay"; - this.buttonOkay.Size = new System.Drawing.Size(111, 34); - this.buttonOkay.TabIndex = 0; - this.buttonOkay.Text = "OK"; - this.buttonOkay.UseVisualStyleBackColor = true; - // // NeuropixelsV1ProbeConfigurationDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -620,9 +605,9 @@ private void InitializeComponent() this.panelTrackBar.ResumeLayout(false); this.panelTrackBar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.trackBarProbePosition)).EndInit(); + this.flowLayoutPanel1.ResumeLayout(false); this.panelOptions.ResumeLayout(false); this.panelOptions.PerformLayout(); - this.flowLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -649,7 +634,6 @@ private void InitializeComponent() private System.Windows.Forms.Button buttonEnableContacts; private System.Windows.Forms.Button buttonClearSelections; private System.Windows.Forms.ComboBox comboBoxChannelPresets; - private System.Windows.Forms.Button buttonResetZoom; private System.Windows.Forms.CheckBox checkBoxSpikeFilter; internal System.Windows.Forms.TextBox textBoxAdcCalibrationFile; internal System.Windows.Forms.TextBox textBoxGainCalibrationFile; diff --git a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs index 78dceaa9..7a65bf95 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV1ProbeConfigurationDialog.cs @@ -376,11 +376,6 @@ private void ChooseAdcCalibrationFile_Click(object sender, EventArgs e) CheckStatus(); } - private void ResetZoom_Click(object sender, EventArgs e) - { - ResetZoom(); - } - private void ClearSelection_Click(object sender, EventArgs e) { DeselectContacts(); @@ -450,12 +445,6 @@ private void DeselectContacts() ChannelConfiguration.RefreshZedGraph(); } - private void ResetZoom() - { - ChannelConfiguration.ResetZoom(); - ChannelConfiguration.RefreshZedGraph(); - } - private void MoveToVerticalPosition(float relativePosition) { ChannelConfiguration.MoveToVerticalPosition(relativePosition); diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs index 43ca5c08..32d2cd81 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eChannelConfigurationDialog.cs @@ -34,9 +34,6 @@ public NeuropixelsV2eChannelConfigurationDialog(NeuropixelsV2QuadShankProbeConfi ProbeConfiguration = probeConfiguration; - ZoomInBoundaryX = 300; - ZoomInBoundaryY = 300; - HighlightEnabledContacts(); UpdateContactLabels(); DrawScale(); diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs index e6275f57..c82733d6 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.Designer.cs @@ -43,7 +43,6 @@ private void InitializeComponent() this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.buttonEnableContacts = new System.Windows.Forms.Button(); this.buttonClearSelections = new System.Windows.Forms.Button(); - this.buttonResetZoom = new System.Windows.Forms.Button(); this.buttonChooseCalibrationFile = new System.Windows.Forms.Button(); this.panelProbe = new System.Windows.Forms.Panel(); this.panelTrackBar = new System.Windows.Forms.Panel(); @@ -200,20 +199,6 @@ private void InitializeComponent() this.buttonClearSelections.UseVisualStyleBackColor = true; this.buttonClearSelections.Click += new System.EventHandler(this.ClearSelection_Click); // - // buttonResetZoom - // - this.buttonResetZoom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.buttonResetZoom.Location = new System.Drawing.Point(15, 325); - this.buttonResetZoom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.buttonResetZoom.Name = "buttonResetZoom"; - this.buttonResetZoom.Size = new System.Drawing.Size(280, 44); - this.buttonResetZoom.TabIndex = 4; - this.buttonResetZoom.Text = "Reset Zoom"; - this.toolTip.SetToolTip(this.buttonResetZoom, "Reset the zoom in the probe view so that the probe is zoomed out and centered."); - this.buttonResetZoom.UseVisualStyleBackColor = true; - this.buttonResetZoom.Click += new System.EventHandler(this.ResetZoom_Click); - // // buttonChooseCalibrationFile // this.buttonChooseCalibrationFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -244,7 +229,7 @@ private void InitializeComponent() this.panelTrackBar.Controls.Add(this.trackBarProbePosition); this.panelTrackBar.Dock = System.Windows.Forms.DockStyle.Fill; this.panelTrackBar.Location = new System.Drawing.Point(863, 4); - this.panelTrackBar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.panelTrackBar.Margin = new System.Windows.Forms.Padding(4); this.panelTrackBar.Name = "panelTrackBar"; this.panelTrackBar.Size = new System.Drawing.Size(52, 658); this.panelTrackBar.TabIndex = 30; @@ -284,7 +269,6 @@ private void InitializeComponent() this.panelChannelOptions.Controls.Add(labelPresets); this.panelChannelOptions.Controls.Add(this.buttonEnableContacts); this.panelChannelOptions.Controls.Add(this.buttonClearSelections); - this.panelChannelOptions.Controls.Add(this.buttonResetZoom); this.panelChannelOptions.Dock = System.Windows.Forms.DockStyle.Fill; this.panelChannelOptions.Location = new System.Drawing.Point(922, 2); this.panelChannelOptions.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); @@ -390,7 +374,7 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.panelChannelOptions, 2, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); @@ -406,7 +390,7 @@ private void InitializeComponent() this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 670); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(1226, 38); this.flowLayoutPanel1.TabIndex = 2; @@ -480,7 +464,6 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox comboBoxChannelPresets; private System.Windows.Forms.Button buttonEnableContacts; private System.Windows.Forms.Button buttonClearSelections; - private System.Windows.Forms.Button buttonResetZoom; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.TextBox textBoxGainCorrection; diff --git a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs index a8ef8153..851782fb 100644 --- a/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/NeuropixelsV2eProbeConfigurationDialog.cs @@ -604,11 +604,6 @@ internal void ChooseCalibrationFile_Click(object sender, EventArgs e) CheckStatus(); } - internal void ResetZoom_Click(object sender, EventArgs e) - { - ResetZoom(); - } - internal void ClearSelection_Click(object sender, EventArgs e) { DeselectContacts(); @@ -640,12 +635,6 @@ private void DeselectContacts() ChannelConfiguration.RefreshZedGraph(); } - private void ResetZoom() - { - ChannelConfiguration.ResetZoom(); - ChannelConfiguration.RefreshZedGraph(); - } - private void MoveToVerticalPosition(float relativePosition) { ChannelConfiguration.MoveToVerticalPosition(relativePosition); diff --git a/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs b/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs index d7521ac5..6d99c8e3 100644 --- a/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs +++ b/OpenEphys.Onix1.Design/Rhs2116ChannelConfigurationDialog.cs @@ -29,8 +29,8 @@ public Rhs2116ChannelConfigurationDialog(Rhs2116ProbeGroup probeGroup) zedGraphChannels.ZoomStepFraction = 0.5; - ZoomInBoundaryX = 5; - ZoomInBoundaryY = 5; + ZoomInBoundaryX = 2; + ZoomInBoundaryY = 2; DrawProbeGroup(); RefreshZedGraph();