Explorar o código

去蔡司前提交的最后一个版本

@wang_qi0307 %!s(int64=5) %!d(string=hai) anos
pai
achega
a93c9e378c

+ 105 - 25
HOZProject/FormUnitControl.cs

@@ -33,7 +33,7 @@ namespace HOZProject
 
         public XmlManager xmg = new XmlManager();
 
-        
+
         private String path = Directory.GetCurrentDirectory();
         private int st_flag = 0;
 
@@ -47,19 +47,19 @@ namespace HOZProject
 
             Control.CheckForIllegalCrossThreadCalls = false;
 
-            if(iSEM.ConnectStatus())
+            if (iSEM.ConnectStatus())
             {
                 float ret = iSEM.GetFIBIMAGING();
-                if(ret==0)
+                if (ret == 0)
                 {
                     btnSEM.BackColor = Color.Lime;
                 }
-                else if(ret==1)
+                else if (ret == 1)
                 {
                     btnFIB.BackColor = Color.Lime;
                     panelFIB.Visible = true;
                 }
-                else if(ret==2)
+                else if (ret == 2)
                 {
                     btnMILL.BackColor = Color.Lime;
                 }
@@ -71,7 +71,7 @@ namespace HOZProject
 
         }
         #endregion
-        
+
         #region 缩放Get
         private void btnenlargeGet_Click(object sender, EventArgs e)
         {
@@ -143,7 +143,7 @@ namespace HOZProject
                 btnBrightnessSet.Enabled = false;
             }
             else
-            { 
+            {
                 txtBrightnessSet.Text = ret.ToString();
                 btnBrightnessSet.Enabled = true;
             }
@@ -317,7 +317,7 @@ namespace HOZProject
             float set = 0;
             if (float.TryParse(txtScanRotationSet.Text, out set))
             {
-                
+
                 iSEM.SetScanRotation(set);
             }
         }
