浏览代码

修改配置文件与参数不同步的bug

HaoShuang 4 年之前
父节点
当前提交
0f33c19015

+ 17 - 17
HOZProject/FormHOZMain.cs

@@ -140,23 +140,23 @@ namespace HOZProject
                 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["Focus_UP"].ToString());
-                m_MeasureFile.MParam.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-                m_MeasureFile.MParam.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-                m_MeasureFile.MParam.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-                m_MeasureFile.MParam.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
-
-                m_MeasureFile.MParam.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
-                m_MeasureFile.MParam.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-                m_MeasureFile.MParam.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-                m_MeasureFile.MParam.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-                m_MeasureFile.MParam.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
-
-                m_MeasureFile.MParam.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
-                m_MeasureFile.MParam.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-                m_MeasureFile.MParam.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-                m_MeasureFile.MParam.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-                m_MeasureFile.MParam.AutoStigY.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_Ms.X_Min = Convert.ToSingle(ConfigurationManager.AppSettings["X_Min"]);

+ 55 - 36
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -76,6 +76,7 @@
             this.chkWqxkc = new System.Windows.Forms.CheckBox();
             this.label3 = new System.Windows.Forms.Label();
             this.cbbYDZZDX = new System.Windows.Forms.TextBox();
+            this.btOK = new System.Windows.Forms.Button();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbDelWLZ)).BeginInit();
@@ -98,7 +99,7 @@
             this.label1.ForeColor = System.Drawing.Color.LightGray;
             this.label1.Location = new System.Drawing.Point(15, 9);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(77, 14);
+            this.label1.Size = new System.Drawing.Size(109, 20);
             this.label1.TabIndex = 0;
             this.label1.Text = "初始化设置";
             // 
@@ -135,7 +136,7 @@
             this.tbCutHoleFilePath.Location = new System.Drawing.Point(129, 49);
             this.tbCutHoleFilePath.Name = "tbCutHoleFilePath";
             this.tbCutHoleFilePath.ReadOnly = true;
-            this.tbCutHoleFilePath.Size = new System.Drawing.Size(347, 23);
+            this.tbCutHoleFilePath.Size = new System.Drawing.Size(347, 30);
             this.tbCutHoleFilePath.TabIndex = 5;
             // 
             // txtWPTF
@@ -144,7 +145,7 @@
             this.txtWPTF.Location = new System.Drawing.Point(129, 100);
             this.txtWPTF.Name = "txtWPTF";
             this.txtWPTF.ReadOnly = true;
-            this.txtWPTF.Size = new System.Drawing.Size(346, 23);
+            this.txtWPTF.Size = new System.Drawing.Size(346, 30);
             this.txtWPTF.TabIndex = 7;
             // 
             // lblCutHoleCount
@@ -154,7 +155,7 @@
             this.lblCutHoleCount.ForeColor = System.Drawing.Color.LightGray;
             this.lblCutHoleCount.Location = new System.Drawing.Point(127, 79);
             this.lblCutHoleCount.Name = "lblCutHoleCount";
-            this.lblCutHoleCount.Size = new System.Drawing.Size(126, 14);
+            this.lblCutHoleCount.Size = new System.Drawing.Size(179, 20);
             this.lblCutHoleCount.TabIndex = 8;
             this.lblCutHoleCount.Text = "成功导入0个分析点";
             // 
@@ -166,7 +167,7 @@
             this.chkManul.Location = new System.Drawing.Point(455, 181);
             this.chkManul.Margin = new System.Windows.Forms.Padding(2);
             this.chkManul.Name = "chkManul";
-            this.chkManul.Size = new System.Drawing.Size(82, 18);
+            this.chkManul.Size = new System.Drawing.Size(115, 24);
             this.chkManul.TabIndex = 15;
             this.chkManul.Text = "手动对焦";
             this.chkManul.UseVisualStyleBackColor = true;
@@ -180,7 +181,7 @@
             this.label6.Location = new System.Drawing.Point(13, 54);
             this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(77, 14);
+            this.label6.Size = new System.Drawing.Size(109, 20);
             this.label6.TabIndex = 17;
             this.label6.Text = "导入分析点";
             // 
