瀏覽代碼

optimize measure flow

gsp 4 年之前
父節點
當前提交
d5fea70bad

二進制
Document/05 FIB自动化分析接口文档V3.0_1.7.xlsx


+ 27 - 27
HOZProject/FormHOZMain.Designer.cs

@@ -90,7 +90,7 @@
             this.plMain.Controls.Add(this.plLeft);
             this.plMain.Controls.Add(this.plTop);
             this.plMain.Location = new System.Drawing.Point(16, 15);
-            this.plMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plMain.Margin = new System.Windows.Forms.Padding(4);
             this.plMain.Name = "plMain";
             this.plMain.Size = new System.Drawing.Size(1401, 895);
             this.plMain.TabIndex = 1;
@@ -107,7 +107,7 @@
             this.plFill.Controls.Add(this.pbImage);
             this.plFill.Controls.Add(this.plSEM);
             this.plFill.Location = new System.Drawing.Point(203, 108);
-            this.plFill.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plFill.Margin = new System.Windows.Forms.Padding(4);
             this.plFill.Name = "plFill";
             this.plFill.Size = new System.Drawing.Size(1192, 788);
             this.plFill.TabIndex = 5;
@@ -121,9 +121,9 @@
             this.groupBox1.Controls.Add(this.textBox2);
             this.groupBox1.ForeColor = System.Drawing.Color.White;
             this.groupBox1.Location = new System.Drawing.Point(909, 4);
-            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
             this.groupBox1.Size = new System.Drawing.Size(267, 125);
             this.groupBox1.TabIndex = 26;
             this.groupBox1.TabStop = false;
@@ -133,7 +133,7 @@
             // textBox1
             // 
             this.textBox1.Location = new System.Drawing.Point(8, 25);
-            this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox1.Margin = new System.Windows.Forms.Padding(4);
             this.textBox1.Name = "textBox1";
             this.textBox1.Size = new System.Drawing.Size(132, 25);
             this.textBox1.TabIndex = 21;
@@ -143,7 +143,7 @@
             // 
             this.button1.ForeColor = System.Drawing.Color.Black;
             this.button1.Location = new System.Drawing.Point(159, 25);
-            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button1.Margin = new System.Windows.Forms.Padding(4);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(100, 91);
             this.button1.TabIndex = 24;
@@ -158,7 +158,7 @@
             "True",
             "False"});
             this.comboBox1.Location = new System.Drawing.Point(8, 91);
-            this.comboBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
             this.comboBox1.Name = "comboBox1";
             this.comboBox1.Size = new System.Drawing.Size(132, 23);
             this.comboBox1.TabIndex = 25;
@@ -166,7 +166,7 @@
             // textBox2
             // 
             this.textBox2.Location = new System.Drawing.Point(8, 59);
-            this.textBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox2.Margin = new System.Windows.Forms.Padding(4);
             this.textBox2.Name = "textBox2";
             this.textBox2.Size = new System.Drawing.Size(132, 25);
             this.textBox2.TabIndex = 22;
@@ -177,7 +177,7 @@
             this.plPrarInfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
             this.plPrarInfo.ForeColor = System.Drawing.Color.Transparent;
             this.plPrarInfo.Location = new System.Drawing.Point(0, 0);
-            this.plPrarInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plPrarInfo.Margin = new System.Windows.Forms.Padding(4);
             this.plPrarInfo.Name = "plPrarInfo";
             this.plPrarInfo.Size = new System.Drawing.Size(291, 125);
             this.plPrarInfo.TabIndex = 2;
@@ -201,7 +201,7 @@
             this.pbImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.pbImage.Dock = System.Windows.Forms.DockStyle.Fill;
             this.pbImage.Location = new System.Drawing.Point(0, 0);
-            this.pbImage.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbImage.Margin = new System.Windows.Forms.Padding(4);
             this.pbImage.Name = "pbImage";
             this.pbImage.Size = new System.Drawing.Size(1192, 717);
             this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
@@ -216,7 +216,7 @@
             this.plSEM.Controls.Add(this.lblFlowContent);
             this.plSEM.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.plSEM.Location = new System.Drawing.Point(0, 717);
