فهرست منبع

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

cxs 1 سال پیش
والد
کامیت
cc09fce2c2

+ 0 - 1
Bin/x64/Debug/Config/ReportTemplate/Inca_Template/ReportTemplateConfig.xml

@@ -122,7 +122,6 @@
     <str_kllb_qcys>C</str_kllb_qcys>
     <str_kllb_DeleteClass>misc</str_kllb_DeleteClass>
     <list_str_kllb_DeleteClass>
-      <YS0>misc</YS0>
     </list_str_kllb_DeleteClass>
     <list_int_kllb_number>18</list_int_kllb_number>
   </M_KLLBXX>

+ 26 - 2
Bin/x64/Debug/Config/SysData/OTSStage.stg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="4">
+<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="3">
   <Collection RegName="Stagelist">
     <Member strName="圆形九圆孔50mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0:ROUND" />
@@ -54,7 +54,7 @@
         <Member HoleName="7" rectDomian="-23000,0,15000,0" shape="0" />
       </Collection>
     </Member>
-    <Member strName="Apero12_90">
+    <Member strName="Apero90mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,90000,90000" shape="1:RECTANGLE" />
       <Member RegName="std" PolygonPoint="" rectDomian="6300,0,2,0" shape="0:ROUND" />
       <Collection RegName="Holes">
@@ -78,5 +78,29 @@
         <Member HoleName="18" rectDomian="-14500,-24500,12000,0" shape="0" />
       </Collection>
     </Member>
+    <Member strName="Apero">
+      <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,130000,120000" shape="1:RECTANGLE" />
+      <Member RegName="std" PolygonPoint="" rectDomian="6300,0,2,0" shape="0:ROUND" />
+      <Collection RegName="Holes">
+        <Member HoleName="9" rectDomian="0,0,10000,0" shape="0" />
+        <Member HoleName="2" rectDomian="0,25000,10000,0" shape="0" />
+        <Member HoleName="3" rectDomian="-15000,25000,10000,0" shape="0" />
+        <Member HoleName="1" rectDomian="15000,25500,10000,0" shape="0" />
+        <Member HoleName="4" rectDomian="22000,13000,10000,0" shape="0" />
+        <Member HoleName="5" rectDomian="7000,13000,10000,0" shape="0" />
+        <Member HoleName="6" rectDomian="-7500,13000,10000,0" shape="0" />
+        <Member HoleName="7" rectDomian="-22500,13000,10000,0" shape="0" />
+        <Member HoleName="8" rectDomian="14000,0,10000,0" shape="0" />
+        <Member HoleName="10" rectDomian="-15000,0,10000,0" shape="0" />
+        <Member HoleName="11" rectDomian="-30000,0,10000,0" shape="0" />
+        <Member HoleName="12" rectDomian="22000,-12500,10000,0" shape="0" />
+        <Member HoleName="13" rectDomian="7000,-12500,10000,0" shape="0" />
+        <Member HoleName="14" rectDomian="-7500,-12500,10000,0" shape="0" />
+        <Member HoleName="15" rectDomian="-22500,-12500,10000,0" shape="0" />
+        <Member HoleName="16" rectDomian="14500,-24500,10000,0" shape="0" />
+        <Member HoleName="17" rectDomian="-500,-24500,10000,0" shape="0" />
+        <Member HoleName="18" rectDomian="-14500,-24500,10000,0" shape="0" />
+      </Collection>
+    </Member>
   </Collection>
 </XMLData>

+ 2 - 10
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -457,11 +457,7 @@
 			<Control name="whole" text="全部颗粒"/>
 			<Control name="select" text="选择颗粒"/>
 			
-			<Control name="groupBox4" text="特定选择"/>
-			<Control name="label7" text="标准库选择:"/>
-			<Control name="button3" text="元素选择"/>
-			<Control name="button7" text="取消"/>
-			<Control name="button4" text="元素选择"/>
+		
 			
 			<Control name="standardlibrary" text="当前标准库:"/>
 		</Controls>
@@ -513,11 +509,7 @@
 		<Control name="no_database" text="未找到数据库!"/>
 		<Control name="image_opened" text="图片已被打开,请关闭改图片!"/>
 		
-		<Control name="groupBox4" text="特定选择"/>
-		<Control name="label7" text="标准库选择:"/>
-	    <Control name="button3" text="编辑选择"/>
-		<Control name="button4" text="元素选择"/>
-	    <Control name="button7" text="取消"/>
+
 		
 		
 		<Control name="standardlibrary" text="当前标准库:"/>

+ 67 - 12
OTSIncAReportApp/1-UI/Control_Graph/Controls/ImageSplicer.cs

@@ -3,6 +3,7 @@ using OpenCvSharp.Extensions;
 using OTSCommon.Model;
 using OTSIncAReportGraph;
 using OTSIncAReportGraph.Class;
+using OTSIncAReportGraph.OTSIncAReportGraphFuncation;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -45,8 +46,6 @@ namespace OTSIncAReportApp._1_UI.Control_Graph.Controls
             DataView dv_x_2 = dv_x.ToTable(true, "X").DefaultView;
             dv_x_2.Sort = "X ASC";
             total_dt_X = dv_x_2.ToTable();
-
-
             DataTable total_dt_Y = picDatat.Copy();
             DataView dv_Y = total_dt_Y.DefaultView;
             DataView dv_Y_2 = dv_Y.ToTable(true, "Y").DefaultView;
@@ -57,18 +56,15 @@ namespace OTSIncAReportApp._1_UI.Control_Graph.Controls
             for (int i = 0; i < total_dt_Y.Rows.Count; i++)
             {
                 NLog.LogManager.GetCurrentClassLogger().Info("Splice line" + i + 1.ToString() + "of" + total_dt_Y.Rows.Count.ToString() + ".....");
-
                 DataTable data = new DataTable();
                 data.Columns.Add("mat", typeof(Bitmap));
                 data.Columns.Add("X", typeof(double));
                 //循环每行图片进行拼接
                 Bitmap bitmap = new Bitmap((int)m_list_allDfield[0].OriginalImage.Width, (int)m_list_allDfield[0].OriginalImage.Height);
-
                 for (int a = 0; a < total_dt_X.Rows.Count; a++)
                 {
                     DataRow dr2 = data.NewRow();
                     Graphics g = Graphics.FromImage(bitmap);
-
                     g.Clear(Color.White);
                     g.Dispose();
                     dr2["mat"] = bitmap;
@@ -87,12 +83,10 @@ namespace OTSIncAReportApp._1_UI.Control_Graph.Controls
                             {
                                 Bitmap image = new Bitmap(bitmap.Width, bitmap.Height);
                                 Graphics g2 = Graphics.FromImage(image);
-                                //g2.Clear(Color.White);
                                 Color color1 = Color.FromArgb(217, 217, 217);
                                 g2.Clear(color1);
                                 g2.DrawImage(image, 0, 0, f.OriginalImage.Width, f.OriginalImage.Height);
                                 Graphics graph_2 = Graphics.FromImage(image);
-
                                 for (int a = 0; a < fieldlist.Count; a++)
                                 {
                                     if (fieldlist[a].FieldID.ToString() == f.FieldID.ToString())
@@ -111,12 +105,10 @@ namespace OTSIncAReportApp._1_UI.Control_Graph.Controls
                                             foreach (Segment seg in list_seg)
                                             {
                                                 #region 创建DSegment对象,并将STD分析出的化合物颜色保存到DSegment对象中
-
                                                 System.Drawing.Point on_p = new System.Drawing.Point() { X = seg.Start, Y = seg.Height };
                                                 System.Drawing.Point off_p = new System.Drawing.Point() { X = seg.Start + seg.Length, Y = seg.Height };
                                                 Pen npen = new Pen(Color.FromArgb(255 - particle.AveGray, 0, 0, 0));
                                                 graph_2.DrawLine(npen, on_p, off_p);
-
                                                 #endregion
                                             }
                                         }
@@ -129,9 +121,6 @@ namespace OTSIncAReportApp._1_UI.Control_Graph.Controls
                     }
 
                 }
-
-
-
                 DataView dataView1 = data.DefaultView;
                 dataView1.Sort = "X ASC";
                 data = dataView1.ToTable();
@@ -394,5 +383,71 @@ namespace OTSIncAReportApp._1_UI.Control_Graph.Controls
             }
             return data;
         }
+
+        public static Bitmap ParticleBinaryDiagram(DataTable resultFile, int PICSerialNumber,int SerialNumber)
+        {
+            
+            DataTable PICData = resultFile.Clone();
+            for (int i=0;i< resultFile.Rows.Count;i++)
+            {
+                if (Convert.ToInt32(resultFile.Rows[i]["FieldId"]) == PICSerialNumber)
+                {
+                    PICData.Rows.Add(resultFile.Rows[i].ItemArray);
+                }
+            }
+            DataTable SerialData = PICData.Clone();
+            for (int i=0;i< PICData.Rows.Count;i++)
+            {
+                if (Convert.ToInt32(PICData.Rows[i]["ParticleId"])== SerialNumber)
+                {
+                    SerialData.Rows.Add(PICData.Rows[i].ItemArray);
+                }
+            }
+            HashSet<int> hsINT = new HashSet<int>();
+            int left = int.MaxValue;
+            int wide = 0;
+            int Ht = int.MaxValue;
+            List<int> vs = new List<int>();
+            List<int> HList = new List<int>();
+            for (int i = 0; i < SerialData.Rows.Count; i++)
+            {
+                if (left >Convert.ToInt32(SerialData.Rows[i]["Start"]))
+                {
+                    left = Convert.ToInt32(SerialData.Rows[i]["Start"]);
+                }
+                vs.Add(Convert.ToInt32(SerialData.Rows[i]["Start"]) + Convert.ToInt32(SerialData.Rows[i]["Length"]));
+                hsINT.Add(Convert.ToInt32(SerialData.Rows[i]["Height"]));
+                HList.Add(Convert.ToInt32(SerialData.Rows[i]["Height"]));
+            }
+
+            for (int i=0;i< vs.Count;i++)
+            {
+                vs[i] = vs[i] - left;
+                if (wide< vs[i])
+                {
+                    wide = vs[i];
+                }
+                
+            }
+            for (int i=0;i< HList.Count;i++)
+            {
+                if (Ht > HList[i])
+                {
+                    Ht = HList[i];
+                }
+            }
+            Bitmap bitmap = new Bitmap(wide+20, hsINT.Count+30);
+            Graphics graphics = Graphics.FromImage(bitmap);  
+            graphics.Clear(Color.White);
+            //再循环取出里面所有的segment
+            for (int i=0;i< SerialData.Rows.Count;i++)
+            {
+                #region 创建DSegment对象,并将STD分析出的化合物颜色保存到DSegment对象中
+                Rectangle rectangle = new Rectangle(Convert.ToInt32(SerialData.Rows[i]["Start"]) - left + 10, Convert.ToInt32(SerialData.Rows[i]["Height"]) - Ht + 10,  Convert.ToInt32(SerialData.Rows[i]["Length"]),2);
+                graphics.FillRectangle(Brushes.Black, rectangle);
+                #endregion
+            }
+            return bitmap;
+        }
     }
 }

