Procházet zdrojové kódy

报告尺寸图添加总计数

颗粒查询变全选
cxs před 11 měsíci
rodič
revize
7ab026f295

+ 9 - 0
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -257,6 +257,15 @@ namespace OTSIncAReportGrids
             }
 
             gridView.Name = "gridView" + num.ToString();
+
+            int a1 = gridView.Rows.Add();
+            gridView.Rows[a1].Cells[1].Value = "Sum";
+            for (int j = 0; j < gridView.Rows.Count - 2; j++)
+            {
+                if (gridView.Rows[a1].Cells[3].Value == null)
+                        gridView.Rows[a1].Cells[3].Value = 0;
+                    gridView.Rows[a1].Cells[3].Value = Convert.ToInt32(gridView.Rows[a1].Cells[3].Value) + Convert.ToInt32(gridView.Rows[j].Cells[3].Value);
+            }
             SetDataGridViewStyle(gridView);
             panel1.Controls.Add(gridView);
 

+ 2 - 12
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -45,6 +45,8 @@ namespace OTSIncAReportGrids
         public bool ParticleRange { set; get; }
         #endregion
 
+
+
         #region 自定义方法
         /// <summary>
         /// 绑定datagridview数据
@@ -55,7 +57,6 @@ namespace OTSIncAReportGrids
             List<string> colname = new List<string>() { table["str1"].ToString(), table["str4"].ToString(), table["str3"].ToString(), table["str6"].ToString() };
             OTSIncAReportApp.DataOperation.DataAccess.ParticleData particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(path);
             OTSGridView gridView = new OTSGridView();
-            //创建Grid的列
             for (int i = 0; i < colid.Count; i++)
             {
                 gridView.Columns.Add(colid[i], colname[i]);
@@ -77,8 +78,6 @@ namespace OTSIncAReportGrids
             gridView.AddSpanHeader(1, gridView.Columns.Count - 1, filename);
             DataTable dt;
             dt = particledata.GetAreaByAllIncA(filedAndParticl);
-             
-
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 if (Convert.ToInt32(dt.Rows[i]["TypeId"]) < 100)
@@ -86,15 +85,12 @@ namespace OTSIncAReportGrids
                     continue;
                 }
                 double total = Convert.ToDouble(dt.Rows[i]["ar"]);
-                //double small = Convert.ToDouble(dt.Rows[i]["small"]);
                 int add_rowindex = gridView.Rows.Add();
                 gridView.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
                 gridView.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
                 gridView.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
                 gridView.Rows[add_rowindex].Cells[2].Value = Math.Round(total, 2);
                 gridView.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
-                //Gview_gz.Rows[add_rowindex].Cells[3].Value = Math.Round(small, 2);
-                //Gview_gz.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
                 gridView.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
                 gridView.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
@@ -104,10 +100,8 @@ namespace OTSIncAReportGrids
                     int col = 0;
                     foreach (DataRow dr in dtp.Rows)
                     {
-
                         if (gridView.Columns[j].Name == dr["name"].ToString())
                         {
-
                             double ar = Convert.ToDouble(dr["pc"]);
                             double p = Math.Round(ar / total, 2);
                             gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
@@ -138,16 +132,12 @@ namespace OTSIncAReportGrids
                 }
                 string name = NameList[index];
                 double total = Convert.ToDouble(dt.Rows[i]["ar"]);
-                //double small = Convert.ToDouble(dt.Rows[i]["small"]);
                 gridView.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
-                //Gview_gz.Rows[add_rowindex].Cells[1].Value = name;
                 gridView.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
                 gridView.Rows[add_rowindex].Cells[2].Value = Math.Round(total, 2);
                 gridView.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
-                //Gview_gz.Rows[add_rowindex].Cells[3].Value = Math.Round(small, 2);
                 gridView.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
                 gridView.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
-                //Gview_gz.Rows[add_rowindex].Cells[4].Style.BackColor = Color.Azure;
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
                 for (int j = 4; j < gridView.Columns.Count; j++)
                 {

+ 6 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticleClassificationSelect.cs

@@ -64,6 +64,12 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                         }
                         flowLayoutPanel.Controls.Add(box1);
                     }
+                    if (ParticleClassificationSelectedList.Count() == table.Rows.Count)
+                    {
+                        this.checkBox_selall.CheckedChanged -= new System.EventHandler(this.checkBox_selall_CheckedChanged);
+                        checkBox_selall.Checked = true;
+                        this.checkBox_selall.CheckedChanged += new System.EventHandler(this.checkBox_selall_CheckedChanged);
+                    }
                 }
             }
         }

