瀏覽代碼

更新SmartSEM封装库和FormUnitControl界面

@wang_qi0307 5 年之前
父節點
當前提交
d024f5d5b8

+ 0 - 5
HOZProject/CommandsList.txt

@@ -1,5 +0,0 @@
-CMD_BEAM_OFF,Beam Off
-CMD_BEAM_ON,开电压
-CMD_EHT_OFF,关电压
-CMD_SHUTDOWN,Shutdown
-CMD_DO_SEM_DRIFT_CORRN,电子束校正

+ 561 - 162
HOZProject/FormUnitControl.Designer.cs

@@ -36,6 +36,46 @@
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.btnStageSetM = new System.Windows.Forms.Button();
+            this.txtStageM = new System.Windows.Forms.TextBox();
+            this.lblStageM = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.btnStageGetM = new System.Windows.Forms.Button();
+            this.btnStageSetR = new System.Windows.Forms.Button();
+            this.txtStageR = new System.Windows.Forms.TextBox();
+            this.lblStageR = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.btnStageGetR = new System.Windows.Forms.Button();
+            this.btnStageSetT = new System.Windows.Forms.Button();
+            this.txtStageT = new System.Windows.Forms.TextBox();
+            this.lblStageT = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.btnStageGetT = new System.Windows.Forms.Button();
+            this.btnStageSetZ = new System.Windows.Forms.Button();
+            this.txtStageZ = new System.Windows.Forms.TextBox();
+            this.lblStageZ = new System.Windows.Forms.Label();
+            this.label17 = new System.Windows.Forms.Label();
+            this.btnStageGetZ = new System.Windows.Forms.Button();
+            this.btnStageSetY = new System.Windows.Forms.Button();
+            this.txtStageY = new System.Windows.Forms.TextBox();
+            this.lblStageY = new System.Windows.Forms.Label();
+            this.label19 = new System.Windows.Forms.Label();
+            this.btnStageGetY = new System.Windows.Forms.Button();
+            this.btnStageSetX = new System.Windows.Forms.Button();
+            this.txtStageX = new System.Windows.Forms.TextBox();
+            this.lblStageX = new System.Windows.Forms.Label();
+            this.label21 = new System.Windows.Forms.Label();
+            this.btnStageGetX = new System.Windows.Forms.Button();
+            this.btnCloseVoltage = new System.Windows.Forms.Button();
+            this.btnOpenVoltage = new System.Windows.Forms.Button();
+            this.lblPixelSizeGet = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.btnPixelSizeGet = new System.Windows.Forms.Button();
+            this.btnScanRotationSet = new System.Windows.Forms.Button();
+            this.txtScanRotationSet = new System.Windows.Forms.TextBox();
+            this.lblScanRotationGet = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.btnScanRotationGet = new System.Windows.Forms.Button();
             this.btnTiltAngleSet = new System.Windows.Forms.Button();
             this.txtTiltAngleSet = new System.Windows.Forms.TextBox();
             this.lblTiltAngleGet = new System.Windows.Forms.Label();
@@ -71,18 +111,8 @@
             this.lblenlargeGet = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.tabPage2 = new System.Windows.Forms.TabPage();
-            this.btnPixelSizeSet = new System.Windows.Forms.Button();
-            this.txtPixelSizeSet = new System.Windows.Forms.TextBox();
-            this.lblPixelSizeGet = new System.Windows.Forms.Label();
-            this.label9 = new System.Windows.Forms.Label();
-            this.btnPixelSizeGet = new System.Windows.Forms.Button();
-            this.btnScanRotationSet = new System.Windows.Forms.Button();
-            this.txtScanRotationSet = new System.Windows.Forms.TextBox();
-            this.lblScanRotationGet = new System.Windows.Forms.Label();
-            this.label11 = new System.Windows.Forms.Label();
-            this.btnScanRotationGet = new System.Windows.Forms.Button();
-            this.btnOpenVoltage = new System.Windows.Forms.Button();
-            this.btnCloseVoltage = new System.Windows.Forms.Button();
+            this.tabPage3 = new System.Windows.Forms.TabPage();
+            this.btnGetStagePosition = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
@@ -154,7 +184,7 @@
             this.groupBox1.Controls.Add(this.btnInit);
             this.groupBox1.Controls.Add(this.btnCloseCtrl);
             this.groupBox1.Controls.Add(this.btnSetNotify);
-            this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.groupBox1.Location = new System.Drawing.Point(3, 1);
             this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.groupBox1.Name = "groupBox1";
@@ -168,6 +198,7 @@
             // 
             this.tabControl1.Controls.Add(this.tabPage1);
             this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Controls.Add(this.tabPage3);
             this.tabControl1.Location = new System.Drawing.Point(3, 100);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
@@ -177,10 +208,39 @@
             // tabPage1
             // 
             this.tabPage1.BackColor = System.Drawing.Color.Transparent;
+            this.tabPage1.Controls.Add(this.btnGetStagePosition);
+            this.tabPage1.Controls.Add(this.btnStageSetM);
+            this.tabPage1.Controls.Add(this.txtStageM);
+            this.tabPage1.Controls.Add(this.lblStageM);
+            this.tabPage1.Controls.Add(this.label10);
+            this.tabPage1.Controls.Add(this.btnStageGetM);
+            this.tabPage1.Controls.Add(this.btnStageSetR);
+            this.tabPage1.Controls.Add(this.txtStageR);
+            this.tabPage1.Controls.Add(this.lblStageR);
+            this.tabPage1.Controls.Add(this.label13);
+            this.tabPage1.Controls.Add(this.btnStageGetR);
+            this.tabPage1.Controls.Add(this.btnStageSetT);
+            this.tabPage1.Controls.Add(this.txtStageT);
+            this.tabPage1.Controls.Add(this.lblStageT);
+            this.tabPage1.Controls.Add(this.label15);
+            this.tabPage1.Controls.Add(this.btnStageGetT);
+            this.tabPage1.Controls.Add(this.btnStageSetZ);
+            this.tabPage1.Controls.Add(this.txtStageZ);
+            this.tabPage1.Controls.Add(this.lblStageZ);
+            this.tabPage1.Controls.Add(this.label17);
+            this.tabPage1.Controls.Add(this.btnStageGetZ);
+            this.tabPage1.Controls.Add(this.btnStageSetY);
+            this.tabPage1.Controls.Add(this.txtStageY);
+            this.tabPage1.Controls.Add(this.lblStageY);
+            this.tabPage1.Controls.Add(this.label19);
+            this.tabPage1.Controls.Add(this.btnStageGetY);
+            this.tabPage1.Controls.Add(this.btnStageSetX);
+            this.tabPage1.Controls.Add(this.txtStageX);
+            this.tabPage1.Controls.Add(this.lblStageX);
+            this.tabPage1.Controls.Add(this.label21);
+            this.tabPage1.Controls.Add(this.btnStageGetX);
             this.tabPage1.Controls.Add(this.btnCloseVoltage);
             this.tabPage1.Controls.Add(this.btnOpenVoltage);
-            this.tabPage1.Controls.Add(this.btnPixelSizeSet);
-            this.tabPage1.Controls.Add(this.txtPixelSizeSet);
             this.tabPage1.Controls.Add(this.lblPixelSizeGet);
             this.tabPage1.Controls.Add(this.label9);
             this.tabPage1.Controls.Add(this.btnPixelSizeGet);
@@ -232,6 +292,433 @@
             this.tabPage1.TabIndex = 0;
             this.tabPage1.Text = "SEM";
             // 
