瀏覽代碼

add codes which is used for AutoBeamOff

CXS 3 年之前
父節點
當前提交
372534a677

+ 10 - 3
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CMeasure.cs

@@ -150,8 +150,6 @@ namespace OTSModelSharp
         }
         void ThreadOver()
         {
-            
-
 
             DateTime timeEnd = m_ThreadStatus.GetEndTime();
 
@@ -160,10 +158,19 @@ namespace OTSModelSharp
          
            MsrMsg.STMThreadStu.iMsrStatu = m_ThreadStatus.GetStatus();
 
-
             //MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToShortDateString();
             MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToString("yyyy-MM-dd HH:mm:ss");
             ProgressEvent(MsrMsg);
+
+            if (MsrMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.FAILED || MsrMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.COMPLETED)
+            {
+
+                if (m_pProjData.GetGenParam().AutoBeamOff)
+                {
+                    m_SemController.SetSemBeamCurrentOff();
+                }
+            }
+
             //disconnect the semcontroller when we exit this task.
             //m_SemController.DisConnect();
         }

+ 2 - 0
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/COTSMsrPrjResultData.cs

@@ -1422,6 +1422,8 @@ namespace OTSModelSharp
         //合并后新添加的需要的方法
         public void SetGenParam(COTSGeneralParam GenParam) { m_GenParam = GenParam; }
 