-            this.plSEM.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plSEM.Margin = new System.Windows.Forms.Padding(4);
             this.plSEM.Name = "plSEM";
             this.plSEM.Size = new System.Drawing.Size(1192, 71);
             this.plSEM.TabIndex = 19;
@@ -254,7 +254,7 @@
             this.plLeft.Controls.Add(this.plLeftContent);
             this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
             this.plLeft.Location = new System.Drawing.Point(0, 100);
-            this.plLeft.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plLeft.Margin = new System.Windows.Forms.Padding(4);
             this.plLeft.Name = "plLeft";
             this.plLeft.Size = new System.Drawing.Size(194, 795);
             this.plLeft.TabIndex = 4;
@@ -281,7 +281,7 @@
             this.plLeftContent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
             this.plLeftContent.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.plLeftContent.Location = new System.Drawing.Point(7, 26);
-            this.plLeftContent.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plLeftContent.Margin = new System.Windows.Forms.Padding(4);
             this.plLeftContent.Name = "plLeftContent";
             this.plLeftContent.Size = new System.Drawing.Size(178, 765);
             this.plLeftContent.TabIndex = 0;
@@ -304,7 +304,7 @@
             this.plTop.Controls.Add(this.pbInit);
             this.plTop.Dock = System.Windows.Forms.DockStyle.Top;
             this.plTop.Location = new System.Drawing.Point(0, 0);
-            this.plTop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plTop.Margin = new System.Windows.Forms.Padding(4);
             this.plTop.Name = "plTop";
             this.plTop.Size = new System.Drawing.Size(1401, 100);
             this.plTop.TabIndex = 3;
@@ -315,7 +315,7 @@
             this.pbPause.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbPause.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbPause.Location = new System.Drawing.Point(497, 5);
-            this.pbPause.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbPause.Margin = new System.Windows.Forms.Padding(4);
             this.pbPause.Name = "pbPause";
             this.pbPause.Size = new System.Drawing.Size(91, 89);
             this.pbPause.TabIndex = 8;
@@ -329,7 +329,7 @@
             this.pbStart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStart.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStart.Location = new System.Drawing.Point(398, 3);
-            this.pbStart.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbStart.Margin = new System.Windows.Forms.Padding(4);
             this.pbStart.Name = "pbStart";
             this.pbStart.Size = new System.Drawing.Size(91, 89);
             this.pbStart.TabIndex = 8;
@@ -346,7 +346,7 @@
             this.pbMax.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMax.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbMax.Location = new System.Drawing.Point(1309, 5);
-            this.pbMax.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbMax.Margin = new System.Windows.Forms.Padding(4);
             this.pbMax.Name = "pbMax";
             this.pbMax.Size = new System.Drawing.Size(37, 39);
             this.pbMax.TabIndex = 7;
@@ -363,7 +363,7 @@
             this.pbMin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMin.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbMin.Location = new System.Drawing.Point(1264, 5);
-            this.pbMin.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbMin.Margin = new System.Windows.Forms.Padding(4);
             this.pbMin.Name = "pbMin";
             this.pbMin.Size = new System.Drawing.Size(37, 39);
             this.pbMin.TabIndex = 7;
@@ -380,7 +380,7 @@
             this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbClose.Location = new System.Drawing.Point(1355, 5);
-            this.pbClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbClose.Margin = new System.Windows.Forms.Padding(4);
             this.pbClose.Name = "pbClose";
             this.pbClose.Size = new System.Drawing.Size(37, 39);
             this.pbClose.TabIndex = 7;
@@ -396,7 +396,7 @@
             this.pbImportTemplateFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbImportTemplateFile.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbImportTemplateFile.Location = new System.Drawing.Point(299, 5);
-            this.pbImportTemplateFile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbImportTemplateFile.Margin = new System.Windows.Forms.Padding(4);
             this.pbImportTemplateFile.Name = "pbImportTemplateFile";
             this.pbImportTemplateFile.Size = new System.Drawing.Size(91, 89);
             this.pbImportTemplateFile.TabIndex = 6;
