Browse Source

编辑器删除xray相关codes

cxs 1 year ago
parent
commit
097ef8971e

+ 0 - 167
OTSPartA_STDEditor/EDSController.cs

@@ -1,167 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Xml;
-using FEIApiControl;
-using OTSCLRINTERFACE;
-
-namespace OTSPartA_STDEditor
-{
-    class EDSController
-    {
-        private COTSControlFunExport eds;
-        static EDSController edsctrl = null;
-        public static APIClass ApiClass = null;
-        private static bool isFEI = false;
-
-        private EDSController()
-        {
-            if (isFEI)
-            {
-                ApiClass = new APIClass();
-                Connect();
-            }
-            else
-            {
-                eds = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance("Bruker");
-            }
-        }
-
-        public static EDSController GetEDSController()
-        {
-            if (GetXMLInformations("EDSName") == "FEI")
-            {
-                isFEI = true;
-            }
-            if (edsctrl == null)
-            {
-                edsctrl = new EDSController();
-            }
-            return edsctrl;
-        }
-
-        public bool Connect()
-        {
-            if (isFEI)
-            {
-                string FEIIP =GetXMLInformations("FEIIP");
-                string FEIPORT = GetXMLInformations("FEIPORT");
-                if (FEIIP == "" || FEIPORT == "")
-                {
-                    MessageBox.Show("FEI电镜端口配置为空!");
-                    return false;
-                }
-
-                if (ApiClass.isConnect())
-                {
-                    return true;
-                }
-
-                return ApiClass.Connect(FEIIP, FEIPORT);
-            }
-            else
-            {
-                if (!eds.Init())
-                {
-                    return false;
-                }
-                if (eds.IsConnected())
-                {
-                    return true;
-                }
-
-                return eds.ConncetSem();
-            }
-        }
-
-        /// <summary>
-        /// 获取XML节点参数
-        /// </summary>
-        /// <param name="Name">节点参数名称</param>
-        /// <returns>节点参数</returns>
-        public static string GetXMLInformations(string Name)
-        {
-            try
-            {
-                string xmlFilePath = "Config/ProData/HardwareConfig.xml";
-
-                string value = string.Empty;
-                XmlDocument doc = new XmlDocument();
-
-                doc.Load(xmlFilePath);    //加载Xml文件  
-
-                XmlElement root = doc.DocumentElement;   //获取根节点  
-
-                XmlNodeList mainNodes = root.GetElementsByTagName("Member"); //获取子节点集合  
-
-                foreach (XmlNode node in mainNodes)
-                {
-                    //获取Name属性值
-                    string name = ((XmlElement)node).GetAttribute("RegName");
-                    if (name.Equals(Name))
-                    {
-                        value = ((XmlElement)node).GetAttribute("Value");
-                        break;
-                    }
-                }
-                return value;
-            }
-            catch (Exception)
-            {
-                return "";
-            }
-        }
-
-        public bool Init()
-        {
-            if (isFEI)
-            {
-                return ApiClass.isConnect();
-            }
-            else
-            {
-                bool m_init = eds.EDSInit();
-                return m_init;
-            }
-        }
-
-        public bool CollectSpectrum(uint a_nXRayAQTime, ref uint[] a_XrayData)
-        {
-            if (isFEI)
-            {
-                Dictionary<string, double> eleItems = new Dictionary<string, double>();
-
-                return ApiClass.AcquireSpectrum(false, ref eleItems, ref a_XrayData);
-            }
-            else
-            {
-                if (!eds.IsConnected())
-                {
-                    return false;
-                }
-
-                return eds.CollectSpectrum(a_nXRayAQTime, ref a_XrayData);
-            }
-        }
-
-        public bool DisConnect()
-        {
-            if (isFEI)
-            {
-                return ApiClass.DisConnect();
-            }
-            else
-            {
-                if (eds.IsConnected())
-                {
-                    return eds.DisconnectSem();
-                }
-
-                return true;
-            }
-        }
-    }
-}

+ 1 - 58
OTSPartA_STDEditor/Form_Main.Designer.cs

@@ -57,9 +57,6 @@
             this.ribbon_ZeroRules = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbon_UserConstants = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbon_GroupNameMaintenance = new System.Windows.Forms.RibbonOrbMenuItem();
-            this.ribbon_BulkImport = new System.Windows.Forms.RibbonOrbMenuItem();
-            this.ribbon_ConvertOreDatabaseToOtsDatabase = new System.Windows.Forms.RibbonOrbMenuItem();
-            this.rbMatchescorrespondingelement = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbonSeparator3 = new System.Windows.Forms.RibbonSeparator();
             this.ribbon_Exit = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbonTab2 = new System.Windows.Forms.RibbonTab();
@@ -182,13 +179,10 @@
             this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbon_ZeroRules);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbon_UserConstants);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbon_GroupNameMaintenance);
-            this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbon_BulkImport);
-            this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbon_ConvertOreDatabaseToOtsDatabase);
-            this.ribbon1.OrbDropDown.MenuItems.Add(this.rbMatchescorrespondingelement);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbonSeparator3);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbon_Exit);
             this.ribbon1.OrbDropDown.Name = "";
-            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 427);
+            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 295);
             this.ribbon1.OrbDropDown.TabIndex = 0;
             this.ribbon1.OrbImage = global::OTSPartA_STDEditor.Properties.Resources.公司图标;
             // 
@@ -271,54 +265,6 @@
             this.ribbon_GroupNameMaintenance.ToolTipTitle = null;
             this.ribbon_GroupNameMaintenance.Click += new System.EventHandler(this.ribbon_GroupNameMaintenance_Click);
             // 
-            // ribbon_BulkImport
-            // 
-            this.ribbon_BulkImport.AltKey = null;
-            this.ribbon_BulkImport.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
-            this.ribbon_BulkImport.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.ribbon_BulkImport.Enabled = false;
-            this.ribbon_BulkImport.Image = global::OTSPartA_STDEditor.Properties.Resources.worddocument32;
-            this.ribbon_BulkImport.SmallImage = global::OTSPartA_STDEditor.Properties.Resources.worddocument32;
-            this.ribbon_BulkImport.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.ribbon_BulkImport.Tag = "ribbon_BulkImport";
-            this.ribbon_BulkImport.Text = "批量导入X-ray";
-            this.ribbon_BulkImport.ToolTip = null;
-            this.ribbon_BulkImport.ToolTipImage = null;
-            this.ribbon_BulkImport.ToolTipTitle = null;
-            this.ribbon_BulkImport.Click += new System.EventHandler(this.ribbon_BulkImport_Click);
-            // 
-            // ribbon_ConvertOreDatabaseToOtsDatabase
-            // 
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.AltKey = null;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.Enabled = false;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.Image = global::OTSPartA_STDEditor.Properties.Resources.worddocument32;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.SmallImage = global::OTSPartA_STDEditor.Properties.Resources.worddocument32;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.Tag = "ribbon_ConvertOreDatabaseToOtsDatabase";
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.Text = "矿石数据库转换为ots数据库工具";
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.ToolTip = null;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.ToolTipImage = null;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.ToolTipTitle = null;
-            this.ribbon_ConvertOreDatabaseToOtsDatabase.Click += new System.EventHandler(this.ribbon_ConvertOreDatabaseToOtsDatabase_Click);
-            // 
-            // rbMatchescorrespondingelement
-            // 
-            this.rbMatchescorrespondingelement.AltKey = null;
-            this.rbMatchescorrespondingelement.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
-            this.rbMatchescorrespondingelement.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.rbMatchescorrespondingelement.Enabled = false;
-            this.rbMatchescorrespondingelement.Image = global::OTSPartA_STDEditor.Properties.Resources.Ruler161;
-            this.rbMatchescorrespondingelement.SmallImage = global::OTSPartA_STDEditor.Properties.Resources.Ruler161;
-            this.rbMatchescorrespondingelement.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.rbMatchescorrespondingelement.Tag = "rbMatchescorrespondingelement";
-            this.rbMatchescorrespondingelement.Text = "从矿物数据库中搜索元素信息并移植到新库";
-            this.rbMatchescorrespondingelement.ToolTip = null;
-            this.rbMatchescorrespondingelement.ToolTipImage = null;
-            this.rbMatchescorrespondingelement.ToolTipTitle = null;
-            this.rbMatchescorrespondingelement.Click += new System.EventHandler(this.rbMatchescorrespondingelement_Click);
-            // 
             // ribbonSeparator3
             // 
             this.ribbonSeparator3.AltKey = null;
@@ -708,10 +654,7 @@
         public OTS.WinFormsUI.Docking.DockPanel dockPanel1;
         private System.Windows.Forms.RibbonOrbMenuItem ribbon_UserConstants;
         private System.Windows.Forms.RibbonOrbMenuItem ribbon_GroupNameMaintenance;
-        private System.Windows.Forms.RibbonOrbMenuItem ribbon_BulkImport;
-        private System.Windows.Forms.RibbonOrbMenuItem ribbon_ConvertOreDatabaseToOtsDatabase;
         private System.Windows.Forms.RibbonSeparator ribbonSeparator3;
         private System.Windows.Forms.RibbonOrbMenuItem ribbon_Exit;
-        private System.Windows.Forms.RibbonOrbMenuItem rbMatchescorrespondingelement;
     }
 }

+ 206 - 535
OTSPartA_STDEditor/Form_Main.cs

@@ -37,6 +37,7 @@ namespace OTSPartA_STDEditor
 
         //是否做出过更改
         public bool IsModified { set; get; }
+        public bool Isoldversion { set; get; }
 
         public Form_Main()
         {
@@ -74,36 +75,7 @@ namespace OTSPartA_STDEditor
                 {
                     ImportStandardLibraryTypeSelection m_importStandardLibraryTypeSelection = new ImportStandardLibraryTypeSelection();
                     var result = m_importStandardLibraryTypeSelection.ShowDialog();
-                    if (m_importStandardLibraryTypeSelection.SelectEvent == "xray")
-                    {
-                        System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + ImportArgs[1] + "'");
-                        m_dbConnection.Open();
-
-                        string sqlp = @"select xraydata from xraydata where fieldid=" + ImportArgs[2] + " and xrayindex=" + ImportArgs[4];
-                        System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter(sqlp, m_dbConnection);
-                        DataSet ds = new DataSet();
-                        m_dataAdapter.Fill(ds);
-                        DataTable dt = ds.Tables[0];
-                        if (dt.Rows.Count > 0)
-                        {
-                            int STDId = AddSTDDictionaryItem();
-                            if (dt != null)
-                            {
-                                if (dt.Rows.Count > 0)
-                                {
-                                    STDEditor.STDXray tDXray = new STDEditor.STDXray();
-                                    tDXray.StdID = STDId.ToString();
-                                    tDXray.XrayData = (byte[])dt.Rows[0]["XrayData"];
-                                    tDXray.InfoState = (int)STDEditor.STDXrayInfoState.Add;
-                                    m_SubMidWindow.m_STDEditor.m_STDXrayList.Add(tDXray);
-                                    m_STDRuleslist.AddNewRow(STDId, "NewClassify", Color.Gray);
-                                    m_SubMidWindow.m_STDEditor.ShowTabXray();
-                                }
-                            }
-                        }
-                        m_dbConnection.Close();
-                    }
-                    else if (m_importStandardLibraryTypeSelection.SelectEvent == "expression")
+                    if (m_importStandardLibraryTypeSelection.SelectEvent == "expression")
                     {
                         int STDId = AddSTDDictionaryItem();
                         m_STDRuleslist.AddNewRow(STDId, "NewClassify", Color.Gray);
@@ -173,9 +145,9 @@ namespace OTSPartA_STDEditor
                             new_STDdata.GroupId = item["GroupId"].ToString();
                             new_STDdata.ListNum= item["ListNum"].ToString();
                             new_STDdata.GroupId = item["GroupId"].ToString();
-                            if(item.ItemArray.Contains("IfElementAnalysis"))
+                            if(dt.Columns.Contains("IfElementAnalysis"))
                             {
-                                if ((bool)item["IfElementAnalysis"])
+                                if (Convert.ToBoolean(item["IfElementAnalysis"]))
                                 {
                                     new_STDdata.IfElementAnalysis = true;
                                 }
@@ -184,10 +156,19 @@ namespace OTSPartA_STDEditor
                                     new_STDdata.IfElementAnalysis = false;
                                 }
                             }
-
-
                             STDDictionary.Add(int.Parse(item["STDId"].ToString()), new_STDdata);
                         }
+                        if ((dt.Columns.Contains("IfElementAnalysis")))
+                        {
+                            rbSave.Enabled = true;
+                            Isoldversion = false;
+                        }
+                        else
+                        {
+                            MessageBox.Show("该标准库为旧版本,只能进行另存操作!", "注意");
+                            rbSave.Enabled = false;
+                            Isoldversion = true;
+                        }
                     }
                 }
                 return true;
@@ -202,7 +183,6 @@ namespace OTSPartA_STDEditor
         public void ChangeSTDEditorAndGrid_Attributes(int STDId)
         {
             m_SubMidWindow.ChangeText_textbox_STDEditor(STDId);
-            m_SubMidWindow.SelSTDXray(STDId, STDDictionary[STDId]);
             m_Attributes.SetDatatoGrid_Attributes(STDId);
         }
 
@@ -210,8 +190,6 @@ namespace OTSPartA_STDEditor
         {
             if (m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row >= 0)
             {
-                //if (m_STDRuleslist.Grid_Minerals[m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0].Value.ToString().Replace(" ", "").Trim() != "")
-                //{
                 if (CheckAttributes())
                 {
                     if (Checktextbox_STDEditor())
@@ -229,13 +207,9 @@ namespace OTSPartA_STDEditor
                             if (saveFile.ShowDialog() == DialogResult.OK)
                             {
                                 System.IO.File.Copy(STDDBAddress, saveFile.FileName, true);
-                                bool result = SaveDictionaryToClassify(saveFile.FileName);
+                                bool result = SaveAsDictionaryToClassify(saveFile.FileName);
                                 STDDBAddress = saveFile.FileName;
                                 this.Text = this.Text.Split(' ')[0] + "   " + saveFile.FileName;
-                                //if (result)
-                                //{
-                                //    MessageBox.Show("Export file successful!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                                //}
                             }
                             else
                             {
@@ -247,7 +221,6 @@ namespace OTSPartA_STDEditor
                             MessageBox.Show(ex.Message);
                         }
                     }
-                    //}
                 }
                 else
                 {
@@ -304,11 +277,6 @@ namespace OTSPartA_STDEditor
             }
         }
 
-        private void rbRecover_Click(object sender, EventArgs e)
-        {
-
-        }
-
         object Clone(Dictionary<int, STDdata> STDDictionary)
         {
             Dictionary<int, STDdata> STDDictionaryInitial = new Dictionary<int, STDdata>();
@@ -336,16 +304,13 @@ namespace OTSPartA_STDEditor
                                 FormForWaiting forWaiting = new FormForWaiting();
                                 forWaiting.Show();
                                 SaveDataOfSelRule(m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0);
-                                // SaveXmlTreeDataToXml(Address);
                                 bool result = SaveDictionaryToClassify(STDDBAddress);
                                 if (result)
                                 {
-                                    m_SubMidWindow.m_STDEditor.SaveSTDXray();
                                     STDDictionaryInitial.Clear();
                                     STDDictionaryInitial = Clone(STDDictionary) as Dictionary<int, STDdata>;
                                     forWaiting.Close();
                                     IsModified = false;
-                                    //MessageBox.Show("Save successful!", "Tip");
                                 }
                                 else
                                 {
@@ -369,11 +334,9 @@ namespace OTSPartA_STDEditor
                                 FormForWaiting forWaiting = new FormForWaiting();
                                 forWaiting.Show();
                                 SaveDataOfSelRule(m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0);
-                                //SaveXmlTreeDataToXml(Address);
                                 bool result = SaveDictionaryToClassify(STDDBAddress);
                                 if (result)
                                 {
-                                    m_SubMidWindow.m_STDEditor.SaveSTDXray();
                                     STDDictionaryInitial.Clear();
                                     STDDictionaryInitial = new Dictionary<int, STDdata>(STDDictionary);
                                     forWaiting.Close();
@@ -544,15 +507,6 @@ namespace OTSPartA_STDEditor
                     return false;
                 }
             }
-            else
-            {
-                var XrayInfo = m_SubMidWindow.m_STDEditor.m_STDXrayList.Find(STDXray => STDXray.StdID == m_STDRuleslist.Grid_Minerals[m_STDRuleslist.PreRow, 0].Tag.ToString());
-                if (XrayInfo==null||XrayInfo.XrayData==null)
-                {
-                    MessageBox.Show("Expressions cannot be empty!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    return false;
-                }
-            }
             return true;
         }
 
@@ -818,7 +772,6 @@ namespace OTSPartA_STDEditor
                     newRow["STDId"] = kv.Key;
                     newRow["StrName"] = kv.Value.StrName;
                     newRow["Color"] = kv.Value.Color;
-                    newRow["IfElementAnalysis"] = kv.Value.IfElementAnalysis;
                     newRow["KeyElementList"] = kv.Value.KeyElementList;
                     newRow["SubElementList"] = kv.Value.SubElementList;
                     newRow["UsingImgPropertyList"] = UsingImgPropertyList;
@@ -830,6 +783,7 @@ namespace OTSPartA_STDEditor
                     newRow["BSE"] = int.Parse(kv.Value.BSE);
                     newRow["Formula"] = kv.Value.Formula;
                     newRow["Element"] = kv.Value.Element;
+                    newRow["IfElementAnalysis"] = kv.Value.IfElementAnalysis;
                     newRow["GroupId"] = int.Parse(kv.Value.GroupId);
                     newRow["ListNum"] = kv.Value.ListNum;
                     dt.Rows.Add(newRow);
@@ -845,6 +799,157 @@ namespace OTSPartA_STDEditor
             return true;
         }
 
+        bool SaveAsDictionaryToClassify(string DBAddress)
+        {
+            //保存列表顺序
+            for (int i = 1; i < m_STDRuleslist.Grid_Minerals.RowsCount; i++)
+            {
+                STDDictionary[(int)m_STDRuleslist.Grid_Minerals[i, 0].Tag].ListNum = i.ToString();
+            }
+            try
+            {
+                System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + DBAddress + "'");
+                m_dbConnection.Open();
+
+                System.Data.SQLite.SQLiteCommand cmm = m_dbConnection.CreateCommand();
+                cmm.CommandText = "drop table ClassifySTD";
+                cmm.ExecuteNonQuery();
+
+                cmm.CommandText = "CREATE TABLE ClassifySTD (STDId INTEGER,StrName TEXT, Color TEXT,KeyElementList TEXT,SubElementList TEXT,UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT,Hardness TEXT,Density TEXT,Electrical_conductivity TEXT,BSE INTEGER,Formula TEXT,Element TEXT,IfElementAnalysis BOOLEAN,ListNum INT,GroupId INT)";
+                cmm.ExecuteNonQuery();
+
+                System.Data.Common.DbTransaction trans = m_dbConnection.BeginTransaction();
+                trans.Commit();
+
+                System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from ClassifySTD", m_dbConnection);
+                System.Data.SQLite.SQLiteCommandBuilder qLiteCommandBuilder = new System.Data.SQLite.SQLiteCommandBuilder(m_dataAdapter);
+
+                DataSet ds = new DataSet();
+                m_dataAdapter.Fill(ds, "ClassifySTD");
+                DataTable dt = ds.Tables["ClassifySTD"];
+
+                foreach (KeyValuePair<int, STDdata> kv in STDDictionary)
+                {
+                    string UsingElementList = "";
+                    string UsingImgPropertyList = "";
+                    string UsingOtherPropertyList = "";
+                    List<string> UsingElementL = new List<string>();
+                    List<string> UsingImgPropertyL = new List<string>();
+                    List<string> UsingOtherPropertyL = new List<string>();
+
+                    string str_RemoveBlank = kv.Value.Expression;
+                    //forth_elem干扰or分隔符,故先行去掉
+                    if (str_RemoveBlank.Contains("forth_elem"))
+                    {
+                        str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
+                        UsingOtherPropertyList = "forth_elem,";
+                    }
+
+                    str_RemoveBlank = str_RemoveBlank.Replace(" ", "");
+                    string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
+                    List<string> str_Removeandor = new List<string>();
+                    for (int i = 0; i < str_Removeand.Length; i++)
+                    {
+                        str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
+                    }
+                    List<string> list_all = new List<string>();
+                    for (int i = 0; i < str_Removeandor.Count; i++)
+                    {
+                        list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
+                    }
+                    for (int i = 0; i < list_all.Count; i++)
+                    {
+                        //周期元素?
+                        if (m_SubMidWindow.m_STDEditor.comboBox_PeriodicTable.Items.Contains(list_all[i]))
+                        {
+                            if (!UsingElementL.Contains(list_all[i]))
+                            {
+                                UsingElementL.Add(list_all[i]);
+                            }
+                        }
+                        //first_elem?
+                        if (m_SubMidWindow.m_STDEditor.comboBox_Elem1.Items.Contains(list_all[i]))
+                        {
+                            if (!UsingOtherPropertyL.Contains(list_all[i]))
+                            {
+                                UsingOtherPropertyL.Add(list_all[i]);
+                            }
+                        }
+                        //Element1?
+                        if (m_SubMidWindow.m_STDEditor.comboBox_Elem.Items.Contains(list_all[i]))
+                        {
+                            if (!UsingOtherPropertyL.Contains(list_all[i]))
+                            {
+                                UsingOtherPropertyL.Add(list_all[i]);
+                            }
+                        }
+                        //其它元素?
+                        if (m_SubMidWindow.m_STDEditor.comboBox_ImgProperty.Items.Contains(list_all[i]))
+                        {
+                            if (!UsingImgPropertyL.Contains(list_all[i]))
+                            {
+                                UsingImgPropertyL.Add(list_all[i]);
+                            }
+                        }
+                    }
+                    if (UsingElementL.Count > 0)
+                    {
+                        for (int i = 0; i < UsingElementL.Count - 1; i++)
+                        {
+                            UsingElementList += UsingElementL[i] + ",";
+                        }
+                        UsingElementList += UsingElementL[UsingElementL.Count - 1];
+                    }
+
+                    if (UsingImgPropertyL.Count > 0)
+                    {
+                        for (int i = 0; i < UsingImgPropertyL.Count - 1; i++)
+                        {
+                            UsingImgPropertyList += UsingImgPropertyL[i] + ",";
+                        }
+                        UsingImgPropertyList += UsingImgPropertyL[UsingImgPropertyL.Count - 1];
+                    }
+
+                    if (UsingOtherPropertyL.Count > 0)
+                    {
+                        for (int i = 0; i < UsingOtherPropertyL.Count - 1; i++)
+                        {
+                            UsingOtherPropertyList += UsingOtherPropertyL[i] + ",";
+                        }
+                        UsingOtherPropertyList += UsingOtherPropertyL[UsingOtherPropertyL.Count - 1];
+                    }
+
+                    DataRow newRow = dt.NewRow();
+                    newRow["STDId"] = kv.Key;
+                    newRow["StrName"] = kv.Value.StrName;
+                    newRow["Color"] = kv.Value.Color;
+                    newRow["KeyElementList"] = kv.Value.KeyElementList;
+                    newRow["SubElementList"] = kv.Value.SubElementList;
+                    newRow["UsingImgPropertyList"] = UsingImgPropertyList;
+                    newRow["UsingOtherPropertyList"] = UsingOtherPropertyList;
+                    newRow["Expression"] = kv.Value.Expression;
+                    newRow["Hardness"] = kv.Value.Hardness;
+                    newRow["Density"] = kv.Value.Density;
+                    newRow["Electrical_conductivity"] = kv.Value.Electrical_conductivity;
+                    newRow["BSE"] = int.Parse(kv.Value.BSE);
+                    newRow["Formula"] = kv.Value.Formula;
+                    newRow["Element"] = kv.Value.Element;
+                    newRow["IfElementAnalysis"] = kv.Value.IfElementAnalysis;
+                    newRow["GroupId"] = int.Parse(kv.Value.GroupId);
+                    newRow["ListNum"] = kv.Value.ListNum;
+                    dt.Rows.Add(newRow);
+                }
+                m_dataAdapter.Update(ds, "ClassifySTD");
+                m_dbConnection.Close();
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.ToString());
+                return false;
+            }
+            return true;
+        }
+
         public int AddSTDDictionaryItem()
         {
             STDdata new_STDdata = new STDdata();//定义一个TreeNode节点对象
@@ -891,10 +996,6 @@ namespace OTSPartA_STDEditor
         public void ChangeSTDRulesLISTBackColor()
         {
             int stdid=m_STDRuleslist.ChangeSTDRulesLISTBackColor();
-            if (stdid != -1)
-            {
-                m_SubMidWindow.m_STDEditor.SelSTDXray(stdid, STDDictionary[stdid]);
-            }
         }
         public void ChangeSTDRuleName(String RuleName)
         {
@@ -1018,14 +1119,14 @@ namespace OTSPartA_STDEditor
         private void ribbon_GroupNameMaintenance_Click(object sender, EventArgs e)
         {
             //STDDictionary[int.Parse(m_STDRuleslist.Grid_Minerals[m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0].Tag.ToString())].GroupId = GroupIdDictionaryFromName[m_Attributes.Grid_Attributes[10, 1].Value.ToString()].ToString();
-            int selGroupId = GroupIdDictionaryFromName[m_Attributes.Grid_Attributes[10, 1].Value.ToString()];
+            int selGroupId = GroupIdDictionaryFromName[m_Attributes.Grid_Attributes[11, 1].Value.ToString()];
             Form_GroupId form_GroupId = new Form_GroupId(STDDBAddress,this);
             DialogResult dialogResult = form_GroupId.ShowDialog();
             if (dialogResult == DialogResult.Yes)
             {
                 AddSTDGroupsToAttribute();
                 //SetNonexistentGroupsToDefault();
-                m_Attributes.Grid_Attributes[10, 1].Value = GroupIdDictionaryFromId[selGroupId];
+                m_Attributes.Grid_Attributes[11, 1].Value = GroupIdDictionaryFromId[selGroupId];
             }
         }
 
@@ -1034,268 +1135,45 @@ namespace OTSPartA_STDEditor
             this.Close();
         }
 
-
-        #region XML文档部分代码
-        //string Address = Application.StartupPath + "\\Config\\SysData\\OTSParticleSTD.xml";
-        //string Address_backup = Application.StartupPath + "\\Config\\SysData\\OTSParticleSTD_backup.xml";
-        //private void Form_ConstantsEditor2_Load(object sender, EventArgs e)
-        //{
-        //    //XmlDocument doc = new XmlDocument();
-        //    //doc.Load(Address);
-        //    //doc.Load(Address_backup);
-        //    //LoadXmlToDictionary(doc, ref STDDictionary);
-        //}
-        //private void rbRecover_Click(object sender, EventArgs e)
-        //{
-        //    try
-        //    {
-
-        //        //System.IO.File.Copy(Address_backup, Address, true);
-        //        //XmlDocument doc = new XmlDocument();
-        //        //doc.Load(Address);
-        //        //LoadXmlToDictionary(doc, ref STDDictionary);
-        //    }
-        //}
-        //void LoadXmlToDictionary(XmlDocument xml, ref Dictionary<int, STDdata> STDDictionary)
-        //{
-        //    XmlNode root = xml.SelectSingleNode("XMLData");
-        //    XmlNodeList root2 = root.SelectNodes("Collection");
-
-        //    for (int j = 0; j < root2.Count; j++)
-        //    {
-        //        if (root2[j].Attributes["RegName"].Value.ToString() == "STDList")
-        //        {
-        //            XmlNodeList childlist = root2[j].ChildNodes;
-
-        //            for (int i = 0; i < childlist.Count; i++)
-        //            {
-
-        //                //BSE、化学式、元素
-        //                string strBseValue = string.Empty;
-        //                string strFormula = string.Empty;
-        //                string strElement = string.Empty;
-        //                if (childlist[i].Attributes["BSE"] != null)
-        //                {
-        //                    strBseValue = childlist[i].Attributes["BSE"].Value;
-        //                }
-        //                if (childlist[i].Attributes["Formula"] != null)
-        //                {
-        //                    strFormula = childlist[i].Attributes["Formula"].Value;
-        //                }
-        //                if (childlist[i].Attributes["Element"] != null)
-        //                {
-        //                    strElement = childlist[i].Attributes["Element"].Value;
-        //                }
-
-
-        //                STDdata new_STDdata = new STDdata();//定义一个TreeNode节点对象
-        //                new_STDdata.Hardness = childlist[i].Attributes["Hardness"].Value;
-        //                new_STDdata.Density = childlist[i].Attributes["Density"].Value;
-        //                new_STDdata.Electrical_conductivity = childlist[i].Attributes["Electrical_conductivity"].Value;
-        //                new_STDdata.BSE = strBseValue;
-        //                new_STDdata.Formula = strFormula;
-        //                new_STDdata.Element = strElement;
-        //                new_STDdata.StrName = childlist[i].Attributes["StrName"].Value;
-        //                new_STDdata.Expression = childlist[i].Attributes["Expression"].Value;
-        //                new_STDdata.STDId = childlist[i].Attributes["STDId"].Value;
-        //                new_STDdata.Color = childlist[i].Attributes["Color"].Value;
-        //                new_STDdata.KeyElementList = childlist[i].Attributes["KeyElementList"].Value;
-        //                new_STDdata.SubElementList = childlist[i].Attributes["SubElementList"].Value;
-
-
-
-        //                STDDictionary.Add(int.Parse(childlist[i].Attributes["STDId"].Value), new_STDdata);
-        //            }
-        //        }
-        //    }
-
-        //    XmlNode root3 = root.SelectSingleNode("Member");
-        //    string ConstantsStr = root3.Attributes["value"].Value;
-        //    ConstantsStr = ConstantsStr.Replace(" ", "");
-        //    string[] ConstantsStr2 = ConstantsStr.Split(',');
-        //    m_SubMidWindow.m_STDEditor.comboBox_Constants.Items.Clear();
-        //    m_SubMidWindow.m_STDEditor.comboBox_Constants.Items.AddRange(ConstantsStr2);
-        //}
-
-        ////保存xmltree内容到xml文件
-        //void SaveXmlTreeDataToXml(string Address)
-        //{
-        //    #region text
-        //    //XElement xele = XElement.Load(Address);
-        //    //var item = (from ele1 in xele.Elements("Collection")
-        //    //            where ele1.Attribute("RegName").Value.Equals("STDList")
-        //    //            select ele1).FirstOrDefault();
-
-        //    //if (item != null)
-        //    //{
-        //    //    item.Remove();
-        //    //}
-
-        //    //xele.Save(Address);
-        //    #endregion
-        //    XDocument xdoc = XDocument.Load(Address);
-        //    IEnumerable<XElement> elements = from ele in xdoc.Descendants("XMLData") select ele;
-        //    var item = (from ele1 in elements.Elements("Collection")
-        //                where ele1.Attribute("RegName").Value.Equals("STDList")
-        //                select ele1).FirstOrDefault();
-        //    if (item != null)
-        //    {
-        //        item.Remove();
-        //    }
-
-        //    XElement STD = new XElement("Collection");
-        //    STD.SetAttributeValue("RegName", "STDList");
-        //    elements.ElementAt(0).Add(STD);
-
-        //    foreach (KeyValuePair<int, STDdata> kv in STDDictionary)
-        //    {
-        //        string UsingElementList = "";
-        //        string UsingImgPropertyList = "";
-        //        string UsingOtherPropertyList = "";
-        //        List<string> UsingElementL = new List<string>();
-        //        List<string> UsingImgPropertyL = new List<string>();
-        //        List<string> UsingOtherPropertyL = new List<string>();
-
-        //        string str_RemoveBlank = kv.Value.Expression;
-        //        //forth_elem干扰or分隔符,故先行去掉
-        //        if (str_RemoveBlank.Contains("forth_elem"))
-        //        {
-        //            str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-        //            UsingOtherPropertyList = "forth_elem,";
-        //        }
-
-        //        str_RemoveBlank = str_RemoveBlank.Replace(" ", "");
-        //        string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-        //        List<string> str_Removeandor = new List<string>();
-        //        for (int i = 0; i < str_Removeand.Length; i++)
-        //        {
-        //            str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-        //        }
-        //        List<string> list_all = new List<string>();
-        //        for (int i = 0; i < str_Removeandor.Count; i++)
-        //        {
-        //            list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-        //        }
-        //        for (int i = 0; i < list_all.Count; i++)
-        //        {
-        //            //周期元素?
-        //            if (m_SubMidWindow.m_STDEditor.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-        //            {
-        //                if (!UsingElementL.Contains(list_all[i]))
-        //                {
-        //                    UsingElementL.Add(list_all[i]);
-        //                }
-        //            }
-        //            //first_elem?
-        //            if (m_SubMidWindow.m_STDEditor.comboBox_Elem1.Items.Contains(list_all[i]))
-        //            {
-        //                if (!UsingOtherPropertyL.Contains(list_all[i]))
-        //                {
-        //                    UsingOtherPropertyL.Add(list_all[i]);
-        //                }
-        //            }
-        //            //Element1?
-        //            if (m_SubMidWindow.m_STDEditor.comboBox_Elem.Items.Contains(list_all[i]))
-        //            {
-        //                if (!UsingOtherPropertyL.Contains(list_all[i]))
-        //                {
-        //                    UsingOtherPropertyL.Add(list_all[i]);
-        //                }
-        //            }
-        //            //其它元素?
-        //            if (m_SubMidWindow.m_STDEditor.comboBox_ImgProperty.Items.Contains(list_all[i]))
-        //            {
-        //                if (!UsingImgPropertyL.Contains(list_all[i]))
-        //                {
-        //                    UsingImgPropertyL.Add(list_all[i]);
-        //                }
-        //            }
-        //        }
-        //        if (UsingElementL.Count > 0)
-        //        {
-        //            for (int i = 0; i < UsingElementL.Count - 1; i++)
-        //            {
-        //                UsingElementList += UsingElementL[i] + ",";
-        //            }
-        //            UsingElementList += UsingElementL[UsingElementL.Count - 1];
-        //        }
-
-        //        if (UsingImgPropertyL.Count > 0)
-        //        {
-        //            for (int i = 0; i < UsingImgPropertyL.Count - 1; i++)
-        //            {
-        //                UsingImgPropertyList += UsingImgPropertyL[i] + ",";
-        //            }
-        //            UsingImgPropertyList += UsingImgPropertyL[UsingImgPropertyL.Count - 1];
-        //        }
-
-        //        if (UsingOtherPropertyL.Count > 0)
-        //        {
-        //            for (int i = 0; i < UsingOtherPropertyL.Count - 1; i++)
-        //            {
-        //                UsingOtherPropertyList += UsingOtherPropertyL[i] + ",";
-        //            }
-        //            UsingOtherPropertyList += UsingOtherPropertyL[UsingOtherPropertyL.Count - 1];
-        //        }
-
-        //        XElement EleName = new XElement("Member");
-        //        EleName.SetAttributeValue("STDId", kv.Key);
-        //        EleName.SetAttributeValue("StrName", kv.Value.StrName);
-        //        EleName.SetAttributeValue("Color", kv.Value.Color);
-        //        //EleName.SetAttributeValue("UsingElementList", UsingElementList);
-        //        EleName.SetAttributeValue("KeyElementList", kv.Value.KeyElementList);
-        //        EleName.SetAttributeValue("SubElementList", kv.Value.SubElementList);
-        //        EleName.SetAttributeValue("UsingImgPropertyList", UsingImgPropertyList);
-        //        EleName.SetAttributeValue("UsingOtherPropertyList", UsingOtherPropertyList);
-        //        EleName.SetAttributeValue("Expression", kv.Value.Expression);
-        //        EleName.SetAttributeValue("Hardness", kv.Value.Hardness);
-        //        EleName.SetAttributeValue("Density", kv.Value.Density);
-        //        EleName.SetAttributeValue("Electrical_conductivity", kv.Value.Electrical_conductivity);
-        //        EleName.SetAttributeValue("BSE", kv.Value.BSE);
-        //        EleName.SetAttributeValue("Formula", kv.Value.Formula);
-        //        EleName.SetAttributeValue("Element", kv.Value.Element);
-
-        //        STD.Add(EleName);
-        //    }
-        //    xdoc.Save(Address);
-        //}
-        #endregion
-
         private void rbClose_Click(object sender, EventArgs e)
-        {            
-            if (!EqualsBetweenDictionary(STDDictionaryInitial, STDDictionary) || IsModified)
+        {
+            if (!Isoldversion)
             {
-                DialogResult dr = MessageBox.Show("Whether to save the current modification?", "Tip", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
-                if (dr == DialogResult.Yes)
+
+
+                if (!EqualsBetweenDictionary(STDDictionaryInitial, STDDictionary) || IsModified)
                 {
-                    if (m_STDRuleslist.Grid_Minerals.RowsCount > 1)
+                    DialogResult dr = MessageBox.Show("Whether to save the current modification?", "Tip", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+                    if (dr == DialogResult.Yes)
                     {
-                        if ((m_STDRuleslist.Grid_Minerals[m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0].Value.ToString().Replace(" ", "").Trim() != "") && CheckAttributes() && Checktextbox_STDEditor())
+                        if (m_STDRuleslist.Grid_Minerals.RowsCount > 1)
                         {
-                            SaveDataOfSelRule(m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0);
+                            if ((m_STDRuleslist.Grid_Minerals[m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0].Value.ToString().Replace(" ", "").Trim() != "") && CheckAttributes() && Checktextbox_STDEditor())
+                            {
+                                SaveDataOfSelRule(m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, 0);
+                            }
+                            else
+                            {
+                                return;
+                            }
+
                         }
                         else
                         {
-                            return;
+                            STDDictionaryInitial.Clear();
+                        }
+                        FormForWaiting forWaiting = new FormForWaiting();
+                        forWaiting.Show();
+                        bool result = SaveDictionaryToClassify(STDDBAddress);
+                        if (result)
+                        {
+                            forWaiting.Close();
+                        }
+                        else
+                        {
+                            forWaiting.Close();
+                            MessageBox.Show("Save failed!", "Tip");
                         }
-
-                    }
-                    else
-                    {
-                        STDDictionaryInitial.Clear();
-                    }
-                    FormForWaiting forWaiting = new FormForWaiting();
-                    forWaiting.Show();
-                    bool result = SaveDictionaryToClassify(STDDBAddress);
-                    if (result)
-                    {
-                        m_SubMidWindow.m_STDEditor.SaveSTDXray();
-                        forWaiting.Close();
-                    }
-                    else
-                    {
-                        forWaiting.Close();
-                        MessageBox.Show("Save failed!", "Tip");
                     }
                 }
             }
@@ -1346,7 +1224,6 @@ namespace OTSPartA_STDEditor
             ribbon_ESDMaxRules.Enabled = true;
             ribbon_UserConstants.Enabled = true;
             ribbon_GroupNameMaintenance.Enabled = true;
-            ribbon_BulkImport.Enabled = true;
         }
 
 
@@ -1362,19 +1239,18 @@ namespace OTSPartA_STDEditor
             ribbon_ESDMaxRules.Enabled = false;
             ribbon_UserConstants.Enabled = false;
             ribbon_GroupNameMaintenance.Enabled = false;
-            ribbon_BulkImport.Enabled = false;
         }
 
         void InitForms(string DBAddress)
         {
             STDDictionary.Clear();
+            ButtonStatusOpen();
             bool ret = LoadClassifyToDictionary(DBAddress, ref STDDictionary);
             STDDictionaryInitial = Clone(STDDictionary) as Dictionary<int, STDdata>;
             if (!ret)
             {
                 return;
             }
-            ButtonStatusOpen();
 
             m_STDRuleslist = new STDRuleslist(this);
             m_Attributes = new Attributes(this);
@@ -1408,64 +1284,6 @@ namespace OTSPartA_STDEditor
             }
         }
 
-        private void ribbon_BulkImport_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog openFileDialog = new OpenFileDialog();
-            openFileDialog.Filter = "(*.db)|*.db";
-            openFileDialog.RestoreDirectory = true;
-            openFileDialog.FilterIndex = 1;
-            openFileDialog.Title = "Please open a database!";
-            if (openFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                try
-                {
-                    System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + openFileDialog.FileName + "'");
-                    m_dbConnection.Open();
-
-                    if(STDDictionary.Count==0)
-                    {
-                        MessageBox.Show(table["message27"].ToString(), "Tip");
-                        return;
-                    }
-
-                    string STDId = m_STDRuleslist.Grid_Minerals[m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row,m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Column].Tag.ToString();
-
-                    bool ret = false;//搜索结果
-                    for(int i=0;i< STDDictionary.Count;i++)
-                    {
-                        STDEditor.Result result = m_SubMidWindow.m_STDEditor.ImportFromResult(STDDictionary.Keys.ElementAt(i).ToString(), m_dbConnection);
-                        if (result == STDEditor.Result.Success)
-                        {
-                            ret = true;
-                        }
-                        else if(result == STDEditor.Result.Fail)
-                        {
-                            return;
-                        }
-                    }
-                    if (!ret)
-                    {
-                        MessageBox.Show("No matching energy spectrum data was found", "Tip");
-                    }
-
-                    int color = Convert.ToInt32(m_SubMidWindow.m_STDEditor.ParseRGB(STDRuleslist.colorHx16toRGB(STDDictionary[int.Parse(STDId)].Color)).ToString());
-                    for (int j = 0; j < m_SubMidWindow.m_STDEditor.m_STDXrayList.Count; j++)
-                    {
-                        if (m_SubMidWindow.m_STDEditor.m_STDXrayList[j].StdID == STDId)
-                        {
-                            m_SubMidWindow.m_STDEditor.ShowXrayAtlas(color, m_SubMidWindow.m_STDEditor.m_STDXrayList[j].XrayData);
-                            break;
-                        }
-                    }
-                    m_dbConnection.Close();
-                }
-                catch(Exception ex)
-                {
-                    MessageBox.Show(ex.ToString());
-                }
-            }
-        }
-
         bool EqualsBetweenDictionary(Dictionary<int, STDdata> STDDictionaryInitial, Dictionary<int, STDdata> STDDictionary)
         {
            if(STDDictionaryInitial.Count!= STDDictionary.Count)
@@ -1493,6 +1311,10 @@ namespace OTSPartA_STDEditor
 
         private void Form_ConstantsEditor2_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if(Isoldversion)
+            {
+                return;
+            }
             if (m_STDRuleslist.Text != "")
             {
                 if (!EqualsBetweenDictionary(STDDictionaryInitial, STDDictionary)|| IsModified)
@@ -1522,7 +1344,6 @@ namespace OTSPartA_STDEditor
                         bool result = SaveDictionaryToClassify(STDDBAddress);
                         if (result)
                         {
-                            m_SubMidWindow.m_STDEditor.SaveSTDXray();
                             forWaiting.Close();
                         }
                         else
@@ -1547,156 +1368,6 @@ namespace OTSPartA_STDEditor
             }
         }
 
-        private void ribbon_ConvertOreDatabaseToOtsDatabase_Click(object sender, EventArgs e)
-        {
-            DataTable OreDatabasedt = new DataTable();
-            OpenFileDialog openFileDialog = new OpenFileDialog();
-            openFileDialog.Title= "Please select the database you want to convert";
-            openFileDialog.Filter = "(*.db)|*.db";
-            openFileDialog.RestoreDirectory = true;
-            openFileDialog.FilterIndex = 1;
-            if (openFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                try
-                {
-                    string OreDatabaseAddress = openFileDialog.FileName;
-                    System.Data.SQLite.SQLiteConnection m_OreDatabaseConnection = new System.Data.SQLite.SQLiteConnection("data source='" + OreDatabaseAddress + "'");
-                    m_OreDatabaseConnection.Open();
-                    System.Data.SQLite.SQLiteDataAdapter m_OreDatabasedataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from STDMinerals", m_OreDatabaseConnection);
-                    DataSet OreDatabaseds = new DataSet();
-                    m_OreDatabasedataAdapter.Fill(OreDatabaseds);
-                    OreDatabasedt = OreDatabaseds.Tables[0];
-
-                    int listnum = 1;
-                    SaveFileDialog saveFile = new SaveFileDialog();
-                    saveFile.Title = table["message23"].ToString();
-                    saveFile.Filter = table["message36"].ToString();
-                    saveFile.OverwritePrompt = true;  //是否覆盖当前文件
-                    saveFile.RestoreDirectory = true;  //还原上次目录
-                    if (saveFile.ShowDialog() == DialogResult.OK)
-                    {
-                        System.Data.SQLite.SQLiteConnection.CreateFile(saveFile.FileName);
-                        System.Data.SQLite.SQLiteConnection m_OtsDatabaseConnection = new System.Data.SQLite.SQLiteConnection("data source='" + saveFile.FileName + "'");
-                        m_OtsDatabaseConnection.Open();
-                        System.Data.SQLite.SQLiteCommand OtsDatabaseCommand = m_OtsDatabaseConnection.CreateCommand();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE ClassifySTD (STDId INTEGER,StrName TEXT, Color TEXT,KeyElementList TEXT,SubElementList TEXT,UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT,Hardness TEXT,Density TEXT,Electrical_conductivity TEXT,BSE INTEGER,Formula TEXT,Element TEXT,ListNum INT,GroupId INT)";
-                        OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE Constants (value TEXT)";
-                        OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE MaxEDSRules (MaxEDSTime INT,UsingElementList TEXT, UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT)";
-                        OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE STDGroups (id INTEGER,name TEXT, color TEXT,iorder INTEGER)";
-                        OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE STDMinerals (id INTEGER,SPEC BLOB)";
-                        OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE ZeroElementRules (ZeroElement TEXT,UsingElementList TEXT, UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT)";
-                        OtsDatabaseCommand.ExecuteNonQuery();
-                        System.Data.Common.DbTransaction trans = m_OtsDatabaseConnection.BeginTransaction();
-
-                        foreach (DataRow item in OreDatabasedt.Rows)
-                        {
-                            int n = 0;
-                            string STRcolor = "#0";
-                            if(int.TryParse(item["color"].ToString(),out n))
-                            {
-                                STRcolor = "#"+n.ToString("X6");
-                            }
-                            int idaAdd10 = 0;
-                            idaAdd10 = int.Parse(item["id"].ToString()) + 10;
-                            OtsDatabaseCommand.CommandText = "insert into ClassifySTD (Density,BSE,Formula,StrName,Color,STDId,ListNum,GroupId,KeyElementList,SubElementList,UsingImgPropertyList,UsingOtherPropertyList,Expression,Hardness,Electrical_conductivity,Element) values ( '" + item["density"].ToString() + "','" + item["BSEValue"].ToString() + "','" + item["formula"].ToString() + "','" + item["name"].ToString() + "','" + STRcolor + "'," + idaAdd10.ToString() + "," + listnum.ToString() + @",0,' ',' ',' ',' ',' ',' ',' ',' ')";
-                            OtsDatabaseCommand.ExecuteNonQuery();
-                            listnum++;
-                            OtsDatabaseCommand.CommandText = "insert into STDMinerals (id,SPEC) values (@id,@SPEC)";
-                            OtsDatabaseCommand.Parameters.Add("id", DbType.Int32).Value = idaAdd10;
-                            OtsDatabaseCommand.Parameters.Add("SPEC", DbType.Binary).Value = item["SPEC"];
-                            OtsDatabaseCommand.ExecuteNonQuery();
-                        }
-
-                        trans.Commit();
-                    }
-                    else
-                    {
-                        return;
-                    }
-                }
-                catch(Exception ex)
-                {
-                    MessageBox.Show(ex.ToString());
-                }
-            }
-            else
-            {
-                return;
-            }
-        }
-
-        private void rbMatchescorrespondingelement_Click(object sender, EventArgs e)
-        {
-            DataTable OreDatabasedt = new DataTable();
-            OpenFileDialog openFileDialog = new OpenFileDialog();
-            openFileDialog.Title = "Please select the database you want to math:";
-            openFileDialog.Filter = "(*.db)|*.db";
-            openFileDialog.RestoreDirectory = true;
-            openFileDialog.FilterIndex = 1;
-            if (openFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                try
-                {
-                    string OreDatabaseAddress = openFileDialog.FileName;
-                    System.Data.SQLite.SQLiteConnection m_OreDatabaseConnection = new System.Data.SQLite.SQLiteConnection("data source='" + OreDatabaseAddress + "'");
-                    m_OreDatabaseConnection.Open();
-                    System.Data.SQLite.SQLiteDataAdapter m_OreDatabasedataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from MineralElements", m_OreDatabaseConnection);
-                    DataSet OreDatabaseds = new DataSet();
-                    m_OreDatabasedataAdapter.Fill(OreDatabaseds);
-                    OreDatabasedt = OreDatabaseds.Tables[0];
-
-                    System.Data.SQLite.SQLiteConnection m_OtsDatabaseConnection = new System.Data.SQLite.SQLiteConnection("data source='" + STDDBAddress + "'");
-                    m_OtsDatabaseConnection.Open();
-                    System.Data.SQLite.SQLiteCommand OtsDatabaseCommand = m_OtsDatabaseConnection.CreateCommand();
-                    OtsDatabaseCommand.CommandText = "CREATE TABLE MineralElements (mineralID INTEGER,elementID INTEGER,elementPercentage FLOAT)";
-                    OtsDatabaseCommand.ExecuteNonQuery();
-                    System.Data.Common.DbTransaction trans = m_OtsDatabaseConnection.BeginTransaction();
-
-                    System.Data.SQLite.SQLiteDataAdapter m_OtsDatabasedataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select id from STDMinerals", m_OtsDatabaseConnection);
-                    DataSet OtsDatabaseds = new DataSet();
-                    m_OtsDatabasedataAdapter.Fill(OtsDatabaseds);
-                    var OtsDatabasedt = OtsDatabaseds.Tables[0];
-
-                    List<int> IdG = new List<int>();
-                    foreach (DataRow item in OtsDatabasedt.Rows)
-                    {
-                        IdG.Add(int.Parse(item["id"].ToString()) - 10);
-                    }
-
-
-                    int n = 0;
-                    foreach (DataRow item in OreDatabasedt.Rows)
-                    {
-                        if (!int.TryParse(item["mineralID"].ToString(), out n))
-                        { continue; }
-
-                        if (IdG.Contains(n))
-                        {
-                            OtsDatabaseCommand.CommandText = "insert into MineralElements (mineralID,elementID,elementPercentage) values (@mineralID,@elementID,@elementPercentage)";
-                            OtsDatabaseCommand.Parameters.Add("mineralID", DbType.Int32).Value = (n+10);
-                            OtsDatabaseCommand.Parameters.Add("elementID", DbType.Int32).Value = item["elementID"];
-                            OtsDatabaseCommand.Parameters.Add("elementPercentage", DbType.Double).Value = item["elementPercentage"];
-                            OtsDatabaseCommand.ExecuteNonQuery();
-                        }
-                    }
-                    trans.Commit();
-                }
-                catch (Exception ex)
-                {
-                    MessageBox.Show(ex.ToString());
-                }
-            }
-            else
-            {
-                return;
-            }
-        }
-
         private void rbNew_Click(object sender, EventArgs e)
         {
             SaveFileDialog saveFile = new SaveFileDialog();
@@ -1712,7 +1383,7 @@ namespace OTSPartA_STDEditor
                     System.Data.SQLite.SQLiteConnection m_OtsDatabaseConnection = new System.Data.SQLite.SQLiteConnection("data source='" + saveFile.FileName + "'");
                     m_OtsDatabaseConnection.Open();
                     System.Data.SQLite.SQLiteCommand OtsDatabaseCommand = m_OtsDatabaseConnection.CreateCommand();
-                    OtsDatabaseCommand.CommandText = "CREATE TABLE ClassifySTD (STDId INTEGER,StrName TEXT, Color TEXT,KeyElementList TEXT,SubElementList TEXT,UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT,Hardness TEXT,Density TEXT,Electrical_conductivity TEXT,BSE INTEGER,Formula TEXT,Element TEXT,ListNum INT,IfElementAnalysis BLOB,GroupId INT)";
+                    OtsDatabaseCommand.CommandText = "CREATE TABLE ClassifySTD (STDId INTEGER,StrName TEXT, Color TEXT,KeyElementList TEXT,SubElementList TEXT,UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT,Hardness TEXT,Density TEXT,Electrical_conductivity TEXT,BSE INTEGER,Formula TEXT,Element TEXT,IfElementAnalysis BOOLEAN,ListNum INT,GroupId INT)";
                     OtsDatabaseCommand.ExecuteNonQuery();
                     OtsDatabaseCommand.CommandText = "CREATE TABLE Constants (value TEXT)";
                     OtsDatabaseCommand.ExecuteNonQuery();

+ 0 - 1673
OTSPartA_STDEditor/Form_STDConstantsEditor.Designer.cs

@@ -1,1673 +0,0 @@
-namespace OTSPartA_STDEditor
-{
-    partial class Form_STDConstantsEditor
-    {
-        /// <summary>
-        /// 必需的设计器变量。
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// 清理所有正在使用的资源。
-        /// </summary>
-        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows 窗体设计器生成的代码
-
-        /// <summary>
-        /// 设计器支持所需的方法 - 不要修改
-        /// 使用代码编辑器修改此方法的内容。
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.components = new System.ComponentModel.Container();
-            this.groupBox_Data = new System.Windows.Forms.GroupBox();
-            this.groupBox_CalculatingSymbols = new System.Windows.Forms.GroupBox();
-            this.button_0 = new System.Windows.Forms.Button();
-            this.button_9 = new System.Windows.Forms.Button();
-            this.button_4 = new System.Windows.Forms.Button();
-            this.button_5 = new System.Windows.Forms.Button();
-            this.button_6 = new System.Windows.Forms.Button();
-            this.button_7 = new System.Windows.Forms.Button();
-            this.button_8 = new System.Windows.Forms.Button();
-            this.button_Divide = new System.Windows.Forms.Button();
-            this.button_Or = new System.Windows.Forms.Button();
-            this.button_And = new System.Windows.Forms.Button();
-            this.button_3 = new System.Windows.Forms.Button();
-            this.button_2 = new System.Windows.Forms.Button();
-            this.button_1 = new System.Windows.Forms.Button();
-            this.button_Equal = new System.Windows.Forms.Button();
-            this.button_RightParenthesis = new System.Windows.Forms.Button();
-            this.button_LeftParenthesis = new System.Windows.Forms.Button();
-            this.button_Less = new System.Windows.Forms.Button();
-            this.button_More = new System.Windows.Forms.Button();
-            this.button_Multiply = new System.Windows.Forms.Button();
-            this.button_Subtract = new System.Windows.Forms.Button();
-            this.button_Plus = new System.Windows.Forms.Button();
-            this.groupBox_XmlTree_MaxEDSRules = new System.Windows.Forms.GroupBox();
-            this.textBox_MaxEDSTime = new System.Windows.Forms.TextBox();
-            this.button_Backup = new System.Windows.Forms.Button();
-            this.groupBox_ChemicalElement = new System.Windows.Forms.GroupBox();
-            this.comboBox_PeriodicTable = new System.Windows.Forms.ComboBox();
-            this.groupBox_OtherCommonlyUsedSymbols = new System.Windows.Forms.GroupBox();
-            this.comboBox_Constants = new System.Windows.Forms.ComboBox();
-            this.label_DefinedConstant = new System.Windows.Forms.Label();
-            this.label_Other = new System.Windows.Forms.Label();
-            this.label_ElementFormTwo = new System.Windows.Forms.Label();
-            this.label_ElementFormOne = new System.Windows.Forms.Label();
-            this.comboBox_Elem1 = new System.Windows.Forms.ComboBox();
-            this.comboBox_Elem = new System.Windows.Forms.ComboBox();
-            this.comboBox_ImgProperty = new System.Windows.Forms.ComboBox();
-            this.button_Recover = new System.Windows.Forms.Button();
-            this.btn_dbs = new System.Windows.Forms.Button();
-            this.label_Color = new System.Windows.Forms.Label();
-            this.groupBox_XmlTree_STDlist1 = new System.Windows.Forms.GroupBox();
-            this.textBox_Electrical_conductivity = new System.Windows.Forms.TextBox();
-            this.textBox_Density = new System.Windows.Forms.TextBox();
-            this.textBox_Element = new System.Windows.Forms.TextBox();
-            this.label_Element = new System.Windows.Forms.Label();
-            this.label_Conductivity = new System.Windows.Forms.Label();
-            this.label_Formula = new System.Windows.Forms.Label();
-            this.label__BSEValue = new System.Windows.Forms.Label();
-            this.textBox_Formula = new System.Windows.Forms.TextBox();
-            this.textBox_BSEValue = new System.Windows.Forms.TextBox();
-            this.label_Density = new System.Windows.Forms.Label();
-            this.label_Hardness = new System.Windows.Forms.Label();
-            this.textBox_Hardness = new System.Windows.Forms.TextBox();
-            this.button_Ok = new System.Windows.Forms.Button();
-            this.button_Cancel = new System.Windows.Forms.Button();
-            this.textbox_STDEditor = new System.Windows.Forms.TextBox();
-            this.XmlTreeMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.新建标准库规则ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.删除ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.button_UpOrder = new System.Windows.Forms.Button();
-            this.button_DownOrder = new System.Windows.Forms.Button();
-            this.tabControl_Rules = new System.Windows.Forms.TabControl();
-            this.tabPage_ClassificationRules = new System.Windows.Forms.TabPage();
-            this.button_SpecialOrder = new System.Windows.Forms.Button();
-            this.XmlTree_STDlist = new System.Windows.Forms.TreeView();
-            this.tabPage_MaxEDSRules = new System.Windows.Forms.TabPage();
-            this.XmlTree_MaxEDSRules = new System.Windows.Forms.TreeView();
-            this.tabPage_ZeroElementRules = new System.Windows.Forms.TabPage();
-            this.XmlTree_ZeroElementRules = new System.Windows.Forms.TreeView();
-            this.tabPage_UserConstants = new System.Windows.Forms.TabPage();
-            this.button_UpdateConstants = new System.Windows.Forms.Button();
-            this.label_ConstantValue = new System.Windows.Forms.Label();
-            this.label_ConstantSymbol = new System.Windows.Forms.Label();
-            this.checkBox_3 = new System.Windows.Forms.CheckBox();
-            this.checkBox_0 = new System.Windows.Forms.CheckBox();
-            this.textBox_9 = new System.Windows.Forms.TextBox();
-            this.textBox_0 = new System.Windows.Forms.TextBox();
-            this.checkBox_9 = new System.Windows.Forms.CheckBox();
-            this.checkBox_1 = new System.Windows.Forms.CheckBox();
-            this.textBox_8 = new System.Windows.Forms.TextBox();
-            this.textBox_1 = new System.Windows.Forms.TextBox();
-            this.checkBox_8 = new System.Windows.Forms.CheckBox();
-            this.checkBox_2 = new System.Windows.Forms.CheckBox();
-            this.textBox_7 = new System.Windows.Forms.TextBox();
-            this.textBox_2 = new System.Windows.Forms.TextBox();
-            this.checkBox_7 = new System.Windows.Forms.CheckBox();
-            this.textBox_3 = new System.Windows.Forms.TextBox();
-            this.textBox_6 = new System.Windows.Forms.TextBox();
-            this.checkBox_4 = new System.Windows.Forms.CheckBox();
-            this.checkBox_6 = new System.Windows.Forms.CheckBox();
-            this.textBox_4 = new System.Windows.Forms.TextBox();
-            this.textBox_5 = new System.Windows.Forms.TextBox();
-            this.checkBox_5 = new System.Windows.Forms.CheckBox();
-            this.label_SubElements = new System.Windows.Forms.Label();
-            this.label_KeyElements = new System.Windows.Forms.Label();
-            this.dataGridView_KeyElements = new System.Windows.Forms.DataGridView();
-            this.dataGridView_SubElements = new System.Windows.Forms.DataGridView();
-            this.tabSTDStandrad = new System.Windows.Forms.TabControl();
-            this.tabSTD = new System.Windows.Forms.TabPage();
-            this.PeriodicTableSwitch = new System.Windows.Forms.Button();
-            this.tabXray = new System.Windows.Forms.TabPage();
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.btnTest = new System.Windows.Forms.Button();
-            this.label9 = new System.Windows.Forms.Label();
-            this.txtCollectTime = new System.Windows.Forms.TextBox();
-            this.btnReadXray = new System.Windows.Forms.Button();
-            this.btnCollectXray = new System.Windows.Forms.Button();
-            this.label2 = new System.Windows.Forms.Label();
-            this.plXray = new System.Windows.Forms.Panel();
-            this.panel_OTSPeriodicTable = new System.Windows.Forms.Panel();
-            this.groupBox_Data.SuspendLayout();
-            this.groupBox_CalculatingSymbols.SuspendLayout();
-            this.groupBox_XmlTree_MaxEDSRules.SuspendLayout();
-            this.groupBox_ChemicalElement.SuspendLayout();
-            this.groupBox_OtherCommonlyUsedSymbols.SuspendLayout();
-            this.groupBox_XmlTree_STDlist1.SuspendLayout();
-            this.XmlTreeMenuStrip.SuspendLayout();
-            this.tabControl_Rules.SuspendLayout();
-            this.tabPage_ClassificationRules.SuspendLayout();
-            this.tabPage_MaxEDSRules.SuspendLayout();
-            this.tabPage_ZeroElementRules.SuspendLayout();
-            this.tabPage_UserConstants.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_KeyElements)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_SubElements)).BeginInit();
-            this.tabSTDStandrad.SuspendLayout();
-            this.tabSTD.SuspendLayout();
-            this.tabXray.SuspendLayout();
-            this.panel1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // groupBox_Data
-            // 
-            this.groupBox_Data.Controls.Add(this.groupBox_CalculatingSymbols);
-            this.groupBox_Data.Controls.Add(this.groupBox_XmlTree_MaxEDSRules);
-            this.groupBox_Data.Controls.Add(this.button_Backup);
-            this.groupBox_Data.Controls.Add(this.groupBox_ChemicalElement);
-            this.groupBox_Data.Controls.Add(this.groupBox_OtherCommonlyUsedSymbols);
-            this.groupBox_Data.Controls.Add(this.button_Recover);
-            this.groupBox_Data.Location = new System.Drawing.Point(9, 260);
-            this.groupBox_Data.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_Data.Name = "groupBox_Data";
-            this.groupBox_Data.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_Data.Size = new System.Drawing.Size(866, 420);
-            this.groupBox_Data.TabIndex = 0;
-            this.groupBox_Data.TabStop = false;
-            this.groupBox_Data.Click += new System.EventHandler(this.groupBox_Data_Click);
-            // 
-            // groupBox_CalculatingSymbols
-            // 
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_0);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_9);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_4);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_5);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_6);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_7);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_8);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Divide);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Or);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_And);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_3);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_2);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_1);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Equal);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_RightParenthesis);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_LeftParenthesis);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Less);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_More);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Multiply);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Subtract);
-            this.groupBox_CalculatingSymbols.Controls.Add(this.button_Plus);
-            this.groupBox_CalculatingSymbols.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBox_CalculatingSymbols.Location = new System.Drawing.Point(580, 30);
-            this.groupBox_CalculatingSymbols.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_CalculatingSymbols.Name = "groupBox_CalculatingSymbols";
-            this.groupBox_CalculatingSymbols.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_CalculatingSymbols.Size = new System.Drawing.Size(279, 381);
-            this.groupBox_CalculatingSymbols.TabIndex = 32;
-            this.groupBox_CalculatingSymbols.TabStop = false;
-            this.groupBox_CalculatingSymbols.Text = "运算符号";
-            // 
-            // button_0
-            // 
-            this.button_0.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_0.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_0.Location = new System.Drawing.Point(228, 102);
-            this.button_0.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_0.Name = "button_0";
-            this.button_0.Size = new System.Drawing.Size(45, 52);
-            this.button_0.TabIndex = 26;
-            this.button_0.Text = "0";
-            this.button_0.UseVisualStyleBackColor = true;
-            this.button_0.Click += new System.EventHandler(this.button_0_Click);
-            // 
-            // button_9
-            // 
-            this.button_9.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_9.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_9.Location = new System.Drawing.Point(174, 104);
-            this.button_9.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_9.Name = "button_9";
-            this.button_9.Size = new System.Drawing.Size(45, 52);
-            this.button_9.TabIndex = 25;
-            this.button_9.Text = "9";
-            this.button_9.UseVisualStyleBackColor = true;
-            this.button_9.Click += new System.EventHandler(this.button_9_Click);
-            // 
-            // button_4
-            // 
-            this.button_4.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_4.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_4.Location = new System.Drawing.Point(174, 30);
-            this.button_4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_4.Name = "button_4";
-            this.button_4.Size = new System.Drawing.Size(45, 52);
-            this.button_4.TabIndex = 24;
-            this.button_4.Text = "4";
-            this.button_4.UseVisualStyleBackColor = true;
-            this.button_4.Click += new System.EventHandler(this.button_4_Click);
-            // 
-            // button_5
-            // 
-            this.button_5.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_5.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_5.Location = new System.Drawing.Point(228, 30);
-            this.button_5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_5.Name = "button_5";
-            this.button_5.Size = new System.Drawing.Size(45, 52);
-            this.button_5.TabIndex = 23;
-            this.button_5.Text = "5";
-            this.button_5.UseVisualStyleBackColor = true;
-            this.button_5.Click += new System.EventHandler(this.button_5_Click);
-            // 
-            // button_6
-            // 
-            this.button_6.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_6.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_6.Location = new System.Drawing.Point(9, 104);
-            this.button_6.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_6.Name = "button_6";
-            this.button_6.Size = new System.Drawing.Size(45, 52);
-            this.button_6.TabIndex = 22;
-            this.button_6.Text = "6";
-            this.button_6.UseVisualStyleBackColor = true;
-            this.button_6.Click += new System.EventHandler(this.button_6_Click);
-            // 
-            // button_7
-            // 
-            this.button_7.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_7.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_7.Location = new System.Drawing.Point(64, 104);
-            this.button_7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_7.Name = "button_7";
-            this.button_7.Size = new System.Drawing.Size(45, 52);
-            this.button_7.TabIndex = 21;
-            this.button_7.Text = "7";
-            this.button_7.UseVisualStyleBackColor = true;
-            this.button_7.Click += new System.EventHandler(this.button_7_Click);
-            // 
-            // button_8
-            // 
-            this.button_8.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_8.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_8.Location = new System.Drawing.Point(118, 104);
-            this.button_8.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_8.Name = "button_8";
-            this.button_8.Size = new System.Drawing.Size(45, 52);
-            this.button_8.TabIndex = 20;
-            this.button_8.Text = "8";
-            this.button_8.UseVisualStyleBackColor = true;
-            this.button_8.Click += new System.EventHandler(this.button_8_Click);
-            // 
-            // button_Divide
-            // 
-            this.button_Divide.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Divide.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Divide.Location = new System.Drawing.Point(174, 178);
-            this.button_Divide.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Divide.Name = "button_Divide";
-            this.button_Divide.Size = new System.Drawing.Size(45, 52);
-            this.button_Divide.TabIndex = 8;
-            this.button_Divide.Text = "/";
-            this.button_Divide.UseVisualStyleBackColor = true;
-            this.button_Divide.Click += new System.EventHandler(this.button_Divide_Click);
-            // 
-            // button_Or
-            // 
-            this.button_Or.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Or.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Or.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.button_Or.Location = new System.Drawing.Point(180, 321);
-            this.button_Or.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Or.Name = "button_Or";
-            this.button_Or.Size = new System.Drawing.Size(93, 52);
-            this.button_Or.TabIndex = 15;
-            this.button_Or.Text = "or";
-            this.button_Or.UseVisualStyleBackColor = true;
-            this.button_Or.Click += new System.EventHandler(this.button_Or_Click);
-            // 
-            // button_And
-            // 
-            this.button_And.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_And.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_And.ForeColor = System.Drawing.SystemColors.ControlText;
-            this.button_And.Location = new System.Drawing.Point(9, 321);
-            this.button_And.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_And.Name = "button_And";
-            this.button_And.Size = new System.Drawing.Size(154, 52);
-            this.button_And.TabIndex = 14;
-            this.button_And.Text = "and";
-            this.button_And.UseVisualStyleBackColor = true;
-            this.button_And.Click += new System.EventHandler(this.button_And_Click);
-            // 
-            // button_3
-            // 
-            this.button_3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_3.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_3.Location = new System.Drawing.Point(118, 30);
-            this.button_3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_3.Name = "button_3";
-            this.button_3.Size = new System.Drawing.Size(45, 52);
-            this.button_3.TabIndex = 19;
-            this.button_3.Text = "3";
-            this.button_3.UseVisualStyleBackColor = true;
-            this.button_3.Click += new System.EventHandler(this.button_3_Click);
-            // 
-            // button_2
-            // 
-            this.button_2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_2.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_2.Location = new System.Drawing.Point(63, 30);
-            this.button_2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_2.Name = "button_2";
-            this.button_2.Size = new System.Drawing.Size(45, 52);
-            this.button_2.TabIndex = 18;
-            this.button_2.Text = "2";
-            this.button_2.UseVisualStyleBackColor = true;
-            this.button_2.Click += new System.EventHandler(this.button_2_Click);
-            // 
-            // button_1
-            // 
-            this.button_1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_1.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_1.Location = new System.Drawing.Point(9, 30);
-            this.button_1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_1.Name = "button_1";
-            this.button_1.Size = new System.Drawing.Size(45, 52);
-            this.button_1.TabIndex = 17;
-            this.button_1.Text = "1";
-            this.button_1.UseVisualStyleBackColor = true;
-            this.button_1.Click += new System.EventHandler(this.button_1_Click);
-            // 
-            // button_Equal
-            // 
-            this.button_Equal.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Equal.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Equal.Location = new System.Drawing.Point(228, 178);
-            this.button_Equal.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Equal.Name = "button_Equal";
-            this.button_Equal.Size = new System.Drawing.Size(45, 52);
-            this.button_Equal.TabIndex = 16;
-            this.button_Equal.Text = "=";
-            this.button_Equal.UseVisualStyleBackColor = true;
-            this.button_Equal.Click += new System.EventHandler(this.button_Equal_Click);
-            // 
-            // button_RightParenthesis
-            // 
-            this.button_RightParenthesis.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_RightParenthesis.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_RightParenthesis.Location = new System.Drawing.Point(174, 252);
-            this.button_RightParenthesis.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_RightParenthesis.Name = "button_RightParenthesis";
-            this.button_RightParenthesis.Size = new System.Drawing.Size(45, 52);
-            this.button_RightParenthesis.TabIndex = 13;
-            this.button_RightParenthesis.Text = ")";
-            this.button_RightParenthesis.UseVisualStyleBackColor = true;
-            this.button_RightParenthesis.Click += new System.EventHandler(this.button_RightParenthesis_Click);
-            // 
-            // button_LeftParenthesis
-            // 
-            this.button_LeftParenthesis.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_LeftParenthesis.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_LeftParenthesis.Location = new System.Drawing.Point(118, 252);
-            this.button_LeftParenthesis.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_LeftParenthesis.Name = "button_LeftParenthesis";
-            this.button_LeftParenthesis.Size = new System.Drawing.Size(45, 52);
-            this.button_LeftParenthesis.TabIndex = 12;
-            this.button_LeftParenthesis.Text = "(";
-            this.button_LeftParenthesis.UseVisualStyleBackColor = true;
-            this.button_LeftParenthesis.Click += new System.EventHandler(this.button_LeftParenthesis_Click);
-            // 
-            // button_Less
-            // 
-            this.button_Less.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Less.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Less.Location = new System.Drawing.Point(63, 252);
-            this.button_Less.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Less.Name = "button_Less";
-            this.button_Less.Size = new System.Drawing.Size(45, 52);
-            this.button_Less.TabIndex = 11;
-            this.button_Less.Text = "<";
-            this.button_Less.UseVisualStyleBackColor = true;
-            this.button_Less.Click += new System.EventHandler(this.button_Less_Click);
-            // 
-            // button_More
-            // 
-            this.button_More.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_More.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_More.Location = new System.Drawing.Point(8, 252);
-            this.button_More.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_More.Name = "button_More";
-            this.button_More.Size = new System.Drawing.Size(45, 52);
-            this.button_More.TabIndex = 10;
-            this.button_More.Text = ">";
-            this.button_More.UseVisualStyleBackColor = true;
-            this.button_More.Click += new System.EventHandler(this.button_More_Click);
-            // 
-            // button_Multiply
-            // 
-            this.button_Multiply.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Multiply.Font = new System.Drawing.Font("方正舒体", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Multiply.Location = new System.Drawing.Point(118, 178);
-            this.button_Multiply.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Multiply.Name = "button_Multiply";
-            this.button_Multiply.Size = new System.Drawing.Size(45, 52);
-            this.button_Multiply.TabIndex = 9;
-            this.button_Multiply.Text = "*";
-            this.button_Multiply.UseVisualStyleBackColor = true;
-            this.button_Multiply.Click += new System.EventHandler(this.button_Multiply_Click);
-            // 
-            // button_Subtract
-            // 
-            this.button_Subtract.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Subtract.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Subtract.Location = new System.Drawing.Point(63, 178);
-            this.button_Subtract.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Subtract.Name = "button_Subtract";
-            this.button_Subtract.Size = new System.Drawing.Size(45, 52);
-            this.button_Subtract.TabIndex = 7;
-            this.button_Subtract.Text = "-";
-            this.button_Subtract.UseVisualStyleBackColor = true;
-            this.button_Subtract.Click += new System.EventHandler(this.button_Subtract_Click);
-            // 
-            // button_Plus
-            // 
-            this.button_Plus.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
-            this.button_Plus.Font = new System.Drawing.Font("方正舒体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_Plus.Location = new System.Drawing.Point(8, 178);
-            this.button_Plus.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Plus.Name = "button_Plus";
-            this.button_Plus.Size = new System.Drawing.Size(45, 52);
-            this.button_Plus.TabIndex = 6;
-            this.button_Plus.Text = "+";
-            this.button_Plus.UseVisualStyleBackColor = true;
-            this.button_Plus.Click += new System.EventHandler(this.button_Plus_Click);
-            // 
-            // groupBox_XmlTree_MaxEDSRules
-            // 
-            this.groupBox_XmlTree_MaxEDSRules.Controls.Add(this.textBox_MaxEDSTime);
-            this.groupBox_XmlTree_MaxEDSRules.Location = new System.Drawing.Point(9, 30);
-            this.groupBox_XmlTree_MaxEDSRules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_XmlTree_MaxEDSRules.Name = "groupBox_XmlTree_MaxEDSRules";
-            this.groupBox_XmlTree_MaxEDSRules.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_XmlTree_MaxEDSRules.Size = new System.Drawing.Size(189, 88);
-            this.groupBox_XmlTree_MaxEDSRules.TabIndex = 30;
-            this.groupBox_XmlTree_MaxEDSRules.TabStop = false;
-            this.groupBox_XmlTree_MaxEDSRules.Text = "MaxEDSTime";
-            this.groupBox_XmlTree_MaxEDSRules.Click += new System.EventHandler(this.groupBox_XmlTree_MaxEDSRules_Click);
-            // 
-            // textBox_MaxEDSTime
-            // 
-            this.textBox_MaxEDSTime.Location = new System.Drawing.Point(18, 34);
-            this.textBox_MaxEDSTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_MaxEDSTime.Name = "textBox_MaxEDSTime";
-            this.textBox_MaxEDSTime.Size = new System.Drawing.Size(160, 31);
-            this.textBox_MaxEDSTime.TabIndex = 21;
-            this.textBox_MaxEDSTime.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // button_Backup
-            // 
-            this.button_Backup.Location = new System.Drawing.Point(6, 260);
-            this.button_Backup.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Backup.Name = "button_Backup";
-            this.button_Backup.Size = new System.Drawing.Size(195, 60);
-            this.button_Backup.TabIndex = 26;
-            this.button_Backup.Text = "导出";
-            this.button_Backup.UseVisualStyleBackColor = true;
-            this.button_Backup.Click += new System.EventHandler(this.button_Backup_Click);
-            // 
-            // groupBox_ChemicalElement
-            // 
-            this.groupBox_ChemicalElement.Controls.Add(this.comboBox_PeriodicTable);
-            this.groupBox_ChemicalElement.Location = new System.Drawing.Point(207, 27);
-            this.groupBox_ChemicalElement.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_ChemicalElement.Name = "groupBox_ChemicalElement";
-            this.groupBox_ChemicalElement.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_ChemicalElement.Size = new System.Drawing.Size(364, 69);
-            this.groupBox_ChemicalElement.TabIndex = 5;
-            this.groupBox_ChemicalElement.TabStop = false;
-            this.groupBox_ChemicalElement.Text = "化学元素";
-            this.groupBox_ChemicalElement.Click += new System.EventHandler(this.groupBox_ChemicalElement_Click);
-            // 
-            // comboBox_PeriodicTable
-            // 
-            this.comboBox_PeriodicTable.FormattingEnabled = true;
-            this.comboBox_PeriodicTable.Location = new System.Drawing.Point(148, 22);
-            this.comboBox_PeriodicTable.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.comboBox_PeriodicTable.Name = "comboBox_PeriodicTable";
-            this.comboBox_PeriodicTable.Size = new System.Drawing.Size(204, 32);
-            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.comboBox_Constants);
-            this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_DefinedConstant);
-            this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_Other);
-            this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_ElementFormTwo);
-            this.groupBox_OtherCommonlyUsedSymbols.Controls.Add(this.label_ElementFormOne);
-            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(207, 105);
-            this.groupBox_OtherCommonlyUsedSymbols.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_OtherCommonlyUsedSymbols.Name = "groupBox_OtherCommonlyUsedSymbols";
-            this.groupBox_OtherCommonlyUsedSymbols.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_OtherCommonlyUsedSymbols.Size = new System.Drawing.Size(364, 306);
-            this.groupBox_OtherCommonlyUsedSymbols.TabIndex = 3;
-            this.groupBox_OtherCommonlyUsedSymbols.TabStop = false;
-            this.groupBox_OtherCommonlyUsedSymbols.Text = "其它常用符号";
-            this.groupBox_OtherCommonlyUsedSymbols.Click += new System.EventHandler(this.groupBox_OtherCommonlyUsedSymbols_Click);
-            // 
-            // comboBox_Constants
-            // 
-            this.comboBox_Constants.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_Constants.FormattingEnabled = true;
-            this.comboBox_Constants.Location = new System.Drawing.Point(171, 246);
-            this.comboBox_Constants.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.comboBox_Constants.Name = "comboBox_Constants";
-            this.comboBox_Constants.Size = new System.Drawing.Size(181, 32);
-            this.comboBox_Constants.TabIndex = 5;
-            this.comboBox_Constants.SelectedIndexChanged += new System.EventHandler(this.comboBox_Constants_SelectedIndexChanged);
-            // 
-            // label_DefinedConstant
-            // 
-            this.label_DefinedConstant.AutoSize = true;
-            this.label_DefinedConstant.Location = new System.Drawing.Point(3, 252);
-            this.label_DefinedConstant.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_DefinedConstant.Name = "label_DefinedConstant";
-            this.label_DefinedConstant.Size = new System.Drawing.Size(118, 24);
-            this.label_DefinedConstant.TabIndex = 19;
-            this.label_DefinedConstant.Text = "已定义常数:";
-            // 
-            // label_Other
-            // 
-            this.label_Other.AutoSize = true;
-            this.label_Other.Location = new System.Drawing.Point(57, 182);
-            this.label_Other.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Other.Name = "label_Other";
-            this.label_Other.Size = new System.Drawing.Size(64, 24);
-            this.label_Other.TabIndex = 10;
-            this.label_Other.Text = "其它:";
-            // 
-            // label_ElementFormTwo
-            // 
-            this.label_ElementFormTwo.AutoSize = true;
-            this.label_ElementFormTwo.Location = new System.Drawing.Point(3, 116);
-            this.label_ElementFormTwo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_ElementFormTwo.Name = "label_ElementFormTwo";
-            this.label_ElementFormTwo.Size = new System.Drawing.Size(118, 24);
-            this.label_ElementFormTwo.TabIndex = 9;
-            this.label_ElementFormTwo.Text = "元素形式二:";
-            // 
-            // label_ElementFormOne
-            // 
-            this.label_ElementFormOne.AutoSize = true;
-            this.label_ElementFormOne.Location = new System.Drawing.Point(3, 46);
-            this.label_ElementFormOne.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_ElementFormOne.Name = "label_ElementFormOne";
-            this.label_ElementFormOne.Size = new System.Drawing.Size(118, 24);
-            this.label_ElementFormOne.TabIndex = 8;
-            this.label_ElementFormOne.Text = "元素形式一:";
-            // 
-            // comboBox_Elem1
-            // 
-            this.comboBox_Elem1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_Elem1.FormattingEnabled = true;
-            this.comboBox_Elem1.Location = new System.Drawing.Point(171, 39);
-            this.comboBox_Elem1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.comboBox_Elem1.Name = "comboBox_Elem1";
-            this.comboBox_Elem1.Size = new System.Drawing.Size(181, 32);
-            this.comboBox_Elem1.TabIndex = 2;
-            this.comboBox_Elem1.SelectedIndexChanged += new System.EventHandler(this.comboBox_Elem1_SelectedIndexChanged);
-            // 
-            // comboBox_Elem
-            // 
-            this.comboBox_Elem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_Elem.FormattingEnabled = true;
-            this.comboBox_Elem.Location = new System.Drawing.Point(171, 110);
-            this.comboBox_Elem.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.comboBox_Elem.Name = "comboBox_Elem";
-            this.comboBox_Elem.Size = new System.Drawing.Size(181, 32);
-            this.comboBox_Elem.TabIndex = 3;
-            this.comboBox_Elem.SelectedIndexChanged += new System.EventHandler(this.comboBox_Elem2_SelectedIndexChanged);
-            // 
-            // comboBox_ImgProperty
-            // 
-            this.comboBox_ImgProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox_ImgProperty.FormattingEnabled = true;
-            this.comboBox_ImgProperty.Location = new System.Drawing.Point(171, 176);
-            this.comboBox_ImgProperty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.comboBox_ImgProperty.Name = "comboBox_ImgProperty";
-            this.comboBox_ImgProperty.Size = new System.Drawing.Size(181, 32);
-            this.comboBox_ImgProperty.TabIndex = 4;
-            this.comboBox_ImgProperty.SelectedIndexChanged += new System.EventHandler(this.comboBox_ImgProperty_SelectedIndexChanged);
-            // 
-            // button_Recover
-            // 
-            this.button_Recover.Location = new System.Drawing.Point(6, 184);
-            this.button_Recover.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Recover.Name = "button_Recover";
-            this.button_Recover.Size = new System.Drawing.Size(195, 60);
-            this.button_Recover.TabIndex = 25;
-            this.button_Recover.Text = "恢复至出厂默认值";
-            this.button_Recover.UseVisualStyleBackColor = true;
-            this.button_Recover.Click += new System.EventHandler(this.button_Recover_Click);
-            // 
-            // btn_dbs
-            // 
-            this.btn_dbs.BackColor = System.Drawing.Color.White;
-            this.btn_dbs.Font = new System.Drawing.Font("宋体", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btn_dbs.Location = new System.Drawing.Point(750, 28);
-            this.btn_dbs.Name = "btn_dbs";
-            this.btn_dbs.Size = new System.Drawing.Size(124, 32);
-            this.btn_dbs.TabIndex = 20;
-            this.btn_dbs.Text = "[点击选择]";
-            this.btn_dbs.UseVisualStyleBackColor = false;
-            this.btn_dbs.Click += new System.EventHandler(this.btn_dbs_Click);
-            // 
-            // label_Color
-            // 
-            this.label_Color.AutoSize = true;
-            this.label_Color.Location = new System.Drawing.Point(692, 34);
-            this.label_Color.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Color.Name = "label_Color";
-            this.label_Color.Size = new System.Drawing.Size(64, 24);
-            this.label_Color.TabIndex = 1;
-            this.label_Color.Text = "颜色:";
-            // 
-            // groupBox_XmlTree_STDlist1
-            // 
-            this.groupBox_XmlTree_STDlist1.BackColor = System.Drawing.SystemColors.Control;
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.btn_dbs);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.textBox_Electrical_conductivity);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.textBox_Density);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.textBox_Element);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label_Element);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label_Conductivity);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label_Formula);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label__BSEValue);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.textBox_Formula);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label_Color);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.textBox_BSEValue);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label_Density);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.label_Hardness);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.textBox_Hardness);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.button_Ok);
-            this.groupBox_XmlTree_STDlist1.Controls.Add(this.button_Cancel);
-            this.groupBox_XmlTree_STDlist1.Location = new System.Drawing.Point(333, 752);
-            this.groupBox_XmlTree_STDlist1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_XmlTree_STDlist1.Name = "groupBox_XmlTree_STDlist1";
-            this.groupBox_XmlTree_STDlist1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.groupBox_XmlTree_STDlist1.Size = new System.Drawing.Size(890, 171);
-            this.groupBox_XmlTree_STDlist1.TabIndex = 22;
-            this.groupBox_XmlTree_STDlist1.TabStop = false;
-            this.groupBox_XmlTree_STDlist1.Text = "其他属性";
-            this.groupBox_XmlTree_STDlist1.Click += new System.EventHandler(this.groupBox_XmlTree_STDlist1_Click);
-            // 
-            // textBox_Electrical_conductivity
-            // 
-            this.textBox_Electrical_conductivity.Location = new System.Drawing.Point(550, 28);
-            this.textBox_Electrical_conductivity.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_Electrical_conductivity.Name = "textBox_Electrical_conductivity";
-            this.textBox_Electrical_conductivity.Size = new System.Drawing.Size(126, 31);
-            this.textBox_Electrical_conductivity.TabIndex = 19;
-            this.textBox_Electrical_conductivity.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_Density
-            // 
-            this.textBox_Density.Location = new System.Drawing.Point(300, 28);
-            this.textBox_Density.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_Density.Name = "textBox_Density";
-            this.textBox_Density.Size = new System.Drawing.Size(116, 31);
-            this.textBox_Density.TabIndex = 18;
-            this.textBox_Density.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_Element
-            // 
-            this.textBox_Element.Font = new System.Drawing.Font("宋体", 9F);
-            this.textBox_Element.Location = new System.Drawing.Point(550, 68);
-            this.textBox_Element.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_Element.MaxLength = 50;
-            this.textBox_Element.Name = "textBox_Element";
-            this.textBox_Element.Size = new System.Drawing.Size(319, 28);
-            this.textBox_Element.TabIndex = 32;
-            this.textBox_Element.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.textBox_Element.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox_KeyPress);
-            // 
-            // label_Element
-            // 
-            this.label_Element.AutoSize = true;
-            this.label_Element.Font = new System.Drawing.Font("宋体", 9F);
-            this.label_Element.Location = new System.Drawing.Point(428, 74);
-            this.label_Element.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Element.Name = "label_Element";
-            this.label_Element.Size = new System.Drawing.Size(80, 18);
-            this.label_Element.TabIndex = 35;
-            this.label_Element.Text = "Element:";
-            // 
-            // label_Conductivity
-            // 
-            this.label_Conductivity.AutoSize = true;
-            this.label_Conductivity.Location = new System.Drawing.Point(426, 34);
-            this.label_Conductivity.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Conductivity.Name = "label_Conductivity";
-            this.label_Conductivity.Size = new System.Drawing.Size(68, 24);
-            this.label_Conductivity.TabIndex = 26;
-            this.label_Conductivity.Text = "导电性:";
-            // 
-            // label_Formula
-            // 
-            this.label_Formula.AutoSize = true;
-            this.label_Formula.Font = new System.Drawing.Font("宋体", 9F);
-            this.label_Formula.Location = new System.Drawing.Point(219, 74);
-            this.label_Formula.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Formula.Name = "label_Formula";
-            this.label_Formula.Size = new System.Drawing.Size(80, 18);
-            this.label_Formula.TabIndex = 33;
-            this.label_Formula.Text = "Formula:";
-            // 
-            // label__BSEValue
-            // 
-            this.label__BSEValue.AutoSize = true;
-            this.label__BSEValue.Font = new System.Drawing.Font("宋体", 9F);
-            this.label__BSEValue.Location = new System.Drawing.Point(6, 74);
-            this.label__BSEValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label__BSEValue.Name = "label__BSEValue";
-            this.label__BSEValue.Size = new System.Drawing.Size(44, 18);
-            this.label__BSEValue.TabIndex = 34;
-            this.label__BSEValue.Text = "BSE:";
-            // 
-            // textBox_Formula
-            // 
-            this.textBox_Formula.Font = new System.Drawing.Font("宋体", 9F);
-            this.textBox_Formula.Location = new System.Drawing.Point(300, 68);
-            this.textBox_Formula.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_Formula.MaxLength = 50;
-            this.textBox_Formula.Name = "textBox_Formula";
-            this.textBox_Formula.Size = new System.Drawing.Size(116, 28);
-            this.textBox_Formula.TabIndex = 30;
-            this.textBox_Formula.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.textBox_Formula.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox_KeyPress);
-            // 
-            // textBox_BSEValue
-            // 
-            this.textBox_BSEValue.Font = new System.Drawing.Font("宋体", 9F);
-            this.textBox_BSEValue.Location = new System.Drawing.Point(94, 68);
-            this.textBox_BSEValue.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_BSEValue.MaxLength = 10;
-            this.textBox_BSEValue.Name = "textBox_BSEValue";
-            this.textBox_BSEValue.Size = new System.Drawing.Size(116, 28);
-            this.textBox_BSEValue.TabIndex = 31;
-            this.textBox_BSEValue.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            this.textBox_BSEValue.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox_KeyPress);
-            // 
-            // label_Density
-            // 
-            this.label_Density.AutoSize = true;
-            this.label_Density.Location = new System.Drawing.Point(219, 34);
-            this.label_Density.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Density.Name = "label_Density";
-            this.label_Density.Size = new System.Drawing.Size(50, 24);
-            this.label_Density.TabIndex = 25;
-            this.label_Density.Text = "密度:";
-            // 
-            // label_Hardness
-            // 
-            this.label_Hardness.AutoSize = true;
-            this.label_Hardness.Location = new System.Drawing.Point(6, 34);
-            this.label_Hardness.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_Hardness.Name = "label_Hardness";
-            this.label_Hardness.Size = new System.Drawing.Size(50, 24);
-            this.label_Hardness.TabIndex = 24;
-            this.label_Hardness.Text = "硬度:";
-            // 
-            // textBox_Hardness
-            // 
-            this.textBox_Hardness.Location = new System.Drawing.Point(94, 28);
-            this.textBox_Hardness.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_Hardness.Name = "textBox_Hardness";
-            this.textBox_Hardness.Size = new System.Drawing.Size(116, 31);
-            this.textBox_Hardness.TabIndex = 17;
-            this.textBox_Hardness.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // button_Ok
-            // 
-            this.button_Ok.Location = new System.Drawing.Point(606, 108);
-            this.button_Ok.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Ok.Name = "button_Ok";
-            this.button_Ok.Size = new System.Drawing.Size(129, 54);
-            this.button_Ok.TabIndex = 23;
-            this.button_Ok.Text = "确认";
-            this.button_Ok.UseVisualStyleBackColor = true;
-            this.button_Ok.Click += new System.EventHandler(this.button_Ok_Click);
-            // 
-            // button_Cancel
-            // 
-            this.button_Cancel.Location = new System.Drawing.Point(746, 108);
-            this.button_Cancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_Cancel.Name = "button_Cancel";
-            this.button_Cancel.Size = new System.Drawing.Size(129, 54);
-            this.button_Cancel.TabIndex = 24;
-            this.button_Cancel.Text = "离开";
-            this.button_Cancel.UseVisualStyleBackColor = true;
-            this.button_Cancel.Click += new System.EventHandler(this.button_Cancel_Click);
-            // 
-            // textbox_STDEditor
-            // 
-            this.textbox_STDEditor.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.textbox_STDEditor.Location = new System.Drawing.Point(9, 9);
-            this.textbox_STDEditor.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textbox_STDEditor.Multiline = true;
-            this.textbox_STDEditor.Name = "textbox_STDEditor";
-            this.textbox_STDEditor.Size = new System.Drawing.Size(822, 144);
-            this.textbox_STDEditor.TabIndex = 2;
-            this.textbox_STDEditor.TextChanged += new System.EventHandler(this.textbox_STDEditor_TextChanged);
-            this.textbox_STDEditor.Leave += new System.EventHandler(this.textbox_STDEditor_Leave);
-            // 
-            // XmlTreeMenuStrip
-            // 
-            this.XmlTreeMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
-            this.XmlTreeMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.新建标准库规则ToolStripMenuItem,
-            this.删除ToolStripMenuItem});
-            this.XmlTreeMenuStrip.Name = "XmlTreeMenuStrip";
-            this.XmlTreeMenuStrip.Size = new System.Drawing.Size(117, 60);
-            // 
-            // 新建标准库规则ToolStripMenuItem
-            // 
-            this.新建标准库规则ToolStripMenuItem.Name = "新建标准库规则ToolStripMenuItem";
-            this.新建标准库规则ToolStripMenuItem.Size = new System.Drawing.Size(116, 28);
-            this.新建标准库规则ToolStripMenuItem.Text = "新建";
-            this.新建标准库规则ToolStripMenuItem.Click += new System.EventHandler(this.AddTreeNode_Click);
-            // 
-            // 删除ToolStripMenuItem
-            // 
-            this.删除ToolStripMenuItem.Name = "删除ToolStripMenuItem";
-            this.删除ToolStripMenuItem.Size = new System.Drawing.Size(116, 28);
-            this.删除ToolStripMenuItem.Text = "删除";
-            this.删除ToolStripMenuItem.Click += new System.EventHandler(this.DeleteTreeNode_Click);
-            // 
-            // button_UpOrder
-            // 
-            this.button_UpOrder.Font = new System.Drawing.Font("华文彩云", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_UpOrder.Location = new System.Drawing.Point(2, 4);
-            this.button_UpOrder.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_UpOrder.Name = "button_UpOrder";
-            this.button_UpOrder.Size = new System.Drawing.Size(27, 108);
-            this.button_UpOrder.TabIndex = 26;
-            this.button_UpOrder.Text = "↑";
-            this.button_UpOrder.UseVisualStyleBackColor = true;
-            this.button_UpOrder.Click += new System.EventHandler(this.button_UpOrder_Click);
-            // 
-            // button_DownOrder
-            // 
-            this.button_DownOrder.Font = new System.Drawing.Font("华文彩云", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_DownOrder.Location = new System.Drawing.Point(2, 122);
-            this.button_DownOrder.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_DownOrder.Name = "button_DownOrder";
-            this.button_DownOrder.Size = new System.Drawing.Size(27, 108);
-            this.button_DownOrder.TabIndex = 27;
-            this.button_DownOrder.Text = "↓";
-            this.button_DownOrder.UseVisualStyleBackColor = true;
-            this.button_DownOrder.Click += new System.EventHandler(this.button_DownOrder_Click);
-            // 
-            // tabControl_Rules
-            // 
-            this.tabControl_Rules.Alignment = System.Windows.Forms.TabAlignment.Right;
-            this.tabControl_Rules.Controls.Add(this.tabPage_ClassificationRules);
-            this.tabControl_Rules.Controls.Add(this.tabPage_MaxEDSRules);
-            this.tabControl_Rules.Controls.Add(this.tabPage_ZeroElementRules);
-            this.tabControl_Rules.Controls.Add(this.tabPage_UserConstants);
-            this.tabControl_Rules.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.tabControl_Rules.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-            this.tabControl_Rules.ItemSize = new System.Drawing.Size(190, 20);
-            this.tabControl_Rules.Location = new System.Drawing.Point(4, 14);
-            this.tabControl_Rules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabControl_Rules.Multiline = true;
-            this.tabControl_Rules.Name = "tabControl_Rules";
-            this.tabControl_Rules.SelectedIndex = 0;
-            this.tabControl_Rules.Size = new System.Drawing.Size(326, 909);
-            this.tabControl_Rules.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
-            this.tabControl_Rules.TabIndex = 20;
-            this.tabControl_Rules.SelectedIndexChanged += new System.EventHandler(this.tabControl_Rules_SelectedIndexChanged);
-            this.tabControl_Rules.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabControl_Rules_Selecting);
-            this.tabControl_Rules.Deselecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabControl_Rules_Deselecting);
-            // 
-            // tabPage_ClassificationRules
-            // 
-            this.tabPage_ClassificationRules.Controls.Add(this.button_SpecialOrder);
-            this.tabPage_ClassificationRules.Controls.Add(this.button_UpOrder);
-            this.tabPage_ClassificationRules.Controls.Add(this.button_DownOrder);
-            this.tabPage_ClassificationRules.Controls.Add(this.XmlTree_STDlist);
-            this.tabPage_ClassificationRules.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.tabPage_ClassificationRules.Location = new System.Drawing.Point(4, 4);
-            this.tabPage_ClassificationRules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_ClassificationRules.Name = "tabPage_ClassificationRules";
-            this.tabPage_ClassificationRules.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_ClassificationRules.Size = new System.Drawing.Size(298, 901);
-            this.tabPage_ClassificationRules.TabIndex = 0;
-            this.tabPage_ClassificationRules.Text = "Classification Rules";
-            // 
-            // button_SpecialOrder
-            // 
-            this.button_SpecialOrder.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_SpecialOrder.Location = new System.Drawing.Point(2, 262);
-            this.button_SpecialOrder.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_SpecialOrder.Name = "button_SpecialOrder";
-            this.button_SpecialOrder.Size = new System.Drawing.Size(27, 291);
-            this.button_SpecialOrder.TabIndex = 29;
-            this.button_SpecialOrder.Text = "特殊排序";
-            this.button_SpecialOrder.UseVisualStyleBackColor = true;
-            this.button_SpecialOrder.Visible = false;
-            // 
-            // XmlTree_STDlist
-            // 
-            this.XmlTree_STDlist.ContextMenuStrip = this.XmlTreeMenuStrip;
-            this.XmlTree_STDlist.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.XmlTree_STDlist.HideSelection = false;
-            this.XmlTree_STDlist.Location = new System.Drawing.Point(30, 0);
-            this.XmlTree_STDlist.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.XmlTree_STDlist.Name = "XmlTree_STDlist";
-            this.XmlTree_STDlist.Size = new System.Drawing.Size(217, 895);
-            this.XmlTree_STDlist.TabIndex = 1;
-            this.XmlTree_STDlist.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.XmlTree_STDlist_BeforeSelect);
-            this.XmlTree_STDlist.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.XmlTree_STDlist_AfterSelect);
-            this.XmlTree_STDlist.MouseClick += new System.Windows.Forms.MouseEventHandler(this.XmlTree_STDlist_MouseClick);
-            this.XmlTree_STDlist.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.XmlTree_STDlist_MouseDoubleClick);
-            // 
-            // tabPage_MaxEDSRules
-            // 
-            this.tabPage_MaxEDSRules.Controls.Add(this.XmlTree_MaxEDSRules);
-            this.tabPage_MaxEDSRules.Location = new System.Drawing.Point(4, 4);
-            this.tabPage_MaxEDSRules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_MaxEDSRules.Name = "tabPage_MaxEDSRules";
-            this.tabPage_MaxEDSRules.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_MaxEDSRules.Size = new System.Drawing.Size(278, 901);
-            this.tabPage_MaxEDSRules.TabIndex = 1;
-            this.tabPage_MaxEDSRules.Text = "Max EDS Rules";
-            this.tabPage_MaxEDSRules.UseVisualStyleBackColor = true;
-            // 
-            // XmlTree_MaxEDSRules
-            // 
-            this.XmlTree_MaxEDSRules.ContextMenuStrip = this.XmlTreeMenuStrip;
-            this.XmlTree_MaxEDSRules.HideSelection = false;
-            this.XmlTree_MaxEDSRules.Location = new System.Drawing.Point(0, 3);
-            this.XmlTree_MaxEDSRules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.XmlTree_MaxEDSRules.Name = "XmlTree_MaxEDSRules";
-            this.XmlTree_MaxEDSRules.Size = new System.Drawing.Size(252, 892);
-            this.XmlTree_MaxEDSRules.TabIndex = 2;
-            this.XmlTree_MaxEDSRules.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.XmlTree_MaxEDSRules_BeforeSelect);
-            this.XmlTree_MaxEDSRules.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.XmlTree_MaxEDSRules_AfterSelect);
-            this.XmlTree_MaxEDSRules.MouseClick += new System.Windows.Forms.MouseEventHandler(this.XmlTree_MaxEDSRules_MouseClick);
-            // 
-            // tabPage_ZeroElementRules
-            // 
-            this.tabPage_ZeroElementRules.Controls.Add(this.XmlTree_ZeroElementRules);
-            this.tabPage_ZeroElementRules.Location = new System.Drawing.Point(4, 4);
-            this.tabPage_ZeroElementRules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_ZeroElementRules.Name = "tabPage_ZeroElementRules";
-            this.tabPage_ZeroElementRules.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_ZeroElementRules.Size = new System.Drawing.Size(278, 901);
-            this.tabPage_ZeroElementRules.TabIndex = 2;
-            this.tabPage_ZeroElementRules.Text = "Zero Element Rules";
-            this.tabPage_ZeroElementRules.UseVisualStyleBackColor = true;
-            // 
-            // XmlTree_ZeroElementRules
-            // 
-            this.XmlTree_ZeroElementRules.ContextMenuStrip = this.XmlTreeMenuStrip;
-            this.XmlTree_ZeroElementRules.HideSelection = false;
-            this.XmlTree_ZeroElementRules.Location = new System.Drawing.Point(4, 4);
-            this.XmlTree_ZeroElementRules.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.XmlTree_ZeroElementRules.Name = "XmlTree_ZeroElementRules";
-            this.XmlTree_ZeroElementRules.Size = new System.Drawing.Size(247, 890);
-            this.XmlTree_ZeroElementRules.TabIndex = 2;
-            this.XmlTree_ZeroElementRules.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.XmlTree_ZeroElementRules_BeforeSelect);
-            this.XmlTree_ZeroElementRules.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.XmlTree_ZeroElementRules_AfterSelect);
-            this.XmlTree_ZeroElementRules.MouseClick += new System.Windows.Forms.MouseEventHandler(this.XmlTree_ZeroElementRules_MouseClick);
-            this.XmlTree_ZeroElementRules.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.XmlTree_ZeroElementRules_MouseDoubleClick);
-            // 
-            // tabPage_UserConstants
-            // 
-            this.tabPage_UserConstants.Controls.Add(this.button_UpdateConstants);
-            this.tabPage_UserConstants.Controls.Add(this.label_ConstantValue);
-            this.tabPage_UserConstants.Controls.Add(this.label_ConstantSymbol);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_3);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_0);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_9);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_0);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_9);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_1);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_8);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_1);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_8);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_2);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_7);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_2);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_7);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_3);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_6);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_4);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_6);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_4);
-            this.tabPage_UserConstants.Controls.Add(this.textBox_5);
-            this.tabPage_UserConstants.Controls.Add(this.checkBox_5);
-            this.tabPage_UserConstants.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.tabPage_UserConstants.Location = new System.Drawing.Point(4, 4);
-            this.tabPage_UserConstants.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_UserConstants.Name = "tabPage_UserConstants";
-            this.tabPage_UserConstants.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabPage_UserConstants.Size = new System.Drawing.Size(278, 901);
-            this.tabPage_UserConstants.TabIndex = 3;
-            this.tabPage_UserConstants.Text = "User Constants";
-            this.tabPage_UserConstants.UseVisualStyleBackColor = true;
-            // 
-            // button_UpdateConstants
-            // 
-            this.button_UpdateConstants.Location = new System.Drawing.Point(14, 626);
-            this.button_UpdateConstants.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.button_UpdateConstants.Name = "button_UpdateConstants";
-            this.button_UpdateConstants.Size = new System.Drawing.Size(222, 32);
-            this.button_UpdateConstants.TabIndex = 27;
-            this.button_UpdateConstants.Text = "确认更新常数库";
-            this.button_UpdateConstants.UseVisualStyleBackColor = true;
-            this.button_UpdateConstants.Click += new System.EventHandler(this.button_UpdateConstants_Click);
-            // 
-            // label_ConstantValue
-            // 
-            this.label_ConstantValue.AutoSize = true;
-            this.label_ConstantValue.Location = new System.Drawing.Point(142, 18);
-            this.label_ConstantValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_ConstantValue.Name = "label_ConstantValue";
-            this.label_ConstantValue.Size = new System.Drawing.Size(26, 18);
-            this.label_ConstantValue.TabIndex = 26;
-            this.label_ConstantValue.Text = "值";
-            // 
-            // label_ConstantSymbol
-            // 
-            this.label_ConstantSymbol.AutoSize = true;
-            this.label_ConstantSymbol.Location = new System.Drawing.Point(24, 18);
-            this.label_ConstantSymbol.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_ConstantSymbol.Name = "label_ConstantSymbol";
-            this.label_ConstantSymbol.Size = new System.Drawing.Size(44, 18);
-            this.label_ConstantSymbol.TabIndex = 25;
-            this.label_ConstantSymbol.Text = "符号";
-            // 
-            // checkBox_3
-            // 
-            this.checkBox_3.AutoSize = true;
-            this.checkBox_3.Location = new System.Drawing.Point(14, 226);
-            this.checkBox_3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_3.Name = "checkBox_3";
-            this.checkBox_3.Size = new System.Drawing.Size(79, 22);
-            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);
-            // 
-            // checkBox_0
-            // 
-            this.checkBox_0.AutoSize = true;
-            this.checkBox_0.Location = new System.Drawing.Point(14, 60);
-            this.checkBox_0.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_0.Name = "checkBox_0";
-            this.checkBox_0.Size = new System.Drawing.Size(79, 22);
-            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);
-            // 
-            // textBox_9
-            // 
-            this.textBox_9.Location = new System.Drawing.Point(100, 562);
-            this.textBox_9.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_9.Name = "textBox_9";
-            this.textBox_9.Size = new System.Drawing.Size(110, 28);
-            this.textBox_9.TabIndex = 20;
-            this.textBox_9.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_0
-            // 
-            this.textBox_0.Location = new System.Drawing.Point(100, 57);
-            this.textBox_0.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_0.Name = "textBox_0";
-            this.textBox_0.Size = new System.Drawing.Size(110, 28);
-            this.textBox_0.TabIndex = 2;
-            this.textBox_0.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // checkBox_9
-            // 
-            this.checkBox_9.AutoSize = true;
-            this.checkBox_9.Location = new System.Drawing.Point(14, 567);
-            this.checkBox_9.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_9.Name = "checkBox_9";
-            this.checkBox_9.Size = new System.Drawing.Size(79, 22);
-            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);
-            // 
-            // checkBox_1
-            // 
-            this.checkBox_1.AutoSize = true;
-            this.checkBox_1.Location = new System.Drawing.Point(14, 116);
-            this.checkBox_1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_1.Name = "checkBox_1";
-            this.checkBox_1.Size = new System.Drawing.Size(79, 22);
-            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_8
-            // 
-            this.textBox_8.Location = new System.Drawing.Point(100, 506);
-            this.textBox_8.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_8.Name = "textBox_8";
-            this.textBox_8.Size = new System.Drawing.Size(110, 28);
-            this.textBox_8.TabIndex = 18;
-            this.textBox_8.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_1
-            // 
-            this.textBox_1.Location = new System.Drawing.Point(100, 111);
-            this.textBox_1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_1.Name = "textBox_1";
-            this.textBox_1.Size = new System.Drawing.Size(110, 28);
-            this.textBox_1.TabIndex = 4;
-            this.textBox_1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // checkBox_8
-            // 
-            this.checkBox_8.AutoSize = true;
-            this.checkBox_8.Location = new System.Drawing.Point(14, 510);
-            this.checkBox_8.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_8.Name = "checkBox_8";
-            this.checkBox_8.Size = new System.Drawing.Size(79, 22);
-            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);
-            // 
-            // checkBox_2
-            // 
-            this.checkBox_2.AutoSize = true;
-            this.checkBox_2.Location = new System.Drawing.Point(14, 170);
-            this.checkBox_2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_2.Name = "checkBox_2";
-            this.checkBox_2.Size = new System.Drawing.Size(79, 22);
-            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_7
-            // 
-            this.textBox_7.Location = new System.Drawing.Point(100, 448);
-            this.textBox_7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_7.Name = "textBox_7";
-            this.textBox_7.Size = new System.Drawing.Size(110, 28);
-            this.textBox_7.TabIndex = 16;
-            this.textBox_7.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_2
-            // 
-            this.textBox_2.Location = new System.Drawing.Point(100, 166);
-            this.textBox_2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_2.Name = "textBox_2";
-            this.textBox_2.Size = new System.Drawing.Size(110, 28);
-            this.textBox_2.TabIndex = 6;
-            this.textBox_2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // checkBox_7
-            // 
-            this.checkBox_7.AutoSize = true;
-            this.checkBox_7.Location = new System.Drawing.Point(14, 453);
-            this.checkBox_7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_7.Name = "checkBox_7";
-            this.checkBox_7.Size = new System.Drawing.Size(79, 22);
-            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_3
-            // 
-            this.textBox_3.Location = new System.Drawing.Point(100, 222);
-            this.textBox_3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_3.Name = "textBox_3";
-            this.textBox_3.Size = new System.Drawing.Size(110, 28);
-            this.textBox_3.TabIndex = 8;
-            this.textBox_3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_6
-            // 
-            this.textBox_6.Location = new System.Drawing.Point(100, 393);
-            this.textBox_6.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_6.Name = "textBox_6";
-            this.textBox_6.Size = new System.Drawing.Size(110, 28);
-            this.textBox_6.TabIndex = 14;
-            this.textBox_6.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // checkBox_4
-            // 
-            this.checkBox_4.AutoSize = true;
-            this.checkBox_4.Location = new System.Drawing.Point(14, 284);
-            this.checkBox_4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_4.Name = "checkBox_4";
-            this.checkBox_4.Size = new System.Drawing.Size(79, 22);
-            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);
-            // 
-            // checkBox_6
-            // 
-            this.checkBox_6.AutoSize = true;
-            this.checkBox_6.Location = new System.Drawing.Point(14, 399);
-            this.checkBox_6.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_6.Name = "checkBox_6";
-            this.checkBox_6.Size = new System.Drawing.Size(79, 22);
-            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_4
-            // 
-            this.textBox_4.Location = new System.Drawing.Point(100, 279);
-            this.textBox_4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_4.Name = "textBox_4";
-            this.textBox_4.Size = new System.Drawing.Size(110, 28);
-            this.textBox_4.TabIndex = 10;
-            this.textBox_4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // textBox_5
-            // 
-            this.textBox_5.Location = new System.Drawing.Point(100, 336);
-            this.textBox_5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.textBox_5.Name = "textBox_5";
-            this.textBox_5.Size = new System.Drawing.Size(110, 28);
-            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(14, 339);
-            this.checkBox_5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.checkBox_5.Name = "checkBox_5";
-            this.checkBox_5.Size = new System.Drawing.Size(79, 22);
-            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);
-            // 
-            // label_SubElements
-            // 
-            this.label_SubElements.AutoSize = true;
-            this.label_SubElements.Location = new System.Drawing.Point(9, 225);
-            this.label_SubElements.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_SubElements.Name = "label_SubElements";
-            this.label_SubElements.Size = new System.Drawing.Size(100, 24);
-            this.label_SubElements.TabIndex = 26;
-            this.label_SubElements.Text = "次要元素:";
-            // 
-            // label_KeyElements
-            // 
-            this.label_KeyElements.AutoSize = true;
-            this.label_KeyElements.Location = new System.Drawing.Point(9, 174);
-            this.label_KeyElements.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label_KeyElements.Name = "label_KeyElements";
-            this.label_KeyElements.Size = new System.Drawing.Size(100, 24);
-            this.label_KeyElements.TabIndex = 25;
-            this.label_KeyElements.Text = "关键元素:";
-            // 
-            // dataGridView_KeyElements
-            // 
-            this.dataGridView_KeyElements.BackgroundColor = System.Drawing.SystemColors.Control;
-            this.dataGridView_KeyElements.BorderStyle = System.Windows.Forms.BorderStyle.None;
-            this.dataGridView_KeyElements.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView_KeyElements.Location = new System.Drawing.Point(116, 164);
-            this.dataGridView_KeyElements.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.dataGridView_KeyElements.Name = "dataGridView_KeyElements";
-            this.dataGridView_KeyElements.RowTemplate.Height = 23;
-            this.dataGridView_KeyElements.Size = new System.Drawing.Size(754, 42);
-            this.dataGridView_KeyElements.TabIndex = 27;
-            this.dataGridView_KeyElements.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_KeyElements_CellClick);
-            // 
-            // dataGridView_SubElements
-            // 
-            this.dataGridView_SubElements.BackgroundColor = System.Drawing.SystemColors.Control;
-            this.dataGridView_SubElements.BorderStyle = System.Windows.Forms.BorderStyle.None;
-            this.dataGridView_SubElements.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dataGridView_SubElements.Location = new System.Drawing.Point(116, 214);
-            this.dataGridView_SubElements.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.dataGridView_SubElements.Name = "dataGridView_SubElements";
-            this.dataGridView_SubElements.RowTemplate.Height = 23;
-            this.dataGridView_SubElements.Size = new System.Drawing.Size(754, 42);
-            this.dataGridView_SubElements.TabIndex = 28;
-            this.dataGridView_SubElements.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_SubElements_CellClick);
-            // 
-            // tabSTDStandrad
-            // 
-            this.tabSTDStandrad.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
-            this.tabSTDStandrad.Controls.Add(this.tabSTD);
-            this.tabSTDStandrad.Controls.Add(this.tabXray);
-            this.tabSTDStandrad.Location = new System.Drawing.Point(333, 15);
-            this.tabSTDStandrad.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabSTDStandrad.Name = "tabSTDStandrad";
-            this.tabSTDStandrad.SelectedIndex = 0;
-            this.tabSTDStandrad.Size = new System.Drawing.Size(896, 728);
-            this.tabSTDStandrad.TabIndex = 29;
-            this.tabSTDStandrad.SelectedIndexChanged += new System.EventHandler(this.tabSTDStandrad_SelectedIndexChanged);
-            // 
-            // tabSTD
-            // 
-            this.tabSTD.BackColor = System.Drawing.SystemColors.Control;
-            this.tabSTD.Controls.Add(this.textbox_STDEditor);
-            this.tabSTD.Controls.Add(this.groupBox_Data);
-            this.tabSTD.Controls.Add(this.dataGridView_SubElements);
-            this.tabSTD.Controls.Add(this.PeriodicTableSwitch);
-            this.tabSTD.Controls.Add(this.dataGridView_KeyElements);
-            this.tabSTD.Controls.Add(this.label_KeyElements);
-            this.tabSTD.Controls.Add(this.label_SubElements);
-            this.tabSTD.Location = new System.Drawing.Point(4, 36);
-            this.tabSTD.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabSTD.Name = "tabSTD";
-            this.tabSTD.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabSTD.Size = new System.Drawing.Size(888, 688);
-            this.tabSTD.TabIndex = 0;
-            this.tabSTD.Text = "STD";
-            // 
-            // PeriodicTableSwitch
-            // 
-            this.PeriodicTableSwitch.BackColor = System.Drawing.SystemColors.Control;
-            this.PeriodicTableSwitch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
-            this.PeriodicTableSwitch.Font = new System.Drawing.Font("黑体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PeriodicTableSwitch.Location = new System.Drawing.Point(836, 9);
-            this.PeriodicTableSwitch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.PeriodicTableSwitch.Name = "PeriodicTableSwitch";
-            this.PeriodicTableSwitch.Size = new System.Drawing.Size(44, 146);
-            this.PeriodicTableSwitch.TabIndex = 22;
-            this.PeriodicTableSwitch.UseVisualStyleBackColor = false;
-            this.PeriodicTableSwitch.Click += new System.EventHandler(this.PeriodicTableSwitch_Click);
-            // 
-            // tabXray
-            // 
-            this.tabXray.Controls.Add(this.panel1);
-            this.tabXray.Controls.Add(this.plXray);
-            this.tabXray.Location = new System.Drawing.Point(4, 36);
-            this.tabXray.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabXray.Name = "tabXray";
-            this.tabXray.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.tabXray.Size = new System.Drawing.Size(888, 688);
-            this.tabXray.TabIndex = 1;
-            this.tabXray.Text = "Xray";
-            this.tabXray.UseVisualStyleBackColor = true;
-            // 
-            // panel1
-            // 
-            this.panel1.Controls.Add(this.btnTest);
-            this.panel1.Controls.Add(this.label9);
-            this.panel1.Controls.Add(this.txtCollectTime);
-            this.panel1.Controls.Add(this.btnReadXray);
-            this.panel1.Controls.Add(this.btnCollectXray);
-            this.panel1.Controls.Add(this.label2);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
-            this.panel1.Location = new System.Drawing.Point(4, 4);
-            this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(880, 56);
-            this.panel1.TabIndex = 17;
-            // 
-            // btnTest
-            // 
-            this.btnTest.Location = new System.Drawing.Point(748, 9);
-            this.btnTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.btnTest.Name = "btnTest";
-            this.btnTest.Size = new System.Drawing.Size(112, 34);
-            this.btnTest.TabIndex = 33;
-            this.btnTest.Text = "Test";
-            this.btnTest.UseVisualStyleBackColor = true;
-            this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("宋体", 9F);
-            this.label9.Location = new System.Drawing.Point(218, 20);
-            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(26, 18);
-            this.label9.TabIndex = 32;
-            this.label9.Text = "MS";
-            // 
-            // txtCollectTime
-            // 
-            this.txtCollectTime.Location = new System.Drawing.Point(129, 12);
-            this.txtCollectTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.txtCollectTime.Name = "txtCollectTime";
-            this.txtCollectTime.Size = new System.Drawing.Size(82, 31);
-            this.txtCollectTime.TabIndex = 28;
-            this.txtCollectTime.Text = "120";
-            this.txtCollectTime.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // btnReadXray
-            // 
-            this.btnReadXray.Location = new System.Drawing.Point(357, 9);
-            this.btnReadXray.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.btnReadXray.Name = "btnReadXray";
-            this.btnReadXray.Size = new System.Drawing.Size(218, 34);
-            this.btnReadXray.TabIndex = 31;
-            this.btnReadXray.TabStop = false;
-            this.btnReadXray.Text = "ImportXrayFile";
-            this.btnReadXray.UseVisualStyleBackColor = true;
-            this.btnReadXray.Click += new System.EventHandler(this.btnReadXray_Click);
-            // 
-            // btnCollectXray
-            // 
-            this.btnCollectXray.Location = new System.Drawing.Point(246, 10);
-            this.btnCollectXray.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.btnCollectXray.Name = "btnCollectXray";
-            this.btnCollectXray.Size = new System.Drawing.Size(102, 34);
-            this.btnCollectXray.TabIndex = 30;
-            this.btnCollectXray.TabStop = false;
-            this.btnCollectXray.Text = "Collect";
-            this.btnCollectXray.UseVisualStyleBackColor = true;
-            this.btnCollectXray.Click += new System.EventHandler(this.btnCollectXray_Click);
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("宋体", 9F);
-            this.label2.Location = new System.Drawing.Point(4, 18);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(125, 18);
-            this.label2.TabIndex = 29;
-            this.label2.Text = "Collect Time:";
-            // 
-            // plXray
-            // 
-            this.plXray.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.plXray.Location = new System.Drawing.Point(4, 58);
-            this.plXray.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.plXray.Name = "plXray";
-            this.plXray.Size = new System.Drawing.Size(880, 626);
-            this.plXray.TabIndex = 16;
-            // 
-            // panel_OTSPeriodicTable
-            // 
-            this.panel_OTSPeriodicTable.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
-            this.panel_OTSPeriodicTable.Location = new System.Drawing.Point(1236, 27);
-            this.panel_OTSPeriodicTable.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.panel_OTSPeriodicTable.Name = "panel_OTSPeriodicTable";
-            this.panel_OTSPeriodicTable.Size = new System.Drawing.Size(1044, 864);
-            this.panel_OTSPeriodicTable.TabIndex = 4;
-            this.panel_OTSPeriodicTable.Visible = false;
-            // 
-            // Form_STDConstantsEditor
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
-            this.AutoScroll = true;
-            this.ClientSize = new System.Drawing.Size(2298, 926);
-            this.Controls.Add(this.tabSTDStandrad);
-            this.Controls.Add(this.tabControl_Rules);
-            this.Controls.Add(this.panel_OTSPeriodicTable);
-            this.Controls.Add(this.groupBox_XmlTree_STDlist1);
-            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.MaximizeBox = false;
-            this.Name = "Form_STDConstantsEditor";
-            this.ShowIcon = false;
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "标准库编辑器";
-            this.Load += new System.EventHandler(this.Form_ConstantsEditor_Load);
-            this.groupBox_Data.ResumeLayout(false);
-            this.groupBox_CalculatingSymbols.ResumeLayout(false);
-            this.groupBox_XmlTree_MaxEDSRules.ResumeLayout(false);
-            this.groupBox_XmlTree_MaxEDSRules.PerformLayout();
-            this.groupBox_ChemicalElement.ResumeLayout(false);
-            this.groupBox_OtherCommonlyUsedSymbols.ResumeLayout(false);
-            this.groupBox_OtherCommonlyUsedSymbols.PerformLayout();
-            this.groupBox_XmlTree_STDlist1.ResumeLayout(false);
-            this.groupBox_XmlTree_STDlist1.PerformLayout();
-            this.XmlTreeMenuStrip.ResumeLayout(false);
-            this.tabControl_Rules.ResumeLayout(false);
-            this.tabPage_ClassificationRules.ResumeLayout(false);
-            this.tabPage_MaxEDSRules.ResumeLayout(false);
-            this.tabPage_ZeroElementRules.ResumeLayout(false);
-            this.tabPage_UserConstants.ResumeLayout(false);
-            this.tabPage_UserConstants.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_KeyElements)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_SubElements)).EndInit();
-            this.tabSTDStandrad.ResumeLayout(false);
-            this.tabSTD.ResumeLayout(false);
-            this.tabSTD.PerformLayout();
-            this.tabXray.ResumeLayout(false);
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.GroupBox groupBox_Data;
-        private System.Windows.Forms.Button button_Ok;
-        private System.Windows.Forms.Button button_Cancel;
-        private System.Windows.Forms.Button PeriodicTableSwitch;
-        private System.Windows.Forms.TextBox textbox_STDEditor;
-        private System.Windows.Forms.ComboBox comboBox_Elem;
-        private System.Windows.Forms.ComboBox comboBox_ImgProperty;
-        private System.Windows.Forms.ComboBox comboBox_Elem1;
-        private System.Windows.Forms.GroupBox groupBox_OtherCommonlyUsedSymbols;
-        private System.Windows.Forms.ContextMenuStrip XmlTreeMenuStrip;
-        private System.Windows.Forms.ToolStripMenuItem 新建标准库规则ToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem 删除ToolStripMenuItem;
-        private System.Windows.Forms.Label label_Other;
-        private System.Windows.Forms.Label label_ElementFormTwo;
-        private System.Windows.Forms.Label label_ElementFormOne;
-        private System.Windows.Forms.Panel panel_OTSPeriodicTable;
-        private System.Windows.Forms.GroupBox groupBox_ChemicalElement;
-        private System.Windows.Forms.ComboBox comboBox_PeriodicTable;
-        public System.Windows.Forms.Button btn_dbs;
-        private System.Windows.Forms.Label label_Color;
-        private System.Windows.Forms.GroupBox groupBox_XmlTree_STDlist1;
-        private System.Windows.Forms.Label label_Conductivity;
-        private System.Windows.Forms.Label label_Density;
-        private System.Windows.Forms.Label label_Hardness;
-        private System.Windows.Forms.TextBox textBox_Electrical_conductivity;
-        private System.Windows.Forms.TextBox textBox_Density;
-        private System.Windows.Forms.TextBox textBox_Hardness;
-        private System.Windows.Forms.Label label_DefinedConstant;
-        private System.Windows.Forms.ComboBox comboBox_Constants;
-        private System.Windows.Forms.Button button_Backup;
-        private System.Windows.Forms.Button button_Recover;
-        private System.Windows.Forms.Button button_UpOrder;
-        private System.Windows.Forms.Button button_DownOrder;
-        private System.Windows.Forms.TabControl tabControl_Rules;
-        private System.Windows.Forms.TabPage tabPage_ClassificationRules;
-        private System.Windows.Forms.TabPage tabPage_MaxEDSRules;
-        private System.Windows.Forms.TabPage tabPage_ZeroElementRules;
-        private System.Windows.Forms.TabPage tabPage_UserConstants;
-        private System.Windows.Forms.Button button_SpecialOrder;
-        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;
-        private System.Windows.Forms.TreeView XmlTree_MaxEDSRules;
-        private System.Windows.Forms.TreeView XmlTree_ZeroElementRules;
-        private System.Windows.Forms.GroupBox groupBox_XmlTree_MaxEDSRules;
-        private System.Windows.Forms.TextBox textBox_MaxEDSTime;
-        private System.Windows.Forms.Label label_SubElements;
-        private System.Windows.Forms.TreeView XmlTree_STDlist;
-        private System.Windows.Forms.Label label_KeyElements;
-        private System.Windows.Forms.DataGridView dataGridView_KeyElements;
-        private System.Windows.Forms.DataGridView dataGridView_SubElements;
-        private System.Windows.Forms.TabControl tabSTDStandrad;
-        private System.Windows.Forms.TabPage tabSTD;
-        private System.Windows.Forms.TabPage tabXray;
-        private System.Windows.Forms.Panel plXray;
-        private System.Windows.Forms.Label label_Element;
-        private System.Windows.Forms.TextBox textBox_Element;
-        private System.Windows.Forms.Label label__BSEValue;
-        private System.Windows.Forms.TextBox textBox_BSEValue;
-        private System.Windows.Forms.Label label_Formula;
-        private System.Windows.Forms.TextBox textBox_Formula;
-        private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Label label9;
-        private System.Windows.Forms.TextBox txtCollectTime;
-        private System.Windows.Forms.Button btnReadXray;
-        private System.Windows.Forms.Button btnCollectXray;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Button button_UpdateConstants;
-        private System.Windows.Forms.Label label_ConstantValue;
-        private System.Windows.Forms.Label label_ConstantSymbol;
-        private System.Windows.Forms.GroupBox groupBox_CalculatingSymbols;
-        private System.Windows.Forms.Button button_0;
-        private System.Windows.Forms.Button button_9;
-        private System.Windows.Forms.Button button_4;
-        private System.Windows.Forms.Button button_5;
-        private System.Windows.Forms.Button button_6;
-        private System.Windows.Forms.Button button_7;
-        private System.Windows.Forms.Button button_8;
-        private System.Windows.Forms.Button button_Divide;
-        private System.Windows.Forms.Button button_Or;
-        private System.Windows.Forms.Button button_And;
-        private System.Windows.Forms.Button button_3;
-        private System.Windows.Forms.Button button_2;
-        private System.Windows.Forms.Button button_1;
-        private System.Windows.Forms.Button button_Equal;
-        private System.Windows.Forms.Button button_RightParenthesis;
-        private System.Windows.Forms.Button button_LeftParenthesis;
-        private System.Windows.Forms.Button button_Less;
-        private System.Windows.Forms.Button button_More;
-        private System.Windows.Forms.Button button_Multiply;
-        private System.Windows.Forms.Button button_Subtract;
-        private System.Windows.Forms.Button button_Plus;
-        private System.Windows.Forms.Button btnTest;
-    }
-}

+ 0 - 4342
OTSPartA_STDEditor/Form_STDConstantsEditor.cs

@@ -1,4342 +0,0 @@
-using OTSCLRINTERFACE;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Windows.Forms;
-using System.Xml;
-using System.Xml.Linq;
-
-namespace OTSPartA_STDEditor
-{
-    public partial class Form_STDConstantsEditor : Form
-    {
-        //readonly 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"};
-        //readonly string[] OtherSymbol = { "first_elem" , "second_elem" , "third_elem" , "forth_elem", "fifth_elem", "sixth_elem", "seventh_elem","eighth_elem","ninth_elem", "tenth_elem", "Element1", "Element2" };
-        public Form_STDConstantsEditor()
-        {
-            InitializeComponent();
-            m_sc = new SqlLiteClass();
-        }
-        #region 全局变量
-        //数据库操作对象
-        private SqlLiteClass m_sc = null;
-        // 电镜设置对象
-        COTSControlFunExport m_cfun = null;
-        //Xray图谱用户控件
-        UXrayControl XrayControl = null;
-        //全局Xray 用于存储当前选择行的Xray信息
-        byte[] xrayByteData = null;
-        // 连接状态
-        bool m_bConnectionState = false;
-        //标准Xray信息列表
-        List<STDXray> m_STDXrayList = null;
-        #endregion
-
-        //国际化
-        Language lan;
-        Hashtable table;
-        //public string Language = "English";
-        string Address_backup = Application.StartupPath + "\\Config\\SysData\\OTSParticleSTD_backup.xml";
-        string Address = Application.StartupPath + "\\Config\\SysData\\OTSParticleSTD.xml";
-
-        private void Form_ConstantsEditor_Load(object sender, EventArgs e)
-        {
-
-            //初始化comboBox
-            this.comboBox_Elem1.Items.Add("first_elem");
-            this.comboBox_Elem1.Items.Add("second_elem");
-            this.comboBox_Elem1.Items.Add("third_elem");
-            this.comboBox_Elem1.Items.Add("forth_elem");
-            this.comboBox_Elem1.Items.Add("fifth_elem");
-            this.comboBox_Elem1.Items.Add("sixth_elem");
-            this.comboBox_Elem1.Items.Add("seventh_elem");
-            this.comboBox_Elem1.Items.Add("eighth_elem");
-            this.comboBox_Elem1.Items.Add("ninth_elem");
-            this.comboBox_Elem1.Items.Add("tenth_elem");
-            comboBox_Elem1.SelectedIndex = comboBox_Elem1.Items.IndexOf("first_elem");
-
-            this.comboBox_Elem.Items.Add("Element#1");
-            this.comboBox_Elem.Items.Add("Element#2");
-            this.comboBox_Elem.Items.Add("Element#3");
-            this.comboBox_Elem.Items.Add("Element#4");
-            this.comboBox_Elem.Items.Add("Element#5");
-            this.comboBox_Elem.Items.Add("Element#6");
-            this.comboBox_Elem.Items.Add("Element#7");
-            this.comboBox_Elem.Items.Add("Element#8");
-            this.comboBox_Elem.Items.Add("Element#9");
-            this.comboBox_Elem.Items.Add("Element#10");
-            comboBox_Elem.SelectedIndex = comboBox_Elem.Items.IndexOf("Element#1");
-
-            this.comboBox_ImgProperty.Items.Add("Dmax");
-            this.comboBox_ImgProperty.Items.Add("Dmin");
-            this.comboBox_ImgProperty.Items.Add("Aspect");
-            this.comboBox_ImgProperty.Items.Add("Dperp");
-            this.comboBox_ImgProperty.Items.Add("Dmean");
-            this.comboBox_ImgProperty.Items.Add("Area");
-            this.comboBox_ImgProperty.Items.Add("Dferet");
-            this.comboBox_ImgProperty.Items.Add("With");
-            this.comboBox_ImgProperty.Items.Add("Height");
-            this.comboBox_ImgProperty.Items.Add("Perimeter");
-            this.comboBox_ImgProperty.Items.Add("Dinscr");
-            this.comboBox_ImgProperty.Items.Add("Orientation");
-            this.comboBox_ImgProperty.Items.Add("Delong");
-            this.comboBox_ImgProperty.Items.Add("Aspectelong");
-            this.comboBox_ImgProperty.Items.Add("Dequalcircle");
-            this.comboBox_ImgProperty.Items.Add("Vedio");
-
-            comboBox_ImgProperty.SelectedIndex = comboBox_ImgProperty.Items.IndexOf("Dmax");
-
-            //this.comboBox_Constants.Items.Add("MAC#0");
-            //this.comboBox_Constants.Items.Add("MAC#1");
-            //this.comboBox_Constants.Items.Add("MAC#2");
-            //this.comboBox_Constants.Items.Add("MAC#3");
-            //this.comboBox_Constants.Items.Add("MAC#4");
-            //this.comboBox_Constants.Items.Add("MAC#5");
-            //this.comboBox_Constants.Items.Add("MAC#6");
-            //this.comboBox_Constants.Items.Add("MAC#7");
-            //this.comboBox_Constants.Items.Add("MAC#8");
-            //this.comboBox_Constants.Items.Add("MAC#9");
-            //comboBox_Constants.SelectedIndex = comboBox_Constants.Items.IndexOf("MAC#1");
-
-            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;
-
-            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;
-
-            textBox_Density.ReadOnly = false;
-            textBox_Electrical_conductivity.ReadOnly = false;
-            textBox_BSEValue.ReadOnly = false;
-            textBox_Formula.ReadOnly = false;
-            textBox_Element.ReadOnly = false;
-            textBox_Hardness.ReadOnly = false;
-            btn_dbs.Enabled = true;
-
-
-            dataGridView_KeyElements.RowHeadersVisible = false;
-            dataGridView_KeyElements.ColumnHeadersVisible = false;
-            dataGridView_KeyElements.AllowUserToAddRows = false;
-            dataGridView_KeyElements.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
-
-            dataGridView_SubElements.RowHeadersVisible = false;
-            dataGridView_SubElements.ColumnHeadersVisible = false;
-            dataGridView_SubElements.AllowUserToAddRows = false;
-            dataGridView_SubElements.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
-
-
-            XmlDocument doc = new XmlDocument();
-            //string Address = Application.StartupPath.Substring(0, Application.StartupPath.Length-35) + "\\Opton\\OTSPartA\\OTS\\Bin\\Win32\\Debug\\Config\\SysData\\OTSParticleSTD.xml";
-            //string Address = ".\\Config\\SysData\\OTSParticleSTD.xml";
-            doc.Load(Address);
-            LoadXmlToTreeControl(doc, XmlTree_STDlist.Nodes, XmlTree_MaxEDSRules.Nodes, XmlTree_ZeroElementRules.Nodes);
-
-            button_UpOrder.Enabled = false;
-            button_DownOrder.Enabled = false;
-            textBox_MaxEDSTime.ReadOnly = true;
-            this.textbox_STDEditor.Text = "";
-            //this.XmlTree.TabStop = false;
-            panel_OTSPeriodicTable.Visible = false;
-            //修改窗体宽度
-            //this.Width = this.Width - panel_OTSPeriodicTable.Width - 5;
-
-            //if (XmlTree.GetNodeCount(true) != 0)
-            //{
-            //    this.XmlTree.SelectedNode = XmlTree.Nodes[0];
-            //}
-
-
-            lan = new Language(this);
-            table = lan.GetNameTable(this.Name);
-
-            if (table["language"].ToString() == "EN")
-            {
-                panel_OTSPeriodicTable.BackgroundImage = global::OTSPartA_STDEditor.Properties.Resources.PeriodicTable_EN;
-                PeriodicTableSwitch.BackgroundImage = global::OTSPartA_STDEditor.Properties.Resources.STDEditoName;
-                PeriodicTableSwitch.Text = "";
-            }
-            else
-            {
-                panel_OTSPeriodicTable.BackgroundImage = global::OTSPartA_STDEditor.Properties.Resources.PeriodicTable_ZH;
-                PeriodicTableSwitch.Text = "元素周期表";
-            }
-
-            panel_OTSPeriodicTable.Visible = false;
-            this.Width = this.Width - panel_OTSPeriodicTable.Width - 5;
-
-            Size size = Screen.PrimaryScreen.WorkingArea.Size; Left = (size.Width - Width) / 2;
-            Top = (size.Height - Height) / 2;
-            WindowState = FormWindowState.Normal;
-
-            //groupBox_XmlTree_MaxEDSRules.Focus();
-            this.XmlTree_STDlist.HideSelection = false;//失去焦点后不隐藏选中节点
-            XmlTree_STDlist.Focus();
-            if (XmlTree_STDlist.Nodes.Count > 0)
-            {
-                XmlTree_STDlist.SelectedNode = XmlTree_STDlist.Nodes[0];
-                XmlTree_STDlist_AfterSelect(XmlTree_STDlist, new TreeViewEventArgs(XmlTree_STDlist.SelectedNode));
-            }
-
-            //添加Xray用户控件
-            XrayControl = new UXrayControl();
-            plXray.Controls.Add(XrayControl);
-            XrayControl.Dock = DockStyle.Fill;
-            //绑定数据库中的STDXray 
-            m_STDXrayList = new List<STDXray>();
-            BindSTDXray();
-        }
-        /// <summary>
-        /// [颜色:16进制转成RGB]
-        /// </summary>
-        /// <param name="strColor">设置16进制颜色 [返回RGB]</param>
-        /// <returns></returns>
-        public static System.Drawing.Color colorHx16toRGB(string strHxColor)
-        {
-            try
-            {
-                if (strHxColor.Length == 0)
-                {//如果为空
-                    return System.Drawing.Color.FromArgb(255, 255, 204);//设为白色
-                }
-                else
-                {//转换颜色
-                    return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(1, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(3, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(5, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
-                }
-            }
-            catch
-            {//设为白色
-                return System.Drawing.Color.FromArgb(255, 255, 204);
-            }
-        }
-
-        /// <summary>
-        /// [颜色:RGB转成16进制]
-        /// </summary>
-        /// <param name="R">红 int</param>
-        /// <param name="G">绿 int</param>
-        /// <param name="B">蓝 int</param>
-        /// <returns></returns>
-        public static string colorRGBtoHx16(int R, int G, int B)
-        {
-            return System.Drawing.ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(R, G, B));
-        }
-
-        //XmlTree_STDlist、XmlTree_MaxEDSRules、XmlTree_ZeroElementRules和 ConstantsPage页
-        void LoadXmlToTreeControl(XmlDocument xml, TreeNodeCollection XmlTree_STDlist, TreeNodeCollection XmlTree_MaxEDSRules, TreeNodeCollection XmlTree_ZeroElementRules)
-        {
-            XmlNode root = xml.SelectSingleNode("XMLData");
-            XmlNodeList root2 = root.SelectNodes("Collection");
-            for (int j = 0; j < root2.Count; j++)
-            {
-                if (root2[j].Attributes["RegName"].Value.ToString() == "STDList")
-                {
-                    XmlNodeList childlist = root2[j].ChildNodes;
-                    for (int i = 0; i < childlist.Count; i++)
-                    {
-                        TreeNode new_child = new TreeNode();//定义一个TreeNode节点对象
-                        //BSE、化学式、元素
-                        string strBseValue = string.Empty;
-                        string strFormula = string.Empty;
-                        string strElement = string.Empty;
-                        if (childlist[i].Attributes["BSE"] != null)
-                        {
-                            strBseValue = childlist[i].Attributes["BSE"].Value;
-                        }
-                        if (childlist[i].Attributes["Formula"] != null)
-                        {
-                            strFormula = childlist[i].Attributes["Formula"].Value;
-                        }
-                        if (childlist[i].Attributes["Element"] != null)
-                        {
-                            strElement = childlist[i].Attributes["Element"].Value;
-                        }
-                        new_child.Name = childlist[i].Attributes["Hardness"].Value + "_" + childlist[i].Attributes["Density"].Value + "_" + childlist[i].Attributes["Electrical_conductivity"].Value + "_" + strBseValue + "_" + strFormula + "_" + strElement + "$" + childlist[i].Attributes["KeyElementList"].Value + "$" + childlist[i].Attributes["SubElementList"].Value;
-                        new_child.Text = childlist[i].Attributes["StrName"].Value;
-                        new_child.Tag = childlist[i].Attributes["Expression"].Value;
-                        new_child.ToolTipText = childlist[i].Attributes["STDId"].Value;
-                        new_child.BackColor = colorHx16toRGB(childlist[i].Attributes["Color"].Value);
-                        XmlTree_STDlist.Add(new_child);
-                    }
-                }
-
-                if (root2[j].Attributes["RegName"].Value.ToString() == "ZeroElementRules")
-                {
-                    XmlNodeList childlist = root2[j].ChildNodes;
-                    for (int i = 0; i < childlist.Count; i++)
-                    {
-                        TreeNode new_child = new TreeNode();//定义一个TreeNode节点对象
-                        new_child.Text = childlist[i].Attributes["ZeroElement"].Value+"=0";
-                        new_child.Tag = childlist[i].Attributes["Expression"].Value;
-                        XmlTree_ZeroElementRules.Add(new_child);
-                    }
-                }
-
-                if (root2[j].Attributes["RegName"].Value.ToString() == "MaxEDSRules")
-                {
-                    XmlNodeList childlist = root2[j].ChildNodes;
-                    if (childlist.Count != 0)
-                    {
-                        for (int i = 0; i < childlist.Count; i++)
-                        {
-                            TreeNode new_child = new TreeNode();//定义一个TreeNode节点对象
-                                                                //new_child.Name = childlist[i].Attributes["MaxEDSTime"].Value;
-                            new_child.Tag = childlist[i].Attributes["Expression"].Value;
-                            new_child.Text = "Rule" + i.ToString();
-                            XmlTree_MaxEDSRules.Add(new_child);
-                        }
-                        if (childlist[0].Attributes["MaxEDSTime"] != null)
-                        {
-                            textBox_MaxEDSTime.Text = childlist[0].Attributes["MaxEDSTime"].Value;
-                        }
-                    }
-                }
-            }
-
-            XmlNode root3 = root.SelectSingleNode("Member");
-            string ConstantsStr = root3.Attributes["value"].Value;
-            ConstantsStr = ConstantsStr.Replace(" ", "");
-            string[] ConstantsStr2 = ConstantsStr.Split(',');
-            this.comboBox_Constants.Items.Clear();
-            this.comboBox_Constants.Items.AddRange(ConstantsStr2);
-            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];
-                }
-            }
-        }
-
-        private void comboBox_Elem1_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            string newStr = comboBox_Elem1.SelectedItem.ToString();
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, newStr);
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + newStr.Length, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void comboBox_Elem2_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            string newStr = comboBox_Elem.SelectedItem.ToString();
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, newStr);
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + newStr.Length, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void comboBox_ImgProperty_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            string newStr = comboBox_ImgProperty.SelectedItem.ToString();
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, newStr);
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + newStr.Length, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Plus_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "+");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index+1,0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Subtract_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "-");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Multiply_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "*");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Divide_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "/");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret(); ;
-        }
-
-        private void button_More_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, ">");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Less_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "<");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_LeftParenthesis_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "(");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_RightParenthesis_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, ")");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Equal_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "=");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        //除选中点以外其它节点前景色置灰
-        private void SetGrayExceptSelectedNode(TreeView Tree, TreeNode SelectedNode)
-        {
-            foreach (TreeNode node in Tree.Nodes)
-            {
-                if (node != SelectedNode)
-                {
-                    node.ForeColor = Color.Gray;
-                }
-            }
-        }
-        //恢复所有节点颜色为可用
-        private void SetBlackAllNodes(TreeView Tree)
-        {
-            foreach (TreeNode node in Tree.Nodes)
-            {
-                node.ForeColor = Color.Black;
-            }
-        }
-
-
-
-        //点击节点
-        private void XmlTree_STDlist_MouseClick(object sender, MouseEventArgs e)
-        {
-            //if (e.Button == MouseButtons.Left)
-            //{
-            //    Point ClickPoint = new Point(e.X, e.Y);
-            //    TreeNode CurrentNode = XmlTree_STDlist.GetNodeAt(ClickPoint);
-            //    if (CurrentNode != null)//判断你点的是不是一个节点
-            //    {
-            //        if (XmlTree_STDlist.SelectedNode != null&& XmlTree_STDlist.SelectedNode != CurrentNode)
-            //        {
-            //            //判断Hardness、Density、Electrical_conductivity
-            //            double dHardness = 0, dDensity = 0, dElectrical_conductivity = 0;
-            //            if (!double.TryParse(textBox_Hardness.Text, out dHardness))
-            //            {
-            //                MessageBox.Show("硬度输入错误,请输入数字!");
-            //                SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-            //                return;
-            //            }
-            //            if (!double.TryParse(textBox_Density.Text, out dDensity))
-            //            {
-            //                MessageBox.Show("密度输入错误,请输入数字!");
-            //                SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-            //                return;
-            //            }
-            //            if (!double.TryParse(textBox_Electrical_conductivity.Text, out dElectrical_conductivity))
-            //            {
-            //                MessageBox.Show("导电性输入错误,请输入数字!");
-            //                SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-            //                return;
-            //            }
-
-
-            //            //判断textbox_STDEditor
-            //            if (!Checktextbox_STDEditor())
-            //            {
-            //                SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-            //                return;
-            //            }
-
-            //            XmlTree_STDlist_SaveBeforeMouseClick(e);
-
-            //        }
-            //        SetBlackAllNodes(XmlTree_STDlist);
-            //        XmlTree_STDlist.SelectedNode = CurrentNode;
-            //        XmlTree_STDlist.LabelEdit = true;
-            //        this.textbox_STDEditor.Text = XmlTree_STDlist.SelectedNode.Tag.ToString();
-            //        btn_dbs.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-
-            //        string[] strOther = XmlTree_STDlist.SelectedNode.Name.Split('_');
-            //        textBox_Hardness.Text = strOther[0];
-            //        textBox_Density.Text = strOther[1];
-            //        textBox_Electrical_conductivity.Text = strOther[2];
-
-            //        if (UpOrder.Enabled == false)
-            //        {
-            //            UpOrder.Enabled = true;
-            //        }
-            //        if (DownOrder.Enabled == false)
-            //        {
-            //            DownOrder.Enabled = true;
-            //        }
-            //        if (XmlTree_STDlist.SelectedNode.PrevNode == null)
-            //        {
-            //            UpOrder.Enabled = false;
-            //        }
-            //        else if (XmlTree_STDlist.SelectedNode.NextNode == null)
-            //        {
-            //            DownOrder.Enabled = false;
-            //        }
-            //    }
-            //}
-
-            //if (e.Button == MouseButtons.Right)
-            //{
-            //    Point ClickPoint = new Point(e.X, e.Y);
-            //    TreeNode CurrentNode = XmlTree.GetNodeAt(ClickPoint);
-            //    if (CurrentNode != null)//判断你点的是不是一个节点
-            //    {
-            //        XmlTree.SelectedNode = CurrentNode;//选中这个节点
-            //        XmlTree.LabelEdit = true;
-            //        this.textbox_STDEditor.Text = XmlTree.SelectedNode.Tag.ToString();
-            //    }
-            //}
-        }
-
-
-
-        //XmlTree_STDlist点击节点前保存数据-Hardness、Density、Electrical_conductivity、textbox_STDEditor
-        void XmlTree_STDlist_BeforeMouseClick(MouseEventArgs e)
-        {
-            if ((this.textbox_STDEditor.Text != null) && (XmlTree_STDlist.SelectedNode != null))
-            {
-                XmlTree_STDlist.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                XmlTree_STDlist.SelectedNode.Name = textBox_Hardness.Text + "_" + textBox_Density.Text + "_" + textBox_Electrical_conductivity.Text + "_" + textBox_BSEValue.Text + "_" + textBox_Formula.Text + "_" + textBox_Element.Text; ;
-
-                string sKeyElements = "";
-                for (int i = 0; i < dataGridView_KeyElements.Columns.Count; i++)
-                {
-                    sKeyElements += dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString() + ",";
-                }
-                if (sKeyElements.Length > 0)
-                {
-                    sKeyElements = sKeyElements.Substring(0, sKeyElements.Length - 1);
-                }
-
-                string sSubElements = "";
-                for (int i = 0; i < dataGridView_SubElements.Columns.Count; i++)
-                {
-                    sSubElements += dataGridView_SubElements.Rows[0].Cells[i].Value.ToString() + ",";
-                }
-                if (sSubElements.Length > 0)
-                {
-                    sSubElements = sSubElements.Substring(0, sSubElements.Length - 1);
-                }
-
-                XmlTree_STDlist.SelectedNode.Name += "$" + sKeyElements + "$" + sSubElements;
-            }
-        }
-
-
-
-
-
-        //删除
-        private void DeleteTreeNode_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                TreeView XmlTree = (TreeView)XmlTreeMenuStrip.SourceControl;
-                if (XmlTree.SelectedNode != null)
-                {
-                    if (XmlTree != null)
-                    {
-                        if (XmlTree.SelectedNode.NextNode != null)
-                        {
-                            TreeNode Temp = XmlTree.SelectedNode.NextNode;
-                            XmlTree.SelectedNode.Remove();
-                            XmlTree.SelectedNode = Temp;
-                        }
-                        else if (XmlTree.SelectedNode.PrevNode != null)
-                        {
-                            TreeNode Temp = XmlTree.SelectedNode.PrevNode;
-                            XmlTree.SelectedNode.Remove();
-                            XmlTree.SelectedNode = Temp;
-                        }
-                        else
-                        {
-                            XmlTree.SelectedNode.Remove();
-                            XmlTree.SelectedNode = null;
-                            if (XmlTree.Name == "XmlTree_STDlist")
-                            {
-                                textbox_STDEditor.Text = "";
-                                textBox_Density.Text = "";
-                                textBox_Electrical_conductivity.Text = "";
-                                textBox_BSEValue.Text = "";
-                                textBox_Formula.Text = "";
-                                textBox_Element.Text = "";
-                                textBox_Hardness.Text = "";
-                                btn_dbs.BackColor = Color.White;
-                            }
-                            if (XmlTree.Name == "XmlTree_MaxEDSRules")
-                            {
-                                textbox_STDEditor.Text = "";
-                                textBox_MaxEDSTime.Text = "";
-                            }
-                            if (XmlTree.Name == "XmlTree_ZeroElementRules")
-                            {
-                                textbox_STDEditor.Text = "";
-                            }
-                        }
-                    }
-                }
-                else
-                {
-                    MessageBox.Show(table["message1"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                }
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.ToString(), table["message32"].ToString());
-            }
-        }
-
-        //新建
-        private void AddTreeNode_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                if (tabControl_Rules.SelectedIndex == 0)
-                {
-                    //保存节点当前数据
-                    if (XmlTree_STDlist.SelectedNode != null)
-                    {
-                        //判断Hardness、Density、Electrical_conductivity
-                        double dHardness = 0, dDensity = 0, dElectrical_conductivity = 0;
-                        if (!double.TryParse(textBox_Hardness.Text, out dHardness) || (double.Parse(textBox_Hardness.Text) <= 0))
-                        {
-                            textBox_Hardness.Focus();
-                            textBox_Hardness.SelectAll();
-                            MessageBox.Show(table["message2"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                        if (!double.TryParse(textBox_Density.Text, out dDensity)||double.Parse(textBox_Density.Text)<=0) 
-                        {
-                            textBox_Density.Focus();
-                            textBox_Density.SelectAll();
-                            MessageBox.Show(table["message3"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                        if (!double.TryParse(textBox_Electrical_conductivity.Text, out dElectrical_conductivity)||double.Parse(textBox_Electrical_conductivity.Text)<=0)
-                        {
-                            textBox_Electrical_conductivity.Focus();
-                            textBox_Electrical_conductivity.SelectAll();
-                            MessageBox.Show(table["message4"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                        if (textBox_BSEValue.Text.LastIndexOf("_") > 0)
-                        {
-                            MessageBox.Show(table["message5"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            textBox_BSEValue.Focus();
-                            return;
-                        }
-                        if (textBox_Formula.Text.LastIndexOf("_") > 0)
-                        {
-                            MessageBox.Show(table["message6"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            textBox_Formula.Focus();
-                            return;
-                        }
-                        if (textBox_Element.Text.LastIndexOf("_") > 0)
-                        {
-                            MessageBox.Show(table["message7"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            textBox_Element.Focus();
-                            return;
-                        }
-                        //判断textbox_STDEditor
-                        if (!Checktextbox_STDEditor())
-                        {
-                            return;
-                        }
-
-                        XmlTree_STDlist.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                        XmlTree_STDlist.SelectedNode.Name = textBox_Hardness.Text + "_" + textBox_Density.Text + "_" + textBox_Electrical_conductivity.Text + "_" + textBox_BSEValue.Text + "_" + textBox_Formula.Text + "_" + textBox_Element.Text; ;
-
-                        string sKeyElements = "";
-                        for (int i = 0; i < dataGridView_KeyElements.Columns.Count; i++)
-                        {
-                            sKeyElements += dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString() + ",";
-                        }
-                        if (sKeyElements.Length > 0)
-                        {
-                            sKeyElements = sKeyElements.Substring(0, sKeyElements.Length - 1);
-                        }
-
-                        string sSubElements = "";
-                        for (int i = 0; i < dataGridView_SubElements.Columns.Count; i++)
-                        {
-                            sSubElements += dataGridView_SubElements.Rows[0].Cells[i].Value.ToString() + ",";
-                        }
-                        if (sSubElements.Length > 0)
-                        {
-                            sSubElements = sSubElements.Substring(0, sSubElements.Length - 1);
-                        }
-
-                        XmlTree_STDlist.SelectedNode.Name += "$" + sKeyElements + "$" + sSubElements;
-
-                    }
-                }
-                else if (tabControl_Rules.SelectedIndex == 1)
-                {
-                    if (XmlTree_MaxEDSRules.SelectedNode != null)
-                    {
-
-                        //判断MaxEDSTime
-                        double dMaxEDSTime = 0;
-                        if (!double.TryParse(textBox_MaxEDSTime.Text, out dMaxEDSTime) || double.Parse(textBox_MaxEDSTime.Text) <= 0)
-                        {
-                            MessageBox.Show(table["message8"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                        //判断textbox_STDEditor
-                        if (!Checktextbox_STDEditor())
-                        {
-                            return;
-                        }
-                        XmlTree_MaxEDSRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                        //XmlTree_MaxEDSRules.SelectedNode.Name = textBox_MaxEDSTime.Text;
-                    }
-                }
-                else if (tabControl_Rules.SelectedIndex == 2)
-                {
-                    if (XmlTree_ZeroElementRules.SelectedNode != null)
-                    {
-                        if (XmlTree_ZeroElementRules.SelectedNode.Text.Contains("="))
-                        {
-                            if (!comboBox_PeriodicTable.Items.Contains(XmlTree_ZeroElementRules.SelectedNode.Text.Split('=')[0]))
-                            {
-                                MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                                return;
-                            }
-                        }
-                        else
-                        {
-                            MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                        //判断textbox_STDEditor
-                        if (!Checktextbox_STDEditor())
-                        {
-                            return;
-                        }
-                        XmlTree_ZeroElementRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                    }
-                }
-
-
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                TreeNode new_child = new TreeNode();//定义一个TreeNode节点对象
-                TreeView XmlTree = (TreeView)XmlTreeMenuStrip.SourceControl;
-                if (XmlTreeMenuStrip.SourceControl.Name == "XmlTree_STDlist")
-                {
-                    new_child.Name = "1_1_1$$";
-                    new_child.Text = "new strName";
-                    new_child.Tag = "NewRules";
-                    textbox_STDEditor.Text = "NewRules";
-                    textBox_Density.Text = "1";
-                    textBox_Electrical_conductivity.Text = "1";
-                    textBox_Hardness.Text = "1";
-                    new_child.BackColor = Color.White;
-
-                    int STDId = 1;
-                    for (int i = 0; i < XmlTree_STDlist.Nodes.Count; i++)
-                    {
-                        if (STDId < int.Parse(XmlTree_STDlist.Nodes[i].ToolTipText))
-                        {
-                            STDId = int.Parse(XmlTree_STDlist.Nodes[i].ToolTipText);
-                        }
-                    }
-                    new_child.ToolTipText = (STDId+1).ToString();
-                }
-                if (XmlTreeMenuStrip.SourceControl.Name == "XmlTree_MaxEDSRules")
-                {
-                    int Number = XmlTree.Nodes.Count;
-                    for (int num = 0; num < XmlTree.Nodes.Count; num++)
-                    {
-                        string aa = XmlTree.Nodes[num].Text.ToString().Substring(XmlTree.Nodes[num].Text.Length - 1, 1);
-                        int tp = int.Parse(XmlTree.Nodes[num].Text.ToString().Substring(XmlTree.Nodes[num].Text.Length - 1, 1));
-                        if (Number < tp) Number = tp;
-                    }
-                    new_child.Text = "Rule" + Number.ToString();
-                    new_child.Tag = "NewRules";
-                    textbox_STDEditor.Text = "NewRules";
-                }
-                if (XmlTreeMenuStrip.SourceControl.Name == "XmlTree_ZeroElementRules")
-                {
-                    new_child.Text = "NewElement=0";
-                    new_child.Tag = "NewRules";
-                    textbox_STDEditor.Text = "NewRules";
-                }
-
-                XmlTree.Nodes.Add(new_child);
-                XmlTree.SelectedNode = null;
-                XmlTree.SelectedNode = new_child;
-                //添加STDXray信息
-                AddSTDXray(XmlTree.SelectedNode, xrayByteData);
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.ToString(), table["message32"].ToString());
-            }
-        }
-
-        //双击节点
-        private void XmlTree_STDlist_MouseDoubleClick(object sender, MouseEventArgs e)
-        {
-            if (e.Button == MouseButtons.Left)
-            {
-                Point ClickPoint = new Point(e.X, e.Y);
-                TreeNode CurrentNode = XmlTree_STDlist.GetNodeAt(ClickPoint);
-                if (CurrentNode != null)//判断你点的是不是一个节点
-                {
-                    XmlTree_STDlist.SelectedNode = CurrentNode;//选中这个节点
-                    XmlTree_STDlist.LabelEdit = true;
-                    XmlTree_STDlist.SelectedNode.BeginEdit();
-                }
-            }
-        }
-
-
-        //保存xmltree内容到xml文件
-        void SaveXmlTreeDataToXml(string Address)
-        {
-            XDocument xdoc = XDocument.Load(Address);
-            IEnumerable<XElement> elements = from ele in xdoc.Descendants("XMLData") select ele;
-            foreach (var ele in elements)
-            {
-                if (ele != null)
-                {
-                    ele.RemoveAll();
-                }
-            }
-
-            string value = "";
-            foreach (var str in comboBox_Constants.Items)
-            {
-                value += str + ",";
-            }
-            if (value != "")
-            {
-                value = value.Substring(0, value.Length - 1);
-            }
-            XElement Constant = new XElement("Member");
-            Constant.SetAttributeValue("RegName", "Constants");
-            Constant.SetAttributeValue("value", value);
-            elements.ElementAt(0).Add(Constant);
-
-            XElement ZeroElement = new XElement("Collection");
-            ZeroElement.SetAttributeValue("RegName", "ZeroElementRules");
-            elements.ElementAt(0).Add(ZeroElement);
-
-            for (int num = 0; num < XmlTree_ZeroElementRules.Nodes.Count; num++)
-            {
-                string UsingElementList = "";
-                string UsingImgPropertyList = "";
-                string UsingOtherPropertyList = "";
-                List<string> UsingElementL = new List<string>();
-                List<string> UsingImgPropertyL = new List<string>();
-                List<string> UsingOtherPropertyL = new List<string>();
-
-                string str_RemoveBlank = "";
-                //forth_elem干扰or分隔符,故先行去掉
-                if (XmlTree_ZeroElementRules.Nodes[num].Tag.ToString().Contains("forth_elem"))
-                {
-                    str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-                    UsingOtherPropertyL.Add("forth_elem");
-                }
-
-                str_RemoveBlank = XmlTree_ZeroElementRules.Nodes[num].Tag.ToString().Replace(" ", "");
-                string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-                List<string> str_Removeandor = new List<string>();
-                for (int i = 0; i < str_Removeand.Length; i++)
-                {
-                    str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-                }
-                List<string> list_all = new List<string>();
-                for (int i = 0; i < str_Removeandor.Count; i++)
-                {
-                    list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-                }
-                for (int i = 0; i < list_all.Count; i++)
-                {
-                    //周期元素?
-                    if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingElementL.Contains(list_all[i]))
-                        {
-                            UsingElementL.Add(list_all[i]);
-                        }
-                    }
-                    //first_elem?
-                    if (this.comboBox_Elem1.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingOtherPropertyL.Contains(list_all[i]))
-                        {
-                            UsingOtherPropertyL.Add(list_all[i]);
-                        }
-                    }
-                    //Element1?
-                    if (this.comboBox_Elem.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingOtherPropertyL.Contains(list_all[i]))
-                        {
-                            UsingOtherPropertyL.Add(list_all[i]);
-                        }
-                    }
-                    //其它元素?
-                    if (this.comboBox_ImgProperty.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingImgPropertyL.Contains(list_all[i]))
-                        {
-                            UsingImgPropertyL.Add(list_all[i]);
-                        }
-                    }
-
-                }
-
-                if (UsingElementL.Count > 0)
-                {
-                    for (int i = 0; i < UsingElementL.Count - 1; i++)
-                    {
-                        UsingElementList += UsingElementL[i] + ",";
-                    }
-                    UsingElementList += UsingElementL[UsingElementL.Count - 1];
-                }
-
-                if (UsingImgPropertyL.Count > 0)
-                {
-                    for (int i = 0; i < UsingImgPropertyL.Count - 1; i++)
-                    {
-                        UsingImgPropertyList += UsingImgPropertyL[i] + ",";
-                    }
-                    UsingImgPropertyList += UsingImgPropertyL[UsingImgPropertyL.Count - 1];
-                }
-
-                if (UsingOtherPropertyL.Count > 0)
-                {
-                    for (int i = 0; i < UsingOtherPropertyL.Count - 1; i++)
-                    {
-                        UsingOtherPropertyList += UsingOtherPropertyL[i] + ",";
-                    }
-                    UsingOtherPropertyList += UsingOtherPropertyL[UsingOtherPropertyL.Count - 1];
-                }
-
-                XElement EleName = new XElement("Member");
-                EleName.SetAttributeValue("ZeroElement", XmlTree_ZeroElementRules.Nodes[num].Text.Split('=')[0]);
-                EleName.SetAttributeValue("UsingElementList", UsingElementList);
-                EleName.SetAttributeValue("UsingImgPropertyList", UsingImgPropertyList);
-                EleName.SetAttributeValue("UsingOtherPropertyList", UsingOtherPropertyList);
-                EleName.SetAttributeValue("Expression", XmlTree_ZeroElementRules.Nodes[num].Tag);
-                ZeroElement.Add(EleName);
-            }
-
-            XElement MaxEDS = new XElement("Collection");
-            MaxEDS.SetAttributeValue("RegName", "MaxEDSRules");
-            elements.ElementAt(0).Add(MaxEDS);
-            for (int num = 0; num < XmlTree_MaxEDSRules.Nodes.Count; num++)
-            {
-                string UsingElementList = "";
-                string UsingImgPropertyList = "";
-                string UsingOtherPropertyList = "";
-                List<string> UsingElementL = new List<string>();
-                List<string> UsingImgPropertyL = new List<string>();
-                List<string> UsingOtherPropertyL = new List<string>();
-
-                string str_RemoveBlank = "";
-                //forth_elem干扰or分隔符,故先行去掉
-                if (XmlTree_MaxEDSRules.Nodes[num].Tag.ToString().Contains("forth_elem"))
-                {
-                    str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-                    UsingOtherPropertyList = "forth_elem,";
-                }
-
-                str_RemoveBlank = XmlTree_MaxEDSRules.Nodes[num].Tag.ToString().Replace(" ", "");
-                string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-                List<string> str_Removeandor = new List<string>();
-                for (int i = 0; i < str_Removeand.Length; i++)
-                {
-                    str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-                }
-                List<string> list_all = new List<string>();
-                for (int i = 0; i < str_Removeandor.Count; i++)
-                {
-                    list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-                }
-                for (int i = 0; i < list_all.Count; i++)
-                {
-                    //周期元素?
-                    if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingElementL.Contains(list_all[i]))
-                        {
-                            UsingElementL.Add(list_all[i]);
-                        }
-                    }
-                    //first_elem?
-                    if (this.comboBox_Elem1.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingOtherPropertyL.Contains(list_all[i]))
-                        {
-                            UsingOtherPropertyL.Add(list_all[i]);
-                        }
-                    }
-                    //Element1?
-                    if (this.comboBox_Elem.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingOtherPropertyL.Contains(list_all[i]))
-                        {
-                            UsingOtherPropertyL.Add(list_all[i]);
-                        }
-                    }
-                    //其它元素?
-                    if (this.comboBox_ImgProperty.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingImgPropertyL.Contains(list_all[i]))
-                        {
-                            UsingImgPropertyL.Add(list_all[i]);
-                        }
-                    }
-
-                }
-
-                if (UsingElementL.Count > 0)
-                {
-                    for (int i = 0; i < UsingElementL.Count - 1; i++)
-                    {
-                        UsingElementList += UsingElementL[i] + ",";
-                    }
-                    UsingElementList += UsingElementL[UsingElementL.Count - 1];
-                }
-
-                if (UsingImgPropertyL.Count > 0)
-                {
-                    for (int i = 0; i < UsingImgPropertyL.Count - 1; i++)
-                    {
-                        UsingImgPropertyList += UsingImgPropertyL[i] + ",";
-                    }
-                    UsingImgPropertyList += UsingImgPropertyL[UsingImgPropertyL.Count - 1];
-                }
-
-                if (UsingOtherPropertyL.Count > 0)
-                {
-                    for (int i = 0; i < UsingOtherPropertyL.Count - 1; i++)
-                    {
-                        UsingOtherPropertyList += UsingOtherPropertyL[i] + ",";
-                    }
-                    UsingOtherPropertyList += UsingOtherPropertyL[UsingOtherPropertyL.Count - 1];
-                }
-
-                XElement EleName = new XElement("Member");
-                //EleName.SetAttributeValue("MaxEDSTime", XmlTree_MaxEDSRules.Nodes[num].Name);
-                EleName.SetAttributeValue("MaxEDSTime", textBox_MaxEDSTime.Text);
-                EleName.SetAttributeValue("UsingElementList", UsingElementList);
-                EleName.SetAttributeValue("UsingImgPropertyList", UsingImgPropertyList);
-                EleName.SetAttributeValue("UsingOtherPropertyList", UsingOtherPropertyList);
-                EleName.SetAttributeValue("Expression", XmlTree_MaxEDSRules.Nodes[num].Tag);
-
-                MaxEDS.Add(EleName);
-            }
-
-            XElement STD = new XElement("Collection");
-            STD.SetAttributeValue("RegName", "STDList");
-            elements.ElementAt(0).Add(STD);
-
-            for (int num = 0; num < XmlTree_STDlist.Nodes.Count; num++)
-            {
-                string UsingElementList = "";
-                string UsingImgPropertyList = "";
-                string UsingOtherPropertyList = "";
-                List<string> UsingElementL = new List<string>();
-                List<string> UsingImgPropertyL = new List<string>();
-                List<string> UsingOtherPropertyL = new List<string>();
-
-                string str_RemoveBlank = "";
-                //forth_elem干扰or分隔符,故先行去掉
-                if (XmlTree_STDlist.Nodes[num].Tag.ToString().Contains("forth_elem"))
-                {
-                    str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-                    UsingOtherPropertyList = "forth_elem,";
-                }
-
-                str_RemoveBlank = XmlTree_STDlist.Nodes[num].Tag.ToString().Replace(" ", "");
-                string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-                List<string> str_Removeandor = new List<string>();
-                for (int i = 0; i < str_Removeand.Length; i++)
-                {
-                    str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-                }
-                List<string> list_all = new List<string>();
-                for (int i = 0; i < str_Removeandor.Count; i++)
-                {
-                    list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-                }
-                for (int i = 0; i < list_all.Count; i++)
-                {
-                    //周期元素?
-                    if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingElementL.Contains(list_all[i]))
-                        {
-                            UsingElementL.Add(list_all[i]);
-                        }
-                    }
-                    //first_elem?
-                    if (this.comboBox_Elem1.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingOtherPropertyL.Contains(list_all[i]))
-                        {
-                            UsingOtherPropertyL.Add(list_all[i]);
-                        }
-                    }
-                    //Element1?
-                    if (this.comboBox_Elem.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingOtherPropertyL.Contains(list_all[i]))
-                        {
-                            UsingOtherPropertyL.Add(list_all[i]);
-                        }
-                    }
-                    //其它元素?
-                    if (this.comboBox_ImgProperty.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingImgPropertyL.Contains(list_all[i]))
-                        {
-                            UsingImgPropertyL.Add(list_all[i]);
-                        }
-                    }
-
-                }
-
-                if (UsingElementL.Count > 0)
-                {
-                    for (int i = 0; i < UsingElementL.Count - 1; i++)
-                    {
-                        UsingElementList += UsingElementL[i] + ",";
-                    }
-                    UsingElementList += UsingElementL[UsingElementL.Count - 1];
-                }
-
-                if (UsingImgPropertyL.Count > 0)
-                {
-                    for (int i = 0; i < UsingImgPropertyL.Count - 1; i++)
-                    {
-                        UsingImgPropertyList += UsingImgPropertyL[i] + ",";
-                    }
-                    UsingImgPropertyList += UsingImgPropertyL[UsingImgPropertyL.Count - 1];
-                }
-
-                if (UsingOtherPropertyL.Count > 0)
-                {
-                    for (int i = 0; i < UsingOtherPropertyL.Count - 1; i++)
-                    {
-                        UsingOtherPropertyList += UsingOtherPropertyL[i] + ",";
-                    }
-                    UsingOtherPropertyList += UsingOtherPropertyL[UsingOtherPropertyL.Count - 1];
-                }
-
-                string[] str = XmlTree_STDlist.Nodes[num].Name.Split('$');
-                string[] strOther = str[0].Split('_');
-
-                XElement EleName = new XElement("Member");
-                EleName.SetAttributeValue("STDId", XmlTree_STDlist.Nodes[num].ToolTipText);
-                EleName.SetAttributeValue("StrName", XmlTree_STDlist.Nodes[num].Text);
-                EleName.SetAttributeValue("Color", colorRGBtoHx16(XmlTree_STDlist.Nodes[num].BackColor.R, XmlTree_STDlist.Nodes[num].BackColor.G, XmlTree_STDlist.Nodes[num].BackColor.B));
-                //EleName.SetAttributeValue("UsingElementList", UsingElementList);
-                EleName.SetAttributeValue("KeyElementList", str[1]);
-                EleName.SetAttributeValue("SubElementList", str[2]);
-                EleName.SetAttributeValue("UsingImgPropertyList", UsingImgPropertyList);
-                EleName.SetAttributeValue("UsingOtherPropertyList", UsingOtherPropertyList);
-                EleName.SetAttributeValue("Expression", XmlTree_STDlist.Nodes[num].Tag);
-                EleName.SetAttributeValue("Hardness", strOther[0]);
-                EleName.SetAttributeValue("Density", strOther[1]);
-                EleName.SetAttributeValue("Electrical_conductivity", strOther[2]);
-                if (strOther.Length > 3)
-                {
-                    EleName.SetAttributeValue("BSE", strOther[3]);
-                    EleName.SetAttributeValue("Formula", strOther[4]);
-                    EleName.SetAttributeValue("Element", strOther[5]);
-                }
-                else
-                {
-                    EleName.SetAttributeValue("BSE", "");
-                    EleName.SetAttributeValue("Formula", "");
-                    EleName.SetAttributeValue("Element", "");
-                }
-                STD.Add(EleName);
-            }
-
-
-            xdoc.Save(Address);
-        }
-        //元素周期表开关
-        private void PeriodicTableSwitch_Click(object sender, EventArgs e)
-        {
-            if (PeriodicTableSwitch.BackColor == SystemColors.Control)
-            {
-                panel_OTSPeriodicTable.Visible = true;
-                this.Width = this.Width + panel_OTSPeriodicTable.Width + 5;
-                PeriodicTableSwitch.BackColor = SystemColors.ControlDark;
-                //if (Language == "English")
-                //{
-                //    PeriodicTableSwitch.Text = "Close PeriodicTable";
-                //}
-                //else if(Language == "Chinese")
-                //{
-                //    PeriodicTableSwitch.Text = "关闭元素周期表";
-                //}
-            }
-            else if (PeriodicTableSwitch.BackColor == SystemColors.ControlDark)
-            {
-                panel_OTSPeriodicTable.Visible = false;
-                this.Width = this.Width - panel_OTSPeriodicTable.Width - 5;
-                PeriodicTableSwitch.BackColor = SystemColors.Control;
-                //if (Language == "English")
-                //{
-                //    PeriodicTableSwitch.Text = "Open PeriodicTable";
-                //}
-                //else if (Language == "Chinese")
-                //{
-                //    PeriodicTableSwitch.Text = "打开元素周期表";
-                //}
-
-                //textbox_STDEditor.Focus();
-                groupBox_XmlTree_MaxEDSRules.Focus();
-            }
-        }
-
-        private void button_Ok_Click(object sender, EventArgs e)
-        {
-            if (tabControl_Rules.SelectedIndex == 0)
-            {
-                //保存节点当前数据
-                if (XmlTree_STDlist.SelectedNode != null)
-                {
-                    //判断Hardness、Density、Electrical_conductivity
-                    double dHardness = 0, dDensity = 0, dElectrical_conductivity = 0;
-                    if (!double.TryParse(textBox_Hardness.Text, out dHardness) || (double.Parse(textBox_Hardness.Text) <= 0))
-                    {
-                        textBox_Hardness.Focus();
-                        textBox_Hardness.SelectAll();
-                        MessageBox.Show(table["message10"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    if (!double.TryParse(textBox_Density.Text, out dDensity) || double.Parse(textBox_Density.Text) <= 0)
-                    {
-                        textBox_Density.Focus();
-                        textBox_Density.SelectAll();
-                        MessageBox.Show(table["message11"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    if (!double.TryParse(textBox_Electrical_conductivity.Text, out dElectrical_conductivity) || double.Parse(textBox_Electrical_conductivity.Text) <= 0)
-                    {
-                        textBox_Electrical_conductivity.Focus();
-                        textBox_Electrical_conductivity.SelectAll();
-                        MessageBox.Show(table["message12"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    if (textBox_BSEValue.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_BSEValue.Focus();
-                        textBox_BSEValue.SelectAll();
-                        MessageBox.Show(table["message13"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_BSEValue.Focus();
-                        return;
-                    }
-                    if (textBox_Formula.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_Formula.Focus();
-                        textBox_Formula.SelectAll();
-                        MessageBox.Show(table["message14"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_Formula.Focus();
-                        return;
-                    }
-                    if (textBox_Element.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_Element.Focus();
-                        textBox_Element.SelectAll();
-                        MessageBox.Show(table["message15"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_Element.Focus();
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        return;
-                    }
-
-                    XmlTree_STDlist.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                    XmlTree_STDlist.SelectedNode.Name = textBox_Hardness.Text + "_" + textBox_Density.Text + "_" + textBox_Electrical_conductivity.Text + "_" + textBox_BSEValue.Text + "_" + textBox_Formula.Text + "_" + textBox_Element.Text;
-
-                    string sKeyElements = "";
-                    for (int i = 0; i < dataGridView_KeyElements.Columns.Count; i++)
-                    {
-                        sKeyElements += dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString() + ",";
-                    }
-                    if (sKeyElements.Length > 0)
-                    {
-                        sKeyElements = sKeyElements.Substring(0, sKeyElements.Length - 1);
-                    }
-
-                    string sSubElements = "";
-                    for (int i = 0; i < dataGridView_SubElements.Columns.Count; i++)
-                    {
-                        sSubElements += dataGridView_SubElements.Rows[0].Cells[i].Value.ToString() + ",";
-                    }
-                    if (sSubElements.Length > 0)
-                    {
-                        sSubElements = sSubElements.Substring(0, sSubElements.Length - 1);
-                    }
-
-                    XmlTree_STDlist.SelectedNode.Name += "$" + sKeyElements + "$" + sSubElements;
-                }
-            }
-            else if (tabControl_Rules.SelectedIndex == 1)
-            {
-                if (XmlTree_MaxEDSRules.SelectedNode != null)
-                {
-
-                    //判断MaxEDSTime
-                    double dMaxEDSTime = 0;
-                    if (!double.TryParse(textBox_MaxEDSTime.Text, out dMaxEDSTime) || double.Parse(textBox_MaxEDSTime.Text) <= 0)
-                    {
-                        textBox_MaxEDSTime.Focus();
-                        textBox_MaxEDSTime.SelectAll();
-                        MessageBox.Show(table["message16"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        return;
-                    }
-                    XmlTree_MaxEDSRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                    //XmlTree_MaxEDSRules.SelectedNode.Name = textBox_MaxEDSTime.Text;
-                }
-            }
-            else if (tabControl_Rules.SelectedIndex == 2)
-            {
-                if (XmlTree_ZeroElementRules.SelectedNode != null)
-                {
-                    if (XmlTree_ZeroElementRules.SelectedNode.Text.Contains("="))
-                    {
-                        if (!comboBox_PeriodicTable.Items.Contains(XmlTree_ZeroElementRules.SelectedNode.Text.Split('=')[0]))
-                        {
-                            MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                    }
-                    else
-                    {
-                        MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        return;
-                    }
-                    XmlTree_ZeroElementRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                }
-            }
-
-
-            string value = "";
-            foreach (var str in comboBox_Constants.Items)
-            {
-                value += str + ",";
-            }
-            if (value != "")
-            {
-                value = value.Substring(0, value.Length - 1);
-            }
-
-
-            //string Address = Application.StartupPath + "\\Config\\SysData\\OTSParticleSTD.xml";
-            //string Address = ".\\Config\\SysData\\OTSParticleSTD.xml";
-            SaveXmlTreeDataToXml(Address);
-            //保存STDXray信息至数据库
-            SaveSTDXray();
-            this.Close();
-        }
-
-        private void button_Cancel_Click(object sender, EventArgs e)
-        {
-            this.Close();
-        }
-
-        //元素下拉选择输入
-        private void comboBox_PeriodicTable_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            if (comboBox_PeriodicTable.Text != null && comboBox_PeriodicTable.SelectedItem != null)
-            {
-
-                string newStr = comboBox_PeriodicTable.SelectedItem.ToString();
-                comboBox_PeriodicTable.Text = null;
-                int index = textbox_STDEditor.SelectionStart;
-                textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, newStr);
-                textbox_STDEditor.Focus();
-                textbox_STDEditor.Select(index + newStr.Length, 0);
-                textbox_STDEditor.ScrollToCaret();
-            }
-        }
-
-        //元素自身text按回车键输入
-        private void comboBox_PeriodicTable_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.KeyValue == 13)
-            {
-                if (comboBox_PeriodicTable.Text != null && comboBox_PeriodicTable.Text != "")
-                {
-                    this.textbox_STDEditor.Text += comboBox_PeriodicTable.Text.ToString();
-                    comboBox_PeriodicTable.Text = null;
-                }
-            }
-        }
-
-        //表达式规则检查
-        private bool Checktextbox_STDEditor()
-        {
-            if (textbox_STDEditor.Text == "" || textbox_STDEditor.Text == null)
-            {
-                textBox_MaxEDSTime.Focus();
-                MessageBox.Show(table["message17"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                return false;
-            }
-            string str_RemoveBlank = textbox_STDEditor.Text.ToString().Replace(" ", "");
-            str_RemoveBlank = str_RemoveBlank.Replace("\r\n", "");
-            //分割符号检验
-            string[] Symbol = { "and", "or", "+", "-", "*", "/", "=", ">", "<" };
-            for (int i = 0; i < Symbol.Length; i++)
-            {
-                for (int j = 0; j < Symbol.Length; j++)
-                {
-                    if ((Symbol[i] + Symbol[j]) != ">=" && (Symbol[i] + Symbol[j]) != "<=")
-                    {
-                        if (str_RemoveBlank.Contains(Symbol[i] + Symbol[j]))
-                        {
-                            MessageBox.Show(table["message18"].ToString() + Symbol[i] + Symbol[j], table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return false;
-                        }
-                    }
-                }
-                if (str_RemoveBlank.Contains(Symbol[i] + ")") || str_RemoveBlank.Contains("(" + Symbol[i]))
-                {
-                    MessageBox.Show(table["message18"].ToString() + Symbol[i] + ")", table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    return false;
-                }
-                if (str_RemoveBlank.Contains("(" + Symbol[i]))
-                {
-                    MessageBox.Show(table["message18"].ToString() + "(" + Symbol[i], table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    return false;
-                }
-            }
-            if ((str_RemoveBlank != null) && (str_RemoveBlank != ""))
-            {
-                //左右括号匹配检验
-                int BracketsNum = 0;
-                for (int i = 0; i < str_RemoveBlank.Length; i++)
-                {
-                    if (str_RemoveBlank[i] == '(') BracketsNum++;
-                    if (str_RemoveBlank[i] == ')') BracketsNum--;
-                }
-                if (BracketsNum != 0)
-                {
-                    MessageBox.Show(table["message19"].ToString(),table["message32"].ToString(),MessageBoxButtons.OK,MessageBoxIcon.Information);
-                    return false;
-                }
-                //首字符检测
-                if ((str_RemoveBlank[0] == '+') || (str_RemoveBlank[0] == '-') || (str_RemoveBlank[0] == '*') || (str_RemoveBlank[0] == '/') || (str_RemoveBlank[0] == '>') || (str_RemoveBlank[0] == '<') || (str_RemoveBlank[0] == '=') || (str_RemoveBlank[0] == ')') || (str_RemoveBlank[str_RemoveBlank.Length - 1] == '('))
-                {
-                    MessageBox.Show(table["message20"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    return false;
-                }
-
-                if (str_RemoveBlank.Length >= 3)
-                {
-                    if ((str_RemoveBlank.Substring(0, 3) == "and") || (str_RemoveBlank.Substring(0, 3) == "end"))
-                    {
-                        MessageBox.Show(table["message20"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return false;
-                    }
-                }
-            }
-
-            //forth_elem干扰or分隔符,故先行去掉
-            str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-
-            string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-            List<string> str_Removeandor = new List<string>();
-            for (int i = 0; i < str_Removeand.Length; i++)
-            {
-                str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-            }
-            List<string> list_all = new List<string>();
-            for (int i = 0; i < str_Removeandor.Count; i++)
-            {
-                list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-            }
-
-            //常量
-            List<string> Constantslist = new List<string>();
-            for (int j = 0; j < comboBox_Constants.Items.Count; j++)
-            {
-                Constantslist.Add(comboBox_Constants.Items[j].ToString().Split('=')[0]);
-            }
-
-            for (int i = 0; i < list_all.Count; i++)
-            {
-                //周期元素?
-                if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-                {
-                    continue;
-                }
-                //first_elem?
-                if (this.comboBox_Elem1.Items.Contains(list_all[i]))
-                {
-                    continue;
-                }
-                //Element1?
-                if (this.comboBox_Elem.Items.Contains(list_all[i]))
-                {
-                    continue;
-                }
-                //其它元素?
-                if (this.comboBox_ImgProperty.Items.Contains(list_all[i]))
-                {
-                    continue;
-                }
-                //常量?
-                if (Constantslist.Contains(list_all[i]))
-                {
-                    continue;
-                }
-                //数字?
-                double DNum = 0;
-                if (double.TryParse(list_all[i], out DNum))
-                {
-                    continue;
-                }
-                //>=? <=?等其它情况
-                if (list_all[i] == "")
-                {
-                    continue;
-                }
-                //true false?
-                if ((list_all[i] == "true") || (list_all[i] == "false"))
-                {
-                    continue;
-                }
-
-                MessageBox.Show(table["message21"].ToString() + list_all[i], table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                return false;
-            }
-
-            //检测是否有<>= true,false
-            if (!textbox_STDEditor.Text.ToString().Contains("<") && !textbox_STDEditor.Text.ToString().Contains(">") && !textbox_STDEditor.Text.ToString().Contains("=") && textbox_STDEditor.Text.ToString() != "true" && textbox_STDEditor.Text.ToString() != "false")
-            {
-                MessageBox.Show(table["message22"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                return false;
-            }
-
-            return true;
-        }
-
-        private void btn_dbs_Click(object sender, EventArgs e)
-        {
-            ColorDialog cd = new ColorDialog();
-            cd.FullOpen = true;//自定义颜色界面打开
-            DialogResult result = cd.ShowDialog();
-            if (result == DialogResult.OK)
-            {
-                btn_dbs.BackColor = cd.Color;
-                int color = Convert.ToInt32(ParseRGB(cd.Color));
-                ShowXrayAtlas(color, xrayByteData);
-                if (XmlTree_STDlist.SelectedNode != null)
-                {
-                    XmlTree_STDlist.SelectedNode.BackColor = cd.Color;
-                }
-            }
-            if (XmlTree_STDlist.SelectedNode != null)
-            {
-                //如果不是白色了,就把文字去掉吧,显得好看
-                if (btn_dbs.BackColor != Color.White)
-                {
-                    btn_dbs.Text = "";
-                }
-            }
-        }
-
-        private void button_And_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "and");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 3, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_Or_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "or");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 2, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void comboBox_Constants_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            //if (Flag_comboBox_Constants)
-            //{
-                if (comboBox_Constants.SelectedItem != null)
-                {
-                    //this.textbox_STDEditor.Text += comboBox_Constants.SelectedItem.ToString().Split('=')[0];
-                    ////comboBox_Constants.Text = null;
-                    //textbox_STDEditor.Focus();
-                    //textbox_STDEditor.SelectionStart = textbox_STDEditor.Text.Length;
-                    //textbox_STDEditor.ScrollToCaret();
-
-                    string newStr = comboBox_Constants.SelectedItem.ToString().Split('=')[0];
-                    int index = textbox_STDEditor.SelectionStart;
-                    textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, newStr);
-                    textbox_STDEditor.Focus();
-                    textbox_STDEditor.Select(index + newStr.Length, 0);
-                    textbox_STDEditor.ScrollToCaret();
-                }
-            //}
-            //Flag_comboBox_Constants = true;
-        }
-
-        bool Flag_SelStatus = true; //XML切换成功失败状态
-
-        private void button_UpOrder_Click(object sender, EventArgs e)
-        {
-            if (XmlTree_STDlist.SelectedNode.PrevNode != null)
-            {
-                //object tag = XmlTree_STDlist.SelectedNode.PrevNode.Tag;
-                //string name = XmlTree_STDlist.SelectedNode.PrevNode.Name;
-                //string text = XmlTree_STDlist.SelectedNode.PrevNode.Text;
-                //Color backcolor=XmlTree_STDlist.SelectedNode.PrevNode.BackColor;
-                //string STDId = XmlTree_STDlist.SelectedNode.PrevNode.ToolTipText;
-
-                //XmlTree_STDlist.SelectedNode.PrevNode.Tag = XmlTree_STDlist.SelectedNode.Tag;
-                //XmlTree_STDlist.SelectedNode.PrevNode.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-                //XmlTree_STDlist.SelectedNode.PrevNode.Name = XmlTree_STDlist.SelectedNode.Name;
-                //XmlTree_STDlist.SelectedNode.PrevNode.Text = XmlTree_STDlist.SelectedNode.Text;
-                //XmlTree_STDlist.SelectedNode.PrevNode.ToolTipText = XmlTree_STDlist.SelectedNode.ToolTipText;
-
-                //XmlTree_STDlist.SelectedNode.Tag = tag;
-                //XmlTree_STDlist.SelectedNode.BackColor = backcolor;
-                //XmlTree_STDlist.SelectedNode.Name = name;
-                //XmlTree_STDlist.SelectedNode.Text = text;
-                //XmlTree_STDlist.SelectedNode.ToolTipText = STDId;
-
-                //this.textbox_STDEditor.Text = XmlTree_STDlist.SelectedNode.Tag.ToString();
-                //btn_dbs.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-
-                //string[] strOther = XmlTree_STDlist.SelectedNode.Name.Split('$');
-
-                //string[] strOther2 = strOther[0].Split('_');
-                //textBox_Hardness.Text = strOther2[0];
-                //textBox_Density.Text = strOther2[1];
-                //textBox_Electrical_conductivity.Text = strOther2[2];
-
-
-                //dataGridView_KeyElements.Rows.Clear();
-                //dataGridView_KeyElements.Columns.Clear();
-
-                //string[] KeyElement = strOther[1].Split(',');
-                //for (int i = 0; i < KeyElement.Length; i++)
-                //{
-                //    if (KeyElement[0] != "")
-                //    {
-                //        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                //        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                //        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                //        if (dataGridView_KeyElements.Rows.Count == 0)
-                //        {
-                //            DataGridViewRow row = new DataGridViewRow();
-                //            dataGridView_KeyElements.Rows.Add(row);
-                //        }
-                //        dataGridView_KeyElements.Rows[0].Cells[i].Value = KeyElement[i];
-                //    }
-                //}
-
-
-                //dataGridView_SubElements.Rows.Clear();
-                //dataGridView_SubElements.Columns.Clear();
-
-                //string[] SubElement = strOther[2].Split(',');
-                //for (int i = 0; i < SubElement.Length; i++)
-                //{
-                //    if (SubElement[i] != "")
-                //    {
-                //        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                //        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                //        dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-                //        if (dataGridView_SubElements.Rows.Count == 0)
-                //        {
-                //            DataGridViewRow row = new DataGridViewRow();
-                //            dataGridView_SubElements.Rows.Add(row);
-                //        }
-                //        dataGridView_SubElements.Rows[0].Cells[i].Value = SubElement[i];
-                //    }
-                //}
-
-                //this.XmlTree_STDlist.Focus();
-                //XmlTree_STDlist.SelectedNode = XmlTree_STDlist.SelectedNode.PrevNode;
-                //if (XmlTree_STDlist.SelectedNode.PrevNode == null)
-                //{
-                //    UpOrder.Enabled = false;
-                //}
-
-            }
-
-
-            XmlTree_STDlist.SelectedNode = XmlTree_STDlist.SelectedNode.PrevNode;
-            if (Flag_SelStatus)
-            {
-                object tag = XmlTree_STDlist.SelectedNode.NextNode.Tag;
-                string name = XmlTree_STDlist.SelectedNode.NextNode.Name;
-                string text = XmlTree_STDlist.SelectedNode.NextNode.Text;
-                Color backcolor = XmlTree_STDlist.SelectedNode.NextNode.BackColor;
-                string STDId = XmlTree_STDlist.SelectedNode.NextNode.ToolTipText;
-
-                XmlTree_STDlist.SelectedNode.NextNode.Tag = XmlTree_STDlist.SelectedNode.Tag;
-                XmlTree_STDlist.SelectedNode.NextNode.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-                XmlTree_STDlist.SelectedNode.NextNode.Name = XmlTree_STDlist.SelectedNode.Name;
-                XmlTree_STDlist.SelectedNode.NextNode.Text = XmlTree_STDlist.SelectedNode.Text;
-                XmlTree_STDlist.SelectedNode.NextNode.ToolTipText = XmlTree_STDlist.SelectedNode.ToolTipText;
-
-                XmlTree_STDlist.SelectedNode.Tag = tag;
-                XmlTree_STDlist.SelectedNode.BackColor = backcolor;
-                XmlTree_STDlist.SelectedNode.Name = name;
-                XmlTree_STDlist.SelectedNode.Text = text;
-                XmlTree_STDlist.SelectedNode.ToolTipText = STDId;
-
-                this.textbox_STDEditor.Text = XmlTree_STDlist.SelectedNode.Tag.ToString();
-                btn_dbs.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-
-                string[] strOther = XmlTree_STDlist.SelectedNode.Name.Split('$');
-
-                string[] strOther2 = strOther[0].Split('_');
-                textBox_Hardness.Text = strOther2[0];
-                textBox_Density.Text = strOther2[1];
-                textBox_Electrical_conductivity.Text = strOther2[2];
-                if (strOther2.Length > 3)
-                {
-                    textBox_BSEValue.Text = strOther2[3];
-                    textBox_Formula.Text = strOther2[4];
-                    textBox_Element.Text = strOther2[5];
-                }
-                else
-                {
-                    textBox_BSEValue.Text = "";
-                    textBox_Formula.Text = "";
-                    textBox_Element.Text = "";
-                }
-
-
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-
-                string[] KeyElement = strOther[1].Split(',');
-                for (int i = 0; i < KeyElement.Length; i++)
-                {
-                    if (KeyElement[0] != "")
-                    {
-                        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                        if (dataGridView_KeyElements.Rows.Count == 0)
-                        {
-                            DataGridViewRow row = new DataGridViewRow();
-                            dataGridView_KeyElements.Rows.Add(row);
-                        }
-                        dataGridView_KeyElements.Rows[0].Cells[i].Value = KeyElement[i];
-                    }
-                }
-
-
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                string[] SubElement = strOther[2].Split(',');
-                for (int i = 0; i < SubElement.Length; i++)
-                {
-                    if (SubElement[i] != "")
-                    {
-                        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                        dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-                        if (dataGridView_SubElements.Rows.Count == 0)
-                        {
-                            DataGridViewRow row = new DataGridViewRow();
-                            dataGridView_SubElements.Rows.Add(row);
-                        }
-                        dataGridView_SubElements.Rows[0].Cells[i].Value = SubElement[i];
-                    }
-                }
-
-                this.XmlTree_STDlist.Focus();
-                if (XmlTree_STDlist.SelectedNode.PrevNode == null)
-                {
-                    button_UpOrder.Enabled = false;
-                }
-
-                dataGridView_KeyElements.ClearSelection();
-                dataGridView_SubElements.ClearSelection();
-
-            }
-            this.XmlTree_STDlist.Focus();
-            Flag_SelStatus = true;
-        }
-
-        private void button_DownOrder_Click(object sender, EventArgs e)
-        {
-            if (XmlTree_STDlist.SelectedNode.NextNode != null)
-            {
-                //object tag = XmlTree_STDlist.SelectedNode.NextNode.Tag;
-                //string name = XmlTree_STDlist.SelectedNode.NextNode.Name;
-                //string text = XmlTree_STDlist.SelectedNode.NextNode.Text;
-                //Color backcolor = XmlTree_STDlist.SelectedNode.NextNode.BackColor;
-                //string STDId = XmlTree_STDlist.SelectedNode.NextNode.ToolTipText;
-
-                //XmlTree_STDlist.SelectedNode.NextNode.Tag = XmlTree_STDlist.SelectedNode.Tag;
-                //XmlTree_STDlist.SelectedNode.NextNode.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-                //XmlTree_STDlist.SelectedNode.NextNode.Name = XmlTree_STDlist.SelectedNode.Name;
-                //XmlTree_STDlist.SelectedNode.NextNode.Text = XmlTree_STDlist.SelectedNode.Text;
-                //XmlTree_STDlist.SelectedNode.NextNode.ToolTipText = XmlTree_STDlist.SelectedNode.ToolTipText;
-
-                //XmlTree_STDlist.SelectedNode.Tag = tag;
-                //XmlTree_STDlist.SelectedNode.BackColor = backcolor;
-                //XmlTree_STDlist.SelectedNode.Name = name;
-                //XmlTree_STDlist.SelectedNode.Text = text;
-                //XmlTree_STDlist.SelectedNode.ToolTipText = STDId;
-
-                //this.textbox_STDEditor.Text = XmlTree_STDlist.SelectedNode.Tag.ToString();
-                //btn_dbs.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-
-                //string[] strOther = XmlTree_STDlist.SelectedNode.Name.Split('$');
-
-                //string[] strOther2 = strOther[0].Split('_');
-                //textBox_Hardness.Text = strOther2[0];
-                //textBox_Density.Text = strOther2[1];
-                //textBox_Electrical_conductivity.Text = strOther2[2];
-
-
-                //dataGridView_KeyElements.Rows.Clear();
-                //dataGridView_KeyElements.Columns.Clear();
-
-                //string[] KeyElement = strOther[1].Split(',');
-                //for (int i = 0; i < KeyElement.Length; i++)
-                //{
-                //    if (KeyElement[0] != "")
-                //    {
-                //        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                //        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                //        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                //        if (dataGridView_KeyElements.Rows.Count == 0)
-                //        {
-                //            DataGridViewRow row = new DataGridViewRow();
-                //            dataGridView_KeyElements.Rows.Add(row);
-                //        }
-                //        dataGridView_KeyElements.Rows[0].Cells[i].Value = KeyElement[i];
-                //    }
-                //}
-
-
-                //dataGridView_SubElements.Rows.Clear();
-                //dataGridView_SubElements.Columns.Clear();
-
-                //string[] SubElement = strOther[2].Split(',');
-                //for (int i = 0; i < SubElement.Length; i++)
-                //{
-                //    if (SubElement[i] != "")
-                //    {
-                //        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                //        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                //        dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-                //        if (dataGridView_SubElements.Rows.Count == 0)
-                //        {
-                //            DataGridViewRow row = new DataGridViewRow();
-                //            dataGridView_SubElements.Rows.Add(row);
-                //        }
-                //        dataGridView_SubElements.Rows[0].Cells[i].Value = SubElement[i];
-                //    }
-                //}
-
-
-                //this.XmlTree_STDlist.Focus();
-                //XmlTree_STDlist.SelectedNode = XmlTree_STDlist.SelectedNode.NextNode;
-                //if (XmlTree_STDlist.SelectedNode.NextNode == null)
-                //{
-                //    DownOrder.Enabled = false;
-                //}
-
-            }
-            XmlTree_STDlist.SelectedNode = XmlTree_STDlist.SelectedNode.NextNode;
-            if (Flag_SelStatus)
-            {
-                object tag = XmlTree_STDlist.SelectedNode.PrevNode.Tag;
-                string name = XmlTree_STDlist.SelectedNode.PrevNode.Name;
-                string text = XmlTree_STDlist.SelectedNode.PrevNode.Text;
-                Color backcolor = XmlTree_STDlist.SelectedNode.PrevNode.BackColor;
-                string STDId = XmlTree_STDlist.SelectedNode.PrevNode.ToolTipText;
-
-                XmlTree_STDlist.SelectedNode.PrevNode.Tag = XmlTree_STDlist.SelectedNode.Tag;
-                XmlTree_STDlist.SelectedNode.PrevNode.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-                XmlTree_STDlist.SelectedNode.PrevNode.Name = XmlTree_STDlist.SelectedNode.Name;
-                XmlTree_STDlist.SelectedNode.PrevNode.Text = XmlTree_STDlist.SelectedNode.Text;
-                XmlTree_STDlist.SelectedNode.PrevNode.ToolTipText = XmlTree_STDlist.SelectedNode.ToolTipText;
-
-                XmlTree_STDlist.SelectedNode.Tag = tag;
-                XmlTree_STDlist.SelectedNode.BackColor = backcolor;
-                XmlTree_STDlist.SelectedNode.Name = name;
-                XmlTree_STDlist.SelectedNode.Text = text;
-                XmlTree_STDlist.SelectedNode.ToolTipText = STDId;
-
-                this.textbox_STDEditor.Text = XmlTree_STDlist.SelectedNode.Tag.ToString();
-                btn_dbs.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-
-                string[] strOther = XmlTree_STDlist.SelectedNode.Name.Split('$');
-
-                string[] strOther2 = strOther[0].Split('_');
-                textBox_Hardness.Text = strOther2[0];
-                textBox_Density.Text = strOther2[1];
-                textBox_Electrical_conductivity.Text = strOther2[2];
-                if (strOther2.Length > 3)
-                {
-                    textBox_BSEValue.Text = strOther2[3];
-                    textBox_Formula.Text = strOther2[4];
-                    textBox_Element.Text = strOther2[5];
-                }
-                else
-                {
-                    textBox_BSEValue.Text = "";
-                    textBox_Formula.Text = "";
-                    textBox_Element.Text = "";
-                }
-
-
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-
-                string[] KeyElement = strOther[1].Split(',');
-                for (int i = 0; i < KeyElement.Length; i++)
-                {
-                    if (KeyElement[0] != "")
-                    {
-                        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                        if (dataGridView_KeyElements.Rows.Count == 0)
-                        {
-                            DataGridViewRow row = new DataGridViewRow();
-                            dataGridView_KeyElements.Rows.Add(row);
-                        }
-                        dataGridView_KeyElements.Rows[0].Cells[i].Value = KeyElement[i];
-                    }
-                }
-
-
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                string[] SubElement = strOther[2].Split(',');
-                for (int i = 0; i < SubElement.Length; i++)
-                {
-                    if (SubElement[i] != "")
-                    {
-                        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                        dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                        dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-                        if (dataGridView_SubElements.Rows.Count == 0)
-                        {
-                            DataGridViewRow row = new DataGridViewRow();
-                            dataGridView_SubElements.Rows.Add(row);
-                        }
-                        dataGridView_SubElements.Rows[0].Cells[i].Value = SubElement[i];
-                    }
-                }
-
-                this.XmlTree_STDlist.Focus();
-
-                if (XmlTree_STDlist.SelectedNode.PrevNode == null)
-                {
-                    button_DownOrder.Enabled = false;
-                }
-
-                dataGridView_KeyElements.ClearSelection();
-                dataGridView_SubElements.ClearSelection();
-            }
-
-            this.XmlTree_STDlist.Focus();
-            Flag_SelStatus = true;
-
-        }
-
-        private void button_Backup_Click(object sender, EventArgs e)
-        {
-            if (tabControl_Rules.SelectedIndex == 0)
-            {
-                //保存节点当前数据
-                if (XmlTree_STDlist.SelectedNode != null)
-                {
-                    //判断Hardness、Density、Electrical_conductivity
-                    double dHardness = 0, dDensity = 0, dElectrical_conductivity = 0;
-                    if (!double.TryParse(textBox_Hardness.Text, out dHardness) || (double.Parse(textBox_Hardness.Text) <= 0))
-                    {
-                        textBox_Hardness.Focus();
-                        textBox_Hardness.SelectAll();
-                        MessageBox.Show(table["message10"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    if (!double.TryParse(textBox_Density.Text, out dDensity) || double.Parse(textBox_Density.Text) <= 0)
-                    {
-                        textBox_Density.Focus();
-                        textBox_Density.SelectAll();
-                        MessageBox.Show(table["message11"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    if (!double.TryParse(textBox_Electrical_conductivity.Text, out dElectrical_conductivity) || double.Parse(textBox_Electrical_conductivity.Text) <= 0)
-                    {
-                        textBox_Electrical_conductivity.Focus();
-                        textBox_Electrical_conductivity.SelectAll();
-                        MessageBox.Show(table["message12"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    if (textBox_BSEValue.Text.LastIndexOf("_")>0)
-                    {
-                        textBox_BSEValue.Focus();
-                        textBox_BSEValue.SelectAll();
-                        MessageBox.Show(table["message13"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_BSEValue.Focus();
-                        return;
-                    }
-                    if (textBox_Formula.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_Formula.Focus();
-                        textBox_Formula.SelectAll();
-                        MessageBox.Show(table["message14"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_Formula.Focus();
-                        return;
-                    }
-                    if (textBox_Element.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_Element.Focus();
-                        textBox_Element.SelectAll();
-                        MessageBox.Show(table["message15"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_Element.Focus();
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        return;
-                    }
-
-                    XmlTree_STDlist.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                    XmlTree_STDlist.SelectedNode.Name = textBox_Hardness.Text + "_" + textBox_Density.Text + "_" + textBox_Electrical_conductivity.Text + "_" + textBox_BSEValue.Text + "_" + textBox_Formula.Text + "_" + textBox_Element.Text; ;
-
-                    string sKeyElements = "";
-                    for (int i = 0; i < dataGridView_KeyElements.Columns.Count; i++)
-                    {
-                        sKeyElements += dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString() + ",";
-                    }
-                    if (sKeyElements.Length > 0)
-                    {
-                        sKeyElements = sKeyElements.Substring(0, sKeyElements.Length - 1);
-                    }
-
-                    string sSubElements = "";
-                    for (int i = 0; i < dataGridView_SubElements.Columns.Count; i++)
-                    {
-                        sSubElements += dataGridView_SubElements.Rows[0].Cells[i].Value.ToString() + ",";
-                    }
-                    if (sSubElements.Length > 0)
-                    {
-                        sSubElements = sSubElements.Substring(0, sSubElements.Length - 1);
-                    }
-
-                    XmlTree_STDlist.SelectedNode.Name += "$" + sKeyElements + "$" + sSubElements;
-                }
-            }
-            else if (tabControl_Rules.SelectedIndex == 1)
-            {
-                if (XmlTree_MaxEDSRules.SelectedNode != null)
-                {
-
-                    //判断MaxEDSTime
-                    double dMaxEDSTime = 0;
-                    if (!double.TryParse(textBox_MaxEDSTime.Text, out dMaxEDSTime) || double.Parse(textBox_MaxEDSTime.Text) <= 0)
-                    {
-                        textBox_MaxEDSTime.Focus();
-                        textBox_MaxEDSTime.SelectAll();
-                        MessageBox.Show(table["message16"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        return;
-                    }
-                    XmlTree_MaxEDSRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                    //XmlTree_MaxEDSRules.SelectedNode.Name = textBox_MaxEDSTime.Text;
-                }
-            }
-            else if (tabControl_Rules.SelectedIndex == 2)
-            {
-                if (XmlTree_ZeroElementRules.SelectedNode != null)
-                {
-                    if (XmlTree_ZeroElementRules.SelectedNode.Text.Contains("="))
-                    {
-                        if (!comboBox_PeriodicTable.Items.Contains(XmlTree_ZeroElementRules.SelectedNode.Text.Split('=')[0]))
-                        {
-                            MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            return;
-                        }
-                    }
-                    else
-                    {
-                        MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        return;
-                    }
-                    XmlTree_ZeroElementRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                }
-            }
-
-
-            try
-            {
-                SaveFileDialog saveFile = new SaveFileDialog();
-                saveFile.Title = table["message23"].ToString();
-                saveFile.Filter = table["message24"].ToString();
-                saveFile.OverwritePrompt = true;  //是否覆盖当前文件
-                saveFile.RestoreDirectory = true;  //还原上次目录
-                if (saveFile.ShowDialog() == DialogResult.OK)
-                {
-                    //string Address = Application.StartupPath.Substring(0, Application.StartupPath.Length - 35) + "\\Opton\\OTSPartA\\OTS\\Bin\\Win32\\Debug\\Config\\SysData\\OTSParticleSTD.xml";
-                    //string Address = ".\\Config\\SysData\\OTSParticleSTD.xml";
-                    System.IO.File.Copy(Address, saveFile.FileName, true);
-                    SaveXmlTreeDataToXml(saveFile.FileName);
-                    MessageBox.Show(table["message25"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                }
-                else
-                {
-                    return;
-                }
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.Message);
-            }
-            //string Address_backup = Application.StartupPath.Substring(0, Application.StartupPath.Length-35) + "\\Bin\\Win32\\Debug\\Config\\SysData\\OTSParticleSTD_backup.xml";
-            //string Address_backup = ".\\Config\\SysData\\OTSParticleSTD_backup.xml";
-            //SaveXmlTreeDataToXml(Address_backup);
-
-
-            //MessageBox.Show("备份成功!", "提示");
-        }
-
-        private void button_Recover_Click(object sender, EventArgs e)
-        {
-            XmlDocument doc = new XmlDocument();
-            //string Address_backup = ".\\Config\\SysData\\OTSParticleSTD_backup.xml";
-            //string Address = ".\\Config\\SysData\\OTSParticleSTD.xml";
-            //string Address_backup = Application.StartupPath + "\\Config\\SysData\\\\OTSParticleSTD_backup.xml";
-            //string Address = Application.StartupPath + "\\Config\\SysData\\OTSParticleSTD.xml";
-            try
-            {
-                System.IO.File.Copy(Address_backup, Address, true);
-                doc.Load(Address_backup);
-
-                XmlTree_STDlist.Nodes.Clear();
-                XmlTree_MaxEDSRules.Nodes.Clear();
-                XmlTree_ZeroElementRules.Nodes.Clear();
-
-                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;
-
-                LoadXmlToTreeControl(doc, XmlTree_STDlist.Nodes, XmlTree_MaxEDSRules.Nodes, XmlTree_ZeroElementRules.Nodes);
-
-                XmlTree_STDlist.SelectedNode = null;
-                XmlTree_MaxEDSRules.SelectedNode = null;
-                XmlTree_ZeroElementRules.SelectedNode = null;
-                textbox_STDEditor.Text = "";
-                textBox_Density.Text = "";
-                textBox_Electrical_conductivity.Text = "";
-                textBox_BSEValue.Text = "";
-                textBox_Formula.Text = "";
-                textBox_Element.Text = "";
-                textBox_Hardness.Text = "";
-                //textBox_MaxEDSTime.Text = "";
-                btn_dbs.BackColor = Color.White;
-
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-                //重新绑定STDXray信息
-                BindSTDXray();
-
-            }
-            catch(Exception ex)
-            {
-                MessageBox.Show(table["message26"].ToString() + "\n"+ex.Message.ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-            }
-        }
-
-        private void tabControl_Rules_DrawItem(object sender, DrawItemEventArgs e)
-        {
-            //SolidBrush _Brush = new SolidBrush(Color.Black);//单色画刷
-            //RectangleF _TabTextArea = (RectangleF)tabControl_Rules.GetTabRect(e.Index);//绘制区域
-            //StringFormat _sf = new StringFormat();//封装文本布局格式信息
-            //_sf.LineAlignment = StringAlignment.Center;
-            //_sf.Alignment = StringAlignment.Center;
-            //e.Graphics.DrawString(tabControl_Rules.Controls[e.Index].Text, SystemInformation.MenuFont, _Brush, _TabTextArea, _sf);
-
-            //RectangleF tabArea = tabControl_Rules.GetTabRect(e.Index);
-            //RectangleF tabTextArea = tabArea;
-            //Graphics g = e.Graphics;
-            //StringFormat sf = new StringFormat();
-            //sf.LineAlignment = StringAlignment.Center;
-            //sf.Alignment = StringAlignment.Center;
-            //Font font = this.tabControl_Rules.Font;
-            //SolidBrush brush = new SolidBrush(Color.Black);
-            //g.DrawString(((TabControl)(sender)).TabPages[e.Index].Text, font, brush, tabTextArea, sf);
-        }
-
-        private void XmlTree_ZeroElementRules_MouseClick(object sender, MouseEventArgs e)
-        {
-            //if (e.Button == MouseButtons.Left)
-            //{
-            //    Point ClickPoint = new Point(e.X, e.Y);
-            //    TreeNode CurrentNode = XmlTree_ZeroElementRules.GetNodeAt(ClickPoint);
-            //    if (CurrentNode != null)//判断你点的是不是一个节点
-            //    {
-            //        if (XmlTree_ZeroElementRules.SelectedNode != null&& XmlTree_ZeroElementRules.SelectedNode != CurrentNode)
-            //        {
-            //            if (XmlTree_ZeroElementRules.SelectedNode.Text.Contains("="))
-            //            {
-            //                if (!comboBox_PeriodicTable.Items.Contains(XmlTree_ZeroElementRules.SelectedNode.Text.Split('=')[0]))
-            //                {
-            //                    MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + "项,名称格式填写错误,正确格式为:元素名=0");
-            //                    SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-            //                    return;
-            //                }
-            //            }
-            //            else
-            //            {
-            //                MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + "项,名称格式填写错误,正确格式为:元素名=0");
-            //                SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-            //                return;
-            //            }
-            //            if (!Checktextbox_STDEditor())
-            //            {
-            //                SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-            //                return;
-            //            }
-            //            XmlTree_ZeroElementRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-
-            //        }
-
-            //        SetBlackAllNodes(XmlTree_ZeroElementRules);
-            //        XmlTree_ZeroElementRules.SelectedNode = CurrentNode;
-            //        this.textbox_STDEditor.Text = XmlTree_ZeroElementRules.SelectedNode.Tag.ToString();
-
-            //    }
-            //}
-        }
-
-        private void XmlTree_ZeroElementRules_MouseDoubleClick(object sender, MouseEventArgs e)
-        {
-            if (e.Button == MouseButtons.Left)
-            {
-                Point ClickPoint = new Point(e.X, e.Y);
-                TreeNode CurrentNode = XmlTree_ZeroElementRules.GetNodeAt(ClickPoint);
-                if (CurrentNode != null)//判断你点的是不是一个节点
-                {
-                    XmlTree_ZeroElementRules.SelectedNode = CurrentNode;//选中这个节点
-                    //this.textbox_STDEditor.Text = XmlTree_ZeroElementRules.SelectedNode.Tag.ToString();
-                    XmlTree_ZeroElementRules.LabelEdit = true;
-                    XmlTree_ZeroElementRules.SelectedNode.BeginEdit();
-                }
-            }
-        }
-
-        private void XmlTree_MaxEDSRules_MouseClick(object sender, MouseEventArgs e)
-        {
-            //if (e.Button == MouseButtons.Left)
-            //{
-            //    Point ClickPoint = new Point(e.X, e.Y);
-            //    TreeNode CurrentNode = XmlTree_MaxEDSRules.GetNodeAt(ClickPoint);
-            //    if (CurrentNode != null)//判断你点的是不是一个节点
-            //    {
-            //        if (XmlTree_MaxEDSRules.SelectedNode != null&& XmlTree_MaxEDSRules.SelectedNode!= CurrentNode)
-            //        {
-            //            if (!Checktextbox_STDEditor())
-            //            {
-            //                SetGrayExceptSelectedNode(XmlTree_MaxEDSRules, XmlTree_MaxEDSRules.SelectedNode);
-            //                return;
-            //            }
-            //            //double dMaxEDSTime = 0;
-            //            //if (!double.TryParse(textBox_MaxEDSTime.Text, out dMaxEDSTime)||double.Parse(textBox_MaxEDSTime.Text)<=0)
-            //            //{
-            //            //    MessageBox.Show("MaxEDSTime请填写数字!", "提示");
-            //            //}
-
-            //            XmlTree_MaxEDSRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-            //            //XmlTree_MaxEDSRules.SelectedNode.Name = this.textBox_MaxEDSTime.Text;
-
-            //        }
-            //        SetBlackAllNodes(XmlTree_MaxEDSRules);
-            //        XmlTree_MaxEDSRules.SelectedNode = CurrentNode;
-            //        this.textbox_STDEditor.Text = XmlTree_MaxEDSRules.SelectedNode.Tag.ToString();
-            //        //textBox_MaxEDSTime.Text = XmlTree_MaxEDSRules.SelectedNode.Name;
-            //    }
-            //}
-        }
-
-
-        private void checkBox_0_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_0.Checked)
-            {
-                textBox_0.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_0.Text))
-                {
-                    checkBox_0.Checked = true;
-                }
-                else
-                {
-                    textBox_0.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_1_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_1.Checked)
-            {
-                textBox_1.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_1.Text))
-                {
-                    checkBox_1.Checked = true;
-                }
-                else
-                {
-                    textBox_1.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_2_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_2.Checked)
-            {
-                textBox_2.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_2.Text))
-                {
-                    checkBox_2.Checked = true;
-                }
-                else
-                {
-                    textBox_2.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_3_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_3.Checked)
-            {
-                textBox_3.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_3.Text))
-                {
-                    checkBox_3.Checked = true;
-                }
-                else
-                {
-                    textBox_3.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_4_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_4.Checked)
-            {
-                textBox_4.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_4.Text))
-                {
-                    checkBox_4.Checked = true;
-                }
-                else
-                {
-                    textBox_4.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_5_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_5.Checked)
-            {
-                textBox_5.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_5.Text))
-                {
-                    checkBox_5.Checked = true;
-                }
-                else
-                {
-                    textBox_5.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_6_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_6.Checked)
-            {
-                textBox_6.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_6.Text))
-                {
-                    checkBox_6.Checked = true;
-                }
-                else
-                {
-                    textBox_6.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_7_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_7.Checked)
-            {
-                textBox_7.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_7.Text))
-                {
-                    checkBox_7.Checked = true;
-                }
-                else
-                {
-                    textBox_7.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_8_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_8.Checked)
-            {
-                textBox_8.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_8.Text))
-                {
-                    checkBox_8.Checked = true;
-                }
-                else
-                {
-                    textBox_8.ReadOnly = true;
-                }
-            }
-        }
-
-        private void checkBox_9_CheckedChanged(object sender, EventArgs e)
-        {
-            if (checkBox_9.Checked)
-            {
-                textBox_9.ReadOnly = false;
-            }
-            else
-            {
-                if (!CheckConstants(checkBox_9.Text))
-                {
-                    checkBox_9.Checked = true;
-                }
-                else
-                {
-                    textBox_9.ReadOnly = true;
-                }
-            }
-        }
-        private bool CheckConstants(string ConstantName)
-        {
-            for (int num = 0; num < XmlTree_STDlist.Nodes.Count; num++)
-            {
-                if (XmlTree_STDlist.Nodes[num].Tag.ToString().Contains(ConstantName))
-                {
-                    tabControl_Rules.SelectedIndex = 0;
-                    XmlTree_STDlist.SelectedNode = XmlTree_STDlist.Nodes[num];
-                    SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-                    DialogResult result = MessageBox.Show(table["message27"].ToString() + XmlTree_STDlist.Nodes[num].Text + table["message28"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
-
-                    return false;
-                }
-            }
-            for (int num = 0; num < XmlTree_MaxEDSRules.Nodes.Count; num++)
-            {
-                if (XmlTree_MaxEDSRules.Nodes[num].Tag.ToString().Contains(ConstantName))
-                {
-                    tabControl_Rules.SelectedIndex = 1;
-                    XmlTree_MaxEDSRules.SelectedNode = XmlTree_MaxEDSRules.Nodes[num];
-                    SetGrayExceptSelectedNode(XmlTree_MaxEDSRules, XmlTree_MaxEDSRules.SelectedNode);
-                    DialogResult result = MessageBox.Show(table["message27"].ToString() + XmlTree_MaxEDSRules.Nodes[num].Text + table["message28"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
-
-                    return false;
-                }
-            }
-            for (int num = 0; num < XmlTree_ZeroElementRules.Nodes.Count; num++)
-            {
-                if (XmlTree_ZeroElementRules.Nodes[num].Tag.ToString().Contains(ConstantName))
-                {
-                    tabControl_Rules.SelectedIndex = 2;
-                    XmlTree_ZeroElementRules.SelectedNode = XmlTree_ZeroElementRules.Nodes[num];
-                    SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-                    DialogResult result = MessageBox.Show(table["message27"].ToString() + XmlTree_ZeroElementRules.Nodes[num].Text + table["message28"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    return false;
-                }
-            }
-            return true;
-        }
-
-        private void button_UpdateConstants_Click(object sender, EventArgs e)
-        {
-            this.comboBox_Constants.Items.Clear();
-            for (int i = 0; i < 10; i++)
-            {
-                CheckBox checkBox = (CheckBox)this.tabControl_Rules.TabPages[3].Controls.Find("checkBox_" + i.ToString(), false)[0];
-                if (checkBox.Checked)
-                {
-                    TextBox tBox = (TextBox)this.tabControl_Rules.TabPages[3].Controls.Find("textBox_" + i.ToString(), false)[0];
-                    double DoubleTry = 0;
-                    if (double.TryParse(tBox.Text, out DoubleTry))
-                    {
-                        this.comboBox_Constants.Items.Add(checkBox.Text + "=" + tBox.Text);
-                    }
-                    else
-                    {
-                        MessageBox.Show(table["message29"].ToString() + checkBox.Name + table["message30"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                        return;
-                    }
-                }
-            }
-
-            List<string> Constantslist = new List<string>();
-            Constantslist.Add("MAC#0");
-            Constantslist.Add("MAC#1");
-            Constantslist.Add("MAC#2");
-            Constantslist.Add("MAC#3");
-            Constantslist.Add("MAC#4");
-            Constantslist.Add("MAC#5");
-            Constantslist.Add("MAC#6");
-            Constantslist.Add("MAC#7");
-            Constantslist.Add("MAC#8");
-            Constantslist.Add("MAC#9");
-            foreach (var item in comboBox_Constants.Items)
-            {
-                Constantslist.Remove(item.ToString().Split('=')[0]);
-            }
-
-            MessageBox.Show(table["message31"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-        }
-        //tabpage切换开关
-        bool Flag_TabControlChange = true;
-        private void tabControl_Rules_Deselecting(object sender, TabControlCancelEventArgs e)
-        {
-            if (tabControl_Rules.SelectedIndex == 0)
-            {
-                //保存节点当前数据
-                if (XmlTree_STDlist.SelectedNode != null)
-                {
-                    //判断Hardness、Density、Electrical_conductivity
-                    double dHardness = 0, dDensity = 0, dElectrical_conductivity = 0;
-                    if (!double.TryParse(textBox_Hardness.Text, out dHardness) || (double.Parse(textBox_Hardness.Text) <= 0))
-                    {
-                        textBox_Hardness.Focus();
-                        textBox_Hardness.SelectAll();
-                        MessageBox.Show(table["message10"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    if (!double.TryParse(textBox_Density.Text, out dDensity) || double.Parse(textBox_Density.Text) <= 0)
-                    {
-                        textBox_Density.Focus();
-                        textBox_Density.SelectAll();
-                        MessageBox.Show(table["message11"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    if (!double.TryParse(textBox_Electrical_conductivity.Text, out dElectrical_conductivity) || double.Parse(textBox_Electrical_conductivity.Text) <= 0)
-                    {
-                        textBox_Electrical_conductivity.Focus();
-                        textBox_Electrical_conductivity.SelectAll();
-                        MessageBox.Show(table["message12"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    if (textBox_BSEValue.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_BSEValue.Focus();
-                        textBox_BSEValue.SelectAll();
-                        MessageBox.Show(table["message13"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_BSEValue.Focus();
-                        return;
-                    }
-                    if (textBox_Formula.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_Formula.Focus();
-                        textBox_Formula.SelectAll();
-                        MessageBox.Show(table["message14"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_Formula.Focus();
-                        return;
-                    }
-                    if (textBox_Element.Text.LastIndexOf("_") > 0)
-                    {
-                        textBox_Element.Focus();
-                        textBox_Element.SelectAll();
-                        MessageBox.Show(table["message15"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        textBox_Element.Focus();
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-
-                    Flag_TabControlChange = true;
-                    XmlTree_STDlist.SelectedNode.Tag = this.textbox_STDEditor.Text;
-
-                    XmlTree_STDlist.SelectedNode.Name = textBox_Hardness.Text + "_" + textBox_Density.Text + "_" + textBox_Electrical_conductivity.Text + "_" + textBox_BSEValue.Text + "_" + textBox_Formula.Text + "_" + textBox_Element.Text; ;
-
-                    string sKeyElements = "";
-                    for (int i = 0; i < dataGridView_KeyElements.Columns.Count; i++)
-                    {
-                        sKeyElements += dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString() + ",";
-                    }
-                    if (sKeyElements.Length > 0)
-                    {
-                        sKeyElements = sKeyElements.Substring(0, sKeyElements.Length - 1);
-                    }
-
-                    string sSubElements = "";
-                    for (int i = 0; i < dataGridView_SubElements.Columns.Count; i++)
-                    {
-                        sSubElements += dataGridView_SubElements.Rows[0].Cells[i].Value.ToString() + ",";
-                    }
-                    if (sSubElements.Length > 0)
-                    {
-                        sSubElements = sSubElements.Substring(0, sSubElements.Length - 1);
-                    }
-
-                    XmlTree_STDlist.SelectedNode.Name += "$" + sKeyElements + "$" + sSubElements;
-
-                    XmlTree_STDlist.SelectedNode.BackColor = btn_dbs.BackColor;
-                }
-            }
-            else if (tabControl_Rules.SelectedIndex == 1)
-            {
-                if (XmlTree_MaxEDSRules.SelectedNode != null)
-                {
-                    //判断MaxEDSTime
-                    double dMaxEDSTime = 0;
-                    if (!double.TryParse(textBox_MaxEDSTime.Text, out dMaxEDSTime) || double.Parse(textBox_MaxEDSTime.Text) <= 0)
-                    {
-                        textBox_MaxEDSTime.Focus();
-                        textBox_MaxEDSTime.SelectAll();
-                        MessageBox.Show(table["message16"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    Flag_TabControlChange = true;
-                    XmlTree_MaxEDSRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                    //XmlTree_MaxEDSRules.SelectedNode.Name = textBox_MaxEDSTime.Text;
-                }
-            }
-            else if (tabControl_Rules.SelectedIndex == 2)
-            {
-                if (XmlTree_ZeroElementRules.SelectedNode != null)
-                {
-                    if (XmlTree_ZeroElementRules.SelectedNode.Text.Contains("="))
-                    {
-                        if (!comboBox_PeriodicTable.Items.Contains(XmlTree_ZeroElementRules.SelectedNode.Text.Split('=')[0]))
-                        {
-                            MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                            Flag_TabControlChange = false;
-                            return;
-                        }
-                    }
-                    else
-                    {
-                        MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    //判断textbox_STDEditor
-                    if (!Checktextbox_STDEditor())
-                    {
-                        Flag_TabControlChange = false;
-                        return;
-                    }
-                    Flag_TabControlChange = true;
-                    XmlTree_ZeroElementRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                }
-            }
-            //XmlTree_STDlist.SelectedNode = null;
-            //XmlTree_MaxEDSRules.SelectedNode = null;
-            //XmlTree_ZeroElementRules.SelectedNode = null;
-            //textbox_STDEditor.Text = "";
-            //textBox_Density.Text = "";
-            //textBox_Electrical_conductivity.Text = "";
-            //textBox_Hardness.Text = "";
-            //textBox_MaxEDSTime.Text = "";
-            //btn_dbs.BackColor = Color.White;
-        }
-
-        private void tabControl_Rules_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            if (tabControl_Rules.SelectedIndex == 0)
-            {
-                //XmlTree_STDlist.SelectedNode = null;
-                XmlTree_STDlist.Focus();
-                XmlTree_STDlist_AfterSelect(XmlTree_STDlist, new TreeViewEventArgs(XmlTree_STDlist.SelectedNode));
-
-                textBox_Density.ReadOnly = false;
-                textBox_Electrical_conductivity.ReadOnly = false;
-                textBox_Hardness.ReadOnly = false;
-                textBox_BSEValue.ReadOnly = false;
-                textBox_Formula.ReadOnly = false;
-                textBox_Element.ReadOnly = false;
-                btn_dbs.Enabled = true;
-                textBox_MaxEDSTime.ReadOnly = true;
-                button_UpOrder.Enabled = false;
-                button_DownOrder.Enabled = false;
-            }
-            else if (tabControl_Rules.SelectedIndex == 1)
-            {
-                //XmlTree_MaxEDSRules.SelectedNode = null;
-                XmlTree_MaxEDSRules.Focus();
-                XmlTree_MaxEDSRules_AfterSelect(XmlTree_MaxEDSRules, new TreeViewEventArgs(XmlTree_MaxEDSRules.SelectedNode));
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                btn_dbs.BackColor = SystemColors.Control;
-                textBox_Density.Text = "";
-                textBox_Electrical_conductivity.Text = "";
-                textBox_Hardness.Text = "";
-
-                textBox_Density.ReadOnly = true;
-                textBox_Electrical_conductivity.ReadOnly = true;
-                textBox_Hardness.ReadOnly = true;
-                textBox_BSEValue.ReadOnly = true;
-                textBox_Formula.ReadOnly = true;
-                textBox_Element.ReadOnly = true;
-                btn_dbs.Enabled = false;
-                textBox_MaxEDSTime.ReadOnly = false;
-
-                tabSTDStandrad.SelectedIndex = 0;
-            }
-            else if (tabControl_Rules.SelectedIndex == 2)
-            {
-                //XmlTree_ZeroElementRules.SelectedNode = null;
-                XmlTree_ZeroElementRules.Focus();
-                XmlTree_ZeroElementRules_AfterSelect(XmlTree_MaxEDSRules, new TreeViewEventArgs(XmlTree_ZeroElementRules.SelectedNode));
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                btn_dbs.BackColor = SystemColors.Control;
-                textBox_Density.Text = "";
-                textBox_Electrical_conductivity.Text = "";
-                textBox_Hardness.Text = "";
-
-                textBox_Density.ReadOnly = true;
-                textBox_Electrical_conductivity.ReadOnly = true;
-                textBox_BSEValue.ReadOnly = true;
-                textBox_Formula.ReadOnly = true;
-                textBox_Element.ReadOnly = true;
-                textBox_Hardness.ReadOnly = true;
-                btn_dbs.Enabled = false;
-                textBox_MaxEDSTime.ReadOnly = true;
-                tabSTDStandrad.SelectedIndex = 0;
-            }
-            else
-            {
-                textbox_STDEditor.Text = "";
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                btn_dbs.BackColor = SystemColors.Control;
-                textBox_Density.Text = "";
-                textBox_Electrical_conductivity.Text = "";
-                textBox_Hardness.Text = "";
-
-                textBox_Density.ReadOnly = true;
-                textBox_Electrical_conductivity.ReadOnly = true;
-                textBox_BSEValue.ReadOnly = true;
-                textBox_Formula.ReadOnly = true;
-                textBox_Element.ReadOnly = true;
-                textBox_Hardness.ReadOnly = true;
-                btn_dbs.Enabled = false;
-                textBox_MaxEDSTime.ReadOnly = true;
-            }
-
-            //textbox_STDEditor.Text = "";
-            //dataGridView_KeyElements.Rows.Clear();
-            //dataGridView_KeyElements.Columns.Clear();
-
-            //dataGridView_SubElements.Rows.Clear();
-            //dataGridView_SubElements.Columns.Clear();
-        }
-
-        private void XmlTree_ZeroElementRules_BeforeSelect(object sender, TreeViewCancelEventArgs e)
-        {
-            //if (e.Node != null)
-            //{
-            //    if (e.Node.ForeColor == Color.Gray)
-            //    {
-            //        e.Cancel = true;  //不让选中禁用节点
-            //        return;
-            //    }
-            //}
-
-            if (XmlTree_ZeroElementRules.SelectedNode != null)
-            {
-                if (XmlTree_ZeroElementRules.SelectedNode.Text.Contains("="))
-                {
-                    if (!comboBox_PeriodicTable.Items.Contains(XmlTree_ZeroElementRules.SelectedNode.Text.Split('=')[0]))
-                    {
-                        MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                        SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-                        e.Cancel = true;
-                        return;
-                    }
-                }
-                else
-                {
-                    MessageBox.Show(XmlTree_ZeroElementRules.SelectedNode.Text + table["message9"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-                    e.Cancel = true;
-                    return;
-                }
-                if (!Checktextbox_STDEditor())
-                {
-                    SetGrayExceptSelectedNode(XmlTree_ZeroElementRules, XmlTree_ZeroElementRules.SelectedNode);
-                    e.Cancel = true;
-                    return;
-                }
-                XmlTree_ZeroElementRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-            }
-        }
-
-        private void tabControl_Rules_Selecting(object sender, TabControlCancelEventArgs e)
-        {
-            if (!Flag_TabControlChange)
-            {
-                e.Cancel = true;
-            }
-            else
-            {
-
-            }
-        }
-
-        private void XmlTree_ZeroElementRules_AfterSelect(object sender, TreeViewEventArgs e)
-        {
-            SetBlackAllNodes(XmlTree_ZeroElementRules);
-            this.textbox_STDEditor.Text = XmlTree_ZeroElementRules.SelectedNode.Tag.ToString();
-        }
-
-        private void XmlTree_STDlist_BeforeSelect(object sender, TreeViewCancelEventArgs e)
-        {
-            if (XmlTree_STDlist.SelectedNode != null)
-            {
-                //判断Hardness、Density、Electrical_conductivity
-                double dHardness = 0, dDensity = 0, dElectrical_conductivity = 0;
-                if (!double.TryParse(textBox_Hardness.Text, out dHardness) || (double.Parse(textBox_Hardness.Text) <= 0))
-                {
-                    MessageBox.Show(table["message10"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-                    Flag_SelStatus = false;
-                    e.Cancel = true;
-                    return;
-                }
-                if (!double.TryParse(textBox_Density.Text, out dDensity) || double.Parse(textBox_Density.Text) <= 0)
-                {
-                    MessageBox.Show(table["message11"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-                    Flag_SelStatus = false;
-                    e.Cancel = true;
-                    return;
-                }
-                if (!double.TryParse(textBox_Electrical_conductivity.Text, out dElectrical_conductivity) || double.Parse(textBox_Electrical_conductivity.Text) <= 0)
-                {
-                    MessageBox.Show(table["message12"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-                    Flag_SelStatus = false;
-                    e.Cancel = true;
-                    return;
-                }
-                if (textBox_BSEValue.Text.LastIndexOf("_") > 0)
-                {
-                    MessageBox.Show(table["message13"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    textBox_BSEValue.Focus();
-                    return;
-                }
-                if (textBox_Formula.Text.LastIndexOf("_") > 0)
-                {
-                    MessageBox.Show(table["message14"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    textBox_Formula.Focus();
-                    return;
-                }
-                if (textBox_Element.Text.LastIndexOf("_") > 0)
-                {
-                    MessageBox.Show(table["message15"].ToString(), table["message32"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    textBox_Element.Focus();
-                    return;
-                }
-                //判断textbox_STDEditor
-                if (!Checktextbox_STDEditor())
-                {
-                    SetGrayExceptSelectedNode(XmlTree_STDlist, XmlTree_STDlist.SelectedNode);
-                    Flag_SelStatus = false;
-                    e.Cancel = true;
-                    return;
-                }
-
-                XmlTree_STDlist.SelectedNode.Tag = this.textbox_STDEditor.Text;
-
-                if (dataGridView_KeyElements.Rows.Count == 0 && dataGridView_SubElements.Rows.Count == 0)
-                {
-                    string str_RemoveBlank = textbox_STDEditor.Text.ToString().Replace(" ", "");
-                    str_RemoveBlank = str_RemoveBlank.Replace("\r\n", "");
-                    str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-                    string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-                    List<string> str_Removeandor = new List<string>();
-                    for (int i = 0; i < str_Removeand.Length; i++)
-                    {
-                        str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-                    }
-                    List<string> list_all = new List<string>();
-                    for (int i = 0; i < str_Removeandor.Count; i++)
-                    {
-                        list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-                    }
-                    List<string> UsingElementL = new List<string>();
-                    for (int i = 0; i < list_all.Count; i++)
-                    {
-                        if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-                        {
-                            if (!UsingElementL.Contains(list_all[i]))
-                            {
-                                UsingElementL.Add(list_all[i]);
-                            }
-                        }
-                    }
-                    for (int i = 0; i < UsingElementL.Count; i++)
-                    {
-                        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                        dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
-                        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                        if (dataGridView_KeyElements.Rows.Count == 0)
-                        {
-                            DataGridViewRow row = new DataGridViewRow();
-                            dataGridView_KeyElements.Rows.Add(row);
-                        }
-                        dataGridView_KeyElements.Rows[0].Cells[i].Value = UsingElementL[i];
-                    }
-                }
-
-                XmlTree_STDlist.SelectedNode.Name = textBox_Hardness.Text + "_" + textBox_Density.Text + "_" + textBox_Electrical_conductivity.Text + "_" + textBox_BSEValue.Text + "_" + textBox_Formula.Text + "_" + textBox_Element.Text; ;
-
-                string sKeyElements = "";
-                for (int i = 0; i < dataGridView_KeyElements.Columns.Count; i++)
-                {
-                    sKeyElements += dataGridView_KeyElements.Rows[0].Cells[i].Value.ToString() + ",";
-                }
-                if (sKeyElements.Length > 0)
-                {
-                    sKeyElements = sKeyElements.Substring(0, sKeyElements.Length - 1);
-                }
-
-                string sSubElements = "";
-                for (int i = 0; i < dataGridView_SubElements.Columns.Count; i++)
-                {
-                    sSubElements += dataGridView_SubElements.Rows[0].Cells[i].Value.ToString() + ",";
-                }
-                if (sSubElements.Length > 0)
-                {
-                    sSubElements = sSubElements.Substring(0, sSubElements.Length - 1);
-                }
-
-                XmlTree_STDlist.SelectedNode.Name += "$" + sKeyElements + "$" + sSubElements;
-
-                XmlTree_STDlist.SelectedNode.BackColor = btn_dbs.BackColor;
-            }
-
-        }
-
-        private void XmlTree_MaxEDSRules_AfterSelect(object sender, TreeViewEventArgs e)
-        {
-            SetBlackAllNodes(XmlTree_MaxEDSRules);
-            this.textbox_STDEditor.Text = XmlTree_MaxEDSRules.SelectedNode.Tag.ToString();
-            //textBox_MaxEDSTime.Text = XmlTree_MaxEDSRules.SelectedNode.Name;
-        }
-
-        private void XmlTree_MaxEDSRules_BeforeSelect(object sender, TreeViewCancelEventArgs e)
-        {
-            if (XmlTree_MaxEDSRules.SelectedNode != null)
-            {
-                if (!Checktextbox_STDEditor())
-                {
-                    SetGrayExceptSelectedNode(XmlTree_MaxEDSRules, XmlTree_MaxEDSRules.SelectedNode);
-                    e.Cancel = true;
-                    return;
-                }
-                //double dMaxEDSTime = 0;
-                //if (!double.TryParse(textBox_MaxEDSTime.Text, out dMaxEDSTime)||double.Parse(textBox_MaxEDSTime.Text)<=0)
-                //{
-                //    MessageBox.Show("MaxEDSTime请填写数字!", "提示");
-                //    e.Cancel = true;
-                //}
-
-                XmlTree_MaxEDSRules.SelectedNode.Tag = this.textbox_STDEditor.Text;
-                //XmlTree_MaxEDSRules.SelectedNode.Name = this.textBox_MaxEDSTime.Text;
-            }
-        }
-
-        string ElementKeyOrSub = "";
-
-        private void dataGridView_KeyElements_CellClick(object sender, DataGridViewCellEventArgs e)
-        {
-            ElementKeyOrSub = dataGridView_KeyElements.CurrentCell.Value.ToString();
-            dataGridView_KeyElements.Columns.RemoveAt(e.ColumnIndex);
-
-            DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-            dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-            dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-            if (dataGridView_SubElements.Rows.Count == 0)
-            {
-                DataGridViewRow row = new DataGridViewRow();
-                dataGridView_SubElements.Rows.Add(row);
-            }
-            dataGridView_SubElements.Rows[0].Cells[dataGridView_SubElements.Columns.Count - 1].Value = ElementKeyOrSub;
-            dataGridView_SubElements.ClearSelection();
-            dataGridView_KeyElements.ClearSelection();
-            XmlTree_STDlist.Focus();
-        }
-
-        private void dataGridView_SubElements_CellClick(object sender, DataGridViewCellEventArgs e)
-        {
-            ElementKeyOrSub = dataGridView_SubElements.CurrentCell.Value.ToString();
-            dataGridView_SubElements.Columns.RemoveAt(e.ColumnIndex);
-
-            DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-            dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-            dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-            if (dataGridView_KeyElements.Rows.Count == 0)
-            {
-                DataGridViewRow row = new DataGridViewRow();
-                dataGridView_KeyElements.Rows.Add(row);
-            }
-            dataGridView_KeyElements.Rows[0].Cells[dataGridView_KeyElements.Columns.Count - 1].Value = ElementKeyOrSub;
-            dataGridView_KeyElements.ClearSelection();
-            dataGridView_SubElements.ClearSelection();
-            XmlTree_STDlist.Focus();
-        }
-
-        private void textbox_STDEditor_TextChanged(object sender, EventArgs e)
-        {
-            //string str_RemoveBlank = textbox_STDEditor.Text.ToString().Replace(" ", "");
-            //str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-            //string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-            //List<string> str_Removeandor = new List<string>();
-            //for (int i = 0; i < str_Removeand.Length; i++)
-            //{
-            //    str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-            //}
-            //List<string> list_all = new List<string>();
-            //for (int i = 0; i < str_Removeandor.Count; i++)
-            //{
-            //    list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-            //}
-            //List<string> UsingElementL = new List<string>();
-            //for (int i = 0; i < list_all.Count; i++)
-            //{
-            //    if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-            //    {
-            //        if (!UsingElementL.Contains(list_all[i]))
-            //        {
-            //            UsingElementL.Add(list_all[i]);
-            //        }
-            //    }
-            //}
-            //for (int i = 0; i < UsingElementL.Count; i++)
-            //{
-            //    DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-            //    dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
-            //    dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-            //    if (dataGridView_KeyElements.Rows.Count == 0)
-            //    {
-            //        DataGridViewRow row = new DataGridViewRow();
-            //        dataGridView_KeyElements.Rows.Add(row);
-            //    }
-            //    dataGridView_KeyElements.Rows[0].Cells[i].Value = UsingElementL[i];
-            //}
-        }
-
-        private void textbox_STDEditor_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            //if (e.KeyChar == '\r')
-            //{
-            //    dataGridView_KeyElements.Rows.Clear();
-            //    dataGridView_KeyElements.Columns.Clear();
-            //    dataGridView_SubElements.Rows.Clear();
-            //    dataGridView_SubElements.Columns.Clear();
-
-            //    string str_RemoveBlank = textbox_STDEditor.Text.ToString().Replace(" ", "");
-            //    str_RemoveBlank = str_RemoveBlank.Replace("\r\n", "");
-            //    str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-            //    string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-            //    List<string> str_Removeandor = new List<string>();
-            //    for (int i = 0; i < str_Removeand.Length; i++)
-            //    {
-            //        str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-            //    }
-            //    List<string> list_all = new List<string>();
-            //    for (int i = 0; i < str_Removeandor.Count; i++)
-            //    {
-            //        list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-            //    }
-            //    List<string> UsingElementL = new List<string>();
-            //    for (int i = 0; i < list_all.Count; i++)
-            //    {
-            //        if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-            //        {
-            //            if (!UsingElementL.Contains(list_all[i]))
-            //            {
-            //                UsingElementL.Add(list_all[i]);
-            //            }
-            //        }
-            //    }
-            //    for (int i = 0; i < UsingElementL.Count; i++)
-            //    {
-            //        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-            //        dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
-            //        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-            //        if(dataGridView_KeyElements.Rows.Count==0)
-            //        {
-            //            DataGridViewRow row = new DataGridViewRow();
-            //            dataGridView_KeyElements.Rows.Add(row);
-            //        }
-            //        dataGridView_KeyElements.Rows[0].Cells[i].Value = UsingElementL[i];
-            //    }
-            //}
-        }
-
-        private void textbox_STDEditor_Leave(object sender, EventArgs e)
-        {
-            if (tabControl_Rules.SelectedIndex == 0)
-            {
-                dataGridView_KeyElements.Rows.Clear();
-                dataGridView_KeyElements.Columns.Clear();
-
-
-                string str_RemoveBlank = textbox_STDEditor.Text.ToString().Replace(" ", "");
-                str_RemoveBlank = str_RemoveBlank.Replace("\r\n", "");
-                str_RemoveBlank = str_RemoveBlank.Replace("forth_elem", "");
-                string[] str_Removeand = System.Text.RegularExpressions.Regex.Split(str_RemoveBlank, "and", System.Text.RegularExpressions.RegexOptions.None);
-                List<string> str_Removeandor = new List<string>();
-                for (int i = 0; i < str_Removeand.Length; i++)
-                {
-                    str_Removeandor.AddRange(System.Text.RegularExpressions.Regex.Split(str_Removeand[i], "or", System.Text.RegularExpressions.RegexOptions.None));
-                }
-                List<string> list_all = new List<string>();
-                for (int i = 0; i < str_Removeandor.Count; i++)
-                {
-                    list_all.AddRange(str_Removeandor[i].Split(new char[] { '+', '-', '*', '/', '=', '>', '<', '(', ')' }));
-                }
-                List<string> UsingElementL = new List<string>();
-                for (int i = 0; i < list_all.Count; i++)
-                {
-                    if (this.comboBox_PeriodicTable.Items.Contains(list_all[i]))
-                    {
-                        if (!UsingElementL.Contains(list_all[i]))
-                        {
-                            UsingElementL.Add(list_all[i]);
-                        }
-                    }
-                }
-
-                List<string> SubElements = new List<string>();
-                for (int i = 0; i < dataGridView_SubElements.ColumnCount; i++)
-                {
-                    if (UsingElementL.Contains(dataGridView_SubElements.Rows[0].Cells[i].Value))
-                    {
-                        SubElements.Add(dataGridView_SubElements.Rows[0].Cells[i].Value.ToString());
-                    }
-                }
-
-                dataGridView_SubElements.Rows.Clear();
-                dataGridView_SubElements.Columns.Clear();
-
-                for (int i = 0; i < SubElements.Count; i++)
-                {
-                    DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                    dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                    dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-                    if (dataGridView_SubElements.Rows.Count == 0)
-                    {
-                        DataGridViewRow row = new DataGridViewRow();
-                        dataGridView_SubElements.Rows.Add(row);
-                    }
-                    dataGridView_SubElements.Rows[0].Cells[dataGridView_SubElements.ColumnCount - 1].Value = SubElements[i];
-                }
-
-                if (SubElements.Count > 0)
-                {
-                    for (int i = 0; i < UsingElementL.Count; i++)
-                    {
-                        if (!SubElements.Contains(UsingElementL[i]))
-                        {
-                            DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                            dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
-                            dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                            if (dataGridView_KeyElements.Rows.Count == 0)
-                            {
-                                DataGridViewRow row = new DataGridViewRow();
-                                dataGridView_KeyElements.Rows.Add(row);
-                            }
-                            dataGridView_KeyElements.Rows[0].Cells[dataGridView_KeyElements.ColumnCount - 1].Value = UsingElementL[i];
-                        }
-                    }
-                }
-                else
-                {
-                    for (int i = 0; i < UsingElementL.Count; i++)
-                    {
-                        DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                        dataGridViewButtonColumn.Name = dataGridView_KeyElements.Columns.Count.ToString();
-                        dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                        if (dataGridView_KeyElements.Rows.Count == 0)
-                        {
-                            DataGridViewRow row = new DataGridViewRow();
-                            dataGridView_KeyElements.Rows.Add(row);
-                        }
-                        dataGridView_KeyElements.Rows[0].Cells[i].Value = UsingElementL[i];
-                    }
-                }
-                dataGridView_KeyElements.ClearSelection();
-                dataGridView_SubElements.ClearSelection();
-                XmlTree_STDlist.Focus();
-            }
-            else if(tabControl_Rules.SelectedIndex == 1)
-            {
-                XmlTree_MaxEDSRules.Focus();
-            }
-            else if (tabControl_Rules.SelectedIndex == 2)
-            {
-                XmlTree_ZeroElementRules.Focus();
-            }
-        }
-        
-		 #region  为配合textbox_STDEditor_Leave时事件,点击其它groupbox组件时使焦点转移
-        private void Form_ConstantsEditor_Click(object sender, EventArgs e)
-        {
-            groupBox_XmlTree_MaxEDSRules.Focus();
-        }
-        private void groupBox_Data_Click(object sender, EventArgs e)
-        {
-            groupBox_Data.Focus();
-        }
-        
-        private void groupBox_ChemicalElement_Click(object sender, EventArgs e)
-        {
-            groupBox_ChemicalElement.Focus();
-        }
-        private void groupBox_OtherCommonlyUsedSymbols_Click(object sender, EventArgs e)
-        {
-            groupBox_OtherCommonlyUsedSymbols.Focus();
-        }
-        private void groupBox_XmlTree_STDlist1_Click(object sender, EventArgs e)
-        {
-            groupBox_XmlTree_STDlist1.Focus();
-        }
-        private void groupBox_CalculatingSymbols_Click(object sender, EventArgs e)
-        {
-            groupBox_CalculatingSymbols.Focus();
-        }
-        private void groupBox_XmlTree_MaxEDSRules_Click(object sender, EventArgs e)
-        {
-            groupBox_XmlTree_MaxEDSRules.Focus();
-        }
-        #endregion
-		
-        #region 采集Xray 按钮事件
-        private void btnCollectXray_Click(object sender, EventArgs e)
-        {
-            string strTime = txtCollectTime.Text.Trim();
-            if (txtCollectTime.Equals(""))
-            {
-                showMessage(table["message33"].ToString());
-                txtCollectTime.Focus();
-                return;
-            }
-            if (!IsMatch(strTime, 1))
-            {
-                showMessage(table["message34"].ToString());
-                txtCollectTime.Focus();
-                return;
-            }
-            if (Convert.ToInt32(strTime) < 100)
-            {
-                showMessage(table["message35"].ToString());
-                txtCollectTime.Focus();
-                return;
-            }
-            //显示Xray
-            xrayByteData = IntArrToByteArr(GetCollectXray(strTime));
-            int color = Convert.ToInt32(ParseRGB(btn_dbs.BackColor));
-            //根据树节点修改对应的Xray信息
-            UpdateSTDXray(XmlTree_STDlist.SelectedNode, xrayByteData);
-            ShowXrayAtlas(color, xrayByteData);
-        }
-        /// <summary>
-        /// 获取采集当前的Xray信息
-        /// </summary>
-        /// <returns></returns>
-        protected uint[] GetCollectXray(string strTime)
-        {
-            try
-            {
-                if (null == m_cfun)
-                {
-                    m_cfun = COTSControlFunExport.GetControllerInstance("Bruker");
-                }
-                if (ConnectionSem(connectionEnumType.EDSOnlyPointXRay))
-                {
-                    if (EDSInit())
-                    {
-                        int iSize = 2000;
-                        uint[] iXrayData = new uint[iSize];
-                        //采集XRay数据
-                        if (m_cfun.CollectSpectrum(uint.Parse(strTime), ref iXrayData))
-                        {
-                            return iXrayData;
-                        }
-                    }
-                }
-                return null;
-            }
-            catch /*(Exception ex)*/
-            {
-                return null;
-            }
-            finally
-            {
-                //EDS过程结束
-                //m_cfun.EDSFinishedInstance();
-
-                //关闭连接
-                DisConnectSem(connectionEnumType.EDSOnlyPointXRay);
-            }
-        }
-        private void btnReadXray_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog fileSel = new OpenFileDialog();
-            fileSel.Filter = "|*.txt";
-            if (DialogResult.OK == fileSel.ShowDialog())
-            {
-                String str = "";
-                //读取Xray文件
-                using (StreamReader sr = new StreamReader(fileSel.FileName))
-                {
-                    while (!sr.EndOfStream)
-                    {
-                        str += sr.ReadLine() + ",";
-                    }
-                    str = str.Substring(0, str.Length - 1);
-                    string[] xrayData = str.Split(',');
-                    if (xrayData.Length != 2000)
-                    {
-                        return;
-                    }
-                    uint[] data = new uint[xrayData.Length];
-                    for (int i = 0; i < xrayData.Length; i++)
-                    {
-                        data[i] = Convert.ToUInt32(xrayData[i]);
-                    }
-                    //Xray数据
-                    xrayByteData = IntArrToByteArr(data);
-                    int color = Convert.ToInt32(ParseRGB(btn_dbs.BackColor));
-                    //根据树节点修改对应的Xray信息
-                    UpdateSTDXray(XmlTree_STDlist.SelectedNode, xrayByteData);
-                    ShowXrayAtlas(color, xrayByteData);
-                }
-            }
-        }
-
-        /// <summary>
-        /// 将int[] 转换为 byte[]
-        /// </summary>
-        /// <param name="intArr"></param>
-        /// <returns></returns>
-        public static byte[] IntArrToByteArr(uint[] intArr)
-        {
-            int intSize = sizeof(int) * intArr.Length;
-            byte[] bytArr = new byte[intSize];
-
-            //申请一块非托管内存  
-            //IntPtr ptr = Marshal.AllocHGlobal(intSize);
-            //复制int数组到该内存块  
-            //Marshal.Copy(intArr, 0, ptr, intArr.Length);
-            ////复制回byte数组  
-            //Marshal.Copy(ptr, bytArr, 0, bytArr.Length);
-            ////释放申请的非托管内存  
-            //Marshal.FreeHGlobal(ptr);
-            for (int i = 0; i < intSize; i++)
-            {
-                byte[] c1 = BitConverter.GetBytes(intArr[i]);
-                c1.CopyTo(bytArr, i * intSize);
-            }
-
-        
-            return bytArr;
-        }
-        /// <summary>
-        /// 将颜色对象转换为uint
-        /// </summary>
-        /// <param name="color"></param>
-        /// <returns></returns>
-        public uint ParseRGB(Color color)
-        {
-            return (uint)(((uint)color.B << 16) | (ushort)(((ushort)color.G << 8) | color.R));
-        }
-
-        #region 显示Xray图谱
-        /// <summary>
-        /// 显示Xray图谱
-        /// </summary>
-        protected void ShowXrayAtlas(int colorValue = 0, byte[] XrayData = null)
-        {
-            DataTable dt = new DataTable();
-            dt.Columns.Add("Color", typeof(int));
-            dt.Columns.Add("SPEC", typeof(byte[]));
-            DataRow dRow = dt.NewRow();
-            dRow["Color"] = colorValue;
-            if (XrayData != null)
-            {
-                dRow["SPEC"] = XrayData;
-            }
-            else
-            {
-                dRow["SPEC"] = new byte[8000];
-            }
-            //将选择行的数据传递给Xray控件
-            XrayControl.Dr = dRow;
-            XrayControl.Refresh();
-            XrayData = null;
-        }
-        #endregion
-
-        #region 常用数据验证的封装,数字字符的验证
-        /// <summary>
-        /// 常用数据验证的封装,数字字符的验证
-        /// </summary>
-        /// <param name="inputVal">需要验证的数值【字符串,或者数字】</param>
-        /// <param name="type">类型为哪一个验证</param>
-        /// <returns>如果验证成功则返回True,否则返回false</returns>
-        public bool IsMatch(string inputVal, int type)
-        {
-            switch (type)
-            {
-                case 0:
-                    return Regex.IsMatch(inputVal, @"^[1-9]d*$");  //匹配正整数
-                case 1:
-                    return Regex.IsMatch(inputVal, @"^-?\d+$");  //匹配整数
-                case 2:
-                    return Regex.IsMatch(inputVal, @"^[A-Za-z0-9]+$");  //匹配由数字和26个英文字母组成的字符串 
-                case 3:
-                    return Regex.IsMatch(inputVal, @"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$");  //匹配正浮点数
-                case 4:
-                    return Regex.IsMatch(inputVal, @"^[\u4e00-\u9fa5]{0,}$");  //匹配汉字
-                case 5:
-                    return Regex.IsMatch(inputVal, @"^[0-9]+(.[0-9]{1,3})?$");  //匹配1~3位小数的正实数
-                case 6:
-                    return Regex.IsMatch(inputVal, @"^[A-Za-z]+$");  //匹配英文字符
-                default:
-                    return true;
-            }
-        }
-        #endregion
-
-        #region 弹出提示
-        /// <summary>
-        /// 弹出提示
-        /// </summary>
-        /// <param name="strContent"></param>
-        protected void showMessage(string strContent)
-        {
-            MessageBox.Show(strContent, table["message32"].ToString());
-        }
-        #endregion
-
-        #region 连接与关闭设备
-        public bool ConnectionSem(connectionEnumType connectionType)
-        {
-            //获取连接电镜类型
-            string connTypeStr = GetConnectionType(connectionType);
-            //连接电镜标识
-            bool bDisConnResult = false;
-            //判断连接状态
-            if (!m_bConnectionState)
-            {
-                //连接电镜设置
-                bDisConnResult = m_cfun.ConncetSem();
-            }
-            if (bDisConnResult)
-            {
-                m_bConnectionState = true;
-            }
-            else
-            {
-                m_bConnectionState = false;
-            }
-            return bDisConnResult;
-        }
-
-        public bool DisConnectSem(connectionEnumType disConnectType)
-        {
-            //获取关闭电镜类型
-            string connTypeStr = GetConnectionType(disConnectType);
-            bool bDisConnResult = false;
-            if (m_bConnectionState)
-            {
-                //bDisConnResult = m_cfun.DisConnectSem();
-            }
-            if (bDisConnResult)
-            {
-                m_bConnectionState = false;
-            }
-            else
-            {
-                m_bConnectionState = true;
-            }
-            return bDisConnResult;
-        }
-
-        private string GetConnectionType(connectionEnumType connectionType)
-        {
-            string connString = string.Empty;
-            switch (connectionType)
-            {
-                //设置单点采集文字内容
-                case connectionEnumType.EDSOnlyPointXRay:
-                    connString = "OnlyPointXRay";
-                    break;
-                //设置多点采集文字内容
-                case connectionEnumType.EDSMultiPointXRay:
-                    connString = "MultiPointXRay";
-                    break;
-                //设置面采集文字内容
-                case connectionEnumType.EDSAreaXRay:
-                    connString = "AreaXRay";
-                    break;
-                //设置图片
-                case connectionEnumType.ScanImage:
-                    connString = "Image";
-                    break;
-                default: break;
-            }
-            return connString;
-        }
-
-        /// <summary>
-        /// EDS初始化
-        /// </summary>
-        public bool EDSInit()
-        {
-            bool bResult = false;
-            //线程调用 加载
-            bResult = m_cfun.EDSInit();
-            return bResult;
-        }
-        public enum connectionEnumType
-        {
-            EDSOnlyPointXRay = 0,
-            EDSMultiPointXRay = 1,
-            EDSAreaXRay = 2,
-            ScanImage = 3
-        }
-        /// <summary>
-        /// 标准Xray状态
-        /// </summary>
-        public enum STDXrayInfoState
-        {
-            Add = 0,
-            Modify = 1,
-            Delete = 2
-        }
-        #endregion
-
-        /// <summary>
-        /// 记录修改后的标准中的Xray信息
-        /// </summary>
-        public class STDXray
-        {
-            /// <summary>
-            /// 标准编号
-            /// </summary>
-            private string stdID;
-            /// <summary>
-            /// Xray数据
-            /// </summary>
-            private byte[] xrayData;
-            /// <summary>
-            /// 状态
-            /// </summary>
-            private int infoState=-1;
-
-            public string StdID { get => stdID; set => stdID = value; }
-            public byte[] XrayData { get => xrayData; set => xrayData = value; }
-            public int InfoState { get => infoState; set => infoState = value; }
-        }
-        #endregion
-
-        #region Xray 与 STDDB数据操作
-        /// <summary>
-        /// 绑定数据库中已存在的Xray信息
-        /// </summary>
-        protected void BindSTDXray()
-        {
-            //清空STDXray列表中的集合
-            m_STDXrayList.Clear();
-            //查询
-            DataTable dt = m_sc.GetDTFormSysSTDBySQLString("select Id,SPEC from STDMinerals");
-            if (dt != null)
-            {
-                if (dt.Rows.Count > 0)
-                {
-                    foreach (DataRow item in dt.Rows)
-                    {
-                        STDXray sXray = new STDXray();
-                        sXray.StdID = item["Id"].ToString();
-                        sXray.XrayData = (byte[])item["SPEC"];
-                        m_STDXrayList.Add(sXray);
-                    }
-                }
-            }
-        }
-        /// <summary>
-        /// 保存STDXray至数据库
-        /// </summary>
-        protected void SaveSTDXray()
-        {
-            ArrayList delArrayList = new ArrayList();
-            if (m_STDXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                    foreach (STDXray item in m_STDXrayList)
-                    {
-                        int infoState = item.InfoState;
-                        //添加状态 根据Xray信息当前只能按照一条操作
-                        if (infoState == (int)STDXrayInfoState.Add)
-                        {
-                            if (item.XrayData == null)
-                            {
-                                item.XrayData = new byte[8000];
-                            }
-                            string strvaluename = "@data";
-                            //编辑添加语句
-                            StringBuilder strSqlAdd = new StringBuilder();
-                            strSqlAdd.Append("insert into STDMinerals(Id,SPEC) values(" + item.StdID + "," + strvaluename + ");");
-                            bool addResult =  m_sc.ExecuteBlob(strSqlAdd.ToString(), strvaluename, (byte[])item.XrayData, ((byte[])item.XrayData).Length);
-                            if (!addResult)
-                            {
-                                continue;
-                            }
-                        }
-                        //修改状态
-                        else if (infoState == (int)STDXrayInfoState.Modify)
-                        {
-                            //判断STDID在数据库中是否存在
-                            bool selResult = SelSTDDBBySTDId(item.StdID);
-                            if (selResult)
-                            {
-                                UpdateSTDDB(item.StdID, xrayByteData);
-                            }
-                            else
-                            {
-                                AddSTDDB(item.StdID, xrayByteData);
-                            }
-                        }
-                        //删除状态 编辑批量删除语句
-                        else if (infoState == (int)STDXrayInfoState.Delete)
-                        {
-                            //编辑删除语句
-                            delArrayList.Add("delete from STDMinerals where id=" + item.StdID + ";");
-                        }
-                    }
-                    //批量删除
-                    if (delArrayList.Count>0)
-                    {
-                        bool delResult = m_sc.DelSTDInfo(delArrayList);
-                    }
-                //}
-            }
-        }
-        
-        /// <summary>
-        /// 添加STD信息至数据库
-        /// </summary>
-        protected bool AddSTDDB(string stdID,byte[] XrayData)
-        {
-            if (XrayData == null)
-            {
-                XrayData = new byte[8000];
-            }
-            string strvaluename = "@data";
-            StringBuilder sqlStrAdd = new StringBuilder();
-            sqlStrAdd.Append("insert into STDMinerals(Id,SPEC) values(" + stdID + "," + strvaluename + ");");
-            bool addResult = m_sc.ExecuteBlob(sqlStrAdd.ToString(), strvaluename, (byte[])XrayData, ((byte[])XrayData).Length);
-            return addResult;
-        }
-
-        /// <summary>
-        /// 修改STD信息至数据库
-        /// </summary>
-        protected bool UpdateSTDDB(string stdID, byte[] XrayData)
-        {
-            if (XrayData == null)
-            {
-                XrayData = new byte[8000];
-            }
-            string strValueName = "@data";
-            StringBuilder sqlStrUpdate = new StringBuilder();
-            sqlStrUpdate.Append("update STDMinerals set SPEC=" + strValueName + " where id=" + stdID + ";");
-            bool updateResult = m_sc.ExecuteBlob(sqlStrUpdate.ToString(), strValueName, (byte[])XrayData, ((byte[])XrayData).Length);
-            return updateResult;
-        }
-        /// <summary>
-        /// 查询是否存在标准编号
-        /// </summary>
-        /// <param name="stdID"></param>
-        protected bool SelSTDDBBySTDId(string stdID)
-        {
-            bool selResult = false;
-            //编辑查询语句
-            StringBuilder sqlStr = new StringBuilder();
-            sqlStr.Append("select * from STDMinerals where id=" + stdID + "");
-            DataTable dt = m_sc.GetDTFormSysSTDBySQLString(sqlStr.ToString());
-            if (dt != null)
-            {
-                if (dt.Rows.Count > 0)
-                {
-                    //已存在状态
-                    selResult = true;
-                }
-            }
-            return selResult;
-        }
-        /// <summary>
-        /// 根据选择树节点显示对应的Xray信息
-        /// </summary>
-        protected void SelSTDXray(TreeNode tn)
-        {
-            if (tn == null)
-            {
-                return;
-            }
-            if (m_STDXrayList != null)
-            {
-                if (m_STDXrayList.Count > 0)
-                {
-                    bool isExists = false;
-                    foreach (STDXray item in m_STDXrayList)
-                    {
-                        //修改XrayData信息
-                        if (item.StdID == tn.ToolTipText.ToString())
-                        {
-                            string selColor = ParseRGB(tn.BackColor).ToString();
-                            int colorValue = Convert.ToInt32(selColor);
-                            //显示Xray信息
-                            if (item.XrayData != null)
-                            {
-                                isExists = true;
-                                ShowXrayAtlas(colorValue, item.XrayData);
-                            }
-                            break;
-                        }
-                    }
-                    if (!isExists)
-                    {
-                        ShowXrayAtlas();
-                    }
-                }
-            }
-
-        }
-        /// <summary>
-        /// 根据树节点修改对应的Xray信息
-        /// </summary>
-        /// <param name="tn"></param>
-        protected void UpdateSTDXray(TreeNode tn,byte[] xrayData)
-        {
-            if (tn == null)
-            {
-                return;
-            }
-            if (m_STDXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                    bool isExists = false;
-                    foreach (STDXray item in m_STDXrayList)
-                    {
-                        //修改XrayData信息
-                        if (item.StdID == tn.ToolTipText.ToString())
-                        {
-                            item.XrayData = xrayData;
-                            item.InfoState = (int)STDXrayInfoState.Modify;
-                            isExists = true;
-                            break;
-                        }
-                    }
-                    if (!isExists)
-                    {
-                        if (!tn.ToolTipText.ToString().Equals(""))
-                        {
-                            //添加STD XrayData信息
-                            STDXray stdXray = new STDXray();
-                            stdXray.StdID = tn.ToolTipText.ToString();
-                            stdXray.XrayData = xrayData;
-                            stdXray.InfoState = (int)STDXrayInfoState.Add;
-                            m_STDXrayList.Add(stdXray);
-                        }
-                    }
-                //}
-            }
-        }
-        /// <summary>
-        /// 添加STDXray信息
-        /// </summary>
-        /// <param name="tn">所选树节点</param>
-        /// <param name="xrayData">Xray信息</param>
-        /// <returns></returns>
-        protected bool AddSTDXray(TreeNode tn, byte[] xrayData)
-        {
-            bool addResult = false;
-            if (tn == null)
-            {
-                return false;
-            }
-            if (m_STDXrayList != null)
-            {
-                if (m_STDXrayList.Count > 0)
-                {
-                    if (!tn.ToolTipText.ToString().Equals(""))
-                    {
-                        //添加STD XrayData信息
-                        STDXray stdXray = new STDXray();
-                        stdXray.StdID = tn.ToolTipText.ToString();
-                        stdXray.XrayData = xrayData;
-                        stdXray.InfoState = (int)STDXrayInfoState.Add;
-                        m_STDXrayList.Add(stdXray);
-                        addResult = true;
-                    }
-                }
-            }
-            return addResult;
-        }
-        /// <summary>
-        /// 删除STDXray信息
-        /// </summary>
-        /// <param name="tn">所选要删除的树节点</param>
-        /// <returns></returns>
-        protected bool DelSTDXray(TreeNode tn)
-        {
-            bool delResult = false;
-            if (tn == null)
-            {
-                return false;
-            }
-            if (m_STDXrayList != null)
-            {
-                if (m_STDXrayList.Count > 0)
-                {
-                    if (!tn.ToolTipText.ToString().Equals(""))
-                    {
-                        foreach (STDXray item in m_STDXrayList)
-                        {
-                            //修改XrayData信息
-                            if (item.StdID == tn.ToolTipText.ToString())
-                            {
-                                item.InfoState = (int)STDXrayInfoState.Delete;
-                                delResult = true;
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-            return delResult;
-        }
-        #endregion
-        #region 控制BSE、化学式、元素本文框中不能输入下划线
-        /// <summary>
-        /// 控件不能输入下划线
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void textBox_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            if ((e.KeyChar >= '0' && e.KeyChar <= '9') || (e.KeyChar >= 'A' && e.KeyChar <= 'Z') ||
-                  (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar == 8) || !(e.KeyChar == '_'))
-            {
-                e.Handled = false;
-            }
-
-            else
-            {
-                e.Handled = true;
-            }
-        }
-        #endregion
-
-        private void button_1_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "1");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_2_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "2");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_3_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "3");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_4_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "4");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_5_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "5");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_6_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "6");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_7_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "7");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_8_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "8");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_9_Click(object sender, EventArgs e)
-        {
-            //textbox_STDEditor 中的光标
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "9");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void button_0_Click(object sender, EventArgs e)
-        {
-            int index = textbox_STDEditor.SelectionStart;
-            textbox_STDEditor.Text = textbox_STDEditor.Text.Insert(index, "0");
-
-            textbox_STDEditor.Focus();
-            textbox_STDEditor.Select(index + 1, 0);
-            textbox_STDEditor.ScrollToCaret();
-        }
-
-        private void tabSTDStandrad_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            if (tabSTDStandrad.SelectedIndex == 1)
-            {
-                tabControl_Rules.SelectedIndex = 0;
-                XmlTree_STDlist.Focus();
-            }
-        }
-
-        private void btnTest_Click(object sender, EventArgs e)
-        {
-            XrayContrastForm xrayContrastForm = new XrayContrastForm();
-            //xrayContrastForm.XmlTree_STDlist = XmlTree_STDlist.Nodes;
-            xrayContrastForm.ShowDialog();
-        }
-        private void XmlTree_STDlist_AfterSelect(object sender, TreeViewEventArgs e)
-        {
-            SetBlackAllNodes(XmlTree_STDlist);
-
-            this.textbox_STDEditor.Text = XmlTree_STDlist.SelectedNode.Tag.ToString();
-            btn_dbs.BackColor = XmlTree_STDlist.SelectedNode.BackColor;
-
-
-            string[] strOther = XmlTree_STDlist.SelectedNode.Name.Split('$');
-
-            string[] strOther2 = strOther[0].Split('_');
-            textBox_Hardness.Text = strOther2[0];
-            textBox_Density.Text = strOther2[1];
-            textBox_Electrical_conductivity.Text = strOther2[2];
-
-
-            dataGridView_KeyElements.Rows.Clear();
-            dataGridView_KeyElements.Columns.Clear();
-
-            string[] KeyElement = strOther[1].Split(',');
-            for (int i = 0; i < KeyElement.Length; i++)
-            {
-                if (KeyElement[0] != "")
-                {
-                    DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                    dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                    dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
-                    if (dataGridView_KeyElements.Rows.Count == 0)
-                    {
-                        DataGridViewRow row = new DataGridViewRow();
-                        dataGridView_KeyElements.Rows.Add(row);
-                    }
-                    dataGridView_KeyElements.Rows[0].Cells[i].Value = KeyElement[i];
-                }
-            }
-
-
-            dataGridView_SubElements.Rows.Clear();
-            dataGridView_SubElements.Columns.Clear();
-
-            string[] SubElement = strOther[2].Split(',');
-            for (int i = 0; i < SubElement.Length; i++)
-            {
-                if (SubElement[i] != "")
-                {
-                    DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
-                    dataGridViewButtonColumn.Name = dataGridView_SubElements.Columns.Count.ToString();
-                    dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
-                    if (dataGridView_SubElements.Rows.Count == 0)
-                    {
-                        DataGridViewRow row = new DataGridViewRow();
-                        dataGridView_SubElements.Rows.Add(row);
-                    }
-                    dataGridView_SubElements.Rows[0].Cells[i].Value = SubElement[i];
-                }
-            }
-
-            if (button_UpOrder.Enabled == false)
-            {
-                button_UpOrder.Enabled = true;
-            }
-            if (button_DownOrder.Enabled == false)
-            {
-                button_DownOrder.Enabled = true;
-            }
-            if (XmlTree_STDlist.SelectedNode.PrevNode == null)
-            {
-                button_UpOrder.Enabled = false;
-            }
-            else if (XmlTree_STDlist.SelectedNode.NextNode == null)
-            {
-                button_DownOrder.Enabled = false;
-            }
-
-            dataGridView_KeyElements.ClearSelection();
-            dataGridView_SubElements.ClearSelection();
-            ShowEditContent(XmlTree_STDlist.SelectedNode);
-            SelSTDXray(XmlTree_STDlist.SelectedNode);
-
-
-        }
-
-        protected void ShowEditContent(TreeNode tn)
-        {
-            if (m_STDXrayList != null)
-            {
-                for (int i = 0; i < m_STDXrayList.Count; i++)
-                {
-                    if (m_STDXrayList[i].StdID == tn.ToolTipText.ToString())
-                    {
-
-                        //获取修改行的信息
-                        xrayByteData = (byte[])m_STDXrayList[i].XrayData;
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 123
OTSPartA_STDEditor/Form_STDConstantsEditor.resx

@@ -1,123 +0,0 @@
-<?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>
-  <metadata name="XmlTreeMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-</root>

+ 6 - 18
OTSPartA_STDEditor/ImportStandardLibraryTypeSelection.Designer.cs

@@ -29,23 +29,14 @@ namespace OTSPartA_STDEditor
         /// </summary>
         private void InitializeComponent()
         {
-            this.bn_xray = new System.Windows.Forms.Button();
             this.bn_expression = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
-            // bn_xray
-            // 
-            this.bn_xray.Location = new System.Drawing.Point(41, 39);
-            this.bn_xray.Name = "bn_xray";
-            this.bn_xray.Size = new System.Drawing.Size(252, 60);
-            this.bn_xray.TabIndex = 0;
-            this.bn_xray.Text = "X-ray谱峰图";
-            this.bn_xray.UseVisualStyleBackColor = true;
-            this.bn_xray.Click += new System.EventHandler(this.bn_xray_Click);
-            // 
             // bn_expression
             // 
-            this.bn_expression.Location = new System.Drawing.Point(41, 136);
+            this.bn_expression.Location = new System.Drawing.Point(22, 17);
+            this.bn_expression.MaximumSize = new System.Drawing.Size(252, 60);
+            this.bn_expression.MinimumSize = new System.Drawing.Size(252, 60);
             this.bn_expression.Name = "bn_expression";
             this.bn_expression.Size = new System.Drawing.Size(252, 60);
             this.bn_expression.TabIndex = 1;
@@ -57,13 +48,12 @@ namespace OTSPartA_STDEditor
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(329, 236);
+            this.ClientSize = new System.Drawing.Size(303, 102);
             this.Controls.Add(this.bn_expression);
-            this.Controls.Add(this.bn_xray);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(345, 275);
+            this.MaximumSize = new System.Drawing.Size(319, 141);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(345, 275);
+            this.MinimumSize = new System.Drawing.Size(319, 141);
             this.Name = "ImportStandardLibraryTypeSelection";
             this.ShowIcon = false;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
@@ -73,8 +63,6 @@ namespace OTSPartA_STDEditor
         }
 
         #endregion
-
-        private System.Windows.Forms.Button bn_xray;
         private System.Windows.Forms.Button bn_expression;
     }
 }

+ 0 - 6
OTSPartA_STDEditor/ImportStandardLibraryTypeSelection.cs

@@ -29,12 +29,6 @@ namespace OTSPartA_STDEditor
             table = lan.GetNameTable(this.Name);
         }
 
-        private void bn_xray_Click(object sender, EventArgs e)
-        {
-            m_selectevent = "xray";
-            this.Close();
-        }
-
         private void bn_expression_Click(object sender, EventArgs e)
         {
             m_selectevent = "expression";

+ 0 - 29
OTSPartA_STDEditor/OTSPartA_STDEditor.csproj

@@ -214,7 +214,6 @@
       <DependentUpon>Attributes.cs</DependentUpon>
     </Compile>
     <Compile Include="CommonClass\SqlLiteClass.cs" />
-    <Compile Include="EDSController.cs" />
     <Compile Include="FormForWaiting.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -276,12 +275,6 @@
     <Compile Include="Form_Main.Designer.cs">
       <DependentUpon>Form_Main.cs</DependentUpon>
     </Compile>
-    <Compile Include="Form_STDConstantsEditor.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form_STDConstantsEditor.Designer.cs">
-      <DependentUpon>Form_STDConstantsEditor.cs</DependentUpon>
-    </Compile>
     <Compile Include="Language.cs" />
     <Compile Include="OTSDockWindow\OTSDockWindow.cs" />
     <Compile Include="Program.cs" />
@@ -304,18 +297,6 @@
     <Compile Include="SubMidWindow.Designer.cs">
       <DependentUpon>SubMidWindow.cs</DependentUpon>
     </Compile>
-    <Compile Include="UserControl\UXrayControl.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="UserControl\UXrayControl.Designer.cs">
-      <DependentUpon>UXrayControl.cs</DependentUpon>
-    </Compile>
-    <Compile Include="XrayContrastForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="XrayContrastForm.Designer.cs">
-      <DependentUpon>XrayContrastForm.cs</DependentUpon>
-    </Compile>
     <EmbeddedResource Include="Attributes.resx">
       <DependentUpon>Attributes.cs</DependentUpon>
     </EmbeddedResource>
@@ -340,9 +321,6 @@
     <EmbeddedResource Include="Form_MaxEDSRules.resx">
       <DependentUpon>Form_MaxEDSRules.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Form_STDConstantsEditor.resx">
-      <DependentUpon>Form_STDConstantsEditor.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="Form_UserConstants.resx">
       <DependentUpon>Form_UserConstants.cs</DependentUpon>
     </EmbeddedResource>
@@ -363,13 +341,6 @@
     <EmbeddedResource Include="SubMidWindow.resx">
       <DependentUpon>SubMidWindow.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="UserControl\UXrayControl.resx">
-      <DependentUpon>UXrayControl.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="XrayContrastForm.resx">
-      <DependentUpon>XrayContrastForm.cs</DependentUpon>
-    </EmbeddedResource>
-    <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

+ 4 - 102
OTSPartA_STDEditor/ReferenceLibrary.cs

@@ -16,7 +16,6 @@ namespace OTSPartA_STDEditor
         public SubMidWindow m_SubMidWindow = null;
         protected SourceGrid.Cells.Views.Cell m_CellGroupType = null;
         public Dictionary<int, STDdata> ReferenceDictionary = new Dictionary<int, STDdata>();
-        List<STDEditor.STDXray> ReferenceXrayList = null;
         byte[] ReferencexrayByteData = null;
         System.Collections.Hashtable table_ReferenceLibrary;
         Dictionary<int, string> ReferenceGroup = new Dictionary<int, string>();
@@ -142,25 +141,6 @@ namespace OTSPartA_STDEditor
                         }
                     }
                 }
-                //加载Xray信息
-                System.Data.SQLite.SQLiteDataAdapter m_dataAdapterXray = new System.Data.SQLite.SQLiteDataAdapter("select Id,SPEC from STDMinerals", m_dbConnection);
-                DataSet dsXray = new DataSet();
-                m_dataAdapterXray.Fill(dsXray);
-                DataTable dtXray = dsXray.Tables[0];
-                ReferenceXrayList=new List<STDEditor.STDXray>();
-                if (dtXray != null)
-                {
-                    if (dtXray.Rows.Count > 0)
-                    {
-                        foreach (DataRow item in dtXray.Rows)
-                        {
-                            STDEditor.STDXray sXray = new STDEditor.STDXray();
-                            sXray.StdID = item["Id"].ToString();
-                            sXray.XrayData = (byte[])item["SPEC"];
-                            ReferenceXrayList.Add(sXray);
-                        }
-                    }
-                }
 
                 System.Data.SQLite.SQLiteDataAdapter m_dataAdapterGroup = new System.Data.SQLite.SQLiteDataAdapter("select Id,name from STDGroups", m_dbConnection);
                 DataSet dsGroup = new DataSet();
@@ -174,6 +154,10 @@ namespace OTSPartA_STDEditor
                         {
                             ReferenceGroup.Add(int.Parse(item["Id"].ToString()), item["name"].ToString());
                         }
+                        if(!ReferenceGroup.Keys.Contains(0))
+                        {
+                            ReferenceGroup.Add(0, "Default");
+                        }
                     }
                 }
 
@@ -285,13 +269,10 @@ namespace OTSPartA_STDEditor
                 if ((bool)PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value == true)
                 {
                     PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value = false;
-                    m_SubMidWindow.m_STDEditor.ShowXrayAtlas();
                 }
                 else
                 {
                     int r = PropGrid.Selection.ActivePosition.Row;
-                    SelReferenceXray((int)PropGrid.Rows[r].Tag,ReferenceDictionary[(int)PropGrid.Rows[r].Tag]);
-                    ShowReferenceContent(PropGrid.Rows[r].Tag.ToString());
 
                     MakeCheckboxUnchecked();
                     PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value = true;
@@ -300,60 +281,6 @@ namespace OTSPartA_STDEditor
             }
         }
 
-        private void ShowReferenceContent(string stdID)
-        {
-            if (ReferenceXrayList != null)
-            {
-                for (int i = 0; i < ReferenceXrayList.Count; i++)
-                {
-                    if (ReferenceXrayList[i].StdID == stdID)
-                    {
-                        //获取修改行的信息
-                        ReferencexrayByteData = (byte[])ReferenceXrayList[i].XrayData;
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// 根据选择节点显示对应的Xray信息
-        /// </summary>
-        public void SelReferenceXray(int Key, STDdata sT)
-        {
-            if (sT == null)
-            {
-                return;
-            }
-            if (ReferenceXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                bool isExists = false;
-                foreach (STDEditor.STDXray item in ReferenceXrayList)
-                {
-                    //修改XrayData信息
-                    if (item.StdID == Key.ToString())
-                    {
-                        string selColor = m_SubMidWindow.m_STDEditor.ParseRGB(STDEditor.colorHx16toRGB(sT.Color)).ToString();
-                        int colorValue = Convert.ToInt32(selColor);
-                        //显示Xray信息
-                        if (item.XrayData != null)
-                        {
-                            isExists = true;
-                            m_SubMidWindow.m_STDEditor.ShowXrayAtlas(colorValue, item.XrayData);
-                        }
-                        break;
-                    }
-                }
-                if (!isExists)
-                {
-                    m_SubMidWindow.m_STDEditor.ShowXrayAtlas();
-                }
-                //}
-            }
-
-        }
-
         private void TSLoad_Click(object sender, EventArgs e)
         {
             OpenFileDialog fileSel = new OpenFileDialog();
@@ -376,7 +303,6 @@ namespace OTSPartA_STDEditor
             if (PropGrid.RowsCount > 1)
             {
                 PropGrid.Rows.RemoveRange(1, PropGrid.RowsCount - 1);
-                m_SubMidWindow.m_STDEditor.ShowXrayAtlas();
                 ReferenceDictionary.Clear();
                 this.Text = this.Text.Split(' ')[0];
                 PropGrid.Refresh();
@@ -470,18 +396,6 @@ namespace OTSPartA_STDEditor
                             m_SubMidWindow.m_MainForm.m_STDRuleslist.Refresh();
 
                             m_SubMidWindow.m_MainForm.m_STDRuleslist.PreRow = i;
-
-                            for (int k = 0; k < ReferenceXrayList.Count; k++)
-                            {
-                                if (int.Parse(ReferenceXrayList[k].StdID) == STDnum)
-                                {
-                                    STDEditor.STDXray tDXray=new STDEditor.STDXray();
-                                    tDXray.StdID = (STDId+1).ToString();
-                                    tDXray.XrayData = ReferenceXrayList[k].XrayData;
-                                    tDXray.InfoState = (int)STDEditor.STDXrayInfoState.Add;
-                                    m_SubMidWindow.m_STDEditor.m_STDXrayList.Add(tDXray);
-                                }
-                            }
                         }
 
                     }
@@ -578,18 +492,6 @@ namespace OTSPartA_STDEditor
             m_SubMidWindow.m_MainForm.m_STDRuleslist.AddNewRow(STDId + 1, sT.StrName, STDRuleslist.colorHx16toRGB(sT.Color));
             m_SubMidWindow.m_MainForm.m_STDRuleslist.Refresh();
             m_SubMidWindow.m_MainForm.m_STDRuleslist.PreRow = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.RowsCount - 1;
-
-            for (int k = 0; k < ReferenceXrayList.Count; k++)
-            {
-                if (int.Parse(ReferenceXrayList[k].StdID) == STDnum)
-                {
-                    STDEditor.STDXray tDXray = new STDEditor.STDXray();
-                    tDXray.StdID = (STDId + 1).ToString();
-                    tDXray.XrayData = ReferenceXrayList[k].XrayData;
-                    tDXray.InfoState = (int)STDEditor.STDXrayInfoState.Add;
-                    m_SubMidWindow.m_STDEditor.m_STDXrayList.Add(tDXray);
-                }
-            }
         }
     }
 }

+ 0 - 131
OTSPartA_STDEditor/STDEditor.Designer.cs

@@ -70,16 +70,6 @@
             this.comboBox_Elem1 = new System.Windows.Forms.ComboBox();
             this.comboBox_Elem = new System.Windows.Forms.ComboBox();
             this.comboBox_ImgProperty = new System.Windows.Forms.ComboBox();
-            this.tabXray = new System.Windows.Forms.TabPage();
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.button_ImportFromResult = new System.Windows.Forms.Button();
-            this.btnTest = new System.Windows.Forms.Button();
-            this.label9 = new System.Windows.Forms.Label();
-            this.txtCollectTime = new System.Windows.Forms.TextBox();
-            this.btnReadXray = new System.Windows.Forms.Button();
-            this.btnCollectXray = new System.Windows.Forms.Button();
-            this.label2 = new System.Windows.Forms.Label();
-            this.plXray = new System.Windows.Forms.Panel();
             this.tabSTDStandrad.SuspendLayout();
             this.tabSTD.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView_SubElements)).BeginInit();
@@ -88,15 +78,12 @@
             this.groupBox_CalculatingSymbols.SuspendLayout();
             this.groupBox_ChemicalElement.SuspendLayout();
             this.groupBox_OtherCommonlyUsedSymbols.SuspendLayout();
-            this.tabXray.SuspendLayout();
-            this.panel1.SuspendLayout();
             this.SuspendLayout();
             // 
             // tabSTDStandrad
             // 
             this.tabSTDStandrad.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
             this.tabSTDStandrad.Controls.Add(this.tabSTD);
-            this.tabSTDStandrad.Controls.Add(this.tabXray);
             this.tabSTDStandrad.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tabSTDStandrad.Location = new System.Drawing.Point(0, 0);
             this.tabSTDStandrad.Name = "tabSTDStandrad";
@@ -609,111 +596,6 @@
             this.comboBox_ImgProperty.TabIndex = 4;
             this.comboBox_ImgProperty.SelectedIndexChanged += new System.EventHandler(this.comboBox_ImgProperty_SelectedIndexChanged);
             // 
-            // tabXray
-            // 
-            this.tabXray.Controls.Add(this.panel1);
-            this.tabXray.Controls.Add(this.plXray);
-            this.tabXray.Location = new System.Drawing.Point(4, 25);
-            this.tabXray.Name = "tabXray";
-            this.tabXray.Padding = new System.Windows.Forms.Padding(3);
-            this.tabXray.Size = new System.Drawing.Size(1252, 430);
-            this.tabXray.TabIndex = 1;
-            this.tabXray.Text = "Xray";
-            this.tabXray.UseVisualStyleBackColor = true;
-            // 
-            // panel1
-            // 
-            this.panel1.Controls.Add(this.button_ImportFromResult);
-            this.panel1.Controls.Add(this.btnTest);
-            this.panel1.Controls.Add(this.label9);
-            this.panel1.Controls.Add(this.txtCollectTime);
-            this.panel1.Controls.Add(this.btnReadXray);
-            this.panel1.Controls.Add(this.btnCollectXray);
-            this.panel1.Controls.Add(this.label2);
-            this.panel1.Location = new System.Drawing.Point(3, 0);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1246, 37);
-            this.panel1.TabIndex = 17;
-            // 
-            // button_ImportFromResult
-            // 
-            this.button_ImportFromResult.Location = new System.Drawing.Point(403, 5);
-            this.button_ImportFromResult.Name = "button_ImportFromResult";
-            this.button_ImportFromResult.Size = new System.Drawing.Size(111, 23);
-            this.button_ImportFromResult.TabIndex = 34;
-            this.button_ImportFromResult.Text = "从结果中导入";
-            this.button_ImportFromResult.UseVisualStyleBackColor = true;
-            this.button_ImportFromResult.Click += new System.EventHandler(this.button_ImportFromResult_Click);
-            // 
-            // btnTest
-            // 
-            this.btnTest.Location = new System.Drawing.Point(536, 5);
-            this.btnTest.Name = "btnTest";
-            this.btnTest.Size = new System.Drawing.Size(75, 23);
-            this.btnTest.TabIndex = 33;
-            this.btnTest.Text = "Test";
-            this.btnTest.UseVisualStyleBackColor = true;
-            this.btnTest.Visible = false;
-            this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("宋体", 9F);
-            this.label9.Location = new System.Drawing.Point(145, 13);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(17, 12);
-            this.label9.TabIndex = 32;
-            this.label9.Text = "MS";
-            // 
-            // txtCollectTime
-            // 
-            this.txtCollectTime.Location = new System.Drawing.Point(86, 8);
-            this.txtCollectTime.Name = "txtCollectTime";
-            this.txtCollectTime.Size = new System.Drawing.Size(56, 21);
-            this.txtCollectTime.TabIndex = 28;
-            this.txtCollectTime.Text = "120";
-            this.txtCollectTime.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // btnReadXray
-            // 
-            this.btnReadXray.Location = new System.Drawing.Point(238, 6);
-            this.btnReadXray.Name = "btnReadXray";
-            this.btnReadXray.Size = new System.Drawing.Size(145, 23);
-            this.btnReadXray.TabIndex = 31;
-            this.btnReadXray.TabStop = false;
-            this.btnReadXray.Text = "ImportXrayFile";
-            this.btnReadXray.UseVisualStyleBackColor = true;
-            this.btnReadXray.Click += new System.EventHandler(this.btnReadXray_Click);
-            // 
-            // btnCollectXray
-            // 
-            this.btnCollectXray.Location = new System.Drawing.Point(164, 7);
-            this.btnCollectXray.Name = "btnCollectXray";
-            this.btnCollectXray.Size = new System.Drawing.Size(68, 23);
-            this.btnCollectXray.TabIndex = 30;
-            this.btnCollectXray.TabStop = false;
-            this.btnCollectXray.Text = "Collect";
-            this.btnCollectXray.UseVisualStyleBackColor = true;
-            this.btnCollectXray.Click += new System.EventHandler(this.btnCollectXray_Click);
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("宋体", 9F);
-            this.label2.Location = new System.Drawing.Point(3, 12);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(83, 12);
-            this.label2.TabIndex = 29;
-            this.label2.Text = "Collect Time:";
-            // 
-            // plXray
-            // 
-            this.plXray.Location = new System.Drawing.Point(3, 43);
-            this.plXray.Name = "plXray";
-            this.plXray.Size = new System.Drawing.Size(1246, 381);
-            this.plXray.TabIndex = 16;
-            // 
             // STDEditor
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -740,9 +622,6 @@
             this.groupBox_ChemicalElement.ResumeLayout(false);
             this.groupBox_OtherCommonlyUsedSymbols.ResumeLayout(false);
             this.groupBox_OtherCommonlyUsedSymbols.PerformLayout();
-            this.tabXray.ResumeLayout(false);
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
             this.ResumeLayout(false);
 
         }
@@ -785,21 +664,11 @@
         public System.Windows.Forms.ComboBox comboBox_Elem1;
         public System.Windows.Forms.ComboBox comboBox_Elem;
         public System.Windows.Forms.ComboBox comboBox_ImgProperty;
-        private System.Windows.Forms.TabPage tabXray;
-        private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Button btnTest;
-        private System.Windows.Forms.Label label9;
-        private System.Windows.Forms.TextBox txtCollectTime;
-        private System.Windows.Forms.Button btnReadXray;
-        private System.Windows.Forms.Button btnCollectXray;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Panel plXray;
         public System.Windows.Forms.TextBox textbox_STDEditor;
         private System.Windows.Forms.Label label_KeyElements;
         private System.Windows.Forms.Label label_SubElements;
         public System.Windows.Forms.DataGridView dataGridView_KeyElements;
         public System.Windows.Forms.DataGridView dataGridView_SubElements;
         private System.Windows.Forms.Button button_PeriodicTableSwitch;
-        private System.Windows.Forms.Button button_ImportFromResult;
     }
 }

+ 0 - 636
OTSPartA_STDEditor/STDEditor.cs

@@ -1,18 +1,10 @@
 using OTS.WinFormsUI.Docking;
 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 OTSCLRINTERFACE;
 using System.Collections;
-using System.IO;
-using System.Runtime.InteropServices;
 using System.Text.RegularExpressions;
 
 namespace OTSPartA_STDEditor
@@ -25,16 +17,8 @@ namespace OTSPartA_STDEditor
         Hashtable table_STDEditor;
         //数据库操作对象
         public SqlLiteClass m_sc = null;
-        // 电镜设置对象
-        EDSController m_EDSHardwareMgr = null;
-        //Xray图谱用户控件
-        UXrayControl XrayControl = null;
-        //全局Xray 用于存储当前选择行的Xray信息
-        byte[] xrayByteData = null;
         // 连接状态
         bool m_bConnectionState = false;
-        //标准Xray信息列表
-        public List<STDXray> m_STDXrayList = null;
         #endregion
 
         public enum Result
@@ -130,14 +114,6 @@ namespace OTSPartA_STDEditor
             dataGridView_SubElements.ColumnHeadersVisible = false;
             dataGridView_SubElements.AllowUserToAddRows = false;
             dataGridView_SubElements.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
-
-            //添加Xray用户控件
-            XrayControl = new UXrayControl();
-            plXray.Controls.Add(XrayControl);
-            XrayControl.Dock = DockStyle.Fill;
-            //绑定数据库中的STDXray 
-            m_STDXrayList = new List<STDXray>();
-            BindSTDXray(); 
         }
         /// <summary>
         /// [颜色:16进制转成RGB]
@@ -482,124 +458,6 @@ namespace OTSPartA_STDEditor
             }
         }
 
-
-        //采集Xray 按钮事件
-        private void btnCollectXray_Click(object sender, EventArgs e)
-        {
-            m_SubMidWindow.m_MainForm.IsModified = true;
-            string strTime = txtCollectTime.Text.Trim();
-            if (txtCollectTime.Equals(""))
-            {
-                showMessage("Please fill in the collection time name!");
-                txtCollectTime.Focus();
-                return;
-            }
-            if (!IsMatch(strTime, 1))
-            {
-                showMessage("Error collecting time content, the format should be integer!");
-                txtCollectTime.Focus();
-                return;
-            }
-            if (Convert.ToInt32(strTime) < 50)
-            {
-                showMessage("CollectTime must not be less than 100 milliseconds!");
-                txtCollectTime.Focus();
-                return;
-            }
-            //显示Xray
-            xrayByteData = IntArrToByteArr(GetCollectXray(strTime));
-            m_EDSHardwareMgr.DisConnect();
-            int color = Convert.ToInt32(ParseRGB(colorHx16toRGB(m_SubMidWindow.m_MainForm.STDDictionary[STDId].Color)).ToString());
-            //根据树节点修改对应的Xray信息
-            UpdateSTDXray(STDId, xrayByteData);
-            ShowXrayAtlas(color, xrayByteData);
-        }
-        /// <summary>
-        /// 获取采集当前的Xray信息
-        /// </summary>
-        /// <returns></returns>
-        protected uint[] GetCollectXray(string strTime)
-        {
-            //控制类对象初始化
-            if (null == m_EDSHardwareMgr)
-            {
-                m_EDSHardwareMgr = EDSController.GetEDSController();
-            }
-
-            //1.连接电镜
-            if (m_EDSHardwareMgr.Connect())
-            {
-                int iSize = 2000;
-                uint[] iXrayData = new uint[iSize];
-                //采集XRay数据
-                if (m_EDSHardwareMgr.CollectSpectrum(uint.Parse(strTime), ref iXrayData))
-                {
-                    return iXrayData;
-                }
-            }
-
-            return null;
-        }
-        private void btnReadXray_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog fileSel = new OpenFileDialog();
-            fileSel.Filter = "|*.txt";
-            if (DialogResult.OK == fileSel.ShowDialog())
-            {
-                String str = "";
-                //读取Xray文件
-                using (StreamReader sr = new StreamReader(fileSel.FileName))
-                {
-                    while (!sr.EndOfStream)
-                    {
-                        str += sr.ReadLine() + ",";
-                    }
-                    str = str.Substring(0, str.Length - 1);
-                    string[] xrayData = str.Split(',');
-                    if (xrayData.Length != 2000)
-                    {
-                        return;
-                    }
-                    uint[] data = new uint[xrayData.Length];
-                    for (int i = 0; i < xrayData.Length; i++)
-                    {
-                        data[i] = Convert.ToUInt32(xrayData[i]);
-                    }
-                    //Xray数据
-                    xrayByteData = IntArrToByteArr(data);
-                    int color = Convert.ToInt32(ParseRGB(colorHx16toRGB(m_SubMidWindow.m_MainForm.STDDictionary[STDId].Color)).ToString());
-                    //根据树节点修改对应的Xray信息
-                    UpdateSTDXray(STDId, xrayByteData);
-                    ShowXrayAtlas(color, xrayByteData);
-                }
-            }
-        }
-
-        /// <summary>
-        /// 将int[] 转换为 byte[]
-        /// </summary>
-        /// <param name="intArr"></param>
-        /// <returns></returns>
-        public static byte[] IntArrToByteArr(uint[] intArr)
-        {
-            int intSize = sizeof(uint) * intArr.Length;
-            byte[] bytArr = new byte[intSize];
-            //申请一块非托管内存  
-            //IntPtr ptr = Marshal.AllocHGlobal(intSize);
-            ////复制int数组到该内存块  
-            //Marshal.Copy(intArr, 0, ptr, intArr.Length);
-            ////复制回byte数组  
-            //Marshal.Copy(ptr, bytArr, 0, bytArr.Length);
-            ////释放申请的非托管内存  
-            //Marshal.FreeHGlobal(ptr);
-            for (int i = 0; i < intArr.Length; i++)
-            {
-                byte[] c1 = BitConverter.GetBytes(intArr[i]);
-                c1.CopyTo(bytArr, i * 4);
-            
-            }
-            return bytArr;
-        }
         /// <summary>
         /// 将颜色对象转换为uint
         /// </summary>
@@ -610,32 +468,6 @@ namespace OTSPartA_STDEditor
             return (uint)(((uint)color.B << 16) | (ushort)(((ushort)color.G << 8) | color.R));
         }
 
-        #region 显示Xray图谱
-        /// <summary>
-        /// 显示Xray图谱
-        /// </summary>
-        public void ShowXrayAtlas(int colorValue = 0, byte[] XrayData = null)
-        {
-            DataTable dt = new DataTable();
-            dt.Columns.Add("Color", typeof(int));
-            dt.Columns.Add("SPEC", typeof(byte[]));
-            DataRow dRow = dt.NewRow();
-            dRow["Color"] = colorValue;
-            if (XrayData != null)
-            {
-                dRow["SPEC"] = XrayData;
-            }
-            else
-            {
-                dRow["SPEC"] = new byte[8000];
-            }
-            //将选择行的数据传递给Xray控件
-            XrayControl.Dr = dRow;
-            XrayControl.Refresh();
-            XrayData = null;
-        }
-        #endregion
-
         #region 常用数据验证的封装,数字字符的验证
         /// <summary>
         /// 常用数据验证的封装,数字字符的验证
@@ -678,363 +510,6 @@ namespace OTSPartA_STDEditor
         }
         #endregion
 
-        #region Xray 与 STDDB数据操作
-        /// <summary>
-        /// 标准Xray状态
-        /// </summary>
-        public enum STDXrayInfoState
-        {
-            Add = 0,
-            Modify = 1,
-            Delete = 2
-        }
-
-        /// <summary>
-        /// 记录修改后的标准中的Xray信息
-        /// </summary>
-        public class STDXray
-        {
-            /// <summary>
-            /// 标准编号
-            /// </summary>
-            private string stdID;
-            /// <summary>
-            /// Xray数据
-            /// </summary>
-            private byte[] xrayData;
-            /// <summary>
-            /// 状态
-            /// </summary>
-            private int infoState = -1;
-
-            public string StdID { get => stdID; set => stdID = value; }
-            public byte[] XrayData { get => xrayData; set => xrayData = value; }
-            public int InfoState { get => infoState; set => infoState = value; }
-        }
-
-        /// <summary>
-        /// 绑定数据库中已存在的Xray信息
-        /// </summary>
-        public void BindSTDXray()
-        {
-            //清空STDXray列表中的集合
-            m_STDXrayList.Clear();
-            //查询
-            DataTable dt = m_sc.GetDTFormSysSTDBySQLString("select Id,SPEC from STDMinerals");
-            if (dt != null)
-            {
-                if (dt.Rows.Count > 0)
-                {
-                    foreach (DataRow item in dt.Rows)
-                    {
-                        STDXray sXray = new STDXray();
-                        sXray.StdID = item["Id"].ToString();
-                        sXray.XrayData = (byte[])item["SPEC"];
-                        sXray.InfoState = 1;
-                        m_STDXrayList.Add(sXray);
-                    }
-                }
-            }
-        }
-        bool SaveOtherDataToXray(string STDDBAddress, int id)
-        {
-            #region 数据库存贮方式一
-            System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + STDDBAddress + "'");
-            System.Data.SQLite.SQLiteCommand cmm = m_dbConnection.CreateCommand();
-            try
-            {
-                m_dbConnection.Open();
-
-                //string insertstr = ("insert into STDMinerals(name,formula,density,Hardness,BSEValue,Electrical_conductivity,color,Element) values(" + m_SubMidWindow.m_MainForm.STDDictionary[id].StrName + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].Formula + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].Density + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].Hardness + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].BSE + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].Electrical_conductivity + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].Color + "," + m_SubMidWindow.m_MainForm.STDDictionary[id].Element + ");");
-                string insertstr = ("insert into STDMinerals(name) values(" + m_SubMidWindow.m_MainForm.STDDictionary[id].StrName + ");");
-                cmm.CommandText = insertstr;
-                cmm.ExecuteNonQuery();
-
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.ToString());
-                return false;
-            }
-            m_dbConnection.Close();
-            #endregion
-            return true;
-        }
-        /// <summary>
-        /// 保存STDXray至数据库
-        /// </summary>
-        public void SaveSTDXray()
-        {
-            ArrayList delArrayList = new ArrayList();
-            if (m_STDXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                foreach (STDXray item in m_STDXrayList)
-                {
-                    int infoState = item.InfoState;
-                    //添加状态 根据Xray信息当前只能按照一条操作
-                    if (infoState == (int)STDXrayInfoState.Add)
-                    {
-                        //if (item.XrayData == null)
-                        //{
-                        //    item.XrayData = new byte[8000];
-                        //}
-                        //string strvaluename = "@data";
-                        ////编辑添加语句
-                        //StringBuilder strSqlAdd = new StringBuilder();
-                        //strSqlAdd.Append("insert into STDMinerals(Id,SPEC) values(" + item.StdID + "," + strvaluename + ");");
-                        //bool addResult = m_sc.ExecuteBlob(strSqlAdd.ToString(), strvaluename, (byte[])item.XrayData, ((byte[])item.XrayData).Length);
-                        bool addResult = false;
-                        //判断STDID在数据库中是否存在
-                        bool selResult = SelSTDDBBySTDId(item.StdID);
-                        if (selResult)
-                        {
-                            //addResult = UpdateSTDDB(item.StdID, xrayByteData);
-                            addResult = UpdateSTDDB(item.StdID, item.XrayData);
-                        }
-                        else
-                        {
-                            addResult = AddSTDDB(item.StdID, item.XrayData);
-                        }
-                        if (!addResult)
-                        {
-                            continue;
-                        }
-                    }
-                    //修改状态
-                    else if (infoState == (int)STDXrayInfoState.Modify)
-                    {
-                        //判断STDID在数据库中是否存在
-                        bool selResult = SelSTDDBBySTDId(item.StdID);
-                        if (selResult)
-                        {
-                            UpdateSTDDB(item.StdID, item.XrayData);
-                        }
-                        else
-                        {
-                            AddSTDDB(item.StdID, item.XrayData);
-                        }
-                    }
-                    //删除状态 编辑批量删除语句
-                    else if (infoState == (int)STDXrayInfoState.Delete)
-                    {
-                        //编辑删除语句
-                        delArrayList.Add("delete from STDMinerals where id=" + item.StdID + ";");
-                    }
-                }
-                //批量删除
-                if (delArrayList.Count > 0)
-                {
-                    bool delResult = m_sc.DelSTDInfo(delArrayList);
-                }
-                //}
-            }
-        }
-
-        /// <summary>
-        /// 添加STD信息至数据库
-        /// </summary>
-        protected bool AddSTDDB(string stdID, byte[] XrayData)
-        {
-            if (XrayData == null)
-            {
-                XrayData = new byte[8000];
-            }
-            string strvaluename = "@data";
-            StringBuilder sqlStrAdd = new StringBuilder();
-            sqlStrAdd.Append("insert into STDMinerals(Id,SPEC) values(" + stdID + "," + strvaluename + ");");
-            bool addResult = m_sc.ExecuteBlob(sqlStrAdd.ToString(), strvaluename, (byte[])XrayData, ((byte[])XrayData).Length);
-            return addResult;
-        }
-
-        /// <summary>
-        /// 修改STD信息至数据库
-        /// </summary>
-        protected bool UpdateSTDDB(string stdID, byte[] XrayData)
-        {
-            if (XrayData == null)
-            {
-                XrayData = new byte[8000];
-            }
-            string strValueName = "@data";
-            StringBuilder sqlStrUpdate = new StringBuilder();
-            sqlStrUpdate.Append("update STDMinerals set SPEC=" + strValueName  +" where id=" + stdID + ";");
-            bool updateResult = m_sc.ExecuteBlob(sqlStrUpdate.ToString(), strValueName, (byte[])XrayData, ((byte[])XrayData).Length);
-            return updateResult;
-        }
-        /// <summary>
-        /// 查询是否存在标准编号
-        /// </summary>
-        /// <param name="stdID"></param>
-        protected bool SelSTDDBBySTDId(string stdID)
-        {
-            bool selResult = false;
-            //编辑查询语句
-            StringBuilder sqlStr = new StringBuilder();
-            sqlStr.Append("select * from STDMinerals where id=" + stdID + "");
-            DataTable dt = m_sc.GetDTFormSysSTDBySQLString(sqlStr.ToString());
-            if (dt != null)
-            {
-                if (dt.Rows.Count > 0)
-                {
-                    //已存在状态
-                    selResult = true;
-                }
-            }
-            return selResult;
-        }
-        /// <summary>
-        /// 根据选择树节点显示对应的Xray信息
-        /// </summary>
-        public void SelSTDXray(int Key, STDdata sT)
-        {
-            if (sT == null)
-            {
-                return;
-            }
-            if (m_STDXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                    bool isExists = false;
-                    foreach (STDXray item in m_STDXrayList)
-                    {
-                        //修改XrayData信息
-                        if (item.StdID == Key.ToString())
-                        {
-                            string selColor = ParseRGB(colorHx16toRGB(sT.Color)).ToString();
-                            int colorValue = Convert.ToInt32(selColor);
-                            //显示Xray信息
-                            if (item.XrayData != null)
-                            {
-                                isExists = true;
-                                ShowXrayAtlas(colorValue, item.XrayData);
-                            }
-                            break;
-                        }
-                    }
-                    if (!isExists)
-                    {
-                        ShowXrayAtlas();
-                    }
-                //}
-            }
-
-        }
-
-        public void ShowEditContent(string stdID)
-        {
-            if (m_STDXrayList != null)
-            {
-                for (int i = 0; i < m_STDXrayList.Count; i++)
-                {
-                    if (m_STDXrayList[i].StdID == stdID)
-                    {
-                        //获取修改行的信息
-                        xrayByteData = (byte[])m_STDXrayList[i].XrayData;
-                        
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// 根据STDId修改对应的Xray信息
-        /// </summary>
-        /// <param name="STDId"></param>
-        protected void UpdateSTDXray(int STDId, byte[] xrayData)
-        {
-            if (m_STDXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                    bool isExists = false;
-                    foreach (STDXray item in m_STDXrayList)
-                    {
-                        //修改XrayData信息
-                        if (item.StdID == STDId.ToString())
-                        {
-                            item.XrayData = xrayData;
-                            item.InfoState = (int)STDXrayInfoState.Modify;
-                            isExists = true;
-                            break;
-                        }
-                    }
-                    if (!isExists)
-                    {
-                        if (!STDId.ToString().Equals(""))
-                        {
-                            //添加STD XrayData信息
-                            STDXray stdXray = new STDXray();
-                            stdXray.StdID = STDId.ToString();
-                            stdXray.XrayData = xrayData;
-                            stdXray.InfoState = (int)STDXrayInfoState.Add;
-                            m_STDXrayList.Add(stdXray);
-                        }
-                    }
-                //}
-            }
-        }
-
-
-        /// <summary>
-        /// 添加STDXray信息
-        /// </summary>
-        /// <param name="STDid">STDid</param>
-        /// <param name="xrayData">Xray信息</param>
-        /// <returns></returns>
-        protected bool AddSTDXray(int STDId, byte[] xrayData)
-        {
-            bool addResult = false;
-            if (m_STDXrayList != null)  
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                    if (!STDId.ToString().Equals(""))
-                    {
-                        //添加STD XrayData信息
-                        STDXray stdXray = new STDXray();
-                        stdXray.StdID = STDId.ToString();
-                        stdXray.XrayData = xrayData;
-                        stdXray.InfoState = (int)STDXrayInfoState.Add;
-                        m_STDXrayList.Add(stdXray);
-                        addResult = true;
-                    }
-                //}
-            }
-            return addResult;
-        }
-        /// <summary>
-        /// 删除STDXray信息
-        /// </summary>
-        /// <param name="STDId">所选要删除的STDId</param>
-        /// <returns></returns>
-        public bool DelSTDXray(int STDId)
-        {
-            bool delResult = false;
-            if (m_STDXrayList != null)
-            {
-                //if (m_STDXrayList.Count > 0)
-                //{
-                    if (!STDId.ToString().Equals(""))
-                    {
-                        foreach (STDXray item in m_STDXrayList)
-                        {
-                            //修改XrayData信息
-                            if (item.StdID == STDId.ToString())
-                            {
-                                item.InfoState = (int)STDXrayInfoState.Delete;
-                                delResult = true;
-                                break;
-                            }
-                        }
-                    }
-                //}
-            }
-            return delResult;
-        }
-        #endregion
         #region 控制BSE、化学式、元素本文框中不能输入下划线
         /// <summary>
         /// 控件不能输入下划线
@@ -1056,12 +531,6 @@ namespace OTSPartA_STDEditor
         }
         #endregion
 
-        private void btnTest_Click(object sender, EventArgs e)
-        {
-            XrayContrastForm xrayContrastForm = new XrayContrastForm();
-            xrayContrastForm.STDDictionary = m_SubMidWindow.m_MainForm.STDDictionary;
-            xrayContrastForm.ShowDialog();
-        }
 
         string ElementKeyOrSub = "";
 
@@ -1213,111 +682,6 @@ namespace OTSPartA_STDEditor
             }
         }
 
-        private void button_ImportFromResult_Click(object sender, EventArgs e)
-        {
-            OpenFileDialog openFileDialog = new OpenFileDialog();
-            openFileDialog.Filter = "(*.db)|*.db";
-            openFileDialog.RestoreDirectory = true;
-            openFileDialog.FilterIndex = 1;
-            if (openFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                try
-                {
-
-                    System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + openFileDialog.FileName + "'");
-                    m_dbConnection.Open();
-                    string STDId = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row, m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Column].Tag.ToString();
-
-                    Result ret=ImportFromResult(STDId, m_dbConnection);
-                    if(ret== Result.NoMatched)
-                    {
-                        MessageBox.Show("No matching energy spectrum data was found", "Tip");
-                    }
-                    m_dbConnection.Close();
-                    int color = Convert.ToInt32(ParseRGB(colorHx16toRGB(m_SubMidWindow.m_MainForm.STDDictionary[int.Parse(STDId)].Color)).ToString());
-                    for(int i=0;i< m_STDXrayList.Count;i++)
-                    {
-                        if(m_STDXrayList[i].StdID== STDId)
-                        {
-                            ShowXrayAtlas(color, m_STDXrayList[i].XrayData);
-                            break;
-                        }
-                    }
-                }
-                catch /*(Exception ex)*/
-                {
-                    MessageBox.Show("Failed to load Xray data!", "Tip");
-                }
-            }
-        }
-
-        public Result ImportFromResult(string STDId, System.Data.SQLite.SQLiteConnection m_dbConnection)
-        {
-            try
-            {
-                System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select FieldId ,XrayId from IncAData where TypeId ="+ STDId , m_dbConnection);
-                DataSet ds = new DataSet();
-                m_dataAdapter.Fill(ds);
-                DataTable dt = ds.Tables[0];
-                if (dt != null)
-                {
-                    if (dt.Rows.Count > 0)
-                    {
-                        string sqlstr = "select XrayData from XRayData where FieldId = " + dt.Rows[0]["FieldId"] + " AND XrayIndex =" + dt.Rows[0]["XrayId"];
-                        m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter(sqlstr, m_dbConnection);
-                        ds = new DataSet();
-                        m_dataAdapter.Fill(ds);
-                        dt = ds.Tables[0];
-                        if (dt != null)
-                        {
-                            if (dt.Rows.Count > 0)
-                            {
-                                DialogResult dr = MessageBox.Show("ID Num:" + STDId+ ", this rule has found the first match object, is it loaded?", "Tip", MessageBoxButtons.OKCancel);
-                                if(dr == DialogResult.OK)
-                                {
-                                    m_SubMidWindow.m_MainForm.IsModified = true;
-                                    if (SelSTDDBBySTDId(STDId))
-                                    {
-                                        if (MessageBox.Show("ID Num:" + STDId + ", the database already contains records of this rule XRay curve, is it overwritten?", "Tip", MessageBoxButtons.OKCancel) == DialogResult.OK)
-                                        {
-                                            UpdateSTDXray(int.Parse(STDId), (byte[])dt.Rows[0]["XrayData"]);
-                                        } 
-                                    } 
-                                    else
-                                    {
-                                        UpdateSTDXray(int.Parse(STDId), (byte[])dt.Rows[0]["XrayData"]);
-                                    }
-                                }
-                                return Result.Success;
-                            }
-                            else
-                            {
-                                return Result.NoMatched;
-                            }
-                        }
-                        else
-                        {
-                            return Result.NoMatched;
-                        }
-                    }
-                    else
-                    {
-                        return Result.NoMatched;
-                    }
-                }
-                else
-                {
-                    return Result.NoMatched;
-                }
-          
-            }
-            catch /*(Exception ee)*/
-            {
-                MessageBox.Show("Failed to load Xray data!", "Tip");
-                return Result.Fail;
-            }
-        }
-
         private void textbox_STDEditor_MouseLeave(object sender, EventArgs e)
         {
             dataGridView_KeyElements.Rows.Clear();

+ 0 - 1
OTSPartA_STDEditor/STDRuleslist.cs

@@ -222,7 +222,6 @@ namespace OTSPartA_STDEditor
             if (x > 0)
             {
                 m_MainForm.RemoveSTDDictionaryItem((int)Grid_Minerals[x, 0].Tag);
-                m_MainForm.m_SubMidWindow.m_STDEditor.DelSTDXray((int)Grid_Minerals[x, 0].Tag);
                 Grid_Minerals.Rows.Remove(x);
                 if (Grid_Minerals.RowsCount > 1)
                 {

+ 0 - 6
OTSPartA_STDEditor/SubMidWindow.cs

@@ -80,11 +80,5 @@ namespace OTSPartA_STDEditor
                 }
             }
         }
-
-        public void SelSTDXray(int Key,STDdata sT)
-        {
-            m_STDEditor.ShowEditContent(Key.ToString());
-            m_STDEditor.SelSTDXray(Key,sT);
-        }
     }
 }

+ 0 - 48
OTSPartA_STDEditor/UserControl/UXrayControl.Designer.cs

@@ -1,48 +0,0 @@
-namespace OTSPartA_STDEditor
-{
-    partial class UXrayControl
-    {
-        /// <summary> 
-        /// 必需的设计器变量。
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary> 
-        /// 清理所有正在使用的资源。
-        /// </summary>
-        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region 组件设计器生成的代码
-
-        /// <summary> 
-        /// 设计器支持所需的方法 - 不要修改
-        /// 使用代码编辑器修改此方法的内容。
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.SuspendLayout();
-            // 
-            // UXrayControl
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.Color.White;
-            this.Name = "UXrayControl";
-            this.Load += new System.EventHandler(this.UXrayControl_Load);
-            this.Paint += new System.Windows.Forms.PaintEventHandler(this.UXrayControl_Paint);
-            this.Resize += new System.EventHandler(this.UXrayControl_Resize);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-    }
-}

+ 0 - 424
OTSPartA_STDEditor/UserControl/UXrayControl.cs

@@ -1,424 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Collections;
-
-namespace OTSPartA_STDEditor
-{
-    public partial class UXrayControl : UserControl
-    {
-        // 画能谱图的矩形区域
-        protected Rectangle m_XrayArea;
-        protected PointF[] m_xraypointf = null;
-        protected bool m_bShowElementLines = true;
-        // 水平刻度分成20等分
-        protected const int m_iHscale = 20;
-        protected bool m_bMouseMove = false;
-        protected Point m_curCurssorPos;
-        private DataTable dt = null;
-        private DataRow dr = null;
-
-        public DataRow Dr { get => dr; set => dr = value; }
-        public DataTable Dt { get => dt; set => dt = value; }
-
-        public UXrayControl()
-        {
-            InitializeComponent();
-            
-            // 设置双缓冲
-            SetDoubleBufferByIsDraw();
-        }
-
-        public void SetDoubleBufferByIsDraw()
-        {
-            SetStyle(ControlStyles.UserPaint, true);//没什么效果,开与关
-            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景,关了闪
-            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // 双缓冲,关了闪
-
-            //上面是必须有的
-            SetStyle(ControlStyles.UserMouse, true);//执行自己的鼠标行为,这个打开后,在win7下鼠标操作明显改善
-        }
-
-        private void UXrayControl_Load(object sender, EventArgs e)
-        {
-
-
-        }
-
-        private void UXrayControl_Resize(object sender, EventArgs e)
-        {
-            this.RefreshCtrl();
-        }
-
-        private void UXrayControl_Paint(object sender, PaintEventArgs e)
-        {
-            Graphics graphic = e.Graphics;
-            DrawSpecture(ref graphic);
-
-            if (m_bMouseMove)
-            {
-                ShowMouseMoveInfo(m_curCurssorPos.X, m_curCurssorPos.Y, ref m_XrayArea, ref graphic);
-            }
-        }
-
-        public void RefreshCtrl()
-        {
-            this.Invalidate();
-            Graphics graph = Graphics.FromHwnd(this.Handle);
-            DrawSpecture(ref graph);
-            m_bMouseMove = false;
-        }
-
-        public void DrawSpecture(ref Graphics graph)
-        {
-            // 设置设置能谱的区域大小
-            // 首先预留出刻度的大小
-            String strLabel = "9999";
-            SizeF size = graph.MeasureString(strLabel, this.Font);
-
-            // 上下左右四顶点预留2个像素空白, 扣除标签的宽高
-            //            Rectangle XrayArea = new Rectangle();
-            m_XrayArea.X = 2 + (int)size.Width;
-            m_XrayArea.Y = 2;
-            m_XrayArea.Width = this.Width - 2 - m_XrayArea.X;
-            m_XrayArea.Height = this.Height - 2 - m_XrayArea.Y - (int)size.Height;
-
-            Pen pen = new Pen(Color.FromArgb(150, Color.Black), 1);
-
-            // 画矩形框
-            graph.DrawRectangle(pen, m_XrayArea);
-
-            // 画横坐标刻度
-            Point point = new Point();
-            Point next = new Point();
-            Point adapt = new Point();  // 微调参数
-            SolidBrush brush = new SolidBrush(Color.FromArgb(255, Color.Black));
-            pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
-            for (int i = 0; i < m_iHscale; i++)
-            {
-                point.X = m_XrayArea.X + i * m_XrayArea.Width / m_iHscale;
-                point.Y = m_XrayArea.Y + m_XrayArea.Height;
-
-                // 画横坐标数字刻度
-                adapt.X = (i > 9) ? 6 : 4;
-                adapt.Y = 2;
-                graph.DrawString(Convert.ToString(i), this.Font, brush, new Point(point.X - adapt.X, point.Y + adapt.Y));
-
-                // 画垂直方向刻度
-                next.X = point.X;
-                next.Y = m_XrayArea.Y;
-                pen.Color = Color.FromArgb(70, Color.Black);
-                graph.DrawLine(pen, point, next);
-            }
-
-            // 画纵坐标的刻度
-            int iRows = 0;
-            int iMaxValue = 0;
-            int iScale = GetYScale(ref iMaxValue);
-            iRows = iMaxValue / iScale;
-            for (int i = 1; i < iRows; i++)
-            {
-                point.Y = m_XrayArea.Y + m_XrayArea.Height - i * m_XrayArea.Height / iRows;
-                point.X = m_XrayArea.X;
-
-                // 画纵坐标数字刻度
-                adapt.X = (i * iScale >= 100) ? 22 : 16;
-                adapt.X = (i * iScale >= 1000) ? 28 : adapt.X;
-                adapt.Y = 6;
-                graph.DrawString(Convert.ToString(iScale * i), this.Font, brush, new Point(point.X - adapt.X, point.Y - adapt.Y));
-
-                // 画水平方向刻度
-                next.X = point.X + m_XrayArea.Width;
-                next.Y = point.Y;
-                graph.DrawLine(pen, point, next);
-            }
-
-            // 画能谱数据
-            //            ShowXray(ref m_XrayArea, iMaxValue, ref graph, m_bShowElementLines);
-            ShowXrayClr(ref m_XrayArea, iMaxValue, ref graph, m_bShowElementLines);
-        }
-
-        protected void ShowXrayClr(ref Rectangle XrayArea, int iMaxValue, ref Graphics graph, bool bShowElementLines)
-        {
-            ShowXray( Dr, ref XrayArea, iMaxValue, ref graph);
-
-            if (bShowElementLines)
-            {
-                // 元素线的高度为能谱图矩形高度一半
-                ShowElementLines(Dr, XrayArea.Height / 2, ref XrayArea, ref graph);
-            }
-
-            if (null != Dr)
-            {
-                int iDelt = 0;
-                SizeF size = graph.MeasureString("Test", this.Font);
-                for (int i = 0; i < 1; i++)
-                {
-                    //DataRow dr = Dt.Rows[i];
-                    ShowXray(Dr, ref XrayArea, iMaxValue, ref graph, true);
-
-                    if (bShowElementLines)
-                    {
-                        iDelt = (0 == i % 2) ? (-i - 1) * (int)size.Height : i * (int)size.Height;
-                        ShowElementLines(dr, iDelt + XrayArea.Height / 2, ref XrayArea, ref graph);
-                    }
-                }
-            }
-        }
-        protected int[] bytesToInt(byte[] src, int offset)
-        {
-            int[] values = new int[src.Length / 4];
-            for (int i = 0; i < values.Length; i++)
-            {
-                values[i] = BitConverter.ToInt32(src, offset);
-                offset += 4;
-            }
-            return values;
-        }
-        public void ShowXray(DataRow dr, ref Rectangle XrayArea, int iMaxValue, ref Graphics graph, bool bComp = false)
-        {
-            if (null != dr)
-            {
-                int[] SPEC= bytesToInt((byte[])dr["SPEC"], 0);
-                int iXrayDataLen = SPEC.Length;
-                if (null == m_xraypointf)
-                {
-                    m_xraypointf = new PointF[iXrayDataLen];
-                }
-                for (int i = 0; i < iXrayDataLen; i++)
-                {
-                    m_xraypointf[i].X = XrayArea.X + i * XrayArea.Width / iXrayDataLen;
-                    m_xraypointf[i].Y = XrayArea.Y + XrayArea.Height - SPEC[i] * XrayArea.Height / iMaxValue;
-                }
-                int ColorValue = 0;
-                if (!dr["Color"].ToString().Equals(""))
-                {
-                    ColorValue = Convert.ToInt32(dr["Color"]);
-                }
-                if (bComp)
-                {
-                    Pen pen = new Pen(Color.FromArgb(150, Color.FromArgb(ColorValue % 256, (ColorValue >> 8) % 256, (ColorValue >> 16) % 256)), 1);
-                    graph.DrawPolygon(pen, m_xraypointf);
-                }
-                else
-                {
-                    SolidBrush brush = new SolidBrush(Color.FromArgb(150, Color.FromArgb(ColorValue % 256, (ColorValue >> 8) % 256, (ColorValue >> 16) % 256)));
-                    graph.FillPolygon(brush, m_xraypointf);
-                }
-            }
-        }
-
-        protected void ShowElementLines(DataRow dr, int iLineHeight, ref Rectangle XrayArea, ref Graphics graph)
-        {
-            if (null == dr)
-            {
-                return;
-            }
-            //double dEnergy = 0;
-            String str = "Test";
-            SizeF size = graph.MeasureString(str, this.Font);
-
-            // 判断元素线高度的合法性
-            iLineHeight = (iLineHeight > size.Height) ? iLineHeight : (int)size.Height;
-            iLineHeight = ((iLineHeight + (int)size.Height) > XrayArea.Height) ? (XrayArea.Height - (int)size.Height) : iLineHeight;
-
-            //PointF point = new PointF();
-            //PointF next = new PointF();
-            //RectangleF rect = new RectangleF();
-            Pen pen = new Pen(Color.FromArgb(255, 150, 100, 50), 1);
-            int ColorValue = 0;
-            if (!dr["Color"].ToString().Equals(""))
-            {
-                ColorValue = Convert.ToInt32(dr["Color"]);
-            }
-            SolidBrush brush = new SolidBrush(Color.FromArgb(255, Color.FromArgb(ColorValue % 256, (ColorValue >> 8) % 256, (ColorValue >> 16) % 256)));
-            //for (int i = 0; i < 1; i++)
-            //{
-            //    //CElementClr elementclr = stdmineralclr.GetElement(i);
-            //    str = "0";//elementclr.GetName();
-            //    size = graph.MeasureString(str, this.Font);
-            //    dEnergy = 2.3;//elementclr.GetEnergyValueK();
-
-            //    point.X = XrayArea.X + (float)dEnergy * XrayArea.Width / m_iHscale;
-            //    point.Y = XrayArea.Y + XrayArea.Height;
-
-            //    next.X = point.X;
-            //    next.Y = (0 == i % 2) ? (point.Y - iLineHeight) : (point.Y - iLineHeight + 2 + (int)size.Height);
-
-            //    // 画线
-            //    graph.DrawLine(pen, point, next);
-
-            //    // 画矩形框
-            //    rect.X = next.X - size.Width / 2;
-            //    rect.Y = next.Y - size.Height;
-            //    rect.Width = size.Width;
-            //    rect.Height = size.Height;
-
-            //    brush.Color = Color.FromArgb(255, Color.FromArgb(ColorValue % 256, (ColorValue >> 8) % 256, (ColorValue >> 16) % 256));
-            //    graph.FillRectangle(brush, rect);
-
-            //    // 画字符串
-            //    brush.Color = Color.FromArgb(255, Color.Black);
-            //    graph.DrawString(str, this.Font, brush, rect.X, rect.Y);
-            //}
-        }
-
-        protected void ShowMouseMoveInfo(int ix, int iy, ref Rectangle XrayArea, ref Graphics graph)
-        {
-            // 判断坐标是否在矩形框区域内, 如果不在, 则退出
-            if (ix < XrayArea.X ||
-                ix > XrayArea.X + XrayArea.Width ||
-                iy < XrayArea.Y ||
-                iy > XrayArea.Y + XrayArea.Height)
-            {
-                return;
-            }
-            float fpos = 0;
-            PointF point = new PointF();
-            PointF next = new PointF();
-            Pen pen = new Pen(Color.FromArgb(150, Color.Black), 1);
-            SolidBrush brush = new SolidBrush(Color.FromArgb(255, Color.FromArgb(255, 0, 0)));
-
-            fpos = (ix - XrayArea.X) * m_iHscale / (float)XrayArea.Width;
-            SizeF size = graph.MeasureString(fpos.ToString(), this.Font);
-
-            // 画竖线
-            point.X = ix;
-            point.Y = XrayArea.Y + XrayArea.Height;
-
-            next.X = point.X;
-            next.Y = XrayArea.Y + (int)size.Height;
-
-            graph.DrawLine(pen, point, next);
-
-            // 显示坐标位置
-            graph.DrawString(fpos.ToString(), this.Font, brush, ix - (int)(size.Width / 2), XrayArea.Y+20);
-
-            // 获取当前位置的元素
-            //            List<String> liststr = CElement.GetAllElementsEnergy(fpos, 0.1f);
-            List<String> liststr = new List<string>();
-            //CElementClr.GetAllElementsEnergyK(fpos, 0.1f, ref liststr);
-
-            brush.Color = Color.FromArgb(255, Color.Blue);
-            for (int i = 0; i < liststr.Count; i++)
-            {
-                size = graph.MeasureString(liststr[i], this.Font);
-
-                point.X = ('-' == liststr[i][0]) ? (ix - (size.Width + 2)) : ix;
-                point.Y = (XrayArea.Y + size.Height) + i * (size.Height + 2);
-
-                graph.DrawString(liststr[i], this.Font, brush, point.X, point.Y);
-            }
-        }
-        
-
-        public void SetElementLines(bool bShowElementLines)
-        {
-            m_bShowElementLines = bShowElementLines;
-        }
-
-        
-        protected override void OnMouseMove(MouseEventArgs e)
-        {
-            ////            if (null == m_CurSelMineral &&
-            ////                (null == m_ListCompMineral ||
-            ////                0 == m_ListCompMineral.Count()))
-            //if (null == m_CurSelSTDMineralClr &&
-            //    (null == m_ListCompMineralClr ||
-            //    0 == m_ListCompMineralClr.Count()))
-            //{
-            //    return;
-            //}
-            m_bMouseMove = true;
-
-            m_curCurssorPos.X = e.X;
-            m_curCurssorPos.Y = e.Y;
-
-            this.Invalidate();
-            //            this.OnPaint(new PaintEventArgs(this.CreateGraphics(), new Rectangle(new Point(0, 0), this.Size)));
-        }
-
-        // 返回值是刻度的精度, iRows表示行数
-        protected int GetYScale(ref int iMaxValue)
-        {
-            int iMaxXray = 0;
-            int iMaxXray1 = 0;
-            int iMaxXray2 = 0;
-            int iBaseScale = 20;    // 最小基础刻度20
-            int iScale = 20;        // 待返回的刻度值
-            int iBaseMaxValue = 100;   // 基础最大值100
-            int iTimes = 0;
-            int iLeft = 0;
-
-            iMaxXray1 = GetMaxXray(Dr);
-            iMaxXray2 = 0;//GetMaxXrayClr();
-
-            iMaxXray = (iMaxXray1 > iMaxXray2) ? iMaxXray1 : iMaxXray2;
-
-            // 设计需求: 0 <= iMaxXray < 500(iScale: 50, iMaxValue: 250或者500)
-            // 设计需求: 500 <= iMaxXray < 1000(iScale: 100, iMaxValue: 750或者1000)
-            // 设计需求: 1000 <= iMaxXray < 1500(iScale: 150, iMaxValue: 1250或者1500)
-            // 设计需求: 1500 <= iMaxXray < 2000(iScale: 200, iMaxValue: 1750或者2000)
-            // 以此类推
-            //            iMaxXray = 9000;// 测试代码, 可以删除
-            iTimes = iMaxXray / iBaseMaxValue;
-            iLeft = iMaxXray % iBaseMaxValue;
-
-            iScale = iBaseScale + iBaseScale * (iTimes / 2);
-            iMaxValue = iBaseMaxValue + iBaseMaxValue * iTimes;
-
-            // 因为iScale * (iMaxValue / iScale) <= iMaxValue, 所以如果 iMaxXray > iScale * (iMaxValue / iScale) 刻度就会不够,导致bug
-            if (iScale * (iMaxValue / iScale) < iMaxXray)
-            {
-                iMaxValue = iMaxValue + iBaseMaxValue;
-            }
-            return iScale;
-        }
-
-        protected int GetMaxXray(DataRow dr)
-        {
-            if (null == dr)
-            {
-                return 0;
-            }
-            int iMaxXray = 0;
-            int iXrayLen = 0;
-            int[] SPEC = bytesToInt((byte[])dr["SPEC"], 0);
-            iXrayLen = SPEC.Length;
-            for (int i = 0; i < iXrayLen; i++)
-            {
-                if (SPEC[i] > iMaxXray)
-                {
-                    iMaxXray = SPEC[i];
-                }
-            }
-            return iMaxXray;
-        }
-
-        protected int GetMaxXrayClr()
-        {
-            if (null == Dr)
-            {
-                return 0;
-            }
-            int iMaxXray = 0;
-            int iXray = 0;
-            for (int i = 0; i < Dt.Rows.Count; i++)
-            {
-                DataRow dr = Dt.Rows[i];
-                iXray = GetMaxXray(dr);
-                if (iXray > iMaxXray)
-                {
-                    iMaxXray = iXray;
-                }
-            }
-            return iMaxXray;
-        }
-    }
-}

+ 0 - 120
OTSPartA_STDEditor/UserControl/UXrayControl.resx

@@ -1,120 +0,0 @@
-<?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>

+ 0 - 158
OTSPartA_STDEditor/XrayContrastForm.Designer.cs

@@ -1,158 +0,0 @@
-namespace OTSPartA_STDEditor
-{
-    partial class XrayContrastForm
-    {
-        /// <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.dgV_IncALib = new System.Windows.Forms.DataGridView();
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.label1 = new System.Windows.Forms.Label();
-            this.label9 = new System.Windows.Forms.Label();
-            this.txtCollectTime = new System.Windows.Forms.TextBox();
-            this.btnCollectXray = new System.Windows.Forms.Button();
-            this.plXray = new System.Windows.Forms.Panel();
-            ((System.ComponentModel.ISupportInitialize)(this.dgV_IncALib)).BeginInit();
-            this.panel1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // dgV_IncALib
-            // 
-            this.dgV_IncALib.AllowUserToAddRows = false;
-            this.dgV_IncALib.AllowUserToDeleteRows = false;
-            this.dgV_IncALib.AllowUserToResizeColumns = false;
-            this.dgV_IncALib.AllowUserToResizeRows = false;
-            this.dgV_IncALib.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.dgV_IncALib.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.dgV_IncALib.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.dgV_IncALib.Location = new System.Drawing.Point(0, 323);
-            this.dgV_IncALib.Margin = new System.Windows.Forms.Padding(2);
-            this.dgV_IncALib.MultiSelect = false;
-            this.dgV_IncALib.Name = "dgV_IncALib";
-            this.dgV_IncALib.ReadOnly = true;
-            this.dgV_IncALib.RowHeadersVisible = false;
-            this.dgV_IncALib.RowHeadersWidth = 23;
-            this.dgV_IncALib.RowTemplate.Height = 30;
-            this.dgV_IncALib.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.dgV_IncALib.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.dgV_IncALib.Size = new System.Drawing.Size(964, 408);
-            this.dgV_IncALib.TabIndex = 16;
-            this.dgV_IncALib.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgV_IncALib_CellClick);
-            // 
-            // panel1
-            // 
-            this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaption;
-            this.panel1.Controls.Add(this.label1);
-            this.panel1.Controls.Add(this.label9);
-            this.panel1.Controls.Add(this.txtCollectTime);
-            this.panel1.Controls.Add(this.btnCollectXray);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
-            this.panel1.Location = new System.Drawing.Point(0, 0);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(964, 27);
-            this.panel1.TabIndex = 18;
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("宋体", 9F);
-            this.label1.Location = new System.Drawing.Point(12, 7);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(71, 12);
-            this.label1.TabIndex = 31;
-            this.label1.Text = "CollectTime";
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("宋体", 9F);
-            this.label9.Location = new System.Drawing.Point(143, 8);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(17, 12);
-            this.label9.TabIndex = 30;
-            this.label9.Text = "MS";
-            // 
-            // txtCollectTime
-            // 
-            this.txtCollectTime.Location = new System.Drawing.Point(85, 3);
-            this.txtCollectTime.Name = "txtCollectTime";
-            this.txtCollectTime.Size = new System.Drawing.Size(56, 21);
-            this.txtCollectTime.TabIndex = 28;
-            this.txtCollectTime.Text = "120";
-            this.txtCollectTime.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // btnCollectXray
-            // 
-            this.btnCollectXray.Location = new System.Drawing.Point(163, 2);
-            this.btnCollectXray.Name = "btnCollectXray";
-            this.btnCollectXray.Size = new System.Drawing.Size(68, 23);
-            this.btnCollectXray.TabIndex = 29;
-            this.btnCollectXray.TabStop = false;
-            this.btnCollectXray.Text = "Collect";
-            this.btnCollectXray.UseVisualStyleBackColor = true;
-            this.btnCollectXray.Click += new System.EventHandler(this.btnCollectXray_Click);
-            // 
-            // plXray
-            // 
-            this.plXray.Dock = System.Windows.Forms.DockStyle.Top;
-            this.plXray.Location = new System.Drawing.Point(0, 27);
-            this.plXray.Name = "plXray";
-            this.plXray.Size = new System.Drawing.Size(964, 298);
-            this.plXray.TabIndex = 19;
-            // 
-            // XrayContrastForm
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(964, 731);
-            this.Controls.Add(this.plXray);
-            this.Controls.Add(this.panel1);
-            this.Controls.Add(this.dgV_IncALib);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
-            this.MaximizeBox = false;
-            this.MinimizeBox = false;
-            this.Name = "XrayContrastForm";
-            this.ShowIcon = false;
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Xray";
-            this.Load += new System.EventHandler(this.XrayContrastForm_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.dgV_IncALib)).EndInit();
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-        public System.Windows.Forms.DataGridView dgV_IncALib;
-        private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Panel plXray;
-        private System.Windows.Forms.Label label9;
-        private System.Windows.Forms.TextBox txtCollectTime;
-        private System.Windows.Forms.Button btnCollectXray;
-        private System.Windows.Forms.Label label1;
-    }
-}

+ 0 - 867
OTSPartA_STDEditor/XrayContrastForm.cs

@@ -1,867 +0,0 @@
-using OTSCLRINTERFACE;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace OTSPartA_STDEditor
-{
-    public partial class XrayContrastForm : Form
-    {
-        #region 全部变量
-        //数据库操作对象
-        //全局Xray 用于存储采集的Xray信息
-        byte[] xrayByteData = null;
-        private SqlLiteClass m_sc = null;
-        //Xray控件
-        UXrayControl xrayControl = null;
-        UXrayControl xrayContrastControl = null;
-        public DataRow dr = null;
-        public DataTable dt = null;
-        // 电镜设置对象
-        COTSControlFunExport m_cfun = null;
-        // 连接状态
-        bool m_bConnectionState = false;
-        //STD信息集合
-        public Dictionary<int, STDdata> STDDictionary = null;
-        //国际化
-        Language lan;
-        System.Collections.Hashtable table;
-        #endregion
-
-        /// <summary>
-        /// [颜色:16进制转成RGB]
-        /// </summary>
-        /// <param name="strColor">设置16进制颜色 [返回RGB]</param>
-        /// <returns></returns>
-        public static System.Drawing.Color colorHx16toRGB(string strHxColor)
-        {
-            try
-            {
-                if (strHxColor.Length == 0)
-                {//如果为空
-                    return System.Drawing.Color.FromArgb(255, 255, 204);//设为白色
-                }
-                else
-                {//转换颜色
-                    return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(1, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(3, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(5, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
-                }
-            }
-            catch
-            {//设为白色
-                return System.Drawing.Color.FromArgb(255, 255, 204);
-            }
-        }
-
-        public XrayContrastForm()
-        {
-            InitializeComponent();
-        }
-
-        private void XrayContrastForm_Load(object sender, EventArgs e)
-        {
-            //加载Xray信息控件
-            xrayControl = new UXrayControl();
-            plXray.Controls.Add(xrayControl);
-            xrayControl.Dock = DockStyle.Top;
-            BindGrid_IncALib();
-            //比对
-            //GetCompMineralFun();
-            xrayContrastControl = new UXrayControl();
-            plXray.Controls.Add(xrayContrastControl);
-            xrayContrastControl.Dock = DockStyle.Top;
-            //国际化
-            lan = new Language(this);
-            table = lan.GetNameTable(this.Name);
-        }
-
-        #region 绑定Grid等相关方法
-
-        /// <summary>
-        /// 绑定STDGrid
-        /// </summary>
-        private void BindGrid_IncALib()
-        {
-            if (m_sc == null)
-            {
-                m_sc = new SqlLiteClass();
-            }
-            //查询
-            //DataTable dtSelDB = m_sc.GetDTFormSysSTDBySQLString("select Name,Id,0 Color,'' Hardness,'' density,'' Conductivity,'' BSEValue,'' formula,'' Element,SPEC,RowIndex,0 ReducedValue from ClassifySTD order by Name");  //STDMinerals
-            //DataTable dtSelDB = m_sc.GetDTFormSysSTDBySQLString("select 'C.StdName','C.StdId','C.Color','C.Hardness','C.Density','C.Electrical_conductivity','C.BSE','C.Formula','C.Element','M.SPEC' from ClassifySTD C,STDMinerals M WHERE C.StdId=M.id");  //STDMinerals
-            DataTable dtSelDB = m_sc.GetDTFormSysSTDBySQLString("select StrName,StdId,Color,Hardness,Density,Electrical_conductivity,BSE,Formula,Element,SPEC,0 ReducedValue from ClassifySTD left join STDMinerals on ClassifySTD.StdId = STDMinerals.id");  //STDMinerals
-            //绑定
-            BindDataGridView_dgV_IncALib(dtSelDB);
-            //样式
-            SetDataGridViewStyleIncLib();
-        }
-
-        /// <summary>
-        /// 使用DataTable绑定Grid
-        /// </summary>
-        /// <param name="in_dt"></param>
-        public void BindDataGridView_dgV_IncALib(DataTable dtSelDB)
-        {
-            dgV_IncALib.Rows.Clear();
-            dgV_IncALib.Columns.Clear();
-
-            //创建Grid的列
-            //名称
-            dgV_IncALib.Columns.Add("Name", "strName");
-            //编号
-            dgV_IncALib.Columns.Add("Code", "Code");
-            //代表色
-            dgV_IncALib.Columns.Add("Color", "Color");
-            //硬度
-            dgV_IncALib.Columns.Add("Hardness", "Hardness");
-            //密度
-            dgV_IncALib.Columns.Add("Density", "Density");
-            //导电性
-            dgV_IncALib.Columns.Add("Conductivity", "Conductivity");
-            //BSE
-            dgV_IncALib.Columns.Add("BSEValue", "BSE");
-            //化学式
-            dgV_IncALib.Columns.Add("Formula", "Formula");
-            //元素
-            dgV_IncALib.Columns.Add("Element", "Element");
-            dgV_IncALib.Columns.Add("Xray", "Xray");
-            dgV_IncALib.Columns.Add("RowIndex", "RowIndex");
-            dgV_IncALib.Columns.Add("ReducedValue", "ReducedValue");
-            //添加完成列后,再对不需要显示的列进行隐藏
-            dgV_IncALib.Columns["Code"].Visible = false;
-            dgV_IncALib.Columns["Color"].Visible = false;
-            dgV_IncALib.Columns["Xray"].Visible = false;
-            dgV_IncALib.Columns["RowIndex"].Visible = false;
-            dgV_IncALib.Columns["ReducedValue"].Visible = false;
-            //宽度
-            dgV_IncALib.Columns["Name"].Width = 140;//名称
-            dgV_IncALib.Columns["Code"].Width = 0;//编号
-            dgV_IncALib.Columns["Color"].Width = 0;//代表色
-            dgV_IncALib.Columns["Hardness"].Width = 80;//硬度
-            dgV_IncALib.Columns["Density"].Width = 80;//密度
-            dgV_IncALib.Columns["Conductivity"].Width = 60;//导电性
-            dgV_IncALib.Columns["BSEValue"].Width = 80;//BSE
-            dgV_IncALib.Columns["Formula"].Width = 240;//化学式
-            dgV_IncALib.Columns["Element"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;//元素
-            dgV_IncALib.Columns["Xray"].Width = 0;//Xray
-            dgV_IncALib.Columns["RowIndex"].Width = 0;//index
-            dgV_IncALib.Columns["ReducedValue"].Width = 0;//相识比对值
-
-            //先设置一下头的高度,否则会太矮不好看
-            dgV_IncALib.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
-            dgV_IncALib.ColumnHeadersHeight = 23;
-            //设置数据
-
-            //克隆 查询出的数据结构
-            dt = dtSelDB.Clone();
-
-            foreach (KeyValuePair<int, STDdata> kv in STDDictionary)
-            {
-                byte[] xrayData = new byte[8000];
-                DataRow[] dr = dtSelDB.Select("STDId=" + kv.Key);
-                if (dr != null)
-                {
-                    if (dr.Length > 0)
-                    {
-                        if (dr[0]["SPEC"].GetType().ToString()!= "System.DBNull")
-                        {
-                            xrayData = (byte[])dr[0]["SPEC"];
-                        }
-                        else
-                        {
-                            xrayData = new byte[2000];
-                        }
-                    }
-                }
-                //添加至全局dt
-                DataRow drSTD = dt.NewRow();
-                drSTD["StrName"] = kv.Value.StrName.ToString();
-                drSTD["StdId"] = kv.Key.ToString();
-                drSTD["Color"] = Convert.ToInt32(ParseRGB(colorHx16toRGB(kv.Value.Color)));
-                drSTD["Hardness"] = kv.Value.Hardness.ToString();
-                drSTD["Density"] = kv.Value.Density.ToString();
-                drSTD["Electrical_conductivity"] = kv.Value.Electrical_conductivity.ToString();
-                drSTD["BSE"] = kv.Value.BSE.ToString();
-                drSTD["Formula"] = kv.Value.Formula.ToString();
-                drSTD["Element"] = kv.Value.Element.ToString();
-                drSTD["SPEC"] = xrayData;
-                dt.Rows.Add(drSTD);
-            }
-
-            //设置数据
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                int add_rowindex = dgV_IncALib.Rows.Add();
-                dgV_IncALib.Rows[add_rowindex].Cells[0].Value = i.ToString();
-                dgV_IncALib.Rows[i].Cells[0].Value = add_rowindex;
-
-                for (int k = 0; k < dt.Columns.Count; k++)
-                {
-                    dgV_IncALib.Rows[i].Cells[k].Value = dt.Rows[i][k].ToString();
-                }
-            }
-
-            //设置颜色
-            for (int i = 0; i < dgV_IncALib.Rows.Count; i++)
-            {
-                //在该数据库中返回的颜色格式与正常的不同,需要在前面加#号
-                Color ls_c = colorValuetoRGB(dgV_IncALib[2, i].Value.ToString());
-                dgV_IncALib[0, i].Style.BackColor = ls_c;
-            }
-        }
-
-        public void SortDataGridView_dgV_IncALib(DataTable dt)
-        {
-            dgV_IncALib.Rows.Clear();
-            dgV_IncALib.Columns.Clear();
-
-            //创建Grid的列
-            //名称
-            dgV_IncALib.Columns.Add("Name", "Name");
-            //编号
-            dgV_IncALib.Columns.Add("Code", "Code");
-            //代表色
-            dgV_IncALib.Columns.Add("Color", "Color");
-            //硬度
-            dgV_IncALib.Columns.Add("Hardness", "Hardness");
-            //密度
-            dgV_IncALib.Columns.Add("Density", "Density");
-            //导电性
-            dgV_IncALib.Columns.Add("Conductivity", "Conductivity");
-            //BSE
-            dgV_IncALib.Columns.Add("BSEValue", "BSE");
-            //化学式
-            dgV_IncALib.Columns.Add("Formula", "Formula");
-            //元素
-            dgV_IncALib.Columns.Add("Element", "Element");
-            dgV_IncALib.Columns.Add("Xray", "Xray");
-            dgV_IncALib.Columns.Add("RowIndex", "RowIndex");
-            dgV_IncALib.Columns.Add("ReducedValue", "ReducedValue");
-            //添加完成列后,再对不需要显示的列进行隐藏
-            dgV_IncALib.Columns["Code"].Visible = false;
-            dgV_IncALib.Columns["Color"].Visible = false;
-            dgV_IncALib.Columns["Xray"].Visible = false;
-            dgV_IncALib.Columns["RowIndex"].Visible = false;
-            dgV_IncALib.Columns["ReducedValue"].Visible = false;
-            //宽度
-            dgV_IncALib.Columns["Name"].Width = 140;//名称
-            dgV_IncALib.Columns["Code"].Width = 0;//编号
-            dgV_IncALib.Columns["Color"].Width = 0;//代表色
-            dgV_IncALib.Columns["Hardness"].Width = 80;//硬度
-            dgV_IncALib.Columns["Density"].Width = 80;//密度
-            dgV_IncALib.Columns["Conductivity"].Width = 60;//导电性
-            dgV_IncALib.Columns["BSEValue"].Width = 80;//BSE
-            dgV_IncALib.Columns["Formula"].Width = 240;//化学式
-            dgV_IncALib.Columns["Element"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;//元素
-            dgV_IncALib.Columns["Xray"].Width = 0;//Xray
-            dgV_IncALib.Columns["RowIndex"].Width = 0;//index
-            dgV_IncALib.Columns["ReducedValue"].Width = 0;//相识比对值
-
-            //先设置一下头的高度,否则会太矮不好看
-            dgV_IncALib.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
-            dgV_IncALib.ColumnHeadersHeight = 23;
-
-            //设置数据
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                int add_rowindex = dgV_IncALib.Rows.Add();
-                dgV_IncALib.Rows[add_rowindex].Cells[0].Value = i.ToString();
-                dgV_IncALib.Rows[i].Cells[0].Value = add_rowindex;
-
-                for (int k = 0; k < dt.Columns.Count; k++)
-                {
-                    dgV_IncALib.Rows[i].Cells[k].Value = dt.Rows[i][k].ToString();
-                }
-            }
-
-            //设置颜色
-            for (int i = 0; i < dgV_IncALib.Rows.Count; i++)
-            {
-                //在该数据库中返回的颜色格式与正常的不同,需要在前面加#号
-                Color ls_c = colorValuetoRGB(dgV_IncALib[2, i].Value.ToString());
-                dgV_IncALib[0, i].Style.BackColor = ls_c;
-            }
-        }
-        #region 自定义方法
-        /// <summary>
-        /// [颜色:16进制转成RGB]
-        /// </summary>
-        /// <param name="strColor">设置16进制颜色 [返回RGB]</param>
-        /// <returns></returns>
-        public System.Drawing.Color colorValuetoRGB(string strHxColor)
-        {
-            try
-            {
-                if (strHxColor.Length == 0)
-                {//如果为空
-                    return System.Drawing.Color.FromArgb(0, 0, 0);//设为黑色
-                }
-                else
-                {
-                    int colorValue = Convert.ToInt32(strHxColor);
-                    //转换颜色
-                    return Color.FromArgb(colorValue % 256, (colorValue >> 8) % 256, (colorValue >> 16) % 256);
-                }
-            }
-            catch (Exception)
-            {//设为黑色
-                return System.Drawing.Color.FromArgb(0, 0, 0);
-            }
-        }
-        /// <summary>
-        /// 将颜色对象转换为uint
-        /// </summary>
-        /// <param name="color"></param>
-        /// <returns></returns>
-        public uint ParseRGB(Color color)
-        {
-            return (uint)(((uint)color.B << 16) | (ushort)(((ushort)color.G << 8) | color.R));
-        }
-        #endregion
-        #region 设置Grid样式
-        /// <summary>
-        /// 设置夹杂物列表DataGridView样式
-        /// </summary>
-        private void SetDataGridViewStyleIncLib()
-        {
-            //用户不能调整标题的高度
-            dgV_IncALib.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
-
-            //用户不能调整 行高
-            dgV_IncALib.AllowUserToResizeRows = false;
-
-            //改变行的高度;
-            //Gview_gz.RowTemplate.Height = 20;
-
-            //点击选择整行
-            dgV_IncALib.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
-
-            //居中显示
-            //System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
-            //dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            //dgV_IncALib.DefaultCellStyle = dataGridViewCellStyle1;
-            dgV_IncALib.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
-
-            //再次重覆禁用拖动表头高度,居然有效果了
-            dgV_IncALib.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
-
-            //设置grid可以复制
-            dgV_IncALib.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
-
-            //设置每列的宽度
-            //dgV_IncALib.Columns[1].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
-
-            //设置序号列不排序
-            dgV_IncALib.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
-            for (int i = 0; i < dgV_IncALib.Columns.Count; i++)
-            {
-                dgV_IncALib.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
-            }
-
-            //设置序号列不可以设置宽度
-            dgV_IncALib.Columns[0].Resizable = DataGridViewTriState.False;
-            
-
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
-            dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightCyan;
-            dgV_IncALib.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
-            dgV_IncALib.BackgroundColor = System.Drawing.Color.White;
-            dgV_IncALib.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
-            dgV_IncALib.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;//211, 223, 240
-            dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(223)))), ((int)(((byte)(240)))));
-            dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Navy;
-            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dgV_IncALib.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
-            dgV_IncALib.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            dgV_IncALib.EnableHeadersVisualStyles = false;
-            dgV_IncALib.GridColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            dgV_IncALib.ReadOnly = true;
-            dgV_IncALib.RowHeadersVisible = true; //建议改为true;为了以后显示序号。
-            dgV_IncALib.RowTemplate.Height = 23;
-            dgV_IncALib.RowTemplate.ReadOnly = true;
-
-            //居中
-            dgV_IncALib.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
-            dgV_IncALib.AllowUserToOrderColumns = false;
-        }
-        #endregion
-        #endregion
-
-        #region Xray比对
-        private void GetCompMineralFun(byte[] collectXrayData)
-        {
-            byte[] stdmineralclr = collectXrayData;
-            List<byte[]> listOreTypeClr = new List<byte[]>();
-            foreach (DataRow item in dt.Rows)
-            {
-                if (item["SPEC"].GetType().ToString() != "System.DBNull")
-                {
-                    listOreTypeClr.Add((byte[])item["SPEC"]);
-                }
-                else
-                {
-                    listOreTypeClr.Add(new byte[2000]);
-                }
-            }
-            //获取信息中的相识度
-            List<double> returnValue = GetCompMineral(ref stdmineralclr, ref listOreTypeClr);
-            //向DataTable中添加
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                dt.Rows[i]["ReducedValue"] = returnValue[i];
-            }
-            //重新排列
-            dt.DefaultView.Sort = "ReducedValue desc";
-            dt = dt.DefaultView.ToTable();
-            SortDataGridView_dgV_IncALib(dt);
-            //设置选中DataGridView当前行
-            if (dgV_IncALib.Rows.Count > 0)
-            {
-                dgV_IncALib.Rows[0].Selected = true;
-
-                xrayControl.Dr = dt.Rows[0];
-                //xrayControl.Dt = dt;
-                xrayControl.Refresh();
-            }
-        }
-        // 在listOreTypeClr列表里找出和stdmineralclr相似的信息并返回
-        protected List<double> GetCompMineral(ref byte[] stdmineralclr, ref List<byte[]> listOreTypeClr)
-        {
-            if (null == stdmineralclr || null == listOreTypeClr)
-            {
-                return null;
-            }
-            if (0 == listOreTypeClr.Count())
-            {
-                return null;
-            }
-
-            int i = 0;
-            List<double> oretypeclr = new List<double>();
-            List<byte[]> listOreTypeClr_cmp = new List<byte[]>();
-            // 计算余弦值
-            double dCosValue = 0;
-            List<string> lstIgnoreElementNames = new List<string>();
-            for (i = 0; i < listOreTypeClr.Count; i++)
-            {
-                dCosValue = GetCosValue(0, ref lstIgnoreElementNames, stdmineralclr, listOreTypeClr[i]);
-                dCosValue = 1000000 * dCosValue;
-                oretypeclr.Add((int)dCosValue);// 将mineralid设置为余弦值
-            }
-            return oretypeclr;
-        }
-        // 20190903:增加参数iStartChannel哪个位置开始比较, lstIgnoreChannel里面的通道不处理
-        // 20191128:变更lstIgnoreChannel参数为lstIgnoreElementNames
-        protected double GetCosValue(int iStartChannel, ref List<string> lstIgnoreElementNames, byte[] stdmineralclr1, byte[] stdmineralclr2)
-        {
-            int iXrayDataLen = stdmineralclr1.Length;
-            List<int> lstIgnoreChannel = new List<int>();
-            if(stdmineralclr2==null)
-            {
-                return 0;
-            }
-            // 两者数据量不一致,返回0
-            if (iXrayDataLen != stdmineralclr2.Length)
-            {
-                return 0;
-            }
-
-            if (iStartChannel < 0 || iStartChannel >= iXrayDataLen)
-            {
-                return 1;
-            }
-
-            bool bignore = false;
-            int j = 0;
-            // 公式: (x1y1+x2y2+x3y3+...x2000y2000) / (sqrt(x1^2 + x2^2 + ...x2000^2) * sqrt(y1^2 + y2^2 + ...y2000^2))            
-            double dotpro = 0;
-            double d1 = 0;
-            double d2 = 0;
-            for (int i = iStartChannel; i < iXrayDataLen; i++)
-            {
-                bignore = false;
-                for (j = 0; j < lstIgnoreChannel.Count(); j++)
-                {
-                    if (lstIgnoreChannel[j] == i)
-                    {
-                        bignore = true;
-                        break;
-                    }
-                }
-
-                if (!bignore)
-                {
-                    dotpro = dotpro + stdmineralclr1[i] * stdmineralclr2[i];
-                    d1 = d1 + stdmineralclr1[i] * stdmineralclr1[i];
-                    d2 = d2 + stdmineralclr2[i] * stdmineralclr2[i];
-                }
-            }
-            d1 = System.Math.Sqrt(d1);
-            d2 = System.Math.Sqrt(d2);
-            //            return (0 == d1 || 0 == d2) ? 0 : dotpro / (d1 * d2);
-            // 算法改进, 加上距离权重
-            if (0 == d1 || 0 == d2)
-            {
-                return 0;
-            }
-            double dresult = 0;
-            dresult = (d1 < d2) ? d1 / d2 : d2 / d1;
-            return 0.4 * dotpro / (d1 * d2) + 0.3 * dresult + 0.3 * GetStdEvp(iStartChannel, ref lstIgnoreChannel, stdmineralclr1, stdmineralclr2);
-        }
-        // 获取标准差
-        // 20190903:增加参数iStartChannel哪个位置开始比较, lstIgnoreChannel里面的通道不处理
-        double GetStdEvp(int iStartChannel, ref List<int> lstIgnoreChannel, byte[] stdmineralclr1, byte[] stdmineralclr2)
-        {
-            int iXrayDataLen = stdmineralclr1.Length;
-
-            // 两者数据量不一致,返回0
-            if (iXrayDataLen != stdmineralclr2.Length)
-            {
-                return 0;
-            }
-            if (iStartChannel < 0 || iStartChannel >= iXrayDataLen)
-            {
-                return 1;
-            }
-
-            bool bignore = false;
-            int i = 0;
-            int j = 0;
-            int iSum1 = 0;
-            int iSum2 = 0;
-            double dAva1 = 0;
-            double dAva2 = 0;
-            double dSquare1 = 0;
-            double dSquare2 = 0;
-            List<int> listdata1 = new List<int>();
-            List<int> listdata2 = new List<int>();
-
-            // 求出能谱的平均值
-            for (i = iStartChannel; i < iXrayDataLen; i++)
-            {
-                bignore = false;
-                for (j = 0; j < lstIgnoreChannel.Count(); j++)
-                {
-                    if (lstIgnoreChannel[j] == i)
-                    {
-                        bignore = true;
-                        break;
-                    }
-                }
-
-                if (!bignore)
-                {
-                    iSum1 = iSum1 + (int)stdmineralclr1[i];
-                    listdata1.Add((int)stdmineralclr1[i]);
-
-                    iSum2 = iSum2 + (int)stdmineralclr2[i];
-                    listdata2.Add((int)stdmineralclr2[i]);
-                }
-            }
-
-            dAva1 = iSum1 / listdata1.Count();
-            dAva2 = iSum2 / listdata2.Count();
-
-            for (i = 0; i < listdata1.Count(); i++)
-            {
-                dSquare1 = dSquare1 + (listdata1[i] - dAva1) * (listdata1[i] - dAva1);
-                dSquare2 = dSquare2 + (listdata2[i] - dAva1) * (listdata2[i] - dAva1);
-            }
-            dSquare1 = dSquare1 / listdata1.Count();
-            dSquare2 = dSquare2 / listdata2.Count();
-
-            dSquare1 = System.Math.Sqrt(dSquare1);
-            dSquare2 = System.Math.Sqrt(dSquare2);
-
-            dSquare1 = dSquare1 * (double)iSum2 / iSum1;    // 归一化
-
-            return (dSquare1 < dSquare2) ? (dSquare1 / dSquare2) : (dSquare2 / dSquare1);
-        }
-        #endregion
-
-        private void dgV_IncALib_CellClick(object sender, DataGridViewCellEventArgs e)
-        {
-            if (xrayByteData != null)
-            {
-                dgV_IncALib.ClearSelection();
-                //删除
-                if (e.RowIndex < 0)
-                {
-                    return;
-                }
-
-                //将选择行的数据传递给Xray控件
-                xrayControl.Dr = dt.Rows[e.RowIndex];
-                //xrayControl.Dt = dt;
-                xrayControl.Refresh();
-                //设置选中DataGridView当前行
-                dgV_IncALib.Rows[e.RowIndex].Selected = true;
-            }
-        }
-
-        private void btnCollectXray_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                string strTime = txtCollectTime.Text.Trim();
-                if (txtCollectTime.Equals(""))
-                {
-                    showMessage("Please fill in the collection time name!");
-                    txtCollectTime.Focus();
-                    return;
-                }
-                if (!IsMatch(strTime, 1))
-                {
-                    showMessage("Error collecting time content, the format should be integer!");
-                    txtCollectTime.Focus();
-                    return;
-                }
-                if (Convert.ToInt32(strTime) < 100)
-                {
-                    showMessage("CollectTime must not be less than 100 milliseconds!");
-                    txtCollectTime.Focus();
-                    return;
-                }
-                //获取Xray方法
-                // 电镜设置对象
-                xrayByteData = intToBytes(GetCollectXray(strTime), 0);
-                DataRow dataRow = dt.NewRow();
-                dataRow["SPEC"] = xrayByteData;
-                dataRow["Color"] = 0;
-                xrayContrastControl.Dr = dataRow;
-                xrayContrastControl.Dt = dt;
-                
-                xrayContrastControl.Refresh();
-                //比对
-                GetCompMineralFun(xrayByteData);
-
-                //国际化
-                lan = new Language(this);
-                //国际化后各表头居中显示
-                for (int i = 0; i < dgV_IncALib.Columns.Count; i++)
-                {
-                    dgV_IncALib.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
-                }
-            }
-            catch (Exception ex)
-            {
-                throw ex;
-            }
-        }
-
-        /// <summary>
-        /// 获取采集当前的Xray信息
-        /// </summary>
-        /// <returns></returns>
-        protected uint[] GetCollectXray(string strTime)
-        {
-            try
-            {
-                if (null == m_cfun)
-                {
-                    m_cfun = COTSControlFunExport.GetControllerInstance("Bruker");
-                }
-                if (ConnectionSem(connectionEnumType.EDSOnlyPointXRay))
-                {
-                    if (EDSInit())
-                    {
-                        int iSize = 2000;
-                        uint[] iXrayData = new uint[iSize];
-                        //采集XRay数据
-                        if (m_cfun.CollectSpectrum(uint.Parse(strTime), ref iXrayData))
-                        {
-                            return iXrayData;
-                        }
-                    }
-                }
-                return null;
-            }
-            catch /*(Exception ex)*/
-            {
-                return null;
-            }
-            finally
-            {
-                //EDS过程结束
-                //m_cfun.EDSFinishedInstance();
-
-                //关闭连接
-                DisConnectSem(connectionEnumType.EDSOnlyPointXRay);
-            }
-        }
-
-
-        #region 连接与关闭设备
-        public bool ConnectionSem(connectionEnumType connectionType)
-        {
-            //获取连接电镜类型
-            string connTypeStr = GetConnectionType(connectionType);
-            //连接电镜标识
-            bool bDisConnResult = false;
-            //判断连接状态
-            if (!m_bConnectionState)
-            {
-                //连接电镜设置
-                bDisConnResult = m_cfun.ConncetSem();
-            }
-            if (bDisConnResult)
-            {
-                m_bConnectionState = true;
-            }
-            else
-            {
-                m_bConnectionState = false;
-            }
-            return bDisConnResult;
-        }
-
-        public bool DisConnectSem(connectionEnumType disConnectType)
-        {
-            //获取关闭电镜类型
-            string connTypeStr = GetConnectionType(disConnectType);
-            bool bDisConnResult = false;
-            if (m_bConnectionState)
-            {
-                //bDisConnResult = m_cfun.DisConnectSem();
-            }
-            if (bDisConnResult)
-            {
-                m_bConnectionState = false;
-            }
-            else
-            {
-                m_bConnectionState = true;
-            }
-            return bDisConnResult;
-        }
-
-        private string GetConnectionType(connectionEnumType connectionType)
-        {
-            string connString = string.Empty;
-            switch (connectionType)
-            {
-                //设置单点采集文字内容
-                case connectionEnumType.EDSOnlyPointXRay:
-                    connString = "OnlyPointXRay";
-                    break;
-                //设置多点采集文字内容
-                case connectionEnumType.EDSMultiPointXRay:
-                    connString = "MultiPointXRay";
-                    break;
-                //设置面采集文字内容
-                case connectionEnumType.EDSAreaXRay:
-                    connString = "AreaXRay";
-                    break;
-                //设置图片
-                case connectionEnumType.ScanImage:
-                    connString = "Image";
-                    break;
-                default: break;
-            }
-            return connString;
-        }
-
-        /// <summary>
-        /// EDS初始化
-        /// </summary>
-        public bool EDSInit()
-        {
-            bool bResult = false;
-            //线程调用 加载
-            bResult = m_cfun.EDSInit();
-            return bResult;
-        }
-        public enum connectionEnumType
-        {
-            EDSOnlyPointXRay = 0,
-            EDSMultiPointXRay = 1,
-            EDSAreaXRay = 2,
-            ScanImage = 3
-        }
-        #endregion
-
-        #region int数组转byte数组
-        /// <summary>  
-        /// int数组转byte数组  
-        /// </summary>  
-        /// <param name="src">源int数组</param> 
-        /// <param name="offset">起始位置,一般为0</param>  
-        /// <returns>values</returns>  
-        protected byte[] intToBytes(uint[] src, int offset)
-        {
-            byte[] values = new byte[src.Length * 4];
-            for (int i = 0; i < src.Length; i++)
-            {
-
-                values[offset + 3] = (byte)((src[i] >> 24) & 0xFF);
-                values[offset + 2] = (byte)((src[i] >> 16) & 0xFF);
-                values[offset + 1] = (byte)((src[i] >> 8) & 0xFF);
-                values[offset] = (byte)(src[i] & 0xFF);
-                offset += 4;
-            }
-            return values;
-        }
-
-        protected int[] bytesToInt(byte[] src, int offset)
-        {
-            int[] values = new int[src.Length / 4];
-            for (int i = 0; i < values.Length; i++)
-            {
-                values[i] = BitConverter.ToInt32(src, offset);
-                offset += 4;
-            }
-            return values;
-        }
-        #endregion
-
-        /// <summary>
-        /// 弹出提示
-        /// </summary>
-        /// <param name="strContent"></param>
-        protected void showMessage(string strContent)
-        {
-            MessageBox.Show(strContent, "Tip");
-        }
-
-        #region 常用数据验证的封装,数字字符的验证
-        /// <summary>
-        /// 常用数据验证的封装,数字字符的验证
-        /// </summary>
-        /// <param name="inputVal">需要验证的数值【字符串,或者数字】</param>
-        /// <param name="type">类型为哪一个验证</param>
-        /// <returns>如果验证成功则返回True,否则返回false</returns>
-        public bool IsMatch(string inputVal, int type)
-        {
-            switch (type)
-            {
-                case 0:
-                    return Regex.IsMatch(inputVal, @"^[1-9]d*$");  //匹配正整数
-                case 1:
-                    return Regex.IsMatch(inputVal, @"^-?\d+$");  //匹配整数
-                case 2:
-                    return Regex.IsMatch(inputVal, @"^[A-Za-z0-9]+$");  //匹配由数字和26个英文字母组成的字符串 
-                case 3:
-                    return Regex.IsMatch(inputVal, @"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$");  //匹配正浮点数
-                case 4:
-                    return Regex.IsMatch(inputVal, @"^[\u4e00-\u9fa5]{0,}$");  //匹配汉字
-                case 5:
-                    return Regex.IsMatch(inputVal, @"^[0-9]+(.[0-9]{1,3})?$");  //匹配1~3位小数的正实数
-                case 6:
-                    return Regex.IsMatch(inputVal, @"^[A-Za-z]+$");  //匹配英文字符
-                default:
-                    return true;
-            }
-        }
-        #endregion
-    }
-}

+ 0 - 120
OTSPartA_STDEditor/XrayContrastForm.resx

@@ -1,120 +0,0 @@
-<?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>