Browse Source

提交 溯源 初版

cxs 3 years ago
parent
commit
0b9b19746c

+ 58 - 0
Bin/x64/Debug/Resources/XMLData/AppResource_EN.xml

@@ -1602,4 +1602,62 @@
 	  <Control name="button1" text="determine" />
     </Controls>
  </Form>
+ <Form>
+    <Name>ParticlesGridDevidePage</Name>
+    <Controls>
+      <Control name="ToolStripMenuItem1" text="Copy the entire table" />
+	  <Control name="ToolStripMenuItem2" text="Replication Selection Area" />
+	  <Control name="toolStripMenuItem4" text="Copy the entire list image that is currently displayed" />
+	  <Control name="ToolStripMenuItem3" text="Restore to the initial state" />
+	  <Control name="ToolStripMenuItem5" text="Move SEM to the Particle Horizon Position" />
+	  <Control name="ToolStripMenuItem_selectparticle" text="Selected granules" />
+	  <Control name="ToolStripMenuItem_exportimagefile" text="Export image file" />
+	  <Control name="ToolStripMenuItem_exportzoomimagefile" text="Export enlarged image file" />
+	  <Control name="label_Condition" text="Condition query:" />
+	  <Control name="label_Area" text="Area(μm²)" />
+	  <Control name="label_Dmax" text="Dmax(μm)" />
+	  <Control name="label_ParticleName" text="ParticleName" />
+	  <Control name="btn_Sel" text="Sel" />
+	  <Control name="label_order" text="Sort by:" />
+	  <Control name="label1" text="common" />
+	  <Control name="label4" text="Records per page" />
+	  <Control name="label2" text="Article of" />
+	  <Control name="label6" text="page" />
+	  <Control name="str1" text="Selected particles" />
+	  <Control name="str2" text="Selected" />
+	  <Control name="str3" text="Please switch to the analysis chart!" />
+	  <Control name="str4" text="No" />
+	  <Control name="str5" text="Image" />
+	  <Control name="str6" text="Name" />
+	  <Control name="str7" text="Start loading granular list information" />
+	  <Control name="str8" text="Particle list, loaded" />
+	  <Control name="str9" text="Export completed, image total" />
+	  <Control name="str10" text="The type of input is error!" />
+	  <Control name="str11" text="Please pay attention to the corresponding size relationship of the input value! "/>
+	  <Control name="str12" text="Load the granular list and start creating table structured Columns" />
+	  <Control name="str15" text="Loading particle list, getting" />
+	  <Control name="str18" text="Value" />
+	  <Control name="partcletype0" text="SMALL" />
+	  <Control name="partcletype1" text="OVERSIZE" />
+	  <Control name="partcletype2" text="AVE_GRAY_NOT_INRANRE" />
+	  <Control name="partcletype4" text="LOW_COUNT" />
+	  <Control name="partcletype6" text="NO_ANALYSIS_X_RAY" />
+      <Control name="partcletype7" text="NOT_IDENTIFIED_SIC" />
+	  <Control name="partcletype8" text="NOT_IDENTIFIED_FEO" />
+	  <Control name="partcletype9" text="NOT_IDENTIFIED" />
+	  <Control name="str21" text="Areaμm²" />
+	  <Control name="str22" text="Equivalent circle diameterμm" />
+	  <Control name="str23" text="Longest diameterμm" />
+	  <Control name="str24" text="Minimum diameterμm" />
+      <Control name="str25" text="Long short diameter ratio" />
+	  <Control name="str26" text="Ferret diameterμm" />
+	  <Control name="str27" text="Orthogonal diameterμm" />
+	  <Control name="str28" text="Perimeterμm" />
+	  <Control name="str29" text="Inscribed circle diameterμm" />
+	  <Control name="str30" text="Average diameter of inscribed circleμm!" />
+	  <Control name="str31" text="Expansion lengthμm" />
+	  <Control name="str32" text="Expanded aspect ratio" />
+	  <Control name="str33" text="Orientation angle °" />
+	</Controls>
+ </Form>
 </Resource>

+ 45 - 0
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1665,4 +1665,49 @@
 	  <Control name="str17" text="最大" />
     </Controls>
  </Form>
+ <Form>
+    <Name>InclusionsTraceability</Name>
+    <Controls>
+	  <Control name="ToolStripMenuItem1" text="复制整个表" />
+	  <Control name="ToolStripMenuItem2" text="复制选择区域" />
+	  <Control name="toolStripMenuItem4" text="复制当前显示列表图像" />
+	  <Control name="ToolStripMenuItem3" text="恢复至初始状态" />
+	  <Control name="ToolStripMenuItem5" text="移动SEM到颗粒视域位置" />
+	  <Control name="ToolStripMenuItem_selectparticle" text="选择颗粒" />
+	  <Control name="ToolStripMenuItem_exportimagefile" text="导出图像文件" />
+	  <Control name="ToolStripMenuItem_exportzoomimagefile" text="导出放大图像文件" />
+	  <Control name="label_Condition" text="条件查询:" />
+	  <Control name="label_Area" text="面积(μm²)" />
+	  <Control name="label_Dmax" text="Dmax(μm)" />
+	  <Control name="label_ParticleName" text="颗粒名称" />
+	  <Control name="btn_Sel" text="查询" />
+	  <Control name="str1" text="选择颗粒" />
+	  <Control name="str2" text="已选定" />
+	  <Control name="str3" text="颗颗粒,请切换到分析图查看!" />
+	  <Control name="str4" text="序号" />
+	  <Control name="str5" text="颗粒图像" />
+	  <Control name="str6" text="颗粒名" />
+	  <Control name="str7" text="开始加载颗粒列表信息" />
+	  <Control name="str8" text="颗粒列表,已完成加载" />
+	  <Control name="str9" text="导出完成,图像共" />
+	  <Control name="str10" text="输入类型错误!" />
+	  <Control name="str11" text="请注意输入数值的对应大小关系!"/>
+	  <Control name="str12" text="加载粒度列表并开始创建表结构列" />
+	  <Control name="str15" text="正在加载颗粒列表,正在获取" />
+	  <Control name="str21" text="面积μm²" />
+	  <Control name="str22" text="等效圆直径μm" />
+	  <Control name="str23" text="最长卡规直径μm" />
+	  <Control name="str24" text="最短卡规直径μm" />
+      <Control name="str25" text="长短直径比" />
+	  <Control name="str26" text="费雷特直径μm" />
+	  <Control name="str27" text="正交直径μm" />
+	  <Control name="str28" text="周长μm" />
+	  <Control name="str29" text="内接圆直径μm" />
+	  <Control name="str30" text="内接圆平均直径μm" />
+	  <Control name="str31" text="展开长度μm" />
+	  <Control name="str32" text="展开长宽比" />
+	  <Control name="str33" text="朝向角度°" />
+	  <Control name="str34" text="外来夹杂物类型" />
+    </Controls>
+ </Form>
 </Resource>

+ 0 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/BSEPicData/COTSFieldData.cs

@@ -464,7 +464,6 @@ namespace OTSModelSharp
             {
                 slo.Serialize(false, classDoc, rootNode);
                 m_otsPos = xPos.value();
-                
             }
         }
     }

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

@@ -73,7 +73,6 @@
             this.ImportSTDDb = new System.Windows.Forms.ToolStripMenuItem();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.dgV_ParticlesDevidePage = new System.Windows.Forms.DataGridView();
-            this.bn_InclusionsTraceability = new System.Windows.Forms.Button();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             this.contextMenuStrip1.SuspendLayout();
@@ -83,7 +82,6 @@
             // 
             // panel2
             // 
-            this.panel2.Controls.Add(this.bn_InclusionsTraceability);
             this.panel2.Controls.Add(this.label_Condition);
             this.panel2.Controls.Add(this.tbx_Type);
             this.panel2.Controls.Add(this.btn_ReMeasure);
@@ -124,7 +122,7 @@
             // 
             // btn_ReMeasure
             // 
-            this.btn_ReMeasure.Location = new System.Drawing.Point(676, 10);
+            this.btn_ReMeasure.Location = new System.Drawing.Point(595, 9);
             this.btn_ReMeasure.Name = "btn_ReMeasure";
             this.btn_ReMeasure.Size = new System.Drawing.Size(80, 23);
             this.btn_ReMeasure.TabIndex = 33;