@@ -410,7 +410,7 @@
             this.pbLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbLog.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbLog.Location = new System.Drawing.Point(754, 5);
-            this.pbLog.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbLog.Margin = new System.Windows.Forms.Padding(4);
             this.pbLog.Name = "pbLog";
             this.pbLog.Size = new System.Drawing.Size(91, 89);
             this.pbLog.TabIndex = 6;
@@ -425,7 +425,7 @@
             this.pbSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbSave.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbSave.Location = new System.Drawing.Point(203, 5);
-            this.pbSave.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbSave.Margin = new System.Windows.Forms.Padding(4);
             this.pbSave.Name = "pbSave";
             this.pbSave.Size = new System.Drawing.Size(91, 89);
             this.pbSave.TabIndex = 4;
@@ -439,7 +439,7 @@
             this.pbOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbOpen.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbOpen.Location = new System.Drawing.Point(7, 5);
-            this.pbOpen.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbOpen.Margin = new System.Windows.Forms.Padding(4);
             this.pbOpen.Name = "pbOpen";
             this.pbOpen.Size = new System.Drawing.Size(91, 89);
             this.pbOpen.TabIndex = 3;
@@ -452,7 +452,7 @@
             this.pbNew.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbNew.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbNew.Location = new System.Drawing.Point(7, 5);
-            this.pbNew.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbNew.Margin = new System.Windows.Forms.Padding(4);
             this.pbNew.Name = "pbNew";
             this.pbNew.Size = new System.Drawing.Size(91, 89);
             this.pbNew.TabIndex = 3;
@@ -468,7 +468,7 @@
             this.pbStop.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStop.Enabled = false;
             this.pbStop.Location = new System.Drawing.Point(398, 4);
-            this.pbStop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbStop.Margin = new System.Windows.Forms.Padding(4);
             this.pbStop.Name = "pbStop";
             this.pbStop.Size = new System.Drawing.Size(91, 89);
             this.pbStop.TabIndex = 8;
@@ -485,7 +485,7 @@
             this.pbInit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbInit.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbInit.Location = new System.Drawing.Point(104, 5);
-            this.pbInit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbInit.Margin = new System.Windows.Forms.Padding(4);
             this.pbInit.Name = "pbInit";
             this.pbInit.Size = new System.Drawing.Size(91, 89);
             this.pbInit.TabIndex = 5;
@@ -501,7 +501,7 @@
             this.ControlBox = false;
             this.Controls.Add(this.plMain);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.MinimumSize = new System.Drawing.Size(1365, 849);
             this.Name = "FormHOZMain";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

+ 10 - 0
HOZProject/FormHOZMain.cs

@@ -205,6 +205,16 @@ namespace HOZProject
                 m_MeasureFile.MParam.IsonlyEDSForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsonlyEDSForDebug"]);
                 // add by zjx 2020-12-18 为了测试只做能谱部分 end
 
+                var p = m_MeasureFile.MParam;
+               p. FindCrossMagnification = p.Location_Magnification / 3;
+                if (p.SampleName == "3") p.FindCrossMagnification = 400;
+                if (p.SampleName == "4")p. FindCrossMagnification = 300;
+                if (p.SampleName == "5")p. FindCrossMagnification = 300;
+                if (p.FindCrossMagnification < 200)
+                {
+                    p.FindCrossMagnification = 200;
+                }
+
                 m_Ms = new Measure(ConfigurationManager.AppSettings["WebServerIP"].ToString(),
                      ConfigurationManager.AppSettings["WebServerPort"].ToString(),
                      ConfigurationManager.AppSettings["WebServerUrl"].ToString());

+ 2 - 2
MeasureData/MeasureParam.cs

@@ -921,7 +921,7 @@ namespace MeasureData
         #endregion
 
 
-
+        public float  FindCrossMagnification;
 
         //构造函数
         public MeasureParam()
