Browse Source

Merge branch 'GSP' of http://36.129.169.60:30080/gogsadmin/OTS into GSP

GSP 3 weeks ago
parent
commit
de8bff56c4

+ 2 - 3
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1277,7 +1277,6 @@ namespace OTSIncAReportGraph.Controls
             m_str_mouseshow_left = "颗粒SEM位置:" + point.X.ToString() + ":" + point.Y.ToString();
             m_sem_mouse_now_point = point;
             //显示xray相关信息
-            uint[] Search_xray = new uint[2000];
             uint[] Analysis_xray = new uint[2000];
 
 
@@ -1288,7 +1287,7 @@ namespace OTSIncAReportGraph.Controls
             List<Element> list_celementchemistryclr = new List<Element>();
 
             //获取Xray数据
-            imageDisHelper.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(m_mouseOver_dparticle.ParticleId, m_mouseOver_dparticle.FieldId, out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+            imageDisHelper.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(m_mouseOver_dparticle.ParticleId, m_mouseOver_dparticle.FieldId, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
 
             //get CElementChemistryClr list
             List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
@@ -1319,7 +1318,7 @@ namespace OTSIncAReportGraph.Controls
             control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + "  " + "DMAX:" + Math.Round(particle.DMAX, 2) + "  " + "DELONG:" + Math.Round(particle.DELONG, 2) + "  " + "DFERET:" + Math.Round(particle.DFERET, 2) + "  " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + "  " + "DMIN:" + Math.Round(particle.DMIN, 2) + "  " + "DPERP:" + Math.Round(particle.DPERP, 2) + "  " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + "  " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
             //获取数据后,需要对xraytable设置
             control_XRayTable1.Visible = true;
-            control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
+            control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
             //颗粒国标信息
             control_XRayTable1.GBInfoStr = "";
             control_XRayTable1.MaterialName = str_IncAName;//杂夹物

+ 2 - 3
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -1016,7 +1016,6 @@ namespace OTSIncAReportGraph.Controls
 
 
             //显示xray相关信息
-            uint[] Search_xray = new uint[2000];
             uint[] Analysis_xray = new uint[2000];
 
             //
@@ -1025,7 +1024,7 @@ namespace OTSIncAReportGraph.Controls
             List<Element> list_celementchemistryclr = new List<Element>();
 
             //获取Xray数据
-            m_imgDisHelper.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(m_mouseOver_dparticle.ParticleId, m_mouseOver_dparticle.FieldId, out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+            m_imgDisHelper.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(m_mouseOver_dparticle.ParticleId, m_mouseOver_dparticle.FieldId, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
 
             //get CElementChemistryClr list
             List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
@@ -1048,7 +1047,7 @@ namespace OTSIncAReportGraph.Controls
 
             //获取数据后,需要对xraytable设置
             control_XRayTable1.Visible = false;
-            control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
+            control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
             //颗粒国标信息
             control_XRayTable1.GBInfoStr = "";
             control_XRayTable1.MaterialName = str_IncALibName;//杂夹物

+ 1 - 2
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.cs

@@ -201,9 +201,8 @@ namespace OTSIncAReportGraph.Controls
         /// <summary>
         /// 设置搜索xray和分析xray值到,记录变量中,及转换成显示变量中,用来供XrayTable显示及计算使用
         /// </summary>
-        /// <param name="search_xray"></param>
         /// <param name="analysis_xray"></param>
-        public void SetXRayShowLineValue(uint[] search_xray, uint[] analysis_xray, List<ShowElementInfo> in_list_showelementinfo)
+        public void SetXRayShowLineValue(uint[] analysis_xray, List<ShowElementInfo> in_list_showelementinfo)
         {
             //重新加载时,对当前的宽度等重新加载并计算
             m_i_draw_end = this.Width;

+ 1 - 3
OTSIncAReportApp/1-UI/Control_Graph/OTSIncAReportGraphFuncation/OTSImageDisHelp.cs

@@ -249,9 +249,8 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         /// <param name="in_clr_fieldid"></param>
         /// <param name="Search_xray"></param>
         /// <param name="Analysis_xray"></param>
-        public Particle GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(int in_clr_tagid, int in_clr_fieldid, out uint[] Search_xray, out uint[] Analysis_xray, out int xray_id, out List<Element> list_celementchemistryclr)
+        public Particle GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(int in_clr_tagid, int in_clr_fieldid, out uint[] Analysis_xray, out int xray_id, out List<Element> list_celementchemistryclr)
         {
-            Search_xray = new uint[2000];
             Analysis_xray = new uint[2000];
             xray_id = 0;
             list_celementchemistryclr = new List<Element>();
@@ -271,7 +270,6 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
                     {
                         Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
                     }
-                    Search_xray = Analysis_xray;
                     xray_id = particle.XrayId;
                     list_celementchemistryclr = particle.ElementList;
                 }

+ 44 - 45
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.cs

@@ -29,7 +29,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
         OTSIncAReportGrids.ParticlesGridDevidePage _particlesGridDevidePage;
         CPosXrayClr SelXrayclr = new CPosXrayClr();
         DataTable particlesAll;
-        DataTable particles;
+        DataTable particlesFilter;
         Hashtable table;
         List<string> _RenameInfo;
         private Thread m_mythread;
@@ -111,15 +111,15 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 particlesAll.Columns.Add("SimilarRatio", typeof(double));
                 DataTable XRayData = Particledata.GetXRayData();
                 particlesAll.Columns.Add("XRayDataCount");
-                particles = particlesAll.Clone();
+                particlesFilter = particlesAll.Clone();
                 for (int i = 0; i < particlesAll.Rows.Count; i++)
                 {
                     if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
                     {
-                        string subt = particlesAll.Rows[i]["SubParticles"].ToString();
+                        string subParticleString = particlesAll.Rows[i]["SubParticles"].ToString();
                         uint[] Analysis_xray = new uint[2000];
                         particlesAll.Rows[i]["XRayDataCount"] = 0;
-                        if (subt == "")
+                        if (subParticleString == "")
                         {
                             string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
                             DataRow[] drs = XRayData.Select(str);
@@ -143,8 +143,8 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                         else
                         {
                             DataRow dgvr = particlesAll.Rows[i];
-                            uint[] Search_xray = new uint[2000];
-                            Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Search_xray, out Analysis_xray);
+
+                            Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Analysis_xray);
                             uint xraycount = 0;
                             for (int j = 0; j < 2000; j++)
                             {
@@ -157,14 +157,14 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                         particlesAll.Rows[i]["SimilarRatio"] = GetCosValue(SelXrayclr, Xrayclr);
                         if ((double)particlesAll.Rows[i]["SimilarRatio"] >= val / 100)
                         {
-                            particles.ImportRow(particlesAll.Rows[i]);
+                            particlesFilter.ImportRow(particlesAll.Rows[i]);
                         }
                     }
                 }
 
                 
-                particles.DefaultView.Sort = "SimilarRatio DESC";
-                particles = particles.DefaultView.ToTable();
+                particlesFilter.DefaultView.Sort = "SimilarRatio DESC";
+                particlesFilter = particlesFilter.DefaultView.ToTable();
                 BindDataGridView();
                 SetDataGridViewStyle();
                 cBx_All.Checked = false;
@@ -361,7 +361,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             }
             string filePath = _particlesGridDevidePage.result.FilePath + "\\FIELD_FILES\\";
             KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
-            for (int i = 0; i < particles.Rows.Count; i++)
+            for (int i = 0; i < particlesFilter.Rows.Count; i++)
             {
                 Dictionary<string, string>.Enumerator enl = keyValues.GetEnumerator();
                 Dictionary<string, Bitmap> fieldpics = new Dictionary<string, Bitmap>();
@@ -372,44 +372,44 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                     {
                         if (enl.Current.Key == "ParticleImage")
                         {
-                            string subt = particles.Rows[i]["SubParticles"].ToString();
+                            string subParticleString = particlesFilter.Rows[i]["SubParticles"].ToString();
                             dgV_SimilarParticles.Rows[add_rowindex].Height = 150;
 
 
                             dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
 
                             Bitmap bmap = null;
-                            if (subt != null && subt != "" && subt != "IsSubParticle")
+                            if (subParticleString != null && subParticleString != "" && subParticleString != "IsSubParticle")
                             {
                                 double pix = _result.GetPixelSize();
                                 int width = _result.GetImageWidth();
                                 int height = _result.GetImageHeight();
-                                string substring = "," + subt.Replace(':', '-') + ",";
+                                string substring = "," + subParticleString.Replace(':', '-') + ",";
                                 DataTable dataTable = Particledata.GetParticleAllForBig(substring);//组成拼接颗粒的子颗粒
-                                bmap = fldImgAccess.GetBitmapForMergedParticle(subt, pix, height, width, dataTable);
+                                bmap = fldImgAccess.GetBitmapForMergedParticle(subParticleString, pix, height, width, dataTable);
                                 if (bmap != null)
                                 {
-                                    string[] str = subt.Split(',');
+                                    string[] str = subParticleString.Split(',');
                                     bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1] };
                                 }
                             }
-                            else if (subt != "IsSubParticle")
+                            else if (subParticleString != "IsSubParticle")
                             {
-                                if (!fieldpics.Keys.Contains(particles.Rows[i]["fieldid"].ToString()))
+                                if (!fieldpics.Keys.Contains(particlesFilter.Rows[i]["fieldid"].ToString()))
                                 {
-                                    string imagePath =  "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
-                                    fieldpics.Add(particles.Rows[i]["fieldid"].ToString(), fldImgAccess.ReadImageFile(imagePath));
+                                    string imagePath =  "Field" + particlesFilter.Rows[i]["fieldid"].ToString() + ".bmp";
+                                    fieldpics.Add(particlesFilter.Rows[i]["fieldid"].ToString(), fldImgAccess.ReadImageFile(imagePath));
                                 }
-                                Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particles.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particles.Rows[i]["RectTop"]), Width = Convert.ToInt32(particles.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particles.Rows[i]["RectHeight"]) };
-                                bmap = fldImgAccess.CapturePic(fieldpics[particles.Rows[i]["fieldid"].ToString()], rectangle);
-                                bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString() };
+                                Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particlesFilter.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particlesFilter.Rows[i]["RectTop"]), Width = Convert.ToInt32(particlesFilter.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particlesFilter.Rows[i]["RectHeight"]) };
+                                bmap = fldImgAccess.CapturePic(fieldpics[particlesFilter.Rows[i]["fieldid"].ToString()], rectangle);
+                                bmap.Tag = new List<string>() { particlesFilter.Rows[i]["FieldId"].ToString(), particlesFilter.Rows[i]["ParticleId"].ToString() };
                                 dgV_SimilarParticles.Rows[add_rowindex].Height = bmap.Height + 20;
                             }
                             dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = bmap;
                         }
                         if (enl.Current.Key == "DiameterRatio")
                         {
-                            double d = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
+                            double d = Convert.ToDouble(particlesFilter.Rows[i]["DMAX"]) / Convert.ToDouble(particlesFilter.Rows[i]["DMIN"]);
                             dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
                         }
                         if (en.Current.Key == "Element")
