Browse Source

optimize EDS collection.

gsp 4 years ago
parent
commit
0c4526d2e5

+ 5 - 3
ExtenderControl/Extender.cs

@@ -257,6 +257,7 @@ namespace Extender
                     case OxfordCommand.XrayAreaCollectiong:
                         {
                             AreaXrayParam p = currentCommand.areaXrayPrm;
+                            log.Info("线程:开始线扫xray");
                             if (myExtender.XrayAreaCollectiong( p.dMilliSecondsTime, p.a_listChord,out p.XrayData, out p.a_listElement))
                             {
                                 currentCommand.areaXrayPrm = p;
@@ -265,6 +266,7 @@ namespace Extender
                             }
                             else
                             {
+                                log.Error("线程:失败线扫xray");
                                 currentCommand.returnType = false;
                             }
                             endEvent.Set();
@@ -1589,7 +1591,7 @@ namespace Extender
 
             if (!ReadXrayData(edSpectrum, out m_XrayData, XRayChannelLength))
             {
-                MessageBox.Show("Xray采集完成,获取图像像素失败!");
+                MessageBox.Show("Xray采集完成,获取xray失败!");
             }
             long nXraycount = 0;
             for (int i = 0; i < 2000; i++)
@@ -1814,9 +1816,9 @@ namespace Extender
                         Thread.Sleep(100);
                         Application.DoEvents();
                         lastingTime += 100;
-                        if (lastingTime > EDSColletionTimeOut*3)
+                        if (lastingTime > EDSColletionTimeOut*8)
                         {
-                            //EdSpectrumAcquisitionController.EndMultipleAcquisition();
+                           
                             return false;
                         }
                     }

+ 10 - 14
HOZProject/FormHOZMain.cs

@@ -1,6 +1,7 @@
 using FileManager;
 using MeasureData;
 using MeasureThread;
+using SenseShield;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -163,8 +164,7 @@ namespace HOZProject
                 m_Ms.SendThreadStatus += new ThreadStatusHandler(displayMessage);
                 //注册事件
                 m_Ms.SendCutHolesStatus += new CutHolesStatusHandler(displayCutHoleMessage); 
-                //设置控件操作
-                SetWinControlMeasureState(false);
+              
                 //自动测量的全过程
                 m_Ms.DoMeasure();
             }
@@ -218,7 +218,7 @@ namespace HOZProject
         {
             try
             {
-                // DogDecrypting.decrypting(100);//参数为许可号
+                DogDecrypting.decrypting(100);//参数为许可号
                 //加载控件的点击事件
                 this.Click += new EventHandler(FormHOZMain_Click);
                 plFill.Click += new EventHandler(FormHOZMain_Click);
@@ -232,7 +232,7 @@ namespace HOZProject
                 this.plTop.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
             //新建
                 m_MeasureFile = new MeasureFile();
-                GetParamFromConfigFile();//读到参数对象中    
+                m_MeasureFile.MParam.GetMeasureParamFromConfigration() ;//读到参数对象中    
            
                 uControl_Init.DisplayInitialParam();//显示到界面上
                 
@@ -332,7 +332,7 @@ namespace HOZProject
             pbNew.Enabled = cState;
             pbOpen.Enabled = cState;
             pbSave.Enabled = cState;
-            pbInit.Enabled = cState;
+           // pbInit.Enabled = cState;
             pbImportTemplateFile.Enabled = cState;
             //pbLog.Enabled = cState;
             pbStart.Enabled = cState;
@@ -425,7 +425,7 @@ namespace HOZProject
                    
                    
                    
-                    m_MeasureFile.Save();
+                    //m_MeasureFile.Save();
                     this.Close();
                 }
             }
@@ -461,18 +461,12 @@ namespace HOZProject
         #region 新建、保存、打开、初始化、导入配置、查看日志
         private void pbNew_Click(object sender, EventArgs e)
         {
-            GetParamFromConfigFile();
-        }
-
-        private void GetParamFromConfigFile()
-        {
           
-
-      
-            
             m_MeasureFile.MParam.GetMeasureParamFromConfigration();
         }
 