+            // btnStageSetM
+            // 
+            this.btnStageSetM.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageSetM.Location = new System.Drawing.Point(1043, 204);
+            this.btnStageSetM.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageSetM.Name = "btnStageSetM";
+            this.btnStageSetM.Size = new System.Drawing.Size(78, 33);
+            this.btnStageSetM.TabIndex = 80;
+            this.btnStageSetM.Text = "Set";
+            this.btnStageSetM.UseVisualStyleBackColor = true;
+            this.btnStageSetM.Click += new System.EventHandler(this.btnStageSetM_Click);
+            // 
+            // txtStageM
+            // 
+            this.txtStageM.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtStageM.Location = new System.Drawing.Point(937, 205);
+            this.txtStageM.Name = "txtStageM";
+            this.txtStageM.Size = new System.Drawing.Size(100, 30);
+            this.txtStageM.TabIndex = 79;
+            this.txtStageM.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblStageM
+            // 
+            this.lblStageM.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblStageM.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblStageM.Location = new System.Drawing.Point(762, 204);
+            this.lblStageM.Name = "lblStageM";
+            this.lblStageM.Size = new System.Drawing.Size(84, 33);
+            this.lblStageM.TabIndex = 78;
+            this.lblStageM.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.Location = new System.Drawing.Point(621, 210);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(138, 27);
+            this.label10.TabIndex = 77;
+            this.label10.Text = "样品台 M轴:";
+            // 
+            // btnStageGetM
+            // 
+            this.btnStageGetM.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageGetM.Location = new System.Drawing.Point(852, 204);
+            this.btnStageGetM.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageGetM.Name = "btnStageGetM";
+            this.btnStageGetM.Size = new System.Drawing.Size(78, 33);
+            this.btnStageGetM.TabIndex = 76;
+            this.btnStageGetM.Text = "Get";
+            this.btnStageGetM.UseVisualStyleBackColor = true;
+            this.btnStageGetM.Click += new System.EventHandler(this.btnStageGetM_Click);
+            // 
+            // btnStageSetR
+            // 
+            this.btnStageSetR.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageSetR.Location = new System.Drawing.Point(1043, 167);
+            this.btnStageSetR.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageSetR.Name = "btnStageSetR";
+            this.btnStageSetR.Size = new System.Drawing.Size(78, 33);
+            this.btnStageSetR.TabIndex = 75;
+            this.btnStageSetR.Text = "Set";
+            this.btnStageSetR.UseVisualStyleBackColor = true;
+            this.btnStageSetR.Click += new System.EventHandler(this.btnStageSetR_Click);
+            // 
+            // txtStageR
+            // 
+            this.txtStageR.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtStageR.Location = new System.Drawing.Point(937, 168);
+            this.txtStageR.Name = "txtStageR";
+            this.txtStageR.Size = new System.Drawing.Size(100, 30);
+            this.txtStageR.TabIndex = 74;
+            this.txtStageR.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblStageR
+            // 
+            this.lblStageR.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblStageR.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblStageR.Location = new System.Drawing.Point(762, 167);
+            this.lblStageR.Name = "lblStageR";
+            this.lblStageR.Size = new System.Drawing.Size(84, 33);
+            this.lblStageR.TabIndex = 73;
+            this.lblStageR.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label13.Location = new System.Drawing.Point(621, 173);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(131, 27);
+            this.label13.TabIndex = 72;
+            this.label13.Text = "样品台 R轴:";
+            // 
+            // btnStageGetR
+            // 
+            this.btnStageGetR.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageGetR.Location = new System.Drawing.Point(852, 167);
+            this.btnStageGetR.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageGetR.Name = "btnStageGetR";
+            this.btnStageGetR.Size = new System.Drawing.Size(78, 33);
+            this.btnStageGetR.TabIndex = 71;
+            this.btnStageGetR.Text = "Get";
+            this.btnStageGetR.UseVisualStyleBackColor = true;
+            this.btnStageGetR.Click += new System.EventHandler(this.btnStageGetR_Click);
+            // 
+            // btnStageSetT
+            // 
+            this.btnStageSetT.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageSetT.Location = new System.Drawing.Point(1043, 130);
+            this.btnStageSetT.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageSetT.Name = "btnStageSetT";
+            this.btnStageSetT.Size = new System.Drawing.Size(78, 33);
+            this.btnStageSetT.TabIndex = 70;
+            this.btnStageSetT.Text = "Set";
+            this.btnStageSetT.UseVisualStyleBackColor = true;
+            this.btnStageSetT.Click += new System.EventHandler(this.btnStageSetT_Click);
+            // 
+            // txtStageT
+            // 
+            this.txtStageT.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtStageT.Location = new System.Drawing.Point(937, 131);
+            this.txtStageT.Name = "txtStageT";
+            this.txtStageT.Size = new System.Drawing.Size(100, 30);
+            this.txtStageT.TabIndex = 69;
+            this.txtStageT.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblStageT
+            // 
+            this.lblStageT.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblStageT.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblStageT.Location = new System.Drawing.Point(762, 130);
+            this.lblStageT.Name = "lblStageT";
+            this.lblStageT.Size = new System.Drawing.Size(84, 33);
+            this.lblStageT.TabIndex = 68;
+            this.lblStageT.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label15.Location = new System.Drawing.Point(621, 136);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(129, 27);
+            this.label15.TabIndex = 67;
+            this.label15.Text = "样品台 T轴:";
+            // 
+            // btnStageGetT
+            // 
+            this.btnStageGetT.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageGetT.Location = new System.Drawing.Point(852, 130);
+            this.btnStageGetT.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageGetT.Name = "btnStageGetT";
+            this.btnStageGetT.Size = new System.Drawing.Size(78, 33);
+            this.btnStageGetT.TabIndex = 66;
+            this.btnStageGetT.Text = "Get";
+            this.btnStageGetT.UseVisualStyleBackColor = true;
+            this.btnStageGetT.Click += new System.EventHandler(this.btnStageGetT_Click);
+            // 
+            // btnStageSetZ
+            // 
+            this.btnStageSetZ.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageSetZ.Location = new System.Drawing.Point(1043, 93);
+            this.btnStageSetZ.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageSetZ.Name = "btnStageSetZ";
+            this.btnStageSetZ.Size = new System.Drawing.Size(78, 33);
+            this.btnStageSetZ.TabIndex = 65;
+            this.btnStageSetZ.Text = "Set";
+            this.btnStageSetZ.UseVisualStyleBackColor = true;
+            this.btnStageSetZ.Click += new System.EventHandler(this.btnStageSetZ_Click);
+            // 
+            // txtStageZ
+            // 
+            this.txtStageZ.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtStageZ.Location = new System.Drawing.Point(937, 94);
+            this.txtStageZ.Name = "txtStageZ";
+            this.txtStageZ.Size = new System.Drawing.Size(100, 30);
+            this.txtStageZ.TabIndex = 64;
+            this.txtStageZ.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblStageZ
+            // 
+            this.lblStageZ.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblStageZ.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblStageZ.Location = new System.Drawing.Point(762, 93);
+            this.lblStageZ.Name = "lblStageZ";
+            this.lblStageZ.Size = new System.Drawing.Size(84, 33);
+            this.lblStageZ.TabIndex = 63;
+            this.lblStageZ.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label17.Location = new System.Drawing.Point(621, 99);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(130, 27);
+            this.label17.TabIndex = 62;
+            this.label17.Text = "样品台 Z轴:";
+            // 
+            // btnStageGetZ
+            // 
+            this.btnStageGetZ.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageGetZ.Location = new System.Drawing.Point(852, 93);
+            this.btnStageGetZ.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageGetZ.Name = "btnStageGetZ";
+            this.btnStageGetZ.Size = new System.Drawing.Size(78, 33);
+            this.btnStageGetZ.TabIndex = 61;
+            this.btnStageGetZ.Text = "Get";
+            this.btnStageGetZ.UseVisualStyleBackColor = true;
+            this.btnStageGetZ.Click += new System.EventHandler(this.btnStageGetZ_Click);
+            // 
+            // btnStageSetY
+            // 
+            this.btnStageSetY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageSetY.Location = new System.Drawing.Point(1043, 56);
+            this.btnStageSetY.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageSetY.Name = "btnStageSetY";
+            this.btnStageSetY.Size = new System.Drawing.Size(78, 33);
+            this.btnStageSetY.TabIndex = 60;
+            this.btnStageSetY.Text = "Set";
+            this.btnStageSetY.UseVisualStyleBackColor = true;
+            this.btnStageSetY.Click += new System.EventHandler(this.btnStageSetY_Click);
+            // 
+            // txtStageY
+            // 
+            this.txtStageY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtStageY.Location = new System.Drawing.Point(937, 57);
+            this.txtStageY.Name = "txtStageY";
+            this.txtStageY.Size = new System.Drawing.Size(100, 30);
+            this.txtStageY.TabIndex = 59;
+            this.txtStageY.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblStageY
+            // 
+            this.lblStageY.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblStageY.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblStageY.Location = new System.Drawing.Point(762, 56);
+            this.lblStageY.Name = "lblStageY";
+            this.lblStageY.Size = new System.Drawing.Size(84, 33);
+            this.lblStageY.TabIndex = 58;
+            this.lblStageY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label19
+            // 
+            this.label19.AutoSize = true;
+            this.label19.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label19.Location = new System.Drawing.Point(621, 62);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(130, 27);
+            this.label19.TabIndex = 57;
+            this.label19.Text = "样品台 Y轴:";
+            // 
+            // btnStageGetY
+            // 
+            this.btnStageGetY.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageGetY.Location = new System.Drawing.Point(852, 56);
+            this.btnStageGetY.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageGetY.Name = "btnStageGetY";
+            this.btnStageGetY.Size = new System.Drawing.Size(78, 33);
+            this.btnStageGetY.TabIndex = 56;
+            this.btnStageGetY.Text = "Get";
+            this.btnStageGetY.UseVisualStyleBackColor = true;
+            this.btnStageGetY.Click += new System.EventHandler(this.btnStageGetY_Click);
+            // 
+            // btnStageSetX
+            // 
+            this.btnStageSetX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageSetX.Location = new System.Drawing.Point(1043, 19);
+            this.btnStageSetX.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageSetX.Name = "btnStageSetX";
+            this.btnStageSetX.Size = new System.Drawing.Size(78, 33);
+            this.btnStageSetX.TabIndex = 55;
+            this.btnStageSetX.Text = "Set";
+            this.btnStageSetX.UseVisualStyleBackColor = true;
+            this.btnStageSetX.Click += new System.EventHandler(this.btnStageSetX_Click);
+            // 
+            // txtStageX
+            // 
+            this.txtStageX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtStageX.Location = new System.Drawing.Point(937, 20);
+            this.txtStageX.Name = "txtStageX";
+            this.txtStageX.Size = new System.Drawing.Size(100, 30);
+            this.txtStageX.TabIndex = 54;
+            this.txtStageX.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblStageX
+            // 
+            this.lblStageX.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblStageX.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblStageX.Location = new System.Drawing.Point(762, 19);
+            this.lblStageX.Name = "lblStageX";
+            this.lblStageX.Size = new System.Drawing.Size(84, 33);
+            this.lblStageX.TabIndex = 53;
+            this.lblStageX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label21
+            // 
+            this.label21.AutoSize = true;
+            this.label21.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label21.Location = new System.Drawing.Point(621, 25);
+            this.label21.Name = "label21";
+            this.label21.Size = new System.Drawing.Size(131, 27);
+            this.label21.TabIndex = 52;
+            this.label21.Text = "样品台 X轴:";
+            // 
+            // btnStageGetX
+            // 
+            this.btnStageGetX.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnStageGetX.Location = new System.Drawing.Point(852, 19);
+            this.btnStageGetX.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnStageGetX.Name = "btnStageGetX";
+            this.btnStageGetX.Size = new System.Drawing.Size(78, 33);
+            this.btnStageGetX.TabIndex = 51;
+            this.btnStageGetX.Text = "Get";
+            this.btnStageGetX.UseVisualStyleBackColor = true;
+            this.btnStageGetX.Click += new System.EventHandler(this.btnStageGetX_Click);
+            // 
+            // btnCloseVoltage
+            // 
+            this.btnCloseVoltage.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnCloseVoltage.Location = new System.Drawing.Point(435, 375);
+            this.btnCloseVoltage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnCloseVoltage.Name = "btnCloseVoltage";
+            this.btnCloseVoltage.Size = new System.Drawing.Size(144, 42);
+            this.btnCloseVoltage.TabIndex = 50;
+            this.btnCloseVoltage.Text = "关闭电压";
+            this.btnCloseVoltage.UseVisualStyleBackColor = true;
+            this.btnCloseVoltage.Click += new System.EventHandler(this.btnCloseVoltage_Click);
+            // 
+            // btnOpenVoltage
+            // 
+            this.btnOpenVoltage.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnOpenVoltage.Location = new System.Drawing.Point(275, 375);
+            this.btnOpenVoltage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnOpenVoltage.Name = "btnOpenVoltage";
+            this.btnOpenVoltage.Size = new System.Drawing.Size(144, 42);
+            this.btnOpenVoltage.TabIndex = 49;
+            this.btnOpenVoltage.Text = "开启电压";
+            this.btnOpenVoltage.UseVisualStyleBackColor = true;
+            this.btnOpenVoltage.Click += new System.EventHandler(this.btnOpenVoltage_Click);
+            // 
+            // lblPixelSizeGet
+            // 
+            this.lblPixelSizeGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblPixelSizeGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPixelSizeGet.Location = new System.Drawing.Point(204, 311);
+            this.lblPixelSizeGet.Name = "lblPixelSizeGet";
+            this.lblPixelSizeGet.Size = new System.Drawing.Size(84, 33);
+            this.lblPixelSizeGet.TabIndex = 46;
+            this.lblPixelSizeGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(22, 314);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(104, 27);
+            this.label9.TabIndex = 45;
+            this.label9.Text = "Pixel Size:";
+            // 
+            // btnPixelSizeGet
+            // 
+            this.btnPixelSizeGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnPixelSizeGet.Location = new System.Drawing.Point(294, 311);
+            this.btnPixelSizeGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnPixelSizeGet.Name = "btnPixelSizeGet";
+            this.btnPixelSizeGet.Size = new System.Drawing.Size(78, 33);
+            this.btnPixelSizeGet.TabIndex = 44;
+            this.btnPixelSizeGet.Text = "Get";
+            this.btnPixelSizeGet.UseVisualStyleBackColor = true;
+            this.btnPixelSizeGet.Click += new System.EventHandler(this.btnPixelSizeGet_Click);
+            // 
+            // btnScanRotationSet
+            // 
+            this.btnScanRotationSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnScanRotationSet.Location = new System.Drawing.Point(485, 274);
+            this.btnScanRotationSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnScanRotationSet.Name = "btnScanRotationSet";
+            this.btnScanRotationSet.Size = new System.Drawing.Size(78, 33);
+            this.btnScanRotationSet.TabIndex = 43;
+            this.btnScanRotationSet.Text = "Set";
+            this.btnScanRotationSet.UseVisualStyleBackColor = true;
+            this.btnScanRotationSet.Click += new System.EventHandler(this.btnScanRotationSet_Click);
+            // 
+            // txtScanRotationSet
+            // 
+            this.txtScanRotationSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtScanRotationSet.Location = new System.Drawing.Point(379, 275);
+            this.txtScanRotationSet.Name = "txtScanRotationSet";
+            this.txtScanRotationSet.Size = new System.Drawing.Size(100, 30);
+            this.txtScanRotationSet.TabIndex = 42;
+            this.txtScanRotationSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblScanRotationGet
+            // 
+            this.lblScanRotationGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblScanRotationGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblScanRotationGet.Location = new System.Drawing.Point(204, 274);
+            this.lblScanRotationGet.Name = "lblScanRotationGet";
+            this.lblScanRotationGet.Size = new System.Drawing.Size(84, 33);
+            this.lblScanRotationGet.TabIndex = 41;
+            this.lblScanRotationGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label11.Location = new System.Drawing.Point(22, 277);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(185, 27);
+            this.label11.TabIndex = 40;
+            this.label11.Text = "Scan Rotate角度:";
+            // 
+            // btnScanRotationGet
+            // 
+            this.btnScanRotationGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnScanRotationGet.Location = new System.Drawing.Point(294, 274);
+            this.btnScanRotationGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnScanRotationGet.Name = "btnScanRotationGet";
+            this.btnScanRotationGet.Size = new System.Drawing.Size(78, 33);
+            this.btnScanRotationGet.TabIndex = 39;
+            this.btnScanRotationGet.Text = "Get";
+            this.btnScanRotationGet.UseVisualStyleBackColor = true;
+            this.btnScanRotationGet.Click += new System.EventHandler(this.btnScanRotationGet_Click);
+            // 
             // btnTiltAngleSet
             // 
             this.btnTiltAngleSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -261,13 +748,12 @@
             this.lblTiltAngleGet.Name = "lblTiltAngleGet";
             this.lblTiltAngleGet.Size = new System.Drawing.Size(84, 33);
             this.lblTiltAngleGet.TabIndex = 36;
-            this.lblTiltAngleGet.Text = "0";
             this.lblTiltAngleGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label7
             // 
             this.label7.AutoSize = true;
-            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label7.Location = new System.Drawing.Point(22, 243);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(112, 27);
@@ -315,16 +801,15 @@
             this.lblAstigmatismYGet.Name = "lblAstigmatismYGet";
             this.lblAstigmatismYGet.Size = new System.Drawing.Size(84, 33);
             this.lblAstigmatismYGet.TabIndex = 31;
-            this.lblAstigmatismYGet.Text = "0";
             this.lblAstigmatismYGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label5.Location = new System.Drawing.Point(22, 206);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(105, 27);
+            this.label5.Size = new System.Drawing.Size(104, 27);
             this.label5.TabIndex = 30;
             this.label5.Text = "消像散Y:";
             // 
@@ -369,16 +854,15 @@
             this.lblAstigmatismXGet.Name = "lblAstigmatismXGet";
             this.lblAstigmatismXGet.Size = new System.Drawing.Size(84, 33);
             this.lblAstigmatismXGet.TabIndex = 26;
-            this.lblAstigmatismXGet.Text = "0";
             this.lblAstigmatismXGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label8
             // 
             this.label8.AutoSize = true;
-            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label8.Location = new System.Drawing.Point(22, 169);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(106, 27);
+            this.label8.Size = new System.Drawing.Size(105, 27);
             this.label8.TabIndex = 25;
             this.label8.Text = "消像散X:";
             // 
@@ -423,13 +907,12 @@
             this.lblContrastGet.Name = "lblContrastGet";
             this.lblContrastGet.Size = new System.Drawing.Size(84, 33);
             this.lblContrastGet.TabIndex = 21;
-            this.lblContrastGet.Text = "0";
             this.lblContrastGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label4.Location = new System.Drawing.Point(22, 132);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(92, 27);
@@ -477,13 +960,12 @@
             this.lblBrightnessGet.Name = "lblBrightnessGet";
             this.lblBrightnessGet.Size = new System.Drawing.Size(84, 33);
             this.lblBrightnessGet.TabIndex = 16;
-            this.lblBrightnessGet.Text = "0";
             this.lblBrightnessGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label6
             // 
             this.label6.AutoSize = true;
-            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label6.Location = new System.Drawing.Point(22, 95);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(72, 27);
@@ -531,13 +1013,12 @@
             this.lblWDGet.Name = "lblWDGet";
             this.lblWDGet.Size = new System.Drawing.Size(84, 33);
             this.lblWDGet.TabIndex = 11;
-            this.lblWDGet.Text = "0";
             this.lblWDGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.Location = new System.Drawing.Point(22, 58);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(72, 27);
@@ -585,13 +1066,12 @@
             this.lblenlargeGet.Name = "lblenlargeGet";
             this.lblenlargeGet.Size = new System.Drawing.Size(84, 33);
             this.lblenlargeGet.TabIndex = 6;
-            this.lblenlargeGet.Text = "0";
             this.lblenlargeGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.Location = new System.Drawing.Point(22, 21);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(72, 27);
@@ -606,140 +1086,29 @@
             this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
             this.tabPage2.Size = new System.Drawing.Size(1127, 438);
             this.tabPage2.TabIndex = 1;
-            this.tabPage2.Text = "tabPage2";
+            this.tabPage2.Text = "FIB";
             this.tabPage2.UseVisualStyleBackColor = true;
             // 
