2 次代码提交 6047c39601 ... efdf05a581

作者 SHA1 备注 提交日期
  cxs efdf05a581 Merge branch 'OTSRelease3_2' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_2 4 月之前
  cxs e295ff60e4 颗粒列表新增相似颗粒搜索功能 4 月之前

+ 1 - 28
OTSIncAReportApp/1-UI/Control_Grids/OTSIncAReportGridsFuncation/OTSReportGridsFun.cs

@@ -22,13 +22,7 @@ namespace OTSIncAReportGrids.OTSIncAReportGridsFuncation
         public bool m_SEMConnectionState = false;
         //连接到电镜的ID号
         public int m_SEM_ID = 0;
-        //国际化
-        Language lan = new Language();
-        Hashtable table;
-
-        OTSIncAReportApp.frmReportApp m_frmReportApp = null;
         public HardwareController m_cfun = null;
-
         #endregion
 
         #region 构造函数
@@ -38,31 +32,10 @@ namespace OTSIncAReportGrids.OTSIncAReportGridsFuncation
         /// </summary>
         /// <param name="in_frmReportApp"></param>
         /// <param name="form"></param>
-        public OTSReportGridsFun(OTSIncAReportApp.frmReportApp in_frmReportApp, System.Windows.Forms.UserControl form)
+        public OTSReportGridsFun()
         {
-            //国际化
-            lan = new Language(form);
-            table = lan.GetNameTable(form.Name);
-
-            m_frmReportApp = in_frmReportApp;
-
             m_cfun = HardwareController.GetSemController();//  It's better to reinitialize, but it's not good to uninitialize
-
         }
-
-        /// <summary>
-        /// 需传入,主窗体对象,与要获取数据窗体的对象
-        /// </summary>
-        /// <param name="in_frmReportApp"></param>
-        /// <param name="form"></param>
-        public OTSReportGridsFun(OTSIncAReportApp.frmReportApp in_frmReportApp)
-        {
-            m_frmReportApp = in_frmReportApp;
-
-            m_cfun = HardwareController.GetSemController();//  It's better to reinitialize, but it's not good to uninitialize
-
-        }
-
         #endregion
 
         #region 自定义方法封装

+ 210 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.Designer.cs

@@ -0,0 +1,210 @@
+using OTSIncAReportGraph.Controls;
+
+namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
+{
+    partial class ListOfSimilarParticles
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.dgV_SimilarParticles = new System.Windows.Forms.DataGridView();
+            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.movetoparticleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.btn_OK = new System.Windows.Forms.Button();
+            this.btn_Cannnel = new System.Windows.Forms.Button();
+            this.tB_SimilarRatio = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.btn_Search = new System.Windows.Forms.Button();
+            this.cBx_All = new System.Windows.Forms.CheckBox();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.label2 = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.dgV_SimilarParticles)).BeginInit();
+            this.contextMenuStrip1.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // dgV_SimilarParticles
+            // 
+            this.dgV_SimilarParticles.AllowUserToAddRows = false;
+            this.dgV_SimilarParticles.AllowUserToDeleteRows = false;
+            this.dgV_SimilarParticles.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
+            this.dgV_SimilarParticles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgV_SimilarParticles.ContextMenuStrip = this.contextMenuStrip1;
+            this.dgV_SimilarParticles.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dgV_SimilarParticles.Location = new System.Drawing.Point(0, 0);
+            this.dgV_SimilarParticles.Name = "dgV_SimilarParticles";
+            this.dgV_SimilarParticles.ReadOnly = true;
+            this.dgV_SimilarParticles.RowHeadersWidth = 4;
+            this.dgV_SimilarParticles.RowTemplate.Height = 23;
+            this.dgV_SimilarParticles.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.dgV_SimilarParticles.Size = new System.Drawing.Size(1772, 725);
+            this.dgV_SimilarParticles.TabIndex = 6;
+            this.dgV_SimilarParticles.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgV_SimilarParticles_CellMouseClick);
+            this.dgV_SimilarParticles.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dgV_SimilarParticles_KeyUp);
+            this.dgV_SimilarParticles.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgV_SimilarParticles_MouseUp);
+            // 
+            // contextMenuStrip1
+            // 
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.movetoparticleToolStripMenuItem});
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
+            this.contextMenuStrip1.Size = new System.Drawing.Size(211, 48);
+            // 
+            // movetoparticleToolStripMenuItem
+            // 
+            this.movetoparticleToolStripMenuItem.Name = "movetoparticleToolStripMenuItem";
+            this.movetoparticleToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
+            this.movetoparticleToolStripMenuItem.Text = "移动SEM到颗粒视域位置";
+            this.movetoparticleToolStripMenuItem.Click += new System.EventHandler(this.movetoparticleToolStripMenuItem_Click);
+            // 
+            // btn_OK
+            // 
+            this.btn_OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btn_OK.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btn_OK.Location = new System.Drawing.Point(866, 776);
+            this.btn_OK.Name = "btn_OK";
+            this.btn_OK.Size = new System.Drawing.Size(99, 33);
+            this.btn_OK.TabIndex = 7;
+            this.btn_OK.Text = "OK";
+            this.btn_OK.UseVisualStyleBackColor = true;
+            this.btn_OK.Click += new System.EventHandler(this.btn_OK_Click);
+            // 
+            // btn_Cannnel
+            // 
+            this.btn_Cannnel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btn_Cannnel.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btn_Cannnel.Location = new System.Drawing.Point(997, 776);
+            this.btn_Cannnel.Name = "btn_Cannnel";
+            this.btn_Cannnel.Size = new System.Drawing.Size(107, 33);
+            this.btn_Cannnel.TabIndex = 8;
+            this.btn_Cannnel.Text = "Cannnel";
+            this.btn_Cannnel.UseVisualStyleBackColor = true;
+            this.btn_Cannnel.Click += new System.EventHandler(this.btn_Cannnel_Click);
+            // 
+            // tB_SimilarRatio
+            // 
+            this.tB_SimilarRatio.Location = new System.Drawing.Point(184, 6);
+            this.tB_SimilarRatio.Name = "tB_SimilarRatio";
+            this.tB_SimilarRatio.Size = new System.Drawing.Size(90, 21);
+            this.tB_SimilarRatio.TabIndex = 10;
+            this.tB_SimilarRatio.Text = "97";
+            this.tB_SimilarRatio.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            this.tB_SimilarRatio.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tB_SimilarRatio_KeyUp);
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(12, 9);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(185, 16);
+            this.label1.TabIndex = 9;
+            this.label1.Text = "请设定搜索相似度(0-100之间)";
+            // 
+            // btn_Search
+            // 
+            this.btn_Search.Location = new System.Drawing.Point(302, 5);
+            this.btn_Search.Name = "btn_Search";
+            this.btn_Search.Size = new System.Drawing.Size(75, 23);
+            this.btn_Search.TabIndex = 11;
+            this.btn_Search.Text = "Search";
+            this.btn_Search.UseVisualStyleBackColor = true;
+            this.btn_Search.Click += new System.EventHandler(this.btn_Search_Click);
+            // 
+            // cBx_All
+            // 
+            this.cBx_All.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+            this.cBx_All.Location = new System.Drawing.Point(16, 781);
+            this.cBx_All.Name = "cBx_All";
+            this.cBx_All.Size = new System.Drawing.Size(104, 24);
+            this.cBx_All.TabIndex = 12;
+            this.cBx_All.Text = "全选";
+            this.cBx_All.UseVisualStyleBackColor = true;
+            this.cBx_All.CheckedChanged += new System.EventHandler(this.cBx_All_CheckedChanged);
+            // 
+            // panel1
+            // 
+            this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.panel1.Controls.Add(this.dgV_SimilarParticles);
+            this.panel1.Location = new System.Drawing.Point(16, 41);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(1772, 725);
+            this.panel1.TabIndex = 13;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(276, 7);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(19, 19);
+            this.label2.TabIndex = 14;
+            this.label2.Text = "%";
+            // 
+            // ListOfSimilarParticles
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1800, 817);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.panel1);
+            this.Controls.Add(this.cBx_All);
+            this.Controls.Add(this.btn_Search);
+            this.Controls.Add(this.tB_SimilarRatio);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.btn_Cannnel);
+            this.Controls.Add(this.btn_OK);
+            this.Name = "ListOfSimilarParticles";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "ListOfSimilarParticles";
+            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.Load += new System.EventHandler(this.ListOfSimilarParticles_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.dgV_SimilarParticles)).EndInit();
+            this.contextMenuStrip1.ResumeLayout(false);
+            this.panel1.ResumeLayout(false);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.DataGridView dgV_SimilarParticles;
+        private System.Windows.Forms.Button btn_OK;
+        private System.Windows.Forms.Button btn_Cannnel;
+        private System.Windows.Forms.TextBox tB_SimilarRatio;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button btn_Search;
+        private System.Windows.Forms.CheckBox cBx_All;
+        private Control_XRayTable control_XRayTable1=new Control_XRayTable();
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem movetoparticleToolStripMenuItem;
+        private System.Windows.Forms.Label label2;
+    }
+}

