Explorar o código

optimize the fibwork and ptwork section.

gsp %!s(int64=4) %!d(string=hai) anos
pai
achega
b47ea367cc

+ 105 - 77
HOZProject/FormHOZMain.Designer.cs

@@ -38,6 +38,7 @@
             this.textBox2 = new System.Windows.Forms.TextBox();
             this.plPrarInfo = new System.Windows.Forms.Panel();
             this.listmsg = new System.Windows.Forms.ListBox();
+            this.pbImage = new System.Windows.Forms.PictureBox();
             this.plSEM = new System.Windows.Forms.Panel();
             this.lblStateMessage = new System.Windows.Forms.Label();
             this.lblFlowContent = new System.Windows.Forms.Label();
@@ -45,7 +46,6 @@
             this.label1 = new System.Windows.Forms.Label();
             this.plLeftContent = new System.Windows.Forms.Panel();
             this.plTop = new System.Windows.Forms.Panel();
-            this.pbImage = new System.Windows.Forms.PictureBox();
             this.pbPause = new System.Windows.Forms.PictureBox();
             this.pbStart = new System.Windows.Forms.PictureBox();
             this.pbMax = new System.Windows.Forms.PictureBox();
@@ -61,10 +61,10 @@
             this.plMain.SuspendLayout();
             this.plFill.SuspendLayout();
             this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbImage)).BeginInit();
             this.plSEM.SuspendLayout();
             this.plLeft.SuspendLayout();
             this.plTop.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pbImage)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbPause)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbStart)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbMax)).BeginInit();
@@ -89,9 +89,10 @@
             this.plMain.Controls.Add(this.plFill);
             this.plMain.Controls.Add(this.plLeft);
             this.plMain.Controls.Add(this.plTop);
-            this.plMain.Location = new System.Drawing.Point(12, 12);
+            this.plMain.Location = new System.Drawing.Point(16, 15);
+            this.plMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.plMain.Name = "plMain";
-            this.plMain.Size = new System.Drawing.Size(1051, 716);
+            this.plMain.Size = new System.Drawing.Size(1401, 895);
             this.plMain.TabIndex = 1;
             // 
             // plFill
@@ -105,9 +106,10 @@
             this.plFill.Controls.Add(this.listmsg);
             this.plFill.Controls.Add(this.pbImage);
             this.plFill.Controls.Add(this.plSEM);
-            this.plFill.Location = new System.Drawing.Point(152, 86);
+            this.plFill.Location = new System.Drawing.Point(203, 108);
+            this.plFill.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.plFill.Name = "plFill";
-            this.plFill.Size = new System.Drawing.Size(894, 630);
+            this.plFill.Size = new System.Drawing.Size(1192, 788);
             this.plFill.TabIndex = 5;
             // 
             // groupBox1
@@ -118,9 +120,11 @@
             this.groupBox1.Controls.Add(this.comboBox1);
             this.groupBox1.Controls.Add(this.textBox2);
             this.groupBox1.ForeColor = System.Drawing.Color.White;
-            this.groupBox1.Location = new System.Drawing.Point(682, 3);
+            this.groupBox1.Location = new System.Drawing.Point(909, 4);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(200, 100);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Size = new System.Drawing.Size(267, 125);
             this.groupBox1.TabIndex = 26;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "测试设置状态";
@@ -128,18 +132,20 @@
             // 
             // textBox1
             // 
-            this.textBox1.Location = new System.Drawing.Point(6, 20);
+            this.textBox1.Location = new System.Drawing.Point(8, 25);
+            this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(100, 21);
+            this.textBox1.Size = new System.Drawing.Size(132, 25);
             this.textBox1.TabIndex = 21;
             this.textBox1.Text = "分析点名称";
             // 
             // button1
             // 
             this.button1.ForeColor = System.Drawing.Color.Black;
-            this.button1.Location = new System.Drawing.Point(119, 20);
+            this.button1.Location = new System.Drawing.Point(159, 25);
+            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(75, 73);
+            this.button1.Size = new System.Drawing.Size(100, 91);
             this.button1.TabIndex = 24;
             this.button1.Text = "测试";
             this.button1.UseVisualStyleBackColor = true;
@@ -151,16 +157,18 @@
             this.comboBox1.Items.AddRange(new object[] {
             "True",
             "False"});
-            this.comboBox1.Location = new System.Drawing.Point(6, 73);
+            this.comboBox1.Location = new System.Drawing.Point(8, 91);
+            this.comboBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.comboBox1.Name = "comboBox1";
-            this.comboBox1.Size = new System.Drawing.Size(100, 20);
+            this.comboBox1.Size = new System.Drawing.Size(132, 23);
             this.comboBox1.TabIndex = 25;
             // 
             // textBox2
             // 
-            this.textBox2.Location = new System.Drawing.Point(6, 47);
+            this.textBox2.Location = new System.Drawing.Point(8, 59);
+            this.textBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.textBox2.Name = "textBox2";
-            this.textBox2.Size = new System.Drawing.Size(100, 21);
+            this.textBox2.Size = new System.Drawing.Size(132, 25);
             this.textBox2.TabIndex = 22;
             this.textBox2.Text = "编号";
             // 
@@ -169,8 +177,9 @@
             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.Name = "plPrarInfo";
-            this.plPrarInfo.Size = new System.Drawing.Size(218, 100);
+            this.plPrarInfo.Size = new System.Drawing.Size(291, 125);
             this.plPrarInfo.TabIndex = 2;
             this.plPrarInfo.Visible = false;
             // 
@@ -178,15 +187,27 @@
             // 
             this.listmsg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.listmsg.FormattingEnabled = true;
-            this.listmsg.ItemHeight = 12;
-            this.listmsg.Location = new System.Drawing.Point(246, 94);
-            this.listmsg.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.listmsg.ItemHeight = 15;
+            this.listmsg.Location = new System.Drawing.Point(328, 118);
+            this.listmsg.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
             this.listmsg.Name = "listmsg";
-            this.listmsg.Size = new System.Drawing.Size(477, 196);
+            this.listmsg.Size = new System.Drawing.Size(635, 244);
             this.listmsg.TabIndex = 18;
             this.listmsg.Visible = false;
             // 
-        
+            // pbImage
+            // 
+            this.pbImage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
+            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.Name = "pbImage";
+            this.pbImage.Size = new System.Drawing.Size(1192, 717);
+            this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
+            this.pbImage.TabIndex = 20;
+            this.pbImage.TabStop = false;
+            // 
             // plSEM
             // 
             this.plSEM.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
@@ -194,9 +215,10 @@
             this.plSEM.Controls.Add(this.lblStateMessage);
             this.plSEM.Controls.Add(this.lblFlowContent);
             this.plSEM.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.plSEM.Location = new System.Drawing.Point(0, 573);
+            this.plSEM.Location = new System.Drawing.Point(0, 717);
+            this.plSEM.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.plSEM.Name = "plSEM";
-            this.plSEM.Size = new System.Drawing.Size(894, 57);
+            this.plSEM.Size = new System.Drawing.Size(1192, 71);
             this.plSEM.TabIndex = 19;
             // 
             // lblStateMessage
@@ -205,9 +227,10 @@
             this.lblStateMessage.BackColor = System.Drawing.Color.Transparent;
             this.lblStateMessage.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lblStateMessage.ForeColor = System.Drawing.Color.Black;
-            this.lblStateMessage.Location = new System.Drawing.Point(610, 15);
+            this.lblStateMessage.Location = new System.Drawing.Point(814, 19);
+            this.lblStateMessage.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lblStateMessage.Name = "lblStateMessage";
-            this.lblStateMessage.Size = new System.Drawing.Size(284, 24);
+            this.lblStateMessage.Size = new System.Drawing.Size(379, 30);
             this.lblStateMessage.TabIndex = 1;
             this.lblStateMessage.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             // 
@@ -217,9 +240,10 @@
             this.lblFlowContent.BackColor = System.Drawing.Color.Transparent;
             this.lblFlowContent.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.lblFlowContent.ForeColor = System.Drawing.Color.Black;
-            this.lblFlowContent.Location = new System.Drawing.Point(25, 21);
+            this.lblFlowContent.Location = new System.Drawing.Point(33, 26);
+            this.lblFlowContent.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.lblFlowContent.Name = "lblFlowContent";
-            this.lblFlowContent.Size = new System.Drawing.Size(0, 19);
+            this.lblFlowContent.Size = new System.Drawing.Size(0, 23);
             this.lblFlowContent.TabIndex = 0;
             // 
             // plLeft
