浏览代码

Merge branch 'EDS' of http://192.168.1.123:10080/SDD1/HOZ into EDS

gsp 4 年之前
父节点
当前提交
527f258797
共有 1 个文件被更改,包括 26 次插入248 次删除
  1. 26 248
      MeasureThread/Measure.cs

+ 26 - 248
MeasureThread/Measure.cs

@@ -1540,9 +1540,7 @@ namespace MeasureThread
             log.Info("测量线程:切割后SEM拍照", true);
             if (!iSEM.CmdFIBModeSEM())
             {
-                //arg.Message = "切割后SEM拍照失败。";
-                //arg.State = false;
-                //SendMsg("1-20");
+                
                 log.Error("测量线程报错:切换到SEM模式失败", false);
                 return false;
             }
@@ -1806,10 +1804,7 @@ namespace MeasureThread
 
                 if (!GetImage(fileName10))
                 {
-                    //arg.State = false;
-                    //arg.Message = "SEM拍照失败";
-                    //SendMsg("3-2");
-                    //return false;
+                    
                     log.Error("测量线程报错:找到已切割的位置拍照失败", false);
                 }
 
@@ -1907,12 +1902,7 @@ namespace MeasureThread
             #endregion
 
             #region 拍摄矩形的切割孔,使用拍照的放大倍数
-            //if(!iSEM.SetAutoVideoBrightnessAndContrast())
-            //{
-            //    log.Info("测量线程报错:自动开启亮度对比度失败", false);
-            //    return false;
-            //}
-            //Thread.Sleep(5000);
+          
 
             //2.控制SEM自动对焦、亮度、对比度-接口
             //add by sun 2020-12-16 解决第5/6类样品 2000倍对焦不好问题
@@ -2282,11 +2272,7 @@ namespace MeasureThread
                     }
                     log.Info("========测量线程:自动聚焦成功!" + set.ToString() + "倍", true);
 
-                    ////自动消像散
-                    //if (!ImageStig1())
-                    //{
-                    //    return false;
-                    //}
+                   
 
                     //放大到10000倍
                     iSEM.SetMagnification(magMax);
@@ -2309,30 +2295,7 @@ namespace MeasureThread
                     }
                     log.Info("========测量线程:自动聚焦成功!" + set.ToString() + "倍", true);
 
-                    ////自动消像散
-                    //if (!ImageStig1())
-                    //{
-                    //    return false;
-                    //}
-
-                    ////放大到20000倍
-                    //iSEM.SetMagnification(magMax*2);
-                    //Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-
-                    //set = magMax*2;
-                    //current = iSEM.GetMagnification();
-                    //while (Math.Abs(current - set) > 1)
-                    //{
-                    //    iSEM.SetMagnification(set);
-                    //    Thread.Sleep(200);
-                    //    current = iSEM.GetMagnification();
-                    //}
-
-                    ////自动对焦
-                    //if (!ImageFocus1())
-                    //{
-                    //    return false;
-                    //}                   
+                                     
 
                     iSEM.CloseReduced();
                     Thread.Sleep(200);
