Sfoglia il codice sorgente

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp 1 anno fa
parent
commit
8807b7e940

+ 71 - 26
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.cs

@@ -37,7 +37,7 @@ namespace OTSIncAReportGraph.Controls
         Font m_thisfont_bold = new Font("微软雅黑", 8, FontStyle.Bold);
 
         //下标尺分界位置
-        float m_f_rulerX_location = 170;
+        float m_f_rulerX_location = 160;
 
         //下坐标尺设定参数
         float m_i_smalkd = 5;                                           //5像素一个小刻度
@@ -48,8 +48,10 @@ namespace OTSIncAReportGraph.Controls
         float m_i_draw_start = 0;                                       //整个界面绘制的起始点
         float m_i_draw_end = 1004;                                      //整个界面绘制的边界
 
+        float m_Y_draw_end = 220;                                      //整个界面绘制的边界高
         float m_Y_draw_TopDiff = 15;                                    //Y轴距离顶部距离
         float m_Y_MaxValue = 0;                                         //Y轴显示的最大刻度长度
+        uint m_Y_Value = 50;                                           //Y轴大刻度包含像素数
 
         float m_i_rightdrawlabellocation_x = 850;                       //右上角要显示文字的位置
         float m_i_rightdrawlabellocation_y = 5;                         //右上角要显示文字的位置
@@ -164,6 +166,22 @@ namespace OTSIncAReportGraph.Controls
         public Control_XRayTable()
         {
             InitializeComponent();
+            pictureBox1.Visible = false;
+            pictureBox2.Visible = false;
+            m_i_draw_start += 40;
+        }
+        public Control_XRayTable(Bitmap a_bitmap)
+        {
+            InitializeComponent();
+            pictureBox1.Visible = true;
+            pictureBox2.Visible = true;
+            m_i_draw_start += pictureBox1.Width+pictureBox2.Width+40;
+        }
+
+        public void SetBitmapOfPictureBox(Bitmap a_bitmap1, Bitmap a_bitmap2)
+        {
+            pictureBox1.Image = a_bitmap1;
+            pictureBox2.Image = a_bitmap2;
         }
 
         /// <summary>