+ 13 - 154
OTSIncAReportApp/1-UI/OTSReportExport/Category.Designer.cs

@@ -29,70 +29,28 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
         /// </summary>
         private void InitializeComponent()
         {
-            this.button_down = new System.Windows.Forms.Button();
-            this.button_up = new System.Windows.Forms.Button();
             this.panel1 = new System.Windows.Forms.Panel();
             this.button4 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
-            this.panel3 = new System.Windows.Forms.Panel();
-            this.label2 = new System.Windows.Forms.Label();
-            this.panel2 = new System.Windows.Forms.Panel();
-            this.label1 = new System.Windows.Forms.Label();
-            this.listView_select = new System.Windows.Forms.ListView();
-            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.listView_whole = new System.Windows.Forms.ListView();
-            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.button2 = new System.Windows.Forms.Button();
-            this.button1 = new System.Windows.Forms.Button();
+            this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
             this.panel1.SuspendLayout();
-            this.panel3.SuspendLayout();
-            this.panel2.SuspendLayout();
             this.SuspendLayout();
             // 
-            // button_down
-            // 
-            this.button_down.Font = new System.Drawing.Font("宋体", 9F);
-            this.button_down.Location = new System.Drawing.Point(3, 227);
-            this.button_down.Name = "button_down";
-            this.button_down.Size = new System.Drawing.Size(19, 98);
-            this.button_down.TabIndex = 12;
-            this.button_down.Text = "▼";
-            this.button_down.UseVisualStyleBackColor = true;
-            this.button_down.Click += new System.EventHandler(this.button_down_Click);
-            // 
-            // button_up
-            // 
-            this.button_up.Font = new System.Drawing.Font("宋体", 9F);
-            this.button_up.Location = new System.Drawing.Point(3, 123);
-            this.button_up.Name = "button_up";
-            this.button_up.Size = new System.Drawing.Size(19, 98);
-            this.button_up.TabIndex = 11;
-            this.button_up.Text = "▲";
-            this.button_up.UseVisualStyleBackColor = true;
-            this.button_up.Click += new System.EventHandler(this.button_up_Click);
-            // 
             // panel1
             // 
             this.panel1.BackColor = System.Drawing.SystemColors.ControlLight;
+            this.panel1.Controls.Add(this.checkedListBox1);
             this.panel1.Controls.Add(this.button4);
             this.panel1.Controls.Add(this.button3);
-            this.panel1.Controls.Add(this.panel3);
-            this.panel1.Controls.Add(this.panel2);
-            this.panel1.Controls.Add(this.listView_select);
-            this.panel1.Controls.Add(this.listView_whole);
-            this.panel1.Controls.Add(this.button2);
-            this.panel1.Controls.Add(this.button1);
-            this.panel1.Controls.Add(this.button_up);
-            this.panel1.Controls.Add(this.button_down);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel1.Location = new System.Drawing.Point(0, 0);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(550, 486);
+            this.panel1.Size = new System.Drawing.Size(244, 413);
             this.panel1.TabIndex = 13;
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(462, 459);
+            this.button4.Location = new System.Drawing.Point(154, 374);
             this.button4.Name = "button4";
             this.button4.Size = new System.Drawing.Size(75, 23);
             this.button4.TabIndex = 23;
@@ -102,7 +60,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(381, 459);
+            this.button3.Location = new System.Drawing.Point(73, 374);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(75, 23);
             this.button3.TabIndex = 22;
@@ -110,134 +68,35 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
             this.button3.UseVisualStyleBackColor = true;
             this.button3.Click += new System.EventHandler(this.button3_Click);
             // 
-            // panel3
-            // 
-            this.panel3.Controls.Add(this.label2);
-            this.panel3.Location = new System.Drawing.Point(298, 27);
-            this.panel3.Name = "panel3";
-            this.panel3.Size = new System.Drawing.Size(248, 24);
-            this.panel3.TabIndex = 21;
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(13, 7);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(77, 12);
-            this.label2.TabIndex = 19;
-            this.label2.Text = "数据库分类:";
-            // 
-            // panel2
-            // 
-            this.panel2.Controls.Add(this.label1);
-            this.panel2.Location = new System.Drawing.Point(16, 27);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(248, 24);
-            this.panel2.TabIndex = 20;
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(10, 7);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(77, 12);
-            this.label1.TabIndex = 18;
-            this.label1.Text = "已选择分类:";
-            // 
-            // listView_select
-            // 
-            this.listView_select.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader2});
-            this.listView_select.HideSelection = false;
-            this.listView_select.Location = new System.Drawing.Point(28, 27);
-            this.listView_select.Name = "listView_select";
-            this.listView_select.Size = new System.Drawing.Size(226, 426);
-            this.listView_select.TabIndex = 17;
-            this.listView_select.UseCompatibleStateImageBehavior = false;
-            this.listView_select.View = System.Windows.Forms.View.Details;
-            this.listView_select.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView_select_MouseClick);
-            // 
-            // columnHeader2
-            // 
-            this.columnHeader2.Text = "";
-            this.columnHeader2.Width = 210;
-            // 
-            // listView_whole
-            // 
-            this.listView_whole.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader1});
-            this.listView_whole.HideSelection = false;
-            this.listView_whole.Location = new System.Drawing.Point(313, 27);
-            this.listView_whole.Name = "listView_whole";
-            this.listView_whole.Size = new System.Drawing.Size(226, 426);
-            this.listView_whole.TabIndex = 16;
-            this.listView_whole.UseCompatibleStateImageBehavior = false;
-            this.listView_whole.View = System.Windows.Forms.View.Details;
-            this.listView_whole.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listView_whole_MouseClick);
-            // 
-            // columnHeader1
-            // 
-            this.columnHeader1.Text = "";
-            this.columnHeader1.Width = 210;
-            // 
-            // button2
-            // 
-            this.button2.Location = new System.Drawing.Point(260, 232);
-            this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(47, 23);
-            this.button2.TabIndex = 15;
-            this.button2.Text = "删除";
-            this.button2.UseVisualStyleBackColor = true;
-            this.button2.Click += new System.EventHandler(this.button2_Click);
-            // 
-            // button1
+            // checkedListBox1
             // 
-            this.button1.Location = new System.Drawing.Point(260, 203);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(47, 23);
-            this.button1.TabIndex = 14;
-            this.button1.Text = "添加";
-            this.button1.UseVisualStyleBackColor = true;
-            this.button1.Click += new System.EventHandler(this.button1_Click);
+            this.checkedListBox1.FormattingEnabled = true;
+            this.checkedListBox1.Location = new System.Drawing.Point(12, 12);
+            this.checkedListBox1.Name = "checkedListBox1";
+            this.checkedListBox1.Size = new System.Drawing.Size(217, 356);
+            this.checkedListBox1.TabIndex = 82;
             // 
             // Category
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(550, 486);
+            this.ClientSize = new System.Drawing.Size(244, 413);
             this.Controls.Add(this.panel1);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(566, 525);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(566, 525);
             this.Name = "Category";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "分类选择";
             this.Load += new System.EventHandler(this.Category_Load);
             this.panel1.ResumeLayout(false);
-            this.panel3.ResumeLayout(false);
-            this.panel3.PerformLayout();
-            this.panel2.ResumeLayout(false);
-            this.panel2.PerformLayout();
             this.ResumeLayout(false);
 
         }
 
         #endregion
-        private System.Windows.Forms.Button button_down;
-        private System.Windows.Forms.Button button_up;
         private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Button button2;
-        private System.Windows.Forms.Button button1;
-        private System.Windows.Forms.ListView listView_whole;
-        private System.Windows.Forms.ColumnHeader columnHeader1;
-        private System.Windows.Forms.ListView listView_select;
-        private System.Windows.Forms.ColumnHeader columnHeader2;
-        private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Panel panel3;
-        private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Button button4;
         private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.CheckedListBox checkedListBox1;
     }
 }

+ 38 - 171
OTSIncAReportApp/1-UI/OTSReportExport/Category.cs

