浏览代码

第一次提交

@wang_qi0307 5 年之前
当前提交
83775bead5

+ 63 - 0
.gitattributes

@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs     diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following 
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln       merge=binary
+#*.csproj    merge=binary
+#*.vbproj    merge=binary
+#*.vcxproj   merge=binary
+#*.vcproj    merge=binary
+#*.dbproj    merge=binary
+#*.fsproj    merge=binary
+#*.lsproj    merge=binary
+#*.wixproj   merge=binary
+#*.modelproj merge=binary
+#*.sqlproj   merge=binary
+#*.wwaproj   merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg   binary
+#*.png   binary
+#*.gif   binary
+
+###############################################################################
+# diff behavior for common document formats
+# 
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the 
+# entries below.
+###############################################################################
+#*.doc   diff=astextplain
+#*.DOC   diff=astextplain
+#*.docx  diff=astextplain
+#*.DOCX  diff=astextplain
+#*.dot   diff=astextplain
+#*.DOT   diff=astextplain
+#*.pdf   diff=astextplain
+#*.PDF   diff=astextplain
+#*.rtf   diff=astextplain
+#*.RTF   diff=astextplain

+ 261 - 0
.gitignore

@@ -0,0 +1,261 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+#*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc

+ 31 - 0
HOZ.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.1145
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitControl", "HOZProject\UnitControl.csproj", "{ABBA5E64-536B-4EA0-8305-490A48822C89}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartSEMControl", "SmartSEMControl\SmartSEMControl.csproj", "{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {F291AB01-6941-478D-BA98-1C371698FFAD}
+	EndGlobalSection
+EndGlobal

+ 6 - 0
HOZProject/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
+    </startup>
+</configuration>

+ 5 - 0
HOZProject/CommandsList.txt

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

+ 820 - 0
HOZProject/FormUnitControl.Designer.cs

@@ -0,0 +1,820 @@
+namespace HOZProject
+{
+    partial class FormUnitControl
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.btnGrabImage = new System.Windows.Forms.Button();
+            this.btnInit = new System.Windows.Forms.Button();
+            this.btnCloseCtrl = new System.Windows.Forms.Button();
+            this.btnSetNotify = new System.Windows.Forms.Button();
+            this.btnenlargeGet = new System.Windows.Forms.Button();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.btnTiltAngleSet = new System.Windows.Forms.Button();
+            this.txtTiltAngleSet = new System.Windows.Forms.TextBox();
+            this.lblTiltAngleGet = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.btnTiltAngleGet = new System.Windows.Forms.Button();
+            this.btnAstigmatismYSet = new System.Windows.Forms.Button();
+            this.txtAstigmatismYSet = new System.Windows.Forms.TextBox();
+            this.lblAstigmatismYGet = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.btnAstigmatismYGet = new System.Windows.Forms.Button();
+            this.btnAstigmatismXSet = new System.Windows.Forms.Button();
+            this.txtAstigmatismXSet = new System.Windows.Forms.TextBox();
+            this.lblAstigmatismXGet = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.btnAstigmatismXGet = new System.Windows.Forms.Button();
+            this.btnContrastSet = new System.Windows.Forms.Button();
+            this.txtContrastSet = new System.Windows.Forms.TextBox();
+            this.lblContrastGet = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.btnContrastGet = new System.Windows.Forms.Button();
+            this.btnBrightnessSet = new System.Windows.Forms.Button();
+            this.txtBrightnessSet = new System.Windows.Forms.TextBox();
+            this.lblBrightnessGet = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.btnBrightnessGet = new System.Windows.Forms.Button();
+            this.btnWDSet = new System.Windows.Forms.Button();
+            this.txtWDSet = new System.Windows.Forms.TextBox();
+            this.lblWDGet = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.btnWDGet = new System.Windows.Forms.Button();
+            this.btnenlargeSet = new System.Windows.Forms.Button();
+            this.txtenlargeSet = new System.Windows.Forms.TextBox();
+            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.groupBox1.SuspendLayout();
+            this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // btnGrabImage
+            // 
+            this.btnGrabImage.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnGrabImage.Location = new System.Drawing.Point(523, 31);
+            this.btnGrabImage.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnGrabImage.Name = "btnGrabImage";
+            this.btnGrabImage.Size = new System.Drawing.Size(144, 42);
+            this.btnGrabImage.TabIndex = 1;
+            this.btnGrabImage.Text = "抓取图像";
+            this.btnGrabImage.UseVisualStyleBackColor = true;
+            this.btnGrabImage.Click += new System.EventHandler(this.btnGrabImage_Click);
+            // 
+            // btnInit
+            // 
+            this.btnInit.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnInit.Location = new System.Drawing.Point(31, 31);
+            this.btnInit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnInit.Name = "btnInit";
+            this.btnInit.Size = new System.Drawing.Size(144, 42);
+            this.btnInit.TabIndex = 1;
+            this.btnInit.Text = "初始化设备";
+            this.btnInit.UseVisualStyleBackColor = true;
+            this.btnInit.Click += new System.EventHandler(this.btnInit_Click);
+            // 
+            // btnCloseCtrl
+            // 
+            this.btnCloseCtrl.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnCloseCtrl.Location = new System.Drawing.Point(194, 31);
+            this.btnCloseCtrl.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnCloseCtrl.Name = "btnCloseCtrl";
+            this.btnCloseCtrl.Size = new System.Drawing.Size(144, 42);
+            this.btnCloseCtrl.TabIndex = 2;
+            this.btnCloseCtrl.Text = "关闭设备";
+            this.btnCloseCtrl.UseVisualStyleBackColor = true;
+            this.btnCloseCtrl.Click += new System.EventHandler(this.btnCloseCtrl_Click);
+            // 
+            // btnSetNotify
+            // 
+            this.btnSetNotify.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnSetNotify.Location = new System.Drawing.Point(356, 31);
+            this.btnSetNotify.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnSetNotify.Name = "btnSetNotify";
+            this.btnSetNotify.Size = new System.Drawing.Size(144, 42);
+            this.btnSetNotify.TabIndex = 3;
+            this.btnSetNotify.Text = "设置通知";
+            this.btnSetNotify.UseVisualStyleBackColor = true;
+            this.btnSetNotify.Click += new System.EventHandler(this.btnSetNotify_Click);
+            // 
+            // btnenlargeGet
+            // 
+            this.btnenlargeGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnenlargeGet.Location = new System.Drawing.Point(294, 15);
+            this.btnenlargeGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnenlargeGet.Name = "btnenlargeGet";
+            this.btnenlargeGet.Size = new System.Drawing.Size(78, 33);
+            this.btnenlargeGet.TabIndex = 2;
+            this.btnenlargeGet.Text = "Get";
+            this.btnenlargeGet.UseVisualStyleBackColor = true;
+            this.btnenlargeGet.Click += new System.EventHandler(this.btnenlargeGet_Click);
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.btnGrabImage);
+            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.Location = new System.Drawing.Point(3, 1);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.groupBox1.Size = new System.Drawing.Size(697, 94);
+            this.groupBox1.TabIndex = 17;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "控制按键";
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Location = new System.Drawing.Point(3, 100);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(1135, 467);
+            this.tabControl1.TabIndex = 19;
+            // 
+            // tabPage1
+            // 
+            this.tabPage1.BackColor = System.Drawing.Color.Transparent;
+            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);
+            this.tabPage1.Controls.Add(this.btnScanRotationSet);
+            this.tabPage1.Controls.Add(this.txtScanRotationSet);
+            this.tabPage1.Controls.Add(this.lblScanRotationGet);
+            this.tabPage1.Controls.Add(this.label11);
+            this.tabPage1.Controls.Add(this.btnScanRotationGet);
+            this.tabPage1.Controls.Add(this.btnTiltAngleSet);
+            this.tabPage1.Controls.Add(this.txtTiltAngleSet);
+            this.tabPage1.Controls.Add(this.lblTiltAngleGet);
+            this.tabPage1.Controls.Add(this.label7);
+            this.tabPage1.Controls.Add(this.btnTiltAngleGet);
+            this.tabPage1.Controls.Add(this.btnAstigmatismYSet);
+            this.tabPage1.Controls.Add(this.txtAstigmatismYSet);
+            this.tabPage1.Controls.Add(this.lblAstigmatismYGet);
+            this.tabPage1.Controls.Add(this.label5);
+            this.tabPage1.Controls.Add(this.btnAstigmatismYGet);
+            this.tabPage1.Controls.Add(this.btnAstigmatismXSet);
+            this.tabPage1.Controls.Add(this.txtAstigmatismXSet);
+            this.tabPage1.Controls.Add(this.lblAstigmatismXGet);
+            this.tabPage1.Controls.Add(this.label8);
+            this.tabPage1.Controls.Add(this.btnAstigmatismXGet);
+            this.tabPage1.Controls.Add(this.btnContrastSet);
+            this.tabPage1.Controls.Add(this.txtContrastSet);
+            this.tabPage1.Controls.Add(this.lblContrastGet);
+            this.tabPage1.Controls.Add(this.label4);
+            this.tabPage1.Controls.Add(this.btnContrastGet);
+            this.tabPage1.Controls.Add(this.btnBrightnessSet);
+            this.tabPage1.Controls.Add(this.txtBrightnessSet);
+            this.tabPage1.Controls.Add(this.lblBrightnessGet);
+            this.tabPage1.Controls.Add(this.label6);
+            this.tabPage1.Controls.Add(this.btnBrightnessGet);
+            this.tabPage1.Controls.Add(this.btnWDSet);
+            this.tabPage1.Controls.Add(this.txtWDSet);
+            this.tabPage1.Controls.Add(this.lblWDGet);
+            this.tabPage1.Controls.Add(this.label3);
+            this.tabPage1.Controls.Add(this.btnWDGet);
+            this.tabPage1.Controls.Add(this.btnenlargeSet);
+            this.tabPage1.Controls.Add(this.txtenlargeSet);
+            this.tabPage1.Controls.Add(this.lblenlargeGet);
+            this.tabPage1.Controls.Add(this.label1);
+            this.tabPage1.Controls.Add(this.btnenlargeGet);
+            this.tabPage1.Font = new System.Drawing.Font("楷体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tabPage1.Location = new System.Drawing.Point(4, 25);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage1.Size = new System.Drawing.Size(1127, 438);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Text = "SEM";
+            // 
+            // btnTiltAngleSet
+            // 
+            this.btnTiltAngleSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnTiltAngleSet.Location = new System.Drawing.Point(485, 237);
+            this.btnTiltAngleSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnTiltAngleSet.Name = "btnTiltAngleSet";
+            this.btnTiltAngleSet.Size = new System.Drawing.Size(78, 33);
+            this.btnTiltAngleSet.TabIndex = 38;
+            this.btnTiltAngleSet.Text = "Set";
+            this.btnTiltAngleSet.UseVisualStyleBackColor = true;
+            this.btnTiltAngleSet.Click += new System.EventHandler(this.btnTiltAngleSet_Click);
+            // 
+            // txtTiltAngleSet
+            // 
+            this.txtTiltAngleSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtTiltAngleSet.Location = new System.Drawing.Point(379, 238);
+            this.txtTiltAngleSet.Name = "txtTiltAngleSet";
+            this.txtTiltAngleSet.Size = new System.Drawing.Size(100, 30);
+            this.txtTiltAngleSet.TabIndex = 37;
+            this.txtTiltAngleSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblTiltAngleGet
+            // 
+            this.lblTiltAngleGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblTiltAngleGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblTiltAngleGet.Location = new System.Drawing.Point(204, 237);
+            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.Location = new System.Drawing.Point(22, 243);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(112, 27);
+            this.label7.TabIndex = 35;
+            this.label7.Text = "角度补偿:";
+            // 
+            // btnTiltAngleGet
+            // 
+            this.btnTiltAngleGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnTiltAngleGet.Location = new System.Drawing.Point(294, 237);
+            this.btnTiltAngleGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnTiltAngleGet.Name = "btnTiltAngleGet";
+            this.btnTiltAngleGet.Size = new System.Drawing.Size(78, 33);
+            this.btnTiltAngleGet.TabIndex = 34;
+            this.btnTiltAngleGet.Text = "Get";
+            this.btnTiltAngleGet.UseVisualStyleBackColor = true;
+            this.btnTiltAngleGet.Click += new System.EventHandler(this.btnTiltAngleGet_Click);
+            // 
+            // btnAstigmatismYSet
+            // 
+            this.btnAstigmatismYSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnAstigmatismYSet.Location = new System.Drawing.Point(485, 200);
+            this.btnAstigmatismYSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnAstigmatismYSet.Name = "btnAstigmatismYSet";
+            this.btnAstigmatismYSet.Size = new System.Drawing.Size(78, 33);
+            this.btnAstigmatismYSet.TabIndex = 33;
+            this.btnAstigmatismYSet.Text = "Set";
+            this.btnAstigmatismYSet.UseVisualStyleBackColor = true;
+            this.btnAstigmatismYSet.Click += new System.EventHandler(this.btnAstigmatismYSet_Click);
+            // 
+            // txtAstigmatismYSet
+            // 
+            this.txtAstigmatismYSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtAstigmatismYSet.Location = new System.Drawing.Point(379, 201);
+            this.txtAstigmatismYSet.Name = "txtAstigmatismYSet";
+            this.txtAstigmatismYSet.Size = new System.Drawing.Size(100, 30);
+            this.txtAstigmatismYSet.TabIndex = 32;
+            this.txtAstigmatismYSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblAstigmatismYGet
+            // 
+            this.lblAstigmatismYGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblAstigmatismYGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblAstigmatismYGet.Location = new System.Drawing.Point(204, 200);
+            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.Location = new System.Drawing.Point(22, 206);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(105, 27);
+            this.label5.TabIndex = 30;
+            this.label5.Text = "消像散Y:";
+            // 
+            // btnAstigmatismYGet
+            // 
+            this.btnAstigmatismYGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnAstigmatismYGet.Location = new System.Drawing.Point(294, 200);
+            this.btnAstigmatismYGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnAstigmatismYGet.Name = "btnAstigmatismYGet";
+            this.btnAstigmatismYGet.Size = new System.Drawing.Size(78, 33);
+            this.btnAstigmatismYGet.TabIndex = 29;
+            this.btnAstigmatismYGet.Text = "Get";
+            this.btnAstigmatismYGet.UseVisualStyleBackColor = true;
+            this.btnAstigmatismYGet.Click += new System.EventHandler(this.btnAstigmatismYGet_Click);
+            // 
+            // btnAstigmatismXSet
+            // 
+            this.btnAstigmatismXSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnAstigmatismXSet.Location = new System.Drawing.Point(485, 163);
+            this.btnAstigmatismXSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnAstigmatismXSet.Name = "btnAstigmatismXSet";
+            this.btnAstigmatismXSet.Size = new System.Drawing.Size(78, 33);
+            this.btnAstigmatismXSet.TabIndex = 28;
+            this.btnAstigmatismXSet.Text = "Set";
+            this.btnAstigmatismXSet.UseVisualStyleBackColor = true;
+            this.btnAstigmatismXSet.Click += new System.EventHandler(this.btnAstigmatismXSet_Click);
+            // 
+            // txtAstigmatismXSet
+            // 
+            this.txtAstigmatismXSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtAstigmatismXSet.Location = new System.Drawing.Point(379, 164);
+            this.txtAstigmatismXSet.Name = "txtAstigmatismXSet";
+            this.txtAstigmatismXSet.Size = new System.Drawing.Size(100, 30);
+            this.txtAstigmatismXSet.TabIndex = 27;
+            this.txtAstigmatismXSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblAstigmatismXGet
+            // 
+            this.lblAstigmatismXGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblAstigmatismXGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblAstigmatismXGet.Location = new System.Drawing.Point(204, 163);
+            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.Location = new System.Drawing.Point(22, 169);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(106, 27);
+            this.label8.TabIndex = 25;
+            this.label8.Text = "消像散X:";
+            // 
+            // btnAstigmatismXGet
+            // 
+            this.btnAstigmatismXGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnAstigmatismXGet.Location = new System.Drawing.Point(294, 163);
+            this.btnAstigmatismXGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnAstigmatismXGet.Name = "btnAstigmatismXGet";
+            this.btnAstigmatismXGet.Size = new System.Drawing.Size(78, 33);
+            this.btnAstigmatismXGet.TabIndex = 24;
+            this.btnAstigmatismXGet.Text = "Get";
+            this.btnAstigmatismXGet.UseVisualStyleBackColor = true;
+            this.btnAstigmatismXGet.Click += new System.EventHandler(this.btnAstigmatismXGet_Click);
+            // 
+            // btnContrastSet
+            // 
+            this.btnContrastSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnContrastSet.Location = new System.Drawing.Point(485, 126);
+            this.btnContrastSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnContrastSet.Name = "btnContrastSet";
+            this.btnContrastSet.Size = new System.Drawing.Size(78, 33);
+            this.btnContrastSet.TabIndex = 23;
+            this.btnContrastSet.Text = "Set";
+            this.btnContrastSet.UseVisualStyleBackColor = true;
+            this.btnContrastSet.Click += new System.EventHandler(this.btnContrastSet_Click);
+            // 
+            // txtContrastSet
+            // 
+            this.txtContrastSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtContrastSet.Location = new System.Drawing.Point(379, 127);
+            this.txtContrastSet.Name = "txtContrastSet";
+            this.txtContrastSet.Size = new System.Drawing.Size(100, 30);
+            this.txtContrastSet.TabIndex = 22;
+            this.txtContrastSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblContrastGet
+            // 
+            this.lblContrastGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblContrastGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblContrastGet.Location = new System.Drawing.Point(204, 126);
+            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.Location = new System.Drawing.Point(22, 132);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.TabIndex = 20;
+            this.label4.Text = "对比度:";
+            // 
+            // btnContrastGet
+            // 
+            this.btnContrastGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnContrastGet.Location = new System.Drawing.Point(294, 126);
+            this.btnContrastGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnContrastGet.Name = "btnContrastGet";
+            this.btnContrastGet.Size = new System.Drawing.Size(78, 33);
+            this.btnContrastGet.TabIndex = 19;
+            this.btnContrastGet.Text = "Get";
+            this.btnContrastGet.UseVisualStyleBackColor = true;
+            this.btnContrastGet.Click += new System.EventHandler(this.btnContrastGet_Click);
+            // 
+            // btnBrightnessSet
+            // 
+            this.btnBrightnessSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnBrightnessSet.Location = new System.Drawing.Point(485, 89);
+            this.btnBrightnessSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnBrightnessSet.Name = "btnBrightnessSet";
+            this.btnBrightnessSet.Size = new System.Drawing.Size(78, 33);
+            this.btnBrightnessSet.TabIndex = 18;
+            this.btnBrightnessSet.Text = "Set";
+            this.btnBrightnessSet.UseVisualStyleBackColor = true;
+            this.btnBrightnessSet.Click += new System.EventHandler(this.btnBrightnessSet_Click);
+            // 
+            // txtBrightnessSet
+            // 
+            this.txtBrightnessSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtBrightnessSet.Location = new System.Drawing.Point(379, 90);
+            this.txtBrightnessSet.Name = "txtBrightnessSet";
+            this.txtBrightnessSet.Size = new System.Drawing.Size(100, 30);
+            this.txtBrightnessSet.TabIndex = 17;
+            this.txtBrightnessSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblBrightnessGet
+            // 
+            this.lblBrightnessGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblBrightnessGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblBrightnessGet.Location = new System.Drawing.Point(204, 89);
+            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.Location = new System.Drawing.Point(22, 95);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(72, 27);
+            this.label6.TabIndex = 15;
+            this.label6.Text = "亮度:";
+            // 
+            // btnBrightnessGet
+            // 
+            this.btnBrightnessGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnBrightnessGet.Location = new System.Drawing.Point(294, 89);
+            this.btnBrightnessGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnBrightnessGet.Name = "btnBrightnessGet";
+            this.btnBrightnessGet.Size = new System.Drawing.Size(78, 33);
+            this.btnBrightnessGet.TabIndex = 14;
+            this.btnBrightnessGet.Text = "Get";
+            this.btnBrightnessGet.UseVisualStyleBackColor = true;
+            this.btnBrightnessGet.Click += new System.EventHandler(this.btnBrightnessGet_Click);
+            // 
+            // btnWDSet
+            // 
+            this.btnWDSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnWDSet.Location = new System.Drawing.Point(485, 52);
+            this.btnWDSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnWDSet.Name = "btnWDSet";
+            this.btnWDSet.Size = new System.Drawing.Size(78, 33);
+            this.btnWDSet.TabIndex = 13;
+            this.btnWDSet.Text = "Set";
+            this.btnWDSet.UseVisualStyleBackColor = true;
+            this.btnWDSet.Click += new System.EventHandler(this.btnWDSet_Click);
+            // 
+            // txtWDSet
+            // 
+            this.txtWDSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtWDSet.Location = new System.Drawing.Point(379, 53);
+            this.txtWDSet.Name = "txtWDSet";
+            this.txtWDSet.Size = new System.Drawing.Size(100, 30);
+            this.txtWDSet.TabIndex = 12;
+            this.txtWDSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblWDGet
+            // 
+            this.lblWDGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblWDGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblWDGet.Location = new System.Drawing.Point(204, 52);
+            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.Location = new System.Drawing.Point(22, 58);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(72, 27);
+            this.label3.TabIndex = 10;
+            this.label3.Text = "焦距:";
+            // 
+            // btnWDGet
+            // 
+            this.btnWDGet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnWDGet.Location = new System.Drawing.Point(294, 52);
+            this.btnWDGet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnWDGet.Name = "btnWDGet";
+            this.btnWDGet.Size = new System.Drawing.Size(78, 33);
+            this.btnWDGet.TabIndex = 9;
+            this.btnWDGet.Text = "Get";
+            this.btnWDGet.UseVisualStyleBackColor = true;
+            this.btnWDGet.Click += new System.EventHandler(this.btnWDGet_Click);
+            // 
+            // btnenlargeSet
+            // 
+            this.btnenlargeSet.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.btnenlargeSet.Location = new System.Drawing.Point(485, 15);
+            this.btnenlargeSet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.btnenlargeSet.Name = "btnenlargeSet";
+            this.btnenlargeSet.Size = new System.Drawing.Size(78, 33);
+            this.btnenlargeSet.TabIndex = 8;
+            this.btnenlargeSet.Text = "Set";
+            this.btnenlargeSet.UseVisualStyleBackColor = true;
+            this.btnenlargeSet.Click += new System.EventHandler(this.btnenlargeSet_Click);
+            // 
+            // txtenlargeSet
+            // 
+            this.txtenlargeSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+            this.txtenlargeSet.Location = new System.Drawing.Point(379, 16);
+            this.txtenlargeSet.Name = "txtenlargeSet";
+            this.txtenlargeSet.Size = new System.Drawing.Size(100, 30);
+            this.txtenlargeSet.TabIndex = 7;
+            this.txtenlargeSet.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // lblenlargeGet
+            // 
+            this.lblenlargeGet.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.lblenlargeGet.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblenlargeGet.Location = new System.Drawing.Point(204, 15);
+            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.Location = new System.Drawing.Point(22, 21);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(72, 27);
+            this.label1.TabIndex = 5;
+            this.label1.Text = "缩放:";
+            // 
+            // tabPage2
+            // 
+            this.tabPage2.Font = new System.Drawing.Font("微软雅黑", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tabPage2.Location = new System.Drawing.Point(4, 25);
+            this.tabPage2.Name = "tabPage2";
+            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.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
+            // 
+            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.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);
+            // 
+            // FormUnitControl
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1138, 571);
+            this.Controls.Add(this.tabControl1);
+            this.Controls.Add(this.groupBox1);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Name = "FormUnitControl";
+            this.Text = "UnitControl";
+            this.groupBox1.ResumeLayout(false);
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Button btnInit;
+        private System.Windows.Forms.Button btnCloseCtrl;
+        private System.Windows.Forms.Button btnSetNotify;
+        private System.Windows.Forms.Button btnGrabImage;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Button btnenlargeGet;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.TabPage tabPage2;
+        private System.Windows.Forms.Button btnenlargeSet;
+        private System.Windows.Forms.TextBox txtenlargeSet;
+        private System.Windows.Forms.Label lblenlargeGet;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button btnWDSet;
+        private System.Windows.Forms.TextBox txtWDSet;
+        private System.Windows.Forms.Label lblWDGet;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Button btnWDGet;
+        private System.Windows.Forms.Button btnContrastSet;
+        private System.Windows.Forms.TextBox txtContrastSet;
+        private System.Windows.Forms.Label lblContrastGet;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Button btnContrastGet;
+        private System.Windows.Forms.Button btnBrightnessSet;
+        private System.Windows.Forms.TextBox txtBrightnessSet;
+        private System.Windows.Forms.Label lblBrightnessGet;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Button btnBrightnessGet;
+        private System.Windows.Forms.Button btnAstigmatismYSet;
+        private System.Windows.Forms.TextBox txtAstigmatismYSet;
+        private System.Windows.Forms.Label lblAstigmatismYGet;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Button btnAstigmatismYGet;
+        private System.Windows.Forms.Button btnAstigmatismXSet;
+        private System.Windows.Forms.TextBox txtAstigmatismXSet;
+        private System.Windows.Forms.Label lblAstigmatismXGet;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Button btnAstigmatismXGet;
+        private System.Windows.Forms.Button btnTiltAngleSet;
+        private System.Windows.Forms.TextBox txtTiltAngleSet;
+        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;
+        private System.Windows.Forms.Button btnScanRotationSet;
+        private System.Windows.Forms.TextBox txtScanRotationSet;
+        private System.Windows.Forms.Label lblScanRotationGet;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Button btnScanRotationGet;
+        private System.Windows.Forms.Button btnCloseVoltage;
+        private System.Windows.Forms.Button btnOpenVoltage;
+    }
+}
+

