ソースを参照

报告程序,报告导出除物质分类

zhangjiaxin 2 年 前
コミット
591f1c3cf6

+ 42 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -973,6 +973,27 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             }
 
+            //去除物质分类(非夹杂物分类)
+
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.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())
+                    {
+                        dt.Rows.RemoveAt(i);
+                    
+                    }
+                }
+            }
+
+
+
+
+
+
+
+
             //将颗粒大小排序(从大到小)
             DataView dv = dt.DefaultView;
             dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
@@ -1213,6 +1234,27 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     }
                 }
             }
+
+
+
+            //去除物质分类(非夹杂物分类)
+
+            for (int a = 0; a < m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.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())
+                    {
+                        dt.Rows.RemoveAt(i);
+
+                    }
+                }
+            }
+
+
+
+
+
             //将颗粒大小排序(从大到小)
             DataView dv = dt.DefaultView;
             dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";

+ 24 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -135,6 +135,7 @@ namespace OTSIncAReportApp
                 M_JZWZB = new JZWZB();
                 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_DZ = new DZ();
             }
             #endregion
@@ -568,6 +569,14 @@ namespace OTSIncAReportApp
                 /// </summary>
                 public List<string> list_str_kllb_qcys { get; set; }
 
+                /// <summary>
+                /// 颗粒列表去除不要的物质分类
+                /// </summary>
+                public string str_kllb_DeleteClass { get; set; }
+                /// <summary>
+                /// 颗粒列表去除不要的物质分类
+                /// </summary>
+                public List<string> list_str_kllb_DeleteClass { get; set; }
             }
             #endregion
             #region 夹杂物占比
@@ -785,6 +794,21 @@ namespace OTSIncAReportApp
                     m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Add(str);
                 }
             }
+            m_mbszclass.M_KLLBXX.str_kllb_DeleteClass = Convert.ToString(xmlutil2.Read("M_KLLBXX", "str_kllb_DeleteClass"));
+            m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Clear();
+            for (int i = 0; i < 100; i++)                              //取得所有元素列表
+            {
+                string str = xmlutil2.Read("M_KLLBXX", "list_str_kllb_DeleteClass", "YS" + i.ToString());
+                if (str == null)
+                {
+                    break;
+                }
+                else
+                {
+                    m_mbszclass.M_KLLBXX.list_str_kllb_DeleteClass.Add(str);
+                }
+            }
+
 
             //夹杂物占比
             m_mbszclass.M_JZWZB.b_ck_surface = Convert.ToBoolean(xmlutil2.Read("M_JZWZB", "b_ck_surface"));//夹杂物占比表

+ 52 - 30
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.Designer.cs

@@ -76,6 +76,9 @@
             this.label33 = new System.Windows.Forms.Label();
             this.label42 = new System.Windows.Forms.Label();
             this.groupBox8 = new System.Windows.Forms.GroupBox();
+            this.label11111 = new System.Windows.Forms.Label();
+            this.button5 = new System.Windows.Forms.Button();
+            this.tb_RemoveElements = new System.Windows.Forms.TextBox();
             this.ck_kllb_fjzt = new System.Windows.Forms.CheckBox();
             this.label111 = new System.Windows.Forms.Label();
             this.groupBox_zt = new System.Windows.Forms.GroupBox();
@@ -118,9 +121,8 @@
             this.groupBox9 = new System.Windows.Forms.GroupBox();
             this.label39 = new System.Windows.Forms.Label();
             this.cb_ParticleRange = new System.Windows.Forms.ComboBox();
-            this.tb_RemoveElements = new System.Windows.Forms.TextBox();
-            this.button5 = new System.Windows.Forms.Button();
-            this.label11111 = new System.Windows.Forms.Label();
+            this.delete_Class = new System.Windows.Forms.TextBox();
+            this.label_delete_Class = new System.Windows.Forms.Label();
             this.groupBox1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox6.SuspendLayout();
@@ -634,6 +636,8 @@
             // 
             // groupBox8
             // 
+            this.groupBox8.Controls.Add(this.label_delete_Class);
+            this.groupBox8.Controls.Add(this.delete_Class);
             this.groupBox8.Controls.Add(this.label11111);
             this.groupBox8.Controls.Add(this.button5);
             this.groupBox8.Controls.Add(this.tb_RemoveElements);
@@ -653,11 +657,39 @@
             this.groupBox8.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox8.Name = "groupBox8";
             this.groupBox8.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox8.Size = new System.Drawing.Size(263, 464);
+            this.groupBox8.Size = new System.Drawing.Size(263, 501);
             this.groupBox8.TabIndex = 6;
             this.groupBox8.TabStop = false;
             this.groupBox8.Text = "颗粒列表";
             // 
+            // label11111
+            // 
+            this.label11111.AutoSize = true;
+            this.label11111.Location = new System.Drawing.Point(14, 382);
+            this.label11111.Name = "label11111";
+            this.label11111.Size = new System.Drawing.Size(77, 12);
+            this.label11111.TabIndex = 61;
+            this.label11111.Text = "去除元素信息";
+            // 
+            // button5
+            // 
+            this.button5.Location = new System.Drawing.Point(202, 403);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(55, 23);
+            this.button5.TabIndex = 60;
+            this.button5.Text = "选取";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
+            // tb_RemoveElements
+            // 
+            this.tb_RemoveElements.Location = new System.Drawing.Point(11, 405);
+            this.tb_RemoveElements.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_RemoveElements.Name = "tb_RemoveElements";
+            this.tb_RemoveElements.ReadOnly = true;
+            this.tb_RemoveElements.Size = new System.Drawing.Size(181, 21);
+            this.tb_RemoveElements.TabIndex = 59;
+            // 
             // ck_kllb_fjzt
             // 
             this.ck_kllb_fjzt.AutoSize = true;