@@ -190,8 +208,9 @@ namespace OTSIncAReportGraph.Controls
         {
             //重新加载时,对当前的宽度等重新加载并计算
             m_i_draw_end = this.Width;
-            m_i_smalkd = (m_i_draw_end - 4) / m_i_smallkd_number;//按宽度重新计算小刻度的长度 -4是有4像素的边框差
-            m_i_bigkd = (m_i_draw_end - 4) / m_i_bigkd_number;   //按宽度重新计算大刻度的长度
+            m_Y_draw_end = this.Height;
+            m_i_smalkd = (m_i_draw_end- m_i_draw_start - 4) / m_i_smallkd_number;//按宽度重新计算小刻度的长度 -4是有4像素的边框差
+            m_i_bigkd = (m_i_draw_end- m_i_draw_start - 4) / m_i_bigkd_number;   //按宽度重新计算大刻度的长度
 
 
             #region 重新初始化相关全局变量
@@ -272,7 +291,7 @@ namespace OTSIncAReportGraph.Controls
 
             double ls_width = m_i_draw_end;//改成固定值,整个绘制浪线的总长
             double ls_cs = 2000;
-            m_f_zl = (float)(ls_width / ls_cs);
+            m_f_zl = (float)((ls_width- m_i_draw_start) / ls_cs);
 
             //计算KML峰值判定的上标值与下标值
             GetKMLFPD_MAXANDMIN(m_analysis_xray);
@@ -447,22 +466,25 @@ namespace OTSIncAReportGraph.Controls
         /// </summary>
         /// <param name="g"></param>
         protected void DrawXrayImage(Graphics g)
-        { 
+        {
 
             #region //绘制标尺表盘部份----------------------------------------------------------------------------------------------
-
+            
             //宽度比的缩放基数
             float f_js_width = 1;//经过考虑,先定为1,为固定的像素进行绘制
 
+
             #region 绘制下面的标尺
             //x轴标尺的线
             g.DrawLine(m_this_p, m_i_draw_start, m_f_rulerX_location, m_i_draw_end * f_js_width, m_f_rulerX_location);
+            //y轴标尺的线
+            g.DrawLine(m_this_p, m_i_draw_start, m_f_rulerX_location, m_i_draw_start, -m_Y_draw_end+ m_Y_draw_TopDiff+ m_f_rulerX_location+20);
 
-            //200个小刻度
-            for (int i = 0; i < m_i_smallkd_number; i++)
-            {
-                g.DrawLine(m_this_p, m_i_draw_start + (i * m_i_smalkd * f_js_width), m_f_rulerX_location, m_i_draw_start + (i * m_i_smalkd * f_js_width), m_f_rulerX_location + 5);
-            }
+            ////200个小刻度
+            //for (int i = 0; i < m_i_smallkd_number; i++)
+            //{
+            //    g.DrawLine(m_this_p, m_i_draw_start + (i * m_i_smalkd * f_js_width), m_f_rulerX_location, m_i_draw_start + (i * m_i_smalkd * f_js_width), m_f_rulerX_location + 5);
+            //}
 
             int i_count = 0;
             //40个大刻度
@@ -476,9 +498,31 @@ namespace OTSIncAReportGraph.Controls
                     g.DrawString((i_count - 1).ToString(), m_thisfont_bold, m_this_sb, m_i_draw_start + (i * m_i_bigkd * f_js_width) + 1, m_f_rulerX_location + 10);
                 }
             }
+            int m_Y_Value_Count = (int)Math.Floor(m_xraytopixel_multiple * 150 / 25);
+            m_Y_Value = (uint)(m_Y_Value_Count/4) * 25;
+            if(m_Y_Value==0)
+            {
+                m_Y_Value = (uint)Math.Floor(m_xraytopixel_multiple * 150 / 2);
+            }
+            //纵坐标
+            for (int i = 0; i < 30; i++)
+            {
+                if (i * m_Y_Value <= m_xraytopixel_multiple*150)
+                {
+                    g.DrawLine(m_this_p, m_i_draw_start, m_f_rulerX_location - (i * GetValueByRatio(m_Y_Value) * f_js_width), m_i_draw_start + 3, m_f_rulerX_location - (i * GetValueByRatio(m_Y_Value) * f_js_width));
+                    int aa = i * Convert.ToInt16(m_Y_Value);
+                    g.DrawString(aa.ToString(), m_thisfont_bold, m_this_sb, m_i_draw_start - 10 - ((aa.ToString().Length - 1) * 6), m_f_rulerX_location - (i * GetValueByRatio(m_Y_Value) * f_js_width) - 7);
+                }
+            }
 
             //补充输入文字,为了美观
             //g.DrawString("kv", m_thisfont_bold, m_this_sb, 8, m_f_rulerX_location + 10);
+            Font m_thisfont_bold2 = new Font("微软雅黑", 11, FontStyle.Bold);
+            g.DrawString("Kev", m_thisfont_bold2, m_this_sb, (m_i_draw_end- m_i_draw_start) / 2+m_i_draw_start, m_f_rulerX_location + 23);
+            g.TranslateTransform(m_i_draw_start-45, m_f_rulerX_location-25); // 移动到绘图起始点
+            g.RotateTransform(-90); // 逆时针旋转90度
+            g.DrawString("Counts", m_thisfont_bold2, m_this_sb, 0,0);
+            g.ResetTransform();
             #endregion
 
             #region 绘制x-ray线的边框
@@ -498,14 +542,11 @@ namespace OTSIncAReportGraph.Controls
                 for (int i = 0; i < m_list_twopoint1.Count(); i++)
                 {
                     PointF ls_pf1 = m_list_twopoint1[i].pf1;
-                    ls_pf1.X = ls_pf1.X * f_js_width;
+                    ls_pf1.X = ls_pf1.X * f_js_width+ m_i_draw_start;
                     PointF ls_pf2 = m_list_twopoint1[i].pf2;
-                    ls_pf2.X = ls_pf2.X * f_js_width;
+                    ls_pf2.X = ls_pf2.X * f_js_width+ m_i_draw_start;
 
                     g.DrawLine(m_this_p, ls_pf1, ls_pf2);
-
-           
-
                 }
             }
             if (m_b_show_analysisxray == true)
@@ -514,9 +555,9 @@ namespace OTSIncAReportGraph.Controls
                 for (int i = 0; i < m_list_twopoint2.Count(); i++)
                 {
                     PointF ls_pf1_2 = m_list_twopoint2[i].pf1;
-                    ls_pf1_2.X = ls_pf1_2.X * f_js_width;
+                    ls_pf1_2.X = (ls_pf1_2.X) * f_js_width+ m_i_draw_start ;
                     PointF ls_pf2_2 = m_list_twopoint2[i].pf2;
-                    ls_pf2_2.X = ls_pf2_2.X * f_js_width;
+                    ls_pf2_2.X = (ls_pf2_2.X) * f_js_width+ m_i_draw_start ;
 
                     g.DrawLine(m_this_p_blue, ls_pf1_2, ls_pf2_2);
 
@@ -545,28 +586,28 @@ namespace OTSIncAReportGraph.Controls
                     //先把峰值上的文字去掉,因为这里与底层分析出的结果不太一致,为了不产生疑问所以这里去掉
 
                     //绘制竖线
-                    g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20)), m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20)), m_f_rulerX_location - 3);
+                    g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].kml_x * ((m_i_draw_end- m_i_draw_start) / 20)) + m_i_draw_start, m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].kml_x * ((m_i_draw_end - m_i_draw_start) / 20) + m_i_draw_start), m_f_rulerX_location - 3);
                     //输出文字,并将字输出到线的上面
                     SizeF out_testsizef = g.MeasureString(m_list_kmlfpoint[i].ysm, m_thisfont);
                     PointF ut_test_pointF = new PointF(m_mouse_point.X - (out_testsizef.Width / 2), 2);