@@ -524,16 +522,6 @@
             this.dgV_ParticlesDevidePage.TabIndex = 5;
             this.dgV_ParticlesDevidePage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseDown);
             // 
-            // bn_InclusionsTraceability
-            // 
-            this.bn_InclusionsTraceability.Location = new System.Drawing.Point(595, 10);
-            this.bn_InclusionsTraceability.Name = "bn_InclusionsTraceability";
-            this.bn_InclusionsTraceability.Size = new System.Drawing.Size(75, 23);
-            this.bn_InclusionsTraceability.TabIndex = 36;
-            this.bn_InclusionsTraceability.Text = "夹杂物溯源";
-            this.bn_InclusionsTraceability.UseVisualStyleBackColor = true;
-            this.bn_InclusionsTraceability.Click += new System.EventHandler(this.bn_InclusionsTraceability_Click);
-            // 
             // ParticlesGridDevidePage
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -598,6 +586,5 @@
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItemDelete_Particle;
         private System.Windows.Forms.Button btn_ReMeasure;
         private System.Windows.Forms.ToolStripMenuItem ImportSTDDb;
-        private System.Windows.Forms.Button bn_InclusionsTraceability;
     }
 }

+ 0 - 13
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -2459,19 +2459,6 @@ namespace OTSIncAReportGrids
                 }
             }
         }
-
-        private void bn_InclusionsTraceability_Click(object sender, EventArgs e)
-        {
-            try
-            {
-                System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSInclusionsTraceability.exe", resultFile.FilePath);
-                p.WaitForExit();
-            }
-            catch (Exception ex)
-            {
-                log.Error("InclusionsTraceability :" + ex.ToString());
-            }
-        }
     }
 }
 

+ 4 - 0
OTSIncAReportApp/1-UI/OTSRibbon/OTSRibbonFun.cs

@@ -29,6 +29,7 @@ namespace OTSIncAReportApp.OTSRibbon
             m_ReportApp.dpbOpen.Enabled = true;         //打开,下拉菜单中
             m_ReportApp.dpbExport.Enabled = bRibState;  //输出,下拉菜单中
             m_ReportApp.Backup.Enabled = bRibState;//备份数据库,下拉菜单
+            m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = bRibState;  //输出,下拉菜单中
 
             //Ribbon菜单中
             m_ReportApp.rbOpen.Enabled = true;                  //打开,ribbon中
@@ -59,6 +60,7 @@ namespace OTSIncAReportApp.OTSRibbon
                 m_ReportApp.dpbOpen.Enabled = true;
                 m_ReportApp.dpbExport.Enabled = true;
                 m_ReportApp.Backup.Enabled = true;
+                m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
 
                 //主菜单文件框里(保存、另存为、输出、新建)设置
                 m_ReportApp.rbSave.Enabled = true;
@@ -80,6 +82,7 @@ namespace OTSIncAReportApp.OTSRibbon
                 m_ReportApp.dpbOpen.Enabled = true;
                 m_ReportApp.dpbExport.Enabled = true;
                 m_ReportApp.Backup.Enabled = true;
+                m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
 
                 //主菜单文件框里(保存、另存为、输出、新建)设置
                 m_ReportApp.rbSave.Enabled = true;
@@ -101,6 +104,7 @@ namespace OTSIncAReportApp.OTSRibbon
                 m_ReportApp.dpbOpen.Enabled = true;
                 m_ReportApp.dpbExport.Enabled = true;
                 m_ReportApp.Backup.Enabled = true;
+                m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
 
                 //主菜单文件框里(保存、另存为、输出、新建)设置
                 m_ReportApp.rbSave.Enabled = true;

+ 42 - 24
OTSIncAReportApp/1-UI/frmReportApp.Designer.cs

@@ -56,6 +56,7 @@
             this.dpbOpen = new System.Windows.Forms.RibbonOrbMenuItem();
             this.dpbExport = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbonOrbMenuItem_Extremum = new System.Windows.Forms.RibbonOrbMenuItem();
+            this.ribbonOrbMenuItem_InclusionsTraceability = new System.Windows.Forms.RibbonOrbMenuItem();
             this.Backup = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbonOrbOptionButton1 = new System.Windows.Forms.RibbonOrbOptionButton();
             this.ribbonOrbRecentItem1 = new System.Windows.Forms.RibbonOrbRecentItem();
@@ -69,13 +70,13 @@
             this.rbCircular = new System.Windows.Forms.RibbonButton();
             this.rbRectangle = new System.Windows.Forms.RibbonButton();
             this.rbCancel = new System.Windows.Forms.RibbonButton();
+            this.ribbonPanelOthers = new System.Windows.Forms.RibbonPanel();
+            this.rbHelp = new System.Windows.Forms.RibbonButton();
             this.rbMenu = new System.Windows.Forms.RibbonTab();
             this.ribbonPanel2 = new System.Windows.Forms.RibbonPanel();
             this.rbFrame = new System.Windows.Forms.RibbonButton();
             this.rbStaff = new System.Windows.Forms.RibbonButton();
             this.rbRenew = new System.Windows.Forms.RibbonButton();
-            this.ribbonPanelOthers = new System.Windows.Forms.RibbonPanel();
-            this.rbHelp = new System.Windows.Forms.RibbonButton();
             this.rbGB1 = new System.Windows.Forms.RibbonButton();
             this.rbGB2 = new System.Windows.Forms.RibbonButton();
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();
@@ -196,11 +197,12 @@
             this.ribbon1.OrbDropDown.MenuItems.Add(this.dpbOpen);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.dpbExport);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbonOrbMenuItem_Extremum);
+            this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbonOrbMenuItem_InclusionsTraceability);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.Backup);
             this.ribbon1.OrbDropDown.Name = "";
             this.ribbon1.OrbDropDown.OptionItems.Add(this.ribbonOrbOptionButton1);
             this.ribbon1.OrbDropDown.RecentItems.Add(this.ribbonOrbRecentItem1);
-            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 248);
+            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 292);
             this.ribbon1.OrbDropDown.TabIndex = 0;
             this.ribbon1.OrbImage = global::OTSIncAReportApp.Properties.Resources.logo_40;
             // 
@@ -265,6 +267,21 @@
             this.ribbonOrbMenuItem_Extremum.ToolTipTitle = null;
             this.ribbonOrbMenuItem_Extremum.Click += new System.EventHandler(this.ribbonOrbMenuItem_Extremum_Click);
             // 
+            // ribbonOrbMenuItem_InclusionsTraceability
+            // 
+            this.ribbonOrbMenuItem_InclusionsTraceability.AltKey = null;
+            this.ribbonOrbMenuItem_InclusionsTraceability.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
+            this.ribbonOrbMenuItem_InclusionsTraceability.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.ribbonOrbMenuItem_InclusionsTraceability.Image = global::OTSIncAReportApp.Properties.Resources.sem16;
+            this.ribbonOrbMenuItem_InclusionsTraceability.SmallImage = global::OTSIncAReportApp.Properties.Resources.sem16;
+            this.ribbonOrbMenuItem_InclusionsTraceability.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.ribbonOrbMenuItem_InclusionsTraceability.Tag = null;
+            this.ribbonOrbMenuItem_InclusionsTraceability.Text = "外来夹杂物溯源";
+            this.ribbonOrbMenuItem_InclusionsTraceability.ToolTip = null;
+            this.ribbonOrbMenuItem_InclusionsTraceability.ToolTipImage = null;
+            this.ribbonOrbMenuItem_InclusionsTraceability.ToolTipTitle = null;
+            this.ribbonOrbMenuItem_InclusionsTraceability.Click += new System.EventHandler(this.ribbonOrbMenuItem_InclusionsTraceability_Click);
+            // 
             // Backup
             // 
             this.Backup.AltKey = null;
@@ -436,6 +453,27 @@
             this.rbCancel.ToolTipTitle = null;
             this.rbCancel.Click += new System.EventHandler(this.rbCancel_Click);
             // 