@@ -977,7 +977,7 @@ namespace MeasureData
             this.ScanSpeedFocus = "CMD_SCANRATE5";
             this.ScanSpeedHigh = "CMD_SCANRATE7";
             //add by sun 2020-12-15 增加不同样品扫描速度参数 end
-
+  
         }
 
         //XML文件保存测量参数

+ 71 - 47
MeasureThread/Measure.cs

@@ -650,24 +650,20 @@ namespace MeasureThread
                 #endregion
 
                     //开始测量
-                    if (HoleMeasure(currHole))
-                    {
-                        //保存文件,将测量状态更改
-                        currHole.STATE = State.Success;
-                        currHole.END = DateTime.Now;
-                        m_measureFile.Save();
-                        SendCutHoleMsg(((int)currHole.STATE).ToString(), currHole.HoleName);
-                    }
-                    //失败
-                    else
+                    if (!HoleMeasure(currHole))
                     {
+                   
                         currHole.STATE = State.Failed;
                         currHole.END = DateTime.Now;
                         m_measureFile.Save();
                         SendCutHoleMsg(((int)currHole.STATE).ToString(), currHole.HoleName);
                     }
- 
 
+                //保存文件,将测量状态更改
+                currHole.STATE = State.Success;
+                currHole.END = DateTime.Now;
+                m_measureFile.Save();
+                SendCutHoleMsg(((int)currHole.STATE).ToString(), currHole.HoleName);
                 if (key_stop)
                 {
 
@@ -757,11 +753,7 @@ namespace MeasureThread
                 return false;
             }
 
-            //4、设置WD
-            //iSEM.SetWorkingDistance(currHole.Position.WD);
-            //Thread.Sleep(1000);
-
-            //20201127增加自动亮度对比度
+          
                
                     
 
@@ -774,12 +766,12 @@ namespace MeasureThread
                             
             Thread.Sleep(6000);
 
+            iSEM.SetAutoVideoOff();
 
-               
 
 
             //拍照前改变速度,延时
-        
+
             Thread.Sleep(200);
 
             m_photo.GetParam().Mag = MParam.Location_Magnification;
@@ -955,21 +947,19 @@ namespace MeasureThread
             }
             Thread.Sleep(200);
 
-            //iSEM.SetAutoVideoBrightnessAndContrast();
-
-            //cycle_time = iSEM.GetCycleTime();
-            //Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
-            ////判断是否停止进程
 
             if (key_stop)
             {
                 log.Info("停止键按下", true);
                 return false;
             }
-            String fileName4 = currHole.data_path + "\\" + MParam.Firm + "-" +MParam.Location_Magnification.ToString("0") + "-" +currHole.HoleName + "-" + ImageName4;
+            String fileName4 = currHole.data_path + "\\" + MParam.Firm + "-" + MParam.FindCrossMagnification.ToString("0") + "-" +currHole.HoleName + "-" + ImageName4;
             //add by zjx 2020-12-21 根据客户的需求修改图片的名称 end
             log.Info("fileName4====================" + fileName4, true);
-            m_photo.GetParam().Mag = MParam.Location_Magnification;
+            float mag = MParam.FindCrossMagnification;
+           
+            m_photo.GetParam().Mag = mag;
+         
             m_photo.GetParam().savePath = fileName4;
             m_photo.TakePhoto();
             //arg.Message = "SEM拍照成功";
@@ -1261,17 +1251,32 @@ namespace MeasureThread
 
                     log.Info("测量线程:移动到对焦点( " + ct0.X.ToString()
                         + "," + ct0.Y.ToString() + ")", true);
+
+                    Thread.Sleep(200);
+                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭
+                    iSEM.CmdFocusScanSpeed(MParam.ScanSpeedFocus);//CmdFocusRate(5);
+                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end
+                    Thread.Sleep(200);
+                    cycle_time = iSEM.GetCycleTime();
+                    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
+
                     //循环升级对焦,每次放大3000倍
