Sfoglia il codice sorgente

Merge branch 'Release2.3' of http://36.129.163.148:10080/gaoshipeng/OTS2_0 into Release2.3

gsp 4 anni fa
parent
commit
5fe5c91edd

+ 3 - 3
Bin/x64/Debug/Config/ProData/ReportTemplateConfig.xml

@@ -15,7 +15,7 @@
   </M_YMYJ>
   <M_KLFXJG>
     <b_ck_klcc_xsmk>True</b_ck_klcc_xsmk>
-    <index_cb_klcc_jsfs>0</index_cb_klcc_jsfs>
+    <index_cb_klcc_jsfs>2</index_cb_klcc_jsfs>
     <index_cb_klcc_ljb>0</index_cb_klcc_ljb>
     <index_cb_klcc_klfw>0</index_cb_klcc_klfw>
     <b_cb_jzwfl_xsmk>True</b_cb_jzwfl_xsmk>
@@ -50,7 +50,7 @@
     </list_str_tb_yscf_ysxx>
   </M_YSFXJG>
   <M_SYXT>
-    <b_ck_syxt_xsmk>False</b_ck_syxt_xsmk>
+    <b_ck_syxt_xsmk>True</b_ck_syxt_xsmk>
     <index_cb_syxt_jsfs>0</index_cb_syxt_jsfs>
     <index_cb_syxt_klfw>0</index_cb_syxt_klfw>
     <str_cb_syxt_mhxssl>2</str_cb_syxt_mhxssl>
@@ -72,7 +72,7 @@
     </list_lbv_syxt_mblb_index>
   </M_SYXT>
   <M_KLLBXX>
-    <b_ck_kllb_xsmk>False</b_ck_kllb_xsmk>
+    <b_ck_kllb_xsmk>True</b_ck_kllb_xsmk>
     <index_cb_kllb_jsfs>0</index_cb_kllb_jsfs>
     <index_cb_kllb_klfw>0</index_cb_kllb_klfw>
     <int_tb_kllb_ylsx>1</int_tb_kllb_ylsx>

BIN
Bin/x64/Debug/Resources/ReportTemplate/group1.rmf


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

@@ -761,7 +761,7 @@
 	  <Control name="str9" text="Color" />
 	  <Control name="str10" text="TotalParticles" />
 	  <Control name="str11" text="Small" />
-	  <Control name="str13" text="AreaRadio" />
+	  <Control name="str13" text="AreaRadio%" />
 	   <Control name="partcletype0" text="SMALL" />
 	  <Control name="partcletype1" text="OVERSIZE" />
 	  <Control name="partcletype2" text="AVE_GRAY_NOT_INRANRE" />

+ 9 - 9
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -632,7 +632,7 @@
 	  <Control name="partcletype6" text="不含分析元素的颗粒" />
       <Control name="partcletype7" text="非夹杂物颗粒SiC" />
 	  <Control name="partcletype8" text="非夹杂物颗粒FeO" />
-	  <Control name="partcletype9" text="未识别颗粒" />
+	  <Control name="partcletype9" text="未识别颗粒/非夹杂物" />
 	  <Control name="partcletype10" text="分析颗粒" />
     </Controls>
  </Form>
@@ -737,7 +737,7 @@
 	  <Control name="partcletype6" text="不含分析元素的颗粒" />
       <Control name="partcletype7" text="非夹杂物颗粒SiC" />
 	  <Control name="partcletype8" text="非夹杂物颗粒FeO" />
-	  <Control name="partcletype9" text="未识别颗粒" />
+	  <Control name="partcletype9" text="未识别颗粒/非夹杂物" />
     </Controls>
  </Form>
  <Form>
@@ -757,7 +757,7 @@
 	  <Control name="str9" text="代表色" />
 	  <Control name="str10" text="颗粒数" />
 	  <Control name="str11" text="小颗粒" />
-	  <Control name="str13" text="面积占比" />
+	  <Control name="str13" text="面积占比%" />
 	  <Control name="partcletype0" text="过小颗粒" />
 	  <Control name="partcletype1" text="过大颗粒" />
 	  <Control name="partcletype2" text="亮度不在分析范围内的颗粒" />
@@ -765,7 +765,7 @@
 	  <Control name="partcletype6" text="不含分析元素的颗粒" />
       <Control name="partcletype7" text="非夹杂物颗粒SiC" />
 	  <Control name="partcletype8" text="非夹杂物颗粒FeO" />
-	  <Control name="partcletype9" text="未识别颗粒" />
+	  <Control name="partcletype9" text="未识别颗粒/非夹杂物" />
 	  <Control name="str20" text="尖晶石" />
 	  <Control name="str21" text="氧化物" />
 	  <Control name="str22" text="硫氧化物" />
@@ -803,7 +803,7 @@
 	  <Control name="partcletype6" text="不含分析元素的颗粒" />
       <Control name="partcletype7" text="非夹杂物颗粒SiC" />
 	  <Control name="partcletype8" text="非夹杂物颗粒FeO" />
-	  <Control name="partcletype9" text="未识别颗粒" />
+	  <Control name="partcletype9" text="未识别颗粒/非夹杂物" />
     </Controls>
  </Form>
  <Form>
@@ -937,7 +937,7 @@
 	  <Control name="str8" text="灰度#" />
 	  <Control name="str9" text="移动SEM到当前位置" />
 	  <Control name="str10" text="移动SEM到颗粒视域位置" />
-          <Control name="partcletype9" text="未识别颗粒" />
+          <Control name="partcletype9" text="未识别颗粒/非夹杂物" />
 	  <Control name="partcletype10" text="分析颗粒" />
     </Controls>
  </Form>
@@ -1328,7 +1328,7 @@
 	  <Control name="partcletype6" text="不含分析元素的颗粒" />
       <Control name="partcletype7" text="非夹杂物颗粒SiC" />
 	  <Control name="partcletype8" text="非夹杂物颗粒FeO" />
-	  <Control name="partcletype9" text="未识别颗粒" />
+	  <Control name="partcletype9" text="未识别颗粒/非夹杂物" />
     </Controls>
  </Form>
  <Form>
@@ -1373,7 +1373,7 @@
 	  <Control name="partcletype6" text="不含分析元素的颗粒" />
       <Control name="partcletype7" text="非夹杂物颗粒SiC" />
 	  <Control name="partcletype8" text="非夹杂物颗粒FeO" />
-	  <Control name="partcletype9" text="未识别颗粒" /> 
+	  <Control name="partcletype9" text="未识别颗粒/非夹杂物" /> 
 	  <Control name="str21" text="面积μm²" />
 	  <Control name="str22" text="等效圆直径μm" />
 	  <Control name="str23" text="最长直径μm" />
@@ -1402,7 +1402,7 @@
 	  <Control name="str8" text="不进行x-ray分析的颗粒" />
 	  <Control name="str9" text="非夹杂物颗粒SiC" />
 	  <Control name="str10" text="非夹杂物颗粒FeO" />
-	  <Control name="str11" text="未识别颗粒" />
+	  <Control name="str11" text="未识别颗粒/非夹杂物" />
     </Controls>
  </Form>
   <!-- OTSPeriodicTable -->

+ 128 - 81
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.Designer.cs

@@ -67,6 +67,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.button_DelHole = new System.Windows.Forms.Button();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
             this.button_Ok = new System.Windows.Forms.Button();
+            this.helpProvider1 = new System.Windows.Forms.HelpProvider();
             ((System.ComponentModel.ISupportInitialize)(this.m_ctrlStagePicture)).BeginInit();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -77,44 +78,49 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // m_ctrlStagePicture
             // 
             this.m_ctrlStagePicture.BackColor = System.Drawing.Color.White;
-            this.m_ctrlStagePicture.Location = new System.Drawing.Point(831, 14);
-            this.m_ctrlStagePicture.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.m_ctrlStagePicture.Location = new System.Drawing.Point(554, 10);
+            this.m_ctrlStagePicture.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.m_ctrlStagePicture.Name = "m_ctrlStagePicture";
-            this.m_ctrlStagePicture.Size = new System.Drawing.Size(916, 848);
+            this.m_ctrlStagePicture.Size = new System.Drawing.Size(610, 566);
             this.m_ctrlStagePicture.TabIndex = 2;
             this.m_ctrlStagePicture.TabStop = false;