+ 779 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.cs

@@ -0,0 +1,779 @@
+using OTSCLRINTERFACE;
+using OTSCommon;
+using OTSCommon.DBOperate.Model;
+using OTSIncAReportApp.OTSRstMgrFunction;
+using OTSIncAReportGraph.Class;
+using OTSIncAReportGrids.OTSIncAReportGridsFuncation;
+using OTSPeriodicTable;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SQLite;
+using System.Drawing;
+using System.Linq;
+using System.Reflection;
+using System.Threading;
+using System.Windows.Forms;
+using Color = System.Drawing.Color;
+
+namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
+{
+    public partial class ListOfSimilarParticles : Form
+    {
+        OTSIncAReportGrids.ParticlesGridDevidePage _particlesGridDevidePage;
+        CPosXrayClr SelXrayclr = new CPosXrayClr();
+        DataTable particlesAll;
+        DataTable particles;
+        Hashtable table;
+        int _classifyid;
+        List<string> _RenameInfo;
+        private Thread m_mythread;
+        //记录线程是否已经运行完成的状态
+        private bool m_mythread_state = false;
+        //底层操作类
+        OTSReportGridsFun m_OTSIncAReportGridsFun = null;
+
+        public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, int classifyid, List<string> RenameInfo)
+        {
+            InitializeComponent();
+            _particlesGridDevidePage = particlesGridDevidePage;
+            SelXrayclr.SetXrayData(SelXray);
+            table = particlesGridDevidePage.table;
+            _classifyid = classifyid;
+            _RenameInfo = RenameInfo;
+
+            m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
+
+
+            //设置窗体的双缓冲,以保证大数据时拖动不卡
+            this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
+            this.UpdateStyles();
+            //利用反射设置DataGridView的双缓冲
+            Type dgvType = this.dgV_SimilarParticles.GetType();
+            PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
+            pi.SetValue(this.dgV_SimilarParticles, true, null);
+
+            this.control_XRayTable1 = new OTSIncAReportGraph.Controls.Control_XRayTable(null);
+            this.control_XRayTable1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            this.control_XRayTable1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.control_XRayTable1.GBInfoStr = "";
+            this.control_XRayTable1.GoodChineseName = "";
+            this.control_XRayTable1.MaterialName = "";
+            this.control_XRayTable1.Location = new System.Drawing.Point(0, 400);
+            this.control_XRayTable1.Name = "control_XRayTable1";
+            this.control_XRayTable1.ShowAnalysisXray = true;
+            this.control_XRayTable1.ShowSearchXray = false;
+            this.control_XRayTable1.Size = new System.Drawing.Size(1004, 200);
+            this.control_XRayTable1.STDName = "";
+            this.control_XRayTable1.Visible = false;
+            this.control_XRayTable1.label_close.Visible = true;
+            panel1.Controls.Add(this.control_XRayTable1);
+        }
+        private void btn_Search_Click(object sender, EventArgs e)
+        {
+            double val;
+            if (!double.TryParse(tB_SimilarRatio.Text, out val))
+            {
+                MessageBox.Show("The value must range from 0 to 100!");
+                return;
+            }
+            else
+            {
+                this.Cursor = Cursors.WaitCursor;
+                particlesAll = ObtainSourceOfSimilarParticles(_classifyid);
+
+
+
+
+
+                DataTable elementchemistry = _particlesGridDevidePage.Particledata.GetElementChemistry();
+                for (int i = 0; i < particlesAll.Rows.Count; i++)
+                {
+                    string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
+                    DataRow[] drs = elementchemistry.Select(str);
+                    string ConcatenatedString = "";
+                    for (int j = 0; j < drs.Length; j++)
+                    {
+                        ConcatenatedString += drs[j]["name"] + "-" + drs[j]["Percentage"] + ';';
+                    }
+                    particlesAll.Rows[i]["Element"] = ConcatenatedString;
+                }
+                particlesAll.Columns.Add("SimilarRatio", typeof(double));
+                particles = particlesAll.Clone();
+                DataTable mergeParticles = _particlesGridDevidePage.Particledata.GetInfoForPartucleDevidePage_mergeParticles("");
+                if (mergeParticles != null && mergeParticles.Rows.Count > 0)
+                {
+                    _particlesGridDevidePage.RemoveMergeParticles(ref particlesAll, mergeParticles);
+                }
+                foreach (DataRow row in particlesAll.Rows)
+                {
+                    var tmpPart = _particlesGridDevidePage.Particledata.GetParticleXrayDataByFidAndPid(row["fieldid"].ToString(), row["xrayid"].ToString());
+                    if (tmpPart != null)
+                    {
+                        uint[] Search_xray = new uint[2000];
+                        for (int i = 0; i < 2000; i++)
+                        {
+                            Search_xray[i] = BitConverter.ToUInt32(tmpPart.XRayData, i * 4);
+                        }
+                        CPosXrayClr Xrayclr = new CPosXrayClr();
+                        Xrayclr.SetXrayData(Search_xray);
+                        row["SimilarRatio"] = GetCosValue(SelXrayclr, Xrayclr);
+                        if ((double)row["SimilarRatio"] >= val/100)
+                        {
+                            particles.ImportRow(row);
+                        }
+                    }
+                }
+                particles.DefaultView.Sort = "SimilarRatio DESC";
+                particles = particles.DefaultView.ToTable();
+                BindDataGridView();
+                SetDataGridViewStyle();
+                cBx_All.Checked = false;
+                cBx_All.Checked = true;
+                this.Cursor = Cursors.Default;
+            }
+        }
+        private void SetDataGridViewStyle()
+        {
+            //用户不能调整标题的高度
+            dgV_SimilarParticles.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+
+            //用户不能调整 行高
+            dgV_SimilarParticles.AllowUserToResizeRows = false;
+
+            //点击选择整行
+            dgV_SimilarParticles.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+
+            //居中显示
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dgV_SimilarParticles.DefaultCellStyle = dataGridViewCellStyle1;
+            dgV_SimilarParticles.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+
+            //再次重覆禁用拖动表头高度,居然有效果了
+            dgV_SimilarParticles.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+
+            //设置grid可以复制
+            dgV_SimilarParticles.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
+
+            //设置每列的宽度
+            dgV_SimilarParticles.Columns[0].Width = 30;//第一列序号的宽度设置一下吧,要不太丑
+            dgV_SimilarParticles.Columns[1].Width = 50;
+            for (int i = 4; i < dgV_SimilarParticles.Columns.Count; i++)
+            {
+                dgV_SimilarParticles.Columns[i].Width = 65;
+            }
+            //设置序号列不排序
+            dgV_SimilarParticles.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
+            dgV_SimilarParticles.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
+            //设置序号列不可以设置宽度
+            dgV_SimilarParticles.Columns[0].Resizable = DataGridViewTriState.False;
+
+            dgV_SimilarParticles.RowsDefaultCellStyle.BackColor = Color.Azure;
+
+            if (dgV_SimilarParticles.Rows.Count > 0)
+            {
+                dgV_SimilarParticles.Rows[0].Frozen = true;
+            }
+        }
+        private void BindDataGridView()
+        {
+            dgV_SimilarParticles.Visible = false;
+            dgV_SimilarParticles.Rows.Clear();
+            dgV_SimilarParticles.Columns.Clear();
+
+            string str_DefaultComputedColName = "", str_ElementsColName = "";
+            DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
+            DataTable dt = ds.Tables["Member"];
+            foreach (DataRow element in dt.Rows)
+            {
+                string RegName = element["RegName"].ToString();
+
+                if (RegName == "DefaultComputedColName")
+                {
+                    str_DefaultComputedColName = element["strValue"].ToString();
+                }
+
+                if (RegName == "ElementsColName")
+                {
+                    str_ElementsColName = element["strValue"].ToString();
+                }
+            }
+
+            string[] strs = str_DefaultComputedColName.Split(',');
+            Dictionary<string, string> keyValues = new Dictionary<string, string>() { };
+            keyValues.Add("SimilarRatio", "相似度");
+            keyValues.Add("TypeName", table["str6"].ToString());
+            keyValues.Add("ParticleImage", table["str5"].ToString());
+            keyValues.Add("FieldId", "FieldId");
+            keyValues.Add("ParticleId", "ParticleId");
+            keyValues.Add("SEMPosX", "SEMPosX");
+            keyValues.Add("SEMPosY", "SEMPosY");
+            for (int i = 0; i < strs.Count(); i++)
+            {
+                if (strs[i] == "ParticleCoordinate")
+                {
+                    keyValues.Add("AbPosX", "PosX");
+                    keyValues.Add("AbPosY", "PosY");
+                }
+                if (strs[i] == "Area")
+                {
+                    keyValues.Add("Area", table["str21"].ToString());
+                }
+                if (strs[i] == "EquivalentCircleDiameter")
+                {
+                    keyValues.Add("Equivalent", table["str22"].ToString());
+                }
+                if (strs[i] == "MaxDiameter")
+                {
+                    keyValues.Add("DMAX", table["str23"].ToString());
+                }
+                if (strs[i] == "MinDiameter")
+                {
+                    keyValues.Add("DMIN", table["str24"].ToString());
+                }
+                if (strs[i] == "DiameterRatio")
+                {
+                    keyValues.Add("DiameterRatio", table["str25"].ToString());
+                }
+                if (strs[i] == "FerretDiameter")
+                {
+                    keyValues.Add("DFERET", table["str26"].ToString());
+                }
+                if (strs[i] == "PERP")
+                {
+                    keyValues.Add("DPERP", table["str27"].ToString());
+                }
+                if (strs[i] == "PERI")
+                {
+                    keyValues.Add("PERIMETER", table["str28"].ToString());
+                }
+                if (strs[i] == "INSCR")
+                {
+                    keyValues.Add("DINSCR", table["str29"].ToString());
+                }
+                if (strs[i] == "MEAN")
+                {
+                    keyValues.Add("DMEAN", table["str30"].ToString());
+                }
+                if (strs[i] == "ELONG")
+                {
+                    keyValues.Add("DELONG", table["str31"].ToString());
+                }
+                if (strs[i] == "ASPECT_ELONG")
+                {
+                    keyValues.Add("ASPECT_ELONG", table["str32"].ToString());
+                }
+                if (strs[i] == "Orientation")
+                {
+                    keyValues.Add("ORIENTATION", table["str33"].ToString());
+                }
+                if (strs[i] == "XRayDataCount")
+                {
+                    keyValues.Add("XRayDataCount", "XRay计数");
+                }
+            }
+            keyValues.Add("Element", "Element");
+
+            Dictionary<string, string>.Enumerator en = keyValues.GetEnumerator();
+            for (int irow = 0; irow < keyValues.Count; irow++)
+            {
+                if (en.MoveNext())
+                {
+                    if (en.Current.Key == "ParticleImage")
+                    {
+                        DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
+                        iconColumn.Name = en.Current.Key;
+                        iconColumn.HeaderText = en.Current.Value;
+                        dgV_SimilarParticles.Columns.Add(iconColumn);
+                    }
+                    else if (en.Current.Key == "Element")
+                    {
+
+                    }
+                    else
+                    {
+                        dgV_SimilarParticles.Columns.Add(en.Current.Key, en.Current.Value);
+                        if (en.Current.Key == "Area" || en.Current.Key == "EquivalentCircleDiameter" || en.Current.Key == "MaxDiameter" || en.Current.Key == "MinDiameter" || en.Current.Key == "DiameterRatio" || en.Current.Key == "FerretDiameter" || en.Current.Key == "PERP" || en.Current.Key == "PERI" || en.Current.Key == "INSCR" || en.Current.Key == "MEAN" || en.Current.Key == "ELONG" || en.Current.Key == "ASPECT_ELONG" || en.Current.Key == "Orientation")
+                        {
+                            int id = dgV_SimilarParticles.Columns.Count;
+                            dgV_SimilarParticles.Columns[id - 1].Tag = "NumericType";
+                        }
+                    }
+                }
+            }
+            if (particlesAll == null)
+            {
+                return;
+            }
+            string particleM = "";
+            List<string> ElementTypeSort = new List<string>(str_ElementsColName.Split(',').ToList());//去重
+            for (int i = 0; i < ElementTypeSort.Count; i++)
+            {
+                if (ElementTypeSort[0] == "")
+                {
+                    ElementTypeSort.RemoveAt(0);
+                    break;
+                }
+                dgV_SimilarParticles.Columns.Add(ElementTypeSort[i], ElementTypeSort[i]);
+                int id = dgV_SimilarParticles.Columns.Count;
+                dgV_SimilarParticles.Columns[id - 1].Tag = "NumericType";
+            }
+            string filePath = _particlesGridDevidePage.result.FilePath + "\\FIELD_FILES\\";
+            KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
+            for (int i = 0; i < particles.Rows.Count; i++)
+            {
+                Dictionary<string, string>.Enumerator enl = keyValues.GetEnumerator();
+
+                int add_rowindex = dgV_SimilarParticles.Rows.Add();
+                for (int k = 0; k < keyValues.Count; k++)
+                {
+                    if (enl.MoveNext())
+                    {
+                        if (enl.Current.Key == "ParticleImage")
+                        {
+                            if (particles.Columns.Contains("SubParticles"))
+                            {
+                                string subt = particles.Rows[i]["SubParticles"].ToString();
+                                if (subt != null && subt != "")
+                                {
+                                    double ScanFieldSize = _particlesGridDevidePage.result.GetScanFieldSizeX();
+                                    string filePatht = _particlesGridDevidePage.result.FilePath + "\\FIELD_FILES\\";
+                                    string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
+                                    Bitmap tempbit = _particlesGridDevidePage.Particledata.ReadImageFile(imagePatht);
+                                    int pixw = tempbit.Width;
+                                    double xs = pixw / ScanFieldSize;
+
+                                    particleM = particleM + "," + subt;
+                                    Bitmap bmap = _particlesGridDevidePage.Particledata.GetBitmapForBig(subt, xs, _particlesGridDevidePage.result.FilePath, tempbit.Height, tempbit.Width);
+                                    if (bmap != null)
+                                    {
+                                        string[] str = subt.Split(',');
+                                        bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
+                                        dgV_SimilarParticles.Rows[add_rowindex].Height = 150;
+                                        dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = bmap;
+                                        dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                        dgV_SimilarParticles.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
+                                    }
+                                    else
+                                    {
+                                        dgV_SimilarParticles.Rows[add_rowindex].Height = 150;
+                                        dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                if (FieldImage.Key != particles.Rows[i]["fieldid"].ToString() || FieldImage.Value == null)
+                                {
+                                    string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
+                                    FieldImage = new KeyValuePair<string, Bitmap>(particles.Rows[i]["fieldid"].ToString(), _particlesGridDevidePage.Particledata.ReadImageFile(imagePath));
+                                }
+                                Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particles.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particles.Rows[i]["RectTop"]), Width = Convert.ToInt32(particles.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particles.Rows[i]["RectHeight"]) };
+                                Bitmap bmap = _particlesGridDevidePage.Particledata.GetBitmapByParticle(FieldImage.Value, rectangle);
+                                bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString(), particles.Rows[i]["XrayId"].ToString() };
+                                dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = bmap;
+                                dgV_SimilarParticles.Rows[add_rowindex].Height = bmap.Height + 20;
+                            }
+                        }
+                        if (enl.Current.Key == "DiameterRatio")
+                        {
+                            double d = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
+                            dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
+                        }
+                        if (en.Current.Key == "Element")
+                        {
+
+                        }
+                        if (enl.Current.Key == "ASPECT_ELONG")
+                        {
+                            double d = Convert.ToDouble(particles.Rows[i]["DELONG"]) / Convert.ToDouble(particles.Rows[i]["DMEAN"]);
+                            dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
+                        }
+                        if (particles.Columns.Contains(enl.Current.Key))
+                        {
+                            double num = 0;
+                            if (double.TryParse(particles.Rows[i][enl.Current.Key].ToString(), out num))
+                            {
+                                dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(num, 2);
+                            }
+                            else if (enl.Current.Key == "Element")
+                            {
+                                List<string> elementtemp = new List<string>(ElementTypeSort);
+                                string[] strcbo = particles.Rows[i][enl.Current.Key].ToString().Split(';');
+                                for (int j = 0; j < strcbo.Length; j++)
+                                {
+                                    if (ElementTypeSort.Count == 0)
+                                    {
+                                        break;
+                                    }
+                                    string[] str = strcbo[j].Split('-');
+                                    if (ElementTypeSort.Contains(str[0]))
+                                    { dgV_SimilarParticles.Rows[add_rowindex].Cells[str[0].ToString()].Value = Math.Round(double.Parse(str[1]), 2).ToString(); }
+                                    elementtemp.Remove(str[0].ToString());
+                                }
+                                foreach (var ele in elementtemp)
+                                {
+                                    dgV_SimilarParticles.Rows[add_rowindex].Cells[ele].Value = "0";
+                                }
+                            }
+                            else
+                            {
+                                double val = 0;
+                                if (double.TryParse(Convert.ToString(particles.Rows[i][enl.Current.Key]), out val))
+                                {
+                                    dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = val;
+                                }
+                                else
+                                {
+                                    dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = particles.Rows[i][enl.Current.Key];
+                                }
+
+                            }
+                        }
+                        if (enl.Current.Key == "TypeName")
+                        {
+                            if (particles.Rows[i]["TypeId"].ToString() == "9")
+                            {
+                                dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = "Not Identified";
+                            }
+                        }
+                        if (enl.Current.Key == "Equivalent")
+                        {
+                            double dSize = Convert.ToDouble(particles.Rows[i]["Area"]);
+                            double Diameter = Math.Sqrt(dSize / Math.PI) * 2;
+                            dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(Diameter, 2);
+                        }
+                        if (enl.Current.Key == "AbPosX")
+                        {
+                            Point point = OTSIncAReportGrids.ParticlesGridDevidePage.CalculateParticleCenterPosition(_particlesGridDevidePage.result, new Point(Convert.ToInt32(particles.Rows[i]["SEMPosX"]), Convert.ToInt32(particles.Rows[i]["SEMPosY"])), new Point(Convert.ToInt32(particles.Rows[i]["PosX"]), Convert.ToInt32(particles.Rows[i]["PosY"])));
+                            dgV_SimilarParticles.Rows[add_rowindex].Cells["AbPosX"].Value = point.X;
+                            dgV_SimilarParticles.Rows[add_rowindex].Cells["AbPosY"].Value = point.Y;
+                        }
+                    }
+                }
+            }
+            DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn();
+            checkBoxColumn.HeaderText = "选择";
+            checkBoxColumn.Name = "IsSelected";
+            checkBoxColumn.TrueValue = true;
+            checkBoxColumn.FalseValue = false;
+            checkBoxColumn.Width = 30;
+            checkBoxColumn.ReadOnly = false;
+            dgV_SimilarParticles.Columns.Insert(0, checkBoxColumn);
+            dgV_SimilarParticles.Rows[0].Cells[2].Value = _RenameInfo[1];
+            dgV_SimilarParticles.Visible = true;
+        }
+
+
+
+
+
+        private double GetCosValue(CPosXrayClr posXray, CPosXrayClr posXray1)
+        {
+            if (posXray == null) return 0;
+            if (posXray1 == null) return 0;
+            if (posXray.GetChannelsNum() != posXray1.GetChannelsNum())
+            {
+                return 0;
+            }
+
+            var pXrayData = posXray.GetXrayData();
+            var pXrayData1 = posXray1.GetXrayData();
+
+
+            // 公式: (x1y1+x2y2+x3y3+...x2000y2000) / (sqrt(x1^2 + x2^2 + ...x2000^2) * sqrt(y1^2 + y2^2 + ...y2000^2))
+            double dotProduct = 0;
+            double d1 = 0;
+            double d2 = 0;
+            for (int i = 0; i < posXray.GetChannelsNum(); i++)
+            {
+                double r1 = pXrayData[i];
+                double r2 = pXrayData1[i];
+                r1 *= r2;
+                dotProduct = dotProduct + r1;
+
+            }
+            d1 = posXray.GetXrayDataVectorNorm();
+            d2 = posXray1.GetXrayDataVectorNorm();
+            return (0 == d1 || 0 == d2) ? 0 : dotProduct / (d1 * d2);
+
+        }
+
+        private void ListOfSimilarParticles_Load(object sender, EventArgs e)
+        {
+            btn_Search_Click(null, null);
+        }
+
+        private void btn_OK_Click(object sender, EventArgs e)
+        {
+            List<KeyValuePair<string, SQLiteParameter[]>> cmdlist = new List<KeyValuePair<string, SQLiteParameter[]>>();
+            foreach (DataGridViewRow row in dgV_SimilarParticles.Rows)
+            {
+                if (row.Cells["IsSelected"].Value != null && (bool)row.Cells["IsSelected"].Value)
+                {
+                    row.Cells[1].Value = _RenameInfo[0];
+                    Bitmap ls_bp = (Bitmap)row.Cells[3].Value;
+                    List<string> list_str = (List<string>)ls_bp.Tag;
+                    int i_ls_fieldid = Convert.ToInt32(list_str[0]);
+                    int i_ls_particleid = Convert.ToInt32(list_str[1]);
+                    List<int> ints = new List<int>();
+                    ints.Add(i_ls_fieldid);
+                    ints.Add(i_ls_particleid);
+
+                    var cmd = _particlesGridDevidePage.Particledata.GetUpdataAIncACmd(ints, _RenameInfo);
+                    cmdlist.Add(cmd);
+                }
+            }
+            _particlesGridDevidePage.Particledata.ExecuteNonQueryBatch(cmdlist);
+            this.DialogResult = DialogResult.OK;
+            this.Close();
+        }
+
+        private void dgV_SimilarParticles_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
+        {
+            var SelectRows = dgV_SimilarParticles.SelectedRows;
+            if (SelectRows.Count != 0)
+            {
+                if (SelectRows.Count == 1)
+                {
+                    DataGridViewRow dgvr = SelectRows[0];
+
+                    if ((bool)dgvr.Cells[0].EditedFormattedValue == true)
+                    {
+                        dgvr.Cells[0].Value = false;
+                    }
+                    else
+                    {
+                        dgvr.Cells[0].Value = true;
+                    }
+                    dgV_SimilarParticles.Rows[0].Cells[0].Value = true;
+                }
+            }
+        }
+
+        private void cBx_All_CheckedChanged(object sender, EventArgs e)
+        {
+            CheckBox selectAllCheckBox = (CheckBox)sender;
+
+            foreach (DataGridViewRow row in dgV_SimilarParticles.Rows)
+            {
+                DataGridViewCheckBoxCell checkBox = row.Cells["IsSelected"] as DataGridViewCheckBoxCell;
+                checkBox.Value = selectAllCheckBox.Checked;
+            }
+            dgV_SimilarParticles.Rows[0].Cells[0].Value = true;
+        }
+
+        DataTable ObtainSourceOfSimilarParticles(int _classifyid)
+        {
+            if (_classifyid == -1)
+            {
+                return _particlesGridDevidePage.Particledata.GetInfoForPartucleDevidePage_InvalidParticle("");
+            }
+            else if (_classifyid == 9)
+            {
+                return _particlesGridDevidePage.Particledata.GetInfoForPartucleDevidePage_NotIdentifyParticle("");
+            }
+            else if (_classifyid != 4)
+            {
+                return _particlesGridDevidePage.Particledata.GetInfoForPartucleDevidePage_analyticalParticle("");
+            }
+            return null;
+        }
+
+        private void btn_Cannnel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+            this.Close();
+        }
+
+        private void dgV_SimilarParticles_MouseUp(object sender, MouseEventArgs e)
+        {
+            var SelectRows = dgV_SimilarParticles.SelectedRows;
+            if (SelectRows.Count != 0)
+            {
+                if (SelectRows.Count == 1)
+                {
+                    DataGridViewRow dgvr = SelectRows[0];
+                    Bitmap ls_bp = (Bitmap)dgvr.Cells[3].Value;
+                    List<string> list_str = (List<string>)ls_bp.Tag;
+                    uint[] Search_xray = new uint[2000];
+                    uint[] Analysis_xray = new uint[2000];
+                    int i_xray_id = 0;
+                    List<Element> list_celementchemistryclr = new List<Element>();
+                    _particlesGridDevidePage.ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+
+                    List<OTSIncAReportGraph.Controls.ShowElementInfo> list_showelementinfo = new List<OTSIncAReportGraph.Controls.ShowElementInfo>();
+                    for (int i = 0; i < list_celementchemistryclr.Count; i++)
+                    {
+                        OTSIncAReportGraph.Controls.ShowElementInfo ls_sei = new OTSIncAReportGraph.Controls.ShowElementInfo();
+                        ls_sei.ElementName = list_celementchemistryclr[i].Name;
+                        ls_sei.Percentage = list_celementchemistryclr[i].Percentage;
+                        ls_sei.dKF = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).K_Peak);
+                        double de_sx2 = 0;
+                        if (CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak == "" || CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak == "-")
+                        {
+                            de_sx2 = 0;
+                        }
+                        else
+                        {
+                            de_sx2 = Convert.ToDouble(CListPeriodic.GetPeriodicByEleName(ls_sei.ElementName).L_Peak);
+                        }
+                        ls_sei.dLF = de_sx2;
+                        list_showelementinfo.Add(ls_sei);
+                    }
+
+
+                    list_showelementinfo.Sort((p1, p2) => p2.Percentage.CompareTo(p1.Percentage));
+                    string str_IncAName = "";
+                    str_IncAName = Convert.ToString(dgvr.Cells[2].Value);
+                    Particle particle = _particlesGridDevidePage.result.List_OTSField.Find(x => x.FieldID == Convert.ToInt32(dgvr.Cells["fieldid"].Value)).ParticleList.Find(x => x.ParticleId == Convert.ToInt32(dgvr.Cells["particleId"].Value));
+                    if (particle == null)
+                    {
+                        return;
+                    }
+                    control_XRayTable1.SetParticleInfo("Area:" + Math.Round(particle.Area, 2) + "  " + "DMAX:" + Math.Round(particle.DMAX, 2) + "  " + "DELONG:" + Math.Round(particle.DELONG, 2) + "  " + "DFERET:" + Math.Round(particle.DFERET, 2) + "  " + "DINSCR:" + Math.Round(particle.DINSCR, 2) + "\n" + "DMEAN:" + Math.Round(particle.DMEAN, 2) + "  " + "DMIN:" + Math.Round(particle.DMIN, 2) + "  " + "DPERP:" + Math.Round(particle.DPERP, 2) + "  " + "ORIENTATION:" + Math.Round(particle.ORIENTATION, 2) + "  " + "PERIMETER:" + Math.Round(particle.PERIMETER, 2));
+
+                    control_XRayTable1.Visible = true;
+                    control_XRayTable1.SetXRayShowLineValue(null, Analysis_xray, list_showelementinfo);
+                    //颗粒国标信息
+                    control_XRayTable1.GBInfoStr = "";
+                    control_XRayTable1.MaterialName = str_IncAName;//杂夹物
+
+                    control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
+
+                    string str = " particleId= " + dgvr.Cells["particleId"].Value.ToString() + " and fieldid = " + dgvr.Cells["fieldid"].Value.ToString();
+                    DataRow[] drs = particles.Select(str);
+                    if (drs.Length > 0)
+                    {
+                        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particle.RectLeft), Y = Convert.ToInt32(particle.RectTop), Width = Convert.ToInt32(particle.RectWidth), Height = Convert.ToInt32(particle.RectHeight) };
+                        Bitmap dpImage = new Bitmap(_particlesGridDevidePage.result.GetImageWidth(), _particlesGridDevidePage.result.GetImageHeight());
+                        using (Graphics graphics = Graphics.FromImage(dpImage))
+                        {
+                            graphics.Clear(Color.White); // 清除位图背景为白色
+                        }
+                        string filePath = _particlesGridDevidePage.result.FilePath + "\\FIELD_FILES\\";
+                        string imagePath = filePath + "Field" + dgvr.Cells["fieldid"].Value.ToString() + ".bmp";
+                        Bitmap m_originalImage = DrawFunction.ReadImageFile(imagePath);
+
+                        foreach (Segment seg in particle.SegmentList)
+                        {
+                            int f_length = seg.Length;
+                            for (int m = 0; m < f_length; m++)
+                            {
+                                int lsjs_x = seg.Start + m;
+                                int lsjs_y = seg.Height;
+                                var pixelColor = m_originalImage.GetPixel(lsjs_x, lsjs_y);
+                                dpImage.SetPixel(lsjs_x, lsjs_y, Color.Black);
+                            }
+                        }
+                        Bitmap bmap = _particlesGridDevidePage.Particledata.GetBitmapByParticle(dpImage, rectangle);
+                        Bitmap bmap1 = _particlesGridDevidePage.Particledata.GetBitmapByParticle(m_originalImage, rectangle);
+                        control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
+                        Invalidate();
+                    }
+                    else
+                    {
+                        control_XRayTable1.Visible = false;
+                    }
+                }
+            }
+        }
+
+        private void movetoparticleToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            //先获取鼠标所选择的行里的颗粒的FieldID和ParticleID
+            string i_ls_fieldid = "";
+            string i_ls_particleid = "";
+            int cou = dgV_SimilarParticles.SelectedRows.Count;
+            if (cou > 0)
+            {
+                DataGridViewRow dgvr = dgV_SimilarParticles.SelectedRows[cou - 1];
+                Bitmap ls_bp = (Bitmap)dgvr.Cells[3].Value;
+                List<string> list_str = (List<string>)ls_bp.Tag;
+                if (list_str != null)
+                {
+                    i_ls_fieldid = list_str[0];
+                    i_ls_particleid = list_str[1];
+                }
+            }
+            DataOperation.DataAccess.ParticleData particleData = new DataOperation.DataAccess.ParticleData(_particlesGridDevidePage.result.FilePath);
+            Particle particle = particleData.GetParticleByFidAndPid(i_ls_fieldid, i_ls_particleid);
+            //取得Field的Position,然后执行线程移动SEM到当前Field的位置
+            if (m_mythread == null)
+            {
+                return;
+            }
+
+            if (m_mythread.ThreadState == ThreadState.Running || m_mythread.ThreadState == ThreadState.WaitSleepJoin)
+            {
+                return;
+            }
+
+            if (m_mythread.ThreadState == ThreadState.Stopped)
+            {
+                m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
+            }
+            Point point = OTSIncAReportGrids.ParticlesGridDevidePage.CalculateParticleCenterPosition(_particlesGridDevidePage.result, new Point(particle.SEMPosX, particle.SEMPosY), new Point(particle.PosX, particle.PosY));
+            //改为线程调用,先判断线程状态
+            m_mythread.Start(point);
+        }
+
+        #region 连接电镜相关
+        /// <summary>
+        /// 移动SEM到指定位置线程函数
+        /// </summary>
+        private void Thread_GO(object in_obj)
+        {
+            if (m_mythread_state == false)
+            {
+                m_mythread_state = true;
+
+                Point sem_point = (Point)in_obj;
+
+                //第一步,连接电镜
+                m_OTSIncAReportGridsFun.Connection_ForParticlesGrid();
+
+                Thread.Sleep(500);
+
+                //第二步,移动到指定位置,先读取再设置
+                if (m_OTSIncAReportGridsFun.m_SEMConnectionState == true)
+                {
+                    m_OTSIncAReportGridsFun.MoveSemToPointXY_ForParticlesGrid(sem_point.X, sem_point.Y);
+
+                }
+
+                Thread.Sleep(1500);
+
+                m_mythread_state = false;
+            }
+
+        }
+        #endregion
+
+        private void dgV_SimilarParticles_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.KeyData == Keys.Down)
+            {
+                dgV_SimilarParticles_MouseUp(null, null);
+            }
+            if (e.KeyData == Keys.Up)
+            {
+                dgV_SimilarParticles_MouseUp(null, null);
+            }
+            if (e.KeyData == Keys.Space)
+            {
+                dgV_SimilarParticles_CellMouseClick(null,null);
+            }
+        }
+
+        private void tB_SimilarRatio_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.KeyData == Keys.Enter)
+            {
+                btn_Search_Click(null, null);
+            }
+        }
+    }
+}