+ 118 - 20
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.Designer.cs

@@ -32,6 +32,14 @@ namespace OTSIncAReportGrids
         {
             this.components = new System.ComponentModel.Container();
             this.panel2 = new System.Windows.Forms.Panel();
+            this.label11 = new System.Windows.Forms.Label();
+            this.tbx_DferretMax = new System.Windows.Forms.TextBox();
+            this.label12 = new System.Windows.Forms.Label();
+            this.tbx_DferretMin = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.tbx_ECDMax = new System.Windows.Forms.TextBox();
+            this.label10 = new System.Windows.Forms.Label();
+            this.tbx_ECDMin = new System.Windows.Forms.TextBox();
             this.btn_particletypesel = new System.Windows.Forms.Button();
             this.btn_showconfig = new System.Windows.Forms.Button();
             this.tB_FieldId = new System.Windows.Forms.TextBox();
@@ -86,6 +94,14 @@ namespace OTSIncAReportGrids
             // 
             // panel2
             // 
+            this.panel2.Controls.Add(this.label11);
+            this.panel2.Controls.Add(this.tbx_DferretMax);
+            this.panel2.Controls.Add(this.label12);
+            this.panel2.Controls.Add(this.tbx_DferretMin);
+            this.panel2.Controls.Add(this.label8);
+            this.panel2.Controls.Add(this.tbx_ECDMax);
+            this.panel2.Controls.Add(this.label10);
+            this.panel2.Controls.Add(this.tbx_ECDMin);
             this.panel2.Controls.Add(this.btn_particletypesel);
             this.panel2.Controls.Add(this.btn_showconfig);
             this.panel2.Controls.Add(this.tB_FieldId);
@@ -110,9 +126,77 @@ namespace OTSIncAReportGrids
             this.panel2.Size = new System.Drawing.Size(1502, 37);
             this.panel2.TabIndex = 6;
             // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(424, 13);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(77, 12);
+            this.label11.TabIndex = 49;
+            this.label11.Text = "Dferret(μm)";
+            // 
+            // tbx_DferretMax
+            // 
+            this.tbx_DferretMax.Location = new System.Drawing.Point(563, 9);
+            this.tbx_DferretMax.Name = "tbx_DferretMax";
+            this.tbx_DferretMax.Size = new System.Drawing.Size(40, 21);
+            this.tbx_DferretMax.TabIndex = 48;
+            this.tbx_DferretMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(549, 13);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(11, 12);
+            this.label12.TabIndex = 47;
+            this.label12.Text = "~";
+            // 
+            // tbx_DferretMin
+            // 
+            this.tbx_DferretMin.Location = new System.Drawing.Point(507, 9);
+            this.tbx_DferretMin.Name = "tbx_DferretMin";
+            this.tbx_DferretMin.Size = new System.Drawing.Size(40, 21);
+            this.tbx_DferretMin.TabIndex = 46;
+            this.tbx_DferretMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(258, 13);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(53, 12);
+            this.label8.TabIndex = 45;
+            this.label8.Text = "ECD(μm)";
+            // 
+            // tbx_ECDMax
+            // 
+            this.tbx_ECDMax.Location = new System.Drawing.Point(378, 9);
+            this.tbx_ECDMax.Name = "tbx_ECDMax";
+            this.tbx_ECDMax.Size = new System.Drawing.Size(40, 21);
+            this.tbx_ECDMax.TabIndex = 44;
+            this.tbx_ECDMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(364, 13);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(11, 12);
+            this.label10.TabIndex = 43;
+            this.label10.Text = "~";
+            // 
+            // tbx_ECDMin
+            // 
+            this.tbx_ECDMin.Location = new System.Drawing.Point(322, 9);
+            this.tbx_ECDMin.Name = "tbx_ECDMin";
+            this.tbx_ECDMin.Size = new System.Drawing.Size(40, 21);
+            this.tbx_ECDMin.TabIndex = 42;
+            this.tbx_ECDMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
             // btn_particletypesel
             // 
-            this.btn_particletypesel.Location = new System.Drawing.Point(715, 8);
+            this.btn_particletypesel.Location = new System.Drawing.Point(692, 8);
             this.btn_particletypesel.Name = "btn_particletypesel";
             this.btn_particletypesel.Size = new System.Drawing.Size(107, 23);
             this.btn_particletypesel.TabIndex = 41;
@@ -133,32 +217,34 @@ namespace OTSIncAReportGrids
             // 
             // tB_FieldId
             // 
-            this.tB_FieldId.Location = new System.Drawing.Point(549, 10);
+            this.tB_FieldId.Location = new System.Drawing.Point(1087, 9);
             this.tB_FieldId.Name = "tB_FieldId";
-            this.tB_FieldId.Size = new System.Drawing.Size(68, 21);
+            this.tB_FieldId.Size = new System.Drawing.Size(35, 21);
             this.tB_FieldId.TabIndex = 39;
+            this.tB_FieldId.Visible = false;
             // 
             // label7
             // 
             this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(484, 14);
+            this.label7.Location = new System.Drawing.Point(1034, 13);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(47, 12);
             this.label7.TabIndex = 38;
             this.label7.Text = "FieldId";
+            this.label7.Visible = false;
             // 
             // tB_ParticleId
             // 
-            this.tB_ParticleId.Location = new System.Drawing.Point(1244, 11);
+            this.tB_ParticleId.Location = new System.Drawing.Point(1345, 8);
             this.tB_ParticleId.Name = "tB_ParticleId";
-            this.tB_ParticleId.Size = new System.Drawing.Size(76, 21);
+            this.tB_ParticleId.Size = new System.Drawing.Size(53, 21);
             this.tB_ParticleId.TabIndex = 37;
             this.tB_ParticleId.Visible = false;
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(1164, 15);
+            this.label3.Location = new System.Drawing.Point(1274, 12);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(65, 12);
             this.label3.TabIndex = 36;
@@ -177,10 +263,10 @@ namespace OTSIncAReportGrids
             // tbx_Type
             // 
             this.tbx_Type.BackColor = System.Drawing.Color.White;
-            this.tbx_Type.Location = new System.Drawing.Point(982, 10);
+            this.tbx_Type.Location = new System.Drawing.Point(1213, 8);
             this.tbx_Type.Name = "tbx_Type";
             this.tbx_Type.ReadOnly = true;
-            this.tbx_Type.Size = new System.Drawing.Size(176, 21);
+            this.tbx_Type.Size = new System.Drawing.Size(55, 21);
             this.tbx_Type.TabIndex = 34;
             this.tbx_Type.TabStop = false;
             this.tbx_Type.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
@@ -189,7 +275,7 @@ namespace OTSIncAReportGrids
             // 
             // btn_Sel
             // 
-            this.btn_Sel.Location = new System.Drawing.Point(632, 8);
+            this.btn_Sel.Location = new System.Drawing.Point(622, 8);
             this.btn_Sel.Name = "btn_Sel";
             this.btn_Sel.Size = new System.Drawing.Size(54, 23);
             this.btn_Sel.TabIndex = 33;
@@ -201,7 +287,7 @@ namespace OTSIncAReportGrids
             // 
             this.label_ParticleName.AutoSize = true;
             this.label_ParticleName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.label_ParticleName.Location = new System.Drawing.Point(899, 14);
+            this.label_ParticleName.Location = new System.Drawing.Point(1128, 13);
             this.label_ParticleName.Name = "label_ParticleName";
             this.label_ParticleName.Size = new System.Drawing.Size(79, 14);
             this.label_ParticleName.TabIndex = 32;
@@ -211,7 +297,7 @@ namespace OTSIncAReportGrids
             // label_Dmax
             // 
             this.label_Dmax.AutoSize = true;
-            this.label_Dmax.Location = new System.Drawing.Point(309, 14);
+            this.label_Dmax.Location = new System.Drawing.Point(80, 13);
             this.label_Dmax.Name = "label_Dmax";
             this.label_Dmax.Size = new System.Drawing.Size(59, 12);
             this.label_Dmax.TabIndex = 27;
@@ -219,7 +305,7 @@ namespace OTSIncAReportGrids
             // 
             // tbx_DmaxMax
             // 
-            this.tbx_DmaxMax.Location = new System.Drawing.Point(429, 10);
+            this.tbx_DmaxMax.Location = new System.Drawing.Point(200, 9);
             this.tbx_DmaxMax.Name = "tbx_DmaxMax";
             this.tbx_DmaxMax.Size = new System.Drawing.Size(40, 21);
             this.tbx_DmaxMax.TabIndex = 25;
@@ -228,7 +314,7 @@ namespace OTSIncAReportGrids
             // label9
             // 
             this.label9.AutoSize = true;
-            this.label9.Location = new System.Drawing.Point(415, 14);
+            this.label9.Location = new System.Drawing.Point(186, 13);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(11, 12);
             this.label9.TabIndex = 24;
@@ -236,7 +322,7 @@ namespace OTSIncAReportGrids
             // 
             // tbx_DmaxMin
             // 
-            this.tbx_DmaxMin.Location = new System.Drawing.Point(373, 10);
+            this.tbx_DmaxMin.Location = new System.Drawing.Point(144, 9);
             this.tbx_DmaxMin.Name = "tbx_DmaxMin";
             this.tbx_DmaxMin.Size = new System.Drawing.Size(40, 21);
             this.tbx_DmaxMin.TabIndex = 23;
@@ -245,36 +331,40 @@ namespace OTSIncAReportGrids
             // label_Area
             // 
             this.label_Area.AutoSize = true;
-            this.label_Area.Location = new System.Drawing.Point(127, 13);
+            this.label_Area.Location = new System.Drawing.Point(872, 12);
             this.label_Area.Name = "label_Area";
             this.label_Area.Size = new System.Drawing.Size(65, 12);
             this.label_Area.TabIndex = 22;
-            this.label_Area.Text = "面积(μm²)";
+            this.label_Area.Text = "Area(μm²)";
+            this.label_Area.Visible = false;
             // 
             // Tbx_AreaMax
             // 
-            this.Tbx_AreaMax.Location = new System.Drawing.Point(251, 10);
+            this.Tbx_AreaMax.Location = new System.Drawing.Point(996, 9);
             this.Tbx_AreaMax.Name = "Tbx_AreaMax";
             this.Tbx_AreaMax.Size = new System.Drawing.Size(40, 21);
             this.Tbx_AreaMax.TabIndex = 4;
             this.Tbx_AreaMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.Tbx_AreaMax.Visible = false;
             // 
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(237, 13);
+            this.label5.Location = new System.Drawing.Point(1093, 19);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(11, 12);
             this.label5.TabIndex = 3;
             this.label5.Text = "~";
+            this.label5.Visible = false;
             // 
             // tBx_AreaMin
             // 
-            this.tBx_AreaMin.Location = new System.Drawing.Point(194, 10);
+            this.tBx_AreaMin.Location = new System.Drawing.Point(939, 9);
             this.tBx_AreaMin.Name = "tBx_AreaMin";
             this.tBx_AreaMin.Size = new System.Drawing.Size(40, 21);
             this.tBx_AreaMin.TabIndex = 2;
             this.tBx_AreaMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.tBx_AreaMin.Visible = false;
             // 
             // panel1
             // 
@@ -614,5 +704,13 @@ namespace OTSIncAReportGrids
         public System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
         private Control_XRayTable control_XRayTable1;
         private System.Windows.Forms.Button btn_particletypesel;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.TextBox tbx_DferretMax;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.TextBox tbx_DferretMin;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.TextBox tbx_ECDMax;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.TextBox tbx_ECDMin;
     }
 }

