|
@@ -23,7 +23,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
public List<DataTable> m_list_dt; //导出的各模块数据,合集
|
|
|
|
|
|
public OTSReport_Export m_otsreport_export;
|
|
|
-
|
|
|
+ UserLibraryData userLibrary;
|
|
|
+ DataTable userLibraryData;
|
|
|
DataTable m_bt_DBData = new DataTable();
|
|
|
List<string> TemplateList;
|
|
|
#endregion
|
|
@@ -114,7 +115,48 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
|
|
|
}
|
|
|
#endregion
|
|
|
-
|
|
|
+ #region 读取选择颗粒数据
|
|
|
+ private void SelectParticleData(out DataTable dt)
|
|
|
+ {
|
|
|
+ List<Particle> selectParticles = m_otsreport_export.m_ReportApp.GetSelectedParticles();
|
|
|
+
|
|
|
+ #region Datatable数据表格式
|
|
|
+ DataTable dtUelect = new DataTable();
|
|
|
+ dtUelect.Columns.Add("fieldid");
|
|
|
+ dtUelect.Columns.Add("particleid");
|
|
|
+ dtUelect.Columns.Add("AveGray");
|
|
|
+ dtUelect.Columns.Add("RectLeft");
|
|
|
+ dtUelect.Columns.Add("RectTop");
|
|
|
+ dtUelect.Columns.Add("RectWidth");
|
|
|
+ dtUelect.Columns.Add("RectHeight");
|
|
|
+ dtUelect.Columns.Add("Area");
|
|
|
+ dtUelect.Columns.Add("PosX");
|
|
|
+ dtUelect.Columns.Add("PosY");
|
|
|
+ dtUelect.Columns.Add("TypeId");
|
|
|
+ dtUelect.Columns.Add("SegmentNum");
|
|
|
+ dtUelect.Columns.Add("SEMPosX");
|
|
|
+ dtUelect.Columns.Add("SEMPosY");
|
|
|
+ dtUelect.Columns.Add("XrayId");
|
|
|
+ dtUelect.Columns.Add("DMAX");
|
|
|
+ dtUelect.Columns.Add("DMIN");
|
|
|
+ dtUelect.Columns.Add("DPERP");
|
|
|
+ dtUelect.Columns.Add("PERIMETER");
|
|
|
+ dtUelect.Columns.Add("ORIENTATION");
|
|
|
+ dtUelect.Columns.Add("DINSCR");
|
|
|
+ dtUelect.Columns.Add("DMEAN");
|
|
|
+ dtUelect.Columns.Add("DELONG");
|
|
|
+ dtUelect.Columns.Add("DFERET");
|
|
|
+ dtUelect.Columns.Add("TypeName");
|
|
|
+ dtUelect.Columns.Add("TypeColor");
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ for (int i = 0; i < selectParticles.Count; i++)
|
|
|
+ {
|
|
|
+ dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor);
|
|
|
+ }
|
|
|
+ dt = dtUelect.Copy();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
#region 读取标准库所需要的数据
|
|
|
private void GetSTL(string str ,out DataTable data)
|
|
|
{
|
|
@@ -151,9 +193,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
data = dt;
|
|
|
}
|
|
|
- public bool GetDBData()
|
|
|
+ public bool GetDBData(MBSZClass m_mbszclass)
|
|
|
{
|
|
|
//GetSTL();
|
|
|
+
|
|
|
|
|
|
m_bt_DBData.Clear();
|
|
|
m_bt_DBData.Columns.Clear();
|
|
@@ -180,12 +223,19 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
m_bt_DBData.Columns.Add(colid[i].ToString());
|
|
|
}
|
|
|
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("");
|
|
|
-
|
|
|
+ //选择颗粒信息
|
|
|
+ DataTable data;
|
|
|
+ SelectParticleData(out data);
|
|
|
+ //选择颗粒整理成表
|
|
|
+ DataTable Partic_dt = new DataTable();
|
|
|
+ if (data.Rows.Count >0)
|
|
|
+ {
|
|
|
+ Partic_dt = GetParticleListForParticlSize(data, dtp);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
List<string> vs = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
|
|
|
string po = vs[m_otsreport_export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs];
|
|
@@ -205,37 +255,127 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
po = "DFERET";
|
|
|
break;
|
|
|
}
|
|
|
- for (int i=0;i< dt.Rows.Count;i++)
|
|
|
+
|
|
|
+
|
|
|
+ //如果是全部颗粒(0)
|
|
|
+ if (m_mbszclass.M_SY.int_xzkl == 0)
|
|
|
{
|
|
|
- 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++)
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- string d1 = colid[a].Split('~')[0];
|
|
|
- string d2 = colid[a].Split('~')[1];
|
|
|
- if (d2 == "MAX")
|
|
|
+ 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++)
|
|
|
{
|
|
|
- d2 = "999";
|
|
|
+ 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"];
|
|
|
+ }
|
|
|
}
|
|
|
- DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
|
|
|
- dr[colid[a]] = datas.Count();
|
|
|
+ m_bt_DBData.Rows.Add(dr);
|
|
|
}
|
|
|
- for (int a=0;a< AreaInformationOfAllElements.Rows.Count;a++)
|
|
|
+ }
|
|
|
+ else//选择颗粒(1)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < Partic_dt.Rows.Count; i++)
|
|
|
{
|
|
|
- if (dt.Rows[i]["TypeId"].ToString()== AreaInformationOfAllElements.Rows[a]["TypeId"].ToString())
|
|
|
+ DataRow dr = m_bt_DBData.NewRow();
|
|
|
+ dr["TypeName"] = Partic_dt.Rows[i]["TypeName"].ToString();
|
|
|
+ dr["TypeId"] = Partic_dt.Rows[i]["TypeId"].ToString();
|
|
|
+ dr["con"] = Partic_dt.Rows[i]["con"].ToString();
|
|
|
+ dr["Class"] = Partic_dt.Rows[i]["GroupName"].ToString();
|
|
|
+ dr["Largest"] = Math.Round(Convert.ToDouble(Partic_dt.Rows[i]["max"]), 2);
|
|
|
+ for (int a = 6; a < colid.Count; a++)
|
|
|
{
|
|
|
- dr["ar"] = AreaInformationOfAllElements.Rows[a]["ar"];
|
|
|
+ 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, Partic_dt.Rows[i]["TypeId"].ToString()));
|
|
|
+ dr[colid[a]] = datas.Count();
|
|
|
}
|
|
|
+ dr["ar"] = Partic_dt.Rows[i]["Area"];
|
|
|
+ m_bt_DBData.Rows.Add(dr);
|
|
|
}
|
|
|
- m_bt_DBData.Rows.Add(dr);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ private DataTable GetParticleListForParticlSize(DataTable data,DataTable table)
|
|
|
+ {
|
|
|
+ DataTable dt_Partick = new DataTable();
|
|
|
+ dt_Partick.Columns.Add("TypeId");
|
|
|
+ dt_Partick.Columns.Add("TypeName");
|
|
|
+ dt_Partick.Columns.Add("TypeColor");
|
|
|
+ dt_Partick.Columns.Add("con");
|
|
|
+ dt_Partick.Columns.Add("av");
|
|
|
+ dt_Partick.Columns.Add("max");
|
|
|
+ dt_Partick.Columns.Add("Area",typeof(double));
|
|
|
+ dt_Partick.Columns.Add("GroupName");
|
|
|
+ List<string> typeName = new List<string>();
|
|
|
+ for (int i=0;i<data.Rows.Count;i++)
|
|
|
+ {
|
|
|
+ typeName.Add(data.Rows[i]["TypeId"].ToString());
|
|
|
+ }
|
|
|
+ typeName = typeName.Distinct().ToList();
|
|
|
+
|
|
|
+ for (int i = 0; i < typeName.Count; i++)
|
|
|
+ {
|
|
|
+ DataTable dt = dt_Partick.Clone();
|
|
|
+ for (int j = 0; j < data.Rows.Count; j++)
|
|
|
+ {
|
|
|
+ if (typeName[i].ToString() == data.Rows[j]["TypeId"].ToString())
|
|
|
+ {
|
|
|
+ DataRow row = dt.NewRow();
|
|
|
+ row["TypeId"] = data.Rows[j]["TypeId"];
|
|
|
+ row["TypeName"] = data.Rows[j]["TypeName"];
|
|
|
+ row["TypeColor"] = data.Rows[j]["TypeColor"];
|
|
|
+ row["Area"] = data.Rows[j]["Area"];
|
|
|
+ dt.Rows.Add(row);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DataRow dr = dt_Partick.NewRow();
|
|
|
+ dr["TypeId"] = dt.Rows[0]["TypeId"].ToString();
|
|
|
+ dr["TypeName"] = dt.Rows[0]["TypeName"].ToString();
|
|
|
+ dr["TypeColor"] = dt.Rows[0]["TypeColor"].ToString();
|
|
|
+ dr["con"] = dt.Rows.Count;
|
|
|
+ dr["av"] = dt.Compute("min(Area)", "");
|
|
|
+ dr["max"] = dt.Compute("Max(Area)", "");
|
|
|
+ dr["Area"] = dt.Compute("SUM(Area)", "");
|
|
|
+ dt_Partick.Rows.Add(dr);
|
|
|
+ }
|
|
|
+ for (int i=0;i< dt_Partick.Rows.Count;i++)
|
|
|
+ {
|
|
|
+ for (int j=0;j< table.Rows.Count;j++)
|
|
|
+ {
|
|
|
+ if (dt_Partick.Rows[i]["TypeId"].ToString()== table.Rows[j]["TypeId"].ToString())
|
|
|
+ {
|
|
|
+ dt_Partick.Rows[i]["GroupName"] = table.Rows[j]["GroupName"];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return dt_Partick;
|
|
|
+ }
|
|
|
private DataTable InvalidRemoval(DataTable dt ,string str)
|
|
|
{
|
|
|
DataTable dataTable = dt.Copy();
|
|
@@ -263,387 +403,27 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// 颗粒列表中插入帧图,并带上颗粒分组信息
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public bool InsertReportTemplateTable_ParticlesGridDevidePage()
|
|
|
+
|
|
|
+ public bool InsertReportTemplateTable_ParticlesGridDevidePage_CleanlinessA(MBSZClass m_mbszclass)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
int serialNumber = 1;
|
|
|
//------------------加载模块,获取数据-------------------------------------------------
|
|
|
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.getSelectedIndex()].FilePath);
|
|
|
- DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(),"TypeName") ;
|
|
|
- //将颗粒大小排序(从大到小)
|
|
|
- DataView dv = dt.DefaultView;
|
|
|
- dv.Sort = "DMAX DESC";
|
|
|
- DataTable dt_ParticlesGridDevidePage = dv.ToTable();
|
|
|
-
|
|
|
- string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath;
|
|
|
- //------------------加载模块,获取数据结束----------------------------------------------
|
|
|
- #region 创建要插入数据库表结构
|
|
|
- //插入模板需父子表,结构
|
|
|
- //表名field_dt表:(父表) 帧图表
|
|
|
- DataTable DT_field_dt = new DataTable();
|
|
|
- DT_field_dt.TableName = "field_dt";
|
|
|
- DataColumn colpictid2 = new DataColumn("FieldId");
|
|
|
- colpictid2.DataType = typeof(int);
|
|
|
- DT_field_dt.Columns.Add(colpictid2);
|
|
|
- //图像列
|
|
|
- DataColumn colpict2 = new DataColumn("FieldImg");
|
|
|
- colpict2.DataType = System.Type.GetType("System.Byte[]");
|
|
|
- DT_field_dt.Columns.Add(colpict2);
|
|
|
-
|
|
|
- //表名Largest_frame表:(子表) 显示20条颗粒除外的部份颗粒信息
|
|
|
- DataTable DT_field_dt_copy = new DataTable();
|
|
|
- DataTable DT_Largest_frame = new DataTable();
|
|
|
- DT_Largest_frame.TableName = "Largest_frame";
|
|
|
- DT_Largest_frame.Columns.Add("pid");
|
|
|
- DT_Largest_frame.Columns.Add("Size");
|
|
|
- DT_Largest_frame.Columns.Add("Width");
|
|
|
- DT_Largest_frame.Columns.Add("DMAX");
|
|
|
- DT_Largest_frame.Columns.Add("DMIN");
|
|
|
- DT_Largest_frame.Columns.Add("Class");
|
|
|
- DT_Largest_frame.Columns.Add("ColName1");
|
|
|
- DT_Largest_frame.Columns.Add("ColName2");
|
|
|
- DT_Largest_frame.Columns.Add("ColName3");
|
|
|
- DT_Largest_frame.Columns.Add("ColName4");
|
|
|
- DT_Largest_frame.Columns.Add("ColName5");
|
|
|
- DT_Largest_frame.Columns.Add("ColName6");
|
|
|
- DT_Largest_frame.Columns.Add("ColVal1");
|
|
|
- DT_Largest_frame.Columns.Add("ColVal2");
|
|
|
- DT_Largest_frame.Columns.Add("ColVal3");
|
|
|
- DT_Largest_frame.Columns.Add("ColVal4");
|
|
|
- DT_Largest_frame.Columns.Add("ColVal5");
|
|
|
- DT_Largest_frame.Columns.Add("ColVal6");
|
|
|
- DataColumn colpictid = new DataColumn("FieldId");
|
|
|
- colpictid.DataType = typeof(int);
|
|
|
- DT_Largest_frame.Columns.Add(colpictid);
|
|
|
- //图像列
|
|
|
- DataColumn colpict = new DataColumn("p1");
|
|
|
- colpict.DataType = System.Type.GetType("System.Byte[]");
|
|
|
- DT_Largest_frame.Columns.Add(colpict);
|
|
|
-
|
|
|
- //largest20表:(无关系表) 需要显示前20条带有显示能谱图像的颗粒表
|
|
|
- DataTable DT_Largest20 = new DataTable();
|
|
|
- DT_Largest20.TableName = "Largest20";
|
|
|
- DT_Largest20.Columns.Add("pid");
|
|
|
- DT_Largest20.Columns.Add("Size");
|
|
|
- DT_Largest20.Columns.Add("Width");
|
|
|
- DT_Largest20.Columns.Add("DMAX");
|
|
|
- DT_Largest20.Columns.Add("DMIN");
|
|
|
- DT_Largest20.Columns.Add("Class");
|
|
|
- DT_Largest20.Columns.Add("ColName1");
|
|
|
- DT_Largest20.Columns.Add("ColName2");
|
|
|
- DT_Largest20.Columns.Add("ColName3");
|
|
|
- DT_Largest20.Columns.Add("ColName4");
|
|
|
- DT_Largest20.Columns.Add("ColName5");
|
|
|
- DT_Largest20.Columns.Add("ColName6");
|
|
|
- DT_Largest20.Columns.Add("ColVal1");
|
|
|
- DT_Largest20.Columns.Add("ColVal2");
|
|
|
- DT_Largest20.Columns.Add("ColVal3");
|
|
|
- DT_Largest20.Columns.Add("ColVal4");
|
|
|
- DT_Largest20.Columns.Add("ColVal5");
|
|
|
- DT_Largest20.Columns.Add("ColVal6");
|
|
|
- // 图像列
|
|
|
- DataColumn colpict_20ago = new DataColumn("p1");
|
|
|
- colpict_20ago.DataType = System.Type.GetType("System.Byte[]");
|
|
|
- DT_Largest20.Columns.Add(colpict_20ago);
|
|
|
- DataColumn colpict2_20ago = new DataColumn("p2");
|
|
|
- colpict2_20ago.DataType = System.Type.GetType("System.Byte[]");
|
|
|
- DT_Largest20.Columns.Add(colpict2_20ago);
|
|
|
- DataColumn colpict3_20ago = new DataColumn("p3");
|
|
|
- colpict3_20ago.DataType = System.Type.GetType("System.Byte[]");
|
|
|
- DT_Largest20.Columns.Add(colpict3_20ago);
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 插入20颗粒部份
|
|
|
-
|
|
|
- for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
|
|
|
+ DataTable SelectParticleTable = new DataTable();
|
|
|
+ SelectParticleData(out SelectParticleTable);
|
|
|
+ int sel = 0;
|
|
|
+ if (m_mbszclass.M_SY.int_xzkl == 0)
|
|
|
{
|
|
|
- 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();
|
|
|
- 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_fieldid == "-1")
|
|
|
- continue;
|
|
|
-
|
|
|
- if (serialNumber > 20)
|
|
|
- continue;
|
|
|
-
|
|
|
- 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, tempbit.Height, tempbit.Width);
|
|
|
- }
|
|
|
- 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_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"] = 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["DMAX"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmax"]), 2).ToString();
|
|
|
- dr["DMIN"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmin"]), 2).ToString();
|
|
|
- dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
|
|
|
-
|
|
|
- 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_Largest20.Rows.Add(dr);
|
|
|
- }
|
|
|
+ sel = 0;
|
|
|
}
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 插入-帧图图像部份
|
|
|
- List<string> vs = new List<string>();
|
|
|
- DataTable data = new DataTable();
|
|
|
- //首先生成标记颗粒的帧图图像文件
|
|
|
- DataTable dt_GridDevidePage = new DataTable();
|
|
|
- dt_GridDevidePage = dt_ParticlesGridDevidePage.Copy();
|
|
|
- dt_GridDevidePage.Clear();
|
|
|
- for (int i=0;i< dt_ParticlesGridDevidePage.Rows.Count;i++)
|
|
|
- {
|
|
|
- if (dt_ParticlesGridDevidePage.Rows[i]["TypeName"].ToString() != "Not Identified")
|
|
|
- {
|
|
|
- dt_GridDevidePage.Rows.Add(dt_ParticlesGridDevidePage.Rows[i].ItemArray);
|
|
|
- }
|
|
|
- }
|
|
|
- m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage.SaveMarkParticleRectangleOnFieldFile(str_resultPath,dt_GridDevidePage, out vs ,out data);
|
|
|
- string str_path_FIELD_FILES_MARK = str_resultPath + "\\FIELD_FILES_MARK\\";
|
|
|
- DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES_MARK);
|
|
|
- if (theFolder.Exists)
|
|
|
+ else
|
|
|
{
|
|
|
- for (int i=0;i<vs.Count;i++)
|
|
|
- {
|
|
|
- foreach (FileInfo nextifile in theFolder.GetFiles())
|
|
|
- {
|
|
|
- if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
|
|
|
- {
|
|
|
- //确认对应的帧图名
|
|
|
- string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
|
|
|
- if (str_fieldid==vs[i].ToString())
|
|
|
- {
|
|
|
- //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
|
|
|
- DataRow[] datarowlist = dt_GridDevidePage.Select(" fieldid = " + str_fieldid);
|
|
|
- if (datarowlist.Count() > 0)
|
|
|
- {
|
|
|
- Bitmap ls_bp_fieldmark = new Bitmap(nextifile.FullName);
|
|
|
- DataRow dr = DT_field_dt.NewRow();
|
|
|
- MemoryStream newms_bp_fieldmark = new MemoryStream();
|
|
|
- ls_bp_fieldmark.Save(newms_bp_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
|
|
|
- newms_bp_fieldmark.Seek(0, SeekOrigin.Begin);
|
|
|
- byte[] newarr_fieldmark = new byte[newms_bp_fieldmark.Length];
|
|
|
- newms_bp_fieldmark.Read(newarr_fieldmark, 0, newarr_fieldmark.Length);
|
|
|
- dr["FieldImg"] = newarr_fieldmark;
|
|
|
- dr["FieldId"] = str_fieldid;
|
|
|
- ls_bp_fieldmark.Dispose();
|
|
|
- DT_field_dt.Rows.Add(dr);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- DT_field_dt_copy = DT_field_dt.Copy();
|
|
|
+ sel = 1;
|
|
|
}
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 插入-帧图副表部分
|
|
|
- for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
|
|
|
- {
|
|
|
- if (dt_ParticlesGridDevidePage.Rows[i_row]["element"].ToString() == "")
|
|
|
- continue;
|
|
|
- //获取颗粒的fieldid,和particleid
|
|
|
- string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
|
|
|
- if (Convert.ToInt32(str_fieldid) < 20)
|
|
|
- {
|
|
|
-
|
|
|
- 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 != "")
|
|
|
- {
|
|
|
- //合并大颗粒
|
|
|
- //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
|
|
|
- {
|
|
|
- //正常颗粒
|
|
|
- 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["DMAX"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmax"]),2).ToString();
|
|
|
- dr["DMIN"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmin"]),2).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
|
|
|
- //FrameGraphParticleTable(dt_ParticlesGridDevidePage, str_resultPath, fielddata, DT_field_dt);
|
|
|
- m_list_dt.Add(DT_field_dt_copy);
|
|
|
- m_list_dt.Add(DT_Largest_frame);
|
|
|
- m_list_dt.Add(DT_Largest20);
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- public bool InsertReportTemplateTable_ParticlesGridDevidePage_CleanlinessA(MBSZClass m_mbszclass)
|
|
|
- {
|
|
|
-
|
|
|
- int serialNumber = 1;
|
|
|
- //------------------加载模块,获取数据-------------------------------------------------
|
|
|
- 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.getSelectedIndex()].FilePath);
|
|
|
- DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(), "TypeName");
|
|
|
+ //根据sql条件,查询获取颗粒信息数据
|
|
|
+ ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
|
|
|
+ DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel), "TypeName");
|
|
|
ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
|
|
|
string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
|
|
|
if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString()== "Hardness")
|
|
@@ -736,7 +516,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
//获取颗粒的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_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();
|
|
@@ -752,23 +532,23 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
if (serialNumber > 20)
|
|
|
continue;
|
|
|
|
|
|
- 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, tempbit.Height, tempbit.Width);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ //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, tempbit.Height, tempbit.Width);
|
|
|
+ //}
|
|
|
+ //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);
|
|
@@ -1022,7 +802,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
{
|
|
|
|
|
|
string str_particleid = dt.Rows[i_row]["particleid"].ToString();
|
|
|
- string str_subparticles = dt.Rows[i_row]["SubParticles"].ToString();
|
|
|
+ //string str_subparticles = dt.Rows[i_row]["SubParticles"].ToString();
|
|
|
string str_typeid = dt.Rows[i_row]["TypeId"].ToString();
|
|
|
string str_typename = dt.Rows[i_row]["TypeName"].ToString();
|
|
|
string str_element = dt.Rows[i_row]["Element"].ToString();
|
|
@@ -1031,19 +811,19 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
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 (str_subparticles != null && str_subparticles != "")
|
|
|
+ //{
|
|
|
|
|
|
- continue;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ // continue;
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
//正常颗粒
|
|
|
Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt.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.Rows[i_row]["FieldId"].ToString(), dt.Rows[i_row]["ParticleId"].ToString(), dt.Rows[i_row]["TypeId"].ToString() };
|
|
|
- }
|
|
|
+ //}
|
|
|
|
|
|
//获取该颗粒的xray能谱图像
|
|
|
System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
|
|
@@ -1118,13 +898,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// 向 模板设计器 中插入 颗粒尺寸表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public bool InsertReportTemplateTable_ParticleSizeGrid()
|
|
|
+ public bool InsertReportTemplateTable_ParticleSizeGrid(MBSZClass m_mbszclass)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
if (m_bt_DBData.Columns.Count==0)
|
|
|
{
|
|
|
- GetDBData();
|
|
|
+ GetDBData(m_mbszclass);
|
|
|
}
|
|
|
|
|
|
List<string> colid = new List<string>();
|
|
@@ -1365,13 +1145,22 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// 向 模板设计器 中插入 平均元素含量表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public bool InsertReportTemplateTable_ElementCompositionAvgGrid()
|
|
|
+ public bool InsertReportTemplateTable_ElementCompositionAvgGrid(MBSZClass m_mbszclass)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
//加载模块
|
|
|
ElementCompositionAvgGrid ls_elementcompositionavggrid = new ElementCompositionAvgGrid(m_otsreport_export.m_ReportApp);
|
|
|
ls_elementcompositionavggrid.Report = true;
|
|
|
+ if (m_mbszclass.M_SY.int_xzkl == 0)
|
|
|
+ {
|
|
|
+ ls_elementcompositionavggrid.ParticleRange = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ls_elementcompositionavggrid.ParticleRange = false;
|
|
|
+ }
|
|
|
+
|
|
|
m_otsreport_export.panel_container.Controls.Clear();
|
|
|
m_otsreport_export.panel_container.Controls.Add(ls_elementcompositionavggrid);
|
|
|
|
|
@@ -1502,11 +1291,11 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public bool InsertReportTemplateTable_ElementAvgGrid()
|
|
|
+ public bool InsertReportTemplateTable_ElementAvgGrid(MBSZClass m_mbszclass)
|
|
|
{
|
|
|
if (m_bt_DBData.Columns.Count == 0)
|
|
|
{
|
|
|
- GetDBData();
|
|
|
+ GetDBData(m_mbszclass);
|
|
|
}
|
|
|
|
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
@@ -1536,11 +1325,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
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自定义列表进行排序,大类中的小类元素信息按照面积从大到小排序
|
|
@@ -2065,7 +1850,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
#endregion
|
|
|
|
|
|
#region 插入大分类夹杂物面积比图
|
|
|
- public bool InsertReportTemplateChart_InclusionAreaClassRatio(string a_GraphicStyle)
|
|
|
+ public bool InsertReportTemplateChart_InclusionAreaClassRatio(string a_GraphicStyle, MBSZClass m_mbszclass)
|
|
|
{
|
|
|
//加载模块
|
|
|
m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition = new EChart_ParticlesComposition(m_otsreport_export.m_ReportApp, "InclusionareaClassRatio");
|
|
@@ -2074,6 +1859,15 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
m_otsreport_export.m_ReportApp.timerKG = true;
|
|
|
//string str = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FileName;
|
|
|
m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.Report = true;
|
|
|
+ if (m_mbszclass.M_SY.int_xzkl==0)
|
|
|
+ {
|
|
|
+ m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = false; ;
|
|
|
+ }
|
|
|
+
|
|
|
m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition);
|
|
|
|
|
|
//弹出加载图片窗体
|
|
@@ -2108,7 +1902,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
}
|
|
|
#endregion
|
|
|
#region 插入夹杂物面积比图
|
|
|
- public bool InsertReportTemplateChart_InclusionAreaRatio(string a_GraphicStyle)
|
|
|
+ public bool InsertReportTemplateChart_InclusionAreaRatio(string a_GraphicStyle, MBSZClass m_mbszclass)
|
|
|
{
|
|
|
//加载模块
|
|
|
m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition = new EChart_ParticlesComposition(m_otsreport_export.m_ReportApp, "InclusionareaRatio");
|
|
@@ -2116,6 +1910,14 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
m_otsreport_export.m_ReportApp.type = a_GraphicStyle;
|
|
|
m_otsreport_export.m_ReportApp.timerKG = true;
|
|
|
m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.Report = true;
|
|
|
+ if (m_mbszclass.M_SY.int_xzkl == 0)
|
|
|
+ {
|
|
|
+ m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = false; ;
|
|
|
+ }
|
|
|
m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition);
|
|
|
|
|
|
//弹出加载图片窗体
|
|
@@ -2335,23 +2137,24 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// </summary>
|
|
|
/// <param name="selectindex"></param>
|
|
|
/// <returns></returns>
|
|
|
- private byte[] GetByte_InsertReportTemplateChart_Trianglediagram(int selectindex)
|
|
|
+ private byte[] GetByte_InsertReportTemplateChart_Trianglediagram(int selectindex, MBSZClass m_mbszclass)
|
|
|
{
|
|
|
byte[] newarr = new byte[0];
|
|
|
|
|
|
|
|
|
//加载模块
|
|
|
- //m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram = new EChart_Trianglediagram(m_otsreport_export.m_ReportApp, TemplateList[selectindex]);
|
|
|
- //m_otsreport_export.m_ReportApp.timerKG = true;
|
|
|
- //m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram.condition = m_otsreport_export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs;
|
|
|
- //m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram.Report = true;
|
|
|
- //m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram);
|
|
|
-
|
|
|
-
|
|
|
|
|
|
EChart_Trianglediagram eChart_Trianglediagram= new EChart_Trianglediagram(m_otsreport_export.m_ReportApp, TemplateList[selectindex]);
|
|
|
m_otsreport_export.m_ReportApp.timerKG = true;
|
|
|
eChart_Trianglediagram.condition = m_otsreport_export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs;
|
|
|
+ if(m_mbszclass.M_SY.int_xzkl==0)
|
|
|
+ {
|
|
|
+ eChart_Trianglediagram.ParticleRange = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ eChart_Trianglediagram.ParticleRange = false;
|
|
|
+ }
|
|
|
eChart_Trianglediagram.Report = true;
|
|
|
m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(eChart_Trianglediagram);
|
|
|
|
|
@@ -2395,31 +2198,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
/// 向 模板设计器 中插入 三元相图
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public bool InsertReportTemplateChart_Trianglediagram()
|
|
|
+ public bool InsertReportTemplateChart_Trianglediagram(MBSZClass m_mbszclass)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- ////创建二进制列的数据表,循环插入三元选择的模板
|
|
|
- //DataTable dt_pic = GetPicDataTable_PicSYXT2T();
|
|
|
- //List<byte[]> lt_by = new List<byte[]>();
|
|
|
- //for (int i = 0; i < m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index.Count; i ++)
|
|
|
- //{
|
|
|
- // byte[] newarr, newarr2;
|
|
|
- // newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i]);
|
|
|
- // lt_by.Add(newarr);
|
|
|
-
|
|
|
- // newarr2 = null;
|
|
|
- // DataRow dr = dt_pic.NewRow();
|
|
|
- // dr["pict"] = newarr;//图像二进制
|
|
|
- // dr["pict2"] = newarr2;//图像二进制
|
|
|
- // dt_pic.Rows.Add(dr);
|
|
|
- //}
|
|
|
- //if (lt_by.GroupBy(i => i).Where(g => g.Count() > 1).Count() >= 1)
|
|
|
- //{
|
|
|
- // MessageBox.Show("图片重复");
|
|
|
- //}
|
|
|
-
|
|
|
-
|
|
|
//创建二进制列的数据表,循环插入三元选择的模板
|
|
|
DataTable ls_dt = GetPicDataTable_PicSYXT2T();
|
|
|
DataTable ls_dt3t = GetPicDataTable_PicSYXT3T();
|
|
@@ -2430,8 +2212,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
for (int i = 0; i < m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index.Count; i = i + 2)
|
|
|
{
|
|
|
byte[] newarr, newarr2;
|
|
|
- newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i]);
|
|
|
- newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1]);
|
|
|
+ newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i], m_mbszclass);
|
|
|
+ newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1], m_mbszclass);
|
|
|
|
|
|
DataRow dr = ls_dt.NewRow();
|
|
|
dr["pict"] = newarr;//图像二进制
|
|
@@ -2452,9 +2234,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
|
|
|
for (int i = 0; i < m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index.Count; i = i + 3)
|
|
|
{
|
|
|
byte[] newarr, newarr2, newarr3;
|
|
|
- newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i]);
|
|
|
- newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1]);
|
|
|
- newarr3 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 2]);
|
|
|
+ newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i], m_mbszclass);
|
|
|
+ newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1], m_mbszclass);
|
|
|
+ newarr3 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 2], m_mbszclass);
|
|
|
|
|
|
DataRow dr = ls_dt3t.NewRow();
|
|
|
dr["pict"] = newarr;//图像二进制
|