@@ -1002,7 +1034,7 @@
             this.groupBox211.Controls.Add(this.label1311);
             this.groupBox211.Controls.Add(this.label1211);
             this.groupBox211.Controls.Add(this.ck_jzwzb_surface);
-            this.groupBox211.Location = new System.Drawing.Point(3, 1706);
+            this.groupBox211.Location = new System.Drawing.Point(3, 1749);
             this.groupBox211.Name = "groupBox211";
             this.groupBox211.Size = new System.Drawing.Size(263, 81);
             this.groupBox211.TabIndex = 8;
@@ -1049,7 +1081,7 @@
             // groupBZ
             // 
             this.groupBZ.Controls.Add(this.textBox_strBZ);
-            this.groupBZ.Location = new System.Drawing.Point(5, 1793);
+            this.groupBZ.Location = new System.Drawing.Point(5, 1838);
             this.groupBZ.Name = "groupBZ";
             this.groupBZ.Size = new System.Drawing.Size(263, 139);
             this.groupBZ.TabIndex = 7;
@@ -1106,33 +1138,21 @@
             this.cb_ParticleRange.Size = new System.Drawing.Size(121, 20);
             this.cb_ParticleRange.TabIndex = 76;
             // 
-            // tb_RemoveElements
+            // delete_Class
             // 
-            this.tb_RemoveElements.Location = new System.Drawing.Point(11, 405);
-            this.tb_RemoveElements.Margin = new System.Windows.Forms.Padding(2);
-            this.tb_RemoveElements.Name = "tb_RemoveElements";
-            this.tb_RemoveElements.ReadOnly = true;
-            this.tb_RemoveElements.Size = new System.Drawing.Size(181, 21);
-            this.tb_RemoveElements.TabIndex = 59;
+            this.delete_Class.Location = new System.Drawing.Point(11, 464);
+            this.delete_Class.Name = "delete_Class";
+            this.delete_Class.Size = new System.Drawing.Size(181, 21);
+            this.delete_Class.TabIndex = 62;
             // 
-            // button5
+            // label_delete_Class
             // 
-            this.button5.Location = new System.Drawing.Point(202, 403);
-            this.button5.Name = "button5";
-            this.button5.Size = new System.Drawing.Size(55, 23);
-            this.button5.TabIndex = 60;
-            this.button5.Text = "选取";
-            this.button5.UseVisualStyleBackColor = true;
-            this.button5.Click += new System.EventHandler(this.button5_Click);
-            // 
-            // label11111
-            // 
-            this.label11111.AutoSize = true;
-            this.label11111.Location = new System.Drawing.Point(14, 382);
-            this.label11111.Name = "label11111";
-            this.label11111.Size = new System.Drawing.Size(77, 12);
-            this.label11111.TabIndex = 61;
-            this.label11111.Text = "去除元素信息";
+            this.label_delete_Class.AutoSize = true;
+            this.label_delete_Class.Location = new System.Drawing.Point(12, 440);
+            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 = "去除指定物质分类";
             // 
             // OTSReport_TemplateDesignerRM
             // 
@@ -1282,5 +1302,7 @@
         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;
     }
 }

+ 38 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -595,6 +595,29 @@ 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_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");//夹杂物占比图
@@ -671,7 +694,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p2 = cb_FrameChart_p2.Text;//颗粒帧图表行第二个字段的可选参数
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p2 = cb_FrameChart_p2.SelectedIndex;
 
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys = tb_RemoveElements.Text;
+            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;//去除不要的物质分类
 
             if (ck_kllb_xsmk.Checked)
             {
@@ -682,6 +707,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx = Convert.ToInt32("1");
             }
 
+
             //m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys = tb_kllb_sxys.Text;//显示元素
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_ystx = ck_kllb_ystx.Checked;//原始图像
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_fdtx = ck_kllb_fdtx.Checked;//放大图像
@@ -771,6 +797,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             cb_FrameChart_p2.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p2;
             //cb_FrameChart_p3.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p3;
 
+            delete_Class.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass;
+
             //夹杂物占比
             ck_jzwzb_surface.Checked = m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_surface;//夹杂物占比表
             ck_jzwzb_chart.Checked = m_OTSReport_Export.m_mbszclass.M_JZWZB.b_ck_chart;//夹杂物占比图
@@ -890,6 +918,15 @@ 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]);
+            }
+            
+
 
             SaveTemplateParameters();
 

+ 4 - 1
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.cs

@@ -652,7 +652,10 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             //     Export_ReportTemplate export_ReportTemplate = new Export_ReportTemplate(m_otsreport_export);
             DataTable dataTable = export_ReportTemplate.Get_dev_kllb_data(TemplateClass);
 
-            for (int i=0;i<dataTable.Rows.Count;i++)
+           
+
+
+            for (int i = 0; i < dataTable.Rows.Count; i++)
             {
                 dataTable.Rows[i]["Class"] = subscript.Getsubscriptstring(dataTable.Rows[i]["Class"].ToString());
             }