-            // btnPixelSizeSet
-            // 
-            this.btnPixelSizeSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnPixelSizeSet.Location = new System.Drawing.Point(485, 311);
-            this.btnPixelSizeSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.btnPixelSizeSet.Name = "btnPixelSizeSet";
-            this.btnPixelSizeSet.Size = new System.Drawing.Size(78, 33);
-            this.btnPixelSizeSet.TabIndex = 48;
-            this.btnPixelSizeSet.Text = "Set";
-            this.btnPixelSizeSet.UseVisualStyleBackColor = true;
-            this.btnPixelSizeSet.Click += new System.EventHandler(this.btnPixelSizeSet_Click);
-            // 
-            // txtPixelSizeSet
-            // 
-            this.txtPixelSizeSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
-            this.txtPixelSizeSet.Location = new System.Drawing.Point(379, 312);
-            this.txtPixelSizeSet.Name = "txtPixelSizeSet";
-            this.txtPixelSizeSet.Size = new System.Drawing.Size(100, 30);
-            this.txtPixelSizeSet.TabIndex = 47;
-            this.txtPixelSizeSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // lblPixelSizeGet
-            // 
-            this.lblPixelSizeGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.lblPixelSizeGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblPixelSizeGet.Location = new System.Drawing.Point(204, 311);
-            this.lblPixelSizeGet.Name = "lblPixelSizeGet";
-            this.lblPixelSizeGet.Size = new System.Drawing.Size(84, 33);
-            this.lblPixelSizeGet.TabIndex = 46;
-            this.lblPixelSizeGet.Text = "0";
-            this.lblPixelSizeGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // label9
-            // 
-            this.label9.AutoSize = true;
-            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(22, 314);
-            this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(113, 27);
-            this.label9.TabIndex = 45;
-            this.label9.Text = "Pixel Size:";
-            // 
-            // btnPixelSizeGet
+            // tabPage3
             // 
-            this.btnPixelSizeGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnPixelSizeGet.Location = new System.Drawing.Point(294, 311);
-            this.btnPixelSizeGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.btnPixelSizeGet.Name = "btnPixelSizeGet";
-            this.btnPixelSizeGet.Size = new System.Drawing.Size(78, 33);
-            this.btnPixelSizeGet.TabIndex = 44;
-            this.btnPixelSizeGet.Text = "Get";
-            this.btnPixelSizeGet.UseVisualStyleBackColor = true;
-            this.btnPixelSizeGet.Click += new System.EventHandler(this.btnPixelSizeGet_Click);
+            this.tabPage3.Location = new System.Drawing.Point(4, 25);
+            this.tabPage3.Name = "tabPage3";
+            this.tabPage3.Size = new System.Drawing.Size(1127, 438);
+            this.tabPage3.TabIndex = 2;
+            this.tabPage3.Text = "PT";
+            this.tabPage3.UseVisualStyleBackColor = true;
             // 
-            // btnScanRotationSet
+            // btnGetStagePosition
             // 
-            this.btnScanRotationSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnScanRotationSet.Location = new System.Drawing.Point(485, 274);
-            this.btnScanRotationSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.btnScanRotationSet.Name = "btnScanRotationSet";
-            this.btnScanRotationSet.Size = new System.Drawing.Size(78, 33);
-            this.btnScanRotationSet.TabIndex = 43;
-            this.btnScanRotationSet.Text = "Set";
-            this.btnScanRotationSet.UseVisualStyleBackColor = true;
-            this.btnScanRotationSet.Click += new System.EventHandler(this.btnScanRotationSet_Click);
-            // 
-            // txtScanRotationSet
-            // 
-            this.txtScanRotationSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
-            this.txtScanRotationSet.Location = new System.Drawing.Point(379, 275);
-            this.txtScanRotationSet.Name = "txtScanRotationSet";
-            this.txtScanRotationSet.Size = new System.Drawing.Size(100, 30);
-            this.txtScanRotationSet.TabIndex = 42;
-            this.txtScanRotationSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // lblScanRotationGet
-            // 
-            this.lblScanRotationGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.lblScanRotationGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblScanRotationGet.Location = new System.Drawing.Point(204, 274);
-            this.lblScanRotationGet.Name = "lblScanRotationGet";
-            this.lblScanRotationGet.Size = new System.Drawing.Size(84, 33);
-            this.lblScanRotationGet.TabIndex = 41;
-            this.lblScanRotationGet.Text = "0";
-            this.lblScanRotationGet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            // 
-            // label11
-            // 
-            this.label11.AutoSize = true;
-            this.label11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label11.Location = new System.Drawing.Point(22, 277);
-            this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(192, 27);
-            this.label11.TabIndex = 40;
-            this.label11.Text = "Scan Rotate角度:";
-            // 
-            // btnScanRotationGet
-            // 
-            this.btnScanRotationGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnScanRotationGet.Location = new System.Drawing.Point(294, 274);
-            this.btnScanRotationGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.btnScanRotationGet.Name = "btnScanRotationGet";
-            this.btnScanRotationGet.Size = new System.Drawing.Size(78, 33);
-            this.btnScanRotationGet.TabIndex = 39;
-            this.btnScanRotationGet.Text = "Get";
-            this.btnScanRotationGet.UseVisualStyleBackColor = true;
-            this.btnScanRotationGet.Click += new System.EventHandler(this.btnScanRotationGet_Click);
-            // 
-            // btnOpenVoltage
-            // 
-            this.btnOpenVoltage.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnOpenVoltage.Location = new System.Drawing.Point(275, 375);
-            this.btnOpenVoltage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.btnOpenVoltage.Name = "btnOpenVoltage";
-            this.btnOpenVoltage.Size = new System.Drawing.Size(144, 42);
-            this.btnOpenVoltage.TabIndex = 49;
-            this.btnOpenVoltage.Text = "开启电压";
-            this.btnOpenVoltage.UseVisualStyleBackColor = true;
-            this.btnOpenVoltage.Click += new System.EventHandler(this.btnOpenVoltage_Click);
-            // 
-            // btnCloseVoltage
-            // 
-            this.btnCloseVoltage.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.btnCloseVoltage.Location = new System.Drawing.Point(435, 375);
-            this.btnCloseVoltage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.btnCloseVoltage.Name = "btnCloseVoltage";
-            this.btnCloseVoltage.Size = new System.Drawing.Size(144, 42);
-            this.btnCloseVoltage.TabIndex = 50;
-            this.btnCloseVoltage.Text = "关闭电压";
-            this.btnCloseVoltage.UseVisualStyleBackColor = true;
-            this.btnCloseVoltage.Click += new System.EventHandler(this.btnCloseVoltage_Click);
+            this.btnGetStagePosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnGetStagePosition.Location = new System.Drawing.Point(626, 262);
+            this.btnGetStagePosition.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnGetStagePosition.Name = "btnGetStagePosition";
+            this.btnGetStagePosition.Size = new System.Drawing.Size(144, 42);
+            this.btnGetStagePosition.TabIndex = 81;
+            this.btnGetStagePosition.Text = "获取位置数组";
+            this.btnGetStagePosition.UseVisualStyleBackColor = true;
+            this.btnGetStagePosition.Click += new System.EventHandler(this.btnGetStagePosition_Click);
             // 
             // FormUnitControl
             // 
@@ -803,8 +1172,6 @@
         private System.Windows.Forms.Label lblTiltAngleGet;
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.Button btnTiltAngleGet;
-        private System.Windows.Forms.Button btnPixelSizeSet;
-        private System.Windows.Forms.TextBox txtPixelSizeSet;
         private System.Windows.Forms.Label lblPixelSizeGet;
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.Button btnPixelSizeGet;
@@ -815,6 +1182,38 @@
         private System.Windows.Forms.Button btnScanRotationGet;
         private System.Windows.Forms.Button btnCloseVoltage;
         private System.Windows.Forms.Button btnOpenVoltage;
+        private System.Windows.Forms.TabPage tabPage3;
+        private System.Windows.Forms.Button btnStageSetM;
+        private System.Windows.Forms.TextBox txtStageM;
+        private System.Windows.Forms.Label lblStageM;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Button btnStageGetM;
+        private System.Windows.Forms.Button btnStageSetR;
+        private System.Windows.Forms.TextBox txtStageR;
+        private System.Windows.Forms.Label lblStageR;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Button btnStageGetR;
+        private System.Windows.Forms.Button btnStageSetT;
+        private System.Windows.Forms.TextBox txtStageT;
+        private System.Windows.Forms.Label lblStageT;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Button btnStageGetT;
+        private System.Windows.Forms.Button btnStageSetZ;
+        private System.Windows.Forms.TextBox txtStageZ;
+        private System.Windows.Forms.Label lblStageZ;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.Button btnStageGetZ;
+        private System.Windows.Forms.Button btnStageSetY;
+        private System.Windows.Forms.TextBox txtStageY;
+        private System.Windows.Forms.Label lblStageY;
+        private System.Windows.Forms.Label label19;
+        private System.Windows.Forms.Button btnStageGetY;
+        private System.Windows.Forms.Button btnStageSetX;
+        private System.Windows.Forms.TextBox txtStageX;
+        private System.Windows.Forms.Label lblStageX;
+        private System.Windows.Forms.Label label21;
+        private System.Windows.Forms.Button btnStageGetX;
+        private System.Windows.Forms.Button btnGetStagePosition;
     }
 }
 

+ 179 - 500
HOZProject/FormUnitControl.cs

