Procházet zdrojové kódy

optimize the interface

gsp před 4 roky
rodič
revize
287d851cac

+ 14 - 169
HOZProject/App.config

@@ -5,43 +5,19 @@
     </startup>
     <appSettings>
       <!--厂商_数据源-->
-      <add key="Firm" value="Noah-BOE,LG,SDC,Ocean-BOE"/>
-      <!--样品类型_数据源-->
-      <add key="Sample_Type" value="0,1,2,3"/>
-      <!--拍照的工作电压_数据源-->
-      <add key="WPZD" value="100,200,300,2500,2000"/>
-      <!--拍照的放大倍数_数据源-->
-      <add key="WPZF" value="100,200,300,2000"/>
-      <!--定位切割位置的工作电压_数据源-->
-      <add key="WQGD" value="100,200,300,2000"/>
-      <!--定位切割位置的放大倍数_数据源-->
-      <add key="WQGF" value="100,200,300"/>
-      <!--拉直操作需要的放大倍数_数据源-->
-      <add key="WLZ" value="100,200,300"/>
-      <!--FIB模式下的放大倍数_数据源-->
-      <add key="WFIB" value="100,200,300,1500"/>
-      <!--一键配置保存目录-->
-      <add key="TemplateFilePath" value="D:\HOZ1.0\TemplateFilePath"/>
+      <add key="Firms" value="Noah-BOE,LG,SDC,Ocean-BOE"/>
+
+      
       <!--PT使用的ELY文件-->
       <add key="PT_ELYFile" value=""/>
       <!--FIB使用的ELY文件-->
       <add key="FIB_ELYFile" value=""/>
-      <!--拉直操作需要的放大倍数-->
-      <add key="Stretch_Magnification" value="300"/>
-      <!--定位切割位置的放大倍数-->
-      <add key="Location_Magnification" value="300"/>
-      <!--定位切割位置的工作电压-->
-      <add key="Location_Voltage" value="2000"/>
-      <!--拍照的放大倍数-->
-      <add key="Photograph_Magnification" value="2000"/>
-      <!--拍照的工作电压-->
-      <add key="Photograph_Voltage" value="2000"/>
-      <!--校正角度选择-->
-      <add key="Correction_Angle" value="36"/>
+
+   
       <!--样品类型-->
-      <add key="SampleName" value="1"/>
+      <add key="LastSampleType" value="1"/>
       <!--厂商-->
-      <add key="Firms" value="Ocean-BOE"/>
+      <add key="LastSelectFirm" value="Ocean-BOE"/>
       <!--是否倾斜样品台-->
       <add key="Is_Title" value="True"/>
       <!--是否仅拍照-->
@@ -53,19 +29,12 @@
       <!--能谱移动Z轴位置-->
       <add key="EDS_Z" value="37.241"/>
       <!--能谱电压设置值-->
-      <add key="EDS_V" value="10000"/>
+      <add key="EDS_V" value="7000"/>
       <!--能谱电流设置值-->
-      <add key="EDS_A" value="1.0"/>
+      <add key="EDS_A" value="0.5"/>
       <!--能谱Xray Mode 0:point mode 1: line mode 2: area mode-->
       <add key="EDS_XrayMode" value="1"/>
-      <!--FIB的放大倍数-->
-      <add key="FIB_Magnification" value="1500"/>
-      <!--Z轴移动距离,单位:mm-->
-      <add key="ZDistance" value="5"/>
-      <!--层高分析的放大倍数-->
-      <add key="FH_Magnification" value="1500"/>
-      <!--层高分析的电压-->
-      <add key="FH_Voltage" value="3000"/>
+    
   
       <!--ScanRotate角度补偿参数-->
       <add key="ScanRotCur" value="1"/>
@@ -73,8 +42,7 @@
       <add key="PixelSize_Y_Cur" value="1.236"/>
       
       
-      <!--自动对焦模式,手动1,自有2,客户3-->
-      <add key="Focus_Mode" value="2"/>
+      
       <!--图像接口模式,人工干预-1,自动运算-2-->
       <add key="Hand_Intervene" value="2"/>
 
@@ -87,54 +55,13 @@
 
 
       
-      <!--距离、矩阵-->
-      <add key="distance" value="30"/>
-      <add key="rag" value="4"/>
-
-      <!--样品台保护-->
-      <add key="X_min" value="0"/>
-      <add key="X_max" value="0.13"/>
-      <add key="Y_min" value="0"/>
-      <add key="Y_max" value="0.13"/>
-      <add key="Z_min" value="0"/>
-      <add key="Z_max" value="0.05"/>
-      <add key="T_min" value="-4"/>
-      <add key="T_max" value="70"/>
-      <add key="R_min" value="-380"/>
-      <add key="R_max" value="380"/>
-      <add key="M_min" value="0"/>
-      <add key="M_max" value="0.012"/>
+     
 
       <add key="RemoteELYPath" value="\\192.168.1.101\Carl Zeiss\SmartFIB\API\Drop\"/>
       <add key="RemoteMLFPath" value="\\192.168.1.101\Carl Zeiss\SmartSEM\User\Service\"/>
 
 
-      <!--add by sun 2020-12-15 增加不同样品扫描速度参数,每大类样品3种扫描速度-->
-      <!--0大类样品 正常情况下默认扫描速度-->
-      <add key="ScanSpeedNormal_0" value="CMD_SCANRATE4"/>
-      <!--对焦拍照扫描速度-->
-      <add key="ScanSpeedFocus_0" value="CMD_SCANRATE5"/>
-      <!--高倍拍照扫描速度-->
-      <add key="ScanSpeedHigh_0" value="CMD_SCANRATE7"/>
-      <!--1大类样品 正常情况下默认扫描速度-->
-      <add key="ScanSpeedNormal_1" value="CMD_SCANRATE4"/>
-      <!--对焦拍照扫描速度-->
-      <add key="ScanSpeedFocus_1" value="CMD_SCANRATE5"/>
-      <!--高倍拍照扫描速度-->
-      <add key="ScanSpeedHigh_1" value="CMD_SCANRATE7"/>
-      <!--2大类样品 正常情况下默认扫描速度-->
-      <add key="ScanSpeedNormal_2" value="CMD_SCANRATE4"/>
-      <!--对焦拍照扫描速度-->
-      <add key="ScanSpeedFocus_2" value="CMD_SCANRATE5"/>
-      <!--高倍拍照扫描速度-->
-      <add key="ScanSpeedHigh_2" value="CMD_SCANRATE7"/>
-      <!--3大类样品 正常情况下默认扫描速度-->
-      <add key="ScanSpeedNormal_3" value="CMD_SCANRATE4"/>
-      <!--对焦拍照扫描速度-->
-      <add key="ScanSpeedFocus_3" value="CMD_SCANRATE5"/>
-      <!--高倍拍照扫描速度-->
-      <add key="ScanSpeedHigh_3" value="CMD_SCANRATE7"/>
-      <!--add by sun 2020-12-15 增加不同样品扫描速度参数,每大类样品3种扫描速度 end-->
+     
       
       <!--add by sun 2020-12-17 增加调试时是否切割开关-->
       <add key="IsCutingForDebug" value="true"/>
@@ -145,91 +72,9 @@
       <!--add by zjx 2020-12-18 为了测试只做能谱部分-->
       
       
-      <!--add by zjx 2020-12-20 初始化窗体中里样品类型的初始值-->
-      <!--add by zjx 2020-12-20 样品类型的厂商参数-->
-      <add key="VendorType0" value="Ocean-BOE"/>
-      <add key="VendorType1" value="Ocean-BOE"/>
-      <add key="VendorType2" value="Ocean-BOE"/>
-      <add key="VendorType3" value="Noah-BOE"/>
-      <!--add by zjx 2020-12-20 样品类型的厂商参数 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的校正角度-->
-      <add key="CorrectionType0" value="截面观测"/>
-      <add key="CorrectionType1" value="截面观测"/>
-      <add key="CorrectionType2" value="截面观测"/>
-      <add key="CorrectionType3" value="截面观测"/>
-      <!--add by zjx 2020-12-20 样品类型的校正角度 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的拉直操作放大倍数-->
-      <add key="StraightenTimesType0" value="1500"/>
-      <add key="StraightenTimesType1" value="300"/>
-      <add key="StraightenTimesType2" value="200"/>
-      <add key="StraightenTimesType3" value="500"/>
-      <!--add by zjx 2020-12-20 样品类型的拉直操作放大倍数 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的定位电压-->
-      <add key="PositioningVoltageeType0" value="2000"/>
-      <add key="PositioningVoltageeType1" value="2000"/>
-      <add key="PositioningVoltageeType2" value="2000"/>
-      <add key="PositioningVoltageeType3" value="5000"/>
-      <!--add by zjx 2020-12-20 样品类型的定位电压 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的定位放大倍数-->
-      <add key="PositioningTimesType0" value="1500"/>
-      <add key="PositioningTimesType1" value="300"/>
-      <add key="PositioningTimesType2" value="200"/>
-      <add key="PositioningTimesType3" value="500"/>
-      <!--add by zjx 2020-12-20 样品类型的定位放大倍数 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的拍照电压-->
-      <add key="PhotoVoltageeType0" value="2000"/>
-      <add key="PhotoVoltageeType1" value="2000"/>
-      <add key="PhotoVoltageeType2" value="2000"/>
-      <add key="PhotoVoltageeType3" value="5000"/>
-      <!--add by zjx 2020-12-20 样品类型的拍照电压 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的拍照放大倍数-->
-      <add key="PhotoTimesType0" value="2000"/>
-      <add key="PhotoTimesType1" value="2000"/>
-      <add key="PhotoTimesType2" value="2000"/>
-      <add key="PhotoTimesType3" value="5000"/>
-      <!--add by zjx 2020-12-20 样品类型的拍照放大倍数 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的ScanRotate修正参数-->
-      <add key="ScanRotateType0" value="1"/>
-      <add key="ScanRotateType1" value="1"/>
-      <add key="ScanRotateType2" value="1"/>
-      <add key="ScanRotateType3" value="1"/>
-      <!--add by zjx 2020-12-20 样品类型的ScanRotate修正参数 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的Y轴方向PixelSize修正值-->
-      <add key="PixelSizeType0" value="1.236"/>
-      <add key="PixelSizeType1" value="1.236"/>
-      <add key="PixelSizeType2" value="1.236"/>
-      <add key="PixelSizeType3" value="1.236"/>
-      <!--add by zjx 2020-12-20 样品类型的Y轴方向PixelSize修正值 end-->
-
-      <!--add by zjx 2020-12-20 样品类型的能谱Z轴移动位置-->
-      <add key="SEMAxis_ZType0" value="37.241"/>
-      <add key="SEMAxis_ZType1" value="37.241"/>
-      <add key="SEMAxis_ZType2" value="37.241"/>
-      <add key="SEMAxis_ZType3" value="37.241"/>
-      <!--add by zjx 2020-12-20 样品类型的能谱Z轴移动位置 end-->
 
-      <!--add by zjx 2020-12-20 样品类型的能谱电压值-->
-      <add key="SEMVoltageeType0" value="7000"/>
-      <add key="SEMVoltageeType1" value="7000"/>
-      <add key="SEMVoltageeType2" value="7000"/>
-      <add key="SEMVoltageeType3" value="7000"/>
-      <!--add by zjx 2020-12-20 样品类型的能谱电压值-->
 
-      <!--add by zjx 2020-12-20 样品类型的能谱电流值-->
-      <add key="SEMCurrentType0" value="0.5"/>
-      <add key="SEMCurrentType1" value="0.5"/>
-      <add key="SEMCurrentType2" value="0.5"/>
-      <add key="SEMCurrentType3" value="0.5"/>
-      <!--add by zjx 2020-12-20 样品类型的能谱电流值 end-->
-      <!--add by zjx 2020-12-20 初始化窗体中里样品类型的初始值 end-->
+     
     </appSettings>
   <runtime>
     <assemblyBinding xmlns=" urn:schemas-microsoft-com:asm.v1">

+ 36 - 287
HOZProject/FormHOZMain.cs

@@ -136,6 +136,7 @@ namespace HOZProject
             m_BackgroundWorker.ProgressChanged += new ProgressChangedEventHandler(UpdateProgress);
             m_BackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompletedWork);
 
+            uControl_Init = new UControl_Init(this);
             //LogManager.InitManulLog();
         }
         #endregion
@@ -147,89 +148,16 @@ 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"]);
-
-
-
-                //Z轴移动距离
-                m_MeasureFile.MParam.ZDistance= Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"]);
-
-                //add by sun 2020-12-15 增加不同样品扫描速度参数
-                m_MeasureFile.MParam.ScanSpeedNormal = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedNormal_" + m_MeasureFile.MParam.SampleName]);
-                m_MeasureFile.MParam.ScanSpeedFocus = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedFocus_" + m_MeasureFile.MParam.SampleName]);
-                m_MeasureFile.MParam.ScanSpeedHigh = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedHigh_" + m_MeasureFile.MParam.SampleName]);
-                //log.Info("==============="+ ConfigurationManager.AppSettings["ScanSpeedNormal_3"] + "========="+ m_MeasureFile.MParam.SampleName, true);
-                //add by sun 2020-12-15 增加不同样品扫描速度参数 end
-                //add by sun 2020-12-17 增加调试时是否切割开关
-                m_MeasureFile.MParam.IsCutingForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsCutingForDebug"]);
-                //add by sun 2020-12-17 增加调试时是否切割开关 end
-
-                // add by zjx 2020-12-18 为了测试只做能谱部分
-                m_MeasureFile.MParam.IsonlyEDSForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsonlyEDSForDebug"]);
-                // add by zjx 2020-12-18 为了测试只做能谱部分 end
-
-
-
                 m_Ms = new Measure(ConfigurationManager.AppSettings["WebServerIP"].ToString(),
                      ConfigurationManager.AppSettings["WebServerPort"].ToString(),
                      ConfigurationManager.AppSettings["WebServerUrl"].ToString());
 
-                m_Ms.X_Min = Convert.ToSingle(ConfigurationManager.AppSettings["X_Min"]);
-                m_Ms.X_Max = Convert.ToSingle(ConfigurationManager.AppSettings["X_Max"]);
-                m_Ms.Y_Min = Convert.ToSingle(ConfigurationManager.AppSettings["Y_Min"]);
-                m_Ms.Y_Max = Convert.ToSingle(ConfigurationManager.AppSettings["Y_Max"]);
-                m_Ms.Z_Min = Convert.ToSingle(ConfigurationManager.AppSettings["Z_Min"]);
-                m_Ms.Z_Max = Convert.ToSingle(ConfigurationManager.AppSettings["Z_Max"]);
-                m_Ms.T_Min = Convert.ToSingle(ConfigurationManager.AppSettings["T_Min"]);
-                m_Ms.T_Max = Convert.ToSingle(ConfigurationManager.AppSettings["T_Max"]);
-                m_Ms.R_Min = Convert.ToSingle(ConfigurationManager.AppSettings["R_Min"]);
-                m_Ms.R_Max = Convert.ToSingle(ConfigurationManager.AppSettings["R_Max"]);
-                m_Ms.M_Min = Convert.ToSingle(ConfigurationManager.AppSettings["M_Min"]);
-                m_Ms.M_Max = Convert.ToSingle(ConfigurationManager.AppSettings["M_Max"]);
-
-                //人工干预
-                m_Ms.hand_intervene = Convert.ToInt32(ConfigurationManager.AppSettings["Hand_Intervene"]);
+        
 
                 //SmartSEM远程路径
-                m_Ms.RemoteELYPath = ConfigurationManager.AppSettings["RemoteELYPath"];
-                m_Ms.RemoteMLFPath = ConfigurationManager.AppSettings["RemoteMLFPath"];
+                m_Ms.RemoteELYPath =m_MeasureFile.MParam.RemoteELYPath;
+                m_Ms.RemoteMLFPath = m_MeasureFile.MParam.RemoteMLFPath;
+
                 m_Ms.InitMeasure(m_MeasureFile);
                 //注册事件
                 m_Ms.SendThreadStatus += new ThreadStatusHandler(displayMessage);
@@ -290,8 +218,8 @@ namespace HOZProject
         {
             try
             {
-               // DogDecrypting.decrypting(100);//参数为许可号
-                                              //加载控件的点击事件
+                // DogDecrypting.decrypting(100);//参数为许可号
+                //加载控件的点击事件
                 this.Click += new EventHandler(FormHOZMain_Click);
                 plFill.Click += new EventHandler(FormHOZMain_Click);
                 plTop.Click += new EventHandler(FormHOZMain_Click);
@@ -302,14 +230,15 @@ namespace HOZProject
                 //加载窗口移动事件
                 this.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
                 this.plTop.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-                //新建
-                NewCreate();
-                //实例初始化窗体对象
-                if (uControl_Init == null)
-                {
-                    uControl_Init = new UControl_Init(this);
-                    uControl_Init.ReloadConfig();
-                }
+            //新建
+                m_MeasureFile = new MeasureFile();
+                GetParamFromConfigFile();//读到参数对象中    
+           
+                uControl_Init.DisplayInitialParam();//显示到界面上
+                
+          
+
+
                 logwin = new OTSMeasureOutputNlog();
                 logwin.Show();
                 logwin.Height = this.Height;
@@ -321,27 +250,23 @@ namespace HOZProject
                         t => "control" == t.Name
                     )
                 );
-                if (lr != null)
-                {
-
-
-                }
+            
 
 
 
 
                 log = NLog.LogManager.GetCurrentClassLogger();
 
-                ConfigurationParameter();
+              
 
                 this.Left = this.Location.X + logwin.Width / 2;
-            }
+        }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message, "错误:", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 this.Close();
-            }
-        }
+    }
+}
             #endregion
 
             #region 创建切孔列表信息
@@ -536,29 +461,16 @@ namespace HOZProject
         #region 新建、保存、打开、初始化、导入配置、查看日志
         private void pbNew_Click(object sender, EventArgs e)
         {
-            NewCreate();
+            GetParamFromConfigFile();
         }
 
-        private void NewCreate()
+        private void GetParamFromConfigFile()
         {
-            m_MeasureFile = new MeasureFile();
-            if (!m_MeasureFile.New())
-            {
-                return;
-            }
-            else
-            {
-                //清空内容容器中的控件
-                ClearPanelControls();
-            }
-            //实例初始化窗体对象
-            if (uControl_Init == null)
-            {
-                uControl_Init = new UControl_Init(this);
-                uControl_Init.ReloadConfig();
-            }
+          
+
+      
             
-            m_MeasureFile.MParam = uControl_Init.GetMeasureParam();
+            m_MeasureFile.MParam.GetMeasureParamFromConfigration();
         }
 
         private void pbSave_Click(object sender, EventArgs e)
@@ -568,33 +480,10 @@ namespace HOZProject
         }
         public void Saveclick()
         {
-            if (m_MeasureFile == null)
-            {
-                MessageBox.Show("请新建一个测量文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
-            }
-            else
-            {
-                //保存测量文件
-                if (m_MeasureFile.SaveAs())
-                {
-                    //获取测量文件所在路径
-                    //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);
-                    //}
-                    //将初始化中的参数,配置到测量参数中
-                    m_MeasureFile.MParam = uControl_Init.GetMeasureParamInfo();
-                    //设置已保存状态
-                    IsSave = true;
-                }
-            }
+        
+               
+                
+          
         }
 
         private void pbOpen_Click(object sender, EventArgs e)
@@ -632,7 +521,7 @@ namespace HOZProject
             if (uControl_Init == null)
             {
                 uControl_Init = new UControl_Init(this);
-                uControl_Init.ReloadConfig();
+                //uControl_Init.ReloadConfig();
             }
             if (m_FormInit == null)
             {
@@ -649,33 +538,13 @@ namespace HOZProject
                 
             }
             m_FormInit.ShowDialog();
-            ConfigurationParameter();
+            //ConfigurationParameter();
             m_FormInit.Left = this.Left;
         }
 
         private void pictureBox1_Click(object sender, EventArgs e)
         {
-            //if (UControl_ZoomIn == null)
-            //{
-            //    UControl_ZoomIn = new UControl_ZoomIn(this);
-            //    UControl_ZoomIn.ReloadConfig();
-            //}
-            //if (m_FormZoomIn == null)
-            //{
-            //    m_FormZoomIn = new FormZoomIn();
-            //}
-            //m_FormZoomIn.StartPosition = FormStartPosition.CenterScreen;
-            //m_FormZoomIn.FormBorderStyle = FormBorderStyle.None;
-            //m_FormZoomIn.Width = UControl_ZoomIn.Width + 4;
-            //m_FormZoomIn.Height = UControl_ZoomIn.Height + 4;
-            //if (m_FormZoomIn.Controls.Count == 0)
-            //{
-            //    UControl_ZoomIn.Location = new Point(2, 2);
-
-            //    m_FormZoomIn.Controls.Add(UControl_ZoomIn);
-
-            //}
-            //m_FormZoomIn.ShowDialog();
+           
         }
 
         private void pbImportTemplateFile_Click(object sender, EventArgs e)