-                    g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
+                    g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * ((m_list_kmlfpoint[i].kml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
                     g.DrawString(m_list_kmlfpoint[i].ysm,
                         m_thisfont_bold,
                         m_this_sb,
-                        new PointF(f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
+                        new PointF(f_js_width * ((m_list_kmlfpoint[i].kml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
 
                     if (m_list_kmlfpoint[i].lml_x != 0)
                     {
                         //绘制竖线
-                        g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20)), m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20)), m_f_rulerX_location - 3);
+                        g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start, m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20) + m_i_draw_start), m_f_rulerX_location - 3);
                         //输出文字,并将字输出到线的上面
                         SizeF out_testsizef2 = g.MeasureString(m_list_kmlfpoint[i].ysm, m_thisfont);
                         PointF ut_test_pointF2 = new PointF(m_mouse_point.X - (out_testsizef.Width / 2), 2);
-                        g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
+                        g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * ((m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20))+ m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
                         g.DrawString(m_list_kmlfpoint[i].ysm,
                             m_thisfont_bold,
                             m_this_sb,
-                            new PointF(f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
+                            new PointF(f_js_width * ((m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
                     }
                 }
             }
@@ -583,11 +624,11 @@ namespace OTSIncAReportGraph.Controls
                 if (m_analysis_xray[i] > m_f_kmlfzpd_mix)
                 {
                     //用绘线线段,的起始点与鼠标当前位置进行对应上的话,那么就进行取kmlf值,进行显示
-                    if (Convert.ToInt32(m_list_twopoint2[i].pf1.X * f_js_width) == m_mouse_point.X)
+                    if (Convert.ToInt32(m_list_twopoint2[i].pf1.X * f_js_width) == m_mouse_point.X+ m_i_draw_start)
                     {
                         ls_label_str = m_list_twopoint2[i].kmlf_value.ToString();
                     }
-                    if (Convert.ToInt32(m_list_twopoint2[i].pf2.X * f_js_width) == m_mouse_point.X)
+                    if (Convert.ToInt32(m_list_twopoint2[i].pf2.X * f_js_width) == m_mouse_point.X + m_i_draw_start)
                     {
                         ls_label_str = m_list_twopoint2[i].kmlf_value.ToString();
                     }
@@ -697,6 +738,10 @@ namespace OTSIncAReportGraph.Controls
         }
         #endregion
 
+        private void label_close_Click(object sender, EventArgs e)
+        {
+            this.Visible = false;
+        }
     }
 
     #region 用来显示连接线封装的类

+ 51 - 0
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.designer.cs

@@ -28,19 +28,70 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
+            this.label_close = new System.Windows.Forms.Label();
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
             this.SuspendLayout();
             // 
+            // pictureBox1
+            // 
+            this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.pictureBox1.Location = new System.Drawing.Point(0, 0);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(177, 220);
+            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox1.TabIndex = 0;
+            this.pictureBox1.TabStop = false;
+            // 
+            // label_close
+            // 
+            this.label_close.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.label_close.AutoSize = true;
+            this.label_close.Location = new System.Drawing.Point(990, 0);
+            this.label_close.Name = "label_close";
+            this.label_close.Size = new System.Drawing.Size(11, 12);
+            this.label_close.TabIndex = 1;
+            this.label_close.Text = "X";
+            this.label_close.Visible = false;
+            this.label_close.Click += new System.EventHandler(this.label_close_Click);
+            // 
+            // pictureBox2
+            // 
+            this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.pictureBox2.Location = new System.Drawing.Point(174, 0);
+            this.pictureBox2.Name = "pictureBox2";
+            this.pictureBox2.Size = new System.Drawing.Size(177, 220);
+            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox2.TabIndex = 2;
+            this.pictureBox2.TabStop = false;
+            // 
             // Control_XRayTable
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.BackColor = System.Drawing.Color.White;
+            this.Controls.Add(this.pictureBox2);
+            this.Controls.Add(this.label_close);
+            this.Controls.Add(this.pictureBox1);
             this.Name = "Control_XRayTable";
             this.Size = new System.Drawing.Size(1004, 220);
             this.Load += new System.EventHandler(this.Control_XRayTable_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             this.ResumeLayout(false);
+            this.PerformLayout();
 
         }
 
         #endregion
+
+        private System.Windows.Forms.PictureBox pictureBox1;
+        public System.Windows.Forms.Label label_close;
+        private System.Windows.Forms.PictureBox pictureBox2;
     }
 }

+ 92 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticleClassificationSelect.Designer.cs