@@ -14,30 +14,21 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 {
     public partial class Category : Form
     {
-        List<string> select = new List<string>();
+        List<string> CheckTheOptions = new List<string>();
         List<string> ElementList = new List<string>();
         public List<string> OutElementList = new List<string>();
+        /// <summary>
+        /// 窗体是否修改
+        /// </summary>
+        public bool IsModify = false;
         Hashtable table;
-        private string str_Select_All;
-        private string str_Select;
+     
         public Category(List<string> a_ElementList, List<string> AllList)
         {
-            select = a_ElementList;
-            for (int i=0;i< AllList.Count();i++)
-            {
-                bool bl = false;
-                for (int a=0;a< a_ElementList.Count;a++)
-                {
-                    if(AllList[i]== a_ElementList[a])
-                    {
-                        bl = true;
-                    }
-                }
-                if (!bl)
-                    ElementList.Add(AllList[i]);
-            }
             InitializeComponent();
-
+            ElementList = AllList;
+            CheckTheOptions = a_ElementList;
+            OutElementList = a_ElementList;
             #region 国际化语言
             OTSCommon.Language lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
@@ -46,175 +37,51 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 
         private void Category_Load(object sender, EventArgs e)
         {
-   
-            OutElementList.Clear();
-            for (int i=0;i< select.Count;i++)
-            {
-                ListViewItem item = new ListViewItem(select[i]);
-                listView_select.Items.Add(item);
-                OutElementList.Add(select[i]);
-            }
-
-
             for (int i = 0; i < ElementList.Count; i++)
             {
-
-                ListViewItem item = new ListViewItem(ElementList[i]);
-                listView_whole.Items.Add(item);
-
+                checkedListBox1.Items.Add(ElementList[i]);
             }
-
-        }
-
-        private void UpdateSelectedCategories()
-        {
-            OutElementList.Clear();
-
-            foreach (ListViewItem item in listView_select.Items)
-            {
-               
-                string secondColumnData = item.SubItems[0].Text; // 索引1代表第二列  
-                OutElementList.Add(secondColumnData);
-              
-            }
-
-        }
-
-        private void button_up_Click(object sender, EventArgs e)
-        {
-            MoveSelectedItemUp();
-            //UpdateSelectedCategories();
-        }
-
-        private void button_down_Click(object sender, EventArgs e)
-        {
-            MoveSelectedItemDown();
-            //UpdateSelectedCategories();
-        }
-
-        private void button1_Click(object sender, EventArgs e)
-        {
-            if (listView_whole.SelectedItems.Count == 0)
-                return;
-            //ListViewItem item2 = new ListViewItem(str_Select_All);
-            //listView_select.Items.Add(item2);
-            foreach (ListViewItem item in listView_whole.SelectedItems)
+            for (int i = 0; i < checkedListBox1.Items.Count; i++)
             {
-                // 从ListView的Items集合中移除选中的项  
-                listView_whole.Items.Remove(item);
-
-                listView_select.Items.Add(item);
-            }
-            //UpdateSelectedCategories();
-        }
-
-        private void button2_Click(object sender, EventArgs e)
-        {
-            if (listView_select.SelectedItems.Count == 0)
-                return;
-            //ListViewItem item2 = new ListViewItem(str_Select);
-            //listView_whole.Items.Add(item2);
-            foreach (ListViewItem item in listView_select.SelectedItems)
-            {
-                // 从ListView的Items集合中移除选中的项  
-                listView_select.Items.Remove(item);
-
-                listView_whole.Items.Add(item);
-            }
-            //UpdateSelectedCategories();
-        }
-
-        private void listView_whole_MouseClick(object sender, MouseEventArgs e)
-        {
-            ListViewHitTestInfo info = listView_whole.HitTest(e.Location);
-            if (info.Item != null)
-            {
-                // 如果你还关心点击的是哪个子项(Details视图下)  
-                if (info.SubItem != null)
+                if (CheckTheOptions.Count == 0)
                 {
-                    str_Select_All = info.SubItem.Text;
+                    checkedListBox1.SetItemChecked(i, true);
                 }
-            }
-        }
-
-        private void listView_select_MouseClick(object sender, MouseEventArgs e)
-        {
-            ListViewHitTestInfo info = listView_select.HitTest(e.Location);
-            if (info.Item != null)
-            {
-                // 如果你还关心点击的是哪个子项(Details视图下)  
-                if (info.SubItem != null)
+                else
                 {
-                    str_Select = info.SubItem.Text;
+                    for (int a = 0; a < CheckTheOptions.Count; a++)
+                    {
+                        if (checkedListBox1.Items[i].ToString() == CheckTheOptions[a].ToString())
+                            checkedListBox1.SetItemChecked(i, true);
+                    }
                 }
+                
             }
         }
 
-
-        private void MoveSelectedItemUp()
-        {
-            // 确保ListView中有选中的项,并且不是第一项  
-            if (listView_select.SelectedItems.Count > 0 && listView_select.SelectedIndices[0] > 0)
-            {
-                // 获取选中的项  
-                ListViewItem selectedItem = listView_select.SelectedItems[0];
-                // 在上一行的位置插入新的项(使用保存的数据)  
-                int newIndex = selectedItem.Index - 1; // 上一行的索引 
-                // 保存选中项的数据(这里只保存Text,如果有子项也需要保存)  
-                string text = selectedItem.Text;
-                ListViewItem.ListViewSubItem[] subItems = selectedItem.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray(); // 如果有子项  
-
-                // 移除选中的项  
-                listView_select.Items.Remove(selectedItem);
-
-                // 在上一行的位置插入新的项(使用保存的数据)  
-                //int newIndex = selectedItem.Index - 1; // 上一行的索引  
-                ListViewItem newItem = new ListViewItem(text); // 创建新的项  
-                newItem.SubItems.AddRange(subItems); // 如果有子项,则添加它们  
-                listView_select.Items.Insert(newIndex, newItem); // 插入新的项  
-
-                // 重新选择移动后的项(可选)  
-                listView_select.Items[newIndex].Selected = true;
-            }
-        }
-
-        private void MoveSelectedItemDown()
+        /// <summary>
+        /// 确定按钮
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button3_Click(object sender, EventArgs e)
         {
-            // 确保ListView中有选中的项,并且不是最后一项  
-            if (listView_select.SelectedItems.Count > 0 && listView_select.SelectedIndices[0] < listView_select.Items.Count - 1)
+            OutElementList.Clear();
+            for (int i=0;i< checkedListBox1.Items.Count;i++)
             {
-                // 获取选中的项  
-                ListViewItem selectedItem = listView_select.SelectedItems[0];
-                int selectedIndex = selectedItem.Index;
-                // 在下一行的位置插入新的项(使用保存的数据)  
-                int newIndex = selectedIndex + 1; // 下一行的索引  
-                // 保存选中项的数据(包括文本和任何子项)  
-                string text = selectedItem.Text;
-                ListViewItem.ListViewSubItem[] subItems = selectedItem.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray();
-
-                // 移除选中的项  
-                listView_select.Items.RemoveAt(selectedIndex);
-
-                // 在下一行的位置插入新的项(使用保存的数据)  
-                //int newIndex = selectedIndex + 1; // 下一行的索引  
-                ListViewItem newItem = new ListViewItem(text);
-                newItem.SubItems.AddRange(subItems); // 如果有子项,则添加它们  
-                listView_select.Items.Insert(newIndex, newItem);
-
-                // 重新选择移动后的项(可选)  
-                listView_select.Items[newIndex].Selected = true;
-
-                // 如果需要,滚动到新的位置  
-                listView_select.EnsureVisible(newIndex);
+                if (checkedListBox1.GetItemChecked(i))
+                {
+                    OutElementList.Add(checkedListBox1.Items[i].ToString());
+                }
             }
-        }
-
-        private void button3_Click(object sender, EventArgs e)
-        {
-            UpdateSelectedCategories();
+            IsModify = true;
             this.Close();
         }
-
+        /// <summary>
+        /// 取消按钮
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void button4_Click(object sender, EventArgs e)
         {
             this.Close();

+ 151 - 0
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ImageProcessor.cs

@@ -0,0 +1,151 @@
+using OpenCvSharp;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
+{
+    class ImageProcessor
+    {
+
+        /// <summary>
+        /// 颗粒图片缩放到固定大小
+        /// </summary>
+        /// <param name="sourceFile"></param>
+        /// <param name="targetWidth"></param>
+        /// <param name="targetHeight"></param>
+        /// <returns></returns>
+        public Bitmap  ResizeImageWithPadding(Bitmap sourceFile, int targetWidth, int targetHeight, Color color)
+        {
+            var originalImage = sourceFile;
+
+                // 计算缩放后的尺寸,保持宽高比  
+            int scaledWidth, scaledHeight;
+                if (originalImage.Width > originalImage.Height)
+                {
+                    scaledWidth = targetWidth;
+                    scaledHeight = (int)(targetWidth * ((double)originalImage.Height / originalImage.Width));
+                }
+                else
+                {
+                    scaledHeight = targetHeight;
+                    scaledWidth = (int)(targetHeight * ((double)originalImage.Width / originalImage.Height));
+                }
+
+            // 创建新的Bitmap,大小为目标尺寸  
+            Bitmap newImage = new Bitmap(targetWidth, targetHeight);
+
+            Graphics graphic = Graphics.FromImage(newImage);
+                    
+                        // 填充整个图像为黑色  
+                        graphic.Clear(color);
+
+                        // 设置高质量插值法  
+                        //graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
+
+                        // 计算图片在新图像中的位置(居中)  
+                        int x = (targetWidth - scaledWidth) / 2;
+                        int y = (targetHeight - scaledHeight) / 2;
+
+                        // 绘制缩放后的图片  
+                        graphic.DrawImage(originalImage, new Rectangle(x, y, scaledWidth, scaledHeight));
+
+                    // 保存新图像  
+                    //newImage.Save(destFile, ImageFormat.Png); // 或使用ImageFormat.Jpeg等  
+
+                        return newImage;
+                
+            
+        }
+        /// <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;
+        }
+
+        public  Bitmap GetReZoomBitmap(Bitmap in_bp)
+        {
+            Mat src = OpenCvSharp.Extensions.BitmapConverter.ToMat(in_bp);
+            Mat dst = new Mat();
+
+            Cv2.AdaptiveThreshold(src, dst, 255, AdaptiveThresholdTypes.MeanC, ThresholdTypes.Binary, 27, 25);
+
+            //绝对缩放,
+            Mat dst2 = new Mat();
+            int col = dst.Width;//获取原图像的大小
+            int rows = dst.Height;
+            Cv2.Resize(dst, dst2, new OpenCvSharp.Size(4 * col, 4 * rows), 0, 0, InterpolationFlags.Cubic);
+
+            return OpenCvSharp.Extensions.BitmapConverter.ToBitmap(dst2);
+        }
+
+        /// <summary> 
+        /// Resize图片
+        /// </summary>
+        /// <param name="bmp">原始Bitmap</param>
+        /// <param name="newW">新的宽度</param>
+        /// <param name="newH">新的高度</param>
+        /// <returns>处理以后的图片</returns>
+        public  Bitmap KiResizeImage(Bitmap bmp, int newW, int newH)
+        {
+            try
+            {
+                Bitmap b = new Bitmap(newW, newH);
+                Graphics g = Graphics.FromImage(b);
+
+                // 插值算法的质量
+                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
+
+                g.DrawImage(bmp, new Rectangle(0, 0, newW, newH), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);
+                g.Dispose();
+
+                return b;
+            }
+            catch
+            {
+                return null;
+            }
+        }
+    }
+}

+ 16 - 7
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleList.cs

@@ -1,4 +1,5 @@
 using OTSCommon.Model;
+using OTSIncAReportApp._1_UI.Control_Graph.Controls;
 using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportGraph.Controls;
 using OTSIncAReportGrids;
@@ -179,6 +180,8 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             DataTable Filtered = dt_ParticlesGridDevidePage.Clone();
 
             ElementIcons = new List<DataTable>();
+
+            ImageProcessor imageProcessor = new ImageProcessor();
             #region 插入-前20颗粒部份
             for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
             {
@@ -191,7 +194,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                     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);
+                    //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_fieldid == "-1")
@@ -200,31 +203,37 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                         continue;
                     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);
+                    Bitmap bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+                    bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, Color.Black);
                     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能谱图像
-                    DataTable DT_XR= ExportXRay(str_fieldid, str_particleid, fielddata);
+                    DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);
                     ElementIcons.Add(DT_XR);
                     System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
                             str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
                     Bitmap ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
