Browse Source

报告更新新增,不显示颗粒选项,更改报告文件路径

zhangjiaxin 2 years ago
parent
commit
27027d7956

+ 2 - 2
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -946,7 +946,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
             //根据sql条件,查询获取颗粒信息数据
             ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
-            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel), "TypeName");
+            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel, m_mbszclass.M_KLLBXX.list_str_kllb_qcys), "TypeName");
             ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
             string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
             if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() == "Hardness")
@@ -1161,7 +1161,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
             //根据sql条件,查询获取颗粒信息数据
             ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
-            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel), "TypeName");
+            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel, m_mbszclass.M_KLLBXX.list_str_kllb_qcys), "TypeName");
             ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
             string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
             if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() == "Hardness")

+ 26 - 2
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -38,7 +38,7 @@ namespace OTSIncAReportApp
         public string m_export_type = "Excel";                          //导出文件的格式类型Excel,Word,Pdf
 
         Export_ReportTemplate m_export_reporttemplate;
-        public string strPath = "./Config/ProData/ReportTemplateConfig.xml"; //报告模板设置文件的路径
+        public string strPath = "./ReportTemplateExe/ReportTemplate/ReportTemplateConfig.xml"; //报告模板设置文件的路径
        
         public string strPath2;
         public XmlConfigUtil xmlutil;
@@ -134,6 +134,7 @@ namespace OTSIncAReportApp
                 M_KLLBXX = new KLLBXX();
                 M_JZWZB = new JZWZB();
                 M_KLLBXX.list_str_tb_lllb_sxys = new List<string>();
+                M_KLLBXX.list_str_kllb_qcys = new List<string>();
                 M_DZ = new DZ();
             }
             #endregion
@@ -511,7 +512,7 @@ namespace OTSIncAReportApp
                 public bool b_ck_kllb_npxx { get; set; }
 
 
-
+                
                 
                 /// <summary>
                 /// 颗粒列表 颗粒排序表行中第一个可选字段 文本
@@ -558,6 +559,14 @@ namespace OTSIncAReportApp
                 /// 颗粒列表 颗粒帧图表行中第二个可选字段 索引
                 /// </summary>
                 public int index_cb_kllb_chartSort_p2 { get; set; }
+                /// <summary>
+                /// 颗粒列表去除不要的颗粒
+                /// </summary>
+                public string str_kllb_qcys { get; set; }
+                /// <summary>
+                /// 颗粒列表去除不要的颗粒
+                /// </summary>
+                public List<string> list_str_kllb_qcys { get; set; }
 
             }
             #endregion
@@ -762,6 +771,21 @@ namespace OTSIncAReportApp
             //m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p3 = Convert.ToString(xmlutil2.Read("M_KLLBXX", "str_cb_kllb_chartSort_p3"));//帧图表列中第三个可选参数
             //m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p3 = Convert.ToInt32(xmlutil2.Read("M_KLLBXX", "index_cb_kllb_chartSort_p3"));
 
+            m_mbszclass.M_KLLBXX.str_kllb_qcys = Convert.ToString(xmlutil2.Read("M_KLLBXX", "str_kllb_qcys"));
+            m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Clear();
+            for (int i = 0; i < 100; i++)                              //取得所有元素列表
+            {
+                string str = xmlutil2.Read("M_KLLBXX", "list_str_kllb_qcys", "YS" + i.ToString());
+                if (str == null)
+                {
+                    break;
+                }
+                else
+                {
+                    m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Add(str);
+                }
+            }
+
             //夹杂物占比
             m_mbszclass.M_JZWZB.b_ck_surface = Convert.ToBoolean(xmlutil2.Read("M_JZWZB", "b_ck_surface"));//夹杂物占比表
             m_mbszclass.M_JZWZB.b_ck_chart= Convert.ToBoolean(xmlutil2.Read("M_JZWZB", "b_ck_chart"));//夹杂物占比图

+ 37 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.Designer.cs

@@ -118,6 +118,9 @@
             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.groupBox1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox6.SuspendLayout();
@@ -631,6 +634,9 @@
             // 
             // groupBox8
             // 
+            this.groupBox8.Controls.Add(this.label11111);
+            this.groupBox8.Controls.Add(this.button5);
+            this.groupBox8.Controls.Add(this.tb_RemoveElements);
             this.groupBox8.Controls.Add(this.ck_kllb_fjzt);
             this.groupBox8.Controls.Add(this.label111);
             this.groupBox8.Controls.Add(this.groupBox_zt);
@@ -1100,6 +1106,34 @@
             this.cb_ParticleRange.Size = new System.Drawing.Size(121, 20);
             this.cb_ParticleRange.TabIndex = 76;
             // 
