Selaa lähdekoodia

添加特殊颗粒处理页面

zty 3 vuotta sitten
vanhempi
commit
0fae3554a1

+ 14 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_EN.xml

@@ -1016,7 +1016,8 @@
 	  <Control name="label44" text="Using X-ray" />
 	  <Control name="btnok" text="Sure" />
 	  <Control name="btncancel" text="Cancel" />
-	  <Control name="button1" text="Special Gray Grain Recognition Settings" />
+	  <Control name="button_SpPart" text="Special Gray Grain Recognition Settings" />
+	  <Control name="checkBox_Run" text="Enable" />
 	  <Control name="ProgMgrInfoForm" text="ProgramManagement" />
 	  <Control name="message1" text="Sample Stage information cannot be empty" />
 	  <Control name="message2" text="Screen size cannot be empty at 100 times" />
@@ -1086,6 +1087,18 @@
 	  <Control name="message65" text="The entered corrosion expansion coefficient cannot be empty!" />
 	  <Control name="message66" text="Please enter a positive odd number or 0!" />
     </Controls>
+ </Form>
+  <Form>
+    <Name>SpecialParticleForm</Name>
+    <Controls>
+	  <Control name="SpecialParticleForm" text="Special Gray Grain Recognition Settings" />
+	  <Control name="RegName" text="RegName" />
+	  <Control name="start" text="grayStart(0-255)" />
+	  <Control name="end" text="grayEnd(0-255)" />
+	  <Control name="diameterStart" text="diameterStart(um)" />
+	  <Control name="diameterEnd" text="diameterEnd(um)" />
+	  <Control name="collectXray" text="collectXray" />
+    </Controls>
  </Form>
  <Form>
     <Name>OTSSolutionWindow</Name>

+ 14 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1015,7 +1015,8 @@
 	  <Control name="label44" text="是否使用X-ray" />
 	  <Control name="btnok" text="确  定" />
 	  <Control name="btncancel" text="取  消" />
-	  <Control name="button1" text="特殊灰度颗粒识别设置" />
+	  <Control name="button_SpPart" text="特殊灰度颗粒识别设置" />
+	  <Control name="checkBox_Run" text="是否启用" />
 	  <Control name="ProgMgrInfoForm" text="程序管理" />
 	  <Control name="message1" text="样品台信息不能为空" />
 	  <Control name="message2" text="100倍时屏幕尺寸不能为空" />
@@ -1084,6 +1085,18 @@
 	  <Control name="message65" text="输入的腐蚀膨胀系数不可以为空!" />
 	  <Control name="message66" text="请输入正奇数或0!" />
     </Controls>
+ </Form>
+  <Form>
+    <Name>SpecialParticleForm</Name>
+    <Controls>
+	  <Control name="SpecialParticleForm" text="特殊灰度颗粒识别设置" />
+	  <Control name="RegName" text="名称" />
+	  <Control name="start" text="开始灰度(0-255)" />
+	  <Control name="end" text="结束灰度(0-255)" />
+	  <Control name="diameterStart" text="开始直径(微米)" />
+	  <Control name="diameterEnd" text="结束直径(微米)" />
+	  <Control name="collectXray" text="是否采集Xray" />
+    </Controls>
  </Form>
  <Form>
     <Name>OTSSolutionWindow</Name>

+ 124 - 0
OTSCommon/XMLoperate.cs

@@ -661,6 +661,130 @@ namespace OTSCommon
         }
         #endregion
 