+                    DataTable SegmentData = fielddata.GetSegment();
+                  Bitmap BinaryParticles= ImageSplicer.ParticleBinaryDiagram(SegmentData, Convert.ToInt32(str_fieldid), Convert.ToInt32(str_particleid));
+                    Bitmap BP= imageProcessor.ResizeImageWithPadding(BinaryParticles, 120, 120, Color.White);
                     //获取该颗粒的二次放大处理图像
-                    Bitmap ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
+                    //Bitmap 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);
                     //二次放大图
                     MemoryStream newms_p2 = new MemoryStream();
-                    ls_processbitmap.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
+                    BP.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
                     //能谱图
                     MemoryStream newms_p3 = new MemoryStream();
                     ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
-                    //---------------------------------------------------------------------------------------                  
+                    //---------------------------------------------------------------------------------------                   
                     DataRow dr = DT_Largest20.NewRow();
                     dr["p1"] = bp_particle;
-                    dr["p2"] = ls_processbitmap;
+                    dr["p2"] = BP;
                     dr["p3"] = ls_xraybpnew;
+
+                   
                     newms_p1.Dispose();
                     newms_p2.Dispose();
                     newms_p3.Dispose();

+ 1 - 1
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Export.cs

@@ -1016,7 +1016,7 @@ namespace OTSIncAReportApp
                     m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Add(str);
                 }
             }
-            m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = Convert.ToString(xmlutil.Read("M_KLLBXX", "str_kllb_DeleteClass"));
+            //m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = Convert.ToString(xmlutil.Read("M_KLLBXX", "str_kllb_DeleteClass"));
             m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Clear();
             for (int i = 0; i < 100; i++)                              //取得所有元素列表
             {

+ 27 - 64
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_CleannessA.Designer.cs

@@ -69,11 +69,8 @@
             this.ParticleList_1 = new System.Windows.Forms.Label();
             this.comboBox_p1 = new System.Windows.Forms.ComboBox();
             this.ck_kllb_xsmk = new System.Windows.Forms.CheckBox();
-            this.label_delete_Class = new System.Windows.Forms.Label();
-            this.delete_Class = new System.Windows.Forms.TextBox();
             this.button6 = new System.Windows.Forms.Button();
             this.groupBox9 = new System.Windows.Forms.GroupBox();
-            this.groupBox2 = new System.Windows.Forms.GroupBox();
             this.button3 = new System.Windows.Forms.Button();
             this.textBox_zypxss = new System.Windows.Forms.TextBox();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
@@ -91,7 +88,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.numericMin)).BeginInit();
             this.groupBox_px.SuspendLayout();
             this.groupBox9.SuspendLayout();
-            this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox5.SuspendLayout();
@@ -136,7 +132,7 @@
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(821, 667);
+            this.button1.Location = new System.Drawing.Point(819, 608);
             this.button1.Margin = new System.Windows.Forms.Padding(2);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(70, 30);
@@ -224,7 +220,7 @@
             // 
             // tb_yjwb
             // 
-            this.tb_yjwb.Location = new System.Drawing.Point(9, 65);
+            this.tb_yjwb.Location = new System.Drawing.Point(9, 51);
             this.tb_yjwb.Margin = new System.Windows.Forms.Padding(2);
             this.tb_yjwb.Name = "tb_yjwb";
             this.tb_yjwb.Size = new System.Drawing.Size(250, 21);
@@ -233,7 +229,7 @@
             // label10
             // 
             this.label10.AutoSize = true;
-            this.label10.Location = new System.Drawing.Point(7, 31);
+            this.label10.Location = new System.Drawing.Point(7, 26);
             this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(53, 12);
@@ -260,14 +256,14 @@
             this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox1.Size = new System.Drawing.Size(263, 114);
+            this.groupBox1.Size = new System.Drawing.Size(263, 95);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "页脚设置";
             // 
             // pictureBox7
             // 
-            this.pictureBox7.Location = new System.Drawing.Point(9, 98);
+            this.pictureBox7.Location = new System.Drawing.Point(6, 66);
             this.pictureBox7.Name = "pictureBox7";
             this.pictureBox7.Size = new System.Drawing.Size(249, 144);
             this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@@ -277,7 +273,7 @@
             // label8312
             // 
             this.label8312.AutoSize = true;
-            this.label8312.Location = new System.Drawing.Point(18, 44);
+            this.label8312.Location = new System.Drawing.Point(17, 30);
             this.label8312.Name = "label8312";
             this.label8312.Size = new System.Drawing.Size(47, 12);
             this.label8312.TabIndex = 54;
@@ -285,7 +281,7 @@
             // 
             // button1217
             // 
-            this.button1217.Location = new System.Drawing.Point(182, 39);
+            this.button1217.Location = new System.Drawing.Point(181, 25);
             this.button1217.Name = "button1217";
             this.button1217.Size = new System.Drawing.Size(75, 23);
             this.button1217.TabIndex = 53;
@@ -342,7 +338,7 @@
             // 
             // tb_ysfx_xsys
             // 
-            this.tb_ysfx_xsys.Location = new System.Drawing.Point(255, 138);
+            this.tb_ysfx_xsys.Location = new System.Drawing.Point(255, 143);
             this.tb_ysfx_xsys.Margin = new System.Windows.Forms.Padding(2);
             this.tb_ysfx_xsys.Name = "tb_ysfx_xsys";
             this.tb_ysfx_xsys.ReadOnly = true;
@@ -351,7 +347,7 @@
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(597, 138);
+            this.button4.Location = new System.Drawing.Point(597, 143);
             this.button4.Margin = new System.Windows.Forms.Padding(2);
             this.button4.Name = "button4";
             this.button4.Size = new System.Drawing.Size(72, 20);
@@ -363,7 +359,7 @@
             // ck_ysfx_xsmk
             // 
             this.ck_ysfx_xsmk.AutoSize = true;
-            this.ck_ysfx_xsmk.Location = new System.Drawing.Point(22, 140);
+            this.ck_ysfx_xsmk.Location = new System.Drawing.Point(22, 143);
             this.ck_ysfx_xsmk.Margin = new System.Windows.Forms.Padding(2);
             this.ck_ysfx_xsmk.Name = "ck_ysfx_xsmk";
             this.ck_ysfx_xsmk.Size = new System.Drawing.Size(72, 16);
@@ -405,7 +401,7 @@
             // ck_kllb_fjzt
             // 
             this.ck_kllb_fjzt.AutoSize = true;
-            this.ck_kllb_fjzt.Location = new System.Drawing.Point(22, 323);
+            this.ck_kllb_fjzt.Location = new System.Drawing.Point(22, 352);
             this.ck_kllb_fjzt.Name = "ck_kllb_fjzt";
             this.ck_kllb_fjzt.Size = new System.Drawing.Size(96, 16);
             this.ck_kllb_fjzt.TabIndex = 57;
@@ -426,7 +422,7 @@
             this.groupBox_px.Controls.Add(this.ParticleList_2);
             this.groupBox_px.Controls.Add(this.ParticleList_1);
             this.groupBox_px.Controls.Add(this.comboBox_p1);
-            this.groupBox_px.Location = new System.Drawing.Point(156, 184);
+            this.groupBox_px.Location = new System.Drawing.Point(156, 202);
             this.groupBox_px.Name = "groupBox_px";
             this.groupBox_px.Size = new System.Drawing.Size(513, 125);
             this.groupBox_px.TabIndex = 54;
@@ -526,7 +522,7 @@
             // ck_kllb_xsmk
             // 
             this.ck_kllb_xsmk.AutoSize = true;
-            this.ck_kllb_xsmk.Location = new System.Drawing.Point(22, 179);
+            this.ck_kllb_xsmk.Location = new System.Drawing.Point(22, 197);
             this.ck_kllb_xsmk.Margin = new System.Windows.Forms.Padding(2);
             this.ck_kllb_xsmk.Name = "ck_kllb_xsmk";
             this.ck_kllb_xsmk.Size = new System.Drawing.Size(72, 16);
@@ -535,26 +531,9 @@
             this.ck_kllb_xsmk.UseVisualStyleBackColor = true;
             this.ck_kllb_xsmk.CheckedChanged += new System.EventHandler(this.ck_kllb_xsmk_CheckedChanged);
             // 
-            // label_delete_Class
-            // 
-            this.label_delete_Class.AutoSize = true;
-            this.label_delete_Class.Location = new System.Drawing.Point(4, 17);
-            this.label_delete_Class.Name = "label_delete_Class";
-            this.label_delete_Class.Size = new System.Drawing.Size(101, 12);
-            this.label_delete_Class.TabIndex = 63;
-            this.label_delete_Class.Text = "去除指定物质分类";
-            // 
-            // delete_Class
-            // 
-            this.delete_Class.Location = new System.Drawing.Point(6, 32);
-            this.delete_Class.Multiline = true;
-            this.delete_Class.Name = "delete_Class";
-            this.delete_Class.Size = new System.Drawing.Size(672, 49);
-            this.delete_Class.TabIndex = 62;
-            // 
             // button6
             // 
-            this.button6.Location = new System.Drawing.Point(747, 667);
+            this.button6.Location = new System.Drawing.Point(745, 608);
             this.button6.Margin = new System.Windows.Forms.Padding(2);
             this.button6.Name = "button6";
             this.button6.Size = new System.Drawing.Size(70, 30);
@@ -582,24 +561,13 @@
             this.groupBox9.TabStop = false;
             this.groupBox9.Text = "首页设置";
             // 
-            // groupBox2
-            // 
-            this.groupBox2.Controls.Add(this.label_delete_Class);
-            this.groupBox2.Controls.Add(this.delete_Class);
-            this.groupBox2.Location = new System.Drawing.Point(281, 12);
-            this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Size = new System.Drawing.Size(684, 87);
-            this.groupBox2.TabIndex = 77;
-            this.groupBox2.TabStop = false;
-            this.groupBox2.Text = "排除分类";
-            // 
             // button3
             // 
             this.button3.Location = new System.Drawing.Point(578, 61);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(83, 22);
             this.button3.TabIndex = 68;
-            this.button3.Text = "编辑选择";
+            this.button3.Text = "分类设置";
             this.button3.UseVisualStyleBackColor = true;
             this.button3.Click += new System.EventHandler(this.button3_Click);
             // 
@@ -624,9 +592,9 @@
             this.groupBox3.Controls.Add(this.ck_ysfx_xsmk);
             this.groupBox3.Controls.Add(this.ck_kllb_fjzt);
             this.groupBox3.Controls.Add(this.ck_kllb_xsmk);