+        
+
         private void pbSave_Click(object sender, EventArgs e)
         {
             Saveclick();
@@ -785,6 +779,8 @@ namespace HOZProject
                 {
                     log.Info("开始", true);
                     m_BackgroundWorker.RunWorkerAsync(this);
+                    //设置控件操作
+                    SetWinControlMeasureState(false);
                     pbStop.Visible = true;
                     pbStart.Visible = false;
                 }

+ 10 - 10
HOZProject/MeasureXML/MeasureStructXml.xml

@@ -11,8 +11,8 @@
 
     <Step Index="6"  Code="2-0" IsData="False" Type="Photo" IsShow="True" Title="FIB操作" Details="设置拍照放大倍数"></Step>
     <Step Index="7"  Code="2-1" IsData="False" Type="FIB" IsShow="True" Title="FIB操作" Details="切换到FIB模式"></Step>
-    <Step Index="8"  Code="2-2" IsData="False" Type="FIB" IsShow="True" Title="FIB操作" Details="设置放大倍数"></Step>
-    <Step Index="9"  Code="2-3" IsData="True" Type="FIB" IsShow="True" Title="FIB操作" Details="拍照"></Step>
+    <Step Index="8"  Code="2-2" IsData="False" Type="FIB" IsShow="False" Title="FIB操作" Details="设置放大倍数"></Step>
+    <Step Index="9"  Code="2-3" IsData="True" Type="FIB" IsShow="False" Title="FIB操作" Details="拍照"></Step>
     <Step Index="10"  Code="2-4" IsData="False" Type="Pt" IsShow="True" Title="FIB操作" Details="插入PT针"></Step>
     <Step Index="11"  Code="2-5" IsData="False" Type="Pt" IsShow="True" Title="FIB操作" Details="PT沉积"></Step>
     <Step Index="12"  Code="2-6" IsData="False" Type="Pt" IsShow="True" Title="FIB操作" Details="撤出PT针"></Step>
@@ -21,16 +21,16 @@
 
 
     <Step Index="15"  Code="3-0" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="切换到SEM模式"></Step>
-    <Step Index="16"  Code="3-1" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="设置拍照放大倍数"></Step>
+    <Step Index="16"  Code="3-1" IsData="False" Type="FIB" IsShow="False" Title="层高分析" Details="设置拍照放大倍数"></Step>
     <Step Index="17"  Code="3-2" IsData="True" Type="FIB" IsShow="True" Title="层高分析" Details="SEM拍照"></Step>
-    <Step Index="18"  Code="3-3" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="获取中心点位置并移动"></Step>
-    <Step Index="19"  Code="3-4" IsData="False" Type="Photo" IsShow="True" Title="层高分析" Details="设置定位放大倍数"></Step>
-    <Step Index="20"  Code="3-5" IsData="False" Type="Photo" IsShow="True" Title="层高分析" Details="定位位置自动对焦"></Step>
-    <Step Index="21"  Code="3-6" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="设置观测时的角度补偿"></Step>
+    <Step Index="18"  Code="3-3" IsData="False" Type="FIB" IsShow="False" Title="层高分析" Details="获取中心点位置并移动"></Step>
+    <Step Index="19"  Code="3-4" IsData="False" Type="Photo" IsShow="False" Title="层高分析" Details="设置定位放大倍数"></Step>
+    <Step Index="20"  Code="3-5" IsData="False" Type="Photo" IsShow="False" Title="层高分析" Details="定位位置自动对焦"></Step>
+    <Step Index="21"  Code="3-6" IsData="False" Type="FIB" IsShow="False" Title="层高分析" Details="设置观测时的角度补偿"></Step>
     <Step Index="22"  Code="3-7" IsData="True" Type="Photo" IsShow="True" Title="层高分析" Details="SEM拍照"></Step>
     <Step Index="23"  Code="3-8" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="获取观测形状的角度并补偿"></Step>
-    <Step Index="24"  Code="3-9" IsData="True" Type="FIB" IsShow="True" Title="层高分析" Details="SEM拍照"></Step>
-    <Step Index="25"  Code="3-10" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="获取位置及放大倍数"></Step>
+    <Step Index="24"  Code="3-9" IsData="True" Type="FIB" IsShow="False" Title="层高分析" Details="SEM拍照"></Step>
+    <Step Index="25"  Code="3-10" IsData="False" Type="FIB" IsShow="False" Title="层高分析" Details="获取位置及放大倍数"></Step>
     <Step Index="26"  Code="3-11" IsData="True" Type="FIB" IsShow="True" Title="层高分析" Details="移动到拍摄点拍照"></Step>
     <Step Index="27"  Code="3-12" IsData="False" Type="FIB" IsShow="True" Title="层高分析" Details="自动层高分析"></Step>
 
@@ -40,7 +40,7 @@
     <Step Index="30"  Code="4-2" IsData="False" Type="FIB" IsShow="True" Title="能谱分析" Details="拍照并获取拍摄点位置信息"></Step>
     <Step Index="31"  Code="4-3" IsData="False" Type="FIB" IsShow="True" Title="能谱分析" Details="移动到拍摄点位置"></Step>
     <Step Index="32"  Code="4-4" IsData="False" Type="FIB" IsShow="True" Title="能谱分析" Details="放大并对拍摄点对焦"></Step>
-    <Step Index="33"  Code="4-5" IsData="True" Type="FIB" IsShow="True" Title="能谱分析" Details="能谱拍照"></Step>
+    <Step Index="33"  Code="4-5" IsData="True" Type="FIB" IsShow="False" Title="能谱分析" Details="能谱拍照"></Step>
     <Step Index="34"  Code="4-6" IsData="False" Type="FIB" IsShow="True" Title="能谱分析" Details="采集能谱信息"></Step>
   
   </MeasureFlow>

+ 4 - 0
HOZProject/UnitControl.csproj

@@ -53,6 +53,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\bin\Debug\NLog.dll</HintPath>
     </Reference>
+    <Reference Include="SlmRuntimeCSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\bin\Release\SlmRuntimeCSharp.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />

+ 132 - 22
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -60,7 +60,6 @@
             this.label28 = new System.Windows.Forms.Label();
             this.label29 = new System.Windows.Forms.Label();
             this.label30 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
             this.btnHandSavePoints = new System.Windows.Forms.Button();
             this.btnFIBTemplateFile = new System.Windows.Forms.Button();
             this.btnPTTemplateFile = new System.Windows.Forms.Button();
@@ -73,6 +72,16 @@
             this.txtMag4 = new System.Windows.Forms.TextBox();
             this.txtVot = new System.Windows.Forms.TextBox();
             this.txtIprobe = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.txtScanRotCur = new System.Windows.Forms.TextBox();
+            this.txtYPSCur = new System.Windows.Forms.TextBox();
+            this.txtEDSZ = new System.Windows.Forms.TextBox();
+            this.txtEDSV = new System.Windows.Forms.TextBox();
+            this.txtEDSA = new System.Windows.Forms.TextBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             this.panel2.SuspendLayout();
@@ -177,7 +186,7 @@
             this.cbbWCS.Font = new System.Drawing.Font("宋体", 10F);
             this.cbbWCS.ForeColor = System.Drawing.SystemColors.WindowText;
             this.cbbWCS.FormattingEnabled = true;
-            this.cbbWCS.Location = new System.Drawing.Point(502, 185);
+            this.cbbWCS.Location = new System.Drawing.Point(497, 190);
             this.cbbWCS.Margin = new System.Windows.Forms.Padding(2);
             this.cbbWCS.Name = "cbbWCS";
             this.cbbWCS.Size = new System.Drawing.Size(155, 25);
@@ -286,7 +295,7 @@
             this.label56.AutoSize = true;
             this.label56.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label56.ForeColor = System.Drawing.Color.Black;
-            this.label56.Location = new System.Drawing.Point(466, 189);
+            this.label56.Location = new System.Drawing.Point(455, 190);
             this.label56.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label56.Name = "label56";
             this.label56.Size = new System.Drawing.Size(39, 20);
@@ -322,7 +331,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(502, 285);
+            this.chkWPT.Location = new System.Drawing.Point(191, 156);
             this.chkWPT.Margin = new System.Windows.Forms.Padding(2);
             this.chkWPT.Name = "chkWPT";
             this.chkWPT.Size = new System.Drawing.Size(86, 27);
@@ -412,7 +421,7 @@
             "0",
             "1",
             "2"});
