Browse Source

xml reading

gsp 4 năm trước cách đây
mục cha
commit
89fd33ae28

+ 1 - 44
HOZProject/App.config

@@ -66,24 +66,7 @@
       <add key="FH_Magnification" value="1500"/>
       <!--层高分析的电压-->
       <add key="FH_Voltage" value="3000"/>
-      <!--是否调节FIB-->
-      <add key="Is_FIBDo" value="True"/>
-      <!--是否自动调节亮度对比度-->
-      <add key="Is_FIBAutoBc" value="True"/>
-      <!--亮度对比度-->
-      <add key="FIBB" value="50"/>
-      <add key="FIBC" value="50"/>
-      <!--放大倍数挡位,偏移值-->
-      <add key="MagComp" value="True"/>
-      <add key="MagRange1" value="0"/>
-      <add key="MagRange2" value="0"/>
-      <add key="MagRange3" value="3"/>
-      <add key="MagCompX1" value="11"/>
-      <add key="MagCompX2" value="12"/>
-      <add key="MagCompX3" value="13"/>
-      <add key="MagCompY1" value="21"/>
-      <add key="MagCompY2" value="22"/>
-      <add key="MagCompY3" value="23"/>
+  
       <!--ScanRotate角度补偿参数-->
       <add key="ScanRotCur" value="1"/>
       <!--Title角度补偿后Y轴方向PixelSize修正值-->
@@ -102,33 +85,7 @@
       <!--远程算法地址-->
       <add key="WebServerUrl" value="FIB_degree_recognize,FIB_cal_cut_location,FIB_verify,FIB_cut_center_location,FIB_sharpness,FIB_sharpness,FIB_degree_recognize_trap,FIB_measure_location,FIB_measure_parameter,FIB_EDS_points,FIB_EDS_lines,FIB_EDS_areas"/>
 
-      <!--聚焦调节-->
-      <add key="Focus_UP" value="3000"/>
-      <add key="Focus_Down" value="4000"/>
-      <add key="Focus_Step" value="1000"/>
-      <add key="Focus_Range" value="50"/>
-      <add key="Focus_FStep" value="50"/>
 
-      <!--FIB聚焦调节-->
-      <add key="FIB_UP" value="300"/>
-      <add key="FIB_Down" value="300"/>
-      <add key="FIB_Step" value="100"/>
-      <add key="FIB_Range" value="150"/>
-      <add key="FIB_FStep" value="50"/>
-
-      <!--StigX调节-->
-      <add key="StigX_UP" value="-1000"/>
-      <add key="StigX_Down" value="1000"/>
-      <add key="StigX_Step" value="1000"/>
-      <add key="StigX_Range" value="1000"/>
-      <add key="StigX_FStep" value="50"/>
-
-      <!--StigY调节-->
-      <add key="StigY_UP" value="-1000"/>
-      <add key="StigY_Down" value="1000"/>
-      <add key="StigY_Step" value="1000"/>
-      <add key="StigY_Range" value="1000"/>
-      <add key="StigY_FStep" value="50"/>
       
       <!--距离、矩阵-->
       <add key="distance" value="30"/>

+ 48 - 48
HOZProject/FormHOZMain.cs

@@ -147,44 +147,44 @@ namespace HOZProject
             {
               
 
-                m_MeasureFile.MParam.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
-                m_MeasureFile.MParam.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-                m_MeasureFile.MParam.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-                m_MeasureFile.MParam.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-                m_MeasureFile.MParam.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
-
-                m_MeasureFile.MParam.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
-                m_MeasureFile.MParam.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
-                m_MeasureFile.MParam.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
-                m_MeasureFile.MParam.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
-                m_MeasureFile.MParam.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
-
-                m_MeasureFile.MParam.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
-                m_MeasureFile.MParam.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
-                m_MeasureFile.MParam.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
-                m_MeasureFile.MParam.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
-                m_MeasureFile.MParam.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
-
-                m_MeasureFile.MParam.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
-                m_MeasureFile.MParam.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
-                m_MeasureFile.MParam.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
-                m_MeasureFile.MParam.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
-                m_MeasureFile.MParam.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
-
-                m_MeasureFile.MParam.FIBDo= Convert.ToBoolean(ConfigurationManager.AppSettings["Is_FIBDo"]);
-                m_MeasureFile.MParam.FIBAutoBC = Convert.ToBoolean(ConfigurationManager.AppSettings["Is_FIBAutoBc"]);
-                m_MeasureFile.MParam.FIBB = Convert.ToSingle(ConfigurationManager.AppSettings["FIBB"]);
-                m_MeasureFile.MParam.FIBC = Convert.ToSingle(ConfigurationManager.AppSettings["FIBC"]);
-                m_MeasureFile.MParam.MagComp = Convert.ToBoolean(ConfigurationManager.AppSettings["MagComp"]);
-                m_MeasureFile.MParam.MagRange1 = Convert.ToSingle(ConfigurationManager.AppSettings["MagRange1"]);
-                m_MeasureFile.MParam.MagRange2 = Convert.ToSingle(ConfigurationManager.AppSettings["MagRange2"]);
-                m_MeasureFile.MParam.MagRange3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagRange3"]);
-                m_MeasureFile.MParam.MagCompX1 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompX1"]);
-                m_MeasureFile.MParam.MagCompX2 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompX2"]);
-                m_MeasureFile.MParam.MagCompX3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompX3"]);
-                m_MeasureFile.MParam.MagCompY1 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY1"]);
-                m_MeasureFile.MParam.MagCompY2 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY2"]);
-                m_MeasureFile.MParam.MagCompY3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY3"]);
+                //m_MeasureFile.MParam.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
+                //m_MeasureFile.MParam.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
+                //m_MeasureFile.MParam.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
+                //m_MeasureFile.MParam.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
+                //m_MeasureFile.MParam.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
+
+                //m_MeasureFile.MParam.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
+                //m_MeasureFile.MParam.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
+                //m_MeasureFile.MParam.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
+                //m_MeasureFile.MParam.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
+                //m_MeasureFile.MParam.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
+
+                //m_MeasureFile.MParam.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
+                //m_MeasureFile.MParam.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
+                //m_MeasureFile.MParam.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
+                //m_MeasureFile.MParam.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
+                //m_MeasureFile.MParam.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
+
+                //m_MeasureFile.MParam.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
+                //m_MeasureFile.MParam.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
+                //m_MeasureFile.MParam.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
+                //m_MeasureFile.MParam.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
+                //m_MeasureFile.MParam.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
+
+                //m_MeasureFile.MParam.FIBDo= Convert.ToBoolean(ConfigurationManager.AppSettings["Is_FIBDo"]);
+                //m_MeasureFile.MParam.FIBAutoBC = Convert.ToBoolean(ConfigurationManager.AppSettings["Is_FIBAutoBc"]);
+                //m_MeasureFile.MParam.FIBB = Convert.ToSingle(ConfigurationManager.AppSettings["FIBB"]);
+                //m_MeasureFile.MParam.FIBC = Convert.ToSingle(ConfigurationManager.AppSettings["FIBC"]);
+                //m_MeasureFile.MParam.MagComp = Convert.ToBoolean(ConfigurationManager.AppSettings["MagComp"]);
+                //m_MeasureFile.MParam.MagRange1 = Convert.ToSingle(ConfigurationManager.AppSettings["MagRange1"]);
+                //m_MeasureFile.MParam.MagRange2 = Convert.ToSingle(ConfigurationManager.AppSettings["MagRange2"]);
+                //m_MeasureFile.MParam.MagRange3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagRange3"]);
+                //m_MeasureFile.MParam.MagCompX1 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompX1"]);
+                //m_MeasureFile.MParam.MagCompX2 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompX2"]);
+                //m_MeasureFile.MParam.MagCompX3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompX3"]);
+                //m_MeasureFile.MParam.MagCompY1 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY1"]);
+                //m_MeasureFile.MParam.MagCompY2 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY2"]);
+                //m_MeasureFile.MParam.MagCompY3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY3"]);
 
 
 
@@ -578,17 +578,17 @@ namespace HOZProject
                 if (m_MeasureFile.SaveAs())
                 {
                     //获取测量文件所在路径
-                    string savePath = m_MeasureFile.FilePath;
+                    //string savePath = m_MeasureFile.FilePath;
                     //数据库名称
-                    string dbFileName = "MeasureDB.db";
-                    //要复制的文件路径
-                    string pLocalFilePath = Application.StartupPath + "\\" + dbFileName;
-                    string pSaveFilePath = savePath + "\\" + dbFileName;//指定存储的路径
-                    if (File.Exists(pLocalFilePath))//必须判断要复制的文件是否存在
-                    {
-                        //三个参数分别是源文件路径,存储路径,若存储路径有相同文件是否替换
-                        //File.Copy(pLocalFilePath, pSaveFilePath, true);
-                    }
+                    //string dbFileName = "MeasureDB.db";
+                    ////要复制的文件路径
+                    //string pLocalFilePath = Application.StartupPath + "\\" + dbFileName;
+                    //string pSaveFilePath = savePath + "\\" + dbFileName;//指定存储的路径
+                    //if (File.Exists(pLocalFilePath))//必须判断要复制的文件是否存在
+                    //{
+                    //    //三个参数分别是源文件路径,存储路径,若存储路径有相同文件是否替换
+                    //    //File.Copy(pLocalFilePath, pSaveFilePath, true);
+                    //}
                     //将初始化中的参数,配置到测量参数中
                     m_MeasureFile.MParam = uControl_Init.GetMeasureParamInfo();
                     //设置已保存状态

+ 2 - 10
HOZProject/FormUnitControl.cs

@@ -2265,17 +2265,9 @@ namespace HOZProject
             //20201015 根据当前的工作距离重新计算对焦位置
             float currentWd = iSEM.GetWorkingDistance();//0.0154m =15.4mm = 15400um
             MeasureFile m_measureFile = new MeasureFile();
-            m_measureFile.MParam.AutoFocus.Path = txtFocus.Text;
-            m_measureFile.MParam.AutoFocus.Step = 50;//100um,0.1mm
-            m_measureFile.MParam.AutoFocus.UP = currentWd * 1000000 - m_measureFile.MParam.AutoFocus.Step;
-            m_measureFile.MParam.AutoFocus.Down = currentWd * 1000000 + m_measureFile.MParam.AutoFocus.Step;
-            m_measureFile.MParam.AutoFocus.Range = 40;
-            m_measureFile.MParam.AutoFocus.fStep = 20;
+     
 
-            //LogManager.AddHardwareLog("修改对焦参数", true);
-            //AutoFocus1(m_measureFile.MParam.AutoFocus, out wd);
-
-            LogManager.AddHardwareLog("自动调节算法输出" + (wd * 0.00000001).ToString(), true);
+          
             //设置工作距离
             iSEM.SetWorkingDistance((float)(wd * 0.00000001));
             //设置完工作距离后必须延迟5秒

+ 10 - 0
HOZProject/UnitControl.csproj

@@ -116,6 +116,12 @@
     <Compile Include="UserControls\FormExportPoints.Designer.cs">
       <DependentUpon>FormExportPoints.cs</DependentUpon>
     </Compile>
+    <Compile Include="UserControls\paramEdit.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="UserControls\paramEdit.Designer.cs">
+      <DependentUpon>paramEdit.cs</DependentUpon>
+    </Compile>
     <Compile Include="UserControls\UControl_CutHole.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -177,6 +183,9 @@
     <EmbeddedResource Include="UserControls\FormExportPoints.resx">
       <DependentUpon>FormExportPoints.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="UserControls\paramEdit.resx">
+      <DependentUpon>paramEdit.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="UserControls\UControl_CutHole.resx">
       <DependentUpon>UControl_CutHole.cs</DependentUpon>
     </EmbeddedResource>
@@ -304,6 +313,7 @@
     <None Include="Resources\Max_Gray.png" />
   </ItemGroup>
   <ItemGroup>
+    <Content Include="FlowParam_1.xml" />
     <Content Include="MeasureXML\MeasureStructXml.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
       <SubType>Designer</SubType>

+ 129 - 657
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -31,7 +31,6 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UControl_Init));
             this.label1 = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
-            this.pbClose = new System.Windows.Forms.PictureBox();
             this.tbCutHoleFilePath = new System.Windows.Forms.TextBox();
             this.txtWPTF = new System.Windows.Forms.TextBox();
             this.lblCutHoleCount = new System.Windows.Forms.Label();
@@ -62,49 +61,13 @@
             this.chkWqxkc = new System.Windows.Forms.CheckBox();
             this.label3 = new System.Windows.Forms.Label();
             this.txtYPSCur = new System.Windows.Forms.TextBox();
-            this.btnFIBTemplateFile = new System.Windows.Forms.Button();
-            this.btnPTTemplateFile = new System.Windows.Forms.Button();
-            this.btnCutHoleAuto = new System.Windows.Forms.Button();
-            this.btnCutHoleFile = new System.Windows.Forms.Button();
-            this.pbDelWLZ = new System.Windows.Forms.PictureBox();
-            this.pbDelWQGD = new System.Windows.Forms.PictureBox();
-            this.pbWQGFDel = new System.Windows.Forms.PictureBox();
-            this.pbDelWPZD = new System.Windows.Forms.PictureBox();
-            this.pbDelWPZF = new System.Windows.Forms.PictureBox();
-            this.pbDelWYP = new System.Windows.Forms.PictureBox();
-            this.pbDelWCS = new System.Windows.Forms.PictureBox();
             this.panel2 = new System.Windows.Forms.Panel();
             this.btnSaveDefalutPara = new System.Windows.Forms.Button();
-            this.btnCreateConfig = new System.Windows.Forms.Button();
-            this.chkFIBAdjust = new System.Windows.Forms.CheckBox();
-            this.chkFIBAtuoAdjust = new System.Windows.Forms.CheckBox();
-            this.tbBrightness = new System.Windows.Forms.TextBox();
-            this.label4 = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
-            this.label7 = new System.Windows.Forms.Label();
-            this.label8 = new System.Windows.Forms.Label();
-            this.tbGear3to4 = new System.Windows.Forms.TextBox();
-            this.tbGear2to3 = new System.Windows.Forms.TextBox();
-            this.tbGear1to2 = new System.Windows.Forms.TextBox();
-            this.label9 = new System.Windows.Forms.Label();
-            this.label10 = new System.Windows.Forms.Label();
-            this.label12 = new System.Windows.Forms.Label();
-            this.label11 = new System.Windows.Forms.Label();
-            this.label13 = new System.Windows.Forms.Label();
-            this.label14 = new System.Windows.Forms.Label();
-            this.label15 = new System.Windows.Forms.Label();
+            this.btnEditConfig = new System.Windows.Forms.Button();
             this.tbGear1to2_Xdeviation = new System.Windows.Forms.TextBox();
-            this.label16 = new System.Windows.Forms.Label();
             this.tbGear1to2_Ydeviation = new System.Windows.Forms.TextBox();
-            this.tbGear2to3_Xdeviation = new System.Windows.Forms.TextBox();
             this.label17 = new System.Windows.Forms.Label();
-            this.tbGear2to3_Ydeviation = new System.Windows.Forms.TextBox();
-            this.tbGear3to4_Xdeviation = new System.Windows.Forms.TextBox();
-            this.tbGear3to4_Ydeviation = new System.Windows.Forms.TextBox();
-            this.chkGearSwitch = new System.Windows.Forms.CheckBox();
-            this.tbContrast = new System.Windows.Forms.TextBox();
             this.txtScanRotCur = new System.Windows.Forms.TextBox();
-            this.btnHandSavePoints = new System.Windows.Forms.Button();
             this.chkEDS = new System.Windows.Forms.CheckBox();
             this.txtEDSZ = new System.Windows.Forms.TextBox();
             this.label18 = new System.Windows.Forms.Label();
@@ -115,27 +78,20 @@
             this.label23 = new System.Windows.Forms.Label();
             this.cbbEDSV = new System.Windows.Forms.ComboBox();
             this.cbbEDSA = new System.Windows.Forms.ComboBox();
-            this.tbScanSpeedNormal = new System.Windows.Forms.TextBox();
-            this.label24 = new System.Windows.Forms.Label();
-            this.label25 = new System.Windows.Forms.Label();
-            this.label26 = new System.Windows.Forms.Label();
-            this.tbScanSpeedFocus = new System.Windows.Forms.TextBox();
-            this.tbScanSpeedHigh = new System.Windows.Forms.TextBox();
-            this.label27 = new System.Windows.Forms.Label();
             this.cboXrayMode = new System.Windows.Forms.ComboBox();
             this.label28 = new System.Windows.Forms.Label();
             this.label29 = new System.Windows.Forms.Label();
             this.label30 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.btnHandSavePoints = new System.Windows.Forms.Button();
+            this.btnFIBTemplateFile = new System.Windows.Forms.Button();
+            this.btnPTTemplateFile = new System.Windows.Forms.Button();
+            this.btnCutHoleAuto = new System.Windows.Forms.Button();
+            this.btnCutHoleFile = new System.Windows.Forms.Button();
+            this.pbClose = new System.Windows.Forms.PictureBox();
             this.panel1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWLZ)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWQGD)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbWQGFDel)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWPZD)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWPZF)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWYP)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWCS)).BeginInit();
             this.panel2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             this.SuspendLayout();
             // 
             // label1
@@ -161,22 +117,6 @@
             this.panel1.Size = new System.Drawing.Size(767, 33);
             this.panel1.TabIndex = 3;
             // 
-            // pbClose
-            // 
-            this.pbClose.BackColor = System.Drawing.Color.Transparent;
-            this.pbClose.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbClose.Dock = System.Windows.Forms.DockStyle.Right;
-            this.pbClose.Location = new System.Drawing.Point(733, 0);
-            this.pbClose.Name = "pbClose";
-            this.pbClose.Size = new System.Drawing.Size(32, 31);
-            this.pbClose.TabIndex = 106;
-            this.pbClose.TabStop = false;
-            this.pbClose.Click += new System.EventHandler(this.btnClose_Click);
-            this.pbClose.MouseEnter += new System.EventHandler(this.pbClose_MouseEnter);
-            this.pbClose.MouseLeave += new System.EventHandler(this.pbClose_MouseLeave);
-            // 
             // tbCutHoleFilePath
             // 
             this.tbCutHoleFilePath.Font = new System.Drawing.Font("宋体", 10F);
@@ -386,7 +326,7 @@
             this.label54.AutoSize = true;
             this.label54.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label54.ForeColor = System.Drawing.Color.Black;
-            this.label54.Location = new System.Drawing.Point(418, 264);
+            this.label54.Location = new System.Drawing.Point(404, 262);
             this.label54.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label54.Name = "label54";
             this.label54.Size = new System.Drawing.Size(99, 20);
@@ -410,7 +350,7 @@
             this.label42.AutoSize = true;
             this.label42.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label42.ForeColor = System.Drawing.Color.Black;
