Переглянути джерело

提交合并颗粒导出功能第一版可用

zhangjiaxin 1 місяць тому
батько
коміт
d42774be4d

+ 20 - 9
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/BasicData.cs

@@ -31,6 +31,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
 		private List<DataTable> BData = new List<DataTable>();
         private List<DataTable> Measurements = new List<DataTable>();//测量结果数据列队
+        private DataTable spliceMeasurements = new DataTable();//拼接测量结果数据列队
 
 		private DataTable AllClass = new DataTable();
         private DataTable AllElement = new DataTable();
@@ -123,6 +124,9 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 			DataTable qparticlesAll = particlesGridDevide.Particledata.GetInfoForPartucleDevidePage_mergeParticles("");
             particlesAll = SplicingParticleElementFilling(qparticlesAll, particlesGridDevide, userSTDDbData);
 
+
+
+
             return particlesAll;
 		}
 
@@ -188,9 +192,9 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             DataTable dt = InvalidRemoval(fielddata.GetParticleListForParticlSize("area", ""));
             DataTable AreaInformationOfAllElements = InvalidRemoval(fielddata.GetAreaByAllIncA(""));
             DataTable dtp = InvalidRemoval(fielddata.GetParticleAll(""));
+			spliceMeasurements= InvalidRemoval(fielddata.GetSpliceParticleAll(""));
 
-
-            DataTable particlesAll = ObtainInformationOnSplicedParticles(m_otsreport_export);//拼接颗粒信息
+			DataTable particlesAll = ObtainInformationOnSplicedParticles(m_otsreport_export);//拼接颗粒信息
 
 			#region 分割出需要删除的拼接前的颗粒
 			List<string> listPicture = new List<string>();
@@ -221,12 +225,9 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 					}
                 }
 			}
-			#endregion
-
-			#region 添加拼接颗粒
+            #endregion
 
-
-			#endregion
+ 
 
 
 			string po = ComputeMode;
@@ -291,7 +292,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                         string d2 = colid[a].Split('~')[1];
                         if (d2 == "MAX")
                         {
-                            d2 = "999";
+                            d2 = "999999999";
                         }
                         DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
                         dr[colid[a]] = datas.Count();
@@ -677,7 +678,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 					DataRow dgvr = a_particlesAll.Rows[i];
 					uint[] Search_xray = new uint[2000];
 					uint[] Analysis_xray = new uint[2000];
-					particlesGridDevide.Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Search_xray, out Analysis_xray);
+					particlesGridDevide.Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Analysis_xray);
 					uint xraycount = 0;
 					for (int j = 0; j < 2000; j++)
 					{
@@ -737,6 +738,16 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
 		}
 
+		/// <summary>
+		///拼接测量结果数据列队
+		/// </summary>
+		/// <returns></returns>
+		public DataTable GetSpliceMeasurements()
+		{
+			return spliceMeasurements;
+
+		}
+
 		/// <summary>
 		/// 定义ParticleData类
 		/// </summary>

+ 196 - 40
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleList.cs

@@ -24,6 +24,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Windows.Media;
+using static NPOI.HSSF.Util.HSSFColor;
 using static OTSDataType.otsdataconst;
 using static OTSIncAReportApp.OTSReport_Export;
 
@@ -37,23 +38,48 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
         //string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
         ParticleData fielddata;
         FieldImage imgAcc;
