|
@@ -115,13 +115,23 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// <returns></returns>
|
|
|
public bool InsertReportTemplateTable_ParticlesGridDevidePage()
|
|
|
{
|
|
|
+
|
|
|
+ int serialNumber = 1;
|
|
|
+
|
|
|
//------------------加载模块,获取数据-------------------------------------------------
|
|
|
//if (m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage!=null)
|
|
|
m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
|
|
|
|
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
|
ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath);
|
|
|
- DataTable dt_ParticlesGridDevidePage = fielddata.GetInfoForPartucleDevidePage(0, 200, "fieldid,particleid", "");
|
|
|
+ //DataTable dt_ParticlesGridDevidePage = fielddata.GetInfoForPartucleDevidePage(0, 200, "fieldid,particleid", "");
|
|
|
+ DataTable dt = fielddata.GetIncaSurfaceData();
|
|
|
+ //将颗粒大小排序(从大到小)
|
|
|
+ DataView dv = dt.DefaultView;
|
|
|
+ dv.Sort = "Area DESC";
|
|
|
+ DataTable dt_ParticlesGridDevidePage = dv.ToTable();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath;
|
|
|
//------------------加载模块,获取数据结束----------------------------------------------
|
|
@@ -197,125 +207,18 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- //for (int i= 0;i < dt_ParticlesGridDevidePage.Rows.Count;i++)
|
|
|
- //{
|
|
|
- // //获取颗粒的fieldid,和particleid
|
|
|
- // string str_fieldid = dt_ParticlesGridDevidePage.Rows[i]["fieldid"].ToString();
|
|
|
- // string str_particleid = dt_ParticlesGridDevidePage.Rows[i]["particleid"].ToString();
|
|
|
- // string str_subparticles = dt_ParticlesGridDevidePage.Rows[i]["SubParticles"].ToString();
|
|
|
- // string str_typeid = dt_ParticlesGridDevidePage.Rows[i]["TypeId"].ToString();
|
|
|
- // string str_typename = dt_ParticlesGridDevidePage.Rows[i]["TypeName"].ToString();
|
|
|
- // string str_element = dt_ParticlesGridDevidePage.Rows[i]["Element"].ToString();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // //获取原始颗粒图像
|
|
|
- // Bitmap bp_particle = new Bitmap(1, 1);
|
|
|
- // string str_path = str_resultPath + "\\FIELD_FILES\\";
|
|
|
- // string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
|
|
|
-
|
|
|
- // if (str_subparticles != null && str_subparticles != "")
|
|
|
- // {
|
|
|
-
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // //正常颗粒
|
|
|
- // Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectHeight"]) };
|
|
|
- // Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
|
|
|
- // bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
|
- // bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i]["TypeId"].ToString() };
|
|
|
-
|
|
|
-
|
|
|
- // if (fielddata.GetParticleByFidAndPid(str_fieldid, str_particleid).XRayData != null)
|
|
|
- // {
|
|
|
-
|
|
|
- // //获取该颗粒的xray能谱图像
|
|
|
- // System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
|
|
|
- // str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
|
|
|
- // Bitmap ls_xraybpnew = new Bitmap(1, 1);
|
|
|
- // ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
|
|
|
-
|
|
|
- // //获取该颗粒的二次放大处理图像
|
|
|
- // Bitmap ls_processbitmap = new Bitmap(1, 1);
|
|
|
- // ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
|
|
|
-
|
|
|
- // //再将图像转成二进制流-------------------------------------------------------------------
|
|
|
- // //原图
|
|
|
- // MemoryStream newms_p1 = new MemoryStream();
|
|
|
- // bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
- // newms_p1.Seek(0, SeekOrigin.Begin);
|
|
|
- // byte[] newarr_p1 = new byte[newms_p1.Length];
|
|
|
- // newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
|
|
|
-
|
|
|
- // //二次放大图
|
|
|
- // MemoryStream newms_p2 = new MemoryStream();
|
|
|
- // ls_processbitmap.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
- // newms_p2.Seek(0, SeekOrigin.Begin);
|
|
|
- // byte[] newarr_p2 = new byte[newms_p2.Length];
|
|
|
- // newms_p2.Read(newarr_p2, 0, newarr_p2.Length);
|
|
|
-
|
|
|
- // //能谱图
|
|
|
- // MemoryStream newms_p3 = new MemoryStream();
|
|
|
- // ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
- // newms_p3.Seek(0, SeekOrigin.Begin);
|
|
|
- // byte[] newarr_p3 = new byte[newms_p3.Length];
|
|
|
- // newms_p3.Read(newarr_p3, 0, newarr_p3.Length);
|
|
|
- // //---------------------------------------------------------------------------------------
|
|
|
- // DataRow dr = DT_Largest20.NewRow();
|
|
|
-
|
|
|
- // dr["p1"] = newarr_p1;
|
|
|
- // dr["p2"] = newarr_p2;
|
|
|
- // dr["p3"] = newarr_p3;
|
|
|
- // newms_p1.Dispose();
|
|
|
- // newms_p2.Dispose();
|
|
|
- // newms_p3.Dispose();
|
|
|
-
|
|
|
- // dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i]["particleid"].ToString();
|
|
|
- // dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
|
|
|
- // dr["Width"] = dt_ParticlesGridDevidePage.Rows[i]["rectwidth"].ToString();
|
|
|
- // dr["Class"] = dt_ParticlesGridDevidePage.Rows[i]["typename"].ToString();
|
|
|
-
|
|
|
-
|
|
|
- // List<string> list_max_elementname = new List<string>();
|
|
|
- // List<double> list_max_elementvale = new List<double>();
|
|
|
- // GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i, out list_max_elementname, out list_max_elementvale);
|
|
|
- // //元素1
|
|
|
- // dr["ColName1"] = list_max_elementname[0];
|
|
|
- // dr["ColVal1"] = list_max_elementvale[0].ToString();
|
|
|
- // //元素2
|
|
|
- // dr["ColName2"] = list_max_elementname[1];
|
|
|
- // dr["ColVal2"] = list_max_elementvale[1].ToString();
|
|
|
- // //元素3
|
|
|
- // dr["ColName3"] = list_max_elementname[2];
|
|
|
- // dr["ColVal3"] = list_max_elementvale[2].ToString();
|
|
|
- // //元素4
|
|
|
- // dr["ColName4"] = list_max_elementname[3];
|
|
|
- // dr["ColVal4"] = list_max_elementvale[3].ToString();
|
|
|
- // //元素5
|
|
|
- // dr["ColName5"] = list_max_elementname[4];
|
|
|
- // dr["ColVal5"] = list_max_elementvale[4].ToString();
|
|
|
- // //元素6
|
|
|
- // dr["ColName6"] = list_max_elementname[5];
|
|
|
- // dr["ColVal6"] = list_max_elementvale[5].ToString();
|
|
|
-
|
|
|
-
|
|
|
- // DT_Largest20.Rows.Add(dr);
|
|
|
-
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //}
|
|
|
+
|
|
|
|
|
|
|
|
|
#region 插入-前20颗粒部份
|
|
|
- for (int i_row = 0; i_row < 20; i_row++)
|
|
|
+
|
|
|
+
|
|
|
+ for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
|
|
|
{
|
|
|
- if (i_row < dt_ParticlesGridDevidePage.Rows.Count)
|
|
|
+ if (dt_ParticlesGridDevidePage.Rows[i_row].ItemArray[24].ToString()!= "Not Identified")
|
|
|
{
|
|
|
+
|
|
|
+
|
|
|
//获取颗粒的fieldid,和particleid
|
|
|
string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
|
|
|
string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
@@ -332,6 +235,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
if (str_fieldid == "-1")
|
|
|
continue;
|
|
|
|
|
|
+
|
|
|
+ if (serialNumber > 20)
|
|
|
+ continue;
|
|
|
+
|
|
|
if (str_subparticles != null && str_subparticles != "")
|
|
|
{
|
|
|
//合并大颗粒
|
|
@@ -345,14 +252,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
{
|
|
|
//正常颗粒
|
|
|
Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
|
|
|
- Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
|
|
|
- bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
|
- bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
|
|
|
- }
|
|
|
-
|
|
|
- //fielddata.GetParticleByFidAndPid(str_fieldid, str_particleid);
|
|
|
-
|
|
|
-
|
|
|
+ Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
|
|
|
+ bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
|
+ bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
|
|
|
+ }
|
|
|
//获取该颗粒的xray能谱图像
|
|
|
System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
|
|
|
str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
|
|
@@ -394,7 +297,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
newms_p2.Dispose();
|
|
|
newms_p3.Dispose();
|
|
|
|
|
|
- dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
|
+ dr["pid"] = serialNumber++.ToString();
|
|
|
+ //dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
|
dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
|
|
|
dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
|
|
|
dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
|
|
@@ -436,6 +340,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES_MARK);
|
|
|
if (theFolder.Exists)
|
|
|
{
|
|
|
+
|
|
|
foreach (FileInfo nextifile in theFolder.GetFiles())
|
|
|
{
|
|
|
if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
|
|
@@ -471,89 +376,94 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
#endregion
|
|
|
|
|
|
#region 插入-前20颗粒外的颗粒
|
|
|
- for (int i_row = 20; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
|
|
|
+ for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
|
|
|
{
|
|
|
//获取颗粒的fieldid,和particleid
|
|
|
string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
|
|
|
- string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
|
- string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
|
|
|
- string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
|
|
|
- string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
|
|
|
- string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
|
|
|
-
|
|
|
- //获取原始颗粒图像
|
|
|
- Bitmap bp_particle = new Bitmap(1, 1);
|
|
|
- string str_path = str_resultPath + "\\FIELD_FILES\\";
|
|
|
- string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
|
|
|
- if (str_subparticles != null && str_subparticles != "")
|
|
|
+ if (Convert.ToInt32(str_fieldid) < 20)
|
|
|
{
|
|
|
- //合并大颗粒
|
|
|
- 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);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //正常颗粒
|
|
|
- Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
|
|
|
- Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
|
|
|
- bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
|
- bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
|
|
|
- }
|
|
|
+
|
|
|
+ string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
|
+ string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
|
|
|
+ string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
|
|
|
+ string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
|
|
|
+ string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
|
|
|
|
|
|
- //获取该颗粒的xray能谱图像
|
|
|
- System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
|
|
|
- str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
|
|
|
-
|
|
|
- //获取该颗粒的二次放大处理图像
|
|
|
- Bitmap ls_processbitmap = new Bitmap(1, 1);
|
|
|
- ls_processbitmap = (Bitmap)bp_particle.Clone();//待完善
|
|
|
-
|
|
|
- //再将图像转成二进制流-------------------------------------------------------------------
|
|
|
- //原图
|
|
|
- MemoryStream newms_p1 = new MemoryStream();
|
|
|
- bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
- newms_p1.Seek(0, SeekOrigin.Begin);
|
|
|
- byte[] newarr_p1 = new byte[newms_p1.Length];
|
|
|
- newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
|
|
|
- //---------------------------------------------------------------------------------------
|
|
|
- DataRow dr = DT_Largest_frame.NewRow();
|
|
|
- dr["p1"] = newarr_p1;
|
|
|
- newms_p1.Dispose();
|
|
|
-
|
|
|
- dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
|
- dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
|
|
|
- dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
|
|
|
- dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
|
|
|
-
|
|
|
- dr["fieldid"] = str_fieldid;
|
|
|
-
|
|
|
- List<string> list_max_elementname = new List<string>();
|
|
|
- List<double> list_max_elementvale = new List<double>();
|
|
|
- GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out list_max_elementname, out list_max_elementvale);
|
|
|
- //元素1
|
|
|
- dr["ColName1"] = list_max_elementname[0];
|
|
|
- dr["ColVal1"] = list_max_elementvale[0].ToString();
|
|
|
- //元素2
|
|
|
- dr["ColName2"] = list_max_elementname[1];
|
|
|
- dr["ColVal2"] = list_max_elementvale[1].ToString();
|
|
|
- //元素3
|
|
|
- dr["ColName3"] = list_max_elementname[2];
|
|
|
- dr["ColVal3"] = list_max_elementvale[2].ToString();
|
|
|
- //元素4
|
|
|
- dr["ColName4"] = list_max_elementname[3];
|
|
|
- dr["ColVal4"] = list_max_elementvale[3].ToString();
|
|
|
- //元素5
|
|
|
- dr["ColName5"] = list_max_elementname[4];
|
|
|
- dr["ColVal5"] = list_max_elementvale[4].ToString();
|
|
|
- //元素6
|
|
|
- dr["ColName6"] = list_max_elementname[5];
|
|
|
- dr["ColVal6"] = list_max_elementvale[5].ToString();
|
|
|
-
|
|
|
-
|
|
|
- DT_Largest_frame.Rows.Add(dr);
|
|
|
+ //获取原始颗粒图像
|
|
|
+ Bitmap bp_particle = new Bitmap(1, 1);
|
|
|
+ string str_path = str_resultPath + "\\FIELD_FILES\\";
|
|
|
+ string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //正常颗粒
|
|
|
+ Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
|
|
|
+ Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
|
|
|
+ bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
|
+ bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取该颗粒的xray能谱图像
|
|
|
+ System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
|
|
|
+ str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
|
|
|
+
|
|
|
+ //获取该颗粒的二次放大处理图像
|
|
|
+ Bitmap ls_processbitmap = new Bitmap(1, 1);
|
|
|
+ ls_processbitmap = (Bitmap)bp_particle.Clone();//待完善
|
|
|
+
|
|
|
+ //再将图像转成二进制流-------------------------------------------------------------------
|
|
|
+ //原图
|
|
|
+ MemoryStream newms_p1 = new MemoryStream();
|
|
|
+ bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
+ newms_p1.Seek(0, SeekOrigin.Begin);
|
|
|
+ byte[] newarr_p1 = new byte[newms_p1.Length];
|
|
|
+ newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
|
|
|
+ //---------------------------------------------------------------------------------------
|
|
|
+ DataRow dr = DT_Largest_frame.NewRow();
|
|
|
+ dr["p1"] = newarr_p1;
|
|
|
+ newms_p1.Dispose();
|
|
|
+
|
|
|
+ dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
|
|
|
+ dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
|
|
|
+ dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
|
|
|
+ dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
|
|
|
+
|
|
|
+ dr["fieldid"] = str_fieldid;
|
|
|
+
|
|
|
+ List<string> list_max_elementname = new List<string>();
|
|
|
+ List<double> list_max_elementvale = new List<double>();
|
|
|
+ GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out list_max_elementname, out list_max_elementvale);
|
|
|
+ //元素1
|
|
|
+ dr["ColName1"] = list_max_elementname[0];
|
|
|
+ dr["ColVal1"] = list_max_elementvale[0].ToString();
|
|
|
+ //元素2
|
|
|
+ dr["ColName2"] = list_max_elementname[1];
|
|
|
+ dr["ColVal2"] = list_max_elementvale[1].ToString();
|
|
|
+ //元素3
|
|
|
+ dr["ColName3"] = list_max_elementname[2];
|
|
|
+ dr["ColVal3"] = list_max_elementvale[2].ToString();
|
|
|
+ //元素4
|
|
|
+ dr["ColName4"] = list_max_elementname[3];
|
|
|
+ dr["ColVal4"] = list_max_elementvale[3].ToString();
|
|
|
+ //元素5
|
|
|
+ dr["ColName5"] = list_max_elementname[4];
|
|
|
+ dr["ColVal5"] = list_max_elementvale[4].ToString();
|
|
|
+ //元素6
|
|
|
+ dr["ColName6"] = list_max_elementname[5];
|
|
|
+ dr["ColVal6"] = list_max_elementvale[5].ToString();
|
|
|
+
|
|
|
+
|
|
|
+ DT_Largest_frame.Rows.Add(dr);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -577,7 +487,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
{
|
|
|
//加载模块
|
|
|
ParticlesSizeGrid ls_particlesizegrid = new ParticlesSizeGrid(m_otsreport_export.m_ReportApp);
|
|
|
- List<string> vs = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
|
|
|
+ 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);
|
|
@@ -768,6 +678,12 @@ 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());
|
|
|
+ }
|
|
|
|
|
|
m_list_dt.Add(ls_elementname_dt);
|
|
|
m_list_dt.Add(ls_element_dt);
|
|
@@ -1257,7 +1173,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
if (str_element != "")
|
|
|
{
|
|
|
string[] strcbo = str_element.Split(';');
|
|
|
- for (int i = 0; i < strcbo.Length; i++)
|
|
|
+ for (int i = 0; i < strcbo.Length-1; i++)
|
|
|
{
|
|
|
string[] str = strcbo[i].Split('-');
|
|
|
list_elementname.Add(str[0]);
|
|
@@ -1272,7 +1188,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
string max_elementname = "";
|
|
|
int max_index = -1;
|
|
|
|
|
|
- if (list_elementvalue.Count > 1)
|
|
|
+ if (list_elementvalue.Count > 0)
|
|
|
{
|
|
|
for (int i = 0; i < list_elementvalue.Count; i++)
|
|
|
{
|