-            this.cboXrayMode.Location = new System.Drawing.Point(502, 234);
+            this.cboXrayMode.Location = new System.Drawing.Point(496, 420);
             this.cboXrayMode.Margin = new System.Windows.Forms.Padding(2);
             this.cboXrayMode.Name = "cboXrayMode";
             this.cboXrayMode.Size = new System.Drawing.Size(155, 25);
@@ -423,7 +432,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(413, 234);
+            this.label28.Location = new System.Drawing.Point(406, 425);
             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);
@@ -435,7 +444,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(666, 240);
+            this.label29.Location = new System.Drawing.Point(659, 431);
             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);
@@ -447,25 +456,13 @@
             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(666, 265);
+            this.label30.Location = new System.Drawing.Point(659, 456);
             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);
             this.label30.TabIndex = 142;
             this.label30.Text = "2:area";
             // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.ForeColor = System.Drawing.Color.Black;
-            this.label4.Location = new System.Drawing.Point(375, 186);
-            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(69, 20);
-            this.label4.TabIndex = 80;
-            this.label4.Text = "样品类名";
-            // 
             // btnHandSavePoints
             // 
             this.btnHandSavePoints.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -596,12 +593,112 @@
             this.txtIprobe.Size = new System.Drawing.Size(155, 27);
             this.txtIprobe.TabIndex = 149;
             // 