+            this.m_ctrlStagePicture.Paint += new System.Windows.Forms.PaintEventHandler(this.m_ctrlStagePicture_Paint);
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(26, 15);
+            this.label1.Location = new System.Drawing.Point(18, 11);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(116, 18);
+            this.label1.Size = new System.Drawing.Size(77, 12);
             this.label1.TabIndex = 3;
             this.label1.Text = "样品台名称:";
             // 
             // tStageName
             // 
-            this.tStageName.Location = new System.Drawing.Point(148, 12);
+            this.tStageName.Location = new System.Drawing.Point(98, 8);
+            this.tStageName.Margin = new System.Windows.Forms.Padding(2);
             this.tStageName.Name = "tStageName";
-            this.tStageName.Size = new System.Drawing.Size(664, 28);
+            this.tStageName.Size = new System.Drawing.Size(444, 21);
             this.tStageName.TabIndex = 4;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(26, 64);
+            this.label2.Location = new System.Drawing.Point(18, 42);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(98, 18);
+            this.label2.Size = new System.Drawing.Size(65, 12);
             this.label2.TabIndex = 5;
             this.label2.Text = "坐标系统:";
             // 
             // radioButton_OTS
             // 
             this.radioButton_OTS.AutoSize = true;
-            this.radioButton_OTS.Location = new System.Drawing.Point(148, 64);
+            this.radioButton_OTS.Location = new System.Drawing.Point(98, 42);
+            this.radioButton_OTS.Margin = new System.Windows.Forms.Padding(2);
             this.radioButton_OTS.Name = "radioButton_OTS";
-            this.radioButton_OTS.Size = new System.Drawing.Size(132, 22);
+            this.radioButton_OTS.Size = new System.Drawing.Size(89, 16);
             this.radioButton_OTS.TabIndex = 6;
             this.radioButton_OTS.TabStop = true;
             this.radioButton_OTS.Text = "OTS坐标系统";
@@ -123,9 +129,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // radioButton_SEM
             // 
             this.radioButton_SEM.AutoSize = true;
-            this.radioButton_SEM.Location = new System.Drawing.Point(314, 64);
+            this.radioButton_SEM.Location = new System.Drawing.Point(210, 42);
+            this.radioButton_SEM.Margin = new System.Windows.Forms.Padding(2);
             this.radioButton_SEM.Name = "radioButton_SEM";
-            this.radioButton_SEM.Size = new System.Drawing.Size(132, 22);
+            this.radioButton_SEM.Size = new System.Drawing.Size(89, 16);
             this.radioButton_SEM.TabIndex = 10;
             this.radioButton_SEM.TabStop = true;
             this.radioButton_SEM.Text = "SEM坐标系统";
@@ -135,9 +142,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(20, 38);
+            this.label3.Location = new System.Drawing.Point(14, 26);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(152, 18);
+            this.label3.Size = new System.Drawing.Size(101, 12);
             this.label3.TabIndex = 8;
             this.label3.Text = "样品台边框形状:";
             // 
@@ -155,92 +163,104 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.groupBox1.Controls.Add(this.radioButton_BoundarySquare);
             this.groupBox1.Controls.Add(this.radioButton_BoundaryCircle);
             this.groupBox1.Controls.Add(this.label3);
-            this.groupBox1.Location = new System.Drawing.Point(6, 92);
+            this.groupBox1.Location = new System.Drawing.Point(4, 62);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(806, 171);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox1.Size = new System.Drawing.Size(538, 114);
             this.groupBox1.TabIndex = 12;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "样品台边框";
             // 
             // tBoundaryHeight
             // 
-            this.tBoundaryHeight.Location = new System.Drawing.Point(534, 114);
+            this.tBoundaryHeight.Location = new System.Drawing.Point(356, 76);
+            this.tBoundaryHeight.Margin = new System.Windows.Forms.Padding(2);
             this.tBoundaryHeight.Name = "tBoundaryHeight";
-            this.tBoundaryHeight.Size = new System.Drawing.Size(122, 28);
+            this.tBoundaryHeight.Size = new System.Drawing.Size(82, 21);
             this.tBoundaryHeight.TabIndex = 19;
             // 
             // label8
             // 
             this.label8.AutoSize = true;
-            this.label8.Location = new System.Drawing.Point(448, 117);
+            this.label8.Location = new System.Drawing.Point(298, 78);
+            this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(62, 18);
+            this.label8.Size = new System.Drawing.Size(41, 12);
             this.label8.TabIndex = 18;
             this.label8.Text = "高度:";
             // 
             // tBoundaryWide
             // 
-            this.tBoundaryWide.Location = new System.Drawing.Point(534, 70);
+            this.tBoundaryWide.Location = new System.Drawing.Point(356, 46);
+            this.tBoundaryWide.Margin = new System.Windows.Forms.Padding(2);
             this.tBoundaryWide.Name = "tBoundaryWide";
-            this.tBoundaryWide.Size = new System.Drawing.Size(122, 28);
+            this.tBoundaryWide.Size = new System.Drawing.Size(82, 21);
             this.tBoundaryWide.TabIndex = 17;
             // 
             // label7
             // 
             this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(448, 74);
+            this.label7.Location = new System.Drawing.Point(298, 50);
+            this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(62, 18);
+            this.label7.Size = new System.Drawing.Size(41, 12);
             this.label7.TabIndex = 16;
             this.label7.Text = "宽度:";
             // 
             // tBoundaryY
             // 
-            this.tBoundaryY.Location = new System.Drawing.Point(226, 114);
+            this.tBoundaryY.Location = new System.Drawing.Point(150, 76);
+            this.tBoundaryY.Margin = new System.Windows.Forms.Padding(2);
             this.tBoundaryY.Name = "tBoundaryY";
-            this.tBoundaryY.Size = new System.Drawing.Size(122, 28);
+            this.tBoundaryY.Size = new System.Drawing.Size(82, 21);
             this.tBoundaryY.TabIndex = 15;
             // 
             // label6
             // 
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(186, 117);
+            this.label6.Location = new System.Drawing.Point(124, 78);
+            this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(35, 18);
+            this.label6.Size = new System.Drawing.Size(23, 12);
             this.label6.TabIndex = 14;
             this.label6.Text = "Y:";
             // 
             // tBoundaryX
             // 
-            this.tBoundaryX.Location = new System.Drawing.Point(226, 70);
+            this.tBoundaryX.Location = new System.Drawing.Point(150, 46);
+            this.tBoundaryX.Margin = new System.Windows.Forms.Padding(2);
             this.tBoundaryX.Name = "tBoundaryX";
-            this.tBoundaryX.Size = new System.Drawing.Size(122, 28);
+            this.tBoundaryX.Size = new System.Drawing.Size(82, 21);
             this.tBoundaryX.TabIndex = 13;
             // 
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(186, 74);
+            this.label5.Location = new System.Drawing.Point(124, 50);
+            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(35, 18);
+            this.label5.Size = new System.Drawing.Size(23, 12);
             this.label5.TabIndex = 12;
             this.label5.Text = "X:";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(20, 74);
+            this.label4.Location = new System.Drawing.Point(14, 50);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(116, 18);
+            this.label4.Size = new System.Drawing.Size(77, 12);
             this.label4.TabIndex = 11;
             this.label4.Text = "中心点坐标:";
             // 
             // radioButton_BoundarySquare
             // 
             this.radioButton_BoundarySquare.AutoSize = true;
-            this.radioButton_BoundarySquare.Location = new System.Drawing.Point(280, 34);
+            this.radioButton_BoundarySquare.Location = new System.Drawing.Point(186, 22);
+            this.radioButton_BoundarySquare.Margin = new System.Windows.Forms.Padding(2);
             this.radioButton_BoundarySquare.Name = "radioButton_BoundarySquare";
-            this.radioButton_BoundarySquare.Size = new System.Drawing.Size(69, 22);
+            this.radioButton_BoundarySquare.Size = new System.Drawing.Size(47, 16);
             this.radioButton_BoundarySquare.TabIndex = 10;
             this.radioButton_BoundarySquare.TabStop = true;
             this.radioButton_BoundarySquare.Text = "方形";
@@ -250,9 +270,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // radioButton_BoundaryCircle
             // 
             this.radioButton_BoundaryCircle.AutoSize = true;
-            this.radioButton_BoundaryCircle.Location = new System.Drawing.Point(189, 34);
+            this.radioButton_BoundaryCircle.Location = new System.Drawing.Point(126, 22);
+            this.radioButton_BoundaryCircle.Margin = new System.Windows.Forms.Padding(2);
             this.radioButton_BoundaryCircle.Name = "radioButton_BoundaryCircle";
