|
|
@@ -2,6 +2,9 @@
|
|
|
using OTSCommon;
|
|
|
using OTSCommon.DBOperate;
|
|
|
using OTSCommon.DBOperate.Model;
|
|
|
+using OTSIncAReportApp._2_CommonFunction.CommonClass;
|
|
|
+using OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess;
|
|
|
+using OTSIncAReportApp.DataOperation.DataAccess;
|
|
|
using OTSIncAReportApp.OTSRstMgrFunction;
|
|
|
using OTSIncAReportGraph.Class;
|
|
|
using OTSIncAReportGrids.OTSIncAReportGridsFuncation;
|
|
|
@@ -35,9 +38,17 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
//底层操作类
|
|
|
SEMAndEDSOperate m_OTSIncAReportGridsFun = null;
|
|
|
frmReportApp m_ReportApp;
|
|
|
+ public ParticleData Particledata;
|
|
|
+ public UserSTDDbAccess userSTDDb;
|
|
|
+ public FieldImage fldImgAccess;
|
|
|
+ public ResultFile _result = null;
|
|
|
|
|
|
|
|
|
- public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, List<string> RenameInfo,frmReportApp ReportApp)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, List<string> RenameInfo,frmReportApp ReportApp)
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
_particlesGridDevidePage = particlesGridDevidePage;
|
|
|
@@ -46,8 +57,9 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
_RenameInfo = RenameInfo;
|
|
|
m_ReportApp = ReportApp;
|
|
|
m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
|
|
|
-
|
|
|
-
|
|
|
+ _result= particlesGridDevidePage.result;
|
|
|
+ fldImgAccess = new FieldImage(_result.FilePath);
|
|
|
+ Particledata = new ParticleData(_result.FilePath);
|
|
|
//设置窗体的双缓冲,以保证大数据时拖动不卡
|
|
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
this.UpdateStyles();
|
|
|
@@ -84,12 +96,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
{
|
|
|
this.Cursor = Cursors.WaitCursor;
|
|
|
particlesAll = ObtainSourceOfSimilarParticles();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- DataTable elementchemistry = _particlesGridDevidePage.Particledata.GetElementChemistry();
|
|
|
+ DataTable elementchemistry = Particledata.GetElementChemistry();
|
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
{
|
|
|
string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
|
|
|
@@ -102,7 +109,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
particlesAll.Rows[i]["Element"] = ConcatenatedString;
|
|
|
}
|
|
|
particlesAll.Columns.Add("SimilarRatio", typeof(double));
|
|
|
- DataTable XRayData = _particlesGridDevidePage.Particledata.GetXRayData();
|
|
|
+ DataTable XRayData = Particledata.GetXRayData();
|
|
|
particlesAll.Columns.Add("XRayDataCount");
|
|
|
particles = particlesAll.Clone();
|
|
|
for (int i = 0; i < particlesAll.Rows.Count; i++)
|
|
|
@@ -137,7 +144,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
{
|
|
|
DataRow dgvr = particlesAll.Rows[i];
|
|
|
uint[] Search_xray = new uint[2000];
|
|
|
- _particlesGridDevidePage.Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Search_xray, out Analysis_xray);
|
|
|
+ Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr["particleId"]), Convert.ToInt32(dgvr["fieldid"]), out Search_xray, out Analysis_xray);
|
|
|
uint xraycount = 0;
|
|
|
for (int j = 0; j < 2000; j++)
|
|
|
{
|
|
|
@@ -216,7 +223,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
dgV_SimilarParticles.Rows.Clear();
|
|
|
dgV_SimilarParticles.Columns.Clear();
|
|
|
string str_DefaultComputedColName = "", str_ElementsColName = "";
|
|
|
- DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
|
|
|
+ DataSet ds = OTSCommon.XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
|
|
|
DataTable dt = ds.Tables["Member"];
|
|
|
foreach (DataRow element in dt.Rows)
|
|
|
{
|
|
|
@@ -374,14 +381,12 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
Bitmap bmap = null;
|
|
|
if (subt != null && subt != "" && subt != "IsSubParticle")
|
|
|
{
|
|
|
- double xs = _particlesGridDevidePage.result.GetPixelSize();
|
|
|
- int width = _particlesGridDevidePage.result.GetImageWidth();
|
|
|
- int height = _particlesGridDevidePage.result.GetImageHeight();
|
|
|
-
|
|
|
-
|
|
|
+ double xs = 1/_result.GetPixelSize();
|
|
|
+ int width = _result.GetImageWidth();
|
|
|
+ int height = _result.GetImageHeight();
|
|
|
string vs = "," + subt.Replace(':', '-') + ",";
|
|
|
- DataTable dataTable = _particlesGridDevidePage.Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
|
|
|
- bmap = _particlesGridDevidePage.fldImgAccess.GetBitmapForMergedParticle(subt, xs, _particlesGridDevidePage.result.FilePath, height, width, dataTable);
|
|
|
+ DataTable dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
|
|
|
+ bmap = fldImgAccess.GetBitmapForMergedParticle(subt, xs, height, width, dataTable);
|
|
|
if (bmap != null)
|
|
|
{
|
|
|
string[] str = subt.Split(',');
|
|
|
@@ -392,13 +397,11 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
{
|
|
|
if (!fieldpics.Keys.Contains(particles.Rows[i]["fieldid"].ToString()))
|
|
|
{
|
|
|
- string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
|
|
|
-
|
|
|
-
|
|
|
- fieldpics.Add(particles.Rows[i]["fieldid"].ToString(), _particlesGridDevidePage.fldImgAccess.ReadImageFile(imagePath));
|
|
|
+ string imagePath = "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
|
|
|
+ fieldpics.Add(particles.Rows[i]["fieldid"].ToString(), fldImgAccess.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"]) };
|
|
|
- bmap = _particlesGridDevidePage.fldImgAccess.GetBitmapByParticle(fieldpics[particles.Rows[i]["fieldid"].ToString()], rectangle);
|
|
|
+ bmap = fldImgAccess.CapturePic(fieldpics[particles.Rows[i]["fieldid"].ToString()], rectangle);
|
|
|
bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString() };
|
|
|
dgV_SimilarParticles.Rows[add_rowindex].Height = bmap.Height + 20;
|
|
|
}
|
|
|
@@ -427,9 +430,10 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
{
|
|
|
dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(num, 5);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(num, 2);}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dgV_SimilarParticles.Rows[add_rowindex].Cells[k].Value = Math.Round(num, 2);
|
|
|
+ }
|
|
|
}
|
|
|
else if (enl.Current.Key == "Element")
|
|
|
{
|
|
|
@@ -598,11 +602,11 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
ints.Add(i_ls_fieldid);
|
|
|
ints.Add(i_ls_particleid);
|
|
|
|
|
|
- var cmd = _particlesGridDevidePage.Particledata.GetUpdataAIncACmd(ints, _RenameInfo);
|
|
|
+ var cmd = Particledata.GetUpdataAIncACmd(ints, _RenameInfo);
|
|
|
cmdlist.Add(cmd);
|
|
|
}
|
|
|
}
|
|
|
- _particlesGridDevidePage.Particledata.ExecuteNonQueryBatch(cmdlist);
|
|
|
+ Particledata.ExecuteNonQueryBatch(cmdlist);
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
this.Close();
|
|
|
}
|
|
|
@@ -643,7 +647,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
dt_ClassifySTD.Columns.Add("GroupName");
|
|
|
dt_ClassifySTD.Columns.Add("GroupColor");
|
|
|
|
|
|
- DataTable da = _particlesGridDevidePage.Particledata.GetParticleListForParticlSizeID("area", "");
|
|
|
+ DataTable da = Particledata.GetParticleListForParticlSizeID("area", "");
|
|
|
for (int i = 0; i < da.Rows.Count; i++)
|
|
|
{
|
|
|
if (Convert.ToInt64(da.Rows[i]["TypeId"]) > 9)
|
|
|
@@ -722,7 +726,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
|
|
|
DataTable ObtainSourceOfSimilarParticles()
|
|
|
{
|
|
|
- return _particlesGridDevidePage.Particledata.GetInfoForPartucleDevidePage_allParticles("");
|
|
|
+ return Particledata.GetInfoForPartucleDevidePage_allParticles("");
|
|
|
}
|
|
|
|
|
|
private void btn_Cannnel_Click(object sender, EventArgs e)
|
|
|
@@ -751,7 +755,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
string subt = row["SubParticles"].ToString();
|
|
|
if (subt != "" && subt != null)
|
|
|
{
|
|
|
- particle = _particlesGridDevidePage.Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray);
|
|
|
+ particle = Particledata.GetXrayByParticleTagIDAndFieldID_ForMergeParticle(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray);
|
|
|
list_celementchemistryclr = particle.ElementList;
|
|
|
}
|
|
|
else
|
|
|
@@ -759,7 +763,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
particle = _particlesGridDevidePage.ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
|
|
|
}
|
|
|
|
|
|
- List<OTSIncAReportGraph.Controls.ShowElementInfo> list_showelementinfo = _particlesGridDevidePage.Particledata.GetShowElementInfos_ForMergeParticle(list_celementchemistryclr);
|
|
|
+ List<OTSIncAReportGraph.Controls.ShowElementInfo> list_showelementinfo = Particledata.GetShowElementInfos_ForMergeParticle(list_celementchemistryclr);
|
|
|
string str_IncAName = "";
|
|
|
str_IncAName = Convert.ToString(dgvr.Cells[2].Value);
|
|
|
if (particle == null)
|
|
|
@@ -773,32 +777,39 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
control_XRayTable1.MaterialName = str_IncAName;
|
|
|
control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
|
|
|
|
|
|
+ DataTable dataTable = new DataTable();
|
|
|
+ double xs = 1 / _result.GetPixelSize();
|
|
|
+ int width = _result.GetImageWidth();
|
|
|
+ int height = _result.GetImageHeight();
|
|
|
+ Dictionary<string, List<Segment>> segsData = new Dictionary<string, List<Segment>>();
|
|
|
+
|
|
|
if (subt == "" || subt == null)
|
|
|
{
|
|
|
- Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(particle.RectLeft), Y = Convert.ToInt32(particle.RectTop), Width = Convert.ToInt32(particle.RectWidth), Height = Convert.ToInt32(particle.RectHeight) };
|
|
|
- Bitmap dpImage = _particlesGridDevidePage.ReportFun.GetBlackAndWhiteImage(particle);
|
|
|
- string filePath = _particlesGridDevidePage.result.FilePath + "\\FIELD_FILES\\";
|
|
|
- string imagePath = filePath + "Field" + dgvr.Cells["fieldid"].Value.ToString() + ".bmp";
|
|
|
- Bitmap m_originalImage = DrawFunction.ReadImageFile(imagePath);
|
|
|
- Bitmap bmap = _particlesGridDevidePage.fldImgAccess.GetBitmapByParticle(dpImage, rectangle);
|
|
|
- Bitmap bmap1 = _particlesGridDevidePage.fldImgAccess.GetBitmapByParticle(m_originalImage, rectangle);
|
|
|
- control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
|
|
|
- Invalidate();
|
|
|
+ int fldid = Convert.ToInt32(dgvr.Cells["fieldid"].Value);
|
|
|
+ int partid = Convert.ToInt32(dgvr.Cells["particleId"].Value);
|
|
|
+ var listseg = Particledata.GetSegmentData(fldid, partid);
|
|
|
+ string key = fldid.ToString() + "_" + partid.ToString();
|
|
|
+ segsData.Add(key, listseg);
|
|
|
+ dataTable = particles.Clone();
|
|
|
+ dataTable.ImportRow(row);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- double xs = _particlesGridDevidePage.result.GetPixelSize();
|
|
|
- int width = _particlesGridDevidePage.result.GetImageWidth();
|
|
|
- int height = _particlesGridDevidePage.result.GetImageHeight();
|
|
|
- int fldid = Convert.ToInt32(dgvr.Cells["fieldid"].Value);
|
|
|
- int partid = Convert.ToInt32(dgvr.Cells["particleId"].Value);
|
|
|
- var listseg = _particlesGridDevidePage.Particledata.GetSegmentData(fldid, partid);
|
|
|
string vs = "," + subt.Replace(':', '-') + ",";
|
|
|
- DataTable dataTable = _particlesGridDevidePage.Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
|
|
|
- Bitmap bp = _particlesGridDevidePage.fldImgAccess.GetBitmapForBigBlackAndWhiteImage(subt, xs, _particlesGridDevidePage.result.FilePath, height, width,dataTable,listseg);
|
|
|
- control_XRayTable1.SetBitmapOfPictureBox(ls_bp, bp);
|
|
|
- Invalidate();
|
|
|
+ dataTable = Particledata.GetParticleAllForBig(vs);//组成拼接颗粒的子颗粒
|
|
|
+ foreach (DataRow dow in dataTable.Rows)
|
|
|
+ {
|
|
|
+ int fldid = Convert.ToInt32(dow["fieldid"]);
|
|
|
+ int partid = Convert.ToInt32(dow["particleId"]);
|
|
|
+ var listseg = Particledata.GetSegmentData(fldid, partid);
|
|
|
+ string key = dow["fieldid"].ToString() + "_" + dow["particleid"].ToString();
|
|
|
+ segsData.Add(key, listseg);
|
|
|
+ }
|
|
|
}
|
|
|
+ Bitmap bmap = fldImgAccess.GetBitmapForParticleAll(subt, dataTable, xs, height, width);
|
|
|
+ Bitmap bmap1 = fldImgAccess.GetBitmapForParticleAllWithBlackAndWhite(subt, dataTable, segsData, xs, height, width);
|
|
|
+ control_XRayTable1.SetBitmapOfPictureBox(bmap1, bmap);
|
|
|
+ Invalidate();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -928,6 +939,9 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
|
|
|
table = particlesGridDevidePage.table;
|
|
|
m_ReportApp = ReportApp;
|
|
|
m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
|
|
|
+ _result = particlesGridDevidePage.result;
|
|
|
+ fldImgAccess = new FieldImage(_result.FilePath);
|
|
|
+ Particledata = new ParticleData(_result.FilePath);
|
|
|
|
|
|
|
|
|
//设置窗体的双缓冲,以保证大数据时拖动不卡
|