-            this.label42.Location = new System.Drawing.Point(418, 239);
+            this.label42.Location = new System.Drawing.Point(406, 237);
             this.label42.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label42.Name = "label42";
             this.label42.Size = new System.Drawing.Size(99, 20);
@@ -544,7 +484,7 @@
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.ForeColor = System.Drawing.Color.Black;
-            this.label3.Location = new System.Drawing.Point(360, 289);
+            this.label3.Location = new System.Drawing.Point(350, 287);
             this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(171, 20);
@@ -561,158 +501,10 @@
             this.txtYPSCur.TextChanged += new System.EventHandler(this.txtYPSCur_TextChanged);
             this.txtYPSCur.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtYPSCur_KeyPress);
             // 
-            // btnFIBTemplateFile
-            // 
-            this.btnFIBTemplateFile.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnFIBTemplateFile.Image = ((System.Drawing.Image)(resources.GetObject("btnFIBTemplateFile.Image")));
-            this.btnFIBTemplateFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.btnFIBTemplateFile.Location = new System.Drawing.Point(526, 126);
-            this.btnFIBTemplateFile.Name = "btnFIBTemplateFile";
-            this.btnFIBTemplateFile.Size = new System.Drawing.Size(89, 25);
-            this.btnFIBTemplateFile.TabIndex = 123;
-            this.btnFIBTemplateFile.Text = "导入模板";
-            this.btnFIBTemplateFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            this.btnFIBTemplateFile.UseVisualStyleBackColor = true;
-            this.btnFIBTemplateFile.Click += new System.EventHandler(this.btnFIBTemplateFile_Click);
-            // 
-            // btnPTTemplateFile
-            // 
-            this.btnPTTemplateFile.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnPTTemplateFile.Image = ((System.Drawing.Image)(resources.GetObject("btnPTTemplateFile.Image")));
-            this.btnPTTemplateFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.btnPTTemplateFile.Location = new System.Drawing.Point(526, 97);
-            this.btnPTTemplateFile.Name = "btnPTTemplateFile";
-            this.btnPTTemplateFile.Size = new System.Drawing.Size(89, 25);
-            this.btnPTTemplateFile.TabIndex = 122;
-            this.btnPTTemplateFile.Text = "导入模板";
-            this.btnPTTemplateFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            this.btnPTTemplateFile.UseVisualStyleBackColor = true;
-            this.btnPTTemplateFile.Click += new System.EventHandler(this.btnPTTemplateFile_Click);
-            // 
-            // btnCutHoleAuto
-            // 
-            this.btnCutHoleAuto.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnCutHoleAuto.Image = global::HOZProject.Properties.Resources.HomePageImport;
-            this.btnCutHoleAuto.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.btnCutHoleAuto.Location = new System.Drawing.Point(635, 46);
-            this.btnCutHoleAuto.Name = "btnCutHoleAuto";
-            this.btnCutHoleAuto.Size = new System.Drawing.Size(103, 25);
-            this.btnCutHoleAuto.TabIndex = 121;
-            this.btnCutHoleAuto.Text = "单个测试点";
-            this.btnCutHoleAuto.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            this.btnCutHoleAuto.UseVisualStyleBackColor = true;
-            this.btnCutHoleAuto.Click += new System.EventHandler(this.btnCutHoleAuto_Click);
-            // 
-            // btnCutHoleFile
-            // 
-            this.btnCutHoleFile.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnCutHoleFile.Image = global::HOZProject.Properties.Resources.BatchImport;
-            this.btnCutHoleFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.btnCutHoleFile.Location = new System.Drawing.Point(527, 46);
-            this.btnCutHoleFile.Name = "btnCutHoleFile";
-            this.btnCutHoleFile.Size = new System.Drawing.Size(103, 25);
-            this.btnCutHoleFile.TabIndex = 120;
-            this.btnCutHoleFile.Text = "多个测试点";
-            this.btnCutHoleFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            this.btnCutHoleFile.UseVisualStyleBackColor = true;
-            this.btnCutHoleFile.Click += new System.EventHandler(this.btnCutHoleFile_Click);
-            // 
-            // pbDelWLZ
-            // 
-            this.pbDelWLZ.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbDelWLZ.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbDelWLZ.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbDelWLZ.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbDelWLZ.Location = new System.Drawing.Point(657, 210);
-            this.pbDelWLZ.Name = "pbDelWLZ";
-            this.pbDelWLZ.Size = new System.Drawing.Size(25, 21);
-            this.pbDelWLZ.TabIndex = 111;
-            this.pbDelWLZ.TabStop = false;
-            this.pbDelWLZ.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
-            // pbDelWQGD
-            // 
-            this.pbDelWQGD.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbDelWQGD.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbDelWQGD.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbDelWQGD.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbDelWQGD.Location = new System.Drawing.Point(329, 235);
-            this.pbDelWQGD.Name = "pbDelWQGD";
-            this.pbDelWQGD.Size = new System.Drawing.Size(25, 21);
-            this.pbDelWQGD.TabIndex = 110;
-            this.pbDelWQGD.TabStop = false;
-            this.pbDelWQGD.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
-            // pbWQGFDel
-            // 
-            this.pbWQGFDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbWQGFDel.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbWQGFDel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbWQGFDel.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbWQGFDel.Location = new System.Drawing.Point(657, 235);
-            this.pbWQGFDel.Name = "pbWQGFDel";
-            this.pbWQGFDel.Size = new System.Drawing.Size(25, 21);
-            this.pbWQGFDel.TabIndex = 109;
-            this.pbWQGFDel.TabStop = false;
-            this.pbWQGFDel.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
-            // pbDelWPZD
-            // 
-            this.pbDelWPZD.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbDelWPZD.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbDelWPZD.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbDelWPZD.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbDelWPZD.Location = new System.Drawing.Point(329, 260);
-            this.pbDelWPZD.Name = "pbDelWPZD";
-            this.pbDelWPZD.Size = new System.Drawing.Size(25, 21);
-            this.pbDelWPZD.TabIndex = 108;
-            this.pbDelWPZD.TabStop = false;
-            this.pbDelWPZD.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
-            // pbDelWPZF
-            // 
-            this.pbDelWPZF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbDelWPZF.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbDelWPZF.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbDelWPZF.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbDelWPZF.Location = new System.Drawing.Point(657, 260);
-            this.pbDelWPZF.Name = "pbDelWPZF";
-            this.pbDelWPZF.Size = new System.Drawing.Size(25, 21);
-            this.pbDelWPZF.TabIndex = 107;
-            this.pbDelWPZF.TabStop = false;
-            this.pbDelWPZF.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
-            // pbDelWYP
-            // 
-            this.pbDelWYP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbDelWYP.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbDelWYP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbDelWYP.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbDelWYP.Location = new System.Drawing.Point(329, 186);
-            this.pbDelWYP.Name = "pbDelWYP";
-            this.pbDelWYP.Size = new System.Drawing.Size(25, 21);
-            this.pbDelWYP.TabIndex = 106;
-            this.pbDelWYP.TabStop = false;
-            this.pbDelWYP.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
-            // pbDelWCS
-            // 
-            this.pbDelWCS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.pbDelWCS.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
-            this.pbDelWCS.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
-            this.pbDelWCS.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbDelWCS.Location = new System.Drawing.Point(657, 185);
-            this.pbDelWCS.Name = "pbDelWCS";
-            this.pbDelWCS.Size = new System.Drawing.Size(25, 21);
-            this.pbDelWCS.TabIndex = 105;
-            this.pbDelWCS.TabStop = false;
-            this.pbDelWCS.Click += new System.EventHandler(this.DelComboBoxItem_Click);
-            // 
             // panel2
             // 
             this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel2.Controls.Add(this.btnSaveDefalutPara);
-            this.panel2.Controls.Add(this.btnCreateConfig);
             this.panel2.Location = new System.Drawing.Point(0, 441);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(769, 49);
@@ -723,7 +515,7 @@
             this.btnSaveDefalutPara.Cursor = System.Windows.Forms.Cursors.Hand;
             this.btnSaveDefalutPara.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.btnSaveDefalutPara.ForeColor = System.Drawing.Color.Black;
-            this.btnSaveDefalutPara.Location = new System.Drawing.Point(381, 9);
+            this.btnSaveDefalutPara.Location = new System.Drawing.Point(271, 2);
             this.btnSaveDefalutPara.Margin = new System.Windows.Forms.Padding(2);
             this.btnSaveDefalutPara.Name = "btnSaveDefalutPara";
             this.btnSaveDefalutPara.Size = new System.Drawing.Size(129, 30);
@@ -732,197 +524,19 @@
             this.btnSaveDefalutPara.UseVisualStyleBackColor = true;
             this.btnSaveDefalutPara.Click += new System.EventHandler(this.btnSaveDefalutPara_Click);
             // 
-            // btnCreateConfig
-            // 
-            this.btnCreateConfig.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.btnCreateConfig.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnCreateConfig.ForeColor = System.Drawing.Color.Black;
-            this.btnCreateConfig.Location = new System.Drawing.Point(227, 9);
-            this.btnCreateConfig.Margin = new System.Windows.Forms.Padding(2);
-            this.btnCreateConfig.Name = "btnCreateConfig";
-            this.btnCreateConfig.Size = new System.Drawing.Size(129, 30);
-            this.btnCreateConfig.TabIndex = 119;
-            this.btnCreateConfig.Text = "创建配置文件";
-            this.btnCreateConfig.UseVisualStyleBackColor = true;
-            this.btnCreateConfig.Click += new System.EventHandler(this.btnCreateConfig_Click);
-            // 
-            // chkFIBAdjust
-            // 
-            this.chkFIBAdjust.AutoSize = true;
-            this.chkFIBAdjust.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.chkFIBAdjust.Location = new System.Drawing.Point(90, 371);
-            this.chkFIBAdjust.Name = "chkFIBAdjust";
-            this.chkFIBAdjust.Size = new System.Drawing.Size(176, 27);
-            this.chkFIBAdjust.TabIndex = 125;
-            this.chkFIBAdjust.Text = "FIB亮度对比度调节";
-            this.chkFIBAdjust.UseVisualStyleBackColor = true;
-            this.chkFIBAdjust.CheckedChanged += new System.EventHandler(this.chkFIBAdjust_CheckedChanged);
-            // 
-            // chkFIBAtuoAdjust
-            // 
-            this.chkFIBAtuoAdjust.AutoSize = true;
-            this.chkFIBAtuoAdjust.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.chkFIBAtuoAdjust.Location = new System.Drawing.Point(248, 371);
-            this.chkFIBAtuoAdjust.Name = "chkFIBAtuoAdjust";
-            this.chkFIBAtuoAdjust.Size = new System.Drawing.Size(210, 27);
-            this.chkFIBAtuoAdjust.TabIndex = 126;
-            this.chkFIBAtuoAdjust.Text = "FIB亮度对比度自动调节";
-            this.chkFIBAtuoAdjust.UseVisualStyleBackColor = true;
-            this.chkFIBAtuoAdjust.CheckedChanged += new System.EventHandler(this.chkFIBAtuoAdjust_CheckedChanged);
-            // 
-            // tbBrightness
-            // 
-            this.tbBrightness.Location = new System.Drawing.Point(229, 398);
-            this.tbBrightness.MaxLength = 3;
-            this.tbBrightness.Name = "tbBrightness";
-            this.tbBrightness.Size = new System.Drawing.Size(100, 27);
-            this.tbBrightness.TabIndex = 127;
-            this.tbBrightness.TextChanged += new System.EventHandler(this.tbBrightness_TextChanged);
-            this.tbBrightness.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbBrightness_KeyPress);
+            // btnEditConfig
             // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(188, 401);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(44, 23);
-            this.label4.TabIndex = 129;
-            this.label4.Text = "亮度";
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(464, 400);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(61, 23);
-            this.label5.TabIndex = 130;
-            this.label5.Text = "对比度";
-            // 
-            // label7
-            // 
-            this.label7.AutoSize = true;
-            this.label7.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(332, 401);
-            this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(25, 23);
-            this.label7.TabIndex = 131;
-            this.label7.Text = "%";
-            // 
-            // label8
-            // 
-            this.label8.AutoSize = true;
-            this.label8.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label8.Location = new System.Drawing.Point(624, 402);
-            this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(25, 23);
-            this.label8.TabIndex = 132;
-            this.label8.Text = "%";
-            // 
-            // tbGear3to4
-            // 
-            this.tbGear3to4.Location = new System.Drawing.Point(140, 510);
-            this.tbGear3to4.Name = "tbGear3to4";
-            this.tbGear3to4.Size = new System.Drawing.Size(100, 27);
-            this.tbGear3to4.TabIndex = 32;
-            this.tbGear3to4.Visible = false;
-            this.tbGear3to4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear3to4_KeyPress);
-            // 
-            // tbGear2to3
-            // 
-            this.tbGear2to3.Location = new System.Drawing.Point(140, 477);
-            this.tbGear2to3.Name = "tbGear2to3";
-            this.tbGear2to3.Size = new System.Drawing.Size(100, 27);
-            this.tbGear2to3.TabIndex = 31;
-            this.tbGear2to3.Visible = false;
-            this.tbGear2to3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear2to3_KeyPress);
-            // 
-            // tbGear1to2
-            // 
-            this.tbGear1to2.Location = new System.Drawing.Point(140, 444);
-            this.tbGear1to2.Name = "tbGear1to2";
-            this.tbGear1to2.Size = new System.Drawing.Size(100, 27);
-            this.tbGear1to2.TabIndex = 30;
-            this.tbGear1to2.Visible = false;
-            this.tbGear1to2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear1to2_KeyPress);
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(306, 477);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(72, 23);
-            this.label9.TabIndex = 19;
-            this.label9.Text = "X偏移值";
-            this.label9.Visible = false;
-            // 
-            // label10
-            // 
-            this.label10.AutoSize = true;
-            this.label10.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(43, 447);
-            this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(115, 23);
-            this.label10.TabIndex = 6;
-            this.label10.Text = "挡位1至挡位2";
-            this.label10.Visible = false;
-            // 
-            // label12
-            // 
-            this.label12.AutoSize = true;
-            this.label12.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(555, 510);
-            this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(71, 23);
-            this.label12.TabIndex = 24;
-            this.label12.Text = "Y偏移值";
-            this.label12.Visible = false;
-            // 
-            // label11
-            // 
-            this.label11.AutoSize = true;
-            this.label11.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(43, 480);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(115, 23);
-            this.label11.TabIndex = 7;
-            this.label11.Text = "挡位2至挡位3";
-            this.label11.Visible = false;
-            // 
-            // label13
-            // 
-            this.label13.AutoSize = true;
-            this.label13.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(555, 477);
-            this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(71, 23);
-            this.label13.TabIndex = 23;
-            this.label13.Text = "Y偏移值";
-            this.label13.Visible = false;
-            // 
-            // label14
-            // 
-            this.label14.AutoSize = true;
-            this.label14.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(43, 513);
-            this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(115, 23);
-            this.label14.TabIndex = 8;
-            this.label14.Text = "挡位3至档位4";
-            this.label14.Visible = false;
-            // 
-            // label15
-            // 
-            this.label15.AutoSize = true;
-            this.label15.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(555, 444);
-            this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(71, 23);
-            this.label15.TabIndex = 22;
-            this.label15.Text = "Y偏移值";
-            this.label15.Visible = false;
+            this.btnEditConfig.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.btnEditConfig.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnEditConfig.ForeColor = System.Drawing.Color.Black;
+            this.btnEditConfig.Location = new System.Drawing.Point(329, 182);
+            this.btnEditConfig.Margin = new System.Windows.Forms.Padding(2);
+            this.btnEditConfig.Name = "btnEditConfig";
+            this.btnEditConfig.Size = new System.Drawing.Size(42, 30);
+            this.btnEditConfig.TabIndex = 119;
+            this.btnEditConfig.Text = "...";
+            this.btnEditConfig.UseVisualStyleBackColor = true;
+            this.btnEditConfig.Click += new System.EventHandler(this.btnEditConfig_Click);
             // 
             // tbGear1to2_Xdeviation
             // 
@@ -931,18 +545,6 @@
             this.tbGear1to2_Xdeviation.Size = new System.Drawing.Size(100, 27);
             this.tbGear1to2_Xdeviation.TabIndex = 10;
             this.tbGear1to2_Xdeviation.Visible = false;
-            this.tbGear1to2_Xdeviation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear1to2_Xdeviation_KeyPress);
-            // 
-            // label16
-            // 
-            this.label16.AutoSize = true;
-            this.label16.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(306, 510);
-            this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(72, 23);
-            this.label16.TabIndex = 20;
-            this.label16.Text = "X偏移值";
-            this.label16.Visible = false;
             // 
             // tbGear1to2_Ydeviation
             // 
@@ -951,16 +553,6 @@
             this.tbGear1to2_Ydeviation.Size = new System.Drawing.Size(100, 27);
             this.tbGear1to2_Ydeviation.TabIndex = 11;
             this.tbGear1to2_Ydeviation.Visible = false;
-            this.tbGear1to2_Ydeviation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear1to2_Ydeviation_KeyPress);
-            // 
-            // tbGear2to3_Xdeviation
-            // 
-            this.tbGear2to3_Xdeviation.Location = new System.Drawing.Point(377, 474);
-            this.tbGear2to3_Xdeviation.Name = "tbGear2to3_Xdeviation";
-            this.tbGear2to3_Xdeviation.Size = new System.Drawing.Size(100, 27);
-            this.tbGear2to3_Xdeviation.TabIndex = 12;
-            this.tbGear2to3_Xdeviation.Visible = false;
-            this.tbGear2to3_Xdeviation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear2to3_Xdeviation_KeyPress);
             // 
             // label17
             // 
@@ -973,55 +565,6 @@
             this.label17.Text = "X偏移值";
             this.label17.Visible = false;
             // 
