Prechádzať zdrojové kódy

ots报告程序增加导出国标图片,导出报告修改报告,数据库里有低计数颗粒导致报错

zhangjiaxin 1 rok pred
rodič
commit
623f1173b3

+ 91 - 0
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -59,6 +59,7 @@ namespace OTSIncAReportGraph.Controls
         pic = 0,
         Render_pic = 1,
         noBackground_pic = 2,
+        GBOne = 3,
         Combin,
         Render_Combin
     }
@@ -2491,5 +2492,95 @@ namespace OTSIncAReportGraph.Controls
 
             Invalidate();
         }
+        private DataTable GetGBDataTable(object sender, int met)
+        {
+            int index = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+            for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
+            {
+                string anothername = m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString();
+                string resultfile = m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath.ToString() + "\\" + m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString();
+                m_ReportApp.m_rstDataMgr.m_ReportMgr.AddASmplMsrResultMgr(resultfile, anothername);
+            }
+            OTSCLRINTERFACE.CPropParamClr clr_prop = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetPropertyParamTable();
+            List<string> datasourcelist = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+            clr_prop.SetDataSourceList(datasourcelist);
+            clr_prop.SetDataSourceId(index);//
+            clr_prop.SetType((int)DisplayPicutureType.AnalyzeDataTable);//table
+            DataTable tbl;//
+            clr_prop.SetCalTableType(met);
+            tbl = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetAllGBFields(clr_prop);
+            return tbl;
+        }
+        private void 方法一ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            SaveFileDialog sfd = new SaveFileDialog();
+
+            sfd.Filter = "png Files(*.png)| *.png |BMP Files(*.bmp)| *.bmp |JPG Files(*.jpg)|*.jpg;*.jpeg";
+            if (sfd.ShowDialog() == DialogResult.OK)
+            {
+                var datd = GetGBDataTable(sender, (int)CALCULATE_TABLE_TYPE.GB_Method1);
+                this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
+                OutPIC outpic = new OutPIC();
+                outpic.GBDatatableOne = datd;
+                outpic.GridLength = Convert.ToInt32(710.0 / imageDisHelper.m_pixelSize);
+                outpic.m_list_allDfield = m_list_allDfield;
+                outpic.resultFile = resultFile;
+                outpic.sfd = sfd;
+                outpic.type = (int)Outpic_enum.GBOne;
+                outpic.m_ReportApp = m_ReportApp;
+                Thread bThread = new Thread(new ThreadStart(outpic.opencv_outpic));
+                bThread.IsBackground = true;
+                bThread.Start();
+
+            }
+        }
+
+        private void 方法二ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            SaveFileDialog sfd = new SaveFileDialog();
+
+            sfd.Filter = "png Files(*.png)| *.png |BMP Files(*.bmp)| *.bmp |JPG Files(*.jpg)|*.jpg;*.jpeg";
+            if (sfd.ShowDialog() == DialogResult.OK)
+            {
+                var datd = GetGBDataTable(sender, (int)CALCULATE_TABLE_TYPE.GB_Method2);
+                this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
+                OutPIC outpic = new OutPIC();
+                outpic.GBDatatableOne = datd;
+                outpic.GridLength = Convert.ToInt32(710.0 / imageDisHelper.m_pixelSize);
+                outpic.m_list_allDfield = m_list_allDfield;
+                outpic.resultFile = resultFile;
+                outpic.sfd = sfd;
+                outpic.type = (int)Outpic_enum.GBOne;
+                outpic.m_ReportApp = m_ReportApp;
+                Thread bThread = new Thread(new ThreadStart(outpic.opencv_outpic));
+                bThread.IsBackground = true;
+                bThread.Start();
+
+            }
+        }
+
+        private void aSTMToolStripMenuItem1_Click(object sender, EventArgs e)
+        {
+            SaveFileDialog sfd = new SaveFileDialog();
+
+            sfd.Filter = "png Files(*.png)| *.png |BMP Files(*.bmp)| *.bmp |JPG Files(*.jpg)|*.jpg;*.jpeg";
+            if (sfd.ShowDialog() == DialogResult.OK)
+            {
+                var datd = GetGBDataTable(sender, (int)CALCULATE_TABLE_TYPE.ASTM);
+                this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
+                OutPIC outpic = new OutPIC();
+                outpic.GBDatatableOne = datd;
+                outpic.GridLength = Convert.ToInt32(710.0 / imageDisHelper.m_pixelSize);
+                outpic.m_list_allDfield = m_list_allDfield;
+                outpic.resultFile = resultFile;
+                outpic.sfd = sfd;
+                outpic.type = (int)Outpic_enum.GBOne;
+                outpic.m_ReportApp = m_ReportApp;
+                Thread bThread = new Thread(new ThreadStart(outpic.opencv_outpic));
+                bThread.IsBackground = true;
+                bThread.Start();
+
+            }
+        }
     }
 }