@@ -198,7 +199,7 @@
             this.cbbWPZD.Location = new System.Drawing.Point(129, 258);
             this.cbbWPZD.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWPZD.Name = "cbbWPZD";
-            this.cbbWPZD.Size = new System.Drawing.Size(132, 21);
+            this.cbbWPZD.Size = new System.Drawing.Size(132, 28);
             this.cbbWPZD.TabIndex = 99;
             this.cbbWPZD.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWPZD_KeyPress);
             // 
@@ -215,7 +216,7 @@
             this.cbbWPZF.Location = new System.Drawing.Point(439, 258);
             this.cbbWPZF.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWPZF.Name = "cbbWPZF";
-            this.cbbWPZF.Size = new System.Drawing.Size(132, 21);
+            this.cbbWPZF.Size = new System.Drawing.Size(132, 28);
             this.cbbWPZF.TabIndex = 98;
             this.cbbWPZF.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWPZF_KeyPress);
             // 
@@ -233,7 +234,7 @@
             this.cbbWQGD.Location = new System.Drawing.Point(129, 301);
             this.cbbWQGD.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWQGD.Name = "cbbWQGD";
-            this.cbbWQGD.Size = new System.Drawing.Size(132, 21);
+            this.cbbWQGD.Size = new System.Drawing.Size(132, 28);
             this.cbbWQGD.TabIndex = 97;
             this.cbbWQGD.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWQGD_KeyPress);
             // 
@@ -250,7 +251,7 @@
             this.cbbWQGF.Location = new System.Drawing.Point(439, 301);
             this.cbbWQGF.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWQGF.Name = "cbbWQGF";
-            this.cbbWQGF.Size = new System.Drawing.Size(132, 21);
+            this.cbbWQGF.Size = new System.Drawing.Size(132, 28);
             this.cbbWQGF.TabIndex = 96;
             this.cbbWQGF.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWQGF_KeyPress);
             // 
@@ -267,7 +268,7 @@
             this.cbbWLZ.Location = new System.Drawing.Point(439, 344);
             this.cbbWLZ.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWLZ.Name = "cbbWLZ";
-            this.cbbWLZ.Size = new System.Drawing.Size(132, 21);
+            this.cbbWLZ.Size = new System.Drawing.Size(132, 28);
             this.cbbWLZ.TabIndex = 95;
             this.cbbWLZ.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWLZ_KeyPress);
             // 
@@ -283,7 +284,7 @@
             this.cbbWXZ.Location = new System.Drawing.Point(129, 344);
             this.cbbWXZ.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWXZ.Name = "cbbWXZ";
-            this.cbbWXZ.Size = new System.Drawing.Size(132, 21);
+            this.cbbWXZ.Size = new System.Drawing.Size(132, 28);
             this.cbbWXZ.TabIndex = 94;
             // 
             // cbbWCS
@@ -294,7 +295,7 @@
             this.cbbWCS.Location = new System.Drawing.Point(438, 215);
             this.cbbWCS.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWCS.Name = "cbbWCS";
-            this.cbbWCS.Size = new System.Drawing.Size(132, 21);
+            this.cbbWCS.Size = new System.Drawing.Size(132, 28);
             this.cbbWCS.TabIndex = 93;
             // 
             // cbbWYP
@@ -305,7 +306,7 @@
             this.cbbWYP.Location = new System.Drawing.Point(129, 215);
             this.cbbWYP.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWYP.Name = "cbbWYP";
-            this.cbbWYP.Size = new System.Drawing.Size(132, 21);
+            this.cbbWYP.Size = new System.Drawing.Size(132, 28);
             this.cbbWYP.TabIndex = 92;
             // 
             // label58
@@ -316,7 +317,7 @@
             this.label58.Location = new System.Drawing.Point(13, 347);
             this.label58.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label58.Name = "label58";
-            this.label58.Size = new System.Drawing.Size(63, 14);
+            this.label58.Size = new System.Drawing.Size(89, 20);
             this.label58.TabIndex = 91;
             this.label58.Text = "校正角度";
             // 
@@ -328,7 +329,7 @@
             this.label50.Location = new System.Drawing.Point(13, 261);
             this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label50.Name = "label50";