@@ -18,151 +18,10 @@ namespace HOZProject
     public partial class FormUnitControl : Form
     {
         #region 系统参数
-        private String path= Directory.GetCurrentDirectory();
+        private String path = Directory.GetCurrentDirectory();
         private SmartSEM sem = new SmartSEM();
         #endregion
 
-        #region 远程处理服务器可能发送给您的通知代码。
-        // Notification codes that the Remoting server may send to you.
-        public enum ZeissNotificationCode
-        {
-            PARAMETER_CHANGE = 0,
-            PARAMETER_XY_CHANGE = 6,
-            EMSERVER_HAS_LOADED = 1111111,
-            EMSERVER_HAS_EXITED = 2222222,
-            EMSERVER_USER_LOGGED_ON = 3333333,
-            EMSERVER_USER_LOGGED_OFF = 4444444,
-            REMOTING_SERVER_EXITED = 5555555,
-            EMSERVER_FIBUI_HAS_LOADED = 6666666
-        }
-        #endregion
-
-        #region 返回错误代码
-        public enum ZeissErrorCode
-        {
-            // Failed to translate parameter into an id
-            API_E_GET_TRANSLATE_FAIL = 1000,
-
-            // Failed to get analogue value
-            API_E_GET_AP_FAIL = 1001,
-
-            // Failed to get digital value
-            API_E_GET_DP_FAIL = 1002,
-            // Parameter supplied is not analogue nor digital
-            API_E_GET_BAD_PARAMETER = 1003,
-
-            // Failed to translate parameter into an id
-            API_E_SET_TRANSLATE_FAIL = 1004,
-
-            // Failed to set a digital state 
-            API_E_SET_STATE_FAIL = 1005,
-
-            // Failed to set a float value
-            API_E_SET_FLOAT_FAIL = 1006,
-
-            // Value supplied is too low
-            API_E_SET_FLOAT_LIMIT_LOW = 1007,
-
-            // Value supplied is too high
-            API_E_SET_FLOAT_LIMIT_HIGH = 1008,
-
-            // Value supplied is is of wrong type
-            API_E_SET_BAD_VALUE = 1009,
-
-            // Parameter supplied is not analogue nor digital
-            API_E_SET_BAD_PARAMETER = 1010,
-
-            // Failed to translate command into an id
-            API_E_EXEC_TRANSLATE_FAIL = 1011,
-
-            // Failed to execute command=
-            API_E_EXEC_CMD_FAIL = 1012,
-
-            // Failed to execute file macro
-            API_E_EXEC_MCF_FAIL = 1013,
-
-            // Failed to execute library macro
-            API_E_EXEC_MCL_FAIL = 1014,
-
-            // Command supplied is not implemented
-            API_E_EXEC_BAD_COMMAND = 1015,
-
-            // Grab command failed
-            API_E_GRAB_FAIL = 1016,
-
-            // Get Stage position failed
-            API_E_GET_STAGE_FAIL = 1017,
-
-            // Move Stage position failed
-            API_E_MOVE_STAGE_FAIL = 1018,
-
-            // API not initialised
-            API_E_NOT_INITIALISED = 1019,
-
-            // Failed to translate parameter to an id
-            API_E_NOTIFY_TRANSLATE_FAIL = 1020,
-
-            // Set notification failed
-            API_E_NOTIFY_SET_FAIL = 1021,
-
-            // Get limits failed
-            API_E_GET_LIMITS_FAIL = 1022,
-
-            // Get multiple parameters failed
-            API_E_GET_MULTI_FAIL = 1023,
-
-            // Set multiple parameters failed
-            API_E_SET_MULTI_FAIL = 1024,
-
-            // Missing API license
-            API_E_NOT_LICENSED = 1025,
-
-            // Reserved or not implemented
-            API_E_NOT_IMPLEMENTED = 1026,
-
-            // Failed to get user name (Remoting Interface only)
-            API_E_GET_USER_NAME_FAIL = 1027,
-
-            // Failed to get user idle state (Remoting Interface only)
-            API_E_GET_USER_IDLE_FAIL = 1028,
-
-            // Failed to get the last remoting connection error string (Remoting Interface Only)
-            API_E_GET_LAST_REMOTING_CONNECT_ERROR_FAIL = 1029,
-
-            // Failed to remotely logon to the EM Server (username and password may be incorrect or EM Server is not running or User is already logged on
-            API_E_EMSERVER_LOGON_FAILED = 1030,
-
-            // Failed to start the EM Server - this may be because the Server is already running or has an internal error. 
-            API_E_EMSERVER_START_FAILED = 1031,
-
-            // The command or parameter is currently disabled (you cannot execute or set it).
-            API_E_PARAMETER_IS_DISABLED = 1032,
-
-            // Remoting incorrectly configured, use RConfigure to correct
-            API_E_REMOTING_NOT_CONFIGURED = 2027,
-
-            // Remoting did not connect to the server
-            API_E_REMOTING_FAILED_TO_CONNECT = 2028,
-
-            // Remoting could not start (unknown reason)
-            API_E_REMOTING_COULD_NOT_CREATE_INTERFACE = 2029,
-
-            // Remoting: Remote server is not running currently.
-            API_E_REMOTING_EMSERVER_NOT_RUNNING = 2030,
-
-            // Remoting: Remote server has no user logged in
-            API_E_REMOTING_NO_USER_LOGGED_IN = 2031,
-
-
-            // Internal Defines, although they may be useful in your own program. TRS.
-            API_FIRST_REMOTING_ERROR_CODE = API_E_REMOTING_NOT_CONFIGURED,
-            API_LAST_REMOTING_ERROR_CODE = API_E_REMOTING_NO_USER_LOGGED_IN,
-
-            API_FIRST_ERROR_CODE = API_E_GET_TRANSLATE_FAIL,
-            API_LAST_ERROR_CODE = API_E_REMOTING_NO_USER_LOGGED_IN
-        }
-        #endregion
-
         #region 构造函数
         public FormUnitControl()
         {
@@ -176,342 +35,10 @@ namespace HOZProject
         }
         #endregion
 
-        #region 控件加载事件1
-        public void CZEMApi_Notify(string strParameter, int reason)
-        {
-            Notify(strParameter, reason);
-        }
-        #endregion
-
-        #region 控件加载事件2
-        public void CZEMApi_NotifyWithCurrentValue(string strParameter, int reason, int paramid, double dLastKnownValue)
-        {
-            Notify(strParameter, reason);
-        }
-        #endregion
-
-        #region 加载事件调用函数
-        public void Notify(string strParameter, int reason)
-        {
-            //string strGetEMSERVERMsg = "";
-            //switch ((ZeissNotificationCode)reason)
-            //{
-            //    case ZeissNotificationCode.PARAMETER_CHANGE: // Parameter Change
-            //        if (strParameter == "DP_VACSTATUS" || strParameter == "DP_RUNUPSTATE" || strParameter == "DP_COLUMN_TYPE" || strParameter == "DP_OPERATING_MODE"
-            //            || strParameter == "DP_SCANRATE" || strParameter == "DP_AUTO_FUNCTION" || strParameter == "DP_DETECTOR_TYPE" || strParameter == "DP_STAGE_INIT"
-            //            || strParameter == "DP_STAGE_IS" || strParameter == "DP_FIB_MODE" || strParameter == "DP_FIB_GUN_STATE" || strParameter == "AP_ACTUALKV"
-            //            || strParameter == "AP_ACTUALCURRENT" || strParameter == "AP_MAG" || strParameter == "AP_WD" || strParameter == "AP_IPROBE" || strParameter== "AP_CONTRAST")
-            //        {
-            //            UpdateStatus(strParameter);
-            //        }
-            //        break;
-
-            //    case ZeissNotificationCode.REMOTING_SERVER_EXITED:
-            //        //listServerMsg.Items.Add("Remote Server Exited");
-            //        strGetEMSERVERMsg = "Remote Server Exited";
-            //        DisplayError("Remote Server closed", "");
-            //        m_bInitialised = false;
-            //        //txtEditInit.Text = "Not Initialised";
-            //        //txtEditNotify.Text = "No Notification";
-            //        //txtEditInit.BackColor = Color.Red;
-            //        //txtEditNotify.BackColor = Color.Red;
-            //        break;
-
-            //    default:
-            //        strGetEMSERVERMsg = strParameter;
-            //        break;
-            //}
-
-            //if (strGetEMSERVERMsg.Length > 0)
-            //{
-            //    //if (txtNotifyEdit.Text.Length > 0)
-            //    //{
-            //    //    txtNotifyEdit.Text += "\r\n" + strGetEMSERVERMsg;
-            //    //    txtNotifyEdit.SelectionStart = txtNotifyEdit.Text.Length;
-            //    //    txtNotifyEdit.SelectionLength = 0;
-            //    //}
-            //    //else
-            //    //{
-            //    //    txtNotifyEdit.Text = strGetEMSERVERMsg;
-            //    //}
-            //}
-        }
-        #endregion
-
-        #region 更新状态
-        public void UpdateStatus(string szParam)
-        {
-            //object varStr = new VariantWrapper("");
-            //object varfloat = new VariantWrapper((float)0.0f);
-            //if(szParam.IndexOf("AP")==0)
-            //{
-            //    lrt = CZEMApi.Get(szParam, ref varfloat);
-            //    if (lrt != 0)
-            //    {
-            //        ReportError(lrt, "Update Status", szParam);
-            //        return;
-            //    }
-            //    lblgetValue.Text = Convert.ToDecimal(varfloat).ToString();
-            //}
-            //else
-            //{
-            //    lrt = CZEMApi.Get(szParam, ref varStr);
-            //    if (lrt != 0)
-            //    {
-            //        ReportError(lrt, "Update Status", szParam);
-            //        return;
-            //    }
-            //    lblgetValue.Text = varStr.ToString();
-            //}
-            
-            
-            
-            //if (szParam == "DP_VACSTATUS")
-            //{
-            //    txtEditVacStatus.Text = "VAC status = " + varStr;
-            //}
-            //else if (szParam == "DP_RUNUPSTATE")
-            //{
-            //    txtEditRunupstate.Text = "Beam Status = " + varStr;
-            //}
-            //else if (szParam == "DP_COLUMN_TYPE")
-            //{
-            //    txtEditColumnType.Text = "Column Type = " + varStr;
-            //}
-            //else if (szParam == "DP_STAGE_INIT")
-            //{
-            //    txtEditStageInit.Text = "Stage Initialised = " + varStr;
-            //}
-            //else if (szParam == "DP_STAGE_IS")
-            //{
-            //    txtEditStageIs.Text = "Stage = " + varStr;
-            //}
-            //else if (szParam == "DP_OPERATING_MODE")
-            //{
-            //    txtEditOperatingMode.Text = "Operating Mode = " + varStr;
-            //}
-            //else if (szParam == "DP_SCANRATE")
-            //{
-            //    txtEditScanrate.Text = "Scan Rate = " + varStr;
-            //}
-            //else if (szParam == "DP_AUTO_FUNCTION")
-            //{
-            //    txtEditAutoFunction.Text = "Auto Function = " + varStr;
-            //}
-            //else if (szParam == "DP_DETECTOR_TYPE")
-            //{
-            //    txtEditDetectorType.Text = "Detector =  " + varStr;
-            //}
-            //else if (szParam == "DP_FIB_MODE")
-            //{
-            //    txtEditFibMode.Text = "FIB Mode =  " + varStr;
-            //}
-            //else if (szParam == "DP_FIB_GUN_STATE")
-            //{
-            //    txtEditFibGunState.Text = "FIB Gun =  " + varStr;
-            //}
-            //else if (szParam == "AP_ACTUALKV")
-            //{
-            //    txtEditActualkv.Text = "EHT " + varStr;
-            //}
-            //else if (szParam == "AP_ACTUALCURRENT")
-            //{
-            //    txtEditActualcurrent.Text = "I " + varStr;
-            //}
-            //else if (szParam == "AP_MAG")
-            //{
-            //    txtEditMag.Text = "Mag " + varStr;
-            //}
-            //else if (szParam == "AP_WD")
-            //{
-            //    txtEditWd.Text = "WD " + varStr;
-            //}
-            //else if (szParam == "AP_IPROBE")
-            //{
-            //    txtEditIprobe.Text = "Probe I " + varStr;
-            //}
-        }
-        #endregion
-
-        #region 显示错误代码
-        internal void DisplayError(string strCaller, string strComment)
-        {
-            //if (m_bInitialised)
-            //{
-            //    object objError = new VariantWrapper("");
-            //    long lResult = CZEMApi.GetLastError(ref objError);
-            //    if (lResult == 0)
-            //    {
-            //        if (objError != null)
-            //        {
-            //            ReportError(objError.ToString(), strCaller, strComment);
-            //        }
-            //        else
-            //        {
-            //            ReportError("No error occured", strCaller, strComment);
-            //        }
-            //    }
-            //    else
-            //    {
-            //        ReportError("Cannot get last error", strCaller, strComment);
-            //    }
-            //}
-        }
-        #endregion
-
-        #region 输出错误号1
-        internal void ReportError(string strError, string strCaller, string strComment)
-        {
-            if (strCaller.Length != 0 || strComment.Length != 0)
-            {
-               // listmsg.Items.Add(string.Format("{0}\r\nCaller: {1}\r\nComment: {2}", strError, strCaller, strComment));
-            }
-            else
-            {
-                //listmsg.Items.Add(strError);
-            }
-        }
-        #endregion
-
-        #region 输出错误2
-        internal void ReportError(long lReturn, string strCaller, string strComment)
-        {
-            ReportError(ErrorToString(lReturn), strCaller, strComment);
-        }
-        #endregion
-
-        #region 错误代码转换
-        string ErrorToString(long lError)
-        {
-            string strError;
-            switch ((ZeissErrorCode)lError)
-            {
-                case 0:
-                    strError = "OK";
-                    break;
-                case ZeissErrorCode.API_E_GET_TRANSLATE_FAIL:
-                    strError = "Failed to translate parameter into an ID";
-                    break;
-                case ZeissErrorCode.API_E_GET_AP_FAIL:
-                    strError = "Failed to get analogue value";
-                    break;
-                case ZeissErrorCode.API_E_GET_DP_FAIL:
-                    strError = "Failed to get digital value";
-                    break;
-                case ZeissErrorCode.API_E_GET_BAD_PARAMETER:
-                    strError = "Parameter supplied is neither analogue nor digital";
-                    break;
-                case ZeissErrorCode.API_E_SET_TRANSLATE_FAIL:
-                    strError = "Failed to translate parameter into an ID";
-                    break;
-                case ZeissErrorCode.API_E_SET_STATE_FAIL:
-                    strError = "Failed to set a digital state";
-                    break;
-                case ZeissErrorCode.API_E_SET_FLOAT_FAIL:
-                    strError = "Failed to set a float value";
-                    break;
-                case ZeissErrorCode.API_E_SET_FLOAT_LIMIT_LOW:
-                    strError = "Value supplied is too low";
-                    break;
-                case ZeissErrorCode.API_E_SET_FLOAT_LIMIT_HIGH:
-                    strError = "Value supplied is too high";
-                    break;
-                case ZeissErrorCode.API_E_SET_BAD_VALUE:
-                    strError = "Value supplied is of wrong type";
-                    break;
-                case ZeissErrorCode.API_E_SET_BAD_PARAMETER:
-                    strError = "Parameter supplied is not analogue nor digital";
-                    break;
-                case ZeissErrorCode.API_E_EXEC_TRANSLATE_FAIL:
-                    strError = "Failed to translate command into an ID";
-                    break;
-                case ZeissErrorCode.API_E_EXEC_CMD_FAIL:
-                    strError = "Failed to execute command";
-                    break;
-                case ZeissErrorCode.API_E_EXEC_MCF_FAIL:
-                    strError = "Failed to execute file macro";
-                    break;
-                case ZeissErrorCode.API_E_EXEC_MCL_FAIL:
-                    strError = "Failed to execute library macro";
-                    break;
-                case ZeissErrorCode.API_E_EXEC_BAD_COMMAND:
-                    strError = "Command supplied is not implemented";
-                    break;
-                case ZeissErrorCode.API_E_GRAB_FAIL:
-                    strError = "Grab command failed";
-                    break;
-                case ZeissErrorCode.API_E_GET_STAGE_FAIL:
-                    strError = "Get Stage position failed";
-                    break;
-                case ZeissErrorCode.API_E_MOVE_STAGE_FAIL:
-                    strError = "Move Stage position failed";
-                    break;
-                case ZeissErrorCode.API_E_NOT_INITIALISED:
-                    strError = "API not initialised";
-                    break;
-                case ZeissErrorCode.API_E_NOTIFY_TRANSLATE_FAIL: // 1020L
-                    strError = "Failed to translate parameter to an ID";
-                    break;
-                case ZeissErrorCode.API_E_NOTIFY_SET_FAIL:
-                    strError = "Set notification failed";
-                    break;
-                case ZeissErrorCode.API_E_GET_LIMITS_FAIL:
-                    strError = "Get limits failed";
-                    break;
-                case ZeissErrorCode.API_E_GET_MULTI_FAIL:
-                    strError = "Get multiple parameters failed";
-                    break;
-                case ZeissErrorCode.API_E_SET_MULTI_FAIL:
-                    strError = "Set multiple parameters failed";
-                    break;
-                case ZeissErrorCode.API_E_NOT_LICENSED:
-                    strError = "Missing API license";
-                    break;
-                case ZeissErrorCode.API_E_NOT_IMPLEMENTED:
-                    strError = "Reserved or not implemented";
-                    break;
-                case ZeissErrorCode.API_E_GET_USER_NAME_FAIL:
-                    strError = "Failed to get user name";
-                    break;
-                case ZeissErrorCode.API_E_GET_USER_IDLE_FAIL:
-                    strError = "Failed to get user idle state";
-                    break;
-                case ZeissErrorCode.API_E_GET_LAST_REMOTING_CONNECT_ERROR_FAIL:
-                    strError = "Failed to get the last remoting connection error string";
-                    break;
-                case ZeissErrorCode.API_E_EMSERVER_LOGON_FAILED:
-                    strError = "Failed to remotely logon to the EM Server. Username and password may be incorrect or EM Server is not running or User is already logged on";
-                    break;
-                case ZeissErrorCode.API_E_EMSERVER_START_FAILED:
-                    strError = "Failed to start the EM Server. This may be because the Server is already running or has an internal error.";
-                    break;
-                case ZeissErrorCode.API_E_REMOTING_NOT_CONFIGURED:
-                    strError = "Remoting incorrectly configured, use RConfigure to correct";
-                    break;
-                case ZeissErrorCode.API_E_REMOTING_FAILED_TO_CONNECT:
-                    strError = "Remoting did not connect to the server";
-                    break;
-                case ZeissErrorCode.API_E_REMOTING_COULD_NOT_CREATE_INTERFACE:
-                    strError = "Remoting could not start (unknown reason)";
-                    break;
-                case ZeissErrorCode.API_E_REMOTING_EMSERVER_NOT_RUNNING:
-                    strError = "EMServer is not running on the remote machine";
-                    break;
-                case ZeissErrorCode.API_E_REMOTING_NO_USER_LOGGED_IN:
-                    strError = "No user is logged into EM Server on the remote machine";
-                    break;
-                default:
-                    strError = string.Format("Unknown error code {0}", lError);
-                    break;
-            }
-            return strError;
-        }
-        #endregion
-
         #region 设备初始化按键
         private void btnInit_Click(object sender, EventArgs e)
         {
-            if(sem.Init())
+            if (sem.Init())
             {
                 btnInit.BackColor = Color.Lime;
             }
@@ -609,8 +136,8 @@ namespace HOZProject
             //        DisplayError("SetNotify", "DP_AUTO_FUNCTION");
             //        return;
             //    }
-                
-                
+
+
             //    // probe current
             //    if (CZEMApi.SetNotify("AP_IPROBE", 1) != 0)
             //    {
@@ -648,8 +175,8 @@ namespace HOZProject
             //        return;
             //    }
 
-                //listmsg.Items.Add("Notification enabled");
-           // }
+            //listmsg.Items.Add("Notification enabled");
+            // }
         }
         #endregion
 
@@ -657,7 +184,7 @@ namespace HOZProject
         private void btnenlargeGet_Click(object sender, EventArgs e)
         {
             float ret = sem.GetMagnification();
-            if(float.IsNaN(ret))
+            if (float.IsNaN(ret))
             {
                 lblenlargeGet.Text = "NaN";
                 txtenlargeSet.Enabled = false;
@@ -676,11 +203,11 @@ namespace HOZProject
         private void btnenlargeSet_Click(object sender, EventArgs e)
         {
             float set = 0;
-            if(float.TryParse(txtenlargeSet.Text, out set))
+            if (float.TryParse(txtenlargeSet.Text, out set))
             {
                 sem.SetMagnification(set);
             }
-            
+
         }
         #endregion
 
@@ -913,29 +440,14 @@ namespace HOZProject
         #region PixelSize Get
         private void btnPixelSizeGet_Click(object sender, EventArgs e)
         {
-            float ret = sem.GetScanRotation();
+            float ret = sem.GetPixelSize();
             if (float.IsNaN(ret))
             {
-                lblScanRotationGet.Text = "NaN";
-                txtScanRotationSet.Enabled = false;
-                btnScanRotationSet.Enabled = false;
+                lblPixelSizeGet.Text = "NaN";
             }
             else
             {
-                lblScanRotationGet.Text = ret.ToString();
-                txtScanRotationSet.Text = ret.ToString();
-                btnScanRotationSet.Enabled = true;
-            }
-        }
-        #endregion
-
-        #region PixelSize Set
-        private void btnPixelSizeSet_Click(object sender, EventArgs e)
-        {
-            float set = 0;
-            if (float.TryParse(txtScanRotationSet.Text, out set))
-            {
-                sem.SetScanRotation(set);
+                lblPixelSizeGet.Text = ret.ToString();
             }
         }
         #endregion
@@ -953,5 +465,172 @@ namespace HOZProject
             sem.CmdCloseVoltage();
         }
         #endregion
+
+        #region 样品台位置获取
+        private void btnStageGetX_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetStageAtX();
+            if (float.IsNaN(ret))
+            {
+                lblStageX.Text = "NaN";
+            }
+            else
+            {
+                lblStageX.Text = ret.ToString();
+            }
+        }
+
+        private void btnStageGetY_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetStageAtY();
+            if (float.IsNaN(ret))
+            {
+                lblStageY.Text = "NaN";
+            }
+            else
+            {
+                lblStageY.Text = ret.ToString();
+            }
+        }
+
+        private void btnStageGetZ_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetStageAtZ();
+            if (float.IsNaN(ret))
+            {
+                lblStageZ.Text = "NaN";
+            }
+            else
+            {
+                lblStageZ.Text = ret.ToString();
+            }
+        }
+
+        private void btnStageGetT_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetStageAtT();
+            if (float.IsNaN(ret))
+            {
+                lblStageT.Text = "NaN";
+            }
+            else
+            {
+                lblStageT.Text = ret.ToString();
+            }
+        }
+
+        private void btnStageGetR_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetStageAtR();
+            if (float.IsNaN(ret))
+            {
+                lblStageR.Text = "NaN";
+            }
+            else
+            {
+                lblStageR.Text = ret.ToString();
+            }
+        }
+
+        private void btnStageGetM_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetStageAtM();
+            if (float.IsNaN(ret))
+            {
+                lblStageM.Text = "NaN";
+            }
+            else
+            {
+                lblStageM.Text = ret.ToString();
+            }
+        }
+        #endregion
+
+        #region 样品台位置设置
+        private void btnStageSetX_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtStageX.Text, out set))
+            {
+                sem.SetStageGotoX(set);
+            }
+        }
+
+        private void btnStageSetY_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtStageY.Text, out set))
+            {
+                sem.SetStageGotoY(set);
+            }
+        }
+
+        private void btnStageSetZ_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtStageZ.Text, out set))
+            {
+                sem.SetStageGotoZ(set);
+            }
+        }
+
+        private void btnStageSetT_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtStageT.Text, out set))
+            {
+                sem.SetStageGotoT(set);
+            }
+        }
+
+        private void btnStageSetR_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtStageR.Text, out set))
+            {
+                sem.SetStageGotoR(set);
+            }
+        }
+
+        private void btnStageSetM_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtStageM.Text, out set))
+            {
+                sem.SetStageGotoM(set);
+            }
+        }
+        #endregion
+
+        #region 获取样品台位置数组
+        private void btnGetStagePosition_Click(object sender, EventArgs e)
+        {
+            float[] pt = sem.GetStagePosition();
+            if (!float.IsNaN(pt[0]))
+            {
+                lblStageX.Text = pt[0].ToString();
+            }
+            if (!float.IsNaN(pt[1]))
+            {
+                lblStageY.Text = pt[1].ToString();
+            }
+            if (!float.IsNaN(pt[2]))
+            {
+                lblStageZ.Text = pt[2].ToString();
+            }
+            if (!float.IsNaN(pt[3]))
+            {
+                lblStageT.Text = pt[3].ToString();
+            }
+            if (!float.IsNaN(pt[4]))
+            {
+                lblStageR.Text = pt[4].ToString();
+            }
+            if (!float.IsNaN(pt[5]))
+            {
+                lblStageM.Text = pt[5].ToString();
+            }
+        }
+        #endregion
     }
 }