@@ -229,9 +253,10 @@
             this.plLeft.Controls.Add(this.label1);
             this.plLeft.Controls.Add(this.plLeftContent);
             this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
-            this.plLeft.Location = new System.Drawing.Point(0, 80);
+            this.plLeft.Location = new System.Drawing.Point(0, 100);
+            this.plLeft.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.plLeft.Name = "plLeft";
-            this.plLeft.Size = new System.Drawing.Size(146, 636);
+            this.plLeft.Size = new System.Drawing.Size(194, 795);
             this.plLeft.TabIndex = 4;
             // 
             // label1
@@ -240,9 +265,10 @@
             this.label1.BackColor = System.Drawing.Color.Transparent;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 8F, System.Drawing.FontStyle.Bold);
             this.label1.ForeColor = System.Drawing.Color.Black;
-            this.label1.Location = new System.Drawing.Point(32, 2);
+            this.label1.Location = new System.Drawing.Point(43, 2);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(63, 16);
+            this.label1.Size = new System.Drawing.Size(79, 19);
             this.label1.TabIndex = 1;
             this.label1.Text = "分析点列表";
             // 
@@ -254,9 +280,10 @@
             this.plLeftContent.AutoScroll = true;
             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(5, 21);
+            this.plLeftContent.Location = new System.Drawing.Point(7, 26);
+            this.plLeftContent.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.plLeftContent.Name = "plLeftContent";
-            this.plLeftContent.Size = new System.Drawing.Size(134, 612);
+            this.plLeftContent.Size = new System.Drawing.Size(178, 765);
             this.plLeftContent.TabIndex = 0;
             // 
             // plTop
@@ -277,31 +304,20 @@
             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.Name = "plTop";
-            this.plTop.Size = new System.Drawing.Size(1051, 80);
+            this.plTop.Size = new System.Drawing.Size(1401, 100);
             this.plTop.TabIndex = 3;
             // 
-            // pbImage
-            // 
-            this.pbImage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
-            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.Name = "pbImage";
-            this.pbImage.Size = new System.Drawing.Size(894, 573);
-            this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
-            this.pbImage.TabIndex = 20;
-            this.pbImage.TabStop = false;
-            // 
             // pbPause
             // 
             this.pbPause.BackgroundImage = global::HOZProject.Properties.Resources.Report;
             this.pbPause.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbPause.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbPause.Location = new System.Drawing.Point(475, 5);
-            this.pbPause.Location = new System.Drawing.Point(445, 4);
+            this.pbPause.Location = new System.Drawing.Point(497, 5);
+            this.pbPause.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbPause.Name = "pbPause";
-            this.pbPause.Size = new System.Drawing.Size(68, 71);
+            this.pbPause.Size = new System.Drawing.Size(91, 89);
             this.pbPause.TabIndex = 8;
             this.pbPause.TabStop = false;
             this.pbPause.Click += new System.EventHandler(this.pbPause_Click);
@@ -312,9 +328,10 @@
             this.pbStart.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbStart.BackgroundImage")));
             this.pbStart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStart.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbStart.Location = new System.Drawing.Point(371, 4);
+            this.pbStart.Location = new System.Drawing.Point(398, 3);
+            this.pbStart.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbStart.Name = "pbStart";
-            this.pbStart.Size = new System.Drawing.Size(68, 71);
+            this.pbStart.Size = new System.Drawing.Size(91, 89);
             this.pbStart.TabIndex = 8;
             this.pbStart.TabStop = false;
             this.pbStart.Click += new System.EventHandler(this.pbStart_Click);
@@ -328,9 +345,10 @@
             this.pbMax.BackgroundImage = global::HOZProject.Properties.Resources.Max_2_;
             this.pbMax.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMax.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbMax.Location = new System.Drawing.Point(982, 4);
+            this.pbMax.Location = new System.Drawing.Point(1309, 5);
+            this.pbMax.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbMax.Name = "pbMax";
-            this.pbMax.Size = new System.Drawing.Size(28, 31);
+            this.pbMax.Size = new System.Drawing.Size(37, 39);
             this.pbMax.TabIndex = 7;
             this.pbMax.TabStop = false;
             this.pbMax.Click += new System.EventHandler(this.pbMax_Click);
@@ -344,9 +362,10 @@
             this.pbMin.BackgroundImage = global::HOZProject.Properties.Resources.Min_2_;
             this.pbMin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMin.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbMin.Location = new System.Drawing.Point(948, 4);
+            this.pbMin.Location = new System.Drawing.Point(1264, 5);
+            this.pbMin.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbMin.Name = "pbMin";
-            this.pbMin.Size = new System.Drawing.Size(28, 31);
+            this.pbMin.Size = new System.Drawing.Size(37, 39);
             this.pbMin.TabIndex = 7;
             this.pbMin.TabStop = false;
             this.pbMin.Click += new System.EventHandler(this.pbMin_Click);
@@ -360,9 +379,10 @@
             this.pbClose.BackgroundImage = global::HOZProject.Properties.Resources.exit_2_;
             this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbClose.Location = new System.Drawing.Point(1016, 4);
+            this.pbClose.Location = new System.Drawing.Point(1355, 5);
+            this.pbClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbClose.Name = "pbClose";
-            this.pbClose.Size = new System.Drawing.Size(28, 31);
+            this.pbClose.Size = new System.Drawing.Size(37, 39);
             this.pbClose.TabIndex = 7;
             this.pbClose.TabStop = false;
             this.pbClose.Click += new System.EventHandler(this.pbClose_Click);
@@ -375,9 +395,10 @@
             this.pbImportTemplateFile.BackgroundImage = global::HOZProject.Properties.Resources.ImportConfigFile_3_;
             this.pbImportTemplateFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbImportTemplateFile.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbImportTemplateFile.Location = new System.Drawing.Point(224, 4);
+            this.pbImportTemplateFile.Location = new System.Drawing.Point(299, 5);
+            this.pbImportTemplateFile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbImportTemplateFile.Name = "pbImportTemplateFile";
-            this.pbImportTemplateFile.Size = new System.Drawing.Size(68, 71);
+            this.pbImportTemplateFile.Size = new System.Drawing.Size(91, 89);
             this.pbImportTemplateFile.TabIndex = 6;
             this.pbImportTemplateFile.TabStop = false;
             this.pbImportTemplateFile.Click += new System.EventHandler(this.pbImportTemplateFile_Click);
@@ -388,11 +409,13 @@
             this.pbLog.BackgroundImage = global::HOZProject.Properties.Resources.Log_3_;
             this.pbLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbLog.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbLog.Location = new System.Drawing.Point(297, 4);
+            this.pbLog.Location = new System.Drawing.Point(754, 5);
+            this.pbLog.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbLog.Name = "pbLog";
-            this.pbLog.Size = new System.Drawing.Size(68, 71);
+            this.pbLog.Size = new System.Drawing.Size(91, 89);
             this.pbLog.TabIndex = 6;
             this.pbLog.TabStop = false;
+            this.pbLog.Visible = false;
             this.pbLog.Click += new System.EventHandler(this.pbLog_Click);
             // 
             // pbSave
@@ -401,9 +424,10 @@
             this.pbSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbSave.BackgroundImage")));
             this.pbSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbSave.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbSave.Location = new System.Drawing.Point(152, 4);
+            this.pbSave.Location = new System.Drawing.Point(203, 5);
+            this.pbSave.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbSave.Name = "pbSave";
-            this.pbSave.Size = new System.Drawing.Size(68, 71);
+            this.pbSave.Size = new System.Drawing.Size(91, 89);
             this.pbSave.TabIndex = 4;
             this.pbSave.TabStop = false;
             this.pbSave.Click += new System.EventHandler(this.pbSave_Click);
@@ -414,10 +438,10 @@
             this.pbOpen.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbOpen.BackgroundImage")));
             this.pbOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbOpen.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbOpen.Location = new System.Drawing.Point(5, 2);
-            this.pbOpen.Location = new System.Drawing.Point(5, 4);
+            this.pbOpen.Location = new System.Drawing.Point(7, 5);
+            this.pbOpen.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbOpen.Name = "pbOpen";
-            this.pbOpen.Size = new System.Drawing.Size(68, 71);
+            this.pbOpen.Size = new System.Drawing.Size(91, 89);
             this.pbOpen.TabIndex = 3;
             this.pbOpen.TabStop = false;
             this.pbOpen.Click += new System.EventHandler(this.pbOpen_Click);