+ 123 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.resx

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

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.Designer.cs

@@ -527,7 +527,7 @@ namespace OTSIncAReportGrids
             this.EXCELToolStripMenuItem,
             this.ToolStripMenuItemDelete_Particle});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(211, 208);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(211, 230);
             // 
             // ToolStripMenuItem1
             // 

+ 96 - 58
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -34,7 +34,6 @@ namespace OTSIncAReportGrids
     public partial class ParticlesGridDevidePage : UserControl
     {
         ParticlesGridDevidePageShowConfig m_particlesGridDevidePageShowConfig = null;
-
         //设置模拟数据表
         public DataTable m_dt = new DataTable();
 
@@ -60,7 +59,7 @@ namespace OTSIncAReportGrids
         public int m_oneresult_columncount = 0;
 
         OTSImageDisHelp m_ReportFun = null;
-        private OTSImageDisHelp ReportFun { get => m_ReportFun; set => m_ReportFun = value; }
+        public OTSImageDisHelp ReportFun { get => m_ReportFun; set => m_ReportFun = value; }
         /// <summary>
         /// 选择颗粒缓存表
         /// </summary>
@@ -71,14 +70,14 @@ namespace OTSIncAReportGrids
 
         //国际化
         Language lan;
-        Hashtable table;
+        public Hashtable table;
         //测量结果
-        ResultFile result = null;
+        public ResultFile result = null;
         frmReportConditionChoose m_condition;
         FieldData fieldData;
         DataTable particlesAll;
         DataTable particles;
-        ParticleData Particledata;
+        public ParticleData Particledata;
         UserLibraryData userLibrary;
         DataTable userLibraryData;
         NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
@@ -90,7 +89,7 @@ namespace OTSIncAReportGrids
             MergeParticles = 2,
             allParticles = 3
         }