+            // 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(395, 234);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(99, 20);
+            this.label3.TabIndex = 142;
+            this.label3.Text = "角度补偿参数";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.ForeColor = System.Drawing.Color.Black;
+            this.label5.Location = new System.Drawing.Point(386, 267);
+            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(108, 20);
+            this.label5.TabIndex = 142;
+            this.label5.Text = "Y轴方向修正值";
+            // 
+            // txtScanRotCur
+            // 
+            this.txtScanRotCur.Location = new System.Drawing.Point(497, 232);
+            this.txtScanRotCur.Name = "txtScanRotCur";
+            this.txtScanRotCur.Size = new System.Drawing.Size(156, 27);
+            this.txtScanRotCur.TabIndex = 150;
+            // 
+            // txtYPSCur
+            // 
+            this.txtYPSCur.Location = new System.Drawing.Point(498, 265);
+            this.txtYPSCur.Name = "txtYPSCur";
+            this.txtYPSCur.Size = new System.Drawing.Size(156, 27);
+            this.txtYPSCur.TabIndex = 150;
+            // 
+            // txtEDSZ
+            // 
+            this.txtEDSZ.Location = new System.Drawing.Point(497, 301);
+            this.txtEDSZ.Name = "txtEDSZ";
+            this.txtEDSZ.Size = new System.Drawing.Size(156, 27);
+            this.txtEDSZ.TabIndex = 150;
+            // 
+            // txtEDSV
+            // 
+            this.txtEDSV.Location = new System.Drawing.Point(498, 334);
+            this.txtEDSV.Name = "txtEDSV";
+            this.txtEDSV.Size = new System.Drawing.Size(156, 27);
+            this.txtEDSV.TabIndex = 150;
+            // 
+            // txtEDSA
+            // 
+            this.txtEDSA.Location = new System.Drawing.Point(498, 367);
+            this.txtEDSA.Name = "txtEDSA";
+            this.txtEDSA.Size = new System.Drawing.Size(156, 27);
+            this.txtEDSA.TabIndex = 150;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.ForeColor = System.Drawing.Color.Black;
+            this.label4.Location = new System.Drawing.Point(398, 304);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(93, 20);
+            this.label4.TabIndex = 142;
+            this.label4.Text = "能谱Z轴位置";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.ForeColor = System.Drawing.Color.Black;
+            this.label7.Location = new System.Drawing.Point(422, 341);
+            this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(69, 20);
+            this.label7.TabIndex = 142;
+            this.label7.Text = "能谱电压";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.ForeColor = System.Drawing.Color.Black;
+            this.label8.Location = new System.Drawing.Point(422, 374);
+            this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(69, 20);
+            this.label8.TabIndex = 142;
+            this.label8.Text = "能谱电流";
+            // 
             // UControl_Init
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 17F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
             this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.Controls.Add(this.txtEDSA);