-            this.label50.Size = new System.Drawing.Size(77, 14);
+            this.label50.Size = new System.Drawing.Size(109, 20);
             this.label50.TabIndex = 90;
             this.label50.Text = "拍照电压/V";
             // 
@@ -340,7 +341,7 @@
             this.label54.Location = new System.Drawing.Point(299, 262);
             this.label54.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label54.Name = "label54";
-            this.label54.Size = new System.Drawing.Size(91, 14);
+            this.label54.Size = new System.Drawing.Size(129, 20);
             this.label54.TabIndex = 89;
             this.label54.Text = "拍照放大倍数";
             // 
@@ -352,7 +353,7 @@
             this.label46.Location = new System.Drawing.Point(13, 304);
             this.label46.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label46.Name = "label46";
-            this.label46.Size = new System.Drawing.Size(77, 14);
+            this.label46.Size = new System.Drawing.Size(109, 20);
             this.label46.TabIndex = 88;
             this.label46.Text = "定位电压/V";
             // 
@@ -364,7 +365,7 @@
             this.label42.Location = new System.Drawing.Point(299, 305);
             this.label42.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label42.Name = "label42";
-            this.label42.Size = new System.Drawing.Size(91, 14);
+            this.label42.Size = new System.Drawing.Size(129, 20);
             this.label42.TabIndex = 87;
             this.label42.Text = "定位放大倍数";
             // 
@@ -376,7 +377,7 @@
             this.label38.Location = new System.Drawing.Point(299, 348);
             this.label38.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label38.Name = "label38";
-            this.label38.Size = new System.Drawing.Size(119, 14);
+            this.label38.Size = new System.Drawing.Size(169, 20);
             this.label38.TabIndex = 86;
             this.label38.Text = "拉直操作放大倍数";
             // 
@@ -388,7 +389,7 @@
             this.chkWIsP.Location = new System.Drawing.Point(247, 181);
             this.chkWIsP.Margin = new System.Windows.Forms.Padding(2);
             this.chkWIsP.Name = "chkWIsP";
-            this.chkWIsP.Size = new System.Drawing.Size(68, 18);
+            this.chkWIsP.Size = new System.Drawing.Size(95, 24);
             this.chkWIsP.TabIndex = 85;
             this.chkWIsP.Text = "仅拍照";
             this.chkWIsP.UseVisualStyleBackColor = true;
@@ -402,7 +403,7 @@
             this.label48.Location = new System.Drawing.Point(13, 218);
             this.label48.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label48.Name = "label48";
-            this.label48.Size = new System.Drawing.Size(63, 14);
+            this.label48.Size = new System.Drawing.Size(89, 20);
             this.label48.TabIndex = 81;
             this.label48.Text = "样品类型";
             // 
@@ -414,7 +415,7 @@
             this.label56.Location = new System.Drawing.Point(299, 219);
             this.label56.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label56.Name = "label56";
-            this.label56.Size = new System.Drawing.Size(35, 14);
+            this.label56.Size = new System.Drawing.Size(49, 20);
             this.label56.TabIndex = 80;
             this.label56.Text = "厂商";
             // 
@@ -426,7 +427,7 @@
             this.label59.Location = new System.Drawing.Point(13, 147);
             this.label59.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label59.Name = "label59";
-            this.label59.Size = new System.Drawing.Size(84, 14);
+            this.label59.Size = new System.Drawing.Size(119, 20);
             this.label59.TabIndex = 79;
             this.label59.Text = "FIB文件名称";
             // 
@@ -438,7 +439,7 @@
             this.label61.Location = new System.Drawing.Point(13, 105);
             this.label61.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label61.Name = "label61";
-            this.label61.Size = new System.Drawing.Size(77, 14);
+            this.label61.Size = new System.Drawing.Size(109, 20);
             this.label61.TabIndex = 78;
             this.label61.Text = "PT文件名称";
             // 
@@ -450,7 +451,7 @@
             this.chkWPT.Location = new System.Drawing.Point(351, 181);
             this.chkWPT.Margin = new System.Windows.Forms.Padding(2);
             this.chkWPT.Name = "chkWPT";
-            this.chkWPT.Size = new System.Drawing.Size(68, 18);
+            this.chkWPT.Size = new System.Drawing.Size(95, 24);
             this.chkWPT.TabIndex = 77;
             this.chkWPT.Text = "使用PT";
             this.chkWPT.UseVisualStyleBackColor = true;
