浏览代码

Merge branch 'master' of http://192.168.1.123:10080/SDD1/HOZ

HaoShuang 5 年之前
父节点
当前提交
067ad458bf

+ 4 - 8
FileManager/XmlManager.cs

@@ -48,9 +48,8 @@ namespace FileManager
         /// 获取Xml文件中节点内的信息
         /// </summary>
         /// <param name="xmlfullname">Xml文件的全路径</param>
-        /// <param name="measureCode">线程编号</param>
         /// <returns></returns>
-        public static XmlNodeList GetXmlMeasureFlowNodeInfo(String xmlfullname, string measureCode)
+        public static XmlNodeList GetXmlMeasureFlowNodeInfo(String xmlfullname)
         {
             try
             {
@@ -63,12 +62,9 @@ namespace FileManager
                 XmlNodeList nodeChildList = null;
                 foreach (XmlNode item in nodeList)
                 {
-                    if (item.Attributes["Code"].Value == measureCode)
-                    {
-                        //获取当前节点下的所有信息
-                        nodeChildList = item.ChildNodes;
-                        break;
-                    }
+                    //获取当前节点下的所有信息
+                    nodeChildList = item.ChildNodes;
+                    break;
                 }
                 return nodeChildList;
             }

+ 3 - 0
HOZ.sln

@@ -8,6 +8,9 @@ EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartSEMControl", "SmartSEMControl\SmartSEMControl.csproj", "{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeasureThread", "MeasureThread\MeasureThread.csproj", "{9A5851E4-73FD-48E1-876C-68BED40A0512}"
+	ProjectSection(ProjectDependencies) = postProject
+		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E} = {12617585-8D9A-4AD4-B6C4-6894A48CEE9E}
+	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoDo", "AutoDo\AutoDo.csproj", "{0938309A-9C6B-4F93-8638-C94EA58487ED}"
 EndProject

+ 11 - 1
HOZProject/App.config

@@ -18,7 +18,7 @@
       <add key="WQGF" value="100,200,300"/>
       <!--拉直操作需要的放大倍数_数据源-->
       <add key="WLZ" value="100,200,300"/>
-      <add key="ConfigFilePath" value="E:/ConfigFile"/>
+      <add key="TemplateFilePath" value="E:\TemplateFilePath"/>
       <!--PT使用的ELY文件-->
       <add key="PT_ELYFile" value=""/>
       <!--FIB使用的ELY文件-->
@@ -43,5 +43,15 @@
       <add key="Is_Photograph" value="True"/>
       <!--是否PT沉积-->
       <add key="PT_Depostion" value="False"/>
+      
+      <!--自动对焦模式,手动1,自有2,客户3-->
+      <add key="Focus_Mode" value="2"/>
+
+      <!--远程IP地址-->
+      <add key="WebServerIP" value="127.0.0.1"/>
+      <!--远程IP端口-->
+      <add key="WebServerPort" value="12345"/>
+      <!--远程算法地址-->
+      <add key="WebServerUrl" value="FIB_degree_recognize,test2,FIB_verify,test4,test5,test6,test7,test8"/>
     </appSettings>
 </configuration>

+ 21 - 1
HOZProject/FormHOZMain.cs

@@ -4,8 +4,10 @@ using MeasureThread;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Configuration;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -40,6 +42,10 @@ namespace HOZProject
         /// 初始化用户控件
         /// </summary>
         UControl_Init uControl_Init = null;
+        //流程控制
+        public int m_MeasureType = (int)MeasureMsgManage.measureType.FIB;
+
+        Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
         #endregion
 
         #region 构造函数
@@ -62,7 +68,9 @@ namespace HOZProject
         #region 测量线程
         void DoWork(object sender, DoWorkEventArgs e)
         {
-            m_Ms = new Measure();
+            m_Ms = new Measure(ConfigurationManager.AppSettings["WebServerIP"].ToString(),
+                ConfigurationManager.AppSettings["WebServerPort"].ToString(),
+                ConfigurationManager.AppSettings["WebServerUrl"].ToString());
             m_Ms.InitMeas(m_MeasureFile);
             m_Ms.SendThreadStatus += new ThreadStatusHandler(displayMessage); //注册事件
             m_Ms.SendCutHolesStatus += new CutHolesStatusHandler(displayCutHoleMessage); //注册事件
@@ -284,6 +292,8 @@ namespace HOZProject
             else
             {
                 m_MeasureFile.Save();
+                //将初始化中的参数,配置到测量参数中
+                m_MeasureFile.MParam = uControl_Init.GetMeasureParamInfo();
             }
         }
 
@@ -316,8 +326,18 @@ namespace HOZProject
 
         private void pbImportTemplateFile_Click(object sender, EventArgs e)
         {
+            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+            string m_TemplateFilePath = config.AppSettings.Settings["TemplateFilePath"].Value.ToString();
+            //判断保存的路径是否存在
+            if (!Directory.Exists(m_TemplateFilePath))
+            {
+                //创建路径
+                Directory.CreateDirectory(m_TemplateFilePath);
+            }
             //打开默认路径
             OpenFileDialog openFileDialog = new OpenFileDialog();
+            //设置默认打开路径(绝对路径)
+            openFileDialog.InitialDirectory = m_TemplateFilePath;
             openFileDialog.Filter = "样品参数文件|*.cfg";
             if (openFileDialog.ShowDialog() == DialogResult.OK)
             {

+ 9 - 9
HOZProject/FormUnitControl.cs

@@ -38,7 +38,7 @@ namespace HOZProject
         private String path = Directory.GetCurrentDirectory();
         private int st_flag = 0;
 
-        WebResult wr = new WebResult("127.0.0.1", "18080");
+        WebResult wr = new WebResult("127.0.0.1", "18080","");
 
         String[] sT;
         String[] firms;
@@ -686,7 +686,7 @@ namespace HOZProject
             md.PT = true;
             md.PTTemp = "bbbbb";
             md.FIBTemp = "cccc";
-            md.FocusMode = false;
+            md.FocusMode = 2;
 
             mf.MParam = md;
 
@@ -1403,18 +1403,18 @@ namespace HOZProject
             cfm.PT = chkWPT.Checked;
             cfm.PTTemp = txtWPTF.Text;
             cfm.FIBTemp = txtWFIBF.Text;
-            cfm.Stretch_Magnification = Convert.ToDouble(cbbWLZ.Text);
-            cfm.Location_Magnification = Convert.ToDouble(cbbWQGF.Text);
-            cfm.Location_Voltage = Convert.ToDouble(cbbWQGD.Text);
-            cfm.Photograph_Magnification = Convert.ToDouble(cbbWPZF.Text);
-            cfm.Photograph_Voltage = Convert.ToDouble(cbbWPZD.Text);
+            cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
+            cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
+            cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
+            cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
+            cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
             if(cbbWXZ.SelectedIndex==0)
             {
-                cfm.Correction_Angle = 36.0;
+                cfm.Correction_Angle = 36;
             }
             else
             {
-                cfm.Correction_Angle = 54.0;
+                cfm.Correction_Angle = 54;
             }
             
             cfm.SampleName = cbbWYP.Text;

+ 6 - 0
HOZProject/MeasureMsgDispose/MeasureMsgManage.cs

@@ -12,6 +12,12 @@ namespace HOZProject
 {
     public class MeasureMsgManage
     {
+        public enum measureType
+        {
+            Photo=0,
+            FIB=1,
+            PT=2
+        }
         /// <summary>
         /// 线程消息处理,显示内容
         /// </summary>

+ 47 - 135
HOZProject/MeasureXML/MeasureStructXml.xml

@@ -1,141 +1,53 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <MeasureList>
-  <MeasureFlow Code="1" Name="拍照">
-    <Step Index="0" Name="" Code="1-0" IsData="False" Title="移动至切割位置" Details="自动定位切割位置"></Step>
-    <Step Index="1" Name="" Code="1-1" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-    <Step Index="2" Name="" Code="1-2" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-    <Step Index="3" Name="" Code="1-3" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-    <Step Index="4" Name="" Code="1-4" IsData="False" Title="保存照片" Details="保存照片"></Step>
-    <Step Index="5" Name="" Code="1-5" IsData="False" Title="保存信息" Details="保存切孔位置坐标,保存客户返回值信息"></Step>
-
-    <Step Index="6" Name="" Code="1-6" IsData="False" Title="移动至切割位置" Details="自动定位切割位置"></Step>
-    <Step Index="7" Name="" Code="1-7" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-    <Step Index="8" Name="" Code="1-8" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-    <Step Index="9" Name="" Code="1-9" IsData="True" Title="拍照" Details="控制SEM拍照"></Step>
-    <Step Index="10" Name="" Code="1-10" IsData="True" Title="获取偏移信息" Details="显示照片,获取偏移坐标,以及偏移角度"></Step>
-    <Step Index="11" Name="" Code="1-11" IsData="False" Title="移动至切孔位置" Details="根据坐标控制SEM移动到切孔位置,居中"></Step>
-    <Step Index="12" Name="" Code="1-12" IsData="False" Title="验证移动准确性" Details="获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-
-    <Step Index="13" Name="" Code="1-13" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-    <Step Index="14" Name="" Code="1-14" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-    <Step Index="15" Name="" Code="1-15" IsData="False" Title="角度补偿" Details="设置SEM角度补偿"></Step>
-    <Step Index="16" Name="" Code="1-16" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-    <Step Index="17" Name="" Code="1-17" IsData="False" Title="保存照片" Details="设置图片名称、保存图片"></Step>
-    <Step Index="18" Name="" Code="1-18" IsData="True" Title="获取偏移坐标" Details="将照片传给客户,获取偏移坐标"></Step>
-    <Step Index="19" Name="" Code="1-19" IsData="False" Title="移动至分析位置" Details="根据坐标控制SEM移动到分析位置"></Step>
-    <Step Index="20" Name="" Code="1-20" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
+  <MeasureFlow Name="测量流程">
+      <Step Index="0" Name="" Code="1-0" IsData="False" Type="Pt" Title="PT沉积" Details="自动根据样品类型参数确定是否需要PT沉积"></Step>
+      <Step Index="1" Name="" Code="1-1" IsData="False" Type="State" Title="移动至切割位置" Details="自动定位切割位置"></Step>
+      <Step Index="2" Name="" Code="1-2" IsData="False" Type="Photo" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
+      <Step Index="3" Name="" Code="1-3" IsData="True" Type="Photo" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
+      <Step Index="4" Name="" Code="1-4" IsData="False" Type="Photo" Title="角度补偿" Details="设置SEM进行角度补偿"></Step>
+      <Step Index="5" Name="" Code="1-5" IsData="True" Type="Photo" Title="拍照保存照片" Details="控制SEM对分析位置拍照保存照片"></Step>
+      <Step Index="6" Name="" Code="1-6" IsData="False" Type="FIB" Title="切换到FIB模式" Details="切换到FIB模式"></Step>
+      <Step Index="7" Name="" Code="1-7" IsData="True" Type="FIB" Title="FIB拍照保存照片" Details="FIB拍照保存照片"></Step>
+      <Step Index="8" Name="" Code="1-8" IsData="True" Type="Stage" Title="样品台移动到指定位置" Details="将照片传给客户,返回梯形位置坐标,及样品类型参数"></Step>
+      <Step Index="9" Name="" Code="1-9" IsData="False" Type="Stage" Title="验证移动位置" Details="验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
+      <Step Index="10" Name="" Code="1-10" IsData="False" Type="Photo" Title="PT沉积" Details="根据配置文件进行PT沉积"></Step>
+      <Step Index="11" Name="" Code="1-11" IsData="True" Type="Position" Title="保存六轴坐标" Details="将六轴坐标保存到数据库中"></Step>
+
+      <Step Index="12" Name="" Code="1-12" IsData="False" Type="FIB" Title="FIB进行切割" Details="控制FIB进行切割"></Step>
+      <Step Index="13" Name="" Code="1-13" IsData="False" Type="FIB" Title="设置FIB放大倍数" Details="控制SEM放大倍数"></Step>
+      <Step Index="14" Name="" Code="1-14" IsData="False" Type="Photo" Title="保存照片" Details="保存照片"></Step>
+      <Step Index="15" Name="" Code="1-15" IsData="False" Type="Photo" Title="验证移动准确性" Details="验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比"></Step>
+      <Step Index="16" Name="" Code="1-16" IsData="False" Type="State" Title="FIB切割状态" Details="FIB切割成功或失败"></Step>
     
-    <Step Index="21" Name="" Code="1-21" IsData="False" Title="平行校正" Details="控制SEM平行校正,并记录校正前初始值"></Step>
-    <Step Index="22" Name="" Code="1-22" IsData="False" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
-    <Step Index="23" Name="" Code="1-23" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
-    <Step Index="24" Name="" Code="1-24" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-    <Step Index="25" Name="" Code="1-25" IsData="False" Title="保存照片" Details="设置图片名称、保存图片"></Step>
-    <Step Index="26" Name="" Code="1-26" IsData="False" Title="取消电子束校正并初始化" Details="控制SEM取消电子束校正,回到初始值"></Step>
-    <Step Index="27" Name="" Code="1-27" IsData="False" Title="自动能谱分析" Details="确定能谱位置、控制牛津打能谱、能谱分析-面扫+线扫"></Step>
-    <Step Index="28" Name="" Code="1-28" IsData="False" Title="初始化" Details="多切孔进行初始化操作"></Step>
-  </MeasureFlow>
-  <MeasureFlow Code="2" Name="切割">
-      <Step Index="0" Name="" Code="2-0" IsData="False" Title="移动至切割位置" Details="自动定位切割位置"></Step>
-      <Step Index="1" Name="" Code="2-1" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="2" Name="" Code="2-2" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-      <Step Index="3" Name="" Code="2-3" IsData="False" Title="角度补偿" Details="设置SEM进行角度补偿"></Step>
-      <Step Index="4" Name="" Code="2-4" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-      <Step Index="5" Name="" Code="2-5" IsData="False" Title="保存照片" Details="保存照片"></Step>
-      <Step Index="6" Name="" Code="2-6" IsData="False" Title="FIB拍照参数" Details="设置FIB拍照参数-扫描时间、束流等"></Step>
-      <Step Index="7" Name="" Code="2-7" IsData="False" Title="FIB设置参数" Details="控制FIB自动亮度、对比度"></Step>
-      <Step Index="8" Name="" Code="2-8" IsData="False" Title="FIB拍照" Details=""></Step>
-      <Step Index="9" Name="" Code="2-9" IsData="False" Title="保存照片" Details="保存照片"></Step>
-      <Step Index="10" Name="" Code="2-10" IsData="True" Title="显示照片" Details="将照片传给客户,返回梯形位置坐标,及样品类型参数"></Step>
-      <Step Index="11" Name="" Code="2-11" IsData="False" Title="FIB调整到中心位置" Details="根据梯形坐标控制FIB调整到中心位置"></Step>
-      <Step Index="12" Name="" Code="2-12" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-      <Step Index="13" Name="" Code="2-13" IsData="False" Title="保存信息" Details="保存切孔位置坐标,保存客户返回值信息"></Step>  
+      <Step Index="17" Name="" Code="1-17" IsData="False" Type="Pt" Title="拔出PT针" Details="根据样品类型决定是否撤出PT针"></Step>
+
+      <Step Index="18" Name="" Code="1-18" IsData="False" Type="Photo" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
+      <Step Index="19" Name="" Code="1-19" IsData="True" Type="Photo" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
+      <Step Index="20" Name="" Code="1-20" IsData="True" Type="Photo" Title="拍照显示照片" Details="控制SEM对分析位置拍照"></Step>
+      <Step Index="21" Name="" Code="1-21" IsData="False" Type="Photo" Title="移动到切孔位置" Details="根据坐标控制SEM移动到切孔位置,居中"></Step>
+      <Step Index="22" Name="" Code="1-22" IsData="False" Type="Photo" Title="调整角度" Details="调整角度"></Step>
+      <Step Index="23" Name="" Code="1-23" IsData="False" Type="Photo" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
+      <Step Index="24" Name="" Code="1-24" IsData="False" Type="State" Title="自动调整SEM找切割位置" Details="自动调整SEM找切割位置"></Step>
     
-      <Step Index="14" Name="" Code="2-14" IsData="True" Title="设置FIB参数" Details="根据参数设置FIB扫描时间(使图清晰),设置梯形上下边及深度、设置束流等"></Step>
-      <Step Index="15" Name="" Code="2-15" IsData="False" Title="FIB进行切割" Details="控制FIB进行切割"></Step>
-      <Step Index="16" Name="" Code="2-16" IsData="False" Title="设置FIB放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="17" Name="" Code="2-17" IsData="False" Title="保存照片" Details="保存照片"></Step>
-      <Step Index="18" Name="" Code="2-18" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比"></Step><Step Index="13" Name="" Code="2-13" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="19" Name="" Code="2-19" IsData="False" Title="设置FIB解冻" Details="设置FIB解冻:先读取状态,如果冻结状态则进行解冻"></Step>
-
-      <Step Index="20" Name="" Code="2-20" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="21" Name="" Code="2-21" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-      <Step Index="22" Name="" Code="2-22" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-      <Step Index="23" Name="" Code="2-23" IsData="True" Title="显示照片" Details="获取偏移坐标,以及偏移角度"></Step>
-      <Step Index="24" Name="" Code="2-24" IsData="False" Title="移动到切孔位置" Details="根据坐标控制SEM移动到切孔位置,居中"></Step>
-      <Step Index="25" Name="" Code="2-25" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-
-      <Step Index="26" Name="" Code="2-26" IsData="False" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
-      <Step Index="27" Name="" Code="2-27" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
-      <Step Index="28" Name="" Code="2-28" IsData="False" Title="角度补偿" Details="设置SEM角度补偿"></Step>
-      <Step Index="29" Name="" Code="2-29" IsData="True" Title="保存照片" Details="设置图片名称、保存图片"></Step>
-      <Step Index="30" Name="" Code="2-30" IsData="True" Title="显示照片" Details="获取偏移坐标"></Step>
-      <Step Index="31" Name="" Code="2-31" IsData="False" Title="移动到分析位置" Details="根据坐标控制SEM移动到分析位置"></Step>
-      <Step Index="32" Name="" Code="2-32" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-      
-      <Step Index="33" Name="" Code="2-33" IsData="False" Title="平行校正" Details="控制SEM平行校正,并记录校正前初始值"></Step>
-      <Step Index="34" Name="" Code="2-34" IsData="False" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
-      <Step Index="35" Name="" Code="2-35" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
-      <Step Index="36" Name="" Code="2-36" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-      <Step Index="37" Name="" Code="2-37" IsData="False" Title="保存照片" Details="设置图片名称、保存图片"></Step>
-      <Step Index="38" Name="" Code="2-38" IsData="False" Title="取消电子束校正并初始化" Details="控制SEM取消电子束校正,回到初始值"></Step>
-
-      <Step Index="39" Name="" Code="2-39" IsData="False" Title="传入参数" Details="获取SEM Pixel Size 给客户传入参数"></Step>
-      <Step Index="40" Name="" Code="2-40" IsData="True" Title="显示照片" Details="将照片传给客户,客户进行层高分析"></Step>
-      <Step Index="41" Name="" Code="2-41" IsData="False" Title="自动能谱分析" Details="确定能谱位置、控制牛津打能谱、能谱分析-面扫+线扫"></Step>
-      <Step Index="42" Name="" Code="2-42" IsData="False" Title="初始化" Details="多切孔进行初始化操作"></Step>
-  </MeasureFlow>
-  <MeasureFlow Code="3" Name="PT+切割">
-      <Step Index="0" Name="" Code="3-0" IsData="False" Title="PT沉积" Details="自动根据样品类型参数确定是否需要PT沉积"></Step>
-      <Step Index="1" Name="" Code="3-1" IsData="False" Title="移动至切割位置" Details="自动定位切割位置"></Step>
-      <Step Index="2" Name="" Code="3-2" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="3" Name="" Code="3-3" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-      <Step Index="4" Name="" Code="3-4" IsData="False" Title="角度补偿" Details="设置SEM进行角度补偿"></Step>
-      <Step Index="5" Name="" Code="3-5" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-      <Step Index="6" Name="" Code="3-6" IsData="False" Title="保存照片" Details="保存照片"></Step>
-      <Step Index="7" Name="" Code="3-7" IsData="False" Title="FIB拍照参数" Details="设置FIB拍照参数-扫描时间、束流等"></Step>
-      <Step Index="8" Name="" Code="3-8" IsData="False" Title="FIB设置参数" Details="控制FIB自动亮度、对比度"></Step>
-      <Step Index="9" Name="" Code="3-9" IsData="False" Title="FIB拍照" Details=""></Step>
-      <Step Index="10" Name="" Code="3-10" IsData="False" Title="保存照片" Details="保存照片"></Step>
-      <Step Index="11" Name="" Code="3-11" IsData="True" Title="显示照片" Details="将照片传给客户,返回梯形位置坐标,及样品类型参数"></Step>
-      <Step Index="12" Name="" Code="3-12" IsData="False" Title="PT沉积" Details="自动根据样品类型参数确定是否需要PT沉积"></Step>
-      <Step Index="13" Name="" Code="3-13" IsData="False" Title="FIB调整到中心位置" Details="根据梯形坐标控制FIB调整到中心位置"></Step>
-      <Step Index="14" Name="" Code="3-14" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-      <Step Index="15" Name="" Code="3-15" IsData="False" Title="保存信息" Details="保存切孔位置坐标,保存客户返回值信息"></Step>
-
-      <Step Index="16" Name="" Code="3-16" IsData="True" Title="设置FIB参数" Details="根据参数设置FIB扫描时间(使图清晰),设置梯形上下边及深度、设置束流等"></Step>
-      <Step Index="17" Name="" Code="3-17" IsData="False" Title="FIB进行切割" Details="控制FIB进行切割"></Step>
-      <Step Index="18" Name="" Code="3-18" IsData="False" Title="设置FIB放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="19" Name="" Code="3-19" IsData="False" Title="保存照片" Details="保存照片"></Step>
-      <Step Index="20" Name="" Code="3-20" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比"></Step>
-      <Step Index="21" Name="" Code="3-21" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="22" Name="" Code="3-22" IsData="False" Title="设置FIB解冻" Details="设置FIB解冻:先读取状态,如果冻结状态则进行解冻"></Step>
-      <Step Index="23" Name="" Code="3-23" IsData="False" Title="拔出PT针" Details="根据样品类型决定是否撤出PT针"></Step>
-
-      <Step Index="24" Name="" Code="3-24" IsData="False" Title="设置放大倍数" Details="控制SEM放大倍数"></Step>
-      <Step Index="25" Name="" Code="3-25" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、亮度、对比度"></Step>
-      <Step Index="26" Name="" Code="3-26" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-      <Step Index="27" Name="" Code="3-27" IsData="True" Title="显示照片" Details="获取偏移坐标,以及偏移角度"></Step>
-      <Step Index="28" Name="" Code="3-28" IsData="False" Title="移动到切孔位置" Details="根据坐标控制SEM移动到切孔位置,居中"></Step>
-      <Step Index="29" Name="" Code="3-29" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-
-      <Step Index="30" Name="" Code="3-30" IsData="False" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
-      <Step Index="31" Name="" Code="3-31" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
-      <Step Index="32" Name="" Code="3-32" IsData="False" Title="角度补偿" Details="设置SEM角度补偿"></Step>
-      <Step Index="33" Name="" Code="3-33" IsData="True" Title="保存照片" Details="设置图片名称、保存图片"></Step>
-      <Step Index="34" Name="" Code="3-34" IsData="True" Title="显示照片" Details="获取偏移坐标"></Step>
-      <Step Index="35" Name="" Code="3-35" IsData="False" Title="移动到分析位置" Details="根据坐标控制SEM移动到分析位置"></Step>
-      <Step Index="36" Name="" Code="3-36" IsData="False" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
-
-      <Step Index="37" Name="" Code="3-37" IsData="False" Title="平行校正" Details="控制SEM平行校正,并记录校正前初始值"></Step>
-      <Step Index="38" Name="" Code="3-38" IsData="False" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
-      <Step Index="39" Name="" Code="3-39" IsData="True" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
-      <Step Index="40" Name="" Code="3-40" IsData="True" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
-      <Step Index="41" Name="" Code="3-41" IsData="False" Title="保存照片" Details="设置图片名称、保存图片"></Step>
-      <Step Index="42" Name="" Code="3-42" IsData="False" Title="取消电子束校正并初始化" Details="控制SEM取消电子束校正,回到初始值"></Step>
-
-      <Step Index="43" Name="" Code="3-43" IsData="False" Title="传入参数" Details="获取SEM Pixel Size 给客户传入参数"></Step>
-      <Step Index="44" Name="" Code="3-44" IsData="True" Title="显示照片" Details="将照片传给客户,客户进行层高分析"></Step>
-      <Step Index="45" Name="" Code="3-45" IsData="False" Title="自动能谱分析" Details="确定能谱位置、控制牛津打能谱、能谱分析-面扫+线扫"></Step>
-      <Step Index="46" Name="" Code="3-46" IsData="False" Title="初始化" Details="多切孔进行初始化操作"></Step>
+      <Step Index="25" Name="" Code="1-25" IsData="False" Type="Photo" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
+      <Step Index="26" Name="" Code="1-26" IsData="True" Type="Photo" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
+      <Step Index="27" Name="" Code="1-27" IsData="False" Type="Photo" Title="角度补偿" Details="设置SEM角度补偿"></Step>
+      <Step Index="28" Name="" Code="1-28" IsData="True" Type="Photo" Title="保存照片" Details="设置图片名称、保存图片"></Step>
+      <Step Index="29" Name="" Code="1-29" IsData="True" Type="Photo" Title="获取坐标并移动到对应位置" Details="获取坐标并移动到对应位置"></Step>
+      <Step Index="35" Name="" Code="1-35" IsData="False" Type="Photo" Title="移动到分析位置" Details="根据坐标控制SEM移动到分析位置"></Step>
+      <Step Index="36" Name="" Code="1-36" IsData="False" Type="Photo" Title="验证移动准确性" Details="验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确"></Step>
+
+      <Step Index="37" Name="" Code="1-37" IsData="False" Type="Photo" Title="平行校正" Details="控制SEM平行校正,并记录校正前初始值"></Step>
+      <Step Index="38" Name="" Code="1-38" IsData="False" Type="Photo" Title="设置放大倍数" Details="控制SEM放大到指定参数大小范围"></Step>
+      <Step Index="39" Name="" Code="1-39" IsData="True" Type="Photo" Title="自动对焦" Details="控制SEM自动对焦、消像散、亮度、对比度"></Step>
+      <Step Index="40" Name="" Code="1-40" IsData="True" Type="Photo" Title="拍照" Details="控制SEM对分析位置拍照"></Step>
+      <Step Index="41" Name="" Code="1-41" IsData="False" Type="Photo" Title="保存照片" Details="设置图片名称、保存图片"></Step>
+      <Step Index="42" Name="" Code="1-42" IsData="False" Type="Photo" Title="取消电子束校正并初始化" Details="控制SEM取消电子束校正,回到初始值"></Step>
+
+      <Step Index="43" Name="" Code="1-43" IsData="False" Type="Photo" Title="传入参数" Details="获取SEM Pixel Size 给客户传入参数"></Step>
+      <Step Index="44" Name="" Code="1-44" IsData="True" Type="Photo" Title="显示照片" Details="将照片传给客户,客户进行层高分析"></Step>
+      <Step Index="45" Name="" Code="1-45" IsData="False" Type="Photo" Title="自动能谱分析" Details="确定能谱位置、控制牛津打能谱、能谱分析-面扫+线扫"></Step>
+      <Step Index="46" Name="" Code="1-46" IsData="False" Type="Photo" Title="初始化" Details="多切孔进行初始化操作"></Step>
     </MeasureFlow>
 </MeasureList>

+ 27 - 16
HOZProject/UserControls/UCTimeLine.cs

@@ -51,7 +51,6 @@ namespace HOZProject
             set
             {
                 titleFont = value;
-                ReloadItems();
             }
         }
 
@@ -71,7 +70,6 @@ namespace HOZProject
             set
             {
                 titleForcolor = value;
-                ReloadItems();
             }
         }
 
@@ -91,7 +89,6 @@ namespace HOZProject
             set
             {
                 detailsFont = value;
-                ReloadItems();
             }
         }
 
@@ -111,7 +108,6 @@ namespace HOZProject
             set
             {
                 detailsForcolor = value;
-                ReloadItems();
             }
         }
 
@@ -131,13 +127,12 @@ namespace HOZProject
             set
             {
                 items = value;
-                ReloadItems();
             }
         }
         /// <summary>
         /// Initializes a new instance of the <see cref="UCTimeLine"/> class.
         /// </summary>