@@ -418,13 +418,13 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                         }
                         if (enl.Current.Key == "ASPECT_ELONG")
                         {
-                            double d = Convert.ToDouble(particles.Rows[i]["DELONG"]) / Convert.ToDouble(particles.Rows[i]["DMEAN"]);
+                            double d = Convert.ToDouble(particlesFilter.Rows[i]["DELONG"]) / Convert.ToDouble(particlesFilter.Rows[i]["DMEAN"]);
                             dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
                         }
-                        if (particles.Columns.Contains(enl.Current.Key))
+                        if (particlesFilter.Columns.Contains(enl.Current.Key))
                         {
                             double num = 0;
-                            if (double.TryParse(particles.Rows[i][enl.Current.Key].ToString(), out num))
+                            if (double.TryParse(particlesFilter.Rows[i][enl.Current.Key].ToString(), out num))
                             {
                                 if (enl.Current.Key == "SimilarRatio")
                                 {
@@ -438,7 +438,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                             else if (enl.Current.Key == "Element")
                             {
                                 List<string> elementtemp = new List<string>(ElementTypeSort);
-                                string[] strcbo = particles.Rows[i][enl.Current.Key].ToString().Split(';');
+                                string[] strcbo = particlesFilter.Rows[i][enl.Current.Key].ToString().Split(';');
                                 for (int j = 0; j < strcbo.Length; j++)
                                 {
                                     if (ElementTypeSort.Count == 0)
@@ -458,33 +458,33 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                             else
                             {
                                 double val = 0;
-                                if (double.TryParse(Convert.ToString(particles.Rows[i][enl.Current.Key]), out val))
+                                if (double.TryParse(Convert.ToString(particlesFilter.Rows[i][enl.Current.Key]), out val))
                                 {
                                     dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = val;
                                 }
                                 else
                                 {
-                                    dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = particles.Rows[i][enl.Current.Key];
+                                    dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = particlesFilter.Rows[i][enl.Current.Key];
                                 }
 
                             }
                         }
                         if (enl.Current.Key == "TypeName")
                         {
-                            if (particles.Rows[i]["TypeId"].ToString() == "9")
+                            if (particlesFilter.Rows[i]["TypeId"].ToString() == "9")
                             {
                                 dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = "Not Identified";
                             }
                         }
                         if (enl.Current.Key == "Equivalent")
                         {
-                            double dSize = Convert.ToDouble(particles.Rows[i]["Area"]);
+                            double dSize = Convert.ToDouble(particlesFilter.Rows[i]["Area"]);
                             double Diameter = Math.Sqrt(dSize / Math.PI) * 2;
                             dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(Diameter, 2);
                         }
                         if (enl.Current.Key == "AbPosX")
                         {
-                            Point point = OTSIncAReportGrids.ParticlesGridDevidePage.CalculateParticleCenterPosition(_particlesGridDevidePage.result, new Point(Convert.ToInt32(particles.Rows[i]["SEMPosX"]), Convert.ToInt32(particles.Rows[i]["SEMPosY"])), new Point(Convert.ToInt32(particles.Rows[i]["PosX"]), Convert.ToInt32(particles.Rows[i]["PosY"])));
+                            Point point = OTSIncAReportGrids.ParticlesGridDevidePage.CalculateParticleCenterPosition(_particlesGridDevidePage.result, new Point(Convert.ToInt32(particlesFilter.Rows[i]["SEMPosX"]), Convert.ToInt32(particlesFilter.Rows[i]["SEMPosY"])), new Point(Convert.ToInt32(particlesFilter.Rows[i]["PosX"]), Convert.ToInt32(particlesFilter.Rows[i]["PosY"])));
                             dgV_SimilarParticles.Rows[add_rowindex].Cells["AbPosX"].Value = point.X;
                             dgV_SimilarParticles.Rows[add_rowindex].Cells["AbPosY"].Value = point.Y;
                         }
@@ -744,26 +744,25 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 {
                     DataGridViewRow dgvr = SelectRows[0];
                     Bitmap ls_bp = (Bitmap)dgvr.Cells[3].Value;
-                    uint[] Search_xray = new uint[2000];
                     uint[] Analysis_xray = new uint[2000];
                     int i_xray_id = 0;
                     List<Element> list_celementchemistryclr = new List<Element>();
                     Particle particle = new Particle();
                     string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
-                    DataRow[] drs = particles.Select(str);
+                    DataRow[] drs = particlesFilter.Select(str);
                     DataRow row = drs[0];
-                    string subt = row["SubParticles"].ToString();
-                    if (subt != "" && subt != null)
+                    string subParticleString = row["SubParticles"].ToString();
+                    if (subParticleString != "" && subParticleString != null)
                     {
-                        particle = Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray);
+                        particle = Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Analysis_xray);
                         list_celementchemistryclr = particle.ElementList;
                     }
                     else
                     {
-                        particle = _particlesGridDevidePage.ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+                        particle = _particlesGridDevidePage.ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
                     }
 
-                    List<OTSIncAReportGraph.Controls.ShowElementInfo> list_showelementinfo = Particledata.GetShowElementInfos_ForMergeParticle(list_celementchemistryclr);
+                    List<OTSIncAReportGraph.Controls.ShowElementInfo> list_showelementinfo = Particledata.GetShowElementInfos(list_celementchemistryclr);
                     string str_IncAName = "";
                     str_IncAName = Convert.ToString(dgvr.Cells[2].Value);
                     if (particle == null)
@@ -772,7 +771,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                     }
                     control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + "  " + "DMAX:" + Math.Round(particle.DMAX, 2) + "  " + "DELONG:" + Math.Round(particle.DELONG, 2) + "  " + "DFERET:" + Math.Round(particle.DFERET, 2) + "  " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + "  " + "DMIN:" + Math.Round(particle.DMIN, 2) + "  " + "DPERP:" + Math.Round(particle.DPERP, 2) + "  " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + "  " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
                     control_XRayTable1.Visible = true;
-                    control_XRayTable1.SetXRayShowLineValue(null, Analysis_xray, list_showelementinfo);
+                    control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
                     control_XRayTable1.GBInfoStr = "";
                     control_XRayTable1.MaterialName = str_IncAName;
                     control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
@@ -783,19 +782,19 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                     int height = _result.GetImageHeight();
                     Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
 
-                    if (subt == "" || subt == null)
+                    if (subParticleString == "" || subParticleString == null)
                     {
                         int fldid = Convert.ToInt32(dgvr.Cells["fieldid"].Value);
                         int partid = Convert.ToInt32(dgvr.Cells["particleId"].Value);
                         var listseg = Particledata.GetSegmentData(fldid, partid);
                         string key = fldid.ToString() + "_" + partid.ToString();
                         segsData.Add(key, listseg);
-                        dataTable = particles.Clone();
+                        dataTable = particlesFilter.Clone();
                         dataTable.ImportRow(row);
                     }
                     else
                     {
-                        string vs = "," + subt.Replace(':', '-') + ",";
+                        string vs = "," + subParticleString.Replace(':', '-') + ",";
                         dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
                         foreach (DataRow dow in dataTable.Rows)
                         {
@@ -806,8 +805,8 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                             segsData.Add(key, listseg);
                         }
                     }
-                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, pix, height, width);
-                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, pix, height, width);
+                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subParticleString, dataTable, pix, height, width);
+                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subParticleString, dataTable, segsData, pix, height, width);
                     control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
                     Invalidate();
                 }

