Browse Source

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

gsp 1 year ago
parent
commit
6a6dc46be6

+ 1 - 1
OTSIncAMeasureApp/1-OTSMeasure/CMeasureThreadWrapper.cs

@@ -254,7 +254,7 @@ namespace OTSMeasureApp
                     }
                     else if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.SUCCESSED)
                     {
-                        //StopMeasure(MSTMsg);
+                        StopMeasure(MSTMsg);
                     }
                     else if(MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.PAUSED)
                     {

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

+ 1 - 1
OTSPartA_STDEditor/UI/Form_ZeroElementRules.cs

@@ -28,7 +28,7 @@ namespace OTSPartA_STDEditor
         {
             InitializeComponent();
             STDDBAddress = DBAddress;
-
+                                                                                                                                                                            
             X = this.Width;
             Y = this.Height;
             setTag(this);

+ 35 - 7
OTSPartA_STDEditor/UI/STDEditor.Designer.cs

@@ -63,6 +63,8 @@
             this.button_PeriodicTableSwitch = new System.Windows.Forms.Button();
             this.comboBox_PeriodicTable = new System.Windows.Forms.ComboBox();
             this.groupBox_OtherCommonlyUsedSymbols = new System.Windows.Forms.GroupBox();
+            this.label_help1 = new System.Windows.Forms.Label();
+            this.label_help2 = new System.Windows.Forms.Label();
             this.comboBox_Constants = new System.Windows.Forms.ComboBox();
             this.label_DefinedConstant = new System.Windows.Forms.Label();
             this.label_Other = new System.Windows.Forms.Label();
@@ -494,7 +496,7 @@
             this.groupBox_ChemicalElement.Controls.Add(this.comboBox_PeriodicTable);
             this.groupBox_ChemicalElement.Location = new System.Drawing.Point(6, 20);
             this.groupBox_ChemicalElement.Name = "groupBox_ChemicalElement";
-            this.groupBox_ChemicalElement.Size = new System.Drawing.Size(172, 115);
+            this.groupBox_ChemicalElement.Size = new System.Drawing.Size(131, 115);
             this.groupBox_ChemicalElement.TabIndex = 5;
             this.groupBox_ChemicalElement.TabStop = false;
             this.groupBox_ChemicalElement.Text = "化学元素";
@@ -503,7 +505,7 @@
             // 
             this.button_PeriodicTableSwitch.Location = new System.Drawing.Point(18, 79);
             this.button_PeriodicTableSwitch.Name = "button_PeriodicTableSwitch";
-            this.button_PeriodicTableSwitch.Size = new System.Drawing.Size(126, 25);
+            this.button_PeriodicTableSwitch.Size = new System.Drawing.Size(96, 25);
             this.button_PeriodicTableSwitch.TabIndex = 33;
             this.button_PeriodicTableSwitch.Text = "PeriodicTable";
             this.button_PeriodicTableSwitch.UseVisualStyleBackColor = true;
@@ -514,13 +516,15 @@
             this.comboBox_PeriodicTable.FormattingEnabled = true;
             this.comboBox_PeriodicTable.Location = new System.Drawing.Point(18, 36);
             this.comboBox_PeriodicTable.Name = "comboBox_PeriodicTable";
-            this.comboBox_PeriodicTable.Size = new System.Drawing.Size(126, 20);
+            this.comboBox_PeriodicTable.Size = new System.Drawing.Size(96, 20);
             this.comboBox_PeriodicTable.TabIndex = 1;
             this.comboBox_PeriodicTable.SelectedIndexChanged += new System.EventHandler(this.comboBox_PeriodicTable_SelectedIndexChanged);
             this.comboBox_PeriodicTable.KeyDown += new System.Windows.Forms.KeyEventHandler(this.comboBox_PeriodicTable_KeyDown);
             // 
             // groupBox_OtherCommonlyUsedSymbols
             // 
+            this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_help1);
+            this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_help2);
             this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.comboBox_Constants);
             this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_DefinedConstant);
             this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_Other);
@@ -529,20 +533,42 @@
             this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.comboBox_Elem1);
             this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.comboBox_Elem);
             this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.comboBox_ImgProperty);
-            this.groupBox_OtherCommonlyUsedSymbols.Location = new System.Drawing.Point(184, 20);
+            this.groupBox_OtherCommonlyUsedSymbols.Location = new System.Drawing.Point(143, 20);
             this.groupBox_OtherCommonlyUsedSymbols.Name = "groupBox_OtherCommonlyUsedSymbols";
-            this.groupBox_OtherCommonlyUsedSymbols.Size = new System.Drawing.Size(502, 115);
+            this.groupBox_OtherCommonlyUsedSymbols.Size = new System.Drawing.Size(543, 115);
             this.groupBox_OtherCommonlyUsedSymbols.TabIndex = 3;
             this.groupBox_OtherCommonlyUsedSymbols.TabStop = false;
             this.groupBox_OtherCommonlyUsedSymbols.Text = "其它常用符号";
             // 