+        public COTSGeneralParam GetGenParam() { return m_GenParam; }
+
         public bool Reclassify()
         {
             string strFilePath = FileHelper.GetFolderName(m_strPathName);

+ 21 - 0
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/OTSGeneralParam.cs

@@ -30,6 +30,24 @@ namespace OTSModelSharp
         otsdataconst.DOMAIN_SHAPE m_nDefaultShape;
        
         otsdataconst.MEMBRANE_TYPE m_DefaultmembraneType;
+
+
+        bool m_AutoBeamOff;
+        /// <summary>
+        /// AutoBeamOff:自动关高压开关
+        /// </summary>
+        public bool AutoBeamOff
+        {
+            set
+            {
+                m_AutoBeamOff = value;
+            }
+            get
+            {
+                return m_AutoBeamOff;
+            }
+        }
+
         //--------------------public-----------------
         public COTSGeneralParam()
         {
@@ -213,6 +231,9 @@ namespace OTSModelSharp
             m_bSysSTD = false;
             m_steelTechnologyl = 0;
             m_sSTDSelect = ("");
+
+
+            AutoBeamOff = false;
         }
         protected void Duplicate(COTSGeneralParam a_oSource)
         {

+ 1 - 2
OTSIncAMeasureApp/1-OTSMeasure/CMeasureThreadWrapper.cs

@@ -183,8 +183,8 @@ namespace OTSMeasureApp
                     }
                     else if (MSTMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.FAILED)
                     {
-
                         StopMeasure(MSTMsg);
+                        
                         log.Error("(OTSGetMreRetThread)  MSTMsg.STMThreadStu.iMThreadStatus = RET_MEASURE_THREAD_STATUS.FAILED");
 
 
@@ -193,7 +193,6 @@ namespace OTSMeasureApp
                     {
 
                         StopMeasure(MSTMsg);
-
                     }
                     else
                     {

+ 0 - 18
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -73,22 +73,6 @@ namespace OTSMeasureApp
         /// <remarks>创建</remarks>
         public COTSMsrPrjResultData m_ResultData;
 
-        bool m_AutoBeamOff;
-        /// <summary>
-        /// AutoBeamOff:自动关高压开关
-        /// </summary>
-        public bool AutoBeamOff
-        {
-            set
-            {
-                m_AutoBeamOff = value;
-            }
-            get
-            {
-                return m_AutoBeamOff;
-            }
-        }
-
         //参数文件
         public COTSDefaultParam m_DefaultParam = null;
         //样品台文件(读取样品台数据等)                            
@@ -106,8 +90,6 @@ namespace OTSMeasureApp
             m_MeasureAppFrom = MeasureApp;
            
             m_ResultData = new COTSMsrPrjResultData();
-
-            AutoBeamOff = false;
         }
 
       

+ 7 - 7
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/SEMDATAFieldManage.cs

@@ -27,7 +27,7 @@ namespace OTSMeasureApp
         ScanController cScanfun = null;
         EDSController cEDSfun = null;
         //主窗体对象
-        COTSMeasureParam m_ProjData;
+        COTSMeasureParam m_MsrParam;
         CFieldPositionMgr cFieldMgrClr;
 
         NLog.Logger log ;
@@ -39,9 +39,9 @@ namespace OTSMeasureApp
         {
             log = NLog.LogManager.GetCurrentClassLogger();
             //获取主窗体对象
-            if (m_ProjData == null)
+            if (m_MsrParam == null)
             {
-                m_ProjData = a_DataMgr;
+                m_MsrParam = a_DataMgr;
             }
 
         }
@@ -263,7 +263,7 @@ namespace OTSMeasureApp
                     //鼠标在样品台中移动获取坐标
                     OTSLocation = OTSSamplespaceGraphicsPanelFun.GetMouseLocationInRectangleGDIObject(mousePoint, m_RectangleGDIObjects[0], oTSSampleStageData, IsWidth, m_RectangleGDIObjects[0].Region.Width, m_RectangleGDIObjects[0].Region.Height);
 
-                    Point SEMPoint =m_ProjData.ChangeOTSToSemCoord(OTSLocation);
+                    Point SEMPoint =m_MsrParam.ChangeOTSToSemCoord(OTSLocation);
 
                     //调用C++ controller中的方法
                     //移动至当前位置
@@ -304,7 +304,7 @@ namespace OTSMeasureApp
                 {
                     //鼠标在样品台中移动获取坐标
                     OTSLocation = OTSSamplespaceGraphicsPanelFun.GetMouseLocationInRectangleGDIObject(mousePoint, RectangleGDIObject, oTSSampleStageData, IsWidth, RectangleGDIObject.Region.Width, RectangleGDIObject.Region.Height);
-                    Point SEMPoint = m_ProjData.ChangeOTSToSemCoord(OTSLocation);
+                    Point SEMPoint = m_MsrParam.ChangeOTSToSemCoord(OTSLocation);
                     //循环single中所有对象 进行位置匹配
                     for (int i = 0; i < m_SingleGDIObjects.Count; i++)
                     {
@@ -313,11 +313,11 @@ namespace OTSMeasureApp
                             //获取帧图左上坐标
                             Point LT = new Point((int)m_SingleGDIObjects[i].RegionF.Left, (int)m_SingleGDIObjects[i].RegionF.Top);
                             Point lTLocation = OTSSamplespaceGraphicsPanelFun.GetMouseLocationInRectangleGDIObject(LT, RectangleGDIObject, oTSSampleStageData, IsWidth, RectangleGDIObject.Region.Width, RectangleGDIObject.Region.Height);
-                            lTLocation = m_ProjData.ChangeOTSToSemCoord(lTLocation);
+                            lTLocation = m_MsrParam.ChangeOTSToSemCoord(lTLocation);
                             //获取帧图右下坐标
                             Point RB = new Point((int)m_SingleGDIObjects[i].RegionF.Right, (int)m_SingleGDIObjects[i].RegionF.Bottom);
                             Point rbLocation = OTSSamplespaceGraphicsPanelFun.GetMouseLocationInRectangleGDIObject(RB, RectangleGDIObject, oTSSampleStageData, IsWidth, RectangleGDIObject.Region.Width, RectangleGDIObject.Region.Height);
-                            rbLocation = m_ProjData.ChangeOTSToSemCoord(rbLocation);
+                            rbLocation = m_MsrParam.ChangeOTSToSemCoord(rbLocation);
 
                             int diffX = Math.Abs(rbLocation.X - lTLocation.X) / 2;
                             int diffY = Math.Abs(rbLocation.Y - lTLocation.Y) / 2;

+ 88 - 88
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSBSEImageFun.cs

@@ -55,93 +55,93 @@ namespace OTSMeasureApp
                     return 0;
                 }
 
-                int a_ExternalMode = 0;
-                //获取终止模式
-
-                a_ExternalMode = cfun.GetSemExternalMode();
-
-                //保存初始模式变量
-                int a_oldMode = 0;
-                //获取初始模式
-
-                if (!cfun.GetSemScanMode(ref a_oldMode))
-                {
-                    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemScanMode = false  Failed";
-                    log.Error(strErrorInfo);
-                    return 0;
-                }
-
-                //设置当前模式
-
-                if (!cfun.SetSemScanMode(a_ExternalMode))
-                {
-                    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetSemScanMode = false  Failed";
-                    log.Error(strErrorInfo);
-                    return 0;
-                }
-
-
-                #region BeamBlank
-                int a_nBeamBlank = 0;
-                //获取参数
-
-                if (!cfun.GetSemBeamBlank(ref a_nBeamBlank))
-                {
-                    cfun.SetSemScanMode(a_oldMode);
-                    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemBeamBlank = false  Failed";
-                    log.Error(strErrorInfo);
-                    return 0;
-                }
-
-                //设置参数               
-                if (!cfun.SetSemBeamBlank(0))
-                {
-                    cfun.SetSemScanMode(a_oldMode);
-                    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetSemBeamBlank = false  Failed";
-                    log.Error(strErrorInfo);
-                    return 0;
-                }
-
-                #endregion
-
-                #region 获得放大倍数
-                //获得放大倍数
-                double a_dMagnification = 0;
-
-                //获取参数
-                if (!cfun.GetSemMagnification(ref a_dMagnification))
-                {
-                    cfun.SetSemScanMode(a_oldMode);
-                    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemMagnification = false  Failed";
-                    log.Error(strErrorInfo);
-                    return 0;
-                }
-
-                #endregion
-
-                #region 获取 电镜 X、Y轴 与角度
-                //获取 电镜 X、Y轴 与角度
-                double PositionX = 0;
-                double PositionY = 0;
-                double PositionR = 0;
-                //获取参数
-
-                if (!cfun.GetSemPositionXY(ref PositionX, ref PositionY, ref PositionR))
-                {
-                    cfun.SetSemScanMode(a_oldMode);
-                    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemPositionXY = false  Failed";
-                    log.Error(strErrorInfo);
-                    return 0;
-                }
-
-                #endregion
+                //int a_ExternalMode = 0;
+                ////获取终止模式
+
+                //a_ExternalMode = cfun.GetSemExternalMode();
+
+                ////保存初始模式变量
+                //int a_oldMode = 0;
+                ////获取初始模式
+
+                //if (!cfun.GetSemScanMode(ref a_oldMode))
+                //{
+                //    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemScanMode = false  Failed";
+                //    log.Error(strErrorInfo);
+                //    return 0;
+                //}
+
+                ////设置当前模式
+
+                //if (!cfun.SetSemScanMode(a_ExternalMode))
+                //{
+                //    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetSemScanMode = false  Failed";
+                //    log.Error(strErrorInfo);
+                //    return 0;
+                //}
+
+
+                //#region BeamBlank
+                //int a_nBeamBlank = 0;
+                ////获取参数
+
+                //if (!cfun.GetSemBeamBlank(ref a_nBeamBlank))
+                //{
+                //    cfun.SetSemScanMode(a_oldMode);
+                //    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemBeamBlank = false  Failed";
+                //    log.Error(strErrorInfo);
+                //    return 0;
+                //}
+
+                ////设置参数               
+                //if (!cfun.SetSemBeamBlank(false))
+                //{
+                //    cfun.SetSemScanMode(a_oldMode);
+                //    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetSemBeamBlank = false  Failed";
+                //    log.Error(strErrorInfo);
+                //    return 0;
+                //}
+
+                //#endregion
+
+                //#region 获得放大倍数
+                ////获得放大倍数
+                //double a_dMagnification = 0;
+
+                ////获取参数
+                //if (!cfun.GetSemMagnification(ref a_dMagnification))
+                //{
+                //    cfun.SetSemScanMode(a_oldMode);
+                //    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemMagnification = false  Failed";
+                //    log.Error(strErrorInfo);
+                //    return 0;
+                //}
+
+                //#endregion
+
+                //#region 获取 电镜 X、Y轴 与角度
+                ////获取 电镜 X、Y轴 与角度
+                //double PositionX = 0;
+                //double PositionY = 0;
+                //double PositionR = 0;
+                ////获取参数
+
+                //if (!cfun.GetSemPositionXY(ref PositionX, ref PositionY, ref PositionR))
+                //{
+                //    cfun.SetSemScanMode(a_oldMode);
+                //    string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemPositionXY = false  Failed";
+                //    log.Error(strErrorInfo);
+                //    return 0;
+                //}
+
+                //#endregion
 
                 #region 设置图像分辨率
                 //设置宽度
 
                 if (!cfun.SetImageSize(iWidth,iHeigh))
                 {
-                    cfun.SetSemScanMode(a_oldMode);
+                    //cfun.SetSemScanMode(a_oldMode);
                     string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetImageSize = false  Failed";
                     log.Error(strErrorInfo);
                     return 0;
@@ -155,7 +155,7 @@ namespace OTSMeasureApp
 
                 if (!cfun.SetDwellTime(nDwellTime))
                 {
-                    cfun.SetSemScanMode(a_oldMode);
+                    //cfun.SetSemScanMode(a_oldMode);
                     string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetDwellTime = false  Failed";
                     log.Error(strErrorInfo);
                     return 0;
@@ -165,12 +165,12 @@ namespace OTSMeasureApp
 
                 #region MatrixSize
                 //获得放大倍数
-                int a_MatrixSize = 0;
-                Size size = new Size();
+                //int a_MatrixSize = 0;
+                //Size size = new Size();
                 //获取参数
-                size = cfun.GetMatrixSize(a_MatrixSize);
+                //size = cfun.GetMatrixSize(a_MatrixSize);
 
-                size = cfun.GetMatrixSize(a_MatrixSize);
+                //size = cfun.GetMatrixSize(a_MatrixSize);
 
                 #endregion
 
@@ -185,14 +185,14 @@ namespace OTSMeasureApp
                 {
                     //设置为原始 扫描模式
 
-                    cfun.SetSemScanMode(a_oldMode);
+                    //cfun.SetSemScanMode(a_oldMode);
 
         
 
                 }
                 else
                 {
-                    cfun.SetSemScanMode(a_oldMode);
+                    //cfun.SetSemScanMode(a_oldMode);
                     string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.AcquireBSEImage = 0  Failed";
                     log.Error(strErrorInfo);
 

+ 3 - 3
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1406,16 +1406,16 @@ namespace OTSMeasureApp
 
         private void rbAutoBeamOff_Click(object sender, EventArgs e)
         {
-            if (m_ProjParam.AutoBeamOff)
+            if (m_ProjData.GetGenParam().AutoBeamOff)
             {
-                m_ProjParam.AutoBeamOff = false;
+                m_ProjData.GetGenParam().AutoBeamOff = false;
                 rbAutoBeamOff.Image = global::OTSMeasureApp.Properties.Resources.AutoBeamOff_off;
                 rbAutoBeamOff.SmallImage = global::OTSMeasureApp.Properties.Resources.AutoBeamOff_off;
                 rbAutoBeamOff.Checked = false;
             }
             else
             {
-                m_ProjParam.AutoBeamOff = true;
+                m_ProjData.GetGenParam().AutoBeamOff = true;
                 rbAutoBeamOff.Image = global::OTSMeasureApp.Properties.Resources.AutoBeamOff_on;
                 rbAutoBeamOff.SmallImage = global::OTSMeasureApp.Properties.Resources.AutoBeamOff_on;
                 rbAutoBeamOff.Checked = true;

+ 3 - 0
OTSIncAMeasureApp/ServiceCenter/IMeasureHardware.cs

@@ -27,6 +27,9 @@ namespace OTSModelSharp.ServiceInterface
        bool GetSemPositionXY(ref double a_dPositionX, ref double a_dPositionY, ref double a_dPositionR);
         bool MoveSEMToPoint(Point poi, double rotation);
         bool MoveSEMToPoint(Point poi);
+
+        bool SetSemBeamCurrentOff();
+
         OTSCLRINTERFACE.COTSControlFunExport GetHardwareInterface();
     }
     public interface IScanController

+ 10 - 0
OTSIncAMeasureApp/ServiceCenter/SemController.cs

@@ -156,6 +156,16 @@ namespace OTSModelSharp.ServiceInterface
             return hw.SetSemWorkingDistance(a_distance);
         }
 
+        public bool SetSemBeamCurrentOff()
+        {
+            if (!hw.IsConnected())
+            {
+                return false;
+            }
+            //int seValue = b ? 1 : 0;
+            return hw.SetSemBeamCurrent(true);
+        }
+
         public OTSCLRINTERFACE.COTSControlFunExport GetHardwareInterface()
         {
             if (!hw.IsConnected())