浏览代码

颗粒列表添加元素自动选择

cxs 10 月之前
父节点
当前提交
608d919432

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

@@ -2553,7 +2553,27 @@ namespace OTSIncAReportGrids
         {
             //if (m_particlesGridDevidePageShowConfig == null|| m_particlesGridDevidePageShowConfig.IsDisposed)
             //{
-                m_particlesGridDevidePageShowConfig = new ParticlesGridDevidePageShowConfig(m_ReportApp.m_RptConfigFile.Systype);
+            var p = particles; List<string> ele = new List<string>();
+            string elementsstr = "";
+            foreach (DataRow row in particles.Rows)
+            {
+                string[] strcbo = row["Element"].ToString().Split(';');
+                for (int j = 0; j < strcbo.Length; j++)
+                {
+                    string[] str = strcbo[j].Split('-');
+                    if (!ele.Contains(str[0])&& str[0]!="")
+                    { ele.Add(str[0]); }
+                }
+            }
+            foreach(var el in ele)
+            {
+                elementsstr += el.ToString() + ',';
+            }
+            if(elementsstr!="")
+            {
+                elementsstr=elementsstr.Remove(elementsstr.Length - 1, 1);
+            }
+            m_particlesGridDevidePageShowConfig = new ParticlesGridDevidePageShowConfig(m_ReportApp.m_RptConfigFile.Systype, elementsstr);
                 m_particlesGridDevidePageShowConfig.ShowDialog();
             //}
             //else

+ 46 - 32
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePageShowConfig.Designer.cs

@@ -30,6 +30,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
         private void InitializeComponent()
         {
             this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.cB_XRayDataCount = new System.Windows.Forms.CheckBox();
             this.label_help = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.cb_ParticleCoordinate = new System.Windows.Forms.CheckBox();
@@ -54,12 +55,13 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.cb_INSCR = new System.Windows.Forms.CheckBox();
             this.btn_ybcsqx = new System.Windows.Forms.Button();
             this.btn_ybcsbc = new System.Windows.Forms.Button();
-            this.cB_XRayDataCount = new System.Windows.Forms.CheckBox();
+            this.btn_auto = new System.Windows.Forms.Button();
             this.groupBox2.SuspendLayout();
             this.SuspendLayout();
             // 
             // groupBox2
             // 
+            this.groupBox2.Controls.Add(this.btn_auto);
             this.groupBox2.Controls.Add(this.cB_XRayDataCount);
             this.groupBox2.Controls.Add(this.label_help);
             this.groupBox2.Controls.Add(this.label1);
@@ -92,6 +94,17 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "显示信息设置";
             // 
+            // cB_XRayDataCount
+            // 
+            this.cB_XRayDataCount.AutoSize = true;
+            this.cB_XRayDataCount.Location = new System.Drawing.Point(339, 146);
+            this.cB_XRayDataCount.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.cB_XRayDataCount.Name = "cB_XRayDataCount";
+            this.cB_XRayDataCount.Size = new System.Drawing.Size(72, 16);
+            this.cB_XRayDataCount.TabIndex = 131;
+            this.cB_XRayDataCount.Text = "XRay计数";
+            this.cB_XRayDataCount.UseVisualStyleBackColor = true;
+            // 
             // label_help
             // 
             this.label_help.AutoSize = true;
@@ -115,7 +128,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_ParticleCoordinate
             // 
             this.cb_ParticleCoordinate.AutoSize = true;
-            this.cb_ParticleCoordinate.Location = new System.Drawing.Point(254, 146);
+            this.cb_ParticleCoordinate.Location = new System.Drawing.Point(223, 146);
             this.cb_ParticleCoordinate.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_ParticleCoordinate.Name = "cb_ParticleCoordinate";
             this.cb_ParticleCoordinate.Size = new System.Drawing.Size(72, 16);
@@ -125,19 +138,19 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // 
             // btn_xsys
             // 
-            this.btn_xsys.Location = new System.Drawing.Point(469, 18);
+            this.btn_xsys.Location = new System.Drawing.Point(406, 19);
             this.btn_xsys.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.btn_xsys.Name = "btn_xsys";
-            this.btn_xsys.Size = new System.Drawing.Size(33, 19);
+            this.btn_xsys.Size = new System.Drawing.Size(62, 21);
             this.btn_xsys.TabIndex = 112;
-            this.btn_xsys.Text = "...";
+            this.btn_xsys.Text = "手动选择";
             this.btn_xsys.UseVisualStyleBackColor = true;
             this.btn_xsys.Click += new System.EventHandler(this.btn_xsys_Click);
             // 
             // cB_Electrical_conductivity
             // 
             this.cB_Electrical_conductivity.AutoSize = true;
-            this.cB_Electrical_conductivity.Location = new System.Drawing.Point(128, 169);
+            this.cB_Electrical_conductivity.Location = new System.Drawing.Point(97, 169);
             this.cB_Electrical_conductivity.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_Electrical_conductivity.Name = "cB_Electrical_conductivity";
             this.cB_Electrical_conductivity.Size = new System.Drawing.Size(60, 16);
@@ -158,7 +171,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_Density
             // 
             this.cB_Density.AutoSize = true;
-            this.cB_Density.Location = new System.Drawing.Point(370, 169);
+            this.cB_Density.Location = new System.Drawing.Point(339, 169);
             this.cB_Density.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_Density.Name = "cB_Density";
             this.cB_Density.Size = new System.Drawing.Size(48, 16);
@@ -168,16 +181,16 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // 
             // tb_xsys
             // 
-            this.tb_xsys.Location = new System.Drawing.Point(128, 19);
+            this.tb_xsys.Location = new System.Drawing.Point(97, 19);
             this.tb_xsys.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.tb_xsys.Name = "tb_xsys";
-            this.tb_xsys.Size = new System.Drawing.Size(336, 21);
+            this.tb_xsys.Size = new System.Drawing.Size(305, 21);
             this.tb_xsys.TabIndex = 111;
             // 
             // cB_Hardness
             // 
             this.cB_Hardness.AutoSize = true;
-            this.cB_Hardness.Location = new System.Drawing.Point(254, 169);
+            this.cB_Hardness.Location = new System.Drawing.Point(223, 169);
             this.cB_Hardness.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_Hardness.Name = "cB_Hardness";
             this.cB_Hardness.Size = new System.Drawing.Size(48, 16);
@@ -188,7 +201,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_Area
             // 
             this.cb_Area.AutoSize = true;
-            this.cb_Area.Location = new System.Drawing.Point(128, 50);
+            this.cb_Area.Location = new System.Drawing.Point(97, 50);
             this.cb_Area.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_Area.Name = "cb_Area";
             this.cb_Area.Size = new System.Drawing.Size(66, 16);
@@ -199,7 +212,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_ELONG
             // 
             this.cb_ELONG.AutoSize = true;
-            this.cb_ELONG.Location = new System.Drawing.Point(370, 74);
+            this.cb_ELONG.Location = new System.Drawing.Point(339, 74);
             this.cb_ELONG.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_ELONG.Name = "cb_ELONG";
             this.cb_ELONG.Size = new System.Drawing.Size(84, 16);
@@ -210,7 +223,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_MaxDiameter
             // 
             this.cb_MaxDiameter.AutoSize = true;
-            this.cb_MaxDiameter.Location = new System.Drawing.Point(128, 98);
+            this.cb_MaxDiameter.Location = new System.Drawing.Point(97, 98);
             this.cb_MaxDiameter.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_MaxDiameter.Name = "cb_MaxDiameter";
             this.cb_MaxDiameter.Size = new System.Drawing.Size(84, 16);
@@ -221,7 +234,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_PERI
             // 
             this.cb_PERI.AutoSize = true;
-            this.cb_PERI.Location = new System.Drawing.Point(254, 98);
+            this.cb_PERI.Location = new System.Drawing.Point(223, 98);
             this.cb_PERI.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_PERI.Name = "cb_PERI";
             this.cb_PERI.Size = new System.Drawing.Size(60, 16);
@@ -232,7 +245,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_MinDiameter
             // 
             this.cb_MinDiameter.AutoSize = true;
-            this.cb_MinDiameter.Location = new System.Drawing.Point(254, 50);
+            this.cb_MinDiameter.Location = new System.Drawing.Point(223, 50);
             this.cb_MinDiameter.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_MinDiameter.Name = "cb_MinDiameter";
             this.cb_MinDiameter.Size = new System.Drawing.Size(84, 16);
@@ -243,7 +256,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_EquivalentCircleDiameter
             // 
             this.cb_EquivalentCircleDiameter.AutoSize = true;
-            this.cb_EquivalentCircleDiameter.Location = new System.Drawing.Point(128, 123);
+            this.cb_EquivalentCircleDiameter.Location = new System.Drawing.Point(97, 123);
             this.cb_EquivalentCircleDiameter.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_EquivalentCircleDiameter.Name = "cb_EquivalentCircleDiameter";
             this.cb_EquivalentCircleDiameter.Size = new System.Drawing.Size(96, 16);
@@ -254,7 +267,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_DiameterRatio
             // 
             this.cb_DiameterRatio.AutoSize = true;
-            this.cb_DiameterRatio.Location = new System.Drawing.Point(128, 74);
+            this.cb_DiameterRatio.Location = new System.Drawing.Point(97, 74);
             this.cb_DiameterRatio.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_DiameterRatio.Name = "cb_DiameterRatio";
             this.cb_DiameterRatio.Size = new System.Drawing.Size(84, 16);
@@ -265,7 +278,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_ASPECT_ELONG
             // 
             this.cb_ASPECT_ELONG.AutoSize = true;
-            this.cb_ASPECT_ELONG.Location = new System.Drawing.Point(370, 123);
+            this.cb_ASPECT_ELONG.Location = new System.Drawing.Point(339, 123);
             this.cb_ASPECT_ELONG.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_ASPECT_ELONG.Name = "cb_ASPECT_ELONG";
             this.cb_ASPECT_ELONG.Size = new System.Drawing.Size(84, 16);
@@ -276,7 +289,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_FerretDiameter
             // 
             this.cb_FerretDiameter.AutoSize = true;
-            this.cb_FerretDiameter.Location = new System.Drawing.Point(254, 74);
+            this.cb_FerretDiameter.Location = new System.Drawing.Point(223, 74);
             this.cb_FerretDiameter.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_FerretDiameter.Name = "cb_FerretDiameter";
             this.cb_FerretDiameter.Size = new System.Drawing.Size(96, 16);
@@ -287,7 +300,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_Orientation
             // 
             this.cb_Orientation.AutoSize = true;
-            this.cb_Orientation.Location = new System.Drawing.Point(254, 122);
+            this.cb_Orientation.Location = new System.Drawing.Point(223, 122);
             this.cb_Orientation.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_Orientation.Name = "cb_Orientation";
             this.cb_Orientation.Size = new System.Drawing.Size(84, 16);
@@ -298,7 +311,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_PERP
             // 
             this.cb_PERP.AutoSize = true;
-            this.cb_PERP.Location = new System.Drawing.Point(370, 50);
+            this.cb_PERP.Location = new System.Drawing.Point(339, 50);
             this.cb_PERP.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_PERP.Name = "cb_PERP";
             this.cb_PERP.Size = new System.Drawing.Size(84, 16);
@@ -309,7 +322,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_MEAN
             // 
             this.cb_MEAN.AutoSize = true;
-            this.cb_MEAN.Location = new System.Drawing.Point(128, 146);
+            this.cb_MEAN.Location = new System.Drawing.Point(97, 146);
             this.cb_MEAN.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_MEAN.Name = "cb_MEAN";
             this.cb_MEAN.Size = new System.Drawing.Size(108, 16);
@@ -320,7 +333,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cb_INSCR
             // 
             this.cb_INSCR.AutoSize = true;
-            this.cb_INSCR.Location = new System.Drawing.Point(370, 98);
+            this.cb_INSCR.Location = new System.Drawing.Point(339, 98);
             this.cb_INSCR.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cb_INSCR.Name = "cb_INSCR";
             this.cb_INSCR.Size = new System.Drawing.Size(96, 16);
@@ -350,16 +363,16 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.btn_ybcsbc.UseVisualStyleBackColor = true;
             this.btn_ybcsbc.Click += new System.EventHandler(this.btn_ybcsbc_Click);
             // 
-            // cB_XRayDataCount
+            // btn_auto
             // 
-            this.cB_XRayDataCount.AutoSize = true;
-            this.cB_XRayDataCount.Location = new System.Drawing.Point(370, 146);
-            this.cB_XRayDataCount.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.cB_XRayDataCount.Name = "cB_XRayDataCount";
-            this.cB_XRayDataCount.Size = new System.Drawing.Size(72, 16);
-            this.cB_XRayDataCount.TabIndex = 131;
-            this.cB_XRayDataCount.Text = "XRay计数";
-            this.cB_XRayDataCount.UseVisualStyleBackColor = true;
+            this.btn_auto.Location = new System.Drawing.Point(472, 19);
+            this.btn_auto.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.btn_auto.Name = "btn_auto";
+            this.btn_auto.Size = new System.Drawing.Size(38, 21);
+            this.btn_auto.TabIndex = 132;
+            this.btn_auto.Text = "自动";
+            this.btn_auto.UseVisualStyleBackColor = true;
+            this.btn_auto.Click += new System.EventHandler(this.btn_auto_Click);
             // 
             // ParticlesGridDevidePageShowConfig
             // 
@@ -411,5 +424,6 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
         private System.Windows.Forms.Button btn_ybcsbc;
         private System.Windows.Forms.Label label_help;
         private System.Windows.Forms.CheckBox cB_XRayDataCount;
+        private System.Windows.Forms.Button btn_auto;
     }
 }

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

@@ -14,10 +14,12 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
         Hashtable languageTable;
         Language lan;
         OTS_SysType_ID systype = OTS_SysType_ID.IncA;
-        public ParticlesGridDevidePageShowConfig(OTS_SysType_ID a_systype)
+        string _elementstr = "";
+        public ParticlesGridDevidePageShowConfig(OTS_SysType_ID a_systype,string elementstr)
         {
             InitializeComponent();
             systype = a_systype;
+            _elementstr= elementstr;
         }
         private void ParticlesGridDevidePageShowConfig_Load(object sender, EventArgs e)
         {
@@ -564,5 +566,10 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             //  设置伴随的对象.
             toolTip1.SetToolTip(this.label_help, str);
         }
+
+        private void btn_auto_Click(object sender, EventArgs e)
+        {
+            tb_xsys.Text = _elementstr;
+        }
     }
 }