@@ -2410,65 +2373,7 @@ namespace MeasureThread
                         #region 如果是第一个点,则1W倍对焦
                         if (n == 0)
                         {
-                            ////在第一个点上放大1W倍对焦
-                            //if (!iSEM.SetMagnification(mag[n]))
-                            //{
-                            //    log.Info("测量线程报错:第一个区域放大倍数" + mag[n].ToString() + "控制失败", false);
-                            //    return false;
-                            //}
-                            //Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-                            //while (true)
-                            //{
-                            //    current = iSEM.GetMagnification();
-                            //    if (Math.Abs(current - mag[n]) < 1)
-                            //    {
-                            //        Thread.Sleep(200);
-                            //        break;
-                            //    }
-                            //    Thread.Sleep(200);
-                            //    iSEM.SetMagnification(set);
-                            //    Thread.Sleep(200);
-                            //}
-                            //if (MParam.SampleName == "2")
-                            //{
-                            //    //窗口对焦
-                            //    iSEM.SetReduced1(340, 1, 340, 256);
-                            //    Thread.Sleep(200);
-                            //    iSEM.CmdFocusRate();
-                            //    Thread.Sleep(200);
-                            //    cycle_time = iSEM.GetCycleTime();
-                            //    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-                            //    //自动对焦
-                            //    if (!ImageFocus1(false))
-                            //    {
-                            //        return false;
-                            //    }
-                            //    //恢复全屏
-                            //    iSEM.CloseReduced();
-                            //    Thread.Sleep(200);
-                            //    cycle_time = iSEM.GetCycleTime();
-                            //    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-                            //}
-                            //else
-                            //{
-                            //    //窗口对焦
-                            //    //iSEM.SetReduced(402, 128, 800, 600);
-                            //    //Thread.Sleep(200);
-                            //    iSEM.CmdFocusRate();
-                            //    Thread.Sleep(200);
-                            //    cycle_time = iSEM.GetCycleTime();
-                            //    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-                            //    //自动对焦
-                            //    if (!ImageFocus1(false))
-                            //    {
-                            //        return false;
-                            //    }
-                            //    //恢复全屏
-                            //    //iSEM.CloseReduced();
-                            //    //Thread.Sleep(200);
-                            //    cycle_time = iSEM.GetCycleTime();
-                            //    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-                            //}
+                            
 
                             log.Info("========测量线程:进入内部观察,不对焦!", true);
                             //增亮图像
@@ -2498,13 +2403,7 @@ namespace MeasureThread
                         }
                         #endregion
 
-                        //add by sun 2020-12-17 根据客户要求,3大类样品需要在5000倍下在拍摄一张图片,不需要分析
-                        //if((MParam.SampleName=="3")&&(n==0))
-                        //{ 
-                        //    if (!GetImageFromSEM(mag[n]/2))
-                        //        log.Info("测量线程报错:第一个区域放大一半倍数" + (mag[n]/2).ToString() + "控制失败", true);
-                        //}
-                        //add by sun 2020-12-17 根据客户要求,3大类样品需要在5000倍下在拍摄一张图片,不需要分析 end
+                        
                         #region 拍照
                         if (!iSEM.SetMagnification(mag[n]))
                         {
@@ -2612,10 +2511,7 @@ namespace MeasureThread
 
             }
 
-            ////14光束复位和Rotation关闭开关
-            //arg.Message = "光束复位成功";
-            //arg.State = true;
-            //SendMsg("1-36");
+          
             iSEM.SetTiltAngleOff();
             Thread.Sleep(200);
             iSEM.SetScanRotationOff();
@@ -2796,10 +2692,7 @@ namespace MeasureThread
                     return false;
                 }
 
-                //这段是临时的
-                //arg.State = true;
-                //arg.Message = "测量尺寸成功";
-                //SendMsg("1-40");
+             
 
                 //18.自动层高分析
                 if (MParam.Is_Photograph == false)
@@ -2978,10 +2871,7 @@ namespace MeasureThread
                 return false;
             }
 
-            //这段是临时的
-            //arg.State = true;
-            //arg.Message = "测量尺寸成功";
-            //SendMsg("1-40");
+      
 
             //18.自动层高分析
             if (MParam.Is_Photograph == false)
@@ -3009,9 +2899,6 @@ namespace MeasureThread
                 EDS_Analysis();
             }
 
-            //20.复位  del by sun 2020-12-15
-            //BeamShiftReset();
-            //del by sun 2020-12-15 end
 
             return true;
         }
@@ -3837,9 +3724,7 @@ namespace MeasureThread
                 {
                     return false;
                 }
-                //arg.State = true;
-                //arg.Message = "自动对焦";
-                //SendMsg("0-9");
+               
 
                 //判断是否停止进程
                 if (key_stop)
@@ -3891,9 +3776,7 @@ namespace MeasureThread
                 {
                     return false;
                 }
-                //arg.State = true;
-                //arg.Message = "自动对焦";
-                //SendMsg("0-9");
+              
 
                 //判断是否停止进程
                 if (key_stop)