-        public UCTimeLine(TimeLineItem[] tlItem)
+        public UCTimeLine(TimeLineItem[] tlItem,int measureType)
         {
             this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
             this.SetStyle(ControlStyles.DoubleBuffer, true);
@@ -147,22 +142,15 @@ namespace HOZProject
             this.SetStyle(ControlStyles.UserPaint, true);
             InitializeComponent();
             items = tlItem;
-            //for (int i = 0; i < 4; i++)
-            //{
-            //    items[i] = new TimeLineItem()
-            //    {
-            //        Title = DateTime.Now.AddMonths(-1 * (3 - i)).ToString("yyyy年MM月"),
-            //        Details = DateTime.Now.AddMonths(-1 * (3 - i)).ToString("yyyy年MM月")
-            //    };
-            //}
-            ReloadItems();
+            //加载节点信息
+            ReloadItems(measureType);
 
         }
 
         /// <summary>
         /// Reloads the items.
         /// </summary>
-        public void ReloadItems()
+        public void ReloadItems(int measureType)
         {
             try
             {
@@ -172,6 +160,24 @@ namespace HOZProject
                 {
                     foreach (var item in items)
                     {
+                        switch (measureType)
+                        {
+                            case (int)MeasureMsgManage.measureType.Photo:
+                                if (item.Type.ToUpper() == "PT" || item.Type.ToUpper() == "FIB")
+                                {
+                                    continue;
+                                }
+                                break;
+                            case (int)MeasureMsgManage.measureType.FIB:
+                                if (item.Type.ToUpper() == "PT")
+                                {
+                                    continue;
+                                }
+                                break;
+                            //case (int)MeasureMsgManage.measureType.PT:
+
+                            //    break;
+                        }
                         FlowLayoutPanel panelTitle = new FlowLayoutPanel();
                         panelTitle.Dock = DockStyle.Top;
                         panelTitle.AutoScroll = false;
@@ -305,5 +311,10 @@ namespace HOZProject
         /// </summary>
         /// <value>The IsData.</value>
         public bool IsData { get; set; }
+        /// <summary>
+        /// Gets or sets the Type.
+        /// </summary>
+        /// <value>The Type.</value>
+        public string Type { get; set; }
     }
 }

+ 1 - 0
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -442,6 +442,7 @@
             this.chkWPT.TabIndex = 77;
             this.chkWPT.Text = "是否使用PT";
             this.chkWPT.UseVisualStyleBackColor = true;
+            this.chkWPT.CheckedChanged += new System.EventHandler(this.chkWPT_CheckedChanged);
             // 
             // btnCreateConfig
             // 

+ 103 - 21
HOZProject/UserControls/UControl_Init.cs

@@ -10,6 +10,7 @@ using System.Windows.Forms;
 using MeasureData;
 using System.Configuration;
 using FileManager;
+using System.IO;
 
 namespace HOZProject
 {
@@ -29,6 +30,8 @@ namespace HOZProject
         //模板路径
         private string readConfigPath;
         public string ReadConfigPath { get => readConfigPath; set => readConfigPath = value; }
+        //模板文件默认路径
+        private string m_TemplateFilePath;
         #endregion
 
         #region 构造方法
@@ -102,8 +105,9 @@ namespace HOZProject
             pOpenFileDialog.Title = "选择模板文件";
             //设置打开文件类型
             pOpenFileDialog.Filter = "ely文件(*.ely)|*.ely";
-            //监测文件是否存在
-            pOpenFileDialog.CheckFileExists = true;
+            ////监测文件是否存在
+            //pOpenFileDialog.CheckFileExists = true;
+            
             //文件打开后执行以下程序
             if (pOpenFileDialog.ShowDialog() == DialogResult.OK)
             {
@@ -125,8 +129,8 @@ namespace HOZProject
             pOpenFileDialog.Title = "选择模板文件";
             //设置打开文件类型
             pOpenFileDialog.Filter = "ely文件(*.ely)|*.ely";
-            //监测文件是否存在
-            pOpenFileDialog.CheckFileExists = true;
+            ////监测文件是否存在
+            //pOpenFileDialog.CheckFileExists = true;
             //文件打开后执行以下程序
             if (pOpenFileDialog.ShowDialog() == DialogResult.OK)
             {
@@ -142,31 +146,75 @@ namespace HOZProject
         {
             SaveTemplateFile();
         }
-        private void SaveTemplateFile()
+        /// <summary>
+        /// 获取测量参数,初始化窗体中的控件信息
+        /// </summary>   
+        /// <returns></returns>
+        public MeasureParam GetMeasureParamInfo()
+        {
+            MeasureParam cfm = new MeasureParam();
+            cfm.Is_Photograph = chkWIsP.Checked;
+            cfm.PT = chkWPT.Checked;
+            //自动对焦模式
+            //cfm.FocusMode = chkManul.Checked;
+            cfm.PTTemp = txtWPTF.Text;
+            cfm.FIBTemp = txtWFIBF.Text;
+            cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
+            cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
+            cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
+            cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
+            cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
+            if (cbbWXZ.SelectedIndex == 0)
+            {
+                cfm.Correction_Angle = 36;
+            }
+            else
+            {
+                cfm.Correction_Angle = 54;
+            }
+
+            cfm.SampleName = cbbWYP.Text;
+            cfm.Firm = cbbWCS.Text;
+            return cfm;
+        }
+
+        public void SaveTemplateFile()
         {
             MeasureParam cfm = new MeasureParam();
             cfm.Is_Photograph = chkWIsP.Checked;
             cfm.PT = chkWPT.Checked;
+            //自动对焦模式
+            //cfm.FocusMode = chkManul.Checked;
             cfm.PTTemp = txtWPTF.Text;
             cfm.FIBTemp = txtWFIBF.Text;
-            cfm.Stretch_Magnification = Convert.ToDouble(cbbWLZ.Text);
-            cfm.Location_Magnification = Convert.ToDouble(cbbWQGF.Text);
-            cfm.Location_Voltage = Convert.ToDouble(cbbWQGD.Text);
-            cfm.Photograph_Magnification = Convert.ToDouble(cbbWPZF.Text);
-            cfm.Photograph_Voltage = Convert.ToDouble(cbbWPZD.Text);
+            cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
+            cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
+            cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
+            cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
+            cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
             if (cbbWXZ.SelectedIndex == 0)
             {
-                cfm.Correction_Angle = 36.0;
+                cfm.Correction_Angle = 36;
             }
             else
             {
-                cfm.Correction_Angle = 54.0;
+                cfm.Correction_Angle = 54;
             }
 
             cfm.SampleName = cbbWYP.Text;
             cfm.Firm = cbbWCS.Text;
             ConfigFile cf = new ConfigFile(cfm);
+            if (!m_TemplateFilePath.Equals(""))
+            {
+                if (!Directory.Exists(m_TemplateFilePath))
+                {
+                    //创建路径
+                    Directory.CreateDirectory(m_TemplateFilePath);
+                }
+            }
             SaveFileDialog saveFileDialog = new SaveFileDialog();
+            //设置默认打开路径(绝对路径)
+            saveFileDialog.InitialDirectory = m_TemplateFilePath;
             saveFileDialog.Filter = "样品参数文件|*.cfg";
             if (saveFileDialog.ShowDialog() == DialogResult.OK)
             {
@@ -246,23 +294,25 @@ namespace HOZProject
 
                 MeasureParam cfm = new MeasureParam();
                 cfm.Is_Photograph = chkWIsP.Checked;
+                cfm.FocusMode = Convert.ToInt32(config.AppSettings.Settings["Focus_Mode"].Value);
                 cfm.PT = chkWPT.Checked;
+                //自动对焦模式
+                //cfm.FocusMode = chkManul.Checked;
                 cfm.PTTemp = txtWPTF.Text;
                 cfm.FIBTemp = txtWFIBF.Text;
-                cfm.Stretch_Magnification = Convert.ToDouble(cbbWLZ.Text);
-                cfm.Location_Magnification = Convert.ToDouble(cbbWQGF.Text);
-                cfm.Location_Voltage = Convert.ToDouble(cbbWQGD.Text);
-                cfm.Photograph_Magnification = Convert.ToDouble(cbbWPZF.Text);
-                cfm.Photograph_Voltage = Convert.ToDouble(cbbWPZD.Text);
+                cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
+                cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
+                cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
+                cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
+                cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
                 if (cbbWXZ.SelectedIndex == 0)
                 {
-                    cfm.Correction_Angle = 36.0;
+                    cfm.Correction_Angle = 36;
                 }
                 else
                 {
-                    cfm.Correction_Angle = 54.0;
+                    cfm.Correction_Angle = 54;
                 }
-                
 
                 cfm.SampleName = cbbWYP.Text;
                 cfm.Firm = cbbWCS.Text;
@@ -388,6 +438,7 @@ namespace HOZProject
             cbbWQGF.Items.Clear();
             cbbWLZ.Items.Clear();
 
+            m_TemplateFilePath = config.AppSettings.Settings["TemplateFilePath"].Value.ToString();
             string sample_Type = config.AppSettings.Settings["Sample_Type"].Value.ToString();
             string firm = config.AppSettings.Settings["Firm"].Value.ToString();
             string WPZDTemp = config.AppSettings.Settings["WPZD"].Value.ToString();
@@ -420,6 +471,8 @@ namespace HOZProject
             //设置配置文件默认值
             chkWIsP.Checked=Convert.ToBoolean(config.AppSettings.Settings["Is_Photograph"].Value);
             chkWPT.Checked = Convert.ToBoolean(config.AppSettings.Settings["PT_Depostion"].Value);
+            //自动对焦模式
+            //chkManul.Checked = Convert.ToBoolean(config.AppSettings.Settings["Focus_Mode"].Value);
             txtWPTF.Text = config.AppSettings.Settings["PT_ELYFile"].Value;
             txtWFIBF.Text = config.AppSettings.Settings["FIB_ELYFile"].Value;
             cbbWLZ.Text = config.AppSettings.Settings["Stretch_Magnification"].Value;
@@ -452,6 +505,8 @@ namespace HOZProject
                 cfm.Read(ReadConfigPath);
                 chkWIsP.Checked = cfm.m_Config.Is_Photograph;
                 chkWPT.Checked = cfm.m_Config.PT;
+                //自动对焦模式
+                //cfm.FocusMode = chkManul.Checked;
                 txtWPTF.Text = cfm.m_Config.PTTemp;
                 txtWFIBF.Text = cfm.m_Config.FIBTemp;
                 cbbWLZ.Text = cfm.m_Config.Stretch_Magnification.ToString();
@@ -531,13 +586,40 @@ namespace HOZProject
             {
                 chkWPT.Checked = false;
                 chkWPT.Visible = false;
+                FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.Photo;
             }
             else
             {
                 chkWPT.Visible = true;
+                if (!chkWPT.Checked)
+                {
+                    FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.FIB;
+                }
             }
+            CreateCutHoleList();
         }
         #endregion
-        
+
+        private void CreateCutHoleList()
+        {
+            List<CutHole> ListCutHole = FormHOZMainObject.m_MeasureFile.ListCutHole;
+            FormHOZMainObject.CreateCutHoleList(ListCutHole);
+        }
+
+        private void chkWPT_CheckedChanged(object sender, EventArgs e)
+        {
+            if (chkWPT.Checked)
+            {
+                FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.PT;
+            }
+            else
+            {
+                if (!chkWIsP.Checked)
+                {
+                    FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.FIB;
+                }
+            }
+            CreateCutHoleList();
+        }
     }
 }

+ 8 - 7
HOZProject/UserControls/UControl_ParaInfo.cs

@@ -36,7 +36,6 @@ namespace HOZProject
         private FormHOZMain formHOZMain;
         private TimeLineItem[] tlItem = null;
         private UCTimeLine uCTimeLine=null;
-        private int flowCode = 1;
         public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
         public string StartTime { get => startTime; set => startTime = value; }
         public string EndTime { get => endTime; set => endTime = value; }
@@ -50,7 +49,8 @@ namespace HOZProject
         {
             InitializeComponent();
             FormHOZMainObject = formHOZ;
-            ShowMeasureFlow("1");
+            //显示测量流程
+            ShowMeasureFlow();
         }
 
         private void btnClose_Click(object sender, EventArgs e)
@@ -77,7 +77,7 @@ namespace HOZProject
         {
             if (plTimeLine.Controls.Count == 0)
             {
-                uCTimeLine = new UCTimeLine(tlItem);
+                uCTimeLine = new UCTimeLine(tlItem, FormHOZMainObject.m_MeasureType);
                 uCTimeLine.Dock = DockStyle.Fill;
                 plTimeLine.Controls.Add(uCTimeLine);
             }
@@ -113,21 +113,21 @@ namespace HOZProject
         /// 绑定流程信息
         /// </summary>
         /// <param name="flowCode"></param>
-        private void ShowMeasureFlow(string flowCode)
+        private void ShowMeasureFlow()
         {
             if (TlItem == null)
             {
-                TlItem = GetMeasureFlowStructInfo(flowCode);
+                TlItem = GetMeasureFlowStructInfo();
             }
             if (TlItem != null)
             {
                 ShowUCTimeLine(TlItem);
             }
         }
-        private TimeLineItem[] GetMeasureFlowStructInfo(string MeasureCode)
+        private TimeLineItem[] GetMeasureFlowStructInfo()
         {
             string xmlfullname = Application.StartupPath+ @"\MeasureXML\MeasureStructXml.xml";
-            XmlNodeList nodeList = XmlManager.GetXmlMeasureFlowNodeInfo(xmlfullname, MeasureCode);
+            XmlNodeList nodeList = XmlManager.GetXmlMeasureFlowNodeInfo(xmlfullname);
             if (nodeList != null)
             {
                 return XmlConvertTimeListItem(nodeList);
@@ -146,6 +146,7 @@ namespace HOZProject
                 tlItem.State = -1;
                 tlItem.Title = nodeList[i].Attributes["Title"].Value;
                 tlItem.IsData = Convert.ToBoolean(nodeList[i].Attributes["IsData"].Value);
+                tlItem.Type = nodeList[i].Attributes["Type"].Value;
                 timeLineItem[i] = tlItem;
             }
             return timeLineItem;

+ 0 - 12
MeasureData/MeasureFile.cs

@@ -172,18 +172,6 @@ namespace MeasureData
         //保存
         public bool Save()
         {
-            SaveFileDialog saveFileDialog = new SaveFileDialog();
-            if (saveFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                //获得文件路径  
-                string localFilePath = saveFileDialog.FileName.ToString();
-                //获取文件名,不带路径  
-                string fileNameExt = localFilePath.Substring(localFilePath.LastIndexOf("\\") + 1); 
-                //获取文件路径,不带文件名 
-                string FilePath = localFilePath.Substring(0, localFilePath.LastIndexOf("\\"));
-                this.FilePath = FilePath;
-                this.FileName = fileNameExt;
-            }
             //如果是新文件
             this.FileName.Trim();
             if (string.Compare(this.FileName,UNTITLED_FILE_NAME) == 0)

+ 23 - 22
MeasureData/MeasureParam.cs

@@ -59,57 +59,57 @@ namespace MeasureData
             set { this.m_ptTemp = value; }
         }
 
-        //对焦方式,自动对焦还是手动对焦,手动对焦是1,自动对焦0
-        private bool m_fMode;
-        public bool FocusMode
+        //对焦方式,自动对焦还是手动对焦,手动对焦是1,自有自动对焦2,客户自动对焦3
+        private int m_fMode;
+        public int FocusMode
         {
             get { return m_fMode; }
             set { m_fMode = value; }
         }
 
         //拉直操作需要的放大位数
-        private double stretch_Magnification;
-        public double Stretch_Magnification
+        private float stretch_Magnification;
+        public float Stretch_Magnification
         {
             get { return this.stretch_Magnification; }
             set { this.stretch_Magnification = value; }
         }
 
         //定位切割位置的放大倍数
-        private double location_Magnification;
-        public double Location_Magnification
+        private float location_Magnification;
+        public float Location_Magnification
         {
             get { return this.location_Magnification; }
             set { this.location_Magnification = value; }
         }
 
         //定位切割位置的工作电压
-        private double location_Voltage;
-        public double Location_Voltage
+        private float location_Voltage;
+        public float Location_Voltage
         {
             get { return this.location_Voltage; }
             set { this.location_Voltage = value; }
         }
 
         //拍照的放大倍数
-        private double photograph_Magnification;
-        public double Photograph_Magnification
+        private float photograph_Magnification;
+        public float Photograph_Magnification
         {
             get { return this.photograph_Magnification; }
             set { this.photograph_Magnification = value; }
         }
 
         //拍照的工作电压
-        private double photograph_Voltage;
-        public double Photograph_Voltage
+        private float photograph_Voltage;
+        public float Photograph_Voltage
         {
             get { return this.photograph_Voltage; }
             set { this.photograph_Voltage = value; }
         }
 
         //校正角度选择
-        private double correction_Angle;
-        public double Correction_Angle
+        private float correction_Angle;
+        public float Correction_Angle
         {
             get { return this.correction_Angle; }
             set { this.correction_Angle = value; }
@@ -147,6 +147,7 @@ namespace MeasureData
             this.PT = false;
             this.FIBTemp = @"";
             this.PTTemp = @"";
+            this.FocusMode = 2;
             this.AutoFocus = new FocusParam();
         }
 
@@ -172,7 +173,7 @@ namespace MeasureData
             sFile.Register("FIB_ELYFile", fibELYFile);
 
             //对焦方式
-            xBool focusmode = new xBool();
+            xInt focusmode = new xInt();
             focusmode.AssignValue(this.m_fMode);
             sFile.Register("FocusMode", focusmode);
 
@@ -225,13 +226,13 @@ namespace MeasureData
 
                 this.m_fMode = focusmode.value();
 
-                this.stretch_Magnification = stretchMagnification.value();
-                this.location_Magnification = locationMagnification.value();
-                this.location_Voltage = locationVoltage.value();
-                this.photograph_Magnification = photographMagnification.value();
-                this.photograph_Voltage = photographVoltage.value();
+                this.stretch_Magnification = Convert.ToSingle(stretchMagnification.value());
+                this.location_Magnification = Convert.ToSingle(locationMagnification.value());
+                this.location_Voltage = Convert.ToSingle(locationVoltage.value());
+                this.photograph_Magnification = Convert.ToSingle(photographMagnification.value());
+                this.photograph_Voltage = Convert.ToSingle(photographVoltage.value());
 
-                this.correction_Angle = correctionAngle.value();
+                this.correction_Angle = Convert.ToSingle(correctionAngle.value());
 
                 this.m_SampleName = sampleType.value();
                 this.firm = _firm.value();

+ 511 - 273
MeasureThread/Measure.cs

@@ -14,6 +14,7 @@ using System.IO;
 using SmartSEMControl;
 using MeasureData;
 using FileManager;
+using WebManager;
 
 using OpenCvSharp;
 
@@ -360,6 +361,51 @@ namespace MeasureThread
 
     public class Measure
     {
+        /// <summary>
+        /// 图像拉直算法
+        /// </summary>
+        /// <param name="Slope">倾斜角度</param>
+        /// <param name="x0">圆心坐标x</param>
+        /// <param name="y0">圆心坐标y</param>
+        /// <param name="x1">倾斜情况下帧图的坐标x</param>
+        /// <param name="y1">倾斜情况下帧图的坐标y</param>
+        /// <param name="Hx">复位到原位置需要移动的x值(返回值)</param>
+        /// <param name="Hy">复位到原位置需要移动的y值(返回值)</param>
+        /// <returns></returns>
+        public bool Straightening(double Slope, int x0, int y0, int x1, int y1, ref int Hx, ref int Hy)
+        {
+            try
+            {
+                double xr = x1 - x0;//倾斜图到中心的距离差x
+                double yr = y1 - y0;//倾斜图到中心的距离差y
+                double R = Math.Sqrt(xr * xr + yr * yr);//圆心到倾斜图的长度
+                //double D = 2 * R * Math.Sin(ScanRotation / 2);//倾斜图与矫正图底边的长度
+                double k = Math.Atan(y1 / x1) / Math.PI * 180;//x1,y1的直角三角形圆心角度
+                double k_S = k - Slope;//通过夹角差求x2,y2
+                int y2 = (int)Math.Round(Math.Sin(Math.PI / (180 / k_S)) * R);
+                int x2 = (int)Math.Round(Math.Cos(Math.PI / (180 / k_S)) * R);
+
+                if (Slope > 0 || Slope < 0)
+                {
+                    Hx = x1 - x2;
+                    Hy = y1 - y2;
+                }
+                else
+                {
+                    Hx = 0;
+                    Hy = 0;
+                }
+
+                return true;
+            }
+            catch (Exception)
+            {
+                return false;
+            }
+        }
+
+        public WebResult wr = null;
+
         public event ThreadStatusHandler SendThreadStatus;  // 声明事件
         public event CutHolesStatusHandler SendCutHolesStatus;  // 声明事件
 
@@ -435,16 +481,13 @@ namespace MeasureThread
         }
 
         //构造函数
-        public Measure()
-        {
-            Init();
-        }
-
-        private void Init()
+        public Measure(String webServerIP, String webServerPort, String webServerUrl)
         {
             MeasParam = new MeasureParam();
             TStatus = new ThreadStatus();
             cutHoles = new List<MeasureData.CutHole>();
+            //配置远程连接
+            wr = new WebResult(webServerIP,webServerPort,webServerUrl);
         }
 
         //初始化测量业务, 读测量文件,判断是否有可测试的切孔
@@ -482,13 +525,12 @@ namespace MeasureThread
             switch(step_code)
             {
                 //拍照
-                case "1-3":
-                case "1-9":
+                case "1-5":
+                case "1-7":
                 case "1-16":
                 case "1-24":
                     //电压、放大倍数、工作距离、位置信息、图片路径
                     arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
-                    arg.Picture_Information.Work_Status = "SEM";
                     arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
                     arg.Picture_Information.Magnification = iSEM.GetMagnification();
                     break;
@@ -509,6 +551,7 @@ namespace MeasureThread
             }
             SendThreadStatus(this, arg);
         }
+
         public void SendCutHoleMsg(string a_state, string a_holeName)
         {
             CutHolesStatusEventArgs arg = new CutHolesStatusEventArgs(a_state, a_holeName);
@@ -590,46 +633,15 @@ namespace MeasureThread
         //设置工作文件夹
         public bool SetWorkingFolderStr()
         {
-
             WorkingFolder = m_measureFile.FilePath;
-
             return true;
-            ////获取工作文件路径
-            //string pathName = m_measureFile.FilePath;
-
-            ////判断工作文件路径是否为空或无效
-            //if (string.IsNullOrEmpty(pathName))
-            //{
-            //    SendMsg("路径无效");
-            //    return false;
-            //}
-            ////文件未保存
-            //else if (pathName.CompareTo(MeasureFile.UNTITLED_FILE_NAME) == 0)
-            //{
-            //    SendMsg("工程文件未保存");
-            //    return false;
-            //}
-
-            ////获取工作文件所在文件夹
-            //string folder = System.IO.Path.GetDirectoryName(pathName);
-            //if (string.IsNullOrEmpty(folder))
-            //{
-            //    SendMsg("工程文件无效");
-            //    return false;
-            //}
-
-            //WorkingFolder += @"\\";
-
-            //LogManager.Init(WorkingFolder);
-
-            //return false;
         }
 
         //插入PT针
         public bool InsertPT()
         {
             string fn = m_ProgramFolder + "\\Macro\\" + MacoInsertPt;
-            SendMsg("调用宏插入PT针宏文件" + fn);
+            //SendMsg("调用宏插入PT针宏文件" + fn);
             iSEM.CMDMCFFilename(fn);
             //延时1s??
             Thread.Sleep(1000);
@@ -640,7 +652,7 @@ namespace MeasureThread
         public bool RetractPT()
         {
             string fn = m_ProgramFolder + "\\Macro\\" + MacoRetractPt;
-            SendMsg("调用宏撤出PT针宏文件" + fn);
+            //SendMsg("调用宏撤出PT针宏文件" + fn);
             iSEM.CMDMCFFilename(fn);
             //延时1s??
             Thread.Sleep(1000);
@@ -652,7 +664,7 @@ namespace MeasureThread
         {
             //执行PT沉积的ELY文件
             string fn = m_ProgramFolder + "\\Macro\\" + ElyDeposition;
-            SendMsg("执行PT沉积Ely文件:" + fn);
+            //SendMsg("执行PT沉积Ely文件:" + fn);
             if (!ExcuteEly(fn))
             {
                 return false;
@@ -675,7 +687,7 @@ namespace MeasureThread
         {
             //执行PT沉积的ELY文件
             string fn = m_ProgramFolder + "\\Macro\\" + ElyCrossSection;
-            SendMsg("执行FIB切割Ely文件:" + fn);
+            //SendMsg("执行FIB切割Ely文件:" + fn);
             if (!ExcuteEly(fn))
             {
                 return false;
@@ -694,198 +706,230 @@ namespace MeasureThread
             return true;
         }
 
+        //执行ELY文件的步骤
         public bool ExcuteEly(string a_filename)
         {
             //执行ELy文件有三个动作
             //1. 选择ELY文件
-            SendMsg("选择ELY文件");
+            //SendMsg("选择ELY文件");
             if (!iSEM.CmdFIBLoadELY(a_filename))
             {
-                SendMsg("选择ELY文件失败");
+                //SendMsg("选择ELY文件失败");
                 return false;
             }
             Thread.Sleep(1000);
             //2. 确认ELY文件
-            SendMsg("确认ELY文件");
+            //SendMsg("确认ELY文件");
             if (!iSEM.CmdFIBEXPOSUREELY())
             {
-                SendMsg("确认ELY文件失败");
+                //SendMsg("确认ELY文件失败");
                 return false;
             }
             Thread.Sleep(1000);
             //3. 执行ELY文件
-            SendMsg("执行ELY文件");
+            //SendMsg("执行ELY文件");
             if (!iSEM.CmdFIBSTARTELY())
             {
-                SendMsg("执行ELY文件失败");
+                //SendMsg("执行ELY文件失败");
                 return false;
             }
             Thread.Sleep(1000);
 
             return true;
         }
+
         /// <summary>
-        ///13. 自动 定位功能
+        ///13. 自动 定位功能,沉积
         /// </summary>
         /// <returns></returns>
-        public bool GetPoistion()
+        public bool GetPoistion(Boolean isFirst)
         {
+            float x0 = 0, y0 = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0;
+            int state = 0;
             //SendMsg("自动定位");
             //13.自动定位切割
             {
                 //1.控制SEM放大600X
-                if (!iSEM.SetMagnification(600))
+                arg.State = "SEM";
+                if (!iSEM.SetMagnification(m_measureFile.MParam.Photograph_Magnification))
                 {
+                    arg.Message = "放大" + m_measureFile.MParam.Photograph_Magnification.ToString("0.0") + "倍失败";
+                    SendMsg("1-2");
                     return false;
                 }
-                arg.Message = "放大600倍";
-                SendMsg("1-1");
+                arg.Message = "放大" + m_measureFile.MParam.Photograph_Magnification.ToString("0.0") + "倍成功";
+                SendMsg("1-2");
 
                 //2.控制SEM自动对焦、亮度、对比度
-                // if (!MeasParam.FocusMode)
+                if (m_measureFile.MParam.FocusMode==1)//手动
                 {
                     if (DialogResult.Yes == MessageBox.Show("图像自动对焦已完成?", "确认消息", MessageBoxButtons.YesNo))
                     {
                         arg.Message = "自动对焦完成";
-                        SendMsg("1-2");
+                        SendMsg("1-3");
                         //return true;
                     }
                     else
                     {
                         arg.Message = "自动对焦失败";
-                        SendMsg("1-2");
+                        SendMsg("1-3");
                         return false;
                     }
-                    //弹出手动对焦的窗口
                 }
-                //else
-                //{
-                //    //调用自动对焦模块
-                //}
-
-                //3.设置SEM进行角度补偿54度
-                //if (!TiltCorrection(54))
-                //{
-                //    SendMsg("设置SEM进行角度补偿54度");
-                //    return false;
-                //}
-                //arg.Message = "设置校正54度";
-                //SendMsg("1-15");
-                //Thread.Sleep(5000);
-
-                //4.控制SEM拍照
-                
-                //5.保存照片
+                else if (m_measureFile.MParam.FocusMode == 2)//自有自动
                 {
-                    //1. 创建目录,已经完成
-                    //2. 设置图片名称
-                    //3. 保存图片1
-                    WorkingFolder = m_measureFile.FilePath;
-                    String fileName1 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName1;
-                    arg.Picture_Information.Picture_FullPath = fileName1;
-                    if (!GetImage(ImageMode.SEM, fileName1))
-                    {
-                        SendMsg("SEM拍照失败");
-                        return false;
-                    }
-                    arg.Message = "SEM拍照";
-                    SendMsg("1-3");
-                    Thread.Sleep(3000);
+                    //郝工增加自动对焦算法
                 }
-                
-                //6.设置FIB拍照参数——扫描时间、束流等
-                //7.控制FIB自动亮度、对比度
-                SendMsg("切换FIB控制");
-                if (!iSEM.CmdFIBModeFIB())
+                else     //客户自动
                 {
-                    SendMsg("FIB模式切换失败");
-                    return false;
+                    //后期和客户对接接口
+                    List<string> filenames = new List<string>();
+                    String retfilename = wr.Img_Auto_Focus(filenames);
                 }
 
-                Thread.Sleep(10000);
-
-                //8.控制FIB拍照
-                //9.保存照片
-                SendMsg("FIB拍照");
+                //3.第一次不需要进行角度补偿,其他需要设置SEM进行角度补偿54度
+                if (!isFirst)
                 {
-                    //1. 设置图片名称
-                    //2. 保存图片2
-                    String fileName2 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName2;
-                    if (!GetImage(ImageMode.FIB, fileName2))
+                    if (!TiltCorrection(m_measureFile.MParam.Correction_Angle))
                     {
-                        SendMsg("FIB拍照失败");
+                        arg.Message = "设置SEM进行角度补偿" + m_measureFile.MParam.Correction_Angle.ToString("0") + "度失败";
+                        SendMsg("1-4");
                         return false;
                     }
-
-                    Thread.Sleep(3000);
+                    arg.Message = "设置SEM进行角度补偿" + m_measureFile.MParam.Correction_Angle.ToString("0") + "度成功";
+                    SendMsg("1-4");
+                    Thread.Sleep(5000);
                 }
 
-                //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
-                SendMsg("调用识别位置");
-
-                if (DialogResult.Yes == MessageBox.Show("移动已完成?", "确认消息", MessageBoxButtons.YesNo))
-                {
-                    SendMsg("移动已完成");
-                    //return true;
-                }
-                else
+                //4.控制SEM拍照,5保存照片
+                String fileName1 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName1;
+                arg.Picture_Information.Picture_FullPath = fileName1;
+                arg.Picture_Information.Work_Status = "SEM";
+                if (!GetImage(ImageMode.SEM, fileName1))
                 {
-                    SendMsg("移动已失败");
+                    arg.Message = "SEM拍照失败";
+                    SendMsg("1-5");
                     return false;
                 }
+                arg.Message = "SEM拍照成功";
+                SendMsg("1-5");
+                Thread.Sleep(3000);
 
-
-                SendMsg("进行PT沉积");
-                //11.自动工具样品类型参数确定是否需要PT沉积
+                //判断是否为仅拍照,不是则执行FIB操作
+                if (!m_MsParam.Is_Photograph)
                 {
-                    //1. 根据客户PT沉积坐标控制FIB调整到中心位置
-                    //2. 验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否一定正确
-                    //3. 根据坐标进行PT沉积   
-                    if (!PTWork())
+                    //6.设置FIB拍照参数——扫描时间、束流等
+                    //7.控制FIB自动亮度、对比度
+                    if (!iSEM.CmdFIBModeFIB())
                     {
-                        SendMsg("PT沉积失败");
+                        arg.Message = "FIB模式切换失败";
+                        SendMsg("1-6");
                         return false;
                     }
+                    arg.Message = "FIB模式切换成功";
+                    SendMsg("1-6");
+                    Thread.Sleep(10000);
 
+                    //8.控制FIB拍照
+                    //9.保存照片
+                    String fileName2 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName2;
+                    arg.Picture_Information.Picture_FullPath = fileName1;
+                    arg.Picture_Information.Work_Status = "FIB";
+                    if (!GetImage(ImageMode.FIB, fileName2))
+                    {
+                        arg.Message = "FIB拍照失败";
+                        SendMsg("1-7");
+                        return false;
+                    }
+                    arg.Message = "FIB拍照成功";
+                    SendMsg("1-7");
+                    Thread.Sleep(3000);
 
-                }
-
+                    //这里需要确认是否对FIB的参数进行设置:电压和放大倍数等
 
-                return true;
-                //模拟为客户返回的坐标值
-                float x0 = 0, y0 = 0;
-                SendMsg("移动到新(" + x0.ToString() + "," + y0.ToString() + ")位置失败");
+                    //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
+                    if (DialogResult.Yes == MessageBox.Show("是否手动移动样品台到指定位置?\n如果点击取消则会调用Web接口。", "确认消息", MessageBoxButtons.YesNo))
+                    {
+                        arg.Message = "样品台移动到指定位置";
+                        SendMsg("1-8");
+                    }
+                    else
+                    {
+                        wr.Img_Cut_Position(fileName2, m_MsParam.SampleName, m_MsParam.Firm, out x1, out y1, out x2, out y2, out state);
+                        if (state == 1)
+                        {
+                            //1. 根据客户PT沉积坐标控制FIB调整到中心位置???????
+                            if (!iSEM.MoveStageXY(x1, y1))
+                            {
+                                arg.Message = "移动到新(" + x1.ToString() + "," + y1.ToString() + ")位置失败";
+                                SendMsg("1-8");
+                                return false;
+                            }
+                            //判断是否移动完成
+                            while (true)
+                            {
+                                Thread.Sleep(5000);
+                                if (iSEM.GetStageIs() == 0)
+                                {
+                                    break;
+                                }
+                            }
+                            arg.Message = "移动到新(" + x1.ToString() + "," + y1.ToString() + ")位置失败";
+                            SendMsg("1-8");
+                        }
+                        else
+                        {
+                            arg.Message = "样品台移动失败";
+                            SendMsg("1-8");
+                            return false;
+                        }
+                    }
 
-                //12.根据梯形坐标控制FIB调整到中心位置
-                if (!iSEM.MoveStageXY(x0, y0))
-                {
-                    SendMsg("移动到新(" + x0.ToString() + "," + y0.ToString() + ")位置失败");
-                    return false;
+                    //11.自动工具样品类型参数确定是否需要PT沉积
+                    if (m_MsParam.PT)
+                    {
+                        //1. 根据客户PT沉积坐标控制FIB调整到中心位置???????
+                        //第10步已经移动好位置
+                        //2. 验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否一定正确
+                        x0 = iSEM.GetStageAtX();
+                        y0 = iSEM.GetStageAtY();
+                        if (Math.Abs(x0 - x1) > fMin && Math.Abs(y0 - y1) > fMin)
+                        {
+                            arg.Message = "目标位置(" + x0.ToString() + "," + y0.ToString() + ")移动失败";
+                            SendMsg("1-9");
+                            return false;
+                        }
+                        arg.Message = "目标位置(" + x0.ToString() + "," + y0.ToString() + ")移动成功";
+                        SendMsg("1-9");
+                        //3. 根据坐标进行PT沉积   
+                        if (!PTWork())
+                        {
+                            arg.Message = "PT沉积失败";
+                            SendMsg("1-10");
+                            return false;
+                        }
+                        arg.Message = "PT沉积成功";
+                        SendMsg("1-10");
+                    }
                 }
 
-                //电镜移动是有一个延时的操作的?
-
+                //12.根据梯形坐标控制FIB调整到中心位置
                 //13.验证移动准确性:获取当前FIB中心位置坐标,与客户返回坐标对比,验证是否移动正确
-                float x1 = iSEM.GetStageAtX();
-                float y1 = iSEM.GetStageAtY();
-                if (Math.Abs(x0 - x1) > fMin && Math.Abs(y0 - y1) > fMin)
-                {
-                    SendMsg("目标位置(" + x0.ToString() + "," + y0.ToString() + ")移动失败");
-                    return false;
-                }
+                //以上两步已经将程序移动到11内部去做
 
                 //14.保存样品1第1号孔中心位置6轴坐标1 XYZMRT到数据库,保存客户返回值信息到数据库
                 float[] firstPosition = iSEM.GetStagePosition();
                 //这里要调用文件保存功能
-                SendMsg("坐标1(" + firstPosition[0].ToString() + ","
+                arg.Message = "坐标1(" + firstPosition[0].ToString() + ","
                     + firstPosition[1].ToString() + ","
                     + firstPosition[2].ToString() + ","
                     + firstPosition[3].ToString() + ","
                     + firstPosition[4].ToString() + ","
-                    + firstPosition[5].ToString() + ")");
+                    + firstPosition[5].ToString() + ")";
+                SendMsg("1-11");
             }
 
-            return false;
+            return true;
         }
 
         /// <summary>
@@ -895,38 +939,39 @@ namespace MeasureThread
         public bool FIBCross()
         {
             //14.自动控制FIB切割
+            //1.根据参数设置FIB草率时间(使图清晰),设置梯形上下边及深度、设置束流
+            //2.控制FIB进行切割
+            //以上1、2步全部用ELY文件代替
+            if (!FIBWork())
             {
-                //1.根据参数设置FIB草率时间(使图清晰),设置梯形上下边及深度、设置束流
-                //2.控制FIB进行切割
-                SendMsg("FIB切割");
-                if (!FIBWork())
-                {
-                    SendMsg("FIB切割失败");
-                    return false;
-                }
-
-                Thread.Sleep(5000);
+                arg.Message = "FIB切割失败";
+                SendMsg("1-12");
+                return false;
+            }
+            arg.Message = "FIB切割成功";
+            SendMsg("1-12");
+            
+            Thread.Sleep(5000);
 
-                //3.控制FIB拍照600X
-                //4.保存图片
-                {
-                    //1.设置图片名称
-                    //2.保存图片3
-                    WorkingFolder = m_measureFile.FilePath;
-                    String fileName3 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName3;
-                    SendMsg("SEM拍照存储到" + fileName3);
-                    if (!GetImage(ImageMode.FIB, fileName3))
-                    {
-                        SendMsg("FIB拍照失败");
-                        return false;
-                    }
+            //3.控制FIB拍照600X
+            //这里如何控制
+            //4.保存图片
+            String fileName3 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName3;
+            arg.Picture_Information.Picture_FullPath = fileName3;
+            arg.Picture_Information.Work_Status = "FIB";
+            if (!GetImage(ImageMode.FIB, fileName3))
+            {
+                arg.Message = "FIB拍照失败";
+                SendMsg("1-14"); 
+                return false;
+            }
+            arg.Message = "FIB拍照成功";
+            SendMsg("1-14");
 
-                    Thread.Sleep(3000);
-                }
-                //5.验证切割准确性:与切割前对比,如果对比误差大,则停止自动执行,进行报警
+            Thread.Sleep(3000);
+            //5.验证切割准确性:与切割前对比,如果对比误差大,则停止自动执行,进行报警
 
-                //6.设置FIB解冻:先读取状态,如果冻结状态则进行解冻
-            }
+            //6.设置FIB解冻:先读取状态,如果冻结状态则进行解冻
             return true;
         }
 
@@ -936,59 +981,252 @@ namespace MeasureThread
         /// <returns></returns>
         public bool FindCross()
         {
-            //16.自动调整SEM找到切割位置
+            float x0 = 0, y0 = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0;
+            float angle = 0;
+            int direction = 0;
+            int state = 0;
+            //1.控制SEM放大到300倍
+            arg.State = "SEM";
+            if (!iSEM.SetMagnification(m_measureFile.MParam.Photograph_Magnification))
+            {
+                arg.Message = "放大" + m_measureFile.MParam.Photograph_Magnification.ToString("0.0") + "倍失败";
+                SendMsg("1-18");
+                return false;
+            }
+            arg.Message = "放大" + m_measureFile.MParam.Photograph_Magnification.ToString("0.0") + "倍成功";
+            SendMsg("1-18");
+            //2.控制SEM自动对焦、亮度、对比度-接口
+            if (m_measureFile.MParam.FocusMode == 1)//手动
             {
-                //1.控制SEM放大到300倍
-                if (!iSEM.SetMagnification(300))
+                if (DialogResult.Yes == MessageBox.Show("图像自动对焦已完成?", "确认消息", MessageBoxButtons.YesNo))
                 {
+                    arg.Message = "自动对焦完成";
+                    SendMsg("1-19");
+                    //return true;
+                }
+                else
+                {
+                    arg.Message = "自动对焦失败";
+                    SendMsg("1-19");
                     return false;
                 }
-                //2.控制SEM自动对焦、亮度、对比度-接口
-                if (!MeasParam.FocusMode)
+            }
+            else if (m_measureFile.MParam.FocusMode == 2)//自有自动
+            {
+                //郝工增加自动对焦算法
+            }
+            else     //客户自动
+            {
+                //后期和客户对接接口
+                List<string> filenames = new List<string>();
+                String retfilename = wr.Img_Auto_Focus(filenames);
+            }
+
+            Thread.Sleep(5000);
+
+            //原来这里有3是角度补偿
+
+            //3.控制SEM拍照
+            String fileName4 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName4;
+            arg.Picture_Information.Picture_FullPath = fileName4;
+            arg.Picture_Information.Work_Status = "SEM";
+            if (!GetImage(ImageMode.SEM, fileName4))
+            {
+                arg.Message = "SEM拍照失败";
+                SendMsg("1-20");
+                return false;
+            }
+            arg.Message = "SEM拍照成功";
+            SendMsg("1-20");
+
+            Thread.Sleep(3000);
+            //4.将照片传给客户,获取偏移坐标,以及偏移角度
+            //5.根据坐标控制SEM移动到切孔位置,居中
+            //这里是否用到拉直操作,我没有加
+            if (DialogResult.Yes == MessageBox.Show("是否手动移动样品台到指定位置?\n如果点击取消则会调用Web接口。", "确认消息", MessageBoxButtons.YesNo))
+            {
+                arg.Message = "样品台移动到指定位置";
+                SendMsg("1-21");
+            }
+            else
+            {
+                wr.Img_Center_Position_OffsetAngle_Direction(fileName4, m_MsParam.SampleName, m_MsParam.Firm, out x1, out y1, out angle, out direction, out state);
+                if (state == 1)
                 {
-                    //弹出手动对焦的窗口
+                    //1. 根据客户PT沉积坐标控制FIB调整到中心位置???????
+                    if (!iSEM.MoveStageXY(x1, y1))
+                    {
+                        arg.Message = "移动到新(" + x1.ToString() + "," + y1.ToString() + ")位置失败";
+                        SendMsg("1-21");
+                        return false;
+                    }
+                    //判断是否移动完成
+                    while (true)
+                    {
+                        Thread.Sleep(5000);
+                        if (iSEM.GetStageIs() == 0)
+                        {
+                            break;
+                        }
+                    }
+                    arg.Message = "移动到新(" + x1.ToString() + "," + y1.ToString() + ")位置失败";
+                    SendMsg("1-21");
                 }
                 else
                 {
-                    //调用自动对焦模块
+                    arg.Message = "样品台移动失败";
+                    SendMsg("1-21");
+                    return false;
                 }
+            }
 
-                Thread.Sleep(5000);
+            if (!iSEM.SetScanRotation(angle))
+            {
+                arg.Message = "调整角度失败";
+                SendMsg("1-22");
+                return false;
+            }
+            arg.Message = "调整角度成功";
+            SendMsg("1-22");
 
-                //3.控制SEM拍照
-                String fileName4 = WorkingFolder + ImageName4;
-                if (!GetImage(ImageMode.SEM, fileName4))
+
+            ////6.验证移动准确性:获取当前SEM中心位置坐标,与客户返回坐标对比,验证是否移动正确
+            //float x5 = iSEM.GetStageAtX();
+            //float y5 = iSEM.GetStageAtY();
+            //if (Math.Abs(x5 - x4) > fMin && Math.Abs(y5 - y4) > fMin)
+            //{
+            //    return false;
+            //}
+
+            return true;
+        }
+
+        /// <summary>
+        /// 17.自动控制SEM拍截面照
+        /// </summary>
+        /// <returns></returns>
+        public bool ShotSection()
+        {
+            float x0 = 0, y0 = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0;
+            int state = 0;
+            //切换到SEM模式
+            if (!iSEM.CmdFIBModeSEM())
+            {
+                //SendMsg("SEM模式切换失败");
+                return false;
+            }
+            arg.State = "SEM";
+            Thread.Sleep(10000);
+
+            //1、放大6000倍
+            if (!iSEM.SetMagnification(6000))
+            {
+                arg.Message = "放大倍数调整失败";
+                SendMsg("1-25");
+                return false;
+            }
+            arg.Message = "放大倍数调整成功";
+            SendMsg("1-25");
+
+            //2.控制SEM自动对焦、亮度、对比度-接口
+            if (m_measureFile.MParam.FocusMode == 1)//手动
+            {
+                if (DialogResult.Yes == MessageBox.Show("图像自动对焦已完成?", "确认消息", MessageBoxButtons.YesNo))
+                {
+                    arg.Message = "自动对焦完成";
+                    SendMsg("1-26");
+                    //return true;
+                }
+                else
                 {
+                    arg.Message = "自动对焦失败";
+                    SendMsg("1-26");
                     return false;
                 }
+            }
+            else if (m_measureFile.MParam.FocusMode == 2)//自有自动
+            {
+                //郝工增加自动对焦算法
+            }
+            else     //客户自动
+            {
+                //后期和客户对接接口
+                List<string> filenames = new List<string>();
+                String retfilename = wr.Img_Auto_Focus(filenames);
+            }
 
-                Thread.Sleep(3000);
-                //4.将照片传给客户,获取偏移坐标,以及偏移角度
-                float x4 = 0, y4 = 0;
-                float angle = 0;
+            //3、设置SEM补偿角度
+            if (!TiltCorrection(m_measureFile.MParam.Correction_Angle))
+            {
+                arg.Message = "设置SEM进行角度补偿" + m_measureFile.MParam.Correction_Angle.ToString("0") + "度失败";
+                SendMsg("1-27");
+                return false;
+            }
+            arg.Message = "设置SEM进行角度补偿" + m_measureFile.MParam.Correction_Angle.ToString("0") + "度成功";
+            SendMsg("1-27");
+            Thread.Sleep(5000);
 
-                //5.根据坐标控制SEM移动到切孔位置,居中
-                if (!iSEM.MoveStageXY(x4, y4))
+            //4、拍照,5、保存照片
+            String fileName5 = WorkingFolder + "\\" + m_nWorkHoleNo.ToString() + "Hole" + ImageName5;
+            arg.Picture_Information.Picture_FullPath = fileName5;
+            arg.Picture_Information.Work_Status = "SEM";
+            if (!GetImage(ImageMode.SEM, fileName5))
+            {
+                arg.Message = "SEM拍照失败";
+                SendMsg("1-28");
+                return false;
+            }
+            arg.Message = "SEM拍照成功";
+            SendMsg("1-28");
+            Thread.Sleep(3000);
+
+            //6、获取偏移坐标,7、移动到位
+            if (DialogResult.Yes == MessageBox.Show("是否手动移动样品台到指定位置?\n如果点击取消则会调用Web接口。", "确认消息", MessageBoxButtons.YesNo))
+            {
+                arg.Message = "样品台移动到指定位置";
+                SendMsg("1-29");
+            }
+            else
+            {
+               // wr.Img_Cut_Position(fileName5, m_MsParam.SampleName, m_MsParam.Firm, out x1, out y1, out x2, out y2, out state);
+                if (state == 1)
                 {
-                    return false;
+                    //1. 根据客户PT沉积坐标控制FIB调整到中心位置???????
+                    if (!iSEM.MoveStageXY(x1, y1))
+                    {
+                        arg.Message = "移动到新(" + x1.ToString() + "," + y1.ToString() + ")位置失败";
+                        SendMsg("1-29");
+                        return false;
+                    }
+                    //判断是否移动完成
+                    while (true)
+                    {
+                        Thread.Sleep(5000);
+                        if (iSEM.GetStageIs() == 0)
+                        {
+                            break;
+                        }
+                    }
+                    arg.Message = "移动到新(" + x1.ToString() + "," + y1.ToString() + ")位置失败";
+                    SendMsg("1-29");
                 }
-
-                if (!iSEM.SetScanRotation(angle))
+                else
                 {
+                    arg.Message = "样品台移动失败";
+                    SendMsg("1-8");
                     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;
-                //}
             }
+
+            //8、验证移动准确性
+
+            //9、
+
+
             return true;
         }
 
+
         public bool CommonWork()
         {
             SendMsg("插入PT针");
@@ -1004,7 +1242,7 @@ namespace MeasureThread
 
             //13. 自动 定位功能
             SendMsg("自动定位切割位置");
-            if (!GetPoistion())
+            if (!GetPoistion(false))
             {
                 SendMsg("自动定位切割位置失败");
                 return false;
@@ -1140,103 +1378,103 @@ namespace MeasureThread
         public bool FirstHole()
         {
             MeasureData.CutHole firstHole = m_cutHoles[0];            
-            SendMsg("插入PT针");
+            
             //12.根据样品类型参数确定是否需要PT沉积,控制PT针插入
-            //if (firstHole.PT == true)
+            if (m_MsParam.Is_Photograph == false && m_MsParam.PT == true)
             {
                 if (!InsertPT())
                 {
-                    SendMsg("插入PT针失败");
+                    arg.Message = "插入PT针失败";
+                    SendMsg("1-0");
                     return false;
                 }
+                arg.Message = "插入PT针成功";
+                SendMsg("1-0");
             }
 
             //13. 自动 定位功能
-            SendMsg("自动定位切割位置");
-            if (!GetPoistion())
+            if (!GetPoistion(true))
             {
-                SendMsg("自动定位切割位置失败");
+                arg.Message = "自动定位切割位置失败";
+                SendMsg("1-1");
                 return false;
             }
+            arg.Message = "自动定位切割位置成功";
+            SendMsg("1-1");
 
             //14.自动控制FIB切割
-            SendMsg("FIB切割");
-            if (!FIBCross())
+            if (m_MsParam.Is_Photograph == false && m_MsParam.PT == true)
             {
-                SendMsg("FIB切割失败");
-                return false;
+                if (!FIBCross())
+                {
+                    arg.Message = "FIB切割失败";
+                    SendMsg("1-16");
+                    return false;
+                }
+                arg.Message = "FIB切割成功";
+                SendMsg("1-16");
             }
-            //{
-            //    //1.根据参数设置FIB草率时间(使图清晰),设置梯形上下边及深度、设置束流
-            //    //2.控制FIB进行切割
-
-            //    //3.控制FIB拍照600X
-            //    //4.保存图片
-            //    {
-            //        //1.设置图片名称
-            //        //2.保存图片3
-            //        String fileName3 = WorkingFolder + ImageName3;
-            //        if (!GetImage(ImageMode.FIB, fileName3))
-            //        {
-            //            return false;
-            //        }
-            //    }
-            //    //5.验证切割准确性:与切割前对比,如果对比误差大,则停止自动执行,进行报警
 
-            //    //6.设置FIB解冻:先读取状态,如果冻结状态则进行解冻
-            //}
             //15.根据样品类型决定是否撤出PT针
-            SendMsg("撤出PT针");
-            //if (firstHole.PT == false)
-            //{
+            if(m_MsParam.Is_Photograph == false && m_MsParam.PT == true)
+            {
                 if (!RetractPT())
                 {
-                    SendMsg("撤出PT针失败");
+                    arg.Message = "撤出PT针失败";
+                    SendMsg("1-17");
                     return false;
                 }
-            //}
+                arg.Message = "撤出PT针成功";
+                SendMsg("1-17");
+            }
 
             // 16.找到切割位置
-            SendMsg("找到切割位置");
-
-            //17.自动控制SEM拍截面照
-            SendMsg("观测层高");
-
-            SendMsg("切换SEM控制");
-            if (!iSEM.CmdFIBModeSEM())
+            if(m_MsParam.Is_Photograph == false)
             {
-                SendMsg("SEM模式切换失败");
-                return false;
+                if (!FindCross())
+                {
+                    arg.Message = "找到切割位置失败";
+                    SendMsg("1-24");
+                    return false;
+                }
+                arg.Message = "找到切割位置成功";
+                SendMsg("1-24");
             }
 
-            Thread.Sleep(10000);
-
-            SendMsg("放大6000倍");
-            if (!iSEM.SetMagnification(6000))
+            //17.自动控制SEM拍截面照
+            if(m_MsParam.Is_Photograph == false)
             {
-                SendMsg("放大倍数调整失败");
-                return false;
+                if (!ShotSection())
+                {
+                    arg.Message = "自动控制SEM拍截面照失败";
+                    SendMsg("1-33");
+                    return false;
+                }
+                arg.Message = "自动控制SEM拍截面照成功";
+                SendMsg("1-33");
             }
 
-            if (DialogResult.Yes == MessageBox.Show("图像拍摄已完成?", "确认消息", MessageBoxButtons.YesNo))
-            {
-                SendMsg("拍摄照片完成");
-                //return true;
-            }
-            else
-            {
-                SendMsg("拍摄照片失败");
-                return false;
-            }
+            
 
-            SendMsg("图像校正36度");
-            //3.设置SEM角度补偿cos36度
-            if (!TiltCorrection(36))
-            {
-                return false;
-            }
+            //if (DialogResult.Yes == MessageBox.Show("图像拍摄已完成?", "确认消息", MessageBoxButtons.YesNo))
+            //{
+            //    SendMsg("拍摄照片完成");
+            //    //return true;
+            //}
+            //else
+            //{
+            //    SendMsg("拍摄照片失败");
+            //    return false;
+            //}
 
-            Thread.Sleep(3000);
+            //SendMsg("图像校正36度");
+            ////3.设置SEM角度补偿cos36度
+            //if (!TiltCorrection(36))
+            //{
+            //    return false;
+            //}
+
+            //Thread.Sleep(3000);
 
             string fn;
             //用宏抓一般图

+ 4 - 0
MeasureThread/MeasureThread.csproj

@@ -75,6 +75,10 @@
       <Project>{bf7f80b0-a6da-4470-a331-4c96057fc7fa}</Project>
       <Name>SmartSEMControl</Name>
     </ProjectReference>
+    <ProjectReference Include="..\WebManager\WebManager.csproj">
+      <Project>{00319b6f-fad0-46b5-b76b-7164dc5ca0d5}</Project>
+      <Name>WebManager</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <None Include="packages.config" />

+ 85 - 18
WebManager/WebResult.cs

@@ -20,6 +20,7 @@ namespace WebManager
         private String Url = "";
         private const String Post = "Post";
         private const String Content_Type= "Content-Type:application/json";
+        private String[] _url = new string[8];
 
         #endregion
 
@@ -28,10 +29,11 @@ namespace WebManager
         /// </summary>
         /// <param name="ws_ip">WebServer的IP地址</param>
         /// <param name="ws_port">WebServer的端口号</param>
-        public WebResult(String ws_ip,String ws_port)
+        public WebResult(String ws_ip,String ws_port,String ws_url)
         {
             this.webServer_IP = ws_ip;
             this.webServer_Port = ws_port;
+            this._url = ws_url.Split(',');
             //更新Web网址
             Update_Url();
         }
@@ -96,7 +98,14 @@ namespace WebManager
         /// <returns>json字符串</returns>
         public void Img_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double degree, out int direction, out int state)
         {
-            this.webServer_Path = "FIB_degree_recognize";
+            try
+            {
+                this.webServer_Path = this._url[0];
+            }
+            catch
+            {
+                this.webServer_Path = "FIB_degree_recognize";
+            }
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);
@@ -126,10 +135,22 @@ namespace WebManager
         /// <param name="imagePath">图片路径</param>
         /// <param name="imageType">孔类型</param>
         /// <param name="firm">厂家类型</param>
+        /// <param name="offsetx1">切割点相对于原点坐标左上角x值</param>
+        /// <param name="offsetx2">切割点相对于原点坐标左上角y值</param>
+        /// <param name="offsety1">切割点相对于原点坐标右上角x值</param>
+        /// <param name="offsety2">切割点相对于原点坐标右上角y值</param>
+        /// <param name="state">返回状态</param>
         /// <returns>json字符串</returns>
-        public void Img_Cut_Position(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out int state)
+        public void Img_Cut_Position(String imagePath, String imageType, String firm, out float offsetx1, out float offsety1, out float offsetx2, out float offsety2, out int state)
         {
-            this.webServer_Path = "test2";
+            try
+            {
+                this.webServer_Path = this._url[1];
+            }
+            catch
+            {
+                this.webServer_Path = "test2";
+            }
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);
@@ -141,15 +162,19 @@ namespace WebManager
             {
                 JObject jname = JObject.Parse(jret["img_name"].ToString());
                 JArray jlocation = JArray.Parse(jname["location"].ToString());
-                offsetx = Convert.ToDouble(jlocation[0].ToString());
-                offsety = Convert.ToDouble(jlocation[1].ToString());
+                offsetx1 = Convert.ToSingle(jlocation[0][0].ToString());
+                offsety1 = Convert.ToSingle(jlocation[0][1].ToString());
+                offsetx2 = Convert.ToSingle(jlocation[1][0].ToString());
+                offsety2 = Convert.ToSingle(jlocation[1][1].ToString());
                 state = Convert.ToInt32(jname["state"].ToString());
             }
             else
             {
                 state = 0;
-                offsetx = 0;
-                offsety = 0;
+                offsetx1 = 0;
+                offsety1 = 0;
+                offsetx2 = 0;
+                offsety2 = 0;
             }
         }
 
@@ -161,7 +186,14 @@ namespace WebManager
         /// <returns>json字符串</returns>
         public void Img_Cut_Success(String imageBefore, String imageAfter, out int state)
         {
-            this.webServer_Path = "FIB_verify";
+            try
+            {
+                this.webServer_Path = this._url[2];
+            }
+            catch
+            {
+                this.webServer_Path = "FIB_verify";
+            }
             Update_Url();
             JObject json = new JObject();
             json.Add("img_before_path", imageBefore);
@@ -185,7 +217,14 @@ namespace WebManager
         /// <returns>json字符串</returns>
         public void Img_Trapezoid_Top_Center_Position(String imagePath, out double offsetx, out double offsety, out int state)
         {
-            this.webServer_Path = "test4";
+            try
+            {
+                this.webServer_Path = this._url[3];
+            }
+            catch
+            {
+                this.webServer_Path = "test4";
+            }
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);
@@ -214,7 +253,14 @@ namespace WebManager
         /// <returns>json字符串</returns>
         public String Img_Auto_Focus(List<String> imagePath)
         {
-            this.webServer_Path = "test5";
+            try
+            {
+                this.webServer_Path = this._url[4];
+            }
+            catch
+            {
+                this.webServer_Path = "test5";
+            }
             Update_Url();
             JObject json = new JObject();
             for(int i=0;i<imagePath.Count;i++)
@@ -240,7 +286,14 @@ namespace WebManager
         /// <returns>json字符串</returns>
         public String Img_Auto_Stigmatic(List<String> imagePath)
         {
-            this.webServer_Path = "test6";
+            try
+            {
+                this.webServer_Path = this._url[5];
+            }
+            catch
+            {
+                this.webServer_Path = "test6";
+            }
             Update_Url();
             JObject json = new JObject();
             for (int i = 0; i < imagePath.Count; i++)
@@ -264,9 +317,16 @@ namespace WebManager
         /// </summary>
         /// <param name="imagePath">图片路径</param>
         /// <returns>json字符串</returns>
-        public void Img_Center_Position_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out double degree, out int direction, out int state)
+        public void Img_Center_Position_OffsetAngle_Direction(String imagePath, String imageType, String firm, out float offsetx, out float offsety, out float degree, out int direction, out int state)
         {
-            this.webServer_Path = "test7";
+            try
+            {
+                this.webServer_Path = this._url[6];
+            }
+            catch
+            {
+                this.webServer_Path = "test7";
+            }
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);
@@ -278,10 +338,10 @@ namespace WebManager
             {
                 JObject jname = JObject.Parse(jret["img_name"].ToString());
                 JArray jlocation = JArray.Parse(jname["center"].ToString());
-                offsetx = Convert.ToDouble(jlocation[0].ToString());
-                offsety = Convert.ToDouble(jlocation[1].ToString());
+                offsetx = Convert.ToSingle(jlocation[0].ToString());
+                offsety = Convert.ToSingle(jlocation[1].ToString());
                 state = Convert.ToInt32(jname["state"].ToString());
-                degree = Convert.ToDouble(jname["degree"].ToString());
+                degree = Convert.ToSingle(jname["degree"].ToString());
                 direction = Convert.ToInt32(jname["direction"].ToString());
 
             }
@@ -304,7 +364,14 @@ namespace WebManager
         /// <returns>json字符串</returns>
         public void Img_Measure_Size(String imagePath, String ratio, String size, out int state)
         {
-            this.webServer_Path = "test8";
+            try
+            {
+                this.webServer_Path = this._url[7];
+            }
+            catch
+            {
+                this.webServer_Path = "test8";
+            }
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);