+ 0 - 19
HOZProject/ParamsList.txt

@@ -1,19 +0,0 @@
-AP_MAG,缩放
-AP_WD,焦距
-AP_BRIGHTNESS,亮度
-AP_CONTRAST,对比度
-AP_STIG_X,消像散X轴
-AP_STIG_Y,消像散Y轴
-AP_TILT_ANGLE,角度补偿
-AP_STAGE_GOTO_X,X轴移动到
-AP_STAGE_GOTO_Y,Y轴移动到
-AP_SCANROTATION,Scan Rotate角度
-AP_PIXEL_SIZE,像素大小
-AP_STAGE_AT_X,X轴坐标
-AP_STAGE_AT_Y,Y轴坐标
-AP_STAGE_AT_Z,Z轴坐标
-AP_STAGE_AT_T,T轴坐标
-AP_STAGE_AT_R,R轴坐标
-AP_STAGE_AT_M,M轴坐标
-AP_AUTO_BRIGHT,自动亮度
-AP_AUTO_CONTRAST,自动对比度

+ 0 - 8
HOZProject/UnitControl.csproj

@@ -79,14 +79,6 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
-  <ItemGroup>
-    <Content Include="CommandsList.txt">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-    <Content Include="ParamsList.txt">
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\SmartSEMControl\SmartSEMControl.csproj">
       <Project>{bf7f80b0-a6da-4470-a331-4c96057fc7fa}</Project>

二進制
HOZProject/document/HOZ200520.xmind


+ 226 - 0
HOZProject/document/HOZ项目各方分工内容0527.docx

@@ -0,0 +1,226 @@
+                          HOZ项目各方分工内容
+ 概述
+  5月19日~22日欧波同3人到客户现场详细了解业务需求,22日与客户开会商讨业务过程及功能分工。由于涉密要求,图形分析部分由客户完成,欧波同方传入拍摄照片及相关参数,客户接收照片进行处理,返回处理结果及参数,且最终数据分析报告由客户方出具。具体各方开发内容整理如下(实际情况以实际开发过程中三方约定为准)。
+ 项目分工内容
+客户:
+                                    序号
+                                   内容项
+                                    备注
+图片分析
+                                       1
+确定切割位置、PT沉积位置等图片分析
+                                       
+                                       2
+SEM找切割位置图片分析
+                                       
+                                       3
+SEM图片水平校正图片分析
+                                       
+                                       4
+确定切孔兴趣点位置图片分析
+                                       
+                                       5
+层高图片分析
+                                       
+                                       6
+对焦、消像散、亮度、对比度图片分析
+                                       
+                                       7
+切割前后图片对比分析
+                                       
+                                       8
+报告功能
+                                       
+现场实施
+                                       1
+现场调试设备使用
+                                       
+                                       2
+实施相关事宜协调
+                                       
+蔡司:
+                                    序号
+                                   内容项
+                                    备注
+                                       1
+FIB设备使用提供及指导
+                                       
+                                       2
+FIB软件样品参数及模板设置
+                                       
+                                       3
+Remote API接口提供及调用指导
+                                       
+                                       4
+三方之间工作协调
+                                       
+说明:涉及硬件接口较多,设备需要经常性使用进行测试调整。计划先进行开发,集中进行测试,初步以周为单位申请设备使用(北京或上海)
+欧波同:
+                                    序号
+                                   内容项
+                                    备注
+一、SEM控制接口
+                                       
+                                       1
+SEM放大缩小接口
+                                    AP_MAG
+                                       2
+SEM对焦接口-获取焦距、设置焦距 
+                                     AP_WD
+                                       3
+SEM亮度接口-获取亮度、设置亮度   
+                                 AP_BRIGHTNESS
+                                       4
+SEM对比度接口-获取对比度、设置对比度   
+                                  AP_CONTRAST
+                                       5
+SEM消像散接口-获取消像散、设置消像散 
+                                 AP_STIG_X, Y
+                                       6
+设置SEM角度补偿接口--获取角度补偿、设置角度补偿
+                                 AP_TILT_ANGLE
+                                       7
+SEM拍照接口-控制拍照、照片传输、图片信息获取及传输 
+                       Grab(0,0,1024,768,0,文件路径)
+                                       8
+SEM移动接口
+                         AP_STAGE_GOTO_X, Y, Z, T, R,M
+                                       9
+SEM获取中心点坐标接口            
+                                       
+                                      10
+SEM 设置 Scan Rotate角度接口
+                                AP_SCANROTATION
+                                      11
+SEM获取Scan Rotate角度接口
+                                AP_SCANROTATION
+                                      12
+SEM设置取消电子束校正接口
+                            CMD_DO_SEM_DRIFT_CORRN
+                                      13
+SEM获取Pixel Size 接口
+                                 AP_PIXEL_SIZE
+                                      14
+获取数组坐标接口
+                         AP_STAGE_AT_X, Y, Z, T, R, M
+                            GetStagePosition(.....)
+                                      15
+开启、关闭电压接口
+                              CMD_BEAM_ON  开启
+                              CMD_EHT_OFF  关闭
+二、FIB控制接口
+                                       
+                                      16
+FIB调取事先设置好的模板 -- 传模板编号或名称,直接按模板设置好的参数执行FIB操作
+                                       
+                                      17
+FIB切割形状参数设置接口
+                                       
+                                      18
+FIB切割接口
+                                       
+                                      19
+FIB亮度接口
+                                       
+                                      20
+FIB对比度接口
+                                       
+                                      21
+FIB拍照接口-控制拍照、照片传输、图片信息获取及传输
+                                       
+                                      22
+FIB移动接口                         
+                                       
+                                      23
+FIB获取中心点坐标接口             
+                                       
+                                      24
+FIB冻结状态获取接口              
+                                       
+                                      25
+FIB解冻接口                     
+                                       
+三、PT控制接口
+                                       
+                                      26
+PT针插入接口
+                                       
+                                      27
+PT沉积接口 -- 传模板编号或名称,直接按模板设置好的参数执行沉积操作
+                                       
+                                      28
+PT针撤出接口
+                                       
+四、样品台控制接口
+                                       
+                                      29
+样品台移动接口 
+                                       
+五、其他程序
+                                       
+                                      30
+样品点信息导入
+                                       
+                                      31
+创建目录
+                                       
+                                      32
+设置图片名称                
+                                       
+                                      33
+保存图片                       
+                                       
+                                      34
+坐标对比验证 -- SEM移动坐标对比、FIB移动坐标对比,允许几微米的误差
+                                       
+                                      35
+数据存数据库 -- 样品1第1号孔坐标、每个切割孔的属性信息存储等
+                                       
+六、单功能测试
+                                       
+                                       1
+在实际设备中单功能测试
+                                       
+七、图形分析
+                                       
+                                       1
+确定切割位置、PT沉积位置等接口对接 -- 获取返回值后,要有偏移计算
+                                       
+                                       2
+确定SEM找切割位置接口对接
+                                       
+                                       3
+确定SEM图片水平校正接口对接
+                                       
+                                       4
+确定切孔兴趣点位置接口对接
+                                       
+                                       5
+确定兴趣点放大图片传输
+                                       
+                                       6
+对焦、消像散、亮度、对比度接口对接
+                                       
+                                       7
+切割前后图片对比分析接口对接
+                                       
+八、系统功能串联
+                                       
+                                       1
+整合所有功能接口,及客户接口,一键式操作+进度通知(开发+测试)
+                                       
+                                       
+
+                                       
+                                       2
+提供成份自动测量功能
+                                       
+                                       3
+自动化过程中保证设备安全
+                                       
+九、实施+功能完善及扩展
+                                       
+                                       1
+实施+功能完善及扩展
+                                       
+

+ 629 - 0
HOZProject/document/SmartSEM Remote API.docx