+            // ribbonPanelOthers
+            // 
+            this.ribbonPanelOthers.Items.Add(this.rbHelp);
+            this.ribbonPanelOthers.Tag = null;
+            this.ribbonPanelOthers.Text = "其它";
+            // 
+            // rbHelp
+            // 
+            this.rbHelp.AltKey = null;
+            this.rbHelp.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Down;
+            this.rbHelp.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.rbHelp.Image = global::OTSIncAReportApp.Properties.Resources.find32;
+            this.rbHelp.SmallImage = ((System.Drawing.Image)(resources.GetObject("rbHelp.SmallImage")));
+            this.rbHelp.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.rbHelp.Tag = "rbHelp";
+            this.rbHelp.Text = "帮助";
+            this.rbHelp.ToolTip = "rbHelp";
+            this.rbHelp.ToolTipImage = null;
+            this.rbHelp.ToolTipTitle = null;
+            this.rbHelp.Click += new System.EventHandler(this.rbHelp_Click);
+            // 
             // rbMenu
             // 
             this.rbMenu.Panels.Add(this.ribbonPanel2);
@@ -497,27 +535,6 @@
             this.rbRenew.ToolTipTitle = null;
             this.rbRenew.Click += new System.EventHandler(this.rbRenew_Click);
             // 
-            // ribbonPanelOthers
-            // 
-            this.ribbonPanelOthers.Items.Add(this.rbHelp);
-            this.ribbonPanelOthers.Tag = null;
-            this.ribbonPanelOthers.Text = "其它";
-            // 
-            // rbHelp
-            // 
-            this.rbHelp.AltKey = null;
-            this.rbHelp.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Down;
-            this.rbHelp.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.rbHelp.Image = global::OTSIncAReportApp.Properties.Resources.find32;
-            this.rbHelp.SmallImage = ((System.Drawing.Image)(resources.GetObject("rbHelp.SmallImage")));
-            this.rbHelp.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.rbHelp.Tag = "rbHelp";
-            this.rbHelp.Text = "帮助";
-            this.rbHelp.ToolTip = "rbHelp";
-            this.rbHelp.ToolTipImage = null;
-            this.rbHelp.ToolTipTitle = null;
-            this.rbHelp.Click += new System.EventHandler(this.rbHelp_Click);
-            // 
             // rbGB1
             // 
             this.rbGB1.AltKey = null;
@@ -744,6 +761,7 @@
         public System.Windows.Forms.RibbonButton rbHelp;
         private System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_Extremum;
         public System.Windows.Forms.RibbonOrbMenuItem Backup;
+        public System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_InclusionsTraceability;
     }
 }
 

+ 21 - 8
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -43,10 +43,6 @@ namespace OTSIncAReportApp
         public frmTables m_TablesWindow = null;                                //报表窗体
         public frmReportSysConfig m_ReportSysConfigForm;                        //配置参数窗体
 
-
-        ResultFile resultFile = null;
-        OTSImageDisHelp m_ReportFun = null;
-        public OTSImageDisHelp ReportFun { get => m_ReportFun; set => m_ReportFun = value; }
         #endregion //-----------------------------------------------------------------------------------------------
 
         #region 报告类结构相关------------------------------------------------------------------------------------
@@ -272,6 +268,7 @@ namespace OTSIncAReportApp
 
             dpbExport.Tag = "dpbExport";
             ribbonOrbOptionButton1.Tag = "ribbonOrbOptionButton1";
+            ribbonOrbMenuItem_InclusionsTraceability.Tag = "ribbonOrbMenuItem_InclusionsTraceability";
         }
 
         /// <summary>
@@ -1157,8 +1154,11 @@ namespace OTSIncAReportApp
 
         private void Backup_Click(object sender, EventArgs e)
         {
-            resultFile = m_rstDataMgr.CurResultFile;
-            ReportFun = new OTSImageDisHelp(resultFile);
+
+            //OTSImageDisHelp m_ReportFun = null;
+            //public OTSImageDisHelp ReportFun { get => m_ReportFun; set => m_ReportFun = value; }
+
+            var ReportFun = new OTSImageDisHelp(m_rstDataMgr.CurResultFile);
 
             if (BackupDatabase())
             {
@@ -1173,9 +1173,9 @@ namespace OTSIncAReportApp
         private bool BackupDatabase()
         {
             //创建备份数据库文件夹
-            string sourcePath = resultFile.FilePath + "\\FIELD_FILES\\Inclusion.db";//源文件路径
+            string sourcePath = m_rstDataMgr.CurResultFile.FilePath + "\\FIELD_FILES\\Inclusion.db";//源文件路径
             string sourceName = "Inclusion.db";//源文件名称
-            string folderPath = resultFile.FilePath + "\\FIELD_FILES\\Backups";//目标文件夹
+            string folderPath = m_rstDataMgr.CurResultFile.FilePath + "\\FIELD_FILES\\Backups";//目标文件夹
             string Fields = "";
             for (int i = 1; i < 201; i++)
             {
@@ -1205,6 +1205,19 @@ namespace OTSIncAReportApp
 
             return true;
         }
+
+        private void ribbonOrbMenuItem_InclusionsTraceability_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSInclusionsTraceability.exe", m_rstDataMgr.CurResultFile.FilePath);
+                p.WaitForExit();
+            }
+            catch (Exception ex)
+            {
+                log.Error("InclusionsTraceability :" + ex.ToString());
+            }
+        }
     }
 }
 

+ 6 - 7
OTSIncAReportApp/1-UI/frmReportApp.resx

@@ -183,9 +183,8 @@
   </data>
   <data name="rbOpen.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxjAAAAAElF
-        TkSuQmCC
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+        wwAADsMBx2+oZAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="Backup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -236,25 +235,25 @@
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="rbFrame.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="rbHelp.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="rbStaff.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="rbFrame.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="rbRenew.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="rbStaff.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="rbHelp.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="rbRenew.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=

+ 6 - 0
OTSInclusionsTraceability/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
+    </startup>
+</configuration>

+ 238 - 0
OTSInclusionsTraceability/DataOperation.cs

