Explorar el Código

update interface SEMControl

@wang_qi0307 hace 5 años
padre
commit
00a8b8f444
Se han modificado 3 ficheros con 111 adiciones y 47 borrados
  1. 4 6
      HOZProject/FormUnitControl.cs
  2. 60 10
      SmartSEMControl/HardwareInterface.cs
  3. 47 31
      SmartSEMControl/SmartSEM.cs

+ 4 - 6
HOZProject/FormUnitControl.cs

@@ -187,8 +187,7 @@ namespace HOZProject
         #region 缩放Get
         private void btnenlargeGet_Click(object sender, EventArgs e)
         {
-            float ret = sem.Magnification;
-            //float ret = sem.GetMagnification();
+            float ret = sem.GetMagnification();
             if (float.IsNaN(ret))
             {
                 lblenlargeGet.Text = "NaN";
@@ -210,8 +209,7 @@ namespace HOZProject
             float set = 0;
             if (float.TryParse(txtenlargeSet.Text, out set))
             {
-                sem.Magnification = set;
-                //sem.SetMagnification(set);
+                sem.SetMagnification(set);
             }
 
         }
@@ -220,7 +218,7 @@ namespace HOZProject
         #region 焦距Get
         private void btnWDGet_Click(object sender, EventArgs e)
         {
-            float ret = sem.WorkingDistance;
+            float ret = sem.GetWorkingDistance();
             if (float.IsNaN(ret))
             {
                 lblWDGet.Text = "NaN";
@@ -242,7 +240,7 @@ namespace HOZProject
             float set = 0;
             if (float.TryParse(txtWDSet.Text, out set))
             {
-                sem.WorkingDistance = set;
+                sem.SetWorkingDistance(set);
             }
         }
         #endregion

+ 60 - 10
SmartSEMControl/HardwareInterface.cs

@@ -10,19 +10,69 @@ namespace SmartSEMControl
     interface SEMControl
     {
 
+
         //缩放
-        float Magnification
-        {
-            get;set;
-        }
+        float GetMagnification();
+        Boolean SetMagnification(float set);
 
         //焦距
-        float WorkingDistance
-        {
-            get;set;
-        }
-
-
+        float GetWorkingDistance();
+        Boolean SetWorkingDistance(float set);
+
+        //亮度
+        float GetBrightness();
+        Boolean SetBrightness(float set);
+
+        //对比度
+        float GetContrast();
+        Boolean SetContrast(float set);
+
+        //消像散
+        float GetAstigmatismX();
+        float GetAstigmatismY();
+        Boolean SetAstigmatismX(float set);
+        Boolean SetAstigmatismY(float set);
+
+        //角度补偿
+        float GetTiltAngle();
+        Boolean SetTiltAngle(float set);
+
+        //BeamSHift移动
+        float GetBeamShiftX();
+        float GetBeamShiftY();
+        Boolean SetBeamShiftX(float set);
+        Boolean SetBeamShiftY(float set);
+
+        //样品台
+        float GetStageAtX();
+        float GetStageAtY();
+        float GetStageAtZ();
+        float GetStageAtT();
+        float GetStageAtR();
+        float GetStageAtM();
+        Boolean SetStageGotoX(float set);
+        Boolean SetStageGotoY(float set);
+        Boolean SetStageGotoZ(float set);
+        Boolean SetStageGotoT(float set);
+        Boolean SetStageGotoR(float set);
+        Boolean SetStageGotoM(float set);
+
+        //Scan Rotate角度接口
+        float GetScanRotation();
+        Boolean SetScanRotation(float set);
+
+        //像素读取PixelSize
+        float GetPixelSize();
+
+        //电子束校正设置
+        float GetTiltCorrection();
+        Boolean SetTiltCorrection(float set);
+
+        //开启电压
+        Boolean CmdOpenVoltage();
+
+        //关闭电压
+        Boolean CmdCloseVoltage();
 
         //清除控件
         Boolean Dispose();

+ 47 - 31
SmartSEMControl/SmartSEM.cs

@@ -273,49 +273,63 @@ namespace SmartSEMControl
         }
         #endregion
 
-        #region 缩放
-        public float Magnification
+        #region 放大缩小
+        /// <summary>
+        /// 读取缩放倍数
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetMagnification()
         {
-            get
+            float ret = 0;
+            if(ReadParams(AP_MAG, ref ret))
             {
-                float ret = 0;
-                if (ReadParams(AP_MAG, ref ret))
-                {
-                    return ret;
-                }
-                else
-                {
-                    return float.NaN;
-                }
+                return ret;
             }
-            set
+            else
             {
-                WriteParams(AP_MAG, value);
+                return float.NaN;
             }
         }
+
+        /// <summary>
+        /// 设置缩放倍数
+        /// </summary>
+        /// <param name="set">倍数</param>
+        /// <returns>true or false</returns>
+        public Boolean SetMagnification(float set)
+        {
+            return WriteParams(AP_MAG, set);
+        }
         #endregion
 
         #region 焦距
-        public float WorkingDistance
+        /// <summary>
+        /// 读取工作距离
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetWorkingDistance()
         {
-            get
+            float ret = 0;
+            if (ReadParams(AP_WD, ref ret))
             {
-                float ret = 0;
-                if (ReadParams(AP_WD, ref ret))
-                {
-                    return ret;
-                }
-                else
-                {
-                    return float.NaN;
-                }
+                return ret;
             }
-            set
+            else
             {
-                WriteParams(AP_WD, value);
+                return float.NaN;
             }
         }
-        #endregion      
+
+        /// <summary>
+        /// 设置焦距
+        /// </summary>
+        /// <param name="set">焦距</param>
+        /// <returns>true or false</returns>
+        public Boolean SetWorkingDistance(float set)
+        {
+            return WriteParams(AP_WD, set);
+        }
+        #endregion  
 
         #region 亮度
         /// <summary>
@@ -766,9 +780,11 @@ namespace SmartSEMControl
         /// <returns>true or false</returns>
         public Boolean SetScanRotation(float set)
         {
-            WriteDataParams(DP_SCAN_ROT, 1);
-            return WriteParams(AP_SCANROTATION, set);
-            WriteDataParams(DP_SCAN_ROT, 0);
+            Boolean ret = false;
+            ret = WriteDataParams(DP_SCAN_ROT, 1);
+            ret = WriteParams(AP_SCANROTATION, set);
+            ret = WriteDataParams(DP_SCAN_ROT, 0);
+            return ret;
         }
         #endregion