Browse Source

修改颗粒列表其它颗粒的无法筛选的bug

cxs 4 months ago
parent
commit
dd0cfd8440

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSReportMgrParam.rpf

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData systype="IncA">
   <Member RegName="Scale" strValue="1000" />
-  <Member RegName="DefaultComputedColName" strValue="" />
+  <Member RegName="DefaultComputedColName" strValue="ParticleCoordinate,Area,EquivalentCircleDiameter,MaxDiameter,MinDiameter,DiameterRatio,FerretDiameter,PERP,PERI,INSCR,MEAN,ELONG,ASPECT_ELONG,Orientation,XRayDataCount" />
   <Member RegName="ElementsColName" strValue="C,O,Al,Fe,F,Ti,Na,Mn,Mg" />
   <Member RegName="PartSizeFile" name="Li1-10.psf" />
   <Member RegName="TRIO_CHART_TYPE" strValue="CaO.SiO₂.Al₂O₃" />

+ 3 - 4
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.Designer.cs

@@ -52,12 +52,10 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // 
             this.dgV_SimilarParticles.AllowUserToAddRows = false;
             this.dgV_SimilarParticles.AllowUserToDeleteRows = false;
-            this.dgV_SimilarParticles.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.dgV_SimilarParticles.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
             this.dgV_SimilarParticles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.dgV_SimilarParticles.ContextMenuStrip = this.contextMenuStrip1;
+            this.dgV_SimilarParticles.Dock = System.Windows.Forms.DockStyle.Fill;
             this.dgV_SimilarParticles.Location = new System.Drawing.Point(0, 0);
             this.dgV_SimilarParticles.Name = "dgV_SimilarParticles";
             this.dgV_SimilarParticles.ReadOnly = true;
@@ -66,6 +64,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.dgV_SimilarParticles.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
             this.dgV_SimilarParticles.Size = new System.Drawing.Size(1772, 725);
             this.dgV_SimilarParticles.TabIndex = 6;
+            this.dgV_SimilarParticles.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgV_SimilarParticles_CellMouseClick);
             this.dgV_SimilarParticles.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgV_SimilarParticles_CellMouseDoubleClick);
             this.dgV_SimilarParticles.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dgV_SimilarParticles_KeyUp);
             this.dgV_SimilarParticles.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgV_SimilarParticles_MouseUp);
@@ -200,7 +199,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.Name = "ListOfSimilarParticles";
             this.ShowIcon = false;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "ListOfSimilarParticles";
+            this.Text = "SearchSimilarParticles";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.Load += new System.EventHandler(this.ListOfSimilarParticles_Load);
             ((System.ComponentModel.ISupportInitialize)(this.dgV_SimilarParticles)).EndInit();

+ 36 - 1
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.cs

@@ -100,12 +100,40 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                     particlesAll.Rows[i]["Element"] = ConcatenatedString;
                 }
                 particlesAll.Columns.Add("SimilarRatio", typeof(double));
-                particles = particlesAll.Clone();
                 DataTable mergeParticles = _particlesGridDevidePage.Particledata.GetInfoForPartucleDevidePage_mergeParticles("");
                 if (mergeParticles != null && mergeParticles.Rows.Count > 0)
                 {
                     _particlesGridDevidePage.RemoveMergeParticles(ref particlesAll, mergeParticles);
                 }
+                DataTable XRayData = _particlesGridDevidePage.Particledata.GetXRayData();
+                particlesAll.Columns.Add("XRayDataCount");
+                for (int i = 0; i < particlesAll.Rows.Count; i++)
+                {
+                    if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
+                    {
+                        particlesAll.Rows[i]["XRayDataCount"] = 0;
+                        string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
+                        DataRow[] drs = XRayData.Select(str);
+                        uint xraycount = 0;
+                        if (drs != null)
+                        {
+                            if (drs.Length > 0)
+                            {
+                                uint[] Analysis_xray = new uint[2000];
+                                for (int j = 0; j < 2000; j++)
+                                {
+                                    Analysis_xray[j] = BitConverter.ToUInt32((byte[])drs[0][2], j * 4);
+                                }
+                                for (int j = 0; j < 2000; j++)
+                                {
+                                    xraycount += Analysis_xray[j];
+                                }
+                                particlesAll.Rows[i]["XRayDataCount"] = xraycount;
+                            }
+                        }
+                    }
+                }
+                particles = particlesAll.Clone();
                 foreach (DataRow row in particlesAll.Rows)
                 {
                     var tmpPart = _particlesGridDevidePage.Particledata.GetParticleXrayDataByFidAndPid(row["fieldid"].ToString(), row["xrayid"].ToString());
@@ -455,6 +483,8 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                     }
                 }
             }
+
+
             DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn();
             checkBoxColumn.HeaderText = "选择";
             checkBoxColumn.Name = "IsSelected";
@@ -776,5 +806,10 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 }
             }
         }
+
+        private void dgV_SimilarParticles_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
+        {
+
+        }
     }
 }

+ 4 - 4
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticleClassificationSelect.cs