@@ -0,0 +1,92 @@
+
+namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
+{
+    partial class ParticleClassificationSelect
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.btn_ok = new System.Windows.Forms.Button();
+            this.btn_cannel = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // panel1
+            // 
+            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel1.Location = new System.Drawing.Point(2, 3);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(264, 507);
+            this.panel1.TabIndex = 0;
+            // 
+            // btn_ok
+            // 
+            this.btn_ok.Location = new System.Drawing.Point(106, 514);
+            this.btn_ok.Name = "btn_ok";
+            this.btn_ok.Size = new System.Drawing.Size(75, 23);
+            this.btn_ok.TabIndex = 1;
+            this.btn_ok.Text = "OK";
+            this.btn_ok.UseVisualStyleBackColor = true;
+            this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
+            // 
+            // btn_cannel
+            // 
+            this.btn_cannel.Location = new System.Drawing.Point(191, 514);
+            this.btn_cannel.Name = "btn_cannel";
+            this.btn_cannel.Size = new System.Drawing.Size(75, 23);
+            this.btn_cannel.TabIndex = 2;
+            this.btn_cannel.Text = "Cannel";
+            this.btn_cannel.UseVisualStyleBackColor = true;
+            this.btn_cannel.Click += new System.EventHandler(this.btn_cannel_Click);
+            // 
+            // ParticleClassificationSelect
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(269, 539);
+            this.Controls.Add(this.btn_cannel);
+            this.Controls.Add(this.btn_ok);
+            this.Controls.Add(this.panel1);
+            this.MaximizeBox = false;
+            this.MaximumSize = new System.Drawing.Size(285, 578);
+            this.MinimumSize = new System.Drawing.Size(285, 578);
+            this.Name = "ParticleClassificationSelect";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "颗粒类型选择";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ParticleClassificationSelect_FormClosing);
+            this.Load += new System.EventHandler(this.ParticleClassificationSelect_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Button btn_ok;
+        private System.Windows.Forms.Button btn_cannel;
+    }
+}

+ 110 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticleClassificationSelect.cs

@@ -0,0 +1,110 @@
+using OTSIncAReportApp.DataOperation.DataAccess;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
+{
+    public partial class ParticleClassificationSelect : Form
+    {
+        ParticleData Particledata;
+        string[] ParticleClassificationSelectedList;
+        public string ParticleClassificationSelected
+        {
+            get;
+            set;
+        }
+        public ParticleClassificationSelect(ParticleData a_Particledata, string a_ParticleClassificationSelected)
+        {
+            InitializeComponent();
+            Particledata = a_Particledata;
+            ParticleClassificationSelectedList = a_ParticleClassificationSelected.Split(',');
+        }
+
+        private void ParticleClassificationSelect_Load(object sender, EventArgs e)
+        {
+            DataTable table = Particledata.GetClassificationOfAllParticles();
+            if (table != null)
+            {
+                if (table.Rows.Count > 0)
+                {
+                    FlowLayoutPanel flowLayoutPanel = new FlowLayoutPanel();
+                    flowLayoutPanel.FlowDirection = FlowDirection.LeftToRight;
+                    flowLayoutPanel.WrapContents = true;
+                    flowLayoutPanel.Dock = DockStyle.Fill;
+                    flowLayoutPanel.AutoScroll = true;
+                    flowLayoutPanel.Padding = new Padding(15);
+                    panel1.Controls.Add(flowLayoutPanel);
+                    foreach (DataRow it in table.Rows)
+                    {
+                        // 添加控件到 FlowLayoutPanel 中
+                        CheckBox box1 = new CheckBox();
+                        box1.Text = it["TypeName"].ToString();
+                        box1.Width = flowLayoutPanel.Width-30;
+                        if (ParticleClassificationSelectedList != null)
+                        {
+                            if (ParticleClassificationSelectedList.Contains(box1.Text))
+                            {
+                                box1.Checked = true;
+                            }
+                            else
+                            {
+                                box1.Checked = false;
+                            }
+                        }
+                        else
+                        {
+                            box1.Checked = false;
+                        }
+                        flowLayoutPanel.Controls.Add(box1);
+                    }
+                }
+            }
+        }
+
+        private void btn_ok_Click(object sender, EventArgs e)
+        {
+            ParticleClassificationSelected = "";
+            foreach (Control control in panel1.Controls)
+            {
+                if (control.GetType() == typeof(FlowLayoutPanel))
+                {
+                    foreach (Control control1 in control.Controls)
+                    {
+                        if (control1.GetType() == typeof(System.Windows.Forms.CheckBox))
+                        {
+                            if (((CheckBox)control1).Checked)
+                            {
+                                ParticleClassificationSelected += control1.Text+",";
+                            }
+                        }
+                    }
+                }
+            }
+
+            if(ParticleClassificationSelected!="")
+            {
+                ParticleClassificationSelected = ParticleClassificationSelected.Remove(ParticleClassificationSelected.Length - 1);
+            }
+            this.DialogResult = DialogResult.OK;
+            this.Close();
+        }
+
+        private void btn_cannel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+            this.Close();
+        }
+
+        private void ParticleClassificationSelect_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            this.Close();
+        }
+    }
+}

+ 120 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticleClassificationSelect.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 31 - 7
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.Designer.cs