@@ -0,0 +1,629 @@
+智能扫描电镜               
+远程应用程序接口               
+编程API
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+SmartSEM远程API
+编程API
+摘要
+本文档描述了SmartSEM(R)应用程序编程接口
+允许外部程序与SmartSEM(R)软件通信。
+已采取一切合理措施确保本出版物的正确性和完整性,
+但如果用户对任何细节有疑问,可以向卡尔蔡司咨询
+显微镜有限公司或其授权代表。
+本文件中的信息如有更改,恕不另行通知
+卡尔蔡司显微镜有限公司
+对本文档中可能出现的任何错误概不负责。
+版权所有(C)卡尔蔡司显微镜有限公司,英国剑桥,2017年
+保留所有权利。不得以任何形式复制本出版物的内容,或
+未经卡尔蔡司显微镜有限公司事先书面许可,与第三方沟通。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+一。介绍
+本指南是为希望编写以下软件应用程序的第三方开发人员编写的
+与卡尔蔡司扫描电子显微镜(SEM)通信。应用程序
+编程接口(API)由一个活动的X控件组成,该控件提供对
+智能扫描电镜显微镜控制软件。
+支持以下类型的扫描电镜:
+::常规扫描电镜
+::场发射扫描电镜
+::横梁
+作为一个Active X控件,API可以被各种编程语言访问,比如
+作为Visual Basic、Visual C++、Visual C语言和各种脚本语言(例如VBScript)。
+一项小型调查显示,大多数第三方开发人员更喜欢使用MS VisualC++。
+或者C++,所以安装CD-ROM上的示例代码既用C++编写,又用C++编写。
+C#(Visual Studio 2012)。
+在本手册中,读者将熟悉EM服务器的一些概念-
+客户机模型,以及API在其中的角色。API公开了一个COM Idispatch接口
+所有的方法和事件都会被解释。一些示例代码片段将
+但用户应参考提供的示例程序
+使用指南。在本手册的末尾,我们列出了最常见的参数
+(模拟和数字状态)和操作扫描电镜的命令。
+本文件描述了卡尔蔡司显微镜的使用CZEMAPI.OCX公司,它
+必须与卡尔蔡司显微镜公司达成协议,才能开发商业
+使用它的应用程序。一旦签署了这样的协议,卡尔蔡司显微镜公司
+将提供必要的支持文件和技术信息,以便开发
+继续。首先,请联系卡尔蔡司显微镜软件团队:
+卡尔蔡司显微镜有限公司
+科尔达姆斯巷511号
+剑桥CB1 3JS
+大不列颠联合王国
+电话:+44-1223-414166
+电子邮件:瓦拉特@蔡司网站
+
+
+
+
+
+
+
+
+
+
+
+
+
+2。一些概念
+2.1客户机-服务器体系结构
+SmartSEM软件的主要组件是EM服务器。EM服务器
+控制硬件。它还维护了SEM的状态和参数列表。这个
+SmartSEM UIF或外部应用程序可以发送指令("灯丝加热开启")或
+修改参数("放大率=10000"),然后由EM处理
+服务器。CZEMAPI ActiveX控件是与EM通信的主通道
+服务器。它可以与EM服务器在同一台计算机上运行,也可以在另一台计算机上运行
+
+
+
+
+
+
+
+
+
+
+
+
+图2:在远程PC上运行的第三方应用程序。通信通过LAN进行
+网络。
+当第三方软件在单独的计算机上运行时,API ActiveX控件将
+还要处理客户机和EM服务器之间的通信,但这必须是
+先配置。最值得注意的是"远程客户端"必须安装在远程PC上。
+远程客户端安装程序可以在远程API开发人员磁盘上找到。在扫描电镜上
+PC"远程中继"将始终运行;这是远程服务器
+注意:对于SmartSEM 5.5(及更高版本),远程客户端安装程序也在V05.05上
+安装DVD。
+2.2参数、状态和命令
+仪器的控制,因此用户界面之间的接口
+元件和仪表的控制,是基于参数、状态的概念和命令。从客户端应用程序发送到服务器的所有消息参数通过从参数类型派生的唯一标识符执行此操作以及低级参数ID参数符号为字符串(例如"AP_MAG"),控件将获得参数ID。
+所有参数、状态和命令都有一个可见性属性,用于确定它们是否用于当前机器类型。
+每个参数、状态和命令都可能与一个规则相关联,该规则定义当它被允许或有效时。如果不允许参数(或状态或命令)或无效,则应在UIF上显示为灰色。规则被定义为逻辑的基于国家、国家价值和许可证的表达。EM服务器管理和应用规则。
+设置参数和显示参数值是两个截然不同的功能:
+  ::如果用户在UIF上设置了一个值,则会导致向EM服务器发出请求设置值。视情况而定,价值应接受限制和有效性检查,然后路由到相应的低级模块以执行所需的功能。通常会将参数设置为所需的值。但是,设置在当前条件下,值可能无法实现,或者服从时间常数。
+  ::低级函数检测参数值的变化,原因可能是设置值、执行命令或询问硬件。因此,a
+通知消息将发送到服务器,该服务器将传递到API.OCX标准,然后通知感兴趣的UIF对象参数或状态已更改。这个UIF元素应依次请求显示。
+
+这种分离确保了所有对象都得到正确的更新和参数的设置接受相关模块的一致性检查。参数受上限和下限限制,机器状态只能有离散值的数目。由于扫描电镜上有大量的参数,因此提供了一种机理,根据用户的要求。每个参数、状态和命令都被分配到一个类别:新手,专家或服务,用户可以选择新手/专家/服务的"用户级别",其中根据类别限制要选择的参数数量,即。"新手"仅表示新手类别,"专家"表示新手和专家类别,服务提供所有参数。
+
+2.2.1模拟参数
+模拟参数是指在规定限值之间具有完整数值范围的参数。
+例如:"图像偏移X"。
+所有参数值均采用标准国际单位制,例如电流单位为安培,距离单位为
+米等许多调整参数,如偏转器值,以百分比和
+在内部转化为电流。当参数显示在UIF上时
+使用例如m m、μm、nm等而不是10-3m来制作合适的显示字符串,
+10-6米、10-9米等。
+每个模拟参数都有一个唯一的数字标识,它与
+启动AP_u的符号,例如AP_umag。此标识在整个服务器和
+低级模块。
+模拟参数的属性是:
+::名称(用于显示-默认为英语,但可以是其他语言)
+::上限
+::下限
+::仅输入(如果设置的参数不可用于鼠标调整)
+::只读(用户无法设置;由EM服务器内部修改)
+::参数类型(正常,X为X Y对,Y为XY对)
+::鼠标调整的动态特性(线性/对数,常数定义
+逻辑到物理关系)
+::单元类型。根据当前值和数据输入定义显示格式
+格式
+::鼠标调整的粗/细增量(逻辑单位)
+::启用/禁用(根据规则)
+::可见(如果未设置,则不适用于当前机器类型)
+::目标/实际。标识参数是目标参数还是实际参数,并标识
+相关参数-见下文
+有一组特殊的模拟参数,包括
+目标值和实际值。
+实际值是一个只读参数,它显示某些
+实体,例如AP_STAGE_AT_X定义当前的STAGE X位置。
+
+目标值是一个读/写参数,它为一些实体,例如AP_STAGE_GOTO_X定义请求的STAGE X位置。
+注:至远程API 5.3,所有模拟参数均为浮点数。从5.4开始
+也支持双精度。虽然EM Server支持双倍,但大多数
+与硬件的通信处于浮动状态,因此通常使用
+双打。一个值得注意的例外是高精度的舞台坐标实施。
+
+2.2.2数字参数(状态)
+数字参数是指具有离散值集的参数。例如,
+数字参数"点模式"(DP_Spot)具有"开"和"关"状态。
+每个数字参数都有一个与符号相关联的唯一数字标识
+启动DP_u,例如DP_ustage_uis。此标识在整个服务器和更低版本中使用
+水平模块。只读(RO)状态表示
+仪器,例如"光束状态",它不仅包括静态,如"EHT关闭"
+或"光束开启",但也包括所有过渡状态,如"斜坡"和"关闭"。
+数字参数属性:
+::名称(用于显示-默认为英语,但可以是其他语言)
+::只读。(用户无法设置;由EM服务器内部修改)
+::启用/禁用(根据规则)
+::状态值集 - 见下文
+::集团状态。如果设置了
+state还有一组命令标识的集合。
+::可见(如果未设置,则不适用于当前机器类型)
+国家价值观
+状态值是一个状态可能具有的离散值。
+每个状态值都有一个唯一的开始符号,例如SúON、SúIDLE等。
+状态值的属性是:
+::值(例如0)
+::名称(用于显示-默认为英语,但可以是其他语言)
+2.2.3字符串参数
+有少量字符串参数,例如SV_SERIAL_number="1540XB-
+29-03英寸。有些是只读的,有些是可编辑的。
+2.2.4命令
+命令是启动某些操作的函数。E、 g."光束开启"。
+每个命令都有一个与符号相关联的唯一数字标识
+启动命令,例如命令光束打开。此标识在整个服务器和
+低级模块。
+命令的属性是:
+::名称(用于显示-默认为英语,但可以是其他语言)
+::启用/禁用(根据规则)
+::指示命令是否与组状态关联的组标志(见下文),
+如果设置,则该命令还包括组状态的标识。
+::可见(如果未设置,则不适用于当前机器类型)
+2.2.5组
+这些是只读状态和组命令的特殊组合
+影响国家。示例是"Beam State",相关命令是"Shutdown
+"枪声"、"弹射停止"和"枪声开启"。
+2.3许可证
+许可证用于启用可选功能。每个许可证都有一个唯一的数字标识,它与以LIC_u开头的符号相关联,例如,对于扩展电压范围软件许可证。许可证用于规则和许可证状态
+可以通过EM服务器查询。
+请参阅SmartSEM V05.07用户手册以了解许可证的说明以及是的。
+2.4宏
+宏是一组SEM指令,可以包括条件(if..then...else)、状态,
+模拟参数、命令和特殊功能。使用宏可以
+打开SmartSEM对话框或在SEM PC上运行程序。有关详细说明,请参阅
+宏编辑器联机帮助。
+
+三。安装CZEMAPI ActiveX控件
+首先,您需要决定如何使用客户机应用程序。要么就是安装在运行EM服务器的同一台PC上,即在显微镜PC上,或客户端应用程序安装在第二台远程PC上。如果选择第一个选项然后你只需要在你的电脑上安装SmartSEM软件选项,您还需要在第二台PC上安装远程客户端。
+3.1安装SmartSEM软件
+您需要SmartSEM安装DVD。首先安装所有驱动程序,然后安装智能扫描电镜软件。出于测试目的,您可以安装SmartSEM软件"仅限个人电脑"在没有显微镜的个人电脑上。为了运行SmartSEM软件作为个人电脑只有你需要从蔡司获得一个个人电脑加密狗。安装SmartSEM
+也将安装并注册CZEMAPI.OCX公司. 它现在可以放进你的申请。
+SmartSEM安装还将在PC上安装远程服务器程序,远程服务器称为"远程"中继.exe"并会处理好任何沟通在EM服务器和客户端之间。远程中继.exe在Windows上自动启动,启动并将继续在后台运行。它可以处理多个远程客户端,在多台电脑上。在第一次安装时,RemoteRelay尝试访问网络。Windows XP/7安全将检测到此活动并阻止它。现在必须手动允许远程中继以访问网络并指示Windows记住此决定。
+3.2安装远程客户端
+如果客户端软件在第二台PC上运行,则需要安装远程客户端软件,可在远程API安装程序CD-ROM上找到。运行RClientInstaller.exe.这将安装CZEMApi.ocx公司,支持文件和客户端配置程序。跑步RConfigure.exe. 这将配置服务器和客户端的IP地址和端口在客户端。一个小程序将在客户端的后台运行机器,称为"拦截器.exe". 这个程序实际上与"远程中继.exe"在服务器上。CZEMApi.ocx公司在客户端自动注册电脑,随时可用。EM服务器可以在是时候了。当拦截器尝试访问网络时,Windows安全将检测到活动并阻止它。现在必须手动允许拦截器访问网络并指示Windows记住此决定。
+3.3 SmartSEM版本
+在下表中,我们列出了SmartSEM的版本和远程API。需要注意的是,兼容性通常只是一个真正的问题在1.x版和2.x版(及更高版本)的远程API之间这些版本之间发生了显著的(不可避免的)变化。但是我们会,建议服务器和客户端的版本应尽可能匹配。
+
+
+3.4远程API客户端和服务器版本RConfigure程序将显示远程客户端或服务器版本,具体取决于无论是在远程计算机上运行程序还是在SmartSEM计算机上运行程序。你也可以在注册表中读取版本:客户:HKEY U CLASSES U ROOT\蔡司剑桥虚拟商店\Carl Zeiss SMT有限公司\远程处理\客户端版本服务器:HKEY_CLASSES_ROOT\Zeiss Cambridge virtualized Store\Carl Zeiss SMT有限公司\远程处理\服务器版本旧版本只是使用了密钥"Version",但是如果客户端和服务器安装在同一台计算机上。第三方注意:第三方软件集成商有责任确保
+他们的电脑配置正确。这包括安装正确的远程客户端与SmartSEM PC上的服务器版本兼容。
+3.5点网络远程处理与NetDDE
+远程客户机-服务器通信由程序完成。"拦截器.exe"和"远程中继.exe". 它们使用新的Microsoft.NET远程处理技术。这是为什么.NET运行时同时安装在客户端和服务器上。第三方开发商不过,不用担心它在引擎盖下是如何工作的。以前版本的CZEMApi.ocx公司,调用莱奥皮.ocx,也支持较旧的科技网。NetDDE现在已被弃用。
+3.6将CZEMApi ActiveX控件插入MFC应用程序
+在Visual Studio.NET 2012中,您可以执行类似的操作。选择菜单"项目>添加上课。从对话框中选择"VisualC++ ++ MFC > MFC类从Active X Control"按<Open>。这将显示"Add class from Active X控制向导"。从可用的活动X控件列表中选择CZ EM API控件。将类和存根文件重命名为CZEMApi,CZEMApi.cpp公司等。
+
+如果CZ EM Api控件不在列表中,则需要注册活动的X控件使用RegSvr32。如果已经存在文件关联,则双击控件程序图标,或右键单击并选择"打开方式...",然后在Windows\System32目录。现在可以在窗体上拖动控件,并且可以关联控件参数从类向导那里得到的。在Visual Studio.NET中,必须手动执行此操作。宣布头文件中的成员参数:
+卡皮;随后在窗体类OnInitDialog(..)成员中创建控件对象功能。请参阅示例代码。
+3.7将CZEMApi ActiveX控件插入C#应用程序
+从Visual Studio中的C#form应用程序中,选择菜单"项目>添加引用"。
+从"COM"选项卡中选择CZ EM API OLE控件。这将插入类
+在项目中加入ApiClass。
+如果CZ EM API OLE控件不在列表中,则需要注册活动的X
+用RegSvr32控制。如果已经存在文件关联,则双击
+控制程序图标,或右键单击并选择"打开方式...",然后在中浏览RegSvr32
+Windows\System32目录。
+添加以下行以将命名空间插入到类中
+Using APILib;
+然后可以在form类中创建一个ApiClass对象。参见示例代码
+
+
+
+
+四。API接口
+对于控件的初始化,您必须在为与本地运行的EM服务器一起使用,或作为第二台PC上的客户端应用程序使用。对于前者使用"Initialise",后者使用"InitialiseRemoting"。这个CZEMApi.ocx公司拥有以下方法和事件:
+4.1 Initialise Method
+long Initialise(LPCTSTR lpszMachine)
+[in]lpszMachine是带显微镜的机器的名称
+评论:
+使用Initialise(...)在与EM Server相同的PC上本地运行客户端应用程序。
+此方法必须在任何其他方法之前调用(GetVersion除外)。它初始化OCX和EM服务器之间的通信。如果空机器名是提供时,假定EM服务器与CZEMAPI ActiveX在同一台计算机上
+控制。提供机器名将搜索由NetBIOS名称指定的显微镜,lpszMachine公司。
+返回值:
+如果调用成功,则返回0。如果调用失败,函数将返回错误代码。
+错误:
+API未初始化:无法初始化控件
+错误代码在头文件"api_err.h"中定义。
+4.2   InitialiseRemoting Method
+long InitialiseRemote(void)
+评论:
+使用InitialiseRemoting在第二台PC上运行客户端应用程序,并与远程EM服务器。此方法必须在任何其他方法之前调用(除了获取版本)。与Initialise()方法不同,不直接使用EM服务器。相反,远程处理体系结构充当"中间人",将允许无论EM服务器处于何种状态(加载、卸载,登录,注销)。
+你需要有远程中继.exe运行在与EM服务器相同的计算机上为了这个工作。此程序从Windows启动时运行,不提供加载计算机资源。
+如果使用InitialiseRemoting()启动API,将获得有关状态的更多有用信息
+而不是使用Initialise(),因为它可以区分EM Server已加载或用户是否已登录。Initialise()实际上绕过了远程中继,如果需要,将运行服务器并显示登录屏幕。另见"通知事件"部分并比较您在使用InitialiseRemoting()或Initialise()。
+InitialiseRemoting()可以从与EM运行在同一台PC上的应用程序调用服务器。所需的只是要安装的远程客户端以及客户端和远程要设置为"本地主机"的IP地址。
+返回值:
+如果调用成功,则返回0。如果调用失败,函数将返回错误代码。
+错误:API_E_REMOTING_NOT_CONFIGURED REMOTING配置错误,请使用配置以更正
+API_E_REMOTING_FAILED_CONNECT REMOTING未连接到服务器
+API_E_REMOTING_COULD_NOT_CREATE_接口REMOTING COULD NOT start
+(未知原因)
+注意:使用其他方法时也可能发生上述错误。请参考
+所有错误定义的api_err.h。
+
+4.3 GetVersion方法
+long GetVersion(short* Version) 
+[out]版本是CZ EM API OCX的当前版本
+评论:
+此函数现在已弃用。它不会返回当前版本的API
+返回值:
+如果调用成功,则返回0。
+4.4 GetLimits方法
+long GetLimits(LPCTSTR lpszParam,VARIANT*vminvaliue,VARIANT*vMaxValue)
+[in]lpszParam是参数的名称,例如"AP_MAG"
+[out]vminvaliue是参数的最小值
+[out]vMaxValue是参数的最大值
+评论:
+此调用将获取指定参数的最小值和最大值,并将
+在vMinValue和vMaxValue中返回它们。值将作为VT_R4类型返回,默认,或VT_R8。无法获取数字参数DP_XXXX的限制。
+返回值:
+如果调用成功,则返回0。如果调用失败,vValue的variant type设置为VT_ERROR
+在这个变量中返回错误代码。相同的错误代码从功能。
+错误:
+API未初始化:控件未初始化
+API_E_GET_TRANSLATE_失败:无法识别的参数字符串或无法转换一串
+API_E_GET_LIMITS_FAIL:无法获取限制
+4.5Get Method
+Long Get(LPCTSTR lpszParam,VARIANT*v值)
+[in]lpszParam是参数的名称,例如"AP_MAG"
+[in][out]v值是参数的值
+评论:
+此调用将获取指定参数的值并以v值形式返回。
+在C++中,在调用此函数之前,必须指定变量类型(v值vt)到VT_R4、VT_R8或VT_BSTR。如果没有为vValue定义变量类型,则默认为用于模拟参数的VT_R4(AP_XXXX)和用于数字参数的VT_BSTR(DP_XXXX)。
+如果模拟参数的变量类型是VT_R4,则浮点表示在变量中返回。VT_R8表示双精度值。如果传递VT_BSTR变量,模拟值作为缩放字符串返回附加单位(例如,AP_WD将返回"=10毫米")。
+对于数字参数,VT_R4变量产生状态号和VT_BSTR变量导致状态字符串(例如DP_RUNUPSTATE将返回状态0或"Shutdown"或与所支持的语言相同)。
+在C++中,如果变量类型指定为VTH-BSTR,那么API将在内部分配。调用方必须使用SDK调用::SysFreeString取消分配的BSTR(v值.bstrVal)
+
+返回值:
+如果调用成功,则返回0。如果调用失败,vValue的variant type设置为VT_ERROR
+在这个变量中返回错误代码。相同的错误代码从功能。
+错误:
+API未初始化:控件未初始化
+API_E_GET_TRANSLATE_失败:无法识别的参数字符串或无法转换
+一串
+API_E_GET_AP_FAIL:无法获取指定的模拟参数
+API_E_GET_DP_失败:无法获取指定的数字参数
+API_E_GET_BAD_参数:指定的参数既不是模拟(AP_),也不是数字(DP)
+
+4.6设置方法
+long Set(LPCTSTR lpszParam,VARIANT*v值)
+[in]lpszParam是参数的名称,例如AP_MAG
+[in]vValue是参数的值
+评论:
+此调用将把指定参数的值设置为vValue中指定的值。如果参数是一个模拟值(AP_XXX),那么vValue的变量类型可以是指定浮点值的VT_R4。如果vValue的变量类型设置为VT BSTR,并且lpszParameter是模拟值参数,该参数设置为vValue中指定的缩放值(例如。lpszParam=AP_WD和v值->bstrVal="10"将工作距离设置为0.010i、 e.10毫米变为0.010米)。没有简单的方法可以发现缩放值,而不是在Get()和从返回的字符串值中提取单位。
+SmartSEM几乎所有的模拟参数都以国际单位制存储。首选的方法是它们用VT_R4作为浮点值。对于某些参数,例如舞台位置,我们实现了对双精度VT_R8的支持。如果vValue的变量类型是VT BSTR或VT R4,则设置状态参数分别表示状态字符串和状态值(例如,DP_SCAN_ROT可以是设置为0或"关闭"或所支持语言中的等效值)
+
+返回值:
+如果调用成功,则返回0。如果调用失败,vValue的variant type设置为VT_ERROR
+在这个变量中返回错误代码。相同的错误代码从
+功能。
+错误:
+API未初始化:控件未初始化
+API_E_SET_TRANSLATE_FAIL:无法识别的参数字符串或无法转换一串
+API_E_SET_STATE_FAIL:无法设置数字参数状态
+API_E_SET_FLOAT_FAIL:无法设置模拟参数值
+API_E_SET_BAD_VALUE:提交了无法识别的值(既不是字符串也不是浮动)
+API_E_PARAMETER_IS_DISABLED:命令或参数当前被禁用(您不能执行或设置它)。
+错误说明:
+远程API中引入了错误API_E_PARAMETER_IS_DISABLED3.1条。参数或状态很可能被禁用。这取决于模式还有规则。通过SmartSEM 5.5的发布测试(与远程API 3.6兼容)我们发现与旧的第三方软件不兼容错误。因此,在远程API 3.6中,此错误被抑制:Set方法将失败
+在禁用参数上保持静默。在客户端使用下面的注册表
+显示或抑制错误:
+[HKEY U CLASSES U ROOT\蔡司剑桥虚拟商店\Carl Zeiss SMT有限公司
+"SuppressParameterDisabledErrors"=dword:00000000//允许错误
+"SuppressParameterDisabledErrors"=dword:00000001//抑制错误(默认)
+4.7 GetMulti方法
+未实施。
+4.8 SetMulti方法
+未实现
+4.9  Execute Method
+long Execute(LPCTSTR lpszCommand)
+[in]lpszCommand是命令的名称,例如CMD_BEAM_ON
+评论:
+此调用将执行指定的命令。
+如果lpszCommand的前缀为MCF_u或MCL_u,则为宏文件或宏库,将执行命令(例如,MCF_FREEZE将运行宏文件FREEZE)。这个宏需要位于SmartSEM PC上。EM服务器将在
+以下位置:
+1) 特定用户目录。例如"C:\程序文件\Carl Zeiss\SmartSEM\user\MyUserName\My宏.MLF"
+请参阅注册表HKEY_CLASSES_ROOT\Zeiss Cambridge virtualized Store\Leo电子显微镜有限公司
+2) 用户根目录,例如C:\程序文件\Carl Zeiss\SmartSEM\User\
+3) SmartSEM分发目录。E、 g.在Windows XP上:C:\程序文件\卡尔蔡司
+NTS Ltd\SmartSEM\Distrib;在Windows 7上C:\ ProgramData\Carl
+蔡司SmartSEM DISTRIB读取注册表HKEY_CLASSES_ROOT\蔡司
+Cambridge Virtualized Store\Leo Electron Microsment Ltd\Leo-32\Data目录到知道数据目录在哪里。
+返回值:
+如果调用成功,则返回0。如果调用失败,函数将返回错误代码。
+错误:
+API未初始化:控件未初始化
+API_E_EXEC_TRANSLATE_失败:无法识别的命令字符串或无法翻译一串
+API_E_EXEC_CMD_FAIL:未能执行CMD_u命令
+API_E_EXEC_MCF_FAIL:未能执行MCF_u宏文件
+API_E_EXEC_MCL_FAIL:未能执行MCL_u宏库
+API_E_EXEC_BAD_命令:无法识别的命令(不是命令、MCF_u或麦克尔)
+API_E_PARAMETER_IS_DISABLED:命令或参数当前被禁用(您不能执行或设置它)。
+错误说明:
+远程API中引入了错误API_E_PARAMETER_IS_DISABLED3.1条。命令很可能被禁用。这取决于模式和规则。通过SmartSEM 5.5(与远程API 3.6兼容)的发布测试,我们发现与未识别此错误的旧第三方软件不兼容。因此,在远程API 3.6中,此错误被抑制:Execute方法将失败在禁用参数上保持静默。在客户端使用下面的注册表显示或抑制错误:
+[HKEY U CLASSES U ROOT\蔡司剑桥虚拟商店\Carl Zeiss SMT有限公司
+"SuppressParameterDisabledErrors"=dword:00000000//允许错误
+"SuppressParameterDisabledErrors"=dword:00000001//抑制错误(默认)
+
+4.10  GetStagePosition Method
+Long GetstagPosition()Variant*X,Variant*Y,Variant*Z,Variant*T,Variant** R,变量* m)
+X是该阶段/米的X共计
+这是阶段/米的Y-co-order
+[......]Z是阶段/米的Z共计
+等到舞台/等级
+是阶段/度的旋转
+[出局]米是阶段/米的硕士
+Remarks:
+This call obtains the current position of the stage,if initiaised.阶段变量
+作为指针返回vt \ \ r4(()float)或vt \ \ r8(()double)values。
+回报价值
+如果呼唤成功,它会回到0。如果呼叫失败,则从函数返回错误码。
+错误:
+API \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
+API \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
+4.11  MoveStage Method
+Long movestage()float x,float y,float z,float t,float r,float m)
+[......]x是该阶段/米的X共计
+[......]是阶段/米的Y共计
+[......]z是阶段/米的共z
+[......]t是该阶段的最后一步/
+[......]R是阶段/度的旋转
+[英寸]m是舞台的主z/米
+评论:
+此调用将阶段移动到指定的位置。调用是非阻塞的,因此
+应检查DP_STAGE_,以检查该STAGE是否繁忙或空闲。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+错误:
+API未初始化:控件未初始化
+API_E_GET_STAGE_失败:无法设置STAGE值
+4.12移动分段法
+长移动浮筒(双x、双y、双z、双t、双r、双m)
+评论:
+与前一个MoveStage方法类似,此调用将stage移动到
+以双精度指定。
+4.13Grab Method
+Long Grab(短xoff、短yoff、短宽度、短高度、短减速、LPCTSTR
+lpszFilename)
+[in]xoff是要获取的图像的x偏移量
+[in]yoff是要获取的图像的y偏移量
+[in]width是要抓取的图像的宽度
+[in]height是要抓取的图像的高度
+[in]reduction是要获取的图像的子采样因子
+[in]lpszFilename是保存位图图像的文件名。
+评论:
+这个调用从显微镜中获取一个具有偏移量、尺寸和
+提供子采样并将其保存为lpszFilename指定的文件
+位图或Tiff图像,具体取决于给定的文件扩展名。蒂芙的蔡司头上有
+采集参数信息。如果此命令是通过网络使用的(在
+InitialiseRemote)映像文件是在本地客户机上创建的。
+您试图获取的图像大小应在0-1024的X范围和Y范围内
+0-768,与图像存储分辨率无关。获取完整帧的默认调用
+是:
+抓取(0,0,1024768,0,lpszMyFileName)
+
+抓取图像的大小由参数的值决定图片商店。DP_IMAGE_STORE和他们的意思。
+内存映射文件
+当从运行在显微镜上的客户端应用程序调用Grab()方法时PC(SmartSEM也在运行)然后您可以捷克克朗""作为lpszFilename用于指示SmartSEM生成包含位图位。然后,MMF中的图像数据可以用于您自己的程序的需要。
+例如,您的应用程序需要20-30赫兹刷新率的显微镜图像。
+注意:当MMF数据不再使用时,必须使用
+"捷克克朗"作为lpszFilename参数,所有其他参数指示为0
+SmartSEM以释放分配给MMF的内存。货币市场基金的名称是
+取决于硬件。对于基于MVTitan/LREM的系统(EVO、Sigma、Auriga,上面的系统和旧系统)的名称如下表所示。
+
+对于基于SVSEM的系统(Merlin、横梁、Sigma HD、Sigma 500、GeminiSEM)MMF文件名在下表中。
+
+对于内存映射文件,在调用Grab()方法。因此,对DP_IMAGE_STORE参数调用Get()
+在调用Grab()之前。有关如何处理MMF的更多信息,请参见C++示例程序。
+返回值
+如果调用成功,则返回0。如果调用失败,则函数返回错误代码
+错误
+API未初始化:控件未初始化
+API_E_GRAB_FAIL:抓取失败
+4.14 GetLastError方法
+Long GetLastError(变量*错误)
+[out]Error是与上一个错误的错误代码关联的错误字符串
+评论:
+此调用将返回与上一个错误关联的VT_BSTR变量。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+错误:
+API未初始化:控件未初始化
+4.15ClosingControl()
+Long ClosingControl()
+评论:
+必须在销毁控件之前调用此调用。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+错误:
+API未初始化:控件未初始化
+4.16 SetNotify方法
+Long SetNotify(LPCTSTR lpszParameter,布尔bNotify)
+[in]lpszParameter是关于
+bNotify是启用或禁用通知的标志
+评论:
+如果
+bNotify设置为TRUE。将bNotify设置为FALSE将禁用该通知
+参数。通过Notify()事件接收通知。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+错误:
+API未初始化:控件未初始化
+API_E_NOTIFY_TRANSLATE_FAIL:无法识别的参数字符串或无法转换字符串
+API_E_NOTIFY_SET_FAIL:无法设置通知
+
+4.17 GetCurrentUser方法
+Long GetCurrentUserName(BSTR*strServerUserName,BSTR*strNTUserName)
+[输出]蔡司EM服务器上的strServerUserName用户名
+[输出]strNTUser Windows用户名
+评论:
+仅远程处理。获取用户登录到Windows的用户名和通过SmartSEM应用程序登录到EM服务器。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+4.18 GetUserIsIdle方法
+长GetUserIsIdle(长*总线)
+[出]服务器上的buserisdle用户空闲是/否
+评论:
+仅远程处理。EM服务器上的用户空闲时间是否超过30秒?这个
+意思是,他没有打字或移动鼠标吗?如果"是",buserisdle=1,如果"否",
+bUserIsIdle=0。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+4.19 GetLastRemotingConnectionRor方法
+长GetRemotingLastConnectionError(BSTR*strError)
+[out]strError错误字符串
+评论:
+仅远程处理。如果发生错误,则以字符串形式获取最后一个远程处理错误。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+4.20SetSuppressRemotingConnectionErrors Method设置支持移除连接错误方法
+long SetSuppressRemotingConnectionErrors()
+评论:
+仅远程处理。禁止弹出远程连接错误,以便第三方应用程序可以自行处理错误。你只能调用一次而不能撤消它。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+4.21 StartEMServer方法
+long StartEMServer()
+评论:
+仅远程处理。如果EM服务器尚未启动,请启动它。通常你会称之为
+函数,如果其他任何函数返回错误2030
+API_E_REMOTING_EMSERVER_未运行。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+如果您尝试再次启动EM服务器,则会得到错误代码2031
+API_E_REMOTING_NO_USER_登录。
+4.22LogonToEMServer Method登录服务器方法
+Long LogonToEMServer Method(LPCTSTR username,LPCTSTR userpassword)
+评论:
+仅远程处理。使用SmartSEM用户名和密码登录到EM服务器。不是的如果通过此方法登录,则需要运行SmartSEM UIF。如果SmartSEM已经运行时不需要调用此方法。
+有两种情况下,EM服务器将在
+SmartSEM电脑:
+1) 用户名/密码不正确,因此出现登录对话框,启用要手动键入用户名和密码的用户
+2) 用户首次登录并询问许可协议出现。
+在这两种情况下,只有在用户
+单击对话框上的"确定"或"取消"。取消EM Server登录将导致服务器关闭。
+返回值:
+如果调用成功,则返回0。如果调用失败,则从函数返回错误代码。
+2030 API_E_E_REMOTING_EM Server_NOT_正在运行EM服务器
+不运行,需要先启动。
+4.23 Notify Event 通知事件
+Notify Event(LPCTSTR lpszParameter,long Reason)[eventid=1]
+[out]lpszParameter是发出此通知的参数
+[out]Reason是通知原因的数值
+评论:
+此事件在以下情况下触发:远程API版本1.0或在
+本地PC,使用Initialise()初始化。在其他情况下,处理NotifyWithCurrentValue()
+事件。
+当请求通知事件的参数时,该控件将触发通知事件
+要使用函数SetNotify()通知中的更改,实际更改。参数是
+在lpszParameter中指定(例如"AP_IMAGE_SHIFT_X")以及
+通知已在"原因"中指定。当EM服务器关闭时,也会触发此事件
+在这种情况下,lpszParameter设置为"SVR_CLOSING_down"。
+Reason参数可以有以下值:
+
+
+最后六个通知将仅在使用InitialiseRemoting()初始化后发出。如果你的
+应用程序获取EMSERVER_HAS_LOADED通知,然后它只需等待
+使用EM服务器登录的用户(例如,通过SmartSEM应用程序)。如果你的申请
+通知EM Server用户登录,然后与EM服务器通信是可能的。在此之前,任何通信尝试都将得到答复"EMServer is not在远程计算机上运行"或"没有用户登录到远程的EM服务器
+机器"。无法通过InitialiseRemoting()触发登录屏幕(按原样可以使用Initialise()调用)。通知EMSERVER用户已注销表示用户已注销。通知EMSERVER已退出意味着EM服务器应用程序已停止。远程服务器退出是你平时不应该得到的东西。在实践中,"值已更改"的通知是最重要的通知。这个软件应该通过Get()方法响应以获取参数的实际值。
+4.24NotifyWithCurrentValue Event通知当前值事件
+NotifyWithCurrentValue(LPCTSTR lpszParameter,长原因,长参数id,双精度
+dLastKnownValue)[事件ID=2]
+[out]lpszParameter是发出此通知的参数
+[out]Reason是通知原因的数值
+[out]paramid参数在EM Server中使用时的ID
+[输出]dlastnownvalue存储在EM Server中的当前值
+评论:
+在以下情况下,此事件将替换上面的通知事件:远程处理版本2.0
+以及更高版本(SmartSEM V5.2及更高版本),并且使用InitialiseRemoting()。非激励函数Initialise()仍将给出Notify(..)事件。当然是SetNotify(...)
+应该先打电话。最好在代码中同时处理这两个事件。
+NotifyWithCurrentValue()的优点是事件传递
+更改的参数。这将进行后续的Get()调用以获取值
+没必要。
+Reason参数的值与上面的相同。

