Browse Source

更新测量线程

@wang_qi0307 5 years ago
parent
commit
7dabc9dfc9
1 changed files with 75 additions and 39 deletions
  1. 75 39
      MeasureThread/Measure.cs

+ 75 - 39
MeasureThread/Measure.cs

@@ -521,42 +521,37 @@ namespace MeasureThread
         }
 
         public void SendMsg(string step_code)
-        {
-            arg.State = step_code;
-            SendThreadStatus(this, arg);
-        }
-
-        public void SendMsg1(string step_code)
         {
             arg.Step_Code = step_code;
             arg.Time = DateTime.Now;
-            switch(step_code)
-            {
-                //拍照
-                case "1-5":
-                case "1-7":
-                case "1-16":
-                case "1-24":
-                    //电压、放大倍数、工作距离、位置信息、图片路径
-                    arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
-                    arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
-                    arg.Picture_Information.Magnification = iSEM.GetMagnification();
-                    break;
-                case "1-10":
-                case "1-18":
-                    //获取偏移信息
-                    break;
-                case "1-12":
-                case "1-20":
-                    //验证移动准备性
-                    break;
-                case "1-26":
-                    //取消电子束校正并初始化
-                    break;
-                default:
-                    arg.State = "1";
-                    break;
-            }
+            //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);
         }
 
@@ -567,6 +562,7 @@ namespace MeasureThread
             arg.State = a_state;
             SendCutHolesStatus(this, arg);
         }
+
         //测量流程
         public void DoMeasure()
         {
@@ -575,7 +571,7 @@ namespace MeasureThread
 
             if (SendThreadStatus != null)
             {
-                SendMsg("开始测量。");
+                //SendMsg("开始测量。");
             }
 
             LogManager.AddHardwareLog("开始测量",true);
@@ -583,7 +579,7 @@ namespace MeasureThread
             //检查硬件连接是否正常
             if (!ConnectHardware())
             {
-                SendMsg("连接硬件失败。");
+                //SendMsg("连接硬件失败。");
                 this.TStatus.ComputeTime(THREAD_TIME_TYPE.STOPPED);
                 return;
             }
@@ -599,7 +595,7 @@ namespace MeasureThread
                 return;
             }
 
-            SendMsg("创建工作文件路径为" + WorkingFolder);
+            //SendMsg("创建工作文件路径为" + WorkingFolder);
 
             float[] firstPosition;
             //将停止键复位
@@ -682,8 +678,6 @@ namespace MeasureThread
                     break;
                 }
             }
-
-
         }
 
         //检查硬件连接是否正常
@@ -914,6 +908,12 @@ namespace MeasureThread
             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();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+            Thread.Sleep(1000);
             if (!GetImage(ImageMode.SEM, fileName1))
             {
                 arg.Message = "SEM拍照失败";
@@ -953,8 +953,14 @@ namespace MeasureThread
                 //8.控制FIB拍照
                 //9.保存照片======更改路径
                 String fileName2 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName2;
-                arg.Picture_Information.Picture_FullPath = fileName1;
+                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();
+                Thread.Sleep(1000);
+                arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+                Thread.Sleep(1000);
                 if (!GetImage(ImageMode.FIB, fileName2))
                 {
                     arg.Message = "FIB拍照失败";
@@ -1092,6 +1098,12 @@ namespace MeasureThread
             String fileName31 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName31;
             arg.Picture_Information.Picture_FullPath = fileName31;
             arg.Picture_Information.Work_Status = "FIB";
+            arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Magnification = iSEM.GetMagnification();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+            Thread.Sleep(1000);
             if (!GetImage(ImageMode.FIB, fileName31))
             {
                 arg.Message = "FIB切割前拍照失败";
@@ -1131,6 +1143,12 @@ namespace MeasureThread
             String fileName32 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName32;
             arg.Picture_Information.Picture_FullPath = fileName32;
             arg.Picture_Information.Work_Status = "FIB";
+            arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Magnification = iSEM.GetMagnification();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+            Thread.Sleep(1000);
             if (!GetImage(ImageMode.FIB, fileName32))
             {
                 arg.Message = "FIB切割后拍照失败";
@@ -1232,6 +1250,12 @@ namespace MeasureThread
             String fileName4 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName4;
             arg.Picture_Information.Picture_FullPath = fileName4;
             arg.Picture_Information.Work_Status = "SEM";
+            arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Magnification = iSEM.GetMagnification();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+            Thread.Sleep(1000);
             if (!GetImage(ImageMode.SEM, fileName4))
             {
                 arg.Message = "SEM拍照失败";
@@ -1380,6 +1404,12 @@ namespace MeasureThread
             String fileName5 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName5;
             arg.Picture_Information.Picture_FullPath = fileName5;
             arg.Picture_Information.Work_Status = "SEM";
+            arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Magnification = iSEM.GetMagnification();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+            Thread.Sleep(1000);
             if (!GetImage(ImageMode.SEM, fileName5))
             {
                 arg.Message = "SEM拍照失败";
@@ -1479,6 +1509,12 @@ namespace MeasureThread
             String fileName6 = data_path + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName6;
             arg.Picture_Information.Picture_FullPath = fileName6;
             arg.Picture_Information.Work_Status = "SEM";
+            arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Magnification = iSEM.GetMagnification();
+            Thread.Sleep(1000);
+            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
+            Thread.Sleep(1000);
             if (!GetImage(ImageMode.SEM, fileName6))
             {
                 arg.Message = "SEM拍照失败";