@@ -1,4 +1,6 @@
-namespace OTSIncAReportGrids
+using OTSIncAReportGraph.Controls;
+
+namespace OTSIncAReportGrids
 {
     partial class ParticlesGridDevidePage
     {
@@ -74,6 +76,7 @@
             this.ToolStripMenuItemDelete_Particle = new System.Windows.Forms.ToolStripMenuItem();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.dgV_ParticlesDevidePage = new System.Windows.Forms.DataGridView();
+            this.btn_particletypesel = new System.Windows.Forms.Button();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             this.contextMenuStrip1.SuspendLayout();
@@ -83,6 +86,7 @@
             // 
             // panel2
             // 
+            this.panel2.Controls.Add(this.btn_particletypesel);
             this.panel2.Controls.Add(this.btn_showconfig);
             this.panel2.Controls.Add(this.tB_FieldId);
             this.panel2.Controls.Add(this.label7);
@@ -162,15 +166,20 @@
             // 
             // tbx_Type
             // 
-            this.tbx_Type.Location = new System.Drawing.Point(723, 10);
+            this.tbx_Type.BackColor = System.Drawing.Color.White;
+            this.tbx_Type.Location = new System.Drawing.Point(982, 10);
             this.tbx_Type.Name = "tbx_Type";
-            this.tbx_Type.Size = new System.Drawing.Size(69, 21);
+            this.tbx_Type.ReadOnly = true;
+            this.tbx_Type.Size = new System.Drawing.Size(176, 21);
             this.tbx_Type.TabIndex = 34;
+            this.tbx_Type.TabStop = false;
             this.tbx_Type.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.tbx_Type.Visible = false;
+            this.tbx_Type.Click += new System.EventHandler(this.tbx_Type_Click);
             // 
             // btn_Sel
             // 
-            this.btn_Sel.Location = new System.Drawing.Point(809, 8);
+            this.btn_Sel.Location = new System.Drawing.Point(632, 8);
             this.btn_Sel.Name = "btn_Sel";
             this.btn_Sel.Size = new System.Drawing.Size(54, 23);
             this.btn_Sel.TabIndex = 33;
@@ -181,11 +190,13 @@
             // label_ParticleName
             // 
             this.label_ParticleName.AutoSize = true;
-            this.label_ParticleName.Location = new System.Drawing.Point(635, 13);
+            this.label_ParticleName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.label_ParticleName.Location = new System.Drawing.Point(899, 14);
             this.label_ParticleName.Name = "label_ParticleName";
-            this.label_ParticleName.Size = new System.Drawing.Size(53, 12);
+            this.label_ParticleName.Size = new System.Drawing.Size(79, 14);
             this.label_ParticleName.TabIndex = 32;
-            this.label_ParticleName.Text = "颗粒名称";
+            this.label_ParticleName.Text = "颗粒类别选择";
+            this.label_ParticleName.Visible = false;
             // 
             // label_Dmax
             // 
@@ -522,9 +533,20 @@
             this.dgV_ParticlesDevidePage.TabIndex = 5;
             this.dgV_ParticlesDevidePage.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.dgV_ParticlesDevidePage_SortCompare);
             this.dgV_ParticlesDevidePage.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgV_ParticlesDevidePage_KeyDown);
+            this.dgV_ParticlesDevidePage.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dgV_ParticlesDevidePage_KeyUp);
             this.dgV_ParticlesDevidePage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseDown);
             this.dgV_ParticlesDevidePage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseUp);
             // 
+            // btn_particletypesel
+            // 
+            this.btn_particletypesel.Location = new System.Drawing.Point(715, 8);
+            this.btn_particletypesel.Name = "btn_particletypesel";
+            this.btn_particletypesel.Size = new System.Drawing.Size(107, 23);
+            this.btn_particletypesel.TabIndex = 41;
+            this.btn_particletypesel.Text = "颗粒类别选择";
+            this.btn_particletypesel.UseVisualStyleBackColor = true;
+            this.btn_particletypesel.Click += new System.EventHandler(this.btn_particletypesel_Click);
+            // 
             // ParticlesGridDevidePage
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -590,5 +612,7 @@
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.Button btn_showconfig;
         public System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private Control_XRayTable control_XRayTable1;
+        private System.Windows.Forms.Button btn_particletypesel;
     }
 }

+ 240 - 35
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -1,14 +1,18 @@
-using NPOI.HSSF.UserModel;
-using NPOI.SS.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.SS.UserModel.Charts;
+using NPOI.SS.Util;
+using NPOI.XSSF.UserModel;
+using OTSCommon.Model;
 using OTSIncAReportApp;
+using OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage;
 using OTSIncAReportApp.DataOperation.DataAccess;
-using OTSCommon.Model;
 using OTSIncAReportApp.SysMgrTools;
 using OTSIncAReportGraph.Class;
+using OTSIncAReportGraph.Controls;
 using OTSIncAReportGraph.OTSIncAReportGraphFuncation;
 using OTSIncAReportGrids.OTSIncAReportGridsFuncation;
 using OTSIncAReportMailInterface;
-
+using OTSPeriodicTable;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -20,10 +24,6 @@ using System.Linq;
 using System.Reflection;
 using System.Threading;
 using System.Windows.Forms;
