|
@@ -486,8 +486,6 @@ namespace MeasureThread
|
|
|
set { this.m_MsParam = value; }
|
|
|
}
|
|
|
|
|
|
- //
|
|
|
-
|
|
|
//构造函数
|
|
|
public Measure(String webServerIP, String webServerPort, String webServerUrl)
|
|
|
{
|
|
@@ -524,34 +522,6 @@ namespace MeasureThread
|
|
|
{
|
|
|
arg.Step_Code = step_code;
|
|
|
arg.Time = DateTime.Now;
|
|
|
- //switch(step_code)
|
|
|
- //{
|
|
|
- // //拍照
|
|
|
- // case "1-4":
|
|
|
- // case "1-6":
|
|
|
- // case "1-11":
|
|
|
- // case "1-13":
|
|
|
- // case "1-19":
|
|
|
- // case "1-25":
|
|
|
- // case "1-29":
|
|
|
- // //电压、放大倍数、工作距离、位置信息、图片路径
|
|
|
-
|
|
|
- // break;
|
|
|
- // case "1-10":
|
|
|
- // case "1-18":
|
|
|
- // //获取偏移信息
|
|
|
- // break;
|
|
|
- // case "1-12":
|
|
|
- // case "1-20":
|
|
|
- // //验证移动准备性
|
|
|
- // break;
|
|
|
- // case "1-26":
|
|
|
- // //取消电子束校正并初始化
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // arg.State = "1";
|
|
|
- // break;
|
|
|
- //}
|
|
|
SendThreadStatus(this, arg);
|
|
|
}
|
|
|
|
|
@@ -649,7 +619,7 @@ namespace MeasureThread
|
|
|
else
|
|
|
{
|
|
|
//非第一个孔的测试
|
|
|
- SendMsg("第" + i.ToString() + "个切孔开始测量");
|
|
|
+ //SendMsg("第" + i.ToString() + "个切孔开始测量");
|
|
|
//切孔操作-开始
|
|
|
SendCutHoleMsg(((int)ThreadState.InProcess).ToString(), m_cutHoles[i].HoleName);
|
|
|
//其他孔的测试
|
|
@@ -675,6 +645,8 @@ namespace MeasureThread
|
|
|
{
|
|
|
m_cutHoles[i].STATE = State.Unmeasured;
|
|
|
m_measureFile.Save();
|
|
|
+ arg.Message = "用户停止测量";
|
|
|
+ SendMsg("0-0");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -816,6 +788,7 @@ namespace MeasureThread
|
|
|
{
|
|
|
Directory.Delete(focus_path, true);
|
|
|
}
|
|
|
+ Thread.Sleep(5000);
|
|
|
Directory.CreateDirectory(focus_path);
|
|
|
//1、对焦参数类,2、输出工作距离
|
|
|
int wd = 0;
|
|
@@ -824,7 +797,8 @@ namespace MeasureThread
|
|
|
//LogManager.AddHardwareLog("算法输出"+ wd.ToString(), true);
|
|
|
//设置工作距离
|
|
|
iSEM.SetWorkingDistance((float)(wd * 0.00000001));
|
|
|
-
|
|
|
+ //设置完工作距离后必须延迟5秒
|
|
|
+ Thread.Sleep(5000);
|
|
|
//处理图片位置
|
|
|
//File.Copy(focus_path + "\\fine\\" + wd.ToString() + ".tif", data_path + "\\" + ImageName);
|
|
|
}
|
|
@@ -836,7 +810,26 @@ namespace MeasureThread
|
|
|
}
|
|
|
else //蔡司自动对焦
|
|
|
{
|
|
|
+ iSEM.CmdAutoFocusCoarse();
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ Thread.Sleep(10000);
|
|
|
|
|
|
+ if(0 == iSEM.GetAutoFunction())
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ iSEM.CmdAutoFocusFine();
|
|
|
+ while (true)
|
|
|
+ {
|
|
|
+ Thread.Sleep(10000);
|
|
|
+
|
|
|
+ if (0 == iSEM.GetAutoFunction())
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -897,16 +890,24 @@ namespace MeasureThread
|
|
|
SendMsg("1-3");
|
|
|
return false;
|
|
|
}
|
|
|
+ Thread.Sleep(5000);
|
|
|
arg.State = true;
|
|
|
arg.Message = "设置SEM进行角度补偿54度成功";
|
|
|
SendMsg("1-3");
|
|
|
- Thread.Sleep(5000);
|
|
|
+
|
|
|
//判断是否停止进程
|
|
|
if (key_stop)
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Thread.Sleep(2000);
|
|
|
+ arg.State = true;
|
|
|
+ arg.Message = "设置SEM进行角度补偿54度成功";
|
|
|
+ SendMsg("1-3");
|
|
|
+ }
|
|
|
|
|
|
//4.控制SEM拍照,5保存照片=====需要更改路径
|
|
|
String fileName1 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName1;
|
|
@@ -1674,30 +1675,25 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
// 16.找到切割位置
|
|
|
- if (!FindCross())
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- //判断是否停止进程
|
|
|
- if (key_stop)
|
|
|
+ if (m_MsParam.Is_Photograph == false)
|
|
|
{
|
|
|
- return false;
|
|
|
+ if (!FindCross())
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //判断是否停止进程
|
|
|
+ if (key_stop)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//将过程17最后的拍照图片提出给18步进行调用
|
|
|
String img18 = "";
|
|
|
//17.自动控制SEM拍截面照
|
|
|
- if (m_MsParam.Is_Photograph == false)
|
|
|
+ if (!ShotSection(ref img18))
|
|
|
{
|
|
|
-
|
|
|
- if (!ShotSection(ref img18))
|
|
|
- {
|
|
|
- arg.Message = "自动控制SEM拍截面照失败";
|
|
|
- SendMsg("1-33");
|
|
|
- return false;
|
|
|
- }
|
|
|
- arg.Message = "自动控制SEM拍截面照成功";
|
|
|
- SendMsg("1-33");
|
|
|
+ return false;
|
|
|
}
|
|
|
//判断是否停止进程
|
|
|
if (key_stop)
|
|
@@ -1706,19 +1702,21 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//18.自动层高分析
|
|
|
- float size = iSEM.GetPixelSize();
|
|
|
- float mag = iSEM.GetMagnification();
|
|
|
- int state = 0;
|
|
|
- wr.Img_Measure_Size(img18, mag, size, out state);
|
|
|
- if(state==0)
|
|
|
+ if (m_MsParam.Is_Photograph == false)
|
|
|
{
|
|
|
- arg.Message = "测量尺寸失败";
|
|
|
+ float size = iSEM.GetPixelSize();
|
|
|
+ float mag = iSEM.GetMagnification();
|
|
|
+ int state = 0;
|
|
|
+ wr.Img_Measure_Size(img18, mag, size, out state);
|
|
|
+ if (state == 0)
|
|
|
+ {
|
|
|
+ arg.Message = "测量尺寸失败";
|
|
|
+ SendMsg("1-31");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ arg.Message = "测量尺寸成功";
|
|
|
SendMsg("1-31");
|
|
|
- return false;
|
|
|
}
|
|
|
- arg.Message = "测量尺寸成功";
|
|
|
- SendMsg("1-31");
|
|
|
-
|
|
|
#region 测试程序
|
|
|
//最后保存测量数据-测量文件、测量状态,m_cutHoles[i].STATE!=MeasureData.CutHole.State.Success.
|
|
|
//中间停止更新状态为Unmeasured,过程中return false时,更新状态为failed,保存测量文件
|
|
@@ -1968,31 +1966,27 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
// 16.找到切割位置
|
|
|
- if (!FindCross())
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- //判断是否停止进程
|
|
|
- if (key_stop)
|
|
|
+ if (m_MsParam.Is_Photograph == false)
|
|
|
{
|
|
|
- return false;
|
|
|
+ if (!FindCross())
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //判断是否停止进程
|
|
|
+ if (key_stop)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//将过程17最后的拍照图片提出给18步进行调用
|
|
|
String img18 = "";
|
|
|
//17.自动控制SEM拍截面照
|
|
|
- if (m_MsParam.Is_Photograph == false)
|
|
|
+ if (!ShotSection(ref img18))
|
|
|
{
|
|
|
-
|
|
|
- if (!ShotSection(ref img18))
|
|
|
- {
|
|
|
- arg.Message = "自动控制SEM拍截面照失败";
|
|
|
- SendMsg("1-33");
|
|
|
- return false;
|
|
|
- }
|
|
|
- arg.Message = "自动控制SEM拍截面照成功";
|
|
|
- SendMsg("1-33");
|
|
|
+ return false;
|
|
|
}
|
|
|
+
|
|
|
//判断是否停止进程
|
|
|
if (key_stop)
|
|
|
{
|
|
@@ -2000,18 +1994,21 @@ namespace MeasureThread
|
|
|
}
|
|
|
|
|
|
//18.自动层高分析
|
|
|
- float size = iSEM.GetPixelSize();
|
|
|
- float mag = iSEM.GetMagnification();
|
|
|
- int state = 0;
|
|
|
- wr.Img_Measure_Size(img18, mag, size, out state);
|
|
|
- if (state == 0)
|
|
|
+ if (m_MsParam.Is_Photograph == false)
|
|
|
{
|
|
|
- arg.Message = "测量尺寸失败";
|
|
|
+ float size = iSEM.GetPixelSize();
|
|
|
+ float mag = iSEM.GetMagnification();
|
|
|
+ int state = 0;
|
|
|
+ wr.Img_Measure_Size(img18, mag, size, out state);
|
|
|
+ if (state == 0)
|
|
|
+ {
|
|
|
+ arg.Message = "测量尺寸失败";
|
|
|
+ SendMsg("1-31");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ arg.Message = "测量尺寸成功";
|
|
|
SendMsg("1-31");
|
|
|
- return false;
|
|
|
}
|
|
|
- arg.Message = "测量尺寸成功";
|
|
|
- SendMsg("1-31");
|
|
|
|
|
|
#region 测试程序
|
|
|
//string fn;
|
|
@@ -2202,7 +2199,7 @@ namespace MeasureThread
|
|
|
//}
|
|
|
|
|
|
//开启校正
|
|
|
- SendMsg("开启校正");
|
|
|
+ //SendMsg("开启校正");
|
|
|
if (!iSEM.SetTiltAngleOn())
|
|
|
{
|
|
|
return false;
|
|
@@ -2215,7 +2212,7 @@ namespace MeasureThread
|
|
|
//}
|
|
|
|
|
|
//恢复原始状态
|
|
|
- SendMsg("校正角度"+ a_fAngle.ToString());
|
|
|
+ //SendMsg("校正角度"+ a_fAngle.ToString());
|
|
|
if (!iSEM.SetTiltAngle(a_fAngle))
|
|
|
{
|
|
|
return false;
|