+ 56 - 69
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -78,7 +78,7 @@ namespace OTSIncAReportGrids
         frmReportConditionChoose m_condition;
         FieldData fieldData;
         DataTable particlesAll;
-        DataTable particles;
+        DataTable particlesFilter;
         public ParticleData Particledata;
         public UserSTDDbAccess userSTDDb;
         public FieldImage fldImgAccess;
@@ -377,8 +377,8 @@ namespace OTSIncAReportGrids
             DataTable XRayData = Particledata.GetXRayData();
             for (int i = 0; i < particlesAll.Rows.Count; i++)
             {
-                string subt = particlesAll.Rows[i]["SubParticles"].ToString();
-                if (subt =="")
+                string subParticleString = particlesAll.Rows[i]["SubParticles"].ToString();
+                if (subParticleString =="")
                 {
                     particlesAll.Rows[i]["XRayDataCount"] = 0;
                     string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
@@ -406,9 +406,8 @@ namespace OTSIncAReportGrids
 
                     particlesAll.Rows[i]["XRayDataCount"] = 0;
                     DataRow dgvr = particlesAll.Rows[i];
-                    uint[] Search_xray = new uint[2000];
                     uint[] Analysis_xray = new uint[2000];
-                    Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Search_xray, out Analysis_xray);
+                    Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Analysis_xray);
                     uint xraycount = 0;
                     for (int j = 0; j < 2000; j++)
                     {
@@ -468,14 +467,14 @@ namespace OTSIncAReportGrids
                 return;
             }
             RecordCount = particlesAll.Rows.Count;
-            particles = particlesAll.Clone();
+            particlesFilter = particlesAll.Clone();
             for (int fi = (PageIndex - 1) * pageSize; fi < PageIndex * pageSize; fi++)
             {
                 if (fi > RecordCount - 1)
                 {
                     break;
                 }
-                particles.ImportRow(particlesAll.Rows[fi]);
+                particlesFilter.ImportRow(particlesAll.Rows[fi]);
             }
 
             List<string> ElementTypeSort = new List<string>(str_ElementsColName.Split(',').ToList());//去重
@@ -492,10 +491,10 @@ namespace OTSIncAReportGrids
                 int id = dgV_ParticlesDevidePage.Columns.Count;
                 dgV_ParticlesDevidePage.Columns[id - 1].Tag = "NumericType";
             }
