Browse Source

修复三元图切换粒级发生错误的bug,新增夹杂物报告导出去除知道颗粒功能可选项功能

zhangjiaxin 1 year ago
parent
commit
0b75a49e61

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

@@ -122,8 +122,12 @@
     <str_kllb_qcys>C</str_kllb_qcys>
     <str_kllb_DeleteClass>misc</str_kllb_DeleteClass>
     <list_str_kllb_DeleteClass>
+      <YS0>SiC</YS0>
     </list_str_kllb_DeleteClass>
     <list_int_kllb_number>18</list_int_kllb_number>
+    <list_str_kllb_DeleteClass_Serial>
+      <YS0>20001</YS0>
+    </list_str_kllb_DeleteClass_Serial>
   </M_KLLBXX>
   <M_address>
     <Path>./Config/ReportTemplate/ReportTemplateConfig.xml</Path>

+ 10 - 10
OTSIncAReportApp/1-UI/Control_ECharts/EChart_Trianglediagram.cs

@@ -105,7 +105,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i]);
-                    ternaryDiagram.ShapeList(1, new PointF(10, PositionJeight), 10, Color_list[i], g);
+                    ternaryDiagram.ShapeList(0, new PointF(10, PositionJeight), 10, Color_list[i], g);
                     //g.DrawRectangle(mypen, 0, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 1, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i].ToString() + str_unit, myFont2, sbrush, 22, PositionJeight - 2);
@@ -113,7 +113,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 1 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 1]);
-                    ternaryDiagram.ShapeList(2, new PointF(104, PositionJeight), 10, Color_list[i+1], g);
+                    ternaryDiagram.ShapeList(1, new PointF(104, PositionJeight), 10, Color_list[i+1], g);
                     //g.DrawRectangle(mypen, 94, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 95, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 1].ToString() + str_unit, myFont2, sbrush, 116, PositionJeight - 2);
@@ -121,7 +121,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 2 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 2]);
-                    ternaryDiagram.ShapeList(3, new PointF(194, PositionJeight), 10, Color_list[i + 2], g);
+                    ternaryDiagram.ShapeList(2, new PointF(194, PositionJeight), 10, Color_list[i + 2], g);
                     //g.DrawRectangle(mypen, 188, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 189, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 2].ToString() + str_unit, myFont2, sbrush, 206, PositionJeight - 2);
@@ -130,7 +130,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 3 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 3]);
-                    ternaryDiagram.ShapeList(4, new PointF(292, PositionJeight), 10, Color_list[i + 3], g);
+                    ternaryDiagram.ShapeList(3, new PointF(292, PositionJeight), 10, Color_list[i + 3], g);
                     //g.DrawRectangle(mypen, 282, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 283, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 3].ToString() + str_unit, myFont2, sbrush, 304, PositionJeight - 2);
@@ -138,7 +138,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 4 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 4]);
-                    ternaryDiagram.ShapeList(1, new PointF(386, PositionJeight), 10, Color_list[i + 4], g);
+                    ternaryDiagram.ShapeList(0, new PointF(386, PositionJeight), 10, Color_list[i + 4], g);
                     //g.DrawRectangle(mypen, 376, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 377, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 4].ToString() + str_unit, myFont2, sbrush, 398, PositionJeight - 2);
@@ -146,7 +146,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 5 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 5]);
-                    ternaryDiagram.ShapeList(2, new PointF(480, PositionJeight), 10, Color_list[i + 5], g);
+                    ternaryDiagram.ShapeList(1, new PointF(480, PositionJeight), 10, Color_list[i + 5], g);
                     //g.DrawRectangle(mypen, 470, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 471, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 5].ToString() + str_unit, myFont2, sbrush, 492, PositionJeight - 2);
@@ -154,7 +154,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 6 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 6]);
-                    ternaryDiagram.ShapeList(3, new PointF(574, PositionJeight), 10, Color_list[i + 6], g);
+                    ternaryDiagram.ShapeList(2, new PointF(574, PositionJeight), 10, Color_list[i + 6], g);
                     //g.DrawRectangle(mypen, 564, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 565, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 6].ToString() + str_unit, myFont2, sbrush, 586, PositionJeight - 2);
