|
@@ -664,14 +664,12 @@ namespace OTSIncAReportGrids
|
|
|
keyValues.Add("ParticleImage", table["str5"].ToString());
|
|
|
keyValues.Add("FieldId", "FieldId");
|
|
|
keyValues.Add("ParticleId", "ParticleId");
|
|
|
- keyValues.Add("SEMPosX", "SEMPosX");
|
|
|
- keyValues.Add("SEMPosY", "SEMPosY");
|
|
|
for (int i = 0; i < strs.Count(); i++)
|
|
|
{
|
|
|
if (strs[i] == "ParticleCoordinate")
|
|
|
{
|
|
|
- keyValues.Add("PosX", "PosX");
|
|
|
- keyValues.Add("PosY", "PosY");
|
|
|
+ keyValues.Add("AbPosX", "PosX");
|
|
|
+ keyValues.Add("AbPosY", "PosY");
|
|
|
}
|
|
|
if (strs[i] == "Area")
|
|
|
{
|
|
@@ -927,6 +925,12 @@ namespace OTSIncAReportGrids
|
|
|
dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = particles.Rows[i]["Hardness"].ToString();
|
|
|
}
|
|
|
}
|
|
|
+ if (enl.Current.Key == "AbPosX")
|
|
|
+ {
|
|
|
+ Point point = CalculateParticleCenterPosition(resultFile, new Point(Convert.ToInt32(particles.Rows[i]["SEMPosX"]), Convert.ToInt32(particles.Rows[i]["SEMPosY"])), new Point(Convert.ToInt32(particles.Rows[i]["PosX"]), Convert.ToInt32(particles.Rows[i]["PosY"])));
|
|
|
+ dgV_ParticlesDevidePage.Rows[add_rowindex].Cells["AbPosX"].Value = point.X;
|
|
|
+ dgV_ParticlesDevidePage.Rows[add_rowindex].Cells["AbPosY"].Value = point.Y;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -987,6 +991,47 @@ namespace OTSIncAReportGrids
|
|
|
dgV_ParticlesDevidePage.RowsDefaultCellStyle.BackColor = Color.Azure;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 计算颗粒中心的电镜坐标
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="resultFile"></param>
|
|
|
+ /// <param name="SEMPos"></param>
|
|
|
+ /// <param name="ParticlePos"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static Point CalculateParticleCenterPosition(ResultFile resultFile, Point SEMPos, Point ParticlePos)
|
|
|
+ {
|
|
|
+ Point point = new Point();
|
|
|
+ Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)resultFile.ResultInfo["Sample"])["Members"]);
|
|
|
+ Dictionary<string, object> imageScanParam = (Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)sampleMembers["MsrParams"])["Members"])["ImageScanParam"];
|
|
|
+ Dictionary<string, object> SEMDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
|
|
|
+ Dictionary<string, object> SEMStageData = (Dictionary<string, object>)resultFile.ResultInfo["SEMStageData"];
|
|
|
+ float ScanFieldSizeX = float.Parse(SEMDataMsr["ScanFieldSize"].ToString());
|
|
|
+ string leftOrRight = SEMStageData["xAxisDir"].ToString().Split(':')[1];
|
|
|
+ string downOrUp = SEMStageData["yAxisDir"].ToString().Split(':')[1];
|
|
|
+ string ImageResolution = imageScanParam["ImageResolution"].ToString();
|
|
|
+ int width = int.Parse(ImageResolution.Split('_')[1]);
|
|
|
+ int height = int.Parse(ImageResolution.Split('_')[2]);
|
|
|
+ float ScanFieldSizeY = ScanFieldSizeX * height / width;
|
|
|
+ float m_pixelSize = ScanFieldSizeX / width;
|
|
|
+ if (leftOrRight == "RIGHT_TOWARD")
|
|
|
+ {
|
|
|
+ point.X = (int)(SEMPos.X - ScanFieldSizeX / 2 + ParticlePos.X * m_pixelSize);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ point.X = (int)(SEMPos.X + ScanFieldSizeX / 2 - ParticlePos.X * m_pixelSize);
|
|
|
+ }
|
|
|
+ if (downOrUp == "UP_TOWARD")
|
|
|
+ {
|
|
|
+ point.Y = (int)(SEMPos.Y + ScanFieldSizeY / 2 - ParticlePos.Y * m_pixelSize);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ point.Y = (int)(SEMPos.Y - ScanFieldSizeY / 2 + ParticlePos.Y * m_pixelSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ return point;
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 相关事件
|
|
@@ -1261,9 +1306,9 @@ namespace OTSIncAReportGrids
|
|
|
{
|
|
|
m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
|
|
|
}
|
|
|
-
|
|
|
+ Point point = CalculateParticleCenterPosition(resultFile, new Point(particle.SEMPosX, particle.SEMPosY), new Point(particle.PosX, particle.PosY));
|
|
|
//改为线程调用,先判断线程状态
|
|
|
- m_mythread.Start(new Point(particle.SEMPosX, particle.SEMPosY));
|
|
|
+ m_mythread.Start(point);
|
|
|
|
|
|
}
|
|
|
|