-            double jd = 95f / (double)particles.Rows.Count;
+            double jd = 95f / (double)particlesFilter.Rows.Count;
             string filePath = result.FilePath + "\\FIELD_FILES\\";
             
-            for (int i = 0; i < particles.Rows.Count; i++)
+            for (int i = 0; i < particlesFilter.Rows.Count; i++)
             {
                 if (i % 10 == 0)
                     m_frm_userprogress.SetProgressValueAndText((int)(jd * i), "loading..");
@@ -511,62 +510,62 @@ namespace OTSIncAReportGrids
                     {
                         if (enl.Current.Key == "ParticleImage")
                         {
-                            string subt = particles.Rows[i]["SubParticles"].ToString();
+                            string subParticleString = particlesFilter.Rows[i]["SubParticles"].ToString();
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
                             
                             
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
 
                             Bitmap bmap = null;
-                            if (subt != null && subt != "" && subt != "IsSubParticle")
+                            if (subParticleString != null && subParticleString != "" && subParticleString != "IsSubParticle")
                             {
                                 double pix =  result.GetPixelSize();
                                 int width = result.GetImageWidth(); 
                                 int height = result.GetImageHeight();
-                                string vs = "," + subt.Replace(':', '-') + ",";
+                                string vs = "," + subParticleString.Replace(':', '-') + ",";
                                 DataTable dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
-                                bmap = fldImgAccess.GetBitmapForMergedParticle(subt, pix, height, width, dataTable);
+                                bmap = fldImgAccess.GetBitmapForMergedParticle(subParticleString, pix, height, width, dataTable);
                                 if (bmap != null)
                                 {
-                                    string[] str = subt.Split(',');
+                                    string[] str = subParticleString.Split(',');
                                     bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1] };
                                 }
                             }
-                            else if (subt != "IsSubParticle")
+                            else if (subParticleString != "IsSubParticle")
                             {
-                                if (!fieldpics.Keys.Contains(particles.Rows[i]["fieldid"].ToString()))
+                                if (!fieldpics.Keys.Contains(particlesFilter.Rows[i]["fieldid"].ToString()))
                                 {
-                                    string imagePath = "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
-                                    fieldpics.Add(particles.Rows[i]["fieldid"].ToString(), fldImgAccess.ReadImageFile(imagePath));
+                                    string imagePath = "Field" + particlesFilter.Rows[i]["fieldid"].ToString() + ".bmp";
+                                    fieldpics.Add(particlesFilter.Rows[i]["fieldid"].ToString(), fldImgAccess.ReadImageFile(imagePath));
                                 }
-                                Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particles.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particles.Rows[i]["RectTop"]), Width = Convert.ToInt32(particles.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particles.Rows[i]["RectHeight"]) };
-                                bmap = fldImgAccess.CapturePic(fieldpics[particles.Rows[i]["fieldid"].ToString()], rectangle);
-                                bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString()};
+                                Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particlesFilter.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particlesFilter.Rows[i]["RectTop"]), Width = Convert.ToInt32(particlesFilter.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particlesFilter.Rows[i]["RectHeight"]) };
+                                bmap = fldImgAccess.CapturePic(fieldpics[particlesFilter.Rows[i]["fieldid"].ToString()], rectangle);
+                                bmap.Tag = new List<string>() { particlesFilter.Rows[i]["FieldId"].ToString(), particlesFilter.Rows[i]["ParticleId"].ToString()};
                                 dgV_ParticlesDevidePage.Rows[add_rowindex].Height = bmap.Height + 20;
                             }
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
                         }
                         if (enl.Current.Key == "DiameterRatio")
                         {
-                            double d = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
+                            double d = Convert.ToDouble(particlesFilter.Rows[i]["DMAX"]) / Convert.ToDouble(particlesFilter.Rows[i]["DMIN"]);
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
                         }
                         if (enl.Current.Key == "ASPECT_ELONG")
                         {
-                            double d = Convert.ToDouble(particles.Rows[i]["DELONG"]) / Convert.ToDouble(particles.Rows[i]["DMEAN"]);
+                            double d = Convert.ToDouble(particlesFilter.Rows[i]["DELONG"]) / Convert.ToDouble(particlesFilter.Rows[i]["DMEAN"]);
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
                         }