@@ -0,0 +1,238 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Xml;
+using OTSCommon;
+
+namespace OTSInclusionsTraceability
+{
+    class DataOperation
+    {
+        #region 数据库相关
+        private SqLiteHelper dbHelper = null;
+
+        public DataOperation(string path)
+        {
+            string[] vs = path.Split('\\');
+            if (path.Split('\\').Contains("Inclusion.db"))
+            {
+                dbHelper = new SqLiteHelper("data source='" + path+"'");
+            }
+            else
+            {
+                dbHelper = new SqLiteHelper("data source='" + path + "\\FIELD_FILES\\Inclusion.db'");
+            }
+        }
+
+        public DataTable GetParticlesByEquCircleDiameter(string condition1,string condition2)
+        {
+            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 xrayid > -1  and typeid !=9 and typeid !=-1 " + /*"and "+ */condition1 /*+" and "*/+condition2 ;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+
+        public DataTable GetElementChemistry()
+        {
+            string sqliteString = "select * from ElementChemistry";
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+
+        
+
+        public Particle GetParticleXrayDataByFidAndPid(string fieldid, string xrayid)
+        {
+            string sqlp = @"select xraydata from xraydata where xrayindex=" + xrayid + " and fieldid=" + fieldid;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqlp);
+            List<Particle> listp = TableToList<Particle>(DT);
+            if (listp.Count > 0)
+            {
+                return listp[0];
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>        
+        /// /// tbale转list        
+        /// /// </summary>        
+        /// /// <typeparam name="T"></typeparam>        
+        /// /// <returns></returns>        
+        public List<T> TableToList<T>(DataTable table) where T : class, new()
+        {
+            var result = new List<T>();
+            var propertys = typeof(T).GetProperties();
+            foreach (DataRow dr in table.Rows)
+            {
+                var item = new T();
+                result.Add(item);
+                foreach (var pi in propertys)
+                {
+                    if (!table.Columns.Contains(pi.Name))
+                        continue;
+                    var value = dr[pi.Name];
+                    if (value is DBNull || value == null)
+                        continue;
+                    if (value.GetType().ToString() == "System.Int64")
+                    {
+                        pi.SetValue(item, Convert.ToInt32(value));
+                    }
+                    else if (value.GetType().ToString() == "System.Decimal")
+                    {
+                        pi.SetValue(item, Convert.ToDouble(value));
+                    }
+                    else
+                    {
+                        pi.SetValue(item, value);
+                    }
+                }
+            }
+            return result;
+        }
+        #endregion
+
+        #region Xml 相关
+        string XmlAddress = "\\Config\\SysData\\OTSInclusionsTraceabilityParam.rpf";
+        string ELEXmlAddress = "\\Config\\SysData\\OTSReportMgrParam.rpf";
+        XmlDocument doc = new XmlDocument();
+        public bool WriteXmlDefaultData(string sEquivalentCircularDiameter, bool bContains, string sDisplaySource)
+        {
+            //要写入的文件是否存在
+            if (File.Exists(Application.StartupPath + XmlAddress))
+            {
+                doc.Load(Application.StartupPath + XmlAddress);
+                //获取根节点
+                XmlElement xml = doc.DocumentElement;
+                doc.DocumentElement.RemoveAll();
+            }
+            else
+            {
+                XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "utf-8", "yes");
+                doc.AppendChild(dec);
+                XmlElement root = doc.CreateElement("XMLData");//加入根节点 
+                doc.AppendChild(root);
+            }
+
+            XmlElement user = doc.CreateElement("Member");
+            user.SetAttribute("RegName", "EquivalentCircularDiameter");
+            user.SetAttribute("strValue", sEquivalentCircularDiameter);
+            doc.DocumentElement.AppendChild(user);
+
+            user = doc.CreateElement("Member");
+            user.SetAttribute("RegName", "Contains");
+            user.SetAttribute("strValue", bContains.ToString());
+            doc.DocumentElement.AppendChild(user);
+
+            user = doc.CreateElement("Member");
+            user.SetAttribute("RegName", "DisplaySource");
+            user.SetAttribute("strValue", sDisplaySource);
+            doc.DocumentElement.AppendChild(user);
+
+            doc.Save(Application.StartupPath + XmlAddress);
+            return true;
+        }
+        public bool ReadXmlDataDefault(string AttributeItem,ref string output,string _XmlAddress= "\\Config\\SysData\\OTSInclusionsTraceabilityParam.rpf")
+        {
+            if (!File.Exists(Application.StartupPath + _XmlAddress))
+            {
+                return false;
+            }
+            doc.Load(Application.StartupPath + _XmlAddress);
+            //获取根节点
+            XmlElement xn1 = doc.DocumentElement;
+            XmlNodeList xn2 = xn1.ChildNodes;
+            //遍历所有节点
+            foreach (XmlNode item in xn2)
+            {
+                XmlElement xe = (XmlElement)item;
+                //将遍历到的值追加到Dictionary中
+                if (xe.GetAttribute("RegName") == AttributeItem)
+                {
+                    output= xe.GetAttribute("strValue");
+                    break;
+                }
+            }
+
+            return true;
+        }
+        #endregion
+
+        /// <summary>
+        /// 通过FileStream 来打开文件,这样就可以实现不锁定Image文件,到时可以让多用户同时访问Image文件
+        /// </summary>
+        /// <param name="path"></param>
+        /// <returns></returns>
+        public Bitmap ReadImageFile(string path)
+        {
+            if (!File.Exists(path))
+            {
+                return null;//文件不存在
+            }
+            FileStream fs = File.OpenRead(path); //OpenRead
+            int filelength = 0;
+            filelength = (int)fs.Length; //获得文件长度 
+            Byte[] image = new Byte[filelength]; //建立一个字节数组 
+            fs.Read(image, 0, filelength); //按字节流读取 
+            System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
+            fs.Close();
+            Bitmap bit = new Bitmap(result);
+            return bit;
+        }
+
+        /// <summary>
+        /// 传入单颗颗粒的particle类对象,返回从field中抠取出的bitmap对象,抠取单颗颗粒
+        /// </summary>
+        /// <param name="in_cotsparticleclr"></param>
+        /// <returns></returns>
+        public Bitmap GetBitmapByParticle(Bitmap ls_bt, Rectangle offset_rect)
+        {
+            //为了能把整个颗粒显示完整
+            offset_rect.X = offset_rect.X - 5;
+            offset_rect.Y = offset_rect.Y - 5;
+            offset_rect.Width = offset_rect.Width + 10;
+            offset_rect.Height = offset_rect.Height + 10;
+
+            //防止计算偏差后,有坐标溢出现象
+            if (offset_rect.X < 0)
+                offset_rect.X = 0;
+            if (offset_rect.Y < 0)
+                offset_rect.Y = 0;
+            if (offset_rect.X + offset_rect.Width > ls_bt.Width)
+            {
+                offset_rect.Width = ls_bt.Width - offset_rect.X;
+            }
+            if (offset_rect.Y + offset_rect.Height > ls_bt.Height)
+            {
+                offset_rect.Height = ls_bt.Height - offset_rect.Y;
+            }
+
+            Bitmap new_ret_bp;
+            //防止为0后面计算出错
+            if (offset_rect.Width > 0 && offset_rect.Height > 0)
+            {
+                //最后通过list_showsegment组建成新的图片,进行返回
+                new_ret_bp = ls_bt.Clone(offset_rect, PixelFormat.Format8bppIndexed);
+            }
+            else
+            {
+
+                new_ret_bp = new Bitmap(offset_rect.Width, offset_rect.Height);
+            }
+
+            return new_ret_bp;
+        }
+    }
+}

+ 239 - 0
OTSInclusionsTraceability/OTSInclusionsTraceability.Designer.cs

@@ -0,0 +1,239 @@
+
+namespace OTSInclusionsTraceability
+{
+    partial class InclusionsTraceability
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.comboBox_SourceType = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.bn_Find = new System.Windows.Forms.Button();
+            this.cB_contain = new System.Windows.Forms.CheckBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.tB_EquivalentCircularDiameter = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.panel2 = new System.Windows.Forms.Panel();
+            this.dgV_Traceablilty = new System.Windows.Forms.DataGridView();
+            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.复制全部ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.复制图像ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.复制图像ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.ExportExecl = new System.Windows.Forms.ToolStripMenuItem();
+            this.panel1.SuspendLayout();
+            this.panel2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgV_Traceablilty)).BeginInit();
+            this.contextMenuStrip1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // 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.comboBox_SourceType);
+            this.panel1.Controls.Add(this.label3);
+            this.panel1.Controls.Add(this.bn_Find);
+            this.panel1.Controls.Add(this.cB_contain);
+            this.panel1.Controls.Add(this.label2);
+            this.panel1.Controls.Add(this.tB_EquivalentCircularDiameter);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Location = new System.Drawing.Point(12, 12);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(1591, 54);
+            this.panel1.TabIndex = 0;
+            // 
+            // comboBox_SourceType
+            // 
+            this.comboBox_SourceType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.comboBox_SourceType.FormattingEnabled = true;
+            this.comboBox_SourceType.Location = new System.Drawing.Point(1341, 15);
+            this.comboBox_SourceType.Name = "comboBox_SourceType";
+            this.comboBox_SourceType.Size = new System.Drawing.Size(141, 20);
+            this.comboBox_SourceType.TabIndex = 7;
+            // 
+            // label3
+            // 
+            this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(1269, 18);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(65, 12);
+            this.label3.TabIndex = 6;
+            this.label3.Text = "显示类型:";
+            // 
+            // bn_Find
+            // 
+            this.bn_Find.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.bn_Find.Location = new System.Drawing.Point(1504, 13);
+            this.bn_Find.Name = "bn_Find";
+            this.bn_Find.Size = new System.Drawing.Size(75, 23);
+            this.bn_Find.TabIndex = 5;
+            this.bn_Find.Text = "查找";
+            this.bn_Find.UseVisualStyleBackColor = true;
+            this.bn_Find.Click += new System.EventHandler(this.bn_Find_Click);
+            // 
+            // cB_contain
+            // 
+            this.cB_contain.AutoSize = true;
+            this.cB_contain.Location = new System.Drawing.Point(395, 17);
+            this.cB_contain.Name = "cB_contain";
+            this.cB_contain.Size = new System.Drawing.Size(72, 16);
+            this.cB_contain.TabIndex = 3;
+            this.cB_contain.Text = "是否包含";
+            this.cB_contain.UseVisualStyleBackColor = true;
+            this.cB_contain.Visible = false;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(360, 18);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(29, 12);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "微米";
+            // 
+            // tB_EquivalentCircularDiameter
+            // 
+            this.tB_EquivalentCircularDiameter.Location = new System.Drawing.Point(247, 15);
+            this.tB_EquivalentCircularDiameter.Name = "tB_EquivalentCircularDiameter";
+            this.tB_EquivalentCircularDiameter.Size = new System.Drawing.Size(107, 21);
+            this.tB_EquivalentCircularDiameter.TabIndex = 1;
+            this.tB_EquivalentCircularDiameter.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(14, 18);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(227, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "请输入判定外来夹杂物的最小等效圆尺寸:";
+            // 
+            // panel2
+            // 
+            this.panel2.Controls.Add(this.dgV_Traceablilty);
+            this.panel2.Location = new System.Drawing.Point(12, 80);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(1594, 725);
+            this.panel2.TabIndex = 1;
+            // 
+            // dgV_Traceablilty
+            // 
+            this.dgV_Traceablilty.AllowUserToAddRows = false;
+            this.dgV_Traceablilty.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.dgV_Traceablilty.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgV_Traceablilty.ContextMenuStrip = this.contextMenuStrip1;
+            this.dgV_Traceablilty.Location = new System.Drawing.Point(0, 0);
+            this.dgV_Traceablilty.Name = "dgV_Traceablilty";
+            this.dgV_Traceablilty.RowHeadersVisible = false;
+            this.dgV_Traceablilty.Size = new System.Drawing.Size(1591, 725);
+            this.dgV_Traceablilty.TabIndex = 0;
+            // 
+            // contextMenuStrip1
+            // 
+            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.复制全部ToolStripMenuItem,
+            this.复制图像ToolStripMenuItem1,
+            this.复制图像ToolStripMenuItem,
+            this.ExportExecl});
+            this.contextMenuStrip1.Name = "contextMenuStrip1";
+            this.contextMenuStrip1.Size = new System.Drawing.Size(149, 92);
+            // 
+            // 复制全部ToolStripMenuItem
+            // 
+            this.复制全部ToolStripMenuItem.Name = "复制全部ToolStripMenuItem";
+            this.复制全部ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
+            this.复制全部ToolStripMenuItem.Text = "复制整个表";
+            this.复制全部ToolStripMenuItem.Click += new System.EventHandler(this.复制全部ToolStripMenuItem_Click);
+            // 
+            // 复制图像ToolStripMenuItem1
+            // 
+            this.复制图像ToolStripMenuItem1.Name = "复制图像ToolStripMenuItem1";
+            this.复制图像ToolStripMenuItem1.Size = new System.Drawing.Size(148, 22);
+            this.复制图像ToolStripMenuItem1.Text = "复制选择区域";
+            this.复制图像ToolStripMenuItem1.Click += new System.EventHandler(this.CopySelectToolStripMenuItem1_Click);
+            // 
+            // 复制图像ToolStripMenuItem
+            // 
+            this.复制图像ToolStripMenuItem.Name = "复制图像ToolStripMenuItem";
+            this.复制图像ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
+            this.复制图像ToolStripMenuItem.Text = "复制图像";
+            this.复制图像ToolStripMenuItem.Click += new System.EventHandler(this.复制图像ToolStripMenuItem_Click);
+            // 
+            // ExportExecl
+            // 
+            this.ExportExecl.Name = "ExportExecl";
+            this.ExportExecl.Size = new System.Drawing.Size(148, 22);
+            this.ExportExecl.Text = "导出execl";
+            this.ExportExecl.Click += new System.EventHandler(this.ExportExecl_Click);
+            // 
+            // InclusionsTraceability
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1615, 814);
+            this.Controls.Add(this.panel2);
+            this.Controls.Add(this.panel1);
+            this.Name = "InclusionsTraceability";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "InclusionsTraceability";
+            this.Load += new System.EventHandler(this.InclusionsTraceability_Load);
+            this.Resize += new System.EventHandler(this.InclusionsTraceability_Resize);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgV_Traceablilty)).EndInit();
+            this.contextMenuStrip1.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Button bn_Find;
+        private System.Windows.Forms.CheckBox cB_contain;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox tB_EquivalentCircularDiameter;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Panel panel2;
+        private System.Windows.Forms.DataGridView dgV_Traceablilty;
+        private System.Windows.Forms.ComboBox comboBox_SourceType;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+        private System.Windows.Forms.ToolStripMenuItem ExportExecl;
+        private System.Windows.Forms.ToolStripMenuItem 复制全部ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 复制图像ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem 复制图像ToolStripMenuItem1;
+    }
+}
+