-            this.radioButton_BoundaryCircle.Size = new System.Drawing.Size(69, 22);
+            this.radioButton_BoundaryCircle.Size = new System.Drawing.Size(47, 16);
             this.radioButton_BoundaryCircle.TabIndex = 9;
             this.radioButton_BoundaryCircle.TabStop = true;
             this.radioButton_BoundaryCircle.Text = "圆形";
@@ -273,92 +294,104 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.groupBox2.Controls.Add(this.radioButton_StandardsampleSqare);
             this.groupBox2.Controls.Add(this.radioButton_StandardsampleCircle);
             this.groupBox2.Controls.Add(this.label14);
-            this.groupBox2.Location = new System.Drawing.Point(6, 268);
+            this.groupBox2.Location = new System.Drawing.Point(4, 178);
+            this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Size = new System.Drawing.Size(806, 160);
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox2.Size = new System.Drawing.Size(538, 106);
             this.groupBox2.TabIndex = 13;
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "标样";
             // 
             // tStandardsampleHeight
             // 
-            this.tStandardsampleHeight.Location = new System.Drawing.Point(534, 114);
+            this.tStandardsampleHeight.Location = new System.Drawing.Point(356, 76);
+            this.tStandardsampleHeight.Margin = new System.Windows.Forms.Padding(2);
             this.tStandardsampleHeight.Name = "tStandardsampleHeight";
-            this.tStandardsampleHeight.Size = new System.Drawing.Size(122, 28);
+            this.tStandardsampleHeight.Size = new System.Drawing.Size(82, 21);
             this.tStandardsampleHeight.TabIndex = 19;
             // 
             // label9
             // 
             this.label9.AutoSize = true;
-            this.label9.Location = new System.Drawing.Point(448, 117);
+            this.label9.Location = new System.Drawing.Point(298, 78);
+            this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(62, 18);
+            this.label9.Size = new System.Drawing.Size(41, 12);
             this.label9.TabIndex = 18;
             this.label9.Text = "高度:";
             // 
             // tStandardsampleWide
             // 
-            this.tStandardsampleWide.Location = new System.Drawing.Point(534, 70);
+            this.tStandardsampleWide.Location = new System.Drawing.Point(356, 46);
+            this.tStandardsampleWide.Margin = new System.Windows.Forms.Padding(2);
             this.tStandardsampleWide.Name = "tStandardsampleWide";
-            this.tStandardsampleWide.Size = new System.Drawing.Size(122, 28);
+            this.tStandardsampleWide.Size = new System.Drawing.Size(82, 21);
             this.tStandardsampleWide.TabIndex = 17;
             // 
             // label10
             // 
             this.label10.AutoSize = true;
-            this.label10.Location = new System.Drawing.Point(448, 74);
+            this.label10.Location = new System.Drawing.Point(298, 50);
+            this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(62, 18);
+            this.label10.Size = new System.Drawing.Size(41, 12);
             this.label10.TabIndex = 16;
             this.label10.Text = "宽度:";
             // 
             // tStandardsampleY
             // 
-            this.tStandardsampleY.Location = new System.Drawing.Point(226, 114);
+            this.tStandardsampleY.Location = new System.Drawing.Point(150, 76);
+            this.tStandardsampleY.Margin = new System.Windows.Forms.Padding(2);
             this.tStandardsampleY.Name = "tStandardsampleY";
-            this.tStandardsampleY.Size = new System.Drawing.Size(122, 28);
+            this.tStandardsampleY.Size = new System.Drawing.Size(82, 21);
             this.tStandardsampleY.TabIndex = 15;
             // 
             // label11
             // 
             this.label11.AutoSize = true;
-            this.label11.Location = new System.Drawing.Point(186, 117);
+            this.label11.Location = new System.Drawing.Point(124, 78);
+            this.label11.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(35, 18);
+            this.label11.Size = new System.Drawing.Size(23, 12);
             this.label11.TabIndex = 14;
             this.label11.Text = "Y:";
             // 
             // tStandardsampleX
             // 
-            this.tStandardsampleX.Location = new System.Drawing.Point(226, 70);
+            this.tStandardsampleX.Location = new System.Drawing.Point(150, 46);
+            this.tStandardsampleX.Margin = new System.Windows.Forms.Padding(2);
             this.tStandardsampleX.Name = "tStandardsampleX";
-            this.tStandardsampleX.Size = new System.Drawing.Size(122, 28);
+            this.tStandardsampleX.Size = new System.Drawing.Size(82, 21);
             this.tStandardsampleX.TabIndex = 13;
             // 
             // label12
             // 
             this.label12.AutoSize = true;
-            this.label12.Location = new System.Drawing.Point(186, 74);
+            this.label12.Location = new System.Drawing.Point(124, 50);
+            this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(35, 18);
+            this.label12.Size = new System.Drawing.Size(23, 12);
             this.label12.TabIndex = 12;
             this.label12.Text = "X:";
             // 
             // label13
             // 
             this.label13.AutoSize = true;
-            this.label13.Location = new System.Drawing.Point(20, 74);
+            this.label13.Location = new System.Drawing.Point(14, 50);
+            this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(116, 18);
+            this.label13.Size = new System.Drawing.Size(77, 12);
             this.label13.TabIndex = 11;
             this.label13.Text = "中心点坐标:";
             // 
             // radioButton_StandardsampleSqare
             // 
             this.radioButton_StandardsampleSqare.AutoSize = true;
-            this.radioButton_StandardsampleSqare.Location = new System.Drawing.Point(280, 34);
+            this.radioButton_StandardsampleSqare.Location = new System.Drawing.Point(186, 22);
+            this.radioButton_StandardsampleSqare.Margin = new System.Windows.Forms.Padding(2);
             this.radioButton_StandardsampleSqare.Name = "radioButton_StandardsampleSqare";
-            this.radioButton_StandardsampleSqare.Size = new System.Drawing.Size(69, 22);
+            this.radioButton_StandardsampleSqare.Size = new System.Drawing.Size(47, 16);
             this.radioButton_StandardsampleSqare.TabIndex = 10;
             this.radioButton_StandardsampleSqare.TabStop = true;
             this.radioButton_StandardsampleSqare.Text = "方形";
@@ -368,9 +401,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // radioButton_StandardsampleCircle
             // 
             this.radioButton_StandardsampleCircle.AutoSize = true;
-            this.radioButton_StandardsampleCircle.Location = new System.Drawing.Point(189, 34);
+            this.radioButton_StandardsampleCircle.Location = new System.Drawing.Point(126, 22);
+            this.radioButton_StandardsampleCircle.Margin = new System.Windows.Forms.Padding(2);
             this.radioButton_StandardsampleCircle.Name = "radioButton_StandardsampleCircle";
-            this.radioButton_StandardsampleCircle.Size = new System.Drawing.Size(69, 22);
+            this.radioButton_StandardsampleCircle.Size = new System.Drawing.Size(47, 16);
             this.radioButton_StandardsampleCircle.TabIndex = 9;
             this.radioButton_StandardsampleCircle.TabStop = true;
             this.radioButton_StandardsampleCircle.Text = "圆形";
@@ -380,17 +414,19 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // label14
             // 
             this.label14.AutoSize = true;
-            this.label14.Location = new System.Drawing.Point(20, 38);
+            this.label14.Location = new System.Drawing.Point(14, 26);
+            this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(98, 18);
+            this.label14.Size = new System.Drawing.Size(65, 12);
             this.label14.TabIndex = 8;
             this.label14.Text = "标样形状:";
             // 
             // button_Generate
             // 
-            this.button_Generate.Location = new System.Drawing.Point(831, 876);
+            this.button_Generate.Location = new System.Drawing.Point(554, 584);
+            this.button_Generate.Margin = new System.Windows.Forms.Padding(2);
             this.button_Generate.Name = "button_Generate";
-            this.button_Generate.Size = new System.Drawing.Size(699, 44);
+            this.button_Generate.Size = new System.Drawing.Size(466, 30);
             this.button_Generate.TabIndex = 16;
             this.button_Generate.Text = "生成";
             this.button_Generate.UseVisualStyleBackColor = true;
