Browse Source

修改报告程序导出元素排序功能,完成

zhangjiaxin 3 years ago
parent
commit
991c94dcb0

+ 34 - 7
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.Designer.cs

@@ -104,6 +104,8 @@
             this.panel3 = new System.Windows.Forms.Panel();
             this.panel3 = new System.Windows.Forms.Panel();
             this.groupBox9 = new System.Windows.Forms.GroupBox();
             this.groupBox9 = new System.Windows.Forms.GroupBox();
             this.label39 = new System.Windows.Forms.Label();
             this.label39 = new System.Windows.Forms.Label();
+            this.comboBox_PeriodicTable = new System.Windows.Forms.ComboBox();
+            this.button3 = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.groupBox1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox5.SuspendLayout();
             this.groupBox5.SuspendLayout();
@@ -433,7 +435,7 @@
             this.groupBox5.Controls.Add(this.label20);
             this.groupBox5.Controls.Add(this.label20);
             this.groupBox5.Controls.Add(this.label22);
             this.groupBox5.Controls.Add(this.label22);
             this.groupBox5.Controls.Add(this.cb_yscf_xstx);
             this.groupBox5.Controls.Add(this.cb_yscf_xstx);
-            this.groupBox5.Location = new System.Drawing.Point(3, 738);
+            this.groupBox5.Location = new System.Drawing.Point(3, 752);
             this.groupBox5.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox5.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox5.Name = "groupBox5";
             this.groupBox5.Name = "groupBox5";
             this.groupBox5.Padding = new System.Windows.Forms.Padding(2);
             this.groupBox5.Padding = new System.Windows.Forms.Padding(2);
@@ -485,6 +487,8 @@
             // 
             // 
             // groupBox6
             // groupBox6
             // 
             // 
+            this.groupBox6.Controls.Add(this.button3);
+            this.groupBox6.Controls.Add(this.comboBox_PeriodicTable);
             this.groupBox6.Controls.Add(this.tb_ysfx_xsys);
             this.groupBox6.Controls.Add(this.tb_ysfx_xsys);
             this.groupBox6.Controls.Add(this.button4);
             this.groupBox6.Controls.Add(this.button4);
             this.groupBox6.Controls.Add(this.ck_ysfx_xsmk);
             this.groupBox6.Controls.Add(this.ck_ysfx_xsmk);
@@ -493,27 +497,28 @@
             this.groupBox6.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox6.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox6.Name = "groupBox6";
             this.groupBox6.Name = "groupBox6";
             this.groupBox6.Padding = new System.Windows.Forms.Padding(2);
             this.groupBox6.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox6.Size = new System.Drawing.Size(268, 101);
+            this.groupBox6.Size = new System.Drawing.Size(268, 134);
             this.groupBox6.TabIndex = 4;
             this.groupBox6.TabIndex = 4;
             this.groupBox6.TabStop = false;
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "元素分析表";
             this.groupBox6.Text = "元素分析表";
             // 
             // 
             // tb_ysfx_xsys
             // tb_ysfx_xsys
             // 
             // 
-            this.tb_ysfx_xsys.Location = new System.Drawing.Point(16, 66);
+            this.tb_ysfx_xsys.Location = new System.Drawing.Point(16, 51);
             this.tb_ysfx_xsys.Margin = new System.Windows.Forms.Padding(2);
             this.tb_ysfx_xsys.Margin = new System.Windows.Forms.Padding(2);
             this.tb_ysfx_xsys.Name = "tb_ysfx_xsys";
             this.tb_ysfx_xsys.Name = "tb_ysfx_xsys";
-            this.tb_ysfx_xsys.Size = new System.Drawing.Size(173, 21);
+            this.tb_ysfx_xsys.ReadOnly = true;
+            this.tb_ysfx_xsys.Size = new System.Drawing.Size(181, 21);
             this.tb_ysfx_xsys.TabIndex = 58;
             this.tb_ysfx_xsys.TabIndex = 58;
             // 
             // 
             // button4
             // button4
             // 
             // 
-            this.button4.Location = new System.Drawing.Point(213, 66);
+            this.button4.Location = new System.Drawing.Point(167, 93);
             this.button4.Margin = new System.Windows.Forms.Padding(2);
             this.button4.Margin = new System.Windows.Forms.Padding(2);
             this.button4.Name = "button4";
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(37, 19);
+            this.button4.Size = new System.Drawing.Size(72, 20);
             this.button4.TabIndex = 57;
             this.button4.TabIndex = 57;
-            this.button4.Text = "...";
+            this.button4.Text = "PeriodicTable";
             this.button4.UseVisualStyleBackColor = true;
             this.button4.UseVisualStyleBackColor = true;
             this.button4.Click += new System.EventHandler(this.button4_Click);
             this.button4.Click += new System.EventHandler(this.button4_Click);
             // 
             // 