+        #region 特殊颗粒XML处理
+        /// <summary>
+        /// 特殊颗粒XML读取
+        /// </summary>
+        /// <param name="FilePath">文件地址</param>
+        /// <param name="RegName">节点名称</param>
+        /// <returns>DataSet</returns>
+        public static DataSet GetXMLRegList(string FilePath, string TagName)
+        {
+            XmlDocument xmlDoc = new XmlDocument();
+
+            xmlDoc.Load(FilePath);    //加载Xml文件  
+
+            XmlNodeList nodeList = xmlDoc.GetElementsByTagName(TagName);
+
+            List<DataSet> dsList = new List<DataSet>();
+
+            DataSet dsResult = new DataSet();
+
+            foreach (XmlNode node in nodeList)
+            {
+                XmlElement ele = (XmlElement)node;
+                DataSet dsn = new DataSet();
+                StringReader read = new StringReader(node.OuterXml);
+                dsn.ReadXml(read);
+                dsList.Add(dsn);
+            }
+
+            for (int i = 0; i < dsList.Count; i++)
+            {
+                if (i == 0)
+                {
+                    dsResult = dsList[i];
+                }
+                else
+                {
+                    dsResult.Merge(dsList[i], false, MissingSchemaAction.Ignore);
+                }
+            }
+
+            return dsResult;
+        }
+
+        /// <summary>
+        /// 特殊颗粒XML修改
+        /// </summary>
+        /// <param name="FilePath">文件地址</param>
+        /// <param name="RegName">节点名称</param>
+        /// <returns>DataSet</returns>
+        public static bool UpdateXMLRegList(string FilePath, string TagName, string RowIndex, string MemberName, string MemberValue)
+        {
+            XmlDocument xmlDoc = new XmlDocument();
+
+            xmlDoc.Load(FilePath);    //加载Xml文件  
+
+            XmlNodeList nodeList = xmlDoc.GetElementsByTagName(TagName);
+
+            for (int i = 0; i < nodeList.Count; i++)
+            {
+                XmlElement ele = (XmlElement)nodeList[i];
+                if (i.ToString() == RowIndex)
+                {
+                    ele.SetAttribute(MemberName, MemberValue);
+                    break;
+                }
+            }
+
+            xmlDoc.Save(FilePath);
+
+            return true;
+        }
+
+        /// <summary>
+        /// 特殊颗粒XML添加
+        /// </summary>
+        /// <param name="FilePath">文件地址</param>
+        /// <param name="RegName">节点名称</param>
+        /// <returns>DataSet</returns>
+        public static bool AddXMLRegList(string FilePath, string RegName, string start, string end, string diameterStart, string diameterEnd, string collectXray)
+        {
+            XmlDocument xmlDoc = new XmlDocument();
+
+            xmlDoc.Load(FilePath);    //加载Xml文件  
+
+            XmlElement root = xmlDoc.DocumentElement;
+            //根节点的添加独立子节点  
+            XmlElement systemData = xmlDoc.CreateElement("Member");
+            //设置参数
+            systemData.SetAttribute("RegName", RegName);
+            systemData.SetAttribute("start", start);
+            systemData.SetAttribute("end", end);
+            systemData.SetAttribute("diameterStart", diameterStart);
+            systemData.SetAttribute("diameterEnd", diameterEnd);
+            systemData.SetAttribute("collectXray", collectXray);
+            //添加至父节点
+            root.FirstChild.AppendChild(systemData);
+
+            xmlDoc.Save(FilePath);
+
+            return true;
+        }
+
+        /// <summary>
+        /// 特殊颗粒XML删除
+        /// </summary>
+        /// <param name="FilePath">文件地址</param>
+        /// <param name="RegName">节点名称</param>
+        /// <returns>DataSet</returns>
+        public static bool DeleteXMLRegList(string FilePath, string TagName, int RowIndex)
+        {
+            XmlDocument xmlDoc = new XmlDocument();
+
+            xmlDoc.Load(FilePath);    //加载Xml文件  
+
+            XmlNodeList nodeList = xmlDoc.GetElementsByTagName(TagName);
+
+            nodeList.Item(RowIndex).ParentNode.RemoveChild(nodeList[RowIndex]);
+
+            xmlDoc.Save(FilePath);
+
+            return true;
+        }
+        #endregion
+
     }
 
 }

+ 36 - 5
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -14,6 +14,9 @@ using static OTSDataType.otsdataconst;
 using OTSModelSharp.Measure.GetStageInfo;
 using OTSMeasureApp._0_OTSModel.Measure.ParamData;
 using OTSMeasureApp._3_OTSDisplaySourceGridData;