@@ -427,9 +451,10 @@
             this.pbNew.BackgroundImage = global::HOZProject.Properties.Resources.New;
             this.pbNew.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbNew.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbNew.Location = new System.Drawing.Point(5, 4);
+            this.pbNew.Location = new System.Drawing.Point(7, 5);
+            this.pbNew.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbNew.Name = "pbNew";
-            this.pbNew.Size = new System.Drawing.Size(68, 71);
+            this.pbNew.Size = new System.Drawing.Size(91, 89);
             this.pbNew.TabIndex = 3;
             this.pbNew.TabStop = false;
             this.pbNew.Visible = false;
@@ -442,9 +467,10 @@
             this.pbStop.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStop.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStop.Enabled = false;
-            this.pbStop.Location = new System.Drawing.Point(371, 3);
+            this.pbStop.Location = new System.Drawing.Point(398, 4);
+            this.pbStop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbStop.Name = "pbStop";
-            this.pbStop.Size = new System.Drawing.Size(68, 71);
+            this.pbStop.Size = new System.Drawing.Size(91, 89);
             this.pbStop.TabIndex = 8;
             this.pbStop.TabStop = false;
             this.pbStop.Visible = false;
@@ -458,23 +484,25 @@
             this.pbInit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pbInit.BackgroundImage")));
             this.pbInit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbInit.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pbInit.Location = new System.Drawing.Point(78, 4);
+            this.pbInit.Location = new System.Drawing.Point(104, 5);
+            this.pbInit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pbInit.Name = "pbInit";
-            this.pbInit.Size = new System.Drawing.Size(68, 71);
+            this.pbInit.Size = new System.Drawing.Size(91, 89);
             this.pbInit.TabIndex = 5;
             this.pbInit.TabStop = false;
             this.pbInit.Click += new System.EventHandler(this.pbInit_Click);
             // 
             // FormHOZMain
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(179)))), ((int)(((byte)(254)))));
-            this.ClientSize = new System.Drawing.Size(1075, 733);
+            this.ClientSize = new System.Drawing.Size(1433, 916);
             this.ControlBox = false;
             this.Controls.Add(this.plMain);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.MinimumSize = new System.Drawing.Size(1024, 679);
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.MinimumSize = new System.Drawing.Size(1365, 849);
             this.Name = "FormHOZMain";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "FormHOZMain";
@@ -487,12 +515,12 @@
             this.plFill.ResumeLayout(false);
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbImage)).EndInit();
             this.plSEM.ResumeLayout(false);
             this.plSEM.PerformLayout();
             this.plLeft.ResumeLayout(false);
             this.plLeft.PerformLayout();
             this.plTop.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pbImage)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbPause)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbStart)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbMax)).EndInit();

+ 50 - 49
HOZProject/FormHOZMain.cs

@@ -145,9 +145,7 @@ namespace HOZProject
         {
             try
             {
-                m_Ms = new Measure(ConfigurationManager.AppSettings["WebServerIP"].ToString(),
-                       ConfigurationManager.AppSettings["WebServerPort"].ToString(),
-                       ConfigurationManager.AppSettings["WebServerUrl"].ToString());
+              
 
                 m_MeasureFile.MParam.AutoFocus.UP = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_UP"].ToString());
                 m_MeasureFile.MParam.AutoFocus.Down = Convert.ToSingle(ConfigurationManager.AppSettings["Focus_Down"].ToString());
@@ -189,6 +187,28 @@ namespace HOZProject
                 m_MeasureFile.MParam.MagCompY3 = Convert.ToSingle(ConfigurationManager.AppSettings["MagCompY3"]);
 
 
+
+                //Z轴移动距离
+                m_MeasureFile.MParam.ZDistance= Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"]);
+
+                //add by sun 2020-12-15 增加不同样品扫描速度参数
+                m_MeasureFile.MParam.ScanSpeedNormal = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedNormal_" + m_MeasureFile.MParam.SampleName]);
+                m_MeasureFile.MParam.ScanSpeedFocus = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedFocus_" + m_MeasureFile.MParam.SampleName]);
+                m_MeasureFile.MParam.ScanSpeedHigh = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedHigh_" + m_MeasureFile.MParam.SampleName]);
+                //log.Info("==============="+ ConfigurationManager.AppSettings["ScanSpeedNormal_3"] + "========="+ m_MeasureFile.MParam.SampleName, true);
+                //add by sun 2020-12-15 增加不同样品扫描速度参数 end
+                //add by sun 2020-12-17 增加调试时是否切割开关
+                m_MeasureFile.MParam.IsCutingForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsCutingForDebug"]);
+                //add by sun 2020-12-17 增加调试时是否切割开关 end
+
+                // add by zjx 2020-12-18 为了测试只做能谱部分
+                m_MeasureFile.MParam.IsonlyEDSForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsonlyEDSForDebug"]);
+                // add by zjx 2020-12-18 为了测试只做能谱部分 end
+
+                m_Ms = new Measure(ConfigurationManager.AppSettings["WebServerIP"].ToString(),
+                     ConfigurationManager.AppSettings["WebServerPort"].ToString(),
+                     ConfigurationManager.AppSettings["WebServerUrl"].ToString());
+
                 m_Ms.X_Min = Convert.ToSingle(ConfigurationManager.AppSettings["X_Min"]);
                 m_Ms.X_Max = Convert.ToSingle(ConfigurationManager.AppSettings["X_Max"]);
                 m_Ms.Y_Min = Convert.ToSingle(ConfigurationManager.AppSettings["Y_Min"]);
@@ -208,25 +228,6 @@ namespace HOZProject
                 //SmartSEM远程路径
                 m_Ms.RemoteELYPath = ConfigurationManager.AppSettings["RemoteELYPath"];
                 m_Ms.RemoteMLFPath = ConfigurationManager.AppSettings["RemoteMLFPath"];
-
-                //Z轴移动距离
-                m_MeasureFile.MParam.ZDistance= Convert.ToSingle(ConfigurationManager.AppSettings["ZDistance"]);
-
-                //add by sun 2020-12-15 增加不同样品扫描速度参数
-                m_MeasureFile.MParam.ScanSpeedNormal = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedNormal_" + m_MeasureFile.MParam.SampleName]);
-                m_MeasureFile.MParam.ScanSpeedFocus = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedFocus_" + m_MeasureFile.MParam.SampleName]);
-                m_MeasureFile.MParam.ScanSpeedHigh = Convert.ToString(ConfigurationManager.AppSettings["ScanSpeedHigh_" + m_MeasureFile.MParam.SampleName]);
-                //log.Info("==============="+ ConfigurationManager.AppSettings["ScanSpeedNormal_3"] + "========="+ m_MeasureFile.MParam.SampleName, true);
-                //add by sun 2020-12-15 增加不同样品扫描速度参数 end
-                //add by sun 2020-12-17 增加调试时是否切割开关
-                m_MeasureFile.MParam.IsCutingForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsCutingForDebug"]);
-                //add by sun 2020-12-17 增加调试时是否切割开关 end
-
-                // add by zjx 2020-12-18 为了测试只做能谱部分
-                m_MeasureFile.MParam.IsonlyEDSForDebug = Convert.ToBoolean(ConfigurationManager.AppSettings["IsonlyEDSForDebug"]);
-                // add by zjx 2020-12-18 为了测试只做能谱部分 end
-
-                
                 m_Ms.InitMeasure(m_MeasureFile);
                 //注册事件
                 m_Ms.SendThreadStatus += new ThreadStatusHandler(displayMessage);
@@ -715,29 +716,29 @@ namespace HOZProject
 
         private void pbLog_Click(object sender, EventArgs e)
         {
-            m_FormLog = new Form();
-            m_FormLog.StartPosition = FormStartPosition.CenterScreen;
-            if (ucLog == null)
-            {
-                ucLog = new UControl_Log();
-            }
-            m_FormLog.FormBorderStyle = FormBorderStyle.None;
-            m_FormLog.Width = ucLog.Width;
-            m_FormLog.Height = ucLog.Height;
-            ucLog.Name = "UControl_Log";
-            //获取日志信息
-            if (listmsg.Items.Count>0)
-            {
-                string[] strLog = new string[listmsg.Items.Count];
-                for (int i = 0; i < listmsg.Items.Count; i++)
-                {
-                    //赋值给数组
-                    strLog[i] = listmsg.Items[i].ToString();
-                }
-                ucLog.ShowProcessLogInfo(strLog);
-            }
-            m_FormLog.Controls.Add(ucLog);
-            m_FormLog.ShowDialog();
+            //m_FormLog = new Form();
+            //m_FormLog.StartPosition = FormStartPosition.CenterScreen;
+            //if (ucLog == null)
+            //{
+            //    ucLog = new UControl_Log();
+            //}
+            //m_FormLog.FormBorderStyle = FormBorderStyle.None;
+            //m_FormLog.Width = ucLog.Width;
+            //m_FormLog.Height = ucLog.Height;
+            //ucLog.Name = "UControl_Log";
+            ////获取日志信息
+            //if (listmsg.Items.Count>0)
+            //{
+            //    string[] strLog = new string[listmsg.Items.Count];
+            //    for (int i = 0; i < listmsg.Items.Count; i++)
+            //    {
+            //        //赋值给数组
+            //        strLog[i] = listmsg.Items[i].ToString();
+            //    }
+            //    ucLog.ShowProcessLogInfo(strLog);
+            //}
+            //m_FormLog.Controls.Add(ucLog);
+            //m_FormLog.ShowDialog();
         }
 
         //显示日志
@@ -1200,9 +1201,9 @@ namespace HOZProject
             if (File.Exists(m_MeasureFile.m_SavePath))
             {
                 string position = System.Environment.CurrentDirectory;
-                //Process pro = Process.Start(@"D:\HOZ\an_hoz\HOZ\bin\Debug\Report\ExportReport.exe", @"D:\HOZ\18\j.msf");//打开程序B
-                Process pro = Process.Start(position + "\\Report\\ExportReport.exe", m_MeasureFile.m_SavePath);//打开程序B
-                pro.WaitForExit();
+                 //Process pro = Process.Start(@"D:\DebugLine\Debug\ExportReport.exe", @"D:\6\s.msf");//打开程序B
+                  Process pro = Process.Start(position + "\\Report\\ExportReport.exe", m_MeasureFile.m_SavePath);//打开程序B
+                 pro.WaitForExit();
                 int Result = pro.ExitCode;//程序B退出回传值
                 if (Result == 1)//接收到程序B退出代码"1"
                 {
@@ -1214,6 +1215,6 @@ namespace HOZProject
                 MessageBox.Show("尚未保存文件");
             }
 
-        }
+}
     }
 }