@@ -718,29 +587,7 @@ namespace HOZProject
 
         private void pbLog_Click(object sender, EventArgs e)
         {
-            //m_FormLog = new Form();
-            //m_FormLog.StartPosition = FormStartPosition.CenterScreen;
-            //if (ucLog == null)
-            //{
-            //    ucLog = new UControl_Log();
-            //}
-            //m_FormLog.FormBorderStyle = FormBorderStyle.None;
-            //m_FormLog.Width = ucLog.Width;
-            //m_FormLog.Height = ucLog.Height;
-            //ucLog.Name = "UControl_Log";
-            ////获取日志信息
-            //if (listmsg.Items.Count>0)
-            //{
-            //    string[] strLog = new string[listmsg.Items.Count];
-            //    for (int i = 0; i < listmsg.Items.Count; i++)
-            //    {
-            //        //赋值给数组
-            //        strLog[i] = listmsg.Items[i].ToString();
-            //    }
-            //    ucLog.ShowProcessLogInfo(strLog);
-            //}
-            //m_FormLog.Controls.Add(ucLog);
-            //m_FormLog.ShowDialog();
+            
         }
 
         //显示日志
@@ -1073,105 +920,7 @@ namespace HOZProject
             
         }
 
-        private void ConfigurationParameter()
-        {
-            #region 初始化参数的默认值
-                // add by zjx 2020-12-20 厂商参数
-                //m_MeasureFile.MParam.VendorType0 = Convert.ToString(ConfigurationManager.AppSettings["VendorType0"]);
-                //m_MeasureFile.MParam.VendorType1 = Convert.ToString(ConfigurationManager.AppSettings["VendorType1"]);
-                //m_MeasureFile.MParam.VendorType2 = Convert.ToString(ConfigurationManager.AppSettings["VendorType2"]);
-                //m_MeasureFile.MParam.VendorType3 = Convert.ToString(ConfigurationManager.AppSettings["VendorType3"]);
-                // add by zjx 2020-12-20 厂商参数 end 
-                // add by zjx 2020-12-21 校正角度
-                m_MeasureFile.MParam.CorrectionType0 = Convert.ToString(ConfigurationManager.AppSettings["CorrectionType0"]);
-                m_MeasureFile.MParam.CorrectionType1 = Convert.ToString(ConfigurationManager.AppSettings["CorrectionType1"]);
-                m_MeasureFile.MParam.CorrectionType2 = Convert.ToString(ConfigurationManager.AppSettings["CorrectionType2"]);
-                m_MeasureFile.MParam.CorrectionType3 = Convert.ToString(ConfigurationManager.AppSettings["CorrectionType3"]);
-            m_MeasureFile.MParam.CorrectionType4 = Convert.ToString(ConfigurationManager.AppSettings["CorrectionType4"]);
-            m_MeasureFile.MParam.CorrectionType5 = Convert.ToString(ConfigurationManager.AppSettings["CorrectionType5"]);
-            // add by zjx 2020-12-21 校正角度 end 
-            // add by zjx 2020-12-21 拉直操作放大倍数
-            m_MeasureFile.MParam.StraightenTimesType0 = Convert.ToString(ConfigurationManager.AppSettings["StraightenTimesType0"]);
-                m_MeasureFile.MParam.StraightenTimesType1 = Convert.ToString(ConfigurationManager.AppSettings["StraightenTimesType1"]);
-                m_MeasureFile.MParam.StraightenTimesType2 = Convert.ToString(ConfigurationManager.AppSettings["StraightenTimesType2"]);
-                m_MeasureFile.MParam.StraightenTimesType3 = Convert.ToString(ConfigurationManager.AppSettings["StraightenTimesType3"]);
-            m_MeasureFile.MParam.StraightenTimesType4 = Convert.ToString(ConfigurationManager.AppSettings["StraightenTimesType4"]);
-            m_MeasureFile.MParam.StraightenTimesType5 = Convert.ToString(ConfigurationManager.AppSettings["StraightenTimesType5"]);
-            // add by zjx 2020-12-21 拉直操作放大倍数 end
-            // add by zjx 2020-12-21 定位电压
-            m_MeasureFile.MParam.PositioningVoltageeType0 = Convert.ToString(ConfigurationManager.AppSettings["PositioningVoltageeType0"]);
-                m_MeasureFile.MParam.PositioningVoltageeType1 = Convert.ToString(ConfigurationManager.AppSettings["PositioningVoltageeType1"]);
-                m_MeasureFile.MParam.PositioningVoltageeType2 = Convert.ToString(ConfigurationManager.AppSettings["PositioningVoltageeType2"]);
-                m_MeasureFile.MParam.PositioningVoltageeType3 = Convert.ToString(ConfigurationManager.AppSettings["PositioningVoltageeType3"]);
-            m_MeasureFile.MParam.PositioningVoltageeType4 = Convert.ToString(ConfigurationManager.AppSettings["PositioningVoltageeType4"]);
-            m_MeasureFile.MParam.PositioningVoltageeType5 = Convert.ToString(ConfigurationManager.AppSettings["PositioningVoltageeType5"]);
-            // add by zjx 2020-12-21 定位电压 end
-            // add by zjx 2020-12-21 定位放大倍数
-            m_MeasureFile.MParam.PositioningTimesType0 = Convert.ToString(ConfigurationManager.AppSettings["PositioningTimesType0"]);
-                m_MeasureFile.MParam.PositioningTimesType1 = Convert.ToString(ConfigurationManager.AppSettings["PositioningTimesType1"]);
-                m_MeasureFile.MParam.PositioningTimesType2 = Convert.ToString(ConfigurationManager.AppSettings["PositioningTimesType2"]);
-                m_MeasureFile.MParam.PositioningTimesType3 = Convert.ToString(ConfigurationManager.AppSettings["PositioningTimesType3"]);
-            m_MeasureFile.MParam.PositioningTimesType4 = Convert.ToString(ConfigurationManager.AppSettings["PositioningTimesType4"]);
-            m_MeasureFile.MParam.PositioningTimesType5 = Convert.ToString(ConfigurationManager.AppSettings["PositioningTimesType5"]);
-            // add by zjx 2020-12-21 定位放大倍数 end
-            // add by zjx 2020-12-21 拍照电压
-            m_MeasureFile.MParam.PhotoVoltageeType0 = Convert.ToString(ConfigurationManager.AppSettings["PhotoVoltageeType0"]);
-                m_MeasureFile.MParam.PhotoVoltageeType1 = Convert.ToString(ConfigurationManager.AppSettings["PhotoVoltageeType1"]);
-                m_MeasureFile.MParam.PhotoVoltageeType2 = Convert.ToString(ConfigurationManager.AppSettings["PhotoVoltageeType2"]);
-                m_MeasureFile.MParam.PhotoVoltageeType3 = Convert.ToString(ConfigurationManager.AppSettings["PhotoVoltageeType3"]);
-            m_MeasureFile.MParam.PhotoVoltageeType4 = Convert.ToString(ConfigurationManager.AppSettings["PhotoVoltageeType4"]);
-            m_MeasureFile.MParam.PhotoVoltageeType5 = Convert.ToString(ConfigurationManager.AppSettings["PhotoVoltageeType5"]);
-            // add by zjx 2020-12-21 拍照电压 end
-            // add by zjx 2020-12-21 拍照放大倍数
-            m_MeasureFile.MParam.PhotoTimesType0 = Convert.ToString(ConfigurationManager.AppSettings["PhotoTimesType0"]);
-                m_MeasureFile.MParam.PhotoTimesType1 = Convert.ToString(ConfigurationManager.AppSettings["PhotoTimesType1"]);
-                m_MeasureFile.MParam.PhotoTimesType2 = Convert.ToString(ConfigurationManager.AppSettings["PhotoTimesType2"]);
-                m_MeasureFile.MParam.PhotoTimesType3 = Convert.ToString(ConfigurationManager.AppSettings["PhotoTimesType3"]);
-            m_MeasureFile.MParam.PhotoTimesType4 = Convert.ToString(ConfigurationManager.AppSettings["PhotoTimesType4"]);
-            m_MeasureFile.MParam.PhotoTimesType5 = Convert.ToString(ConfigurationManager.AppSettings["PhotoTimesType5"]);
-            // add by zjx 2020-12-21 拍照放大倍数 end
-            // add by zjx 2020-12-21 ScanRotate修正参数
-            m_MeasureFile.MParam.ScanRotateType0 = Convert.ToString(ConfigurationManager.AppSettings["ScanRotateType0"]);
-                m_MeasureFile.MParam.ScanRotateType1 = Convert.ToString(ConfigurationManager.AppSettings["ScanRotateType1"]);
-                m_MeasureFile.MParam.ScanRotateType2 = Convert.ToString(ConfigurationManager.AppSettings["ScanRotateType2"]);
-                m_MeasureFile.MParam.ScanRotateType3 = Convert.ToString(ConfigurationManager.AppSettings["ScanRotateType3"]);
-            m_MeasureFile.MParam.ScanRotateType4 = Convert.ToString(ConfigurationManager.AppSettings["ScanRotateType4"]);
-            m_MeasureFile.MParam.ScanRotateType5 = Convert.ToString(ConfigurationManager.AppSettings["ScanRotateType5"]);
-            // add by zjx 2020-12-21 ScanRotate修正参数 end
-            // add by zjx 2020-12-21 Y轴方向PixelSize修正值
-            m_MeasureFile.MParam.PixelSizeType0 = Convert.ToString(ConfigurationManager.AppSettings["PixelSizeType0"]);
-                m_MeasureFile.MParam.PixelSizeType1 = Convert.ToString(ConfigurationManager.AppSettings["PixelSizeType1"]);
-                m_MeasureFile.MParam.PixelSizeType2 = Convert.ToString(ConfigurationManager.AppSettings["PixelSizeType2"]);
-                m_MeasureFile.MParam.PixelSizeType3 = Convert.ToString(ConfigurationManager.AppSettings["PixelSizeType3"]);
-            m_MeasureFile.MParam.PixelSizeType4 = Convert.ToString(ConfigurationManager.AppSettings["PixelSizeType4"]);
-            m_MeasureFile.MParam.PixelSizeType5 = Convert.ToString(ConfigurationManager.AppSettings["PixelSizeType5"]);
-            // add by zjx 2020-12-21 Y轴方向PixelSize修正值 end
-            // add by zjx 2020-12-21 能谱Z轴移动位置
-            m_MeasureFile.MParam.SEMAxis_ZType0 = Convert.ToString(ConfigurationManager.AppSettings["SEMAxis_ZType0"]);
-                m_MeasureFile.MParam.SEMAxis_ZType1 = Convert.ToString(ConfigurationManager.AppSettings["SEMAxis_ZType1"]);
-                m_MeasureFile.MParam.SEMAxis_ZType2 = Convert.ToString(ConfigurationManager.AppSettings["SEMAxis_ZType2"]);
-                m_MeasureFile.MParam.SEMAxis_ZType3 = Convert.ToString(ConfigurationManager.AppSettings["SEMAxis_ZType3"]);
-            m_MeasureFile.MParam.SEMAxis_ZType4 = Convert.ToString(ConfigurationManager.AppSettings["SEMAxis_ZType4"]);
-            m_MeasureFile.MParam.SEMAxis_ZType5 = Convert.ToString(ConfigurationManager.AppSettings["SEMAxis_ZType5"]);
-            // add by zjx 2020-12-21 能谱Z轴移动位置 end
-            // add by zjx 2020-12-21 能谱电压值
-            m_MeasureFile.MParam.SEMVoltageeType0 = Convert.ToString(ConfigurationManager.AppSettings["SEMVoltageeType0"]);
-                m_MeasureFile.MParam.SEMVoltageeType1 = Convert.ToString(ConfigurationManager.AppSettings["SEMVoltageeType1"]);
-                m_MeasureFile.MParam.SEMVoltageeType2 = Convert.ToString(ConfigurationManager.AppSettings["SEMVoltageeType2"]);
-                m_MeasureFile.MParam.SEMVoltageeType3 = Convert.ToString(ConfigurationManager.AppSettings["SEMVoltageeType3"]);
-            m_MeasureFile.MParam.SEMVoltageeType4 = Convert.ToString(ConfigurationManager.AppSettings["SEMVoltageeType4"]);
-            m_MeasureFile.MParam.SEMVoltageeType5 = Convert.ToString(ConfigurationManager.AppSettings["SEMVoltageeType5"]);
-            // add by zjx 2020-12-21 能谱电压值 end
-            // add by zjx 2020-12-21 能谱电流值
-            m_MeasureFile.MParam.SEMCurrentType0 = Convert.ToString(ConfigurationManager.AppSettings["SEMCurrentType0"]);
-                m_MeasureFile.MParam.SEMCurrentType1 = Convert.ToString(ConfigurationManager.AppSettings["SEMCurrentType1"]);
-                m_MeasureFile.MParam.SEMCurrentType2 = Convert.ToString(ConfigurationManager.AppSettings["SEMCurrentType2"]);
-                m_MeasureFile.MParam.SEMCurrentType3 = Convert.ToString(ConfigurationManager.AppSettings["SEMCurrentType3"]);
-            m_MeasureFile.MParam.SEMCurrentType4 = Convert.ToString(ConfigurationManager.AppSettings["SEMCurrentType4"]);
-            m_MeasureFile.MParam.SEMCurrentType5 = Convert.ToString(ConfigurationManager.AppSettings["SEMCurrentType5"]);
-            // add by zjx 2020-12-21 能谱电流值 end
-            #endregion
-        }
+       
 
    
 

+ 17 - 17
HOZProject/FormUnitControl.cs

@@ -688,11 +688,11 @@ namespace HOZProject
             mf.ListCutHole.Add(ch);
 
             MeasureParam md = new MeasureParam();
-            md.SampleName = "aaaaaa";
+            md.SampleType = "aaaaaa";
             md.PT = true;
             md.PTTemp = "bbbbb";
             md.FIBTemp = "cccc";
-            md.FocusMode = 2;
+            //md.FocusMode = 2;
 
             mf.MParam = md;
 
@@ -1413,21 +1413,21 @@ namespace HOZProject
             cfm.PT = chkWPT.Checked;
             cfm.PTTemp = txtWPTF.Text;
             cfm.FIBTemp = txtWFIBF.Text;
-            cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
+            cfm.Straighten_Magnification = Convert.ToSingle(cbbWLZ.Text);
             cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
-            cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
+            cfm.Voltage = Convert.ToSingle(cbbWQGD.Text);
             cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
             cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
-            if(cbbWXZ.SelectedIndex==0)
-            {
-                cfm.Correction_Angle = 36;
-            }
-            else
-            {
-                cfm.Correction_Angle = 54;
-            }
+            //if(cbbWXZ.SelectedIndex==0)
+            //{
+            //    cfm.Correction_Angle = 36;
+            //}
+            //else
+            //{
+            //    cfm.Correction_Angle = 54;
+            //}
             
-            cfm.SampleName = cbbWYP.Text;
+            cfm.SampleType = cbbWYP.Text;
             cfm.Firm = cbbWCS.Text;
 
             ConfigFile cf = new ConfigFile(cfm);
@@ -1474,13 +1474,13 @@ namespace HOZProject
             chkRPT.Checked = cfm.PT;
             txtRPTF.Text = cfm.PTTemp;
             txtRFIBF.Text = cfm.FIBTemp;
-            txtRLZ.Text = cfm.Stretch_Magnification.ToString();
+            txtRLZ.Text = cfm.Straighten_Magnification.ToString();
             txtRQGF.Text = cfm.Location_Magnification.ToString();
-            txtRQGD.Text = cfm.Location_Voltage.ToString();
+            txtRQGD.Text = cfm.Voltage.ToString();
             txtRPZF.Text = cfm.Photograph_Magnification.ToString();
             txtRPZD.Text = cfm.Photograph_Voltage.ToString();
-            txtRXZ.Text = cfm.Correction_Angle.ToString();
-            txtRYP.Text = cfm.SampleName;
+            //txtRXZ.Text = cfm.Correction_Angle.ToString();
+            txtRYP.Text = cfm.SampleType;
             txtRCS.Text = cfm.Firm;
 
         }

+ 2 - 5
HOZProject/Program.cs

@@ -16,17 +16,14 @@ namespace HOZProject
         {
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            //Application.Run(new FormUCMain());
-            //Application.Run(new FormHOZMain());
-            //Application.Run(new FormMeasureTest());
-            //Application.Run(new FormUnitControl());
+       
             bool createdNew;//返回是否赋予了使用线程的互斥体初始所属权 
             System.Threading.Mutex instance = new System.Threading.Mutex(true, "MutexName", out createdNew); //同步基元变量 
             if (createdNew) //赋予了线程初始所属权,也就是首次使用互斥体 
             {
                 FormHOZMain mainForm = new FormHOZMain();
                 Application.Run(mainForm);
-                //Application.Run(new FormUnitControl());
+               
                 instance.ReleaseMutex();
             }
             else

+ 118 - 405
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -31,20 +31,14 @@
             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();
             this.chkManul = new System.Windows.Forms.CheckBox();
             this.label6 = new System.Windows.Forms.Label();
-            this.cbbWPZD = new System.Windows.Forms.ComboBox();
-            this.cbbWPZF = new System.Windows.Forms.ComboBox();
-            this.cbbWQGD = new System.Windows.Forms.ComboBox();
-            this.cbbWQGF = new System.Windows.Forms.ComboBox();
-            this.cbbWLZ = new System.Windows.Forms.ComboBox();
-            this.cbbWXZ = new System.Windows.Forms.ComboBox();
             this.cbbWCS = new System.Windows.Forms.ComboBox();
             this.cbbWYP = new System.Windows.Forms.ComboBox();
-            this.label58 = new System.Windows.Forms.Label();
             this.label50 = new System.Windows.Forms.Label();
             this.label54 = new System.Windows.Forms.Label();
             this.label46 = new System.Windows.Forms.Label();
@@ -57,27 +51,11 @@
             this.label61 = new System.Windows.Forms.Label();
             this.chkWPT = new System.Windows.Forms.CheckBox();
             this.txtWFIBF = new System.Windows.Forms.TextBox();
-            this.label2 = new System.Windows.Forms.Label();
             this.chkWqxkc = new System.Windows.Forms.CheckBox();
-            this.label3 = new System.Windows.Forms.Label();
-            this.txtYPSCur = new System.Windows.Forms.TextBox();
             this.panel2 = new System.Windows.Forms.Panel();
             this.btnSaveDefalutPara = new System.Windows.Forms.Button();
             this.btnEditConfig = new System.Windows.Forms.Button();
-            this.tbGear1to2_Xdeviation = new System.Windows.Forms.TextBox();
-            this.tbGear1to2_Ydeviation = new System.Windows.Forms.TextBox();
-            this.label17 = new System.Windows.Forms.Label();
-            this.txtScanRotCur = new System.Windows.Forms.TextBox();
             this.chkEDS = new System.Windows.Forms.CheckBox();
-            this.txtEDSZ = new System.Windows.Forms.TextBox();
-            this.label18 = new System.Windows.Forms.Label();
-            this.label19 = new System.Windows.Forms.Label();
-            this.label20 = new System.Windows.Forms.Label();
-            this.label21 = new System.Windows.Forms.Label();
-            this.label22 = new System.Windows.Forms.Label();
-            this.label23 = new System.Windows.Forms.Label();
-            this.cbbEDSV = new System.Windows.Forms.ComboBox();
-            this.cbbEDSA = new System.Windows.Forms.ComboBox();
             this.cboXrayMode = new System.Windows.Forms.ComboBox();
             this.label28 = new System.Windows.Forms.Label();
             this.label29 = new System.Windows.Forms.Label();
@@ -88,10 +66,16 @@
             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.label2 = new System.Windows.Forms.Label();
+            this.txtMag1 = new System.Windows.Forms.TextBox();
+            this.txtMag2 = new System.Windows.Forms.TextBox();
+            this.txtMag3 = new System.Windows.Forms.TextBox();
+            this.txtMag4 = new System.Windows.Forms.TextBox();
+            this.txtVot = new System.Windows.Forms.TextBox();
+            this.txtIprobe = new System.Windows.Forms.TextBox();
             this.panel1.SuspendLayout();
-            this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
+            this.panel2.SuspendLayout();
             this.SuspendLayout();
             // 
             // label1
@@ -117,6 +101,22 @@
             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);
