Kaynağa Gözat

Rename some parameters

cxs 3 hafta önce
ebeveyn
işleme
5e061f6ec4

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

@@ -381,12 +381,12 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                             Bitmap bmap = null;
                             if (subt != null && subt != "" && subt != "IsSubParticle")
                             {
-                                double xs = 1/_result.GetPixelSize();
+                                double pix = _result.GetPixelSize();
                                 int width = _result.GetImageWidth();
                                 int height = _result.GetImageHeight();
-                                string vs = "," + subt.Replace(':', '-') + ",";
-                                DataTable dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
-                                bmap = fldImgAccess.GetBitmapForMergedParticle(subt, xs, height, width, dataTable);
+                                string substring = "," + subt.Replace(':', '-') + ",";
+                                DataTable dataTable = Particledata.GetParticleAllForBig(substring);//组成拼接颗粒的子颗粒
+                                bmap = fldImgAccess.GetBitmapForMergedParticle(subt, pix, height, width, dataTable);
                                 if (bmap != null)
                                 {
                                     string[] str = subt.Split(',');
@@ -778,7 +778,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                     control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
 
                     DataTable dataTable = new DataTable();
-                    double xs = 1 / _result.GetPixelSize();
+                    double pix =  _result.GetPixelSize();
                     int width = _result.GetImageWidth();
                     int height = _result.GetImageHeight();
                     Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
@@ -806,8 +806,8 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                             segsData.Add(key, listseg);
                         }
                     }
-                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, xs, height, width);
-                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, xs, height, width);
+                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, pix, height, width);
+                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, pix, height, width);
                     control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
                     Invalidate();
                 }

+ 5 - 5
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -520,12 +520,12 @@ namespace OTSIncAReportGrids
                             Bitmap bmap = null;
                             if (subt != null && subt != "" && subt != "IsSubParticle")
                             {
-                                double xs = 1 / result.GetPixelSize();
+                                double pix =  result.GetPixelSize();
                                 int width = result.GetImageWidth(); 
                                 int height = result.GetImageHeight();
                                 string vs = "," + subt.Replace(':', '-') + ",";
                                 DataTable dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
-                                bmap = fldImgAccess.GetBitmapForMergedParticle(subt, xs, height, width, dataTable);
+                                bmap = fldImgAccess.GetBitmapForMergedParticle(subt, pix, height, width, dataTable);
                                 if (bmap != null)
                                 {
                                     string[] str = subt.Split(',');
@@ -2491,7 +2491,7 @@ namespace OTSIncAReportGrids
 
 
                     DataTable dataTable=new DataTable();
-                    double xs = 1/result.GetPixelSize();
+                    double pix = result.GetPixelSize();
                     int width = result.GetImageWidth();
                     int height = result.GetImageHeight();
                     Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
@@ -2519,8 +2519,8 @@ namespace OTSIncAReportGrids
                             segsData.Add(key, listseg);
                         }
                     }
-                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, xs, height, width);
-                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, xs, height, width);
+                    Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, pix, height, width);
+                    Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, pix, height, width);
                     control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
                     Invalidate();
                     ToolStripMenuItem_SimilarityReclassification.Enabled = true;

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

@@ -185,7 +185,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                             table1.ImportRow(p1Data.Rows[i_row]);
 
 
-                            Bitmap bp_particle = imgAcc.GetBitmapByParticle(table1);
+                            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能谱图像
@@ -319,7 +319,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             {
 				DataTable table1 = particles.Clone();
                 table1.ImportRow(particles.Rows[i]);
-                Bitmap bmap = imgAcc.GetBitmapByParticle(table1);
+                Bitmap bmap = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
 				bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString(), particles.Rows[i]["XrayId"].ToString() };
                 DataRow row = SplicingParticlesData.NewRow();
                 row["image"] = bmap;