+ 7 - 14
MeasureThread/Focus.cs

@@ -52,7 +52,7 @@ namespace MeasureThread
         }
         public bool DoFocusByNewMagnification(float newMag)
         {
-
+            log.Warn("开始自动对焦!");
             // set magnification
             bool mRetMag = iSEM.SetMagnification(newMag);
 
@@ -107,20 +107,17 @@ namespace MeasureThread
             iSEM.CloseReduced();
             Thread.Sleep(200);
 
-        
-
-            //float cycle_time = iSEM.GetCycleTime();
-            //Thread.Sleep(1000 + Convert.ToInt32(cycle_time));
 
+            log.Warn("自动对焦结束!"+"ifStig="+ifStig.ToString());
             return true;
 
 
         }
         public bool DoFocus()
         {
-            
-               //set voltage and SemIprobe
-             bool mRet_VoltageFlag = iSEM.SetSEMVoltage(prm.voltage);
+            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);
@@ -186,13 +183,9 @@ namespace MeasureThread
             }
 
             iSEM.CloseReduced();
-            Thread.Sleep(200);           
-
-           // iSEM.SetAutoVideoBrightnessAndContrast();
-           
-           //float cycle_time = iSEM.GetCycleTime();
-           // Thread.Sleep(1000 + Convert.ToInt32(cycle_time));
+            Thread.Sleep(200);
 
+            log.Warn("自动对焦结束!" + "ifStig=" + ifStig.ToString());
             return true;
         }
 

+ 170 - 554
MeasureThread/Measure.cs

@@ -439,7 +439,8 @@ namespace MeasureThread
         private Photo m_photo;
         private ArgSend mArgSend;
         public Boolean key_stop = false;
-
+        FibWork m_FibWork;
+        PTWork m_PTWork;
         //String focus_path = "";
         //String FIBfocus_path = "";
         //String StigX_path = "";
@@ -505,6 +506,7 @@ namespace MeasureThread
             m_focuse = new Focus(iSEM);
             m_photo = new Photo(iSEM);
             mArgSend = new ArgSend(this, iSEM);
+           
         }
 
         //初始化测量业务, 读测量文件,判断是否有可测试的切孔
@@ -552,6 +554,9 @@ namespace MeasureThread
             iSEM.SetRemoteELYPath(RemoteELYPath);
             iSEM.SetRemoteMLFPath(RemoteMLFPath);
 
+            m_FibWork = new FibWork(iSEM, MParam.FIBTemp);
+            m_PTWork = new PTWork(iSEM, MParam.PTTemp);
+
             iSEM.SetScanRotationOff();
             Thread.Sleep(200);
 
@@ -681,138 +686,36 @@ namespace MeasureThread
  
 
 
-        //插入PT针
-        public bool InsertPT()
-        {
-            string fn = m_ProgramFolder + "\\Macro\\" + MacoInsertPt;
-            //SendMsg("调用宏插入PT针宏文件" + fn);
-            iSEM.CMDMCFFilename(fn);
-            //延时1s??
-            Thread.Sleep(1000);
-            return true;
-        }
-
-        //撤出PT针
-        public bool RetractPT()
-        {
-            string fn = m_ProgramFolder + "\\Macro\\" + MacoRetractPt;
-            //SendMsg("调用宏撤出PT针宏文件" + fn);
-            iSEM.CMDMCFFilename(fn);
-            //延时1s??
-            Thread.Sleep(1000);
-            return true;
-        }
-
-        //PT沉积
-        public bool PTWork()
-        {
-            //执行PT沉积的ELY文件
-            if (!ExcuteEly(MParam.PTTemp))
-            {
-                return false;
-            }
-
-            //等待沉积完成
-            while (true)
-            {
-                Thread.Sleep(7000);
-                if (iSEM.GetFIBMode() == 0)
-                {
-                    break;
-                }
-            }
-            return true;
-        }
-
-        //FIB切割
-        public bool FIBWork()
-        {
-            //执行PT沉积的ELY文件
-            if (!ExcuteEly(MParam.FIBTemp))
-            {
-                return false;
-            }
-
-            //等待切割完成
-            while (true)
-            {
-                Thread.Sleep(10000);
-                if (iSEM.GetFIBMode() == 0)
-                {
-                    break;
-                }
-            }
-
-            return true;
-        }
-
-        //执行ELY文件的步骤
-        public bool ExcuteEly(string a_filename)
-        {
-            //执行ELy文件有三个动作
-            //1. 选择ELY文件
-            //SendMsg("选择ELY文件");
-            if (!iSEM.CmdFIBLoadELY(a_filename))
-            {
-                //SendMsg("选择ELY文件失败");
-                return false;
-            }
-            Thread.Sleep(1000);
-            //2. 确认ELY文件
-            //SendMsg("确认ELY文件");
-            if (!iSEM.CmdFIBEXPOSUREELY())
-            {
-                //SendMsg("确认ELY文件失败");
-                return false;
-            }
-            Thread.Sleep(1000);
-            //3. 执行ELY文件
-            //SendMsg("执行ELY文件");
-            if (!iSEM.CmdFIBSTARTELY())
-            {
-                //SendMsg("执行ELY文件失败");
-                return false;
-            }
-            Thread.Sleep(1000);
+      
 
-            return true;
-        }
+       
 
         /// <summary>
         ///13. 自动 定位功能,沉积
         /// </summary>
         /// <returns></returns>