-using NPOI.XSSF.UserModel;
-using NPOI.SS.UserModel.Charts;
-using NPOI.SS.Util;
-using OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage;
 
 namespace OTSIncAReportGrids
 {
@@ -194,6 +194,23 @@ namespace OTSIncAReportGrids
             Type dgvType = this.dgV_ParticlesDevidePage.GetType();
             PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
             pi.SetValue(this.dgV_ParticlesDevidePage, true, null);
+
+            this.control_XRayTable1 = new Control_XRayTable(null);
+            this.control_XRayTable1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            this.control_XRayTable1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.control_XRayTable1.GBInfoStr = "";
+            this.control_XRayTable1.GoodChineseName = "";
+            this.control_XRayTable1.MaterialName = "";
+            //this.control_XRayTable1.List_ShowElementInfo = ((System.Collections.Generic.List<OTSIncAReportGraph.Controls.ShowElementInfo>)(Resources.GetObject("control_XRayTable1.List_ShowElementInfo")));
+            this.control_XRayTable1.Location = new System.Drawing.Point(0, 400);
+            this.control_XRayTable1.Name = "control_XRayTable1";
+            this.control_XRayTable1.ShowAnalysisXray = true;
+            this.control_XRayTable1.ShowSearchXray = false;
+            this.control_XRayTable1.Size = new System.Drawing.Size(1004, 200);
+            this.control_XRayTable1.STDName = "";
+            this.control_XRayTable1.Visible = false;
+            this.control_XRayTable1.label_close.Visible = true;
+            this.Controls.Add(this.control_XRayTable1);
         }
         bool Init()
         {
@@ -258,6 +275,8 @@ namespace OTSIncAReportGrids
             cbB_PageSize.Items.Add("5000");
             cbB_PageSize.Items.Add("All");
             cbB_PageSize.SelectedIndex = 0;
+
+            dgV_ParticlesDevidePage.Focus();
         }
 
         #region 自定义方法
@@ -1460,7 +1479,20 @@ namespace OTSIncAReportGrids
 
             if (!string.IsNullOrWhiteSpace(tbx_Type.Text))
             {
-                condition += " and TypeName Like \"%" + tbx_Type.Text + "%\" ";
+                //string[] tr = tbx_Type.Text.Split(',');
+                //condition += "and ("; 
+                //for(int i=0;i<tr.Length;i++)
+                //{
+                //    if(i==0)
+                //    { 
+                //    condition += "  TypeName = '"+ tr[i]+"'";
+                //    }
+                //    else
+                //    {
+                //        condition += " or TypeName = '" + tr[i] + "'";
+                //    }
+                //}
+                //condition += ")";
             }
 
             if (m_frm_userprogress.IsDisposed)