@@ -414,7 +414,7 @@ namespace HOZProject
             }
             else
             {
-                if(ret==0)
+                if (ret == 0)
                 {
                     btnTiltCorr.BackColor = Color.Blue;
                     iSEM.SetTiltCorrectionOn();
@@ -600,7 +600,7 @@ namespace HOZProject
         #region 窗体关闭
         private void FormUnitControl_FormClosing(object sender, FormClosingEventArgs e)
         {
-            if(iSEM!=null)
+            if (iSEM != null)
             {
                 iSEM.Dispose();
             }
@@ -700,20 +700,20 @@ namespace HOZProject
         #region SEM模式
         private void btnSEM_Click(object sender, EventArgs e)
         {
-            if(iSEM.CmdFIBModeSEM())
+            if (iSEM.CmdFIBModeSEM())
             {
                 btnFIB.BackColor = SystemColors.Control;
                 btnSEM.BackColor = Color.Lime;
                 btnMILL.BackColor = SystemColors.Control;
                 panelFIB.Visible = false;
-            } 
+            }
         }
         #endregion
 
         #region FIB模式
         private void btnFIB_Click(object sender, EventArgs e)
         {
-            if(iSEM.CmdFIBModeFIB())
+            if (iSEM.CmdFIBModeFIB())
             {
                 btnFIB.BackColor = Color.Lime;
                 btnSEM.BackColor = SystemColors.Control;
@@ -726,7 +726,7 @@ namespace HOZProject
         #region MILL模式
         private void btnMILL_Click(object sender, EventArgs e)
         {
-            if(iSEM.CmdFIBModeMILL())
+            if (iSEM.CmdFIBModeMILL())
             {
                 btnFIB.BackColor = SystemColors.Control;
                 btnSEM.BackColor = SystemColors.Control;
@@ -762,11 +762,11 @@ namespace HOZProject
         {
             float ret = 111;
             Boolean state = false;
-            while(true)
+            while (true)
             {
                 Thread.Sleep(1000);
                 ret = iSEM.GetAutoFunction();
-                if(ret==0)
+                if (ret == 0)
                 {
                     if (st_flag == 1 && state == true)
                     {
@@ -783,7 +783,7 @@ namespace HOZProject
                         }
                         break;
                     }
-                    else if(st_flag==2 && state)
+                    else if (st_flag == 2 && state)
                     {
                         btnAutoFocus2.BackColor = Color.Lime;
                         Thread.Sleep(1000);
@@ -886,9 +886,9 @@ namespace HOZProject
                     //    fileStream.Dispose();
                     //}
 
-                    
+
                 }
-                else if(ret>0 && ret<12)
+                else if (ret > 0 && ret < 12)
                 {
                     state = true;
                 }
@@ -1135,7 +1135,7 @@ namespace HOZProject
             {
                 string fn = Path.GetFileNameWithoutExtension(sfd.FileName).ToUpper();
                 iSEM.CMDMCFFilename(fn);
-                
+
             }
         }
         #endregion
@@ -1201,7 +1201,7 @@ namespace HOZProject
             {
                 return;
             }
-            if(!float.TryParse(txtStageY.Text,out sety))
+            if (!float.TryParse(txtStageY.Text, out sety))
             {
                 return;
             }
@@ -1215,10 +1215,10 @@ namespace HOZProject
         private void MoveStagexy()
         {
             float ret = 111;
-            while(true)
+            while (true)
             {
                 ret = iSEM.GetStageIs();
-                if(ret==0)
+                if (ret == 0)
                 {
                     btnMoveXY.BackColor = Color.Lime;
                     break;
@@ -1281,8 +1281,88 @@ namespace HOZProject
         //测量线程测试
         private void button1_Click(object sender, EventArgs e)
         {
-            FormMeasureTest Measure = new FormMeasureTest();
-            Measure.Show();
+            //FormMeasureTest Measure = new FormMeasureTest();
+            //Measure.Show();
+        }
+
+        private void btnPost1_Click(object sender, EventArgs e)
+        {
+            double degree = 0;
+            int direction = 0;
+            int state = 0;
+            wr.Img_OffsetAngle_Direction("D:/aaaa.jpg", out degree, out direction, out state);
+            lbldegree1.Text = degree.ToString("0.0");
+            lbldirection1.Text = direction.ToString();
+            lblstate1.Text = state.ToString();
+        }
+
+        private void btnPost2_Click(object sender, EventArgs e)
+        {
+            double offsetx = 0;
+            double offsety = 0;
+            int state = 0;
+            wr.Img_Cut_Position("D:/aaaa.jpg", out offsetx, out offsety, out state);
+            lbllocationx.Text = offsetx.ToString("0.0");
+            lbllocationy.Text = offsety.ToString("0.0");
+            lblstate2.Text = state.ToString();
+        }
+
+        private void btnPost3_Click(object sender, EventArgs e)
+        {
+            int state = 0;
+            wr.Img_Cut_Success("D:/aaaa.jpg", "D:/bbbb.jpg", out state);
+            lblstate3.Text = state.ToString();
+        }
+
+        private void btnPost4_Click(object sender, EventArgs e)
+        {
+            double offsetx = 0;
+            double offsety = 0;
+            int state = 0;
+            wr.Img_Trapezoid_Top_Center_Position("D:/aaaa.jpg", out offsetx, out offsety, out state);
+            lbltopcx.Text = offsetx.ToString("0.0");
+            lbltopcy.Text = offsety.ToString("0.0");
+            lblstate4.Text = state.ToString();
+        }
+
+        private void btnPost5_Click(object sender, EventArgs e)
+        {
+            List<string> filenames = new List<string>();
+            filenames.Add("1111111");
+            filenames.Add("2222222");
+            filenames.Add("3333333");
+            lblfocuspath.Text = wr.Img_Auto_Focus(filenames);
+        }
+
+        private void btnPost6_Click(object sender, EventArgs e)
+        {
+            List<string> filenames = new List<string>();
+            filenames.Add("1111111");
+            filenames.Add("2222222");
+            filenames.Add("3333333");
+            lblstigpath.Text = wr.Img_Auto_Focus(filenames);
+        }
+
+        private void btnPost7_Click(object sender, EventArgs e)
+        {
+            double offsetx = 0;
+            double offsety = 0;
+            double degree = 0;
+            int direction = 0;
+            int state = 0;
+            wr.Img_Center_Position_OffsetAngle_Direction("D:/aaaa.jpg", out offsetx, out offsety, out degree, out direction, out state);
+            lblcenterx.Text = offsetx.ToString("0.0");
+            lblcentery.Text = offsety.ToString("0.0");
+            lbldegree2.Text = degree.ToString();
+            lbldirection2.Text = direction.ToString();
+            lblstate5.Text = state.ToString();
+        }
+
+        private void btnPost8_Click(object sender, EventArgs e)
+        {
+            int state = 0;
+            wr.Img_Measure_Size("D:/aaaa.jpg", "1000", "0.005", out state);
+            lblstate6.Text = state.ToString();
         }
 
         private void btnPost1_Click(object sender, EventArgs e)

+ 0 - 9
HOZProject/UnitControl.csproj

@@ -65,17 +65,8 @@
     <Compile Include="FormUnitControl.Designer.cs">
       <DependentUpon>FormUnitControl.cs</DependentUpon>
     </Compile>
-    <Compile Include="FormMeasureTest.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="FormMeasureTest.Designer.cs">
-      <DependentUpon>FormMeasureTest.cs</DependentUpon>
-    </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="FormMeasureTest.resx">
-      <DependentUpon>FormMeasureTest.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FormShowImage.resx">
       <DependentUpon>FormShowImage.cs</DependentUpon>
     </EmbeddedResource>

+ 13 - 6
MeasureData/MeasureFile.cs

@@ -63,15 +63,18 @@ namespace MeasureData
             {
                 if( XmlManager.CreateXmlFile(this.FileName))
                 {
+                    //创建一个新的
                     return 1;
                 }
                 else
                 {
+                    //创建失败
                     return 0;
                 }
             }
             else
             {
+                //重新创建
                 XmlManager.CreateXmlFile(this.FileName);
                 return 2;
             }
@@ -169,6 +172,10 @@ namespace MeasureData
             }
 
             XmlDocument doc = new XmlDocument();
+            if (CreateXml() == 0)//创建该文件?
+            {
+                return false;
+            }
             if (File.Exists(FileName))
             {
                 doc.Load(this.FileName);//载入xml文件               
@@ -177,7 +184,7 @@ namespace MeasureData
             {
                 return SaveAs(); //当前路径不存在               
             }
-
+                      
             XmlNode root = doc.SelectSingleNode("XMLData");
             Serialize(true, doc, root);
             doc.Save(this.FileName);
@@ -212,12 +219,9 @@ namespace MeasureData
 
                 //创建一个新的文件
                 XmlDocument doc = new XmlDocument();
-                if (!File.Exists(this.FileName))
+                if (CreateXml() == 0)//创建该文件?
                 {
-                    if (CreateXml() > 0)//创建该文件?
-                    {
-                        return false;
-                    }
+                    return false;
                 }
                 doc.Load(this.FileName);
                 XmlNode root = doc.SelectSingleNode("XMLData");
@@ -230,6 +234,9 @@ namespace MeasureData
         //从文件生成切割孔信息
         public bool GetCutHolesFromFile(string a_FilePathName)
         {
+            //清空原文件中的切孔
+            this.ListCutHole.Clear();
+
             //弹出打开txt文件的对话矿
             a_FilePathName.Trim();
             if (string.IsNullOrEmpty(a_FilePathName))

+ 374 - 207
MeasureThread/Measure.cs

@@ -7,43 +7,73 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 
 using SmartSEMControl;
 using MeasureData;
+using FileManager;
 
 namespace MeasureThread
 {
+    //图片模式
     public enum ImageMode
     {
         FIB,
         SEM
     }
 
-    //层间通讯数据包
-    public struct ST_MSTMsg
+    public delegate void ThreadStatusHandler(object sender, ThreadStatusEventArgs e);  //声明委托
+    public delegate void CutHolesStatusHandler(object sender, CutHolesStatusEventArgs e);
+
+    public class ThreadStatusEventArgs
     {
-        //线程状态
-        public struct STMThreadStatus
+        public string State
+        {
+            get { return m_state; }
+            set { m_state = value; }
+        }
+        private string m_state;
+
+        public DateTime Time
+        {
+            get { return m_time; }
+            set { m_time = value; }
+        }
+        private DateTime m_time;
+
+        public ThreadStatusEventArgs(string a_State)
         {
-            public int iMThreadStatus;     
-            public string cMsrStartTime;  
-            public string cMsrEndTime;    
-        };
-        //切孔状态
-        public struct STMHoleStatus
+            this.m_state = a_State;
+        }
+
+    }
+    public class CutHolesStatusEventArgs
+    {
+        public string State
         {
-            public int iMeasureSampleStatus;    
-            public string cSampleName;
-        };
-        public STMThreadStatus STMThreadStu;
-        public STMHoleStatus STMSampleStu;
-    };
+            get { return m_state; }
+            set { m_state = value; }
+        }
+        private string m_state;
+
+        public string HoleName
+        {
+            get { return m_holeName; }
+            set { m_holeName = value; }
+        }
+        private string m_holeName;
 
+        public CutHolesStatusEventArgs(string a_state, string a_holeName)
+        {
+            this.m_state = a_state;
+            this.m_holeName = a_holeName;
+        }
+    }
 
     public class Measure
     {
-        public delegate void ProgressEventHandler(ST_MSTMsg msg);
-        public event ProgressEventHandler ProgressEvent;
+        public event ThreadStatusHandler SendThreadStatus;  // 声明事件
+        public event CutHolesStatusHandler SendCutHolesStatus;  // 声明事件
 
         //全局只有一个fatorySEM
         static FactoryHardware factorySEM = FactoryHardware.Instance;
@@ -112,7 +142,7 @@ namespace MeasureThread
         }
 
     //初始化测量业务, 读测量文件,判断是否有可测试的切孔
-    public bool InitMeas(MeasureFile a_measureFile)
+        public bool InitMeas(MeasureFile a_measureFile)
         {
             m_measureFile = a_measureFile;
             List<CutHole> listHoles = m_measureFile.ListCutHole;
@@ -133,44 +163,64 @@ namespace MeasureThread
             return true;
         }
 
+        public void SendMsg(string a_StrMsg)
+        {
+            ThreadStatusEventArgs arg = new ThreadStatusEventArgs(a_StrMsg);
+            arg.Time = DateTime.Now;
+            SendThreadStatus(this, arg);
+        }
+
         //测量流程
         public void DoMeasure()
         {
             //创建线程的测量状态的更新
             this.TStatus.ComputeTime(THREAD_TIME_TYPE.START);
 
-            //将这个开始时间传递给主界面
+            if (SendThreadStatus != null) 
+            {
+                SendMsg("开始测量。");
+            }
 
+            
             //检查硬件连接是否正常
             if (!ConnectHardware())
             {
+                SendMsg("连接硬件失败。");
                 this.TStatus.ComputeTime(THREAD_TIME_TYPE.STOPPED);
                 return;
             }
 
-            //设置工作文件夹
-            if (!SetWorkingFolderStr())
-            {
-                this.TStatus.ComputeTime(THREAD_TIME_TYPE.STOPPED);
-                return;
-            }
+            SendMsg("硬件连接成功。");
+
+            ////设置工作文件夹
+            //if (!SetWorkingFolderStr())
+            //{
+            //    SendMsg("设置工作文件夹失败");
+            //    this.TStatus.ComputeTime(THREAD_TIME_TYPE.STOPPED);
+            //    return;
+            //}
+
+            //SendMsg("创建工作文件路径成功。");
 
             float[] firstPosition;
             for (int i = 0; i < m_cutHoles.Count; i++)
             {
                 if (i == 0)
                 {
+                    SendMsg("第一个切孔开始测量");
                     firstPosition = iSEM.GetStagePosition();
+                    //第一个孔的测试
+                    FirstHole();
                 }
                 else
                 {
-
+                    //非第一个孔的测试
+                    SendMsg("第" + i.ToString()+"个切孔开始测量");
+                    //OtherHole();
                 }
             }
-            //第一个孔的测试
-            FirstHole();
-            //非第一个孔的测试
-            OtherHole();
+            
+            
         }
 
         //检查硬件连接是否正常
@@ -189,11 +239,13 @@ namespace MeasureThread
             //判断工作文件路径是否为空或无效
             if (string.IsNullOrEmpty(pathName))
             {
+                SendMsg("路径无效");
                 return false;
             }
             //文件未保存
             else if (pathName.CompareTo(MeasureFile.UNTITLED_FILE_NAME) == 0)
             {
+                SendMsg("工程文件未保存");
                 return false;
             }
 
@@ -201,29 +253,27 @@ namespace MeasureThread
             string folder = System.IO.Path.GetDirectoryName(pathName);
             if (string.IsNullOrEmpty(folder))
             {
+                SendMsg("工程文件无效");
                 return false;
             }
 
             WorkingFolder += @"\\";
 
+            LogManager.Init(WorkingFolder);
+
             return false;
         }
 
-        //第一个孔的测试过程
-        public bool FirstHole()
+        /// <summary>
+        ///13. 自动 定位功能
+        /// </summary>
+        /// <returns></returns>
+        public bool GetPoistion()
         {
-            MeasureData.CutHole firstHole = m_cutHoles[0];
-            //12.根据样品类型参数确定是否需要PT沉积,控制PT针插入
-            //if (firstHole.PT == true)
-            //{
-            //    if (!iSEM.InsertPT())
-            //    {
-            //        return false;
-            //    }
-            //}
-
+            SendMsg("自动定位");
             //13.自动定位切割
             {
+                SendMsg("放大600倍");
                 //1.控制SEM放大600X
                 if (!iSEM.SetMagnification(600))
                 {
@@ -231,14 +281,24 @@ namespace MeasureThread
                 }
 
                 //2.控制SEM自动对焦、亮度、对比度
-                if (!MeasParam.FocusMode)
+               // if (!MeasParam.FocusMode)
                 {
+                    if (DialogResult.Yes == MessageBox.Show("图像拍摄已完成?", "确认消息", MessageBoxButtons.YesNo))
+                    {
+                        SendMsg("拍摄照片完成");
+                        return true;
+                    }
+                    else
+                    {
+                        SendMsg("拍摄照片失败");
+                        return false;
+                    }
                     //弹出手动对焦的窗口
                 }
-                else 
-                {
-                    //调用自动对焦模块
-                }                
+                //else
+                //{
+                //    //调用自动对焦模块
+                //}
 
                 //3.设置SEM进行角度补偿54度
                 if (!TiltCorrection(54))
@@ -275,7 +335,7 @@ namespace MeasureThread
                 }
 
                 //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
-                
+
                 //11.自动工具样品类型参数确定是否需要PT沉积
                 {
                     //1. 根据客户PT沉积坐标控制FIB调整到中心位置
@@ -291,6 +351,8 @@ namespace MeasureThread
                     return false;
                 }
 
+                //电镜移动是有一个延时的操作的?
+
                 //13.验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否移动正确
                 float x1 = iSEM.GetStageAtX();
                 float y1 = iSEM.GetStageAtY();
@@ -302,188 +364,292 @@ namespace MeasureThread
                 //14.保存样品1第1号孔中心位置6轴坐标1 XYZMRT到数据库,保存客户返回值信息到数据库
                 float[] firstPosition = iSEM.GetStagePosition();
             }
-            //14.自动控制FIB切割
-            {
-                //1.根据参数设置FIB草率时间(使图清晰),设置梯形上下边及深度、设置束流
-                //2.控制FIB进行切割
 
-                //3.控制FIB拍照600X
-                //4.保存图片
-                {
-                    //1.设置图片名称
-                    //2.保存图片3
-                    String fileName3 = WorkingFolder + ImageName3;
-                    if (!GetImage(ImageMode.FIB, fileName3))
-                    {
-                        return false;
-                    }
-                }
-                //5.验证切割准确性:与切割前对比,如果对比误差大,则停止自动执行,进行报警
+            return false;
+        }
 
-                //6.设置FIB解冻:先读取状态,如果冻结状态则进行解冻
-            }
-            //15.根据样品类型决定是否撤出PT针
-            //if (firstHole.PT == false)
+        //第一个孔的测试过程
+        public bool FirstHole()
+        {
+            MeasureData.CutHole firstHole = m_cutHoles[0];
+            //12.根据样品类型参数确定是否需要PT沉积,控制PT针插入
+            //if (firstHole.PT == true)
             //{
-            //    if (!iSEM.OutputPT())
+            //    if (!iSEM.InsertPT())
             //    {
             //        return false;
             //    }
             //}
 
-            //16.自动调整SEM找到切割位置
+            if (!GetPoistion())
             {
-                //1.控制SEM放大到300倍
-                if (!iSEM.SetMagnification(300))
-                {
-                    return false;
-                }
-                //2.控制SEM自动对焦、亮度、对比度-接口
-                if (!MeasParam.FocusMode)
-                {
-                    //弹出手动对焦的窗口
-                }
-                else
-                {
-                    //调用自动对焦模块
-                }
+                SendMsg("自动定位切割失败");
+                return false;
+            }
+            ////13.自动定位切割
+            //{
+            //    //1.控制SEM放大600X
+            //    if (!iSEM.SetMagnification(600))
+            //    {
+            //        return false;
+            //    }
 
-                //3.控制SEM拍照
-                String fileName4 = WorkingFolder + ImageName4;
-                if (!GetImage(ImageMode.SEM, fileName4))
-                {
-                    return false;
-                }
-                //4.将照片传给客户,获取偏移坐标,以及偏移角度
-                float x4 = 0, y4 = 0;
-                float angle = 0;
+            //    //2.控制SEM自动对焦、亮度、对比度
+            //    if (!MeasParam.FocusMode)
+            //    {
+            //        //弹出手动对焦的窗口
+            //    }
+            //    else 
+            //    {
+            //        //调用自动对焦模块
+            //    }                
 
-                //5.根据坐标控制SEM移动到切孔位置,居中
-                if (!iSEM.MoveStageXY(x4, y4))
-                {
-                    return false;
-                }
+            //    //3.设置SEM进行角度补偿54度
+            //    if (!TiltCorrection(54))
+            //    {
+            //        return false;
+            //    }
 
-                if (!iSEM.SetScanRotation(angle))
-                {
-                    return false;
-                }
+            //    //4.控制SEM拍照
+            //    //5.保存照片
+            //    {
+            //        //1. 创建目录,已经完成
+            //        //2. 设置图片名称
+            //        //3. 保存图片1
+            //        String fileName1 = WorkingFolder + ImageName1;
+            //        if (!GetImage(ImageMode.SEM, fileName1))
+            //        {
+            //            return false;
+            //        }
+            //    }
 
-                //6.验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确
-                float x5 = iSEM.GetStageAtX();
-                float y5 = iSEM.GetStageAtY();
-                if (Math.Abs(x5 - x4) > fMin && Math.Abs(y5 - y4) > fMin)
-                {
-                    return false;
-                }
-            }
-            //17.自动控制SEM拍截面照
-            {
-                //1.控制SEM放大到指定参数大小范围,6000x
-                if (!iSEM.SetMagnification(6000))
-                {
-                    return false;
-                }
-                //2.控制SEM自动对焦、消像散、亮度、对比度
-                if (!MeasParam.FocusMode)
-                {
-                    //弹出手动对焦的窗口
-                }
-                else
-                {
-                    //调用自动对焦模块
-                }
+            //    //6.设置FIB拍照参数——扫描时间、束流等
+            //    //7.控制FIB自动亮度、对比度
 
-                //3.设置SEM角度补偿cos36度
-                if (!TiltCorrection(36))
-                {
-                    return false;
-                }
+            //    //8.控制FIB拍照
+            //    //9.保存照片
+            //    {
+            //        //1. 设置图片名称
+            //        //2. 保存图片2
+            //        String fileName2 = WorkingFolder + ImageName2;
+            //        if (!GetImage(ImageMode.FIB, fileName2))
+            //        {
+            //            return false;
+            //        }
+            //    }
 
-                //4.控制SEM拍照
-                //5.保存照片4
-                String fileName5 = WorkingFolder + ImageName5;
-                if (!GetImage(ImageMode.SEM, fileName5))
-                {
-                    return false;
-                }
-                //6.将照片传给客户,获取偏移坐标
-                float x6 = 0, y6 = 0;
-                float angle1 = 0;
-                float mage = 10000;
+            //    //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
+                
+            //    //11.自动工具样品类型参数确定是否需要PT沉积
+            //    {
+            //        //1. 根据客户PT沉积坐标控制FIB调整到中心位置
+            //        //2. 验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否一定正确
+            //        //3. 根据坐标进行PT沉积
+            //    }
 
-                //7.根据坐标控制SEM移动到分析位置
-                if (!iSEM.MoveStageXY(x6, y6))
-                {
-                    return false;
-                }
-                //8.验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确
+            //    //模拟为客户返回的坐标值
+            //    float x0 = 0, y0 = 0;
+            //    //12.根据梯形坐标控制FIB调整到中心位置
+            //    if (!iSEM.MoveStageXY(x0, y0))
+            //    {
+            //        return false;
+            //    }
 
-                float x7 = iSEM.GetStageAtX();
-                float y7 = iSEM.GetStageAtY();
-                if (Math.Abs(x6 - x7) > fMin && Math.Abs(y6 - y7) > fMin)
-                {
-                    return false;
-                }
+            //    //电镜移动是有一个延时的操作的?
 
-                //9.控制SEM平行校正,并记录校正前初始值
-                float foldAnagle = iSEM.GetScanRotation();
-                if (foldAnagle == float.NaN)
-                {
-                    return false;
-                }
+            //    //13.验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否移动正确
+            //    float x1 = iSEM.GetStageAtX();
+            //    float y1 = iSEM.GetStageAtY();
+            //    if (Math.Abs(x0 - x1) > fMin && Math.Abs(y0 - y1) > fMin)
+            //    {
+            //        return false;
+            //    }
 
-                if (!iSEM.SetScanRotation(angle1))
-                {
-                    return false;
-                }
+            //    //14.保存样品1第1号孔中心位置6轴坐标1 XYZMRT到数据库,保存客户返回值信息到数据库
+            //    float[] firstPosition = iSEM.GetStagePosition();
+            //}
+            ////14.自动控制FIB切割
+            //{
+            //    //1.根据参数设置FIB草率时间(使图清晰),设置梯形上下边及深度、设置束流
+            //    //2.控制FIB进行切割
 
-                //10.控制SEM放大到指定参数大小范围
-                if (!iSEM.SetMagnification(mage))
-                {
-                    return false;
-                }
+            //    //3.控制FIB拍照600X
+            //    //4.保存图片
+            //    {
+            //        //1.设置图片名称
+            //        //2.保存图片3
+            //        String fileName3 = WorkingFolder + ImageName3;
+            //        if (!GetImage(ImageMode.FIB, fileName3))
+            //        {
+            //            return false;
+            //        }
+            //    }
+            //    //5.验证切割准确性:与切割前对比,如果对比误差大,则停止自动执行,进行报警
 
-                //11.控制SEM自动对焦、消像散、亮度、对比度
-                if (!MeasParam.FocusMode)
-                {
-                    //弹出手动对焦的窗口
-                }
-                else
-                {
-                    //调用自动对焦模块
-                }
+            //    //6.设置FIB解冻:先读取状态,如果冻结状态则进行解冻
+            //}
+            ////15.根据样品类型决定是否撤出PT针
+            ////if (firstHole.PT == false)
+            ////{
+            ////    if (!iSEM.OutputPT())
+            ////    {
+            ////        return false;
+            ////    }
+            ////}
+
+            ////16.自动调整SEM找到切割位置
+            //{
+            //    //1.控制SEM放大到300倍
+            //    if (!iSEM.SetMagnification(300))
+            //    {
+            //        return false;
+            //    }
+            //    //2.控制SEM自动对焦、亮度、对比度-接口
+            //    if (!MeasParam.FocusMode)
+            //    {
+            //        //弹出手动对焦的窗口
+            //    }
+            //    else
+            //    {
+            //        //调用自动对焦模块
+            //    }
 
+            //    //3.控制SEM拍照
+            //    String fileName4 = WorkingFolder + ImageName4;
+            //    if (!GetImage(ImageMode.SEM, fileName4))
+            //    {
+            //        return false;
+            //    }
+            //    //4.将照片传给客户,获取偏移坐标,以及偏移角度
+            //    float x4 = 0, y4 = 0;
+            //    float angle = 0;
 
-                //12.控制SEM对分析位置拍照
-                String fileName6 = WorkingFolder + ImageName6;
-                if (!GetImage(ImageMode.SEM, fileName6))
-                {
-                    return false;
-                }
-                //13.保存照片
-                //14.控制SEM取消电子束校正,回到初始值
+            //    //5.根据坐标控制SEM移动到切孔位置,居中
+            //    if (!iSEM.MoveStageXY(x4, y4))
+            //    {
+            //        return false;
+            //    }
 
-                if (!iSEM.SetScanRotation(foldAnagle))
-                {
-                    return false;
-                }
-            }
-            //18.自动层高分析
-            {
-                //1.获取SEM Pixel Size给客户传入参数
-                if (iSEM.GetPixelSize() == float.NaN)
-                {
-                    return false;
-                }
-                //2.将照片传给客户,客户进行层高分析(返回分析后的图像、相对坐标、分辨率、各层编号以及各层对应的层高数据),如果客户自行出分析报告则无需返回数据
-            }
-            //19.自动能谱分析
-            {
-                //1. 确定能谱位置
-                //2. 控制牛津打能谱
-                //3. 能谱分析——面扫+线扫描
-            }
+            //    if (!iSEM.SetScanRotation(angle))
+            //    {
+            //        return false;
+            //    }
+
+            //    //6.验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确
+            //    float x5 = iSEM.GetStageAtX();
+            //    float y5 = iSEM.GetStageAtY();
+            //    if (Math.Abs(x5 - x4) > fMin && Math.Abs(y5 - y4) > fMin)
+            //    {
+            //        return false;
+            //    }
+            //}
+            ////17.自动控制SEM拍截面照
+            //{
+            //    //1.控制SEM放大到指定参数大小范围,6000x
+            //    if (!iSEM.SetMagnification(6000))
+            //    {
+            //        return false;
+            //    }
+            //    //2.控制SEM自动对焦、消像散、亮度、对比度
+            //    if (!MeasParam.FocusMode)
+            //    {
+            //        //弹出手动对焦的窗口
+            //    }
+            //    else
+            //    {
+            //        //调用自动对焦模块
+            //    }
+
+            //    //3.设置SEM角度补偿cos36度
+            //    if (!TiltCorrection(36))
+            //    {
+            //        return false;
+            //    }
+
+            //    //4.控制SEM拍照
+            //    //5.保存照片4
+            //    String fileName5 = WorkingFolder + ImageName5;
+            //    if (!GetImage(ImageMode.SEM, fileName5))
+            //    {
+            //        return false;
+            //    }
+            //    //6.将照片传给客户,获取偏移坐标
+            //    float x6 = 0, y6 = 0;
+            //    float angle1 = 0;
+            //    float mage = 10000;
+
+            //    //7.根据坐标控制SEM移动到分析位置
+            //    if (!iSEM.MoveStageXY(x6, y6))
+            //    {
+            //        return false;
+            //    }
+            //    //8.验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确
+
+            //    float x7 = iSEM.GetStageAtX();
+            //    float y7 = iSEM.GetStageAtY();
+            //    if (Math.Abs(x6 - x7) > fMin && Math.Abs(y6 - y7) > fMin)
+            //    {
+            //        return false;
+            //    }
+
+            //    //9.控制SEM平行校正,并记录校正前初始值
+            //    float foldAnagle = iSEM.GetScanRotation();
+            //    if (foldAnagle == float.NaN)
+            //    {
+            //        return false;
+            //    }
+
+            //    if (!iSEM.SetScanRotation(angle1))
+            //    {
+            //        return false;
+            //    }
+
+            //    //10.控制SEM放大到指定参数大小范围
+            //    if (!iSEM.SetMagnification(mage))
+            //    {
+            //        return false;
+            //    }
+
+            //    //11.控制SEM自动对焦、消像散、亮度、对比度
+            //    if (!MeasParam.FocusMode)
+            //    {
+            //        //弹出手动对焦的窗口
+            //    }
+            //    else
+            //    {
+            //        //调用自动对焦模块
+            //    }
+
+
+            //    //12.控制SEM对分析位置拍照
+            //    String fileName6 = WorkingFolder + ImageName6;
+            //    if (!GetImage(ImageMode.SEM, fileName6))
+            //    {
+            //        return false;
+            //    }
+            //    //13.保存照片
+            //    //14.控制SEM取消电子束校正,回到初始值
+
+            //    if (!iSEM.SetScanRotation(foldAnagle))
+            //    {
+            //        return false;
+            //    }
+            //}
+            ////18.自动层高分析
+            //{
+            //    //1.获取SEM Pixel Size给客户传入参数
+            //    if (iSEM.GetPixelSize() == float.NaN)
+            //    {
+            //        return false;
+            //    }
+            //    //2.将照片传给客户,客户进行层高分析(返回分析后的图像、相对坐标、分辨率、各层编号以及各层对应的层高数据),如果客户自行出分析报告则无需返回数据
+            //}
+            ////19.自动能谱分析
+            //{
+            //    //1. 确定能谱位置
+            //    //2. 控制牛津打能谱
+            //    //3. 能谱分析——面扫+线扫描
+            //}
 
             return true;
         }
@@ -657,6 +823,7 @@ namespace MeasureThread
 
             return true;
         }
+        
 
     }
 }

+ 5 - 0
MeasureThread/MeasureThread.csproj

@@ -38,6 +38,7 @@
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
@@ -51,6 +52,10 @@
     <Compile Include="ThreadStatus.cs" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\FileManager\FileManager.csproj">
+      <Project>{14c99f54-b3c2-47cf-adb3-e79fdd2d382f}</Project>
+      <Name>FileManager</Name>
+    </ProjectReference>
     <ProjectReference Include="..\SmartSEMControl\SmartSEMControl.csproj">
       <Project>{bf7f80b0-a6da-4470-a331-4c96057fc7fa}</Project>
       <Name>SmartSEMControl</Name>

+ 6 - 0
WindowsFormsApp1/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
+    </startup>
+</configuration>

+ 405 - 0
WindowsFormsApp1/MainForm.Designer.cs

@@ -0,0 +1,405 @@
+namespace WindowsFormsApp1
+{
+    partial class MainForm
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.btnOpenFile = new System.Windows.Forms.Button();
+            this.btnSaveFile = new System.Windows.Forms.Button();
+            this.btnNewFile = new System.Windows.Forms.Button();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button7 = new System.Windows.Forms.Button();
+            this.button6 = new System.Windows.Forms.Button();
+            this.button5 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
+            this.btnLoadCutHoles = new System.Windows.Forms.Button();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.btParamOK = new System.Windows.Forms.Button();
+            this.btFIB = new System.Windows.Forms.Button();
+            this.tBFIBTemp = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.tBSampleName = new System.Windows.Forms.TextBox();
+            this.cBIsManul = new System.Windows.Forms.CheckBox();
+            this.cBIsPT = new System.Windows.Forms.CheckBox();
+            this.LogText = new System.Windows.Forms.TextBox();
+            this.CutHoleGridView = new System.Windows.Forms.DataGridView();
+            this.Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.X = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Z = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.M = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.R = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.T = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.groupBox3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.CutHoleGridView)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.btnOpenFile);
+            this.groupBox1.Controls.Add(this.btnSaveFile);
+            this.groupBox1.Controls.Add(this.btnNewFile);
+            this.groupBox1.Location = new System.Drawing.Point(12, 12);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(455, 81);
+            this.groupBox1.TabIndex = 1;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "测量文件操作";
+            // 
+            // btnOpenFile
+            // 
+            this.btnOpenFile.Location = new System.Drawing.Point(235, 28);
+            this.btnOpenFile.Name = "btnOpenFile";
+            this.btnOpenFile.Size = new System.Drawing.Size(102, 37);
+            this.btnOpenFile.TabIndex = 2;
+            this.btnOpenFile.Text = "打开";
+            this.btnOpenFile.UseVisualStyleBackColor = true;
+            this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
+            // 
+            // btnSaveFile
+            // 
+            this.btnSaveFile.Location = new System.Drawing.Point(127, 28);
+            this.btnSaveFile.Name = "btnSaveFile";
+            this.btnSaveFile.Size = new System.Drawing.Size(102, 37);
+            this.btnSaveFile.TabIndex = 1;
+            this.btnSaveFile.Text = "保存";
+            this.btnSaveFile.UseVisualStyleBackColor = true;
+            this.btnSaveFile.Click += new System.EventHandler(this.btnSaveFile_Click);
+            // 
+            // btnNewFile
+            // 
+            this.btnNewFile.Location = new System.Drawing.Point(19, 28);
+            this.btnNewFile.Name = "btnNewFile";
+            this.btnNewFile.Size = new System.Drawing.Size(102, 37);
+            this.btnNewFile.TabIndex = 0;
+            this.btnNewFile.Text = "新建";
+            this.btnNewFile.UseVisualStyleBackColor = true;
+            this.btnNewFile.Click += new System.EventHandler(this.btnNewFile_Click);
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.button1);
+            this.groupBox2.Controls.Add(this.button7);
+            this.groupBox2.Controls.Add(this.button6);
+            this.groupBox2.Controls.Add(this.button5);
+            this.groupBox2.Controls.Add(this.button4);
+            this.groupBox2.Controls.Add(this.button3);
+            this.groupBox2.Controls.Add(this.btnLoadCutHoles);
+            this.groupBox2.Location = new System.Drawing.Point(12, 99);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(455, 130);
+            this.groupBox2.TabIndex = 2;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "测量流程";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(343, 81);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(102, 37);
+            this.button1.TabIndex = 6;
+            this.button1.Text = "截面";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button7
+            // 
+            this.button7.Location = new System.Drawing.Point(235, 81);
+            this.button7.Name = "button7";
+            this.button7.Size = new System.Drawing.Size(102, 37);
+            this.button7.TabIndex = 5;
+            this.button7.Text = "分析位置";
+            this.button7.UseVisualStyleBackColor = true;
+            this.button7.Click += new System.EventHandler(this.button7_Click);
+            // 
+            // button6
+            // 
+            this.button6.Location = new System.Drawing.Point(127, 81);
+            this.button6.Name = "button6";
+            this.button6.Size = new System.Drawing.Size(102, 37);
+            this.button6.TabIndex = 4;
+            this.button6.Text = "切割";
+            this.button6.UseVisualStyleBackColor = true;
+            this.button6.Click += new System.EventHandler(this.button6_Click);
+            // 
+            // button5
+            // 
+            this.button5.Location = new System.Drawing.Point(19, 81);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(102, 37);
+            this.button5.TabIndex = 3;
+            this.button5.Text = "定位";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(235, 38);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(102, 37);
+            this.button4.TabIndex = 2;
+            this.button4.Text = "停止";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(127, 38);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(102, 37);
+            this.button3.TabIndex = 1;
+            this.button3.Text = "启动";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
+            // btnLoadCutHoles
+            // 
+            this.btnLoadCutHoles.Location = new System.Drawing.Point(19, 38);
+            this.btnLoadCutHoles.Name = "btnLoadCutHoles";
+            this.btnLoadCutHoles.Size = new System.Drawing.Size(102, 37);
+            this.btnLoadCutHoles.TabIndex = 0;
+            this.btnLoadCutHoles.Text = "导入切孔";
+            this.btnLoadCutHoles.UseVisualStyleBackColor = true;
+            this.btnLoadCutHoles.Click += new System.EventHandler(this.btnLoadCutHoles_Click);
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Controls.Add(this.btParamOK);
+            this.groupBox3.Controls.Add(this.btFIB);
+            this.groupBox3.Controls.Add(this.tBFIBTemp);
+            this.groupBox3.Controls.Add(this.label2);
+            this.groupBox3.Controls.Add(this.label1);
+            this.groupBox3.Controls.Add(this.tBSampleName);
+            this.groupBox3.Controls.Add(this.cBIsManul);
+            this.groupBox3.Controls.Add(this.cBIsPT);
+            this.groupBox3.Location = new System.Drawing.Point(13, 235);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(454, 109);
+            this.groupBox3.TabIndex = 3;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "测量参数";
+            // 
+            // btParamOK
+            // 
+            this.btParamOK.Location = new System.Drawing.Point(342, 67);
+            this.btParamOK.Name = "btParamOK";
+            this.btParamOK.Size = new System.Drawing.Size(102, 37);
+            this.btParamOK.TabIndex = 7;
+            this.btParamOK.Text = "确定";
+            this.btParamOK.UseVisualStyleBackColor = true;
+            this.btParamOK.Click += new System.EventHandler(this.btParamOK_Click);
+            // 
+            // btFIB
+            // 
+            this.btFIB.Location = new System.Drawing.Point(185, 60);
+            this.btFIB.Name = "btFIB";
+            this.btFIB.Size = new System.Drawing.Size(43, 27);
+            this.btFIB.TabIndex = 6;
+            this.btFIB.Text = "...";
+            this.btFIB.UseVisualStyleBackColor = true;
+            this.btFIB.Click += new System.EventHandler(this.btFIB_Click);
+            // 
+            // tBFIBTemp
+            // 
+            this.tBFIBTemp.Location = new System.Drawing.Point(85, 59);
+            this.tBFIBTemp.Name = "tBFIBTemp";
+            this.tBFIBTemp.ReadOnly = true;
+            this.tBFIBTemp.Size = new System.Drawing.Size(100, 28);
+            this.tBFIBTemp.TabIndex = 5;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(17, 69);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(71, 18);
+            this.label2.TabIndex = 4;
+            this.label2.Text = "FIB模板";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(206, 31);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(80, 18);
+            this.label1.TabIndex = 3;
+            this.label1.Text = "样品名称";
+            // 
+            // tBSampleName
+            // 
+            this.tBSampleName.Location = new System.Drawing.Point(288, 28);
+            this.tBSampleName.Name = "tBSampleName";
+            this.tBSampleName.Size = new System.Drawing.Size(100, 28);
+            this.tBSampleName.TabIndex = 2;
+            // 
+            // cBIsManul
+            // 
+            this.cBIsManul.AutoSize = true;
+            this.cBIsManul.Location = new System.Drawing.Point(94, 28);
+            this.cBIsManul.Name = "cBIsManul";
+            this.cBIsManul.Size = new System.Drawing.Size(106, 22);
+            this.cBIsManul.TabIndex = 1;
+            this.cBIsManul.Text = "手动对焦";
+            this.cBIsManul.UseVisualStyleBackColor = true;
+            // 
+            // cBIsPT
+            // 
+            this.cBIsPT.AutoSize = true;
+            this.cBIsPT.Location = new System.Drawing.Point(18, 28);
+            this.cBIsPT.Name = "cBIsPT";
+            this.cBIsPT.Size = new System.Drawing.Size(70, 22);
+            this.cBIsPT.TabIndex = 0;
+            this.cBIsPT.Text = "有PT";
+            this.cBIsPT.UseVisualStyleBackColor = true;
+            // 
+            // LogText
+            // 
+            this.LogText.Location = new System.Drawing.Point(473, 12);
+            this.LogText.Multiline = true;
+            this.LogText.Name = "LogText";
+            this.LogText.Size = new System.Drawing.Size(315, 332);
+            this.LogText.TabIndex = 15;
+            // 
+            // CutHoleGridView
+            // 
+            dataGridViewCellStyle4.BackColor = System.Drawing.Color.Beige;
+            dataGridViewCellStyle4.Font = new System.Drawing.Font("Verdana", 8F, System.Drawing.FontStyle.Bold);
+            this.CutHoleGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
+            this.CutHoleGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.CutHoleGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.Name,
+            this.X,
+            this.Y,
+            this.Z,
+            this.M,
+            this.R,
+            this.T});
+            this.CutHoleGridView.Location = new System.Drawing.Point(12, 350);
+            this.CutHoleGridView.Name = "CutHoleGridView";
+            this.CutHoleGridView.ReadOnly = true;
+            this.CutHoleGridView.RowTemplate.Height = 30;
+            this.CutHoleGridView.Size = new System.Drawing.Size(776, 263);
+            this.CutHoleGridView.TabIndex = 16;
+            // 
+            // Name
+            // 
+            this.Name.Name = "Name";
+            this.Name.ReadOnly = true;
+            // 
+            // X
+            // 
+            this.X.Name = "X";
+            this.X.ReadOnly = true;
+            // 
+            // Y
+            // 
+            this.Y.Name = "Y";
+            this.Y.ReadOnly = true;
+            // 
+            // Z
+            // 
+            this.Z.Name = "Z";
+            this.Z.ReadOnly = true;
+            // 
+            // M
+            // 
+            this.M.Name = "M";
+            this.M.ReadOnly = true;
+            // 
+            // R
+            // 
+            this.R.Name = "R";
+            this.R.ReadOnly = true;
+            // 
+            // T
+            // 
+            this.T.Name = "T";
+            this.T.ReadOnly = true;
+            // 
+            // MainForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 622);
+            this.Controls.Add(this.CutHoleGridView);
+            this.Controls.Add(this.LogText);
+            this.Controls.Add(this.groupBox3);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.groupBox1);
+            //this.Name = "MainForm";
+            this.Text = "测量流程测试";
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox3.ResumeLayout(false);
+            this.groupBox3.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.CutHoleGridView)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Button btnOpenFile;
+        private System.Windows.Forms.Button btnSaveFile;
+        private System.Windows.Forms.Button btnNewFile;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.Button button7;
+        private System.Windows.Forms.Button button6;
+        private System.Windows.Forms.Button button5;
+        private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button btnLoadCutHoles;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.CheckBox cBIsManul;
+        private System.Windows.Forms.CheckBox cBIsPT;
+        private System.Windows.Forms.TextBox tBFIBTemp;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox tBSampleName;
+        private System.Windows.Forms.Button btParamOK;
+        private System.Windows.Forms.Button btFIB;
+        private System.Windows.Forms.DataGridView CutHoleGridView;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Name;
+        private System.Windows.Forms.DataGridViewTextBoxColumn X;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Y;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Z;
+        private System.Windows.Forms.DataGridViewTextBoxColumn M;
+        private System.Windows.Forms.DataGridViewTextBoxColumn R;
+        private System.Windows.Forms.DataGridViewTextBoxColumn T;
+        private System.Windows.Forms.TextBox LogText;
+    }
+}
+