@@ -9,23 +9,23 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
 {
     public partial class ParticleClassificationSelect : Form
     {
-        ParticleData Particledata;
+        OTSIncAReportGrids.ParticlesGridDevidePage _ParticlesGridDevidePage;
         string[] ParticleClassificationSelectedList;
         public string ParticleClassificationSelected
         {
             get;
             set;
         }
-        public ParticleClassificationSelect(ParticleData a_Particledata, string a_ParticleClassificationSelected)
+        public ParticleClassificationSelect(OTSIncAReportGrids.ParticlesGridDevidePage a_ParticlesGridDevidePage, string a_ParticleClassificationSelected)
         {
             InitializeComponent();
-            Particledata = a_Particledata;
+            _ParticlesGridDevidePage = a_ParticlesGridDevidePage;
             ParticleClassificationSelectedList = a_ParticleClassificationSelected.Split('$');
         }
 
         private void ParticleClassificationSelect_Load(object sender, EventArgs e)
         {
-            DataTable table = Particledata.GetClassificationOfAllParticles();
+            DataTable table = _ParticlesGridDevidePage.GetClassificationOfAllParticles();
             if (table != null)
             {
                 if (table.Rows.Count > 0)

+ 29 - 8
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -266,7 +266,7 @@ namespace OTSIncAReportGrids
             cbB_PageSize.Items.Add("5000");
             cbB_PageSize.Items.Add("All");
             cbB_PageSize.SelectedIndex = 0;
-            DataTable table = Particledata.GetClassificationOfAllParticles();
+            DataTable table = GetClassificationOfAllParticles();
             if (table != null)
             {
                 if (table.Rows.Count > 0)
@@ -1164,11 +1164,11 @@ namespace OTSIncAReportGrids
                 int inum = 0;
                 if (double.TryParse(tbx_DferretMin.Text, out dnum) && dnum >= 0)
                 {
-                    condition += " and PERIMETER" + ">" + tbx_DferretMin.Text;
+                    condition += " and DFERET" + ">" + tbx_DferretMin.Text;
                 }
                 else if (int.TryParse(Tbx_AreaMax.Text, out inum) && inum >= 0)
                 {
-                    condition += " and PERIMETER" + ">" + tbx_DferretMin.Text;
+                    condition += " and DFERET" + ">" + tbx_DferretMin.Text;
                 }
                 else
                 {
@@ -1183,11 +1183,11 @@ namespace OTSIncAReportGrids
                 int inum = 0;
                 if (double.TryParse(tbx_DferretMax.Text, out dnum) && dnum >= 0)
                 {
-                    condition += " and PERIMETER" + "<" + tbx_DferretMax.Text;
+                    condition += " and DFERET" + "<" + tbx_DferretMax.Text;
                 }
                 else if (int.TryParse(tbx_DferretMax.Text, out inum) && inum >= 0)
                 {
-                    condition += " and PERIMETER" + "<" + tbx_DferretMax.Text;
+                    condition += " and DFERET" + "<" + tbx_DferretMax.Text;
                 }
                 else
                 {
@@ -1677,7 +1677,7 @@ namespace OTSIncAReportGrids
                         UpdateTable();
                         lnkFirst_Click(null, null);
                         SetDataGridViewStyle();
-                        DataTable table = Particledata.GetClassificationOfAllParticles();
+                        DataTable table = GetClassificationOfAllParticles();
                         if (table != null)
                         {
                             if (table.Rows.Count > 0)
@@ -2429,7 +2429,7 @@ namespace OTSIncAReportGrids
         }
         private void tbx_Type_Click(object sender, EventArgs e)
         {
-            ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(Particledata, tbx_Type.Text);
+            ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(this, tbx_Type.Text);
             DialogResult result = particleClassificationSelect.ShowDialog();
             if (result == DialogResult.OK)
             {
@@ -2463,7 +2463,7 @@ namespace OTSIncAReportGrids
         }
         private void btn_particletypesel_Click(object sender, EventArgs e)
         {
-            ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(Particledata, tbx_Type.Text);
+            ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(this, tbx_Type.Text);
             DialogResult result = particleClassificationSelect.ShowDialog();
             if (result == DialogResult.OK)
             {
@@ -2476,6 +2476,27 @@ namespace OTSIncAReportGrids
                 }
             }
         }
+
+        public DataTable GetClassificationOfAllParticles()
+        {
+            string str = "";
+            int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
+            if (sel == (int)SelItem.analyticalParticle)
+            {
+                str = "where xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=4";
+            }
+            else if (sel == (int)SelItem.otherParticles)
+            {
+                str = "where typeid =9 or typeid =-1 or typeid =4";
+            }
+            else
+            {
+
+            }
+
+            DataTable table = Particledata.GetClassificationOfAllParticles(str);
+            return table;
+        }
     }
 }
 

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

@@ -603,7 +603,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
 		public DataTable GetInfoForPartucleDevidePage_analyticalParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=4" +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where (xrayid > -1  and typeid !=9 and typeid !=-1 and typeid !=4)" +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
@@ -613,7 +613,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
         public DataTable GetInfoForPartucleDevidePage_otherParticle(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where typeid =9 or typeid =-1 or typeid =4 " +
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where (typeid =9 or typeid =-1 or typeid =4) " +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
@@ -660,9 +660,9 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
-        public DataTable GetClassificationOfAllParticles()
+        public DataTable GetClassificationOfAllParticles(string condition)
         {
-            string sqliteString1 = "select distinct TypeName from INcAData";
+            string sqliteString1 = "select distinct TypeName from INcAData "+ condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString1);
             return DT;