+ 716 - 0
OTSInclusionsTraceability/OTSInclusionsTraceability.cs

@@ -0,0 +1,716 @@
+using NPOI.SS.UserModel;
+using NPOI.SS.UserModel.Charts;
+using NPOI.SS.Util;
+using NPOI.XSSF.UserModel;
+using OTSCommon;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSInclusionsTraceability
+{
+    public partial class InclusionsTraceability : Form
+    {
+        #region 变量
+        /// <summary>
+        /// 外来夹杂物种类
+        /// </summary>
+        enum SourceType
+        {
+            RefiningSlag=0,
+            Refractory=1,
+            RefiningSlagAndRefractory=2
+        }
+
+        string sEquivalentCircularDiameter = "30";
+        bool bContains = false;
+        string sDisplaySource = "精炼渣";
+        string sElementsColName = "";
+        string sDefaultComputedColName = "";
+
+        DataOperation dataOperation;
+        public string RetDBAddress = "";
+        DataTable particles;
+        DataTable particlesDisplay;
+        Dictionary<string, string> keyValues = new Dictionary<string, string>() { };
+
+        //国际化
+        Language lan;
+        Hashtable table;
+        #endregion
+
+        public InclusionsTraceability()
+        {
+            //设置窗体的双缓冲,以保证大数据时拖动不卡
+            this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
+            this.UpdateStyles();
+            InitializeComponent();
+        }
+
+        private void InclusionsTraceability_Load(object sender, EventArgs e)
+        {
+            comboBox_SourceType.Items.Add("精炼渣");
+            comboBox_SourceType.Items.Add("耐材");
+            //comboBox_SourceType.Items.Add("精炼渣+耐材");
+            comboBox_SourceType.SelectedIndex = 0;
+
+            Init();
+
+            tB_EquivalentCircularDiameter.Text = sEquivalentCircularDiameter;
+            cB_contain.Checked = bContains;
+            switch(sDisplaySource)
+            {
+                case "精炼渣": comboBox_SourceType.SelectedIndex = 0;break;
+                case "耐材": comboBox_SourceType.SelectedIndex = 1; break;
+                case "精炼渣+耐材": comboBox_SourceType.SelectedIndex = 2; break;
+            }
+            #region 界面缩放控件位置记录
+            int count = this.Controls.Count * 2 + 2;
+            float[] nature = new float[count];
+            int i = 0;
+            nature[i++] = Size.Width;
+            nature[i++] = Size.Height;
+            foreach (Control ctrl in this.Controls)
+            {
+                nature[i++] = ctrl.Location.X / (float)Size.Width;
+                nature[i++] = ctrl.Location.Y / (float)Size.Height;
+                ctrl.Tag = ctrl.Size;
+            }
+            Tag = nature;
+            #endregion
+
+            tB_EquivalentCircularDiameter.Select(tB_EquivalentCircularDiameter.Text.Length, 0);
+        }
+
+        string AuquireEquCircleDiameter()
+        {
+            string condition = "";
+            double EquCircleDiameter = 0;
+            if (double.TryParse(tB_EquivalentCircularDiameter.Text,out EquCircleDiameter))
+            {
+                double Darea = Math.PI * (EquCircleDiameter * EquCircleDiameter / 4);
+                if(cB_contain.Checked)
+                { 
+                    condition = "Area>=" + Darea.ToString();
+                }
+                else
+                {
+                    condition = "Area>" + Darea.ToString();
+                }
+            }
+            return condition;
+        }
+
+        /// <summary>
+        /// DataRow转换为DataTable
+        /// </summary>
+        /// <param name="dt"></param>
+        /// <param name="strWhere">筛选的条件</param>
+        /// <returns></returns>
+        public DataTable SreeenDataTable(DataTable dt, string strWhere)
+        {
+            if (dt.Rows.Count <= 0) return dt;        //当数据为空时返回
+            DataTable dtNew = dt.Clone();         //复制数据源的表结构
+            DataRow[] dr = dt.Select(strWhere);  //strWhere条件筛选出需要的数据!
+            for (int i = 0; i < dr.Length; i++)
+            {
+                dtNew.Rows.Add(dr[i].ItemArray);  // 将DataRow添加到DataTable中
+            }
+            return dtNew;
+        }
+
+        private void bn_Find_Click(object sender, EventArgs e)
+        {
+            string condition = AuquireEquCircleDiameter();
+            if (condition == "")
+            {
+                MessageBox.Show("请输入有效的数据!");
+                return;
+            }
+            if(comboBox_SourceType.SelectedIndex==(int)SourceType.RefiningSlag)
+            {
+                condition += " and TypeName Like \'%CaO%\' ";
+            }
+            else if(comboBox_SourceType.SelectedIndex == (int)SourceType.Refractory)
+            {
+                condition += " and (TypeName Like \'%MgO%\' or TypeName Like \'%Al2O3%\')";
+            }
+            else
+            {
+                condition += " and (TypeName Like \'%MgO%\' or TypeName Like \'%Al2O3%\' or TypeName Like \'%CaO%\')";
+            }
+            
+            particlesDisplay = SreeenDataTable(particles, condition);
+
+            DataTable elementchemistry = dataOperation.GetElementChemistry();
+            for (int i = 0; i < particlesDisplay.Rows.Count; i++)
+            {
+                string str = "XRayId = " + particlesDisplay.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesDisplay.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"] + ';';
+                }
+                particlesDisplay.Rows[i]["Element"] = ConcatenatedString;
+            }
+            BindDataGridView();
+            SetDataGridViewStyle();
+            dataOperation.WriteXmlDefaultData(tB_EquivalentCircularDiameter.Text, cB_contain.Checked,(comboBox_SourceType.SelectedItem).ToString());
+        }
+
+        void BindDataGridView()
+        {
+            dgV_Traceablilty.Visible = false;
+            
+            this.Cursor = Cursors.WaitCursor;
+
+            if (particlesDisplay== null)
+            {
+                return;
+            }
+
+            //获取需要显示的元素名
+            List<string> ElementTypeSort = new List<string>(sElementsColName.Split(',').ToList());//去重
+            for (int i = 0; i < ElementTypeSort.Count; i++)
+            {
+                dgV_Traceablilty.Columns.Add(ElementTypeSort[i], ElementTypeSort[i]);
+            }
+            //double jd = 95f / (double)particles.Rows.Count;//计算进度刻度
+            string filePath = "";
+            if (RetDBAddress.Contains("db"))
+            {
+                filePath = Directory.GetParent(RetDBAddress).FullName+"\\";
+            }
+            else
+            {
+                filePath = RetDBAddress + "\\FIELD_FILES\\";
+            }
+
+            KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
+            for (int i = 0; i < particlesDisplay.Rows.Count; i++)
+            {
+                //更新进度,每100条记录加载完,更新一次进度
+                //if (i % 10 == 0)
+                //    m_frm_userprogress.SetProgressValueAndText((int)(jd * i), "loading..");
+
+                Dictionary<string, string>.Enumerator enl = keyValues.GetEnumerator();
+
+                int add_rowindex = dgV_Traceablilty.Rows.Add();
+                dgV_Traceablilty.Rows[add_rowindex].Cells[0].Value = (add_rowindex + 1).ToString();
+
+                for (int k = 0; k < keyValues.Count; k++)
+                {
+                    if (enl.MoveNext())
+                    {
+                        if (enl.Current.Key == "rowid")
+                        {
+                            //dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = i + 1;
+                        }
+                        if (enl.Current.Key == "ParticleImage")
+                        {
+                            if (FieldImage.Key != particlesDisplay.Rows[i]["fieldid"].ToString() || FieldImage.Value == null)
+                            {
+                                string imagePath = filePath + "Field" + particlesDisplay.Rows[i]["fieldid"].ToString() + ".bmp";
+                                FieldImage = new KeyValuePair<string, Bitmap>(particlesDisplay.Rows[i]["fieldid"].ToString(), dataOperation.ReadImageFile(imagePath));
+                            }
+
+                            Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particlesDisplay.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particlesDisplay.Rows[i]["RectTop"]), Width = Convert.ToInt32(particlesDisplay.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particlesDisplay.Rows[i]["RectHeight"]) };
+                            Bitmap bmap = dataOperation.GetBitmapByParticle(FieldImage.Value, rectangle);
+                            bmap.Tag = new List<string>() { particlesDisplay.Rows[i]["FieldId"].ToString(), particlesDisplay.Rows[i]["ParticleId"].ToString(), particlesDisplay.Rows[i]["TypeId"].ToString(), particlesDisplay.Rows[i]["XrayId"].ToString() };
+                            dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = bmap;
+                            dgV_Traceablilty.Rows[add_rowindex].Height = bmap.Height + 20;
+
+                        }
+                        //if (enl.Current.Key == "SourceType")
+                        //{
+
+                        //    if (particlesDisplay.Rows[i]["TypeName"].ToString().Contains("CaO"))
+                        //    {
+                        //        dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = SourceType.RefiningSlag.ToString();
+                        //    }
+                        //    else
+                        //    {
+                        //        dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = SourceType.Refractory.ToString();
+                        //    }
+                        //}
+                        if (enl.Current.Key == "DiameterRatio")
+                        {
+                            double d = Convert.ToDouble(particlesDisplay.Rows[i]["DMAX"]) / Convert.ToDouble(particlesDisplay.Rows[i]["DMIN"]);
+                            dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
+                        }
+                        if (enl.Current.Key == "ASPECT_ELONG")
+                        {
+                            double d = Convert.ToDouble(particlesDisplay.Rows[i]["DELONG"]) / Convert.ToDouble(particlesDisplay.Rows[i]["DMEAN"]);
+                            dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = Math.Round(d, 2);
+                        }
+                        if (particlesDisplay.Columns.Contains(enl.Current.Key))
+                        {
+                            double num = 0;
+                            if (double.TryParse(particlesDisplay.Rows[i][enl.Current.Key].ToString(), out num))
+                            {
+                                dgV_Traceablilty.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 = particlesDisplay.Rows[i][enl.Current.Key].ToString().Split(';');
+                                for (int j = 0; j < strcbo.Length; j++)
+                                {
+                                    string[] str = strcbo[j].Split('-');
+                                    if (ElementTypeSort.Contains(str[0]))
+                                    { dgV_Traceablilty.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_Traceablilty.Rows[add_rowindex].Cells[ele].Value = "0";
+                                }
+                            }
+                            else
+                            {
+                                dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = particlesDisplay.Rows[i][enl.Current.Key];
+                            }
+                        }
+                        //if (enl.Current.Key == "TypeName")
+                        //{
+                        //    if (particlesDisplay.Rows[i]["TypeId"].ToString() == "9")
+                        //    {
+                        //        dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = "Not Identified";
+                        //    }
+                        //}
+                        if (enl.Current.Key == "Equivalent")
+                        {
+                            double dSize = Convert.ToDouble(particlesDisplay.Rows[i]["Area"]);
+                            double Diameter = Math.Sqrt(dSize / Math.PI) * 2;
+                            dgV_Traceablilty.Rows[add_rowindex].Cells[k].Value = Math.Round(Diameter, 2);
+                        }
+                    }
+                }
+            }
+
+
+            #region 加载进度条进度部份结束
+            //加载完成设置鼠标为默认
+            this.Cursor = Cursors.Default;
+            //string str8 = table["str8"].ToString();
+            //m_frm_userprogress.SetProgressValueAndText(100, str8);
+            ////加载完成,关闭进度条
+            //m_frm_userprogress.Close();
+            #endregion
+
+            dgV_Traceablilty.Visible = true;
+        }
+
+        void Init()
+        {
+            lan = new Language(this);
+            table = lan.GetNameTable(this.Name);
+
+            #region 数据库及表格
+            dataOperation = new DataOperation(RetDBAddress);
+            particles = dataOperation.GetParticlesByEquCircleDiameter("", "");
+            #endregion
+
+            #region XML 文档
+            dataOperation.ReadXmlDataDefault("ElementsColName", ref sElementsColName, "\\Config\\SysData\\OTSReportMgrParam.rpf");
+            dataOperation.ReadXmlDataDefault("DefaultComputedColName", ref sDefaultComputedColName, "\\Config\\SysData\\OTSReportMgrParam.rpf");
+            string sContains = "";
+            if (dataOperation.ReadXmlDataDefault("Contains", ref sContains))
+            {
+                if (sContains == "True")
+                {
+                    bContains = true;
+                }
+                dataOperation.ReadXmlDataDefault("EquivalentCircularDiameter", ref sEquivalentCircularDiameter);
+                dataOperation.ReadXmlDataDefault("DisplaySource", ref sDisplaySource);
+            }
+            #endregion
+
+            #region 表格
+            dgV_Traceablilty.Rows.Clear();
+            dgV_Traceablilty.Columns.Clear();
+            //获取需要显示的计算列
+            string[] strs = sDefaultComputedColName.Split(',');
+
+            //列名
+            keyValues.Add("rowid", table["str4"].ToString());
+            keyValues.Add("TypeName", table["str6"].ToString());
+            keyValues.Add("ParticleImage", table["str5"].ToString());
+            //keyValues.Add("SourceType", table["str34"].ToString());
+            keyValues.Add("FieldID", "FieldID");
+            for (int i = 0; i < strs.Count(); i++)
+            {
+                if (strs[i] == "FiledCoordinate")
+                {
+                    keyValues.Add("SEMPosX", "SEMPosX");
+                    keyValues.Add("SEMPosY", "SEMPosY");
+                }
+                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());
+                }
+            }
+            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_Traceablilty.Columns.Add(iconColumn);
+                    }
+                    else if (en.Current.Key == "Element")
+                    {
+
+                    }
+                    else
+                    {
+                        int columndid = dgV_Traceablilty.Columns.Add(en.Current.Key, en.Current.Value);
+                    }
+
+                }
+            }
+            #endregion
+        }
+
+        /// <summary>
+        /// 设置DataGridView样式
+        /// </summary>
+        private void SetDataGridViewStyle()
+        {
+            //用户不能调整标题的高度
+            dgV_Traceablilty.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+
+            //用户不能调整 行高
+            dgV_Traceablilty.AllowUserToResizeRows = false;
+
+            //点击选择整行
+            dgV_Traceablilty.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+
+            //居中显示
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dgV_Traceablilty.DefaultCellStyle = dataGridViewCellStyle1;
+            dgV_Traceablilty.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+
+            //再次重覆禁用拖动表头高度,居然有效果了
+            dgV_Traceablilty.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+
+            //设置grid可以复制
+            dgV_Traceablilty.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
+
+            //设置每列的宽度
+            dgV_Traceablilty.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
+            dgV_Traceablilty.Columns[1].Width = 150;
+            //dgV_Traceablilty.Columns[dgV_Traceablilty.Columns.Count - 1].Width = 450;
+            //dgV_Traceablilty.Columns[dgV_Traceablilty.Columns.Count - 1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
+
+            //设置序号列不排序
+            dgV_Traceablilty.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
+
+            //设置序号列不可以设置宽度
+            dgV_Traceablilty.Columns[0].Resizable = DataGridViewTriState.False;
+
+            dgV_Traceablilty.RowsDefaultCellStyle.BackColor = Color.Azure;
+        }
+
+        private void InclusionsTraceability_Resize(object sender, EventArgs e)
+        {
+            //控件随窗体全屏显示
+            float[] scale = (float[])Tag;
+            int i = 2;
+
+            foreach (Control ctrl in this.Controls)
+            {
+                ctrl.Left = (int)(Size.Width * scale[i++]);
+                ctrl.Top = (int)(Size.Height * scale[i++]);
+                ctrl.Width = (int)(Size.Width / (float)scale[0] * ((Size)ctrl.Tag).Width);
+                ctrl.Height = (int)(Size.Height / (float)scale[1] * ((Size)ctrl.Tag).Height);
+            }
+        }
+
+        private void ExportExecl_Click(object sender, EventArgs e)
+        {
+            //将所有的数据导出到EXCEL中
+            SaveFileDialog sfd = new SaveFileDialog();
+            sfd.Filter = "Excel File(*.xlsx)|*.xlsx";
+            //设置默认文件类型显示顺序
+            sfd.FilterIndex = 1;
+            sfd.FileName = "ParticlesInfo";
+
+            //保存对话框是否记忆上次打开的目录
+            sfd.RestoreDirectory = true;
+            if (sfd.ShowDialog() == DialogResult.OK)
+            {
+                //IWorkbook workbook = new HSSFWorkbook();   //用于创建.xls  office2003开始以前的
+                IWorkbook workbook = new NPOI.XSSF.UserModel.XSSFWorkbook();        //用于创建.xlsx office2007开始以后的
+                ISheet sheet;
+
+                //创建Excel文件
+                FileStream fs = File.Create(sfd.FileName);
+                fs.Close();
+
+                sheet = workbook.CreateSheet("Particles");//创建工作表
+
+
+                //创建表格边框样式风格
+                ICellStyle cellStyle = workbook.CreateCellStyle();
+                cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
+                cellStyle.VerticalAlignment = VerticalAlignment.Center;
+
+                //设置上4边
+                cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
+                cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
+                cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
+                cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
+
+                //设置字符大小和颜色
+                IFont font = workbook.CreateFont();
+                font.FontName = "黑体";
+                font.FontHeightInPoints = 10;
+                cellStyle.SetFont(font);
+
+                //设置颗粒名列宽
+                sheet.SetColumnWidth(1, 30 * 256);//夹杂物名列宽
+                sheet.SetColumnWidth(2, 7 * 256);//图像列宽
+
+                IRow row;
+                ICell cell;
+
+                //插入表头
+                row = sheet.CreateRow(1);//从第15行添加一行
+                row.Height = 30 * 20;
+                for (int i_cell = 0; i_cell < dgV_Traceablilty.Columns.Count; i_cell++)
+                {
+                    cell = row.CreateCell(i_cell);
+                    cell.CellStyle = cellStyle;
+
+                    cell.SetCellValue(dgV_Traceablilty.Columns[i_cell].Name);
+                }
+
+
+                //插入表内容
+                for (int i_row = 0; i_row < dgV_Traceablilty.Rows.Count; i_row++)
+                {
+                    row = sheet.CreateRow(2 + i_row);
+                    row.Height = 45 * 20;
+                    for (int i_cell = 0; i_cell < dgV_Traceablilty.Columns.Count; i_cell++)
+                    {
+                        cell = row.CreateCell(i_cell);
+                        cell.CellStyle = cellStyle;
+
+                        if (dgV_Traceablilty[i_cell, i_row].Value == null)
+                            continue;
+
+                        if (i_cell == 2)
+                        {
+                            //颗粒图像列
+                            Bitmap bp = (Bitmap)dgV_Traceablilty.Rows[i_row].Cells[2].Value;
+
+                            byte[] bytes = ImageConvertToBytes(bp);
+
+                            //第二步,将图片添加到workbook中,指定图片的格式,返回图片所在workbook->paicture数组中的索引的地址,从1开始
+                            int pictureIdx = workbook.AddPicture(bytes, PictureType.JPEG);
+
+                            //第三步,在sheet中创建画布
+                            IDrawing patriarch = sheet.CreateDrawingPatriarch();
+
+                            //第四步,设置锚点,(在起始单元格的X坐标0-1023,Y的坐标0-255,在终止单元格的X坐标0-1023,Y的坐标0-255,起始单元格行数,列数,终止单元格行数,列数)
+                            IClientAnchor anchor = patriarch.CreateAnchor(1, 1, 2, 2, i_cell, i_row + 2, i_cell + 1, i_row + 3);//终止比开始位置大1,会自动缩放到一个单元格内的
+
+                            //第五步,创建图片
+                            IPicture pict = patriarch.CreatePicture(anchor, pictureIdx);
+
+                            //图像效果不好,自己另外导出吧,这里对该列宽进行了设置0
+                        }
+                        else
+                        {
+                            //非图像列
+                            double dbl = 0;
+                            if (double.TryParse(dgV_Traceablilty[i_cell, i_row].Value.ToString(), out dbl))
+                            {
+                                cell.SetCellValue(dbl);
+                            }
+                            else
+                            {
+                                cell.SetCellValue(dgV_Traceablilty[i_cell, i_row].Value.ToString());
+                            }
+                        }
+
+                    }
+                }
+                //完成后,对Excel进行保存
+                FileStream file = new FileStream(sfd.FileName, FileMode.Create);
+                workbook.Write(file);
+                file.Close();
+
+                MessageBox.Show("Export complete!");
+
+                //导出完成后,打开Excel文件
+                if (File.Exists(sfd.FileName))
+                {
+                    //打开刚才导出的文件
+                    System.Diagnostics.Process.Start(sfd.FileName);
+                }
+            }
+        }
+
+        /// <summary>
+        /// 将image转成bytes
+        /// </summary>
+        /// <param name="in_img"></param>
+        /// <returns></returns>
+        public byte[] ImageConvertToBytes(System.Drawing.Image in_img)
+        {
+            MemoryStream ms = new MemoryStream();
+            in_img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
+            return ms.ToArray();
+        }
+
+        void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, int rowid)
+        {
+            var chart = drawing.CreateChart(anchor) as XSSFChart;
+
+            //图表
+            var data = chart.ChartDataFactory.CreateLineChartData<double, double>(); //折线图
+
+            IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
+
+            IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
+            leftAxis.Crosses = AxisCrosses.AutoZero;
+            leftAxis.IsVisible = true;
+            bottomAxis.IsVisible = true;
+            //数据源
+            IChartDataSource<double> ys = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(rowid, rowid, 1, 2001));
+
+            Double[] doubles = new Double[2000];
+            for (int i = 0; i < 2000; i++)
+            {
+                doubles[i] = i;
+            }
+            IChartDataSource<double> xs = DataSources.FromArray(doubles);
+
+            //数据系列
+            var s1 = data.AddSeries(xs, ys);
+
+            // 开始绘制折线图
+            chart.Plot(data, bottomAxis, leftAxis);
+
+        }
+
+        private void 复制全部ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            //复制整个表
+            CopyAll();
+        }
+        /// <summary>
+        /// 复制所有
+        /// </summary>
+        public void CopyAll()
+        {
+            dgV_Traceablilty.SelectAll();
+            Clipboard.SetDataObject(dgV_Traceablilty.GetClipboardContent());
+
+        }
+
+        private void CopySelectToolStripMenuItem1_Click(object sender, EventArgs e)
+        {
+            //复制选择区域
+            CopySelected();
+        }
+
+        /// <summary>
+        /// 复制选择区域
+        /// </summary>
+        public void CopySelected()
+        {
+            //复制选择区域
+            object oo = dgV_Traceablilty.GetClipboardContent();
+            if (oo != null)
+                Clipboard.SetDataObject(dgV_Traceablilty.GetClipboardContent());
+        }
+
+        private void 复制图像ToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            //对gridview进行截图
+            CopyImage();
+        }
+
+        /// <summary>
+        /// 以图像的方式将GridView进行截图
+        /// </summary>
+        public void CopyImage()
+        {
+            int height, width;
+            width = dgV_Traceablilty.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) + 2;
+            height = this.Height;
+
+            Bitmap image = new Bitmap(width, height);
+            dgV_Traceablilty.DrawToBitmap(image, new Rectangle(0, 0, width, height));
+
+            Clipboard.SetImage(image);
+        }
+    }
+}