+            this.Controls.Add(this.txtEDSV);
+            this.Controls.Add(this.txtEDSZ);
+            this.Controls.Add(this.txtYPSCur);
+            this.Controls.Add(this.txtScanRotCur);
             this.Controls.Add(this.txtMag4);
             this.Controls.Add(this.txtMag3);
             this.Controls.Add(this.txtMag2);
@@ -612,6 +709,11 @@
             this.Controls.Add(this.cboXrayMode);
             this.Controls.Add(this.label30);
             this.Controls.Add(this.label29);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.label28);
             this.Controls.Add(this.chkEDS);
             this.Controls.Add(this.btnHandSavePoints);
@@ -632,7 +734,6 @@
             this.Controls.Add(this.label38);
             this.Controls.Add(this.chkWIsP);
             this.Controls.Add(this.label48);
-            this.Controls.Add(this.label4);
             this.Controls.Add(this.label56);
             this.Controls.Add(this.label59);
             this.Controls.Add(this.label61);
@@ -694,7 +795,6 @@
         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;
@@ -702,5 +802,15 @@
         private System.Windows.Forms.TextBox txtMag4;
         private System.Windows.Forms.TextBox txtVot;
         private System.Windows.Forms.TextBox txtIprobe;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.TextBox txtScanRotCur;
+        private System.Windows.Forms.TextBox txtYPSCur;
+        private System.Windows.Forms.TextBox txtEDSZ;
+        private System.Windows.Forms.TextBox txtEDSV;
+        private System.Windows.Forms.TextBox txtEDSA;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label8;
     }
 }

+ 34 - 43
HOZProject/UserControls/UControl_Init.cs

@@ -367,34 +367,22 @@ namespace HOZProject
             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) ;
+            m_param.EDSV = Convert.ToSingle(txtEDSV.Text);
+            m_param.EDSA = Convert.ToSingle(txtEDSA.Text) ;
             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);//拍照的电压
-            //cfm.FIB_Magnification = Convert.ToSingle(cbbWFIB.Text);//FIB的放大倍数
+                                           
 
-           
 
-            //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;
-            //}
+            m_param.ScanRotCor = Convert.ToSingle(txtScanRotCur.Text);
+            m_param.PixelSizeCor = Convert.ToSingle(txtYPSCur.Text);
+
+
 
             m_param.SampleType = cbbWYP.Text;//样品类型
             m_param.Firm = cbbWCS.Text;//厂商类型