@@ -946,6 +951,26 @@
             this.label39.TabIndex = 75;
             this.label39.TabIndex = 75;
             this.label39.Text = "模板设置";
             this.label39.Text = "模板设置";
             // 
             // 
+            // comboBox_PeriodicTable
+            // 
+            this.comboBox_PeriodicTable.FormattingEnabled = true;
+            this.comboBox_PeriodicTable.Location = new System.Drawing.Point(16, 93);
+            this.comboBox_PeriodicTable.Name = "comboBox_PeriodicTable";
+            this.comboBox_PeriodicTable.Size = new System.Drawing.Size(141, 20);
+            this.comboBox_PeriodicTable.TabIndex = 59;
+            this.comboBox_PeriodicTable.SelectedIndexChanged += new System.EventHandler(this.comboBox_PeriodicTable_SelectedIndexChanged);
+            this.comboBox_PeriodicTable.KeyDown += new System.Windows.Forms.KeyEventHandler(this.comboBox_PeriodicTable_KeyDown);
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(202, 51);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(55, 23);
+            this.button3.TabIndex = 60;
+            this.button3.Text = "Delete";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click_1);
+            // 
             // OTSReport_TemplateDesignerRM
             // OTSReport_TemplateDesignerRM
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1072,5 +1097,7 @@
         private System.Windows.Forms.Label label39;
         private System.Windows.Forms.Label label39;
         private System.Windows.Forms.TextBox tb_ysfx_xsys;
         private System.Windows.Forms.TextBox tb_ysfx_xsys;
         private System.Windows.Forms.Button button4;
         private System.Windows.Forms.Button button4;
+        public System.Windows.Forms.ComboBox comboBox_PeriodicTable;
+        private System.Windows.Forms.Button button3;
     }
     }
 }
 }

+ 55 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -46,6 +46,17 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// </summary>
         /// </summary>
         private void BindControl()
         private void BindControl()
         {
         {
+            #region 元素选择
+            string[] PeriodicTable = { "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hq", "TI", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Mc", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Unb" };
+            comboBox_PeriodicTable.Items.AddRange(PeriodicTable);
+            AutoCompleteStringCollection sc = new AutoCompleteStringCollection();
+            sc.AddRange(PeriodicTable);
+            this.comboBox_PeriodicTable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
+            this.comboBox_PeriodicTable.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
+            this.comboBox_PeriodicTable.AutoCompleteCustomSource = sc;
+            #endregion
+
+
             #region 颗粒尺寸分析结果
             #region 颗粒尺寸分析结果
             //计算方式
             //计算方式
             //BindComboBox(DisplayPicutureType.AnalyzeDataChart, cb_klcc_jsfs, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, (int)CALCULATE_CHART_TYPE.TRIO_CHART, OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //BindComboBox(DisplayPicutureType.AnalyzeDataChart, cb_klcc_jsfs, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, (int)CALCULATE_CHART_TYPE.TRIO_CHART, OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
@@ -1136,5 +1147,49 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             KLLB();
             KLLB();
         }
         }
         #endregion
         #endregion
+
+        private void comboBox_PeriodicTable_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (comboBox_PeriodicTable.Text != null && comboBox_PeriodicTable.SelectedItem != null)
+            {
+
+                string newStr = comboBox_PeriodicTable.SelectedItem.ToString();
+                string[] after = tb_ysfx_xsys.Text.Split(new char[] { ',' });
+                for (int i=0;i< after.Length;i++)
+                {
+                    if (after[i] == newStr)
+                    {
+                        MessageBox.Show("Element already exists!");
+                        return;
+                    }
+                }
+                if (tb_ysfx_xsys.Text == "")
+                    tb_ysfx_xsys.Text = tb_ysfx_xsys.Text + newStr;
+                else if (tb_ysfx_xsys.Text.Substring(tb_ysfx_xsys.Text.Length - 1) != ",")
+                    tb_ysfx_xsys.Text = tb_ysfx_xsys.Text + "," + newStr;
+                else
+                    tb_ysfx_xsys.Text = tb_ysfx_xsys.Text + newStr;
+                comboBox_PeriodicTable.Text = null;
+            }
+        }
+
+        private void comboBox_PeriodicTable_KeyDown(object sender, KeyEventArgs e)
+        {
+
+        }
+
+        private void button3_Click_1(object sender, EventArgs e)
+        {
+            string str = "";
+            string[] after = tb_ysfx_xsys.Text.Split(new char[] { ',' });
+            for (int i=0;i< after.Length-1;i++)
+            {
+                if (i == after.Length - 2)
+                    str = str + after[i];
+                else
+                    str = str + after[i] + ",";
+            }
+            tb_ysfx_xsys.Text = str;
+        }
     }
     }
 }
 }