+ 78 - 38
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.designer.cs

@@ -38,6 +38,11 @@
             this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.查询DS类颗粒ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.显示当前帧国标分类ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.aToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.bToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.cToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.dToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.全部ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripMenuItem();
@@ -50,11 +55,10 @@
             this.ToolStripMenuItem_movesempoint = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem_DeleteParticles = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem_Segmentation = new System.Windows.Forms.ToolStripMenuItem();
-            this.aToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.bToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.cToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.dToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.全部ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.国标图导出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.方法一ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.方法二ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.aSTMToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.CMenuStrip.SuspendLayout();
             this.contextMenuStrip_Particle.SuspendLayout();
             this.SuspendLayout();
@@ -68,9 +72,10 @@
             this.ExportoriginalspliceToolStripMenuItem,
             this.显示国标信息ToolStripMenuItem,
             this.toolStripMenuItem_combin,
-            this.toolStripMenuItem_combinClass});
+            this.toolStripMenuItem_combinClass,
+            this.国标图导出ToolStripMenuItem});
             this.CMenuStrip.Name = "contextMenuStrip1";
-            this.CMenuStrip.Size = new System.Drawing.Size(185, 158);
+            this.CMenuStrip.Size = new System.Drawing.Size(185, 180);
             // 
             // ToolStripMenuItem_ParticleSplicing
             // 
@@ -111,7 +116,7 @@
             this.查询DS类颗粒ToolStripMenuItem,
             this.显示当前帧国标分类ToolStripMenuItem});
             this.toolStripMenuItem2.Name = "toolStripMenuItem2";
-            this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22);
+            this.toolStripMenuItem2.Size = new System.Drawing.Size(112, 22);
             this.toolStripMenuItem2.Text = "方法一";
             // 
             // toolStripMenuItem1
@@ -143,13 +148,48 @@
             this.显示当前帧国标分类ToolStripMenuItem.Text = "高亮当前帧国标分类";
             this.显示当前帧国标分类ToolStripMenuItem.Click += new System.EventHandler(this.显示当前帧国标分类ToolStripMenuItem_Click);
             // 
+            // aToolStripMenuItem
+            // 
+            this.aToolStripMenuItem.Name = "aToolStripMenuItem";
+            this.aToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.aToolStripMenuItem.Text = "A";
+            this.aToolStripMenuItem.Click += new System.EventHandler(this.aToolStripMenuItem_Click);
+            // 
+            // bToolStripMenuItem
+            // 
+            this.bToolStripMenuItem.Name = "bToolStripMenuItem";
+            this.bToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.bToolStripMenuItem.Text = "B";
+            this.bToolStripMenuItem.Click += new System.EventHandler(this.bToolStripMenuItem_Click);
+            // 
+            // cToolStripMenuItem
+            // 
+            this.cToolStripMenuItem.Name = "cToolStripMenuItem";
+            this.cToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.cToolStripMenuItem.Text = "C";
+            this.cToolStripMenuItem.Click += new System.EventHandler(this.cToolStripMenuItem_Click);
+            // 
+            // dToolStripMenuItem
+            // 
+            this.dToolStripMenuItem.Name = "dToolStripMenuItem";
+            this.dToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.dToolStripMenuItem.Text = "D";
+            this.dToolStripMenuItem.Click += new System.EventHandler(this.dToolStripMenuItem_Click);
+            // 
+            // 全部ToolStripMenuItem
+            // 
+            this.全部ToolStripMenuItem.Name = "全部ToolStripMenuItem";
+            this.全部ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
+            this.全部ToolStripMenuItem.Text = "全部";
+            this.全部ToolStripMenuItem.Click += new System.EventHandler(this.全部ToolStripMenuItem_Click);
+            // 
             // toolStripMenuItem3
             // 
             this.toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripMenuItem4,
             this.toolStripMenuItem10});
             this.toolStripMenuItem3.Name = "toolStripMenuItem3";