-        /// <summary>
-        /// DEV颗粒列表颗粒前20个谱图排序
-        /// </summary>
-        /// <param name="m_mbszclass"></param>
-        /// <returns></returns>
-        public List<DataTable> Get_dev_kllb_data(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export,BasicData basicData,out List<DataTable> a_FilteredData)
+
+
+        //ResultFile result;
+		/// <summary>
+		/// DEV颗粒列表颗粒前20个谱图排序
+		/// </summary>
+		/// <param name="m_mbszclass"></param>
+		/// <returns></returns>
+		public List<DataTable> Get_dev_kllb_data(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export,BasicData basicData,out List<DataTable> a_FilteredData)
 		{
 			
 			//------------------加载模块,获取数据-------------------------------------------------
 			string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
 			 fielddata = new ParticleData(str_resultPath);
-             imgAcc = new FieldImage(str_resultPath   );
+             imgAcc = new FieldImage(str_resultPath);
             List<DataTable> OutDt = new List<DataTable>();
             a_FilteredData = new List<DataTable>();
 
 			List<DataTable> datas = basicData.GetMeasurements();
-            for (int i = 0; i < datas.Count; i++)
+			DataTable SpliceMeasurements= basicData.GetSpliceMeasurements();
+
+			DataTable spliceAll = basicData.ObtainInformationOnSplicedParticles(m_otsreport_export);//拼接颗粒信息
+
+
+
+			ResultFile result;
+			string sou = m_otsreport_export.m_ReportApp.m_conditionChoose.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+			if (sou.Contains("+"))
+			{
+				MessageBox.Show("This function does not support multiple samples!");
+				result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[0];
+			}
+			else
+			{
+				result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)];
+			}
+			ParticlesGridDevidePage particlesGridDevide = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
+            particlesGridDevide.fldImgAccess = new FieldImage(result.FilePath);
+			particlesGridDevide.Particledata= new ParticleData(result.FilePath);
+
+
+			for (int i = 0; i < datas.Count; i++)
             {
 				int serialNumber = 1;
 				if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.TCCleannessA/*|| m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.BatteryCleannessA*/)
@@ -155,7 +181,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 				#endregion
 
 
-				DataTable p1Data = fielddata.AddElementColumn(p1Data_b, m_mbszclass);
+				DataTable p1Data = fielddata.AddElementColumn(p1Data_b, m_mbszclass, spliceAll);
 
 
 				#region 插入颗粒部份
@@ -184,41 +210,123 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                             DataTable table1=p1Data.Clone();
                             table1.ImportRow(p1Data.Rows[i_row]);
 
+                            bool isSplice = false;
+							for (int b = 0; b < spliceAll.Rows.Count; b++)
+                            {
+                                if (spliceAll.Rows[b]["SubParticles"].ToString() == p1Data.Rows[i_row]["SubParticles"].ToString())
+                                {
+                                    isSplice = true;
+								}
+                            }
 
-                            Bitmap bp_particle = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
-							bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, System.Drawing.Color.White);
-							bp_particle.Tag = new List<string>() { p1Data.Rows[i_row]["FieldId"].ToString(), p1Data.Rows[i_row]["ParticleId"].ToString(), p1Data.Rows[i_row]["TypeId"].ToString() };
-							//获取该颗粒的xray能谱图像
-							DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);
-							//ElementIcons.Add(DT_XR);
-							System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
-									str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
-							Bitmap ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
-							DataTable SegmentData = fielddata.GetSegment();
-							Bitmap BinaryParticles = ImageSplicer.ParticleBinaryDiagram(SegmentData, Convert.ToInt32(str_fieldid), Convert.ToInt32(str_particleid));
-							Bitmap BP = imageProcessor.ResizeImageWithPadding(BinaryParticles, 120, 120, System.Drawing.Color.White);
-							//获取该颗粒的二次放大处理图像
-							//Bitmap ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
-							//再将图像转成二进制流-------------------------------------------------------------------
-							//原图
-							MemoryStream newms_p1 = new MemoryStream();
-							bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
+                            //原图
+                            Bitmap bp_particle;
 							//二次放大图