@@ -409,16 +397,7 @@ namespace HOZProject
         {
             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["LastSampleType"].Value = wsT;
-                //}
+
                 //厂商
                 List<String> _firms = firms.ToList();
                 if ((_firms.IndexOf(cbbWCS.Text) < 0)
@@ -434,20 +413,27 @@ namespace HOZProject
 
                 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.Straighten_Magnification.ToString();
-                config.AppSettings.Settings["Location_Magnification"].Value = m_Prm.Location_Magnification.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["ScanRotCur"].Value = m_Prm.ScanRotCor.ToString();
+
+
+                config.AppSettings.Settings["PixelSize_Y_Cur"].Value = m_Prm.PixelSizeCor.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.Save(ConfigurationSaveMode.Modified);
+
+                config.AppSettings.Settings["Is_EDS"].Value = m_Prm.EDS.ToString();
+                config.AppSettings.Settings["EDS_Z"].Value = m_Prm.EDSZ.ToString();
+                config.AppSettings.Settings["EDS_V"].Value = m_Prm.EDSV.ToString();
+                config.AppSettings.Settings["EDS_A"].Value = m_Prm.EDSA.ToString();
+                
+
+                config.Save(ConfigurationSaveMode.Full);
                 ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
                 return true;
             }
@@ -487,8 +473,9 @@ namespace HOZProject
             string firm = config.AppSettings.Settings["Firms"].Value.ToString();
 
             string ScanRotCur = config.AppSettings.Settings["ScanRotCur"].Value.ToString();
-            
-   
+
+            txtScanRotCur.Text = ScanRotCur;
+            txtYPSCur.Text= config.AppSettings.Settings["PixelSize_Y_Cur"].Value.ToString();
             //厂商
             firms = firm.Split(',');
             BindComboxData(cbbWCS, firms);
@@ -510,7 +497,9 @@ namespace HOZProject
             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);
+            txtEDSV.Text = Convert.ToString(config.AppSettings.Settings["EDS_V"].Value);
+            txtEDSA.Text = Convert.ToString(config.AppSettings.Settings["EDS_A"].Value);
             cboXrayMode.Text = Convert.ToString(config.AppSettings.Settings["EDS_XrayMode"].Value);
         }
 
@@ -556,6 +545,8 @@ namespace HOZProject
                 MessageBox.Show("FIB文件路径不能为空");
                 return;
             }
+
+
             GetMeasureParamFromHMI();
 
             SaveParamToConfigfile();

+ 1 - 1
MeasureData/MeasureParam.cs

@@ -114,7 +114,7 @@ namespace MeasureData
             set { this.m_ptTemp = value; }
         }
        public string RemoteELYPath ;
-         public string   RemoteMLFPath;
+       public string   RemoteMLFPath;
  
 
         //拉直操作需要的放大位数

+ 19 - 16
MeasureThread/Focus.cs

@@ -47,7 +47,9 @@ namespace MeasureThread
                 Thread.Sleep(200);
                 current = iSEM.GetMagnification();
             }
-
+            Thread.Sleep(200);
+            float cycle_time = iSEM.GetCycleTime();
+            Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
             return true;
         }
         public bool SetWorkingDistance(float newWdInMilimeter)
@@ -70,7 +72,7 @@ namespace MeasureThread
          
             // 
             float set = newMag;
-            Thread.Sleep(1000);
+            Thread.Sleep(2000);
             float current = iSEM.GetMagnification();
             Thread.Sleep(200);
             while (Math.Abs(current - set) > 1)
@@ -79,7 +81,9 @@ namespace MeasureThread
                 Thread.Sleep(200);
                 current = iSEM.GetMagnification();
             }
-
+            Thread.Sleep(200);
+            float cycle_time = iSEM.GetCycleTime();
+            Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
             // set the window of focusing.
             iSEM.SetReduced(prm.reduceWindowPos.X, prm.reduceWindowPos.Y, (int)prm.reduceWinWidth, (int)prm.reduceWinHeight);
             iSEM.CmdFocusScanSpeed("CMD_SCANRATE4");//