-                        if (particles.Columns.Contains(enl.Current.Key))
+                        if (particlesFilter.Columns.Contains(enl.Current.Key))
                         {
                             double num = 0;
-                            if (double.TryParse(particles.Rows[i][enl.Current.Key].ToString(), out num))
+                            if (double.TryParse(particlesFilter.Rows[i][enl.Current.Key].ToString(), out num))
                             {
                                 dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(num, 2);
                             }
                             else if (enl.Current.Key == "Element")
                             {
                                 List<string> elementtemp = new List<string>(ElementTypeSort);
-                                string[] strcbo = particles.Rows[i][enl.Current.Key].ToString().Split(';');
+                                string[] strcbo = particlesFilter.Rows[i][enl.Current.Key].ToString().Split(';');
                                 for (int j = 0; j < strcbo.Length; j++)
                                 {
                                     if (ElementTypeSort.Count == 0)
@@ -586,33 +585,33 @@ namespace OTSIncAReportGrids
                             else
                             {
                                 double val = 0;
-                                if (double.TryParse(Convert.ToString(particles.Rows[i][enl.Current.Key]), out val))
+                                if (double.TryParse(Convert.ToString(particlesFilter.Rows[i][enl.Current.Key]), out val))
                                 {
                                     dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = val;
                                 }
                                 else
                                 {
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = particles.Rows[i][enl.Current.Key];
+                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = particlesFilter.Rows[i][enl.Current.Key];
                                 }
 
                             }
                         }
                         if (enl.Current.Key == "TypeName")
                         {
-                            if (particles.Rows[i]["TypeId"].ToString() == "9")
+                            if (particlesFilter.Rows[i]["TypeId"].ToString() == "9")
                             {
                                 dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = "Not Identified";
                             }
                         }
                         if (enl.Current.Key == "Equivalent")
                         {
-                            double dSize = Convert.ToDouble(particles.Rows[i]["Area"]);
+                            double dSize = Convert.ToDouble(particlesFilter.Rows[i]["Area"]);
                             double Diameter = Math.Sqrt(dSize / Math.PI) * 2;
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = Math.Round(Diameter, 2);
                         }
                         if (enl.Current.Key == "Hardness")
                         {
-                            string str = ChangeHardnessColor(particles.Rows[i]["Hardness"].ToString());
+                            string str = ChangeHardnessColor(particlesFilter.Rows[i]["Hardness"].ToString());
                             {
                                 if (str == "#FF0000")
                                 {
@@ -622,7 +621,7 @@ namespace OTSIncAReportGrids
                         }
                         if (enl.Current.Key == "AbPosX")
                         {
-                            Point point = CalculateParticleCenterPosition(result, new Point(Convert.ToInt32(particles.Rows[i]["SEMPosX"]), Convert.ToInt32(particles.Rows[i]["SEMPosY"])), new Point(Convert.ToInt32(particles.Rows[i]["PosX"]), Convert.ToInt32(particles.Rows[i]["PosY"])));
+                            Point point = CalculateParticleCenterPosition(result, new Point(Convert.ToInt32(particlesFilter.Rows[i]["SEMPosX"]), Convert.ToInt32(particlesFilter.Rows[i]["SEMPosY"])), new Point(Convert.ToInt32(particlesFilter.Rows[i]["PosX"]), Convert.ToInt32(particlesFilter.Rows[i]["PosY"])));
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells["AbPosX"].Value = point.X;
                             dgV_ParticlesDevidePage.Rows[add_rowindex].Cells["AbPosY"].Value = point.Y;
                         }
@@ -1554,13 +1553,13 @@ namespace OTSIncAReportGrids
 
                     sheet2.AddMergedRegion(new NPOI.SS.Util.CellRangeAddress(1, 1, 1, 2000));
 
-                    for (int j = 0; j < particles.Rows.Count; j++)
+                    for (int j = 0; j < particlesFilter.Rows.Count; j++)
                     {
                         row = sheet2.CreateRow(2 + j);
                         cell = row.CreateCell(0);
                         cell.CellStyle = cellStyle;
                         cell.SetCellValue(j + 1);
-                        var tmpPart = Particledata.GetParticleXrayDataByFidAndPid(particles.Rows[j]["fieldid"].ToString(), particles.Rows[j]["particleid"].ToString());
+                        var tmpPart = Particledata.GetParticleXrayDataByFidAndPid(particlesFilter.Rows[j]["fieldid"].ToString(), particlesFilter.Rows[j]["particleid"].ToString());
                         if (tmpPart != null)
                         {
                             if (tmpPart.XrayId > -1)
@@ -1597,7 +1596,7 @@ namespace OTSIncAReportGrids
 
                     IDrawing drawing;
                     IClientAnchor anchor3;
-                    for (int j = 0; j < particles.Rows.Count; j++)
+                    for (int j = 0; j < particlesFilter.Rows.Count; j++)
                     {
                         row = sheet3.CreateRow(j + 2);
                         row.Height = 120 * 20;
@@ -1791,7 +1790,7 @@ namespace OTSIncAReportGrids
                             return;
                         }
                         var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
-                        uint[] Search_xray = new uint[2000];
+                        uint[] Analysis_xray = new uint[2000];
                         if (SelectRows.Count != 0)
                         {
                             if (SelectRows.Count == 1)
@@ -1799,13 +1798,12 @@ namespace OTSIncAReportGrids
                                 DataGridViewRow dgvr = SelectRows[0];
                                 Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
                                 List<string> list_str = (List<string>)ls_bp.Tag;
-                                uint[] Analysis_xray = new uint[2000];
                                 int i_xray_id = 0;
                                 List<Element> list_celementchemistryclr = new List<Element>();
-                                ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+                                ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
                             }
                         }
-                        ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, strings, m_ReportApp);
+                        ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Analysis_xray, strings, m_ReportApp);
                         DialogResult result3 = Form_listOfSimilarParticles.ShowDialog();
                         if (result3 == DialogResult.OK)
                         {
@@ -2373,9 +2371,9 @@ namespace OTSIncAReportGrids
 
         private void btn_showconfig_Click(object sender, EventArgs e)
         {
-            var p = particles; List<string> ele = new List<string>();
+            var p = particlesFilter; List<string> ele = new List<string>();
             string elementsstr = "";
-            foreach (DataRow row in particles.Rows)
+            foreach (DataRow row in particlesFilter.Rows)
             {
                 string[] strcbo = row["Element"].ToString().Split(';');
                 for (int j = 0; j < strcbo.Length; j++)
@@ -2455,26 +2453,16 @@ namespace OTSIncAReportGrids
                 {
                     DataGridViewRow dgvr = SelectRows[0];
                     Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
-                    uint[] Search_xray = new uint[2000];
                     uint[] Analysis_xray = new uint[2000];
-                    int i_xray_id = 0;
-                    List<Element> list_celementchemistryclr = new List<Element>();
                     Particle particle=new Particle();
                     string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
-                    DataRow[] drs = particles.Select(str);
+                    DataRow[] drs = particlesFilter.Select(str);
                     DataRow row = drs[0];
-                    string subt = row["SubParticles"].ToString();
-                    if (subt != ""&& subt != null)
-                    {
-                        particle = Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray);
-                        list_celementchemistryclr = particle.ElementList;
-                    }
-                    else
-                    {
-                        particle = ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
-                    }
+                    string subParticleString = row["SubParticles"].ToString();
+                    particle =Particledata.GetXrayByParticleIDAndFieldID(subParticleString, Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Analysis_xray);
+
 
-                    List<ShowElementInfo> list_showelementinfo = Particledata.GetShowElementInfos_ForMergeParticle(list_celementchemistryclr);
+                    List<ShowElementInfo> list_showelementinfo = Particledata.GetShowElementInfos(particle.ElementList);
                     string str_IncAName = "";
                     str_IncAName = Convert.ToString(dgvr.Cells[1].Value);
                     if (particle == null)
@@ -2483,7 +2471,7 @@ namespace OTSIncAReportGrids
                     }
                     control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + "  " + "DMAX:" + Math.Round(particle.DMAX, 2) + "  " + "DELONG:" + Math.Round(particle.DELONG, 2) + "  " + "DFERET:" + Math.Round(particle.DFERET, 2) + "  " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + "  " + "DMIN:" + Math.Round(particle.DMIN, 2) + "  " + "DPERP:" + Math.Round(particle.DPERP, 2) + "  " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + "  " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
                     control_XRayTable1.Visible = true;
-                    control_XRayTable1.SetXRayShowLineValue(null, Analysis_xray, list_showelementinfo);
+                    control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
                     control_XRayTable1.GBInfoStr = "";
                     control_XRayTable1.MaterialName = str_IncAName;
                     control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
@@ -2496,19 +2484,19 @@ namespace OTSIncAReportGrids
                     int height = result.GetImageHeight();
                     Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
 
-                    if (subt == "" || subt == null)
+                    if (subParticleString == "" || subParticleString == null)
                     {
                         int fldid = Convert.ToInt32(dgvr.Cells["fieldid"].Value);
                         int partid = Convert.ToInt32(dgvr.Cells["particleId"].Value);
                         var listseg = Particledata.GetSegmentData(fldid, partid);
                         string key = fldid.ToString() + "_" + partid.ToString();
                         segsData.Add(key, listseg);
-                        dataTable= particles.Clone();
+                        dataTable= particlesFilter.Clone();
                         dataTable.ImportRow(row);
                     }
                     else
                     {
-                        string vs = "," + subt.Replace(':', '-') + ",";
+                        string vs = "," + subParticleString.Replace(':', '-') + ",";
                         dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
                         foreach (DataRow dow in dataTable.Rows)
                         {
@@ -2519,8 +2507,8 @@ namespace OTSIncAReportGrids
                             segsData.Add(key, listseg);
                         }
                     }
-                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, pix, height, width);
-                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, pix, height, width);
+                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subParticleString, dataTable, pix, height, width);
+                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subParticleString, dataTable, segsData, pix, height, width);
                     control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
                     Invalidate();
                     ToolStripMenuItem_SimilarityReclassification.Enabled = true;
@@ -2632,7 +2620,6 @@ namespace OTSIncAReportGrids
                 return;
             }
             var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