-            // tbGear2to3_Ydeviation
-            // 
-            this.tbGear2to3_Ydeviation.Location = new System.Drawing.Point(627, 474);
-            this.tbGear2to3_Ydeviation.Name = "tbGear2to3_Ydeviation";
-            this.tbGear2to3_Ydeviation.Size = new System.Drawing.Size(100, 27);
-            this.tbGear2to3_Ydeviation.TabIndex = 13;
-            this.tbGear2to3_Ydeviation.Visible = false;
-            this.tbGear2to3_Ydeviation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear2to3_Ydeviation_KeyPress);
-            // 
-            // tbGear3to4_Xdeviation
-            // 
-            this.tbGear3to4_Xdeviation.Location = new System.Drawing.Point(377, 507);
-            this.tbGear3to4_Xdeviation.Name = "tbGear3to4_Xdeviation";
-            this.tbGear3to4_Xdeviation.Size = new System.Drawing.Size(100, 27);
-            this.tbGear3to4_Xdeviation.TabIndex = 14;
-            this.tbGear3to4_Xdeviation.Visible = false;
-            this.tbGear3to4_Xdeviation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear3to4_Xdeviation_KeyPress);
-            // 
-            // tbGear3to4_Ydeviation
-            // 
-            this.tbGear3to4_Ydeviation.Location = new System.Drawing.Point(627, 507);
-            this.tbGear3to4_Ydeviation.Name = "tbGear3to4_Ydeviation";
-            this.tbGear3to4_Ydeviation.Size = new System.Drawing.Size(100, 27);
-            this.tbGear3to4_Ydeviation.TabIndex = 15;
-            this.tbGear3to4_Ydeviation.Visible = false;
-            this.tbGear3to4_Ydeviation.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbGear3to4_Ydeviation_KeyPress);
-            // 
-            // chkGearSwitch
-            // 
-            this.chkGearSwitch.AutoSize = true;
-            this.chkGearSwitch.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.chkGearSwitch.Location = new System.Drawing.Point(470, 371);
-            this.chkGearSwitch.Name = "chkGearSwitch";
-            this.chkGearSwitch.Size = new System.Drawing.Size(100, 27);
-            this.chkGearSwitch.TabIndex = 134;
-            this.chkGearSwitch.Text = "放大挡位";
-            this.chkGearSwitch.UseVisualStyleBackColor = true;
-            this.chkGearSwitch.Visible = false;
-            // 
-            // tbContrast
-            // 
-            this.tbContrast.Location = new System.Drawing.Point(518, 398);
-            this.tbContrast.MaxLength = 3;
-            this.tbContrast.Name = "tbContrast";
-            this.tbContrast.Size = new System.Drawing.Size(100, 27);
-            this.tbContrast.TabIndex = 135;
-            this.tbContrast.TextChanged += new System.EventHandler(this.tbContrast_TextChanged);
-            this.tbContrast.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbContrast_KeyPress);
-            // 
             // txtScanRotCur
             // 
             this.txtScanRotCur.Location = new System.Drawing.Point(174, 285);
@@ -1030,20 +573,6 @@
             this.txtScanRotCur.Size = new System.Drawing.Size(155, 27);
             this.txtScanRotCur.TabIndex = 136;
             // 
-            // btnHandSavePoints
-            // 
-            this.btnHandSavePoints.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnHandSavePoints.Image = global::HOZProject.Properties.Resources.BatchImport;
-            this.btnHandSavePoints.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-            this.btnHandSavePoints.Location = new System.Drawing.Point(527, 72);
-            this.btnHandSavePoints.Name = "btnHandSavePoints";
-            this.btnHandSavePoints.Size = new System.Drawing.Size(103, 25);
-            this.btnHandSavePoints.TabIndex = 137;
-            this.btnHandSavePoints.Text = "手动添加点";
-            this.btnHandSavePoints.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            this.btnHandSavePoints.UseVisualStyleBackColor = true;
-            this.btnHandSavePoints.Click += new System.EventHandler(this.btnHandSavePoints_Click);
-            // 
             // chkEDS
             // 
             this.chkEDS.AutoSize = true;
@@ -1173,81 +702,6 @@
             this.cbbEDSA.Size = new System.Drawing.Size(155, 25);
             this.cbbEDSA.TabIndex = 149;
             // 
-            // tbScanSpeedNormal
-            // 
-            this.tbScanSpeedNormal.Location = new System.Drawing.Point(140, 548);
-            this.tbScanSpeedNormal.Name = "tbScanSpeedNormal";
-            this.tbScanSpeedNormal.Size = new System.Drawing.Size(100, 27);
-            this.tbScanSpeedNormal.TabIndex = 155;
-            this.tbScanSpeedNormal.Text = "4";
-            this.tbScanSpeedNormal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
-            this.tbScanSpeedNormal.Visible = false;
-            // 
-            // label24
-            // 
-            this.label24.AutoSize = true;
-            this.label24.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label24.Location = new System.Drawing.Point(495, 548);
-            this.label24.Name = "label24";
-            this.label24.Size = new System.Drawing.Size(146, 23);
-            this.label24.TabIndex = 154;
-            this.label24.Text = "高倍拍照扫描速度";
-            this.label24.Visible = false;
-            // 
-            // label25
-            // 
-            this.label25.AutoSize = true;
-            this.label25.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label25.Location = new System.Drawing.Point(43, 551);
-            this.label25.Name = "label25";
-            this.label25.Size = new System.Drawing.Size(112, 23);
-            this.label25.TabIndex = 150;
-            this.label25.Text = "正常扫描速度";
-            this.label25.Visible = false;
-            // 
-            // label26
-            // 
-            this.label26.AutoSize = true;
-            this.label26.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label26.Location = new System.Drawing.Point(270, 548);
-            this.label26.Name = "label26";
-            this.label26.Size = new System.Drawing.Size(112, 23);
-            this.label26.TabIndex = 153;
-            this.label26.Text = "对焦扫描速度";
-            this.label26.Visible = false;
-            // 
-            // tbScanSpeedFocus
-            // 
-            this.tbScanSpeedFocus.Location = new System.Drawing.Point(377, 545);
-            this.tbScanSpeedFocus.Name = "tbScanSpeedFocus";
-            this.tbScanSpeedFocus.Size = new System.Drawing.Size(100, 27);
-            this.tbScanSpeedFocus.TabIndex = 151;
-            this.tbScanSpeedFocus.Text = "5";
-            this.tbScanSpeedFocus.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
-            this.tbScanSpeedFocus.Visible = false;
-            // 
-            // tbScanSpeedHigh
-            // 
-            this.tbScanSpeedHigh.Location = new System.Drawing.Point(627, 545);
-            this.tbScanSpeedHigh.Name = "tbScanSpeedHigh";
-            this.tbScanSpeedHigh.Size = new System.Drawing.Size(100, 27);
-            this.tbScanSpeedHigh.TabIndex = 152;
-            this.tbScanSpeedHigh.Text = "7";
-            this.tbScanSpeedHigh.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
-            this.tbScanSpeedHigh.Visible = false;
-            // 
-            // label27
-            // 
-            this.label27.AutoSize = true;
-            this.label27.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label27.ForeColor = System.Drawing.Color.Black;
-            this.label27.Location = new System.Drawing.Point(362, 189);
-            this.label27.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label27.Name = "label27";
-            this.label27.Size = new System.Drawing.Size(39, 20);
-            this.label27.TabIndex = 156;
-            this.label27.Text = "厂商";
-            // 
             // cboXrayMode
             // 
             this.cboXrayMode.Font = new System.Drawing.Font("宋体", 10F);
@@ -1299,19 +753,111 @@
             this.label30.TabIndex = 142;
             this.label30.Text = "2:area";
             // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.ForeColor = System.Drawing.Color.Black;
+            this.label4.Location = new System.Drawing.Point(375, 186);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(69, 20);
+            this.label4.TabIndex = 80;
+            this.label4.Text = "样品类名";
+            // 
+            // btnHandSavePoints
+            // 
+            this.btnHandSavePoints.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnHandSavePoints.Image = global::HOZProject.Properties.Resources.BatchImport;
+            this.btnHandSavePoints.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.btnHandSavePoints.Location = new System.Drawing.Point(527, 72);
+            this.btnHandSavePoints.Name = "btnHandSavePoints";
+            this.btnHandSavePoints.Size = new System.Drawing.Size(103, 25);
+            this.btnHandSavePoints.TabIndex = 137;
+            this.btnHandSavePoints.Text = "手动添加点";
+            this.btnHandSavePoints.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.btnHandSavePoints.UseVisualStyleBackColor = true;
+            this.btnHandSavePoints.Click += new System.EventHandler(this.btnHandSavePoints_Click);
+            // 
+            // btnFIBTemplateFile
+            // 
+            this.btnFIBTemplateFile.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnFIBTemplateFile.Image = ((System.Drawing.Image)(resources.GetObject("btnFIBTemplateFile.Image")));
+            this.btnFIBTemplateFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.btnFIBTemplateFile.Location = new System.Drawing.Point(526, 126);
+            this.btnFIBTemplateFile.Name = "btnFIBTemplateFile";
+            this.btnFIBTemplateFile.Size = new System.Drawing.Size(89, 25);
+            this.btnFIBTemplateFile.TabIndex = 123;
+            this.btnFIBTemplateFile.Text = "导入模板";
+            this.btnFIBTemplateFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.btnFIBTemplateFile.UseVisualStyleBackColor = true;
+            this.btnFIBTemplateFile.Click += new System.EventHandler(this.btnFIBTemplateFile_Click);
+            // 
+            // btnPTTemplateFile
+            // 
+            this.btnPTTemplateFile.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnPTTemplateFile.Image = ((System.Drawing.Image)(resources.GetObject("btnPTTemplateFile.Image")));
+            this.btnPTTemplateFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.btnPTTemplateFile.Location = new System.Drawing.Point(526, 97);
+            this.btnPTTemplateFile.Name = "btnPTTemplateFile";
+            this.btnPTTemplateFile.Size = new System.Drawing.Size(89, 25);
+            this.btnPTTemplateFile.TabIndex = 122;
+            this.btnPTTemplateFile.Text = "导入模板";
+            this.btnPTTemplateFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.btnPTTemplateFile.UseVisualStyleBackColor = true;
+            this.btnPTTemplateFile.Click += new System.EventHandler(this.btnPTTemplateFile_Click);
+            // 
+            // btnCutHoleAuto
+            // 
+            this.btnCutHoleAuto.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnCutHoleAuto.Image = global::HOZProject.Properties.Resources.HomePageImport;
+            this.btnCutHoleAuto.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.btnCutHoleAuto.Location = new System.Drawing.Point(635, 46);
+            this.btnCutHoleAuto.Name = "btnCutHoleAuto";
+            this.btnCutHoleAuto.Size = new System.Drawing.Size(103, 25);
+            this.btnCutHoleAuto.TabIndex = 121;
+            this.btnCutHoleAuto.Text = "单个测试点";
+            this.btnCutHoleAuto.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.btnCutHoleAuto.UseVisualStyleBackColor = true;
+            this.btnCutHoleAuto.Click += new System.EventHandler(this.btnCutHoleAuto_Click);
+            // 
+            // btnCutHoleFile
+            // 
+            this.btnCutHoleFile.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnCutHoleFile.Image = global::HOZProject.Properties.Resources.BatchImport;
+            this.btnCutHoleFile.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
+            this.btnCutHoleFile.Location = new System.Drawing.Point(527, 46);
+            this.btnCutHoleFile.Name = "btnCutHoleFile";
+            this.btnCutHoleFile.Size = new System.Drawing.Size(103, 25);
+            this.btnCutHoleFile.TabIndex = 120;
+            this.btnCutHoleFile.Text = "多个测试点";
+            this.btnCutHoleFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.btnCutHoleFile.UseVisualStyleBackColor = true;
+            this.btnCutHoleFile.Click += new System.EventHandler(this.btnCutHoleFile_Click);
+            // 
+            // pbClose
+            // 
+            this.pbClose.BackColor = System.Drawing.Color.Transparent;
+            this.pbClose.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
+            this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
+            this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.pbClose.Dock = System.Windows.Forms.DockStyle.Right;
+            this.pbClose.Location = new System.Drawing.Point(733, 0);
+            this.pbClose.Name = "pbClose";
+            this.pbClose.Size = new System.Drawing.Size(32, 31);
+            this.pbClose.TabIndex = 106;
+            this.pbClose.TabStop = false;
+            this.pbClose.Click += new System.EventHandler(this.btnClose_Click);
+            this.pbClose.MouseEnter += new System.EventHandler(this.pbClose_MouseEnter);
+            this.pbClose.MouseLeave += new System.EventHandler(this.pbClose_MouseLeave);
+            // 
             // UControl_Init
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
             this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.Controls.Add(this.label27);
-            this.Controls.Add(this.tbScanSpeedHigh);
-            this.Controls.Add(this.tbScanSpeedFocus);
-            this.Controls.Add(this.tbScanSpeedNormal);
-            this.Controls.Add(this.label24);
-            this.Controls.Add(this.label25);
-            this.Controls.Add(this.label26);
+            this.Controls.Add(this.btnEditConfig);
             this.Controls.Add(this.cbbEDSA);
             this.Controls.Add(this.cboXrayMode);
             this.Controls.Add(this.cbbEDSV);
@@ -1328,50 +874,19 @@
             this.Controls.Add(this.chkEDS);
             this.Controls.Add(this.btnHandSavePoints);
             this.Controls.Add(this.txtScanRotCur);
-            this.Controls.Add(this.tbContrast);
-            this.Controls.Add(this.chkGearSwitch);
-            this.Controls.Add(this.tbGear3to4);
-            this.Controls.Add(this.tbGear2to3);
-            this.Controls.Add(this.label8);
-            this.Controls.Add(this.tbGear1to2);
-            this.Controls.Add(this.label7);
-            this.Controls.Add(this.label9);
-            this.Controls.Add(this.label5);
-            this.Controls.Add(this.label10);
-            this.Controls.Add(this.label4);
-            this.Controls.Add(this.label12);
-            this.Controls.Add(this.label11);
-            this.Controls.Add(this.tbBrightness);
-            this.Controls.Add(this.label13);
-            this.Controls.Add(this.chkFIBAtuoAdjust);
-            this.Controls.Add(this.label14);
-            this.Controls.Add(this.chkFIBAdjust);
-            this.Controls.Add(this.label15);
             this.Controls.Add(this.panel2);
             this.Controls.Add(this.tbGear1to2_Xdeviation);
             this.Controls.Add(this.btnFIBTemplateFile);
-            this.Controls.Add(this.label16);
             this.Controls.Add(this.btnPTTemplateFile);
             this.Controls.Add(this.tbGear1to2_Ydeviation);
             this.Controls.Add(this.btnCutHoleAuto);
-            this.Controls.Add(this.tbGear2to3_Xdeviation);
             this.Controls.Add(this.btnCutHoleFile);
             this.Controls.Add(this.label17);
-            this.Controls.Add(this.tbGear2to3_Ydeviation);
-            this.Controls.Add(this.tbGear3to4_Xdeviation);
             this.Controls.Add(this.txtYPSCur);
-            this.Controls.Add(this.tbGear3to4_Ydeviation);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.chkWqxkc);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label50);
-            this.Controls.Add(this.pbDelWLZ);
-            this.Controls.Add(this.pbDelWQGD);
-            this.Controls.Add(this.pbWQGFDel);
-            this.Controls.Add(this.pbDelWPZD);
-            this.Controls.Add(this.pbDelWPZF);
-            this.Controls.Add(this.pbDelWYP);
-            this.Controls.Add(this.pbDelWCS);
             this.Controls.Add(this.txtWFIBF);
             this.Controls.Add(this.cbbWPZD);
             this.Controls.Add(this.cbbWPZF);
@@ -1388,6 +903,7 @@
             this.Controls.Add(this.label38);
             this.Controls.Add(this.chkWIsP);
             this.Controls.Add(this.label48);
+            this.Controls.Add(this.label4);
             this.Controls.Add(this.label56);
             this.Controls.Add(this.label59);
             this.Controls.Add(this.label61);
@@ -1401,19 +917,12 @@
             this.Font = new System.Drawing.Font("宋体", 10F);
             this.ForeColor = System.Drawing.SystemColors.WindowText;
             this.Name = "UControl_Init";
-            this.Size = new System.Drawing.Size(767, 493);
+            this.Size = new System.Drawing.Size(767, 490);
             this.Load += new System.EventHandler(this.UControl_Init_Load);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWLZ)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWQGD)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbWQGFDel)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWPZD)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWPZF)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWYP)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pbDelWCS)).EndInit();
             this.panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -1448,14 +957,7 @@
         private System.Windows.Forms.Label label61;
         private System.Windows.Forms.CheckBox chkWPT;
         private System.Windows.Forms.TextBox txtWFIBF;
-        private System.Windows.Forms.PictureBox pbDelWCS;
         private System.Windows.Forms.PictureBox pbClose;
-        private System.Windows.Forms.PictureBox pbDelWYP;
-        private System.Windows.Forms.PictureBox pbDelWPZD;
-        private System.Windows.Forms.PictureBox pbDelWPZF;
-        private System.Windows.Forms.PictureBox pbDelWQGD;
-        private System.Windows.Forms.PictureBox pbWQGFDel;
-        private System.Windows.Forms.PictureBox pbDelWLZ;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.CheckBox chkWqxkc;
         private System.Windows.Forms.Label label3;
@@ -1466,34 +968,10 @@
         private System.Windows.Forms.Button btnFIBTemplateFile;
         private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Button btnSaveDefalutPara;
-        private System.Windows.Forms.Button btnCreateConfig;
-        private System.Windows.Forms.CheckBox chkFIBAdjust;
-        private System.Windows.Forms.CheckBox chkFIBAtuoAdjust;
-        private System.Windows.Forms.TextBox tbBrightness;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.Label label7;
-        private System.Windows.Forms.Label label8;
-        private System.Windows.Forms.TextBox tbGear3to4;
-        private System.Windows.Forms.TextBox tbGear2to3;
-        private System.Windows.Forms.TextBox tbGear1to2;
-        private System.Windows.Forms.Label label9;
-        private System.Windows.Forms.Label label10;
-        private System.Windows.Forms.Label label12;
-        private System.Windows.Forms.Label label11;
-        private System.Windows.Forms.Label label13;
-        private System.Windows.Forms.Label label14;
-        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Button btnEditConfig;
         private System.Windows.Forms.TextBox tbGear1to2_Xdeviation;
-        private System.Windows.Forms.Label label16;
         private System.Windows.Forms.TextBox tbGear1to2_Ydeviation;
-        private System.Windows.Forms.TextBox tbGear2to3_Xdeviation;
         private System.Windows.Forms.Label label17;
-        private System.Windows.Forms.TextBox tbGear2to3_Ydeviation;
-        private System.Windows.Forms.TextBox tbGear3to4_Xdeviation;
-        private System.Windows.Forms.TextBox tbGear3to4_Ydeviation;
-        private System.Windows.Forms.CheckBox chkGearSwitch;
-        private System.Windows.Forms.TextBox tbContrast;
         private System.Windows.Forms.TextBox txtScanRotCur;
         private System.Windows.Forms.Button btnHandSavePoints;
         private System.Windows.Forms.CheckBox chkEDS;
@@ -1506,16 +984,10 @@
         private System.Windows.Forms.Label label23;
         private System.Windows.Forms.ComboBox cbbEDSV;
         private System.Windows.Forms.ComboBox cbbEDSA;
-        private System.Windows.Forms.TextBox tbScanSpeedNormal;
-        private System.Windows.Forms.Label label24;
-        private System.Windows.Forms.Label label25;
-        private System.Windows.Forms.Label label26;
-        private System.Windows.Forms.TextBox tbScanSpeedFocus;
-        private System.Windows.Forms.TextBox tbScanSpeedHigh;
-        private System.Windows.Forms.Label label27;
         private System.Windows.Forms.ComboBox cboXrayMode;
         private System.Windows.Forms.Label label28;
         private System.Windows.Forms.Label label29;
         private System.Windows.Forms.Label label30;