@@ -460,7 +461,7 @@
             // 
             this.btnCreateConfig.Cursor = System.Windows.Forms.Cursors.Hand;
             this.btnCreateConfig.ForeColor = System.Drawing.Color.Black;
-            this.btnCreateConfig.Location = new System.Drawing.Point(14, 421);
+            this.btnCreateConfig.Location = new System.Drawing.Point(303, 421);
             this.btnCreateConfig.Margin = new System.Windows.Forms.Padding(2);
             this.btnCreateConfig.Name = "btnCreateConfig";
             this.btnCreateConfig.Size = new System.Drawing.Size(135, 41);
@@ -475,7 +476,7 @@
             this.txtWFIBF.Location = new System.Drawing.Point(129, 142);
             this.txtWFIBF.Name = "txtWFIBF";
             this.txtWFIBF.ReadOnly = true;
-            this.txtWFIBF.Size = new System.Drawing.Size(346, 23);
+            this.txtWFIBF.Size = new System.Drawing.Size(346, 30);
             this.txtWFIBF.TabIndex = 103;
             // 
             // pbDelWLZ
@@ -625,7 +626,7 @@
             // 
             this.btnSaveDefalutPara.Cursor = System.Windows.Forms.Cursors.Hand;
             this.btnSaveDefalutPara.ForeColor = System.Drawing.Color.Black;
-            this.btnSaveDefalutPara.Location = new System.Drawing.Point(455, 421);
+            this.btnSaveDefalutPara.Location = new System.Drawing.Point(454, 421);
             this.btnSaveDefalutPara.Margin = new System.Windows.Forms.Padding(2);
             this.btnSaveDefalutPara.Name = "btnSaveDefalutPara";
             this.btnSaveDefalutPara.Size = new System.Drawing.Size(135, 41);
@@ -647,7 +648,7 @@
             this.cbbWFIB.Location = new System.Drawing.Point(130, 390);
             this.cbbWFIB.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWFIB.Name = "cbbWFIB";
-            this.cbbWFIB.Size = new System.Drawing.Size(132, 21);
+            this.cbbWFIB.Size = new System.Drawing.Size(132, 28);
             this.cbbWFIB.TabIndex = 114;
             this.cbbWFIB.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbWFIB_KeyPress);
             // 
@@ -659,7 +660,7 @@
             this.label2.Location = new System.Drawing.Point(13, 393);
             this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(84, 14);
+            this.label2.Size = new System.Drawing.Size(119, 20);
             this.label2.TabIndex = 113;
             this.label2.Text = "FIB放大倍数";
             // 
@@ -669,7 +670,7 @@
             this.chkWqxkc.ForeColor = System.Drawing.Color.LightGray;
             this.chkWqxkc.Location = new System.Drawing.Point(129, 181);
             this.chkWqxkc.Name = "chkWqxkc";
-            this.chkWqxkc.Size = new System.Drawing.Size(82, 18);
+            this.chkWqxkc.Size = new System.Drawing.Size(115, 24);
             this.chkWqxkc.TabIndex = 115;
             this.chkWqxkc.Text = "倾斜观测";
             this.chkWqxkc.UseVisualStyleBackColor = true;
@@ -683,25 +684,42 @@
             this.label3.Location = new System.Drawing.Point(299, 393);
             this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(112, 14);
+            this.label3.Size = new System.Drawing.Size(149, 20);
             this.label3.TabIndex = 116;
-            this.label3.Text = "移动Z轴大小(mm)";
+            this.label3.Text = "移动Z轴大小/mm";
+            this.label3.Visible = false;
             // 
             // cbbYDZZDX
             // 
             this.cbbYDZZDX.Location = new System.Drawing.Point(438, 390);
             this.cbbYDZZDX.Name = "cbbYDZZDX";
-            this.cbbYDZZDX.Size = new System.Drawing.Size(131, 23);
+            this.cbbYDZZDX.Size = new System.Drawing.Size(131, 30);
             this.cbbYDZZDX.TabIndex = 117;