-                    
-                    
-                    for(int curmag=2000; curmag < magMax+3000; curmag += 5000)
+
+                    int startmag=7000;
+                    if (magMax < 7000)
+                    {
+                        startmag =(int) magMax;
+
+                    }
+
+                    for (int curmag= startmag; curmag < magMax+3000; curmag += 5000)
                     {
                         
                         fprm.IfAutoBrightnessAndContrast = true;                       
 
                         fprm.reduceWinHeight = 480;
                         fprm.reduceWinWidth = 450;
-
+                        fprm.tiltCorrAngle = 36;
 
 
                         fprm.ScanSpeed = MParam.ScanSpeedFocus;
@@ -1284,7 +1289,7 @@ namespace MeasureThread
                     }
 
                     #endregion
-                    m_photo.EnforceBrightness();//enter inside,enforce the brightness.
+                    m_photo.EnforceContrast() ;//enter inside,enforce the brightness.
                     #region 循环拍照
                     for (int n = 0; n < ct.Count; n++)
                     {
@@ -1306,7 +1311,7 @@ namespace MeasureThread
                             //移动到第一个点失败
                             log.Error("测量线程报错:移动到点(" + ct[n].X.ToString() + "," + ct[n].Y.ToString() + ")失败", false);
                         }
-                        Thread.Sleep(500);
+                        Thread.Sleep(1000);
                         log.Info("测量线程:移动到第1个点( " + ct[n].X.ToString()
                             + "," + ct[n].Y.ToString() + ")", true);
                         #endregion
@@ -1330,10 +1335,17 @@ namespace MeasureThread
                        m_photo.TakePhoto();
 
 
-                       // iSEM.CmdPixelScan();
+                       
+                        iSEM.CmdPixelScan();
                         Thread.Sleep(200);
-
                       
+                    
+                        iSEM.CmdFocusScanSpeed(MParam.ScanSpeedNormal);//CmdFocusRate(4);
+                        Thread.Sleep(200);
+                        cycle_time = iSEM.GetCycleTime();
+                        Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
+                        Thread.Sleep(200);
+
                         mArgSend.SendArgumentToScreen("3-11", "移动到第一个点位置拍照成功",fileName7);
 
                         // add by zjx 在测量图上显示放大倍数和像素大小等信息
@@ -1344,7 +1356,7 @@ namespace MeasureThread
 
                         float size = iSEM.GetPixelSize();
                         SaveMeasDataPic(fileName7, mag[n], size);
-                     
+                        Thread.Sleep(1000);
                         #endregion
                     }
 
@@ -1526,19 +1538,19 @@ namespace MeasureThread
                 //16.找到切割位置
                 if (MParam.Is_Photograph == false)
                 {
-                    log.Info("测量线程:第一个孔的测试过程-16.找到切割位置开始!", true);
+                    log.Info("测量线程:找到切割位置开始!移动到视野中心", true);
                     if (!FindCross(currHole))
                     {
                         return false;
                     }
-                    log.Info("测量线程:第一个孔的测试过程-16.找到切割位置结束!", true);
+                    log.Info("测量线程:找到切割位置结束!", true);
                     //判断是否停止进程
                     if (key_stop)
                     {
                         return false;
                     }
                 }
-                log.Warn("测量线程:第一个孔的测试过程-17.自动控制SEM拍截面照开始", true);
+                log.Warn("测量线程:自动控制SEM拍截面照开始", true);
                 //将过程17最后的拍照图片提出给18步进行调用
                 List<String> limg_path = new List<string>();
                 List<float> lsize = new List<float>();
@@ -1548,7 +1560,7 @@ namespace MeasureThread
                     log.Error("拍截面照失败!");
                     return false;
                 }
-                log.Info("测量线程:第一个孔的测试过程-17.自动控制SEM拍截面照结束!", true);
+                log.Info("测量线程:自动控制SEM拍截面照结束!", true);
                 //判断是否停止进程
                 if (key_stop)
                 {
@@ -1994,7 +2006,7 @@ namespace MeasureThread
             int state = 0;
             float mag = MParam.Photograph_Magnification / 3;
            
-            String fileName4 = currHole.data_path + "\\" + MParam.Firm + "-" + mag.ToString("0") + "-" + currHole.HoleName + "-" + ImageNameEDS4;
+            String fileName4 = currHole.data_path + "\\EDS\\" + MParam.Firm + " - " + mag.ToString("0") + "-" + currHole.HoleName + "-" + ImageNameEDS4;
             PhotoParam prm = new PhotoParam()
             {
             
@@ -2051,7 +2063,7 @@ namespace MeasureThread
                 log.Info("停止键按下", true);
                 return false;
             }
-            
+            Thread.Sleep(2000);
             return true;
         }
 