+        private System.Windows.Forms.Label label4;
     }
 }

+ 152 - 474
HOZProject/UserControls/UControl_Init.cs

@@ -12,6 +12,7 @@ using System.Configuration;
 using FileManager;
 using System.IO;
 using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 //20201029:注释
 //初始化窗口管理的是参数,包括,测量文件使用的参数,配置文件中的参数(默认参数),或者保存成参数文件。
@@ -83,30 +84,15 @@ namespace HOZProject
         private void UControl_Init_Load(object sender, EventArgs e)
         {
             //从配置文件中读取一系列的信息
-            //ReloadConfig();
-            if (!chkFIBAdjust.Checked)
-            {
-                chkFIBAtuoAdjust.Checked = false;
-                chkFIBAtuoAdjust.Visible = false;
-            }
-            if (chkFIBAtuoAdjust.Checked)
-            {
-                label4.Visible = false;
-                tbBrightness.Visible = false;
-                label7.Visible = false;
-                label5.Visible = false;
-                tbContrast.Visible = false;
-                label8.Visible = false;
-            }
-            else
+
+
+            cbbWYP.Items.Clear();
+            DirectoryInfo TheFolder = new DirectoryInfo(System.Environment.CurrentDirectory + "\\SampleTemplate");
+            foreach (FileInfo fi in TheFolder.GetFiles())//遍历文件夹下所有文件
             {
-                label4.Visible = true;
-                tbBrightness.Visible = true;
-                label7.Visible = true;
-                label5.Visible = true;
-                tbContrast.Visible = true;
-                label8.Visible = true;
+                cbbWYP.Items.Add(fi.Name);
             }
+
             SetTypel();
         } 
         #endregion
@@ -366,9 +352,12 @@ namespace HOZProject
         #endregion
 
         #region 创建与读取样品参数、配置文件
-        private void btnCreateConfig_Click(object sender, EventArgs e)
+        private void btnEditConfig_Click(object sender, EventArgs e)
         {
-            SaveTemplateFile();
+            DirectoryInfo TheFolder = new DirectoryInfo(System.Environment.CurrentDirectory + "\\SampleTemplate");
+            Process pro = Process.Start(@"C:\Windows\notepad.exe", TheFolder.ToString()+ "\\" + cbbWYP.Text);//打开程序B
+
+            
         }
         /// <summary>
         /// 获取测量参数,初始化窗体中的控件信息
@@ -377,59 +366,43 @@ namespace HOZProject
         public MeasureParam GetMeasureParamInfo()
         {
             //从当前界面内获取参数
-            MeasureParam cfm = new MeasureParam();
-            cfm.Is_Photograph = chkWIsP.Checked;//是否仅拍照
-            cfm.PT = chkWPT.Checked;//是否有PT
-            cfm.Tilt = chkWqxkc.Checked;//是否倾斜样品台
-            cfm.EDS = chkEDS.Checked;
-            cfm.EDSZ = Convert.ToSingle(txtEDSZ.Text)/1000;
-            cfm.EDSV = Convert.ToSingle(cbbEDSV.Text);
-            cfm.EDSA = Convert.ToSingle(cbbEDSA.Text)/1000000000;
-            cfm.EDSParam.XrayCollectMode = Convert.ToInt16(cboXrayMode.Text);
+            MeasureParam m_param = new MeasureParam();
+            m_param.Is_Photograph = chkWIsP.Checked;//是否仅拍照
+            m_param.PT = chkWPT.Checked;//是否有PT
+            m_param.Tilt = chkWqxkc.Checked;//是否倾斜样品台
+            m_param.EDS = chkEDS.Checked;
+            m_param.EDSZ = Convert.ToSingle(txtEDSZ.Text)/1000;
+            m_param.EDSV = Convert.ToSingle(cbbEDSV.Text);
+            m_param.EDSA = Convert.ToSingle(cbbEDSA.Text)/1000000000;
+            m_param.EDSParam.XrayCollectMode = Convert.ToInt16(cboXrayMode.Text);
             //自动对焦模式
             //cfm.FocusMode = chkManul.Checked;
-            cfm.PTTemp = txtWPTF.Text;//PT文件路径
-            cfm.FIBTemp = txtWFIBF.Text;//FIB文件路径
-            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);//拍照的电压
+            m_param.PTTemp = txtWPTF.Text;//PT文件路径
+            m_param.FIBTemp = txtWFIBF.Text;//FIB文件路径
+            m_param.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);//来自放大倍数
+            m_param.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);//定位的放大倍数
+            m_param.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);//定位的放大电压
+            m_param.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);//拍照的放大倍数
+            m_param.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);//拍照的电压
             //cfm.FIB_Magnification = Convert.ToSingle(cbbWFIB.Text);//FIB的放大倍数
 
-            //亮度对比度
-            cfm.FIBDo = chkFIBAdjust.Checked;
-            cfm.FIBAutoBC = chkFIBAtuoAdjust.Checked;
-            cfm.FIBB = Convert.ToSingle(tbBrightness.Text);
-            cfm.FIBC = Convert.ToSingle(tbContrast.Text);
-
-            //放大倍数挡位
-            cfm.MagComp = Convert.ToBoolean(chkGearSwitch.Checked);
-            cfm.MagRange1 = Convert.ToSingle(tbGear1to2.Text);
-            cfm.MagRange2 = Convert.ToSingle(tbGear2to3.Text);
-            cfm.MagRange3 = Convert.ToSingle(tbGear3to4.Text);
-            cfm.MagCompX1 = Convert.ToSingle(tbGear1to2_Xdeviation.Text);
-            cfm.MagCompX2 = Convert.ToSingle(tbGear2to3_Xdeviation.Text);
-            cfm.MagCompX3 = Convert.ToSingle(tbGear3to4_Xdeviation.Text);
-            cfm.MagCompY1 = Convert.ToSingle(tbGear1to2_Ydeviation.Text);
-            cfm.MagCompY2 = Convert.ToSingle(tbGear2to3_Ydeviation.Text);
-            cfm.MagCompY3 = Convert.ToSingle(tbGear3to4_Ydeviation.Text);
-
-            cfm.ScanRotCor = Convert.ToSingle(txtScanRotCur.Text);
-            cfm.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
+           
+
+            m_param.ScanRotCor = Convert.ToSingle(txtScanRotCur.Text);
+            m_param.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
 
             if (cbbWXZ.SelectedIndex == 0)//校正角度
             {
-                cfm.Correction_Angle = 36;
+                m_param.Correction_Angle = 36;
             }
             else
             {
-                cfm.Correction_Angle = 54;
+                m_param.Correction_Angle = 54;
             }
 
-            cfm.SampleName = cbbWYP.Text;//样品类型
-            cfm.Firm = cbbWCS.Text;//厂商类型
-            return cfm;
+            m_param.SampleName = cbbWYP.Text;//样品类型
+            m_param.Firm = cbbWCS.Text;//厂商类型
+            return m_param;
         }
 
         public void SaveTemplateFile()
@@ -467,29 +440,29 @@ namespace HOZProject
             //保存配置文件中的参数
             cfm.ZDistance = Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"].ToString());
 
-            cfm.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
-            cfm.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-            cfm.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-            cfm.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-            cfm.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
+            //cfm.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
+            //cfm.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
+            //cfm.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
+            //cfm.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
+            //cfm.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
 
-            cfm.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
-            cfm.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
-            cfm.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
-            cfm.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
-            cfm.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
+            //cfm.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
+            //cfm.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
+            //cfm.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
+            //cfm.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
+            //cfm.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
 
-            cfm.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
-            cfm.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
-            cfm.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
-            cfm.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
-            cfm.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
+            //cfm.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
+            //cfm.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
+            //cfm.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
+            //cfm.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
+            //cfm.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
 
-            cfm.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
-            cfm.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
-            cfm.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
-            cfm.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
-            cfm.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
+            //cfm.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
+            //cfm.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
+            //cfm.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
+            //cfm.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
+            //cfm.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
 
 
             ConfigFile cf = new ConfigFile(cfm);
@@ -613,101 +586,85 @@ namespace HOZProject
                 //    config.AppSettings.Settings["WFIB"].Value = wWFIB;
                 //}               
 
-                MeasureParam cfm = new MeasureParam();
-                cfm = FormHOZMainObject.m_MeasureFile.MParam;
-                cfm.Is_Photograph = chkWIsP.Checked;
+                MeasureParam m_Prm = new MeasureParam();
+                //m_Prm = FormHOZMainObject.m_MeasureFile.MParam;
+                m_Prm.Is_Photograph = chkWIsP.Checked;
 
-                cfm.FocusMode = Convert.ToInt32(config.AppSettings.Settings["Focus_Mode"].Value);
-                cfm.PT = chkWPT.Checked;
+                m_Prm.FocusMode = Convert.ToInt32(config.AppSettings.Settings["Focus_Mode"].Value);
+                m_Prm.PT = chkWPT.Checked;
                 //EDS
-                cfm.EDS = chkEDS.Checked;
+                m_Prm.EDS = chkEDS.Checked;
                 config.AppSettings.Settings["Is_EDS"].Value = chkEDS.Checked.ToString();
-                cfm.EDSZ = Convert.ToSingle(txtEDSZ.Text)/1000;
+                m_Prm.EDSZ = Convert.ToSingle(txtEDSZ.Text)/1000;
                 config.AppSettings.Settings["EDS_Z"].Value = txtEDSZ.Text;
-                cfm.EDSV = Convert.ToSingle(cbbEDSV.Text);
+                m_Prm.EDSV = Convert.ToSingle(cbbEDSV.Text);
                 config.AppSettings.Settings["EDS_V"].Value = cbbEDSV.Text;
-                cfm.EDSA = Convert.ToSingle(cbbEDSA.Text) / 1000000000;
+                m_Prm.EDSA = Convert.ToSingle(cbbEDSA.Text) / 1000000000;
                 config.AppSettings.Settings["EDS_A"].Value = cbbEDSA.Text;
-                cfm.EDSParam.XrayCollectMode = Convert.ToInt16(cboXrayMode.Text);
+                m_Prm.EDSParam.XrayCollectMode = Convert.ToInt16(cboXrayMode.Text);
                 config.AppSettings.Settings["EDS_XrayMode"].Value = cboXrayMode.Text;
                 //自动对焦模式
                 //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);
+                m_Prm.PTTemp = txtWPTF.Text;
+                m_Prm.FIBTemp = txtWFIBF.Text;
+                m_Prm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
+                m_Prm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
+                m_Prm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
+                m_Prm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
+                m_Prm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
                 //cfm.FIB_Magnification = Convert.ToSingle(cbbWFIB.Text);
 
-                //亮度对比度
-                cfm.FIBDo = chkFIBAdjust.Checked;
-                cfm.FIBAutoBC = chkFIBAtuoAdjust.Checked;
-                cfm.FIBB = Convert.ToSingle(tbBrightness.Text);
-                cfm.FIBC = Convert.ToSingle(tbContrast.Text);
-
-                //放大倍数挡位
-                cfm.MagComp = Convert.ToBoolean(chkGearSwitch.Checked);
-                cfm.MagRange1 = Convert.ToSingle(tbGear1to2.Text);
-                cfm.MagRange2 = Convert.ToSingle(tbGear2to3.Text);
-                cfm.MagRange3 = Convert.ToSingle(tbGear3to4.Text);
-                cfm.MagCompX1 = Convert.ToSingle(tbGear1to2_Xdeviation.Text);
-                cfm.MagCompX2 = Convert.ToSingle(tbGear2to3_Xdeviation.Text);
-                cfm.MagCompX3 = Convert.ToSingle(tbGear3to4_Xdeviation.Text);
-                cfm.MagCompY1 = Convert.ToSingle(tbGear1to2_Ydeviation.Text);
-                cfm.MagCompY2 = Convert.ToSingle(tbGear2to3_Ydeviation.Text);
-                cfm.MagCompY3 = Convert.ToSingle(tbGear3to4_Ydeviation.Text);
+               
 
                 //倾斜观测
-                cfm.Tilt = chkWqxkc.Checked;
+                m_Prm.Tilt = chkWqxkc.Checked;
                 //移动Z轴大小
-                cfm.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
+                m_Prm.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
 
                 if (cbbWXZ.SelectedIndex == 0)
                 {
-                    cfm.Correction_Angle = 36;
+                    m_Prm.Correction_Angle = 36;
                 }
                 else
                 {
-                    cfm.Correction_Angle = 54;
+                    m_Prm.Correction_Angle = 54;
                 }
 
-                cfm.SampleName = cbbWYP.Text;
-                cfm.Firm = cbbWCS.Text;
-
-                //设置配置文件默认值
-                config.AppSettings.Settings["Is_FIBDo"].Value = cfm.FIBDo.ToString();
-                config.AppSettings.Settings["Is_FIBAutoBc"].Value = cfm.FIBAutoBC.ToString();
-                config.AppSettings.Settings["FIBB"].Value = cfm.FIBB.ToString();
-                config.AppSettings.Settings["FIBC"].Value = cfm.FIBC.ToString();
-
-                config.AppSettings.Settings["MagComp"].Value = cfm.MagComp.ToString();
-                config.AppSettings.Settings["MagRange1"].Value = cfm.MagRange1.ToString();
-                config.AppSettings.Settings["MagRange2"].Value = cfm.MagRange2.ToString();
-                config.AppSettings.Settings["MagRange3"].Value = cfm.MagRange3.ToString();
-                config.AppSettings.Settings["MagCompX1"].Value = cfm.MagCompX1.ToString();
-                config.AppSettings.Settings["MagCompX2"].Value = cfm.MagCompX2.ToString();
-                config.AppSettings.Settings["MagCompX3"].Value = cfm.MagCompX3.ToString();
-                config.AppSettings.Settings["MagCompY1"].Value = cfm.MagCompY1.ToString();
-                config.AppSettings.Settings["MagCompY2"].Value = cfm.MagCompY2.ToString();
-                config.AppSettings.Settings["MagCompY3"].Value = cfm.MagCompY3.ToString();
-
-                config.AppSettings.Settings["Is_Photograph"].Value = cfm.Is_Photograph.ToString();
-                config.AppSettings.Settings["PT_Depostion"].Value = cfm.PT.ToString();
-                config.AppSettings.Settings["PT_ELYFile"].Value = cfm.PTTemp;
-                config.AppSettings.Settings["FIB_ELYFile"].Value = cfm.FIBTemp;
-                config.AppSettings.Settings["Stretch_Magnification"].Value = cfm.Stretch_Magnification.ToString();
-                config.AppSettings.Settings["Location_Magnification"].Value = cfm.Location_Magnification.ToString();
-                config.AppSettings.Settings["Location_Voltage"].Value = cfm.Location_Voltage.ToString();
-                config.AppSettings.Settings["Photograph_Magnification"].Value = cfm.Photograph_Magnification.ToString();
-                config.AppSettings.Settings["Photograph_Voltage"].Value = cfm.Photograph_Voltage.ToString();
-                config.AppSettings.Settings["Correction_Angle"].Value = cfm.Correction_Angle.ToString();
-                config.AppSettings.Settings["SampleName"].Value = cfm.SampleName;
-                config.AppSettings.Settings["Firms"].Value = cfm.Firm;
-                config.AppSettings.Settings["FIB_Magnification"].Value = cfm.FIB_Magnification.ToString();
-                config.AppSettings.Settings["Is_Title"].Value = cfm.Tilt.ToString();
-                config.AppSettings.Settings["ZDistance"].Value = cfm.ZDistance.ToString();
+                m_Prm.SampleName = cbbWYP.Text;
+                m_Prm.Firm = cbbWCS.Text;
+
+                ////设置配置文件默认值
+                //config.AppSettings.Settings["Is_FIBDo"].Value = m_Prm.FIBDo.ToString();
+                //config.AppSettings.Settings["Is_FIBAutoBc"].Value = m_Prm.FIBAutoBC.ToString();
+                //config.AppSettings.Settings["FIBB"].Value = m_Prm.FIBB.ToString();
+                //config.AppSettings.Settings["FIBC"].Value = m_Prm.FIBC.ToString();
+
+                //config.AppSettings.Settings["MagComp"].Value = m_Prm.MagComp.ToString();
+                //config.AppSettings.Settings["MagRange1"].Value = m_Prm.MagRange1.ToString();
+                //config.AppSettings.Settings["MagRange2"].Value = m_Prm.MagRange2.ToString();
+                //config.AppSettings.Settings["MagRange3"].Value = m_Prm.MagRange3.ToString();
+                //config.AppSettings.Settings["MagCompX1"].Value = m_Prm.MagCompX1.ToString();
+                //config.AppSettings.Settings["MagCompX2"].Value = m_Prm.MagCompX2.ToString();
+                //config.AppSettings.Settings["MagCompX3"].Value = m_Prm.MagCompX3.ToString();
+                //config.AppSettings.Settings["MagCompY1"].Value = m_Prm.MagCompY1.ToString();
+                //config.AppSettings.Settings["MagCompY2"].Value = m_Prm.MagCompY2.ToString();
+                //config.AppSettings.Settings["MagCompY3"].Value = m_Prm.MagCompY3.ToString();
+
+                config.AppSettings.Settings["Is_Photograph"].Value = m_Prm.Is_Photograph.ToString();
+                config.AppSettings.Settings["PT_Depostion"].Value = m_Prm.PT.ToString();
+                config.AppSettings.Settings["PT_ELYFile"].Value = m_Prm.PTTemp;
+                config.AppSettings.Settings["FIB_ELYFile"].Value = m_Prm.FIBTemp;
+                config.AppSettings.Settings["Stretch_Magnification"].Value = m_Prm.Stretch_Magnification.ToString();
+                config.AppSettings.Settings["Location_Magnification"].Value = m_Prm.Location_Magnification.ToString();
+                config.AppSettings.Settings["Location_Voltage"].Value = m_Prm.Location_Voltage.ToString();
+                config.AppSettings.Settings["Photograph_Magnification"].Value = m_Prm.Photograph_Magnification.ToString();
+                config.AppSettings.Settings["Photograph_Voltage"].Value = m_Prm.Photograph_Voltage.ToString();
+                config.AppSettings.Settings["Correction_Angle"].Value = m_Prm.Correction_Angle.ToString();
+                config.AppSettings.Settings["SampleName"].Value = m_Prm.SampleName;
+                config.AppSettings.Settings["Firms"].Value = m_Prm.Firm;
+                config.AppSettings.Settings["FIB_Magnification"].Value = m_Prm.FIB_Magnification.ToString();
+                config.AppSettings.Settings["Is_Title"].Value = m_Prm.Tilt.ToString();
+                config.AppSettings.Settings["ZDistance"].Value = m_Prm.ZDistance.ToString();
                 config.Save(ConfigurationSaveMode.Modified);
                 ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
                 return true;
@@ -719,80 +676,7 @@ namespace HOZProject
             }
         }
 