-        public bool GetPoistion(CutHole currHole)
+        public bool GetFIBPoistion(CutHole currHole)
         {
-            float x0 = 0, y0 = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0, px = 0;
+          
+            float px = 0;
             int state = 1;
             log.Info("测量线程:13.自动定位、沉积-功能自动定位电压" + MParam.Location_Voltage.ToString() + "自动定位放大倍数" + MParam.Location_Magnification.ToString(), true);
             Thread.Sleep(200);
             //1.控制SEM放大600X
             if (!iSEM.SetSEMVoltage(MParam.Location_Voltage))
             {
-                arg.Message = "电压设置" + MParam.Location_Voltage.ToString("0.0") + "失败";
-                arg.State = false;
-                SendMsg("2-0");
+
                 log.Error("测量线程报错:13.自动定位、沉积-自动定位电压" + MParam.Location_Voltage.ToString() + "控制失败", false);
                 return false;
             }
             Thread.Sleep(200);
-            if (!iSEM.SetMagnification(MParam.Location_Magnification))
+            
+            if (!m_focuse.SetMagnification(MParam.Location_Magnification))
             {
-                arg.Message = "放大" + MParam.Location_Magnification.ToString("0.0") + "倍失败";
-                arg.State = false;
-                SendMsg("2-0");
+
                 log.Error("测量线程报错:13.自动定位、沉积-自动定位放大倍数" + MParam.Location_Magnification.ToString() + "控制失败", false);
                 return false;
             }
-            float current = iSEM.GetMagnification();
-            while (Math.Abs(current - MParam.Location_Magnification) > 1)
-            {
-                iSEM.SetMagnification(MParam.Location_Magnification);
-                Thread.Sleep(200);
-                current = iSEM.GetMagnification();
-            }
             arg.State = true;
             arg.Message = "放大" + MParam.Location_Magnification.ToString("0.0") + "倍成功";
             SendMsg("2-0");
@@ -823,342 +726,118 @@ namespace MeasureThread
                 return false;
             }
 
-            //判断是否为仅拍照,不是则执行FIB操作
-            if (!MParam.Is_Photograph)
+            log.Info("测量线程:切换到FIB模式。", true);
+            //6.设置FIB拍照参数——扫描时间、束流等
+            //7.控制FIB自动亮度、对比度
+            Thread.Sleep(200);
+            if (!iSEM.CmdFIBModeFIB())
             {
-                log.Info("测量线程:切换到FIB模式。", true);
-                //6.设置FIB拍照参数——扫描时间、束流等
-                //7.控制FIB自动亮度、对比度
-                Thread.Sleep(200);
-                if (!iSEM.CmdFIBModeFIB())
-                {
+                log.Error("测量线程报错:切换到FIB模式失败。", false);
+                return false;
+            }
+            arg.State = true;
+            arg.Picture_Information.Work_Status = "FIB";
+            arg.Message = "FIB模式切换成功";
+            SendMsg("2-1");
+            Thread.Sleep(1000);
+            //判断是否停止进程
+            if (key_stop)
+            {
+                log.Info("停止键按下。", true);
+                return false;
+            }
+            //8.控制FIB拍照
+            //9.保存照片======更改路径
+            //20201103,FIB使用定位的放大倍数
+            String fileName2 = currHole.data_path + "\\" +currHole.HoleName + "_" + MParam.Location_Magnification.ToString("0") + "_" + ImageName2;
+            //判断是否停止进程
+            if (key_stop)
+            {
+                log.Info("停止键按下。", true);
+                return false;
+            }
 
-                    log.Error("测量线程报错:切换到FIB模式失败。", false);
-                    return false;
-                }
-                arg.State = true;
-                arg.Picture_Information.Work_Status = "FIB";
-                arg.Message = "FIB模式切换成功";
-                SendMsg("2-1");
-                Thread.Sleep(1000);
-                //判断是否停止进程
-                if (key_stop)
-                {
-                    log.Info("停止键按下。", true);
-                    return false;
-                }
+            //4、设置WD
+            //iSEM.SetWorkingDistance(currHole.Position.WD);
+            //Thread.Sleep(1000);
 
-                //8.控制FIB拍照
-                //9.保存照片======更改路径
-                //20201103,FIB使用定位的放大倍数
-                String fileName2 = currHole.data_path + "\\" +currHole.HoleName + "_" + MParam.Location_Magnification.ToString("0") + "_" + ImageName2;
-
-
-                //FIB的放大位数,将来会改
-                //log.Info("测量线程:设置FIB放大倍数" + MParam.Location_Magnification.ToString(), true);
-                //20201103,FIB使用定位的放大倍数
-                //if (!iSEM.SetFIBMagnification(MParam.Location_Magnification))
-                //{
-                //    arg.Message = "FIB放大倍数设置失败";
-                //    arg.State = false;
-                //    SendMsg("2-2");
-                //    log.Error("测量线程失败:FIB放大倍数设置失败。", false);
-                //    return false;
-                //}
-                //arg.Message = "FIB放大倍数设置成功";
-                //arg.State = true;
-                //SendMsg("2-2");
-                //Thread.Sleep(200);
+            //20201127增加自动亮度对比度
+               
+                    
 
-                //判断是否停止进程
-                if (key_stop)
-                {
-                    log.Info("停止键按下。", true);
-                    return false;
-                }
+            Thread.Sleep(200);
+            iSEM.SetAutoBright(100);
+            Thread.Sleep(200);
+            iSEM.SetAutoContrast(100);
+            iSEM.SetAutoVideoBrightnessAndContrast();
+                           
+                            
+            Thread.Sleep(6000);
 
-                //4、设置WD
-                iSEM.SetWorkingDistance(currHole.Position.WD);
-                Thread.Sleep(1000);
 
-                //20201127增加自动亮度对比度
-                if (MParam.FIBDo)
-                {
-                    if (MParam.FIBAutoBC)
-                    {
-                        //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题
-                        float m_TempBrightness = 50.0f;
-                        float m_TempContrast = 30.0f;
-                        if (MParam.SampleName == "3" || MParam.SampleName == "1")
-                        {
-                            m_TempBrightness = 50.0f;
-                            m_TempContrast = 30.0f;
-                            iSEM.SetAutoVideoOff();
-                            Thread.Sleep(200);
-                            iSEM.SetBrightness(m_TempBrightness); //50.0f
-                            Thread.Sleep(200);
-                            iSEM.SetContrast(m_TempContrast); //30.0f
-                            Thread.Sleep(200);
-                        }
-                        else //add by sun 2020-12-17 解决3大类样品FIB下亮度过白导致无法识别问题  end
-                        {
-                            iSEM.SetAutoVideoBrightnessAndContrast();
-                            //20201128陈工建议增加
-                            Thread.Sleep(200);
-                            iSEM.SetAutoBright(100);
-                            Thread.Sleep(200);
-                            iSEM.SetAutoContrast(100);
-                            Thread.Sleep(5000);
-                        }
-                    }
-                    else
-                    {
-                        iSEM.SetAutoVideoOff();
-                        Thread.Sleep(200);
-                        iSEM.SetBrightness(MParam.FIBB);
-                        Thread.Sleep(200);
-                        iSEM.SetContrast(MParam.FIBC);
-                        Thread.Sleep(200);
-                    }
+               
 
-                }
 
+            //拍照前改变速度,延时
+        
+            Thread.Sleep(200);
 
-                //拍照前改变速度,延时
-                //iSEM.CloseReduced();
-                Thread.Sleep(200);
-                ////add by sun 2020-12-15 增加不同样品扫描速度参数,每大类样品3种扫描速度
-                //iSEM.CmdFocusScanSpeed(MParam.ScanSpeedHigh);//iSEM.CmdSaveRate();
-                ////add by sun 2020 - 12 - 15 增加不同样品扫描速度参数,每大类样品3种扫描速度 end
-                //Thread.Sleep(200);
-                //cycle_time = iSEM.GetCycleTime();
-                //Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
-                m_photo.GetParam().Mag = MParam.Location_Magnification;
-                m_photo.GetParam().savePath = fileName2;
-                if (!m_photo.TakePhoto())
-                {                    
-                    log.Error("测量线程报错:FIB拍照失败。", false);
-                    return false;
-                }
+            m_photo.GetParam().Mag = MParam.Location_Magnification;
+            m_photo.GetParam().savePath = fileName2;
+            if (!m_photo.TakePhoto())
+            {                    
+                log.Error("测量线程报错:FIB拍照失败。", false);
+                return false;
+            }
                 