@@ -112,8 +116,8 @@ namespace MeasureThread
             }
             if (!ImageFocus1(ifStig))
             {
-                log.Error("自动对焦失败,程序退出。", false);
-
+                log.Error("自动对焦失败", false);
+                iSEM.CloseReduced();
                 return false;
             }
 
@@ -129,15 +133,11 @@ namespace MeasureThread
         public bool DoFocusBySetMainParameter()
         {
             log.Warn("开始自动对焦!");
-            //set voltage and SemIprobe
-           // bool mRet_VoltageFlag = iSEM.SetSEMVoltage(prm.voltage);
-           // Thread.Sleep(500);
-           //bool mRet_ElecFlag = iSEM.SetSEMIPROBE(prm.Iprobe / 1000000000);
-           // Thread.Sleep(500);
+    
             // set magnification
             bool mRetMag=iSEM.SetMagnification(prm.mag);
             
-            Thread.Sleep(500);
+            Thread.Sleep(2000);
             float current = iSEM.GetMagnification();
             while (Math.Abs(current - prm.mag) > 1)
             {
@@ -145,6 +145,9 @@ namespace MeasureThread
                 Thread.Sleep(200);
                 current = iSEM.GetMagnification();
             }
+            Thread.Sleep(200);
+            float cycle_time = iSEM.GetCycleTime();
+            Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
             // 
             if (!TiltCorrection(prm.tiltCorrAngle))
             {               
@@ -161,9 +164,9 @@ namespace MeasureThread
 
                     return false;
                 }
-
+                Thread.Sleep(1000);
             }
-
+           
             // set the window of focusing.
             iSEM.SetReduced(prm.reduceWindowPos.X, prm.reduceWindowPos.Y, (int)prm.reduceWinWidth, (int)prm.reduceWinHeight);
 
@@ -199,8 +202,8 @@ namespace MeasureThread
             }
             if (!ImageFocus1(ifStig))
             {
-                log.Error("自动对焦失败,程序退出。", false);
-                
+                log.Warn("自动对焦失败", false);
+                iSEM.CloseReduced();
                 return false;
             }
 
@@ -232,7 +235,7 @@ namespace MeasureThread
                 {
                     return false;
                 }
-                Thread.Sleep(200);
+                Thread.Sleep(2000);
             }
            
             return true;

+ 15 - 29
MeasureThread/Measure.cs

@@ -625,14 +625,14 @@ namespace MeasureThread
                     {                   
                         currHole.STATE = State.Failed;
                         currHole.END = DateTime.Now;
-                        m_measureFile.Save();
+                        //m_measureFile.Save();
                         SendCutHoleMsg(((int)currHole.STATE).ToString(), currHole.HoleName);
                     }
 
                 //保存文件,将测量状态更改
                 currHole.STATE = State.Success;
                 currHole.END = DateTime.Now;
-                m_measureFile.Save();
+                //m_measureFile.Save();
                 SendCutHoleMsg(((int)currHole.STATE).ToString(), currHole.HoleName);
 
                 if (key_stop)