+ 263 - 0
WindowsFormsApp1/MainForm.cs

@@ -0,0 +1,263 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+using MeasureData;
+using MeasureThread;
+
+namespace WindowsFormsApp1
+{
+    public partial class MainForm : Form
+    {
+        #region 成员变量
+        private BackgroundWorker m_BackgroundWorker;// 申明后台对象
+        /// <summary>
+        /// 测量文件
+        /// </summary>
+        public MeasureFile m_MeasureFile;
+        
+        /// 测量线程  
+        public Measure m_Ms;
+        
+        #endregion
+        #region 构造函数
+        public MainForm()
+        {
+            InitializeComponent();
+
+            m_BackgroundWorker = new BackgroundWorker(); // 实例化后台对象 
+            m_BackgroundWorker.WorkerReportsProgress = true; // 设置可以通告进度 
+            m_BackgroundWorker.WorkerSupportsCancellation = true; // 设置可以取消 
+            m_BackgroundWorker.DoWork += new DoWorkEventHandler(DoWork);
+            m_BackgroundWorker.ProgressChanged += new ProgressChangedEventHandler(UpdateProgress);
+            m_BackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompletedWork);
+        }
+        #endregion
+        #region 测量线程
+        void DoWork(object sender, DoWorkEventArgs e)
+        {
+            m_Ms = new Measure();
+            m_Ms.InitMeas(m_MeasureFile);
+            m_Ms.SendThreadStatus += new ThreadStatusHandler(displayMessage); //注册事件
+
+            //自动测量的全过程
+            m_Ms.DoMeasure();
+            //定位
+            //切割
+            //分析位置
+            //截面
+
+        }
+
+        public void displayMessage(object sender, ThreadStatusEventArgs e)
+        {
+            //主界面显示内容
+            this.BeginInvoke((Action)delegate
+            {
+                this.LogText.Text += e.Time.ToString() + e.State + "\n";
+            });
+        }
+
+        void UpdateProgress(object sender, ProgressChangedEventArgs e)
+        {
+        }
+        void CompletedWork(object sender, RunWorkerCompletedEventArgs e)
+        {
+        }
+        #endregion
+        #region 按钮操作
+        /// <summary>
+        /// 新建文件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnNewFile_Click(object sender, EventArgs e)
+        {
+            m_MeasureFile = new MeasureFile();
+            if (!m_MeasureFile.New())
+            {
+                return;
+            }
+            else
+            {
+                MessageBox.Show("新建测量文件成功。");
+            }
+        }
+
+        /// <summary>
+        /// 保存文件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnSaveFile_Click(object sender, EventArgs e)
+        {
+            if (m_MeasureFile == null)
+            {
+                MessageBox.Show("请新建一个测量文件");
+            }
+            else
+            {
+                m_MeasureFile.Save();                
+            }
+        }
+
+        /// <summary>
+        /// 打开文件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnOpenFile_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        /// <summary>
+        /// 停止
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button4_Click(object sender, EventArgs e)
+        {
+            if (m_BackgroundWorker.IsBusy)
+            {
+                m_BackgroundWorker.CancelAsync();
+            }
+
+        }
+
+        /// <summary>
+        /// 加载切割孔
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnLoadCutHoles_Click(object sender, EventArgs e)
+        {
+            if (m_MeasureFile == null)
+            {
+                MessageBox.Show("请新建一个测量文件");
+            }
+            else
+            {
+                if (!m_MeasureFile.GetCutHolesFromFile(""))
+                {
+                    MessageBox.Show("导入切孔失败");
+                }
+
+                this.CutHoleGridView.Rows.Clear();
+                List<CutHole> listHoles = m_MeasureFile.ListCutHole;
+                foreach (CutHole hole in listHoles)
+                {
+                    //在CutHoleGridView中,添加切孔信息
+                    int index = this.CutHoleGridView.Rows.Add();
+                    this.CutHoleGridView.Rows[index].Cells[0].Value = hole.HoleName;
+
+                    SemPosition pos = hole.Position;
+                    this.CutHoleGridView.Rows[index].Cells[1].Value = pos.X;
+                    this.CutHoleGridView.Rows[index].Cells[2].Value = pos.Y;
+                    this.CutHoleGridView.Rows[index].Cells[3].Value = pos.Z;
+                    this.CutHoleGridView.Rows[index].Cells[4].Value = pos.M;
+                    this.CutHoleGridView.Rows[index].Cells[5].Value = pos.R;
+                    this.CutHoleGridView.Rows[index].Cells[6].Value = pos.T;
+                }
+            }
+        }
+
+        /// <summary>
+        /// 启动
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void button3_Click(object sender, EventArgs e)
+        {
+            if (m_MeasureFile == null)
+            {
+                MessageBox.Show("请新建一个测量文件");
+            }
+            else
+            {
+                if (m_BackgroundWorker.IsBusy)
+                {
+                    MessageBox.Show("线程已经运行");
+                    return;
+                }
+                m_BackgroundWorker.RunWorkerAsync(this);
+            }
+        }
+
+        /// <summary>
+        /// 调区FIB模板
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btFIB_Click(object sender, EventArgs e)
+        {
+            string FilePathName;
+            string fileNameWithoutExtension;
+            //新建一个文件对话框
+            OpenFileDialog pOpenFileDialog = new OpenFileDialog();
+            //设置对话框标题
+            pOpenFileDialog.Title = "选择模板文件";
+            //设置打开文件类型
+            pOpenFileDialog.Filter = "ely文件(*.ely)|*.ely";
+            //监测文件是否存在
+            pOpenFileDialog.CheckFileExists = true;
+            //文件打开后执行以下程序
+            if (pOpenFileDialog.ShowDialog() == DialogResult.OK)
+            {
+                FilePathName = System.IO.Path.GetFullPath(pOpenFileDialog.FileName);                             //绝对路径
+                fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(FilePathName);
+                this.tBFIBTemp.Text = fileNameWithoutExtension;
+            }
+        }
+
+        private void btParamOK_Click(object sender, EventArgs e)
+        {
+            if (m_MeasureFile == null)
+            {
+                MessageBox.Show("请新建一个测量文件");
+                this.LogText.Text += "请新建一个测量文件";
+            }
+            else
+            {
+                m_MeasureFile.MParam.PT = this.cBIsPT.Checked;
+                m_MeasureFile.MParam.SampleName = this.tBSampleName.Text;
+                m_MeasureFile.MParam.FIBTemp = this.tBFIBTemp.Text;
+                m_MeasureFile.MParam.FocusMode = this.cBIsManul.Checked;
+
+                MessageBox.Show("参数设置成功");
+            }
+        }
+
+        #endregion
+
+        //定位操作
+        private void button5_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        //切割操作
+        private void button6_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        //分析位置操作
+        private void button7_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        //观测截面
+        private void button1_Click(object sender, EventArgs e)
+        {
+
+        }
+    }
+}