-            this.groupBox3.Location = new System.Drawing.Point(281, 206);
+            this.groupBox3.Location = new System.Drawing.Point(285, 111);
             this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(684, 349);
+            this.groupBox3.Size = new System.Drawing.Size(684, 388);
             this.groupBox3.TabIndex = 78;
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "模块设定";
@@ -634,7 +602,7 @@
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(154, 141);
+            this.label2.Location = new System.Drawing.Point(154, 146);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(83, 12);
             this.label2.TabIndex = 68;
@@ -642,7 +610,7 @@
             // 
             // button7
             // 
-            this.button7.Location = new System.Drawing.Point(895, 667);
+            this.button7.Location = new System.Drawing.Point(893, 608);
             this.button7.Margin = new System.Windows.Forms.Padding(2);
             this.button7.Name = "button7";
             this.button7.Size = new System.Drawing.Size(70, 30);
@@ -657,12 +625,12 @@
             this.groupBox4.Controls.Add(this.comboBox1);
             this.groupBox4.Controls.Add(this.button3);
             this.groupBox4.Controls.Add(this.textBox_zypxss);
-            this.groupBox4.Location = new System.Drawing.Point(281, 105);
+            this.groupBox4.Location = new System.Drawing.Point(285, 15);
             this.groupBox4.Name = "groupBox4";
             this.groupBox4.Size = new System.Drawing.Size(684, 90);
             this.groupBox4.TabIndex = 79;
             this.groupBox4.TabStop = false;
-            this.groupBox4.Text = "特定选择";
+            this.groupBox4.Text = "物质分类显示";
             this.groupBox4.Enter += new System.EventHandler(this.groupBox4_Enter);
             // 
             // label7
@@ -683,11 +651,12 @@
             this.comboBox1.Name = "comboBox1";
             this.comboBox1.Size = new System.Drawing.Size(192, 20);
             this.comboBox1.TabIndex = 69;
+            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
             // 
             // label_StandardLibraryName
             // 
             this.label_StandardLibraryName.AutoSize = true;
-            this.label_StandardLibraryName.Location = new System.Drawing.Point(16, 676);
+            this.label_StandardLibraryName.Location = new System.Drawing.Point(16, 617);
             this.label_StandardLibraryName.Name = "label_StandardLibraryName";
             this.label_StandardLibraryName.Size = new System.Drawing.Size(41, 12);
             this.label_StandardLibraryName.TabIndex = 69;
@@ -696,7 +665,7 @@
             // groupBox5
             // 
             this.groupBox5.Controls.Add(this.textBox1);
-            this.groupBox5.Location = new System.Drawing.Point(281, 557);
+            this.groupBox5.Location = new System.Drawing.Point(285, 505);
             this.groupBox5.Name = "groupBox5";
             this.groupBox5.Size = new System.Drawing.Size(684, 98);
             this.groupBox5.TabIndex = 69;
@@ -716,9 +685,9 @@
             this.groupBox6.Controls.Add(this.pictureBox7);
             this.groupBox6.Controls.Add(this.button1217);
             this.groupBox6.Controls.Add(this.label8312);
-            this.groupBox6.Location = new System.Drawing.Point(11, 401);
+            this.groupBox6.Location = new System.Drawing.Point(11, 382);
             this.groupBox6.Name = "groupBox6";
-            this.groupBox6.Size = new System.Drawing.Size(263, 254);
+            this.groupBox6.Size = new System.Drawing.Size(263, 221);
             this.groupBox6.TabIndex = 80;
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "图标选择";
@@ -727,7 +696,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(977, 708);
+            this.ClientSize = new System.Drawing.Size(977, 647);
             this.Controls.Add(this.groupBox5);
             this.Controls.Add(this.groupBox6);
             this.Controls.Add(this.label_StandardLibraryName);
@@ -736,7 +705,6 @@
             this.Controls.Add(this.groupBox4);
             this.Controls.Add(this.groupBox3);
             this.Controls.Add(this.button1);
-            this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox9);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.button2);
@@ -757,8 +725,6 @@
             this.groupBox_px.PerformLayout();
             this.groupBox9.ResumeLayout(false);
             this.groupBox9.PerformLayout();
-            this.groupBox2.ResumeLayout(false);
-            this.groupBox2.PerformLayout();
             this.groupBox3.ResumeLayout(false);
             this.groupBox3.PerformLayout();
             this.groupBox4.ResumeLayout(false);
@@ -808,8 +774,6 @@
         private System.Windows.Forms.Button button5;
         private System.Windows.Forms.TextBox tb_RemoveElements;
         private System.Windows.Forms.Label label11111;
-        private System.Windows.Forms.Label label_delete_Class;
-        private System.Windows.Forms.TextBox delete_Class;
         private System.Windows.Forms.Label label112121;
         private System.Windows.Forms.NumericUpDown numericMin;
         private System.Windows.Forms.CheckBox checkBox2;
@@ -818,7 +782,6 @@
         private System.Windows.Forms.PictureBox pictureBox7;
         private System.Windows.Forms.Label label8312;
         private System.Windows.Forms.Button button1217;
-        private System.Windows.Forms.GroupBox groupBox2;
         private System.Windows.Forms.TextBox textBox_zypxss;
         private System.Windows.Forms.GroupBox groupBox3;
         private System.Windows.Forms.Label label2;

+ 62 - 59
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_CleannessA.cs

@@ -22,6 +22,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         public string FileName = "";
         private string fileName = "";
         Hashtable table;
+
+        private string CurrentDatabase = "";
+        private bool SwitchCategories = false;
         #endregion
 
         #region 构造函数及窗体加载
@@ -299,26 +302,26 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     }
                 }
 
-                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass.ToString(), "M_KLLBXX", "str_kllb_DeleteClass");
-                for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i++)                              //去除元素列表
-                {
-                    xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[i].ToString(), "M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + i.ToString());
-                }
-
-                //然后判断一下xml中是否还存在之前比现有长度长的节点存在,存在则删除,防止后面再进行读取
-                for (int i = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i < 1000; i++)
-                {
-                    string strxh = i.ToString();
-                    if (null != xmlutil.Read("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + strxh))
-                    {
-                        //删除该节点
-                        xmlutil.RemoveNode("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + strxh);
-                    }
-                    else
-                    {
-                        break;
-                    }
-                }
+                //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass.ToString(), "M_KLLBXX", "str_kllb_DeleteClass");
+                //for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i++)                              //去除元素列表
+                //{
+                //    xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[i].ToString(), "M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + i.ToString());
+                //}
+
+                ////然后判断一下xml中是否还存在之前比现有长度长的节点存在,存在则删除,防止后面再进行读取
+                //for (int i = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i < 1000; i++)
+                //{
+                //    string strxh = i.ToString();
+                //    if (null != xmlutil.Read("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + strxh))
+                //    {
+                //        //删除该节点
+                //        xmlutil.RemoveNode("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + strxh);
+                //    }
+                //    else
+                //    {
+                //        break;
+                //    }
+                //}
 
                 //夹杂物占比
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_surface.ToString(), "M_JZWZB", "b_ck_surface");//夹杂物占比表
@@ -350,12 +353,12 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys.Add(after[i]);
             }
             //拆分,物质分类
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Clear();
-            for (int i = 0; i < delete_Class.Text.Split(',').Length; i++)
-            {
-                if (delete_Class.Text.Split(',')[i] != "")
-                    m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(delete_Class.Text.Split(',')[i]);
-            }
+            //m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Clear();
+            //for (int i = 0; i < delete_Class.Text.Split(',').Length; i++)
+            //{
+            //    if (delete_Class.Text.Split(',')[i] != "")
+            //        m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(delete_Class.Text.Split(',')[i]);
+            //}
             //主要优先显示
             m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Clear();
             string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
@@ -406,7 +409,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_chart = false;//夹杂物占比图
             //去除信息
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys = tb_RemoveElements.Text;//去除不要的物质元素
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = delete_Class.Text;//去除不要的物质分类
+            //m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = delete_Class.Text;//去除不要的物质分类
             m_OTSReport_Export.m_mbszclass.str_MainPriority = textBox_zypxss.Text;//主要排序
            
            
@@ -443,7 +446,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             comboBox_p2.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_sort_p2;
             comboBox_p3.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_sort_p3;
            
-            delete_Class.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass;
+            //delete_Class.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass;
             textBox_zypxss.Text = m_OTSReport_Export.m_mbszclass.str_MainPriority;
 
             numericMin.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_int_kllb_number.ToString();
@@ -623,10 +626,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
                         if (!IsPathWithinDirectory(filePath, System.IO.Directory.GetCurrentDirectory() + "\\Config\\ReportTemplate"))
                         {
-                            //Console.WriteLine("图片路径在指定的文件夹内。");
                             CopyPicture(filePath, System.IO.Directory.GetCurrentDirectory() + "\\Config\\ReportTemplate\\");
                         }
-                        //CopyPicture(filePath, System.IO.Directory.GetCurrentDirectory() + "\\Config\\ReportTemplate\\");
                     }
                     catch
                     {
@@ -644,16 +645,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// <param name="targetFolderPath">目标文件夹路径(确保文件夹存在,否则需要创建它)</param>
         private void CopyPicture(string sourceImagePath, string targetFolderPath)
         {
-
             // 构造目标图片路径(如果图片名要改变,可以在这里指定新的名字)  
             string targetImagePath = Path.Combine(targetFolderPath, Path.GetFileName(sourceImagePath));
-
             // 确保目标文件夹存在  
             if (!Directory.Exists(targetFolderPath))
             {
                 Directory.CreateDirectory(targetFolderPath);
             }
-
             // 复制图片到目标路径  
             try
             {
@@ -672,11 +670,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 directoryPath += Path.DirectorySeparatorChar;
             }
-
             // 使用Path.GetFullPath来规范化路径,这样可以处理相对路径和当前目录等  
             string fullPath = Path.GetFullPath(filePath);
             string fullDirectoryPath = Path.GetFullPath(directoryPath);
-
             // 判断fullPath是否以fullDirectoryPath为前缀  
             return fullPath.StartsWith(fullDirectoryPath, StringComparison.OrdinalIgnoreCase);
         }
@@ -692,12 +688,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
         private void ck_kllb_xsmk_CheckedChanged(object sender, EventArgs e)
         {
-
             if (!ck_kllb_xsmk.Checked)
             {
                 ck_kllb_fjzt.Checked = false;
             }
-
         }
 
         private void ck_kllb_fjzt_CheckedChanged(object sender, EventArgs e)
@@ -740,46 +734,46 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
         private void button3_Click(object sender, EventArgs e)
         {
-            List<string> vs = new List<string>(); 
-            string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
-            for (int i = 0; i < MainPriority.Length; i++)
+            List<string> vs = new List<string>();
+            if (!SwitchCategories)
             {
-                if (textBox_zypxss.Text.Split(',')[i] != "")
-                    vs.Add(MainPriority[i]);
+                string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
+                for (int i = 0; i < MainPriority.Length; i++)
+                {
+                    if (textBox_zypxss.Text.Split(',')[i] != "")
+                        vs.Add(MainPriority[i]);
+                }
             }
-
-            Category category = new Category(vs, ReadClassification());
+            Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
             category.ShowDialog();
             List<string> ls = category.OutElementList;
-            string str="";
-            for (int i=0;i< ls.Count;i++)
+            string str = "";
+            for (int i = 0; i < ls.Count; i++)
             {
-                if (i== ls.Count-1)
+                if (i == ls.Count - 1)
                 {
-                    str = str+ ls[i];
+                    str = str + ls[i];
                 }
                 else
                 {
                     str = str + ls[i] + ",";
                 }
-                
             }
-            textBox_zypxss.Text = str;
-
+            if (category.IsModify)
+            {
+                textBox_zypxss.Text = str;
+            }
         }
-        private List<string> ReadClassification()
+        private List<string> ReadClassification(int position)
         {
             List<string> vs = new List<string>();
-            if (comboBox1.Text== "")
+            if (comboBox1.Text == "")
             {
-                return vs; 
+                return vs;
             }
-   
-            OTSCommon.SqLiteHelper sh = new OTSCommon.SqLiteHelper("data source='" + m_OTSReport_Export.LibraryName[comboBox1.SelectedIndex][1] + "'");
-            
+            OTSCommon.SqLiteHelper sh = new OTSCommon.SqLiteHelper("data source='" + m_OTSReport_Export.LibraryName[position][1] + "'");
             DataTable dt_stl = sh.ExecuteQuery("select * from ClassifySTD");
-            
-            for (int i=0;i< dt_stl.Rows.Count;i++)
+            for (int i = 0; i < dt_stl.Rows.Count; i++)
             {
                 vs.Add(dt_stl.Rows[i]["StrName"].ToString());
             }
@@ -795,5 +789,14 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         {
 
         }
+
+        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (CurrentDatabase != comboBox1.Text)
+            {
+                CurrentDatabase = comboBox1.Text;
+                SwitchCategories = true;
+            }
+        }
     }
 }