-							MemoryStream newms_p2 = new MemoryStream();
-							BP.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
-							//能谱图
-							MemoryStream newms_p3 = new MemoryStream();
-							ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
-							//---------------------------------------------------------------------------------------                   
-							DataRow dr = DT_Largest20.NewRow();
+							Bitmap BP;
+							//获取该颗粒的xray能谱图像
+							Bitmap ls_xraybpnew;
+
+                            if (!isSplice)
+                            {
+                                //原图
+                                bp_particle = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
+                                bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, System.Drawing.Color.White);
+                                bp_particle.Tag = new List<string>() { p1Data.Rows[i_row]["FieldId"].ToString(), p1Data.Rows[i_row]["ParticleId"].ToString(), p1Data.Rows[i_row]["TypeId"].ToString() };
+                                MemoryStream newms_p1 = new MemoryStream();
+                                bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
+
+
+                                //获取该颗粒的xray能谱图像
+                                DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);
+                                //ElementIcons.Add(DT_XR);
+                                System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
+                                        str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
+                                ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理																														   //能谱图
+                                MemoryStream newms_p3 = new MemoryStream();
+                                ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
+
+
+
+                                DataTable SegmentData = fielddata.GetSegment();
+                                Bitmap BinaryParticles = ImageSplicer.ParticleBinaryDiagram(SegmentData, Convert.ToInt32(str_fieldid), Convert.ToInt32(str_particleid));
+                                BP = imageProcessor.ResizeImageWithPadding(BinaryParticles, 120, 120, System.Drawing.Color.White);
+                                //二次放大图
+                                MemoryStream newms_p2 = new MemoryStream();
+                                BP.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
+
+								newms_p1.Dispose();
+								newms_p2.Dispose();
+								newms_p3.Dispose();
+							}
+                            else 
+                            {
+                                List<string> strFieldId = new List<string>();
+								List<string> strXrayId = new List<string>();
+								string detailedLocation = p1Data.Rows[i_row]["SubParticles"].ToString();
+								string[] fruits = detailedLocation.Split(',');
+								for (int p2 = 0; p2 < fruits.Length; p2++)
+								{
+									string[] fruit = fruits[p2].Split(':');
+									strFieldId.Add(fruit[0]);
+									strXrayId.Add(fruit[1]);
+								}
+								DataTable SpliceData = p1Data.Clone();
+								for (int splice = 0; splice < SpliceMeasurements.Rows.Count; splice++)
+                                {
+                                    for (int splice2 = 0; splice2 < strFieldId.Count; splice2++)
+                                    {
+										if (SpliceMeasurements.Rows[splice]["FieldId"].ToString() == strFieldId[splice2] && SpliceMeasurements.Rows[splice]["XrayId"].ToString() == strXrayId[splice2])
+										{
+											SpliceData.Rows.Add(SpliceMeasurements.Rows[splice].ItemArray);
+										}
+									}
+
+                                    
+                                }
+
+								double pix = particlesGridDevide.result.GetPixelSize();
+								int bitHeight = particlesGridDevide.result.GetImageHeight();
+								int bitWidth = particlesGridDevide.result.GetImageWidth();
+
+
+								//原图
+								Bitmap original = particlesGridDevide.fldImgAccess.GetBitmapForParticleAll
+                                    (p1Data.Rows[i_row]["SubParticles"].ToString(), SpliceData, pix, bitHeight, bitWidth);
+								bp_particle= OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(original, 120, 120);
+								//黑白图
+								Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
+								foreach (DataRow dow in SpliceData.Rows)
+								{
+									int fldid = Convert.ToInt32(dow["fieldid"]);
+									int partid = Convert.ToInt32(dow["particleId"]);
+									var listseg = particlesGridDevide.Particledata.GetSegmentData(fldid, partid);
+									string key = dow["fieldid"].ToString() + "_" + dow["particleid"].ToString();
+									segsData.Add(key, listseg);
+								}
+								Bitmap black = particlesGridDevide.fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite
+									(p1Data.Rows[i_row]["SubParticles"].ToString(), SpliceData, segsData, pix, bitHeight, bitWidth);
+								BP = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(black, 120, 120);
+
+								//谱图
+								Bitmap xraybpnew = splice_ExportXRayBitmap
+                                    (p1Data.Rows[i_row]["SubParticles"].ToString(), Convert.ToInt32(p1Data.Rows[i_row]["particleId"]), 
+                                    Convert.ToInt32(p1Data.Rows[i_row]["fieldid"]), particlesGridDevide.Particledata, p1Data.Rows[i_row]["TypeName"].ToString());
+								ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(xraybpnew, 700, 115);//能谱图处理
+																														
+
+							}
+
+
+
+
+                                //---------------------------------------------------------------------------------------                   
+                                DataRow dr = DT_Largest20.NewRow();
 							dr["p1"] = bp_particle;
 							dr["p2"] = BP;
 							dr["p3"] = ls_xraybpnew;
 
 