+ 157 - 39
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -277,9 +277,32 @@ namespace OTSIncAReportGrids
             cbB_PageSize.Items.Add("5000");
             cbB_PageSize.Items.Add("All");
             cbB_PageSize.SelectedIndex = 0;
+            DataTable table = Particledata.GetClassificationOfAllParticles();
+            if (table != null)
+            {
+                if (table.Rows.Count > 0)
+                {
+                    foreach(DataRow row in table.Rows)
+                    {
+                        tbx_Type.Text += row["TypeName"].ToString() + '$';
+                    }
+                }
+                if(tbx_Type.Text!="")
+                {
+                    tbx_Type.Text = tbx_Type.Text.Remove(tbx_Type.Text.Length - 1);
+                }
+            }
             dgV_ParticlesDevidePage.Focus();
         }
 
+
+
+
+
+
+
+
+
         #region 自定义方法
         bool UpdateTable()
         {
@@ -672,6 +695,10 @@ namespace OTSIncAReportGrids
                         iconColumn.Name = en.Current.Key;
                         iconColumn.HeaderText = en.Current.Value;
                         dgV_ParticlesDevidePage.Columns.Add(iconColumn);
+                    }
+                    else if (en.Current.Key == "Element")
+                    {
+
                     }
                     else
                     {
@@ -763,7 +790,6 @@ namespace OTSIncAReportGrids
                                     else
                                     {
                                         dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
-
                                         dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
                                     }
                                 }