+            this.cbbYDZZDX.Visible = false;
             this.cbbYDZZDX.TextChanged += new System.EventHandler(this.cbbYDZZDX_TextChanged);
             this.cbbYDZZDX.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbYDZZDX_KeyPress);
             // 
+            // btOK
+            // 
+            this.btOK.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.btOK.ForeColor = System.Drawing.Color.Black;
+            this.btOK.Location = new System.Drawing.Point(454, 422);
+            this.btOK.Margin = new System.Windows.Forms.Padding(2);
+            this.btOK.Name = "btOK";
+            this.btOK.Size = new System.Drawing.Size(135, 41);
+            this.btOK.TabIndex = 118;
+            this.btOK.Text = "确认";
+            this.btOK.UseVisualStyleBackColor = true;
+            this.btOK.Visible = false;
+            this.btOK.Click += new System.EventHandler(this.button1_Click);
+            // 
             // UControl_Init
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 20F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Black;
             this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.Controls.Add(this.btOK);
             this.Controls.Add(this.cbbYDZZDX);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.chkWqxkc);
@@ -819,5 +837,6 @@
         private System.Windows.Forms.CheckBox chkWqxkc;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.TextBox cbbYDZZDX;
+        private System.Windows.Forms.Button btOK;
     }
 }

+ 210 - 78
HOZProject/UserControls/UControl_Init.cs

@@ -13,26 +13,60 @@ using FileManager;
 using System.IO;
 using System.Runtime.InteropServices;
 
+//20201029:注释
+//初始化窗口管理的是参数,包括,测量文件使用的参数,配置文件中的参数(默认参数),或者保存成参数文件。
+//初始化窗口中显示的参数是测量文件在使用的参数。
+//点击确认,对当前修改的参数保存到测量文件中去。
+//点击保存默认设置,当前修改的参数保存到AppConfig中,下次打开时作为默认值打开。
+//点击保存成配置文件,将以文件的形式将参数保存在文件中
+//参数又分为两种类型,客户操作可见的类型,在AppConfig中参数,
+//客户操作的参数,可以每次都针对测量进行修改
+//这类参数包括:
+//是否是倾斜的样品台
+//是否仅拍照
+//是否使用PT
+//PT加工文件
+//FIB加工文件
+//样品名称
+//厂商
+//拉直操作的放大倍数
+//定位的电压
+//定位的放大倍数
+//拍照的电压
+//拍照的放大倍数
+//AppConfig中的参数,通常不需要修改,每次修改要在配置文件中修改,要重新启动程序
+//这类参数包括:
+//四组对焦参数
+//Z轴的移动距离
+//各个参数需要有一系列的默认值,并且各个值可以修改,删除
 
 namespace HOZProject
 {
     public partial class UControl_Init : UserControl
     {
         #region 成员变量
-        String[] sT;
-        String[] firms;
-        String[] WPZD;
-        String[] WPZF;
-        String[] WQGD;
-        String[] WQGF;
-        String[] WLZ;
-        String[] WFIB;
+
+        //可供选择的各个参数的值列表
+        String[] sT;//样品类型列表
+        String[] firms;//厂商列表
+        String[] WPZD;//拍照电压列表
+        String[] WPZF;//拍照放大倍数列表
+        String[] WQGD;//定位电压列表
+        String[] WQGF;//定位电压放大倍数列表
+        String[] WLZ;//拉直电压列表
+        String[] WFIB;//FIB电压列表
+
+        //配置文件
         Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+
+        //依附与主工作窗口
         private FormHOZMain formHOZMain;
         public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
+        
         //模板路径
         private string readConfigPath;
         public string ReadConfigPath { get => readConfigPath; set => readConfigPath = value; }
+        
         //模板文件默认路径
         private string m_TemplateFilePath;
         #endregion
@@ -48,13 +82,16 @@ namespace HOZProject
         #region 窗体加载
         private void UControl_Init_Load(object sender, EventArgs e)
         {
-
+            //从配置文件中读取一系列的信息
         } 
         #endregion
 
         #region 关闭窗体
         private void btnClose_Click(object sender, EventArgs e)
         {
+            //按照当前的值,更新测量文件的参数
+            SaveMeasureFile();
+
             Form fParent = this.ParentForm;
             fParent.Close();
         }
@@ -85,7 +122,7 @@ namespace HOZProject
                         lblCutHoleCount.Text = string.Format("成功导入{0}个切孔", ListCutHole.Count);
                         tbCutHoleFilePath.Text = CutHoleFilePath;
                         //保存测量文件
-                        if (FormHOZMainObject.IsSave)
+                        if (Directory.Exists(FormHOZMainObject.m_MeasureFile.FilePath))
                         {
                             FormHOZMainObject.m_MeasureFile.Save();
                         }
@@ -300,20 +337,22 @@ namespace HOZProject
         /// <returns></returns>
         public MeasureParam GetMeasureParamInfo()
         {
+            //从当前界面内获取参数
             MeasureParam cfm = new MeasureParam();
-            cfm.Is_Photograph = chkWIsP.Checked;
-            cfm.PT = chkWPT.Checked;
+            cfm.Is_Photograph = chkWIsP.Checked;//是否仅拍照
+            cfm.PT = chkWPT.Checked;//是否有PT
+            cfm.Title = chkWqxkc.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.PTTemp = txtWPTF.Text;//PT文件路径
+            cfm.FIBTemp = txtWFIBF.Text;//FIB文件路径
+            cfm.Stretch_Magnification = Convert.ToSingle(cbbWLZ.Text);//来自放大倍数
+            cfm.Location_Magnification = Convert.ToSingle(cbbWQGF.Text);//定位的放大倍数
+            cfm.Location_Voltage = Convert.ToSingle(cbbWQGD.Text);//定位的放大电压
+            cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);//拍照的放大倍数
+            cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);//拍照的电压
+            cfm.FIB_Magnification = Convert.ToSingle(cbbWFIB.Text);//FIB的放大倍数
+            if (cbbWXZ.SelectedIndex == 0)//校正角度
             {
                 cfm.Correction_Angle = 36;
             }
@@ -322,16 +361,20 @@ namespace HOZProject
                 cfm.Correction_Angle = 54;
             }
 