+using OTSMeasureApp._7_OTSProgMgrInfo;
+using OTSCommon;
+using System.Data;
 
 namespace OTSMeasureApp
 {
@@ -968,6 +971,20 @@ namespace OTSMeasureApp
             else
                 btnok.Enabled = false;
 
+            //获取特殊颗粒信息
+            DataTable dt = XMLoperate.GetXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData").Tables[0];
+            if (dt.Rows.Count != 0)
+            {
+                if (XMLoperate.GetXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData").Tables[0].Rows[0]["ToRun"].ToString() == "true")
+                {
+                    checkBox_Run.Checked = true;
+                }
+                else
+                {
+                    checkBox_Run.Checked = false;
+                }
+            }
+
             //关于路径定位问题
             this.folderBrowserDialog1.SelectedPath = IDC_EDIT_MEASUREPARAMPATH.Text;
 
@@ -2038,11 +2055,6 @@ namespace OTSMeasureApp
             ThisSetIsModify();
         }
 
-        private void button1_Click(object sender, EventArgs e)
-        {
-            System.Diagnostics.Process.Start("notepad.exe",CSpecialGrayRangeParam.GetParamFileFullName());
-        }
-
         private void btn_StopMode_Click(object sender, EventArgs e)
         {
             if (StopModeDialog == null)
@@ -2076,6 +2088,25 @@ namespace OTSMeasureApp
         {
             ThisSetIsModify();
         }
+
+        private void button_SpPart_Click(object sender, EventArgs e)
+        {
+            //System.Diagnostics.Process.Start("notepad.exe", CSpecialGrayRangeParam.GetParamFileFullName());
+            SpecialParticleForm specialParticleForm = new SpecialParticleForm(CSpecialGrayRangeParam.GetParamFileFullName());
+            specialParticleForm.ShowDialog();
+        }
+
+        private void checkBox_Run_CheckedChanged(object sender, EventArgs e)
+        {
+            if (checkBox_Run.Checked)
+            {
+                XMLoperate.UpdateXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData", "0", "ToRun", "true");
+            }
+            else
+            {
+                XMLoperate.UpdateXMLRegList(CSpecialGrayRangeParam.GetParamFileFullName(), "XMLData", "0", "ToRun", "false");
+            }
+        }
     }
     public class ComboBoxItem
     {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 295 - 242
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs


+ 130 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.Designer.cs

@@ -0,0 +1,130 @@
+
+namespace OTSMeasureApp._7_OTSProgMgrInfo
+{
+    partial class SpecialParticleForm
+    {
+        /// <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.dataGridView_xml = new System.Windows.Forms.DataGridView();
+            this.RegName = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.start = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.end = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.diameterStart = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.diameterEnd = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.collectXray = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_xml)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // dataGridView_xml
+            // 
+            this.dataGridView_xml.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView_xml.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.RegName,
+            this.start,
+            this.end,
+            this.diameterStart,
+            this.diameterEnd,
+            this.collectXray});
+            this.dataGridView_xml.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dataGridView_xml.Location = new System.Drawing.Point(0, 0);
+            this.dataGridView_xml.Name = "dataGridView_xml";
+            this.dataGridView_xml.RowTemplate.Height = 23;
+            this.dataGridView_xml.Size = new System.Drawing.Size(784, 314);
+            this.dataGridView_xml.TabIndex = 2;
+            this.dataGridView_xml.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_xml_CellValueChanged);
+            this.dataGridView_xml.DefaultValuesNeeded += new System.Windows.Forms.DataGridViewRowEventHandler(this.dataGridView_xml_DefaultValuesNeeded);
+            this.dataGridView_xml.UserDeletingRow += new System.Windows.Forms.DataGridViewRowCancelEventHandler(this.dataGridView_xml_UserDeletingRow);
+            // 
+            // RegName
+            // 
+            this.RegName.DataPropertyName = "RegName";
+            this.RegName.HeaderText = "名称";
+            this.RegName.Name = "RegName";
+            this.RegName.Width = 80;
+            // 
+            // start
+            // 
+            this.start.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.start.DataPropertyName = "start";
+            this.start.HeaderText = "开始灰度(0-255)";
+            this.start.Name = "start";
+            // 
+            // end
+            // 
+            this.end.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.end.DataPropertyName = "end";
+            this.end.HeaderText = "结束灰度(0-255)";
+            this.end.Name = "end";
+            // 
+            // diameterStart
+            // 
+            this.diameterStart.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.diameterStart.DataPropertyName = "diameterStart";
+            this.diameterStart.HeaderText = "开始直径(微米)";
+            this.diameterStart.Name = "diameterStart";
+            // 
+            // diameterEnd
+            // 
+            this.diameterEnd.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.diameterEnd.DataPropertyName = "diameterEnd";
+            this.diameterEnd.HeaderText = "结束直径(微米)";
+            this.diameterEnd.Name = "diameterEnd";
+            // 
+            // collectXray
+            // 
+            this.collectXray.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.collectXray.DataPropertyName = "collectXray";
+            this.collectXray.HeaderText = "是否采集Xray";
+            this.collectXray.Name = "collectXray";
+            // 
+            // SpecialParticleForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(784, 314);
+            this.Controls.Add(this.dataGridView_xml);
+            this.MaximumSize = new System.Drawing.Size(800, 353);
+            this.MinimumSize = new System.Drawing.Size(800, 353);
+            this.Name = "SpecialParticleForm";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "SpecialParticleForm";
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView_xml)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.DataGridView dataGridView_xml;
+        private System.Windows.Forms.DataGridViewTextBoxColumn RegName;
+        private System.Windows.Forms.DataGridViewTextBoxColumn start;
+        private System.Windows.Forms.DataGridViewTextBoxColumn end;
+        private System.Windows.Forms.DataGridViewTextBoxColumn diameterStart;
+        private System.Windows.Forms.DataGridViewTextBoxColumn diameterEnd;
+        private System.Windows.Forms.DataGridViewTextBoxColumn collectXray;
+    }
+}