-                mArgSend.SendArgumentToScreen("2-3", "FIB拍照成功",fileName2);
-                //Thread.Sleep(200);
-                ////SendMsg("1-16");
-                //iSEM.CmdFocusScanSpeed(MParam.ScanSpeedNormal);//CmdFocusRate(4);
-                //Thread.Sleep(200);
-                //cycle_time = iSEM.GetCycleTime();
-                //Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
-                //判断是否停止进程
-                if (key_stop)
-                {
-                    log.Info("停止键按下。", true);
-                    return false;
-                }
-
-                iSEM.CmdFIBModeSEM();
-                Thread.Sleep(200);
+            mArgSend.SendArgumentToScreen("2-3", "FIB拍照成功",fileName2);
 
-                //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
-                log.Info("测量线程:调用图像处理接口,准备移动样品台", true);
-                log.Info("文件名=" + fileName2, true);
-                log.Info("样品类型=" + MParam.SampleName, true);
-                log.Info("供应商名称=" + MParam.Firm, true);
-                ImagePro.Img_Cut_Position(fileName2, Convert.ToInt32(MParam.SampleName), MParam.Firm, out x1, out y1, out x2, out y2, out state);
-                log.Info("FIB梯形左上角和右上角位置信息= (" + x1.ToString() + ", " + y1.ToString() + "), (" + x2.ToString() + ", " + y2.ToString() + ")", true);
-                log.Info("准备移动样品台返回状态=" + state.ToString(), true);
-                if (state == 1)
-                {
-                    //20201128将移动光束改为移动ely文件中的参数来实现沉积和切割
-                    float xc = (x1 + x2) / 2;
-                    float yc = (y1 + y2) / 2;
-                    x0 = xc - 512;
-                    y0 = 384 - yc;
-                    log.Info("移动像素 x = " + x0.ToString() + ",y=" + y0.ToString(), true);
-                    px = iSEM.GetPixelSize();
-                    //修改FIB切割的ELY文件坐标
-                    XmlDocument xmlDoc = new XmlDocument();
-                    xmlDoc.Load(MParam.FIBTemp);//加载baixml文件,xmlpath 为XML文件的路径du
-                    XmlNode xns = xmlDoc.SelectSingleNode("ELAYOUT/STRUCTURE_LIST/STRUCTURE/LAYER_REFERENCE/TRAPEZOID");
-                    if (xns != null)
-                    {
-                        XmlAttributeCollection attributeCol = xns.Attributes;
-                        //遍历自己点属性
-                        double width_a = Convert.ToDouble(attributeCol.GetNamedItem("width_a").Value) / 2.0;
-                        log.Info("XML-Width_a = " + width_a.ToString(), true);
-                        foreach (XmlAttribute attri in attributeCol)
-                        {
-                            if (attri.Name == "x")
-                            {
-                                attri.InnerText = ((x0 * px) * 1000000 - width_a).ToString();
-                                log.Info("XML-TopLeft-X = " + attri.InnerText, true);
-                            }
-                            else if (attri.Name == "y")
-                            {
-                                attri.InnerText = ((y0 * px) * 1000000 - 2.791).ToString();
-                                log.Info("XML-TopLeft-Y = " + attri.InnerText, true);
-                            }
-                        }
-                    }
-                    xns = xmlDoc.SelectSingleNode("ELAYOUT/STRUCTURE_LIST/STRUCTURE/LAYER_REFERENCE/RECT");
-                    if (xns != null)
-                    {
-                        XmlAttributeCollection attributeCol = xns.Attributes;
-                        double width = Convert.ToDouble(attributeCol.GetNamedItem("width").Value) / 2.0;
-                        //遍历自己点属性
-                        foreach (XmlAttribute attri in attributeCol)
-                        {
-                            if (attri.Name == "x")
-                            {
-                                attri.InnerText = ((x0 * px) * 1000000 - width).ToString();
-                            }
-                            else if (attri.Name == "y")
-                            {
-                                attri.InnerText = (((y0 * px) * 1000000) + 2 - 2.791).ToString();
-                            }
-                        }
-                    }
-                    xmlDoc.Save(MParam.FIBTemp);//保存的该XML文件,否则更新无效
-                    //判断是否需要PT沉积,如果需要也要修改PT的ELY文件
-                    if (MParam.PT)
-                    {
-                        xmlDoc = new XmlDocument();
-                        xmlDoc.Load(MParam.PTTemp);//加载baixml文件,xmlpath 为XML文件的路径du
-                        xns = xmlDoc.SelectSingleNode("ELAYOUT/STRUCTURE_LIST/STRUCTURE/LAYER_REFERENCE/RECT");
-                        if (xns != null)
-                        {
-                            XmlAttributeCollection attributeCol = xns.Attributes;
-                            double width = Convert.ToDouble(attributeCol.GetNamedItem("width").Value) / 2.0;
-                            //因为ELY文件里的矩形高就是负值,所以在下面的Y值加上这个值就好。
-                            double height = Convert.ToDouble(attributeCol.GetNamedItem("height").Value) / 1.5;
-                            //遍历自己点属性
-                            foreach (XmlAttribute attri in attributeCol)
-                            {
-                                if (attri.Name == "x")
-                                {
-                                    attri.InnerText = ((x0 * px) * 1000000 - width).ToString();
-                                }
-                                else if (attri.Name == "y")
-                                {
-                                    attri.InnerText = ((y0 * px) * 1000000 - 2.791 - height).ToString();
-                                }
-                            }
-                        }
-                        xmlDoc.Save(MParam.PTTemp);
-                    }
-
-                    if (hand_intervene == 1)
-                    {
-                        MessageBox.Show("Web返回数据移动是否正确?\n如果错误请手动移动到指定位置后按确认", "确认消息", MessageBoxButtons.OK);
-                    }
-                }
-                else
-                {
-                  
-                    if (hand_intervene == 1)
-                    {
-                        if (DialogResult.Yes != MessageBox.Show("网络参数State返回为0。\n是否继续操作?。", "确认消息", MessageBoxButtons.YesNo))
-                        {
-                            return false;
-                        }
-                    }
-                    else
-                    {
-                        log.Error("测量线程报错:自动定位图像接口返回0", false);
-                        return false;
-                    }
+            //判断是否停止进程
+            if (key_stop)
+            {
+                log.Info("停止键按下。", true);
+                return false;
+            }
 
-                    log.Error("测量线程报错:自动定位图像接口返回0", false);
-                    return false;
-                }
-                //判断是否停止进程
-                if (key_stop)
-                {
-                    log.Info("停止键按下", true);
-                    return false;
-                }
+            iSEM.CmdFIBModeSEM();
+            Thread.Sleep(200);
+            float x1=0,y1=0, x2=0, y2=0;
+            //10.将照片传给客户,返回梯形位置坐标,及样品类型参数(是否需要PT沉积,PT坐标位置,PT宽度、PT高度、梯形上、下边及深度、扫描时间、束流、样品放大倍数1、样品放大倍数2等切割参数)
+            log.Info("测量线程:调用图像处理接口,准备移动样品台", true);
+            log.Info("文件名=" + fileName2, true);
+            log.Info("样品类型=" + MParam.SampleName, true);
+            log.Info("供应商名称=" + MParam.Firm, true);
+            ImagePro.Img_Cut_Position(fileName2, Convert.ToInt32(MParam.SampleName), MParam.Firm, out x1, out y1, out x2, out y2, out state);
+            log.Info("FIB梯形左上角和右上角位置信息= (" + x1.ToString() + ", " + y1.ToString() + "), (" + x2.ToString() + ", " + y2.ToString() + ")", true);
+            log.Info("准备移动样品台返回状态=" + state.ToString(), true);
+            if (state == 1)
+            {
+                m_FibWork.ModifyCutTemplate(x1, y1 ,x2, y2);
 
-                //11.自动工具样品类型参数确定是否需要PT沉积
+                //判断是否需要PT沉积,如果需要也要修改PT的ELY文件
                 if (MParam.PT)
                 {
-                    if (!iSEM.CmdFIBModeFIB())
-                    {
-                        log.Error("测量线程报错:切换到SEM模式失败", false);
-                        return false;
-                    }
-                    Thread.Sleep(200);
-                    //12.根据样品类型参数确定是否需要PT沉积,控制PT针插入
-                    if (MParam.Is_Photograph == false && MParam.PT == true)
-                    {
-                        log.Info("测量线程:插入PT针" + arg.Message, true);
-                        if (!InsertPT())
-                        {
-                            arg.Message = "插入PT针失败";
-                            arg.State = false;
-                            SendMsg("2-4");
-                            log.Error("测量线程报错:" + arg.Message, false);
-                            return false;
-                        }
-                        arg.State = true;
-                        arg.Message = "插入PT针成功";
-                        SendMsg("2-4");
-                    }
-                    //判断是否停止进程
-                    if (key_stop)
-                    {
-                        log.Info("停止键按下", true);
-                        return false;
-                    }
 
-                    //3. 根据坐标进行PT沉积   
-                    if (!PTWork())
-                    {
-                        arg.Message = "PT沉积失败";
-                       
-                        log.Error("测量线程报错:" + arg.Message, false);
-                        return false;
-                    }
-                    arg.State = true;
-                    arg.Message = "PT沉积成功";
-                    SendMsg("2-5");
-                    //判断是否停止进程
-                    if (key_stop)
-                    {
-                        log.Info("停止键按下", true);
-                        return false;
-                    }
+                    m_PTWork.ModifyPTTemp();
 
-                    //15.根据样品类型决定是否撤出PT针
-                    if (MParam.Is_Photograph == false && MParam.PT == true)
-                    {
-                        if (!RetractPT())
-                        {
-                            arg.Message = "撤出PT针失败";
-                           
-                            log.Error("测量线程报错:" + arg.Message, false);
-                            return false;
-                        }
-                        arg.State = true;
-                        arg.Message = "撤出PT针成功";
-                        SendMsg("2-6");
-                    }
-                    //判断是否停止进程
-                    if (key_stop)
-                    {
-                        log.Info("停止键按下", true);
-                        return false;
-                    }
-
-                    if (!iSEM.CmdFIBModeSEM())
-                    {
-                        //arg.Message = "切割前SEM拍照失败。";
-                        //arg.State = false;
-                        //SendMsg("1-17");
-                        log.Error("测量线程报错:切换到SEM模式失败", false);
-                        return false;
-                    }
                 }
+
+            }
+            else
+            {             
+
+                log.Error("测量线程报错:自动定位图像接口返回0", false);
+                return false;
+            }
+            //判断是否停止进程
+            if (key_stop)
+            {
+                log.Info("停止键按下", true);
+                return false;
             }
 