@@ -3912,10 +3795,7 @@ namespace MeasureThread
             else
                 a_nWd = fineWd;
 
-            //SendMsg("细选工作距离wd = " + a_nWd.ToString());
-            //arg.State = true;
-            //arg.Message = "自动对焦";
-            //SendMsg(step_code);
+          
 
             return true;
 
@@ -4246,12 +4126,7 @@ namespace MeasureThread
             else
                 a_nWd = fineWd;
 
-            //SendMsg("细选工作距离wd = " + a_nWd.ToString());
-
-            //arg.State = true;
-            //arg.Message = "自动像散";
-            //SendMsg(step_code);
-
+          
             return true;
 
         }
@@ -4502,9 +4377,7 @@ namespace MeasureThread
                 {
                     return false;
                 }
-                //arg.State = true;
-                //arg.Message = "自动像散";
-                //SendMsg(step_code);
+             
 
                 //判断是否停止进程
                 if (key_stop)
@@ -4577,9 +4450,7 @@ namespace MeasureThread
                 {
                     return false;
                 }
-                //arg.State = true;
-                //arg.Message = "自动像散";
-                //SendMsg(step_code);
+               
 
                 //判断是否停止进程
                 if (key_stop)
@@ -4598,11 +4469,7 @@ namespace MeasureThread
             else
                 a_nWd = fineWd;
 
-            //SendMsg("细选工作距离wd = " + a_nWd.ToString());
-
-            //arg.State = true;
-            //arg.Message = "自动像散";
-            //SendMsg("0-9");
+            
 
             return true;
 
@@ -5628,6 +5495,8 @@ namespace MeasureThread
 
 
                 iExtender.GrabImage(edsfn, 0, 0, 0, 0, 0);//get the field eds image where the anylysis point locate.
+                arg.Picture_Information.Picture_FullPath = "";
+                arg.State = true;
                 SendMsg("4-5");//向界面发送指令:能谱拍照
                 //arg.State = false;
                 arg.Message = "";
@@ -5838,9 +5707,6 @@ namespace MeasureThread
 
                 }
 
-
-
-
                 //存储数据
                 //向分析点数据库更新
 
@@ -5872,27 +5738,7 @@ namespace MeasureThread
             float x2 = 0, y2 = 0;
             int state = 0;
 
-            //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-            //float m_TempBrightness = 50.0f;
-            //float m_TempContrast = 30.0f;
-            //if (MParam.SampleName == "3")
-            //{
-            //    m_TempBrightness = 48.0f;
-            //    m_TempContrast = 29.0f;
-            //}
-            //else if (MParam.SampleName == "0")
-            //{
-            //    m_TempBrightness = 50.0f;
-            //    m_TempContrast = 28.0f;
-            //}                        
-
-            ////add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题    
-            //iSEM.SetAutoVideoOff();
-            //Thread.Sleep(200);
-            //iSEM.SetBrightness(m_TempBrightness);//50.0f
-            //Thread.Sleep(200);
-            //iSEM.SetContrast(m_TempContrast);//30.0f
-            //Thread.Sleep(200);
+           
 
             //1.控制SEM放大到300倍
             //float mag = MParam.Photograph_Magnification / 3;
@@ -6002,9 +5848,7 @@ namespace MeasureThread
                         break;
                     }
                 }
-                //arg.State = true;
-                //arg.Message = "移动到新(" + x2.ToString() + "," + y2.ToString() + ")位置成功";
-                //SendMsg("3-3");
+           
 
                 //高倍到低倍不进行对焦
 