+ 110 - 0
OTSInclusionsTraceability/OTSInclusionsTraceability.csproj

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{83412BF0-F802-456C-8A33-7C6CD5B6704D}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>OTSInclusionsTraceability</RootNamespace>
+    <AssemblyName>OTSInclusionsTraceability</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>x64</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\Bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
+      <HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
+    </Reference>
+    <Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
+      <HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OOXML, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OOXML.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXml4Net, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXml4Net.dll</HintPath>
+    </Reference>
+    <Reference Include="NPOI.OpenXmlFormats, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
+      <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
+    </Reference>
+    <Reference Include="OTSCommon, Version=1.0.1.0, Culture=neutral, processorArchitecture=AMD64">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Bin\x64\Debug\OTSCommon.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="OTSInclusionsTraceability.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="OTSInclusionsTraceability.Designer.cs">
+      <DependentUpon>OTSInclusionsTraceability.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Particle.cs" />
+    <Compile Include="DataOperation.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="OTSInclusionsTraceability.resx">
+      <DependentUpon>OTSInclusionsTraceability.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
+    </Compile>
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 123 - 0
OTSInclusionsTraceability/OTSInclusionsTraceability.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>

+ 139 - 0
OTSInclusionsTraceability/Particle.cs

@@ -0,0 +1,139 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OTSInclusionsTraceability
+{
+    class Particle
+    {
+        public enum SourceType
+        {
+            RefiningSlag=0,
+            Refractory=1
+        }
+        public int FieldId { set; get; }
+        //ParticleId
+        public int ParticleId { set; get; }
+        //XrayId
+        public int XrayId { set; get; }
+        //RectLeft
+        public int RectLeft { set; get; }
+        //RectTop
+        public int RectTop { set; get; }
+        //RectWidth
+        public int RectWidth { set; get; }
+        //RectHeight
+        //public int RectHeight { set; get; }
+        ////FeatureList
+        //public List<Segment> SegmentList { set; get; }
+        //XRayData
+        public byte[] XRayData { set; get; }
+        ////ElementList
+        //public List<Element> ElementList { set; get; }
+
+        public int AveGray
+        {
+            set;
+            get;
+        }
+        //PosX
+        public int PosX { set; get; }
+        //PosY
+        public int PosY { set; get; }
+        //TypeId
+        public int TypeId { set; get; }
+        //TypeName
+        public string TypeName { set; get; }
+        //TypeColor
+        public string TypeColor { set; get; }
+        //ElementNum
+        public int ElementNum { set; get; }
+        //SegmentNum
+        public int SegmentNum { set; get; }
+        //FieldPosX
+        public int FieldPosX { set; get; }
+        //FieldPosY
+        public int FieldPosY { set; get; }
+        //Element
+        public string Element { set; get; }
+        //ParticleImage
+        public string ParticleImage { set; get; }
+
+        public double Area
+        {
+            set;
+            get;
+        }
+        public double DELONG
+        {
+            set;
+            get;
+        }
+        public double DINSCR
+        {
+            set;
+            get;
+        }
+        public double DMAX
+        {
+            set;
+            get;
+        }
+        public double DMEAN
+        {
+            set;
+            get;
+        }
+        public double DMIN
+        {
+            set;
+            get;
+        }
+        public double DPERP
+        {
+            set;
+            get;
+        }
+        public double PERIMETER
+        {
+            set;
+            get;
+        }
+
+
+        public double ORIENTATION
+        {
+            set;
+            get;
+        }
+
+        public double DFERET
+        {
+            set;
+            get;
+        }
+
+        public int SEMPosX
+        {
+            get;
+            set;
+        }
+
+        public int SEMPosY
+        {
+            get;
+            set;
+        }
+
+
+        public string Hardness { set; get; }
+
+        public string Density { set; get; }
+
+        public string Electrical_conductivity { set; get; }
+
+        public SourceType Source { set; get; }
+    }
+}

