|
@@ -768,7 +768,7 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//执行自动对焦
|
|
|
- public bool ImageFocus()
|
|
|
+ public bool ImageFocus(String step_code)
|
|
|
{
|
|
|
if (m_measureFile.MParam.FocusMode == 1)//手动
|
|
|
{
|
|
@@ -788,11 +788,18 @@ namespace MeasureThread
|
|
|
{
|
|
|
Directory.Delete(focus_path, true);
|
|
|
}
|
|
|
- Thread.Sleep(5000);
|
|
|
+ Thread.Sleep(3000);
|
|
|
+ arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ arg.Picture_Information.Magnification = iSEM.GetMagnification();
|
|
|
+ Thread.Sleep(1000);
|
|
|
+
|
|
|
+ //再创建文件夹
|
|
|
Directory.CreateDirectory(focus_path);
|
|
|
+
|
|
|
//1、对焦参数类,2、输出工作距离
|
|
|
int wd = 0;
|
|
|
- AutoFocus(m_MsParam.AutoFocus, out wd);
|
|
|
+ AutoFocus(m_MsParam.AutoFocus, out wd, step_code);
|
|
|
|
|
|
//LogManager.AddHardwareLog("算法输出"+ wd.ToString(), true);
|
|
|
//设置工作距离
|
|
@@ -844,7 +851,7 @@ namespace MeasureThread
|
|
|
int state = 0;
|
|
|
|
|
|
//1.控制SEM放大600X
|
|
|
- arg.Picture_Information.Work_Status = "FIB";
|
|
|
+ arg.Picture_Information.Work_Status = "SEM";
|
|
|
if (!iSEM.SetMagnification(m_measureFile.MParam.Location_Magnification))
|
|
|
{
|
|
|
arg.Message = "放大" + m_measureFile.MParam.Location_Magnification.ToString("0.0") + "倍失败";
|
|
@@ -862,7 +869,7 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//2.控制SEM自动对焦、亮度、对比度
|
|
|
- if(ImageFocus())
|
|
|
+ if(ImageFocus("1-2"))
|
|
|
{
|
|
|
arg.Message = "自动对焦完成";
|
|
|
arg.State = true;
|
|
@@ -912,7 +919,6 @@ namespace MeasureThread
|
|
|
//4.控制SEM拍照,5保存照片=====需要更改路径
|
|
|
String fileName1 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName1;
|
|
|
arg.Picture_Information.Picture_FullPath = fileName1;
|
|
|
- arg.Picture_Information.Work_Status = "SEM";
|
|
|
arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
|
|
|
Thread.Sleep(1000);
|
|
|
arg.Picture_Information.Magnification = iSEM.GetMagnification();
|
|
@@ -963,7 +969,6 @@ namespace MeasureThread
|
|
|
//9.保存照片======更改路径
|
|
|
String fileName2 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName2;
|
|
|
arg.Picture_Information.Picture_FullPath = fileName2;
|
|
|
- arg.Picture_Information.Work_Status = "FIB";
|
|
|
arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
|
|
|
Thread.Sleep(1000);
|
|
|
arg.Picture_Information.Magnification = iSEM.GetMagnification();
|
|
@@ -1261,7 +1266,7 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//2.控制SEM自动对焦、亮度、对比度-接口,,将自动对焦提出单独函数调用
|
|
|
- if (ImageFocus())
|
|
|
+ if (ImageFocus("1-18"))
|
|
|
{
|
|
|
arg.Message = "自动对焦完成";
|
|
|
arg.State = true;
|
|
@@ -1412,7 +1417,7 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//2.控制SEM自动对焦、亮度、对比度-接口
|
|
|
- if (ImageFocus())
|
|
|
+ if (ImageFocus("1-23"))
|
|
|
{
|
|
|
arg.Message = "自动对焦完成";
|
|
|
arg.State = true;
|
|
@@ -1545,7 +1550,7 @@ namespace MeasureThread
|
|
|
|
|
|
//9、-10不操作
|
|
|
//11、自动对焦。与之前操作相同
|
|
|
- if (ImageFocus())
|
|
|
+ if (ImageFocus("1-28"))
|
|
|
{
|
|
|
arg.Message = "自动对焦完成";
|
|
|
arg.State = true;
|
|
@@ -2304,7 +2309,7 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//自动聚焦
|
|
|
- public bool AutoFocus(FocusParam a_param, out int a_nWd)
|
|
|
+ public bool AutoFocus(FocusParam a_param, out int a_nWd, String step_code)
|
|
|
{
|
|
|
a_nWd = 0;
|
|
|
float wd = iSEM.GetWorkingDistance();
|
|
@@ -2348,18 +2353,19 @@ namespace MeasureThread
|
|
|
|
|
|
int cWd =(int) Math.Ceiling(nUp + i * nStep + 0.5);
|
|
|
iSEM.SetWorkingDistance((float)(cWd * 0.00000001));
|
|
|
+ arg.Picture_Information.Work_Distance = (float)(cWd * 0.00000001);
|
|
|
Thread.Sleep(8000);
|
|
|
|
|
|
int swd = cWd / 100;
|
|
|
//SendMsg("wd = " + swd.ToString() +"um");
|
|
|
|
|
|
String fileName = path_coarse + "\\" + cWd.ToString() + ".tif";
|
|
|
+ arg.Picture_Information.Picture_FullPath = fileName;
|
|
|
if (!GetImage(ImageMode.SEM, fileName))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ SendMsg(step_code);
|
|
|
}
|
|
|
|
|
|
//1.2, 选定细拍照的工作距离
|
|
@@ -2389,18 +2395,20 @@ namespace MeasureThread
|
|
|
{
|
|
|
int cWd = (int)Math.Ceiling(nfUp + i * nfStep + 0.5);
|
|
|
iSEM.SetWorkingDistance((float)(cWd * 0.00000001));
|
|
|
+ arg.Picture_Information.Work_Distance = (float)(cWd * 0.00000001);
|
|
|
Thread.Sleep(8000);
|
|
|
|
|
|
int swd = cWd / 100;
|
|
|
//SendMsg("wd = " + swd.ToString() + "um");
|
|
|
|
|
|
String fileName = path_fine + "\\" + cWd.ToString() + ".tif";
|
|
|
+ arg.Picture_Information.Picture_FullPath = fileName;
|
|
|
if (!GetImage(ImageMode.SEM, fileName))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
+ SendMsg(step_code);
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
int fineWd;
|