-            this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 22);
+            this.toolStripMenuItem3.Size = new System.Drawing.Size(112, 22);
             this.toolStripMenuItem3.Text = "方法二";
             // 
             // toolStripMenuItem4
@@ -173,7 +213,7 @@
             this.aSTMToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.显示所有帧ToolStripMenuItem});
             this.aSTMToolStripMenuItem.Name = "aSTMToolStripMenuItem";
-            this.aSTMToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+            this.aSTMToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
             this.aSTMToolStripMenuItem.Tag = "";
             this.aSTMToolStripMenuItem.Text = "ASTM";
             // 
@@ -188,7 +228,7 @@
             // 清除ToolStripMenuItem
             // 
             this.清除ToolStripMenuItem.Name = "清除ToolStripMenuItem";
-            this.清除ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+            this.清除ToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
             this.清除ToolStripMenuItem.Text = "清除";
             this.清除ToolStripMenuItem.Click += new System.EventHandler(this.清除ToolStripMenuItem_Click);
             // 
@@ -239,40 +279,36 @@
             this.toolStripMenuItem_Segmentation.Text = "分割颗粒";
             this.toolStripMenuItem_Segmentation.Click += new System.EventHandler(this.toolStripMenuItem_Segmentation_Click);
             // 
-            // aToolStripMenuItem
+            // 国标图导出ToolStripMenuItem
             // 
-            this.aToolStripMenuItem.Name = "aToolStripMenuItem";
-            this.aToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.aToolStripMenuItem.Text = "A";
-            this.aToolStripMenuItem.Click += new System.EventHandler(this.aToolStripMenuItem_Click);
+            this.国标图导出ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.方法一ToolStripMenuItem,
+            this.方法二ToolStripMenuItem,
+            this.aSTMToolStripMenuItem1});
+            this.国标图导出ToolStripMenuItem.Name = "国标图导出ToolStripMenuItem";
+            this.国标图导出ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
+            this.国标图导出ToolStripMenuItem.Text = "国标图导出";
             // 
-            // bToolStripMenuItem
+            // 方法一ToolStripMenuItem
             // 
-            this.bToolStripMenuItem.Name = "bToolStripMenuItem";
-            this.bToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.bToolStripMenuItem.Text = "B";
-            this.bToolStripMenuItem.Click += new System.EventHandler(this.bToolStripMenuItem_Click);
+            this.方法一ToolStripMenuItem.Name = "方法一ToolStripMenuItem";
+            this.方法一ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+            this.方法一ToolStripMenuItem.Text = "方法一";
+            this.方法一ToolStripMenuItem.Click += new System.EventHandler(this.方法一ToolStripMenuItem_Click);
             // 
-            // cToolStripMenuItem
+            // 方法二ToolStripMenuItem
             // 
-            this.cToolStripMenuItem.Name = "cToolStripMenuItem";
-            this.cToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.cToolStripMenuItem.Text = "C";
-            this.cToolStripMenuItem.Click += new System.EventHandler(this.cToolStripMenuItem_Click);
+            this.方法二ToolStripMenuItem.Name = "方法二ToolStripMenuItem";
+            this.方法二ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+            this.方法二ToolStripMenuItem.Text = "方法二";
+            this.方法二ToolStripMenuItem.Click += new System.EventHandler(this.方法二ToolStripMenuItem_Click);
             // 