@@ -404,22 +440,24 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.dataGridView_Holes.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.dataGridView_Holes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.dataGridView_Holes.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.dataGridView_Holes.Location = new System.Drawing.Point(3, 24);
+            this.dataGridView_Holes.Location = new System.Drawing.Point(2, 16);
+            this.dataGridView_Holes.Margin = new System.Windows.Forms.Padding(2);
             this.dataGridView_Holes.Name = "dataGridView_Holes";
             this.dataGridView_Holes.RowHeadersVisible = false;
             this.dataGridView_Holes.RowHeadersWidth = 62;
             this.dataGridView_Holes.RowTemplate.Height = 20;
             this.dataGridView_Holes.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
-            this.dataGridView_Holes.Size = new System.Drawing.Size(772, 467);
+            this.dataGridView_Holes.Size = new System.Drawing.Size(514, 312);
             this.dataGridView_Holes.TabIndex = 17;
             this.dataGridView_Holes.CurrentCellChanged += new System.EventHandler(this.dataGridView_Holes_CurrentCellChanged);
             this.dataGridView_Holes.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dataGridView_Holes_Scroll);
             // 
             // button_AddHole
             // 
-            this.button_AddHole.Location = new System.Drawing.Point(788, 454);
+            this.button_AddHole.Location = new System.Drawing.Point(526, 302);
+            this.button_AddHole.Margin = new System.Windows.Forms.Padding(2);
             this.button_AddHole.Name = "button_AddHole";
-            this.button_AddHole.Size = new System.Drawing.Size(34, 128);
+            this.button_AddHole.Size = new System.Drawing.Size(22, 86);
             this.button_AddHole.TabIndex = 18;
             this.button_AddHole.Text = "增加样品孔";
             this.button_AddHole.UseVisualStyleBackColor = true;
@@ -427,9 +465,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // 
             // button_DelHole
             // 
-            this.button_DelHole.Location = new System.Drawing.Point(788, 586);
+            this.button_DelHole.Location = new System.Drawing.Point(526, 390);
+            this.button_DelHole.Margin = new System.Windows.Forms.Padding(2);
             this.button_DelHole.Name = "button_DelHole";
-            this.button_DelHole.Size = new System.Drawing.Size(34, 128);
+            this.button_DelHole.Size = new System.Drawing.Size(22, 86);
             this.button_DelHole.TabIndex = 19;
             this.button_DelHole.Text = "删除样品孔";
             this.button_DelHole.UseVisualStyleBackColor = true;
@@ -438,9 +477,11 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // groupBox3
             // 
             this.groupBox3.Controls.Add(this.dataGridView_Holes);
-            this.groupBox3.Location = new System.Drawing.Point(6, 430);
+            this.groupBox3.Location = new System.Drawing.Point(4, 286);
+            this.groupBox3.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(778, 494);
+            this.groupBox3.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox3.Size = new System.Drawing.Size(518, 330);
             this.groupBox3.TabIndex = 20;
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "样品孔信息:";
@@ -448,9 +489,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // button_Ok
             // 
             this.button_Ok.Enabled = false;
-            this.button_Ok.Location = new System.Drawing.Point(1570, 876);
+            this.button_Ok.Location = new System.Drawing.Point(1046, 584);
+            this.button_Ok.Margin = new System.Windows.Forms.Padding(2);
             this.button_Ok.Name = "button_Ok";
-            this.button_Ok.Size = new System.Drawing.Size(177, 44);
+            this.button_Ok.Size = new System.Drawing.Size(118, 30);
             this.button_Ok.TabIndex = 21;
             this.button_Ok.Text = "保存";
             this.button_Ok.UseVisualStyleBackColor = true;
@@ -458,9 +500,9 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             // 
             // DlgStageEdit
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
-            this.ClientSize = new System.Drawing.Size(1755, 927);
+            this.ClientSize = new System.Drawing.Size(1170, 618);
             this.Controls.Add(this.button_Ok);
             this.Controls.Add(this.button_DelHole);
             this.Controls.Add(this.groupBox3);
@@ -474,16 +516,20 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.Controls.Add(this.tStageName);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.m_ctrlStagePicture);
+            this.HelpButton = true;
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(1777, 983);
+            this.MaximumSize = new System.Drawing.Size(1190, 669);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(1274, 678);
+            this.MinimumSize = new System.Drawing.Size(855, 466);
             this.Name = "DlgStageEdit";
             this.ShowIcon = false;
             this.ShowInTaskbar = false;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "DlgStageEdit";
+            this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.DlgStageEdit_HelpButtonClicked);
             this.Load += new System.EventHandler(this.DlgStageEdit_Load);
+            this.Paint += new System.Windows.Forms.PaintEventHandler(this.DlgStageEdit_Paint);
             ((System.ComponentModel.ISupportInitialize)(this.m_ctrlStagePicture)).EndInit();
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
@@ -536,5 +582,6 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
         private System.Windows.Forms.Button button_DelHole;
         private System.Windows.Forms.GroupBox groupBox3;
         private System.Windows.Forms.Button button_Ok;
+        private System.Windows.Forms.HelpProvider helpProvider1;
     }
 }

+ 37 - 2
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.cs

@@ -54,6 +54,22 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             {
                 LoadStageData(m_pStage);
             }
+            SetHelp();
+            //Object pDC = new Object();
+            //pDC = m_ctrlStagePicture.CreateGraphics();
+            ////消除锯齿
+            //((Graphics)pDC).SmoothingMode = SmoothingMode.AntiAlias;  //图片柔顺模式选择
+            //((Graphics)pDC).InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
+            //((Graphics)pDC).CompositingQuality = CompositingQuality.HighQuality;//再加一点 
+
+
+        }
+        void SetHelp()
+        {
+            helpProvider1.SetHelpString(label1, "样品台名不能为空字串,不能含\',\'字符!");
+            helpProvider1.SetHelpString(groupBox1, "样品台边框行有5个数值参数。形状参数,中心x坐标,中心y坐标,宽度或直径,高度或0");
+            helpProvider1.SetHelpString(groupBox2, "标样信息行有5个数值参数。形状参数,中心x坐标,中心y坐标,宽度或直径,高度或0");
+            helpProvider1.SetHelpString(groupBox3, "样品孔信息行有6个数值参数,1个字符串参数,5个数值参数。1个字符串参数为样品孔名。5个数值参数为形状参数,中心x坐标,中心y坐标,宽度或直径,高度或0。");
         }
         void LoadStageData(CStage cStage)
         {
@@ -203,6 +219,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             if (!CheckParams())
             {
                 this.button_Ok.Enabled = false;
+                MessageBox.Show("Please check Params!");
                 return;
             }
             CSEMStageData a_pCSEMStageData = new CSEMStageData();
@@ -377,18 +394,21 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             int nBounderyWidth = (int)(BounderyRect.Width);//um,,pixle is (nWidth - PIC_EDGE * 2 )
             int nBounderyHeight = (int)(BounderyRect.Height);
             double PixSize = 0;
+            double coordinateSystemEndpoint = 0;
             if (nBounderyWidth > nBounderyHeight)
             {
                 PixSize = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
+                coordinateSystemEndpoint = nBounderyWidth/2;
             }
             else
             {
                 PixSize = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
+                coordinateSystemEndpoint = nBounderyHeight/2;
             }
             //draw boundery
             Brush pLTGrayBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
             stageDisplayHelp.DrawStageBoundery(m_pStage, nWidth, nHeight, pDC, PixSize);
-
+            
             ////draw STD
             //Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
 
@@ -401,7 +421,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
 
             // draw ratio
             stageDisplayHelp.DrawRatio(nBounderyWidth, nWidth, nHeight, pDC, (IntPtr)pWnd, rc);
-
+            stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSize, coordinateSystemEndpoint);
             pLTGrayBrush.Dispose();
             //pBlackBrush.Dispose();
             //pWriteBrush.Dispose();
@@ -479,5 +499,20 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             }
             return true;
         }
+
+        private void m_ctrlStagePicture_Paint(object sender, PaintEventArgs e)
+        {
+
+        }
+
+        private void DlgStageEdit_Paint(object sender, PaintEventArgs e)
+        {
+          
+        }
+
+        private void DlgStageEdit_HelpButtonClicked(object sender, CancelEventArgs e)
+        {
+            MessageBox.Show("样品台文件说明\n样品台名行只能有一个字符串参数。样品台名不能为空字串,不能含\',\'字符\n样品台边框行有5个数值参数。形状参数,中心x坐标,中心y坐标,宽度或直径,高度或0\n标样信息行有5个数值参数。形状参数,中心x坐标,中心y坐标,宽度或直径,高度或0\n样品孔信息行有6个数值参数,1个字符串参数,5个数值参数。1个字符串参数为样品孔名。5个数值参数为形状参数,中心x坐标,中心y坐标,宽度或直径,高度或0。", "Help",MessageBoxButtons.OK,MessageBoxIcon.Information);
+        }
     }
 }

