Browse Source

add measure data

HaoShuang 5 years ago
parent
commit
8cda840903

+ 102 - 104
MeasureData/CutHole.cs

@@ -1,6 +1,6 @@
 //时间:20200608
 //作者:郝爽
-//功能:测量数据类
+//功能:切割孔
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -10,155 +10,153 @@ using System.Threading.Tasks;
 namespace MeasureData
 {
     
-    //六轴坐标系统
-    struct SemPosition
+     //PT工序类型
+    enum PTType
     {
+        Have,
+        No
+    }
 
-        private float _x, _y, _z, _r, _t, _m;
+    //操作步骤,在操作失败时,反馈的状态
+    enum Operation
+    {
+        Init,
+        PTInsert,
+        GetCutPosition,
+        Cut,
+        PTOut,
+        GetHole,
+        Image,
+        Analysis,
+        Element
+    }
 
-        #region X
-        //限定范围
-        const float Xmax = 100;
-        const float Xmin = 10;
-        
-        public float X
-        {
-            get { return this._x; }
-            set => this._x = rangeCheckedX(value);
-        }
+    //测试结果
+    enum State
+    {
+        Unmeasured,
+        Failed,
+        Success
+    }
 
-        private static float rangeCheckedX(float x)
+    //切割孔
+    class CutHole
+    {
+        #region 样品名
+        /// <summary>
+        /// 样品名
+        /// </summary>
+        private string m_SampleName;
+
+        public string SampleName
         {
-            if (x > Xmax) x = Xmax;
-            else if (x < Xmin) x = Xmin;
-       
-            return x;
+            get { return this.m_SampleName; }
+            set { this.m_SampleName = value; }
         }
         #endregion
 
-        #region Y
-        //限定范围
-        const float Ymax = 100;
-        const float Ymin = 10;
-
-        public float Y
-        {
-            get { return this._y; }
-            set => this._y = rangeCheckedY(value);
-        }
+        #region 坐标位置
+        private SemPosition m_Position;
 
-        private static float rangeCheckedY(float y)
+        public SemPosition Position
         {
-            if (y > Ymax) y = Ymax;
-            else if (y < Ymin) y = Ymin;
-
-            return y;
+            get { return this.m_Position; }
+            set { this.m_Position = value; }
         }
         #endregion
 
-        #region Z
-        //限定范围
-        const float Zmax = 100;
-        const float Zmin = 10;
+        #region 工作条件
 
-        public float Z
-        {
-            get { return this._z; }
-            set => this._z = rangeCheckedZ(value);
-        }
+        //是否有pt工序
+        private PTType m_pt;
 
-        private static float rangeCheckedZ(float z)
+        public PTType PT
         {
-            if (z > Zmax) z = Zmax;
-            else if (z < Zmin) z = Zmin;
-
-            return z;
+            get { return this.m_pt; }
+            set { this.m_pt = value; }
         }
-        #endregion
 
-        #region R
-        //限定范围
-        const float Rmax = 100;
-        const float Rmin = 10;
+        //FIB工作模板
+        private string m_fibTemp;
 
-        public float R
+        public string FIBTemp
         {
-            get { return this._r; }
-            set => this._r = rangeCheckedR(value);
+            get { return this.m_fibTemp; }
+            set { this.m_fibTemp = value; }
         }
 
-        private static float rangeCheckedR(float r)
-        {
-            if (r > Rmax) r = Rmax;
-            else if (r < Rmin) r = Rmin;
+        //PT工作模板
+        private string m_ptTemp;
 
-            return r;
+        public string PTTemp
+        {
+            get { return this.m_ptTemp; }
+            set { this.m_ptTemp = value; }
         }
         #endregion
 
-        #region T
-        //限定范围
-        const float Tmax = 100;
-        const float Tmin = 10;
+        #region 工作状态
+        //操作步骤
+        private Operation m_opt;
 
-        public float T
+        public Operation OPT
         {
-            get { return this._t; }
-            set => this._t = rangeCheckedT(value);
+            get { return this.m_opt; }
+            set { this.m_opt = value; }
         }
 
-        private static float rangeCheckedT(float t)
-        {
-            if (t > Tmax) t = Tmax;
-            else if (t < Tmin) t = Tmin;
+        //开始时间
+        private DateTime m_start;
 
-            return t;
+        public DateTime START
+        {
+            get { return this.m_start; }
+            set { this.m_start = value; }
         }
-        #endregion
 
-        #region M
-        //限定范围
-        const float Mmax = 100;
-        const float Mmin = 10;
+        //结束时间
+        private DateTime m_end;
 
-        public float M
+        public DateTime END
         {
-            get { return this._m; }
-            set => this._m = rangeCheckedM(value);
+            get { return this.m_end; }
+            set { this.m_end = value; }
         }
 
-        private static float rangeCheckedM(float m)
-        {
-            if (m > Mmax) m = Mmax;
-            else if (m < Mmin) m = Mmin;
+        //测试结果
+        private State m_state;
 
-            return m;
+        public State STATE
+        {
+            get { return this.m_state; }
+            set { this.m_state = value; }
         }
-        #endregion
-    }
 
-    //切割孔
-    class CutHole
-    {
-        #region 样品名
-        /// <summary>
-        /// 样品名
-        /// </summary>
-        private string _SampleName;
+        //测量开关
+        private bool m_switch;
 
-        public string SampleName
+        public bool SWITCH
         {
-            get { return this._SampleName; }
-            set { this._SampleName = value; }
+            get { return this.m_switch; }
+            set { this.m_switch = value; }
         }
         #endregion
 
-        #region 坐标位置
-        private SemPosition _Position;
-        public SemPosition Position { get; set; }
-        #endregion
-
+        //构造函数
+        CutHole()
+        {
+            Init();
+        }
 
+        //初始化函数
+        private void Init()
+        {
+            //设定初始值
+            m_opt = Operation.Init;
+            m_state = State.Unmeasured;
+            m_switch = false;
+        }
 
+        //样品孔存储xml文档
     }
 }

+ 3 - 0
MeasureData/MeasureData.csproj

@@ -42,7 +42,10 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="CutHole.cs" />
+    <Compile Include="MeasureFile.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ResultFile.cs" />
+    <Compile Include="SemPosition.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 78 - 0
MeasureData/MeasureFile.cs

@@ -0,0 +1,78 @@
+//时间:20200610
+//作者:郝爽
+//功能:测量文件
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MeasureData
+{
+    class MeasureFile
+    {
+        #region 内容
+        //文件名
+        private string m_fileName;
+
+        public string FileName
+        {
+            get { return this.m_fileName; }
+            set { this.m_fileName = value; }
+        }
+
+        //文件路径
+        private string m_filepath;
+
+        public string FilePath
+        {
+            get { return this.m_filepath; }
+            set { this.m_filepath = value; }
+        }
+
+        //切孔链表
+        private List<CutHole> m_listCutHole;
+
+        public List<CutHole> ListCutHole
+        {
+            get { return this.m_listCutHole; }
+            set { this.m_listCutHole = value; }
+        }
+
+        //XML文件保存
+        #endregion
+
+        //构造函数
+        public MeasureFile()
+        {
+            Init();
+        }
+
+        public void Init()
+        {
+        }
+        #region 操作
+
+        //新建
+        public void New()
+        {
+        }
+
+        //打开
+        public void Open()
+        {
+        }
+
+        //保存
+        public void Save()
+        {
+        }
+
+        //另存为
+        public void SaveAs()
+        {
+        }
+
+        #endregion
+    }
+}

+ 105 - 0
MeasureData/ResultFile.cs

@@ -0,0 +1,105 @@
+//时间:20200610
+//作者:郝爽
+//功能:测量结果文件
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MeasureData
+{
+    class ResultFile
+    {
+        #region 内容
+        //切割点
+        private CutHole m_cutHole;
+
+        public CutHole CutHole
+        {
+            get { return this.m_cutHole; }
+            set { this.m_cutHole = value; }
+        }
+
+        //数据库路径
+        private string m_DBPath;
+
+        public string DBPath
+        {
+            get { return this.m_DBPath; }
+            set { this.m_DBPath = value; }
+        }
+        //图1路径
+        private string m_Image1Path;
+
+        public string Image1Path
+        {
+            get { return this.m_Image1Path; }
+            set { this.m_Image1Path = value; }
+        }
+        //图2路径
+        private string m_Image2Path;
+
+        public string Image2Path
+        {
+            get { return this.m_Image2Path; }
+            set { this.m_Image2Path = value; }
+        }
+        //图3路径
+        private string m_Image3Path;
+
+        public string Image3Path
+        {
+            get { return this.m_Image3Path; }
+            set { this.m_Image3Path = value; }
+        }
+        //图4路径
+        private string m_Image4Path;
+
+        public string Image4Path
+        {
+            get { return this.m_Image4Path; }
+            set { this.m_Image4Path = value; }
+        }
+        //自动调焦路径
+        private string m_AutoFocusPath;
+
+        public string AutoFocusPath
+        {
+            get { return this.m_AutoFocusPath; }
+            set { this.m_AutoFocusPath = value; }
+        }
+        //自动消像散路径
+        private string m_AutoSitgaPath;
+
+        public string AutoSitgaPath
+        {
+            get { return this.m_AutoSitgaPath; }
+            set { this.m_AutoSitgaPath = value; }
+        }
+        //自动亮度对比度路径
+        private string m_AutoBCPath;
+
+        public string AutoBCPath
+        {
+            get { return this.m_AutoBCPath; }
+            set { this.m_AutoBCPath = value; }
+        }
+        //各个数据以XML形式保存
+        #endregion
+
+        //构造函数
+        public ResultFile()
+        {
+            Init();
+        }
+
+        void Init()
+        {
+        }
+
+        #region 操作
+        //保存
+        #endregion
+    }
+}

+ 155 - 0
MeasureData/SemPosition.cs

@@ -0,0 +1,155 @@
+//时间:20200610
+//作者:郝爽
+//功能:六孔坐标位置
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MeasureData
+{
+    //六轴坐标系统
+    class SemPosition
+    {
+
+        private float m_x, m_y, m_z, m_r, m_t, m_m;
+
+        #region X
+        //限定范围
+        const float Xmax = 100;
+        const float Xmin = 10;
+
+        public float X
+        {
+            get { return this.m_x; }
+            set => this.m_x = rangeCheckedX(value);
+        }
+
+        private static float rangeCheckedX(float x)
+        {
+            if (x > Xmax) x = Xmax;
+            else if (x < Xmin) x = Xmin;
+
+            return x;
+        }
+        #endregion
+
+        #region Y
+        //限定范围
+        const float Ymax = 100;
+        const float Ymin = 10;
+
+        public float Y
+        {
+            get { return this.m_y; }
+            set => this.m_y = rangeCheckedY(value);
+        }
+
+        private static float rangeCheckedY(float y)
+        {
+            if (y > Ymax) y = Ymax;
+            else if (y < Ymin) y = Ymin;
+
+            return y;
+        }
+        #endregion
+
+        #region Z
+        //限定范围
+        const float Zmax = 100;
+        const float Zmin = 10;
+
+        public float Z
+        {
+            get { return this.m_z; }
+            set => this.m_z = rangeCheckedZ(value);
+        }
+
+        private static float rangeCheckedZ(float z)
+        {
+            if (z > Zmax) z = Zmax;
+            else if (z < Zmin) z = Zmin;
+
+            return z;
+        }
+        #endregion
+
+        #region R
+        //限定范围
+        const float Rmax = 100;
+        const float Rmin = 10;
+
+        public float R
+        {
+            get { return this.m_r; }
+            set => this.m_r = rangeCheckedR(value);
+        }
+
+        private static float rangeCheckedR(float r)
+        {
+            if (r > Rmax) r = Rmax;
+            else if (r < Rmin) r = Rmin;
+
+            return r;
+        }
+        #endregion
+
+        #region T
+        //限定范围
+        const float Tmax = 100;
+        const float Tmin = 10;
+
+        public float T
+        {
+            get { return this.m_t; }
+            set => this.m_t = rangeCheckedT(value);
+        }
+
+        private static float rangeCheckedT(float t)
+        {
+            if (t > Tmax) t = Tmax;
+            else if (t < Tmin) t = Tmin;
+
+            return t;
+        }
+        #endregion
+
+        #region M
+        //限定范围
+        const float Mmax = 100;
+        const float Mmin = 10;
+
+        public float M
+        {
+            get { return this.m_m; }
+            set => this.m_m = rangeCheckedM(value);
+        }
+
+        private static float rangeCheckedM(float m)
+        {
+            if (m > Mmax) m = Mmax;
+            else if (m < Mmin) m = Mmin;
+
+            return m;
+        }
+        #endregion
+
+        public SemPosition()
+        {
+            m_x = 0;
+            m_y = 0;
+            m_z = 0;
+            m_r = 0;
+            m_t = 0;
+            m_m = 0;
+        }
+
+        //从文件中加载位置信息
+        public void GetPtsFromFile(string fileName)
+        {
+
+        }
+    }
+
+}

+ 8 - 2
SmartSEMControl/SmartSEM.cs

@@ -1,4 +1,7 @@
-using System;
+//时间:20200610
+//作者:王琦
+//功能:SmartSEM remote API控制
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Runtime.InteropServices;
@@ -10,6 +13,7 @@ using System.Threading;
 
 namespace SmartSEMControl
 {
+    //可能遇到的错误提示部分??在log加入之后添加
     class SmartSEM : ISEMControl
     {
         #region 模拟参数
@@ -78,6 +82,7 @@ namespace SmartSEMControl
         private String DP_DETECTOR_TYPE = "DP_DETECTOR_TYPE";
         //图像大小
         private String DP_IMAGE_STORE = "DP_IMAGE_STORE";
+        //自动处理状态查询
         #endregion
 
         #region 命令
@@ -95,8 +100,9 @@ namespace SmartSEMControl
 
         #region APILib
         private Api CZEMApi = new Api();
+        //设备初始化完成标志,true,表示设备已连接,可以控制
         private Boolean m_bInitialised = false;
-        private long lrt = 0;
+        private long lrt = 0; //命名??为什么是全局变量??
         #endregion
 
         #region 构造函数