zhangjiaxin 4 years ago
parent
commit
e37b7fa02d

+ 2 - 2
HOZProject/App.config

@@ -43,7 +43,7 @@
       <!--厂商-->
       <add key="Firms" value=""/>
       <!--是否倾斜样品台-->
-      <add key="Is_Title" value="False"/>
+      <add key="Is_Title" value="True"/>
       <!--是否仅拍照-->
       <add key="Is_Photograph" value="True"/>
       <!--是否PT沉积-->
@@ -51,7 +51,7 @@
       <!--FIB的放大倍数-->
       <add key="FIB_Magnification" value="1500"/>
       <!--Z轴移动距离-->
-      <add key="ZDistance" value="0"/>
+      <add key="ZDistance" value="20"/>
       <!--层高分析的放大倍数-->
       <add key="FH_Magnification" value="1500"/>
       <!--层高分析的电压-->

+ 7 - 14
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -75,7 +75,7 @@
             this.label2 = new System.Windows.Forms.Label();
             this.chkWqxkc = new System.Windows.Forms.CheckBox();
             this.label3 = new System.Windows.Forms.Label();
-            this.cbbYDZZDX = new System.Windows.Forms.ComboBox();
+            this.cbbYDZZDX = new System.Windows.Forms.TextBox();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbDelWLZ)).BeginInit();
@@ -683,25 +683,18 @@
             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(84, 14);
+            this.label3.Size = new System.Drawing.Size(112, 14);
             this.label3.TabIndex = 116;
-            this.label3.Text = "移动Z轴大小";
+            this.label3.Text = "移动Z轴大小(mm)";
             // 
             // cbbYDZZDX
             // 
-            this.cbbYDZZDX.Font = new System.Drawing.Font("宋体", 10F);
-            this.cbbYDZZDX.ForeColor = System.Drawing.SystemColors.WindowText;
-            this.cbbYDZZDX.FormattingEnabled = true;
-            this.cbbYDZZDX.Items.AddRange(new object[] {
-            "600",
-            "1000",
-            "2000",
-            "10000"});
             this.cbbYDZZDX.Location = new System.Drawing.Point(438, 390);
-            this.cbbYDZZDX.Margin = new System.Windows.Forms.Padding(2);
             this.cbbYDZZDX.Name = "cbbYDZZDX";
-            this.cbbYDZZDX.Size = new System.Drawing.Size(132, 21);
+            this.cbbYDZZDX.Size = new System.Drawing.Size(131, 23);
             this.cbbYDZZDX.TabIndex = 117;
+            this.cbbYDZZDX.TextChanged += new System.EventHandler(this.cbbYDZZDX_TextChanged);
+            this.cbbYDZZDX.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbbYDZZDX_KeyPress);
             // 
             // UControl_Init
             // 
@@ -825,6 +818,6 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.CheckBox chkWqxkc;
         private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.ComboBox cbbYDZZDX;
+        private System.Windows.Forms.TextBox cbbYDZZDX;
     }
 }

+ 52 - 1
HOZProject/UserControls/UControl_Init.cs

@@ -461,6 +461,7 @@ namespace HOZProject
 
                 MeasureParam cfm = new MeasureParam();
                 cfm.Is_Photograph = chkWIsP.Checked;
+                
                 cfm.FocusMode = Convert.ToInt32(config.AppSettings.Settings["Focus_Mode"].Value);
                 cfm.PT = chkWPT.Checked;
                 //自动对焦模式
@@ -473,6 +474,12 @@ namespace HOZProject
                 cfm.Photograph_Magnification = Convert.ToSingle(cbbWPZF.Text);
                 cfm.Photograph_Voltage = Convert.ToSingle(cbbWPZD.Text);
                 cfm.FIB_Magnification = Convert.ToSingle(cbbWFIB.Text);
+
+                //倾斜观测
+                cfm.Title = chkWqxkc.Checked;
+                //移动Z轴大小
+                cfm.ZDistance = Convert.ToSingle(cbbYDZZDX.Text);
+
                 if (cbbWXZ.SelectedIndex == 0)
                 {
                     cfm.Correction_Angle = 36;
@@ -498,6 +505,8 @@ namespace HOZProject
                 config.AppSettings.Settings["SampleName"].Value = cfm.SampleName;
                 config.AppSettings.Settings["Firms"].Value = cfm.Firm;
 
+                config.AppSettings.Settings["Is_Title"].Value = cfm.Title.ToString();
+                config.AppSettings.Settings["ZDistance"].Value = cfm.ZDistance.ToString();
                 config.Save(ConfigurationSaveMode.Modified);
                 ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
                 return true;
@@ -606,7 +615,7 @@ namespace HOZProject
             cbbWQGF.Items.Clear();
             cbbWLZ.Items.Clear();
             cbbWFIB.Items.Clear();
-
+            cbbYDZZDX.Text = "0";
             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();
@@ -616,6 +625,9 @@ namespace HOZProject
             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();
+            
+            
             //样品类型
             sT = sample_Type.Split(',');
             BindComboxData(cbbWYP, sT);
@@ -644,6 +656,10 @@ namespace HOZProject
             //设置配置文件默认值
             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轴大小
+            cbbYDZZDX.Text = config.AppSettings.Settings["ZDistance"].Value;
             //自动对焦模式
             //chkManul.Checked = Convert.ToBoolean(config.AppSettings.Settings["Focus_Mode"].Value);
             txtWPTF.Text = config.AppSettings.Settings["PT_ELYFile"].Value;
@@ -655,6 +671,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 (Correction_Angle == "36")
             {
                 cbbWXZ.SelectedIndex = 0;
@@ -1024,5 +1050,30 @@ namespace HOZProject
             //}
         }
         #endregion
+
+        private void cbbYDZZDX_TextChanged(object sender, EventArgs e)
+        {
+            if (cbbYDZZDX.Text!="")
+            {
+                if (Convert.ToSingle(cbbYDZZDX.Text)>40)
+                {
+                  MessageBox.Show("数值最大为40");
+                  cbbYDZZDX.Text = "40";
+                  }
+            }
+            else
+            {
+                cbbYDZZDX.Text = "0";
+            }
+            
+        }
+
+        private void cbbYDZZDX_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            if (((int)e.KeyChar < 48 || (int)e.KeyChar > 57) && (int)e.KeyChar != 8 && (int)e.KeyChar != 46)
+            {
+                e.Handled = true;
+            }
+        }
     }
 }