@@ -151,7 +151,7 @@
             this.chkManul.AutoSize = true;
             this.chkManul.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.chkManul.ForeColor = System.Drawing.Color.Black;
-            this.chkManul.Location = new System.Drawing.Point(638, 122);
+            this.chkManul.Location = new System.Drawing.Point(647, 129);
             this.chkManul.Margin = new System.Windows.Forms.Padding(2);
             this.chkManul.Name = "chkManul";
             this.chkManul.Size = new System.Drawing.Size(100, 27);
@@ -172,108 +172,6 @@
             this.label6.TabIndex = 17;
             this.label6.Text = "导入分析点";
             // 
-            // cbbWPZD
-            // 
-            this.cbbWPZD.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbWPZD.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbWPZD.FormattingEnabled = true;
-            this.cbbWPZD.Items.AddRange(new object[] {
-            "1000",
-            "1500",
-            "2000",
-            "2500",
-            "3000"});
-            this.cbbWPZD.Location = new System.Drawing.Point(174, 260);
-            this.cbbWPZD.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbWPZD.Name = "cbbWPZD";
-            this.cbbWPZD.Size = new System.Drawing.Size(155, 25);
-            this.cbbWPZD.TabIndex = 99;
-            this.cbbWPZD.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWPZD_KeyPress);
-            // 
-            // cbbWPZF
-            // 
-            this.cbbWPZF.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbWPZF.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbWPZF.FormattingEnabled = true;
-            this.cbbWPZF.Items.AddRange(new object[] {
-            "600",
-            "1000",
-            "2000",
-            "10000"});
-            this.cbbWPZF.Location = new System.Drawing.Point(502, 260);
-            this.cbbWPZF.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbWPZF.Name = "cbbWPZF";
-            this.cbbWPZF.Size = new System.Drawing.Size(155, 25);
-            this.cbbWPZF.TabIndex = 98;
-            this.cbbWPZF.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWPZF_KeyPress);
-            // 
-            // cbbWQGD
-            // 
-            this.cbbWQGD.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbWQGD.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbWQGD.FormattingEnabled = true;
-            this.cbbWQGD.Items.AddRange(new object[] {
-            "1000",
-            "1500",
-            "2000",
-            "2500",
-            "3000"});
-            this.cbbWQGD.Location = new System.Drawing.Point(174, 235);
-            this.cbbWQGD.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbWQGD.Name = "cbbWQGD";
-            this.cbbWQGD.Size = new System.Drawing.Size(155, 25);
-            this.cbbWQGD.TabIndex = 97;
-            this.cbbWQGD.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWQGD_KeyPress);
-            // 
-            // cbbWQGF
-            // 
-            this.cbbWQGF.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbWQGF.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbWQGF.FormattingEnabled = true;
-            this.cbbWQGF.Items.AddRange(new object[] {
-            "600",
-            "1000",
-            "2000",
-            "10000"});
-            this.cbbWQGF.Location = new System.Drawing.Point(502, 235);
-            this.cbbWQGF.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbWQGF.Name = "cbbWQGF";
-            this.cbbWQGF.Size = new System.Drawing.Size(155, 25);
-            this.cbbWQGF.TabIndex = 96;
-            this.cbbWQGF.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWQGF_KeyPress);
-            // 
-            // cbbWLZ
-            // 
-            this.cbbWLZ.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbWLZ.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbWLZ.FormattingEnabled = true;
-            this.cbbWLZ.Items.AddRange(new object[] {
-            "600",
-            "1000",
-            "2000",
-            "10000"});
-            this.cbbWLZ.Location = new System.Drawing.Point(502, 210);
-            this.cbbWLZ.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbWLZ.Name = "cbbWLZ";
-            this.cbbWLZ.Size = new System.Drawing.Size(155, 25);
-            this.cbbWLZ.TabIndex = 95;
-            this.cbbWLZ.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWLZ_KeyPress);
-            // 
-            // cbbWXZ
-            // 
-            this.cbbWXZ.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cbbWXZ.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbWXZ.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbWXZ.FormattingEnabled = true;
-            this.cbbWXZ.Items.AddRange(new object[] {
-            "截面观测",
-            "表面观测"});
-            this.cbbWXZ.Location = new System.Drawing.Point(174, 210);
-            this.cbbWXZ.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbWXZ.Name = "cbbWXZ";
-            this.cbbWXZ.Size = new System.Drawing.Size(155, 25);
-            this.cbbWXZ.TabIndex = 94;
-            // 
             // cbbWCS
             // 
             this.cbbWCS.Font = new System.Drawing.Font("宋体", 10F);
@@ -297,18 +195,6 @@
             this.cbbWYP.TabIndex = 92;
             this.cbbWYP.SelectedIndexChanged += new System.EventHandler(this.cbbWYP_SelectedIndexChanged);
             // 
-            // label58
-            // 
-            this.label58.AutoSize = true;
-            this.label58.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label58.ForeColor = System.Drawing.Color.Black;
-            this.label58.Location = new System.Drawing.Point(96, 214);
-            this.label58.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label58.Name = "label58";
-            this.label58.Size = new System.Drawing.Size(69, 20);
-            this.label58.TabIndex = 91;
-            this.label58.Text = "校正角度";
-            // 
             // label50
             // 
             this.label50.AutoSize = true;
@@ -317,21 +203,21 @@
             this.label50.Location = new System.Drawing.Point(80, 264);
             this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label50.Name = "label50";
-            this.label50.Size = new System.Drawing.Size(85, 20);
+            this.label50.Size = new System.Drawing.Size(70, 20);
             this.label50.TabIndex = 90;
-            this.label50.Text = "拍照电压/V";
+            this.label50.Text = "电流/mA";
             // 
             // label54
             // 
             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(404, 262);
+            this.label54.Location = new System.Drawing.Point(18, 390);
             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);
+            this.label54.Size = new System.Drawing.Size(159, 20);
             this.label54.TabIndex = 89;
-            this.label54.Text = "照放大倍数";
+            this.label54.Text = "第一次截面照放大倍数";
             // 
             // label46
             // 
@@ -341,28 +227,28 @@
             this.label46.Location = new System.Drawing.Point(80, 239);
             this.label46.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label46.Name = "label46";
-            this.label46.Size = new System.Drawing.Size(85, 20);
+            this.label46.Size = new System.Drawing.Size(55, 20);
             this.label46.TabIndex = 88;
-            this.label46.Text = "定位电压/V";
+            this.label46.Text = "电压/V";
             // 
             // label42
             // 
             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(406, 237);
+            this.label42.Location = new System.Drawing.Point(18, 362);
             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);
+            this.label42.Size = new System.Drawing.Size(159, 20);
             this.label42.TabIndex = 87;
-            this.label42.Text = "定位放大倍数";
+            this.label42.Text = "找到已切割孔放大倍数";
             // 
             // label38
             // 
             this.label38.AutoSize = true;
             this.label38.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label38.ForeColor = System.Drawing.Color.Black;
-            this.label38.Location = new System.Drawing.Point(394, 214);
+            this.label38.Location = new System.Drawing.Point(48, 334);
             this.label38.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label38.Name = "label38";
             this.label38.Size = new System.Drawing.Size(129, 20);
@@ -436,7 +322,7 @@
             this.chkWPT.AutoSize = true;
             this.chkWPT.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.chkWPT.ForeColor = System.Drawing.Color.Black;
-            this.chkWPT.Location = new System.Drawing.Point(200, 156);
+            this.chkWPT.Location = new System.Drawing.Point(502, 285);
             this.chkWPT.Margin = new System.Windows.Forms.Padding(2);
             this.chkWPT.Name = "chkWPT";
             this.chkWPT.Size = new System.Drawing.Size(86, 27);
@@ -454,18 +340,6 @@
             this.txtWFIBF.Size = new System.Drawing.Size(346, 27);
             this.txtWFIBF.TabIndex = 103;
             // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(13, 289);
-            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(152, 20);
-            this.label2.TabIndex = 113;
-            this.label2.Text = "ScanRotate修正参数";
-            // 
             // chkWqxkc
             // 
             this.chkWqxkc.AutoSize = true;
@@ -479,33 +353,11 @@
             this.chkWqxkc.UseVisualStyleBackColor = true;
             this.chkWqxkc.CheckedChanged += new System.EventHandler(this.chkWqxkc_CheckedChanged);
             // 
-            // label3
-            // 
-            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(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);
-            this.label3.TabIndex = 116;
-            this.label3.Text = "Y轴方向PixelSize修正值";
-            // 
-            // txtYPSCur
-            // 
-            this.txtYPSCur.Location = new System.Drawing.Point(502, 285);
-            this.txtYPSCur.Name = "txtYPSCur";
-            this.txtYPSCur.ReadOnly = true;
-            this.txtYPSCur.Size = new System.Drawing.Size(155, 27);
-            this.txtYPSCur.TabIndex = 117;
-            this.txtYPSCur.TextChanged += new System.EventHandler(this.txtYPSCur_TextChanged);
-            this.txtYPSCur.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtYPSCur_KeyPress);
-            // 
             // panel2
             // 
             this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel2.Controls.Add(this.btnSaveDefalutPara);
-            this.panel2.Location = new System.Drawing.Point(0, 441);
+            this.panel2.Location = new System.Drawing.Point(3, 501);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(769, 49);
             this.panel2.TabIndex = 124;
@@ -515,7 +367,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(271, 2);
+            this.btnSaveDefalutPara.Location = new System.Drawing.Point(293, 2);
             this.btnSaveDefalutPara.Margin = new System.Windows.Forms.Padding(2);
             this.btnSaveDefalutPara.Name = "btnSaveDefalutPara";
             this.btnSaveDefalutPara.Size = new System.Drawing.Size(129, 30);
@@ -538,41 +390,6 @@
             this.btnEditConfig.UseVisualStyleBackColor = true;
             this.btnEditConfig.Click += new System.EventHandler(this.btnEditConfig_Click);
             // 
-            // tbGear1to2_Xdeviation
-            // 
-            this.tbGear1to2_Xdeviation.Location = new System.Drawing.Point(377, 441);
-            this.tbGear1to2_Xdeviation.Name = "tbGear1to2_Xdeviation";
-            this.tbGear1to2_Xdeviation.Size = new System.Drawing.Size(100, 27);
-            this.tbGear1to2_Xdeviation.TabIndex = 10;
-            this.tbGear1to2_Xdeviation.Visible = false;
-            // 
-            // tbGear1to2_Ydeviation
-            // 
-            this.tbGear1to2_Ydeviation.Location = new System.Drawing.Point(627, 441);
-            this.tbGear1to2_Ydeviation.Name = "tbGear1to2_Ydeviation";
-            this.tbGear1to2_Ydeviation.Size = new System.Drawing.Size(100, 27);
-            this.tbGear1to2_Ydeviation.TabIndex = 11;
-            this.tbGear1to2_Ydeviation.Visible = false;
-            // 
-            // label17
-            // 
-            this.label17.AutoSize = true;
-            this.label17.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label17.Location = new System.Drawing.Point(306, 444);
-            this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(72, 23);
-            this.label17.TabIndex = 18;
-            this.label17.Text = "X偏移值";
-            this.label17.Visible = false;
-            // 
-            // txtScanRotCur
-            // 
-            this.txtScanRotCur.Location = new System.Drawing.Point(174, 285);
-            this.txtScanRotCur.Name = "txtScanRotCur";
-            this.txtScanRotCur.ReadOnly = true;
-            this.txtScanRotCur.Size = new System.Drawing.Size(155, 27);
-            this.txtScanRotCur.TabIndex = 136;
-            // 
             // chkEDS
             // 
             this.chkEDS.AutoSize = true;
@@ -586,122 +403,6 @@
             this.chkEDS.Text = "能谱测量";
             this.chkEDS.UseVisualStyleBackColor = true;
             // 
-            // txtEDSZ
-            // 
-            this.txtEDSZ.Location = new System.Drawing.Point(174, 312);
-            this.txtEDSZ.Name = "txtEDSZ";
-            this.txtEDSZ.ReadOnly = true;
-            this.txtEDSZ.Size = new System.Drawing.Size(155, 27);
-            this.txtEDSZ.TabIndex = 140;
-            // 
-            // label18
-            // 
-            this.label18.AutoSize = true;
-            this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.ForeColor = System.Drawing.Color.Black;
-            this.label18.Location = new System.Drawing.Point(42, 314);
-            this.label18.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label18.Name = "label18";
-            this.label18.Size = new System.Drawing.Size(123, 20);
-            this.label18.TabIndex = 139;
-            this.label18.Text = "能谱Z轴移动位置";
-            // 
-            // label19
-            // 
-            this.label19.AutoSize = true;
-            this.label19.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label19.ForeColor = System.Drawing.Color.Black;
-            this.label19.Location = new System.Drawing.Point(334, 314);
-            this.label19.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label19.Name = "label19";
-            this.label19.Size = new System.Drawing.Size(37, 20);
-            this.label19.TabIndex = 141;
-            this.label19.Text = "mm";
-            // 
-            // label20
-            // 
-            this.label20.AutoSize = true;
-            this.label20.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label20.ForeColor = System.Drawing.Color.Black;
-            this.label20.Location = new System.Drawing.Point(662, 314);
-            this.label20.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label20.Name = "label20";
-            this.label20.Size = new System.Drawing.Size(19, 20);
-            this.label20.TabIndex = 144;
-            this.label20.Text = "V";
-            // 
-            // label21
-            // 
-            this.label21.AutoSize = true;
-            this.label21.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label21.ForeColor = System.Drawing.Color.Black;
-            this.label21.Location = new System.Drawing.Point(421, 314);
-            this.label21.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label21.Name = "label21";
-            this.label21.Size = new System.Drawing.Size(84, 20);
-            this.label21.TabIndex = 142;
-            this.label21.Text = "能谱电压值";
-            // 
-            // label22
-            // 
-            this.label22.AutoSize = true;
-            this.label22.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label22.ForeColor = System.Drawing.Color.Black;
-            this.label22.Location = new System.Drawing.Point(334, 343);
-            this.label22.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(29, 20);
-            this.label22.TabIndex = 147;
-            this.label22.Text = "nA";
-            // 
-            // label23
-            // 
-            this.label23.AutoSize = true;
-            this.label23.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label23.ForeColor = System.Drawing.Color.Black;
-            this.label23.Location = new System.Drawing.Point(81, 343);
-            this.label23.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label23.Name = "label23";
-            this.label23.Size = new System.Drawing.Size(84, 20);
-            this.label23.TabIndex = 145;
-            this.label23.Text = "能谱电流值";
-            // 
-            // cbbEDSV
-            // 
-            this.cbbEDSV.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbEDSV.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbEDSV.FormattingEnabled = true;
-            this.cbbEDSV.Items.AddRange(new object[] {
-            "6000",
-            "7000",
-            "8000",
-            "9000",
-            "10000",
-            "11000",
-            "12000"});
-            this.cbbEDSV.Location = new System.Drawing.Point(502, 312);
-            this.cbbEDSV.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbEDSV.Name = "cbbEDSV";
-            this.cbbEDSV.Size = new System.Drawing.Size(155, 25);
-            this.cbbEDSV.TabIndex = 148;
-            // 
-            // cbbEDSA
-            // 
-            this.cbbEDSA.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbEDSA.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbEDSA.FormattingEnabled = true;
-            this.cbbEDSA.Items.AddRange(new object[] {
-            "0.1",
-            "0.2",
-            "0.5",
-            "1.0",
-            "2.0"});
-            this.cbbEDSA.Location = new System.Drawing.Point(174, 339);
-            this.cbbEDSA.Margin = new System.Windows.Forms.Padding(2);
-            this.cbbEDSA.Name = "cbbEDSA";
-            this.cbbEDSA.Size = new System.Drawing.Size(155, 25);
-            this.cbbEDSA.TabIndex = 149;
-            // 
             // cboXrayMode
             // 
             this.cboXrayMode.Font = new System.Drawing.Font("宋体", 10F);
@@ -711,7 +412,7 @@
             "0",
             "1",
             "2"});
-            this.cboXrayMode.Location = new System.Drawing.Point(502, 341);
+            this.cboXrayMode.Location = new System.Drawing.Point(502, 234);
             this.cboXrayMode.Margin = new System.Windows.Forms.Padding(2);
             this.cboXrayMode.Name = "cboXrayMode";
             this.cboXrayMode.Size = new System.Drawing.Size(155, 25);
@@ -722,7 +423,7 @@
             this.label28.AutoSize = true;
             this.label28.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label28.ForeColor = System.Drawing.Color.Black;
-            this.label28.Location = new System.Drawing.Point(418, 341);
+            this.label28.Location = new System.Drawing.Point(413, 234);
             this.label28.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label28.Name = "label28";
             this.label28.Size = new System.Drawing.Size(85, 20);
@@ -734,7 +435,7 @@
             this.label29.AutoSize = true;
             this.label29.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label29.ForeColor = System.Drawing.Color.Black;
-            this.label29.Location = new System.Drawing.Point(662, 343);
+            this.label29.Location = new System.Drawing.Point(666, 240);
             this.label29.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label29.Name = "label29";
             this.label29.Size = new System.Drawing.Size(103, 20);
@@ -746,7 +447,7 @@
             this.label30.AutoSize = true;
             this.label30.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label30.ForeColor = System.Drawing.Color.Black;
-            this.label30.Location = new System.Drawing.Point(662, 363);
+            this.label30.Location = new System.Drawing.Point(666, 265);
             this.label30.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label30.Name = "label30";
             this.label30.Size = new System.Drawing.Size(53, 20);
@@ -835,21 +536,65 @@
             this.btnCutHoleFile.UseVisualStyleBackColor = true;
             this.btnCutHoleFile.Click += new System.EventHandler(this.btnCutHoleFile_Click);
             // 
-            // pbClose
+            // label2
             // 
