|
@@ -22,6 +22,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
public OTSReport_Export m_otsreport_export;
|
|
public OTSReport_Export m_otsreport_export;
|
|
|
|
|
|
|
|
+ DataTable m_bt_DBData = new DataTable();
|
|
List<string> TemplateList;
|
|
List<string> TemplateList;
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
@@ -109,8 +110,76 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
-
|
|
|
|
|
|
|
|
|
|
+ #region 一次性读取数据所需要的数据
|
|
|
|
+ public bool GetDBData()
|
|
|
|
+ {
|
|
|
|
+ //DataTable bt_DBData = new DataTable();
|
|
|
|
+ ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
|
|
|
|
+ List<string> colid = new List<string>() { "TypeName", "ar", "TypeId", "Largest", "Class", "con" };
|
|
|
|
+ //获取粒级表
|
|
|
|
+ string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.FileFolderSize + m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
|
|
|
|
+ DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
|
|
|
|
+ string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
|
|
|
|
+ for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
|
|
|
|
+ {
|
|
|
|
+ if (sizestr.Split(',')[i].Length > 0)
|
|
|
|
+ {
|
|
|
|
+ double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
|
|
|
|
+ double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
|
|
|
|
+ colid.Add(d1.ToString() + "~" + d2.ToString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
|
|
|
|
+ colid.Add(d.ToString() + "~MAX");
|
|
|
|
+
|
|
|
|
+ for (int i=0;i< colid.Count;i++)
|
|
|
|
+ {
|
|
|
|
+ m_bt_DBData.Columns.Add(colid[i].ToString());
|
|
|
|
+ }
|
|
|
|
+ DataTable dt = fielddata.GetParticleListForParticlSize("area", "");
|
|
|
|
+ DataTable AreaInformationOfAllElements = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
|
|
|
|
+ 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];
|
|
|
|
+
|
|
|
|
+ for (int i=0;i< dt.Rows.Count;i++)
|
|
|
|
+ {
|
|
|
|
+ DataRow dr = m_bt_DBData.NewRow();
|
|
|
|
+ dr["TypeName"] = dt.Rows[i]["TypeName"].ToString();
|
|
|
|
+ dr["TypeId"] = dt.Rows[i]["TypeId"].ToString();
|
|
|
|
+ dr["con"]= dt.Rows[i]["con"].ToString();
|
|
|
|
+ dr["Class"] = dt.Rows[i]["GroupName"].ToString();
|
|
|
|
+ dr["Largest"] = Math.Round(Convert.ToDouble(dt.Rows[i]["max"]), 2);
|
|
|
|
+ for (int a=6;a< colid.Count;a++)
|
|
|
|
+ {
|
|
|
|
+ string d1 = colid[a].Split('~')[0];
|
|
|
|
+ string d2 = colid[a].Split('~')[1];
|
|
|
|
+ if (d2 == "MAX")
|
|
|
|
+ {
|
|
|
|
+ d2 = "999";
|
|
|
|
+ }
|
|
|
|
+ DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
|
|
|
|
+ dr[colid[a]] = datas.Count();
|
|
|
|
+ }
|
|
|
|
+ for (int a=0;a< AreaInformationOfAllElements.Rows.Count;a++)
|
|
|
|
+ {
|
|
|
|
+ if (dt.Rows[i]["TypeId"].ToString()== AreaInformationOfAllElements.Rows[a]["TypeId"].ToString())
|
|
|
|
+ {
|
|
|
|
+ dr["ar"] = AreaInformationOfAllElements.Rows[a]["ar"];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ m_bt_DBData.Rows.Add(dr);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ private string getWhere(string max, string min, string col, string partic)
|
|
|
|
+ {
|
|
|
|
+ return col + ">=" + min + " and " + col + "<" + max + " and TypeId=" + partic;
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
|
|
|
|
#region 插入颗粒列表并带有帧图
|
|
#region 插入颗粒列表并带有帧图
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -525,9 +594,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- /// <summary>
|
|
|
|
- ///
|
|
|
|
- /// </summary>
|
|
|
|
|
|
+
|
|
/// <param name="dt_ParticlesGridDevidePage">数据源</param>
|
|
/// <param name="dt_ParticlesGridDevidePage">数据源</param>
|
|
/// <param name="str_resultPath">地址</param>
|
|
/// <param name="str_resultPath">地址</param>
|
|
/// <param name="fielddata"></param>
|
|
/// <param name="fielddata"></param>
|
|
@@ -657,18 +724,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
m_list_dt.Add(FrameGraphSubTable);
|
|
m_list_dt.Add(FrameGraphSubTable);
|
|
}
|
|
}
|
|
|
|
|
|
- private bool DetermineWhetherTheFileExists(DirectoryInfo theFolder ,int id)
|
|
|
|
- {
|
|
|
|
- foreach (FileInfo nextifile in theFolder.GetFiles())
|
|
|
|
- {
|
|
|
|
- if (nextifile.Name.Contains(id.ToString()+".bmp") == true || nextifile.Name.Contains(id.ToString()+".BMP") == true)
|
|
|
|
- {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 插入颗粒尺寸表
|
|
#region 插入颗粒尺寸表
|
|
@@ -680,17 +735,30 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
|
|
|
|
- //加载模块
|
|
|
|
- ParticlesSizeGrid ls_particlesizegrid = new ParticlesSizeGrid(m_otsreport_export.m_ReportApp);
|
|
|
|
- List<string> vs = new List<string>() { "DMAX", "DMIN", "CIRCLE", "FERET" };
|
|
|
|
- ls_particlesizegrid.condition = vs[m_otsreport_export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs];
|
|
|
|
- m_otsreport_export.panel_container.Controls.Clear();
|
|
|
|
- m_otsreport_export.panel_container.Controls.Add(ls_particlesizegrid);
|
|
|
|
|
|
+ if (m_bt_DBData.Columns.Count==0)
|
|
|
|
+ {
|
|
|
|
+ GetDBData();
|
|
|
|
+ }
|
|
|
|
|
|
- DataGridView ls_gv = new DataGridView();
|
|
|
|
- DataTable ls_dt = new DataTable();
|
|
|
|
- ls_particlesizegrid.GetDataTableAndGridView(out ls_dt, out ls_gv);
|
|
|
|
|
|
+ List<string> colid = new List<string>();
|
|
|
|
+ //获取粒级表
|
|
|
|
+ string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.FileFolderSize + m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
|
|
|
|
+ DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
|
|
|
|
+ string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
|
|
|
|
+ {
|
|
|
|
+ if (sizestr.Split(',')[i].Length > 0)
|
|
|
|
+ {
|
|
|
|
+ double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
|
|
|
|
+ double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
|
|
|
|
+ colid.Add(d1.ToString() + "~" + d2.ToString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
|
|
|
|
+ colid.Add(d.ToString() + "~MAX");
|
|
|
|
+
|
|
|
|
+ ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
|
|
|
|
|
|
//------------------------------------------------
|
|
//------------------------------------------------
|
|
DataTable ls_partsize_dt = new DataTable();
|
|
DataTable ls_partsize_dt = new DataTable();
|
|
@@ -706,16 +774,17 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
ls_partsize_dt.Columns.Add("c9");
|
|
ls_partsize_dt.Columns.Add("c9");
|
|
|
|
|
|
DataRow dr = ls_partsize_dt.NewRow();
|
|
DataRow dr = ls_partsize_dt.NewRow();
|
|
- //从2开始,固定的
|
|
|
|
- int col = 6;
|
|
|
|
- for (int i = 1; i < 11; i++)
|
|
|
|
|
|
+ for (int i=1;i<10;i++)
|
|
{
|
|
{
|
|
- if (ls_gv.Columns.Count > col)
|
|
|
|
- if (i < 10)
|
|
|
|
- dr["c" + i.ToString()] = ls_gv.Columns[col++].Name;
|
|
|
|
-
|
|
|
|
|
|
+ if (colid.Count<i)
|
|
|
|
+ {
|
|
|
|
+ dr["c" + i.ToString()] = "";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ dr["c" + i.ToString()] = colid[i - 1];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
ls_partsize_dt.Rows.Add(dr);
|
|
ls_partsize_dt.Rows.Add(dr);
|
|
|
|
|
|
DataTable ls_Particel_dt = new DataTable();
|
|
DataTable ls_Particel_dt = new DataTable();
|
|
@@ -734,62 +803,48 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
ls_Particel_dt.Columns.Add("total", typeof(double));
|
|
ls_Particel_dt.Columns.Add("total", typeof(double));
|
|
ls_Particel_dt.Columns.Add("TypeId");
|
|
ls_Particel_dt.Columns.Add("TypeId");
|
|
ls_Particel_dt.Columns.Add("Class");
|
|
ls_Particel_dt.Columns.Add("Class");
|
|
- for (int i = 0; i < ls_gv.Rows.Count; i++)
|
|
|
|
- {
|
|
|
|
- if (Convert.ToInt32(ls_gv.Rows[i].Cells[3].Value) < 100)
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
+ for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
|
|
|
|
+ {
|
|
DataRow dr2 = ls_Particel_dt.NewRow();
|
|
DataRow dr2 = ls_Particel_dt.NewRow();
|
|
- dr2["Name"] = ls_gv.Rows[i].Cells[1].Value.ToString();
|
|
|
|
-
|
|
|
|
- dr2["TypeId"] = ls_gv.Rows[i].Cells[3].Value.ToString();//获取分类编号
|
|
|
|
- int col2 = 6;
|
|
|
|
- for (int j = 1; j < 11; j++)
|
|
|
|
|
|
+ dr2["Name"] = m_bt_DBData.Rows[i]["TypeName"].ToString();
|
|
|
|
+ dr2["Class"] = m_bt_DBData.Rows[i]["Class"].ToString();
|
|
|
|
+ dr2["TypeId"] = m_bt_DBData.Rows[i]["TypeId"].ToString();//获取分类编号
|
|
|
|
+ for (int j=1;j< 10;j++)
|
|
{
|
|
{
|
|
- if (ls_gv.Columns.Count > col2)
|
|
|
|
- if (j < 10)
|
|
|
|
- dr2["c" + j.ToString()] = Convert.ToDouble(ls_gv.Rows[i].Cells[col2++].Value);
|
|
|
|
|
|
+ if (colid.Count >= j)
|
|
|
|
+ {
|
|
|
|
+ dr2["c" + j.ToString()] = Convert.ToDouble(m_bt_DBData.Rows[i][colid[j-1]]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
|
|
if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
|
|
{
|
|
{
|
|
dr2["total"] = "0"; //求合
|
|
dr2["total"] = "0"; //求合
|
|
double d_total = 0;
|
|
double d_total = 0;
|
|
- int col3 = 6;
|
|
|
|
- for (int j = 1; j < 11; j++)
|
|
|
|
|
|
+
|
|
|
|
+ for (int j = 1; j < 10; j++)
|
|
{
|
|
{
|
|
- if (ls_gv.Columns.Count > col3)
|
|
|
|
- d_total = d_total + Convert.ToInt64(ls_gv.Rows[i].Cells[col3++].Value.ToString());
|
|
|
|
|
|
+ if (colid.Count >= j)
|
|
|
|
+ {
|
|
|
|
+ d_total = d_total + Convert.ToInt64(m_bt_DBData.Rows[i][colid[j - 1]]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
dr2["total"] = d_total.ToString();
|
|
dr2["total"] = d_total.ToString();
|
|
}
|
|
}
|
|
-
|
|
|
|
ls_Particel_dt.Rows.Add(dr2);
|
|
ls_Particel_dt.Rows.Add(dr2);
|
|
}
|
|
}
|
|
|
|
|
|
- //元素物质定义
|
|
|
|
- List<List<string>> ElementData = new List<List<string>>();
|
|
|
|
- ElementData.Add(new List<string> { "O", "S" });//氧硫化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "C", "N" });//碳氮化物
|
|
|
|
- ElementData.Add(new List<string> { "O", "N" });//碳氮化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "O" });//氧化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "S" });//硫化物
|
|
|
|
- //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
|
|
|
|
- List<string> ClassName = new List<string>() { "氧硫化物", "碳氮化物", "氧化物", "硫化物", "其他物质" };
|
|
|
|
- //给每个元素进行划分大类
|
|
|
|
- ElementClassification(ref ls_Particel_dt, ElementData, fielddata);
|
|
|
|
|
|
+ //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
|
|
|
|
+ List<string> ClassName = new List<string>();
|
|
|
|
+ DataTable getClass_dt = fielddata.GetAllClass();
|
|
|
|
+ for (int i = 0; i < getClass_dt.Rows.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
|
|
|
|
+ }
|
|
//获取大分类信息
|
|
//获取大分类信息
|
|
DataTable dt = QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName);
|
|
DataTable dt = QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName);
|
|
-
|
|
|
|
ClassificationSort(ls_Particel_dt,ClassName, dt);
|
|
ClassificationSort(ls_Particel_dt,ClassName, dt);
|
|
m_list_dt.Add(ls_partsize_dt);
|
|
m_list_dt.Add(ls_partsize_dt);
|
|
- //m_list_dt.Add(ls_Particel_dt);
|
|
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
catch (Exception ee)
|
|
catch (Exception ee)
|
|
@@ -1050,41 +1105,37 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
public bool InsertReportTemplateTable_ElementAvgGrid()
|
|
public bool InsertReportTemplateTable_ElementAvgGrid()
|
|
{
|
|
{
|
|
|
|
+ if (m_bt_DBData.Columns.Count == 0)
|
|
|
|
+ {
|
|
|
|
+ GetDBData();
|
|
|
|
+ }
|
|
|
|
+
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
|
|
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 AllAnalysisDetails = new DataTable();
|
|
DataTable AllAnalysisDetails = new DataTable();
|
|
AllAnalysisDetails.TableName = "ElementValue";
|
|
AllAnalysisDetails.TableName = "ElementValue";
|
|
AllAnalysisDetails.Columns.Add("Name");
|
|
AllAnalysisDetails.Columns.Add("Name");
|
|
AllAnalysisDetails.Columns.Add("TypeId");
|
|
AllAnalysisDetails.Columns.Add("TypeId");
|
|
AllAnalysisDetails.Columns.Add("Area",typeof(double));
|
|
AllAnalysisDetails.Columns.Add("Area",typeof(double));
|
|
AllAnalysisDetails.Columns.Add("Class");
|
|
AllAnalysisDetails.Columns.Add("Class");
|
|
- for (int i = 0; i < AreaInformationOfAllElements.Rows.Count; i++)
|
|
|
|
|
|
+ for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
|
|
{
|
|
{
|
|
- if (Convert.ToInt32(AreaInformationOfAllElements.Rows[i]["TypeId"]) < 100)
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
DataRow dr2 = AllAnalysisDetails.NewRow();
|
|
DataRow dr2 = AllAnalysisDetails.NewRow();
|
|
- dr2["Name"] = AreaInformationOfAllElements.Rows[i]["TypeName"].ToString();
|
|
|
|
- dr2["Area"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["ar"]);
|
|
|
|
- dr2["TypeId"] = AreaInformationOfAllElements.Rows[i]["TypeId"].ToString();
|
|
|
|
-
|
|
|
|
|
|
+ dr2["Name"] = m_bt_DBData.Rows[i]["TypeName"].ToString();
|
|
|
|
+ dr2["Area"] = Convert.ToDouble(m_bt_DBData.Rows[i]["ar"]);
|
|
|
|
+ dr2["TypeId"] = m_bt_DBData.Rows[i]["TypeId"].ToString();
|
|
|
|
+ dr2["Class"]= m_bt_DBData.Rows[i]["Class"].ToString();
|
|
AllAnalysisDetails.Rows.Add(dr2);
|
|
AllAnalysisDetails.Rows.Add(dr2);
|
|
}
|
|
}
|
|
- //元素物质定义
|
|
|
|
- List<List<string>> ElementData = new List<List<string>>();
|
|
|
|
- ElementData.Add(new List<string> { "O", "S" });//氧硫化物
|
|
|
|
|
|
|
|
- ElementData.Add(new List<string> { "C", "N" });//碳氮化物
|
|
|
|
- ElementData.Add(new List<string> { "O", "N" });//碳氮化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "O" });//氧化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "S" });//硫化物
|
|
|
|
//按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
|
|
//按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
|
|
- List<string> ClassName = new List<string>() { "氧硫化物", "碳氮化物", "氧化物", "硫化物", "其他物质" };
|
|
|
|
- //给每个元素进行划分大类
|
|
|
|
- ElementClassification(ref AllAnalysisDetails, ElementData, fielddata);
|
|
|
|
|
|
+ List<string> ClassName = new List<string>();
|
|
|
|
+ DataTable getClass_dt= fielddata.GetAllClass();
|
|
|
|
+ for (int i=0;i< getClass_dt.Rows.Count;i++)
|
|
|
|
+ {
|
|
|
|
+ ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
|
|
|
|
+ }
|
|
//统计元素物质大类的元素信息和面积占比
|
|
//统计元素物质大类的元素信息和面积占比
|
|
DataTable dt_ElementalSubstance= ElementalSubstance(AllAnalysisDetails, ClassName, fielddata);
|
|
DataTable dt_ElementalSubstance= ElementalSubstance(AllAnalysisDetails, ClassName, fielddata);
|
|
//统计元素并按照Class Name自定义列表进行排序,大类中的小类元素信息按照面积从大到小排序
|
|
//统计元素并按照Class Name自定义列表进行排序,大类中的小类元素信息按照面积从大到小排序
|
|
@@ -1094,8 +1145,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
//生成最后导出时物质元素细分表
|
|
//生成最后导出时物质元素细分表
|
|
SubdivisionOfMaterialElements(dt_ElementSorting, 13, ClassName, dt);
|
|
SubdivisionOfMaterialElements(dt_ElementSorting, 13, ClassName, dt);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
//夹杂物面积比添加大类
|
|
//夹杂物面积比添加大类
|
|
DataTable RawParticleData = InclusionAreaRatio();
|
|
DataTable RawParticleData = InclusionAreaRatio();
|
|
//夹杂物面积比计算大类占比
|
|
//夹杂物面积比计算大类占比
|
|
@@ -1149,55 +1198,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
m_list_dt.Add(AllAnalysisDetails);
|
|
m_list_dt.Add(AllAnalysisDetails);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- public bool ElementClassification(ref DataTable AreaInformationOfAllElements, List<List<string>> ElementData, ParticleData fielddata)
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- for (int i=0;i< AreaInformationOfAllElements.Rows.Count;i++)
|
|
|
|
- {
|
|
|
|
- List<string> ElementGroup = new List<string>();
|
|
|
|
- DataTable ClassificationDetails = fielddata.GetAreaByIncA(AreaInformationOfAllElements.Rows[i]["TypeId"].ToString(), "");//获取单个分类的元素信息
|
|
|
|
- for (int a=0;a< ClassificationDetails.Rows.Count;a++)
|
|
|
|
- {
|
|
|
|
- ElementGroup.Add(ClassificationDetails.Rows[a]["Name"].ToString());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (int a=0;a< ElementGroup.Count()-1;a++)
|
|
|
|
- {
|
|
|
|
- ElementGroup[a] = ElementGroup[a].Split('-')[0];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (ElementData[0].All(b => ElementGroup.Any(a => a.Equals(b))))
|
|
|
|
- {
|
|
|
|
- AreaInformationOfAllElements.Rows[i]["Class"] = "氧硫化物";
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (ElementData[1].All(b => ElementGroup.Any(a => a.Equals(b)))|| ElementData[2].All(b => ElementGroup.Any(a => a.Equals(b))))
|
|
|
|
- {
|
|
|
|
- AreaInformationOfAllElements.Rows[i]["Class"] = "碳氮化物";
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (ElementData[4].All(b => ElementGroup.Any(a => a.Equals(b))))
|
|
|
|
- {
|
|
|
|
- AreaInformationOfAllElements.Rows[i]["Class"] = "硫化物";
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (ElementData[3].All(b => ElementGroup.Any(a => a.Equals(b))))
|
|
|
|
- {
|
|
|
|
- AreaInformationOfAllElements.Rows[i]["Class"] = "氧化物";
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- AreaInformationOfAllElements.Rows[i]["Class"] = "其他物质";
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
private DataTable ElementSorting( DataTable AllAnalysisDetails, List<string> ClassName , ParticleData fielddata)
|
|
private DataTable ElementSorting( DataTable AllAnalysisDetails, List<string> ClassName , ParticleData fielddata)
|
|
{
|
|
{
|
|
DataTable dte = fielddata.GetAllElement();
|
|
DataTable dte = fielddata.GetAllElement();
|
|
@@ -1339,13 +1340,20 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
dt_ElementalSubstance.Columns.Add(m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]);
|
|
dt_ElementalSubstance.Columns.Add(m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]);
|
|
for (int a=0;a< a_ElementalSubstance.Rows.Count;a++)
|
|
for (int a=0;a< a_ElementalSubstance.Rows.Count;a++)
|
|
{
|
|
{
|
|
- if (a_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]].ToString() == "")
|
|
|
|
|
|
+ if (a_ElementalSubstance.Columns.Contains(m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]))
|
|
{
|
|
{
|
|
- dt_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]] = 0;
|
|
|
|
|
|
+ if (a_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]].ToString() == "")
|
|
|
|
+ {
|
|
|
|
+ dt_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]] = 0;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ dt_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]] = a_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- dt_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]] = a_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]];
|
|
|
|
|
|
+ dt_ElementalSubstance.Rows[a][m_otsreport_export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys[i]] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1417,19 +1425,26 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
{
|
|
{
|
|
if (ClassName[i].ToString() == a_ElementalSubstance.Rows[a]["Class"].ToString())
|
|
if (ClassName[i].ToString() == a_ElementalSubstance.Rows[a]["Class"].ToString())
|
|
{
|
|
{
|
|
-
|
|
|
|
for (int b=0;b< dt_1.Columns.Count;b++)
|
|
for (int b=0;b< dt_1.Columns.Count;b++)
|
|
{
|
|
{
|
|
if (dt_2.Columns[b].ToString()!="Class")
|
|
if (dt_2.Columns[b].ToString()!="Class")
|
|
{
|
|
{
|
|
- if (a_ElementalSubstance.Rows[a][dt_2.Columns[b].ToString()].ToString() == "")
|
|
|
|
|
|
+ if (a_ElementalSubstance.Columns.Contains(dt_2.Columns[b].ToString()))
|
|
{
|
|
{
|
|
- dt_2.Rows[0][dt_2.Columns[b].ToString()] = 0;
|
|
|
|
|
|
+ if (a_ElementalSubstance.Rows[a][dt_2.Columns[b].ToString()].ToString() == "")
|
|
|
|
+ {
|
|
|
|
+ dt_2.Rows[0][dt_2.Columns[b].ToString()] = 0;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ dt_2.Rows[0][dt_2.Columns[b].ToString()] = a_ElementalSubstance.Rows[a][dt_2.Columns[b].ToString()];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- dt_2.Rows[0][dt_2.Columns[b].ToString()] = a_ElementalSubstance.Rows[a][dt_2.Columns[b].ToString()];
|
|
|
|
|
|
+ dt_2.Rows[0][dt_2.Columns[b].ToString()] = 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
dt_1.Rows.Add(dt_2.Rows[0].ItemArray);
|
|
dt_1.Rows.Add(dt_2.Rows[0].ItemArray);
|
|
@@ -1476,31 +1491,24 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
AllAnalysisDetails.Columns.Add("Cunt",typeof(double));
|
|
AllAnalysisDetails.Columns.Add("Cunt",typeof(double));
|
|
for (int i = 0; i < AreaInformationOfAllElements.Rows.Count; i++)
|
|
for (int i = 0; i < AreaInformationOfAllElements.Rows.Count; i++)
|
|
{
|
|
{
|
|
- if (Convert.ToInt32(AreaInformationOfAllElements.Rows[i]["TypeId"]) < 100)
|
|
|
|
- continue;
|
|
|
|
|
|
+ //if (Convert.ToInt32(AreaInformationOfAllElements.Rows[i]["TypeId"]) < 100)
|
|
|
|
+ // continue;
|
|
|
|
|
|
DataRow dr2 = AllAnalysisDetails.NewRow();
|
|
DataRow dr2 = AllAnalysisDetails.NewRow();
|
|
dr2["Name"] = AreaInformationOfAllElements.Rows[i]["TypeName"].ToString();
|
|
dr2["Name"] = AreaInformationOfAllElements.Rows[i]["TypeName"].ToString();
|
|
dr2["Area"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["ar"]);
|
|
dr2["Area"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["ar"]);
|
|
dr2["TypeId"] = AreaInformationOfAllElements.Rows[i]["TypeId"].ToString();
|
|
dr2["TypeId"] = AreaInformationOfAllElements.Rows[i]["TypeId"].ToString();
|
|
dr2["Cunt"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["con"]);
|
|
dr2["Cunt"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["con"]);
|
|
|
|
+ dr2["Class"] = AreaInformationOfAllElements.Rows[i]["GroupName"].ToString();
|
|
AllAnalysisDetails.Rows.Add(dr2);
|
|
AllAnalysisDetails.Rows.Add(dr2);
|
|
}
|
|
}
|
|
- //元素物质定义
|
|
|
|
- List<List<string>> ElementData = new List<List<string>>();
|
|
|
|
- ElementData.Add(new List<string> { "O", "S" });//氧硫化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "C", "N" });//碳氮化物
|
|
|
|
- ElementData.Add(new List<string> { "O", "N" });//碳氮化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "O" });//氧化物
|
|
|
|
-
|
|
|
|
- ElementData.Add(new List<string> { "S" });//硫化物
|
|
|
|
- //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
|
|
|
|
- List<string> ClassName = new List<string>() { "氧硫化物", "碳氮化物", "氧化物", "硫化物", "其他物质" };
|
|
|
|
- //给每个元素进行划分大类
|
|
|
|
- ElementClassification(ref AllAnalysisDetails, ElementData, fielddata);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ List<string> ClassName = new List<string>();
|
|
|
|
+ DataTable getClass_dt = fielddata.GetAllClass();
|
|
|
|
+ for (int i = 0; i < getClass_dt.Rows.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
|
|
|
|
+ }
|
|
|
|
|
|
DataTable AreaRatio = new DataTable();
|
|
DataTable AreaRatio = new DataTable();
|
|
AreaRatio.TableName = "InclusionAreaRatio";
|
|
AreaRatio.TableName = "InclusionAreaRatio";
|
|
@@ -1674,9 +1682,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
-
|
|
|
|
#endregion
|
|
#endregion
|
|
-
|
|
|
|
#region 插入夹杂物面积比图
|
|
#region 插入夹杂物面积比图
|
|
public bool InsertReportTemplateChart_InclusionAreaRatio(string a_GraphicStyle)
|
|
public bool InsertReportTemplateChart_InclusionAreaRatio(string a_GraphicStyle)
|
|
{
|
|
{
|
|
@@ -2111,15 +2117,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
return ret_bp;
|
|
return ret_bp;
|
|
}
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// 导出二次放大图像
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="str_srcPathName"></param>
|
|
|
|
- /// <param name="str_outPathName"></param>
|
|
|
|
- public void ParticleReZoom(string str_srcPathName, string str_outPathName)
|
|
|
|
- {
|
|
|
|
- //m_COTSReportProjFileMgrClr.ReZoom(str_srcPathName, str_outPathName);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 传入DataTable,和行号,返回该Row行中,返回6个靠前的元素,不足6个返回空
|
|
/// 传入DataTable,和行号,返回该Row行中,返回6个靠前的元素,不足6个返回空
|
|
@@ -2228,5 +2226,4 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|