-							newms_p1.Dispose();
-							newms_p2.Dispose();
-							newms_p3.Dispose();
+							
 							dr["pid"] = serialNumber++.ToString();
 							//颗粒列表列中第一个可选参数
 							dr["Size"] = datatable_data(p1Data, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1);
@@ -302,7 +410,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             {
                 return SplicingParticlesData;
             }
-			ResultFile result = null;
+            ResultFile result;
 			string sou = m_otsreport_export.m_ReportApp.m_conditionChoose.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
 			if (sou.Contains("+"))
 			{
@@ -341,8 +449,25 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 		/// <param name="file_pic"></param>
 		/// <param name="list_dt"></param>
 		/// <param name="m_otsreport_export"></param>
-		public void Get_dev_kllb_data_frame_pic(c_TemplateClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt, OTSReport_Export m_otsreport_export, List<DataTable> FrameData)
+		public void Get_dev_kllb_data_frame_pic(c_TemplateClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt, OTSReport_Export m_otsreport_export, List<DataTable> a_FrameData)
 		{
+            //去除拼接后的颗粒
+            List<DataTable> FrameData = new List<DataTable>();
+			for (int i = 0; i < a_FrameData.Count; i++)
+            {
+                DataTable DT = a_FrameData[i].Clone();
+				for (int a = 0; a < a_FrameData[i].Rows.Count; a++)
+                {
+                    if (a_FrameData[i].Rows[a]["SubParticles"].ToString() == "")
+                    {
+                        DT.Rows.Add(a_FrameData[i].Rows[a].ItemArray);
+
+					}
+                }
+                FrameData.Add(DT);
+			}
+
+
 			m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
 			//根据sql条件,查询获取颗粒信息数据
 			ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
@@ -576,7 +701,36 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             ret_bp = control_XRayTable1.ExportXRayImage();
             return ret_bp;
         }
-        private string datatable_data(DataTable dt, int it, string str)
+
+
+		/// <summary>
+		/// 输入颗粒的所在帧图id,颗粒id,颗粒类型id,获取对应的XRay能谱数据图
+		/// </summary>
+		/// <returns></returns>
+		private Bitmap splice_ExportXRayBitmap(string subParticleString,int a_particleId,int a_fieldid, ParticleData particleData,string a_TyoeName)
+		{
+			Bitmap ret_bp;
+			//显示xray相关信息
+			uint[] Analysis_xray = new uint[2000];
+	
+			List<Element> list_celementchemistryclr = new List<Element>();
+			//获取Xray数据
+			Particle list = particleData.GetXrayByParticleIDAndFieldID(subParticleString, a_particleId, a_fieldid, out Analysis_xray);
+			List<ShowElementInfo> list_showelementinfo = particleData.GetShowElementInfos(list.ElementList);
+
+
+			//获取数据后,需要对xraytable设置
+			OTSIncAReportGraph.Controls.Control_XRayTable control_XRayTable1 = new Control_XRayTable();
+			control_XRayTable1.SetXRayShowLineValue(Analysis_xray, list_showelementinfo);
+			control_XRayTable1.MaterialName = a_TyoeName;
+			control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
+			control_XRayTable1.Visible = true;
+			control_XRayTable1.Invalidate();
+			control_XRayTable1.Refresh();
+			ret_bp = control_XRayTable1.ExportXRayImage();
+			return ret_bp;
+		}
+		private string datatable_data(DataTable dt, int it, string str)
         {
             if (str == "Hardness")
             {
@@ -696,6 +850,8 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
         {
 
             DataTable dt;
+			string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath;
+			imgAcc = new FieldImage(str_resultPath);
 
 			if (m_otsreport_export.m_ReportApp.m_RptConfigFile.Systype != OTS_SysType_ID.IncA)
             {

+ 62 - 17
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -276,10 +276,40 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
 
 
+		/// <summary>
+		/// 获取所有Particle
+		/// </summary>
+		/// <returns></returns>
+		public DataTable GetSpliceParticleAll(string fieldAndPartic)
+		{
+			string sqlp = @"select * from INcAData where   SubParticles =  'IsSubParticle'";
+			if (fieldAndPartic != "")
+			{
+				sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+			}
+			DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
+			DT.Columns.Add("ECD", typeof(double));
+
+			for (int i = 0; i < DT.Rows.Count; i++)
+			{
+				DT.Rows[i]["ECD"] = Math.Sqrt((double)DT.Rows[i]["Area"] / Math.PI) * 2;
+			}
+
+			DataTable data = DT.Clone();
+
+			for (int i = 0; i < DT.Rows.Count; i++)
+			{
+				if (Convert.ToInt32(DT.Rows[i]["ParticleId"]) > -1)
+				{
+					data.Rows.Add(DT.Rows[i].ItemArray);
+				}
 
+			}
+			return data;
+		}
 
 
-        public DataTable GetParticleAllForBig(string fieldAndPartic)
+		public DataTable GetParticleAllForBig(string fieldAndPartic)
         {
             string sqlp = @"select * from INcAData where";
             if (fieldAndPartic != "")
@@ -660,7 +690,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             return particlesAll;
         }
 
-        public DataTable AddElementColumn(DataTable particlesAll, c_TemplateClass m_mbszclass)
+        public DataTable AddElementColumn(DataTable particlesAll, c_TemplateClass m_mbszclass,DataTable spliceAll)
         {
             if (!particlesAll.Columns.Contains("Element"))
             {
@@ -672,26 +702,41 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
             for (int i = 0; i < particlesAll.Rows.Count; i++)
             {
-                string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
-                DataRow[] drs = dt_element.Select(str);
-                string ConcatenatedString = "";
-                for (int j = 0; j < drs.Length; j++)
+
+                if (particlesAll.Rows[i]["SubParticles"].ToString() == "")
                 {
-                    //判断是否在处理元素表中
-                    bool bl = false;
-                    for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Count; a++)
+                    string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
+                    DataRow[] drs = dt_element.Select(str);
+                    string ConcatenatedString = "";
+                    for (int j = 0; j < drs.Length; j++)
                     {
-                        if (drs[j]["name"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_qcys[a].ToString())
+                        //判断是否在处理元素表中
+                        bool bl = false;
+                        for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Count; a++)
                         {
-                            bl = true;
-						}
+                            if (drs[j]["name"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_qcys[a].ToString())
+                            {
+                                bl = true;
+                            }
+                        }
+                        if (!bl)
+                        {
+                            ConcatenatedString += drs[j]["name"] + "-" + ChangeDataToD(drs[j]["Percentage"].ToString()) + ';';
+                        }
                     }
-                    if (!bl)
-                    {
-						ConcatenatedString += drs[j]["name"] + "-" + ChangeDataToD(drs[j]["Percentage"].ToString()) + ';';
-					}
+                    particlesAll.Rows[i]["Element"] = ConcatenatedString;
                 }
-                particlesAll.Rows[i]["Element"] = ConcatenatedString;
+                else
+                {
+					for (int a = 0; a < spliceAll.Rows.Count; a++)
+					{
+						if (particlesAll.Rows[i]["particleId"].ToString() == spliceAll.Rows[a]["particleId"].ToString() && particlesAll.Rows[i]["fieldid"].ToString() == spliceAll.Rows[a]["fieldid"].ToString())
+						{
+                            particlesAll.Rows[i]["Element"] = spliceAll.Rows[a]["Element"].ToString();
+						}
+					}
+				}
+                
             }
             return particlesAll;
         }