From 960e855301b15f339b750cba17beb508c89e7146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B0=D0=BD=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A5=D0=BE=D0=B7=D1=8F=D0=B5=D0=BD=D0=BE=D0=BA?= Date: Fri, 12 Jul 2024 12:05:33 +0700 Subject: [PATCH] =?UTF-8?q?=D0=95=D1=81=D0=BB=D0=B8=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4=D0=BD=D0=BE=20=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D0=B5=200.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AnchorsTest/Controller.cs | 7 +- AnchorsTest/MainWindowForm.Designer.cs | 92 +++++++++++++++++++++++--- AnchorsTest/MainWindowForm.cs | 41 ++++++++++++ AnchorsTest/TagAnalyzer.cs | 25 +++---- 4 files changed, 140 insertions(+), 25 deletions(-) diff --git a/AnchorsTest/Controller.cs b/AnchorsTest/Controller.cs index 6f6367f..c3f4dc5 100644 --- a/AnchorsTest/Controller.cs +++ b/AnchorsTest/Controller.cs @@ -913,7 +913,9 @@ namespace AnchorsTest public void LoafForms() { MainWindowForm.Instance.GridViewAnchorState.DataSource = _anchors; - + MainWindowForm.Instance.GridViewGroupState.DataSource = _anchorsGroups; + MainWindowForm.Instance.GridViewFinalGroupState.DataSource = _finalyAncorGroupStates; + MainWindowForm.Instance.GridViewEngineState.DataSource = _engines; } public void SaveToExcel() { @@ -929,7 +931,8 @@ namespace AnchorsTest sheet.Column(column++).Hide(); sheet.Column(column++).Hide(); sheet.Column(column++).Hide(); - sheet.Column(column++).Hide(); + sheet.Column(column).AdjustToContents(); + sheet.Column(column++).Style.NumberFormat.Format = "0.00%"; sheet.Column(column++).Hide(); sheet.Column(column).AdjustToContents(); sheet.Column(column++).Style.NumberFormat.Format = "0.00%"; diff --git a/AnchorsTest/MainWindowForm.Designer.cs b/AnchorsTest/MainWindowForm.Designer.cs index 6cde6f7..109d4cf 100644 --- a/AnchorsTest/MainWindowForm.Designer.cs +++ b/AnchorsTest/MainWindowForm.Designer.cs @@ -34,6 +34,7 @@ B_ChooseFile1 = new Button(); tabControl1 = new TabControl(); tabPage1 = new TabPage(); + button2 = new Button(); button1 = new Button(); label1 = new Label(); textBox3 = new TextBox(); @@ -54,14 +55,24 @@ tableLayoutPanel1 = new TableLayoutPanel(); StatusLabel = new Label(); backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); - button2 = new Button(); + dataGridView2 = new DataGridView(); + tabPage5 = new TabPage(); + dataGridView3 = new DataGridView(); + tabPage6 = new TabPage(); + dataGridView4 = new DataGridView(); tabControl1.SuspendLayout(); tabPage1.SuspendLayout(); tabPage2.SuspendLayout(); tabControl2.SuspendLayout(); tabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); + tabPage4.SuspendLayout(); tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit(); + tabPage5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView3).BeginInit(); + tabPage6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView4).BeginInit(); SuspendLayout(); // // StartRecord @@ -131,6 +142,16 @@ tabPage1.Text = "tabPage1"; tabPage1.UseVisualStyleBackColor = true; // + // button2 + // + button2.Location = new Point(81, 135); + button2.Name = "button2"; + button2.Size = new Size(75, 23); + button2.TabIndex = 15; + button2.Text = "Показать"; + button2.UseVisualStyleBackColor = true; + button2.Click += button2_Click; + // // button1 // button1.Location = new Point(81, 164); @@ -256,6 +277,8 @@ // tabControl2.Controls.Add(tabPage3); tabControl2.Controls.Add(tabPage4); + tabControl2.Controls.Add(tabPage5); + tabControl2.Controls.Add(tabPage6); tabControl2.Dock = DockStyle.Fill; tabControl2.Location = new Point(3, 3); tabControl2.Name = "tabControl2"; @@ -285,6 +308,7 @@ // // tabPage4 // + tabPage4.Controls.Add(dataGridView2); tabPage4.Location = new Point(4, 24); tabPage4.Name = "tabPage4"; tabPage4.Padding = new Padding(3); @@ -317,15 +341,54 @@ StatusLabel.TabIndex = 4; StatusLabel.Text = "label4"; // - // button2 + // dataGridView2 // - button2.Location = new Point(81, 135); - button2.Name = "button2"; - button2.Size = new Size(75, 23); - button2.TabIndex = 15; - button2.Text = "button2"; - button2.UseVisualStyleBackColor = true; - button2.Click += button2_Click; + dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView2.Dock = DockStyle.Fill; + dataGridView2.Location = new Point(3, 3); + dataGridView2.Name = "dataGridView2"; + dataGridView2.Size = new Size(968, 377); + dataGridView2.TabIndex = 1; + // + // tabPage5 + // + tabPage5.Controls.Add(dataGridView3); + tabPage5.Location = new Point(4, 24); + tabPage5.Name = "tabPage5"; + tabPage5.Padding = new Padding(3); + tabPage5.Size = new Size(974, 383); + tabPage5.TabIndex = 2; + tabPage5.Text = "tabPage5"; + tabPage5.UseVisualStyleBackColor = true; + // + // dataGridView3 + // + dataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView3.Dock = DockStyle.Fill; + dataGridView3.Location = new Point(3, 3); + dataGridView3.Name = "dataGridView3"; + dataGridView3.Size = new Size(968, 377); + dataGridView3.TabIndex = 2; + // + // tabPage6 + // + tabPage6.Controls.Add(dataGridView4); + tabPage6.Location = new Point(4, 24); + tabPage6.Name = "tabPage6"; + tabPage6.Padding = new Padding(3); + tabPage6.Size = new Size(974, 383); + tabPage6.TabIndex = 3; + tabPage6.Text = "tabPage6"; + tabPage6.UseVisualStyleBackColor = true; + // + // dataGridView4 + // + dataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView4.Dock = DockStyle.Fill; + dataGridView4.Location = new Point(3, 3); + dataGridView4.Name = "dataGridView4"; + dataGridView4.Size = new Size(968, 377); + dataGridView4.TabIndex = 2; // // MainWindowForm // @@ -342,8 +405,14 @@ tabControl2.ResumeLayout(false); tabPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); + tabPage4.ResumeLayout(false); tableLayoutPanel1.ResumeLayout(false); tableLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit(); + tabPage5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridView3).EndInit(); + tabPage6.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridView4).EndInit(); ResumeLayout(false); } @@ -375,5 +444,10 @@ private Label StatusLabel; private Button button1; private Button button2; + private DataGridView dataGridView2; + private TabPage tabPage5; + private DataGridView dataGridView3; + private TabPage tabPage6; + private DataGridView dataGridView4; } } diff --git a/AnchorsTest/MainWindowForm.cs b/AnchorsTest/MainWindowForm.cs index 3d6eaa0..e684432 100644 --- a/AnchorsTest/MainWindowForm.cs +++ b/AnchorsTest/MainWindowForm.cs @@ -20,6 +20,47 @@ namespace AnchorsTest dataGridView1 = value; } } + + public DataGridView GridViewGroupState + { + get + { + return dataGridView2; + } + + set + { + dataGridView2 = value; + } + } + + public DataGridView GridViewFinalGroupState + { + get + { + return dataGridView3; + } + + set + { + dataGridView3 = value; + } + } + + public DataGridView GridViewEngineState + { + get + { + return dataGridView4; + } + + set + { + dataGridView4 = value; + } + } + + public Label LabelFile1Path { get diff --git a/AnchorsTest/TagAnalyzer.cs b/AnchorsTest/TagAnalyzer.cs index 5c2b269..b3827ae 100644 --- a/AnchorsTest/TagAnalyzer.cs +++ b/AnchorsTest/TagAnalyzer.cs @@ -398,27 +398,24 @@ namespace AnchorsTest finalyState.name = data.AncGroupName; } - finalyState.ZAverage = (finalyState.ZAverage * finalyState.count + data.Z) / (finalyState.count + 1); ++finalyState.count; if (data.Valid) { ++finalyState.countValid; + finalyState.ZAverage = (finalyState.ZAverage * finalyState.count + data.Z) / (finalyState.count + 1); + + if (data.Z < finalyState.ZMin) + { + finalyState.ZMin = data.Z; + } + + if (data.Z > finalyState.ZMax) + { + finalyState.ZMax = data.Z; + } } - if (data.Z < finalyState.ZMin) - { - finalyState.ZMin = data.Z; - } - - if (data.Z > finalyState.ZMax) - { - finalyState.ZMax = data.Z; - } - - - - if (isNeedAdd) { FinalyAnchorGroup.Add(finalyState.sn, finalyState);