-
+        //ListOfSimilarParticles Form_listOfSimilarParticles;
         #region 分页器相关
 
         #region 分页字段和属性
@@ -238,7 +237,7 @@ namespace OTSIncAReportGrids
                     }
                 }
                 //初始化底层操作类
-                m_OTSIncAReportGridsFun = new OTSReportGridsFun(m_ReportApp, this);
+                m_OTSIncAReportGridsFun = new OTSReportGridsFun();
                 return true;
             }
             catch (Exception ex)
@@ -310,7 +309,7 @@ namespace OTSIncAReportGrids
                 {
                     RemoveMergeParticles(ref particlesAll, mergeParticles);
                 }
-            }
+            }                                                                                                                        
             if (sel == (int)SelItem.MergeParticles)
             {
                 particlesAll = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
@@ -783,6 +782,7 @@ namespace OTSIncAReportGrids
 
             //设置序号列不排序
             dgV_ParticlesDevidePage.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
+            dgV_ParticlesDevidePage.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
 
             //设置序号列不可以设置宽度
             dgV_ParticlesDevidePage.Columns[0].Resizable = DataGridViewTriState.False;
@@ -1645,23 +1645,96 @@ namespace OTSIncAReportGrids
                 strings.Add(TypeName);
                 strings.Add(TypeColor);
                 strings.Add(GroupName);
-                List<KeyValuePair<string, SQLiteParameter[]>> cmdlist = new List<KeyValuePair<string, SQLiteParameter[]>>();
-                for (int i = 0; i < dgV_ParticlesDevidePage.SelectedRows.Count; i++)
+                DialogResult result2 = MessageBox.Show("是否寻找相似颗粒并重命名?", "Tip", MessageBoxButtons.YesNo);
+                if (result2 == DialogResult.Yes)
                 {
-                    DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[i];
-                    dgvr.Cells[1].Value = TypeName;
-                    Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
-                    List<string> list_str = (List<string>)ls_bp.Tag;
-                    int i_ls_fieldid = Convert.ToInt32(list_str[0]);
-                    int i_ls_particleid = Convert.ToInt32(list_str[1]);
-                    List<int> ints = new List<int>();
-                    ints.Add(i_ls_fieldid);
-                    ints.Add(i_ls_particleid);
+                    int sel = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
+                    if (sel == (int)SelItem.MergeParticles)
+                    {
+                        return;
+                    }
+                    var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
+                    uint[] Search_xray = new uint[2000];
+                    int classifyid = -1;
+                    if (SelectRows.Count != 0)
+                    {
+                        if (SelectRows.Count == 1)
+                        {
+                            DataGridViewRow dgvr = SelectRows[0];
+                            Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                            List<string> list_str = (List<string>)ls_bp.Tag;
+                            classifyid = Convert.ToInt32(list_str[2]);
+                            uint[] Analysis_xray = new uint[2000];
+                            int i_xray_id = 0;
+                            List<Element> list_celementchemistryclr = new List<Element>();
+                            ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
+                        }
+                    }
+                    ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, classifyid,strings);
+                    DialogResult result3=Form_listOfSimilarParticles.ShowDialog();
+                    if(result3== DialogResult.OK)
+                    {
+                        UpdateTable();
+                        lnkFirst_Click(null, null);
+                        SetDataGridViewStyle();
+                        DataTable table = Particledata.GetClassificationOfAllParticles();
+                        if (table != null)
+                        {
+                            if (table.Rows.Count > 0)
+                            {
+                                foreach (DataRow row in table.Rows)
+                                {
+                                    tbx_Type.Text += row["TypeName"].ToString() + '$';
+                                }
+                            }
+                            if (tbx_Type.Text != "")
+                            {
+                                tbx_Type.Text = tbx_Type.Text.Remove(tbx_Type.Text.Length - 1);
+                            }
+                        }
+                        dgV_ParticlesDevidePage.Focus();
+                    }
+                    else
+                    {
+                        List<KeyValuePair<string, SQLiteParameter[]>> cmdlist = new List<KeyValuePair<string, SQLiteParameter[]>>();
+                        for (int i = 0; i < dgV_ParticlesDevidePage.SelectedRows.Count; i++)
+                        {
+                            DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[i];
+                            dgvr.Cells[1].Value = TypeName;
+                            Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                            List<string> list_str = (List<string>)ls_bp.Tag;
+                            int i_ls_fieldid = Convert.ToInt32(list_str[0]);
+                            int i_ls_particleid = Convert.ToInt32(list_str[1]);
+                            List<int> ints = new List<int>();
+                            ints.Add(i_ls_fieldid);
+                            ints.Add(i_ls_particleid);
+
+                            var cmd = Particledata.GetUpdataAIncACmd(ints, strings);
+                            cmdlist.Add(cmd);
+                        }
+                        Particledata.ExecuteNonQueryBatch(cmdlist);
+                    }
+                }
+                else
+                {
+                    List<KeyValuePair<string, SQLiteParameter[]>> cmdlist = new List<KeyValuePair<string, SQLiteParameter[]>>();
+                    for (int i = 0; i < dgV_ParticlesDevidePage.SelectedRows.Count; i++)
+                    {
+                        DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[i];
+                        dgvr.Cells[1].Value = TypeName;
+                        Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                        List<string> list_str = (List<string>)ls_bp.Tag;
+                        int i_ls_fieldid = Convert.ToInt32(list_str[0]);
+                        int i_ls_particleid = Convert.ToInt32(list_str[1]);
+                        List<int> ints = new List<int>();
+                        ints.Add(i_ls_fieldid);
+                        ints.Add(i_ls_particleid);
 
-                    var cmd = Particledata.GetUpdataAIncACmd(ints, strings);
-                    cmdlist.Add(cmd);
+                        var cmd = Particledata.GetUpdataAIncACmd(ints, strings);
+                        cmdlist.Add(cmd);
+                    }
+                    Particledata.ExecuteNonQueryBatch(cmdlist);
                 }