-            // dToolStripMenuItem
+            // aSTMToolStripMenuItem1
             // 
-            this.dToolStripMenuItem.Name = "dToolStripMenuItem";
-            this.dToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.dToolStripMenuItem.Text = "D";
-            this.dToolStripMenuItem.Click += new System.EventHandler(this.dToolStripMenuItem_Click);
-            // 
-            // 全部ToolStripMenuItem
-            // 
-            this.全部ToolStripMenuItem.Name = "全部ToolStripMenuItem";
-            this.全部ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.全部ToolStripMenuItem.Text = "全部";
-            this.全部ToolStripMenuItem.Click += new System.EventHandler(this.全部ToolStripMenuItem_Click);
+            this.aSTMToolStripMenuItem1.Name = "aSTMToolStripMenuItem1";
+            this.aSTMToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
+            this.aSTMToolStripMenuItem1.Text = "ASTM";
+            this.aSTMToolStripMenuItem1.Click += new System.EventHandler(this.aSTMToolStripMenuItem1_Click);
             // 
             // Control_DrawDistrbutionImageAndBSE
             // 
@@ -317,5 +353,9 @@
         private System.Windows.Forms.ToolStripMenuItem cToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem dToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 全部ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 国标图导出ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 方法一ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 方法二ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem aSTMToolStripMenuItem1;
     }
 }

+ 147 - 8
OTSIncAReportApp/1-UI/Control_Graph/Controls/OutPIC.cs

@@ -1,4 +1,5 @@
-using OTSCommon.Model;
+using OpenCvSharp;
+using OTSCommon.Model;
 using OTSIncAReportGraph;
 using OTSIncAReportGraph.Class;
 using OTSIncAReportGraph.Controls;
@@ -23,7 +24,14 @@ namespace OTSIncAReportApp._3_ServiceCenter
         public SaveFileDialog sfd = null;
         public DataTable ParticleData = new DataTable();
         public DataTable ParticleClassData = new DataTable();
-        
+        /// <summary>
+        /// 国标一框框
+        /// </summary>
+        public DataTable GBDatatableOne { get; set; }
+        /// <summary>
+        ///国标格子大小(像素)
+        /// </summary>
+        public int GridLength { get; set; }
         public int type = 0;
         /// <summary>
         /// 获取每行图片的位置配合opencv方法使用
@@ -231,6 +239,118 @@ namespace OTSIncAReportApp._3_ServiceCenter
             NLog.LogManager.GetCurrentClassLogger().Info("Save to disk......");
             OpenCvSharp.Mat save_pano = new OpenCvSharp.Mat();
             OpenCvSharp.Cv2.VConcat(list_mats, save_pano);