+ 226 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.cs

@@ -0,0 +1,226 @@
+using OTSCommon;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSMeasureApp._7_OTSProgMgrInfo
+{
+    public partial class SpecialParticleForm : Form
+    {
+        private string xmlPath = "";
+        private string str_RegName = "default";
+        private string str_start = "0";
+        private string str_end = "100";
+        private string str_diameterStart = "0";
+        private string str_diameterEnd = "100";
+        private string str_collectXray = "false";
+
+        //国际化
+        OTSCommon.Language lan;
+        Hashtable table;
+
+        public delegate void MyInvoke();
+        public void DoWork()
+        {
+            MyInvoke mi = new MyInvoke(ShowXmlInfo);
+            this.BeginInvoke(mi);
+        }
+
+        public SpecialParticleForm(string xmlPath)
+        {
+            InitializeComponent();
+            this.xmlPath = xmlPath;
+            ShowXmlInfo();
+
+            //国际化
+            lan = new OTSCommon.Language(this);
+            table = lan.GetNameTable(this.Name);
+        }
+
+        private void ShowXmlInfo()
+        {
+            DataSet dataSet = XMLoperate.GetXMLRegList(xmlPath, "Member");
+            dataGridView_xml.DataSource = dataSet.Tables[0];
+        }
+
+        private void dataGridView_xml_CellValueChanged(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.RowIndex == -1 || e.ColumnIndex == -1)
+            {
+                return;
+            }
+
+            if (e.RowIndex == dataGridView_xml.Rows.Count - 1)
+            {
+                return;
+            }
+
+            switch (e.ColumnIndex)
+            {
+                case 0://名称
+                    {
+                        for (int i = 0; i < dataGridView_xml.Rows.Count - 1; i++)
+                        {
+                            if (i != e.RowIndex)
+                            {
+                                if (dataGridView_xml.Rows[i].Cells[e.ColumnIndex].Value.ToString() == dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString())
+                                {
+                                    dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value += "_1";
+                                    break;
+                                }
+                            }
+                        }
+
+                        if (dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "")
+                        {
+                            dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value += "unknow";
+                        }
+
+                        break;
+                    }
+                case 1://开始灰度
+                    {
+                        int result = 0;
+                        int.TryParse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out result);
+
+                        if (result == 0)
+                        {
+                            dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                        }
+                        else
+                        {
+                            if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) > int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[2].Value.ToString()))
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = dataGridView_xml.Rows[e.RowIndex].Cells[2].Value.ToString();
+                            }
+                            else if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) < 0 || int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) > 255)
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                            }
+                        }
+
+                        break;
+                    }
+                case 2://结束灰度
+                    {
+                        int result = 0;
+                        int.TryParse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out result);
+
+                        if (result == 0)
+                        {
+                            dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                        }
+                        else
+                        {
+                            if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) < int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[1].Value.ToString()))
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = dataGridView_xml.Rows[e.RowIndex].Cells[1].Value.ToString();
+                            }
+                            else if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) < 0 || int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) > 255)
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                            }
+                        }
+
+                        break;
+                    }
+                case 3: //开始直径
+                    {
+                        int result = 0;
+                        int.TryParse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out result);
+
+                        if (result == 0)
+                        {
+                            dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                        }
+                        else
+                        {
+                            if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) > int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[4].Value.ToString()))
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = dataGridView_xml.Rows[e.RowIndex].Cells[4].Value.ToString();
+                            }
+                            else if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) < 0 || int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) > 255)
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                            }
+                        }
+
+                        break;
+                    }
+                case 4: //结束直径
+                    {
+                        int result = 0;
+                        int.TryParse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out result);
+
+                        if (result == 0)
+                        {
+                            dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                        }
+                        else
+                        {
+                            if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) < int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[3].Value.ToString()))
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = dataGridView_xml.Rows[e.RowIndex].Cells[3].Value.ToString();
+                            }
+                            else if (int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) < 0 || int.Parse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) > 255)
+                            {
+                                dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "0";
+                            }
+                        }
+
+                        break;
+                    }
+                case 5: //是否采集Xray
+                    {
+                        bool result = false;
+                        bool.TryParse(dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out result);
+
+                        if (result == false)
+                        {
+                            dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "false";
+                        }
+                        break;
+                    }
+
+                default:
+                    break;
+            }
+
+            if (dataGridView_xml.Rows[e.RowIndex].Cells[0].Value.ToString() != "")
+            {
+                XMLoperate.UpdateXMLRegList(xmlPath, "Member", e.RowIndex.ToString(), dataGridView_xml.Columns[e.ColumnIndex].Name, dataGridView_xml.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
+            }
+        }
+
+        private void dataGridView_xml_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
+        {
+            e.Row.Cells["RegName"].Value = str_RegName;
+            e.Row.Cells["start"].Value = str_start;
+            e.Row.Cells["end"].Value = str_end;
+            e.Row.Cells["diameterStart"].Value = str_diameterStart;
+            e.Row.Cells["diameterEnd"].Value = str_diameterEnd;
+            e.Row.Cells["collectXray"].Value = str_collectXray;
+
+            XMLoperate.AddXMLRegList(xmlPath, str_RegName, str_start, str_end, str_diameterStart, str_diameterEnd, str_collectXray);
+
+            Thread thread = new Thread(DoWork);
+            thread.Start();
+        }
+
+        private void dataGridView_xml_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
+        {
+            XMLoperate.DeleteXMLRegList(xmlPath, "Member", e.Row.Index);
+
+            Thread thread = new Thread(DoWork);
+            thread.Start();
+        }
+    }
+}