-                Particledata.ExecuteNonQueryBatch(cmdlist);
             }
         }
         void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, int rowid)
@@ -2138,7 +2211,7 @@ namespace OTSIncAReportGrids
         /// </summary>
         /// <param name="dataTable_Particle"></param>
         /// <param name="dataTable_MergeParticles"></param>
-        void RemoveMergeParticles(ref DataTable dataTable_Particle, DataTable dataTable_MergeParticles)
+        public void RemoveMergeParticles(ref DataTable dataTable_Particle, DataTable dataTable_MergeParticles)
         {
             foreach (DataRow row in dataTable_Particle.Rows)
             {
@@ -2343,7 +2416,6 @@ namespace OTSIncAReportGrids
                 ToolStripMenuItem_Delete_Particle_Click(null, null);
             }
         }
-
         private void dgV_ParticlesDevidePage_KeyUp(object sender, KeyEventArgs e)
         {
             if (e.KeyData == Keys.Down)
@@ -2355,7 +2427,6 @@ namespace OTSIncAReportGrids
                 dgV_ParticlesDevidePage_MouseUp(null, null);
             }
         }
-
         private void tbx_Type_Click(object sender, EventArgs e)
         {
             ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(Particledata, tbx_Type.Text);
@@ -2390,9 +2461,6 @@ namespace OTSIncAReportGrids
             }
 
         }