+ 30 - 0
HOZProject/document/测试环境安装说明.docx

@@ -0,0 +1,30 @@
+                       HOZ项目测试环境安装说明
+ APISETUP
+ 分别安装光盘下的API服务器和客户端(分别对应Install Server文件夹和Install Client文件夹),执行文件夹下的.exe程序即可。
+ 远程API客户端日志记录在安装了远程客户端的PC上使用。
+    在C盘根目录下创建文件夹"C:\\ _clientlog",导入注册表文件(该文件在光盘目录下的Developer Information文件夹下)"enable logging.reg"。这时调试程序启动后,会随程序一起启动一个日志程序。
+ DESkey驱动安装
+  驱动程序在官网  https://www.des.co.uk/support 下载。选择DK3 [HYPERLINK: https://www.des.co.uk/support%20下载。选择DK3]即可。双击安装驱动后系统设备管理器就会正确识别出该硬件。如下图:
+  
+ SmartSEM安装
+  打开文件夹"SmartSEM Installation\SmartSEM",双击SmartSEMInstaller.exe进行安装,安装选项如下图:
+                                        
+                                        
+                                        
+                                        
+                                        
+                                        
+                                        
+                                        
+  再点击下一步进行安装。安装完成后桌面上有两个文件夹"My User Directory"和"My Image Directory"。
+ SmartSEM的使用
+  找到安装目录下的SmartSEM.exe执行程序并双击,如下图:
+  
+  在用户和密码窗口处按Ctrl+S,会切换界面,在前面的复先框上打勾,点击OK按钮即可进入SmartSEM软件界面。
+  
+  这时Demo程序就可以访问虚拟的SmartSEM了。
+ CZ EM API OLE Control的引用
+  新建VS2017项目工程,在右键引用,选择COM选项卡,选择CZ EM API OLE Control勾选。在代码中引用using Apilib;即可。
+  
+  
+  