-            uint[] Search_xray = new uint[2000];
 
             DataGridViewRow dgvr = SelectRows[0];
             Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
@@ -2642,18 +2629,18 @@ namespace OTSIncAReportGrids
             List<Element> list_celementchemistryclr = new List<Element>();
 
             string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
-            DataRow[] drs = particles.Select(str);
+            DataRow[] drs = particlesFilter.Select(str);
             DataRow row = drs[0];
-            string subt = row["SubParticles"].ToString();
-            if (subt != "" && subt != null)
+            string subParticleString = row["SubParticles"].ToString();
+            if (subParticleString != "" && subParticleString != null)
             {
-                Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray);
+                Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Analysis_xray);
             }
             else
             {
-                ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+                ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
             }
-            ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, m_ReportApp);
+            ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Analysis_xray, m_ReportApp);
             DialogResult result3 = Form_listOfSimilarParticles.ShowDialog();
             if (result3 == DialogResult.OK)
             {

+ 52 - 28
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -1,5 +1,4 @@
-
-using DevExpress.Utils;
+using DevExpress.Utils;
 using DevExpress.XtraCharts;
 using OTSIncAReportApp._1_UI.Control_DEVCharts;
 using OTSIncAReportApp.OTSRstMgrFunction;
@@ -30,9 +29,8 @@ namespace OTSIncAReportGrids
         Hashtable table;
 
         //测量结果
-        ResultFile result = null;
-
-        OTSIncAReportApp.OTSSampleReportInfo.ReportCondition source;
+        ResultFile resultFile = null;
+        OTSIncAReportApp.OTSSampleReportInfo.ReportCondition reportCondition;
         OTSIncAReportApp.frmReportApp m_ReportApp;
 
         int gridheight = 0;
@@ -65,12 +63,16 @@ namespace OTSIncAReportGrids
         /// <summary>
         /// 绑定datagridview数据
         /// </summary>
-        public void BindDataGridView(string path, int num, string filename)
+        public void UpdateDataGrid(string path, int num, string filename)
         {
             List<string> colid = new List<string>() { "rowid", "pname", "color", "TypeId", "Largest", "Total" };
             List<string> colname = new List<string>() { table["str1"].ToString(), table["str8"].ToString(), table["str9"].ToString(), "TypeId", table["str10"].ToString(), table["str11"].ToString() };
 
             OTSGridView gridView = new OTSGridView();
+
+            gridView.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(Gview_ColumnHeaderMouseClick);
+            gridView.Sorted += Gview_gz_Sorted;
+
             OTSIncAReportApp.DataOperation.DataAccess.ParticleData particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(path);
 
             DataTable dtp = particledata.GetParticleAll("");
@@ -82,7 +84,7 @@ namespace OTSIncAReportGrids
             }
             else
             {
-                con = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
+                con = reportCondition.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
             }
 
             string po = "";
@@ -105,7 +107,7 @@ namespace OTSIncAReportGrids
             if (m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile == "AUTO.psf")
             {
                 double dn = 99999;
-                string sou = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+                string sou = reportCondition.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
                 if (sou.Contains("+"))
                 {
                     for (int i = 0; i < sou.Split('+').Length; i++)
@@ -193,7 +195,7 @@ namespace OTSIncAReportGrids
                     continue;
                 }
                 int add_rowindex = gridView.Rows.Add();
-
+                gridView.Rows[add_rowindex].Tag = "Statistics";
                 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;
@@ -222,7 +224,7 @@ namespace OTSIncAReportGrids
                     continue;
                 }
                 int add_rowindex = gridView.Rows.Add();
-
+                gridView.Rows[add_rowindex].Tag = "Statistics";
                 gridView.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
 
                 int index = FLID.IndexOf(Convert.ToInt32(dt.Rows[i]["TypeId"]));
@@ -279,11 +281,25 @@ namespace OTSIncAReportGrids
             }
 
             gridView.Name = "gridView" + num.ToString();
-            int a1=gridView.Rows.Add();
+            list_table_Point.Add(SetDataGridViewStyle(gridView));
+            AddSumRow(gridView);
+            panel1.Controls.Add(gridView);
+			list_table_data.Add(m_dt);
+
+		}
+
+
+
+        void AddSumRow(OTSGridView gridView)
+        {
+            if (gridView.Rows == null || gridView.Rows.Count <1)
+                return;
+            int a1 = gridView.Rows.Add();
+            gridView.Rows[a1].Tag = "Sum";
             gridView.Rows[a1].Cells[1].Value = "Sum";
-            for(int j=0;j< gridView.Rows.Count-2;j++)
+            for (int j = 0; j < gridView.Rows.Count - 1; j++)
             {
-                for(int k=3;k< gridView.Columns.Count;k++)
+                for (int k = 5; k < gridView.Columns.Count; k++)
                 {
                     if (gridView.Rows[a1].Cells[k].Value == null)
                         gridView.Rows[a1].Cells[k].Value = 0;
@@ -297,12 +313,7 @@ namespace OTSIncAReportGrids
                     }
                 }
             }
-            list_table_Point.Add(SetDataGridViewStyle(gridView));
-            panel1.Controls.Add(gridView);
-			list_table_data.Add(m_dt);
-
-		}
-
+        }
         /// <summary>
         /// 设置DataGridView样式
         /// </summary>
@@ -372,7 +383,6 @@ namespace OTSIncAReportGrids
 			gridheight = gridheight + gridView.RowCount * 30 + 5;
             gridwidth = gridwidth + gridView.ColumnCount * 100;
 			gridView.TabIndex = 0;
-            gridView.Sorted += Gview_gz_Sorted;
             //先设置一下头的高度,否则会太矮不好看
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             gridView.ColumnHeadersHeight = 40;
@@ -400,8 +410,8 @@ namespace OTSIncAReportGrids
         public ParticlesSizeGrid(OTSIncAReportApp.frmReportApp ReportApp)
         {
             m_ReportApp = ReportApp;
-            result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()];
-            source = m_ReportApp.m_conditionChoose.m_conditionData;
+            resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()];
+            reportCondition = m_ReportApp.m_conditionChoose.m_conditionData;
 
 
             InitializeComponent();
@@ -417,7 +427,7 @@ namespace OTSIncAReportGrids
             list_fileName.Clear();
 	
 
-			string sou = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+			string sou = reportCondition.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
@@ -425,7 +435,7 @@ namespace OTSIncAReportGrids
                     ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
                     if (resultFile != null)
                     {
-                        BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
+                        UpdateDataGrid(resultFile.FilePath, i, resultFile.anotherFileName);
                         list_fileName.Add(resultFile.anotherFileName);
 
 					}