-            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);
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.ForeColor = System.Drawing.Color.Black;
+            this.label2.Location = new System.Drawing.Point(48, 309);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(129, 20);
+            this.label2.TabIndex = 86;
+            this.label2.Text = "恢复位置放大倍数";
+            // 
+            // txtMag1
+            // 
+            this.txtMag1.Location = new System.Drawing.Point(174, 302);
+            this.txtMag1.Name = "txtMag1";
+            this.txtMag1.ReadOnly = true;
+            this.txtMag1.Size = new System.Drawing.Size(155, 27);
+            this.txtMag1.TabIndex = 149;
+            // 
+            // txtMag2
+            // 
+            this.txtMag2.Location = new System.Drawing.Point(174, 331);
+            this.txtMag2.Name = "txtMag2";
+            this.txtMag2.ReadOnly = true;
+            this.txtMag2.Size = new System.Drawing.Size(155, 27);
+            this.txtMag2.TabIndex = 149;
+            // 
+            // txtMag3
+            // 
+            this.txtMag3.Location = new System.Drawing.Point(174, 360);
+            this.txtMag3.Name = "txtMag3";
+            this.txtMag3.ReadOnly = true;
+            this.txtMag3.Size = new System.Drawing.Size(155, 27);
+            this.txtMag3.TabIndex = 149;
+            // 
+            // txtMag4
+            // 
+            this.txtMag4.Location = new System.Drawing.Point(174, 389);
+            this.txtMag4.Name = "txtMag4";
+            this.txtMag4.ReadOnly = true;
+            this.txtMag4.Size = new System.Drawing.Size(155, 27);
+            this.txtMag4.TabIndex = 149;
+            // 
+            // txtVot
+            // 
+            this.txtVot.Location = new System.Drawing.Point(174, 234);
+            this.txtVot.Name = "txtVot";
+            this.txtVot.ReadOnly = true;
+            this.txtVot.Size = new System.Drawing.Size(155, 27);
+            this.txtVot.TabIndex = 149;
+            // 
+            // txtIprobe
+            // 
+            this.txtIprobe.Location = new System.Drawing.Point(174, 265);
+            this.txtIprobe.Name = "txtIprobe";
+            this.txtIprobe.ReadOnly = true;
+            this.txtIprobe.Size = new System.Drawing.Size(155, 27);
+            this.txtIprobe.TabIndex = 149;
             // 
             // UControl_Init
             // 
@@ -857,48 +602,32 @@
             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.txtMag4);
+            this.Controls.Add(this.txtMag3);
+            this.Controls.Add(this.txtMag2);
+            this.Controls.Add(this.txtVot);
+            this.Controls.Add(this.txtIprobe);
+            this.Controls.Add(this.txtMag1);
             this.Controls.Add(this.btnEditConfig);
-            this.Controls.Add(this.cbbEDSA);
             this.Controls.Add(this.cboXrayMode);
-            this.Controls.Add(this.cbbEDSV);
-            this.Controls.Add(this.label22);
-            this.Controls.Add(this.label23);
             this.Controls.Add(this.label30);
             this.Controls.Add(this.label29);
             this.Controls.Add(this.label28);
-            this.Controls.Add(this.label20);
-            this.Controls.Add(this.label21);
-            this.Controls.Add(this.label19);
-            this.Controls.Add(this.txtEDSZ);
-            this.Controls.Add(this.label18);
             this.Controls.Add(this.chkEDS);
             this.Controls.Add(this.btnHandSavePoints);
-            this.Controls.Add(this.txtScanRotCur);
             this.Controls.Add(this.panel2);
-            this.Controls.Add(this.tbGear1to2_Xdeviation);
             this.Controls.Add(this.btnFIBTemplateFile);
             this.Controls.Add(this.btnPTTemplateFile);
-            this.Controls.Add(this.tbGear1to2_Ydeviation);
             this.Controls.Add(this.btnCutHoleAuto);
             this.Controls.Add(this.btnCutHoleFile);
-            this.Controls.Add(this.label17);
-            this.Controls.Add(this.txtYPSCur);
-            this.Controls.Add(this.label3);
             this.Controls.Add(this.chkWqxkc);
-            this.Controls.Add(this.label2);
             this.Controls.Add(this.label50);
             this.Controls.Add(this.txtWFIBF);
-            this.Controls.Add(this.cbbWPZD);
-            this.Controls.Add(this.cbbWPZF);
-            this.Controls.Add(this.cbbWQGD);
-            this.Controls.Add(this.cbbWQGF);
-            this.Controls.Add(this.cbbWLZ);
-            this.Controls.Add(this.cbbWXZ);
             this.Controls.Add(this.cbbWCS);
             this.Controls.Add(this.cbbWYP);
-            this.Controls.Add(this.label58);
             this.Controls.Add(this.label54);
             this.Controls.Add(this.label46);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.label42);
             this.Controls.Add(this.label38);
             this.Controls.Add(this.chkWIsP);
@@ -917,12 +646,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, 490);
+            this.Size = new System.Drawing.Size(767, 549);
             this.Load += new System.EventHandler(this.UControl_Init_Load);
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
-            this.panel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).EndInit();
+            this.panel2.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -935,15 +664,8 @@
         private System.Windows.Forms.Label lblCutHoleCount;
         private System.Windows.Forms.CheckBox chkManul;
         private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.ComboBox cbbWPZD;
-        private System.Windows.Forms.ComboBox cbbWPZF;
-        private System.Windows.Forms.ComboBox cbbWQGD;
-        private System.Windows.Forms.ComboBox cbbWQGF;
-        private System.Windows.Forms.ComboBox cbbWLZ;
-        private System.Windows.Forms.ComboBox cbbWXZ;
         private System.Windows.Forms.ComboBox cbbWCS;
         private System.Windows.Forms.ComboBox cbbWYP;
-        private System.Windows.Forms.Label label58;
         private System.Windows.Forms.Label label50;
         private System.Windows.Forms.Label label54;
         private System.Windows.Forms.Label label46;
@@ -958,10 +680,7 @@
         private System.Windows.Forms.CheckBox chkWPT;
         private System.Windows.Forms.TextBox txtWFIBF;
         private System.Windows.Forms.PictureBox pbClose;
-        private System.Windows.Forms.Label label2;
         private System.Windows.Forms.CheckBox chkWqxkc;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.TextBox txtYPSCur;
         private System.Windows.Forms.Button btnCutHoleFile;
         private System.Windows.Forms.Button btnCutHoleAuto;
         private System.Windows.Forms.Button btnPTTemplateFile;
@@ -969,25 +688,19 @@
         private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Button btnSaveDefalutPara;
         private System.Windows.Forms.Button btnEditConfig;
-        private System.Windows.Forms.TextBox tbGear1to2_Xdeviation;
-        private System.Windows.Forms.TextBox tbGear1to2_Ydeviation;
-        private System.Windows.Forms.Label label17;
-        private System.Windows.Forms.TextBox txtScanRotCur;
         private System.Windows.Forms.Button btnHandSavePoints;
         private System.Windows.Forms.CheckBox chkEDS;
-        private System.Windows.Forms.TextBox txtEDSZ;
-        private System.Windows.Forms.Label label18;
-        private System.Windows.Forms.Label label19;
-        private System.Windows.Forms.Label label20;
-        private System.Windows.Forms.Label label21;
-        private System.Windows.Forms.Label label22;
-        private System.Windows.Forms.Label label23;
-        private System.Windows.Forms.ComboBox cbbEDSV;
-        private System.Windows.Forms.ComboBox cbbEDSA;
         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;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox txtMag1;
+        private System.Windows.Forms.TextBox txtMag2;
+        private System.Windows.Forms.TextBox txtMag3;
+        private System.Windows.Forms.TextBox txtMag4;
+        private System.Windows.Forms.TextBox txtVot;
+        private System.Windows.Forms.TextBox txtIprobe;
     }
 }

+ 220 - 571
HOZProject/UserControls/UControl_Init.cs

@@ -48,14 +48,9 @@ namespace HOZProject
         #region 成员变量
 
         //可供选择的各个参数的值列表
-        String[] sT;//样品类型列表
+       
         String[] firms;//厂商列表
-        String[] WPZD;//拍照电压列表
-        String[] WPZF;//拍照放大倍数列表
-        String[] WQGD;//定位电压列表
-        String[] WQGF;//定位电压放大倍数列表
-        String[] WLZ;//拉直电压列表
-        String[] WFIB;//FIB电压列表
+     
 
         //配置文件
         Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
@@ -69,7 +64,7 @@ namespace HOZProject
         public string ReadConfigPath { get => readConfigPath; set => readConfigPath = value; }
         
         //模板文件默认路径
-        private string m_TemplateFilePath;
+    
         #endregion
 
         #region 构造方法
@@ -100,8 +95,7 @@ namespace HOZProject
         #region 关闭窗体
         private void btnClose_Click(object sender, EventArgs e)
         {
-            //按照当前的值,更新测量文件的参数
-            SaveMeasureFile();
+         
 
             Form fParent = this.ParentForm;
             fParent.Close();
@@ -142,7 +136,7 @@ namespace HOZProject
             }
             catch (Exception ex)
             {
-                LogManager.LogError(ex.Message);
+                NLog.LogManager.GetCurrentClassLogger().Error(ex.Message);
             }
         }
         private void pbCutHoleFile_Click(object sender, EventArgs e)
@@ -363,162 +357,68 @@ namespace HOZProject
         /// 获取测量参数,初始化窗体中的控件信息
         /// </summary>   
         /// <returns></returns>
-        public MeasureParam GetMeasureParamInfo()
+        public bool GetMeasureParamFromHMI()
         {
+
+
             //从当前界面内获取参数
-            MeasureParam m_param = new MeasureParam();
+            var m_param = formHOZMain.m_MeasureFile.MParam;
             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.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;
             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);//拍照的电压
+            //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的放大倍数
 
            
 
-            m_param.ScanRotCor = Convert.ToSingle(txtScanRotCur.Text);
-            m_param.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
+            //m_param.ScanRotCor = Convert.ToSingle(txtScanRotCur.Text);
+            //m_param.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
 
-            if (cbbWXZ.SelectedIndex == 0)//校正角度
-            {
-                m_param.Correction_Angle = 36;
-            }
-            else
-            {
-                m_param.Correction_Angle = 54;
-            }
+            //if (cbbWXZ.SelectedIndex == 0)//校正角度
+            //{
+            //    m_param.Correction_Angle = 36;
+            //}
+            //else
+            //{
+            //    m_param.Correction_Angle = 54;
+            //}
 
-            m_param.SampleName = cbbWYP.Text;//样品类型
+            m_param.SampleType = cbbWYP.Text;//样品类型
             m_param.Firm = cbbWCS.Text;//厂商类型
-            return m_param;
+            return true;
         }
 
-        public void SaveTemplateFile()
-        {
-            //获取当前文件的参数
-            MeasureParam cfm = FormHOZMainObject.m_MeasureFile.MParam;
-            
-            //根据界面显示内容更新参数
-            cfm.Is_Photograph = chkWIsP.Checked;
-            cfm.PT = chkWPT.Checked;
-            cfm.Tilt = chkWqxkc.Checked;//是否倾斜样品台
-            cfm.EDS = chkEDS.Checked;
-            //自动对焦模式
-            //cfm.FocusMode = chkManul.Checked;
-            cfm.PTTemp = txtWPTF.Text;
-            cfm.FIBTemp = txtWFIBF.Text;
-            cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);
-            cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);
-            cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);
-            cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
-            cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
-            //cfm.FIB_Magnification = Convert.ToSingle(cbbWFIB.Text);
-            if (cbbWXZ.SelectedIndex == 0)
-            {
-                cfm.Correction_Angle = 36;
-            }
-            else
-            {
-                cfm.Correction_Angle = 54;
-            }
-
-            cfm.SampleName = cbbWYP.Text;
-            cfm.Firm = cbbWCS.Text;
-
-            //保存配置文件中的参数
-            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.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());
-
-
-            ConfigFile cf = new ConfigFile(cfm);
-
-            m_TemplateFilePath = ConfigurationManager.AppSettings["TemplateFilePath"].ToString();
-
-            //如果路径不存在,要求选择一个路径
-            if (!Directory.Exists(m_TemplateFilePath))
-            {
-                //创建路径
-                //Directory.CreateDirectory(m_TemplateFilePath);
-                FolderBrowserDialog dialog = new FolderBrowserDialog();
-                dialog.Description = "请选择文件路径";
-                //dialog.RootFolder = Environment.SpecialFolder.Programs;
-                if (dialog.ShowDialog() == DialogResult.OK)
-                {
-                    m_TemplateFilePath = dialog.SelectedPath;
-                    config.AppSettings.Settings["TemplateFilePath"].Value = m_TemplateFilePath;
-                    config.Save(ConfigurationSaveMode.Modified);
-                    ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
-                }
-            }
-
-
-            SaveFileDialog saveFileDialog = new SaveFileDialog();
-            //设置默认打开路径(绝对路径)
-            saveFileDialog.InitialDirectory = m_TemplateFilePath;
-            saveFileDialog.Filter = "样品参数文件|*.cfg";
-            if (saveFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                cf.Save(saveFileDialog.FileName);
-            }
-            else
-            {
-                return;
-            }
-            //编辑Config文件
-            EditConfig();
-        }
+        
         /// <summary>
         /// 编辑confing 文件信息
         /// </summary>
