|
@@ -13,6 +13,8 @@ using System.IO;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
+using System.Windows.Forms;
|
|
|
|
+using System.Windows.Media;
|
|
using static OTSDataType.otsdataconst;
|
|
using static OTSDataType.otsdataconst;
|
|
using static OTSIncAReportApp.OTSReport_Export;
|
|
using static OTSIncAReportApp.OTSReport_Export;
|
|
|
|
|
|
@@ -37,7 +39,10 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
|
|
ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
|
|
DataTable btb = InvalidRemoval(fielddata.GetIncaSurfaceData(m_mbszclass.M_KLLBXX.list_str_kllb_qcys));
|
|
DataTable btb = InvalidRemoval(fielddata.GetIncaSurfaceData(m_mbszclass.M_KLLBXX.list_str_kllb_qcys));
|
|
- DataTable dt;
|
|
|
|
|
|
+
|
|
|
|
+ //DataTable particles = fielddata.GetSplicingParticlesData();
|
|
|
|
+
|
|
|
|
+ DataTable dt;
|
|
|
|
|
|
if (m_mbszclass.list_str_MainPriority_Serial.Count == 0)
|
|
if (m_mbszclass.list_str_MainPriority_Serial.Count == 0)
|
|
{
|
|
{
|
|
@@ -209,7 +214,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
|
|
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"]) };
|
|
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);
|
|
Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
|
|
Bitmap bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
Bitmap bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
|
|
- bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, Color.White);
|
|
|
|
|
|
+ bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, System.Drawing.Color.White);
|
|
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() };
|
|
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能谱图像
|
|
//获取该颗粒的xray能谱图像
|
|
DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);
|
|
DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);
|
|
@@ -219,7 +224,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
|
|
Bitmap ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
|
|
Bitmap ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
|
|
DataTable SegmentData = fielddata.GetSegment();
|
|
DataTable SegmentData = fielddata.GetSegment();
|
|
Bitmap BinaryParticles= ImageSplicer.ParticleBinaryDiagram(SegmentData, Convert.ToInt32(str_fieldid), Convert.ToInt32(str_particleid));
|
|
Bitmap BinaryParticles= ImageSplicer.ParticleBinaryDiagram(SegmentData, Convert.ToInt32(str_fieldid), Convert.ToInt32(str_particleid));
|
|
- Bitmap BP= imageProcessor.ResizeImageWithPadding(BinaryParticles, 120, 120, Color.White);
|
|
|
|
|
|
+ Bitmap BP= imageProcessor.ResizeImageWithPadding(BinaryParticles, 120, 120, System.Drawing.Color.White);
|
|
//获取该颗粒的二次放大处理图像
|
|
//获取该颗粒的二次放大处理图像
|
|
//Bitmap ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
|
|
//Bitmap ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
|
|
//再将图像转成二进制流-------------------------------------------------------------------
|
|
//再将图像转成二进制流-------------------------------------------------------------------
|
|
@@ -298,13 +303,71 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
|
|
return DT_Largest20;
|
|
return DT_Largest20;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 颗粒列表帧图
|
|
|
|
|
|
+ /// 拼接颗粒
|
|
/// </summary>
|
|
/// </summary>
|
|
- /// <param name="m_mbszclass"></param>
|
|
|
|
- /// <param name="file_pic"></param>
|
|
|
|
- /// <param name="list_dt"></param>
|
|
|
|
- /// <param name="m_otsreport_export"></param>
|
|
|
|
- public void Get_dev_kllb_data_frame(c_TemplateClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt, OTSReport_Export m_otsreport_export,DataTable FrameData)
|
|
|
|
|
|
+ public DataTable GetSplicingParticlesData(OTSReport_Export m_otsreport_export)
|
|
|
|
+ {
|
|
|
|
+ DataTable SplicingParticlesData = new DataTable();
|
|
|
|
+ SplicingParticlesData.Columns.Add("image",typeof(Bitmap));
|
|
|
|
+ SplicingParticlesData.Columns.Add("TypeName");
|
|
|
|
+ SplicingParticlesData.Columns.Add("Area");
|
|
|
|
+ SplicingParticlesData.Columns.Add("ECD");
|
|
|
|
+ SplicingParticlesData.Columns.Add("DiameterRatio");
|
|
|
|
+ SplicingParticlesData.Columns.Add("DPERP");
|
|
|
|
+
|
|
|
|
+ //根据sql条件,查询获取颗粒信息数据
|
|
|
|
+ ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
|
|
|
|
+ DataTable particles = fielddata.GetSplicingParticlesData();
|
|
|
|
+ if (particles.Rows.Count == 0)
|
|
|
|
+ {
|
|
|
|
+ return SplicingParticlesData;
|
|
|
|
+ }
|
|
|
|
+ ResultFile result = null;
|
|
|
|
+ string sou = m_otsreport_export.m_ReportApp.m_conditionChoose.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
|
|
|
|
+ if (sou.Contains("+"))
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show("This function does not support multiple samples!");
|
|
|
|
+ result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[0];
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ result = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)];
|
|
|
|
+ }
|
|
|
|
+ ParticleData Particledata = new ParticleData(result.FilePath);
|
|
|
|
+ string filePath = result.FilePath + "\\FIELD_FILES\\";
|
|
|
|
+ for (int i = 0; i < particles.Rows.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
|
|
|
|
+ if (FieldImage.Key != particles.Rows[i]["fieldid"].ToString() || FieldImage.Value == null)
|
|
|
|
+ {
|
|
|
|
+ string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
|
|
|
|
+ FieldImage = new KeyValuePair<string, Bitmap>(particles.Rows[i]["fieldid"].ToString(), Particledata.ReadImageFile(imagePath));
|
|
|
|
+ }
|
|
|
|
+ Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particles.Rows[i]["RectLeft"]), Y = Convert.ToInt32(particles.Rows[i]["RectTop"]), Width = Convert.ToInt32(particles.Rows[i]["RectWidth"]), Height = Convert.ToInt32(particles.Rows[i]["RectHeight"]) };
|
|
|
|
+ Bitmap bmap = Particledata.GetBitmapByParticle(FieldImage.Value, rectangle);
|
|
|
|
+ bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString(), particles.Rows[i]["XrayId"].ToString() };
|
|
|
|
+ DataRow row = SplicingParticlesData.NewRow();
|
|
|
|
+ row["image"] = bmap;
|
|
|
|
+ row["TypeName"] = particles.Rows[i]["TypeName"];
|
|
|
|
+ row["Area"] = particles.Rows[i]["Area"];
|
|
|
|
+ row["ECD"] = (Convert.ToDouble(particles.Rows[i]["Area"]) / Math.PI) * 2;
|
|
|
|
+ row["DiameterRatio"] = Convert.ToDouble(particles.Rows[i]["DMAX"]) / Convert.ToDouble(particles.Rows[i]["DMIN"]);
|
|
|
|
+ row["DPERP"] = particles.Rows[i]["DPERP"];
|
|
|
|
+ SplicingParticlesData.Rows.Add(row);
|
|
|
|
+ }
|
|
|
|
+ return SplicingParticlesData;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 颗粒列表帧图
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="m_mbszclass"></param>
|
|
|
|
+ /// <param name="file_pic"></param>
|
|
|
|
+ /// <param name="list_dt"></param>
|
|
|
|
+ /// <param name="m_otsreport_export"></param>
|
|
|
|
+ public void Get_dev_kllb_data_frame(c_TemplateClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt, OTSReport_Export m_otsreport_export,DataTable FrameData)
|
|
{
|
|
{
|
|
m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
|
|
m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
|
|
//根据sql条件,查询获取颗粒信息数据
|
|
//根据sql条件,查询获取颗粒信息数据
|