Browse Source

调整用户编辑器结构

cxs 1 year ago
parent
commit
64fd04af8e

+ 366 - 0
OTSPartA_STDEditor/UI/ConstantsEditor.Designer.cs

@@ -0,0 +1,366 @@
+namespace OTSPartA_STDEditor
+{
+    partial class ConstantsEditor
+    {
+        /// <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.button_Cancel = new System.Windows.Forms.Button();
+            this.button_OK = new System.Windows.Forms.Button();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.textBox_9 = new System.Windows.Forms.TextBox();
+            this.checkBox_9 = new System.Windows.Forms.CheckBox();
+            this.textBox_8 = new System.Windows.Forms.TextBox();
+            this.checkBox_8 = new System.Windows.Forms.CheckBox();
+            this.textBox_7 = new System.Windows.Forms.TextBox();
+            this.checkBox_7 = new System.Windows.Forms.CheckBox();
+            this.textBox_6 = new System.Windows.Forms.TextBox();
+            this.checkBox_6 = new System.Windows.Forms.CheckBox();
+            this.textBox_5 = new System.Windows.Forms.TextBox();
+            this.checkBox_5 = new System.Windows.Forms.CheckBox();
+            this.textBox_4 = new System.Windows.Forms.TextBox();
+            this.checkBox_4 = new System.Windows.Forms.CheckBox();
+            this.textBox_3 = new System.Windows.Forms.TextBox();
+            this.checkBox_3 = new System.Windows.Forms.CheckBox();
+            this.textBox_2 = new System.Windows.Forms.TextBox();
+            this.checkBox_2 = new System.Windows.Forms.CheckBox();
+            this.textBox_1 = new System.Windows.Forms.TextBox();
+            this.checkBox_1 = new System.Windows.Forms.CheckBox();
+            this.textBox_0 = new System.Windows.Forms.TextBox();
+            this.checkBox_0 = new System.Windows.Forms.CheckBox();
+            this.groupBox1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // button_Cancel
+            // 
+            this.button_Cancel.Location = new System.Drawing.Point(120, 539);
+            this.button_Cancel.Name = "button_Cancel";
+            this.button_Cancel.Size = new System.Drawing.Size(75, 31);
+            this.button_Cancel.TabIndex = 21;
+            this.button_Cancel.Text = "取消";
+            this.button_Cancel.UseVisualStyleBackColor = true;
+            this.button_Cancel.Click += new System.EventHandler(this.button_Cancel_Click);
+            // 
+            // button_OK
+            // 
+            this.button_OK.Location = new System.Drawing.Point(39, 539);
+            this.button_OK.Name = "button_OK";
+            this.button_OK.Size = new System.Drawing.Size(75, 31);
+            this.button_OK.TabIndex = 20;
+            this.button_OK.Text = "确定";
+            this.button_OK.UseVisualStyleBackColor = true;
+            this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.textBox_9);
+            this.groupBox1.Controls.Add(this.checkBox_9);
+            this.groupBox1.Controls.Add(this.textBox_8);
+            this.groupBox1.Controls.Add(this.checkBox_8);
+            this.groupBox1.Controls.Add(this.textBox_7);
+            this.groupBox1.Controls.Add(this.checkBox_7);
+            this.groupBox1.Controls.Add(this.textBox_6);
+            this.groupBox1.Controls.Add(this.checkBox_6);
+            this.groupBox1.Controls.Add(this.textBox_5);
+            this.groupBox1.Controls.Add(this.checkBox_5);
+            this.groupBox1.Controls.Add(this.textBox_4);
+            this.groupBox1.Controls.Add(this.checkBox_4);
+            this.groupBox1.Controls.Add(this.textBox_3);
+            this.groupBox1.Controls.Add(this.checkBox_3);
+            this.groupBox1.Controls.Add(this.textBox_2);
+            this.groupBox1.Controls.Add(this.checkBox_2);
+            this.groupBox1.Controls.Add(this.textBox_1);
+            this.groupBox1.Controls.Add(this.checkBox_1);
+            this.groupBox1.Controls.Add(this.textBox_0);
+            this.groupBox1.Controls.Add(this.checkBox_0);
+            this.groupBox1.Location = new System.Drawing.Point(12, 12);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(181, 519);
+            this.groupBox1.TabIndex = 6;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "常量编辑:";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(115, 23);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(17, 12);
+            this.label2.TabIndex = 22;
+            this.label2.Text = "值";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(16, 25);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.TabIndex = 21;
+            this.label1.Text = "常量符号";
+            // 
+            // textBox_9
+            // 
+            this.textBox_9.Location = new System.Drawing.Point(82, 477);
+            this.textBox_9.Name = "textBox_9";
+            this.textBox_9.Size = new System.Drawing.Size(82, 21);
+            this.textBox_9.TabIndex = 20;
+            this.textBox_9.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_9
+            // 
+            this.checkBox_9.AutoSize = true;
+            this.checkBox_9.Location = new System.Drawing.Point(18, 479);
+            this.checkBox_9.Name = "checkBox_9";
+            this.checkBox_9.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_9.TabIndex = 19;
+            this.checkBox_9.Text = "MAC#9";
+            this.checkBox_9.UseVisualStyleBackColor = true;
+            this.checkBox_9.CheckedChanged += new System.EventHandler(this.checkBox_9_CheckedChanged);
+            // 
+            // textBox_8
+            // 
+            this.textBox_8.Location = new System.Drawing.Point(82, 427);
+            this.textBox_8.Name = "textBox_8";
+            this.textBox_8.Size = new System.Drawing.Size(82, 21);
+            this.textBox_8.TabIndex = 18;
+            this.textBox_8.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_8
+            // 
+            this.checkBox_8.AutoSize = true;
+            this.checkBox_8.Location = new System.Drawing.Point(18, 429);
+            this.checkBox_8.Name = "checkBox_8";
+            this.checkBox_8.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_8.TabIndex = 17;
+            this.checkBox_8.Text = "MAC#8";
+            this.checkBox_8.UseVisualStyleBackColor = true;
+            this.checkBox_8.CheckedChanged += new System.EventHandler(this.checkBox_8_CheckedChanged);
+            // 
+            // textBox_7
+            // 
+            this.textBox_7.Location = new System.Drawing.Point(82, 381);
+            this.textBox_7.Name = "textBox_7";
+            this.textBox_7.Size = new System.Drawing.Size(82, 21);
+            this.textBox_7.TabIndex = 16;
+            this.textBox_7.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_7
+            // 
+            this.checkBox_7.AutoSize = true;
+            this.checkBox_7.Location = new System.Drawing.Point(18, 383);
+            this.checkBox_7.Name = "checkBox_7";
+            this.checkBox_7.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_7.TabIndex = 15;
+            this.checkBox_7.Text = "MAC#7";
+            this.checkBox_7.UseVisualStyleBackColor = true;
+            this.checkBox_7.CheckedChanged += new System.EventHandler(this.checkBox_7_CheckedChanged);
+            // 
+            // textBox_6
+            // 
+            this.textBox_6.Location = new System.Drawing.Point(82, 332);
+            this.textBox_6.Name = "textBox_6";
+            this.textBox_6.Size = new System.Drawing.Size(82, 21);
+            this.textBox_6.TabIndex = 14;
+            this.textBox_6.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_6
+            // 
+            this.checkBox_6.AutoSize = true;
+            this.checkBox_6.Location = new System.Drawing.Point(18, 334);
+            this.checkBox_6.Name = "checkBox_6";
+            this.checkBox_6.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_6.TabIndex = 13;
+            this.checkBox_6.Text = "MAC#6";
+            this.checkBox_6.UseVisualStyleBackColor = true;
+            this.checkBox_6.CheckedChanged += new System.EventHandler(this.checkBox_6_CheckedChanged);
+            // 
+            // textBox_5
+            // 
+            this.textBox_5.Location = new System.Drawing.Point(82, 282);
+            this.textBox_5.Name = "textBox_5";
+            this.textBox_5.Size = new System.Drawing.Size(82, 21);
+            this.textBox_5.TabIndex = 12;
+            this.textBox_5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_5
+            // 
+            this.checkBox_5.AutoSize = true;
+            this.checkBox_5.Location = new System.Drawing.Point(18, 284);
+            this.checkBox_5.Name = "checkBox_5";
+            this.checkBox_5.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_5.TabIndex = 11;
+            this.checkBox_5.Text = "MAC#5";
+            this.checkBox_5.UseVisualStyleBackColor = true;
+            this.checkBox_5.CheckedChanged += new System.EventHandler(this.checkBox_5_CheckedChanged);
+            // 
+            // textBox_4
+            // 
+            this.textBox_4.Location = new System.Drawing.Point(82, 235);
+            this.textBox_4.Name = "textBox_4";
+            this.textBox_4.Size = new System.Drawing.Size(82, 21);
+            this.textBox_4.TabIndex = 10;
+            this.textBox_4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_4
+            // 
+            this.checkBox_4.AutoSize = true;
+            this.checkBox_4.Location = new System.Drawing.Point(18, 237);
+            this.checkBox_4.Name = "checkBox_4";
+            this.checkBox_4.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_4.TabIndex = 9;
+            this.checkBox_4.Text = "MAC#4";
+            this.checkBox_4.UseVisualStyleBackColor = true;
+            this.checkBox_4.CheckedChanged += new System.EventHandler(this.checkBox_4_CheckedChanged);
+            // 
+            // textBox_3
+            // 
+            this.textBox_3.Location = new System.Drawing.Point(82, 188);
+            this.textBox_3.Name = "textBox_3";
+            this.textBox_3.Size = new System.Drawing.Size(82, 21);
+            this.textBox_3.TabIndex = 8;
+            this.textBox_3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_3
+            // 
+            this.checkBox_3.AutoSize = true;
+            this.checkBox_3.Location = new System.Drawing.Point(18, 190);
+            this.checkBox_3.Name = "checkBox_3";
+            this.checkBox_3.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_3.TabIndex = 7;
+            this.checkBox_3.Text = "MAC#3";
+            this.checkBox_3.UseVisualStyleBackColor = true;
+            this.checkBox_3.CheckedChanged += new System.EventHandler(this.checkBox_3_CheckedChanged);
+            // 
+            // textBox_2
+            // 
+            this.textBox_2.Location = new System.Drawing.Point(82, 141);
+            this.textBox_2.Name = "textBox_2";
+            this.textBox_2.Size = new System.Drawing.Size(82, 21);
+            this.textBox_2.TabIndex = 6;
+            this.textBox_2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_2
+            // 
+            this.checkBox_2.AutoSize = true;
+            this.checkBox_2.Location = new System.Drawing.Point(18, 143);
+            this.checkBox_2.Name = "checkBox_2";
+            this.checkBox_2.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_2.TabIndex = 5;
+            this.checkBox_2.Text = "MAC#2";
+            this.checkBox_2.UseVisualStyleBackColor = true;
+            this.checkBox_2.CheckedChanged += new System.EventHandler(this.checkBox_2_CheckedChanged);
+            // 
+            // textBox_1
+            // 
+            this.textBox_1.Location = new System.Drawing.Point(82, 95);
+            this.textBox_1.Name = "textBox_1";
+            this.textBox_1.Size = new System.Drawing.Size(82, 21);
+            this.textBox_1.TabIndex = 4;
+            this.textBox_1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_1
+            // 
+            this.checkBox_1.AutoSize = true;
+            this.checkBox_1.Location = new System.Drawing.Point(18, 97);
+            this.checkBox_1.Name = "checkBox_1";
+            this.checkBox_1.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_1.TabIndex = 3;
+            this.checkBox_1.Text = "MAC#1";
+            this.checkBox_1.UseVisualStyleBackColor = true;
+            this.checkBox_1.CheckedChanged += new System.EventHandler(this.checkBox_1_CheckedChanged);
+            // 
+            // textBox_0
+            // 
+            this.textBox_0.Location = new System.Drawing.Point(82, 53);
+            this.textBox_0.Name = "textBox_0";
+            this.textBox_0.Size = new System.Drawing.Size(82, 21);
+            this.textBox_0.TabIndex = 2;
+            this.textBox_0.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // checkBox_0
+            // 
+            this.checkBox_0.AutoSize = true;
+            this.checkBox_0.Location = new System.Drawing.Point(18, 55);
+            this.checkBox_0.Name = "checkBox_0";
+            this.checkBox_0.Size = new System.Drawing.Size(54, 16);
+            this.checkBox_0.TabIndex = 1;
+            this.checkBox_0.Tag = "";
+            this.checkBox_0.Text = "MAC#0";
+            this.checkBox_0.UseVisualStyleBackColor = true;
+            this.checkBox_0.CheckedChanged += new System.EventHandler(this.checkBox_0_CheckedChanged);
+            // 
+            // ConstantsEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(206, 575);
+            this.Controls.Add(this.button_Cancel);
+            this.Controls.Add(this.button_OK);
+            this.Controls.Add(this.groupBox1);
+            this.MaximizeBox = false;
+            this.Name = "ConstantsEditor";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "ConstantsEditor";
+            this.Load += new System.EventHandler(this.ConstantsEditor_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button button_Cancel;
+        private System.Windows.Forms.Button button_OK;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox textBox_9;
+        private System.Windows.Forms.CheckBox checkBox_9;
+        private System.Windows.Forms.TextBox textBox_8;
+        private System.Windows.Forms.CheckBox checkBox_8;
+        private System.Windows.Forms.TextBox textBox_7;
+        private System.Windows.Forms.CheckBox checkBox_7;
+        private System.Windows.Forms.TextBox textBox_6;
+        private System.Windows.Forms.CheckBox checkBox_6;
+        private System.Windows.Forms.TextBox textBox_5;
+        private System.Windows.Forms.CheckBox checkBox_5;
+        private System.Windows.Forms.TextBox textBox_4;
+        private System.Windows.Forms.CheckBox checkBox_4;
+        private System.Windows.Forms.TextBox textBox_3;
+        private System.Windows.Forms.CheckBox checkBox_3;
+        private System.Windows.Forms.TextBox textBox_2;
+        private System.Windows.Forms.CheckBox checkBox_2;
+        private System.Windows.Forms.TextBox textBox_1;
+        private System.Windows.Forms.CheckBox checkBox_1;
+        private System.Windows.Forms.TextBox textBox_0;
+        private System.Windows.Forms.CheckBox checkBox_0;
+    }
+}