@@ -437,7 +447,7 @@ namespace OTSIncAReportGrids
                 {
                     if (sou == m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString())
                     {
-						BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
+						UpdateDataGrid(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
                         list_fileName.Add(m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
 					}
                  
@@ -650,7 +660,7 @@ namespace OTSIncAReportGrids
 
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
             //string sou = m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
-            string sou = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+            string sou = reportCondition.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
@@ -658,23 +668,37 @@ namespace OTSIncAReportGrids
                     ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
                     if (resultFile != null)
                     {
-                        BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
+                        UpdateDataGrid(resultFile.FilePath, i, resultFile.anotherFileName);
                     }
                 }
             }
             else
             {
-                BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].anotherFileName);
+                UpdateDataGrid(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].anotherFileName);
             }
         }
 
         private void Gview_gz_Sorted(object sender, EventArgs e)
         {
+            if (((OTSGridView)sender).Rows == null || ((OTSGridView)sender).Rows.Count == 0)
+                return;
+            for (int i = 0; i < ((OTSGridView)sender).Rows.Count; i++)
+            {
+                if (((OTSGridView)sender).Rows[i].Tag.ToString() == "Sum")
+                { ((OTSGridView)sender).Rows.RemoveAt(i); break; }
+            }
             //排序完成,重新设置序号
             for (int i = 0; i < ((OTSGridView)sender).Rows.Count; i++)
             {
                 ((OTSGridView)sender).Rows[i].Cells[0].Value = (i+1).ToString();
             }
+            ((OTSGridView)sender).Refresh();
+        }
+        void Gview_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
+        {
+            if (((OTSGridView)sender).Rows == null || ((OTSGridView)sender).Rows.Count == 0)
+                return;
+            AddSumRow((OTSGridView)sender);
         }
         #endregion
 

+ 1 - 3
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleList.cs

@@ -507,7 +507,6 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
         {
             Bitmap ret_bp;
             //显示xray相关信息
-            uint[] Search_xray = new uint[2000];
             uint[] Analysis_xray = new uint[2000];
             int i_xray_id = 0;
 
@@ -528,7 +527,6 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                         Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
                     }
                 }
-                Search_xray = Analysis_xray;
                 i_xray_id = particle.XrayId;
                 list_celementchemistryclr = particle.ElementList;
             }
@@ -566,7 +564,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
             //获取数据后,需要对xraytable设置
             OTSIncAReportGraph.Controls.Control_XRayTable control_XRayTable1 = new Control_XRayTable();
-            control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
+            control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
             //颗粒国标信息
             //control_XRayTable1.GBInfoStr = in_dparticle.GBContent;
             control_XRayTable1.MaterialName = str_IncALibName;//杂夹物

+ 1 - 3
OTSIncAReportApp/1-UI/frmReMeasure.cs

@@ -569,14 +569,12 @@ namespace OTSIncAReportApp
                 return;
             }
             //显示xray相关信息
-            uint[] Search_xray = new uint[2000];
             uint[] Analysis_xray = new uint[2000];
             //获取Xray数据
             for (int i = 0; i < 2000; i++)
             {
                 Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
             }
-            Search_xray = Analysis_xray;
             //get CElementChemistryClr list
             List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
             for (int i = 0; i < particle.ElementList.Count; i++)
@@ -600,7 +598,7 @@ namespace OTSIncAReportApp
 
             //获取数据后,需要对xraytable设置
             control_XRayTable1.Visible = false;
-            control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
+            control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
             //颗粒国标信息
             control_XRayTable1.GBInfoStr = "";
             control_XRayTable1.MaterialName = particle.TypeName;//名称

+ 64 - 11
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -1,4 +1,5 @@
 using OTSCommon.DBOperate.Model;
+using OTSIncAReportApp.OTSRstMgrFunction;
 using OTSIncAReportGraph.Controls;
 using OTSPeriodicTable;
 using System;
@@ -82,14 +83,17 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             return DT;
         }
 
+        
+        
+        
+        
         /// <summary>
         /// 获取ParticleList
         /// </summary>
         /// <param name="model">Feature</param>
         /// <returns></returns>
-        public Particle GetMergedParticleInfo(int fieldid, int particleid, out uint[] Search_xray, out uint[] Analysis_xray)
+        public Particle GetMergedParticleInfo(int fieldid, int particleid, out uint[] Analysis_xray)
         {
-
             string sqlp = @"select *,
                             (select group_concat(name||'-'||Percentage,';')  
                             from ElementChemistry where XRayId	=IncAData.XRayId		and fieldid=IncAData.fieldid	) as Element
@@ -99,7 +103,6 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             List<Particle> listp = dbHelper.TableToList<Particle>(DT);
             Particle pte = new Particle();
             Analysis_xray =new uint[2000];
-            Search_xray= new uint[2000];
             if (listp.Count > 0)
             {
                 pte = listp[0];
@@ -127,7 +130,6 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                     {
                         Analysis_xray[i] = Analysis_xray[i]+ BitConverter.ToUInt32(bytes, i * 4);
                     }
-                    Search_xray = Analysis_xray;
                 }
             }
             return pte;