@@ -1498,31 +1530,6 @@ namespace OTSIncAReportGrids
 
         private void cbB_order_SelectedIndexChanged(object sender, EventArgs e)
         {
-            //int ordernum = cbB_order.SelectedIndex;
-            //if (ordernum == 0)
-            //{
-            //    OrderFunction = "fieldid,particleid";
-            //}
-            //else if (ordernum == 1)
-            //{
-            //    OrderFunction = "TypeName";
-            //}
-            //else if (ordernum == 2)
-            //{
-            //    OrderFunction = "DMAX";
-            //}
-            //else if (ordernum == 3)
-            //{
-            //    OrderFunction = "DMAX desc";
-            //}
-            //else if (ordernum == 4)
-            //{
-            //    OrderFunction = "Area";
-            //}
-            //else if (ordernum == 5)
-            //{
-            //    OrderFunction = "Area desc";
-            //}
 
             lnkFirst_Click(null, null);
             SetDataGridViewStyle();
@@ -2497,7 +2504,6 @@ namespace OTSIncAReportGrids
 
         private void dgV_ParticlesDevidePage_MouseDown(object sender, MouseEventArgs e)
         {
-
             var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
             int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
             {
@@ -2635,10 +2641,121 @@ namespace OTSIncAReportGrids
 
         private void dgV_ParticlesDevidePage_MouseUp(object sender, MouseEventArgs e)
         {
+            int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
+            if (sel == (int)SelItem.MergeParticles)
+            {
+                return;
+            }
             var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
             if (SelectRows.Count != 0)
             {
+                if (SelectRows.Count == 1)
+                {
+                    DataGridViewRow dgvr = SelectRows[0];
+                    Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                    List<string> list_str = (List<string>)ls_bp.Tag;
+
+
+                    //显示xray相关信息
+                    uint[] Search_xray = new uint[2000];
+                    uint[] Analysis_xray = new uint[2000];
+                    int i_xray_id = 0;
+                    List<Element> list_celementchemistryclr = new List<Element>();
+                    //获取Xray数据
+                    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);
+
+                    //get CElementChemistryClr list
+                    List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
+                    for (int i = 0; i < list_celementchemistryclr.Count; i++)
+                    {
+                        ShowElementInfo ls_sei = new ShowElementInfo();
+                        ls_sei.ElementName = list_celementchemistryclr[i].Name;
+                        ls_sei.Percentage = list_celementchemistryclr[i].Percentage;
+                        ls_sei.dKF = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).K_Peak);
+                        double de_sx2 = 0;
+                        if (CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak == "" || CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak == "-")
+                        {
+                            de_sx2 = 0;
+                        }
+                        else
+                        {
+                            de_sx2 = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak);
+                        }
+                        ls_sei.dLF = de_sx2;
+                        list_showelementinfo.Add(ls_sei);
+                    }
+                    string str_IncAName = "";
+                    str_IncAName = Convert.ToString(dgvr.Cells[1].Value);
+                    Particle particle = resultFile.List_OTSField.Find(x => x.FieldID == Convert.ToInt32(dgvr.Cells["fieldid"].Value)).ParticleList.Find(x => x.ParticleId == Convert.ToInt32(dgvr.Cells["particleId"].Value));
+                    control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + " " + "DELONG:" + Math.Round(particle.DELONG, 2) + " " + "DFERET:" + Math.Round(particle.DFERET, 2) + " " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + " " + "DMAX:" + Math.Round(particle.DMAX, 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(null, Analysis_xray, list_showelementinfo);
+                    //颗粒国标信息
+                    control_XRayTable1.GBInfoStr = "";
+                    control_XRayTable1.MaterialName = str_IncAName;//杂夹物
+
+                    control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
+
+
+                    string filePath = result.FilePath + "\\FIELD_FILES\\";
+                    string imagePath = filePath + "Field" + dgvr.Cells["fieldid"].Value.ToString() + ".bmp";
+                    Bitmap originalFieldImage=Particledata.ReadImageFile(imagePath);
+                    string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
+                    DataRow[] drs = particles.Select(str);
+                    if (drs.Length > 0)
+                    {
+                        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(drs[0]["RectLeft"]), Y = Convert.ToInt32(drs[0]["RectTop"]), Width = Convert.ToInt32(drs[0]["RectWidth"]), Height = Convert.ToInt32(drs[0]["RectHeight"]) };
+                        Bitmap dpImage = new Bitmap(originalFieldImage.Width, originalFieldImage.Height);
+                        foreach (Segment seg in particle.SegmentList)
+                        {
+                            int f_length = seg.Length;
+                            for (int m = 0; m < f_length; m++)
+                            {
+                                int lsjs_x = seg.Start + m;
+                                int lsjs_y = seg.Height;
+                                var pixelColor = originalFieldImage.GetPixel(lsjs_x, lsjs_y);
+                                dpImage.SetPixel(lsjs_x, lsjs_y, pixelColor);
+                            }
+                        }
+
+
+                        Bitmap bmap = Particledata.GetBitmapByParticle(dpImage, rectangle);
+                        Bitmap binarizedBmp = new Bitmap(bmap.Width, bmap.Height);
+                        for (int x = 0; x < bmap.Width; x++)
+                        {
+                            for (int y = 0; y < bmap.Height; y++)
+                            {
+                                Color color = bmap.GetPixel(x, y);
+                                if (color.A == 255&&color.B==0 && color.G == 0 && color.R == 0)
+                                {
+                                    binarizedBmp.SetPixel(x, y, Color.White);
+                                }
+                                else
+                                {
+                                    int grayValue = (color.R + color.G + color.B) / 3;
+                                    if(grayValue>0)
+                                    {
+                                        binarizedBmp.SetPixel(x, y, Color.Black);
+                                    }
+                                    else
+                                    {
+                                        binarizedBmp.SetPixel(x, y, Color.White);
+                                    }
+                                }
+                            }
+                        }
+                        control_XRayTable1.SetBitmapOfPictureBox(ls_bp, binarizedBmp);
+                        Invalidate();
+                    }
+                    else
+                    {
+                        control_XRayTable1.Visible = false;
+                    }
+                }
                 SaveParticleslist_select();
+
             }
         }
 
@@ -2649,6 +2766,94 @@ namespace OTSIncAReportGrids
                 ToolStripMenuItem_Delete_Particle_Click(null, null);
             }
         }
+
+        private void dgV_ParticlesDevidePage_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.KeyData == Keys.Down)
+            {
+                dgV_ParticlesDevidePage_MouseUp(null, null);
+            }
+            if (e.KeyData == Keys.Up)
+            {
+                dgV_ParticlesDevidePage_MouseUp(null, null);
+            }
+        }
+
+        private void tbx_Type_Click(object sender, EventArgs e)
+        {
+            ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(Particledata, tbx_Type.Text);
+            DialogResult result = particleClassificationSelect.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                condition = "";
+                tbx_Type.Text = particleClassificationSelect.ParticleClassificationSelected;
+                string[] tr = tbx_Type.Text.Split(',');
+                condition += " and (";
+                for (int i = 0; i < tr.Length; i++)
+                {
+                    if (i == 0)
+                    {
+                        condition += "  TypeName = '" + tr[i] + "'";
+                    }
+                    else
+                    {
+                        condition += " or TypeName = '" + tr[i] + "'";
+                    }
+                }
+                condition += ")";
+
+                if (m_frm_userprogress.IsDisposed)
+                {
+                    ProgressStart();
+                }
+
+                UpdateTable();
+
+                lnkFirst_Click(null, null);
+                SetDataGridViewStyle();
+            }
+
+        }
+
+
+
+        private void btn_particletypesel_Click(object sender, EventArgs e)
+        {
+            ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(Particledata, tbx_Type.Text);
+            DialogResult result = particleClassificationSelect.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                condition = "";
+                tbx_Type.Text = "";
+                if (particleClassificationSelect.ParticleClassificationSelected != "")
+                {
+                    tbx_Type.Text = particleClassificationSelect.ParticleClassificationSelected;
+                    string[] tr = tbx_Type.Text.Split(',');
+                    condition += " and (";
+                    for (int i = 0; i < tr.Length; i++)
+                    {
+                        if (i == 0)
+                        {
+                            condition += "  TypeName = '" + tr[i] + "'";
+                        }
+                        else
+                        {
+                            condition += " or TypeName = '" + tr[i] + "'";
+                        }
+                    }
+                    condition += ")";
+                }
+                if (m_frm_userprogress.IsDisposed)
+                {
+                    ProgressStart();
+                }
+
+                UpdateTable();
+
+                lnkFirst_Click(null, null);
+                SetDataGridViewStyle();
+            }
+        }
     }
 }
 