+ 3 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.resx

@@ -117,4 +117,7 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="helpProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 81 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/StageDisplayHelp.cs

@@ -300,6 +300,87 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             return pDomain;
         }
 
+        #region   画出X轴与Y轴
+        /// <summary>
+        /// 在任意的panel里画一个坐标,坐标所在的四边形距离panel边50像素
+        /// </summary>
+        /// <param name="pan"></param>
+        public void DrawXY(Object a_pDC, double width,double height, double a_dPixSize,double coordinateSystemEndpoint)
+        {
+            if (a_pDC == null)
+            {
+                return;
+            }
+            Graphics g = (Graphics)a_pDC;
+
+            //绘制X轴,
+            double ObjectCenterX =  width/ 2;     
+            double ObjectCenterY = height / 2;
+            int X0 = (int)(coordinateSystemEndpoint / a_dPixSize + ObjectCenterX);
+            int Y0 = (int)(0 / a_dPixSize + ObjectCenterY);
+            int X1 = (int)(-coordinateSystemEndpoint / a_dPixSize + ObjectCenterX);
+            int Y1 = (int)(0 / a_dPixSize + ObjectCenterY);
+            Point px1 = new Point(X0, Y0);
+            Point px2 = new Point(X1, Y1);
+            Pen pen = new Pen(Brushes.Green, 1);
+            g.DrawLine(pen, px1, px2);
+            //绘制Y轴
+            int X3 = (int)(0 / a_dPixSize + ObjectCenterX);
+            int Y3 = (int)(coordinateSystemEndpoint / a_dPixSize + ObjectCenterY);
+            int X4 = (int)(0 / a_dPixSize + ObjectCenterX);
+            int Y4 = (int)(-coordinateSystemEndpoint / a_dPixSize + ObjectCenterY);
+            PointF py1 = new PointF(X3, Y3);
+            PointF py2 = new PointF(X4, Y4);
+            g.DrawLine(pen, py1, py2);
+            g.DrawString("0", new Font("宋体 ", 9f), Brushes.Green, new PointF((float)ObjectCenterX - 12, (float)ObjectCenterY + 3));
+            int move = 5,len=10;
+            for (int i = 1; i <= len; i++)    //len等分Y正轴
+            {
+                Point px3 = new Point((int)ObjectCenterX + move, (int)(ObjectCenterY + (-coordinateSystemEndpoint / a_dPixSize) / len * i));
+                Point px4 = new Point((int)ObjectCenterX, (int)(ObjectCenterY + (-coordinateSystemEndpoint / a_dPixSize) / len * i));
+                string sx = ((int)(-(-coordinateSystemEndpoint) / len * i)).ToString();
+                g.DrawLine(pen, px3, px4);
+                StringFormat drawFormat = new StringFormat();
+                drawFormat.Alignment = StringAlignment.Far;
+                drawFormat.LineAlignment = StringAlignment.Center;
+                g.DrawString(sx, new Font("宋体", 8f), Brushes.Green, new Point((int)ObjectCenterX - 5, (int)(ObjectCenterY + (-coordinateSystemEndpoint / a_dPixSize) / len * i)), drawFormat);
+            }
+            for (int i = 1; i <= len; i++)    
+            {
+                Point px3 = new Point((int)ObjectCenterX + move, (int)(ObjectCenterY + (coordinateSystemEndpoint / a_dPixSize) / len * i));
+                Point px4 = new Point((int)ObjectCenterX, (int)(ObjectCenterY + (coordinateSystemEndpoint / a_dPixSize) / len * i));
+                string sx = ((int)((-coordinateSystemEndpoint) / len * i)).ToString();
+                g.DrawLine(pen, px3, px4);
+                StringFormat drawFormat = new StringFormat();
+                drawFormat.Alignment = StringAlignment.Far;
+                drawFormat.LineAlignment = StringAlignment.Center;
+                g.DrawString(sx, new Font("宋体", 8f), Brushes.Green, new Point((int)ObjectCenterX - 5, (int)(ObjectCenterY + (coordinateSystemEndpoint / a_dPixSize) / len * i)), drawFormat);
+            }
+            for (int i = 1; i <= len; i++)    //len等分X正轴
+            {
+                Point px3 = new Point((int)(ObjectCenterX + (coordinateSystemEndpoint / a_dPixSize) / len * i) , (int)(ObjectCenterY + move));
+                Point px4 = new Point((int)(ObjectCenterX + (coordinateSystemEndpoint / a_dPixSize) / len * i), (int)ObjectCenterY);
+                string sx = ((int)(coordinateSystemEndpoint / len * i)).ToString();
+                g.DrawLine(pen, px3, px4);
+                StringFormat drawFormat = new StringFormat();
+                drawFormat.Alignment = StringAlignment.Far;
+                drawFormat.LineAlignment = StringAlignment.Center;
+                g.DrawString(sx, new Font("宋体", 6f), Brushes.Green, new Point((int)(ObjectCenterX + (coordinateSystemEndpoint / a_dPixSize) / len * i)+5, (int)(ObjectCenterY + 15)), drawFormat);
+            }
+            for (int i = 1; i <= len; i++)
+            {
+                Point px3 = new Point((int)(ObjectCenterX + (-coordinateSystemEndpoint / a_dPixSize) / len * i), (int)(ObjectCenterY + move));
+                Point px4 = new Point((int)(ObjectCenterX + (-coordinateSystemEndpoint / a_dPixSize) / len * i), (int)(ObjectCenterY));
+                string sx = ((int)((-coordinateSystemEndpoint) / len * i)).ToString();
+                g.DrawLine(pen, px3, px4);
+                StringFormat drawFormat = new StringFormat();
+                drawFormat.Alignment = StringAlignment.Far;
+                drawFormat.LineAlignment = StringAlignment.Center;
+                g.DrawString(sx, new Font("宋体", 6f), Brushes.Green, new Point((int)(ObjectCenterX + (-coordinateSystemEndpoint / a_dPixSize) / len * i)+5, (int)(ObjectCenterY + 15)), drawFormat);
+            }
 
+            //g.Dispose();
+        }
+        #endregion
     }
 }