@@ -954,8 +956,8 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             {
                 foreach (DataRow MergeParticlesRow in dataTable_MergeParticles.Rows)
                 {
-                    string subt = MergeParticlesRow["SubParticles"].ToString();
-                    string[] sub = subt.Split(',');
+                    string subParticleString = MergeParticlesRow["SubParticles"].ToString();
+                    string[] sub = subParticleString.Split(',');
                     if (row.RowState == DataRowState.Deleted)
                     {
                         break;
@@ -1014,17 +1016,68 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// </summary>
         /// <param name="in_clr_tagid">颗粒id</param>
         /// <param name="in_clr_fieldid"></param>
-        /// <param name="Search_xray"></param>
         /// <param name="Analysis_xray"></param>
-        public Particle GetXrayByParticleTagIDAndFieldID_ForMergeParticle(int in_clr_tagid, int in_clr_fieldid, out uint[] Search_xray, out uint[] Analysis_xray)
+        public Particle GetXrayByParticleTagIDAndFieldID_ForMergeParticle(int in_clr_tagid, int in_clr_fieldid, out uint[] Analysis_xray)
         {
-            Search_xray = new uint[2000];
             Analysis_xray = new uint[2000];
             Particle particle = new Particle();
-            particle = GetMergedParticleInfo(in_clr_fieldid, in_clr_tagid, out Search_xray, out Analysis_xray);
+            particle = GetMergedParticleInfo(in_clr_fieldid, in_clr_tagid, out Analysis_xray);
             return particle;
         }
-        public List<ShowElementInfo> GetShowElementInfos_ForMergeParticle(List<Element> list_celementchemistryclr)
+        public Particle GetXrayByParticleIDAndFieldID(string subParticleString, int in_clr_tagid, int in_clr_fieldid, out uint[] Analysis_xray)
+        {
+            if (subParticleString != "" && subParticleString != null)
+            {
+                return GetXrayByParticleTagIDAndFieldID_ForMergeParticle(in_clr_tagid, in_clr_fieldid, out Analysis_xray);
+            }
+            else
+            {
+                return GetXrayByParticleTagIDAndFieldID_ForUncombinedParticle(in_clr_tagid, in_clr_fieldid, out Analysis_xray);
+            }
+        }
+        public Particle GetXrayByParticleTagIDAndFieldID_ForUncombinedParticle(int in_clr_tagid, int in_clr_fieldid, out uint[] Analysis_xray)
+        {
+            string sqlp = @"select *,
+                            (select group_concat(name||'-'||Percentage,';')  
+                            from ElementChemistry where XRayId	=IncAData.XRayId		and fieldid=IncAData.fieldid	) as Element
+                            from 	IncAData  where FieldId=" + in_clr_fieldid.ToString() + " and ParticleId=" + in_clr_tagid.ToString();
+            DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
+            List<Particle> listp = dbHelper.TableToList<Particle>(DT);
+            Particle pte = new Particle();
+            Analysis_xray = new uint[2000];
+            if (listp.Count > 0)
+            {
+                pte = listp[0];
+                List<OTSCommon.DBOperate.Model.Element> ElementList = new List<OTSCommon.DBOperate.Model.Element>();
+                string element = DT.Rows[0]["Element"].ToString();
+                for (int i = 0; i < element.Split(';').Count(); i++)
+                {
+                    string elestr = element.Split(';')[i];
+                    if (elestr != "")
+                    {
+                        OTSCommon.DBOperate.Model.Element ele = new OTSCommon.DBOperate.Model.Element() { Name = elestr.Split('-')[0], Percentage = Convert.ToDouble(elestr.Split('-')[1]) };
+                        ElementList.Add(ele);
+                    }
+                }
+                pte.ElementList = ElementList;
+                Analysis_xray = new uint[2000];
+                var particle = GetParticleXrayDataByFidAndPid(Convert.ToString(in_clr_fieldid), Convert.ToString(in_clr_tagid));
+                
+                pte.XRayData = particle.XRayData;
+                if (particle != null)
+                {
+                    if (particle.XrayId > -1)
+                    {
+                        for (int i = 0; i < 2000; i++)
+                        {
+                            Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
+                        }
+                    }
+                }
+            }
+            return pte;
+        }
+        public List<ShowElementInfo> GetShowElementInfos(List<Element> list_celementchemistryclr)
         {
             List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
             for (int i = 0; i < list_celementchemistryclr.Count; i++)

+ 14 - 14
OTSIncAReportApp/3-ServiceCenter/DataOperation/ImageAccess/FieldImage.cs

@@ -18,15 +18,15 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 拼接颗粒黑白图
         /// </summary>
-        /// <param name="substring">拼接字符串</param>
+        /// <param name="subParticleString">拼接字符串</param>
         /// <param name="PartdataTable">组成拼接颗粒的子颗粒</param>
         /// <param name="picHeight">图像高</param>
         /// <param name="picWidth">帧图宽</param>
         ///  <param name="segsData">KEY为FidANDpID</param> 
         /// <returns></returns>
-        public Bitmap GetBlackAndWhiteBitmapForMergedParticle(string substring, double pix, int picHeight, int picWidth,DataTable PartdataTable,Dictionary<string,List<Segment>> segsData)
+        public Bitmap GetBlackAndWhiteBitmapForMergedParticle(string subParticleString, double pix, int picHeight, int picWidth,DataTable PartdataTable,Dictionary<string,List<Segment>> segsData)
         {
-            string vs = "," + substring.Replace(':', '-') + ",";
+            string vs = "," + subParticleString.Replace(':', '-') + ",";
             
             if (PartdataTable.Rows.Count == 0)
             {
@@ -139,14 +139,14 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 拼接颗粒图
         /// </summary>
-        /// <param name="substring">拼接字符串</param>
+        /// <param name="subParticleString">拼接字符串</param>
         /// <param name="picHeight">图像高</param>
         /// <param name="picWidth">帧图宽</param>
         /// <param name="dataTable">组成拼接颗粒的子颗粒</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForMergedParticle(string substring, double pix, int picHeight, int picWidth,DataTable dataTable)
+        public Bitmap GetBitmapForMergedParticle(string subParticleString, double pix, int picHeight, int picWidth,DataTable dataTable)
         {
-            string vs = "," + substring.Replace(':', '-') + ",";
+            string vs = "," + subParticleString.Replace(':', '-') + ",";
 
            
             if (dataTable.Rows.Count == 0)
@@ -288,18 +288,18 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 获取全部颗粒图
         /// </summary>
-        /// <param name="substring">拼接颗粒连接字符串</param>
+        /// <param name="subParticleString">拼接颗粒连接字符串</param>
         /// <param name="dataTable">颗粒表</param>
         /// <param name="pix">pixel</param>
         /// <param name="picHeight">帧图高</param>
         /// <param name="picWidth">帧图宽</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForParticleAll(string substring, DataTable dataTable, double pix=0, int picHeight=0, int picWidth=0)
+        public Bitmap GetBitmapForParticleAll(string subParticleString, DataTable dataTable, double pix=0, int picHeight=0, int picWidth=0)
         {
             Bitmap bmap;
-            if(substring != "")
+            if(subParticleString != "")
             {
-                bmap = GetBitmapForMergedParticle(substring, pix, picHeight, picWidth,dataTable);
+                bmap = GetBitmapForMergedParticle(subParticleString, pix, picHeight, picWidth,dataTable);
             }
             else
             {
@@ -310,18 +310,18 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 获取全部颗粒图
         /// </summary>
-        /// <param name="subsubstring">拼接颗粒连接字符串</param>
+        /// <param name="subParticleString">拼接颗粒连接字符串</param>
         /// <param name="dataTable">颗粒表 或 组成拼接颗粒的子颗粒表</param>
         /// <param name="pix">pixel</param>
         /// <param name="picHeight">帧图高</param>
         /// <param name="picWidth">帧图宽</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForParticleAllWithBlackAndWhite(string subsubstring, DataTable dataTable, Dictionary<string, List<Segment>> segsData, double pix = 0, int picHeight = 0, int picWidth = 0)
+        public Bitmap GetBitmapForParticleAllWithBlackAndWhite(string subParticleString, DataTable dataTable, Dictionary<string, List<Segment>> segsData, double pix = 0, int picHeight = 0, int picWidth = 0)
         {
             Bitmap bmap;
-            if (subsubstring != "")
+            if (subParticleString != "")
             {
-                bmap = GetBlackAndWhiteBitmapForMergedParticle(subsubstring, pix, picHeight, picWidth, dataTable, segsData);
+                bmap = GetBlackAndWhiteBitmapForMergedParticle(subParticleString, pix, picHeight, picWidth, dataTable, segsData);
             }
             else
             {