+ 957 - 0
HOZProject/FormUnitControl.cs

@@ -0,0 +1,957 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+using System.IO;
+using SmartSEMControl;
+
+namespace HOZProject
+{
+    public partial class FormUnitControl : Form
+    {
+        #region 系统参数
+        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()
+        {
+            InitializeComponent();
+
+            //Calling Notification for updated status
+            //CZEMApi.Notify += new _EMApiEvents_NotifyEventHandler(CZEMApi_Notify);
+            //CZEMApi.NotifyWithCurrentValue += new _EMApiEvents_NotifyWithCurrentValueEventHandler(CZEMApi_NotifyWithCurrentValue);
+            //加载参数
+
+        }
+        #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())
+            {
+                btnInit.BackColor = Color.Lime;
+            }
+            else
+            {
+                btnInit.BackColor = Color.Red;
+            }
+        }
+        #endregion
+
+        #region 设备关闭按键
+        private void btnCloseCtrl_Click(object sender, EventArgs e)
+        {
+            if (sem.UnInit())
+            {
+                btnInit.BackColor = Control.DefaultBackColor;
+            }
+        }
+        #endregion
+
+        #region 设置参数更新通知
+        private void btnSetNotify_Click(object sender, EventArgs e)
+        {
+            //if (m_bInitialised)
+            //{
+            //    // Magnification
+            //    if (CZEMApi.SetNotify("AP_MAG", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_MAG");
+            //        return;
+            //    }
+            //    // Working distance
+            //    if (CZEMApi.SetNotify("AP_WD", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_WD");
+            //        return;
+            //    }
+            //    // BRIGHTNESS 亮度
+            //    if (CZEMApi.SetNotify("AP_BRIGHTNESS", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_BRIGHTNESS");
+            //        return;
+            //    }
+            //    // AP_CONTRAST,对比度
+            //    if (CZEMApi.SetNotify("AP_CONTRAST", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_CONTRAST");
+            //        return;
+            //    }
+            //    // Vacuum
+            //    if (CZEMApi.SetNotify("DP_VACSTATUS", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_VACSTATUS");
+            //        return;
+            //    }
+            //    // Gun / EHT state
+            //    if (CZEMApi.SetNotify("DP_RUNUPSTATE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_RUNUPSTATE");
+            //        return;
+            //    }
+            //    // actual KV / EHT
+            //    if (CZEMApi.SetNotify("AP_ACTUALKV", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_ACTUALKV");
+            //        return;
+            //    }
+            //    // actual current
+            //    if (CZEMApi.SetNotify("AP_ACTUALCURRENT", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_ACTUALCURRENT");
+            //        return;
+            //    }
+            //    // column type
+            //    if (CZEMApi.SetNotify("DP_COLUMN_TYPE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_COLUMN_TYPE");
+            //        return;
+            //    }
+            //    // mode
+            //    if (CZEMApi.SetNotify("DP_OPERATING_MODE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_OPERATING_MODE");
+            //        return;
+            //    }
+            //    // scan rate
+            //    if (CZEMApi.SetNotify("DP_SCANRATE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_SCANRATE");
+            //        return;
+            //    }
+            //    // auto function active
+            //    if (CZEMApi.SetNotify("DP_AUTO_FUNCTION", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_AUTO_FUNCTION");
+            //        return;
+            //    }
+                
+                
+            //    // probe current
+            //    if (CZEMApi.SetNotify("AP_IPROBE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "AP_IPROBE");
+            //        return;
+            //    }
+            //    // detector
+            //    if (CZEMApi.SetNotify("DP_DETECTOR_TYPE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_DETECTOR_TYPE");
+            //        return;
+            //    }
+            //    // stage initialised
+            //    if (CZEMApi.SetNotify("DP_STAGE_INIT", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_STAGE_INIT");
+            //        return;
+            //    }
+            //    // stage busy?
+            //    if (CZEMApi.SetNotify("DP_STAGE_IS", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_STAGE_IS");
+            //        return;
+            //    }
+            //    // fib mode
+            //    if (CZEMApi.SetNotify("DP_FIB_MODE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_FIB_MODE");
+            //        return;
+            //    }
+            //    // fib gun state
+            //    if (CZEMApi.SetNotify("DP_FIB_GUN_STATE", 1) != 0)
+            //    {
+            //        DisplayError("SetNotify", "DP_FIB_GUN_STATE");
+            //        return;
+            //    }
+
+                //listmsg.Items.Add("Notification enabled");
+           // }
+        }
+        #endregion
+
+        #region 缩放Get
+        private void btnenlargeGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetMagnification();
+            if(float.IsNaN(ret))
+            {
+                lblenlargeGet.Text = "NaN";
+                txtenlargeSet.Enabled = false;
+                btnenlargeSet.Enabled = false;
+            }
+            else
+            {
+                lblenlargeGet.Text = ret.ToString();
+                txtenlargeSet.Text = ret.ToString();
+                btnenlargeSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 缩放Set
+        private void btnenlargeSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if(float.TryParse(txtenlargeSet.Text, out set))
+            {
+                sem.SetMagnification(set);
+            }
+            
+        }
+        #endregion
+
+        #region 焦距Get
+        private void btnWDGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetWorkingDistance();
+            if (float.IsNaN(ret))
+            {
+                lblWDGet.Text = "NaN";
+                txtWDSet.Enabled = false;
+                btnWDSet.Enabled = false;
+            }
+            else
+            {
+                lblWDGet.Text = ret.ToString();
+                txtWDSet.Text = ret.ToString();
+                btnWDSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 焦距Set
+        private void btnWDSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtWDSet.Text, out set))
+            {
+                sem.SetWorkingDistance(set);
+            }
+        }
+        #endregion
+
+        #region 亮度Get
+        private void btnBrightnessGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetBrightness();
+            if (float.IsNaN(ret))
+            {
+                lblBrightnessGet.Text = "NaN";
+                txtBrightnessSet.Enabled = false;
+                btnBrightnessSet.Enabled = false;
+            }
+            else
+            {
+                lblBrightnessGet.Text = ret.ToString();
+                txtBrightnessSet.Text = ret.ToString();
+                btnBrightnessSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 亮度Set
+        private void btnBrightnessSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtBrightnessSet.Text, out set))
+            {
+                sem.SetBrightness(set);
+            }
+        }
+        #endregion
+
+        #region 对比度Get
+        private void btnContrastGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetContrast();
+            if (float.IsNaN(ret))
+            {
+                lblContrastGet.Text = "NaN";
+                txtContrastSet.Enabled = false;
+                btnContrastSet.Enabled = false;
+            }
+            else
+            {
+                lblContrastGet.Text = ret.ToString();
+                txtContrastSet.Text = ret.ToString();
+                btnContrastSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 对比度Set
+        private void btnContrastSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtContrastSet.Text, out set))
+            {
+                sem.SetContrast(set);
+            }
+        }
+        #endregion
+
+        #region 消像散X Get
+        private void btnAstigmatismXGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetAstigmatismX();
+            if (float.IsNaN(ret))
+            {
+                lblAstigmatismXGet.Text = "NaN";
+                txtAstigmatismXSet.Enabled = false;
+                btnAstigmatismXSet.Enabled = false;
+            }
+            else
+            {
+                lblAstigmatismXGet.Text = ret.ToString();
+                txtAstigmatismXSet.Text = ret.ToString();
+                btnAstigmatismXSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 消像散X Set
+        private void btnAstigmatismXSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtAstigmatismXSet.Text, out set))
+            {
+                sem.SetAstigmatismX(set);
+            }
+        }
+        #endregion
+
+        #region 消像散Y Get
+        private void btnAstigmatismYGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetAstigmatismY();
+            if (float.IsNaN(ret))
+            {
+                lblAstigmatismYGet.Text = "NaN";
+                txtAstigmatismYSet.Enabled = false;
+                btnAstigmatismYSet.Enabled = false;
+            }
+            else
+            {
+                lblAstigmatismYGet.Text = ret.ToString();
+                txtAstigmatismYSet.Text = ret.ToString();
+                btnAstigmatismYSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 消像散Y Set
+        private void btnAstigmatismYSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtAstigmatismYSet.Text, out set))
+            {
+                sem.SetAstigmatismY(set);
+            }
+        }
+
+        #endregion
+
+        #region 角度补偿Get
+        private void btnTiltAngleGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetTiltAngle();
+            if (float.IsNaN(ret))
+            {
+                lblTiltAngleGet.Text = "NaN";
+                txtTiltAngleSet.Enabled = false;
+                btnTiltAngleSet.Enabled = false;
+            }
+            else
+            {
+                lblTiltAngleGet.Text = ret.ToString();
+                txtTiltAngleSet.Text = ret.ToString();
+                btnTiltAngleSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region 角度补偿Set
+        private void btnTiltAngleSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtTiltAngleSet.Text, out set))
+            {
+                sem.SetTiltAngle(set);
+            }
+        }
+        #endregion
+
+        #region 抓取图像
+        private void btnGrabImage_Click(object sender, EventArgs e)
+        {
+            SaveFileDialog sfd = new SaveFileDialog();
+            sfd.Title = "图像保存位置:";
+            sfd.FileName = "test.tif";
+            sfd.Filter = "TIF文件|*.tif";
+            if (sfd.ShowDialog() == DialogResult.OK)
+            {
+                string fn = sfd.FileName;
+                sem.GrabImage(fn, 0);
+            }
+        }
+        #endregion
+
+        #region ScanRotate Get
+        private void btnScanRotationGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetScanRotation();
+            if (float.IsNaN(ret))
+            {
+                lblScanRotationGet.Text = "NaN";
+                txtScanRotationSet.Enabled = false;
+                btnScanRotationSet.Enabled = false;
+            }
+            else
+            {
+                lblScanRotationGet.Text = ret.ToString();
+                txtScanRotationSet.Text = ret.ToString();
+                btnScanRotationSet.Enabled = true;
+            }
+        }
+        #endregion
+
+        #region ScanRotate Set
+        private void btnScanRotationSet_Click(object sender, EventArgs e)
+        {
+            float set = 0;
+            if (float.TryParse(txtScanRotationSet.Text, out set))
+            {
+                sem.SetScanRotation(set);
+            }
+        }
+        #endregion
+
+        #region PixelSize Get
+        private void btnPixelSizeGet_Click(object sender, EventArgs e)
+        {
+            float ret = sem.GetScanRotation();
+            if (float.IsNaN(ret))
+            {
+                lblScanRotationGet.Text = "NaN";
+                txtScanRotationSet.Enabled = false;
+                btnScanRotationSet.Enabled = false;
+            }
+            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);
+            }
+        }
+        #endregion
+
+        #region 开启电压
+        private void btnOpenVoltage_Click(object sender, EventArgs e)
+        {
+            sem.CmdOpenVoltage();
+        }
+        #endregion
+
+        #region 关闭电压
+        private void btnCloseVoltage_Click(object sender, EventArgs e)
+        {
+            sem.CmdCloseVoltage();
+        }
+        #endregion
+    }
+}