-
-
-
         private void btn_particletypesel_Click(object sender, EventArgs e)
         {
             ParticleClassificationSelect particleClassificationSelect = new ParticleClassificationSelect(Particledata, tbx_Type.Text);
@@ -2408,36 +2476,6 @@ namespace OTSIncAReportGrids
                 }
             }
         }
-         private  double GetCosValue(CPosXrayClr posXray, CPosXrayClr posXray1)
-        {
-            if (posXray == null) return 0;
-            if (posXray1 == null) return 0;
-            if (posXray.GetChannelsNum() != posXray1.GetChannelsNum())
-            {
-                return 0;
-            }
-
-            var pXrayData = posXray.GetXrayData();
-            var pXrayData1 = posXray1.GetXrayData();
-
-
-            // 公式: (x1y1+x2y2+x3y3+...x2000y2000) / (sqrt(x1^2 + x2^2 + ...x2000^2) * sqrt(y1^2 + y2^2 + ...y2000^2))
-            double dotProduct = 0;
-            double d1 = 0;
-            double d2 = 0;
-            for (int i = 0; i < posXray.GetChannelsNum(); i++)
-            {
-                double r1 = pXrayData[i];
-                double r2 = pXrayData1[i];
-                r1 *= r2;
-                dotProduct = dotProduct + r1;
-
-            }
-            d1 = posXray.GetXrayDataVectorNorm();
-            d2 = posXray1.GetXrayDataVectorNorm();
-            return (0 == d1 || 0 == d2) ? 0 : dotProduct / (d1 * d2);
-
-        }
     }
 }
 