-            cfm.SampleName = cbbWYP.Text;
-            cfm.Firm = cbbWCS.Text;
+            cfm.SampleName = cbbWYP.Text;//样品类型
+            cfm.Firm = cbbWCS.Text;//厂商类型
             return cfm;
         }
 
         public void SaveTemplateFile()
         {
-            MeasureParam cfm = new MeasureParam();
+            //获取当前文件的参数
+            MeasureParam cfm = FormHOZMainObject.m_MeasureFile.MParam;
+            
+            //根据界面显示内容更新参数
             cfm.Is_Photograph = chkWIsP.Checked;
             cfm.PT = chkWPT.Checked;
+            cfm.Title = chkWqxkc.Checked;//是否倾斜样品台
             //自动对焦模式
             //cfm.FocusMode = chkManul.Checked;
             cfm.PTTemp = txtWPTF.Text;
@@ -353,25 +396,57 @@ namespace HOZProject
 
             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);
-            if (!m_TemplateFilePath.Equals(""))
+
+            m_TemplateFilePath = ConfigurationManager.AppSettings["TemplateFilePath"].ToString();
+
+            //如果路径不存在,要求选择一个路径
+            if (!Directory.Exists(m_TemplateFilePath))
             {
-                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)
                 {
-                    //创建路径
-                    //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");//重新加载新的配置文件
-                    }
+                    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;
@@ -461,6 +536,7 @@ namespace HOZProject
                 }
 
                 MeasureParam cfm = new MeasureParam();
+                cfm = FormHOZMainObject.m_MeasureFile.MParam;
                 cfm.Is_Photograph = chkWIsP.Checked;
                 
                 cfm.FocusMode = Convert.ToInt32(config.AppSettings.Settings["Focus_Mode"].Value);
@@ -505,7 +581,7 @@ namespace HOZProject
                 config.AppSettings.Settings["Correction_Angle"].Value = cfm.Correction_Angle.ToString();
                 config.AppSettings.Settings["SampleName"].Value = cfm.SampleName;
                 config.AppSettings.Settings["Firms"].Value = cfm.Firm;