-        public bool EditConfig()
+        public bool SaveParamToConfigfile()
         {
             try
             {
                 //设置数据源信息
                 //样品类型
-                List<String> _sT = sT.ToList();
-                if ((_sT.IndexOf(cbbWYP.Text) < 0)
-                     || (!_sT.Contains(cbbWYP.Text)))
-                {
-                    _sT.Add(cbbWYP.Text);
-                    string wsT = string.Join(",", _sT.ToArray());
-                    config.AppSettings.Settings["Sample_Type"].Value = wsT;
-                }
+                //List<String> _sT = sT.ToList();
+                //if ((_sT.IndexOf(cbbWYP.Text) < 0)
+                //     || (!_sT.Contains(cbbWYP.Text)))
+                //{
+                //    _sT.Add(cbbWYP.Text);
+                //    string wsT = string.Join(",", _sT.ToArray());
+                //    config.AppSettings.Settings["LastSampleType"].Value = wsT;
+                //}
                 //厂商
                 List<String> _firms = firms.ToList();
                 if ((_firms.IndexOf(cbbWCS.Text) < 0)
@@ -526,145 +426,27 @@ namespace HOZProject
                 {
                     _firms.Add(cbbWCS.Text);
                     string wFirms = string.Join(",", _firms.ToArray());
-                    config.AppSettings.Settings["Firm"].Value = wFirms;
-                }
-                //拍照电压
-                List<String> _WPZD = WPZD.ToList();
-                if ((_WPZD.IndexOf(cbbWPZD.Text) < 0)
-                     || (!_WPZD.Contains(cbbWPZD.Text)))
-                {
-                    _WPZD.Add(cbbWPZD.Text);
-                    string wWPZD = string.Join(",", _WPZD.ToArray());
-                    config.AppSettings.Settings["WPZD"].Value = wWPZD;
-                }
-                //拍照放大位数
-                List<String> _WPZF = WPZF.ToList();
-                if ((_WPZF.IndexOf(cbbWPZF.Text) < 0)
-                     || (!_WPZF.Contains(cbbWPZF.Text)))
-                {
-                    _WPZF.Add(cbbWPZF.Text);
-                    string wWPZF = string.Join(",", _WPZF.ToArray());
-                    config.AppSettings.Settings["WPZF"].Value = wWPZF;
-                }
-                //定位切割电压
-                List<String> _WQGD = WQGD.ToList();
-                if ((_WQGD.IndexOf(cbbWQGD.Text) < 0)
-                     || (!_WQGD.Contains(cbbWQGD.Text)))
-                {
-                    _WQGD.Add(cbbWQGD.Text);
-                    string wWQGD = string.Join(",", _WQGD.ToArray());
-                    config.AppSettings.Settings["WQGD"].Value = wWQGD;
-                }
-                //定位切割放大位数
-                List<String> _WQGF = WQGF.ToList();
-                if ((_WQGF.IndexOf(cbbWQGF.Text) < 0)
-                    || (!_WQGF.Contains(cbbWQGF.Text)))
-                {
-                    _WQGF.Add(cbbWQGF.Text);
-                    string wWQGF = string.Join(",", _WQGF.ToArray());
-                    config.AppSettings.Settings["WQGF"].Value = wWQGF;
-                }
-                //拉直操作放大位数
-                List<String> _WLZ = WLZ.ToList();
-                if ((_WLZ.IndexOf(cbbWLZ.Text) < 0)
-                     || (!_WLZ.Contains(cbbWLZ.Text)))
-                {
-                    _WLZ.Add(cbbWLZ.Text);
-                    string wWLZ = string.Join(",", _WLZ.ToArray());
-                    config.AppSettings.Settings["WLZ"].Value = wWLZ;
-                }
-                //ScanRotate修正
-                config.AppSettings.Settings["ScanRotCur"].Value = txtScanRotCur.Text;
-                config.AppSettings.Settings["PixelSize_Y_Cur"].Value = txtYPSCur.Text;
-                //FIB放大位数
-                //List<String> _WFIB = WFIB.ToList();
-                //if ((_WFIB.IndexOf(cbbWFIB.Text) < 0) 
-                //    ||(!_WFIB.Contains(cbbWFIB.Text)))
-                //{
-                //    _WFIB.Add(cbbWFIB.Text);
-                //    string wWFIB = string.Join(",", _WFIB.ToArray());
-                //    config.AppSettings.Settings["WFIB"].Value = wWFIB;
-                //}               
-
-                MeasureParam m_Prm = new MeasureParam();
-                //m_Prm = FormHOZMainObject.m_MeasureFile.MParam;
-                m_Prm.Is_Photograph = chkWIsP.Checked;
-
-                m_Prm.FocusMode = Convert.ToInt32(config.AppSettings.Settings["Focus_Mode"].Value);
-                m_Prm.PT = chkWPT.Checked;
-                //EDS
-                m_Prm.EDS = chkEDS.Checked;
-                config.AppSettings.Settings["Is_EDS"].Value = chkEDS.Checked.ToString();
-                m_Prm.EDSZ = Convert.ToSingle(txtEDSZ.Text)/1000;
-                config.AppSettings.Settings["EDS_Z"].Value = txtEDSZ.Text;
-                m_Prm.EDSV = Convert.ToSingle(cbbEDSV.Text);
-                config.AppSettings.Settings["EDS_V"].Value = cbbEDSV.Text;
-                m_Prm.EDSA = Convert.ToSingle(cbbEDSA.Text) / 1000000000;
-                config.AppSettings.Settings["EDS_A"].Value = cbbEDSA.Text;
-                m_Prm.EDSParam.XrayCollectMode = Convert.ToInt16(cboXrayMode.Text);
-                config.AppSettings.Settings["EDS_XrayMode"].Value = cboXrayMode.Text;
-                //自动对焦模式
-                //cfm.FocusMode = chkManul.Checked;
-                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);
-
-               
-
-                //倾斜观测
-                m_Prm.Tilt = chkWqxkc.Checked;
-                //移动Z轴大小
-                m_Prm.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
-
-                if (cbbWXZ.SelectedIndex == 0)
-                {
-                    m_Prm.Correction_Angle = 36;
-                }
-                else
-                {
-                    m_Prm.Correction_Angle = 54;
+                    config.AppSettings.Settings["Firms"].Value = wFirms;
                 }
 
-                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();
+                var m_Prm = formHOZMain.m_MeasureFile.MParam;
+
 
                 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["Stretch_Magnification"].Value = m_Prm.Straighten_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["Location_Voltage"].Value = m_Prm.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["Correction_Angle"].Value = m_Prm.Correction_Angle.ToString();
+                config.AppSettings.Settings["LastSampleType"].Value = m_Prm.SampleType;
+                //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.AppSettings.Settings["ZDistance"].Value = m_Prm.ZDistance.ToString();
                 config.Save(ConfigurationSaveMode.Modified);
                 ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
                 return true;
@@ -697,91 +479,38 @@ namespace HOZProject
         /// <summary>
         /// 读取Config文件信息
         /// </summary>
-        public void ReloadConfig()
+        public void DisplayInitialParam()
         {
             cbbWYP.Items.Clear();
             cbbWCS.Items.Clear();
-            cbbWPZD.Items.Clear();
-            cbbWPZF.Items.Clear();
-            cbbWQGD.Items.Clear();
-            cbbWQGF.Items.Clear();
-            cbbWLZ.Items.Clear();
-            //cbbWFIB.Items.Clear();
-            txtYPSCur.Text = config.AppSettings.Settings["PixelSize_Y_Cur"].Value.ToString();
-            m_TemplateFilePath = config.AppSettings.Settings["TemplateFilePath"].Value.ToString();
-            string sample_Type = config.AppSettings.Settings["Sample_Type"].Value.ToString();
-            string firm = config.AppSettings.Settings["Firm"].Value.ToString();
-            string WPZDTemp = config.AppSettings.Settings["WPZD"].Value.ToString();
-            string WPZFTemp = config.AppSettings.Settings["WPZF"].Value.ToString();
-            string WQGDTemp = config.AppSettings.Settings["WQGD"].Value.ToString();
-            string WQGFTemp = config.AppSettings.Settings["WQGF"].Value.ToString();
-            string WLZTemp = config.AppSettings.Settings["WLZ"].Value.ToString();
-            string WFIBTemp = config.AppSettings.Settings["WFIB"].Value.ToString();
-            //string ZZDistance = config.AppSettings.Settings["ZDistance"].Value.ToString();
+
+            string firm = config.AppSettings.Settings["Firms"].Value.ToString();
+
             string ScanRotCur = config.AppSettings.Settings["ScanRotCur"].Value.ToString();
             
-            //样品类型
-            sT = sample_Type.Split(',');
-            BindComboxData(cbbWYP, sT);
+   
             //厂商
             firms = firm.Split(',');
             BindComboxData(cbbWCS, firms);
-            //拍照电压
-            WPZD = WPZDTemp.Split(',');
-            BindComboxData(cbbWPZD, WPZD);
-            //拍照放大位数
-            WPZF = WPZFTemp.Split(',');
-            BindComboxData(cbbWPZF, WPZF);
-            //定位切割电压
-            WQGD = WQGDTemp.Split(',');
-            BindComboxData(cbbWQGD, WQGD);
-            //定位切割放大位数
-            WQGF = WQGFTemp.Split(',');
-            BindComboxData(cbbWQGF, WQGF);
-            //拉直操作放大位数
-            WLZ = WLZTemp.Split(',');
-            BindComboxData(cbbWLZ, WLZ);
-            //FIB放大倍数
-            //WFIB = WFIBTemp.Split(',');
-            //BindComboxData(cbbWFIB, WFIB);
-            txtScanRotCur.Text = ScanRotCur;
+
 
            
 
             //设置配置文件默认值
             chkWIsP.Checked=Convert.ToBoolean(config.AppSettings.Settings["Is_Photograph"].Value);
             chkWPT.Checked = Convert.ToBoolean(config.AppSettings.Settings["PT_Depostion"].Value);
-            //倾斜观测
+         
             chkWqxkc.Checked = Convert.ToBoolean(config.AppSettings.Settings["Is_Title"].Value);
-            //移动Z轴大小
-            txtYPSCur.Text = config.AppSettings.Settings["PixelSize_Y_Cur"].Value;
-            //自动对焦模式
-            //chkManul.Checked = Convert.ToBoolean(config.AppSettings.Settings["Focus_Mode"].Value);
+
             txtWPTF.Text = config.AppSettings.Settings["PT_ELYFile"].Value;
             txtWFIBF.Text = config.AppSettings.Settings["FIB_ELYFile"].Value;
-            cbbWLZ.Text = config.AppSettings.Settings["Stretch_Magnification"].Value;
-            cbbWQGF.Text = config.AppSettings.Settings["Location_Magnification"].Value;
-            cbbWQGD.Text = config.AppSettings.Settings["Location_Voltage"].Value;
-            cbbWPZF.Text = config.AppSettings.Settings["Photograph_Magnification"].Value;
-            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 (Correction_Angle == "36")
-            {
-                cbbWXZ.SelectedIndex = 0;
-            }
-            else
-            {
-                cbbWXZ.SelectedIndex = 1;
-            }
-            cbbWYP.Text = config.AppSettings.Settings["SampleName"].Value;
-            cbbWCS.Text = config.AppSettings.Settings["Firms"].Value;
-            //能谱和能谱Z轴移动位置
+            cbbWYP.Text = config.AppSettings.Settings["LastSampleType"].Value;
+            cbbWCS.Text = config.AppSettings.Settings["LastSelectFirm"].Value;
+            
             chkEDS.Checked = Convert.ToBoolean(config.AppSettings.Settings["Is_EDS"].Value);
-            txtEDSZ.Text = Convert.ToString(config.AppSettings.Settings["EDS_Z"].Value);
-            cbbEDSV.Text = Convert.ToString(config.AppSettings.Settings["EDS_V"].Value);
-            cbbEDSA.Text = Convert.ToString(config.AppSettings.Settings["EDS_A"].Value);
+            
             cboXrayMode.Text = Convert.ToString(config.AppSettings.Settings["EDS_XrayMode"].Value);
         }
 
@@ -792,7 +521,7 @@ namespace HOZProject
         {
             if (!ReadConfigPath.Equals(""))
             {
-                ReloadConfig();
+                DisplayInitialParam();
                 ConfigFile cfm = new ConfigFile(FormHOZMainObject.m_MeasureFile.MParam);
                 cfm.Read(ReadConfigPath);
                 chkWIsP.Checked = cfm.m_Config.Is_Photograph;
@@ -801,22 +530,8 @@ namespace HOZProject
                 //cfm.FocusMode = chkManul.Checked;
                 txtWPTF.Text = cfm.m_Config.PTTemp;
                 txtWFIBF.Text = cfm.m_Config.FIBTemp;
-                cbbWLZ.Text = cfm.m_Config.Stretch_Magnification.ToString();
-                cbbWQGF.Text = cfm.m_Config.Location_Magnification.ToString();
-                cbbWQGD.Text = cfm.m_Config.Location_Voltage.ToString();
-                cbbWPZF.Text = cfm.m_Config.Photograph_Magnification.ToString();
-                cbbWPZD.Text = cfm.m_Config.Photograph_Voltage.ToString();
-                //cbbWFIB.Text = cfm.m_Config.FIB_Magnification.ToString();
-                string Correction_Angle = cfm.m_Config.Correction_Angle.ToString();
-                if (Correction_Angle == "36")
-                {
-                    cbbWXZ.SelectedIndex = 0;
-                }
-                else
-                {
-                    cbbWXZ.SelectedIndex = 1;
-                }
-                cbbWYP.Text = cfm.m_Config.SampleName;
+
+                cbbWYP.Text = cfm.m_Config.SampleType;
                 cbbWCS.Text = cfm.m_Config.Firm;
             }
         }
@@ -828,27 +543,39 @@ namespace HOZProject
         /// <param name="e"></param>
         private void btnSaveDefalutPara_Click(object sender, EventArgs e)
         {
-            if(chkWPT.Checked)
+            if (chkWPT.Checked)
             {
-                if (txtWPTF.Text=="")
+                if (txtWPTF.Text == "")
                 {
                     MessageBox.Show("PT文件路径不能为空");
                     return;
                 }
             }
-            if(txtWFIBF.Text=="")
+            if (txtWFIBF.Text == "")
             {
                 MessageBox.Show("FIB文件路径不能为空");
                 return;
             }
-            if (EditConfig())
+            GetMeasureParamFromHMI();
+
+            SaveParamToConfigfile();
+
+            //获取测量结果文件位置,并保存测量结果文件
+            if (formHOZMain.m_MeasureFile.SaveAs())
             {
-                //MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                formHOZMain.Saveclick();
+
+                //设置已保存状态
+                formHOZMain.IsSave = true;
             }
 
-            //增加一个测量文件的参数修改
-            SaveMeasureFile();
+           
+
+
+
+            FormHOZMainObject.m_MeasureFile.IsModified = true;
+
+
+       
             Form fParent = this.ParentForm;
             fParent.Close();
         }
@@ -875,12 +602,12 @@ namespace HOZProject
                 txtWPTF.Visible = false;
                 btnPTTemplateFile.Visible = false;
                 btnFIBTemplateFile.Visible = false;
-                label58.Visible = false;
-                cbbWXZ.Visible = false;
+                //label58.Visible = false;
+                //cbbWXZ.Visible = false;
                 chkEDS.Visible = false;
-                label18.Visible = false;
-                label19.Visible = false;
-                txtEDSZ.Visible = false;
+                //label18.Visible = false;
+                //label19.Visible = false;
+                //txtEDSZ.Visible = false;
                 //cbbWFIB.Visible = false;
                 //pbDelWFIB.Visible = false;
                 FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.Photo;
@@ -895,15 +622,15 @@ namespace HOZProject
                 txtWPTF.Visible = true;
                 btnPTTemplateFile.Visible = true;
                 btnFIBTemplateFile.Visible = true;
-                label58.Visible = true;
-                cbbWXZ.Visible = true;
+                //label58.Visible = true;
+                //cbbWXZ.Visible = true;
                 chkEDS.Visible = true;
                 //label2.Visible = true;
                 //cbbWFIB.Visible = true;
                 //pbDelWFIB.Visible = true;
-                label18.Visible = true;
-                label19.Visible = true;
-                txtEDSZ.Visible = true;
+                //label18.Visible = true;
+                //label19.Visible = true;
+                //txtEDSZ.Visible = true;
                 if (!chkWPT.Checked)
                 {
                     FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.FIB;
@@ -913,87 +640,7 @@ namespace HOZProject
         }
         #endregion
 
-        #region 从配置文件中读取测量参数
-        public MeasureParam GetMeasureParam()
-        {
-            MeasureParam cfm = new MeasureParam();
-
-            //设置配置文件默认值
-            bool bResult = false;
-
-            bool.TryParse(config.AppSettings.Settings["Is_Photograph"].Value, out bResult);
-            cfm.Is_Photograph = bResult;
-
-            bool.TryParse(config.AppSettings.Settings["PT_Depostion"].Value, out bResult);
-            cfm.PT = bResult;
-
-            cfm.PTTemp = config.AppSettings.Settings["PT_ELYFile"].Value;
-            cfm.FIBTemp = config.AppSettings.Settings["FIB_ELYFile"].Value;
-
-            float fResult = (float)0.0;
-            float.TryParse(config.AppSettings.Settings["Stretch_Magnification"].Value, out fResult);
-            cfm.Stretch_Magnification = fResult;
-
-            float.TryParse(config.AppSettings.Settings["Location_Magnification"].Value, out fResult);
-            cfm.Location_Magnification = fResult;
-
-            float.TryParse(config.AppSettings.Settings["Location_Voltage"].Value, out fResult);
-            cfm.Location_Voltage = fResult;
-
-            float.TryParse(config.AppSettings.Settings["Photograph_Magnification"].Value, out fResult);
-            cfm.Photograph_Magnification = fResult;
-
-            float.TryParse(config.AppSettings.Settings["Photograph_Voltage"].Value, out fResult);
-            cfm.Photograph_Voltage = fResult;
-
-            float.TryParse(config.AppSettings.Settings["Correction_Angle"].Value, out fResult);
-            cfm.Correction_Angle = fResult;
-
-            cfm.SampleName = config.AppSettings.Settings["SampleName"].Value;
-
-            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());
-
-            bool.TryParse(config.AppSettings.Settings["Is_Title"].Value, out bResult);
-            cfm.Tilt = bResult;
-
-            bool.TryParse(config.AppSettings.Settings["Is_EDS"].Value, out bResult);
-            cfm.EDS = bResult;
-
-            float.TryParse(config.AppSettings.Settings["ZDistance"].Value, out fResult);
-            cfm.ZDistance = fResult;
-            //add by sun 2020-12-15 增加不同样品扫描速度参数,每大类样品3种扫描速度
-            //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);
-            //add by sun 2020-12-15 增加不同样品扫描速度参数,每大类样品3种扫描速度 end
-            return cfm;
-        }
-        #endregion
+       
 
         #region 创建切孔列表
         private void CreateCutHoleList()
@@ -1111,30 +758,30 @@ namespace HOZProject
             }
         }
 
-        private void cbbWPZD_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            ComboBox_KeyPress(cbbWPZD.Text, sender, e);
-        }
+        //private void cbbWPZD_KeyPress(object sender, KeyPressEventArgs e)
+        //{
+        //    ComboBox_KeyPress(cbbWPZD.Text, sender, e);
+        //}
 
-        private void cbbWPZF_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            ComboBox_KeyPress(cbbWPZF.Text, sender, e);
-        }
+        //private void cbbWPZF_KeyPress(object sender, KeyPressEventArgs e)
+        //{
+        //    ComboBox_KeyPress(cbbWPZF.Text, sender, e);
+        //}
 
-        private void cbbWQGD_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            ComboBox_KeyPress(cbbWQGD.Text, sender, e);
-        }
+        //private void cbbWQGD_KeyPress(object sender, KeyPressEventArgs e)
+        //{
+        //    ComboBox_KeyPress(cbbWQGD.Text, sender, e);
+        //}
 
-        private void cbbWQGF_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            ComboBox_KeyPress(cbbWQGF.Text, sender, e);
-        }
+        //private void cbbWQGF_KeyPress(object sender, KeyPressEventArgs e)
+        //{
+        //    ComboBox_KeyPress(cbbWQGF.Text, sender, e);
+        //}
 
-        private void cbbWLZ_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            ComboBox_KeyPress(cbbWLZ.Text, sender, e);
-        }
+        //private void cbbWLZ_KeyPress(object sender, KeyPressEventArgs e)
+        //{
+        //    ComboBox_KeyPress(cbbWLZ.Text, sender, e);
+        //}
 
         #endregion
 
@@ -1153,22 +800,22 @@ namespace HOZProject
             //}
         }
 
