Преглед на файлове

出去报告中无效颗粒和未识别颗粒

zhangjiaxin преди 3 години
родител
ревизия
aa6186c008
променени са 2 файла, в които са добавени 51 реда и са изтрити 43 реда
  1. 43 19
      OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs
  2. 8 24
      OTSIncAReportApp/OTSIncAReportApp.csproj

+ 43 - 19
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -138,9 +138,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 m_bt_DBData.Columns.Add(colid[i].ToString());
             }
-            DataTable dt = fielddata.GetParticleListForParticlSize("area", "");
-            DataTable AreaInformationOfAllElements = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
-            DataTable dtp = fielddata.GetParticleAll("");
+            DataTable dt =InvalidRemoval(fielddata.GetParticleListForParticlSize("area", ""), "TypeName");
+            //DataTable dt = fielddata.GetParticleListForParticlSize("area", "");
+            DataTable AreaInformationOfAllElements = InvalidRemoval(fielddata.GetAreaByAllIncA(""), "TypeName");
+            //DataTable AreaInformationOfAllElements = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            DataTable dtp = InvalidRemoval(fielddata.GetParticleAll(""), "GroupName");
+            //DataTable dtp = fielddata.GetParticleAll("");
+            
 
             List<string> vs = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
             string po = vs[m_otsreport_export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs];
@@ -191,6 +195,22 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             return true;
         }
+        private DataTable InvalidRemoval(DataTable dt ,string str)
+        {
+            DataTable dataTable = dt.Copy();
+            dataTable.Clear();
+
+            for (int i=0;i<dt.Rows.Count;i++)
+            {
+                if (dt.Rows[i][str].ToString() != "Invalid" && dt.Rows[i][str].ToString()!= "Not Identified" && dt.Rows[i][str].ToString()!= "NOT_INCLUTION")
+                {
+                    dataTable.Rows.Add(dt.Rows[i].ItemArray);
+                }
+                
+            }
+            return dataTable;
+        }
+       
         private string getWhere(string max, string min, string col, string partic)
         {
             return col + ">=" + min + " and " + col + "<" + max + " and TypeId=" + partic;
@@ -212,7 +232,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             //根据sql条件,查询获取颗粒信息数据
             ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
-            DataTable dt = fielddata.GetIncaSurfaceData();
+            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(),"TypeName") ;
             //将颗粒大小排序(从大到小)
             DataView dv = dt.DefaultView;
             dv.Sort = "DMAX DESC";
@@ -850,16 +870,17 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 DataTable getClass_dt = fielddata.GetAllClass();
                 for (int i = 0; i < getClass_dt.Rows.Count; i++)
                 {
-                    if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION")
-                        ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
-                }
-                for (int i = 0; i < getClass_dt.Rows.Count; i++)
-                {
-                    if (getClass_dt.Rows[i]["GroupName"].ToString() == "NOT_INCLUTION")
+                    if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid")
                         ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
                 }
+                //for (int i = 0; i < getClass_dt.Rows.Count; i++)
+                //{
+                //    if (getClass_dt.Rows[i]["GroupName"].ToString() == "NOT_INCLUTION")
+                //        ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+                //}
                 //获取大分类信息
-                DataTable dt = QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName);
+                DataTable dt = InvalidRemoval(QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName), "Class");
+                //DataTable dt = QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName);
                 ClassificationSort(ls_Particel_dt,ClassName, dt);
                 m_list_dt.Add(ls_partsize_dt);
                 return true;
@@ -1151,14 +1172,14 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             DataTable getClass_dt= fielddata.GetAllClass();
             for (int i = 0; i < getClass_dt.Rows.Count; i++)
             {
-                if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION")
-                    ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
-            }
-            for (int i = 0; i < getClass_dt.Rows.Count; i++)
-            {
-                if (getClass_dt.Rows[i]["GroupName"].ToString() == "NOT_INCLUTION")
+                if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString()!= "Invalid")
                     ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
             }
+            //for (int i = 0; i < getClass_dt.Rows.Count; i++)
+            //{
+            //    if (getClass_dt.Rows[i]["GroupName"].ToString() == "NOT_INCLUTION")
+            //        ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+            //}
             //统计元素物质大类的元素信息和面积占比
             DataTable dt_ElementalSubstance=  ElementalSubstance(AllAnalysisDetails, ClassName, fielddata);
             //统计元素并按照Class Name自定义列表进行排序,大类中的小类元素信息按照面积从大到小排序
@@ -1504,7 +1525,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             //根据sql条件,查询获取颗粒信息数据
             ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