+ 72 - 150
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_INCA.Designer.cs

@@ -70,41 +70,34 @@
             this.ParticleList_1 = new System.Windows.Forms.Label();
             this.comboBox_p1 = new System.Windows.Forms.ComboBox();
             this.ck_kllb_xsmk = new System.Windows.Forms.CheckBox();
-            this.label_delete_Class = new System.Windows.Forms.Label();
-            this.delete_Class = new System.Windows.Forms.TextBox();
             this.button6 = new System.Windows.Forms.Button();
             this.ck_jzwzb_surface = new System.Windows.Forms.CheckBox();
             this.groupBox9 = new System.Windows.Forms.GroupBox();
-            this.groupBox2 = new System.Windows.Forms.GroupBox();
-            this.button3 = new System.Windows.Forms.Button();
-            this.textBox_zypxss = new System.Windows.Forms.TextBox();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.button8 = new System.Windows.Forms.Button();
             this.label2 = new System.Windows.Forms.Label();
             this.ck_syxt_xsmk = new System.Windows.Forms.CheckBox();
             this.button7 = new System.Windows.Forms.Button();
-            this.groupBox4 = new System.Windows.Forms.GroupBox();
-            this.label7 = new System.Windows.Forms.Label();
-            this.comboBox1 = new System.Windows.Forms.ComboBox();
-            this.label_StandardLibraryName = new System.Windows.Forms.Label();
             this.groupBox5 = new System.Windows.Forms.GroupBox();
             this.textBox1 = new System.Windows.Forms.TextBox();
             this.groupBox6 = new System.Windows.Forms.GroupBox();
-            this.button8 = new System.Windows.Forms.Button();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.label_delete_Class = new System.Windows.Forms.Label();
+            this.delete_Class = new System.Windows.Forms.TextBox();
             this.groupBox1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.numericMin)).BeginInit();
             this.groupBox_px.SuspendLayout();
             this.groupBox9.SuspendLayout();
-            this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
-            this.groupBox4.SuspendLayout();
             this.groupBox5.SuspendLayout();
             this.groupBox6.SuspendLayout();
+            this.groupBox2.SuspendLayout();
             this.SuspendLayout();
             // 
             // tb_FBT
             // 
-            this.tb_FBT.Location = new System.Drawing.Point(5, 131);
+            this.tb_FBT.Location = new System.Drawing.Point(5, 128);
             this.tb_FBT.Margin = new System.Windows.Forms.Padding(2);
             this.tb_FBT.Name = "tb_FBT";
             this.tb_FBT.Size = new System.Drawing.Size(252, 21);
@@ -112,7 +105,7 @@
             // 
             // tb_ZBT
             // 
-            this.tb_ZBT.Location = new System.Drawing.Point(5, 58);
+            this.tb_ZBT.Location = new System.Drawing.Point(5, 57);
             this.tb_ZBT.Margin = new System.Windows.Forms.Padding(2);
             this.tb_ZBT.Name = "tb_ZBT";
             this.tb_ZBT.Size = new System.Drawing.Size(252, 21);
@@ -121,7 +114,7 @@
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(5, 99);
+            this.label5.Location = new System.Drawing.Point(5, 97);
             this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(41, 12);
@@ -140,7 +133,7 @@
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(841, 754);
+            this.button1.Location = new System.Drawing.Point(841, 662);
             this.button1.Margin = new System.Windows.Forms.Padding(2);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(70, 30);
@@ -163,7 +156,7 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(5, 172);
+            this.label1.Location = new System.Drawing.Point(5, 168);
             this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(53, 12);
@@ -172,7 +165,7 @@
             // 
             // tb_YPBH
             // 
-            this.tb_YPBH.Location = new System.Drawing.Point(5, 204);
+            this.tb_YPBH.Location = new System.Drawing.Point(5, 199);
             this.tb_YPBH.Margin = new System.Windows.Forms.Padding(2);
             this.tb_YPBH.Name = "tb_YPBH";
             this.tb_YPBH.Size = new System.Drawing.Size(252, 21);
@@ -181,7 +174,7 @@
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(5, 245);
+            this.label4.Location = new System.Drawing.Point(5, 239);
             this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(53, 12);
@@ -190,7 +183,7 @@
             // 
             // tb_CKBZ
             // 
-            this.tb_CKBZ.Location = new System.Drawing.Point(5, 277);
+            this.tb_CKBZ.Location = new System.Drawing.Point(5, 270);
             this.tb_CKBZ.Margin = new System.Windows.Forms.Padding(2);
             this.tb_CKBZ.Name = "tb_CKBZ";
             this.tb_CKBZ.Size = new System.Drawing.Size(252, 21);
@@ -228,7 +221,7 @@
             // 
             // tb_yjwb
             // 
-            this.tb_yjwb.Location = new System.Drawing.Point(7, 71);
+            this.tb_yjwb.Location = new System.Drawing.Point(5, 58);
             this.tb_yjwb.Margin = new System.Windows.Forms.Padding(2);
             this.tb_yjwb.Name = "tb_yjwb";
             this.tb_yjwb.Size = new System.Drawing.Size(250, 21);
@@ -237,7 +230,7 @@
             // label10
             // 
             this.label10.AutoSize = true;
-            this.label10.Location = new System.Drawing.Point(10, 36);
+            this.label10.Location = new System.Drawing.Point(6, 29);
             this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(53, 12);
@@ -260,18 +253,18 @@
             this.groupBox1.Controls.Add(this.label9);
             this.groupBox1.Controls.Add(this.tb_yjwb);
             this.groupBox1.Controls.Add(this.label10);
-            this.groupBox1.Location = new System.Drawing.Point(13, 339);
+            this.groupBox1.Location = new System.Drawing.Point(13, 327);
             this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox1.Size = new System.Drawing.Size(263, 138);
+            this.groupBox1.Size = new System.Drawing.Size(263, 100);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "页脚设置";
             // 
             // pictureBox7
             // 
-            this.pictureBox7.Location = new System.Drawing.Point(8, 84);
+            this.pictureBox7.Location = new System.Drawing.Point(8, 57);
             this.pictureBox7.Name = "pictureBox7";
             this.pictureBox7.Size = new System.Drawing.Size(249, 154);
             this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@@ -281,7 +274,7 @@
             // label8312
             // 
             this.label8312.AutoSize = true;
-            this.label8312.Location = new System.Drawing.Point(18, 43);
+            this.label8312.Location = new System.Drawing.Point(18, 33);
             this.label8312.Name = "label8312";
             this.label8312.Size = new System.Drawing.Size(47, 12);
             this.label8312.TabIndex = 54;
@@ -289,7 +282,7 @@
             // 
             // button1217
             // 
-            this.button1217.Location = new System.Drawing.Point(182, 38);
+            this.button1217.Location = new System.Drawing.Point(182, 28);
             this.button1217.Name = "button1217";
             this.button1217.Size = new System.Drawing.Size(75, 23);
             this.button1217.TabIndex = 53;
@@ -554,26 +547,9 @@
             this.ck_kllb_xsmk.UseVisualStyleBackColor = true;
             this.ck_kllb_xsmk.CheckedChanged += new System.EventHandler(this.ck_kllb_xsmk_CheckedChanged);
             // 
-            // label_delete_Class
-            // 
-            this.label_delete_Class.AutoSize = true;
-            this.label_delete_Class.Location = new System.Drawing.Point(4, 17);
-            this.label_delete_Class.Name = "label_delete_Class";
-            this.label_delete_Class.Size = new System.Drawing.Size(101, 12);
-            this.label_delete_Class.TabIndex = 63;
-            this.label_delete_Class.Text = "去除指定物质分类";
-            // 
-            // delete_Class
-            // 
-            this.delete_Class.Location = new System.Drawing.Point(6, 32);
-            this.delete_Class.Multiline = true;
-            this.delete_Class.Name = "delete_Class";
-            this.delete_Class.Size = new System.Drawing.Size(691, 41);
-            this.delete_Class.TabIndex = 62;
-            // 
             // button6
             // 