-        /// <summary>
-        /// 删除config文件节点中内容信息
-        /// </summary>
-        public bool DelConfigNodeContentInfo(string delControlName, string selName)
-        {
-            try
-            {
-                switch (delControlName)
-                {
-                    case "WYP":
-                        //样品类型
-                        List<String> _sT = sT.ToList();
-                        _sT.Remove(selName);
-                        string wsT = string.Join(",", _sT.ToArray());
-                        config.AppSettings.Settings["Sample_Type"].Value = wsT;
-                        break;
-                    case "WCS":
-                        //厂商
-                        List<String> _firms = firms.ToList();
-                        _firms.Remove(selName);
-                        string wFirms = string.Join(",", _firms.ToArray());
-                        config.AppSettings.Settings["Firm"].Value = wFirms;
-                        break;
-                    case "WPZD":
-                        //拍照电压
-                        List<String> _WPZD = WPZD.ToList();
-                        _WPZD.Remove(selName);
-                        string wWPZD = string.Join(",", _WPZD.ToArray());
-                        config.AppSettings.Settings["WPZD"].Value = wWPZD;
-                        break;
-                    case "WPZF":
-                        //拍照放大位数
-                        List<String> _WPZF = WPZF.ToList();
-                        _WPZF.Remove(selName);
-                        string wWPZF = string.Join(",", _WPZF.ToArray());
-                        config.AppSettings.Settings["WPZF"].Value = wWPZF;
-                        break;
-                    case "WQGD"://定位切割电压
-                        List<String> _WQGD = WQGD.ToList();
-                        _WQGD.Remove(selName);
-                        string wWQGD = string.Join(",", _WQGD.ToArray());
-                        config.AppSettings.Settings["WQGD"].Value = wWQGD;
-                        break;
-                    case "WQGF": //定位切割放大位数
-                        List<String> _WQGF = WQGF.ToList();
-                        _WQGF.Remove(selName);
-                        string wWQGF = string.Join(",", _WQGF.ToArray());
-                        config.AppSettings.Settings["WQGF"].Value = wWQGF;
-                        break;
-                    case "WLZ":
-                        //拉直操作放大位数
-                        List<String> _WLZ = WLZ.ToList();
-                        _WLZ.Remove(selName);
-                        string wWLZ = string.Join(",", _WLZ.ToArray());
-                        config.AppSettings.Settings["WLZ"].Value = wWLZ;
-                        break;
-                    case "WFIB":
-                        //FIB放大倍数
-                        List<String> _WFIB = WFIB.ToList();
-                        _WFIB.Remove(selName);
-                        string wWFIB = string.Join(",", _WFIB.ToArray());
-                        config.AppSettings.Settings["WFIB"].Value = wWFIB;
-                        break;
-                }
-                config.Save(ConfigurationSaveMode.Modified);
-                ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
-                return true;
-            }
-            catch (Exception ex)
-            {
-                LogManager.LogError(ex.Message);
-                return true;
-            }
-        }
+      
 
         /// <summary>
         /// 绑定下拉菜单
@@ -862,23 +746,7 @@ namespace HOZProject
             //BindComboxData(cbbWFIB, WFIB);
             txtScanRotCur.Text = ScanRotCur;
 
-            //FIB亮度对比度调节
-            chkFIBAdjust.Checked = Convert.ToBoolean(config.AppSettings.Settings["Is_FIBDo"].Value);
-            //FIB亮度对比度自动调节
-            chkFIBAtuoAdjust.Checked = Convert.ToBoolean(config.AppSettings.Settings["Is_FIBAutoBc"].Value);
-            tbBrightness.Text = config.AppSettings.Settings["FIBB"].Value;
-            tbContrast.Text = config.AppSettings.Settings["FIBC"].Value;
-            //放大倍数挡位切换
-            chkGearSwitch.Checked = Convert.ToBoolean(config.AppSettings.Settings["MagComp"].Value);
-            tbGear1to2.Text = config.AppSettings.Settings["MagRange1"].Value;
-            tbGear2to3.Text = config.AppSettings.Settings["MagRange2"].Value;
-            tbGear3to4.Text = config.AppSettings.Settings["MagRange3"].Value;
-            tbGear1to2_Xdeviation.Text= config.AppSettings.Settings["MagCompX1"].Value;
-            tbGear2to3_Xdeviation.Text= config.AppSettings.Settings["MagCompX2"].Value;
-            tbGear3to4_Xdeviation.Text= config.AppSettings.Settings["MagCompX3"].Value;
-            tbGear1to2_Ydeviation.Text= config.AppSettings.Settings["MagCompY1"].Value;
-            tbGear2to3_Ydeviation.Text= config.AppSettings.Settings["MagCompY2"].Value;
-            tbGear3to4_Ydeviation.Text= config.AppSettings.Settings["MagCompY3"].Value;
+           
 
             //设置配置文件默认值
             chkWIsP.Checked=Convert.ToBoolean(config.AppSettings.Settings["Is_Photograph"].Value);
@@ -898,16 +766,7 @@ namespace HOZProject
             cbbWPZD.Text = config.AppSettings.Settings["Photograph_Voltage"].Value;
             //cbbWFIB.Text = config.AppSettings.Settings["FIB_Magnification"].Value;
             string Correction_Angle = config.AppSettings.Settings["Correction_Angle"].Value;
-            //if (Convert.ToBoolean(config.AppSettings.Settings["Is_Title"].Value))
-            //{
-            //    cbbYDZZDX.Visible = true;
-            //    label3.Visible = true;
-            //}
-            //else
-            //{
-            //    cbbYDZZDX.Visible = false;
-            //    label3.Visible = false;
-            //}
+    
             if (Correction_Angle == "36")
             {
                 cbbWXZ.SelectedIndex = 0;
@@ -997,39 +856,8 @@ namespace HOZProject
 
         #region 删除下拉菜单选择项
 
-        private void DelComboBoxItem_Click(object sender, EventArgs e)
-        {
-            if (MessageBox.Show("是否删除所选项信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
-            {
-                PictureBox pbDel = (PictureBox)sender;
-                string ctrlName = pbDel.Name.Substring(5, pbDel.Name.Length - 5);
-                if (DelComboBoxItem(ctrlName))
-                {
-                    //重新加载
-                    ReloadConfig(); 
-                }
-            }
-        }
+       
 
-        /// <summary>
-        /// 删除下拉菜单选择项
-        /// </summary>
-        public bool DelComboBoxItem(string controlName)
-        {
-            string delName = controlName;
-            foreach (Control item in this.Controls)
-            {
-                if (item is ComboBox)
-                {
-                    if (item.Name.Contains(delName))
-                    {
-                        ComboBox cb = (ComboBox)item;
-                        return DelConfigNodeContentInfo(delName, cb.Text);
-                    }
-                }
-            }
-            return false;
-        }
         #endregion
 
         #region 根据是否仅拍照,进行逻辑判断
@@ -1125,29 +953,29 @@ namespace HOZProject
 
             cfm.Firm = config.AppSettings.Settings["Firms"].Value;
 
-            cfm.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
-            cfm.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-            cfm.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-            cfm.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-            cfm.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
-
-            cfm.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
-            cfm.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
-            cfm.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
-            cfm.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
-            cfm.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
-
-            cfm.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
-            cfm.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
-            cfm.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
-            cfm.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
-            cfm.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
-
-            cfm.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
-            cfm.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
-            cfm.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
-            cfm.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
-            cfm.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
+            //cfm.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
+            //cfm.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
+            //cfm.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
+            //cfm.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
+            //cfm.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
+
+            //cfm.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
+            //cfm.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
+            //cfm.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
+            //cfm.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
+            //cfm.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
+
+            //cfm.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
+            //cfm.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
+            //cfm.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
+            //cfm.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
+            //cfm.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
+
+            //cfm.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
+            //cfm.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
+            //cfm.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
+            //cfm.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
+            //cfm.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
 
             bool.TryParse(config.AppSettings.Settings["Is_Title"].Value, out bResult);
             cfm.Tilt = bResult;
@@ -1161,7 +989,7 @@ namespace HOZProject
             //cfm.ScanSpeedNormal = ConfigurationManager.AppSettings["ScanSpeedNormal_"+cfm.SampleName].ToString();
             //cfm.ScanSpeedFocus = ConfigurationManager.AppSettings["ScanSpeedFocus_" + cfm.SampleName].ToString();
             //cfm.ScanSpeedHigh = ConfigurationManager.AppSettings["ScanSpeedHigh_" + cfm.SampleName].ToString();
-            LogManager.AddHardwareLog("==========参数测试==" + cfm.SampleName+"======="+ config.AppSettings.Settings["ScanSpeedNormal_0"].Value, true);
+            //LogManager.AddHardwareLog("==========参数测试==" + cfm.SampleName+"======="+ config.AppSettings.Settings["ScanSpeedNormal_0"].Value, true);
             //add by sun 2020-12-15 增加不同样品扫描速度参数,每大类样品3种扫描速度 end
             return cfm;
         }
@@ -1359,29 +1187,7 @@ namespace HOZProject
             //配置文件中的参数
             FormHOZMainObject.m_MeasureFile.MParam.ZDistance = Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"].ToString());
 
-            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
-
-            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
-
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
-
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
+
 
             FormHOZMainObject.m_MeasureFile.IsModified = true;
 
@@ -1407,139 +1213,11 @@ namespace HOZProject
 
         #endregion
 
-        private void chkFIBAdjust_CheckedChanged(object sender, EventArgs e)
-        {
-            if (!chkFIBAdjust.Checked)
-            {
-                chkFIBAtuoAdjust.Checked = false;
-                chkFIBAtuoAdjust.Visible = false;
-            }
-            else
-            {
-                chkFIBAtuoAdjust.Visible = true;
-            }
-            if (chkFIBAtuoAdjust.Checked)
-            {
-                label4.Visible = false;
-                tbBrightness.Visible = false;
-                label7.Visible = false;
-                label5.Visible = false;
-                tbContrast.Visible = false;
-                label8.Visible = false;
-            }
-            else
-            {
-                label4.Visible = true;
-                tbBrightness.Visible = true;
-                label7.Visible = true;
-                label5.Visible = true;
-                tbContrast.Visible = true;
-                label8.Visible = true;
-            }
-        }
+       
 
-        private void chkFIBAtuoAdjust_CheckedChanged(object sender, EventArgs e)
-        {
-            if (chkFIBAtuoAdjust.Checked)
-            {
-                label4.Visible = false;
-                tbBrightness.Visible = false;
-                label7.Visible = false;
-                label5.Visible = false;
-                tbContrast.Visible = false;
-                label8.Visible = false;
-            }
-            else
-            {
-                label4.Visible = true;
-                tbBrightness.Visible = true;
-                label7.Visible = true;
-                label5.Visible = true;
-                tbContrast.Visible = true;
-                label8.Visible = true;
-            }
-        }
 
-        private void tbBrightness_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbBrightness.Text, sender, e);
-        }
-
-        private void tbContrast_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbContrast.Text, sender, e);
-        }
-
-        private void tbGear1to2_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear1to2.Text, sender, e);
-        }
-
-        private void tbGear2to3_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear2to3.Text, sender, e);
-        }
-
-        private void tbGear3to4_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear3to4.Text, sender, e);
-        }
-
-        private void tbGear1to2_Xdeviation_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear1to2.Text, sender, e);
-        }
+       
 
-        private void tbGear2to3_Xdeviation_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear2to3.Text, sender, e);
-        }
-
-        private void tbGear3to4_Xdeviation_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear3to4.Text, sender, e);
-        }
-
-        private void tbGear1to2_Ydeviation_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear1to2.Text, sender, e);
-        }
-
-        private void tbGear2to3_Ydeviation_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear2to3.Text, sender, e);
-        }
-
-        private void tbGear3to4_Ydeviation_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            textBox_KeyPress(tbGear3to4.Text, sender, e);
-        }
-
-        private void tbContrast_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
-        {
-            
-        }
-
-        private void tbContrast_KeyPress_1(object sender, KeyPressEventArgs e)
-        {
-            
-        }
-
-        private void tbContrast_TextChanged(object sender, EventArgs e)
-        {
-            if(Convert.ToInt32(tbContrast.Text)>100|| Convert.ToInt32(tbContrast.Text)<0)
-            {
-                tbContrast.Text="0";
-            }
-        }
-
-        private void tbBrightness_TextChanged(object sender, EventArgs e)
-        {
-            if (Convert.ToInt32(tbBrightness.Text) > 100 || Convert.ToInt32(tbBrightness.Text) < 0)
-            {
-                tbBrightness.Text = "0";
-            }
-        }
 
         private void btnHandSavePoints_Click(object sender, EventArgs e)
         {
@@ -1576,7 +1254,7 @@ namespace HOZProject
                 cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType0;//拍照放大倍数
                 cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType0;//能谱电压值
                 cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType0;//能谱电流值
-                label27.Text = "0-AA Hole";
+                label4.Text = "0-AA Hole";
             }
             else
                         if (cbbWYP.Text == "1")
@@ -1589,7 +1267,7 @@ namespace HOZProject
                 cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType1;//拍照放大倍数
                 cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType1;//能谱电压值
                 cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType1;//能谱电流值
-                label27.Text = "1-AA区";
+                label4.Text = "1-AA区";
             }
             else
                         if (cbbWYP.Text == "2")
@@ -1602,7 +1280,7 @@ namespace HOZProject
                 cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType2;//拍照放大倍数
                 cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType2;//能谱电压值
                 cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType2;//能谱电流值
-                label27.Text = "2-Pad bending";
+                label4.Text = "2-Pad bending";
             }
             else
                         if (cbbWYP.Text == "3")
@@ -1615,7 +1293,7 @@ namespace HOZProject
                 cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType3;//拍照放大倍数
                 cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType3;//能谱电压值
                 cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType3;//能谱电流值
-                label27.Text = "3-DDIC";
+                label4.Text = "3-DDIC";
             }
             else
                         if (cbbWYP.Text == "4")
@@ -1628,7 +1306,7 @@ namespace HOZProject
                 cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType4;//拍照放大倍数
                 cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType4;//能谱电压值
                 cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType4;//能谱电流值
-                label27.Text = "4-射频IC-1";
+                label4.Text = "4-射频IC-1";
             }
             else
                         if (cbbWYP.Text == "5")
@@ -1641,7 +1319,7 @@ namespace HOZProject
                 cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType5;//拍照放大倍数
                 cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType5;//能谱电压值
                 cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType5;//能谱电流值
-                label27.Text = "5-射频IC-1";
+                label4.Text = "5-射频IC-1";
             }
         }
     }

+ 128 - 285
MeasureData/MeasureParam.cs

@@ -139,7 +139,7 @@ namespace MeasureData
             get { return this.location_Voltage; }
             set { this.location_Voltage = value; }
         }
-
+        public float sampleIprobe;
         //拍照的放大倍数
         private float photograph_Magnification;
         public float Photograph_Magnification
@@ -165,13 +165,18 @@ namespace MeasureData
         }
 
         //校正角度选择
-        private float correction_Angle;
-        public float Correction_Angle
+        private float correction_Angle_Inside;
+        public float Correction_Angle_Inside
         {
-            get { return this.correction_Angle; }
-            set { this.correction_Angle = value; }
+            get { return this.correction_Angle_Inside; }
+            set { this.correction_Angle_Inside = value; }
+        }
+        private float correction_Angle_OutSide;
+        public float Correction_Angle_OutSide
+        {
+            get { return this.correction_Angle_OutSide; }
+            set { this.correction_Angle_OutSide = value; }
         }
-
         //厂商
         private String firm;
         public String Firm
@@ -180,37 +185,10 @@ namespace MeasureData
             set { this.firm = value; }
         }
 
-        //对焦参数, SEM
-        private FocusParamold focusP;
-        public FocusParamold AutoFocus
-        {
-            get { return this.focusP; }
-            set { this.focusP = value; }
-        }
+      
+      
 
-        //对焦参数, FIB
-        private FocusParamold focusF;
-        public FocusParamold FIBFocus
-        {
-            get { return this.focusF; }
-            set { this.focusF = value; }
-        }
-
-        //消像散x参数
-        private FocusParamold StigX;
-        public FocusParamold AutoStigX
-        {
-            get { return this.StigX; }
-            set { this.StigX = value; }
-        }
-
-        //消像散Y参数
-        private FocusParamold StigY;
-        public FocusParamold AutoStigY
-        {
-            get { return this.StigY; }
-            set { this.StigY = value; }
-        }
+      
 
         //EDS参数
         private EDSParam EdsParam;
@@ -220,149 +198,9 @@ namespace MeasureData
             set { this.EdsParam = value; }
         }
 
-        #region 放大倍数档位切换功能
-        //档位阈值4个,4个偏差补偿值
-        private bool bMagComp;
-        public bool MagComp
-        {
-            get { return this.bMagComp; }
-            set { this.bMagComp = value; }
-        }
-
-        private float fMagRange1;
-        public float MagRange1
-        {
-            get { return this.fMagRange1; }
-            set
-            {
-                if (value < this.fMagRange2)
-                    this.fMagRange1 = value;
-            }
-        }
-
-        private float fMagCompX1;
-        public float MagCompX1
-        {
-            get { return this.fMagCompX1; }
-            set { this.fMagCompX1 = value; }
-        }
-
-        private float fMagCompY1;
-        public float MagCompY1
-        {
-            get { return this.fMagCompY1; }
-            set { this.fMagCompY1 = value; }
-        }
-
-        private float fMagRange2;
-        public float MagRange2
-        {
-            get { return this.fMagRange2; }
-            set
-            {
-                if ((value > this.fMagRange1) && (value < this.fMagRange3))
-                    this.fMagRange2 = value;
-            }
-        }
-
-        private float fMagCompX2;
-        public float MagCompX2
-        {
-            get { return this.fMagCompX2; }
-            set { this.fMagCompX2 = value; }
-        }
-
-        private float fMagCompY2;
-        public float MagCompY2
-        {
-            get { return this.fMagCompY2; }
-            set { this.fMagCompY2 = value; }
-        }
-
-        private float fMagRange3;
-        public float MagRange3
-        {
-            get { return this.fMagRange3; }
-            set
-            {
-                if ((value > this.fMagRange2) && (value < this.fMagRange4))
-                    this.fMagRange3 = value;
-            }
-        }
+       
 