@@ -768,7 +768,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                     Bitmap bp_particle = new Bitmap(1, 1);
                     DataTable table1 = dt.Clone();
                     table1.ImportRow(dt.Rows[i_row]);
-                    bp_particle = imgAcc.GetBitmapByParticle(table1);
+                    bp_particle = imgAcc.GetBitmapByParticleForUncombinedParticle(table1);
                     bp_particle.Tag = new List<string>() { dt.Rows[i_row]["FieldId"].ToString(), dt.Rows[i_row]["ParticleId"].ToString(), dt.Rows[i_row]["TypeId"].ToString() };
                     DataRow dr = FrameGraphSubTable.NewRow();
                     dr["pic"] = bp_particle;

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

@@ -46,7 +46,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// </summary>
         /// <param name="model">Feature</param>
         /// <returns></returns>
-        public List<Particle> GetParticleListByCon(string con, string max, string min, int display)
+        public List<Particle> GetParticleListByCon(string condition, string max, string min, int display)
         {
             string sqlp = "select a.* from IncAData a ";
             string where = " where 1=1 ";
@@ -54,9 +54,9 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             {
                 where = where + " and a.XrayId >-1 ";
             }
-            if (con != "")
+            if (condition != "")
             {
-                where = where + " and a." + con + ">" + min + " and a." + con + "<" + max;
+                where = where + " and a." + condition + ">" + min + " and a." + condition + "<" + max;
             }
             sqlp = sqlp + where;
             DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
@@ -138,10 +138,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// </summary>
         /// <param name="model">Feature</param>
         /// <returns></returns>
-        public DataTable GetParticleStatisticDataListByIncA(string con)
+        public DataTable GetParticleStatisticDataListByIncA(string condition)
         {
-            string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,sum(Area) as Area,avg(" + con
-                + ") as av,max(" + con
+            string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,sum(Area) as Area,avg(" + condition
+                + ") as av,max(" + condition
                 + ") as max ";
             sqlp = sqlp + "from IncAData where typeid !=-1 and typeid !=4 and SubParticles is not 'IsSubParticle' group by TypeId";
 
@@ -149,10 +149,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             return DT;
         }
 
-        public DataTable GetParticleListForParticlSize(string con, string fieldAndPartic)
+        public DataTable GetParticleListForParticlSize(string condition, string fieldAndPartic)
         {
-            string sqlp = @"select TypeId,TypeName,GroupId ,TypeColor,count(1) as con,avg(" + con
-                + ") as av,max(" + con
+            string sqlp = @"select TypeId,TypeName,GroupId ,TypeColor,count(1) as con,avg(" + condition
+                + ") as av,max(" + condition
                 + ") as max ,GroupName";
             sqlp = sqlp + " from IncAData where typeid !=-1 and typeid !=4 and ParticleId !=-1 and SubParticles is not 'IsSubParticle'";
             if (fieldAndPartic != "")
@@ -163,7 +163,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             sqlp = sqlp + " group by TypeId ";
             DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
 
-            if (con == "area")
+            if (condition == "area")
             {
                 for (int i = 0; i < DT.Rows.Count; i++)
                 {
@@ -183,10 +183,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 		/// </summary>
 		/// <param name="model">Feature</param>
 		/// <returns></returns>
-		public DataTable GetParticleListForParticlSizeID(string con, string fieldAndPartic)
+		public DataTable GetParticleListForParticlSizeID(string condition, string fieldAndPartic)
 		{
-			string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,avg(" + con
-				+ ") as av,max(" + con
+			string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,avg(" + condition
+				+ ") as av,max(" + condition
 				+ ") as max ,GroupName ,GroupId,GroupColor";
 			sqlp = sqlp + " from IncAData where typeid !=-1 and typeid !=4";
 			if (fieldAndPartic != "")
@@ -198,7 +198,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
 			DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
 
-			if (con == "area")
+			if (condition == "area")
 			{
 				for (int i = 0; i < DT.Rows.Count; i++)
 				{

+ 33 - 36
OTSIncAReportApp/3-ServiceCenter/DataOperation/ImageAccess/FieldImage.cs

@@ -1,5 +1,4 @@
 using OTSCommon.DBOperate.Model;
-using OTSIncAReportGraph.Class;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -19,16 +18,15 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 拼接颗粒黑白图
         /// </summary>
-        /// <param name="sub">拼接字符串</param>
-        /// <param name="xs">xs = pixw / ScanFieldSize</param>
-        /// <param name="path">报告文件路径</param>
+        /// <param name="substring">拼接字符串</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 sub, double xs, int picHeight, int picWidth,DataTable PartdataTable,Dictionary<string,List<Segment>> segsData)
+        public Bitmap GetBlackAndWhiteBitmapForMergedParticle(string substring, double pix, int picHeight, int picWidth,DataTable PartdataTable,Dictionary<string,List<Segment>> segsData)
         {
-            string vs = "," + sub.Replace(':', '-') + ",";
+            string vs = "," + substring.Replace(':', '-') + ",";
             
             if (PartdataTable.Rows.Count == 0)
             {
@@ -41,13 +39,13 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
 
             double min_X = 99999999;
             //拼接field矩形
-            double B_Y = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosY"]) * xs;
-            double R_X = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosX"]) * xs;
+            double B_Y = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosY"]) * 1/pix;
+            double R_X = Convert.ToInt64(PartdataTable.Rows[0]["FieldPosX"]) * 1/pix;
             double T_Y = B_Y;
             double L_X = R_X;
             foreach (DataRow item in PartdataTable.Rows)
             {
-                double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
+                double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * 1 / pix;
 
                 if (lefttopXH > R_X)
                 {
@@ -57,7 +55,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
                 {
                     L_X = lefttopXH;
                 }
-                double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
+                double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * 1 / pix;
 
                 if (lrfttopYH < B_Y)
                 {
@@ -77,8 +75,8 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
             graph.DrawImage(tableChartImage, 0, 0);
             foreach (DataRow item in PartdataTable.Rows)
             {
-                int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * xs - L_X));
-                int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * xs - T_Y));
+                int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * 1 / pix - L_X));
+                int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * 1 / pix - T_Y));
                 //颗粒外接矩形
                 double lefttopX = x + Convert.ToInt64(item["RectLeft"]);
                 if (lefttopX < min_X)
@@ -141,15 +139,14 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 拼接颗粒图
         /// </summary>
-        /// <param name="sub">拼接字符串</param>
-        /// <param name="xs">xs = pixw / ScanFieldSize</param>
-        /// <param name="path">报告文件路径</param>
+        /// <param name="substring">拼接字符串</param>
         /// <param name="picHeight">图像高</param>
         /// <param name="picWidth">帧图宽</param>
+        /// <param name="dataTable">组成拼接颗粒的子颗粒</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForMergedParticle(string sub, double xs, int picHeight, int picWidth,DataTable dataTable)
+        public Bitmap GetBitmapForMergedParticle(string substring, double pix, int picHeight, int picWidth,DataTable dataTable)
         {
-            string vs = "," + sub.Replace(':', '-') + ",";
+            string vs = "," + substring.Replace(':', '-') + ",";
 
            
             if (dataTable.Rows.Count == 0)
@@ -163,13 +160,13 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
 
             double min_X = 99999999;
             //拼接field矩形
-            double B_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * xs;
-            double R_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * xs;
+            double B_Y = Convert.ToInt64(dataTable.Rows[0]["FieldPosY"]) * 1 / pix;
+            double R_X = Convert.ToInt64(dataTable.Rows[0]["FieldPosX"]) * 1 / pix;
             double T_Y = B_Y;
             double L_X = R_X;
             foreach (DataRow item in dataTable.Rows)
             {
-                double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
+                double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * 1 / pix;
 
                 if (lefttopXH > R_X)
                 {
@@ -179,7 +176,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
                 {
                     L_X = lefttopXH;
                 }
-                double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
+                double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * 1 / pix;
 
                 if (lrfttopYH < B_Y)
                 {
@@ -201,8 +198,8 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
                 string  path1=  "Field" + item["fieldid"].ToString() + ".bmp";
                 //然后将取出的数据,转换成Bitmap对象
                 Bitmap ls_bt = ReadImageFile(path1);
-                int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * xs - L_X));
-                int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * xs - T_Y));
+                int x = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosX"]) * 1 / pix - L_X));
+                int y = Math.Abs(Convert.ToInt32(Convert.ToDouble(item["FieldPosY"]) * 1 / pix - T_Y));
 
                 graph.DrawImage(ls_bt, x, y);
                 //颗粒外接矩形
@@ -239,7 +236,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// </summary>
         /// <param name="in_cotsparticleclr"></param>
         /// <returns></returns>
-        public Bitmap GetBitmapByParticle(DataTable dataTable)
+        public Bitmap GetBitmapByParticleForUncombinedParticle(DataTable dataTable)
         {
             string path1 = "Field" + dataTable.Rows[0]["fieldid"].ToString() + ".bmp";
             //然后将取出的数据,转换成Bitmap对象
@@ -291,40 +288,40 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// <summary>
         /// 获取全部颗粒图
         /// </summary>
-        /// <param name="sub">拼接颗粒连接字符串</param>
+        /// <param name="substring">拼接颗粒连接字符串</param>
         /// <param name="dataTable">颗粒表</param>
-        /// <param name="xs">pixel</param>
+        /// <param name="pix">pixel</param>
         /// <param name="picHeight">帧图高</param>
         /// <param name="picWidth">帧图宽</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForParticleAll(string sub, DataTable dataTable, double xs=0, int picHeight=0, int picWidth=0)
+        public Bitmap GetBitmapForParticleAll(string substring, DataTable dataTable, double pix=0, int picHeight=0, int picWidth=0)
         {
             Bitmap bmap;
-            if(sub != "")
+            if(substring != "")
             {
-                bmap = GetBitmapForMergedParticle(sub, xs, picHeight, picWidth,dataTable);
+                bmap = GetBitmapForMergedParticle(substring, pix, picHeight, picWidth,dataTable);
             }
             else
             {
-                bmap=GetBitmapByParticle(dataTable);
+                bmap=GetBitmapByParticleForUncombinedParticle(dataTable);
             }
             return bmap;
         }
         /// <summary>
         /// 获取全部颗粒图
         /// </summary>
-        /// <param name="sub">拼接颗粒连接字符串</param>
-        /// <param name="dataTable">颗粒表</param>
-        /// <param name="xs">pixel</param>
+        /// <param name="subsubstring">拼接颗粒连接字符串</param>
+        /// <param name="dataTable">颗粒表 或 组成拼接颗粒的子颗粒表</param>
+        /// <param name="pix">pixel</param>
         /// <param name="picHeight">帧图高</param>
         /// <param name="picWidth">帧图宽</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForParticleAllWithBlackAndWhite(string sub, DataTable dataTable, Dictionary<string, List<Segment>> segsData, double xs = 0, int picHeight = 0, int picWidth = 0)
+        public Bitmap GetBitmapForParticleAllWithBlackAndWhite(string subsubstring, DataTable dataTable, Dictionary<string, List<Segment>> segsData, double pix = 0, int picHeight = 0, int picWidth = 0)
         {
             Bitmap bmap;
-            if (sub != "")
+            if (subsubstring != "")
             {
-                bmap = GetBlackAndWhiteBitmapForMergedParticle(sub, xs, picHeight, picWidth, dataTable, segsData);
+                bmap = GetBlackAndWhiteBitmapForMergedParticle(subsubstring, pix, picHeight, picWidth, dataTable, segsData);
             }
             else
             {