-
+                config.AppSettings.Settings["FIB_Magnification"].Value = cfm.FIB_Magnification.ToString();
                 config.AppSettings.Settings["Is_Title"].Value = cfm.Title.ToString();
                 config.AppSettings.Settings["ZDistance"].Value = cfm.ZDistance.ToString();
                 config.Save(ConfigurationSaveMode.Modified);
@@ -575,6 +651,13 @@ namespace HOZProject
                         string wWLZ = string.Join(",", _WLZ.ToArray());
                         config.AppSettings.Settings["WLZ"].Value = wWLZ;
                         break;
+                    case "WFIB":
+                        //FIB放大倍数
+                        List<String> _WFIB = WFIB.ToList();
+                        _WFIB.Remove(selName);
+                        string wWFIB = string.Join(",", _WFIB.ToArray());
+                        config.AppSettings.Settings["WFIB"].Value = wWFIB;
+                        break;
                 }
                 config.Save(ConfigurationSaveMode.Modified);
                 ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
@@ -672,16 +755,16 @@ namespace HOZProject
             cbbWPZD.Text = config.AppSettings.Settings["Photograph_Voltage"].Value;
             cbbWFIB.Text = config.AppSettings.Settings["FIB_Magnification"].Value;
             string Correction_Angle = config.AppSettings.Settings["Correction_Angle"].Value;
-            if (Convert.ToBoolean(config.AppSettings.Settings["Is_Title"].Value))
-            {
-                cbbYDZZDX.Visible = true;
-                label3.Visible = true;
-            }
-            else
-            {
-                cbbYDZZDX.Visible = false;
-                label3.Visible = false;
-            }
+            //if (Convert.ToBoolean(config.AppSettings.Settings["Is_Title"].Value))
+            //{
+            //    cbbYDZZDX.Visible = true;
+            //    label3.Visible = true;
+            //}
+            //else
+            //{
+            //    cbbYDZZDX.Visible = false;
+            //    label3.Visible = false;
+            //}
             if (Correction_Angle == "36")
             {
                 cbbWXZ.SelectedIndex = 0;
@@ -702,7 +785,7 @@ namespace HOZProject
             if (!ReadConfigPath.Equals(""))
             {
                 ReloadConfig();
-                ConfigFile cfm = new ConfigFile(new MeasureParam());
+                ConfigFile cfm = new ConfigFile(FormHOZMainObject.m_MeasureFile.MParam);
                 cfm.Read(ReadConfigPath);
                 chkWIsP.Checked = cfm.m_Config.Is_Photograph;
                 chkWPT.Checked = cfm.m_Config.PT;
@@ -747,6 +830,9 @@ namespace HOZProject
                 {
                     MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
+
+                //增加一个测量文件的参数修改
+                SaveMeasureFile();
             }
         }
         #endregion
@@ -829,6 +915,7 @@ namespace HOZProject
         }
         #endregion
 
+        #region 从配置文件中读取测量参数
         public MeasureParam GetMeasureParam()
         {
             MeasureParam cfm = new MeasureParam();
@@ -874,23 +961,23 @@ namespace HOZProject
             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["Focus_UP"].ToString());
-            cfm.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-            cfm.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-            cfm.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-            cfm.FIBFocus.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["Focus_UP"].ToString());
-            cfm.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-            cfm.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-            cfm.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-            cfm.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_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["Focus_UP"].ToString());
-            cfm.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
-            cfm.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
-            cfm.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
-            cfm.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_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.Title = bResult;
@@ -900,7 +987,7 @@ namespace HOZProject
 
             return cfm;
         }
-
+        #endregion
 
         #region 创建切孔列表
         private void CreateCutHoleList()
@@ -1021,22 +1108,21 @@ namespace HOZProject
         }
         #endregion
 
+        #region Z轴的保护范围
         private void chkWqxkc_CheckedChanged(object sender, EventArgs e)
         {
-            if (chkWqxkc.Checked) 
-            {
-                label3.Visible = true;
-                cbbYDZZDX.Visible = true;
-            }
-            else
-            {
-                label3.Visible = false;
-                cbbYDZZDX.Visible = false;
-            }
+            //if (chkWqxkc.Checked) 
+            //{
+            //    label3.Visible = true;
+            //    cbbYDZZDX.Visible = true;
+            //}
+            //else
+            //{
+            //    label3.Visible = false;
+            //    cbbYDZZDX.Visible = false;
+            //}
         }
 
