|
@@ -396,11 +396,12 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
if (str_subparticles != null && str_subparticles != "")
|
|
|
{
|
|
|
//合并大颗粒
|
|
|
- double ScanFieldSize = 1142;
|
|
|
- Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
|
|
|
- int pixw = tempbit.Width;
|
|
|
- double xs = pixw / ScanFieldSize;
|
|
|
- bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath);
|
|
|
+ //double ScanFieldSize = 1142;
|
|
|
+ //Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
|
|
|
+ //int pixw = tempbit.Width;
|
|
|
+ //double xs = pixw / ScanFieldSize;
|
|
|
+ //bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath);
|
|
|
+ continue;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -678,13 +679,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
dr2["AllElements"] = AllElements;
|
|
|
ls_element_dt.Rows.Add(dr2);
|
|
|
}
|
|
|
- //获取夹杂物的总面积用于计算夹杂物类别的占比(gridview最后一个固定是未识别颗粒,要排除未识别颗粒所以for循环至grid view长度减一)
|
|
|
- double totalInclusionArea = 0;
|
|
|
- for (int i = 0; i < ls_gv.Rows.Count - 1; i++)
|
|
|
- {
|
|
|
- totalInclusionArea = totalInclusionArea + Convert.ToDouble(ls_gv.Rows[i].Cells[2].Value.ToString());
|
|
|
- }
|
|
|
|
|
|
+ InclusionAreaRatio(ls_gv);
|
|
|
m_list_dt.Add(ls_elementname_dt);
|
|
|
m_list_dt.Add(ls_element_dt);
|
|
|
|
|
@@ -698,6 +694,39 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ private void InclusionAreaRatio(DataGridView ls_gv)
|
|
|
+ {
|
|
|
+ DataTable AreaRatio = new DataTable();
|
|
|
+ AreaRatio.TableName = "InclusionAreaRatio";
|
|
|
+ AreaRatio.Columns.Add("e1");
|
|
|
+ AreaRatio.Columns.Add("e2");
|
|
|
+ AreaRatio.Columns.Add("e3");
|
|
|
+ AreaRatio.Columns.Add("e4");
|
|
|
+ AreaRatio.Columns.Add("e5");
|
|
|
+
|
|
|
+
|
|
|
+ //获取夹杂物的总面积用于计算夹杂物类别的占比(gridview最后一个固定是未识别颗粒,要排除未识别颗粒所以for循环至grid view长度减一)
|
|
|
+ double totalInclusionArea = 0;
|
|
|
+ for (int i = 0; i < ls_gv.Rows.Count - 1; i++)
|
|
|
+ {
|
|
|
+ totalInclusionArea = totalInclusionArea + Convert.ToDouble(ls_gv.Rows[i].Cells[2].Value.ToString());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (int i = 0; i < ls_gv.Rows.Count - 1; i++)
|
|
|
+ {
|
|
|
+ DataRow dr = AreaRatio.NewRow();
|
|
|
+ dr["e1"] = (i + 1).ToString();
|
|
|
+ dr["e2"] = ls_gv.Rows[i].Cells[1].Value.ToString();
|
|
|
+ dr["e3"] = ls_gv.Rows[i].Cells[2].Value.ToString();
|
|
|
+ dr["e4"] = Math.Round((Convert.ToDouble(ls_gv.Rows[i].Cells[2].Value)/ totalInclusionArea)*100,2);
|
|
|
+ dr["e5"] = Math.Round((Convert.ToDouble(ls_gv.Rows[i].Cells[2].Value) / Convert.ToDouble( m_list_dt.Where(aa => aa.TableName.Contains("ResultGrid")).ToList()[0].Rows[0][5])) * 100, 4);
|
|
|
+ AreaRatio.Rows.Add(dr);
|
|
|
+ }
|
|
|
+
|
|
|
+ m_list_dt.Add(AreaRatio);
|
|
|
+ }
|
|
|
+
|
|
|
#region 插入颗粒图chart
|
|
|
/// <summary>
|
|
|
/// 用于颗粒图chart
|