-        private float fMagCompX3;
-        public float MagCompX3
-        {
-            get { return this.fMagCompX3; }
-            set { this.fMagCompX3 = value; }
-        }
-
-        private float fMagCompY3;
-        public float MagCompY3
-        {
-            get { return this.fMagCompY3; }
-            set { this.fMagCompY3 = value; }
-        }
-
-        private float fMagRange4;
-        public float MagRange4
-        {
-            get { return this.fMagRange4; }
-            set
-            {
-                if (value > this.fMagRange3)
-                    this.fMagRange4 = value;
-            }
-        }
-
-        private float fMagCompX4;
-        public float MagCompX4
-        {
-            get { return this.fMagCompX4; }
-            set { this.fMagCompX4 = value; }
-        }
-
-        private float fMagCompY4;
-        public float MagCompY4
-        {
-            get { return this.fMagCompY4; }
-            set { this.fMagCompY4 = value; }
-        }
-        #endregion
-
-        #region FIB自动亮度对比度调整
-        //是否调节FIB
-        private bool IsFIBDo;
-        public bool FIBDo
-        {
-            get { return this.IsFIBDo; }
-            set { this.IsFIBDo = value; }
-        }
-
-        //是否开启亮度对比度自动调节
-        private bool IsFIBAutoBC;
-        public bool FIBAutoBC
-        {
-            get { return this.IsFIBAutoBC; }
-            set { this.IsFIBAutoBC = value; }
-        }
-        //关闭亮度对比度时,亮度和对比度的设置值
-        private float FIBBright;
-        public float FIBB
-        {
-            get { return this.FIBBright; }
-            set { this.FIBBright = value; }
-        }
-
-        private float FIBContrast;
-        public float FIBC
-        {
-            get { return this.FIBContrast; }
-            set { this.FIBContrast = value; }
-        }
-
-        //是否开启在其他位置调节亮度对比度功能,再挪回原来位置
-        #endregion
+      
 
         //ScanRotation修正角度
         private float scanRotCor;
@@ -928,7 +766,108 @@ namespace MeasureData
         {
             Init();
         }
+        public loadParamFromSampleTypeFile(string filename)
+        {
+            DirectoryInfo TheFolder = new DirectoryInfo(System.Environment.CurrentDirectory + "\\SampleTemplate");
+            XmlDocument doc = new XmlDocument();
+            doc.Load(TheFolder+"\\"+filename);//载入xml文件
+
+            XmlNode root = doc.SelectSingleNode("XMLData");
+            xString firm = new xString();
+            
+            Slo sFile = new Slo();
+            sFile.Register("DefaultFirmName", firm);
+            Slo locateP = new Slo();
+            xBool torun = new xBool();
+            xInt locMag = new xInt();
+            
+            locateP.Register("Magnification", locMag);
+            sFile.Register("Locate", locateP);
+
+            Slo votandI = new Slo();
+            xBool torun2 = new xBool();
+            xInt vot = new xInt();
+            xDouble i = new xDouble();
+            votandI.Register("ToRun", torun2);
+            votandI.Register("Votage", locMag);
+            votandI.Register("Iprobe", i);
+            sFile.Register("VotageAndIprobe", votandI);
+
+            Slo tCorrect = new Slo();
+            xInt Ot = new xInt();
+            xInt Int = new xInt();
+            votandI.Register("Outside", Ot);
+            votandI.Register("Inside", Int);
+            sFile.Register("TiltCorrect", tCorrect);
+
+            Slo straighten = new Slo();
+            xInt Straightenmag = new xInt();
+            straighten.Register("Magnification", Straightenmag);
+            sFile.Register("Straighten", straighten);
+            Slo bc1 = new Slo();
+            xInt b1 = new xInt();
+            xInt c1 = new xInt();
+            xBool auto1 = new xBool();
+            bc1.Register("HandBright", b1);
+            bc1.Register("HandContrast", c1);
+            bc1.Register("AutoGet", auto1);
+            straighten.Register("BrightnessConstrast", bc1);
+
+
+            Slo fibwork = new Slo();
+            xBool doptwork = new xBool();
+            fibwork.Register("DoPTWork", doptwork);
+            sFile.Register("FIBWork", fibwork);
+
+            Slo findcross = new Slo();
+            xInt crossmag = new xInt();
+            findcross.Register("Magnification", crossmag);
+            sFile.Register("FindCross", findcross);
+
+
+            Slo shotsection = new Slo();
+            xInt shotmag = new xInt();
+            straighten.Register("Magnification", shotmag);
+            sFile.Register("shotsection", straighten);
+            Slo bc2 = new Slo();
+            xInt b2 = new xInt();
+            xInt c2 = new xInt();
+            xBool auto2 = new xBool();
+            bc2.Register("HandBright", b2);
+            bc2.Register("HandContrast", c2);
+            bc2.Register("AutoGet", auto2);
+            straighten.Register("BrightnessConstrast", bc2);
+
+
 
+
+            //是否拍照和PT
+            xBool isPhotograph = new xBool();
+            xBool ptDepostion = new xBool();
+            xBool isTilt = new xBool();
+            xBool isEDS = new xBool();
+            isTilt.AssignValue(this.Tilt);
+            isEDS.AssignValue(this.EDS);
+            isPhotograph.AssignValue(this.is_Photograph);
+            ptDepostion.AssignValue(this.m_pt);
+            sFile.Register("Is_Title", isTilt);
+            sFile.Register("Is_Photograph", isPhotograph);
+            sFile.Register("PT_Depostion", ptDepostion);
+            sFile.Register("Is_EDS", isEDS);
+
+
+       
+            Serialize(false, doc, root);
+
+            this.Location_Magnification = locMag.value();
+            this.location_Voltage = vot.value();
+            this.sampleIprobe = (float)i.value();
+            this.correction_Angle
+
+            //doc.Save(this.FileName);
+
+
+        }
         public void Init()
         {
             this.SampleName = @"";
@@ -936,14 +875,7 @@ namespace MeasureData
             this.FIBTemp = @"";
             this.PTTemp = @"";
             this.FocusMode = 2;
-            this.AutoFocus = new FocusParamold();
-            this.AutoFocus.TYPE = 1;
-            this.AutoStigX = new FocusParamold();
-            this.AutoStigX.TYPE = 2;
-            this.AutoStigY = new FocusParamold();
-            this.AutoStigY.TYPE = 3;
-            this.FIBFocus = new FocusParamold();
-            this.FIBFocus.TYPE = 4;
+           
             this.Tilt = false;
             this.ZDistance = 0;
             this.EDS = false;
@@ -951,25 +883,7 @@ namespace MeasureData
             this.EDSV = 10000;
             this.EDSA = 0.0000000005f;
             this.EDSParam = new EDSParam();
-            //FIB自动亮度对比度
-            this.FIBDo = false;
-            this.FIBAutoBC = false;
-            this.FIBB = 51;
-            this.FIBC = 33;
-            //档位阈值4个,4个偏差补偿值
-            this.MagComp = false;
-            this.MagRange1 = 300;
-            this.MagCompX1 = 0;
-            this.MagCompY1 = 0;
-            this.MagRange2 = 700;
-            this.MagCompX2 = 0;
-            this.MagCompY2 = 0;
-            this.MagRange3 = 2000;
-            this.MagCompX3 = 0;
-            this.MagCompY3 = 0;
-            this.MagRange4 = 6000;
-            this.fMagCompX4 = 0;
-            this.fMagCompY4 = 0;
+            
             this.ScanRotCor = 1;
             this.PixelSizeCor = 1;
             //add by sun 2020-12-15 增加不同样品扫描速度参数
@@ -1058,70 +972,16 @@ namespace MeasureData
             sFile.Register("Sample_Type", sampleType);
             sFile.Register("Firm", _firm);
 
-            //对焦参数
-            sFile.Register("Focus_Param", this.focusP);
-            sFile.Register("FIBFocus_Param", this.FIBFocus);
-            sFile.Register("StigX_Param", this.AutoStigX);
-            sFile.Register("StigY_Param", this.AutoStigY);
+        
             sFile.Register("EDS_Param", this.EDSParam);
 
-            //FIB亮度对比
-            xBool isFIBDo = new xBool();
-            xBool isFIBAutoBC = new xBool();
-            xDouble xFIBB = new xDouble();
-            xDouble xFIBC = new xDouble();
-
-            xBool isMagComp = new xBool();
-            xDouble xMagRange1 = new xDouble();
-            xDouble xMagCompX1 = new xDouble();
-            xDouble xMagCompY1 = new xDouble();
-            xDouble xMagRange2 = new xDouble();
-            xDouble xMagCompX2 = new xDouble();
-            xDouble xMagCompY2 = new xDouble();
-            xDouble xMagRange3 = new xDouble();
-            xDouble xMagCompX3 = new xDouble();
-            xDouble xMagCompY3 = new xDouble();
-            xDouble xMagRange4 = new xDouble();
-            xDouble xMagCompX4 = new xDouble();
-            xDouble xMagCompY4 = new xDouble();
-
-            isFIBDo.AssignValue(this.FIBDo);
-            isFIBAutoBC.AssignValue(this.FIBAutoBC);
-            xFIBB.AssignValue(this.FIBB);
-            xFIBC.AssignValue(this.FIBC);
-
-            isMagComp.AssignValue(this.MagComp);
-            xMagRange1.AssignValue(this.MagRange1);
-            xMagCompX1.AssignValue(this.MagCompX1);
-            xMagCompY1.AssignValue(this.MagCompY1);
-            xMagRange2.AssignValue(this.MagRange2);
-            xMagCompX2.AssignValue(this.MagCompX2);
-            xMagCompY2.AssignValue(this.MagCompY2);
-            xMagRange3.AssignValue(this.MagRange3);
-            xMagCompX3.AssignValue(this.MagCompX3);
-            xMagCompY3.AssignValue(this.MagCompY3);
-            xMagRange4.AssignValue(this.MagRange4);
-            xMagCompX4.AssignValue(this.MagCompX4);
-            xMagCompY4.AssignValue(this.MagCompY4);
-
-            sFile.Register("Is_FIBDo", isFIBDo);
-            sFile.Register("Is_FIBAutoBC", isFIBAutoBC);
-            sFile.Register("FIB_B", xFIBB);
-            sFile.Register("FIB_C", xFIBC);
-
-            sFile.Register("Mag_Comp", isMagComp);
-            sFile.Register("Mag_Range1", xMagRange1);
-            sFile.Register("Mag_CompX1", xMagCompX1);
-            sFile.Register("Mag_CompY1", xMagCompY1);
-            sFile.Register("Mag_Range2", xMagRange2);
-            sFile.Register("Mag_CompX2", xMagCompX2);
-            sFile.Register("Mag_CompY2", xMagCompY2);
-            sFile.Register("Mag_Range3", xMagRange3);
-            sFile.Register("Mag_CompX3", xMagCompX3);
-            sFile.Register("Mag_CompY3", xMagCompY3);
-            sFile.Register("Mag_Range4", xMagRange4);
-            sFile.Register("Mag_CompX4", xMagCompX4);
-            sFile.Register("Mag_CompY4", xMagCompY4);
+          
+          
+
+            
+
+
+         
 
 
             //ScanRotate修正
@@ -1167,24 +1027,7 @@ namespace MeasureData
                 this.EDSV = Convert.ToSingle(xEDSV.value());
                 this.EDSA = Convert.ToSingle(xEDSA.value());
 
-                this.IsFIBDo = isFIBDo.value();
-                this.IsFIBAutoBC = isFIBAutoBC.value();
-                this.FIBB = Convert.ToSingle(xFIBB.value());
-                this.FIBC = Convert.ToSingle(xFIBC.value());
-
-                this.MagComp = isMagComp.value();
-                this.MagRange1 = Convert.ToSingle(xMagRange1.value());
-                this.MagCompX1 = Convert.ToSingle(xMagCompX1.value());
-                this.MagCompY1 = Convert.ToSingle(xMagCompY1.value());
-                this.MagRange2 = Convert.ToSingle(xMagRange2.value());
-                this.MagCompX2 = Convert.ToSingle(xMagCompX2.value());
-                this.MagCompY2 = Convert.ToSingle(xMagCompY2.value());
-                this.MagRange3 = Convert.ToSingle(xMagRange3.value());
-                this.MagCompX3 = Convert.ToSingle(xMagCompX3.value());
-                this.MagCompY3 = Convert.ToSingle(xMagCompY3.value());
-                this.MagRange4 = Convert.ToSingle(xMagRange4.value());
-                this.fMagCompX4 = Convert.ToSingle(xMagCompX4.value());
-                this.MagCompY4 = Convert.ToSingle(xMagCompY4.value());
+               
 
                 this.ScanRotCor = Convert.ToSingle(scanRotate.value());
                 this.PixelSizeCor = Convert.ToSingle(pscor.value());

+ 132 - 0
MeasureThread/FibWork.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace MeasureThread
+{
+    class FibWork
+    {
+        NLog.Logger log;
+        SmartSEMControl.ISEMControl iSEM;
+        string FIBTemp;
+        public FibWork(SmartSEMControl.ISEMControl aSEM,string a_FibTemp)
+        {
+            log = NLog.LogManager.GetCurrentClassLogger();
+            iSEM = aSEM;
+            FIBTemp = a_FibTemp;
+        }
+        //FIB切割
+        public bool DoFIBWork()
+        {
+            //执行PT沉积的ELY文件
+            if (!ExcuteEly(FIBTemp))
+            {
+                return false;
+            }
+
+            //等待切割完成
+            while (true)
+            {
+                Thread.Sleep(10000);
+                if (iSEM.GetFIBMode() == 0)
+                {
+                    break;
+                }
+            }
+
+            return true;
+        }
+        public bool ModifyCutTemplate(float x1,float y1,float x2,float y2)
+        {
+            float x0 = 0, y0 = 0,  px = 0;
+            //20201128将移动光束改为移动ely文件中的参数来实现沉积和切割
+           
+
+            float xc = (x1 + x2) / 2;
+            float yc = (y1 + y2) / 2;
+            x0 = xc - 512;
+            y0 = 384 - yc;
+            log.Info("移动像素 x = " + x0.ToString() + ",y=" + y0.ToString(), true);
+            px = iSEM.GetPixelSize();
+            //修改FIB切割的ELY文件坐标
+            XmlDocument xmlDoc = new XmlDocument();
+            xmlDoc.Load(FIBTemp);//加载baixml文件,xmlpath 为XML文件的路径du
+            XmlNode xns = xmlDoc.SelectSingleNode("ELAYOUT/STRUCTURE_LIST/STRUCTURE/LAYER_REFERENCE/TRAPEZOID");
+            if (xns != null)
+            {
+                XmlAttributeCollection attributeCol = xns.Attributes;
+                //遍历自己点属性
+                double width_a = Convert.ToDouble(attributeCol.GetNamedItem("width_a").Value) / 2.0;
+                log.Info("XML-Width_a = " + width_a.ToString(), true);
+                foreach (XmlAttribute attri in attributeCol)
+                {
+                    if (attri.Name == "x")
+                    {
+                        attri.InnerText = ((x0 * px) * 1000000 - width_a).ToString();
+                        log.Info("XML-TopLeft-X = " + attri.InnerText, true);
+                    }
+                    else if (attri.Name == "y")
+                    {
+                        attri.InnerText = ((y0 * px) * 1000000 - 2.791).ToString();
+                        log.Info("XML-TopLeft-Y = " + attri.InnerText, true);
+                    }
+                }
+            }
+            xns = xmlDoc.SelectSingleNode("ELAYOUT/STRUCTURE_LIST/STRUCTURE/LAYER_REFERENCE/RECT");
+            if (xns != null)
+            {
+                XmlAttributeCollection attributeCol = xns.Attributes;
+                double width = Convert.ToDouble(attributeCol.GetNamedItem("width").Value) / 2.0;
+                //遍历自己点属性
+                foreach (XmlAttribute attri in attributeCol)
+                {
+                    if (attri.Name == "x")
+                    {
+                        attri.InnerText = ((x0 * px) * 1000000 - width).ToString();
+                    }
+                    else if (attri.Name == "y")
+                    {
+                        attri.InnerText = (((y0 * px) * 1000000) + 2 - 2.791).ToString();
+                    }
+                }
+            }
+            xmlDoc.Save(FIBTemp);//保存的该XML文件,否则更新无效
+            return true;
+        }
+        //执行ELY文件的步骤
+        public bool ExcuteEly(string a_filename)
+        {
+            //执行ELy文件有三个动作
+            //1. 选择ELY文件
+            //SendMsg("选择ELY文件");
+            if (!iSEM.CmdFIBLoadELY(a_filename))
+            {
+                //SendMsg("选择ELY文件失败");
+                return false;
+            }
+            Thread.Sleep(1000);
+            //2. 确认ELY文件
+            //SendMsg("确认ELY文件");
+            if (!iSEM.CmdFIBEXPOSUREELY())
+            {
+                //SendMsg("确认ELY文件失败");
+                return false;
+            }
+            Thread.Sleep(1000);
+            //3. 执行ELY文件
+            //SendMsg("执行ELY文件");
+            if (!iSEM.CmdFIBSTARTELY())
+            {
+                //SendMsg("执行ELY文件失败");
+                return false;
+            }
+            Thread.Sleep(1000);
+
+            return true;
+        }
+    }
+}

+ 7 - 0
MeasureThread/Focus.cs

@@ -138,6 +138,13 @@ namespace MeasureThread
             bool mRetMag=iSEM.SetMagnification(prm.mag);
             
             Thread.Sleep(500);
+            float current = iSEM.GetMagnification();
+            while (Math.Abs(current - prm.mag) > 1)
+            {
+                iSEM.SetMagnification(prm.mag);
+                Thread.Sleep(200);
+                current = iSEM.GetMagnification();
+            }
             // 
             if (!TiltCorrection(prm.tiltCorrAngle))
             {               

+ 7 - 7
MeasureThread/Locate.cs

@@ -188,6 +188,13 @@ namespace MeasureThread
                 }
             }
 
+
+            //恢复BeamShift的百分比值
+            iSEM.SetBeamShiftX(pr.xs);
+            Thread.Sleep(200);
+            iSEM.SetBeamShiftY(pr.ys);
+            Thread.Sleep(200);
+
             //恢复原来的放大倍数
             log.Info("恢复原来的放大倍数! " + pr.magCur);
             if (!iSEM.SetMagnification(pr.magCur))
@@ -198,13 +205,6 @@ namespace MeasureThread
             float cycle_time = iSEM.GetCycleTime();
             Thread.Sleep(100 + Convert.ToInt32(cycle_time));
 
-
-            //恢复BeamShift的百分比值
-            iSEM.SetBeamShiftX(pr.xs);
-            Thread.Sleep(200);
-            iSEM.SetBeamShiftY(pr.ys);
-            Thread.Sleep(200);
-
             #endregion
 
         }

+ 199 - 345
MeasureThread/Measure.cs

@@ -412,16 +412,16 @@ namespace MeasureThread
         const String ImageName4 = @"SEMTrapCP.tif";//传给客户,找到已经切割点
         const String ImageName5 = @"SEMDegreeTrap.tif";//传给客户,水平校正
         const String ImageName6 = @"SEMMagEnd.tif";//传给客户,测量层高