+ 7 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -622,7 +622,13 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
-
+        public DataTable GetClassificationOfAllParticles()
+        {
+            string sqliteString1 = "select distinct TypeName from INcAData";
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString1);
+            return DT;
+        }
         public DataTable GetXRayData()
         {
             string sqliteString = @"select * from xraydata";

+ 1 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/SqlHelper.cs

@@ -122,7 +122,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 dataAdapter.Fill(ds);
                 dt = ds.Tables[0];
             }
-            catch (Exception)
+            catch (Exception ex)
             {
 
             }

+ 9 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -430,6 +430,12 @@
     <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticlesGridDevidePageShowConfig.Designer.cs">
       <DependentUpon>ParticlesGridDevidePageShowConfig.cs</DependentUpon>
     </Compile>
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticleClassificationSelect.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticleClassificationSelect.Designer.cs">
+      <DependentUpon>ParticleClassificationSelect.cs</DependentUpon>
+    </Compile>
     <Compile Include="1-UI\Control_Grids\SpectrumExportConfirmation.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -822,6 +828,9 @@
     <EmbeddedResource Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticlesGridDevidePageShowConfig.resx">
       <DependentUpon>ParticlesGridDevidePageShowConfig.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="1-UI\Control_Grids\ParticlesGridDevidePage\ParticleClassificationSelect.resx">
+      <DependentUpon>ParticleClassificationSelect.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\Control_Grids\ParticlesSizeGrid.resx">
       <DependentUpon>ParticlesSizeGrid.cs</DependentUpon>
     </EmbeddedResource>

+ 5 - 5
OTSPartA_STDEditor/UI/Attributes.cs

@@ -120,10 +120,10 @@ namespace OTSPartA_STDEditor
                 Grid_Attributes[2, 0] = new SourceGrid.Cells.Cell("规则名称 ", typeof(string));
                 Grid_Attributes[3, 0] = new SourceGrid.Cells.Cell("颜色", typeof(string));
                 Grid_Attributes[4, 0] = new SourceGrid.Cells.Cell("是否元素分析 ", typeof(string));
-                Grid_Attributes[5, 0] = new SourceGrid.Cells.Cell("硬度", typeof(string));
-                Grid_Attributes[6, 0] = new SourceGrid.Cells.Cell("密度", typeof(string));
-                Grid_Attributes[7, 0] = new SourceGrid.Cells.Cell("导电性", typeof(string));
-                Grid_Attributes[8, 0] = new SourceGrid.Cells.Cell("BSE", typeof(string));
+                Grid_Attributes[5, 0] = new SourceGrid.Cells.Cell("硬度(N/mm2)", typeof(string));
+                Grid_Attributes[6, 0] = new SourceGrid.Cells.Cell("密度(kg/m³)", typeof(string));
+                Grid_Attributes[7, 0] = new SourceGrid.Cells.Cell("导电性(S/m)", typeof(string));
+                Grid_Attributes[8, 0] = new SourceGrid.Cells.Cell("Video", typeof(string));
                 Grid_Attributes[9, 0] = new SourceGrid.Cells.Cell("化学式", typeof(string));
                 Grid_Attributes[10, 0] = new SourceGrid.Cells.Cell("元素", typeof(string));
                 Grid_Attributes[11, 0] = new SourceGrid.Cells.Cell("分组名称", typeof(string));
@@ -138,7 +138,7 @@ namespace OTSPartA_STDEditor
                 Grid_Attributes[5, 0] = new SourceGrid.Cells.Cell("Hardness", typeof(string));
                 Grid_Attributes[6, 0] = new SourceGrid.Cells.Cell("Density", typeof(string));
                 Grid_Attributes[7, 0] = new SourceGrid.Cells.Cell("Conductivity", typeof(string));
-                Grid_Attributes[8, 0] = new SourceGrid.Cells.Cell("BSE", typeof(string));
+                Grid_Attributes[8, 0] = new SourceGrid.Cells.Cell("Video", typeof(string));
                 Grid_Attributes[9, 0] = new SourceGrid.Cells.Cell("Formula", typeof(string));
                 Grid_Attributes[10, 0] = new SourceGrid.Cells.Cell("Element", typeof(string));
                 Grid_Attributes[11, 0] = new SourceGrid.Cells.Cell("GroupName", typeof(string));