-        private void txtYPSCur_TextChanged(object sender, EventArgs e)
-        {
-            if (txtYPSCur.Text!="")
-            {
-                if (Convert.ToSingle(txtYPSCur.Text)>5)
-                {
-                  MessageBox.Show("数值最大为5");
-                  txtYPSCur.Text = "5";
-                  }
-            }
-            else
-            {
-                txtYPSCur.Text = "1";
-            }
-            
-        }
+        //private void txtYPSCur_TextChanged(object sender, EventArgs e)
+        //{
+        //    if (txtYPSCur.Text != "")
+        //    {
+        //        if (Convert.ToSingle(txtYPSCur.Text) > 5)
+        //        {
+        //            MessageBox.Show("数值最大为5");
+        //            txtYPSCur.Text = "5";
+        //        }
+        //    }
+        //    else
+        //    {
+        //        txtYPSCur.Text = "1";
+        //    }
+
+        //}
 
         private void txtYPSCur_KeyPress(object sender, KeyPressEventArgs e)
         {
@@ -1183,22 +830,15 @@ namespace HOZProject
         private void SaveMeasureFile()
         {
             //界面上的参数
-            FormHOZMainObject.m_MeasureFile.MParam = GetMeasureParamInfo();
+            GetMeasureParamFromHMI();
             //配置文件中的参数
-            FormHOZMainObject.m_MeasureFile.MParam.ZDistance = Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"].ToString());
+            //FormHOZMainObject.m_MeasureFile.MParam.ZDistance = Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"].ToString());
 
 
 
             FormHOZMainObject.m_MeasureFile.IsModified = true;
 
-            FormHOZMainObject.m_MeasureFile.MParam.ScanRotCor = Convert.ToSingle(ConfigurationManager.AppSettings["ScanRotCur"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.PixelSizeCor = Convert.ToSingle(ConfigurationManager.AppSettings["PixelSize_Y_Cur"].ToString());
 
-            FormHOZMainObject.m_MeasureFile.MParam.EDS = Convert.ToBoolean(ConfigurationManager.AppSettings["Is_EDS"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.EDSZ = Convert.ToSingle(ConfigurationManager.AppSettings["EDS_Z"].ToString()) / 1000;
-            FormHOZMainObject.m_MeasureFile.MParam.EDSV = Convert.ToSingle(ConfigurationManager.AppSettings["EDS_V"].ToString());
-            FormHOZMainObject.m_MeasureFile.MParam.EDSA = Convert.ToSingle(ConfigurationManager.AppSettings["EDS_A"].ToString()) / 1000000000;
-            FormHOZMainObject.m_MeasureFile.MParam.EDSParam.XrayCollectMode =Convert.ToInt16( ConfigurationManager.AppSettings["EDS_XrayMode"].ToString());
             if (Directory.Exists(FormHOZMainObject.m_MeasureFile.FilePath))//如果已经存在硬盘上要重新保存文件
             {
                 FormHOZMainObject.m_MeasureFile.Save();
@@ -1240,87 +880,96 @@ namespace HOZProject
         
         private void cbbWYP_SelectedIndexChanged(object sender, EventArgs e)
         {
-            SetTypel();
+            
+                FormHOZMainObject.m_MeasureFile.MParam.loadParamFromSampleTypeTemplate(cbbWYP.Text);
+                SetTypel();
+          
+           
         }
         private void SetTypel()
         {
-            if (cbbWYP.Text == "0")
-            {
-                //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType0;//厂商
-                cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType0;//拉直放大倍数
-                cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType0;//定位电压
-                cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType0;//定位放大倍数
-                cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType0;//拍照电压
-                cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType0;//拍照放大倍数
-                cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType0;//能谱电压值
-                cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType0;//能谱电流值
-                label4.Text = "0-AA Hole";
-            }
-            else
-                        if (cbbWYP.Text == "1")
-            {
-                //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType1;//厂商
-                cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType1;//拉直放大倍数
-                cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType1;//定位电压
-                cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType1;//定位放大倍数
-                cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType1;//拍照电压
-                cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType1;//拍照放大倍数
-                cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType1;//能谱电压值
-                cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType1;//能谱电流值
-                label4.Text = "1-AA区";
-            }
-            else
-                        if (cbbWYP.Text == "2")
-            {
-                //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType2;//厂商
-                cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType2;//拉直放大倍数
-                cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType2;//定位电压
-                cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType2;//定位放大倍数
-                cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType2;//拍照电压
-                cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType2;//拍照放大倍数
-                cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType2;//能谱电压值
-                cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType2;//能谱电流值
-                label4.Text = "2-Pad bending";
-            }
-            else
-                        if (cbbWYP.Text == "3")
-            {
-                //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType3;//厂商
-                cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType3;//拉直放大倍数
-                cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType3;//定位电压
-                cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType3;//定位放大倍数
-                cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType3;//拍照电压
-                cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType3;//拍照放大倍数
-                cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType3;//能谱电压值
-                cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType3;//能谱电流值
-                label4.Text = "3-DDIC";
-            }
-            else
-                        if (cbbWYP.Text == "4")
-            {
-                //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType3;//厂商
-                cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType4;//拉直放大倍数
-                cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType4;//定位电压
-                cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType4;//定位放大倍数
-                cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType4;//拍照电压
-                cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType4;//拍照放大倍数
-                cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType4;//能谱电压值
-                cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType4;//能谱电流值
-                label4.Text = "4-射频IC-1";
-            }
-            else
-                        if (cbbWYP.Text == "5")
-            {
-                //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType3;//厂商
-                cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType5;//拉直放大倍数
-                cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType5;//定位电压
-                cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType5;//定位放大倍数
-                cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType5;//拍照电压
-                cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType5;//拍照放大倍数
-                cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType5;//能谱电压值
-                cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType5;//能谱电流值
-                label4.Text = "5-射频IC-1";
-            }
+            //if (cbbWYP.Text == "0")
+            //{
+            //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType0;//厂商
+
+            txtVot.Text = FormHOZMainObject.m_MeasureFile.MParam.Voltage.ToString();//电压
+            txtIprobe.Text = FormHOZMainObject.m_MeasureFile.MParam.Iprobe.ToString();
+
+            txtMag1.Text = FormHOZMainObject.m_MeasureFile.MParam.Location_Magnification.ToString();//定位放大倍数
+            txtMag2.Text = FormHOZMainObject.m_MeasureFile.MParam.Straighten_Magnification.ToString();//拉直放大倍数
+            txtMag3.Text = FormHOZMainObject.m_MeasureFile.MParam.FindCrossMagnification.ToString();
+
+            //cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType0;//拍照电压
+            txtMag4.Text = FormHOZMainObject.m_MeasureFile.MParam.Photograph_Magnification.ToString();//拍照放大倍数
+                //cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType0;//能谱电压值
+                //cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType0;//能谱电流值
+            //    label4.Text = "0-AA Hole";
+            //}
+            //else
+            //            if (cbbWYP.Text == "1")
+            //{
+            //    //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType1;//厂商
+            //    cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType1;//拉直放大倍数
+            //    cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType1;//定位电压
+            //    cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType1;//定位放大倍数
+            //    cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType1;//拍照电压
+            //    cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType1;//拍照放大倍数
+            //    cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType1;//能谱电压值
+            //    cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType1;//能谱电流值
+            //    label4.Text = "1-AA区";
+            //}
+            //else
+            //            if (cbbWYP.Text == "2")
+            //{
+            //    //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType2;//厂商
+            //    cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType2;//拉直放大倍数
+            //    cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType2;//定位电压
+            //    cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType2;//定位放大倍数
+            //    cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType2;//拍照电压
+            //    cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType2;//拍照放大倍数
+            //    cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType2;//能谱电压值
+            //    cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType2;//能谱电流值
+            //    label4.Text = "2-Pad bending";
+            //}
+            //else
+            //            if (cbbWYP.Text == "3")
+            //{
+            //    //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType3;//厂商
+            //    cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType3;//拉直放大倍数
+            //    cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType3;//定位电压
+            //    cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType3;//定位放大倍数
+            //    cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType3;//拍照电压
+            //    cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType3;//拍照放大倍数
+            //    cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType3;//能谱电压值
+            //    cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType3;//能谱电流值
+            //    label4.Text = "3-DDIC";
+            //}
+            //else
+            //            if (cbbWYP.Text == "4")
+            //{
+            //    //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType3;//厂商
+            //    cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType4;//拉直放大倍数
+            //    cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType4;//定位电压
+            //    cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType4;//定位放大倍数
+            //    cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType4;//拍照电压
+            //    cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType4;//拍照放大倍数
+            //    cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType4;//能谱电压值
+            //    cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType4;//能谱电流值
+            //    label4.Text = "4-射频IC-1";
+            //}
+            //else
+            //            if (cbbWYP.Text == "5")
+            //{
+            //    //cbbWCS.Text = FormHOZMainObject.m_MeasureFile.MParam.VendorType3;//厂商
+            //    cbbWLZ.Text = FormHOZMainObject.m_MeasureFile.MParam.StraightenTimesType5;//拉直放大倍数
+            //    cbbWQGD.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningVoltageeType5;//定位电压
+            //    cbbWQGF.Text = FormHOZMainObject.m_MeasureFile.MParam.PositioningTimesType5;//定位放大倍数
+            //    cbbWPZD.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoVoltageeType5;//拍照电压
+            //    cbbWPZF.Text = FormHOZMainObject.m_MeasureFile.MParam.PhotoTimesType5;//拍照放大倍数
+            //    cbbEDSV.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMVoltageeType5;//能谱电压值
+            //    cbbEDSA.Text = FormHOZMainObject.m_MeasureFile.MParam.SEMCurrentType5;//能谱电流值
+            //    label4.Text = "5-射频IC-1";
+            //}
         }
     }
 }

+ 1 - 0
MeasureData/MeasureData.csproj

@@ -37,6 +37,7 @@
       <HintPath>..\bin\Debug\FileManager.dll</HintPath>
     </Reference>
     <Reference Include="System" />
+    <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />

+ 21 - 48
MeasureData/MeasureFile.cs

@@ -72,27 +72,18 @@ namespace MeasureData
         /// <summary>
         /// 创建XML文件
         /// </summary>
-        /// <returns>0:失败;1:成功;2:文件已存在</returns>
-        public int CreateXml()
+        /// <returns></returns>
+        public bool CreateXml()
         {
-            if (!File.Exists(this.FileName))
+            if (File.Exists(this.FileName))
             {
-                if (XmlManager.CreateXmlFile(this.FileName))
-                {
-                    //创建一个新的
-                    return 1;
-                }
-                else
-                {
-                    //创建失败
-                    return 0;
-                }
+                return true;
             }
             else
             {
                 //重新创建
                 XmlManager.CreateXmlFile(this.FileName);
-                return 2;
+                return true;
             }
         }
 
@@ -159,9 +150,8 @@ namespace MeasureData
         //新建
         public bool New()
         {
-            int ret = CreateXml();
-            if (ret > 0)
-            {
+             CreateXml();
+           
                 XmlDocument doc = new XmlDocument();
                 doc.Load(this.FileName);//载入xml文件
 
@@ -170,7 +160,7 @@ namespace MeasureData
                 Serialize(true, doc, root);
 
                 doc.Save(this.FileName);
-            }
+          
 
             // 设置路径为初始默认路径
             this.FileName = UNTITLED_FILE_NAME;
@@ -209,24 +199,17 @@ namespace MeasureData
             {
                 return true;
             }
-            if (string.Compare(this.FileName, UNTITLED_FILE_NAME) == 0)
-            {
-                return SaveAs();
-            }
+            //else
+            //{
+            //    return SaveAs();
+            //}
+
+           
+            CreateXml();
 
             XmlDocument doc = new XmlDocument();
-            if (CreateXml() == 0)//创建该文件?
-            {
-                return false;
-            }
-            if (File.Exists(FileName))
-            {
-                doc.Load(this.FileName);//载入xml文件   
-            }
-            else
-            {
-                return SaveAs(); //当前路径不存在               
-            }
+            doc.Load(this.FileName);//载入xml文件   
+          
 
             XmlNode root = doc.SelectSingleNode("XMLData");
             Serialize(true, doc, root);
@@ -237,22 +220,14 @@ namespace MeasureData
         //另存为
         public bool SaveAs()
         {
-            //打开保存文件的对话框
-            this.FileName.Trim();
-            if (!string.IsNullOrEmpty(this.FileName))
-            {
-                this.FilePath = System.IO.Path.GetDirectoryName(this.FileName);
-            }
+       
 
             SaveFileDialog sfd = new SaveFileDialog();
             sfd.Title = "保存测量文件";
             sfd.InitialDirectory = @"D:\FIB_AUTO\";
             sfd.Filter = "测量文件(*.msf)|*.msf";
 
-            //if (Directory.Exists(this.FilePath))
-            //{
-            //    sfd.InitialDirectory = this.FilePath;
-            //}
+            
 
             if (sfd.ShowDialog() == DialogResult.OK)
             {
@@ -263,10 +238,8 @@ namespace MeasureData
 
                 //创建一个新的文件
                 XmlDocument doc = new XmlDocument();
-                if (CreateXml() == 0)//创建该文件?
-                {
-                    return false;
-                }
+                CreateXml();
+               
                 doc.Load(this.FileName);
                 XmlNode root = doc.SelectSingleNode("XMLData");
                 Serialize(true, doc, root);

+ 138 - 612
MeasureData/MeasureParam.cs

@@ -10,6 +10,7 @@ using System.Threading.Tasks;
 using FileManager;
 using System.Xml;
 using System.IO;
+using System.Configuration;
 
 namespace MeasureData
 {
@@ -21,11 +22,16 @@ namespace MeasureData
 
         // 样品类型
         private string m_SampleName;
-        public string SampleName
+        public string SampleType
         {
             get { return this.m_SampleName; }
             set { this.m_SampleName = value; }
         }
+        public string SampleTypeNo()
+        {
+            return m_SampleName.Split('_')[0];//样品类型的命名必须是“0_XXXX" "1_XXXXX"的形式,前面的数字是与谭博士通信的类型指示
+
+        }
 
         //是否仅拍照
         private Boolean is_Photograph;
@@ -85,12 +91,12 @@ namespace MeasureData
         }
 
         //Z轴移动的范围
-        private float m_dZ;
-        public float ZDistance
-        {
-            get { return this.m_dZ; }
-            set { this.m_dZ = value; }
-        }
+        //private float m_dZ;
+        //public float ZDistance
+        //{
+        //    get { return this.m_dZ; }
+        //    set { this.m_dZ = value; }
+        //}
 
         //FIB使用的ELY文件
         private string m_fibTemp;
@@ -107,23 +113,21 @@ namespace MeasureData
             get { return this.m_ptTemp; }
             set { this.m_ptTemp = value; }
         }
-
-        //对焦方式,自动对焦还是手动对焦,手动对焦是1,自有自动对焦2,客户自动对焦3
-        private int m_fMode;
-        public int FocusMode
-        {
-            get { return m_fMode; }
-            set { m_fMode = value; }
-        }
+       public string RemoteELYPath ;
+         public string   RemoteMLFPath;
+ 
 
         //拉直操作需要的放大位数
-        private float stretch_Magnification;
-        public float Stretch_Magnification
+        private float straighten_Magnification;
+        public float Straighten_Magnification
         {
-            get { return this.stretch_Magnification; }
-            set { this.stretch_Magnification = value; }
+            get { return this.straighten_Magnification; }
+            set { this.straighten_Magnification = value; }
         }
-
+        public bool StraightenToRun;
+        public bool StraightenAutoBC;
+        public float StraightenManualBrightness;
+        public float StraightenManualContrast;
         //定位切割位置的放大倍数
         private float location_Magnification;
         public float Location_Magnification
@@ -133,13 +137,13 @@ namespace MeasureData
         }
 
         //定位切割位置的工作电压
-        private float location_Voltage;
-        public float Location_Voltage
+        private float mVoltage;
+        public float Voltage
         {
-            get { return this.location_Voltage; }
-            set { this.location_Voltage = value; }
+            get { return this.mVoltage; }
+            set { this.mVoltage = value; }
         }
-        public float sampleIprobe;
+        public float Iprobe;
         //拍照的放大倍数
         private float photograph_Magnification;
         public float Photograph_Magnification
@@ -147,7 +151,9 @@ namespace MeasureData
             get { return this.photograph_Magnification; }
             set { this.photograph_Magnification = value; }
         }
-
+        public bool ShotSectionAutoBC;
+        public float  ShotSectionManualBrightness;
+        public float ShotSectionManualConstrast;
         //拍照的工作电压
         private float photograph_Voltage;
         public float Photograph_Voltage
@@ -220,29 +226,7 @@ namespace MeasureData
 
         //能谱参数
 
-        #region add by sun 2020-12-15 增加不同样品扫描速度参数
-        //正常情况下默认扫描速度
-        private String m_ScanSpeedNormal;
-        public String ScanSpeedNormal
-        {
-            get { return this.m_ScanSpeedNormal; }
-            set { this.m_ScanSpeedNormal = value; }
-        }
-        //对焦拍照扫描速度
-        private String m_ScanSpeedFocus;
-        public String ScanSpeedFocus
-        {
-            get { return this.m_ScanSpeedFocus; }
-            set { this.m_ScanSpeedFocus = value; }
-        }
-        //高倍拍照扫描速度
-        private String m_ScanSpeedHigh;
-        public String ScanSpeedHigh
-        {
-            get { return this.m_ScanSpeedHigh; }
-            set { this.m_ScanSpeedHigh = value; }
-        }
-        #endregion add by sun 2020-12-15 增加不同样品扫描速度参数end
+      
 
         //add by sun 2020-12-17 增加调试时是否切割开关
         private bool m_IsCutingForDebug;
@@ -263,510 +247,69 @@ namespace MeasureData
         //add by zjx 2020-12-18 为了测试只做能谱部分 end
 
         #endregion
-        #region  初始化样品的默认参数
-        // add by zjx 2020-12-20 厂商名字
-        #region 厂商
-        private String m_VendorType0;
-        public String VendorType0
-        {
-            get { return this.m_VendorType0; }
-            set { this.m_VendorType0 = value; }
-        }
-        private String m_VendorType1;
-        public String VendorType1
-        {
-            get { return this.m_VendorType1; }
-            set { this.m_VendorType1 = value; }
-        }
-        private String m_VendorType2;
-        public String VendorType2
-        {
-            get { return this.m_VendorType2; }
-            set { this.m_VendorType2 = value; }
-        }
-        private String m_VendorType3;
-        public String VendorType3
-        {
-            get { return this.m_VendorType3; }
-            set { this.m_VendorType3 = value; }
-        }
-        private String m_VendorType4;
-        public String VendorType4
-        {
-            get { return this.m_VendorType4; }
-            set { this.m_VendorType4 = value; }
-        }
-        private String m_VendorType5;
-        public String VendorType5
-        {
-            get { return this.m_VendorType5; }
-            set { this.m_VendorType5 = value; }
-        }
-        #endregion
-        // add by zjx 2020-12-20 厂商名字 end
+       
 
-        // add by zjx 2020-12-20 校正角度
-        #region 校正角度
-        private String m_CorrectionType0;
-        public String CorrectionType0
-        {
-            get { return this.m_CorrectionType0; }
-            set { this.m_CorrectionType0 = value; }
-        }
-        private String m_CorrectionType1;
-        public String CorrectionType1
-        {
-            get { return this.m_CorrectionType1; }
-            set { this.m_CorrectionType1 = value; }
-        }
-        private String m_CorrectionType2;
-        public String CorrectionType2
-        {
-            get { return this.m_CorrectionType2; }
-            set { this.m_CorrectionType2 = value; }
-        }
-        private String m_CorrectionType3;
-        public String CorrectionType3
-        {
-            get { return this.m_CorrectionType3; }
-            set { this.m_CorrectionType3 = value; }
-        }
-        private String m_CorrectionType4;
-        public String CorrectionType4
-        {
-            get { return this.m_CorrectionType4; }
-            set { this.m_CorrectionType4 = value; }
-        }
-        private String m_CorrectionType5;
-        public String CorrectionType5
-        {
-            get { return this.m_CorrectionType5; }
-            set { this.m_CorrectionType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 校正角度 end
 
-        //add by zjx 2020-12-20 拉直操作放大倍数
-        #region 拉直操作放大倍数
-        private String m_StraightenTimesType0;
-        public String StraightenTimesType0
-        {
-            get { return this.m_StraightenTimesType0; }
-            set { this.m_StraightenTimesType0 = value; }
-        }
-        private String m_StraightenTimesType1;
-        public String StraightenTimesType1
-        {
-            get { return this.m_StraightenTimesType1; }
-            set { this.m_StraightenTimesType1 = value; }
-        }
-        private String m_StraightenTimesType2;
-        public String StraightenTimesType2
-        {
-            get { return this.m_StraightenTimesType2; }
-            set { this.m_StraightenTimesType2 = value; }
-        }
-        private String m_StraightenTimesType3;
-        public String StraightenTimesType3
-        {
-            get { return this.m_StraightenTimesType3; }
-            set { this.m_StraightenTimesType3 = value; }
-        }
-        private String m_StraightenTimesType4;
-        public String StraightenTimesType4
+        public float  FindCrossMagnification;
+
+        //构造函数
+        public MeasureParam()
         {
-            get { return this.m_StraightenTimesType4; }
-            set { this.m_StraightenTimesType4 = value; }
+            Init();
         }
-        private String m_StraightenTimesType5;
-        public String StraightenTimesType5
+        public bool GetMeasureParamFromConfigration()
         {
-            get { return this.m_StraightenTimesType5; }
-            set { this.m_StraightenTimesType5 = value; }
-        }
+            MeasureParam cfm = this;
 
-        #endregion
-        //add by zjx 2020-12-20 拉直操作放大倍数 end 
+            //设置配置文件默认值
+            bool bResult = false;
 
-        //add by zjx 2020-12-20 样品类型的定位电压
-        #region 样品类型的定位电压
-        private String m_PositioningVoltageeType0;
-        public String PositioningVoltageeType0
-        {
-            get { return this.m_PositioningVoltageeType0; }
-            set { this.m_PositioningVoltageeType0 = value; }
-        }
-        private String m_PositioningVoltageeType1;
-        public String PositioningVoltageeType1
-        {
-            get { return this.m_PositioningVoltageeType1; }
-            set { this.m_PositioningVoltageeType1 = value; }
-        }
-        private String m_PositioningVoltageeType2;
-        public String PositioningVoltageeType2
-        {
-            get { return this.m_PositioningVoltageeType2; }
-            set { this.m_PositioningVoltageeType2 = value; }
-        }
-        private String m_PositioningVoltageeType3;
-        public String PositioningVoltageeType3
-        {
-            get { return this.m_PositioningVoltageeType3; }
-            set { this.m_PositioningVoltageeType3 = value; }
-        }
-        private String m_PositioningVoltageeType4;
-        public String PositioningVoltageeType4
-        {
-            get { return this.m_PositioningVoltageeType4; }
-            set { this.m_PositioningVoltageeType4 = value; }
-        }
-        private String m_PositioningVoltageeType5;
-        public String PositioningVoltageeType5
-        {
-            get { return this.m_PositioningVoltageeType5; }
-            set { this.m_PositioningVoltageeType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的定位电压 end 
+            bool.TryParse(ConfigurationManager.AppSettings["Is_Photograph"].ToString(), out bResult);
+            cfm.Is_Photograph = bResult;
 
-        //add by zjx 2020-12-20 样品类型的定位放大倍数
-        #region 定位放大倍数
-        private String m_PositioningTimesType0;
-        public String PositioningTimesType0
-        {
-            get { return this.m_PositioningTimesType0; }
-            set { this.m_PositioningTimesType0 = value; }
-        }
-        private String m_PositioningTimesType1;
-        public String PositioningTimesType1
-        {
-            get { return this.m_PositioningTimesType1; }
-            set { this.m_PositioningTimesType1 = value; }
-        }
-        private String m_PositioningTimesType2;
-        public String PositioningTimesType2
-        {
-            get { return this.m_PositioningTimesType2; }
-            set { this.m_PositioningTimesType2 = value; }
-        }
-        private String m_PositioningTimesType3;
-        public String PositioningTimesType3
-        {
-            get { return this.m_PositioningTimesType3; }
-            set { this.m_PositioningTimesType3 = value; }
-        }
-        private String m_PositioningTimesType4;
-        public String PositioningTimesType4
-        {
-            get { return this.m_PositioningTimesType4; }
-            set { this.m_PositioningTimesType4 = value; }
-        }
-        private String m_PositioningTimesType5;
-        public String PositioningTimesType5
-        {
-            get { return this.m_PositioningTimesType5; }
-            set { this.m_PositioningTimesType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的定位放大倍数 end 
+            bool.TryParse(ConfigurationManager.AppSettings["PT_Depostion"].ToString(), out bResult);
+            cfm.PT = bResult;
 
-        //add by zjx 2020-12-20 样品类型的拍照电压
-        #region 拍照电压
-        private String m_PhotoVoltageeType0;
-        public String PhotoVoltageeType0
-        {
-            get { return this.m_PhotoVoltageeType0; }
-            set { this.m_PhotoVoltageeType0 = value; }
-        }
-        private String m_PhotoVoltageeType1;
-        public String PhotoVoltageeType1
-        {
-            get { return this.m_PhotoVoltageeType1; }
-            set { this.m_PhotoVoltageeType1 = value; }
-        }
-        private String m_PhotoVoltageeType2;
-        public String PhotoVoltageeType2
-        {
-            get { return this.m_PhotoVoltageeType2; }
-            set { this.m_PhotoVoltageeType2 = value; }
-        }
-        private String m_PhotoVoltageeType3;
-        public String PhotoVoltageeType3
-        {
-            get { return this.m_PhotoVoltageeType3; }
-            set { this.m_PhotoVoltageeType3 = value; }
-        }
-        private String m_PhotoVoltageeType4;
-        public String PhotoVoltageeType4
-        {
-            get { return this.m_PhotoVoltageeType4; }
-            set { this.m_PhotoVoltageeType4 = value; }
-        }
-        private String m_PhotoVoltageeType5;
-        public String PhotoVoltageeType5
-        {
-            get { return this.m_PhotoVoltageeType5; }
-            set { this.m_PhotoVoltageeType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的拍照电压 end 
+            cfm.PTTemp = ConfigurationManager.AppSettings["PT_ELYFile"].ToString();
+            cfm.FIBTemp = ConfigurationManager.AppSettings["FIB_ELYFile"].ToString();
 
-        //add by zjx 2020-12-20 样品类型的拍照放大倍数
-        #region 拍照放大倍数
-        private String m_PhotoTimesType0;
-        public String PhotoTimesType0
-        {
-            get { return this.m_PhotoTimesType0; }
-            set { this.m_PhotoTimesType0 = value; }
-        }
-        private String m_PhotoTimesType1;
-        public String PhotoTimesType1
-        {
-            get { return this.m_PhotoTimesType1; }
-            set { this.m_PhotoTimesType1 = value; }
-        }
-        private String m_PhotoTimesType2;
-        public String PhotoTimesType2
-        {
-            get { return this.m_PhotoTimesType2; }
-            set { this.m_PhotoTimesType2 = value; }
-        }
-        private String m_PhotoTimesType3;
-        public String PhotoTimesType3
-        {
-            get { return this.m_PhotoTimesType3; }
-            set { this.m_PhotoTimesType3 = value; }
-        }
-        private String m_PhotoTimesType4;
-        public String PhotoTimesType4
-        {
-            get { return this.m_PhotoTimesType4; }
-            set { this.m_PhotoTimesType4 = value; }
-        }
-        private String m_PhotoTimesType5;
-        public String PhotoTimesType5
-        {
-            get { return this.m_PhotoTimesType5; }
-            set { this.m_PhotoTimesType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的拍照放大倍数 end 
 
-        //add by zjx 2020-12-20 样品类型的ScanRotate修正参数
-        #region ScanRotate修正参数
-        private String m_ScanRotateType0;
-        public String ScanRotateType0
-        {
-            get { return this.m_ScanRotateType0; }
-            set { this.m_ScanRotateType0 = value; }
-        }
-        private String m_ScanRotateType1;
-        public String ScanRotateType1
-        {
-            get { return this.m_ScanRotateType1; }
-            set { this.m_ScanRotateType1 = value; }
-        }
-        private String m_ScanRotateType2;
-        public String ScanRotateType2
-        {
-            get { return this.m_ScanRotateType2; }
-            set { this.m_ScanRotateType2 = value; }
-        }
-        private String m_ScanRotateType3;
-        public String ScanRotateType3
-        {
-            get { return this.m_ScanRotateType3; }
-            set { this.m_ScanRotateType3 = value; }
-        }
-        private String m_ScanRotateType4;
-        public String ScanRotateType4
-        {
-            get { return this.m_ScanRotateType4; }
-            set { this.m_ScanRotateType4 = value; }
-        }
-        private String m_ScanRotateType5;
-        public String ScanRotateType5
-        {
-            get { return this.m_ScanRotateType5; }
-            set { this.m_ScanRotateType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的ScanRotate修正参数 end 
 
-        //add by zjx 2020-12-20 样品类型的Y轴方向PixelSize修正值
-        #region Y轴方向PixelSize修正值
-        private String m_PixelSizeType0;
-        public String PixelSizeType0
-        {
-            get { return this.m_PixelSizeType0; }
-            set { this.m_PixelSizeType0 = value; }
-        }
-        private String m_PixelSizeType1;
-        public String PixelSizeType1
-        {
-            get { return this.m_PixelSizeType1; }
-            set { this.m_PixelSizeType1 = value; }
-        }
-        private String m_PixelSizeType2;
-        public String PixelSizeType2
-        {
-            get { return this.m_PixelSizeType2; }
-            set { this.m_PixelSizeType2 = value; }
-        }
-        private String m_PixelSizeType3;
-        public String PixelSizeType3
-        {
-            get { return this.m_PixelSizeType3; }
-            set { this.m_PixelSizeType3 = value; }
-        }
-        private String m_PixelSizeType4;
-        public String PixelSizeType4
-        {
-            get { return this.m_PixelSizeType4; }
-            set { this.m_PixelSizeType4 = value; }
-        }
-        private String m_PixelSizeType5;
-        public String PixelSizeType5
-        {
-            get { return this.m_PixelSizeType5; }
-            set { this.m_PixelSizeType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的Y轴方向PixelSize修正值 end 
+            cfm.SampleType = ConfigurationManager.AppSettings["LastSampleType"].ToString();
 
-        //add by zjx 2020-12-20 样品类型的能谱Z轴移动位置
-        #region 能谱Z轴移动位置
-        private String m_SEMAxis_ZType0;
-        public String SEMAxis_ZType0
-        {
-            get { return this.m_SEMAxis_ZType0; }
-            set { this.m_SEMAxis_ZType0 = value; }
-        }
-        private String m_SEMAxis_ZType1;
-        public String SEMAxis_ZType1
-        {
-            get { return this.m_SEMAxis_ZType1; }
-            set { this.m_SEMAxis_ZType1 = value; }
-        }
-        private String m_SEMAxis_ZType2;
-        public String SEMAxis_ZType2
-        {
-            get { return this.m_SEMAxis_ZType2; }
-            set { this.m_SEMAxis_ZType2 = value; }
-        }
-        private String m_SEMAxis_ZType3;
-        public String SEMAxis_ZType3
-        {
-            get { return this.m_SEMAxis_ZType3; }
-            set { this.m_SEMAxis_ZType3 = value; }
-        }
-        private String m_SEMAxis_ZType4;
-        public String SEMAxis_ZType4
-        {
-            get { return this.m_SEMAxis_ZType4; }
-            set { this.m_SEMAxis_ZType4 = value; }
-        }
-        private String m_SEMAxis_ZType5;
-        public String SEMAxis_ZType5
-        {
-            get { return this.m_SEMAxis_ZType5; }
-            set { this.m_SEMAxis_ZType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的能谱Z轴移动位置 end 
+            cfm.Firm = ConfigurationManager.AppSettings["LastSelectFirm"].ToString();
 
-        //add by zjx 2020-12-20 样品类型的能谱电压值
-        #region 能谱电压值
-        private String m_SEMVoltageeType0;
-        public String SEMVoltageeType0
-        {
-            get { return this.m_SEMVoltageeType0; }
-            set { this.m_SEMVoltageeType0 = value; }
-        }
-        private String m_SEMVoltageeType1;
-        public String SEMVoltageeType1
-        {
-            get { return this.m_SEMVoltageeType1; }
-            set { this.m_SEMVoltageeType1 = value; }
-        }
-        private String m_SEMVoltageeType2;
-        public String SEMVoltageeType2
-        {
-            get { return this.m_SEMVoltageeType2; }
-            set { this.m_SEMVoltageeType2 = value; }
-        }
-        private String m_SEMVoltageeType3;
-        public String SEMVoltageeType3
-        {
-            get { return this.m_SEMVoltageeType3; }
-            set { this.m_SEMVoltageeType3 = value; }
-        }
-        private String m_SEMVoltageeType4;
-        public String SEMVoltageeType4
-        {
-            get { return this.m_SEMVoltageeType4; }
-            set { this.m_SEMVoltageeType4 = value; }
-        }
-        private String m_SEMVoltageeType5;
-        public String SEMVoltageeType5
-        {
-            get { return this.m_SEMVoltageeType5; }
-            set { this.m_SEMVoltageeType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的能谱电压值 end
 
-        //add by zjx 2020-12-20 样品类型的能谱电流值
-        #region 能谱电流值
-        private String m_SEMCurrentType0;
-        public String SEMCurrentType0
-        {
-            get { return this.m_SEMCurrentType0; }
-            set { this.m_SEMCurrentType0 = value; }
-        }
-        private String m_SEMCurrentType1;
-        public String SEMCurrentType1
-        {
-            get { return this.m_SEMCurrentType1; }
-            set { this.m_SEMCurrentType1 = value; }
-        }
-        private String m_SEMCurrentType2;
-        public String SEMCurrentType2
-        {
-            get { return this.m_SEMCurrentType2; }
-            set { this.m_SEMCurrentType2 = value; }
-        }
-        private String m_SEMCurrentType3;
-        public String SEMCurrentType3
-        {
-            get { return this.m_SEMCurrentType3; }
-            set { this.m_SEMCurrentType3 = value; }
-        }
-        private String m_SEMCurrentType4;
-        public String SEMCurrentType4
-        {
-            get { return this.m_SEMCurrentType4; }
-            set { this.m_SEMCurrentType4 = value; }
-        }
-        private String m_SEMCurrentType5;
-        public String SEMCurrentType5
-        {
-            get { return this.m_SEMCurrentType5; }
-            set { this.m_SEMCurrentType5 = value; }
-        }
-        #endregion
-        //add by zjx 2020-12-20 样品类型的能谱电流值 end
-        #endregion
 
+            bool.TryParse(ConfigurationManager.AppSettings["Is_Title"].ToString(), out bResult);
+            cfm.Tilt = bResult;
 
-        public float  FindCrossMagnification;
+            bool.TryParse(ConfigurationManager.AppSettings["Is_EDS"].ToString(), out bResult);
+            cfm.EDS = bResult;
 
-        //构造函数
-        public MeasureParam()
-        {
-            Init();
+            cfm.ScanRotCor = Convert.ToSingle(ConfigurationManager.AppSettings["ScanRotCur"].ToString());
+            cfm.PixelSizeCor = Convert.ToSingle(ConfigurationManager.AppSettings["PixelSize_Y_Cur"].ToString());
+
+            cfm.EDS = Convert.ToBoolean(ConfigurationManager.AppSettings["Is_EDS"].ToString());
+            cfm.EDSZ = Convert.ToSingle(ConfigurationManager.AppSettings["EDS_Z"].ToString()) / 1000;
+            cfm.EDSV = Convert.ToSingle(ConfigurationManager.AppSettings["EDS_V"].ToString());
+            cfm.EDSA = Convert.ToSingle(ConfigurationManager.AppSettings["EDS_A"].ToString()) / 1000000000;
+            cfm.EDSParam.XrayCollectMode = Convert.ToInt16(ConfigurationManager.AppSettings["EDS_XrayMode"].ToString());
+
+          cfm.IsCutingForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsCutingForDebug"]);
+            //add by sun 2020-12-17 增加调试时是否切割开关 end
+
+            // add by zjx 2020-12-18 为了测试只做能谱部分
+            cfm.IsonlyEDSForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsonlyEDSForDebug"]);
+            // add by zjx 2020-12-18 为了测试只做能谱部分 end
+
+          cfm.RemoteELYPath = ConfigurationManager.AppSettings["RemoteELYPath"];
+       cfm.RemoteMLFPath = ConfigurationManager.AppSettings["RemoteMLFPath"];
+            return true;
         }
-        public loadParamFromSampleTypeFile(string filename)
+
+
+        public bool loadParamFromSampleTypeTemplate(string filename)
         {
             DirectoryInfo TheFolder = new DirectoryInfo(System.Environment.CurrentDirectory + "\\SampleTemplate");
             XmlDocument doc = new XmlDocument();
@@ -778,46 +321,44 @@ namespace MeasureData
             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);
+            xDouble iprobe = new xDouble();
+          
+            votandI.Register("Votage", vot);
+            votandI.Register("Iprobe", iprobe);
             sFile.Register("VotageAndIprobe", votandI);
 
             Slo tCorrect = new Slo();
-            xInt Ot = new xInt();
-            xInt Int = new xInt();
-            votandI.Register("Outside", Ot);
-            votandI.Register("Inside", Int);
+            xInt Outside = new xInt();
+            xInt inside = new xInt();
+            tCorrect.Register("Outside", Outside);
+            tCorrect.Register("Inside", inside);
             sFile.Register("TiltCorrect", tCorrect);
 
             Slo straighten = new Slo();
             xInt Straightenmag = new xInt();
-            straighten.Register("Magnification", Straightenmag);
-            sFile.Register("Straighten", straighten);
-            Slo bc1 = new Slo();
+            xBool torun = new xBool();
             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);
+            straighten.Register("Magnification", Straightenmag);
+            straighten.Register("ToRun", torun);
+            straighten.Register("Hand_Bright", b1);
+            straighten.Register("Hand_Contrast", c1);
+            straighten.Register("AutoGet", auto1);
+            sFile.Register("Straighten", straighten);
+           
 
 
-            Slo fibwork = new Slo();
-            xBool doptwork = new xBool();
-            fibwork.Register("DoPTWork", doptwork);
-            sFile.Register("FIBWork", fibwork);
+      
 
             Slo findcross = new Slo();
             xInt crossmag = new xInt();
@@ -827,57 +368,55 @@ namespace MeasureData
 
             Slo shotsection = new Slo();
             xInt shotmag = new xInt();
-            straighten.Register("Magnification", shotmag);
-            sFile.Register("shotsection", straighten);
-            Slo bc2 = new Slo();
+
+            xBool auto2 = new xBool();
             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);
+            shotsection.Register("Magnification", shotmag);
+            shotsection.Register("Hand_Bright", b2);
+            shotsection.Register("Hand_Contrast", c2);
+            shotsection.Register("AutoGet", auto2);
+            sFile.Register("ShotSection", shotsection);
 
 
+            sFile.Serialize(false, doc, root);
 
+            this.Location_Magnification = locMag.value();
 
-            //是否拍照和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);
-
+            this.mVoltage = vot.value();
+            this.Iprobe = (float)iprobe.value();
 
-       
-            Serialize(false, doc, root);
+            this.correction_Angle_Inside = inside.value();
+            this.correction_Angle_OutSide = Outside.value();
+            this.StraightenToRun = torun.value();
+            this.straighten_Magnification = Straightenmag.value();
 
-            this.Location_Magnification = locMag.value();
-            this.location_Voltage = vot.value();
-            this.sampleIprobe = (float)i.value();
-            this.correction_Angle
+            this.StraightenAutoBC = auto1.value();
+            this.StraightenManualBrightness = b1.value();
+            this.StraightenManualContrast = c1.value();
 
-            //doc.Save(this.FileName);
+          
 
+            this.FindCrossMagnification = crossmag.value();
 
+            this.photograph_Magnification = shotmag.value();
+            this.ShotSectionAutoBC = auto2.value();
+            this.ShotSectionManualBrightness = b2.value();
+            this.ShotSectionManualConstrast = c2.value();
+          
+            return true;
         }
+
         public void Init()
         {
-            this.SampleName = @"";
+            this.SampleType = @"";
             this.PT = false;
             this.FIBTemp = @"";
             this.PTTemp = @"";
-            this.FocusMode = 2;
+           
            
             this.Tilt = false;
-            this.ZDistance = 0;
+           
             this.EDS = false;
             this.EDSZ = 0.005f;
             this.EDSV = 10000;
@@ -886,11 +425,7 @@ namespace MeasureData
             
             this.ScanRotCor = 1;
             this.PixelSizeCor = 1;
-            //add by sun 2020-12-15 增加不同样品扫描速度参数
-            this.ScanSpeedNormal = "CMD_SCANRATE4";
-            this.ScanSpeedFocus = "CMD_SCANRATE5";
-            this.ScanSpeedHigh = "CMD_SCANRATE7";
-            //add by sun 2020-12-15 增加不同样品扫描速度参数 end
+            
   
         }
 
@@ -923,7 +458,7 @@ namespace MeasureData
 
             //对焦方式
             xInt focusmode = new xInt();
-            focusmode.AssignValue(this.m_fMode);
+         
             sFile.Register("FocusMode", focusmode);
 
             //放大倍数和电压参数
@@ -941,10 +476,10 @@ namespace MeasureData
             xEDSZ.AssignValue(this.edsZ);
             xEDSV.AssignValue(this.edsV);
             xEDSA.AssignValue(this.edsA);
-            ZDistance.AssignValue(this.ZDistance);
-            stretchMagnification.AssignValue(this.stretch_Magnification);
+            //ZDistance.AssignValue(this.ZDistance);
+            stretchMagnification.AssignValue(this.straighten_Magnification);
             locationMagnification.AssignValue(this.location_Magnification);
-            locationVoltage.AssignValue(this.location_Voltage);
+            locationVoltage.AssignValue(this.mVoltage);
             photographMagnification.AssignValue(this.photograph_Magnification);
             photographVoltage.AssignValue(this.photograph_Voltage);
             fibMagnification.AssignValue(this.fib_Magnification);
@@ -954,14 +489,14 @@ namespace MeasureData
             sFile.Register("Photograph_Magnification", photographMagnification);
             sFile.Register("Photograph_Voltage", photographVoltage);
             sFile.Register("FIB_Magnification", fibMagnification);
-            sFile.Register("ZDistance", ZDistance);
+            //sFile.Register("ZDistance", ZDistance);
             sFile.Register("EDSZ", xEDSZ);
             sFile.Register("EDSV", xEDSV);
             sFile.Register("EDSA", xEDSA);
 
             //校正角度
             xDouble correctionAngle = new xDouble();
-            correctionAngle.AssignValue(this.correction_Angle);
+            correctionAngle.AssignValue(this.correction_Angle_Inside);
             sFile.Register("Correction_Angle", correctionAngle);
 
             //样品名称和厂商
@@ -975,14 +510,6 @@ namespace MeasureData
         
             sFile.Register("EDS_Param", this.EDSParam);
 
-          
-          
-
-            
-
-
-         
-
 
             //ScanRotate修正
             xDouble scanRotate = new xDouble();
@@ -1010,24 +537,23 @@ namespace MeasureData
                 this.m_ptTemp = ptELYFile.value();
                 this.m_fibTemp = fibELYFile.value();
 
-                this.m_fMode = focusmode.value();
+              
 
-                this.stretch_Magnification = Convert.ToSingle(stretchMagnification.value());
+                this.straighten_Magnification = Convert.ToSingle(stretchMagnification.value());
                 this.location_Magnification = Convert.ToSingle(locationMagnification.value());
-                this.location_Voltage = Convert.ToSingle(locationVoltage.value());
+                this.mVoltage = Convert.ToSingle(locationVoltage.value());
                 this.photograph_Magnification = Convert.ToSingle(photographMagnification.value());
                 this.photograph_Voltage = Convert.ToSingle(photographVoltage.value());
 
-                this.correction_Angle = Convert.ToSingle(correctionAngle.value());
+                this.correction_Angle_Inside  = Convert.ToSingle(correctionAngle.value());
 
                 this.m_SampleName = sampleType.value();
                 this.firm = _firm.value();
-                this.ZDistance = Convert.ToSingle(ZDistance.value());
+                //this.ZDistance = Convert.ToSingle(ZDistance.value());
                 this.EDSZ = Convert.ToSingle(xEDSZ.value());
                 this.EDSV = Convert.ToSingle(xEDSV.value());
                 this.EDSA = Convert.ToSingle(xEDSA.value());
 
-               
 
                 this.ScanRotCor = Convert.ToSingle(scanRotate.value());
                 this.PixelSizeCor = Convert.ToSingle(pscor.value());

+ 3 - 4
MeasureThread/IFocus.cs

@@ -16,8 +16,7 @@ namespace MeasureThread
 
     public class Focusparam
     {
-        public float voltage;
-        public float Iprobe;
+      
         public float mag;
         public float workingDis;
         public Point reduceWindowPos;
@@ -26,8 +25,8 @@ namespace MeasureThread
         public bool IfAutoBrightnessAndContrast;
         public float brightness;
         public float contrast;
-        public int delayTime;//ms
-        public string ScanSpeed;
+       
+     
         public float tiltCorrAngle;
         public bool ifStig=false;
     }

+ 62 - 99
MeasureThread/Measure.cs

@@ -510,15 +510,7 @@ namespace MeasureThread
             log.Info("进入初始化函数");
             m_measureFile = a_measureFile;
 
-            var p = m_measureFile.MParam;
-            p.FindCrossMagnification = p.Location_Magnification / 3;
-            if (p.SampleName == "3") p.FindCrossMagnification = 400;
-            if (p.SampleName == "4") p.FindCrossMagnification = 300;
-            if (p.SampleName == "5") p.FindCrossMagnification = 300;
-            if (p.FindCrossMagnification < 200)
-            {
-                p.FindCrossMagnification = 200;
-            }
+  
 
             List<CutHole> listHoles = m_measureFile.ListCutHole;
 
@@ -754,9 +746,9 @@ namespace MeasureThread
             //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
             log.Info("测量线程:调用图像处理接口,准备移动样品台", true);
             log.Info("文件名=" + fileName2, true);
-            log.Info("样品类型=" + MParam.SampleName, true);
+            log.Info("样品类型=" + MParam.SampleType, true);
             log.Info("供应商名称=" + MParam.Firm, true);
-            ImagePro.Img_Cut_Position(fileName2, Convert.ToInt32(MParam.SampleName), MParam.Firm, out x1, out y1, out x2, out y2, out state);
+            ImagePro.Img_Cut_Position(fileName2, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out x1, out y1, out x2, out y2, out state);
             log.Info("FIB梯形左上角和右上角位置信息= (" + x1.ToString() + ", " + y1.ToString() + "), (" + x2.ToString() + ", " + y2.ToString() + ")", true);
             log.Info("准备移动样品台返回状态=" + state.ToString(), true);
             if (state == 1)
@@ -782,21 +774,6 @@ namespace MeasureThread
             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() + ")";
            
             if (key_stop)
             {
@@ -905,7 +882,7 @@ namespace MeasureThread
             //5.根据坐标控制SEM移动到切孔位置,居中
             log.Info("测量线程:图像处理接口,准备移动样品台", true);
             log.Info("文件名=" + fileName4, true);
-            ImagePro.Img_Trapezoid_Top_Center_Position(fileName4, Convert.ToInt32(MParam.SampleName), MParam.Firm, out x2, out y2, out state);
+            ImagePro.Img_Trapezoid_Top_Center_Position(fileName4, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out x2, out y2, out state);
 
             log.Info("梯形中心点返回数据=" + x2.ToString() + ", " + y2.ToString(), true);
             log.Info("准备移动样品台返回状态=" + state.ToString(), true);
@@ -954,25 +931,25 @@ namespace MeasureThread
            
             Focusparam fprm = new Focusparam()
             {
-                voltage = MParam.Photograph_Voltage,
+                //voltage = MParam.Photograph_Voltage,
                 mag = MParam.Photograph_Magnification,
                 reduceWindowPos = new System.Drawing.Point(402, 128),
                 reduceWinHeight = 600,
                 reduceWinWidth = 600,
-                ScanSpeed = MParam.ScanSpeedFocus,
+            
                 IfAutoBrightnessAndContrast = true,
                 brightness = 50.0f,
                 contrast = 30.0f,
-                delayTime = 500,
-                Iprobe = 0.2f,
-                tiltCorrAngle = 54,
+              
+             
+                tiltCorrAngle = MParam.Correction_Angle_Inside,
                 workingDis = 5.0f,
 
             };
 
             //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-            float m_TempBrightness=50f;
-            float m_TempContrast=30f;
+            float m_TempBrightness=MParam.ShotSectionManualBrightness;
+            float m_TempContrast = MParam.ShotSectionManualConstrast;
 
             fprm.brightness = m_TempBrightness;
             fprm.contrast = m_TempContrast;
@@ -1031,7 +1008,7 @@ namespace MeasureThread
                
 
                 //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);
+                ImagePro.Img_Measure_Region_Position(fileName6, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out ct, out mag, out ct0, out state);
                 string s = "";
                         for (int i = 0; i < ct.Count; i++)
                         {
@@ -1040,7 +1017,7 @@ namespace MeasureThread
                         }
                         log.Info("测量线程:图像处理接口返回值为" + state.ToString() +
                             ",计算放大区域坐标,输入图像" + fileName6.ToString() +
-                            "输入样品 " + Convert.ToInt32(MParam.SampleName) +
+                            "输入样品 " + Convert.ToInt32(MParam.SampleTypeNo()) +
                             " 输入厂商" + MParam.Firm.ToString() +
                             s +
                           " 输出对焦点为(" + ct0.X.ToString() + "," + ct0.Y.ToString() + ")", true);
@@ -1093,11 +1070,9 @@ namespace MeasureThread
 
                         fprm.reduceWinHeight = 480;
                         fprm.reduceWinWidth = 450;
-                        fprm.tiltCorrAngle = 36;
+                        fprm.tiltCorrAngle = MParam.Correction_Angle_Inside;
 
 
-                        fprm.ScanSpeed = MParam.ScanSpeedFocus;
-
                         fprm.mag = curmag;
                         m_focuse.setFocusParam(fprm);
                         m_focuse.DoFocusBySetMainParameter();
@@ -1145,7 +1120,7 @@ namespace MeasureThread
                        
                         if (n == 0)//如果是第一个观测点就做角度修正
                         {
-                            String fileName5 = currHole.data_path + "\\" + MParam.Firm + "-" + MParam.Photograph_Magnification.ToString("0") + "-" + currHole.HoleName + "-" + ImageName5;
+                            String fileName5 = currHole.data_path + "\\" + MParam.Firm + "-" + mag[n].ToString("0") + "-" + currHole.HoleName + "-" + ImageName5;
                             //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end 
                             log.Info("纠正前 fileName5=" + fileName5, true);
 
@@ -1157,7 +1132,7 @@ namespace MeasureThread
                             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);
+                            ImagePro.Img_Center_Position_OffsetAngle_Direction(fileName5, Convert.ToInt32(MParam.SampleTypeNo()), 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,得到坐标点。判断移动方式
@@ -1201,7 +1176,7 @@ namespace MeasureThread
 
                         }
                        
-                        iSEM.CmdFocusScanSpeed(MParam.ScanSpeedNormal);//CmdFocusRate(4);
+                        iSEM.CmdFocusScanSpeed("CMD_SCANRATE4");//CmdFocusRate(4);
                         Thread.Sleep(200);
                         cycle_time = iSEM.GetCycleTime();
                         Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
@@ -1290,10 +1265,10 @@ namespace MeasureThread
                 #endregion
                 //第二步:设置电流电压
                 //add by sun 2020-12-17 不同样品电压、电流不一致,应设置灵活。123456类电压2000V电流200pA,7类5000V 500pA,能谱 7000V 500pA 
-                log.Warn("测量线程:设置拍照电压 123456类电压2000V电流200pA,7类5000V 500pA,能谱 7000V 500pA  目前是第 " + MParam.SampleName + " 类!", true);
+                log.Warn("测量线程:设置拍照电压 123456类电压2000V电流200pA,7类5000V 500pA,能谱 7000V 500pA  目前是第 " + MParam.SampleType + " 类!", true);
                 if (!SetVoltageAndIPROBE())
                 {
-                    log.Error("测量线程:设置电压电流失败!目前是第 " + MParam.SampleName + " 类!", false);
+                    log.Error("测量线程:设置电压电流失败!目前是第 " + MParam.SampleType + " 类!", false);
                     return false;
                 }               
               
@@ -1303,7 +1278,7 @@ namespace MeasureThread
                 if (MParam.Is_Photograph == false)
                 {
                     log.Info("测量线程:倾斜补偿角度为54度", true);
-                    if (!m_focuse. TiltCorrection(54.0f))
+                    if (!m_focuse. TiltCorrection(MParam.Correction_Angle_OutSide))
                     {
                         log.Error("测量线程报错:倾斜补偿角度为54度失败", false);
 
@@ -1322,7 +1297,7 @@ namespace MeasureThread
                 }
 
                 //第四步:拉直 ( 2是5/6类样品,不需要拉直)
-                if (MParam.SampleName != "2")
+                if (MParam.StraightenToRun)
                 {
 
                     log.Warn("测量线程:拉直操作开始!", true);
@@ -1379,7 +1354,12 @@ namespace MeasureThread
                         m_PTWork.DoWholePTWork();
                     }
                 }
-
+                arg.State = true;
+                arg.Message = "";
+                SendMsg("2-5");
+                arg.State = true;
+                arg.Message = "";
+                SendMsg("2-6");
 
 
                 log.Info("测量线程:自动定位结束!", true);
@@ -1451,7 +1431,7 @@ namespace MeasureThread
                     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);
+                    ImagePro.Img_Measure_Height(limg_path, lsize, currHole.data_path + "\\", Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out state);
                     if (state == 0)
                     {
 
@@ -1492,11 +1472,11 @@ namespace MeasureThread
         {
 
             //设置拉直的放大倍数
-            log.Info("测量线程:设置拉直放大倍数,放大倍数为" + MParam.Stretch_Magnification.ToString(), true);
+            log.Info("测量线程:设置拉直放大倍数,放大倍数为" + MParam.Straighten_Magnification.ToString(), true);
 
-            if (!m_focuse.SetMagnification(MParam.Stretch_Magnification))
+            if (!m_focuse.SetMagnification(MParam.Straighten_Magnification))
             {
-                log.Error("测量线程报错:设置SEM放大倍数为拉直放大倍数失败,放大倍数为" + MParam.Stretch_Magnification.ToString(), false);
+                log.Error("测量线程报错:设置SEM放大倍数为拉直放大倍数失败,放大倍数为" + MParam.Straighten_Magnification.ToString(), false);
 
                 return false;
             }
@@ -1510,13 +1490,14 @@ namespace MeasureThread
             var p = new Focusparam();
 
             p.IfAutoBrightnessAndContrast = true;
-            p.mag = MParam.Stretch_Magnification;
+            p.mag = MParam.Straighten_Magnification;
             p.reduceWindowPos = new System.Drawing.Point(402, 128);
             p.reduceWinWidth = 400;
             p.reduceWinHeight = 400;
-          
+            p.brightness = MParam.StraightenManualBrightness;
+            p.contrast = MParam.StraightenManualContrast;
             m_focuse.setFocusParam(p);
-            if (!m_focuse.DoFocusByNewMagnification(MParam.Stretch_Magnification))
+            if (!m_focuse.DoFocusByNewMagnification(MParam.Straighten_Magnification))
             {
                 log.Error("测量线程报错:拉直操作自动对焦失败,程序退出。", false);
               
@@ -1537,7 +1518,7 @@ namespace MeasureThread
 
 
             //2、拍张照片
-            String fileName0 = currHole.data_path + "\\" + currHole.HoleName + "_" + MParam.Stretch_Magnification.ToString("0") + "_" + ImageName0;
+            String fileName0 = currHole.data_path + "\\" + currHole.HoleName + "_" + MParam.Straighten_Magnification.ToString("0") + "_" + ImageName0;
             log.Info("测量线程:设置保存图像的是扫描速度保存图像" + fileName0, true);
             //拍照前改变速度,延时
 
@@ -1559,7 +1540,7 @@ namespace MeasureThread
             float degree = 0;
             int direction = 0;
             int state = 1;
-            ImagePro.Img_OffsetAngle_Direction(fileName0, Convert.ToInt32(MParam.SampleName), MParam.Firm, out degree, out direction, out state);
+            ImagePro.Img_OffsetAngle_Direction(fileName0, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out degree, out direction, out state);
             log.Info("测量线程:使用图像处理接口:样品" + currHole.HoleNo.ToString() + "初始化拉直角度=" + degree.ToString(), true);
             log.Info("图像处理结果拉直角度=" + degree.ToString(), true);
             log.Info("图像处理结果拉直角度=" + degree.ToString(), true);
@@ -1668,7 +1649,7 @@ namespace MeasureThread
                     case 0://point mode
                            //点数据
                         int state = 0;
-                        ImagePro.EDS_Param_Points(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleName), MParam.Firm, out listPoints, out state);
+                        ImagePro.EDS_Param_Points(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out listPoints, out state);
                         if (state == 0)
                         {
                             log.Error("点采集失败", false);
@@ -1712,7 +1693,7 @@ namespace MeasureThread
 
                         log.Info("线扫描", true);
                         state = 0;
-                        ImagePro.EDS_Param_Lines(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleName), MParam.Firm, out LinesStartPoint, out lines_height, out state);
+                        ImagePro.EDS_Param_Lines(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out LinesStartPoint, out lines_height, out state);
                         string sp = "";
                         foreach (System.Drawing.Point p in LinesStartPoint)
                         {
@@ -1790,7 +1771,7 @@ namespace MeasureThread
                     case 2: //area mode
                             //面数据
                         state = 0;
-                        ImagePro.EDS_Param_Areas(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleName), MParam.Firm, out area_pt, out width, out height, out state);
+                        ImagePro.EDS_Param_Areas(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out area_pt, out width, out height, out state);
                         log.Info("面返回数据" + area_pt.X.ToString() + "," + area_pt.Y.ToString() + ",height=" + height.ToString() + ",width=" + width.ToString(), true);
                         if (state == 1)
                         {
@@ -1887,7 +1868,6 @@ namespace MeasureThread
             Focusparam focusPrm = new Focusparam()
             {
                 IfAutoBrightnessAndContrast = true,
-                ScanSpeed = MParam.ScanSpeedHigh,
                 mag = tmag,
                 reduceWindowPos = new System.Drawing.Point(256, 192),
                 reduceWinWidth = 400,
@@ -1895,7 +1875,7 @@ namespace MeasureThread
                 workingDis = 10,//unit:mm
                 brightness = 50,
                 contrast = 29,
-                tiltCorrAngle = 54,
+                tiltCorrAngle = MParam.Correction_Angle_OutSide,
                 ifStig = false,
 
             };
@@ -1933,7 +1913,7 @@ namespace MeasureThread
             //5.根据坐标控制SEM移动到切孔位置,居中
             log.Info("测量线程:图像处理接口,准备移动样品台", true);
             log.Info("文件名=" + fileName4, true);
-            ImagePro.Img_Trapezoid_Top_Center_Position(fileName4, Convert.ToInt32(MParam.SampleName), MParam.Firm, out x2, out y2, out state);
+            ImagePro.Img_Trapezoid_Top_Center_Position(fileName4, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out x2, out y2, out state);
            
             log.Info("梯形中心点返回数据=" + x2.ToString() + ", " + y2.ToString(), true);
             log.Info("准备移动样品台返回状态=" + state.ToString(), true);
@@ -1983,15 +1963,13 @@ namespace MeasureThread
                 reduceWindowPos = new System.Drawing.Point(402, 128),
                 reduceWinHeight = 600,
                 reduceWinWidth = 600,
-                ScanSpeed = MParam.ScanSpeedFocus,
+               
                 IfAutoBrightnessAndContrast = true,
-                delayTime = 500,
-                voltage = 7000,
-                Iprobe = 0.5f,
+              
                 workingDis = 10,//unit mm
                 brightness = 50,
                 contrast = 29,
-                tiltCorrAngle = 54,
+                tiltCorrAngle = MParam.Correction_Angle_Inside,
                 ifStig = false,
             };
           
@@ -2039,7 +2017,7 @@ namespace MeasureThread
                 System.Drawing.Point ct0;
                 float  magMax;
                 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);
+                ImagePro.Img_Measure_Region_Position(fileName5, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out ct, out mag, out ct0, out state);
                 string s = "";
                 for (int i = 0; i < ct.Count; i++)
                 {
@@ -2048,7 +2026,7 @@ namespace MeasureThread
                 }
                 log.Info("测量线程:图像处理接口返回值为" + state.ToString() +
                     ",计算两个放大区域坐标,输入图像" + fileName5.ToString() +
-                    "输入样品" + Convert.ToInt32(MParam.SampleName) +
+                    "输入样品" + Convert.ToInt32(MParam.SampleTypeNo()) +
                     "输入厂商" + MParam.Firm.ToString() +
                     s +
                   "输出对焦点为(" + ct0.X.ToString() + "," + ct0.Y.ToString() + ")", true);
@@ -2071,7 +2049,7 @@ namespace MeasureThread
 
                     Thread.Sleep(200);
                     //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭
-                    iSEM.CmdFocusScanSpeed(MParam.ScanSpeedFocus);//CmdFocusRate(5);
+                    iSEM.CmdFocusScanSpeed("CMD_SCANRATE5");//CmdFocusRate(5);
                     //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end
                     
                     cycle_time = iSEM.GetCycleTime();
@@ -2082,15 +2060,13 @@ namespace MeasureThread
                         reduceWindowPos = new System.Drawing.Point(402, 128),
                         reduceWinHeight = 600,
                         reduceWinWidth = 600,
-                        ScanSpeed = MParam.ScanSpeedFocus,
+                   
                         IfAutoBrightnessAndContrast = true,
-                        delayTime = 500,
-                        voltage = 7000,
-                        Iprobe = 0.5f,
+                      
                         workingDis = 10,
                         brightness = 49.4f,
                         contrast = 30.1f,
-                        tiltCorrAngle = 36,
+                        tiltCorrAngle = MParam.Correction_Angle_Inside,
                         ifStig = false,
                     };
                                                                                           
@@ -2146,8 +2122,8 @@ namespace MeasureThread
 
                 Thread.Sleep(200);
 
-                log.Info("改变刷新率 " + MParam.ScanSpeedNormal);
-                iSEM.CmdFocusScanSpeed(MParam.ScanSpeedNormal);//CmdFocusRate(4);
+                log.Info("改变刷新率 " + "CMD_SCANRATE4");
+                iSEM.CmdFocusScanSpeed("CMD_SCANRATE4");//CmdFocusRate(4);
                
                 cycle_time = iSEM.GetCycleTime();
                 Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
@@ -2242,32 +2218,19 @@ namespace MeasureThread
         #region 设置电压电流
         public bool SetVoltageAndIPROBE()
         {
-            log.Info("测量线程:设置电压电流 123456类电压2000V电流200pA,7类5000V 500pA,能谱 7000V 500pA  目前是第 " + MParam.SampleName + " 类!", true);
-            //这块应该做成参数!!! 暂时写死。类型3 则为 5000V 500pA
+            log.Info("测量线程:设置电压电流 123456类电压2000V电流200pA,7类5000V 500pA,能谱 7000V 500pA  目前是第 " + MParam.SampleType + " 类!", true);
+          
             bool mRet_VoltageFlag = false;
             bool mRet_ElecFlag = false;
-            if (MParam.SampleName == "4" || MParam.SampleName == "5")
-            {
-                mRet_VoltageFlag = iSEM.SetSEMVoltage(5000);
-                Thread.Sleep(500);
-                mRet_ElecFlag = iSEM.SetSEMIPROBE(0.2F / 1000000000);
-                Thread.Sleep(500);
-            }
-            else if (MParam.SampleName == "3")
-            {
-                mRet_VoltageFlag = iSEM.SetSEMVoltage(5000);
-                Thread.Sleep(500);
-                mRet_ElecFlag = iSEM.SetSEMIPROBE(0.5F / 1000000000);
-                Thread.Sleep(500);
-            }
-            else
-            {              
-
-                mRet_VoltageFlag = iSEM.SetSEMVoltage(2000);
+            float vot, iprobe;
+            vot = MParam.Voltage;
+            iprobe = MParam.Iprobe;
+            
+                mRet_VoltageFlag = iSEM.SetSEMVoltage(vot);
                 Thread.Sleep(500);
-                mRet_ElecFlag = iSEM.SetSEMIPROBE(0.2F / 1000000000);
+                mRet_ElecFlag = iSEM.SetSEMIPROBE(iprobe / 1000000000);
                 Thread.Sleep(500);
-            }
+           
             if (!mRet_VoltageFlag) return false;
             if (!mRet_ElecFlag) return false;
             log.Info("测量线程:设置电压电流完成!", true);

+ 1 - 1
MeasureThread/PTWork.cs

@@ -52,7 +52,7 @@ namespace MeasureThread
                 log.Error("测量线程报错: PT沉积失败");
                 return false;
             }
-
+            
 
             Thread.Sleep(200);
             log.Info ("测量线程:撤出PT针", false);

+ 2 - 1
MeasureThread/Photo.cs

@@ -47,7 +47,8 @@ namespace MeasureThread
             iSEM.SetContrast(c + 1);
             Thread.Sleep(200);
         }
-        public bool TakePhoto()        {
+        public bool TakePhoto()
+        {
             
 
             if (!iSEM.SetMagnification(prm.Mag))