+
+            if (type == (int)Outpic_enum.GBOne)
+            {
+                // 创建一个HashSet来存储唯一的值  
+                HashSet<int> distinctValuesY = new HashSet<int>();
+                // 创建一个HashSet来存储唯一的值  
+                HashSet<int> distinctValuesX = new HashSet<int>();
+                for (int i = 0; i < GBDatatableOne.Rows.Count; i++)
+                {
+                    distinctValuesY.Add(Convert.ToInt32(GBDatatableOne.Rows[i]["fieldY"]));
+                    distinctValuesX.Add(Convert.ToInt32(GBDatatableOne.Rows[i]["fieldX"]));
+                }
+                int picdataYmin = Convert.ToInt32(list_dt_picdata[0].Rows[0]["Y"]);
+                int picdataXmin = Convert.ToInt32(list_dt_picdata[0].Rows[0]["X"]);
+                var distinctY = distinctValuesY.ToList();
+                distinctY.Sort();
+                var distinctX = distinctValuesX.ToList();
+                distinctX.Sort();
+
+                int Yzhou = (distinctY[0] - picdataYmin);
+                for (int i = 0; i < distinctY.Count; i++)
+                {
+                    int Xzhou = (distinctX[0] - picdataXmin);
+                    DataTable number = CountTheNumberOfX_axes(GBDatatableOne, "fieldY", distinctY[i].ToString());
+                    for (int j = 0; j < number.Rows.Count; j++)
+                    {
+
+                        // 定义矩形的左上角和右下角坐标  
+                        OpenCvSharp.Point topLeft = new OpenCvSharp.Point(Xzhou, Yzhou);
+                        int XzhouDOW = Xzhou + GridLength;
+                        int YzhouDOW = Yzhou + GridLength;
+                        OpenCvSharp.Point textOrg = new OpenCvSharp.Point(Xzhou + 20, Yzhou + 70); // 文字开始的位置  
+                        OpenCvSharp.Point bottomRight = new OpenCvSharp.Point(XzhouDOW, YzhouDOW);
+                        Xzhou = Xzhou + GridLength;
+
+                        // 定义矩形的颜色(BGR)和线宽  
+                        OpenCvSharp.Scalar color = new OpenCvSharp.Scalar(0, 0, 255, 255); // 蓝色  
+                        int thickness = 10;
+                        // 在图像上绘制矩形  
+                        OpenCvSharp.Cv2.Rectangle(save_pano, topLeft, bottomRight, color, thickness);
+
+                        // 设置要绘制的文字及其位置  
+                        string text = number.Rows[i]["data"].ToString();
+
+
+                        string input = number.Rows[i]["data"].ToString();
+                        int chunkSize = 40; // 分割长度  
+
+                        // 使用LINQ的Enumerable.Chunk扩展方法分割字符串  
+                        var chunks = Enumerable.Range(0, input.Length / chunkSize + (input.Length % chunkSize > 0 ? 1 : 0))
+                            .Select(x => input.Substring(x * chunkSize, Math.Min(chunkSize, input.Length - x * chunkSize)))
+                            .ToList();
+
+                        // 输出分割后的子字符串  
+                        //foreach (var chunk in chunks)
+                        //{
+                        //    Console.WriteLine(chunk);
+                        //}
+
+
+                        int topgrade = Convert.ToInt32(number.Rows[i]["color"]);
+                        // 设置字体样式和大小  
+                        Color color1 = new Color();
+                        switch (topgrade)
+                        {
+                            case 0:
+                                color1 = Color.White;
+                                break;
+                            case 1:
+                                color1 = Color.DarkGray;
+                                break;
+                            case 2:
+                                color1 = Color.Purple;
+                                break;
+                            case 3:
+                                color1 = Color.Blue;
+                                break;
+                            case 4:
+                                color1 = Color.Red;
+                                break;
+                            case 5:
+                                color1 = Color.Red;
+                                break;
+                            default:
+                                color1 = Color.Red;
+                                break;
+
+                        }
+                        OpenCvSharp.Scalar fontColor = new OpenCvSharp.Scalar(color1.R, color1.G, color1.B, 255); // 文字颜色:黑色  
+                        double fontScale = 2.5; // 字体大小缩放因子  
+                        //int thickness = 2; // 字体粗细  
+                        OpenCvSharp.LineTypes lineType = OpenCvSharp.LineTypes.AntiAlias; // 线条类型  
+
+                        int thickness2 = 1; // 字体粗细 
+
+                        foreach (var chunk in chunks)
+                        {
+                            // 获取文字的大小,以便我们可以更好地定位它  
+                            OpenCvSharp.Size textSize = OpenCvSharp.Cv2.GetTextSize(chunk, HersheyFonts.HersheySimplex, fontScale, thickness2, out int baseline);
+                            // 使用PutText方法在图像上绘制文字  
+                            OpenCvSharp.Cv2.PutText(save_pano, chunk, textOrg, HersheyFonts.HersheySimplex, fontScale, fontColor, thickness, lineType);
+                            textOrg.Y = textOrg.Y + 100;
+                        }
+
+
+
+                    }
+                    Yzhou = Yzhou + GridLength;
+                }
+
+
+            }
             OpenCvSharp.Cv2.ImWrite(sfd.FileName, save_pano);
             NLog.LogManager.GetCurrentClassLogger().Info("Save complete.");
 
@@ -242,6 +362,25 @@ namespace OTSIncAReportApp._3_ServiceCenter
 
            
         }