+ 297 - 0
OTSPartA_STDEditor/UI/ConstantsEditor.cs

@@ -0,0 +1,297 @@
+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;
+using System.Xml;
+
+namespace OTSPartA_STDEditor
+{
+    public partial class ConstantsEditor : Form
+    {
+        public ConstantsEditor()
+        {
+            InitializeComponent();
+        }
+        void Initialization()
+        {
+            checkBox_0.Checked = false;
+            checkBox_1.Checked = false;
+            checkBox_2.Checked = false;
+            checkBox_3.Checked = false;
+            checkBox_4.Checked = false;
+            checkBox_5.Checked = false;
+            checkBox_6.Checked = false;
+            checkBox_7.Checked = false;
+            checkBox_8.Checked = false;
+            checkBox_9.Checked = false;
+            textBox_0.ReadOnly = true;
+            textBox_1.ReadOnly = true;
+            textBox_2.ReadOnly = true;
+            textBox_3.ReadOnly = true;
+            textBox_4.ReadOnly = true;
+            textBox_5.ReadOnly = true;
+            textBox_6.ReadOnly = true;
+            textBox_7.ReadOnly = true;
+            textBox_8.ReadOnly = true;
+            textBox_9.ReadOnly = true;
+        }
+        private void ConstantsEditor_Load(object sender, EventArgs e)
+        {
+            Initialization();
+
+            XmlDocument doc = new XmlDocument();
+            string Address = "C:\\Users\\someo\\Desktop\\OTSPartA_STDEditor\\OTSPartA_STDEditor\\bin\\Debug\\OTSParticleSTD.xml";
+            doc.Load(Address);
+            XmlNode root = doc.SelectSingleNode("XMLData");
+            XmlNode root2 = root.SelectSingleNode("Member");
+            string ConstantsStr = root2.Attributes["value"].Value;
+            ConstantsStr = ConstantsStr.Replace(" ", "");
+            string[] ConstantsStr2 = ConstantsStr.Split(',');
+            List<string> Constantslist = new List<string>();
+            for (int i = 0; i < ConstantsStr2.Length; i++)
+            {
+                Constantslist.AddRange(ConstantsStr2[i].Split('='));
+            }
+
+            for (int i = 0; i < Constantslist.Count; i += 2)
+            {
+                if (Constantslist[i].Contains("MAC#0"))
+                {
+                    this.checkBox_0.Checked = true;
+                    this.textBox_0.ReadOnly = false;
+                    this.textBox_0.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#1"))
+                {
+                    this.checkBox_1.Checked = true;
+                    this.textBox_1.ReadOnly = false;
+                    this.textBox_1.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#2"))
+                {
+                    this.checkBox_2.Checked = true;
+                    this.textBox_2.ReadOnly = false;
+                    this.textBox_2.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#3"))
+                {
+                    this.checkBox_3.Checked = true;
+                    this.textBox_3.ReadOnly = false;
+                    this.textBox_3.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#4"))
+                {
+                    this.checkBox_4.Checked = true;
+                    this.textBox_4.ReadOnly = false;
+                    this.textBox_4.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#5"))
+                {
+                    this.checkBox_5.Checked = true;
+                    this.textBox_5.ReadOnly = false;
+                    this.textBox_5.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#6"))
+                {
+                    this.checkBox_6.Checked = true;
+                    this.textBox_6.ReadOnly = false;
+                    this.textBox_6.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#7"))
+                {
+                    this.checkBox_7.Checked = true;
+                    this.textBox_7.ReadOnly = false;
+                    this.textBox_7.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#8"))
+                {
+                    this.checkBox_8.Checked = true;
+                    this.textBox_8.ReadOnly = false;
+                    this.textBox_8.Text = Constantslist[i + 1];
+                }
+                else if (Constantslist[i].Contains("MAC#9"))
+                {
+                    this.checkBox_9.Checked = true;
+                    this.textBox_9.ReadOnly = false;
+                    this.textBox_9.Text = Constantslist[i + 1];
+                }
+            }
+
+            //Form1 form1 = (Form1)this.Owner;
+            //this.StartPosition= FormStartPosition.Manual;
+            //this.Location = new Point(form1.Location.X/2, form1.Location.Y/2);
+        }
+
+        private void checkBox_0_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_0.Checked)
+            {
+                textBox_0.ReadOnly = false;
+            }
+            else
+            {
+                textBox_0.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_1_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_1.Checked)
+            {
+                textBox_1.ReadOnly = false;
+            }
+            else
+            {
+                textBox_1.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_2_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_2.Checked)
+            {
+                textBox_2.ReadOnly = false;
+            }
+            else
+            {
+                textBox_2.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_3_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_3.Checked)
+            {
+                textBox_3.ReadOnly = false;
+            }
+            else
+            {
+                textBox_3.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_4_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_4.Checked)
+            {
+                textBox_4.ReadOnly = false;
+            }
+            else
+            {
+                textBox_4.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_5_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_5.Checked)
+            {
+                textBox_5.ReadOnly = false;
+            }
+            else
+            {
+                textBox_5.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_6_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_6.Checked)
+            {
+                textBox_6.ReadOnly = false;
+            }
+            else
+            {
+                textBox_6.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_7_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_7.Checked)
+            {
+                textBox_7.ReadOnly = false;
+            }
+            else
+            {
+                textBox_7.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_8_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_8.Checked)
+            {
+                textBox_8.ReadOnly = false;
+            }
+            else
+            {
+                textBox_8.ReadOnly = true;
+            }
+        }
+
+        private void checkBox_9_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_9.Checked)
+            {
+                textBox_9.ReadOnly = false;
+            }
+            else
+            {
+                textBox_9.ReadOnly = true;
+            }
+        }
+
+        private void button_OK_Click(object sender, EventArgs e)
+        {
+            string value = "";
+            double DoubleTry = 0;
+
+            foreach (Control control in this.groupBox1.Controls)
+            {
+                if (control is CheckBox)
+                {
+                    CheckBox checkBox = (CheckBox)control;
+                    if (checkBox.Checked)
+                    {
+                        TextBox tBox = (TextBox)this.groupBox1.Controls.Find("textBox_" + checkBox.Name.Remove(0, checkBox.Name.Length - 1), true)[0];
+                        if (double.TryParse(tBox.Text, out DoubleTry))
+                        {
+                            value += checkBox.Text + "=" + tBox.Text + ",";
+                        }
+                        else
+                        {
+                            MessageBox.Show("符号" + checkBox.Name + "所对应值输入错误!", "提示");
+                            return;
+                        }
+                    }
+                }
+            }
+
+            if (value != "")
+            {
+                value = value.Substring(0, value.Length - 1);
+            }
+
+            string Address = "C:\\Users\\someo\\Desktop\\OTSPartA_STDEditor\\OTSPartA_STDEditor\\bin\\Debug\\OTSParticleSTD.xml";
+            XmlDocument doc = new XmlDocument();
+            doc.Load(Address);
+            XmlNode root = (XmlElement)doc.SelectSingleNode("XMLData");
+            XmlElement root2 = (XmlElement)root.SelectSingleNode("Member");
+            root2.SetAttribute("value", value);
+            doc.Save(Address);
+
+            this.Close();
+        }
+
+        private void button_Cancel_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+    }
+}

+ 120 - 0
OTSPartA_STDEditor/UI/ConstantsEditor.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>