+            // label_help1
+            // 
+            this.label_help1.AutoSize = true;
+            this.label_help1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label_help1.Location = new System.Drawing.Point(242, 26);
+            this.label_help1.Name = "label_help1";
+            this.label_help1.Size = new System.Drawing.Size(19, 19);
+            this.label_help1.TabIndex = 21;
+            this.label_help1.Text = "?";
+            this.label_help1.MouseHover += new System.EventHandler(this.label_help1label2_MouseHover);
+            // 
+            // label_help2
+            // 
+            this.label_help2.AutoSize = true;
+            this.label_help2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label_help2.Location = new System.Drawing.Point(523, 25);
+            this.label_help2.Name = "label_help2";
+            this.label_help2.Size = new System.Drawing.Size(19, 19);
+            this.label_help2.TabIndex = 20;
+            this.label_help2.Text = "?";
+            this.label_help2.MouseHover += new System.EventHandler(this.label_help2_MouseHover);
+            // 
             // comboBox_Constants
             // 
             this.comboBox_Constants.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.comboBox_Constants.FormattingEnabled = true;
             this.comboBox_Constants.Location = new System.Drawing.Point(372, 72);
             this.comboBox_Constants.Name = "comboBox_Constants";
-            this.comboBox_Constants.Size = new System.Drawing.Size(122, 20);
+            this.comboBox_Constants.Size = new System.Drawing.Size(165, 20);
             this.comboBox_Constants.TabIndex = 5;
             this.comboBox_Constants.SelectedIndexChanged += new System.EventHandler(this.comboBox_Constants_SelectedIndexChanged);
             // 
@@ -608,7 +634,7 @@
             this.comboBox_ImgProperty.FormattingEnabled = true;
             this.comboBox_ImgProperty.Location = new System.Drawing.Point(372, 25);
             this.comboBox_ImgProperty.Name = "comboBox_ImgProperty";
-            this.comboBox_ImgProperty.Size = new System.Drawing.Size(124, 20);
+            this.comboBox_ImgProperty.Size = new System.Drawing.Size(148, 20);
             this.comboBox_ImgProperty.TabIndex = 4;
             this.comboBox_ImgProperty.SelectedIndexChanged += new System.EventHandler(this.comboBox_ImgProperty_SelectedIndexChanged);
             // 
@@ -689,5 +715,7 @@
         private System.Windows.Forms.Button button_PeriodicTableSwitch;
         private System.Windows.Forms.Button button_del;
         private System.Windows.Forms.HelpProvider helpProvider1;
+        private System.Windows.Forms.Label label_help2;
+        private System.Windows.Forms.Label label_help1;
     }
 }

+ 43 - 10
OTSPartA_STDEditor/UI/STDEditor.cs

@@ -773,16 +773,6 @@ namespace OTSPartA_STDEditor
             dataGridView_KeyElements.ClearSelection();
             dataGridView_SubElements.ClearSelection();
         }
-
-        public void ShowTabXray()
-        {
-            tabSTDStandrad.SelectedIndex = 1;
-        }
-        public void ShowSTD()
-        {
-            tabSTDStandrad.SelectedIndex = 0;
-        }
-
         private void button_del_Click(object sender, EventArgs e)
         {
             if (!string.IsNullOrEmpty(textbox_STDEditor.Text))
@@ -799,5 +789,48 @@ namespace OTSPartA_STDEditor
             textbox_STDEditor.Focus();
             textbox_STDEditor.SelectionStart = textbox_STDEditor.Text.Length;
         }
+        private void label_help2_MouseHover(object sender, EventArgs e)
+        {
+            // 创建the ToolTip 
+            ToolTip toolTip1 = new ToolTip();
+
+            // 设置显示样式
+            toolTip1.AutoPopDelay = 7000;//提示信息的可见时间
+            toolTip1.InitialDelay = 500;//事件触发多久后出现提示
+            toolTip1.ReshowDelay = 500;//指针从一个控件移向另一个控件时,经过多久才会显示下一个提示框
+            toolTip1.ShowAlways = true;//是否显示提示框
+            string str = "Dmax:颗粒最大卡规直径\n"+
+                          "Dmin: 颗粒最小卡规直径\n" +
+                          "Aspect:颗粒长宽比\n" +
+                          "Dperp:与Dmax垂直的对应直径\n"+
+                          "Dmean:平均内接圆直径\n"+
+                          "Area:面积\n"+
+                          "Dferet:费雷特直径\n"+
+                          "Width:宽度(直上直下那种)\n"+
+                          "Height:高度(直上直下那种)\n"+
+                          "Perimeter:周长\n"+
+                          "Dinscr:最大内接圆直径\n"+
+                          "Orientation:朝向角度\n"+
+                          "Delong:展开长度(以最小卡规直径为宽)\n" +
+                          "Aspectelong:展开后长宽比\n"+
+                          "Dequalcircle:等效圆直径\n"+
+                          "Vedio:BSE灰度平均值";
+            //  设置伴随的对象.
+            toolTip1.SetToolTip(this.label_help2, str);
+        }
+        private void label_help1label2_MouseHover(object sender, EventArgs e)
+        {
+            // 创建the ToolTip 
+            ToolTip toolTip1 = new ToolTip();
+
+            // 设置显示样式
+            toolTip1.AutoPopDelay = 7000;//提示信息的可见时间
+            toolTip1.InitialDelay = 500;//事件触发多久后出现提示
+            toolTip1.ReshowDelay = 500;//指针从一个控件移向另一个控件时,经过多久才会显示下一个提示框
+            toolTip1.ShowAlways = true;//是否显示提示框
+            string str = "first_elem/Element#1:颗粒元素分析结果中最大占比的元素";
+            //  设置伴随的对象.
+            toolTip1.SetToolTip(this.label_help1, str);
+        }
     }
 }