Selaa lähdekoodia

报告xray显示添加 颗粒图像、黑白图、单位
颗粒列表筛选优化

cxs 1 vuosi sitten
vanhempi
commit
bef3d0249c

+ 18 - 11
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像素一个小刻度
@@ -168,14 +168,14 @@ namespace OTSIncAReportGraph.Controls
             InitializeComponent();
             pictureBox1.Visible = false;
             pictureBox2.Visible = false;
-            m_i_draw_start += 25;
+            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+25;
+            m_i_draw_start += pictureBox1.Width+pictureBox2.Width+40;
         }
 
         public void SetBitmapOfPictureBox(Bitmap a_bitmap1, Bitmap a_bitmap2)
@@ -480,11 +480,11 @@ namespace OTSIncAReportGraph.Controls
             //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个大刻度
@@ -500,6 +500,10 @@ namespace OTSIncAReportGraph.Controls
             }
             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++)
             {
@@ -513,6 +517,12 @@ namespace OTSIncAReportGraph.Controls
 
             //补充输入文字,为了美观
             //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线的边框
@@ -537,9 +547,6 @@ namespace OTSIncAReportGraph.Controls
                     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)

+ 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>

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

@@ -76,6 +76,7 @@ namespace OTSIncAReportGrids
             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();
@@ -85,6 +86,7 @@ namespace OTSIncAReportGrids
             // 
             // 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);
@@ -164,16 +166,20 @@ namespace OTSIncAReportGrids
             // 
             // tbx_Type
             // 
-            this.tbx_Type.Enabled = false;
-            this.tbx_Type.Location = new System.Drawing.Point(716, 9);
+            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(207, 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(929, 9);
+            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;
@@ -184,11 +190,13 @@ namespace OTSIncAReportGrids
             // 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
             // 
@@ -529,6 +537,16 @@ namespace OTSIncAReportGrids
             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);
@@ -595,5 +613,6 @@ namespace OTSIncAReportGrids
         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;
     }
 }

+ 98 - 12
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,13 +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;
-using OTSIncAReportGraph.Controls;
-using OTSIncAReportApp.Properties;
-using OTSPeriodicTable;
 
 namespace OTSIncAReportGrids
 {
@@ -1482,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)
@@ -2768,6 +2778,82 @@ namespace OTSIncAReportGrids
                 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));