+ 115 - 50
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -1469,67 +1469,132 @@ namespace OTSIncAReportGrids
             DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES);
             if (theFolder.Exists)
             {
-                //循环帧图,再循环各帧图中的颗粒,进行标记,保存
-                foreach (FileInfo nextifile in theFolder.GetFiles())
+                int numberOfPictures = 1;
+                for (int i = 0; i < theFolder.GetFiles().Count() - 1; i++)
                 {
-                    //找出所有的用户库文件,在这个目录中
-                    if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
+                    //if (dt_AllParticle.Select("  fieldid = " + i.ToString()).Count() == 0)
+                    //    continue;
+                    if (numberOfPictures > 10)
+                        continue;
+
+                    if (dataTable.Select(" fieldid = " + i.ToString()).Count() > 0)
                     {
-                        //确认对应的帧图名
-                        string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
-                        str_fieldid = str_fieldid.Substring(5, str_fieldid.Length - 5);//减去field字符长度
-                        if (dataTable.Select(" fieldid = " + str_fieldid).Count() > 0)
+                        numberOfPictures++;
+                        Image img = Image.FromFile(str_path_FIELD_FILES + theFolder.GetFiles()[i].Name);
+                        Bitmap ls_fieldbp = new Bitmap(img.Width, img.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+                        using (Graphics g = Graphics.FromImage(ls_fieldbp))
                         {
-                            Image img = Image.FromFile(nextifile.FullName);
-                            Bitmap ls_fieldbp = new Bitmap(img.Width, img.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
-                            using (Graphics g = Graphics.FromImage(ls_fieldbp))
-                            {
-                                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
-                                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
-                                g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
-                                g.DrawImage(img, 0, 0);
-                            }
+                            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
+                            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+                            g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
+                            g.DrawImage(img, 0, 0);
+                        }
 
-                            img.Dispose();
-                            img = null;
+                        img.Dispose();
+                        img = null;
 
-                            //循环将颗粒,进行标记到bitmap图上
-                            DataRow[] drlist = dt_AllParticle.Select("  fieldid = " + str_fieldid);
-                            for (int i_row = 0; i_row < drlist.Count(); i_row++)
+                        //循环将颗粒,进行标记到bitmap图上
+                        DataRow[] drlist = dt_AllParticle.Select("  fieldid = " + i.ToString());
+                        for (int i_row = 0; i_row < drlist.Count(); i_row++)
+                        {
+                            //string str_fieldid = drlist[i_row]["fieldid"].ToString();
+                            string str_particleid = drlist[i_row]["particleid"].ToString();
+                            string str_stdtypeid = drlist[i_row]["typeid"].ToString();
+                            string str_offset_rect_X = drlist[i_row]["RectLeft"].ToString();
+                            string str_offset_rect_Y = drlist[i_row]["RectTop"].ToString();
+                            string str_offset_rect_Width = drlist[i_row]["RectWidth"].ToString();
+                            string str_offset_rect_Height = drlist[i_row]["RectHeight"].ToString();
+
+                            //确定需要标记颗粒的定位
+                            Rectangle offset_rect = new Rectangle(Convert.ToInt32(str_offset_rect_X), Convert.ToInt32(str_offset_rect_Y),
+                    Convert.ToInt32(str_offset_rect_Width), Convert.ToInt32(str_offset_rect_Height));
+
+                            //向帧图进行标记颗粒位置
+                            Graphics g = Graphics.FromImage(ls_fieldbp);
+                            g.DrawRectangle(new Pen(Color.Aquamarine), offset_rect);
+
+                            //判断是否超出了图像外面,是的话,让文字在左侧显示,默认在右侧显示
+                            int ls_offsetx = offset_rect.X + offset_rect.Width;
+                            if (ls_offsetx > ls_fieldbp.Width - 10)
                             {
-                                //string str_fieldid = drlist[i_row]["fieldid"].ToString();
-                                string str_particleid = drlist[i_row]["particleid"].ToString();
-                                string str_stdtypeid = drlist[i_row]["typeid"].ToString();
-                                string str_offset_rect_X = drlist[i_row]["RectLeft"].ToString();
-                                string str_offset_rect_Y = drlist[i_row]["RectTop"].ToString();
-                                string str_offset_rect_Width = drlist[i_row]["RectWidth"].ToString();
-                                string str_offset_rect_Height = drlist[i_row]["RectHeight"].ToString();
-
-                                //确定需要标记颗粒的定位
-                                Rectangle offset_rect = new Rectangle(Convert.ToInt32(str_offset_rect_X), Convert.ToInt32(str_offset_rect_Y),
-                        Convert.ToInt32(str_offset_rect_Width), Convert.ToInt32(str_offset_rect_Height));
-
-                                //向帧图进行标记颗粒位置
-                                Graphics g = Graphics.FromImage(ls_fieldbp);
-                                g.DrawRectangle(new Pen(Color.Aquamarine), offset_rect);
-
-                                //判断是否超出了图像外面,是的话,让文字在左侧显示,默认在右侧显示
-                                int ls_offsetx = offset_rect.X + offset_rect.Width;
-                                if (ls_offsetx > ls_fieldbp.Width - 10)
-                                {
-                                    ls_offsetx = offset_rect.X - 10;
-                                }
-                                g.DrawString(str_fieldid + "" + str_particleid.ToString(),
-                                    new Font("黑体", 8), new SolidBrush(Color.Aqua), new PointF(ls_offsetx, offset_rect.Y));
+                                ls_offsetx = offset_rect.X - 10;
+                            }
+                            g.DrawString(i.ToString() + "" + str_particleid.ToString(),
+                                new Font("黑体", 8), new SolidBrush(Color.Aqua), new PointF(ls_offsetx, offset_rect.Y));
 
-                                //保存带有标记的帧图
-                                ls_fieldbp.Save(str_path_FIELD_FILES_MARK + str_fieldid.ToString() + ".bmp");
+                            //保存带有标记的帧图
+                            ls_fieldbp.Save(str_path_FIELD_FILES_MARK + i.ToString() + ".bmp");
 
-                                //ls_fieldbp.Dispose();
-                            }
+                            //ls_fieldbp.Dispose();
                         }
                     }
+
+
                 }
+
+
+
+                ////循环帧图,再循环各帧图中的颗粒,进行标记,保存
+                //foreach (FileInfo nextifile in theFolder.GetFiles())
+                //{
+                //    //找出所有的用户库文件,在这个目录中
+                //    if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
+                //    {
+                //        //确认对应的帧图名
+                //        string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
+                //        str_fieldid = str_fieldid.Substring(5, str_fieldid.Length - 5);//减去field字符长度
+                //        if (dataTable.Select(" fieldid = " + str_fieldid).Count() > 0)
+                //        {
+                //            Image img = Image.FromFile(nextifile.FullName);
+                //            Bitmap ls_fieldbp = new Bitmap(img.Width, img.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+                //            using (Graphics g = Graphics.FromImage(ls_fieldbp))
+                //            {
+                //                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
+                //                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+                //                g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
+                //                g.DrawImage(img, 0, 0);
+                //            }
+
+                //            img.Dispose();
+                //            img = null;
+
+                //            //循环将颗粒,进行标记到bitmap图上
+                //            DataRow[] drlist = dt_AllParticle.Select("  fieldid = " + str_fieldid);
+                //            for (int i_row = 0; i_row < drlist.Count(); i_row++)
+                //            {
+                //                //string str_fieldid = drlist[i_row]["fieldid"].ToString();
+                //                string str_particleid = drlist[i_row]["particleid"].ToString();
+                //                string str_stdtypeid = drlist[i_row]["typeid"].ToString();
+                //                string str_offset_rect_X = drlist[i_row]["RectLeft"].ToString();
+                //                string str_offset_rect_Y = drlist[i_row]["RectTop"].ToString();
+                //                string str_offset_rect_Width = drlist[i_row]["RectWidth"].ToString();
+                //                string str_offset_rect_Height = drlist[i_row]["RectHeight"].ToString();
+
+                //                //确定需要标记颗粒的定位
+                //                Rectangle offset_rect = new Rectangle(Convert.ToInt32(str_offset_rect_X), Convert.ToInt32(str_offset_rect_Y),
+                //        Convert.ToInt32(str_offset_rect_Width), Convert.ToInt32(str_offset_rect_Height));
+
+                //                //向帧图进行标记颗粒位置
+                //                Graphics g = Graphics.FromImage(ls_fieldbp);
+                //                g.DrawRectangle(new Pen(Color.Aquamarine), offset_rect);
+
+                //                //判断是否超出了图像外面,是的话,让文字在左侧显示,默认在右侧显示
+                //                int ls_offsetx = offset_rect.X + offset_rect.Width;
+                //                if (ls_offsetx > ls_fieldbp.Width - 10)
+                //                {
+                //                    ls_offsetx = offset_rect.X - 10;
+                //                }
+                //                g.DrawString(str_fieldid + "" + str_particleid.ToString(),
+                //                    new Font("黑体", 8), new SolidBrush(Color.Aqua), new PointF(ls_offsetx, offset_rect.Y));
+
+                //                //保存带有标记的帧图
+                //                ls_fieldbp.Save(str_path_FIELD_FILES_MARK + str_fieldid.ToString() + ".bmp");
+
+                //                //ls_fieldbp.Dispose();
+                //            }
+                //        }
+                //    }
+                //}
             }
             //
             GC.Collect();

+ 121 - 205
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -115,13 +115,23 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// <returns></returns>
         public bool InsertReportTemplateTable_ParticlesGridDevidePage()
         {
+
+            int serialNumber = 1;
+
             //------------------加载模块,获取数据-------------------------------------------------
             //if (m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage!=null)
             m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
 
             //根据sql条件,查询获取颗粒信息数据
             ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
-            DataTable dt_ParticlesGridDevidePage = fielddata.GetInfoForPartucleDevidePage(0, 200, "fieldid,particleid", "");
+            //DataTable dt_ParticlesGridDevidePage = fielddata.GetInfoForPartucleDevidePage(0, 200, "fieldid,particleid", "");
+            DataTable dt = fielddata.GetIncaSurfaceData();
+            //将颗粒大小排序(从大到小)
+            DataView dv = dt.DefaultView;
+            dv.Sort = "Area DESC";
+            DataTable dt_ParticlesGridDevidePage = dv.ToTable();
+
+
 
             string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath;
             //------------------加载模块,获取数据结束----------------------------------------------
@@ -197,125 +207,18 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             #endregion
 
-            //for (int i= 0;i < dt_ParticlesGridDevidePage.Rows.Count;i++)
-            //{
-            //    //获取颗粒的fieldid,和particleid
-            //    string str_fieldid = dt_ParticlesGridDevidePage.Rows[i]["fieldid"].ToString();
-            //    string str_particleid = dt_ParticlesGridDevidePage.Rows[i]["particleid"].ToString();
-            //    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i]["SubParticles"].ToString();
-            //    string str_typeid = dt_ParticlesGridDevidePage.Rows[i]["TypeId"].ToString();
-            //    string str_typename = dt_ParticlesGridDevidePage.Rows[i]["TypeName"].ToString();
-            //    string str_element = dt_ParticlesGridDevidePage.Rows[i]["Element"].ToString();
-
-
-
-            //    //获取原始颗粒图像
-            //    Bitmap bp_particle = new Bitmap(1, 1);
-            //    string str_path = str_resultPath + "\\FIELD_FILES\\";
-            //    string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
-
-            //    if (str_subparticles != null && str_subparticles != "")
-            //    {
-
-            //    }
-            //    else
-            //    {
-            //        //正常颗粒
-            //        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectHeight"]) };
-            //        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
-            //        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-            //        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i]["TypeId"].ToString() };
-
-
-            //        if (fielddata.GetParticleByFidAndPid(str_fieldid, str_particleid).XRayData != null)
-            //        {
-
-            //            //获取该颗粒的xray能谱图像
-            //            System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
-            //                str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
-            //            Bitmap ls_xraybpnew = new Bitmap(1, 1);
-            //            ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
-
-            //            //获取该颗粒的二次放大处理图像
-            //            Bitmap ls_processbitmap = new Bitmap(1, 1);
-            //            ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
-
-            //            //再将图像转成二进制流-------------------------------------------------------------------
-            //            //原图
-            //            MemoryStream newms_p1 = new MemoryStream();
-            //            bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
-            //            newms_p1.Seek(0, SeekOrigin.Begin);
-            //            byte[] newarr_p1 = new byte[newms_p1.Length];
-            //            newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
-
-            //            //二次放大图
-            //            MemoryStream newms_p2 = new MemoryStream();
-            //            ls_processbitmap.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
-            //            newms_p2.Seek(0, SeekOrigin.Begin);
-            //            byte[] newarr_p2 = new byte[newms_p2.Length];
-            //            newms_p2.Read(newarr_p2, 0, newarr_p2.Length);
-
-            //            //能谱图
-            //            MemoryStream newms_p3 = new MemoryStream();
-            //            ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
-            //            newms_p3.Seek(0, SeekOrigin.Begin);
-            //            byte[] newarr_p3 = new byte[newms_p3.Length];
-            //            newms_p3.Read(newarr_p3, 0, newarr_p3.Length);
-            //            //---------------------------------------------------------------------------------------                  
-            //            DataRow dr = DT_Largest20.NewRow();
-
-            //            dr["p1"] = newarr_p1;
-            //            dr["p2"] = newarr_p2;
-            //            dr["p3"] = newarr_p3;
-            //            newms_p1.Dispose();
-            //            newms_p2.Dispose();
-            //            newms_p3.Dispose();
-
-            //            dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i]["particleid"].ToString();
-            //            dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
-            //            dr["Width"] = dt_ParticlesGridDevidePage.Rows[i]["rectwidth"].ToString();
-            //            dr["Class"] = dt_ParticlesGridDevidePage.Rows[i]["typename"].ToString();
-
-
-            //            List<string> list_max_elementname = new List<string>();
-            //            List<double> list_max_elementvale = new List<double>();
-            //            GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i, out list_max_elementname, out list_max_elementvale);
-            //            //元素1
-            //            dr["ColName1"] = list_max_elementname[0];
-            //            dr["ColVal1"] = list_max_elementvale[0].ToString();
-            //            //元素2
-            //            dr["ColName2"] = list_max_elementname[1];
-            //            dr["ColVal2"] = list_max_elementvale[1].ToString();
-            //            //元素3
-            //            dr["ColName3"] = list_max_elementname[2];
-            //            dr["ColVal3"] = list_max_elementvale[2].ToString();
-            //            //元素4
-            //            dr["ColName4"] = list_max_elementname[3];
-            //            dr["ColVal4"] = list_max_elementvale[3].ToString();
-            //            //元素5
-            //            dr["ColName5"] = list_max_elementname[4];
-            //            dr["ColVal5"] = list_max_elementvale[4].ToString();
-            //            //元素6
-            //            dr["ColName6"] = list_max_elementname[5];
-            //            dr["ColVal6"] = list_max_elementvale[5].ToString();
-
-
-            //            DT_Largest20.Rows.Add(dr);
-
-            //        }
-            //    }
-
-
-
-
-            //}
+
 
 
             #region 插入-前20颗粒部份
-            for (int i_row = 0; i_row < 20; i_row++)
+
+           
+            for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
             {
-                if (i_row < dt_ParticlesGridDevidePage.Rows.Count)
+                if (dt_ParticlesGridDevidePage.Rows[i_row].ItemArray[24].ToString()!= "Not Identified")
                 {
+
+
                     //获取颗粒的fieldid,和particleid
                     string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
                     string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
@@ -332,6 +235,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     if (str_fieldid == "-1")
                         continue;
 
+
+                    if (serialNumber > 20)
+                        continue;
+
                     if (str_subparticles != null && str_subparticles != "")
                     {
                         //合并大颗粒
@@ -345,14 +252,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     {
                         //正常颗粒
                         Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
-                    Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
-                    bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-                    bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
-                }
-
-                //fielddata.GetParticleByFidAndPid(str_fieldid, str_particleid);
-
-
+                        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
+                        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+                        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
+                    }
                 //获取该颗粒的xray能谱图像
                 System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
                         str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
@@ -394,7 +297,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     newms_p2.Dispose();
                     newms_p3.Dispose();
 
-                    dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
+                    dr["pid"] = serialNumber++.ToString();
+                    //dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
                     dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
                     dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
                     dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
@@ -436,6 +340,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES_MARK);
             if (theFolder.Exists)
             {
+
                 foreach (FileInfo nextifile in theFolder.GetFiles())
                 {
                     if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
@@ -471,89 +376,94 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             #endregion
 
             #region 插入-前20颗粒外的颗粒
-            for (int i_row = 20; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
+            for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
             {
                 //获取颗粒的fieldid,和particleid
                 string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
-                string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
-                string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
-                string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
-                string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
-
-                //获取原始颗粒图像
-                Bitmap bp_particle = new Bitmap(1, 1);
-                string str_path = str_resultPath + "\\FIELD_FILES\\";
-                string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
-                if (str_subparticles != null && str_subparticles != "")
+                if (Convert.ToInt32(str_fieldid) < 20)
                 {
-                    //合并大颗粒
-                    double ScanFieldSize = 1142;
-                    Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
-                    int pixw = tempbit.Width;
-                    double xs = pixw / ScanFieldSize;
-                    bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath);
-                }
-                else
-                {
-                    //正常颗粒
-                    Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
-                    Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
-                    bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-                    bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
-                }
+                    
+                    string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
+                    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
+                    string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
+                    string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
+                    string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
 
-                //获取该颗粒的xray能谱图像
-                System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
-                    str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
-
-                //获取该颗粒的二次放大处理图像
-                Bitmap ls_processbitmap = new Bitmap(1, 1);
-                ls_processbitmap = (Bitmap)bp_particle.Clone();//待完善
-
-                //再将图像转成二进制流-------------------------------------------------------------------
-                //原图
-                MemoryStream newms_p1 = new MemoryStream();
-                bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
-                newms_p1.Seek(0, SeekOrigin.Begin);
-                byte[] newarr_p1 = new byte[newms_p1.Length];
-                newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
-                //---------------------------------------------------------------------------------------                  
-                DataRow dr = DT_Largest_frame.NewRow();
-                dr["p1"] = newarr_p1;
-                newms_p1.Dispose();
-
-                dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00");  //可以需要选择切换,计算方式
-                dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
-                dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
-
-                dr["fieldid"] = str_fieldid;
-
-                List<string> list_max_elementname = new List<string>();
-                List<double> list_max_elementvale = new List<double>();
-                GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out list_max_elementname, out list_max_elementvale);
-                //元素1
-                dr["ColName1"] = list_max_elementname[0];
-                dr["ColVal1"] = list_max_elementvale[0].ToString();
-                //元素2
-                dr["ColName2"] = list_max_elementname[1];
-                dr["ColVal2"] = list_max_elementvale[1].ToString();
-                //元素3
-                dr["ColName3"] = list_max_elementname[2];
-                dr["ColVal3"] = list_max_elementvale[2].ToString();
-                //元素4
-                dr["ColName4"] = list_max_elementname[3];
-                dr["ColVal4"] = list_max_elementvale[3].ToString();
-                //元素5
-                dr["ColName5"] = list_max_elementname[4];
-                dr["ColVal5"] = list_max_elementvale[4].ToString();
-                //元素6
-                dr["ColName6"] = list_max_elementname[5];
-                dr["ColVal6"] = list_max_elementvale[5].ToString();
-
-               
-                DT_Largest_frame.Rows.Add(dr);
+                    //获取原始颗粒图像
+                    Bitmap bp_particle = new Bitmap(1, 1);
+                    string str_path = str_resultPath + "\\FIELD_FILES\\";
+                    string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
+                    if (str_subparticles != null && str_subparticles != "")
+                    {
+                        //合并大颗粒
+                        double ScanFieldSize = 1142;
+                        Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
+                        int pixw = tempbit.Width;
+                        double xs = pixw / ScanFieldSize;
+                        bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath);
+                    }
+                    else
+                    {
+                        //正常颗粒
+                        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
+                        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
+                        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+                        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
+                    }
+
+                    //获取该颗粒的xray能谱图像
+                    System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
+                        str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
+
+                    //获取该颗粒的二次放大处理图像
+                    Bitmap ls_processbitmap = new Bitmap(1, 1);
+                    ls_processbitmap = (Bitmap)bp_particle.Clone();//待完善
+
+                    //再将图像转成二进制流-------------------------------------------------------------------
+                    //原图
+                    MemoryStream newms_p1 = new MemoryStream();
+                    bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
+                    newms_p1.Seek(0, SeekOrigin.Begin);
+                    byte[] newarr_p1 = new byte[newms_p1.Length];
+                    newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
+                    //---------------------------------------------------------------------------------------                  
+                    DataRow dr = DT_Largest_frame.NewRow();
+                    dr["p1"] = newarr_p1;
+                    newms_p1.Dispose();
+
+                    dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
+                    dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00");  //可以需要选择切换,计算方式
+                    dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
+                    dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
+
+                    dr["fieldid"] = str_fieldid;
+
+                    List<string> list_max_elementname = new List<string>();
+                    List<double> list_max_elementvale = new List<double>();
+                    GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out list_max_elementname, out list_max_elementvale);
+                    //元素1
+                    dr["ColName1"] = list_max_elementname[0];
+                    dr["ColVal1"] = list_max_elementvale[0].ToString();
+                    //元素2
+                    dr["ColName2"] = list_max_elementname[1];
+                    dr["ColVal2"] = list_max_elementvale[1].ToString();
+                    //元素3
+                    dr["ColName3"] = list_max_elementname[2];
+                    dr["ColVal3"] = list_max_elementvale[2].ToString();
+                    //元素4
+                    dr["ColName4"] = list_max_elementname[3];
+                    dr["ColVal4"] = list_max_elementvale[3].ToString();
+                    //元素5
+                    dr["ColName5"] = list_max_elementname[4];
+                    dr["ColVal5"] = list_max_elementvale[4].ToString();
+                    //元素6
+                    dr["ColName6"] = list_max_elementname[5];
+                    dr["ColVal6"] = list_max_elementvale[5].ToString();
+
+
+                    DT_Largest_frame.Rows.Add(dr);
+                }
+                
             }
             #endregion
 
@@ -577,7 +487,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 //加载模块
                 ParticlesSizeGrid ls_particlesizegrid = new ParticlesSizeGrid(m_otsreport_export.m_ReportApp);
-                List<string> vs = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
+                List<string> vs = new List<string>() { "DMAX", "DMIN", "CIRCLE", "FERET" };
                 ls_particlesizegrid.condition = vs[m_otsreport_export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs];
                 m_otsreport_export.panel_container.Controls.Clear();
                 m_otsreport_export.panel_container.Controls.Add(ls_particlesizegrid);
@@ -768,6 +678,12 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     dr2["AllElements"] = AllElements;
                     ls_element_dt.Rows.Add(dr2);
                 }