+ 1 - 1
OTSIncAReportApp/1-UI/frmReMeasure.cs

@@ -110,7 +110,7 @@ namespace OTSIncAReportApp
 
             this.m_ReportApp = m_ReportApp;
             //初始化底层操作类
-            this.m_OTSIncAReportGridsFun = new OTSReportGridsFun(m_ReportApp);
+            this.m_OTSIncAReportGridsFun = new OTSReportGridsFun();
             this.SelectedParticles = m_ReportApp.GetSelectedParticles();
             this.ReportFun = ReportFun;
 

+ 16 - 0
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -644,6 +644,22 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
+        public DataTable GetInfoForPartucleDevidePage_NotIdentifyParticle(string condition)
+        {
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where typeid =9 " +
+                condition;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+        public DataTable GetInfoForPartucleDevidePage_InvalidParticle(string condition)
+        {
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where typeid =-1 " +
+                condition;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
         public DataTable GetClassificationOfAllParticles()
         {
             string sqliteString1 = "select distinct TypeName from INcAData";

+ 9 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -539,6 +539,12 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="1-UI\Control_Graph\Controls\ImageSplicer.cs" />
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ListOfSimilarParticles.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ListOfSimilarParticles.Designer.cs">
+      <DependentUpon>ListOfSimilarParticles.cs</DependentUpon>
+    </Compile>
     <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage\ModifyCategoryForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -944,6 +950,9 @@
     <Compile Include="1-UI\OTSMgrInfo\frmReportSysConfig.Designer.cs">
       <DependentUpon>frmReportSysConfig.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="1-UI\Control_Grids\ParticlesGridDevidePage\ListOfSimilarParticles.resx">
+      <DependentUpon>ListOfSimilarParticles.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\Control_Grids\ParticlesGridDevidePage\ModifyCategoryForm.resx">
       <DependentUpon>ModifyCategoryForm.cs</DependentUpon>
     </EmbeddedResource>