-            DataTable AreaInformationOfAllElements = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            //DataTable AreaInformationOfAllElements = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+
+            DataTable AreaInformationOfAllElements = InvalidRemoval(InvalidRemoval(fielddata.GetAreaByAllIncA(""), "GroupName"),"TypeName") ;
             DataTable AllAnalysisDetails = new DataTable();
             //AllAnalysisDetails.TableName = "ElementValue";
             AllAnalysisDetails.Columns.Add("Name");
@@ -1530,7 +1553,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             DataTable getClass_dt = fielddata.GetAllClass();
             for (int i = 0; i < getClass_dt.Rows.Count; i++)
             {
-                ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+                if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid")
+                    ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
             }
 
             DataTable AreaRatio = new DataTable();

+ 8 - 24
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -293,21 +293,15 @@
     <Compile Include="1-UI\Controls\myColorComboBox.Designer.cs">
       <DependentUpon>myColorComboBox.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
+    <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage.cs" />
     <Compile Include="1-UI\Control_Grids\ParticlesGridDevidePage.Designer.cs">
       <DependentUpon>ParticlesGridDevidePage.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\Control_ECharts\EChart_ParticlesComposition.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
+    <Compile Include="1-UI\Control_ECharts\EChart_ParticlesComposition.cs" />
     <Compile Include="1-UI\Control_ECharts\EChart_ParticlesComposition.Designer.cs">
       <DependentUpon>EChart_ParticlesComposition.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\Control_ECharts\EChart_Trianglediagram.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
+    <Compile Include="1-UI\Control_ECharts\EChart_Trianglediagram.cs" />
     <Compile Include="1-UI\Control_ECharts\EChart_Trianglediagram.Designer.cs">
       <DependentUpon>EChart_Trianglediagram.cs</DependentUpon>
     </Compile>
@@ -348,9 +342,7 @@
     <Compile Include="1-UI\Control_Grids\CompositionDistributionGrid.designer.cs">
       <DependentUpon>CompositionDistributionGrid.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\Control_Grids\ElementCompositionAvgGrid.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
+    <Compile Include="1-UI\Control_Grids\ElementCompositionAvgGrid.cs" />
     <Compile Include="1-UI\Control_Grids\ElementCompositionAvgGrid.designer.cs">
       <DependentUpon>ElementCompositionAvgGrid.cs</DependentUpon>
     </Compile>
@@ -444,9 +436,7 @@
     <Compile Include="1-UI\OTSMgrInfo\Triangulation_Edit.Designer.cs">
       <DependentUpon>Triangulation_Edit.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\frmReportApp.cs">
-      <SubType>Form</SubType>
-    </Compile>
+    <Compile Include="1-UI\frmReportApp.cs" />
     <Compile Include="1-UI\frmReportApp.Designer.cs">
       <DependentUpon>frmReportApp.cs</DependentUpon>
     </Compile>
@@ -456,15 +446,11 @@
     <Compile Include="1-UI\OTSMgrInfo\Triangulation_Item.Designer.cs">
       <DependentUpon>Triangulation_Item.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\OTSMgrInfo\Triangulation_List.cs">
-      <SubType>Form</SubType>
-    </Compile>
+    <Compile Include="1-UI\OTSMgrInfo\Triangulation_List.cs" />
     <Compile Include="1-UI\OTSMgrInfo\Triangulation_List.Designer.cs">
       <DependentUpon>Triangulation_List.cs</DependentUpon>
     </Compile>
-    <Compile Include="1-UI\Controls\OTSPeriodicTable\OTSPeriodicTableForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
+    <Compile Include="1-UI\Controls\OTSPeriodicTable\OTSPeriodicTableForm.cs" />
     <Compile Include="1-UI\Controls\OTSPeriodicTable\OTSPeriodicTableForm.Designer.cs">
       <DependentUpon>OTSPeriodicTableForm.cs</DependentUpon>
     </Compile>
@@ -501,9 +487,7 @@
     </Compile>
     <Compile Include="1-UI\OTSTemplateDesigner\Export_NPOI_Excel.cs" />
     <Compile Include="1-UI\OTSTemplateDesigner\Export_ReportTemplate.cs" />
-    <Compile Include="1-UI\OTSTemplateDesigner\OTSReport_Export.cs">
-      <SubType>Form</SubType>
-    </Compile>
+    <Compile Include="1-UI\OTSTemplateDesigner\OTSReport_Export.cs" />
     <Compile Include="1-UI\OTSTemplateDesigner\OTSReport_Export.Designer.cs">
       <DependentUpon>OTSReport_Export.cs</DependentUpon>
     </Compile>