+ 138 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/SpecialParticleForm.resx

@@ -0,0 +1,138 @@
+<?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="RegName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="start.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="end.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="diameterStart.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="diameterEnd.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="collectXray.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 9 - 0
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -288,6 +288,12 @@
     <Compile Include="5-OTSMeasureStatuImageFun\SlopFocus.Designer.cs">
       <DependentUpon>SlopFocus.cs</DependentUpon>
     </Compile>
+    <Compile Include="7-OTSProgMgrInfo\SpecialParticleForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="7-OTSProgMgrInfo\SpecialParticleForm.Designer.cs">
+      <DependentUpon>SpecialParticleForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="7-OTSProgMgrInfo\Stage\DlgStageEdit.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -498,6 +504,9 @@
     <EmbeddedResource Include="5-OTSMeasureStatuImageFun\SlopFocus.resx">
       <DependentUpon>SlopFocus.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="7-OTSProgMgrInfo\SpecialParticleForm.resx">
+      <DependentUpon>SpecialParticleForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="7-OTSProgMgrInfo\Stage\DlgStageEdit.resx">
       <DependentUpon>DlgStageEdit.cs</DependentUpon>
     </EmbeddedResource>

+ 0 - 18
OTSIncAMeasureApp/OTSIncAMeasureAppForm.Designer.cs