@@ -786,6 +812,10 @@ namespace OTSIncAReportGrids
                         {
                             double d = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
+                        }
+                        if (en.Current.Key == "Element")
+                        {
+
                         }
                         if (enl.Current.Key == "ASPECT_ELONG")
                         {
@@ -1342,6 +1372,7 @@ namespace OTSIncAReportGrids
                 }
             }
 
+
             if (!string.IsNullOrWhiteSpace(Tbx_AreaMax.Text))
             {
                 double dnum = 0;
@@ -1371,6 +1402,7 @@ namespace OTSIncAReportGrids
             }
 
 
+
             if (!string.IsNullOrWhiteSpace(tbx_DmaxMin.Text))
             {
                 double dnum = 0;
@@ -1446,22 +1478,131 @@ namespace OTSIncAReportGrids
                 }
             }
 
+
+
+
+
+
+
+
+
+
+            if (!string.IsNullOrWhiteSpace(tbx_DferretMin.Text))
+            {
+                double dnum = 0;
+                int inum = 0;
+                if (double.TryParse(tbx_DferretMin.Text, out dnum) && dnum >= 0)
+                {
+                    condition += " and PERIMETER" + ">" + tbx_DferretMin.Text;
+                }
+                else if (int.TryParse(Tbx_AreaMax.Text, out inum) && inum >= 0)
+                {
+                    condition += " and PERIMETER" + ">" + tbx_DferretMin.Text;
+                }
+                else
+                {
+                    MessageBox.Show(table["str10"].ToString());
+                    return;
+                }
+            }
+
+            if (!string.IsNullOrWhiteSpace(tbx_DferretMax.Text))
+            {
+                double dnum = 0;
+                int inum = 0;
+                if (double.TryParse(tbx_DferretMax.Text, out dnum) && dnum >= 0)
+                {
+                    condition += " and PERIMETER" + "<" + tbx_DferretMax.Text;
+                }
+                else if (int.TryParse(tbx_DferretMax.Text, out inum) && inum >= 0)
+                {
+                    condition += " and PERIMETER" + "<" + tbx_DferretMax.Text;
+                }
+                else
+                {
+                    MessageBox.Show(table["str10"].ToString());
+                    return;
+                }
+            }
+            if (!string.IsNullOrWhiteSpace(tbx_DferretMin.Text) && !string.IsNullOrWhiteSpace(tbx_DferretMax.Text))
+            {
+                if (!CompareInput(tbx_DferretMin.Text, tbx_DferretMax.Text))
+                {
+                    MessageBox.Show(table["str11"].ToString());
+                    return;
+                }
+            }
+
+            if (!string.IsNullOrWhiteSpace(tbx_ECDMin.Text))
+            {
+                double dnum = 0;
+                int inum = 0;
+                if (double.TryParse(tbx_ECDMin.Text, out dnum) && dnum >= 0)
+                {
+                    double area = Math.PI * dnum/2 * dnum/2;
+                    condition += " and Area" + ">" + area.ToString();
+                }
+                else if (int.TryParse(tbx_ECDMin.Text, out inum) && inum >= 0)
+                {
+                    double area = Math.PI * dnum/2 * dnum/2;
+                    condition += " and Area" + ">" + area.ToString();
+                }
+                else
+                {
+                    MessageBox.Show(table["str10"].ToString());
+                    return;
+                }
+            }
+
+
+
+            if (!string.IsNullOrWhiteSpace(tbx_ECDMax.Text))
+            {
+                double dnum = 0;int inum = 0;
+                if (double.TryParse(tbx_ECDMax.Text, out dnum) && dnum >= 0)
+                {
+                    double area = Math.PI * dnum/2 * dnum/2;
+                    condition += " and Area" + "<" + area.ToString();
+                }
+                else if (int.TryParse(tbx_ECDMax.Text, out inum) && inum >= 0)
+                {
+                    double area = Math.PI * dnum/2 * dnum/2;
+                    condition += " and Area" + "<" + area.ToString();
+                }
+                else
+                {
+                    MessageBox.Show(table["str10"].ToString());
+                    return;
+                }
+            }
+            if (!string.IsNullOrWhiteSpace(tbx_ECDMin.Text) && !string.IsNullOrWhiteSpace(tbx_ECDMax.Text))
+            {
+                if (!CompareInput(tbx_ECDMin.Text, tbx_ECDMax.Text))
+                {
+                    MessageBox.Show(table["str11"].ToString());
+                    return;
+                }
+            }
+
+
+
+
             if (!string.IsNullOrWhiteSpace(tbx_Type.Text))
             {
-                //string[] tr = tbx_Type.Text.Split(',');
-                //condition += "and ("; 
-                //for(int i=0;i<tr.Length;i++)
-                //{
-                //    if(i==0)
-                //    { 
-                //    condition += "  TypeName = '"+ tr[i]+"'";
-                //    }
-                //    else
-                //    {
-                //        condition += " or TypeName = '" + tr[i] + "'";
-                //    }
-                //}
-                //condition += ")";
+                string[] tr = tbx_Type.Text.Split('$');
+                condition += " and (";
+                for (int i = 0; i < tr.Length; i++)
+                {
+                    if (i == 0)
+                    {
+                        condition += "  TypeName = '" + tr[i] + "'";
+                    }
+                    else
+                    {
+                        condition += " or TypeName = '" + tr[i] + "'";
+                    }
+                }
+                condition += ")";
             }
 
             if (m_frm_userprogress.IsDisposed)
@@ -1474,7 +1615,6 @@ namespace OTSIncAReportGrids
             lnkFirst_Click(null, null);
             SetDataGridViewStyle();
         }
-
         void ProgressStart()
         {
             #region 加载显示进度条部份
@@ -2752,30 +2892,8 @@ namespace OTSIncAReportGrids
                 if (particleClassificationSelect.ParticleClassificationSelected != "")
                 {
                     tbx_Type.Text = particleClassificationSelect.ParticleClassificationSelected;
-                    string[] tr = tbx_Type.Text.Split('$');
-                    condition += " and (";
-                    for (int i = 0; i < tr.Length; i++)
-                    {
-                        if (i == 0)
-                        {
-                            condition += "  TypeName = '" + tr[i] + "'";
-                        }
-                        else
-                        {
-                            condition += " or TypeName = '" + tr[i] + "'";
-                        }
-                    }
-                    condition += ")";
+                    btn_Sel_Click(null, null);
                 }
-                if (m_frm_userprogress.IsDisposed)
-                {
-                    ProgressStart();
-                }
-
-                UpdateTable();
-
-                lnkFirst_Click(null, null);
-                SetDataGridViewStyle();
             }
         }
     }

+ 13 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -221,6 +221,17 @@ namespace OTSIncAReportGrids
             }
 
             gridView.Name = "gridView" + num.ToString();
+            int a1=gridView.Rows.Add();
+            gridView.Rows[a1].Cells[1].Value = "Sum";
+            for(int j=0;j< gridView.Rows.Count-2;j++)
+            {
+                for(int k=4;k< gridView.Columns.Count;k++)
+                {
+                    if (gridView.Rows[a1].Cells[k].Value == null)
+                        gridView.Rows[a1].Cells[k].Value = 0;
+                    gridView.Rows[a1].Cells[k].Value = Convert.ToInt32(gridView.Rows[a1].Cells[k].Value)+ Convert.ToInt32(gridView.Rows[j].Cells[k].Value);
+                }
+            }
             SetDataGridViewStyle(gridView);
             panel1.Controls.Add(gridView);
         }
@@ -289,6 +300,8 @@ namespace OTSIncAReportGrids
             //先设置一下头的高度,否则会太矮不好看
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             gridView.ColumnHeadersHeight = 40;
+
+            gridView.Columns[4].Visible = false;
         }
         #endregion
 

+ 10 - 3
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -609,9 +609,16 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         {
             string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX " +
                 "as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles,''as Element from MergedParticleInfo where 1=1 " + condition;
-            DataTable DT = new DataTable();
-            DT = dbHelper.ExecuteQuery(sqliteString);
-            return DT;
+            DataTable DT1 = new DataTable();
+            try
+            {
+                DT1 = dbHelper.ExecuteQuery(sqliteString);
+            }
+            catch (Exception ex) 
+            {
+            
+            }
+            return DT1;
         }
 
         public DataTable GetInfoForPartucleDevidePage_allParticles(string condition)