-        const String ImageName7 = @"EDSImage.tif";//计算感兴趣的区域
-        const String ImageName8 = @"SEMAfterMoveToPix.tif";//精确的位置移动后的图像
-        const String ImageName9 = @"SEMBeforeMoveToPix.tif";//精确的位置移动后的图像
-        const String ImageName10 = @"SEMTrapCPAfter.tif";//传给客户,找到已经切割点
-        const String ImageName111 = @"SEMBeforeCut.tif";//切割前SEM拍照
-        const String ImageName112 = @"SEMAfterCut.tif";//切割后SEM拍照
+        const String ImageName7 = @"BeforeImage.tif";//计算感兴趣的区域
+        //const String ImageName8 = @"SEMAfterMoveToPix.tif";//精确的位置移动后的图像
+        //const String ImageName9 = @"SEMBeforeMoveToPix.tif";//精确的位置移动后的图像
+        //const String ImageName10 = @"SEMTrapCPAfter.tif";//传给客户,找到已经切割点
+        //const String ImageName111 = @"SEMBeforeCut.tif";//切割前SEM拍照
+        //const String ImageName112 = @"SEMAfterCut.tif";//切割后SEM拍照
         const String ImageNameTwo_1 = @"SEMRegion.tif";//第一个测量区域拍照
-        const String ImageNameTwo_2 = @"SEMTwoRegion.tif";//第二个测量区域拍照
-        const String ImageNameTwo_11 = @"SEMOneRegionMove.tif";//第一个测量区域拍照
-        const String ImageNameTwo_22 = @"SEMTwoRegionMove.tif";//第二个测量区域拍照
+        //const String ImageNameTwo_2 = @"SEMTwoRegion.tif";//第二个测量区域拍照
+        //const String ImageNameTwo_11 = @"SEMOneRegionMove.tif";//第一个测量区域拍照
+        //const String ImageNameTwo_22 = @"SEMTwoRegionMove.tif";//第二个测量区域拍照
 
         const String MacoInsertPt = "GIS Insert.MLF"; //传入PT针
         const String MacoRetractPt = "GIS Retract.MLF"; //退出PT针
@@ -668,21 +668,15 @@ namespace MeasureThread
         ///13. 自动 定位功能,沉积
         /// </summary>
         /// <returns></returns>
-        public bool GetFIBPoistion(CutHole currHole)
+        public bool GetFIBAndPTPoistion(CutHole currHole)
         {
           
             float px = 0;
             int state = 1;
             log.Info("测量线程:FIB自动定位放大倍数" + MParam.Location_Magnification.ToString(), true);
             Thread.Sleep(200);
-            ////1.控制SEM放大600X
-            //if (!iSEM.SetSEMVoltage(MParam.Location_Voltage))
-            //{
-
-            //    log.Error("测量线程报错:13.自动定位、沉积-自动定位电压" + MParam.Location_Voltage.ToString() + "控制失败", false);
-            //    return false;
-            //}
-            Thread.Sleep(200);
+  
+         
             
             if (!m_focuse.SetMagnification(MParam.Location_Magnification))
             {
@@ -720,7 +714,8 @@ namespace MeasureThread
                 log.Info("停止键按下。", true);
                 return false;
             }
-     
+            //刷亮度对比度
+            iSEM.CmdFocusScanSpeed("CMD_SCANRATE4");//iSEM.CmdSaveRate();
             Thread.Sleep(200);
             iSEM.SetAutoBright(100);
             Thread.Sleep(200);
@@ -728,7 +723,7 @@ namespace MeasureThread
             iSEM.SetAutoVideoBrightnessAndContrast();
                            
                             
-            Thread.Sleep(6000);
+            Thread.Sleep(10000);
 
             iSEM.SetAutoVideoOff();
 
@@ -754,8 +749,7 @@ namespace MeasureThread
                 return false;
             }
 
-            iSEM.CmdFIBModeSEM();
-            Thread.Sleep(200);
+          
             float x1=0,y1=0, x2=0, y2=0;
             //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
             log.Info("测量线程:调用图像处理接口,准备移动样品台", true);
@@ -773,7 +767,7 @@ namespace MeasureThread
                 if (MParam.PT)
                 {
 
-                    m_PTWork.ModifyPTTemp();
+                    m_PTWork.ModifyPTTemp(x1,y1,x2,y2);
 
                 }
 
@@ -785,23 +779,24 @@ namespace MeasureThread
                 return false;
             }
 
-           
+            iSEM.CmdFIBModeSEM();
+            Thread.Sleep(200);
 
             //14.保存样品1第1号孔中心位置6轴坐标1 XYZMRT到数据库,保存客户返回值信息到数据库