-
-
         private void cbbYDZZDX_TextChanged(object sender, EventArgs e)
         {
             if (cbbYDZZDX.Text!="")
@@ -1061,5 +1147,51 @@ namespace HOZProject
                 e.Handled = true;
             }
         }
+        #endregion
+        
+        #region 参数确认
+        private void SaveMeasureFile()
+        {
+            //界面上的参数
+            FormHOZMainObject.m_MeasureFile.MParam = GetMeasureParamInfo();
+            //配置文件中的参数
+            FormHOZMainObject.m_MeasureFile.MParam.ZDistance = Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"].ToString());
+
+            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Step"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Range"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_FStep"].ToString());
+
+            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_UP"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Down"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.Step = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Step"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.Range = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_Range"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.FIBFocus.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["FIB_FStep"].ToString());
+
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_UP"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Down"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Step"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_Range"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigX.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigX_FStep"].ToString());
+
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.UP = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_UP"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.Down = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Down"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.Step = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Step"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.Range = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_Range"].ToString());
+            FormHOZMainObject.m_MeasureFile.MParam.AutoStigY.fStep = Convert.ToSingle(ConfigurationManager.AppSettings["StigY_FStep"].ToString());
+
+            FormHOZMainObject.m_MeasureFile.IsModified = true;
+            if (Directory.Exists(FormHOZMainObject.m_MeasureFile.FilePath))//如果已经存在硬盘上要重新保存文件
+            {
+                FormHOZMainObject.m_MeasureFile.Save();
+            }
+        }
+        private void button1_Click(object sender, EventArgs e)
+        {
+            //保存测量文件的参数
+            SaveMeasureFile();
+        }
+        #endregion
     }
 }

+ 5 - 5
MeasureThread/Measure.cs

@@ -1017,7 +1017,7 @@ namespace MeasureThread
 
                 //根据当前的stigX重新计算像散值
                 float currentStigX = iSEM.GetAstigmatismX();
-                m_MsParam.AutoStigX.Step = 10; //像散的步长为10
+                //m_MsParam.AutoStigX.Step = 10; //像散的步长为10
                 m_MsParam.AutoStigX.UP = currentStigX - m_MsParam.AutoStigX.Step;
                 m_MsParam.AutoStigX.Down = currentStigX + m_MsParam.AutoStigX.Step;
 
@@ -1051,7 +1051,7 @@ namespace MeasureThread
 
                 //根据当前的stigX重新计算像散值
                 float currentStigY = iSEM.GetAstigmatismY();
-                m_MsParam.AutoStigY.Step = 10; //像散的步长为10
+                //m_MsParam.AutoStigY.Step = 10; //像散的步长为10
                 m_MsParam.AutoStigY.UP = currentStigY - m_MsParam.AutoStigY.Step;
                 m_MsParam.AutoStigY.Down = currentStigY + m_MsParam.AutoStigY.Step;
 
@@ -1133,7 +1133,7 @@ namespace MeasureThread
 
                 //根据当前的stigX重新计算像散值
                 float currentFIBFocus = iSEM.GetFIBObjectivePotential();
-                m_MsParam.FIBFocus.Step = 10; //像散的步长为10
+                //m_MsParam.FIBFocus.Step = 10; //像散的步长为10
                 m_MsParam.FIBFocus.UP = currentFIBFocus - m_MsParam.FIBFocus.Step;
                 m_MsParam.FIBFocus.Down = currentFIBFocus + m_MsParam.FIBFocus.Step;
 
@@ -1769,7 +1769,7 @@ namespace MeasureThread
                 return false;
             }
 
-            //从高倍到低倍不用对焦
+            //从高倍到低倍不用对焦,这里应该使用程序去判断要不要对焦
             ////2.控制SEM自动对焦、亮度、对比度-接口,,将自动对焦提出单独函数调用
             //if (ImageFocus("1-18"))
             //{
@@ -3292,7 +3292,7 @@ namespace MeasureThread
                 }
                 else
                 {
-                    LogManager.AddHardwareLog("自动消像散参数设置有误", true);
+                    LogManager.AddHardwareLog("FIB对焦参数设置有误,对焦类型错", true);
                     return false;
                 }