瀏覽代碼

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

GSP 1 月之前
父節點
當前提交
023cae259f

+ 2 - 6
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.cs

@@ -380,9 +380,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                                 Bitmap tempbit = _particlesGridDevidePage.Particledata.ReadImageFile(imagePatht);
                                 int pixw = tempbit.Width;
                                 double xs = pixw / ScanFieldSize;
-                                OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = _particlesGridDevidePage.result.GetXAxisDirEnum();
-                                OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = _particlesGridDevidePage.result.GetYAxisDirEnum();
-                                bmap = _particlesGridDevidePage.Particledata.GetBitmapForBig(subt, xs, _particlesGridDevidePage.result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
+                                bmap = _particlesGridDevidePage.Particledata.GetBitmapForBig(subt, xs, _particlesGridDevidePage.result.FilePath, tempbit.Height, tempbit.Width);
                                 if (bmap != null)
                                 {
                                     string[] str = subt.Split(',');
@@ -795,9 +793,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                         Bitmap tempbit = _particlesGridDevidePage.Particledata.ReadImageFile(imagePatht);
                         int pixw = tempbit.Width;
                         double xs = pixw / ScanFieldSize;
-                        OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = _particlesGridDevidePage.result.GetXAxisDirEnum();
-                        OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = _particlesGridDevidePage.result.GetYAxisDirEnum();
-                        Bitmap bp = _particlesGridDevidePage.Particledata.GetBitmapForBigBlackAndWhiteImage(subt, xs, _particlesGridDevidePage.result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
+                        Bitmap bp = _particlesGridDevidePage.Particledata.GetBitmapForBigBlackAndWhiteImage(subt, xs, _particlesGridDevidePage.result.FilePath, tempbit.Height, tempbit.Width);
                         control_XRayTable1.SetBitmapOfPictureBox(ls_bp, bp);
                         Invalidate();
                     }

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

@@ -521,11 +521,8 @@ namespace OTSIncAReportGrids
                                 Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
                                 int pixw = tempbit.Width;
                                 double xs = pixw / ScanFieldSize;
-                                OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = result.GetXAxisDirEnum();
-                                OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = result.GetYAxisDirEnum();
-
-
-                                bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
+                                
+                                bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
                                 if (bmap != null)
                                 {
                                     string[] str = subt.Split(',');
@@ -2511,9 +2508,7 @@ namespace OTSIncAReportGrids
                         Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
                         int pixw = tempbit.Width;
                         double xs = pixw / ScanFieldSize;
-                        OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION = result.GetXAxisDirEnum();
-                        OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION = result.GetYAxisDirEnum();
-                        Bitmap bp= Particledata.GetBitmapForBigBlackAndWhiteImage(subt, xs, result.FilePath, tempbit.Height, tempbit.Width, X_AXIS_DIRECTION, Y_AXIS_DIRECTION);
+                        Bitmap bp= Particledata.GetBitmapForBigBlackAndWhiteImage(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
                         control_XRayTable1.SetBitmapOfPictureBox(ls_bp,bp);
                         Invalidate();
                     }

+ 34 - 88
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -1,10 +1,6 @@
-using DevExpress.Charts.Native;
-using DevExpress.XtraDiagram.Bars;
-using DevExpress.XtraEditors.Filtering;
-using OTSCommon.DBOperate;
+using OTSCommon.DBOperate;
 using OTSCommon.DBOperate.Model;
 using OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration;
-using OTSIncAReportApp.OTSRstMgrFunction;
 using OTSIncAReportGraph.Controls;
 using OTSPeriodicTable;
 using System;
@@ -1007,7 +1003,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <param name="X_AXIS_DIRECTION">电镜x轴正方向</param>
         /// <param name="Y_AXIS_DIRECTION">电镜y轴正方向</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForBig(string sub, double xs, string path, int picHeight, int picWidth, OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION, OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION)
+        public Bitmap GetBitmapForBig(string sub, double xs, string path, int picHeight, int picWidth)
         {
             string vs = "," + sub.Replace(':', '-') + ",";
 
@@ -1017,11 +1013,11 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 return null;
             }
             //内接矩形
-            double max_Y = Convert.ToInt64(dataTable.Rows[0]["RectTop"]);
-            double max_X = Convert.ToInt64(dataTable.Rows[0]["RectLeft"]);
-            double min_Y = max_Y;
+            double max_Y = -1;
+            double max_X = -1;
+            double min_Y = 99999999;
 
-            double min_X = max_X;
+            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;
@@ -1030,50 +1026,24 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             foreach (DataRow item in dataTable.Rows)
             {
                 double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
-                if (X_AXIS_DIRECTION == OTS_X_AXIS_DIRECTION.LEFT_TOWARD)
+
+                if (lefttopXH > R_X)
                 {
-                    if (lefttopXH > L_X)
-                    {
-                        L_X = lefttopXH;
-                    }
-                    if (lefttopXH < R_X)
-                    {
-                        R_X = lefttopXH;
-                    }
+                    R_X = lefttopXH;
                 }
-                else
+                if (lefttopXH < L_X)
                 {
-                    if (lefttopXH < R_X)
-                    {
-                        R_X = lefttopXH;
-                    }
-                    if (lefttopXH > L_X)
-                    {
-                        L_X = lefttopXH;
-                    }
+                    L_X = lefttopXH;
                 }
                 double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
-                if (Y_AXIS_DIRECTION == OTS_Y_AXIS_DIRECTION.UP_TOWARD)
+
+                if (lrfttopYH < B_Y)
                 {
-                    if (lrfttopYH < B_Y)
-                    {
-                        B_Y = lrfttopYH;
-                    }
-                    if (lrfttopYH > T_Y)
-                    {
-                        T_Y = lrfttopYH;
-                    }
+                    B_Y = lrfttopYH;
                 }
-                else
+                if (lrfttopYH > T_Y)
                 {
-                    if (lrfttopYH > B_Y)
-                    {
-                         B_Y= lrfttopYH;
-                    }
-                    if (lrfttopYH < T_Y)
-                    {
-                        T_Y = lrfttopYH;
-                    }
+                    T_Y = lrfttopYH;
                 }
             }
             int WIDTH = Math.Abs(Convert.ToInt32(R_X - L_X)) + picWidth;
@@ -1081,7 +1051,6 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             //构造最终的图片白板
             Bitmap tableChartImage = new Bitmap(WIDTH, HEIGHT);
             Graphics graph = Graphics.FromImage(tableChartImage);
-            //初始化这个大图
             graph.DrawImage(tableChartImage, 0, 0);
             foreach (DataRow item in dataTable.Rows)
             {
@@ -1119,6 +1088,8 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             int Y = Convert.ToInt32(min_Y);
             Rectangle rectangle = new Rectangle() { X = X, Y = Y, Width = width, Height = height };
             Bitmap bmap = tableChartImage.Clone(rectangle, PixelFormat.Format8bppIndexed);
+            graph.DrawImage(tableChartImage, 0, 0);
+
             return bmap;
         }
 
@@ -1134,7 +1105,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <param name="X_AXIS_DIRECTION">电镜x轴正方向</param>
         /// <param name="Y_AXIS_DIRECTION">电镜y轴正方向</param>
         /// <returns></returns>
-        public Bitmap GetBitmapForBigBlackAndWhiteImage(string sub, double xs, string path, int picHeight, int picWidth, OTS_X_AXIS_DIRECTION X_AXIS_DIRECTION, OTS_Y_AXIS_DIRECTION Y_AXIS_DIRECTION)
+        public Bitmap GetBitmapForBigBlackAndWhiteImage(string sub, double xs, string path, int picHeight, int picWidth)
         {
             string vs = "," + sub.Replace(':', '-') + ",";
             DataTable dataTable = GetParticleAllForBig(vs);
@@ -1143,10 +1114,11 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 return null;
             }
             //内接矩形
-            double max_Y = Convert.ToInt64(dataTable.Rows[0]["RectTop"]);
-            double max_X = Convert.ToInt64(dataTable.Rows[0]["RectLeft"]);
-            double min_Y = max_Y;
-            double min_X = max_X;
+            double max_Y = -1;
+            double max_X = -1;
+            double min_Y = 99999999;
+
+            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;
@@ -1155,50 +1127,24 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             foreach (DataRow item in dataTable.Rows)
             {
                 double lefttopXH = Convert.ToInt64(item["FieldPosX"]) * xs;
-                if (X_AXIS_DIRECTION == OTS_X_AXIS_DIRECTION.LEFT_TOWARD)
+
+                if (lefttopXH > R_X)
                 {
-                    if (lefttopXH > L_X)
-                    {
-                        L_X = lefttopXH;
-                    }
-                    if (lefttopXH < R_X)
-                    {
-                        R_X = lefttopXH;
-                    }
+                    R_X = lefttopXH;
                 }
-                else
+                if (lefttopXH < L_X)
                 {
-                    if (lefttopXH < R_X)
-                    {
-                        R_X = lefttopXH;
-                    }
-                    if (lefttopXH > L_X)
-                    {
-                        L_X = lefttopXH;
-                    }
+                    L_X = lefttopXH;
                 }
                 double lrfttopYH = Convert.ToInt64(item["FieldPosY"]) * xs;
-                if (Y_AXIS_DIRECTION == OTS_Y_AXIS_DIRECTION.UP_TOWARD)
+
+                if (lrfttopYH < B_Y)
                 {
-                    if (lrfttopYH < B_Y)
-                    {
-                        B_Y = lrfttopYH;
-                    }
-                    if (lrfttopYH > T_Y)
-                    {
-                        T_Y = lrfttopYH;
-                    }
+                    B_Y = lrfttopYH;
                 }
-                else
+                if (lrfttopYH > T_Y)
                 {
-                    if (lrfttopYH > B_Y)
-                    {
-                        B_Y = lrfttopYH;
-                    }
-                    if (lrfttopYH < T_Y)
-                    {
-                        T_Y = lrfttopYH;
-                    }
+                    T_Y = lrfttopYH;
                 }
             }
             int WIDTH = Math.Abs(Convert.ToInt32(R_X - L_X)) + picWidth;