+                //获取夹杂物的总面积用于计算夹杂物类别的占比(gridview最后一个固定是未识别颗粒,要排除未识别颗粒所以for循环至grid view长度减一)
+                double totalInclusionArea = 0;
+                for (int i = 0; i < ls_gv.Rows.Count - 1; i++)
+                {
+                    totalInclusionArea = totalInclusionArea + Convert.ToDouble(ls_gv.Rows[i].Cells[2].Value.ToString());
+                }
 
                 m_list_dt.Add(ls_elementname_dt);
                 m_list_dt.Add(ls_element_dt);
@@ -1257,7 +1173,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             if (str_element != "")
             {
                 string[] strcbo = str_element.Split(';');
-                for (int i = 0; i < strcbo.Length; i++)
+                for (int i = 0; i < strcbo.Length-1; i++)
                 {
                     string[] str = strcbo[i].Split('-');
                     list_elementname.Add(str[0]);
@@ -1272,7 +1188,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 string max_elementname = "";
                 int max_index = -1;
 
-                if (list_elementvalue.Count > 1)
+                if (list_elementvalue.Count > 0)
                 {
                     for (int i = 0; i < list_elementvalue.Count; i++)
                     {

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

@@ -396,6 +396,30 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
+        public DataTable GetIncaSurfaceData()
+        {
+            DataTable particlesAll = new DataTable();
+            particlesAll = GetInfoForPartucleDevidePage2("");
+
+            DataTable elementchemistry = GetElementChemistry();
+            for (int i = 0; i < particlesAll.Rows.Count; i++)
+            {
+                string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
+                DataRow[] drs = elementchemistry.Select(str);
+                string ConcatenatedString = "";
+                for (int j = 0; j < drs.Length; j++)
+                {
+                    ConcatenatedString += drs[j]["name"] + "-" + drs[j]["Percentage"] + ';';
+                }
+                particlesAll.Rows[i]["Element"] = ConcatenatedString;
+            }
+
+
+
+            //string sqlliteString = "select * from INcAData";
+            //DataTable dt = dbHelper.ExecuteQuery(sqlliteString);
+            return particlesAll;
+        }
         public DataTable GetInfoForPartucleDevidePage2(string condition)
         {
             string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX,FieldPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;

+ 9 - 9
OTSIncAReportTemplate/OTSIncAReportTemplate.cs

@@ -91,7 +91,7 @@ namespace OTSIncAReportTemplate
                 m_arg4 = "100";
                 m_arg5 = "0-100";
             }
-
+            
 
             //初始化xml类
             xmlutil = new XmlConfigUtil(m_arg2);
@@ -285,11 +285,11 @@ namespace OTSIncAReportTemplate
                 }
                 if (m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk)//判断夹杂物分类图
                 {
-                    DataTable ls_dt_picKL = list_dt.Where(aa => aa.TableName.Contains("PicKL")).ToList()[0];// 用于颗粒图chart
-                    rmReport1.AddDataSet(ls_dt_picKL, "PicKL");
-                    ls_dt_picKL.Dispose();
-                    //ls_dt_picKL.Clear();
-                    rmReport1.FindObject("MasterData95").Prop["Visible"] = true;
+                    //DataTable ls_dt_picKL = list_dt.Where(aa => aa.TableName.Contains("PicKL")).ToList()[0];// 用于颗粒图chart
+                    //rmReport1.AddDataSet(ls_dt_picKL, "PicKL");
+                    //ls_dt_picKL.Dispose();
+                    ////ls_dt_picKL.Clear();
+                    //rmReport1.FindObject("MasterData95").Prop["Visible"] = true;
                 }
                 else
                 {
@@ -926,9 +926,9 @@ namespace OTSIncAReportTemplate
             ls_Particel.TableName = "Particel";
             list_dt.Add(ls_Particel);
 
-            DataTable ls_PicKL = sh.ExecuteQuery("select * from PicKL");
-            ls_PicKL.TableName = "PicKL";
-            list_dt.Add(ls_PicKL);
+            //DataTable ls_PicKL = sh.ExecuteQuery("select * from PicKL");
+            //ls_PicKL.TableName = "PicKL";
+            //list_dt.Add(ls_PicKL);
 
             DataTable ls_PicYS = sh.ExecuteQuery("select * from PicYS");
             ls_PicYS.TableName = "PicYS";