+ 232 - 4
SmartSEMControl/SmartSEM.cs

@@ -31,6 +31,14 @@ namespace SmartSEMControl
         private String AP_STAGE_GOTO_X = "AP_STAGE_GOTO_X";
         //Y轴移动到
         private String AP_STAGE_GOTO_Y = "AP_STAGE_GOTO_Y";
+        //Z轴移动到
+        private String AP_STAGE_GOTO_Z = "AP_STAGE_GOTO_Z";
+        //T轴移动到
+        private String AP_STAGE_GOTO_T = "AP_STAGE_GOTO_T";
+        //R轴移动到
+        private String AP_STAGE_GOTO_R = "AP_STAGE_GOTO_R";
+        //M轴移动到
+        private String AP_STAGE_GOTO_M = "AP_STAGE_GOTO_M";
         //Scan Rotate角度
         private String AP_SCANROTATION = "AP_SCANROTATION";
         //像素大小
@@ -70,7 +78,28 @@ namespace SmartSEMControl
         public Boolean Init()
         {
             lrt = CZEMApi.Initialise("");
-            if(lrt!=0)
+            if (lrt != 0)
+            {
+                m_bInitialised = false;
+                return false;
+            }
+            else
+            {
+                m_bInitialised = true;
+                return true;
+            }
+        }
+        #endregion
+
+        #region 设备远程初始化
+        /// <summary>
+        /// 设备远程初始化
+        /// </summary>
+        /// <returns>return:true or false</returns>
+        public Boolean InitRemoting()
+        {
+            lrt = CZEMApi.InitialiseRemoting();
+            if (lrt != 0)
             {
                 m_bInitialised = false;
                 return false;
@@ -111,7 +140,7 @@ namespace SmartSEMControl
         #endregion
 
         #region 读参数函数
-        private Boolean ReadParams(String str_param,ref float value)
+        private Boolean ReadParams(String str_param, ref float value)
         {
             if (m_bInitialised)
             {
@@ -210,7 +239,7 @@ namespace SmartSEMControl
         public float GetMagnification()
         {
             float ret = 0;
-            if(ReadParams(AP_MAG, ref ret))
+            if (ReadParams(AP_MAG, ref ret))
             {
                 return ret;
             }
@@ -408,7 +437,7 @@ namespace SmartSEMControl
         /// 抓取图像
         /// </summary>
         /// <returns>true:float or false:NaN</returns>
-        public Boolean GrabImage(String filename,short type)
+        public Boolean GrabImage(String filename, short type)
         {
             if (m_bInitialised)
             {
@@ -429,6 +458,205 @@ namespace SmartSEMControl
         }
         #endregion
 
+        #region SEM移动接口
+        /// <summary>
+        /// 返回样品台坐标数组
+        /// </summary>
+        /// <returns>Lenght=6</returns>
+        public float[] GetStagePosition()
+        {
+            object retx = new VariantWrapper((float)0.0f);
+            object rety = new VariantWrapper((float)0.0f);
+            object retz = new VariantWrapper((float)0.0f);
+            object rett = new VariantWrapper((float)0.0f);
+            object retr = new VariantWrapper((float)0.0f);
+            object retm = new VariantWrapper((float)0.0f);
+            float[] ret = new float[6];
+            if (m_bInitialised)
+            {
+                CZEMApi.GetStagePosition(ref retx, ref rety, ref retz, ref rett, ref retr, ref retm);
+                ret[0] = Convert.ToSingle(retx);
+                ret[1] = Convert.ToSingle(rety);
+                ret[2] = Convert.ToSingle(retz);
+                ret[3] = Convert.ToSingle(rett);
+                ret[4] = Convert.ToSingle(retr);
+                ret[5] = Convert.ToSingle(retm);
+            }
+            else
+            {
+                ret[0] = float.NaN;
+                ret[1] = float.NaN;
+                ret[2] = float.NaN;
+                ret[3] = float.NaN;
+                ret[4] = float.NaN;
+                ret[5] = float.NaN;
+            }
+            return ret;
+        }
+
+        /// <summary>
+        /// SEM位置 X轴
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetStageAtX()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STAGE_AT_X, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// SEM位置 Y轴
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetStageAtY()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STAGE_AT_Y, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// SEM位置 Z轴
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetStageAtZ()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STAGE_AT_Z, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// SEM位置 T轴
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetStageAtT()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STAGE_AT_T, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// SEM位置 R轴
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetStageAtR()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STAGE_AT_R, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// SEM位置 M轴
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetStageAtM()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STAGE_AT_M, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// SEM位置 X轴
+        /// </summary>
+        /// <param name="set">X轴移动坐标</param>
+        /// <returns></returns>
+        public Boolean SetStageGotoX(float set)
+        {
+            return WriteParams(AP_STAGE_GOTO_X, set);
+        }
+
+        /// <summary>
+        /// SEM位置 Y轴
+        /// </summary>
+        /// <param name="set">Y轴移动坐标</param>
+        /// <returns></returns>
+        public Boolean SetStageGotoY(float set)
+        {
+            return WriteParams(AP_STAGE_GOTO_Y, set);
+        }
+
+        /// <summary>
+        /// SEM位置 Z轴
+        /// </summary>
+        /// <param name="set">Y轴移动坐标</param>
+        /// <returns></returns>
+        public Boolean SetStageGotoZ(float set)
+        {
+            return WriteParams(AP_STAGE_GOTO_Z, set);
+        }
+
+        /// <summary>
+        /// SEM位置 T轴
+        /// </summary>
+        /// <param name="set">Y轴移动坐标</param>
+        /// <returns></returns>
+        public Boolean SetStageGotoT(float set)
+        {
+            return WriteParams(AP_STAGE_GOTO_T, set);
+        }
+
+        /// <summary>
+        /// SEM位置 R轴
+        /// </summary>
+        /// <param name="set">Y轴移动坐标</param>
+        /// <returns></returns>
+        public Boolean SetStageGotoR(float set)
+        {
+            return WriteParams(AP_STAGE_GOTO_R, set);
+        }
+
+        /// <summary>
+        /// SEM位置 M轴
+        /// </summary>
+        /// <param name="set">M轴移动坐标</param>
+        /// <returns></returns>
+        public Boolean SetStageGotoM(float set)
+        {
+            return WriteParams(AP_STAGE_GOTO_M, set);
+        }
+        #endregion
+
         #region Scan Rotate角度接口
         /// <summary>
         /// 获取Scan Rotate角度接口