+           
+
             //14.保存样品1第1号孔中心位置6轴坐标1 XYZMRT到数据库,保存客户返回值信息到数据库
             float[] firstPosition = iSEM.GetStagePosition();
             m_cutHoles[0].Position.X = firstPosition[0];
@@ -1174,9 +853,7 @@ namespace MeasureThread
                 + firstPosition[3].ToString() + ","
                 + firstPosition[4].ToString() + ","
                 + firstPosition[5].ToString() + ")";
-            arg.State = true;
-            //SendMsg("1-16");
-            //判断是否停止进程
+           
             if (key_stop)
             {
                 log.Info("停止键按下", true);
@@ -1195,9 +872,7 @@ namespace MeasureThread
 
             if (!iSEM.CmdFIBModeFIB())
             {
-                arg.Message = "切换到FIB模式失败。";
-                arg.State = false;
-                SendMsg("2-7");
+
                 log.Error("测量线程报错:切换到SEM模式失败", false);
                 return false;
             }
@@ -1206,25 +881,15 @@ namespace MeasureThread
             SendMsg("2-7");
             Thread.Sleep(1000);
 
-            iSEM.SetMagnification(MParam.Location_Magnification);
-            float current = iSEM.GetMagnification();
-            while (Math.Abs(current - MParam.Location_Magnification) > 1)
-            {
-                iSEM.SetMagnification(MParam.Location_Magnification);
-                Thread.Sleep(200);
-                current = iSEM.GetMagnification();
-            }
-            Thread.Sleep(2000);
+            m_focuse.SetMagnification(MParam.Location_Magnification);
+           
 
             //14.自动控制FIB切割
             //1.根据参数设置FIB草率时间(使图清晰),设置梯形上下边及深度、设置束流
             //2.控制FIB进行切割
             //以上1、2步全部用ELY文件代替
-            if (!FIBWork())
-            {
-                arg.Message = "FIB切割失败";
-                arg.State = false;
-                SendMsg("2-8");
+            if (!m_FibWork.DoFIBWork())
+            { 
                 log.Error("测量线程报错:" + arg.Message, false);
                 return false;
             }
@@ -1290,10 +955,10 @@ namespace MeasureThread
             }
             Thread.Sleep(200);
 
-            iSEM.SetAutoVideoBrightnessAndContrast();
+            //iSEM.SetAutoVideoBrightnessAndContrast();
 
-            cycle_time = iSEM.GetCycleTime();
-            Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
+            //cycle_time = iSEM.GetCycleTime();
+            //Thread.Sleep(Convert.ToInt32(cycle_time) + 100);
             ////判断是否停止进程
 
             if (key_stop)
@@ -1427,8 +1092,6 @@ namespace MeasureThread
             {
                 m_TempBrightness = 50.0f;
                 m_TempContrast = 30.0f;
-
-
             }
 
             fprm.brightness = m_TempBrightness;
@@ -1509,26 +1172,12 @@ namespace MeasureThread
                     
                     mArgSend.SendArgumentToScreen("3-8", Message, fileName5);
 
-                    if (hand_intervene == 1)
-                    {
-                        MessageBox.Show("Web返回数据移动是否正确?\n如果错误请手动移动到指定位置后按确认", "确认消息", MessageBoxButtons.OK);
-                    }
+ 
                 }
                 else
                 {
                     
-                    if (hand_intervene == 1)
-                    {
-                        if (DialogResult.Yes != MessageBox.Show("网络参数State返回为0。\n是否继续操作?。", "确认消息", MessageBoxButtons.YesNo))
-                        {
-                            return false;
-                        }
-                    }
-                    else
-                    {
-                        //return false;
-                    }
-
+    
                     log.Error("测量线程报错:" + arg.Message, false);
                 }
                 //判断是否停止进程
@@ -1618,14 +1267,7 @@ namespace MeasureThread
                     for(int curmag=2000; curmag < magMax+3000; curmag += 5000)
                     {
                         
-                        fprm.IfAutoBrightnessAndContrast = true;
-
-                        if (MParam.SampleName == "3")
-                        {
-
-                            fprm.brightness = 50f;
-                            fprm.contrast = 30f;
-                        }
+                        fprm.IfAutoBrightnessAndContrast = true;                       
 
                         fprm.reduceWinHeight = 480;
                         fprm.reduceWinWidth = 450;
@@ -1640,9 +1282,9 @@ namespace MeasureThread
 
 
                     }
-                   
-                    #endregion
 
+                    #endregion
+                    m_photo.EnforceBrightness();//enter inside,enforce the brightness.
                     #region 循环拍照
                     for (int n = 0; n < ct.Count; n++)
                     {
@@ -1684,6 +1326,7 @@ namespace MeasureThread
 
                         m_photo.GetParam().savePath = fileName7;
                         m_photo.GetParam().Mag = mag[n];
+                       
                        m_photo.TakePhoto();
 
 
@@ -1707,26 +1350,10 @@ namespace MeasureThread
 
                     #endregion
 
-                    if (hand_intervene == 1)
-                    {
-                        MessageBox.Show("Web返回数据移动是否正确?\n如果错误请手动移动到指定位置后按确认", "确认消息", MessageBoxButtons.OK);
-                    }
                 }
                 else
                 {
-                    if (hand_intervene == 1)
-                    {
-                        if (DialogResult.Yes != MessageBox.Show("网络参数State返回为0。\n是否继续操作?。", "确认消息", MessageBoxButtons.YesNo))
-                        {
-                            // return false;
-                        }
-                    }
-                    else
-                    {
-                        //return false;
-                    }
-
-                   
+              
                     log.Error("测量线程报错:" + arg.Message, false);
                 }
                 //判断是否停止进程
@@ -1798,7 +1425,7 @@ namespace MeasureThread
                     arg.Message = "角度补偿54度成功!";
                     arg.State = true;
                     SendMsg("0-2");
-                    Thread.Sleep(1000);
+                  
                     //判断是否停止进程
                     if (key_stop)
                     {
@@ -1829,25 +1456,44 @@ namespace MeasureThread
                     arg.Message = "拉直操作自动对焦成功!";
                     arg.State = true;
                     SendMsg("1-0");
-                    Thread.Sleep(1000);
+                    Thread.Sleep(200);
                     arg.Message = "拉直拍照成功!";
                     arg.Picture_Information.Picture_FullPath = "";
                     arg.State = true;
                     SendMsg("1-1");
-                    Thread.Sleep(1000);
+                    Thread.Sleep(200);
                     arg.Message = "拉直操作完成";
                     arg.State = true;
                     SendMsg("1-2");
-                    Thread.Sleep(1000);
+                    Thread.Sleep(200);
                 }
 
                 //13. 自动 定位功能 PT沉积 