+ 120 - 0
HOZProject/FormUnitControl.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 19 - 0
HOZProject/ParamsList.txt

@@ -0,0 +1,19 @@
+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,自动对比度

+ 22 - 0
HOZProject/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace HOZProject
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new FormUnitControl());
+        }
+    }
+}

+ 36 - 0
HOZProject/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("HOZProject")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HOZProject")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("abba5e64-536b-4ea0-8305-490a48822c89")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
HOZProject/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HOZProject.Properties
+{
+
+
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HOZProject.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   覆盖当前线程的 CurrentUICulture 属性
+        ///   使用此强类型的资源类的资源查找。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
HOZProject/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
HOZProject/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace HOZProject.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
HOZProject/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 94 - 0
HOZProject/UnitControl.csproj

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{ABBA5E64-536B-4EA0-8305-490A48822C89}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>HOZProject</RootNamespace>
+    <AssemblyName>HOZProject</AssemblyName>
+    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="SmartSEMControl">
+      <HintPath>..\SmartSEMControl\bin\Debug\SmartSEMControl.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="FormUnitControl.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FormUnitControl.Designer.cs">
+      <DependentUpon>FormUnitControl.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="FormUnitControl.resx">
+      <DependentUpon>FormUnitControl.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="CommandsList.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="ParamsList.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 36 - 0
SmartSEMControl/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("SmartSEMControl")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SmartSEMControl")]
+[assembly: AssemblyCopyright("Copyright ©  2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("bf7f80b0-a6da-4470-a331-4c96057fc7fa")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 494 - 0
SmartSEMControl/SmartSEM.cs

@@ -0,0 +1,494 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+using APILib;
+using System.Threading;
+
+namespace SmartSEMControl
+{
+    public class SmartSEM
+    {
+        #region 参数
+        //放大缩小
+        private String AP_MAG = "AP_MAG";
+        //焦距
+        private String AP_WD = "AP_WD";
+        //亮度
+        private String AP_BRIGHTNESS = "AP_BRIGHTNESS";
+        //对比度
+        private String AP_CONTRAST = "AP_CONTRAST";
+        //消像散X轴
+        private String AP_STIG_X = "AP_STIG_X";
+        //消像散Y轴
+        private String AP_STIG_Y = "AP_STIG_Y";
+        //角度补偿
+        private String AP_TILT_ANGLE = "AP_TILT_ANGLE";
+        //X轴移动到
+        private String AP_STAGE_GOTO_X = "AP_STAGE_GOTO_X";
+        //Y轴移动到
+        private String AP_STAGE_GOTO_Y = "AP_STAGE_GOTO_Y";
+        //Scan Rotate角度
+        private String AP_SCANROTATION = "AP_SCANROTATION";
+        //像素大小
+        private String AP_PIXEL_SIZE = "AP_PIXEL_SIZE";
+        //X轴坐标
+        private String AP_STAGE_AT_X = "AP_STAGE_AT_X";
+        //Y轴坐标
+        private String AP_STAGE_AT_Y = "AP_STAGE_AT_Y";
+        //Z轴坐标
+        private String AP_STAGE_AT_Z = "AP_STAGE_AT_Z";
+        //T轴坐标
+        private String AP_STAGE_AT_T = "AP_STAGE_AT_T";
+        //R轴坐标
+        private String AP_STAGE_AT_R = "AP_STAGE_AT_R";
+        //M轴坐标
+        private String AP_STAGE_AT_M = "AP_STAGE_AT_M";
+        #endregion
+
+        #region 命令
+        //开启电压
+        private String CMD_BEAM_ON = "CMD_BEAM_ON";
+        //关闭电压
+        private String CMD_EHT_OFF = "CMD_EHT_OFF";
+        #endregion
+
+        #region APILib
+        private Api CZEMApi = new Api();
+        private Boolean m_bInitialised = false;
+        private long lrt = 0;
+        #endregion
+
+        #region 设备初始化
+        /// <summary>
+        /// 设备初始化
+        /// </summary>
+        /// <returns>return:true or false</returns>
+        public Boolean Init()
+        {
+            lrt = CZEMApi.Initialise("");
+            if(lrt!=0)
+            {
+                m_bInitialised = false;
+                return false;
+            }
+            else
+            {
+                m_bInitialised = true;
+                return true;
+            }
+        }
+        #endregion
+
+        #region 关闭设备
+        /// <summary>
+        /// 关闭设备
+        /// </summary>
+        /// <returns>true or false</returns>
+        public Boolean UnInit()
+        {
+            if (m_bInitialised)
+            {
+                lrt = CZEMApi.ClosingControl();
+                if (lrt != 0)
+                {
+                    return false;
+                }
+                else
+                {
+                    m_bInitialised = false;
+                    return true;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+        #endregion
+
+        #region 读参数函数
+        private Boolean ReadParams(String str_param,ref float value)
+        {
+            if (m_bInitialised)
+            {
+                object varfloat = new VariantWrapper((float)0.0f);
+                lrt = CZEMApi.Get(str_param, ref varfloat);
+                if (lrt != 0)
+                {
+                    return false;
+                }
+                else
+                {
+                    value = Convert.ToSingle(varfloat);
+                    return true;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+        #endregion
+
+        #region 写参数函数
+        private Boolean WriteParams(String str_param, float value)
+        {
+            if (m_bInitialised)
+            {
+                //先取范围
+                object varMin = new VariantWrapper((float)0.0f);
+                object varMax = new VariantWrapper((float)0.0f);
+                lrt = CZEMApi.GetLimits(str_param, ref varMin, ref varMax);
+                if (lrt != 0)
+                {
+                    return false;
+                }
+                if (value <= Convert.ToSingle(varMax) && value >= Convert.ToSingle(varMin))
+                {
+                    object varFloat = new VariantWrapper(value);
+                    lrt = CZEMApi.Set(str_param, ref varFloat);// set value
+                    if (lrt != 0)
+                    {
+                        return false;
+                    }
+                    return true;
+                    //这里是写入后读取判断值是否写入,也可以在事件1中捕获返回值
+                    //object varfloat = new VariantWrapper((float)0.0f);
+                    ////object varStr = new VariantWrapper("");
+                    //lrt = CZEMApi.Get(strPara, ref varfloat);
+
+                    //if (lrt != 0)
+                    //{
+                    //    ReportError(lrt, "Set Value", strPara);
+                    //    return;
+                    //}
+                    //lblgetValue.Text = Convert.ToDecimal(varfloat).ToString();
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+        #endregion
+
+        #region 执行命令
+        private Boolean ExecuteCmd(String cmd)
+        {
+            if (m_bInitialised)
+            {
+                lrt = CZEMApi.Execute(cmd);// execute command
+                if (lrt != 0)
+                {
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+        #endregion
+
+        #region 放大缩小
+        /// <summary>
+        /// 读取缩放倍数
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetMagnification()
+        {
+            float ret = 0;
+            if(ReadParams(AP_MAG, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置缩放倍数
+        /// </summary>
+        /// <param name="set">倍数</param>
+        /// <returns>true or false</returns>
+        public Boolean SetMagnification(float set)
+        {
+            return WriteParams(AP_MAG, set);
+        }
+        #endregion
+
+        #region 焦距
+        /// <summary>
+        /// 读取工作距离
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetWorkingDistance()
+        {
+            float ret = 0;
+            if (ReadParams(AP_WD, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置焦距
+        /// </summary>
+        /// <param name="set">焦距</param>
+        /// <returns>true or false</returns>
+        public Boolean SetWorkingDistance(float set)
+        {
+            return WriteParams(AP_WD, set);
+        }
+        #endregion
+
+        #region 亮度
+        /// <summary>
+        /// 读取亮度
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetBrightness()
+        {
+            float ret = 0;
+            if (ReadParams(AP_BRIGHTNESS, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置亮度
+        /// </summary>
+        /// <param name="set">亮度</param>
+        /// <returns>true or false</returns>
+        public Boolean SetBrightness(float set)
+        {
+            return WriteParams(AP_BRIGHTNESS, set);
+        }
+        #endregion
+
+        #region 对比度
+        /// <summary>
+        /// 读取对比度
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetContrast()
+        {
+            float ret = 0;
+            if (ReadParams(AP_CONTRAST, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置对比度
+        /// </summary>
+        /// <param name="set">对比度</param>
+        /// <returns>true or false</returns>
+        public Boolean SetContrast(float set)
+        {
+            return WriteParams(AP_CONTRAST, set);
+        }
+        #endregion
+
+        #region 消像散
+        /// <summary>
+        /// 读取消像散X
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetAstigmatismX()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STIG_X, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 读取消像散Y
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetAstigmatismY()
+        {
+            float ret = 0;
+            if (ReadParams(AP_STIG_Y, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置消像散X
+        /// </summary>
+        /// <param name="set">对比度</param>
+        /// <returns>true or false</returns>
+        public Boolean SetAstigmatismX(float set)
+        {
+            return WriteParams(AP_STIG_X, set);
+        }
+
+        /// <summary>
+        /// 设置消像散Y
+        /// </summary>
+        /// <param name="set">对比度</param>
+        /// <returns>true or false</returns>
+        public Boolean SetAstigmatismY(float set)
+        {
+            return WriteParams(AP_STIG_Y, set);
+        }
+        #endregion
+
+        #region 角度补偿
+        /// <summary>
+        /// 读取角度补偿
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetTiltAngle()
+        {
+            float ret = 0;
+            if (ReadParams(AP_TILT_ANGLE, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置角度补偿
+        /// </summary>
+        /// <param name="set">角度补偿</param>
+        /// <returns>true or false</returns>
+        public Boolean SetTiltAngle(float set)
+        {
+            return WriteParams(AP_TILT_ANGLE, set);
+        }
+        #endregion
+
+        #region 抓取图像
+        /// <summary>
+        /// 抓取图像
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public Boolean GrabImage(String filename,short type)
+        {
+            if (m_bInitialised)
+            {
+                lrt = CZEMApi.Grab(0, 0, 1024, 768, type, filename);
+                if (lrt != 0)
+                {
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+        #endregion
+
+        #region Scan Rotate角度接口
+        /// <summary>
+        /// 获取Scan Rotate角度接口
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetScanRotation()
+        {
+            float ret = 0;
+            if (ReadParams(AP_SCANROTATION, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+
+        /// <summary>
+        /// 设置Scan Rotate角度接口
+        /// </summary>
+        /// <param name="set">角度补偿</param>
+        /// <returns>true or false</returns>
+        public Boolean SetScanRotation(float set)
+        {
+            return WriteParams(AP_SCANROTATION, set);
+        }
+        #endregion
+
+        #region 像素读取PixelSize
+        /// <summary>
+        /// 获取Pixel Size 接口,只读
+        /// </summary>
+        /// <returns>true:float or false:NaN</returns>
+        public float GetPixelSize()
+        {
+            float ret = 0;
+            if (ReadParams(AP_PIXEL_SIZE, ref ret))
+            {
+                return ret;
+            }
+            else
+            {
+                return float.NaN;
+            }
+        }
+        #endregion
+
+        #region 开启电压
+        public Boolean CmdOpenVoltage()
+        {
+            return ExecuteCmd(CMD_BEAM_ON);
+        }
+        #endregion
+
+        #region 关闭电压
+        public Boolean CmdCloseVoltage()
+        {
+            return ExecuteCmd(CMD_EHT_OFF);
+        }
+        #endregion
+    }
+}

+ 59 - 0
SmartSEMControl/SmartSEMControl.csproj

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>SmartSEMControl</RootNamespace>
+    <AssemblyName>SmartSEMControl</AssemblyName>
+    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="SmartSEM.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <COMReference Include="APILib">
+      <Guid>{71BD42C1-EBD3-11D0-AB3A-444553540000}</Guid>
+      <VersionMajor>1</VersionMajor>
+      <VersionMinor>0</VersionMinor>
+      <Lcid>0</Lcid>
+      <WrapperTool>tlbimp</WrapperTool>
+      <Isolated>False</Isolated>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+    </COMReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>