+ 43 - 0
OTSInclusionsTraceability/Program.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSInclusionsTraceability
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main(string[] args)
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            InclusionsTraceability inclusionsTraceability=new InclusionsTraceability();
+            if (args.Length > 0)
+            {
+                inclusionsTraceability.RetDBAddress = args[0];
+            }
+            else
+            {
+                OpenFileDialog openFileDialog = new OpenFileDialog();
+                openFileDialog.Title = "Please select the database you want to open";
+                openFileDialog.Filter = "(*.db)|*.db";
+                openFileDialog.RestoreDirectory = true;
+                openFileDialog.FilterIndex = 1;
+                if (openFileDialog.ShowDialog() == DialogResult.OK)
+                {
+                    inclusionsTraceability.RetDBAddress = openFileDialog.FileName;
+                }
+                else
+                {
+                    return;
+                }
+             }
+            Application.Run(inclusionsTraceability);
+        }
+    }
+}

+ 36 - 0
OTSInclusionsTraceability/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("OTSInclusionsTraceability")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OTSInclusionsTraceability")]
+[assembly: AssemblyCopyright("Copyright ©  2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("83412bf0-f802-456c-8a33-7c6cd5b6704d")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 0
OTSInclusionsTraceability/Properties/Resources.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OTSInclusionsTraceability.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OTSInclusionsTraceability.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
OTSInclusionsTraceability/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 26 - 0
OTSInclusionsTraceability/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OTSInclusionsTraceability.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
OTSInclusionsTraceability/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 6 - 0
OTSInclusionsTraceability/packages.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="NPOI" version="2.5.6" targetFramework="net472" />
+  <package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net472" />
+  <package id="SharpZipLib" version="1.3.3" targetFramework="net472" />
+</packages>