@@ -61,7 +61,6 @@
             this.rbAbout = new System.Windows.Forms.RibbonOrbMenuItem();
             this.rbExitApp = new System.Windows.Forms.RibbonOrbMenuItem();
             this.rbSelectDlg = new System.Windows.Forms.RibbonOrbOptionButton();
-            this.ribbonOrbRecentItem1 = new System.Windows.Forms.RibbonOrbRecentItem();
             this.rbTabHome = new System.Windows.Forms.RibbonTab();
             this.rbPanelFile = new System.Windows.Forms.RibbonPanel();
             this.rbPanelSample = new System.Windows.Forms.RibbonPanel();
@@ -189,7 +188,6 @@
             this.rbMenu.OrbDropDown.MenuItems.Add(this.rbExitApp);
             this.rbMenu.OrbDropDown.Name = "";
             this.rbMenu.OrbDropDown.OptionItems.Add(this.rbSelectDlg);
-            this.rbMenu.OrbDropDown.RecentItems.Add(this.ribbonOrbRecentItem1);
             this.rbMenu.OrbDropDown.Size = new System.Drawing.Size(527, 474);
             this.rbMenu.OrbDropDown.TabIndex = 0;
             this.rbMenu.OrbImage = global::OTSMeasureApp.Properties.Resources.logo_40;
@@ -376,21 +374,6 @@
             this.rbSelectDlg.ToolTipTitle = null;
             this.rbSelectDlg.Click += new System.EventHandler(this.rbSelectDlg_Click);
             // 
-            // ribbonOrbRecentItem1
-            // 
-            this.ribbonOrbRecentItem1.AltKey = null;
-            this.ribbonOrbRecentItem1.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Down;
-            this.ribbonOrbRecentItem1.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.ribbonOrbRecentItem1.Image = ((System.Drawing.Image)(resources.GetObject("ribbonOrbRecentItem1.Image")));
-            this.ribbonOrbRecentItem1.SmallImage = ((System.Drawing.Image)(resources.GetObject("ribbonOrbRecentItem1.SmallImage")));
-            this.ribbonOrbRecentItem1.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.ribbonOrbRecentItem1.Tag = null;
-            this.ribbonOrbRecentItem1.Text = "特殊颗粒识别设置";
-            this.ribbonOrbRecentItem1.ToolTip = null;
-            this.ribbonOrbRecentItem1.ToolTipImage = null;
-            this.ribbonOrbRecentItem1.ToolTipTitle = null;
-            this.ribbonOrbRecentItem1.Click += new System.EventHandler(this.ribbonOrbRecentItem1_Click);
-            // 
             // rbTabHome
             // 
             this.rbTabHome.Panels.Add(this.rbPanelFile);
@@ -1047,7 +1030,6 @@
         public System.Windows.Forms.RibbonButton rbSTDEdit;
         public System.Windows.Forms.RibbonButton rbReClassify;
         private System.Windows.Forms.RibbonButton rbCircleCenter;
-        private System.Windows.Forms.RibbonOrbRecentItem ribbonOrbRecentItem1;
         private System.Windows.Forms.RibbonButton rbThreePoints;
         public System.Windows.Forms.RibbonButton rbConnectHardware;
         public System.Windows.Forms.RibbonButton rbDisconnectHardware; 

+ 0 - 5
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1265,11 +1265,6 @@ namespace OTSMeasureApp
             m_about.ShowDialog();
         }
 
-        private void ribbonOrbRecentItem1_Click(object sender, EventArgs e)
-        {
-            System.Diagnostics.Process.Start("notepad.exe", CSpecialGrayRangeParam.GetParamFileFullName());
-          
-        }
         protected override void DefWndProc(ref Message m)
         {
             switch (m.Msg)

+ 0 - 1
OTSSysMgrApp/OTSSysMgrApp.csproj

@@ -150,7 +150,6 @@
     <Compile Include="ControllerSettingForm.Designer.cs">
       <DependentUpon>ControllerSettingForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="Imagepro.cs" />
     <Compile Include="Language.cs" />
     <Compile Include="OTSSystemManagerForms.cs">
       <SubType>Form</SubType>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä