|
@@ -1,4 +1,5 @@
|
|
|
|
|
|
+using OTSCommon.DBOperate;
|
|
|
using OTSIncAReportApp.DataOperation.DataAccess;
|
|
|
using OTSIncAReportApp.OTSSampleReportInfo;
|
|
|
using System;
|
|
@@ -44,25 +45,50 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
|
|
|
|
|
|
//按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
|
|
|
List<string> ClassName = new List<string>();
|
|
|
- DataTable getClass_dt = basicData.GetAllClass();
|
|
|
- bool bl = false;
|
|
|
+ //DataTable getClass_dt = basicData.GetAllClass();
|
|
|
+ DataTable getClass_dt = ReadClassification(basicData);
|
|
|
for (int i = 0; i < getClass_dt.Rows.Count; i++)
|
|
|
{
|
|
|
- if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid"
|
|
|
- && getClass_dt.Rows[i]["GroupName"].ToString() != "Not Identified")
|
|
|
- if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
|
|
|
- {
|
|
|
- if (!bl)
|
|
|
- {
|
|
|
- ClassName.Add("Default");
|
|
|
- bl = true;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
|
|
|
- }
|
|
|
- }
|
|
|
+ ClassName.Add(getClass_dt.Rows[i][1].ToString());
|
|
|
+
|
|
|
+ }
|
|
|
+ //bool bl = false;
|
|
|
+ // for (int i = 0; i < getClass_dt.Rows.Count; i++)
|
|
|
+ // {
|
|
|
+ // if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid"
|
|
|
+ // && getClass_dt.Rows[i]["GroupName"].ToString() != "Not Identified")
|
|
|
+ // if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
|
|
|
+ // {
|
|
|
+ // if (!bl)
|
|
|
+ // {
|
|
|
+ // ClassName.Add("Default");
|
|
|
+ // bl = true;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // bool isDefault = false;
|
|
|
+
|
|
|
+ // for (int a = 0; a < ClassName.Count; a++)
|
|
|
+ // {
|
|
|
+ // if (getClass_dt.Rows[i]["GroupName"].ToString() == "Default")
|
|
|
+ // {
|
|
|
+ // isDefault = true;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (isDefault)
|
|
|
+ // {
|
|
|
+ // if (getClass_dt.Rows[i]["GroupName"].ToString() != "Default")
|
|
|
+ // {
|
|
|
+ // ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
//统计元素物质大类的元素信息和面积占比
|
|
|
DataTable dt_ElementalSubstance = ElementalSubstance(AllAnalysisDetails, ClassName, basicData.getParticleData());
|
|
@@ -94,7 +120,15 @@ DataTable dtname = new DataTable();
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
- private bool SubdivisionOfMaterialElements(DataTable a_ElementalSubstance, int NumberOfColumns, List<string> ClassName, DataTable data, out DataTable dt1, out DataTable dt2)
|
|
|
+
|
|
|
+ private DataTable ReadClassification(BasicData basicData)
|
|
|
+ {
|
|
|
+ DataTable dt_stl = new DataTable();
|
|
|
+ SqLiteHelper sh = new SqLiteHelper("data source='" + basicData.GetFilePath() + "\\" + basicData.GetResfile() + "'");
|
|
|
+ dt_stl = sh.ExecuteQuery("select * from STDGroups");
|
|
|
+ return dt_stl;
|
|
|
+ }
|
|
|
+ private bool SubdivisionOfMaterialElements(DataTable a_ElementalSubstance, int NumberOfColumns, List<string> ClassName, DataTable data, out DataTable dt1, out DataTable dt2)
|
|
|
{
|
|
|
|
|
|
DataTable dt_ElementalSubstance = new DataTable();
|
|
@@ -398,10 +432,23 @@ DataTable dtname = new DataTable();
|
|
|
dt.Rows.Add(AllAnalysisDetails.Rows[a].ItemArray);
|
|
|
}
|
|
|
}
|
|
|
- if (dt.Rows.Count == 0)
|
|
|
- continue;
|
|
|
- //计算出当前循环中大类物质的面积
|
|
|
- ElementalSubstance = Convert.ToDouble(decimal.Parse(dt.Compute("sum(Area)", "").ToString()));
|
|
|
+ //if (dt.Rows.Count == 0)
|
|
|
+ // continue;
|
|
|
+ if (dt.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ DataRow dataRow = dt.NewRow();
|
|
|
+ dataRow["Area"] = 0;
|
|
|
+ dt.Rows.Add(dataRow);
|
|
|
+
|
|
|
+ DataRow dataRow2 = dt_Class.NewRow();
|
|
|
+ dataRow2["Name"]= ClassName[i].ToString();
|
|
|
+ double ar0 = 0;
|
|
|
+ dataRow2["Area"] = ar0;
|
|
|
+ dt_Class.Rows.Add(dataRow2);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //计算出当前循环中大类物质的面积
|
|
|
+ ElementalSubstance = Convert.ToDouble(decimal.Parse(dt.Compute("sum(Area)", "").ToString()));
|
|
|
|
|
|
DataTable ta = new DataTable();
|
|
|
ta = dt_Class.Copy();
|