+            // 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;
+            // 
+            // 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);
+            // 
+            // 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 = "去除元素信息";
+            // 
             // OTSReport_TemplateDesignerRM
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1245,5 +1279,8 @@
         private System.Windows.Forms.Label label1311;
         private System.Windows.Forms.Label label1211;
         private System.Windows.Forms.CheckBox ck_jzwzb_surface;
+        private System.Windows.Forms.Button button5;
+        private System.Windows.Forms.TextBox tb_RemoveElements;
+        private System.Windows.Forms.Label label11111;
     }
 }

+ 33 - 3
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -569,8 +569,30 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p1.ToString(), "M_KLLBXX", "index_cb_kllb_chartSort_p1");//帧图表列第一个可选参数(index)
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p2.ToString(), "M_KLLBXX", "str_cb_kllb_chartSort_p2");//帧图表列第二个可选参数(string)
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p2.ToString(), "M_KLLBXX", "index_cb_kllb_chartSort_p2");//帧图表列第二个可选参数(index)
-                //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p3.ToString(), "M_KLLBXX", "str_cb_kllb_chartSort_p3");//帧图表列第三个可选参数(string)
-                //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p3.ToString(), "M_KLLBXX", "index_cb_kllb_chartSort_p3");//帧图表列第三个可选参数(index)
+                                                                                                                                                       //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p3.ToString(), "M_KLLBXX", "str_cb_kllb_chartSort_p3");//帧图表列第三个可选参数(string)
+                                                                                                                                                       //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p3.ToString(), "M_KLLBXX", "index_cb_kllb_chartSort_p3");//帧图表列第三个可选参数(index)
+
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys.ToString(), "M_KLLBXX", "str_kllb_qcys");
+                
+                for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Count; i++)                              //去除元素列表
+                {
+                    xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_qcys[i].ToString(), "M_KLLBXX", "list_str_kllb_qcys", "YS" + i.ToString());
+                }
+
+                //然后判断一下xml中是否还存在之前比现有长度长的节点存在,存在则删除,防止后面再进行读取
+                for (int i = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_qcys.Count; i < 1000; i++)
+                {
+                    string strxh = i.ToString();
+                    if (null != xmlutil.Read("M_KLLBXX", "list_str_kllb_qcys", "YS" + strxh))
+                    {
+                        //删除该节点
+                        xmlutil.RemoveNode("M_KLLBXX", "list_str_kllb_qcys", "YS" + strxh);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
 
 
                 //夹杂物占比
@@ -648,7 +670,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_chartSort_p1 = cb_FrameChart_p1.SelectedIndex;
             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;
 
             if (ck_kllb_xsmk.Checked)
             {
@@ -734,6 +757,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             ck_kllb_xsmk.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_xsmk;
             ck_kllb_fjzt.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_fjzt;
 
+            tb_RemoveElements.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_qcys;
+
             ck_kllb_ystx.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_ystx;//原始图像
             ck_kllb_fdtx.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_fdtx;//放大图像
             ck_kllb_npxx.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_npxx;//能谱图像
@@ -943,5 +968,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 ck_jzwzb_chart.Checked = false;
             }
         }
+
+        private void button5_Click(object sender, EventArgs e)
+        {
+            SetPeriodicTableControl(tb_RemoveElements, m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_kllb_qcys);
+        }
     }
 }

+ 19 - 5
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -476,7 +476,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
-        public DataTable GetIncaSurfaceData(DataTable dt,int sel)
+        public DataTable GetIncaSurfaceData(DataTable dt,int sel,List<string> lst_str)
         {
             DataTable particlesAll = new DataTable();
             if (sel==0)
@@ -493,14 +493,28 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             //DataTable elementchemistry = GetElementChemistry();
 
             DataTable dt_element = GetElementChemistry();
-            DataTable elementchemistry = dt_element.Clone();
-            for (int i = 0; i < dt_element.Rows.Count; i++)
+            DataTable elementchemistry = dt_element.Copy();
+
+            //for (int i = 0; i < dt_element.Rows.Count; i++)
+            //{
+            //    if (dt_element.Rows[i]["Name"].ToString() != "Fe")
+            //    {
+            //        elementchemistry.Rows.Add(dt_element.Rows[i].ItemArray);
+            //    }
+            //}
+
+            for (int a=0;a<lst_str.Count;a++)
             {
-                if (dt_element.Rows[i]["Name"].ToString() != "Fe")
+                for (int i = 0; i < dt_element.Rows.Count; i++)
                 {
-                    elementchemistry.Rows.Add(dt_element.Rows[i].ItemArray);
+                    if (elementchemistry.Rows[i]["Name"].ToString() == lst_str[a].ToString())
+                    {
+                        elementchemistry.Rows[i].Delete();
+                    }
                 }
             }
+            elementchemistry.AcceptChanges();
+
             for (int i = 0; i < particlesAll.Rows.Count; i++)
             {
                 string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();