-            this.button6.Location = new System.Drawing.Point(767, 754);
+            this.button6.Location = new System.Drawing.Point(767, 662);
             this.button6.Margin = new System.Windows.Forms.Padding(2);
             this.button6.Name = "button6";
             this.button6.Size = new System.Drawing.Size(70, 30);
@@ -607,41 +583,11 @@
             this.groupBox9.Controls.Add(this.label3);
             this.groupBox9.Location = new System.Drawing.Point(13, 13);
             this.groupBox9.Name = "groupBox9";
-            this.groupBox9.Size = new System.Drawing.Size(263, 321);
+            this.groupBox9.Size = new System.Drawing.Size(263, 309);
             this.groupBox9.TabIndex = 1;
             this.groupBox9.TabStop = false;
             this.groupBox9.Text = "首页设置";
             // 
-            // groupBox2
-            // 
-            this.groupBox2.Controls.Add(this.label_delete_Class);
-            this.groupBox2.Controls.Add(this.delete_Class);
-            this.groupBox2.Location = new System.Drawing.Point(282, 13);
-            this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Size = new System.Drawing.Size(703, 79);
-            this.groupBox2.TabIndex = 77;
-            this.groupBox2.TabStop = false;
-            this.groupBox2.Text = "去除信息";
-            this.groupBox2.Enter += new System.EventHandler(this.groupBox2_Enter);
-            // 
-            // button3
-            // 
-            this.button3.Location = new System.Drawing.Point(614, 66);
-            this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(83, 22);
-            this.button3.TabIndex = 69;
-            this.button3.Text = "编辑选择";
-            this.button3.UseVisualStyleBackColor = true;
-            this.button3.Click += new System.EventHandler(this.button3_Click);
-            // 
-            // textBox_zypxss
-            // 
-            this.textBox_zypxss.Location = new System.Drawing.Point(6, 14);
-            this.textBox_zypxss.Multiline = true;
-            this.textBox_zypxss.Name = "textBox_zypxss";
-            this.textBox_zypxss.Size = new System.Drawing.Size(691, 41);
-            this.textBox_zypxss.TabIndex = 65;
-            // 
             // groupBox3
             // 
             this.groupBox3.Controls.Add(this.button8);
@@ -659,13 +605,24 @@
             this.groupBox3.Controls.Add(this.checkBox1);
             this.groupBox3.Controls.Add(this.ck_ysfx_xsmk);
             this.groupBox3.Controls.Add(this.ck_klcc_xsmk);
-            this.groupBox3.Location = new System.Drawing.Point(282, 199);
+            this.groupBox3.Location = new System.Drawing.Point(282, 106);
             this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(703, 442);
+            this.groupBox3.Size = new System.Drawing.Size(703, 447);
             this.groupBox3.TabIndex = 78;
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "模块设定";
             // 
+            // button8
+            // 
+            this.button8.Location = new System.Drawing.Point(596, 119);
+            this.button8.Margin = new System.Windows.Forms.Padding(2);
+            this.button8.Name = "button8";
+            this.button8.Size = new System.Drawing.Size(72, 20);
+            this.button8.TabIndex = 68;
+            this.button8.Text = "顺序调整";
+            this.button8.UseVisualStyleBackColor = true;
+            this.button8.Click += new System.EventHandler(this.button8_Click);
+            // 
             // label2
             // 
             this.label2.AutoSize = true;
@@ -688,7 +645,7 @@
             // 
             // button7
             // 
-            this.button7.Location = new System.Drawing.Point(915, 754);
+            this.button7.Location = new System.Drawing.Point(915, 662);
             this.button7.Margin = new System.Windows.Forms.Padding(2);
             this.button7.Name = "button7";
             this.button7.Size = new System.Drawing.Size(70, 30);
@@ -697,51 +654,10 @@
             this.button7.UseVisualStyleBackColor = true;
             this.button7.Click += new System.EventHandler(this.button7_Click);
             // 
-            // groupBox4
-            // 
-            this.groupBox4.Controls.Add(this.label7);
-            this.groupBox4.Controls.Add(this.comboBox1);
-            this.groupBox4.Controls.Add(this.button3);
-            this.groupBox4.Controls.Add(this.textBox_zypxss);
-            this.groupBox4.Location = new System.Drawing.Point(282, 98);
-            this.groupBox4.Name = "groupBox4";
-            this.groupBox4.Size = new System.Drawing.Size(703, 95);
-            this.groupBox4.TabIndex = 79;
-            this.groupBox4.TabStop = false;
-            this.groupBox4.Text = "特定选择";
-            // 
-            // label7
-            // 
-            this.label7.AutoSize = true;
-            this.label7.Location = new System.Drawing.Point(330, 71);
-            this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(77, 12);
-            this.label7.TabIndex = 72;
-            this.label7.Text = "标准库选择:";
-            // 
-            // comboBox1
-            // 
-            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.comboBox1.FormattingEnabled = true;
-            this.comboBox1.Location = new System.Drawing.Point(412, 68);
-            this.comboBox1.Margin = new System.Windows.Forms.Padding(2);
-            this.comboBox1.Name = "comboBox1";
-            this.comboBox1.Size = new System.Drawing.Size(192, 20);
-            this.comboBox1.TabIndex = 71;
-            // 
-            // label_StandardLibraryName
-            // 
-            this.label_StandardLibraryName.AutoSize = true;
-            this.label_StandardLibraryName.Location = new System.Drawing.Point(16, 763);
-            this.label_StandardLibraryName.Name = "label_StandardLibraryName";
-            this.label_StandardLibraryName.Size = new System.Drawing.Size(41, 12);
-            this.label_StandardLibraryName.TabIndex = 80;
-            this.label_StandardLibraryName.Text = "label7";
-            // 
             // groupBox5
             // 
             this.groupBox5.Controls.Add(this.textBox1);
-            this.groupBox5.Location = new System.Drawing.Point(282, 647);
+            this.groupBox5.Location = new System.Drawing.Point(282, 559);
             this.groupBox5.Name = "groupBox5";
             this.groupBox5.Size = new System.Drawing.Size(703, 98);
             this.groupBox5.TabIndex = 68;
@@ -761,36 +677,51 @@
             this.groupBox6.Controls.Add(this.pictureBox7);
             this.groupBox6.Controls.Add(this.label8312);
             this.groupBox6.Controls.Add(this.button1217);
-            this.groupBox6.Location = new System.Drawing.Point(13, 482);
+            this.groupBox6.Location = new System.Drawing.Point(13, 432);
             this.groupBox6.Name = "groupBox6";
-            this.groupBox6.Size = new System.Drawing.Size(263, 263);
+            this.groupBox6.Size = new System.Drawing.Size(263, 225);
             this.groupBox6.TabIndex = 69;
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "图标选择";
             // 
-            // button8
+            // groupBox2
             // 
-            this.button8.Location = new System.Drawing.Point(596, 119);
-            this.button8.Margin = new System.Windows.Forms.Padding(2);
-            this.button8.Name = "button8";
-            this.button8.Size = new System.Drawing.Size(72, 20);
-            this.button8.TabIndex = 68;
-            this.button8.Text = "顺序调整";
-            this.button8.UseVisualStyleBackColor = true;
-            this.button8.Click += new System.EventHandler(this.button8_Click);
+            this.groupBox2.Controls.Add(this.label_delete_Class);
+            this.groupBox2.Controls.Add(this.delete_Class);
+            this.groupBox2.Location = new System.Drawing.Point(282, 13);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(703, 87);
+            this.groupBox2.TabIndex = 81;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "排除分类";
+            // 
+            // label_delete_Class
+            // 
+            this.label_delete_Class.AutoSize = true;
+            this.label_delete_Class.Location = new System.Drawing.Point(4, 17);
+            this.label_delete_Class.Name = "label_delete_Class";
+            this.label_delete_Class.Size = new System.Drawing.Size(101, 12);
+            this.label_delete_Class.TabIndex = 63;
+            this.label_delete_Class.Text = "去除指定物质分类";
+            // 
+            // delete_Class
+            // 
+            this.delete_Class.Location = new System.Drawing.Point(6, 32);
+            this.delete_Class.Multiline = true;
+            this.delete_Class.Name = "delete_Class";
+            this.delete_Class.Size = new System.Drawing.Size(691, 49);
+            this.delete_Class.TabIndex = 62;
             // 
             // OTSReport_Template_INCA
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(995, 795);
+            this.ClientSize = new System.Drawing.Size(995, 699);
+            this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox5);
             this.Controls.Add(this.groupBox6);
-            this.Controls.Add(this.label_StandardLibraryName);
             this.Controls.Add(this.button7);
-            this.Controls.Add(this.groupBox4);
             this.Controls.Add(this.groupBox3);
-            this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox9);
             this.Controls.Add(this.button6);
             this.Controls.Add(this.groupBox1);
@@ -813,18 +744,15 @@
             this.groupBox_px.PerformLayout();
             this.groupBox9.ResumeLayout(false);
             this.groupBox9.PerformLayout();
-            this.groupBox2.ResumeLayout(false);
-            this.groupBox2.PerformLayout();
             this.groupBox3.ResumeLayout(false);
             this.groupBox3.PerformLayout();
-            this.groupBox4.ResumeLayout(false);
-            this.groupBox4.PerformLayout();
             this.groupBox5.ResumeLayout(false);
             this.groupBox5.PerformLayout();
             this.groupBox6.ResumeLayout(false);
             this.groupBox6.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
             this.ResumeLayout(false);
-            this.PerformLayout();
 
         }
 
@@ -867,8 +795,6 @@
         private System.Windows.Forms.Button button5;
         private System.Windows.Forms.TextBox tb_RemoveElements;
         private System.Windows.Forms.Label label11111;
-        private System.Windows.Forms.Label label_delete_Class;
-        private System.Windows.Forms.TextBox delete_Class;
         private System.Windows.Forms.Label label112121;
         private System.Windows.Forms.NumericUpDown numericMin;
         private System.Windows.Forms.CheckBox checkBox2;
@@ -876,20 +802,16 @@
         private System.Windows.Forms.PictureBox pictureBox7;
         private System.Windows.Forms.Label label8312;
         private System.Windows.Forms.Button button1217;
-        private System.Windows.Forms.GroupBox groupBox2;
-        private System.Windows.Forms.TextBox textBox_zypxss;
         private System.Windows.Forms.GroupBox groupBox3;
         private System.Windows.Forms.CheckBox ck_syxt_xsmk;
         private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.Button button3;