+ 120 - 0
WindowsFormsApp1/MainForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 101 - 0
WindowsFormsApp1/ManulDo.csproj

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{513BBFDA-D2A1-4D4F-ADD0-01A19485533A}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>WindowsFormsApp1</RootNamespace>
+    <AssemblyName>ManulDo</AssemblyName>
+    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="MainForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="MainForm.Designer.cs">
+      <DependentUpon>MainForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="MainForm.resx">
+      <DependentUpon>MainForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\FileManager\FileManager.csproj">
+      <Project>{14c99f54-b3c2-47cf-adb3-e79fdd2d382f}</Project>
+      <Name>FileManager</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeasureData\MeasureData.csproj">
+      <Project>{12617585-8d9a-4ad4-b6c4-6894a48cee9e}</Project>
+      <Name>MeasureData</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeasureThread\MeasureThread.csproj">
+      <Project>{9a5851e4-73fd-48e1-876c-68bed40a0512}</Project>
+      <Name>MeasureThread</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\SmartSEMControl\SmartSEMControl.csproj">
+      <Project>{bf7f80b0-a6da-4470-a331-4c96057fc7fa}</Project>
+      <Name>SmartSEMControl</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 22 - 0
WindowsFormsApp1/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace WindowsFormsApp1
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new MainForm());
+        }
+    }
+}

+ 36 - 0
WindowsFormsApp1/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("WindowsFormsApp1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WindowsFormsApp1")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("513bbfda-d2a1-4d4f-add0-01a19485533a")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
WindowsFormsApp1/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace WindowsFormsApp1.Properties
+{
+
+
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   覆盖当前线程的 CurrentUICulture 属性
+        ///   使用此强类型的资源类的资源查找。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
WindowsFormsApp1/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
WindowsFormsApp1/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace WindowsFormsApp1.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
WindowsFormsApp1/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>