@@ -1025,7 +1025,7 @@ namespace MeasureThread
                 if (state == 1 && ct.Count != 0 && mag.Count != 0)
                 {
                    
-                    mArgSend.SendArgumentToScreen("3-10", "获取位置及放大倍数成功");
+                //    mArgSend.SendArgumentToScreen("3-10", "获取位置及放大倍数成功");
 
                     #region 记录初始设置的BeamShift的百分比和样品台XY位置
                    
@@ -1739,14 +1739,14 @@ namespace MeasureThread
                             listElement = new Dictionary<string, double>();
 
 
-                            if (iExtender.XrayAreaCollectiong(param.AreaTime, listSeg, out XrayData, out listElement))
+                            if (iExtender.XrayAreaCollectiong(15000, listSeg, out XrayData, out listElement))
                             {
                                 string ele = "";
                                 foreach (var s in listElement)
                                 {
                                     ele += s.ToString();
                                 }
-                                log.Info("采集时间=" + param.AreaTime.ToString(), true);
+                                log.Info("采集时间=15000" , true);
                                 log.Info("(" + listSeg[0].X + "," + listSeg[0].Y + ") height=" + lines_height[i] + " 元素:" + ele);
                                 log.Info("线采集结束,写入数据库开始", true);
                                 //写入数据库
@@ -1802,8 +1802,8 @@ namespace MeasureThread
                             XrayData = new long[2000];
                             listElement = new Dictionary<string, double>();
 
-                            log.Info("AreaTime=" + param.AreaTime.ToString(), true);
-                            if (iExtender.XrayAreaCollectiong(param.AreaTime, listSeg, out XrayData, out listElement))
+                            log.Info("AreaTime=50000", true);
+                            if (iExtender.XrayAreaCollectiong(50000, listSeg, out XrayData, out listElement))
                             {
                                 string ele = "";
                                 foreach (var s in listElement)
@@ -1858,12 +1858,8 @@ namespace MeasureThread
         {
             float x2 = 0, y2 = 0;
             int state = 0;
-            float tmag = MParam.Photograph_Magnification / 3;
-            if (tmag < 300)
-            {
-                tmag = 300;
-
-            }
+            float tmag = MParam.FindCrossMagnification;
+ 
 
             Focusparam focusPrm = new Focusparam()
             {
@@ -1977,7 +1973,7 @@ namespace MeasureThread
             log.Info("自动对焦开始!", true);
             
             m_focuse.setFocusParam(fprm);
-            m_focuse.DoFocusByNewMagnification(MParam.Photograph_Magnification);
+            m_focuse.DoFocusBySetMainParameter();
             SendMsg("4-4");
             fprm.ifStig = false;
 
@@ -2073,7 +2069,7 @@ namespace MeasureThread
                     log.Info("自动对焦1开始!", true);
                    
                     m_focuse.setFocusParam(fprm1);
-                    m_focuse.DoFocusBySetMainParameter();
+                    m_focuse.DoFocusByNewMagnification(fprm1.mag);
 
 
                     log.Info("自动对焦2开始!", true);
@@ -2096,17 +2092,7 @@ namespace MeasureThread
                     #region 拍照
                     //log.Info("进入内部观察,不对焦!", true);
 
-                    //梯形角度
-                    //if (Math.Abs(scanRotateAngle) > 0)
-                    //{
-                    //    iSEM.SetScanRotationOn();
-                    //    Thread.Sleep(200);
-                    //    //20201128陈工要求,谭博返回角度*0.7
-
-                    //    iSEM.SetScanRotation(Convert.ToSingle(scanRotateAngle * 0.7));
-                    //    Thread.Sleep(200);
-
-                    //}
+                   
                     
                     log.Info("开始EDS拍照,设置放大倍数" + mag[0]);
                  
@@ -2157,7 +2143,7 @@ namespace MeasureThread
             //1.先降Z轴  37.241左右使工作距离从5mm 变为 10mm,这样方便能谱工作,麻烦是需要从新对焦。由于移动样品台会有误差,容易造成图像偏移,最好从新定位
             Locate lo = new Locate(iSEM);
             
-            lo.MoveZAxisByAbs(MParam.EDSZ);          
+            lo.MoveZAxisByAbs(MParam.EDSZ / 1000);          
 
             //判断是否停止进程
             if (key_stop)
@@ -2172,9 +2158,9 @@ namespace MeasureThread
            //在层高分析时,角度补偿已经纠正,能谱分析不必再做
 
             Thread.Sleep(200);
-            iSEM.SetSEMVoltage(7000);
+            iSEM.SetSEMVoltage(MParam.EDSV);
             Thread.Sleep(200);
-            iSEM.SetSEMIPROBE(0.5f  / 1000000000);
+            iSEM.SetSEMIPROBE(MParam.EDSA  / 1000000000);
             Thread.Sleep(200);