+
+        private DataTable CountTheNumberOfX_axes(DataTable dataTable, string ColumnName, string name)
+        {
+
+            DataTable data = new DataTable();
+            data.Columns.Add("data");
+            data.Columns.Add("color");
+            for (int i = 0; i < dataTable.Rows.Count; i++)
+            {
+                if (name == dataTable.Rows[i][ColumnName].ToString())
+                {
+                    DataRow dr = data.NewRow();
+                    dr["data"] = dataTable.Rows[i]["grade"].ToString();
+                    dr["color"] = dataTable.Rows[i]["topGrade"].ToString();
+                    data.Rows.Add(dr);
+                }
+            }
+            return data;
+        }
         private int getPICstringLong(DataTable particleData, List<OpenCvSharp.Mat> list_pano)
         {
             int Long = 1;
@@ -420,8 +559,8 @@ namespace OTSIncAReportApp._3_ServiceCenter
                                             {
                                                 #region 创建DSegment对象,并将STD分析出的化合物颜色保存到DSegment对象中
 
-                                                Point on_p = new Point() { X = seg.Start, Y = seg.Height };
-                                                Point off_p = new Point() { X = seg.Start + seg.Length, Y = seg.Height };
+                                                System.Drawing.Point on_p = new System.Drawing.Point() { X = seg.Start, Y = seg.Height };
+                                                System.Drawing.Point off_p = new System.Drawing.Point() { X = seg.Start + seg.Length, Y = seg.Height };
                                                 //var color = DrawFunction.GetColorBySTDTypeIDForBSEAndSorImage("#434343", particle.TypeId);
                                                 
                                                 Pen npen = new Pen(Color.FromArgb(255-particle.AveGray, 0, 0, 0));
@@ -538,8 +677,8 @@ namespace OTSIncAReportApp._3_ServiceCenter
                                             {
                                                 #region 创建DSegment对象,并将STD分析出的化合物颜色保存到DSegment对象中
 
-                                                Point on_p = new Point() { X = seg.Start, Y = seg.Height };
-                                                Point off_p = new Point() { X = seg.Start + seg.Length, Y = seg.Height };
+                                                System.Drawing.Point on_p = new System.Drawing.Point() { X = seg.Start, Y = seg.Height };
+                                                System.Drawing.Point off_p = new System.Drawing.Point() { X = seg.Start + seg.Length, Y = seg.Height };
                                                 var color = DrawFunction.GetColorBySTDTypeIDForBSEAndSorImage(particle.TypeColor, particle.TypeId);
                                                 Pen npen = new Pen(color);
                                                 graph_2.DrawLine(npen, on_p, off_p);
@@ -716,8 +855,8 @@ namespace OTSIncAReportApp._3_ServiceCenter
                                             {
                                                 #region 创建DSegment对象,并将STD分析出的化合物颜色保存到DSegment对象中
 
-                                                Point on_p = new Point() { X = seg.Start, Y = seg.Height };
-                                                Point off_p = new Point() { X = seg.Start + seg.Length, Y = seg.Height };
+                                                System.Drawing.Point on_p = new System.Drawing.Point() { X = seg.Start, Y = seg.Height };
+                                                System.Drawing.Point off_p = new System.Drawing.Point() { X = seg.Start + seg.Length, Y = seg.Height };
                                                 Pen npen = new Pen(dp.Color);
                                                 graph_2.DrawLine(npen, on_p, off_p);
 

+ 2 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -304,6 +304,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     dr["TypeId"] = dt.Rows[i]["TypeId"].ToString();
                     dr["con"] = dt.Rows[i]["con"].ToString();
                     dr["Class"] = dt.Rows[i]["GroupName"].ToString();
+                    if (dt.Rows[i]["GroupName"].ToString() == "")
+                        continue;
                     dr["Largest"] = Math.Round(Convert.ToDouble(dt.Rows[i]["max"]), 2);
                     for (int a = 6; a < colid.Count; a++)
                     {

+ 0 - 0
OTSIncAReportApp/Properties/licenses.licx