@@ -6057,19 +5901,7 @@ namespace MeasureThread
         public bool EDS_ShotSection()
         {
             int state = 0;
-            #region 设置拍照的电压
-            //log.Info("测量线程:设置拍照电压" + MParam.Photograph_Voltage.ToString(), true);
-            //1、放大倍数参数photograph_
-            //if (!iSEM.SetSEMVoltage(2000)) //MParam.Photograph_Voltage
-            //{
-            //    arg.Message = "电压设置" + MParam.Photograph_Voltage.ToString("0.0") + "失败";
-            //    arg.State = false;
-            //    SendMsg("3-4");
-            //    log.Error("测量线程报错:" + arg.Message, false);
-            //    return false;
-            //}
-            //add
-            #endregion
+          
             Thread.Sleep(200);
             #region 设置拍照的放大倍数
             log.Info("设置拍照放大倍数=" + MParam.Photograph_Magnification.ToString(), true);
@@ -6115,9 +5947,7 @@ namespace MeasureThread
             Thread.Sleep(200);
             cycle_time = iSEM.GetCycleTime();
             Thread.Sleep(100 + Convert.ToInt32(cycle_time));
-            //log.Info("关闭自动亮度对比度!", true);
-            //iSEM.SetAutoVideoOff();           
-            //Thread.Sleep(5000);
+  
 
             log.Info("自动对焦开始!", true);
             if (!ImageFocus1(false))
@@ -6138,20 +5968,6 @@ namespace MeasureThread
                 return false;
             }
 
-            //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-            //float m_TempBrightness = 50.0f;
-            //float m_TempContrast = 30.0f;
-
-            //if (MParam.SampleName == "3")
-            //{
-            //    m_TempBrightness = 50f;
-            //    m_TempContrast = 29f;
-            //    iSEM.SetBrightness(m_TempBrightness); //50.0f
-            //    Thread.Sleep(200);
-            //    iSEM.SetContrast(m_TempContrast); //30.0f
-            //    Thread.Sleep(200);
-            //}
-            //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题 end
             log.Info("开启自动亮度对比度", false);
             if (!iSEM.SetAutoVideoBrightnessAndContrast())
             {
@@ -6382,23 +6198,7 @@ namespace MeasureThread
                         + "," + ct0.Y.ToString() + ")", true);
                     MoveToPix(ct0.X, ct0.Y);
 
-
-
-                    //关闭自动亮度对比度
-                    //iSEM.SetAutoVideoOff();
-                    //Thread.Sleep(2000);
-                    //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-                    //if (MParam.SampleName == "3")
-                    //{
-                    //    m_TempBrightness = 50f;
-                    //    m_TempContrast = 29f;
-                    //    iSEM.SetBrightness(m_TempBrightness); //50.0f
-                    //    Thread.Sleep(200);
-                    //    iSEM.SetContrast(m_TempContrast); //30.0f
-                    //    Thread.Sleep(200);
-                    //}
-                    //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题 end
-                    //add by sun 2020-12-16 解决第5/6类样品 6000倍对焦不好问题
+                    
                     if (MParam.SampleName == "3")
                     {
                         iSEM.SetReduced(402, 128, 480, 450);
@@ -6670,31 +6470,9 @@ namespace MeasureThread
             Thread.Sleep(500);
 
             iSEM.SetAutoVideoBrightnessAndContrast();
-            //iSEM.SetAutoVideoBrightness();
-            //iSEM.SetAutoVideoContrast();
+           
             Thread.Sleep(2000);
-            //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-            //关闭自动亮度对比度
-            //iSEM.SetAutoVideoOff();
-            //Thread.Sleep(1000);            
-            //float m_TempBrightness = 50f;
-            //float m_TempContrast = 29f;
-            //if (MParam.SampleName == "3")
-            //{
-            //    m_TempBrightness = 50f;
-            //    m_TempContrast = 29f;
-            //}
-            //else if (MParam.SampleName == "0")
-            //{
-            //    m_TempBrightness = 50f;
-            //    m_TempContrast = 28f;
-
-            //}
-            //iSEM.SetBrightness(m_TempBrightness); //50.0f
-            //Thread.Sleep(200);
-            //iSEM.SetContrast(m_TempContrast); //30.0f
-            //Thread.Sleep(1000);
-            //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题 end
+          
             iSEM.SetMagnification(600);
             Thread.Sleep(500);
             SendMsg("4-1");