-        private System.Windows.Forms.GroupBox groupBox4;
         private System.Windows.Forms.Button button7;
-        private System.Windows.Forms.Label label7;
-        private System.Windows.Forms.ComboBox comboBox1;
-        private System.Windows.Forms.Label label_StandardLibraryName;
         private System.Windows.Forms.GroupBox groupBox5;
         private System.Windows.Forms.TextBox textBox1;
         private System.Windows.Forms.GroupBox groupBox6;
         private System.Windows.Forms.Button button8;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.Label label_delete_Class;
+        private System.Windows.Forms.TextBox delete_Class;
     }
 }

+ 38 - 81
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_INCA.cs

@@ -22,6 +22,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         public string FileName = "";
         private string fileName = "";
         Hashtable table;
+        //private string CurrentDatabase = "";
+        //private bool SwitchCategories = false;
         #endregion
         #region 构造函数及窗体加载
 
@@ -42,25 +44,29 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             BindControl();
             //读取默认值
             LoadControls();
-            label_StandardLibraryName.Text = table["standardlibrary"].ToString() + m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName;
-            for (int i = 0; i < m_OTSReport_Export.LibraryName.Count; i++)
-            {
-                comboBox1.Items.Add(m_OTSReport_Export.LibraryName[i][0]);
-            }
-            int CurrentName = 0;
+            //label_StandardLibraryName.Text = table["standardlibrary"].ToString() + m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName;
+            //for (int i = 0; i < m_OTSReport_Export.LibraryName.Count; i++)
+            //{
+            //    comboBox1.Items.Add(m_OTSReport_Export.LibraryName[i][0]);
+            //}
+            //int CurrentName = 0;
+
+            //for (int i = 0; i < m_OTSReport_Export.LibraryName.Count; i++)
+            //{
+            //    if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName == m_OTSReport_Export.LibraryName[i][0])
+            //    {
+            //        CurrentName = i;
+            //        break;
+            //    }
+            //}
+            //if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName != "")
+            //{
+            //    comboBox1.SelectedIndex = CurrentName;
+            //}
+
+            //CurrentDatabase = comboBox1.Text;
+
 
-            for (int i = 0; i < m_OTSReport_Export.LibraryName.Count; i++)
-            {
-                if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName == m_OTSReport_Export.LibraryName[i][0])
-                {
-                    CurrentName = i;
-                    break;
-                }
-            }
-            if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName != "")
-            {
-                comboBox1.SelectedIndex = CurrentName;
-            }
         }
 
         /// <summary>
@@ -325,7 +331,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                         break;
                     }
                 }
-                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass.ToString(), "M_KLLBXX", "str_kllb_DeleteClass");
+                //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass.ToString(), "M_KLLBXX", "str_kllb_DeleteClass");
 
                 for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i++)                              //去除元素列表
                 {
@@ -382,13 +388,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(delete_Class.Text.Split(',')[i]);
             }
             //主要优先显示
-            m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Clear();
-            string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
-            for (int i = 0; i < MainPriority.Length; i++)
-            {
-                if (textBox_zypxss.Text.Split(',')[i] != "")
-                    m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Add(MainPriority[i]);
-            }
+            //m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Clear();
+            //string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
+            //for (int i = 0; i < MainPriority.Length; i++)
+            //{
+            //    if (textBox_zypxss.Text.Split(',')[i] != "")
+            //        m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Add(MainPriority[i]);
+            //}
            
             m_OTSReport_Export.m_mbszclass.M_SY.LOGName = fileName;
             //首页
@@ -399,7 +405,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_YMYJ.str_tb_yjwb = tb_yjwb.Text;
 
             //ResultFile resfile = m_OTSReport_Export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_OTSReport_Export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
-            m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName = comboBox1.Text;
+            //m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName = comboBox1.Text;
             //颗粒分析结果
             m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_ck_klcc_xsmk = ck_klcc_xsmk.Checked;
             m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_ck_klcc_xsddt = false;
@@ -445,7 +451,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //去除信息
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys = tb_RemoveElements.Text;//去除不要的物质元素
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = delete_Class.Text;//去除不要的物质分类
-            m_OTSReport_Export.m_mbszclass.str_MainPriority = textBox_zypxss.Text;//主要排序
+            //m_OTSReport_Export.m_mbszclass.str_MainPriority = textBox_zypxss.Text;//主要排序
    
         
         }
@@ -495,9 +501,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             comboBox_p1.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_sort_p1;
             comboBox_p2.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_sort_p2;
             comboBox_p3.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_sort_p3;
-            
+
             delete_Class.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass;
-            textBox_zypxss.Text = m_OTSReport_Export.m_mbszclass.str_MainPriority;
+            //textBox_zypxss.Text = m_OTSReport_Export.m_mbszclass.str_MainPriority;
           
             //夹杂物占比
             ck_jzwzb_surface.Checked = m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_surface;//夹杂物占比表
@@ -793,57 +799,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
         }
 
-        private void button3_Click(object sender, EventArgs e)
-        {
-            List<string> vs = new List<string>();
-            string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
-            for (int i = 0; i < MainPriority.Length; i++)
-            {
-                if (textBox_zypxss.Text.Split(',')[i] != "")
-                    vs.Add(MainPriority[i]);
-            }
-
-            Category category = new Category(vs, ReadClassification());
-            category.ShowDialog();
-            List<string> ls = category.OutElementList;
-            string str = "";
-            for (int i = 0; i < ls.Count; i++)
-            {
-                if (i == ls.Count - 1)
-                {
-                    str = str + ls[i];
-                }
-                else
-                {
-                    str = str + ls[i] + ",";
-                }
-
-            }
-            textBox_zypxss.Text = str;
-        }
-        private List<string> ReadClassification()
-        {
-            List<string> vs = new List<string>();
-            if (comboBox1.Text == "")
-            {
-                return vs;
-            }
-
-            OTSCommon.SqLiteHelper sh = new OTSCommon.SqLiteHelper("data source='" + m_OTSReport_Export.LibraryName[comboBox1.SelectedIndex][1] + "'");
-
-            DataTable dt_stl = sh.ExecuteQuery("select * from ClassifySTD");
-
-            for (int i = 0; i < dt_stl.Rows.Count; i++)
-            {
-                vs.Add(dt_stl.Rows[i]["StrName"].ToString());
-            }
-            return vs;
-        }
-
-        private void groupBox2_Enter(object sender, EventArgs e)
-        {
-
-        }
 
         private void button7_Click(object sender, EventArgs e)
         {
@@ -898,5 +853,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
             tb_ysfx_xsys.Text = str;
         }
+
+ 
     }
 }

+ 17 - 7
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -2070,6 +2070,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             XRTableRow Template_Rows_5 = new XRTableRow();
             XRTableCell Template_Rows5_Cell_1 = new XRTableCell();
             XRTableCell Template_Rows5_Cell_2 = new XRTableCell();
+            XRTableCell Template_Rows5_Cell_3 = new XRTableCell();
 
             Template.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
 
@@ -2146,10 +2147,12 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             Template_Rows_4.Controls.Add(Template_Rows4_Cell_11);
 
 
-            Template_Rows5_Cell_1.WidthF = 115.67f;
-            Template_Rows5_Cell_2.WidthF = 572.33f;
+            Template_Rows5_Cell_1.WidthF = 120f;
+            Template_Rows5_Cell_2.WidthF = 120f;
+            Template_Rows5_Cell_3.WidthF = 448f;
             Template_Rows_5.Controls.Add(Template_Rows5_Cell_1);
             Template_Rows_5.Controls.Add(Template_Rows5_Cell_2);
+            Template_Rows_5.Controls.Add(Template_Rows5_Cell_3);
             Template.Rows.Add(Template_Rows_1);
             Template.Rows.Add(Template_Rows_2);
             Template.Rows.Add(Template_Rows_3);
@@ -2207,19 +2210,26 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             XRPictureBox xRPicture2 = new XRPictureBox();
             xRPicture2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.AutoSize;
             xRPicture2.ImageSource = new ImageSource((Bitmap)dataTable.Rows[position]["p3"]);
+
             XRPictureBox xRPicture3 = new XRPictureBox();
-            xRPicture3.ImageSource = new ImageSource((Bitmap)dataTable.Rows[position]["p1"]);
-            xRPicture3.SizeF = new SizeF(117f, 121f);
+            xRPicture3.ImageSource = new ImageSource((Bitmap)dataTable.Rows[position]["p1"]);           
+            xRPicture3.SizeF = new SizeF(120f, 120f);
             xRPicture3.Sizing = DevExpress.XtraPrinting.ImageSizeMode.Squeeze;
 
+            XRPictureBox xRPicture4 = new XRPictureBox();
+            xRPicture4.ImageSource = new ImageSource((Bitmap)dataTable.Rows[position]["p2"]);
+            xRPicture4.SizeF = new SizeF(120f, 120f);
+            xRPicture4.Sizing = DevExpress.XtraPrinting.ImageSizeMode.Squeeze;
+
 
-            XRChart xRChart= ParticleSpectrogramControl(ElementIcons);
+            //XRChart xRChart= ParticleSpectrogramControl(ElementIcons);
 
 
             table.Rows[4].Cells[0].Controls.Add(xRPicture3);
-            table.Rows[4].Cells[1].Controls.Add(xRPicture2);
+            table.Rows[4].Cells[1].Controls.Add(xRPicture4);
+            table.Rows[4].Cells[2].Controls.Add(xRPicture2);
             //table.Rows[4].Cells[1].Controls.Add(xRChart);
-            table.Rows[4].Cells[1].TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
+            table.Rows[4].Cells[2].TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
 
             table.Visible = true;
             table.LocationF = new PointF(0, NeueStartposition);

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

@@ -644,6 +644,18 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
+        /// <summary>
+        /// 得到图形形状
+        /// </summary>
+        /// <returns></returns>
+        public DataTable GetSegment()
+        {
+            string sqliteString = "select * from Segment";
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+
+        }
 
         public Bitmap GetBitmapForBig(string sub, double xs, string path, int picHeight, int picWidth)
         {

+ 1 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -467,6 +467,7 @@
     <Compile Include="1-UI\OTSReportExport\ClassificationOrderAdjuster.Designer.cs">
       <DependentUpon>ClassificationOrderAdjuster.cs</DependentUpon>
     </Compile>
+    <Compile Include="1-UI\OTSReportExport\DataIntegration\ImageProcessor.cs" />
     <Compile Include="1-UI\Purity.cs">
       <SubType>Form</SubType>
     </Compile>