-            float[] firstPosition = iSEM.GetStagePosition();
-            m_cutHoles[0].Position.X = firstPosition[0];
-            m_cutHoles[0].Position.Y = firstPosition[1];
-            m_cutHoles[0].Position.Z = firstPosition[2];
-            m_cutHoles[0].Position.T = firstPosition[3];
-            m_cutHoles[0].Position.R = firstPosition[4];
-            m_cutHoles[0].Position.M = firstPosition[5];
-            //这里要调用文件保存功能
-            arg.Message = "坐标1(" + firstPosition[0].ToString() + ","
-                + firstPosition[1].ToString() + ","
-                + firstPosition[2].ToString() + ","
-                + firstPosition[3].ToString() + ","
-                + firstPosition[4].ToString() + ","
-                + firstPosition[5].ToString() + ")";
+            //float[] firstPosition = iSEM.GetStagePosition();
+            //m_cutHoles[0].Position.X = firstPosition[0];
+            //m_cutHoles[0].Position.Y = firstPosition[1];
+            //m_cutHoles[0].Position.Z = firstPosition[2];
+            //m_cutHoles[0].Position.T = firstPosition[3];
+            //m_cutHoles[0].Position.R = firstPosition[4];
+            //m_cutHoles[0].Position.M = firstPosition[5];
+            ////这里要调用文件保存功能
+            //arg.Message = "坐标1(" + firstPosition[0].ToString() + ","
+            //    + firstPosition[1].ToString() + ","
+            //    + firstPosition[2].ToString() + ","
+            //    + firstPosition[3].ToString() + ","
+            //    + firstPosition[4].ToString() + ","
+            //    + firstPosition[5].ToString() + ")";
            
             if (key_stop)
             {
@@ -875,34 +870,14 @@ namespace MeasureThread
         {
             float x2 = 0, y2 = 0;
             int state = 0;
-            ////切换到SEM模式
-            //if (!iSEM.CmdFIBModeSEM())
-            //{
-                
-            //    log.Error("测量线程报错:" + arg.Message, false);
-            //    return false;
-            //}
-            //Thread.Sleep(1000);
-
-            
-            
-          
-            ////判断是否停止进程
-            //if (key_stop)
-            //{
-            //    log.Info("停止键按下", true);
-            //    return false;
-            //}
+            //切换到SEM模式
+            if (!iSEM.CmdFIBModeSEM())
+            {
 
-            
-            //log.Info("电压设置:" + MParam.Location_Voltage.ToString("0.0"));
-            //if (!iSEM.SetSEMVoltage(MParam.Location_Voltage))
-            //{
-               
-            //    log.Error("测量线程报错:" + arg.Message, false);
-            //    return false;
-            //}
-            //Thread.Sleep(200);
+                log.Error("测量线程报错:" + arg.Message, false);
+                return false;
+            }
+            Thread.Sleep(1000);
 
 
             if (key_stop)
@@ -948,37 +923,17 @@ namespace MeasureThread
                 mArgSend.SendArgumentToScreen("3-3",arg.Message);
 
                 //add by zjx 2020-12-21 根据客户的需求修改图片的名称
-                String fileName10 = currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Location_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName10;
+               // String fileName10 = currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Location_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName10;
                 //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
-                log.Info("fileName10====================" + fileName10, true);
-                m_photo.GetParam().savePath = fileName10;
+                //log.Info("fileName10====================" + fileName10, true);
+                //m_photo.GetParam().savePath = fileName10;
                 
-                //if (!m_photo.TakePhoto())
-                //{
-                    
-                //    log.Error("测量线程报错:找到已切割的位置拍照失败", false);
-                //}
 
-
-                //if (hand_intervene == 1)
-                //{
-                //    MessageBox.Show("Web返回数据移动是否正确?\n如果错误请手动移动到指定位置后按确认", "确认消息", MessageBoxButtons.OK);
-                //}
             }
             else
             {
                
-                //if (hand_intervene == 1)
-                //{
-                //    if (DialogResult.Yes != MessageBox.Show("网络参数State返回为0。\n是否继续操作?。", "确认消息", MessageBoxButtons.YesNo))
-                //    {
-                //        return false;
-                //    }
-                //}
-                //else
-                //{
-                //    return false;
-                //}
+
                 log.Error("测量线程报错:" + arg.Message, false);
                 return false;
             }
@@ -995,9 +950,7 @@ namespace MeasureThread
         public bool ShotSection(CutHole currHole,ref List<String> limg_path, ref List<float> lsize)
         {
             int state = 0;
-            #region 设置拍照的电压
-            log.Info("测量线程:开始对焦" + MParam.Photograph_Voltage.ToString(), true);
-           
+            #region 对焦     
            
             Focusparam fprm = new Focusparam()
             {
@@ -1016,26 +969,10 @@ namespace MeasureThread
                 workingDis = 5.0f,
 
             };
-            //if (MParam.Is_Photograph == false)
-            //{
 
-            //    fprm.tiltCorrAngle = MParam.Correction_Angle;
-            //}
             //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-            float m_TempBrightness;
-            float m_TempContrast;
-
-            if (MParam.SampleName == "3")
-            {
-                m_TempBrightness = 50f;
-                m_TempContrast = 29f;
-               
-            }
-            else
-            {
-                m_TempBrightness = 50.0f;
-                m_TempContrast = 30.0f;
-            }
+            float m_TempBrightness=50f;
+            float m_TempContrast=30f;
 
             fprm.brightness = m_TempBrightness;
             fprm.contrast = m_TempContrast;
@@ -1043,7 +980,7 @@ namespace MeasureThread
             m_focuse.DoFocusBySetMainParameter();
 
 
-
+            Thread.Sleep(200);
             if (key_stop)
             {
                 log.Info("停止键按下", true);
@@ -1051,36 +988,26 @@ namespace MeasureThread
             }
 
 
-          
-
-            //4、拍照,5、保存照片
-            //String fileName5 = data_path + "\\" + currHole.HoleName + "_" + MParam.Photograph_Magnification.ToString("0") + "_" + ImageName5;
-            //add by zjx 2020-12-21 根据客户的需求修改图片的名称
-            String fileName5 = currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Photograph_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName5;
-            //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
-            log.Info("fileName5=" + fileName5, true);
-           
-
-
 
 
+            //4、拍照,5、保存照片
+          string  fileName6 =currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Photograph_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName6;
+           log.Info("fileName6=" + fileName6, true);
+         
             PhotoParam phop = new PhotoParam()
             {
                 Mag = MParam.Photograph_Magnification,
-                 savePath=fileName5,
-
+                 savePath=fileName6,
             };
-
             m_photo.SetPhotoParam(phop);
             if (!m_photo.TakePhoto())
-            {
-               
+            {               
                 log.Error("测量线程报错:" + arg.Message, false);
                 return false;
             }
 
            
-            mArgSend.SendArgumentToScreen("3-7", "SEM拍照成功", fileName5);
+            mArgSend.SendArgumentToScreen("3-7", "SEM拍照成功", fileName6);
             //判断是否停止进程
             if (key_stop)
             {
@@ -1091,77 +1018,9 @@ namespace MeasureThread
 
             if (MParam.Is_Photograph == false)
             {
-                #region 对当前矩形进行旋转校正
-                //8,计算切割面区域偏移角度及方向
-                float degree = 0;
-                int direction = 0;
-
-                ImagePro.Img_Center_Position_OffsetAngle_Direction(fileName5, Convert.ToInt32(MParam.SampleName), MParam.Firm, out degree, out direction, out state);
-                log.Info("测量线程:2000倍 拍照角度移动,输入图像" + fileName5 + "输出角度为" + degree.ToString() + "输出方向为" + direction.ToString() + "返回值为" + state.ToString(), true);
-                log.Info("样品" + currHole.HoleNo.ToString() + "计算切割面区域的角度=" + degree.ToString(), true);
-                //接口返回像素,*pixelsize,得到坐标点。判断移动方式
-                if (state == 1)
-                {
-                    //梯形角度
-                    iSEM.SetScanRotationOn();
-                    Thread.Sleep(200);
-                    //20201128陈工要求,谭博返回角度*0.7
-                    iSEM.SetScanRotation(Convert.ToSingle(degree * MParam.ScanRotCor));
-                    Thread.Sleep(200);
-
-                  
-                    string Message = "图像接口返回角度为:" + degree.ToString();
-                    
-                    mArgSend.SendArgumentToScreen("3-8", Message, fileName5);
-
- 
-                }
-                else
-                {
-                    
-    
-                    log.Error("测量线程报错:" + arg.Message, false);
-                }
-                //判断是否停止进程
-                if (key_stop)
-                {
-                    log.Info("停止键按下", true);
-                    return false;
-                }
-
-                Thread.Sleep(200);
-
-                String fileName6;
-                if (degree == 0)
-                {
-                    fileName6 = fileName5;
-                }
-                else
-                {
-                    //12拍照
-                    
-                    //add by zjx 2020-12-21 根据客户的需求修改图片的名称
-                    fileName6 =currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Photograph_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName6;
-                    //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
-                    log.Info("fileName6=" + fileName6, true);
-               
-
-                    m_photo.GetParam().savePath = fileName6;
-                    if (!m_photo.TakePhoto())
-                    {
-                        log.Error("测量线程报错:" + arg.Message, false);
-                        return false;
-                    }
-                }
-
+              
 
-                mArgSend.SendArgumentToScreen("3-9", "SEM拍照成功", fileName6);
-                if (key_stop)
-                {
-                    log.Info("停止键按下", true);
-                    return false;
-                }
-                #endregion
+              
 
                 #region 获取两个位置上及放大倍数
                 //计算两个测量区域坐标
@@ -1169,6 +1028,8 @@ namespace MeasureThread
                 List<float> mag = new List<float>();
                 System.Drawing.Point ct0;
                 float magMax;
+               
+
                 //log.Info("测量线程:图像处理接口,计算两个放大区域坐标,输入图像" + fileName6.ToString() + "控制失败", true);
                 ImagePro.Img_Measure_Region_Position(fileName6, Convert.ToInt32(MParam.SampleName), MParam.Firm, out ct, out mag, out ct0, out state);
                 string s = "";
@@ -1272,35 +1133,81 @@ namespace MeasureThread
                             + "," + ct[n].Y.ToString() + ")", true);
                         #endregion
 
+                        log.Info("测量线程:移动到第一个点位置完成!", true);
+
 
-                        
                         #region 拍照
-                      
+
                         //add by zjx 2020-12-21 根据客户的需求修改图片的名称
-                        String fileName7 =currHole. data_path + "\\" + MParam.Firm + "-" + mag[n].ToString() + "-" + currHole.HoleName + "-" + n.ToString() + "-" + ImageNameTwo_1;
+                        String fileName7 = currHole.data_path + "\\" + MParam.Firm + "-" + mag[n].ToString() + "-" + currHole.HoleName + "-" + n.ToString() + "-" + ImageNameTwo_1;
                         //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
                         log.Info("fileName7=" + fileName7, true);
-
                        
-                        
-                        log.Info("测量线程:移动到第一个点位置完成!", true);
+                        if (n == 0)//如果是第一个观测点就做角度修正
+                        {
+                            String fileName5 = currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Photograph_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName5;
+                            //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
+                            log.Info("纠正前 fileName5=" + fileName5, true);
+
+                            m_photo.GetParam().savePath = fileName5;
+                            m_photo.GetParam().Mag = mag[n];
+                            m_photo.TakePhoto();
+
+                            //8,计算切割面区域偏移角度及方向
+                            float degree = 0;
+                            int direction = 0;
+
+                            ImagePro.Img_Center_Position_OffsetAngle_Direction(fileName5, Convert.ToInt32(MParam.SampleName), MParam.Firm, out degree, out direction, out state);
+                            log.Info("测量线程:拍照角度移动,输入图像" + fileName5 + "输出角度为" + degree.ToString() + "输出方向为" + direction.ToString() + "返回值为" + state.ToString(), true);
+                            log.Info("样品" + currHole.HoleNo.ToString() + "计算切割面区域的角度=" + degree.ToString(), true);
+                            //接口返回像素,*pixelsize,得到坐标点。判断移动方式
+                            if (state == 1)
+                            {
+                                //梯形角度
+                                iSEM.SetScanRotationOn();
+                                Thread.Sleep(200);
+                                //20201128陈工要求,谭博返回角度*0.7
+                                iSEM.SetScanRotation(Convert.ToSingle(degree * MParam.ScanRotCor));
+                                Thread.Sleep(200);
 
-                        m_photo.GetParam().savePath = fileName7;
-                        m_photo.GetParam().Mag = mag[n];
-                       
-                       m_photo.TakePhoto();
+
+                                string Message = "图像接口返回角度为:" + degree.ToString();
+
+                                mArgSend.SendArgumentToScreen("3-8", Message, fileName5);
+
+
+                            }
+                            else
+                            {
+
+
+                                log.Error("测量线程报错:" + arg.Message, false);
+                            }
+                            //纠正后再次拍照
+                            log.Info("纠正后拍照!");
+                            m_photo.GetParam().savePath = fileName7;
+                            m_photo.GetParam().Mag = mag[n];
+
+                            m_photo.TakePhoto();
+
+                        }
+                        else
+                        {
+                            m_photo.GetParam().savePath = fileName7;
+                            m_photo.GetParam().Mag = mag[n];
+
+                            m_photo.TakePhoto();
+
+
+                        }
                        
-                        iSEM.CmdPixelScan();
-                        Thread.Sleep(200);
-                      
-                    
                         iSEM.CmdFocusScanSpeed(MParam.ScanSpeedNormal);//CmdFocusRate(4);
                         Thread.Sleep(200);
                         cycle_time = iSEM.GetCycleTime();
                         Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
                         Thread.Sleep(200);
 
-                        mArgSend.SendArgumentToScreen("3-11", "移动到第一个点位置拍照成功",fileName7);
+                        mArgSend.SendArgumentToScreen("3-11", "移动到第"+n+"个点位置拍照成功",fileName7);
 
                         // add by zjx 在测量图上显示放大倍数和像素大小等信息
                         
@@ -1362,7 +1269,12 @@ namespace MeasureThread
                  + currHole.Position.Z.ToString() + ")", true);
                 Locate lo = new Locate(iSEM);
                 lo.LocateCutHolePosition(currHole, MParam.Tilt);
+                if (!m_focuse.SetMagnification(MParam.Location_Magnification))
+                {
 
+                    log.Error("测量线程报错:设置定位放大倍数" + MParam.Location_Magnification.ToString() + "控制失败", false);
+                    return false;
+                }
                 if (key_stop)
                 {
 
@@ -1412,18 +1324,7 @@ namespace MeasureThread
                 //第四步:拉直 ( 2是5/6类样品,不需要拉直)
                 if (MParam.SampleName != "2")
                 {
-                    //设置拉直的放大倍数
-                    log.Info("测量线程:设置SEM放大倍数为拉直放大倍数,放大倍数为" + MParam.Stretch_Magnification.ToString(), true);
-
-                    if (!m_focuse.SetMagnification(MParam.Stretch_Magnification))
-                    {
-                        log.Error("测量线程报错:设置SEM放大倍数为拉直放大倍数失败,放大倍数为" + MParam.Stretch_Magnification.ToString(), false);
 
-                        return false;
-                    }
-                    arg.Message = "拉直放大倍数设置成功!";
-                    arg.State = true;
-                    SendMsg("0-2");
                     log.Warn("测量线程:拉直操作开始!", true);
                     if (!Straighten_Handle(currHole))
                     {
@@ -1459,7 +1360,7 @@ namespace MeasureThread
                 if (MParam.Is_Photograph==false)
                 {
                     log.Warn("测量线程:PIB切割自动定位开始!", true);
-                    if (!GetFIBPoistion(currHole))
+                    if (!GetFIBAndPTPoistion(currHole))
                     {
                         log.Error("测量线程报错:自动定位失败,程序退出。", false);
                         return false;
@@ -1467,6 +1368,7 @@ namespace MeasureThread
 
 
                     //11.自动工具样品类型参数确定是否需要PT沉积
+                    log.Info("是否PT:" + MParam.PT.ToString());
                     if (MParam.PT)
                     {
                    
@@ -1546,7 +1448,7 @@ namespace MeasureThread
                 //18.自动层高分析
                 if (MParam.Is_Photograph == false)
                 {
-                    log.Warn("测量线程:18.自动层高分析开始", true);
+                    log.Warn("测量线程:自动层高分析开始", true);
                     float size = iSEM.GetPixelSize();
                     int state = 1;
                     ImagePro.Img_Measure_Height(limg_path, lsize, currHole.data_path + "\\", Convert.ToInt32(MParam.SampleName), MParam.Firm, out state);
@@ -1557,9 +1459,9 @@ namespace MeasureThread
                         return false;
                     }
                     arg.State = true;
-                    arg.Message = "测量尺寸成功";
+                    arg.Message = "层高分析成功";
                     SendMsg("3-12");
-                    log.Info("测量线程:18.自动层高分析结束!", true);
+                    log.Info("测量线程:自动层高分析结束!", true);
                 }
             }
             //add by zjx 2020-12-18 为了测试只做能谱部分 end
@@ -1570,15 +1472,15 @@ namespace MeasureThread
                
                 if (currHole.HoleNo + 1 == m_cutHoles.Count)//最后样品分析点才跑能谱
                 {
-                    log.Warn("测量线程:19.能谱分析开始===" + MParam.EDS, true);
+                    log.Warn("测量线程:能谱分析开始===" + MParam.EDS, true);
                     EDS_Analysis(currHole);
-                    log.Info("测量线程:19.能谱分析结束===" + MParam.EDS, true);
+                    log.Info("测量线程:能谱分析结束===" + MParam.EDS, true);
                 }
                
               
             }
             //20.复位
-            log.Info("===========测量线程:20.复位开始", true);
+            log.Info("测量线程:复位开始", true);
             BeamShiftReset();
             return true;
         }
@@ -1588,8 +1490,19 @@ namespace MeasureThread
         //初始化拉直操作
         public bool Straighten_Handle(CutHole currHole)
         {
-            
 
+            //设置拉直的放大倍数
+            log.Info("测量线程:设置拉直放大倍数,放大倍数为" + MParam.Stretch_Magnification.ToString(), true);
+
+            if (!m_focuse.SetMagnification(MParam.Stretch_Magnification))
+            {
+                log.Error("测量线程报错:设置SEM放大倍数为拉直放大倍数失败,放大倍数为" + MParam.Stretch_Magnification.ToString(), false);
+
+                return false;
+            }
+            arg.Message = "拉直放大倍数设置成功!";
+            arg.State = true;
+            SendMsg("0-2");
             //1、自动对焦
             log.Info("测量线程:拉直操作前自动对焦开始", true);
 
@@ -1964,7 +1877,33 @@ namespace MeasureThread
         {
             float x2 = 0, y2 = 0;
             int state = 0;
-            float mag = MParam.Photograph_Magnification / 3;
+            float tmag = MParam.Photograph_Magnification / 3;
+            if (tmag < 300)
+            {
+                tmag = 300;
+
+            }
+
+            Focusparam focusPrm = new Focusparam()
+            {
+                IfAutoBrightnessAndContrast = true,
+                ScanSpeed = MParam.ScanSpeedHigh,
+                mag = tmag,
+                reduceWindowPos = new System.Drawing.Point(256, 192),
+                reduceWinWidth = 400,
+                reduceWinHeight = 400,
+                workingDis = 10,//unit:mm
+                brightness = 50,
+                contrast = 29,
+                tiltCorrAngle = 54,
+                ifStig = false,
+
+            };
+
+            m_focuse.setFocusParam(focusPrm);
+            m_focuse.DoFocusBySetMainParameter();
+
+            float mag = tmag;
            
             String fileName4 = currHole.data_path + "\\EDS\\" + MParam.Firm + " - " + mag.ToString("0") + "-" + currHole.HoleName + "-" + ImageNameEDS4;
             PhotoParam prm = new PhotoParam()
@@ -1975,7 +1914,7 @@ namespace MeasureThread
                               
                   
             };
-            //Photo pho = new Photo(prm,iSEM);
+            
             m_photo.SetPhotoParam(prm);
             m_photo.TakePhoto();
      
@@ -2092,77 +2031,6 @@ namespace MeasureThread
 
             if (MParam.Is_Photograph == false)//Is_Photograph 代表 是否是只拍照
             {
-                #region 对当前矩形进行旋转校正
-                //8,计算切割面区域偏移角度及方向
-                float degree = 0;
-                int direction = 0;
-
-                ImagePro.Img_Center_Position_OffsetAngle_Direction(fileName5, Convert.ToInt32(MParam.SampleName), MParam.Firm, out degree, out direction, out state);
-                log.Info("测量线程:2000倍===拍照角度移动,输入图像" + fileName5 + "输出角度为" + degree.ToString() + "输出方向为" + direction.ToString() + "返回值为" + state.ToString(), true);
-                log.Info("样品" + currHole.HoleNo.ToString() + "计算切割面区域的角度=" + degree.ToString(), true);
-                //接口返回像素,*pixelsize,得到坐标点。判断移动方式
-                if (state == 1 )
-                {
-                    if (Math.Abs(degree) > 0)
-                    {
-                        //梯形角度
-                        iSEM.SetScanRotationOn();
-                        Thread.Sleep(200);
-                        //20201128陈工要求,谭博返回角度*0.7
-
-                        iSEM.SetScanRotation(Convert.ToSingle(degree * 0.7));
-                        Thread.Sleep(200);
-
-                        arg.State = true;
-                        arg.Message = "图像接口返回角度为:" + degree.ToString();
-                        log.Info(arg.Message);
-                    }               
-                  
-
-                }
-                else
-                {
-                    arg.Message = "图像接口参数State返回值为零";
-                
-                    log.Error("测量线程报错:" + arg.Message, false);
-                }
-                //判断是否停止进程
-                if (key_stop)
-                {
-                    log.Info("停止键按下", true);
-                    return false;
-                }
-
-                Thread.Sleep(200);
-                String fileName6;
-                if (Math.Abs(degree) > 0)
-                {
-                    //add by zjx 2020-12-21 根据客户的需求修改图片的名称
-                     fileName6 = currHole.data_path + "\\EDS\\" + MParam.Firm + "-" + MParam.Photograph_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName6;
-                    //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
-                    log.Info("fileName6=" + fileName6, true);
-                    log.Info("纠正后拍照!");
-                    PhotoParam phoprm = new PhotoParam()
-                    {
-                        Mag = MParam.Photograph_Magnification,
-                        savePath = fileName6,
-                    };
-
-                    m_photo.SetPhotoParam(phoprm);
-                    m_photo.TakePhoto();
-                }
-                else
-                {
-                    fileName6 = fileName5;
-                }
-              
-               
-                if (key_stop)
-                {
-                    log.Info("停止键按下", true);
-                    return false;
-                }
-                #endregion
 
                 #region 获取两个位置上及放大倍数
                 //计算两个测量区域坐标
@@ -2170,8 +2038,8 @@ namespace MeasureThread
                 List<float> mag = new List<float>();
                 System.Drawing.Point ct0;
                 float  magMax;
-                log.Info("图像处理接口,计算两个放大区域坐标,输入图像" + fileName6.ToString(), true);
-                ImagePro.Img_Measure_Region_Position(fileName6, Convert.ToInt32(MParam.SampleName), MParam.Firm, out ct, out mag, out ct0, out state);
+                log.Info("图像处理接口,计算两个放大区域坐标,输入图像" + fileName5.ToString(), true);
+                ImagePro.Img_Measure_Region_Position(fileName5, Convert.ToInt32(MParam.SampleName), MParam.Firm, out ct, out mag, out ct0, out state);
                 string s = "";
                 for (int i = 0; i < ct.Count; i++)
                 {
@@ -2179,7 +2047,7 @@ namespace MeasureThread
                     + "放大倍数=" + mag[i];
                 }
                 log.Info("测量线程:图像处理接口返回值为" + state.ToString() +
-                    ",计算两个放大区域坐标,输入图像" + fileName6.ToString() +
+                    ",计算两个放大区域坐标,输入图像" + fileName5.ToString() +
                     "输入样品" + Convert.ToInt32(MParam.SampleName) +
                     "输入厂商" + MParam.Firm.ToString() +
                     s +
@@ -2248,20 +2116,23 @@ namespace MeasureThread
                     m_locate.MoveToPix(ct[0].X,ct[0].Y,MParam.PixelSizeCor);
                     SendMsg("4-4");//向界面发送指令:放大并对拍摄点对焦
                     Thread.Sleep(500);
-                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭
-                    iSEM.CmdFocusScanSpeed(MParam.ScanSpeedFocus);//CmdFocusRate(5);
-                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end
-                   
-                    cycle_time = iSEM.GetCycleTime();
-                    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
 
-                    //#endregion
+                    #region 拍照
+                    //log.Info("进入内部观察,不对焦!", true);
 
-                    Thread.Sleep(200);
-                //add by sun 2020-12-17 根据客户要求,3大类样品需要在5000倍下在拍摄一张图片,不需要分析 end
-                #region 拍照
-                //log.Info("进入内部观察,不对焦!", true);
-                log.Info("开始EDS拍照,设置放大倍数" + mag[0]);
+                    //梯形角度
+                    //if (Math.Abs(scanRotateAngle) > 0)
+                    //{
+                    //    iSEM.SetScanRotationOn();
+                    //    Thread.Sleep(200);
+                    //    //20201128陈工要求,谭博返回角度*0.7
+
+                    //    iSEM.SetScanRotation(Convert.ToSingle(scanRotateAngle * 0.7));
+                    //    Thread.Sleep(200);
+
+                    //}
+                    
+                    log.Info("开始EDS拍照,设置放大倍数" + mag[0]);
                  
                  m_focuse.SetMagnification(mag[0]);
 
@@ -2320,33 +2191,16 @@ namespace MeasureThread
             }
             SendMsg("4-0");
            
-            //2.角度改为54度
-            iSEM.SetScanRotationOff();
-
+            //2.角度补偿关闭
+           // iSEM.SetScanRotationOff();
+           //在层高分析时,角度补偿已经纠正,能谱分析不必再做
 
             Thread.Sleep(200);
-
-            Focusparam focusPrm = new Focusparam()
-            {
-
-                voltage = 7000,
-                Iprobe = 0.5F,
-                IfAutoBrightnessAndContrast = true,
-                ScanSpeed = MParam.ScanSpeedHigh,
-                mag = MParam.Photograph_Magnification/3,
-                reduceWindowPos = new System.Drawing.Point(256, 192),
-                reduceWinWidth = 400,
-                reduceWinHeight = 400,
-                workingDis = 10,//unit:mm
-                brightness = 50,
-                contrast = 29,
-                tiltCorrAngle = 54,
-                ifStig = false,
-                 
-            };
-          
-            m_focuse.setFocusParam(focusPrm);
-            m_focuse.DoFocusBySetMainParameter();
+            iSEM.SetSEMVoltage(7000);
+            Thread.Sleep(200);
+            iSEM.SetSEMIPROBE(0.5f  / 1000000000);
+            Thread.Sleep(200);
+           
 
             SendMsg("4-1");
             log.Warn("开始梯形移到视野中心!");

+ 187 - 0
MeasureThread/PTWork.cs

@@ -0,0 +1,187 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace MeasureThread
+{
+    class PTWork
+    {
+        NLog.Logger log;
+        SmartSEMControl.ISEMControl iSEM;
+        string PTTemp;
+        private string m_ProgramFolder = Directory.GetCurrentDirectory();
+        const String MacoInsertPt = "GIS Insert.MLF"; //传入PT针
+        const String MacoRetractPt = "GIS Retract.MLF"; //退出PT针
+        public PTWork(SmartSEMControl.ISEMControl aSEM, string a_PTTemp)
+        {
+            log = NLog.LogManager.GetCurrentClassLogger();
+            iSEM = aSEM;
+            PTTemp = a_PTTemp;
+        }
+        public bool DoWholePTWork()
+        {
+            if (!iSEM.CmdFIBModeFIB())
+            {
+                log.Error("测量线程报错:切换到SEM模式失败", false);
+                return false;
+            }
+            Thread.Sleep(200);
+            //12.根据样品类型参数确定是否需要PT沉积,控制PT针插入
+          
+                log.Info("测量线程:插入PT针", true);
+                if (!InsertPT())
+                {
+
+                    log.Error("测量线程报错:插入PT针失败", false);
+                    return false;
+                }
+
+            Thread.Sleep(200);
+
+
+            //3. 根据坐标进行PT沉积   
+            log.Info("测量线程: 进行PT沉积");
+            if (!DoPTWork())
+            {
+
+                log.Error("测量线程报错: PT沉积失败");
+                return false;
+            }
+
+
+            Thread.Sleep(200);
+            log.Info ("测量线程:撤出PT针", false);
+            if (!RetractPT())
+                {
+
+                    log.Error("测量线程报错:撤出PT针失败", false);
+                    return false;
+                }
+
+            Thread.Sleep(200);
+
+
+            if (!iSEM.CmdFIBModeSEM())
+            {
+
+                log.Error("测量线程报错:切换到SEM模式失败", false);
+                return false;
+            }
+            Thread.Sleep(200);
+            return true;
+
+        }
+        public bool  ModifyPTTemp(float x1,float y1,float x2,float y2)
+        {
+          var  px = iSEM.GetPixelSize();
+            float x0 = 0, y0 = 0;
+            float xc = (x1 + x2) / 2;
+            float yc = (y1 + y2) / 2;
+            x0 = xc - 512;
+            y0 = 384 - yc;
+            var  xmlDoc = new XmlDocument();
+            xmlDoc.Load(PTTemp);//加载baixml文件,xmlpath 为XML文件的路径du
+           var xns = xmlDoc.SelectSingleNode("ELAYOUT/STRUCTURE_LIST/STRUCTURE/LAYER_REFERENCE/RECT");
+            if (xns != null)
+            {
+                XmlAttributeCollection attributeCol = xns.Attributes;
+                double width = Convert.ToDouble(attributeCol.GetNamedItem("width").Value) / 2.0;
+                //因为ELY文件里的矩形高就是负值,所以在下面的Y值加上这个值就好。
+                double height = Convert.ToDouble(attributeCol.GetNamedItem("height").Value) / 1.5;
+                //遍历自己点属性
+                foreach (XmlAttribute attri in attributeCol)
+                {
+                    if (attri.Name == "x")
+                    {
+                        attri.InnerText = ((x0 * px) * 1000000 - width).ToString();
+                    }
+                    else if (attri.Name == "y")
+                    {
+                        attri.InnerText = ((y0 * px) * 1000000 - 2.791 - height).ToString();
+                    }
+                }
+            }
+            xmlDoc.Save(PTTemp);
+            return true;
+
+        }
+        //插入PT针
+        public bool InsertPT()
+        {
+            string fn = m_ProgramFolder + "\\Macro\\" + MacoInsertPt;
+           
+            iSEM.CMDMCFFilename(fn);
+           
+            Thread.Sleep(1000);
+            return true;
+        }
+
+        //撤出PT针
+        public bool RetractPT()
+        {
+            string fn = m_ProgramFolder + "\\Macro\\" + MacoRetractPt;
+            //SendMsg("调用宏撤出PT针宏文件" + fn);
+            iSEM.CMDMCFFilename(fn);
+            //延时1s??
+            Thread.Sleep(1000);
+            return true;
+        }
+
+        //PT沉积
+        public bool DoPTWork()
+        {
+            //执行PT沉积的ELY文件
+            if (!ExcuteEly(PTTemp))
+            {
+                return false;
+            }
+
+            //等待沉积完成
+            while (true)
+            {
+                Thread.Sleep(7000);
+                if (iSEM.GetFIBMode() == 0)
+                {
+                    break;
+                }
+            }
+            return true;
+        }
+        //执行ELY文件的步骤
+        public bool ExcuteEly(string a_filename)
+        {
+            //执行ELy文件有三个动作
+            //1. 选择ELY文件
+            //SendMsg("选择ELY文件");
+            if (!iSEM.CmdFIBLoadELY(a_filename))
+            {
+                //SendMsg("选择ELY文件失败");
+                return false;
+            }
+            Thread.Sleep(1000);
+            //2. 确认ELY文件
+            //SendMsg("确认ELY文件");
+            if (!iSEM.CmdFIBEXPOSUREELY())
+            {
+                //SendMsg("确认ELY文件失败");
+                return false;
+            }
+            Thread.Sleep(1000);
+            //3. 执行ELY文件
+            //SendMsg("执行ELY文件");
+            if (!iSEM.CmdFIBSTARTELY())
+            {
+                //SendMsg("执行ELY文件失败");
+                return false;
+            }
+            Thread.Sleep(1000);
+
+            return true;
+        }
+    }
+}

+ 1 - 1
SmartSEMControl/SmartSEM.cs

@@ -2378,7 +2378,7 @@ namespace SmartSEMControl
         public Boolean CmdFocusScanSpeed(String mFocusSpeed)  
         {
             Boolean ret = ExecuteCmd(mFocusSpeed);
-            log.Info("调整扫描速度为CmdFocusScanSpeed=====" + mFocusSpeed + "===是否成功?" + ret, true);
+            log.Info("调整扫描速度为 " + mFocusSpeed + " " +  ret.ToString(), true);
             return ret;
         }
         #endregion add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end