@@ -2080,7 +2092,7 @@ namespace MeasureThread
                 workingDis = 10,//unit mm
                 brightness = 50,
                 contrast = 29,
-                tiltCorrAngle = 36,
+                tiltCorrAngle = 54,
                 ifStig = false,
             };
           
@@ -2223,7 +2235,13 @@ namespace MeasureThread
                  
                     m_locate.MoveToPix(ct0.X,ct0.Y,MParam.PixelSizeCor);
 
-
+                    Thread.Sleep(200);
+                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭
+                    iSEM.CmdFocusScanSpeed(MParam.ScanSpeedFocus);//CmdFocusRate(5);
+                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end
+                    
+                    cycle_time = iSEM.GetCycleTime();
+                    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
                     Focusparam fprm1 = new Focusparam()
                     {
                         mag = magMax / 2,
@@ -2245,7 +2263,7 @@ namespace MeasureThread
                     log.Info("自动对焦1开始!", true);
                    
                     m_focuse.setFocusParam(fprm1);
-                    m_focuse.DoFocusByNewMagnification(magMax / 2);
+                    m_focuse.DoFocus();
 
 
                     log.Info("自动对焦2开始!", true);
@@ -2263,7 +2281,13 @@ namespace MeasureThread
 
                     m_locate.MoveToPix(ct[0].X,ct[0].Y,MParam.PixelSizeCor);
                     SendMsg("4-4");//向界面发送指令:放大并对拍摄点对焦
-
+                    Thread.Sleep(500);
+                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭
+                    iSEM.CmdFocusScanSpeed(MParam.ScanSpeedFocus);//CmdFocusRate(5);
+                    //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end
+                   
+                    cycle_time = iSEM.GetCycleTime();
+                    Thread.Sleep(100 + Convert.ToInt32(cycle_time));
 
                     //#endregion
 
@@ -2275,7 +2299,7 @@ namespace MeasureThread
                  
                  m_focuse.SetMagnification(mag[0]);
 
-                    m_photo.EnforceBrightness();
+                    m_photo.EnforceContrast();
 
                 log.Warn("EDS获取指定观测点图片,并打Xray");
                 DoEDS(currHole, 1);
@@ -2287,7 +2311,7 @@ namespace MeasureThread
 
                 log.Info("改变刷新率 " + MParam.ScanSpeedNormal);
                 iSEM.CmdFocusScanSpeed(MParam.ScanSpeedNormal);//CmdFocusRate(4);
-                Thread.Sleep(200);
+               
                 cycle_time = iSEM.GetCycleTime();
                 Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
 
@@ -2343,7 +2367,7 @@ namespace MeasureThread
                 Iprobe = 0.5F,
                 IfAutoBrightnessAndContrast = true,
                 ScanSpeed = MParam.ScanSpeedHigh,
-                mag = 600,
+                mag = MParam.Photograph_Magnification/3,
                 reduceWindowPos = new System.Drawing.Point(256, 192),
                 reduceWinWidth = 400,
                 reduceWinHeight = 400,

+ 4 - 3
MeasureThread/Photo.cs

@@ -67,14 +67,15 @@ namespace MeasureThread
             }
 
             iSEM.CmdFocusScanSpeed("CMD_SCANRATE5");//iSEM.CmdSaveRate();
-            Thread.Sleep(500);
-
+            Thread.Sleep(1000);
+           
 
             //拍照前改变速度,延时          
             iSEM.CmdLineScan();
             Thread.Sleep(200);
-             float   cycle_time = iSEM.GetCycleTime();
+            float cycle_time = iSEM.GetCycleTime();
             Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
+
             if (!GetImage(prm.savePath))
             {