@@ -162,7 +162,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 if (i + 7 < listName.Count)
                 {
                     //SolidBrush sbrush_Color = new SolidBrush(Color_list[i + 7]);
-                    ternaryDiagram.ShapeList(4, new PointF(668, PositionJeight), 10, Color_list[i + 7], g);
+                    ternaryDiagram.ShapeList(3, new PointF(668, PositionJeight), 10, Color_list[i + 7], g);
                     //g.DrawRectangle(mypen, 658, PositionJeight, 8, 8);
                     //g.FillRectangle(sbrush_Color, 659, PositionJeight + 1, 7, 7);
                     g.DrawString(listName[i + 7].ToString() + str_unit, myFont2, sbrush, 680, PositionJeight - 2);
@@ -376,7 +376,7 @@ namespace OTSIncAReportApp.Control_ECharts
             for (int i = 0; i < dt_point_sort.Rows.Count; i++)
             {
                 int pos = Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"]);
-                if (pos > 4)
+                if (pos > 3)
                 {
                     order = pos % 4;
                 }
@@ -385,7 +385,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     order = pos;
                 }
                 PointF pointF = new PointF(Convert.ToInt32(dt_point_sort.Rows[i]["X"])+10, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]));
-                ternaryDiagram.ShapeList(order, pointF, 10, Color_list[pos-1], g);
+                ternaryDiagram.ShapeList(order, pointF, 10, Color_list[Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"])], g);
                 //SolidBrush mysbrush = new SolidBrush(Color_list[Convert.ToInt32(dt_point_sort.Rows[i]["Color_position"])]);
                 //g.FillRectangle(mysbrush, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 8, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 4, 5);
                 //g.DrawRectangle(mypen, Convert.ToInt32(dt_point_sort.Rows[i]["X"]) + 7, 500 - Convert.ToInt32(dt_point_sort.Rows[i]["Y"]) - 2, 5, 5);

+ 13 - 3
OTSIncAReportApp/1-UI/OTSReportExport/Category.cs

@@ -22,20 +22,27 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
         /// </summary>
         public bool IsModify = false;
         public List<string> vs = new List<string>();
+        private bool isRemove = false;
         Hashtable table;
      
-        public Category(List<string> a_ElementList,DataTable AllList)
+        public Category(List<string> a_ElementList,DataTable AllList,bool a_Remove)
         {
             InitializeComponent();
             ElementList = AllList;
             CheckTheOptions = a_ElementList;
             OutElementList = a_ElementList;
+            isRemove = a_Remove;
             #region 国际化语言
             OTSCommon.Language lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
             #endregion
         }
-
+        //public Category(List<string> a_ElementList,DataTable AllList, bool a_Remove)
+        //{
+        //    ElementList = AllList;
+        //    isRemove = a_Remove;
+        //    InitializeComponent();
+        //}
         private void Category_Load(object sender, EventArgs e)
         {
             if (ElementList != null)
@@ -57,7 +64,10 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
                         box1.Width = flowLayoutPanel.Width - 30;
                         if (CheckTheOptions.Count == 0)
                         {
-                            box1.Checked = true;
+                            if (!isRemove)
+                                box1.Checked = true;
+                            else
+                                box1.Checked = false;
                         }
                         else
                         {

+ 2 - 2
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/BasicData.cs

@@ -140,11 +140,11 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
 
             //去除物质分类(非夹杂物分类)
-            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
             {
                 for (int i = m_bt_DBData.Rows.Count - 1; i >= 0; i--)
                 {
-                    if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    if (m_bt_DBData.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
                     {
                         m_bt_DBData.Rows.RemoveAt(i);
                     }

+ 4 - 4
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/InclusionProportion.cs

@@ -90,11 +90,11 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             
 
             //去除物质分类(非夹杂物分类)
-            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
             {
                 for (int i = data.Rows.Count - 1; i >= 0; i--)
                 {
-                    if (data.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    if (data.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
                     {
                         data.Rows.RemoveAt(i);
                     }
@@ -350,11 +350,11 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
 
             //去除物质分类(非夹杂物分类)
-            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
             {
                 for (int i = AreaInformationOfAllElements.Rows.Count - 1; i >= 0; i--)
                 {
-                    if (AreaInformationOfAllElements.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    if (AreaInformationOfAllElements.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
                     {
                         AreaInformationOfAllElements.Rows.RemoveAt(i);
 

+ 2 - 2
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleAnalysis.cs

@@ -812,11 +812,11 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
 
             //去除物质分类(非夹杂物分类)
-            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
             {
                 for (int i = m_bt_DBData.Rows.Count - 1; i >= 0; i--)
                 {
-                    if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    if (m_bt_DBData.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
                     {
                         m_bt_DBData.Rows.RemoveAt(i);
                     }

+ 4 - 4
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleList.cs

@@ -85,11 +85,11 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 }
             }
             //去除物质分类(非夹杂物分类)
-            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
             {
                 for (int i = dt.Rows.Count - 1; i >= 0; i--)
                 {
-                    if (dt.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    if (dt.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
                     {
                         dt.Rows.RemoveAt(i);
                     }
@@ -356,11 +356,11 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 }
             }
             //去除物质分类(非夹杂物分类)
-            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; a++)
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; a++)
             {
                 for (int i = dt.Rows.Count - 1; i >= 0; i--)
                 {
-                    if (dt.Rows[i]["TypeName"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[a].ToString())
+                    if (dt.Rows[i]["TypeId"].ToString() == m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[a].ToString())
                     {
                         dt.Rows.RemoveAt(i);
                     }

+ 4 - 4
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/TernaryDiagram.cs

@@ -538,22 +538,22 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
 
         public void ShapeList(int order, PointF center, float sideLength, Color Blue, Graphics g)
         {
-            if (order ==1)
+            if (order ==0)
             {
                 //三角
                 Triangle(center, sideLength+2, Blue, g);
             }
-            else if(order==2)
+            else if(order==1)
             {
                 //矩形
                 Rectangle(center, sideLength, Blue, g);
             }
-            else if (order==3)
+            else if (order==2)
             {
                 //圆形
                 circle(center, sideLength, Blue, g);
             }
-            else if (order ==4)
+            else if (order ==3)
             {
                 //菱形
                 rhombus(center, sideLength, Blue, g);

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

@@ -15,6 +15,7 @@ using System.Linq;
 using static OTSDataType.otsdataconst;
 using OTSCommon.DBOperate;
 using OTSIncAReportApp.OTSRstMgrFunction;
+using static OTSIncAReportApp.OTSReport_Export.c_TemplateClass;
 
 namespace OTSIncAReportApp
 {
@@ -129,6 +130,7 @@ namespace OTSIncAReportApp
                 M_KLLBXX.list_str_tb_lllb_sxys = new List<string>();
                 M_KLLBXX.list_str_kllb_qcys = new List<string>();
                 M_KLLBXX.list_str_kllb_DeleteClass = new List<string>();
+                M_KLLBXX.list_str_kllb_DeleteClass_Serial = new List<string>();
                 M_DZ = new DZ();
                 list_str_MainPriority = new List<string>();
                 list_str_MainPriority_Serial = new List<string>();
@@ -496,7 +498,10 @@ namespace OTSIncAReportApp
                 /// </summary>
                 public List<string> list_str_kllb_DeleteClass { get; set; }
 
-
+                /// <summary>
+                /// 颗粒列表去除不要的物质分类
+                /// </summary>
+                public List<string> list_str_kllb_DeleteClass_Serial { get; set; }
                 /// <summary>
                 /// 显示颗粒数量
                 /// </summary>
@@ -1087,6 +1092,20 @@ namespace OTSIncAReportApp
                     m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(str);
                 }
             }
+
+            m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Clear();
+            for (int i = 0; i < 100; i++)                              //取得所有元素列表
+            {
+                string str = xmlutil.Read("M_KLLBXX", "list_str_kllb_DeleteClass_Serial", "YS" + i.ToString());
+                if (str == null)
+                {
+                    break;
+                }
+                else
+                {
+                    m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Add(str);
+                }
+            }
             //夹杂物占比
             m_mbszclass.M_JZWZB.b_ck_surface = Convert.ToBoolean(xmlutil.Read("M_JZWZB", "b_ck_surface"));//夹杂物占比表
             m_mbszclass.M_JZWZB.b_ck_chart = Convert.ToBoolean(xmlutil.Read("M_JZWZB", "b_ck_chart"));//夹杂物占比图

+ 2 - 2
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_CleannessA.cs

@@ -765,9 +765,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 }
             }
 
-            
+
             //Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
-            Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial, ReadClassification(comboBox1.SelectedIndex));
+            Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial, ReadClassification(comboBox1.SelectedIndex),false);
             category.ShowDialog();
             List<string> ls = category.OutElementList;
             TCCleannessAList = category.vs;

+ 17 - 4
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_INCA.Designer.cs

@@ -84,6 +84,7 @@
             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.button3 = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.numericMin)).BeginInit();
@@ -605,9 +606,9 @@
             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, 106);
+            this.groupBox3.Location = new System.Drawing.Point(282, 117);
             this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Size = new System.Drawing.Size(703, 447);
+            this.groupBox3.Size = new System.Drawing.Size(703, 434);
             this.groupBox3.TabIndex = 78;
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "模块设定";
@@ -686,11 +687,12 @@
             // 
             // groupBox2
             // 
+            this.groupBox2.Controls.Add(this.button3);
             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.Size = new System.Drawing.Size(703, 98);
             this.groupBox2.TabIndex = 81;
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "排除分类";
@@ -706,12 +708,22 @@
             // 
             // delete_Class
             // 
-            this.delete_Class.Location = new System.Drawing.Point(6, 32);
+            this.delete_Class.Location = new System.Drawing.Point(6, 40);
             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;
             // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(111, 12);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(44, 23);
+            this.button3.TabIndex = 64;
+            this.button3.Text = "...";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
             // OTSReport_Template_INCA
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -813,5 +825,6 @@
         private System.Windows.Forms.GroupBox groupBox2;
         private System.Windows.Forms.Label label_delete_Class;
         private System.Windows.Forms.TextBox delete_Class;
+        private System.Windows.Forms.Button button3;
     }
 }

+ 88 - 25
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_INCA.cs

@@ -1,6 +1,8 @@
 
+using NPOI.Util;
 using OTSIncAReportApp._1_UI.OTSReportExport;
 using OTSIncAReportApp._1_UI.OTSTemplateDesigner;
+using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
 using OTSPeriodicTable;
@@ -11,6 +13,7 @@ using System.Collections.Generic;
 using System.Data;
 using System.Drawing;
 using System.IO;
+using System.Net.Mail;
 using System.Windows.Forms;
 
 namespace OTSIncAReportApp.OTSTemplateDesigner
@@ -24,6 +27,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         Hashtable table;
         //private string CurrentDatabase = "";
         //private bool SwitchCategories = false;
+        ParticleData fielddata;
+
+        private List<string> DeleteClass_Serial = new List<string>();
         #endregion
         #region 构造函数及窗体加载
 
@@ -44,28 +50,9 @@ 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;
-
-            //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;
+          
 
+            fielddata = new ParticleData(m_OTSReport_Export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_OTSReport_Export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
 
         }
 
@@ -351,6 +338,25 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                         break;
                     }
                 }
+
+                for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; i++)                              //去除元素列表
+                {
+                    xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial[i].ToString(), "M_KLLBXX", "list_str_kllb_DeleteClass_Serial", "YS" + i.ToString());
+                }
+                //然后判断一下xml中是否还存在之前比现有长度长的节点存在,存在则删除,防止后面再进行读取
+                for (int i = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial.Count; i < 1000; i++)
+                {
+                    string strxh = i.ToString();
+                    if (null != xmlutil.Read("M_KLLBXX", "list_str_kllb_DeleteClass_Serial", "YS" + strxh))
+                    {
+                        //删除该节点
+                        xmlutil.RemoveNode("M_KLLBXX", "list_str_kllb_DeleteClass_Serial", "YS" + strxh);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
                 //夹杂物占比
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_surface.ToString(), "M_JZWZB", "b_ck_surface");//夹杂物占比表
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_chart.ToString(), "M_JZWZB", "b_ck_chart");//夹杂物占比图
@@ -387,6 +393,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 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_Serial.Clear();
+            m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial = DeleteClass_Serial.Copy();
+
             //主要优先显示
             //m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Clear();
             //string[] MainPriority = textBox_zypxss.Text.Split(new char[] { ',' });
@@ -395,7 +404,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //    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;
             //首页
             m_OTSReport_Export.m_mbszclass.M_SY.str_tb_ZBT = tb_ZBT.Text;
@@ -450,7 +459,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.M_KLLBXX.str_kllb_DeleteClass = delete_Class.Text;//去除不要的物质分类
             //m_OTSReport_Export.m_mbszclass.str_MainPriority = textBox_zypxss.Text;//主要排序
    
         
@@ -502,7 +511,20 @@ 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;
+            string str = "";
+            for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Count; i++)
+            {
+                if (str == "")
+                {
+                    str = str + m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[i];
+                }
+                else
+                {
+                    str = str + "," + m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass[i];
+                }
+            }
+
+            delete_Class.Text = str;
             //textBox_zypxss.Text = m_OTSReport_Export.m_mbszclass.str_MainPriority;
           
             //夹杂物占比
@@ -854,6 +876,47 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             tb_ysfx_xsys.Text = str;
         }
 
- 
+        private void button3_Click(object sender, EventArgs e)
+        {
+            DataTable fieldData = fielddata.GetAreaByAllIncA("");
+
+            DataTable data = new DataTable();
+            data.Columns.Add("STDId");
+            data.Columns.Add("StrName");
+            for (int i=0;i< fieldData.Rows.Count;i++)
+            {
+                if(Convert.ToInt32(fieldData.Rows[i]["TypeId"])>10)
+                {
+                    DataRow dr = data.NewRow();
+                    dr["STDId"] = fieldData.Rows[i]["TypeId"];
+                    dr["StrName"] = fieldData.Rows[i]["TypeName"];
+                    data.Rows.Add(dr);
+                }
+            }
+            Category category = new Category(m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass_Serial, data, true);
+            category.ShowDialog();
+            if(category.IsModify)
+            {
+                List<string> ls = category.OutElementList;
+                DeleteClass_Serial = category.vs;
+                var MainPriority = category.OutElementList;
+                m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass = category.OutElementList;
+                string str = "";
+                for (int i = 0; i < MainPriority.Count; i++)
+                {
+                    if (str == "")
+                    {
+                        str = str + MainPriority[i];
+                    }
+                    else
+                    {
+                        str = str + "," + MainPriority[i];
+                    }
+                }
+
+                delete_Class.Text = str;
+            }
+      
+        }
     }
 }

+ 12 - 3
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -931,14 +931,16 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 //取值字段
                 pieSeriesClass.ValueDataMembers.AddRange(new string[] { "quantity" });
                 (pieSeriesClass.Label as PieSeriesLabel).Position = PieSeriesLabelPosition.Inside;
-                //显示百分比
-                //pieSeriesClass.PointOptions.PointView = PointView.ArgumentAndValues;
-                //pieSeriesClass.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
+                
                 //设置数据源
                 pieSeriesClass.DataSource = chartmax;
                 pieSeriesClass.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
+
+                pieSeriesClass.Label.TextPattern = "{A}";
                 // 饼图空间添加 新建的饼图对象
                 xrChart_ParticelSizeCalss.Series.Add(pieSeriesClass);
+
+                
                 //右上角分组视图
                 this.xrChart_ParticelSizeCalss.Legend.MarkerSize = new System.Drawing.Size(20, 20);
                 this.xrChart_ParticelSizeCalss.Legend.TextOffset = 5;
@@ -984,6 +986,9 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 pieSeries.DataSource = dt_subdivde_dt;
                 pieSeries.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
                 // 饼图空间添加 新建的饼图对象
+
+
+                pieSeries.Label.TextPattern = "{A}";
                 xrChart_ParticelSizeSubdivision.Series.Add(pieSeries);
                 //右上角分组视图
                 this.xrChart_ParticelSizeSubdivision.Legend.MarkerSize = new System.Drawing.Size(20, 20);
@@ -1433,6 +1438,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             //设置数据源
             pieSeriesClass.DataSource = dt_data;
             pieSeriesClass.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
+
+            pieSeriesClass.Label.TextPattern = "{A}";
             // 饼图空间添加 新建的饼图对象
             xrChart_incaClass.Series.Add(pieSeriesClass);
             //右上角分组视图
@@ -1493,6 +1500,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             //设置数据源
             pieSeriesClass.DataSource = dt_data;
             pieSeriesClass.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
+
+            pieSeriesClass.Label.TextPattern = "{A}";
             // 饼图空间添加 新建的饼图对象
             xrChart_incaSubdivision.Series.Add(pieSeriesClass);
             //右上角分组视图