-                log.Warn("测量线程:第一个孔的测试过程-自动定位开始!", true);
-                if (!GetPoistion(currHole))
+               
+                if (!MParam.Is_Photograph)
                 {
-                    log.Error("测量线程报错:自动定位失败,程序退出。", false);
-                    return false;
+                    log.Warn("测量线程:PIB切割自动定位开始!", true);
+                    if (!GetFIBPoistion(currHole))
+                    {
+                        log.Error("测量线程报错:自动定位失败,程序退出。", false);
+                        return false;
+                    }
+
+
+                    //11.自动工具样品类型参数确定是否需要PT沉积
+                    if (MParam.PT)
+                    {
+                   
+
+                        arg.State = true;
+                        arg.Message = "PT沉积";
+                        SendMsg("2-4");
+                        m_PTWork.DoWholePTWork();
+                    }
                 }
+
+
+
                 log.Info("测量线程:第一个孔的测试过程-自动定位结束!", true);
                 //判断是否停止进程
                 if (key_stop)
@@ -1861,13 +1507,13 @@ namespace MeasureThread
                 {
                     if (MParam.IsCutingForDebug)
                     {
-                        log.Warn("测量线程:第一个孔的测试过程-14.自动控制FIB切割开始!==" + MParam.IsCutingForDebug, true);
+                        log.Warn("测量线程:自动控制FIB切割开始!==" + MParam.IsCutingForDebug, true);
                         if (!FIBCross())
                         {
                             log.Error("测量线程报错:自动控制FIB切割失败。", false);
                             return false;
                         }
-                        log.Info("测量线程:第一个孔的测试过程-14.自动控制FIB切割结束!", true);
+                        log.Info("测量线程:自动控制FIB切割结束!", true);
                     }
                 }
                 //del by sun 2020-12-15 temp end
@@ -1936,7 +1582,7 @@ namespace MeasureThread
             if (MParam.EDS)
             {
                
-                if (currHole.HoleNo + 1 == m_cutHoles.Count)
+                if (currHole.HoleNo + 1 == m_cutHoles.Count)//最后样品分析点才跑能谱
                 {
                     log.Warn("测量线程:第一个孔的测试过程-19.能谱分析开始===" + MParam.EDS, true);
                     EDS_Analysis(currHole);
@@ -2031,19 +1677,8 @@ namespace MeasureThread
             log.Info("图像处理结果拉直角度=" + degree.ToString(), true);
             if (state == 0)
             {
-                log.Info("测量线程:图像处理接口参数state返回为零", false);
-          
-                if (hand_intervene == 1)
-                {
-                    if (DialogResult.Yes != MessageBox.Show("网络参数State返回为0。\n是否继续操作?。", "确认消息", MessageBoxButtons.YesNo))
-                    {
-                        return false;
-                    }
-                }
-                else
-                {
-                    return false;
-                }
+                log.Info("测量线程:图像处理接口参数state返回为零", false);        
+   
 
                 return false;
             }
@@ -2214,7 +1849,7 @@ namespace MeasureThread
                                     Segment segment = new Segment();
                                     segment.X = LinesStartPoint[i].X;
                                     segment.Y = LinesStartPoint[i].Y + j;
-                                    segment.Length = 1;
+                                    segment.Length = 2;
                                     segments.Add(segment);
                                 }
                                 listFeature.Add(segments);
@@ -2365,9 +2000,7 @@ namespace MeasureThread
             
                 Mag = mag,
                 savePath = fileName4,
-                //scanSpeed= MParam.ScanSpeedHigh,
-                //scanSpeedAfter=MParam.ScanSpeedNormal,
-                
+                              
                   
             };
             //Photo pho = new Photo(prm,iSEM);
@@ -2375,14 +2008,10 @@ namespace MeasureThread
             m_photo.TakePhoto();
      
             arg.Picture_Information.Picture_FullPath = fileName4;
-            arg.Picture_Information.Work_Voltage = iSEM.GetSEMVoltage();
-            //Thread.Sleep(200);
-            arg.Picture_Information.Magnification = iSEM.GetMagnification();
-            //Thread.Sleep(200);
-            arg.Picture_Information.Work_Distance = iSEM.GetWorkingDistance();
-            //Thread.Sleep(200);
-            SendMsg("4-2");
-            //拍照前改变速度,延时
+    
+            mArgSend.SendArgumentToScreen("4-2", "", fileName4);
+            
+           
 
             if (key_stop)
             {
@@ -2412,20 +2041,7 @@ namespace MeasureThread
             }
             else
             {
-                arg.Message = "图像接口参数state返回值为零";
-                arg.State = false;
-                //SendMsg("3-3");
-                if (hand_intervene == 1)
-                {
-                    if (DialogResult.Yes != MessageBox.Show("网络参数State返回为0。\n是否继续操作?。", "确认消息", MessageBoxButtons.YesNo))
-                    {
-                        return false;
-                    }
-                }
-                else
-                {
-                    return false;
-                }
+
                 log.Error("测量线程报错:" + arg.Message, false);
                 return false;
             }
@@ -2474,9 +2090,9 @@ namespace MeasureThread
           
 
             log.Info("自动对焦开始!", true);
-            Focus f = new Focus(iSEM) ;
-            f.setFocusParam(fprm);
-            f.DoFocus();
+            
+            m_focuse.setFocusParam(fprm);
+            m_focuse.DoFocusByNewMagnification(MParam.Photograph_Magnification);
             SendMsg("4-4");
             fprm.ifStig = false;
 
@@ -2595,7 +2211,7 @@ namespace MeasureThread
                 {
                     Locate recordPostion = new Locate(iSEM);
                     recordPostion.RecordCurrentBeamShiftAndStagePosition();
-                    //找到放大倍数最大值
+                    //找到第一个观测点放大倍数find the first anylysis point and the mag.
                     magMax = mag[0];
                   
 
@@ -2629,7 +2245,7 @@ namespace MeasureThread
                     log.Info("自动对焦1开始!", true);
                    
                     m_focuse.setFocusParam(fprm1);
-                    m_focuse.DoFocus();
+                    m_focuse.DoFocusByNewMagnification(magMax / 2);
 
 
                     log.Info("自动对焦2开始!", true);
@@ -2658,8 +2274,8 @@ namespace MeasureThread
                 log.Info("开始EDS拍照,设置放大倍数" + mag[0]);
                  
                  m_focuse.SetMagnification(mag[0]);
-              
-                
+
+                    m_photo.EnforceBrightness();
 
                 log.Warn("EDS获取指定观测点图片,并打Xray");
                 DoEDS(currHole, 1);
@@ -2738,7 +2354,7 @@ namespace MeasureThread
                 ifStig = false,
                  
             };
-            //Focus f = new Focus(focusPrm, iSEM);
+          
             m_focuse.setFocusParam(focusPrm);
             m_focuse.DoFocus();
 

+ 2 - 0
MeasureThread/MeasureThread.csproj

@@ -74,6 +74,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ArgSend.cs" />
+    <Compile Include="FibWork.cs" />
     <Compile Include="ILocate.cs" />
     <Compile Include="Locate.cs" />
     <Compile Include="Photo.cs" />
@@ -84,6 +85,7 @@
     <Compile Include="Measure.cs" />
     <Compile Include="Helpers\NewFunMethod.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="PTWork.cs" />
     <Compile Include="ThreadStatus.cs" />
     <Compile Include="UserControls\Control_XRayTable.cs">
       <SubType>UserControl</SubType>

+ 14 - 0
MeasureThread/Photo.cs

@@ -33,6 +33,20 @@ namespace MeasureThread
             }
             return prm;
         }
+        public void EnforceBrightness()
+        {
+            float b = iSEM.GetBrightness();
+            Thread.Sleep(100);
+            iSEM.SetBrightness(b + 1);
+            Thread.Sleep(200);
+        }
+        public void EnforceContrast()
+        {
+            float c= iSEM.GetContrast();
+            Thread.Sleep(100);
+            iSEM.SetContrast(c + 1);
+            Thread.Sleep(200);
+        }
         public bool TakePhoto()        {