Преглед изворни кода

Merge branch 'master' of http://192.168.1.123:10080/SDD1/HOZ

wb_han пре 4 година
родитељ
комит
1a0b31bacd

+ 1222 - 0
ExtenderControl/Extender.cs

@@ -0,0 +1,1222 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+
+//显示弹出信息
+using System.Windows.Forms;
+
+using OINA.Extender;
+using OINA.Extender.MicroscopeControl;
+using OINA.Extender.Acquisition;
+using OINA.Extender.Acquisition.Image;
+using OINA.Extender.Data;
+using OINA.Extender.Data.Image;
+
+using OINA.Extender.Acquisition.Ed;
+using OINA.Extender.Acquisition.Quant;
+using OINA.Extender.Processing;
+using OINA.Extender.Processing.Ed;
+using OINA.Extender.Processing.Quant;
+
+using System.ComponentModel;
+using OINA.Extender.Data.Ed;
+
+namespace Extender
+{
+    public class Extender : IExtenderControl
+    {
+        //构造函数
+        public Extender()
+        {
+            InitMicroscopeController();
+            InitImageAcquisition();
+            InitXrayAcquistion();
+        }
+
+        //结束
+        public void CloseExtender()
+        {
+            CloseMicroscopeController();
+            CloseImageAcquisition();
+            CloaseXrayAcquistion();
+        }
+
+        #region 电镜控制、样品台
+        //控制电镜
+        private IMicroscopeController microscopeController = null;
+
+        //电压
+        private double m_dHighVoltage;
+        //放大倍数
+        private double m_dMagnification;
+        //工作距离
+        private double m_dWorkingDistance;
+        //亮度
+        private double m_dBirghtness;
+        //对比度
+        private double m_dContrast;
+        //BeamOn
+        private bool m_bBeamOn;
+        //FilamentOn
+        private bool m_bFilamentOn;
+
+        //样品台位置
+        private double m_dStageX;
+        private double m_dStageY;
+        private double m_dStageZ;
+        private double m_dStageR;
+        private double m_dStageT;
+
+        private double m_dStageXMax;
+        public double StageXMax
+        {
+            get { return this.m_dStageXMax; }
+            set { this.m_dStageXMax = value; }
+        }
+        private double m_dStageXMin;
+        public double StageXMin
+        {
+            get { return this.m_dStageXMin; }
+            set { this.m_dStageXMin = value; }
+        }
+
+        private double m_dStageYMax;
+        public double StageYMax
+        {
+            get { return this.m_dStageYMax; }
+            set { this.m_dStageYMax = value; }
+        }
+        private double m_dStageYMin;
+        public double StageYMin
+        {
+            get { return this.m_dStageYMin; }
+            set { this.m_dStageYMin = value; }
+        }
+
+        private double m_dStageZMax;
+        public double StageZMax
+        {
+            get { return this.m_dStageZMax; }
+            set { this.m_dStageZMax = value; }
+        }
+        private double m_dStageZMin;
+        public double StageZMin
+        {
+            get { return this.m_dStageZMin; }
+            set { this.m_dStageZMin = value; }
+        }
+
+        private double m_dStageTMax;
+        public double StageTMax
+        {
+            get { return this.m_dStageTMax; }
+            set { this.m_dStageTMax = value; }
+        }
+        private double m_dStageTMin;
+        public double StageTMin
+        {
+            get { return this.m_dStageTMin; }
+            set { this.m_dStageTMin = value; }
+        }
+
+        private double m_dStageRMax;
+        public double StageRMax
+        {
+            get { return this.m_dStageRMax; }
+            set { this.m_dStageRMax = value; }
+        }
+        private double m_dStageRMin;
+        public double StageRMin
+        {
+            get { return this.m_dStageRMin; }
+            set { this.m_dStageRMin = value; }
+        }
+
+        //控制电镜初始化
+        void InitMicroscopeController(float a_fStageXMin = 0, float a_fStageXMax = 130,
+            float a_fStageYMin = 0, float a_fStageYMax = 130,
+            float a_fStageZMin = 0, float a_fStageZMax = 40,
+            float a_fStageTMin = 0, float a_fStageTMax = 90,
+            float a_fStageRMin = 0, float a_fStageRMax = 360)
+        {
+            this.microscopeController = AcquireFactory.CreateMicroscopeControl();
+            this.microscopeController.ColumnChange += this.OnMicroscopeColumnChange;
+            this.microscopeController.StageChange += this.OnMicroscopeStageChange;
+            this.microscopeController.ColumnConnected += this.OnMicroscopeColumnConnected;
+            this.microscopeController.StageConnected += this.OnMicroscopeStageConnected;
+            this.microscopeController.ChangeCompleted += this.OnMicroscopeChangeCompleted;
+
+            ReadMicroscopeColumn();
+            ReadStage();
+
+            StageXMax = a_fStageXMax;
+            StageXMin = a_fStageXMin;
+            StageYMax = a_fStageYMax;
+            StageYMin = a_fStageYMin;
+            StageZMax = a_fStageZMax;
+            StageZMin = a_fStageZMin;
+            StageTMax = a_fStageTMax;
+            StageTMin = a_fStageTMin;
+            StageRMax = a_fStageRMax;
+            StageRMin = a_fStageRMin;
+        }
+
+        //控制电镜释放
+        void CloseMicroscopeController()
+        {
+            this.microscopeController.ColumnChange -= this.OnMicroscopeColumnChange;
+            this.microscopeController.StageChange -= this.OnMicroscopeStageChange;
+            this.microscopeController.ColumnConnected -= this.OnMicroscopeColumnConnected;
+            this.microscopeController.StageConnected -= this.OnMicroscopeStageConnected;
+            this.microscopeController.ChangeCompleted -= this.OnMicroscopeChangeCompleted;
+        }
+
+        //读取当前的电镜控制值
+        private void ReadMicroscopeColumn()
+        {
+            var columnCapabilities = this.microscopeController.ColumnCapabilities;
+            var columnConditions = this.microscopeController.ColumnConditions;
+
+            if (columnCapabilities.Magnification.CanRead)
+            {
+                m_dMagnification = columnConditions.Magnification;
+            }
+
+            if (columnCapabilities.WorkingDistance.CanRead)
+            {
+                m_dWorkingDistance = columnConditions.WorkingDistance;
+            }
+
+            if (columnCapabilities.HighVoltage.CanRead)
+            {
+                m_dHighVoltage = columnConditions.HighVoltage;
+            }
+
+            if (columnCapabilities.Brightness.CanRead)
+            {
+                m_dBirghtness = columnConditions.Brightness;
+            }
+
+            if (columnCapabilities.Contrast.CanRead)
+            {
+                m_dContrast = columnConditions.Contrast;
+            }
+
+            if (columnCapabilities.BeamOn.CanRead)
+            {
+                m_bBeamOn = Convert.ToBoolean(columnConditions.BeamOn);
+            }
+
+            if (columnCapabilities.FilamentOn.CanRead)
+            {
+                m_bFilamentOn = Convert.ToBoolean(columnConditions.FilamentOn);
+            }
+        }
+
+        //读取样品台位置
+        private void ReadStage()
+        {
+            var stageCapabilities = this.microscopeController.StageCapabilities;
+            var stageConditions = this.microscopeController.StageConditions;
+
+            if (stageCapabilities.StageX.CanRead)
+            {
+                this.m_dStageX = stageConditions.StageX;
+            }
+
+            if (stageCapabilities.StageY.CanRead)
+            {
+                this.m_dStageY = stageConditions.StageY;
+            }
+
+            if (stageCapabilities.StageZ.CanRead)
+            {
+                this.m_dStageZ = stageConditions.StageZ;
+            }
+
+            if (stageCapabilities.StageT.CanRead)
+            {
+                this.m_dStageT = stageConditions.StageT;
+            }
+
+            if (stageCapabilities.StageR.CanRead)
+            {
+                this.m_dStageR = stageConditions.StageR;
+            }
+        }
+
+        //电镜控制改变事件
+        private void OnMicroscopeColumnChange(object sender, EventArgs e)
+        {
+            //MessageBox.Show("电镜控制改变ColumnChange");
+
+            ReadMicroscopeColumn();
+        }
+
+        //样品台控制改变事件
+        private void OnMicroscopeStageChange(object sender, EventArgs e)
+        {
+            //MessageBox.Show("样品控制改变StageChange");
+            ReadStage();
+        }
+
+        //列控制连接或断开时的事件
+        private void OnMicroscopeColumnConnected(object sender, EventArgs e)
+        {
+            //MessageBox.Show("电镜控制连接ColumnConnected");
+        }
+
+        //样品台控制连接或断开时的事件
+        private void OnMicroscopeStageConnected(object sender, EventArgs e)
+        {
+            //MessageBox.Show("样品台连接StageConnected");
+            ReadStage();
+        }
+
+        //样品台控制、电镜控制、外围控制的事件改变完成
+        private void OnMicroscopeChangeCompleted(object sender, EventArgs e)
+        {
+            //MessageBox.Show("电镜控制完成ChangeCompleted");
+            ReadMicroscopeColumn();
+            ReadStage();
+        }
+
+        //电镜控制
+        //电压
+        //放大倍数
+        //工作距离
+        //亮度
+        //对比度
+        //BeamOn
+        //FilamentOn
+
+        //缩放
+        public float GetMagnification()
+        {
+            return (float)m_dMagnification;
+        }
+        public Boolean SetMagnification(float set)
+        {
+            Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
+            {
+                { Column.Magnification, (double)set }
+
+            };
+
+            this.microscopeController.SetColumnConditions(columnDictionary);
+            return true;
+        }
+
+        //焦距
+        public float GetWorkingDistance()
+        {
+            return (float)m_dWorkingDistance;
+        }
+        public Boolean SetWorkingDistance(float set)
+        {
+            Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
+            {
+                { Column.WorkingDistance, (double)set }
+
+            };
+
+            this.microscopeController.SetColumnConditions(columnDictionary);
+            return true;
+        }
+
+        //亮度
+        public float GetBrightness()
+        {
+            return (float)m_dBirghtness;
+        }
+        public Boolean SetBrightness(float set)
+        {
+            Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
+            {
+                { Column.Brightness, (double)set }
+
+            };
+
+            this.microscopeController.SetColumnConditions(columnDictionary);
+            return true;
+        }
+
+        //对比度
+        public float GetContrast()
+        {
+            return (float)m_dContrast;
+        }
+        public Boolean SetContrast(float set)
+        {
+            Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
+            {
+                { Column.Contrast, (double)set }
+
+            };
+
+            this.microscopeController.SetColumnConditions(columnDictionary);
+
+            return true;
+        }
+
+        //SEM电压
+        public float GetSEMVoltage()
+        {
+            return (float)m_dHighVoltage;
+        }
+        public Boolean SetSEMVoltage(float set)
+        {
+            Dictionary<Column, double> columnDictionary = new Dictionary<Column, double>
+            {
+                { Column.HighVoltage, (double)set }
+
+            };
+
+            this.microscopeController.SetColumnConditions(columnDictionary);
+            return true;
+        }
+
+        //样品台
+        public float[] GetStagePosition()
+        {
+            float[] ret = new float[5];
+
+            ret[0] = (float)m_dStageX;
+            ret[1] = (float)m_dStageY;
+            ret[2] = (float)m_dStageZ;
+            ret[3] = (float)m_dStageT;
+            ret[4] = (float)m_dStageR;
+
+            return ret;
+        }
+        public Boolean SetStagePosition(float[] set)
+        {
+            double stageX = (double)set[0];
+            if (stageX > StageXMax || stageX < StageXMin)
+            {
+                return false;
+            }
+            double stageY = (double)set[1];
+            if (stageY > StageYMax || stageY < StageYMin)
+            {
+                return false;
+            }
+            double stageZ = (double)set[2];
+            if (stageZ > StageZMax || stageZ < StageZMin)
+            {
+                return false;
+            }
+            double stageT = (double)set[3];
+            if (stageT > StageTMax || stageT < StageTMin)
+            {
+                return false;
+            }
+            double stageR = (double)set[4];
+            if (stageR > StageRMax || stageR < StageRMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageX, (double)stageX },
+                { Stage.StageY, (double)stageY },
+                { Stage.StageZ, (double)stageZ },
+                { Stage.StageT, (double)stageT },
+                { Stage.StageR, (double)stageR }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        public float GetStageAtX()
+        {
+            return (float)m_dStageX;
+        }
+        public float GetStageAtY()
+        {
+            return (float)m_dStageY;
+        }
+        public float GetStageAtZ()
+        {
+            return (float)m_dStageZ;
+        }
+        public float GetStageAtT()
+        {
+            return (float)m_dStageT;
+        }
+        public float GetStageAtR()
+        {
+            return (float)m_dStageR;
+        }
+
+        public Boolean SetStageGotoX(float set)
+        {
+            double stageX = (double)set;
+            if (stageX > StageXMax || stageX < StageXMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageX, (double)stageX }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        public Boolean SetStageGotoY(float set)
+        {
+
+            double stageY = (double)set;
+            if (stageY > StageYMax || stageY < StageYMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageY, (double)stageY }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        public Boolean SetStageGotoZ(float set)
+        {
+            double stageZ = (double)set;
+            if (stageZ > StageZMax || stageZ < StageZMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageZ, (double)stageZ }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        public Boolean SetStageGotoT(float set)
+        {
+            double stageT = (double)set;
+            if (stageT > StageTMax || stageT < StageTMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageT, (double)stageT }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        public Boolean SetStageGotoR(float set)
+        {
+            double stageR = (double)set;
+            if (stageR > StageRMax || stageR < StageRMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageR, (double)stageR }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        public Boolean MoveStageXY(float x, float y)
+        {
+            double stageX = (double)x;
+            if (stageX > StageXMax || stageX < StageXMin)
+            {
+                return false;
+            }
+            double stageY = (double)y;
+            if (stageY > StageYMax || stageY < StageYMin)
+            {
+                return false;
+            }
+
+            var stageDictionary = new Dictionary<Stage, double>
+            {
+                { Stage.StageX, (double)stageX },
+                { Stage.StageY, (double)stageY }
+            };
+
+            this.microscopeController.SetStageConditions(stageDictionary);
+            return true;
+        }
+        #endregion
+
+        #region 拍图
+        /// <summary>
+        /// IImageAcquisitionController object
+        /// </summary>
+        private IImageAcquisitionController imageAcquisitionController = null;
+
+        /// <summary>
+        /// IImageSettings object
+        /// </summary>
+        private IImageAcquisitionSettings imageAcquisitionSettings = null;
+
+        //图像扫描尺寸
+        public double[] ImageScanSize =
+        {
+            32,
+            64,
+            128,
+            256,
+            512,
+            1024,
+            4096,
+            8192
+        };
+
+        private byte[] m_ImageBit = null;
+        private long m_nImageWidth = 0;
+        private long m_nImageHeight = 0;
+        bool m_bAcquistionDone = false;
+        private Bitmap m_Bitmap = null;
+
+
+        void InitImageAcquisition()
+        {
+            imageAcquisitionController = AcquireFactory.CreateImageServer();
+            imageAcquisitionSettings = AcquireFactory.CreateImageSettings();
+
+            imageAcquisitionController.ExperimentStarted += this.OnImageExperimentStarted;
+            imageAcquisitionController.ExperimentFinished += this.OnImageExperimentFinished;
+
+        }
+
+        //控制电镜释放
+        void CloseImageAcquisition()
+        {
+            imageAcquisitionController.ExperimentStarted -= this.OnImageExperimentStarted;
+            imageAcquisitionController.ExperimentFinished -= this.OnImageExperimentFinished;
+        }
+
+        /// <summary>
+        /// OnImageExperimentStarted
+        /// </summary>
+        private void OnImageExperimentStarted(object sender, AcquisitionStartedEventArgs<IElectronImage[]> e)
+        {
+        }
+
+        //int m_nState;
+        /// <summary>
+        /// OnImageExperimentFinished
+        /// </summary>
+        private void OnImageExperimentFinished(object sender, AcquisitionFinishedEventArgs<IElectronImage[]> e)
+        {
+            IElectronImage electronImage = e.Value[0];
+
+            if (!ReadImageData(electronImage, out m_ImageBit, out m_nImageWidth, out m_nImageHeight))
+            {
+                MessageBox.Show("图像采集完成,获取图像像素失败!");
+            }
+
+            if (m_ImageBit != null && m_ImageBit.Length == m_nImageWidth * m_nImageHeight)
+            {
+                m_bAcquistionDone = true;
+            }
+        }
+
+
+        bool ReadImageData(IElectronImage a_electronImage, out Byte[] a_pImageBits, out long a_nImageHeight, out long a_nImageWidth)
+        {
+            a_nImageHeight = 0;
+            a_nImageWidth = 0;
+            a_pImageBits = null;
+
+            if (a_electronImage == null)
+            {
+                return false;
+            }
+
+            a_nImageHeight = a_electronImage.Height;
+            a_nImageWidth = a_electronImage.Width;
+
+            int nBytesPerPixel = a_electronImage.BytesPerPixel;
+            long nImageSize = a_nImageHeight * a_nImageWidth;
+            long nBufferSize = nImageSize * nBytesPerPixel;
+
+            Byte[] imageData = new Byte[nBufferSize];
+            a_electronImage.GetData(imageData);
+
+            a_pImageBits = new Byte[nImageSize];
+            // default, oxford will return short image, we need to convert to byte
+            if (nBytesPerPixel == 2)
+            {
+                int nBSEValue = 0;
+                for (int i = 0; i < nImageSize; ++i)
+                {
+                    nBSEValue = imageData[0 + i * nBytesPerPixel] + imageData[1 + i * nBytesPerPixel] * 255;
+                    a_pImageBits[i] = (Byte)(nBSEValue / 128.0 + 0.5);
+                }
+            }
+            else
+            {
+                string msg = string.Format("image byte per pixel other than 2({0}), image convert may wrong", nBytesPerPixel);
+                MessageBox.Show(msg);
+
+                int nOffset = nBytesPerPixel - 1;
+                for (int i = 0; i < nImageSize; ++i)
+                {
+                    a_pImageBits[i] = imageData[nOffset + i * nBytesPerPixel];
+                }
+            }
+
+            return true;
+        }
+
+        void AcquisitionParamInit()
+        {
+            m_ImageBit = null;
+            m_nImageWidth = 0;
+            m_nImageHeight = 0;
+            m_bAcquistionDone = false;
+            Bitmap m_Bitmap = null;
+        }
+
+        //a_dDwellTime : 1~100000之间的数 
+        //a_sImageType : 1: SE, 2: Bse
+        //a_dImageScanSize : 图像分辨率,图像的高
+        public bool SetImageAcquistionSetting(double a_dDwellTime, int a_nImageType, double a_dImageScanSize)
+        {
+            IImageSettings imageSettings = imageAcquisitionSettings.ImageSettings;
+            IImageCapabilities imageCapabilities = imageAcquisitionSettings.ImageCapabilities;
+            IImageScanSettings scanSettings = imageAcquisitionSettings.ScanSettings;
+
+
+            if (a_dDwellTime > imageCapabilities.MaximumImageDwellMicroseconds)
+            {
+                imageSettings.DwellTimeMicroSeconds = imageCapabilities.MaximumImageDwellMicroseconds;
+            }
+
+            if (a_dDwellTime < imageCapabilities.MinimumImageDwellMicroseconds)
+            {
+                imageSettings.DwellTimeMicroSeconds = imageCapabilities.MinimumImageDwellMicroseconds;
+            }
+            else
+            {
+                imageSettings.DwellTimeMicroSeconds = a_dDwellTime;
+            }
+
+            imageSettings.InputSources.ToList().ForEach(i => imageSettings.EnableInputSource(i.Key, false));
+            imageSettings.EnableInputSource((ImageInputSources)a_nImageType, true);
+
+            if (!ImageScanSize.Contains(a_dImageScanSize))
+            {
+                MessageBox.Show("图像尺寸输入无效");
+                return false;
+            }
+
+            var pixelSize = 1d / a_dImageScanSize;
+
+            scanSettings.AcquisitionRegion.CreateFullFieldRegion(pixelSize);
+
+            return true;
+        }
+
+        ////拍图
+        public Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type)
+        {
+
+            AcquisitionParamInit();
+
+            try
+            {
+                IEnumerable<IElectronImage> images = imageAcquisitionController.StartAcquisition(imageAcquisitionSettings);
+                images.ToList().ForEach(i =>
+                {
+                    i.Label = string.Format(@"Code example image - {0:HH:mm:ss} - {1}", DateTime.Now, i.InputSource.ToString());
+                });
+
+                while (true)
+                {
+                    if (m_bAcquistionDone)
+                    {
+                        // 图像对象
+                        m_Bitmap = ToGrayBitmap(m_ImageBit, (int)m_nImageHeight, (int)m_nImageWidth);
+                        switch (Path.GetExtension(filename))
+                        {
+                            case ".bmp":
+                                m_Bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Bmp);
+                                break;
+                            case ".jpg":
+                                m_Bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
+                                break;
+                            case ".gif":
+                                m_Bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Gif);
+                                break;
+                            case ".tif":
+                                m_Bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Tiff);
+                                break;
+                            case ".png":
+                                m_Bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
+                                break;
+                            default:
+                                break;
+                        }
+                        break;
+                    }
+                }
+            }
+            catch (InvalidSettingsException settingsException)
+            {
+                var sb = new StringBuilder(@"Invalid settings have been supplied: ");
+                sb.AppendLine();
+                settingsException.ValidationResults.ValidationErrors.ToList().ForEach(ve => sb.AppendFormat("{0}{1}", Environment.NewLine, ve));
+
+                MessageBox.Show(sb.ToString());
+            }
+            catch (AcquisitionStartException startException)
+            {
+                string msg = string.Format(@"AcquisitionStartException: {0}", startException.Message);
+                MessageBox.Show(msg);
+            }
+
+            return true;
+        }
+
+        /// <summary>    
+        /// 将一个byte的数组转换为8bit灰度位图
+        /// </summary>    
+        /// <param name="data">数组</param>    
+        /// <param name="width">图像宽度</param>    
+        /// <param name="height">图像高度</param>    
+        /// <returns>位图</returns>    
+        Bitmap ToGrayBitmap(byte[] data, int width, int height)
+        {
+            // 申请目标位图的变量,并将其内存区域锁定    
+            Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed);
+            //BitmapData这部分内容  需要 using System.Drawing.Imaging;  
+            BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height),
+            ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
+
+            // 获取图像参数    
+            // 扫描线的宽度   
+            int stride = bmpData.Stride;
+            // 显示宽度与扫描线宽度的间隙  
+            int offset = stride - width;
+            // 获取bmpData的内存起始位置
+            IntPtr iptr = bmpData.Scan0;
+            // 用stride宽度,表示这是内存区域的大小
+            int scanBytes = stride * height;
+
+            // 下面把原始的显示大小字节数组转换为内存中实际存放的字节数组    
+            int posScan = 0;
+            int posReal = 0;// 分别设置两个位置指针,指向源数组和目标数组    
+            byte[] pixelValues = new byte[scanBytes];  //为目标数组分配内存    
+
+            for (int x = 0; x < height; x++)
+            {
+                int startIndex = x * width;
+                //// 下面的循环节是模拟行扫描    
+                for (int y = 0; y < width; y++)
+                {
+                    pixelValues[posScan++] = data[posReal++];
+                }
+                posScan += offset;  //行扫描结束,要将目标位置指针移过那段“间隙”    
+            }
+            // 用Marshal的Copy方法,将刚才得到的内存字节数组复制到BitmapData中    
+            System.Runtime.InteropServices.Marshal.Copy(pixelValues, 0, iptr, scanBytes);
+            bmp.UnlockBits(bmpData);  // 解锁内存区域    
+
+            // 下面的代码是为了修改生成位图的索引表,从伪彩修改为灰度    
+            ColorPalette tempPalette;
+            using (Bitmap tempBmp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
+            {
+                tempPalette = tempBmp.Palette;
+            }
+            for (int i = 0; i < 256; i++)
+            {
+                tempPalette.Entries[i] = Color.FromArgb(i, i, i);
+            }
+            bmp.Palette = tempPalette;
+
+            return bmp;
+        }
+        //获取分辨率
+        public int[] GetImageStore()
+        {
+            int[] ImageStore = new int[8];
+
+            for (int i = 0; i < 8; i++)
+            {
+                ImageStore[i] = (int)ImageScanSize[i];
+            }
+
+            return ImageStore;
+        }
+        //设置分辨率
+        public Boolean SetImageStore(float set)
+        {
+            IImageScanSettings scanSettings = imageAcquisitionSettings.ScanSettings;
+
+            if (!ImageScanSize.Contains(set))
+            {
+                MessageBox.Show("图像尺寸输入无效");
+                return false;
+            }
+
+            var pixelSize = 1d / (double)set;
+
+            scanSettings.AcquisitionRegion.CreateFullFieldRegion(pixelSize);
+
+            return true;
+        }
+
+        public Bitmap GetBitmap()
+        {
+            return m_Bitmap;
+        }
+        #endregion
+
+        #region X-ray
+        //控制器
+        private IEdSpectrumAcquisitionController EdSpectrumAcquisitionController = null;
+        private IEdSpectrumSettings EdSpectrumSettings = null;
+        private IEdSpectrumProcessing EdSpectrumProcessing = null;
+        // Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
+        private IAutoIdSettings autoIdSettings = null;
+        private ISEMQuantSettings settings = null;
+
+        private int XRayChannelLength = 2000;
+        private long[] m_XrayData = null;
+        private bool m_bXrayDone = false;
+        /// <summary>
+        /// List of EdSpectrum objects
+        /// </summary>
+        private Dictionary<string, double> listElement = null;
+
+        void InitXrayAcquistion()
+        {
+            EdSpectrumSettings = AcquireFactory.CreateEdSpectrumSettings();
+            EdSpectrumAcquisitionController = AcquireFactory.CreateEdSpectrumServer();
+            EdSpectrumProcessing = ProcessingFactory.CreateSpectrumProcessing();
+            // Use the autoIdSettings to define elements that are known or elements that you want to exclude. They also list elements that cannot be identified
+            autoIdSettings = ProcessingFactory.CreateAutoIdSettings();
+            settings = ProcessingFactory.CreateSEMQuantSettings();
+
+            EdSpectrumAcquisitionController.ExperimentFinished += this.OnEdSpectrumExperimentFinished;
+            //EdSpectrumAcquisitionController.ExperimentStarted += this.OnEdSpectrumExperimentStarted;
+        }
+
+        void CloaseXrayAcquistion()
+        {
+            EdSpectrumAcquisitionController.ExperimentFinished -= this.OnEdSpectrumExperimentFinished;
+            //EdSpectrumAcquisitionController.ExperimentStarted -= this.OnEdSpectrumExperimentStarted;
+        }
+
+        void SetXrayAcquisitionParam()
+        {
+            EdSpectrumSettings.EdSettings.AcquisitionMode = EdAcquireMode.LiveTime; // RealTime or LiveTime
+            EdSpectrumSettings.EdSettings.AcquisitionTime = TimeSpan.FromMilliseconds(200);
+
+            EdSpectrumSettings.EdSettings.ProcessTime = 1;
+            EdSpectrumSettings.EdSettings.EnergyRange = 20;
+            EdSpectrumSettings.EdSettings.NumberOfChannels = 4096;
+
+            EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateFullFieldRegion(1.0 / 1024.0);
+        }
+
+        void SetPointAcquistionRegion(int a_nX, int a_nY)
+        {
+            Chord chord = new Chord(a_nX, a_nY, 1);
+            List < Chord > chords = new List < Chord> ();
+            chords.Add(chord);
+
+            ChordList chordsList = null;
+            if (m_nImageWidth != 0)
+            {
+                chordsList = new ChordList(chords, 1 / (double)m_nImageWidth);
+            }
+            else
+            {
+                chordsList = new ChordList(chords, 1 / 1024.0);
+            }
+            EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateChordListRegion(chordsList);
+        }
+
+        void SetAreaAcquistionRegion(List<Chord> a_nChords)
+        {
+            ChordList chordsList = null;
+            if (m_nImageWidth != 0)
+            {
+                chordsList = new ChordList(a_nChords, 1 / (double)m_nImageWidth);
+            }
+            else
+            {
+                chordsList = new ChordList(a_nChords, 1 / 1024.0);
+            }
+            EdSpectrumSettings.ScanSettings.AcquisitionRegion.CreateChordListRegion(chordsList);
+        }
+
+
+        void XrayParamInit()
+        {
+            m_XrayData = null;
+            m_bXrayDone = false;
+        }
+
+
+        /// <summary>
+        /// Called when IEdSpectrumAcquisitionController Experiment Starting.
+        /// </summary>
+        /// <param name="sender">The sender.</param>
+        /// <param name="e">The <see cref="AcquisitionFinishedEventArgs{IEdSpectrum}"/> instance containing the event data.</param>
+        private void OnEdSpectrumExperimentStarting(object sender, AcquisitionStartingEventArgs<IEdSpectrum> e)
+        {
+            
+        }
+
+        /// <summary>
+        /// Called when IEdSpectrumAcquisitionController Experiment Started.
+        /// </summary>
+        /// <param name="sender">The sender.</param>
+        /// <param name="e">The <see cref="AcquisitionFinishedEventArgs{IEdSpectrum}"/> instance containing the event data.</param>
+        private void OnEdSpectrumExperimentStarted(object sender, AcquisitionStartedEventArgs<IEdSpectrum> e)
+        {            
+        }
+
+        /// <summary>
+        /// Called when IEdSpectrumAcquisitionController Experiment Finished
+        /// </summary>
+        /// <param name="sender">sender object</param>
+        /// <param name="e">The instance containing the event data.</param>
+        private void OnEdSpectrumExperimentFinished(object sender, AcquisitionFinishedEventArgs<IEdSpectrum> e)
+        {
+            IEdSpectrumAcquisitionController edSpectrumAcquisitionController = sender as IEdSpectrumAcquisitionController;
+
+            if (edSpectrumAcquisitionController != null)
+            {
+                // This only used for multiple acquisition:
+                //      If this is the last experiment, call EndMultipleAcquisition on the Acquisition 
+                //      controller, to re-enable external scan switching
+                edSpectrumAcquisitionController.EndMultipleAcquisition();                
+            }
+
+            IEdSpectrum edSpectrum = e.Value;
+
+            if (!ReadXrayData(edSpectrum, out m_XrayData, XRayChannelLength))
+            {
+                MessageBox.Show("Xray采集完成,获取图像像素失败!");
+            }
+
+            //Quantify processing
+            
+            EdSpectrumProcessing.IdentifyElements(e.Value, autoIdSettings);
+            // While it is possible to choose other elements, Oxygen is the only supported element by stoichiometry.
+            settings.CombinedElement = 8;
+            settings.Normalised = true;
+            ISEMQuantStatus quantStatus = EdSpectrumProcessing.SEMQuantifySpectrum(e.Value, settings);//(a_nChannelData, OIHelper::SEMQuantSettings);
+            IEnumerable < ISEMQuantResult > Results = quantStatus.Results;
+
+            //Get element result for single point
+            var ie = Results.GetEnumerator();
+
+            listElement = new Dictionary<string, double>();
+
+            while (ie.MoveNext())
+            {
+                ISEMQuantResult result = ie.Current;
+
+                if (result.WeightPercent != 0)
+                {
+                    listElement.Add(ElementProperties.GetElementSymbol(result.AtomicNumber), result.WeightPercent );
+                }
+            }
+
+            if (m_XrayData != null && m_XrayData.Length == XRayChannelLength)
+            {
+                m_bXrayDone = true;
+            }
+
+        }
+
+        bool ReadXrayData(IEdSpectrum a_spectrum, out long[] a_pSpectrumData, int a_nBufferSize)
+        {
+            a_pSpectrumData = new long[a_nBufferSize];
+
+            int[] xrayData = new int[a_spectrum.NumberOfChannels];
+            a_spectrum.GetChannelData(xrayData);
+
+            double dZeroChannelValue = a_spectrum.ZeroChannelValue;
+
+            int nChannelStart = 0;
+            if (dZeroChannelValue < 0)  // zero channel value should less than zero
+            {
+                nChannelStart = (int)(-dZeroChannelValue / a_spectrum.ChannelWidth + 0.5);
+            }
+
+            int nDataLength = (int)(a_spectrum.EnergyRange * 1000 / a_spectrum.ChannelWidth + 0.5);
+
+            double dStep1 = 1.0 / nDataLength;
+            double dStep2 = 1.0 / a_nBufferSize;
+
+            for (int i = 0; i < nDataLength; ++i)
+            {
+                int nValue = xrayData[i + nChannelStart] > 0 ? xrayData[i + nChannelStart] : 0;
+
+                double dBinPos = i * dStep1;
+
+                long nLeftBin = (long)(dBinPos / dStep2);
+
+                // calculate % into left bin
+                double dLeft_Percent = (double)(nLeftBin + 1) - dBinPos / dStep2; // ((nLeftBin + 1)*dStep2 - dBinPos)/dStep2
+
+                // calculate data into the left bin
+                long nValueToLeftBin = (long)((double)nValue * dLeft_Percent + 0.5);
+
+                // put data into bins
+                a_pSpectrumData[nLeftBin] += nValueToLeftBin;
+                if ((nLeftBin + 1) < (long)a_nBufferSize)
+                {
+                    a_pSpectrumData[nLeftBin + 1] += (nValue - nValueToLeftBin);
+                }
+            }
+
+            return true;
+        }
+        /// <summary>
+        /// Called when IEdSpectrum DataChanged
+        /// </summary>
+        /// <param name="sender">Event source</param>
+        /// <param name="e">Event arguments</param>
+        private void OnDataChanged(object sender, EventArgs e)
+        {            
+        }
+
+        //点扫描
+        //X-ray
+        public Boolean XrayPointCollectiong(int x, int y, out long[] XrayData, out Dictionary<string, double> a_listElement)
+        {
+            XrayParamInit();
+
+            XrayData = new long[XRayChannelLength];
+            a_listElement = new Dictionary<string, double>();
+
+            SetXrayAcquisitionParam();
+            SetPointAcquistionRegion(x, y);
+           
+            // IEdSpectrumSettings.EdCapabilities will validate settings and hardware availability.
+            if (EdSpectrumAcquisitionController.IsEdHardwareReady(EdSpectrumSettings))
+            {
+                // This only used for multiple acquisition:
+                //      if this is the first acquisition, call BeginMultipleAcquisition 
+                //      on the IEdSpectrumAcquisitionController to suppress external scan switching
+                EdSpectrumAcquisitionController.BeginMultipleAcquisition();
+
+                // Start spectrum acquisition
+                try
+                {
+                    IEdSpectrum edSpectrum = EdSpectrumAcquisitionController.StartAcquisition(EdSpectrumSettings);
+                    edSpectrum.Label = string.Format(@"Point({0},{1})",x,y);
+
+                    while (true)
+                    {
+                        if (m_bXrayDone)
+                        {
+                            XrayData = m_XrayData;
+                            a_listElement =listElement;
+                            
+                            break;
+                        }
+                    }
+                }
+                catch (InvalidSettingsException invalidSettingsException)
+                {
+                    string msg = string.Format(@"Invalid Settings Exception:{0}, {1}",
+                        invalidSettingsException.Message,
+                        invalidSettingsException.ValidationResults.ValidationErrors);
+                    MessageBox.Show(msg);
+                }
+                catch (AcquisitionStartException acquisitionStartException)
+                {
+                    string msg = string.Format(@"Acquisition Start Exception:{0}",acquisitionStartException.Message);
+                    MessageBox.Show(msg);
+                }
+            }
+
+
+
+            return true;
+        }
+        //面扫描
+        public Boolean XrayAreaCollectiong(List<Segment> a_listChord, out long[] XrayData, out Dictionary<string, double> a_listElement)
+        {
+            XrayParamInit();
+
+            XrayData = new long[XRayChannelLength];
+            a_listElement = new Dictionary<string, double>();
+
+            SetXrayAcquisitionParam();
+            List<Chord> Chords = new List<Chord>();
+
+            foreach (Segment seg in a_listChord)
+            {
+                Chord chord = new Chord(seg.X, seg.Y, seg.Length);
+                Chords.Add(chord);
+            }
+            SetAreaAcquistionRegion(Chords);
+
+            // IEdSpectrumSettings.EdCapabilities will validate settings and hardware availability.
+            if (EdSpectrumAcquisitionController.IsEdHardwareReady(EdSpectrumSettings))
+            {
+                // This only used for multiple acquisition:
+                //      if this is the first acquisition, call BeginMultipleAcquisition 
+                //      on the IEdSpectrumAcquisitionController to suppress external scan switching
+                EdSpectrumAcquisitionController.BeginMultipleAcquisition();
+
+                // Start spectrum acquisition
+                try
+                {
+                    IEdSpectrum edSpectrum = EdSpectrumAcquisitionController.StartAcquisition(EdSpectrumSettings);
+                    edSpectrum.Label = string.Format(@"chord");
+
+                    while (true)
+                    {
+                        if (m_bXrayDone)
+                        {
+                            XrayData = m_XrayData;
+                            a_listElement = listElement;
+                            break;
+                        }
+                    }
+                }
+                catch (InvalidSettingsException invalidSettingsException)
+                {
+                    string msg = string.Format(@"Invalid Settings Exception:{0}, {1}",
+                        invalidSettingsException.Message,
+                        invalidSettingsException.ValidationResults.ValidationErrors);
+                    MessageBox.Show(msg);
+                }
+                catch (AcquisitionStartException acquisitionStartException)
+                {
+                    string msg = string.Format(@"Acquisition Start Exception:{0}", acquisitionStartException.Message);
+                    MessageBox.Show(msg);
+                }
+            }
+
+            return true;
+        }
+
+
+        #endregion
+
+    }
+}

+ 89 - 0
ExtenderControl/Extender.csproj

@@ -0,0 +1,89 @@
+<?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>{F5092F52-1FBD-4882-BB9C-399809D87779}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Extender</RootNamespace>
+    <AssemblyName>Extender</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="OINA.Extender, Version=4.2.0.0, Culture=neutral, PublicKeyToken=5efad68c95e0364e, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\OINA.Extender.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <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="Extender.cs" />
+    <Compile Include="ExtenderInterface.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\apidsp_windows.dll">
+      <Link>apidsp_windows.dll</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\apidsp_windows_x64.dll">
+      <Link>apidsp_windows_x64.dll</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\hasp_net_windows.dll">
+      <Link>hasp_net_windows.dll</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\hasp_windows_50590.dll">
+      <Link>hasp_windows_50590.dll</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\hasp_windows_x64_50590.dll">
+      <Link>hasp_windows_x64_50590.dll</Link>
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\OINA.SNSLicenseProvider.dll">
+      <Link>OINA.SNSLicenseProvider.dll</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\x64\OINA.Ipp.dll">
+      <Link>x64\OINA.Ipp.dll</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="C:\Program Files (x86)\Oxford Instruments NanoAnalysis\Extender\x86\OINA.Ipp.dll">
+      <Link>x86\OINA.Ipp.dll</Link>
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 145 - 0
ExtenderControl/ExtenderInterface.cs

@@ -0,0 +1,145 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+
+namespace Extender
+{
+    public sealed class ExtenderInterface
+    {
+        //只读的静态成员
+        private static readonly ExtenderInterface instance = new ExtenderInterface();
+
+        // Explicit static constructor to tell C# compiler
+        // not to mark type as beforefieldinit
+        //C#的静态构造函数只有在当其类的实例被创建或者有静态成员被引用时执行,
+        //在整个应用程序域中只会被执行一次。
+        static ExtenderInterface()
+        {
+        }
+        private ExtenderInterface()
+        {
+        }
+
+        //使用这个实例
+        public static ExtenderInterface Instance
+        {
+            get
+            {
+                return instance;
+            }
+        }
+
+        //其他使用的成员变量
+        private readonly IExtenderControl m_iExtender = new Extender(); //成员变量
+
+        public IExtenderControl IExtender
+        {
+            get { return m_iExtender; }
+        } //属性,只能当前类创建         
+    }
+
+    public class Segment
+    {
+        private int m_nX;
+        private int m_nY;
+        private int m_nLength;
+
+        public int X
+        {
+            get { return m_nX; }
+            set {
+                if (m_nX > 0)
+                {
+                    m_nX = value;
+                }
+            }
+        }
+
+        public int Y
+        {
+            get { return m_nY; }
+            set
+            {
+                if (m_nY > 0)
+                {
+                    m_nY = value;
+                }
+            }
+        }
+
+        public int Length
+        {
+            get { return m_nLength; }
+            set
+            {
+                if (m_nLength > 0)
+                {
+                    m_nLength = value;
+                }
+            }
+        }
+    };
+
+
+    //Extender控制
+    public interface IExtenderControl
+    {
+
+        //缩放
+        float GetMagnification();
+        Boolean SetMagnification(float set);
+
+        //焦距
+        float GetWorkingDistance();
+        Boolean SetWorkingDistance(float set);
+        
+        //亮度
+        float GetBrightness();
+        Boolean SetBrightness(float set);
+
+        //对比度
+        float GetContrast();
+        Boolean SetContrast(float set);
+
+        //SEM电压
+        float GetSEMVoltage();
+        Boolean SetSEMVoltage(float set);
+
+        //样品台        
+        float[] GetStagePosition();
+        Boolean SetStagePosition(float[] set);
+        float GetStageAtX();
+        float GetStageAtY();
+        float GetStageAtZ();
+        float GetStageAtT();
+        float GetStageAtR();        
+        Boolean SetStageGotoX(float set);
+        Boolean SetStageGotoY(float set);
+        Boolean SetStageGotoZ(float set);
+        Boolean SetStageGotoT(float set);
+        Boolean SetStageGotoR(float set);
+        Boolean MoveStageXY(float x, float y);
+
+        //拍图
+        Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type);
+        //采集参数设置
+        Boolean SetImageAcquistionSetting(double a_dDwellTime, int a_nImageType, double a_dImageScanSize);
+
+        //获取分辨率
+        int[] GetImageStore();
+        //设置分辨率
+        Boolean SetImageStore(float set);
+        //获取bitmap
+        Bitmap GetBitmap();
+
+        //X-ray
+        //点采集
+        Boolean XrayPointCollectiong(int x, int y, out long[] XrayData, out Dictionary<string, double> a_listElement);        
+
+        //面采集
+        Boolean XrayAreaCollectiong(List<Segment> a_listChord, out long[] XrayData, out Dictionary<string, double> a_listElement);
+    }
+}

+ 36 - 0
ExtenderControl/Properties/AssemblyInfo.cs

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

+ 14 - 0
HOZ.sln

@@ -30,6 +30,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebManager", "WebManager\We
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManulDo", "ManulDo\ManulDo.csproj", "{513BBFDA-D2A1-4D4F-ADD0-01A19485533A}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extender", "ExtenderControl\Extender.csproj", "{F5092F52-1FBD-4882-BB9C-399809D87779}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxfordTest", "OxfordTest\OxfordTest.csproj", "{7566397D-632B-4939-8EB6-9AC620EE44F3}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -72,6 +76,14 @@ Global
 		{513BBFDA-D2A1-4D4F-ADD0-01A19485533A}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{513BBFDA-D2A1-4D4F-ADD0-01A19485533A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{513BBFDA-D2A1-4D4F-ADD0-01A19485533A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -86,6 +98,8 @@ Global
 		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E} = {371F2331-83C6-41DB-8D59-9232ECB09801}
 		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5} = {371F2331-83C6-41DB-8D59-9232ECB09801}
 		{513BBFDA-D2A1-4D4F-ADD0-01A19485533A} = {682CF60F-46F7-451A-9887-91C2DCB80B10}
+		{F5092F52-1FBD-4882-BB9C-399809D87779} = {371F2331-83C6-41DB-8D59-9232ECB09801}
+		{7566397D-632B-4939-8EB6-9AC620EE44F3} = {682CF60F-46F7-451A-9887-91C2DCB80B10}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {F291AB01-6941-478D-BA98-1C371698FFAD}

+ 6 - 0
OxfordTest/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>

+ 1090 - 0
OxfordTest/Form1.Designer.cs

@@ -0,0 +1,1090 @@
+namespace OxfordTest
+{
+    partial class Form1
+    {
+        /// <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()
+        {
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.tBHV = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.button1 = new System.Windows.Forms.Button();
+            this.tBHVIn = new System.Windows.Forms.TextBox();
+            this.button2 = new System.Windows.Forms.Button();
+            this.label9 = new System.Windows.Forms.Label();
+            this.tBWD = new System.Windows.Forms.TextBox();
+            this.tBMag = new System.Windows.Forms.TextBox();
+            this.tBBright = new System.Windows.Forms.TextBox();
+            this.tBContast = new System.Windows.Forms.TextBox();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label11 = new System.Windows.Forms.Label();
+            this.label12 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.button3 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
+            this.button5 = new System.Windows.Forms.Button();
+            this.button6 = new System.Windows.Forms.Button();
+            this.tBWDIn = new System.Windows.Forms.TextBox();
+            this.tBMagIn = new System.Windows.Forms.TextBox();
+            this.tBrightIn = new System.Windows.Forms.TextBox();
+            this.tBContrastIn = new System.Windows.Forms.TextBox();
+            this.label14 = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.label17 = new System.Windows.Forms.Label();
+            this.button7 = new System.Windows.Forms.Button();
+            this.button8 = new System.Windows.Forms.Button();
+            this.button9 = new System.Windows.Forms.Button();
+            this.button10 = new System.Windows.Forms.Button();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label18 = new System.Windows.Forms.Label();
+            this.label19 = new System.Windows.Forms.Label();
+            this.label20 = new System.Windows.Forms.Label();
+            this.label21 = new System.Windows.Forms.Label();
+            this.tBX = new System.Windows.Forms.TextBox();
+            this.tBY = new System.Windows.Forms.TextBox();
+            this.tBZ = new System.Windows.Forms.TextBox();
+            this.tBT = new System.Windows.Forms.TextBox();
+            this.tBR = new System.Windows.Forms.TextBox();
+            this.label22 = new System.Windows.Forms.Label();
+            this.label23 = new System.Windows.Forms.Label();
+            this.label24 = new System.Windows.Forms.Label();
+            this.label25 = new System.Windows.Forms.Label();
+            this.label26 = new System.Windows.Forms.Label();
+            this.button11 = new System.Windows.Forms.Button();
+            this.button12 = new System.Windows.Forms.Button();
+            this.button13 = new System.Windows.Forms.Button();
+            this.button14 = new System.Windows.Forms.Button();
+            this.button15 = new System.Windows.Forms.Button();
+            this.tBXIn = new System.Windows.Forms.TextBox();
+            this.tBYIn = new System.Windows.Forms.TextBox();
+            this.tBZIn = new System.Windows.Forms.TextBox();
+            this.tBTIn = new System.Windows.Forms.TextBox();
+            this.tBRIn = new System.Windows.Forms.TextBox();
+            this.label27 = new System.Windows.Forms.Label();
+            this.label28 = new System.Windows.Forms.Label();
+            this.label29 = new System.Windows.Forms.Label();
+            this.label30 = new System.Windows.Forms.Label();
+            this.label31 = new System.Windows.Forms.Label();
+            this.button16 = new System.Windows.Forms.Button();
+            this.button17 = new System.Windows.Forms.Button();
+            this.button18 = new System.Windows.Forms.Button();
+            this.button19 = new System.Windows.Forms.Button();
+            this.button20 = new System.Windows.Forms.Button();
+            this.button21 = new System.Windows.Forms.Button();
+            this.button22 = new System.Windows.Forms.Button();
+            this.button23 = new System.Windows.Forms.Button();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.拍图 = new System.Windows.Forms.GroupBox();
+            this.pBImage = new System.Windows.Forms.PictureBox();
+            this.button24 = new System.Windows.Forms.Button();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.button25 = new System.Windows.Forms.Button();
+            this.button26 = new System.Windows.Forms.Button();
+            this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.元素 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.含量 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.groupBox1.SuspendLayout();
+            this.拍图.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pBImage)).BeginInit();
+            this.groupBox2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(93, 37);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(44, 18);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "高压";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(57, 80);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(80, 18);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "工作距离";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(57, 126);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(80, 18);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "放大倍数";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(93, 169);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(44, 18);
+            this.label6.TabIndex = 5;
+            this.label6.Text = "亮度";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(75, 227);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(62, 18);
+            this.label7.TabIndex = 6;
+            this.label7.Text = "对比度";
+            // 
+            // tBHV
+            // 
+            this.tBHV.Location = new System.Drawing.Point(183, 34);
+            this.tBHV.Name = "tBHV";
+            this.tBHV.ReadOnly = true;
+            this.tBHV.Size = new System.Drawing.Size(100, 28);
+            this.tBHV.TabIndex = 7;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(289, 37);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(26, 18);
+            this.label8.TabIndex = 8;
+            this.label8.Text = "kV";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(336, 27);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 39);
+            this.button1.TabIndex = 9;
+            this.button1.Text = "获取";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // tBHVIn
+            // 
+            this.tBHVIn.Location = new System.Drawing.Point(462, 34);
+            this.tBHVIn.Name = "tBHVIn";
+            this.tBHVIn.Size = new System.Drawing.Size(100, 28);
+            this.tBHVIn.TabIndex = 10;
+            this.tBHVIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(638, 27);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 39);
+            this.button2.TabIndex = 11;
+            this.button2.Text = "设定";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(568, 37);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(26, 18);
+            this.label9.TabIndex = 12;
+            this.label9.Text = "kV";
+            // 
+            // tBWD
+            // 
+            this.tBWD.Location = new System.Drawing.Point(183, 77);
+            this.tBWD.Name = "tBWD";
+            this.tBWD.ReadOnly = true;
+            this.tBWD.Size = new System.Drawing.Size(100, 28);
+            this.tBWD.TabIndex = 13;
+            // 
+            // tBMag
+            // 
+            this.tBMag.Location = new System.Drawing.Point(183, 123);
+            this.tBMag.Name = "tBMag";
+            this.tBMag.ReadOnly = true;
+            this.tBMag.Size = new System.Drawing.Size(100, 28);
+            this.tBMag.TabIndex = 14;
+            // 
+            // tBBright
+            // 
+            this.tBBright.Location = new System.Drawing.Point(183, 166);
+            this.tBBright.Name = "tBBright";
+            this.tBBright.ReadOnly = true;
+            this.tBBright.Size = new System.Drawing.Size(100, 28);
+            this.tBBright.TabIndex = 15;
+            // 
+            // tBContast
+            // 
+            this.tBContast.Location = new System.Drawing.Point(183, 217);
+            this.tBContast.Name = "tBContast";
+            this.tBContast.ReadOnly = true;
+            this.tBContast.Size = new System.Drawing.Size(100, 28);
+            this.tBContast.TabIndex = 16;
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(289, 80);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(26, 18);
+            this.label10.TabIndex = 17;
+            this.label10.Text = "mm";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(289, 126);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(17, 18);
+            this.label11.TabIndex = 18;
+            this.label11.Text = "X";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(289, 169);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(17, 18);
+            this.label12.TabIndex = 19;
+            this.label12.Text = "%";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(289, 220);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(17, 18);
+            this.label13.TabIndex = 20;
+            this.label13.Text = "%";
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(336, 72);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(75, 39);
+            this.button3.TabIndex = 21;
+            this.button3.Text = "获取";
+            this.button3.UseVisualStyleBackColor = true;
+            this.button3.Click += new System.EventHandler(this.button3_Click);
+            // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(336, 116);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(75, 39);
+            this.button4.TabIndex = 22;
+            this.button4.Text = "获取";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click);
+            // 
+            // button5
+            // 
+            this.button5.Location = new System.Drawing.Point(336, 159);
+            this.button5.Name = "button5";
+            this.button5.Size = new System.Drawing.Size(75, 39);
+            this.button5.TabIndex = 23;
+            this.button5.Text = "获取";
+            this.button5.UseVisualStyleBackColor = true;
+            this.button5.Click += new System.EventHandler(this.button5_Click);
+            // 
+            // button6
+            // 
+            this.button6.Location = new System.Drawing.Point(336, 217);
+            this.button6.Name = "button6";
+            this.button6.Size = new System.Drawing.Size(75, 39);
+            this.button6.TabIndex = 24;
+            this.button6.Text = "获取";
+            this.button6.UseVisualStyleBackColor = true;
+            this.button6.Click += new System.EventHandler(this.button6_Click);
+            // 
+            // tBWDIn
+            // 
+            this.tBWDIn.Location = new System.Drawing.Point(462, 77);
+            this.tBWDIn.Name = "tBWDIn";
+            this.tBWDIn.Size = new System.Drawing.Size(100, 28);
+            this.tBWDIn.TabIndex = 25;
+            this.tBWDIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBWDIn_KeyPress);
+            // 
+            // tBMagIn
+            // 
+            this.tBMagIn.Location = new System.Drawing.Point(462, 123);
+            this.tBMagIn.Name = "tBMagIn";
+            this.tBMagIn.Size = new System.Drawing.Size(100, 28);
+            this.tBMagIn.TabIndex = 26;
+            this.tBMagIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBMagIn_KeyPress);
+            // 
+            // tBrightIn
+            // 
+            this.tBrightIn.Location = new System.Drawing.Point(462, 170);
+            this.tBrightIn.Name = "tBrightIn";
+            this.tBrightIn.Size = new System.Drawing.Size(100, 28);
+            this.tBrightIn.TabIndex = 27;
+            this.tBrightIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBrightIn_KeyPress);
+            // 
+            // tBContrastIn
+            // 
+            this.tBContrastIn.Location = new System.Drawing.Point(462, 224);
+            this.tBContrastIn.Name = "tBContrastIn";
+            this.tBContrastIn.Size = new System.Drawing.Size(100, 28);
+            this.tBContrastIn.TabIndex = 28;
+            this.tBContrastIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBContrastIn_KeyPress);
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(568, 227);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(17, 18);
+            this.label14.TabIndex = 32;
+            this.label14.Text = "%";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(568, 176);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(17, 18);
+            this.label15.TabIndex = 31;
+            this.label15.Text = "%";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(568, 133);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(17, 18);
+            this.label16.TabIndex = 30;
+            this.label16.Text = "X";
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(568, 87);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(26, 18);
+            this.label17.TabIndex = 29;
+            this.label17.Text = "mm";
+            // 
+            // button7
+            // 
+            this.button7.Location = new System.Drawing.Point(638, 72);
+            this.button7.Name = "button7";
+            this.button7.Size = new System.Drawing.Size(75, 39);
+            this.button7.TabIndex = 33;
+            this.button7.Text = "设定";
+            this.button7.UseVisualStyleBackColor = true;
+            this.button7.Click += new System.EventHandler(this.button7_Click);
+            // 
+            // button8
+            // 
+            this.button8.Location = new System.Drawing.Point(638, 116);
+            this.button8.Name = "button8";
+            this.button8.Size = new System.Drawing.Size(75, 39);
+            this.button8.TabIndex = 34;
+            this.button8.Text = "设定";
+            this.button8.UseVisualStyleBackColor = true;
+            this.button8.Click += new System.EventHandler(this.button8_Click);
+            // 
+            // button9
+            // 
+            this.button9.Location = new System.Drawing.Point(638, 159);
+            this.button9.Name = "button9";
+            this.button9.Size = new System.Drawing.Size(75, 39);
+            this.button9.TabIndex = 35;
+            this.button9.Text = "设定";
+            this.button9.UseVisualStyleBackColor = true;
+            this.button9.Click += new System.EventHandler(this.button9_Click);
+            // 
+            // button10
+            // 
+            this.button10.Location = new System.Drawing.Point(638, 210);
+            this.button10.Name = "button10";
+            this.button10.Size = new System.Drawing.Size(75, 39);
+            this.button10.TabIndex = 36;
+            this.button10.Text = "设定";
+            this.button10.UseVisualStyleBackColor = true;
+            this.button10.Click += new System.EventHandler(this.button10_Click);
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(17, 291);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(62, 18);
+            this.label4.TabIndex = 37;
+            this.label4.Text = "样品台";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(104, 291);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(17, 18);
+            this.label5.TabIndex = 38;
+            this.label5.Text = "X";
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Location = new System.Drawing.Point(104, 337);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(17, 18);
+            this.label18.TabIndex = 39;
+            this.label18.Text = "Y";
+            // 
+            // label19
+            // 
+            this.label19.AutoSize = true;
+            this.label19.Location = new System.Drawing.Point(104, 382);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(17, 18);
+            this.label19.TabIndex = 40;
+            this.label19.Text = "Z";
+            // 
+            // label20
+            // 
+            this.label20.AutoSize = true;
+            this.label20.Location = new System.Drawing.Point(104, 425);
+            this.label20.Name = "label20";
+            this.label20.Size = new System.Drawing.Size(17, 18);
+            this.label20.TabIndex = 41;
+            this.label20.Text = "T";
+            // 
+            // label21
+            // 
+            this.label21.AutoSize = true;
+            this.label21.Location = new System.Drawing.Point(104, 469);
+            this.label21.Name = "label21";
+            this.label21.Size = new System.Drawing.Size(17, 18);
+            this.label21.TabIndex = 42;
+            this.label21.Text = "R";
+            // 
+            // tBX
+            // 
+            this.tBX.Location = new System.Drawing.Point(183, 281);
+            this.tBX.Name = "tBX";
+            this.tBX.ReadOnly = true;
+            this.tBX.Size = new System.Drawing.Size(100, 28);
+            this.tBX.TabIndex = 43;
+            // 
+            // tBY
+            // 
+            this.tBY.Location = new System.Drawing.Point(183, 334);
+            this.tBY.Name = "tBY";
+            this.tBY.ReadOnly = true;
+            this.tBY.Size = new System.Drawing.Size(100, 28);
+            this.tBY.TabIndex = 44;
+            // 
+            // tBZ
+            // 
+            this.tBZ.Location = new System.Drawing.Point(183, 382);
+            this.tBZ.Name = "tBZ";
+            this.tBZ.ReadOnly = true;
+            this.tBZ.Size = new System.Drawing.Size(100, 28);
+            this.tBZ.TabIndex = 45;
+            // 
+            // tBT
+            // 
+            this.tBT.Location = new System.Drawing.Point(183, 425);
+            this.tBT.Name = "tBT";
+            this.tBT.ReadOnly = true;
+            this.tBT.Size = new System.Drawing.Size(100, 28);
+            this.tBT.TabIndex = 46;
+            // 
+            // tBR
+            // 
+            this.tBR.Location = new System.Drawing.Point(183, 469);
+            this.tBR.Name = "tBR";
+            this.tBR.ReadOnly = true;
+            this.tBR.Size = new System.Drawing.Size(100, 28);
+            this.tBR.TabIndex = 47;
+            // 
+            // label22
+            // 
+            this.label22.AutoSize = true;
+            this.label22.Location = new System.Drawing.Point(289, 291);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(26, 18);
+            this.label22.TabIndex = 48;
+            this.label22.Text = "mm";
+            // 
+            // label23
+            // 
+            this.label23.AutoSize = true;
+            this.label23.Location = new System.Drawing.Point(289, 344);
+            this.label23.Name = "label23";
+            this.label23.Size = new System.Drawing.Size(26, 18);
+            this.label23.TabIndex = 49;
+            this.label23.Text = "mm";
+            // 
+            // label24
+            // 
+            this.label24.AutoSize = true;
+            this.label24.Location = new System.Drawing.Point(289, 385);
+            this.label24.Name = "label24";
+            this.label24.Size = new System.Drawing.Size(26, 18);
+            this.label24.TabIndex = 50;
+            this.label24.Text = "mm";
+            // 
+            // label25
+            // 
+            this.label25.AutoSize = true;
+            this.label25.Location = new System.Drawing.Point(289, 428);
+            this.label25.Name = "label25";
+            this.label25.Size = new System.Drawing.Size(26, 18);
+            this.label25.TabIndex = 51;
+            this.label25.Text = "mm";
+            // 
+            // label26
+            // 
+            this.label26.AutoSize = true;
+            this.label26.Location = new System.Drawing.Point(289, 472);
+            this.label26.Name = "label26";
+            this.label26.Size = new System.Drawing.Size(26, 18);
+            this.label26.TabIndex = 52;
+            this.label26.Text = "mm";
+            // 
+            // button11
+            // 
+            this.button11.Location = new System.Drawing.Point(336, 274);
+            this.button11.Name = "button11";
+            this.button11.Size = new System.Drawing.Size(75, 39);
+            this.button11.TabIndex = 53;
+            this.button11.Text = "获取";
+            this.button11.UseVisualStyleBackColor = true;
+            this.button11.Click += new System.EventHandler(this.button11_Click);
+            // 
+            // button12
+            // 
+            this.button12.Location = new System.Drawing.Point(336, 327);
+            this.button12.Name = "button12";
+            this.button12.Size = new System.Drawing.Size(75, 39);
+            this.button12.TabIndex = 54;
+            this.button12.Text = "获取";
+            this.button12.UseVisualStyleBackColor = true;
+            this.button12.Click += new System.EventHandler(this.button12_Click);
+            // 
+            // button13
+            // 
+            this.button13.Location = new System.Drawing.Point(336, 371);
+            this.button13.Name = "button13";
+            this.button13.Size = new System.Drawing.Size(75, 39);
+            this.button13.TabIndex = 55;
+            this.button13.Text = "获取";
+            this.button13.UseVisualStyleBackColor = true;
+            this.button13.Click += new System.EventHandler(this.button13_Click);
+            // 
+            // button14
+            // 
+            this.button14.Location = new System.Drawing.Point(336, 416);
+            this.button14.Name = "button14";
+            this.button14.Size = new System.Drawing.Size(75, 39);
+            this.button14.TabIndex = 56;
+            this.button14.Text = "获取";
+            this.button14.UseVisualStyleBackColor = true;
+            this.button14.Click += new System.EventHandler(this.button14_Click);
+            // 
+            // button15
+            // 
+            this.button15.Location = new System.Drawing.Point(336, 462);
+            this.button15.Name = "button15";
+            this.button15.Size = new System.Drawing.Size(75, 39);
+            this.button15.TabIndex = 57;
+            this.button15.Text = "获取";
+            this.button15.UseVisualStyleBackColor = true;
+            this.button15.Click += new System.EventHandler(this.button15_Click);
+            // 
+            // tBXIn
+            // 
+            this.tBXIn.Location = new System.Drawing.Point(462, 281);
+            this.tBXIn.Name = "tBXIn";
+            this.tBXIn.Size = new System.Drawing.Size(100, 28);
+            this.tBXIn.TabIndex = 58;
+            this.tBXIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBXIn_KeyPress);
+            // 
+            // tBYIn
+            // 
+            this.tBYIn.Location = new System.Drawing.Point(462, 334);
+            this.tBYIn.Name = "tBYIn";
+            this.tBYIn.Size = new System.Drawing.Size(100, 28);
+            this.tBYIn.TabIndex = 59;
+            this.tBYIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBYIn_KeyPress);
+            // 
+            // tBZIn
+            // 
+            this.tBZIn.Location = new System.Drawing.Point(462, 378);
+            this.tBZIn.Name = "tBZIn";
+            this.tBZIn.Size = new System.Drawing.Size(100, 28);
+            this.tBZIn.TabIndex = 60;
+            this.tBZIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBZIn_KeyPress);
+            // 
+            // tBTIn
+            // 
+            this.tBTIn.Location = new System.Drawing.Point(462, 418);
+            this.tBTIn.Name = "tBTIn";
+            this.tBTIn.Size = new System.Drawing.Size(100, 28);
+            this.tBTIn.TabIndex = 61;
+            this.tBTIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBTIn_KeyPress);
+            // 
+            // tBRIn
+            // 
+            this.tBRIn.Location = new System.Drawing.Point(462, 462);
+            this.tBRIn.Name = "tBRIn";
+            this.tBRIn.Size = new System.Drawing.Size(100, 28);
+            this.tBRIn.TabIndex = 62;
+            this.tBRIn.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tBRIn_KeyPress);
+            // 
+            // label27
+            // 
+            this.label27.AutoSize = true;
+            this.label27.Location = new System.Drawing.Point(568, 291);
+            this.label27.Name = "label27";
+            this.label27.Size = new System.Drawing.Size(26, 18);
+            this.label27.TabIndex = 63;
+            this.label27.Text = "mm";
+            // 
+            // label28
+            // 
+            this.label28.AutoSize = true;
+            this.label28.Location = new System.Drawing.Point(568, 337);
+            this.label28.Name = "label28";
+            this.label28.Size = new System.Drawing.Size(26, 18);
+            this.label28.TabIndex = 64;
+            this.label28.Text = "mm";
+            // 
+            // label29
+            // 
+            this.label29.AutoSize = true;
+            this.label29.Location = new System.Drawing.Point(568, 378);
+            this.label29.Name = "label29";
+            this.label29.Size = new System.Drawing.Size(26, 18);
+            this.label29.TabIndex = 65;
+            this.label29.Text = "mm";
+            // 
+            // label30
+            // 
+            this.label30.AutoSize = true;
+            this.label30.Location = new System.Drawing.Point(568, 426);
+            this.label30.Name = "label30";
+            this.label30.Size = new System.Drawing.Size(26, 18);
+            this.label30.TabIndex = 66;
+            this.label30.Text = "mm";
+            // 
+            // label31
+            // 
+            this.label31.AutoSize = true;
+            this.label31.Location = new System.Drawing.Point(568, 472);
+            this.label31.Name = "label31";
+            this.label31.Size = new System.Drawing.Size(26, 18);
+            this.label31.TabIndex = 67;
+            this.label31.Text = "mm";
+            // 
+            // button16
+            // 
+            this.button16.Location = new System.Drawing.Point(638, 281);
+            this.button16.Name = "button16";
+            this.button16.Size = new System.Drawing.Size(75, 39);
+            this.button16.TabIndex = 68;
+            this.button16.Text = "设定";
+            this.button16.UseVisualStyleBackColor = true;
+            this.button16.Click += new System.EventHandler(this.button16_Click);
+            // 
+            // button17
+            // 
+            this.button17.Location = new System.Drawing.Point(638, 327);
+            this.button17.Name = "button17";
+            this.button17.Size = new System.Drawing.Size(75, 39);
+            this.button17.TabIndex = 69;
+            this.button17.Text = "设定";
+            this.button17.UseVisualStyleBackColor = true;
+            this.button17.Click += new System.EventHandler(this.button17_Click);
+            // 
+            // button18
+            // 
+            this.button18.Location = new System.Drawing.Point(638, 375);
+            this.button18.Name = "button18";
+            this.button18.Size = new System.Drawing.Size(75, 39);
+            this.button18.TabIndex = 70;
+            this.button18.Text = "设定";
+            this.button18.UseVisualStyleBackColor = true;
+            this.button18.Click += new System.EventHandler(this.button18_Click);
+            // 
+            // button19
+            // 
+            this.button19.Location = new System.Drawing.Point(638, 420);
+            this.button19.Name = "button19";
+            this.button19.Size = new System.Drawing.Size(75, 39);
+            this.button19.TabIndex = 71;
+            this.button19.Text = "设定";
+            this.button19.UseVisualStyleBackColor = true;
+            this.button19.Click += new System.EventHandler(this.button19_Click);
+            // 
+            // button20
+            // 
+            this.button20.Location = new System.Drawing.Point(638, 465);
+            this.button20.Name = "button20";
+            this.button20.Size = new System.Drawing.Size(75, 39);
+            this.button20.TabIndex = 72;
+            this.button20.Text = "设定";
+            this.button20.UseVisualStyleBackColor = true;
+            this.button20.Click += new System.EventHandler(this.button20_Click);
+            // 
+            // button21
+            // 
+            this.button21.Location = new System.Drawing.Point(183, 521);
+            this.button21.Name = "button21";
+            this.button21.Size = new System.Drawing.Size(159, 39);
+            this.button21.TabIndex = 73;
+            this.button21.Text = "获取全部";
+            this.button21.UseVisualStyleBackColor = true;
+            this.button21.Click += new System.EventHandler(this.button21_Click);
+            // 
+            // button22
+            // 
+            this.button22.Location = new System.Drawing.Point(378, 521);
+            this.button22.Name = "button22";
+            this.button22.Size = new System.Drawing.Size(146, 39);
+            this.button22.TabIndex = 74;
+            this.button22.Text = "设定XY";
+            this.button22.UseVisualStyleBackColor = true;
+            this.button22.Click += new System.EventHandler(this.button22_Click);
+            // 
+            // button23
+            // 
+            this.button23.Location = new System.Drawing.Point(571, 521);
+            this.button23.Name = "button23";
+            this.button23.Size = new System.Drawing.Size(142, 39);
+            this.button23.TabIndex = 75;
+            this.button23.Text = "设定全部";
+            this.button23.UseVisualStyleBackColor = true;
+            this.button23.Click += new System.EventHandler(this.button23_Click);
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.button2);
+            this.groupBox1.Controls.Add(this.button23);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.button22);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.button21);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.button20);
+            this.groupBox1.Controls.Add(this.label6);
+            this.groupBox1.Controls.Add(this.button19);
+            this.groupBox1.Controls.Add(this.label7);
+            this.groupBox1.Controls.Add(this.button18);
+            this.groupBox1.Controls.Add(this.tBHV);
+            this.groupBox1.Controls.Add(this.button17);
+            this.groupBox1.Controls.Add(this.label8);
+            this.groupBox1.Controls.Add(this.button16);
+            this.groupBox1.Controls.Add(this.button1);
+            this.groupBox1.Controls.Add(this.label31);
+            this.groupBox1.Controls.Add(this.tBHVIn);
+            this.groupBox1.Controls.Add(this.label30);
+            this.groupBox1.Controls.Add(this.label9);
+            this.groupBox1.Controls.Add(this.label29);
+            this.groupBox1.Controls.Add(this.tBWD);
+            this.groupBox1.Controls.Add(this.label28);
+            this.groupBox1.Controls.Add(this.tBMag);
+            this.groupBox1.Controls.Add(this.label27);
+            this.groupBox1.Controls.Add(this.tBBright);
+            this.groupBox1.Controls.Add(this.tBRIn);
+            this.groupBox1.Controls.Add(this.tBContast);
+            this.groupBox1.Controls.Add(this.tBTIn);
+            this.groupBox1.Controls.Add(this.label10);
+            this.groupBox1.Controls.Add(this.tBZIn);
+            this.groupBox1.Controls.Add(this.label11);
+            this.groupBox1.Controls.Add(this.tBYIn);
+            this.groupBox1.Controls.Add(this.label12);
+            this.groupBox1.Controls.Add(this.tBXIn);
+            this.groupBox1.Controls.Add(this.label13);
+            this.groupBox1.Controls.Add(this.button15);
+            this.groupBox1.Controls.Add(this.button3);
+            this.groupBox1.Controls.Add(this.button14);
+            this.groupBox1.Controls.Add(this.button4);
+            this.groupBox1.Controls.Add(this.button13);
+            this.groupBox1.Controls.Add(this.button5);
+            this.groupBox1.Controls.Add(this.button12);
+            this.groupBox1.Controls.Add(this.button6);
+            this.groupBox1.Controls.Add(this.button11);
+            this.groupBox1.Controls.Add(this.tBWDIn);
+            this.groupBox1.Controls.Add(this.label26);
+            this.groupBox1.Controls.Add(this.tBMagIn);
+            this.groupBox1.Controls.Add(this.label25);
+            this.groupBox1.Controls.Add(this.tBrightIn);
+            this.groupBox1.Controls.Add(this.label24);
+            this.groupBox1.Controls.Add(this.tBContrastIn);
+            this.groupBox1.Controls.Add(this.label23);
+            this.groupBox1.Controls.Add(this.label17);
+            this.groupBox1.Controls.Add(this.label22);
+            this.groupBox1.Controls.Add(this.label16);
+            this.groupBox1.Controls.Add(this.tBR);
+            this.groupBox1.Controls.Add(this.label15);
+            this.groupBox1.Controls.Add(this.tBT);
+            this.groupBox1.Controls.Add(this.label14);
+            this.groupBox1.Controls.Add(this.tBZ);
+            this.groupBox1.Controls.Add(this.button7);
+            this.groupBox1.Controls.Add(this.tBY);
+            this.groupBox1.Controls.Add(this.button8);
+            this.groupBox1.Controls.Add(this.tBX);
+            this.groupBox1.Controls.Add(this.button9);
+            this.groupBox1.Controls.Add(this.label21);
+            this.groupBox1.Controls.Add(this.button10);
+            this.groupBox1.Controls.Add(this.label20);
+            this.groupBox1.Controls.Add(this.label4);
+            this.groupBox1.Controls.Add(this.label19);
+            this.groupBox1.Controls.Add(this.label5);
+            this.groupBox1.Controls.Add(this.label18);
+            this.groupBox1.Location = new System.Drawing.Point(12, 12);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(737, 576);
+            this.groupBox1.TabIndex = 76;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "电镜和样品台控制";
+            // 
+            // 拍图
+            // 
+            this.拍图.Controls.Add(this.pBImage);
+            this.拍图.Controls.Add(this.button24);
+            this.拍图.Location = new System.Drawing.Point(790, 12);
+            this.拍图.Name = "拍图";
+            this.拍图.Size = new System.Drawing.Size(890, 576);
+            this.拍图.TabIndex = 77;
+            this.拍图.TabStop = false;
+            this.拍图.Text = "拍图";
+            // 
+            // pBImage
+            // 
+            this.pBImage.Location = new System.Drawing.Point(6, 77);
+            this.pBImage.Name = "pBImage";
+            this.pBImage.Size = new System.Drawing.Size(878, 493);
+            this.pBImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pBImage.TabIndex = 1;
+            this.pBImage.TabStop = false;
+            // 
+            // button24
+            // 
+            this.button24.Location = new System.Drawing.Point(39, 27);
+            this.button24.Name = "button24";
+            this.button24.Size = new System.Drawing.Size(75, 40);
+            this.button24.TabIndex = 0;
+            this.button24.Text = "拍图";
+            this.button24.UseVisualStyleBackColor = true;
+            this.button24.Click += new System.EventHandler(this.button24_Click);
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.dataGridView1);
+            this.groupBox2.Controls.Add(this.chart1);
+            this.groupBox2.Controls.Add(this.button26);
+            this.groupBox2.Controls.Add(this.button25);
+            this.groupBox2.Location = new System.Drawing.Point(20, 610);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(1654, 448);
+            this.groupBox2.TabIndex = 78;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "能谱";
+            // 
+            // button25
+            // 
+            this.button25.Location = new System.Drawing.Point(27, 39);
+            this.button25.Name = "button25";
+            this.button25.Size = new System.Drawing.Size(113, 44);
+            this.button25.TabIndex = 0;
+            this.button25.Text = "点采集";
+            this.button25.UseVisualStyleBackColor = true;
+            this.button25.Click += new System.EventHandler(this.button25_Click);
+            // 
+            // button26
+            // 
+            this.button26.Location = new System.Drawing.Point(175, 40);
+            this.button26.Name = "button26";
+            this.button26.Size = new System.Drawing.Size(123, 44);
+            this.button26.TabIndex = 1;
+            this.button26.Text = "面采集";
+            this.button26.UseVisualStyleBackColor = true;
+            this.button26.Click += new System.EventHandler(this.button26_Click);
+            // 
+            // chart1
+            // 
+            chartArea4.Name = "ChartArea1";
+            this.chart1.ChartAreas.Add(chartArea4);
+            legend4.Name = "Legend1";
+            this.chart1.Legends.Add(legend4);
+            this.chart1.Location = new System.Drawing.Point(328, 40);
+            this.chart1.Name = "chart1";
+            series4.ChartArea = "ChartArea1";
+            series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
+            series4.Legend = "Legend1";
+            series4.Name = "Series1";
+            this.chart1.Series.Add(series4);
+            this.chart1.Size = new System.Drawing.Size(1311, 387);
+            this.chart1.TabIndex = 3;
+            this.chart1.Text = "chart1";
+            // 
+            // dataGridView1
+            // 
+            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.元素,
+            this.含量});
+            this.dataGridView1.Location = new System.Drawing.Point(27, 104);
+            this.dataGridView1.Name = "dataGridView1";
+            this.dataGridView1.RowTemplate.Height = 30;
+            this.dataGridView1.Size = new System.Drawing.Size(271, 323);
+            this.dataGridView1.TabIndex = 79;
+            // 
+            // 元素
+            // 
+            this.元素.HeaderText = "元素";
+            this.元素.Name = "元素";
+            // 
+            // 含量
+            // 
+            this.含量.HeaderText = "含量";
+            this.含量.Name = "含量";
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1687, 1070);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.拍图);
+            this.Controls.Add(this.groupBox1);
+            this.Name = "Form1";
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.拍图.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pBImage)).EndInit();
+            this.groupBox2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.TextBox tBHV;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.TextBox tBHVIn;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.TextBox tBWD;
+        private System.Windows.Forms.TextBox tBMag;
+        private System.Windows.Forms.TextBox tBBright;
+        private System.Windows.Forms.TextBox tBContast;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Button button3;
+        private System.Windows.Forms.Button button4;
+        private System.Windows.Forms.Button button5;
+        private System.Windows.Forms.Button button6;
+        private System.Windows.Forms.TextBox tBWDIn;
+        private System.Windows.Forms.TextBox tBMagIn;
+        private System.Windows.Forms.TextBox tBrightIn;
+        private System.Windows.Forms.TextBox tBContrastIn;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.Button button7;
+        private System.Windows.Forms.Button button8;
+        private System.Windows.Forms.Button button9;
+        private System.Windows.Forms.Button button10;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label18;
+        private System.Windows.Forms.Label label19;
+        private System.Windows.Forms.Label label20;
+        private System.Windows.Forms.Label label21;
+        private System.Windows.Forms.TextBox tBX;
+        private System.Windows.Forms.TextBox tBY;
+        private System.Windows.Forms.TextBox tBZ;
+        private System.Windows.Forms.TextBox tBT;
+        private System.Windows.Forms.TextBox tBR;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label label23;
+        private System.Windows.Forms.Label label24;
+        private System.Windows.Forms.Label label25;
+        private System.Windows.Forms.Label label26;
+        private System.Windows.Forms.Button button11;
+        private System.Windows.Forms.Button button12;
+        private System.Windows.Forms.Button button13;
+        private System.Windows.Forms.Button button14;
+        private System.Windows.Forms.Button button15;
+        private System.Windows.Forms.TextBox tBXIn;
+        private System.Windows.Forms.TextBox tBYIn;
+        private System.Windows.Forms.TextBox tBZIn;
+        private System.Windows.Forms.TextBox tBTIn;
+        private System.Windows.Forms.TextBox tBRIn;
+        private System.Windows.Forms.Label label27;
+        private System.Windows.Forms.Label label28;
+        private System.Windows.Forms.Label label29;
+        private System.Windows.Forms.Label label30;
+        private System.Windows.Forms.Label label31;
+        private System.Windows.Forms.Button button16;
+        private System.Windows.Forms.Button button17;
+        private System.Windows.Forms.Button button18;
+        private System.Windows.Forms.Button button19;
+        private System.Windows.Forms.Button button20;
+        private System.Windows.Forms.Button button21;
+        private System.Windows.Forms.Button button22;
+        private System.Windows.Forms.Button button23;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.GroupBox 拍图;
+        private System.Windows.Forms.Button button24;
+        private System.Windows.Forms.PictureBox pBImage;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.DataGridView dataGridView1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn 元素;
+        private System.Windows.Forms.DataGridViewTextBoxColumn 含量;
+        private System.Windows.Forms.DataVisualization.Charting.Chart chart1;
+        private System.Windows.Forms.Button button26;
+        private System.Windows.Forms.Button button25;
+    }
+}
+

+ 333 - 0
OxfordTest/Form1.cs

@@ -0,0 +1,333 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using Extender;
+
+namespace OxfordTest
+{
+    public partial class Form1 : Form
+    {
+
+        //全局只有一个fatorySEM
+        static ExtenderInterface factoryExtender = ExtenderInterface.Instance;
+        IExtenderControl iExtender = factoryExtender.IExtender;
+
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        //获取电压
+        private void button1_Click(object sender, EventArgs e)
+        {
+            tBHV.Text = iExtender.GetSEMVoltage().ToString();
+        }
+
+        //输入限制只能是数字
+        private void textBox_KeyPress(string text, object sender, KeyPressEventArgs e)
+        {
+
+            //允许输入数字、小数点、删除键和负号  
+            if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != (char)('.') && e.KeyChar != (char)('-'))
+            {
+                MessageBox.Show("请输入正确的数字");
+                text = "";
+                e.Handled = true;
+            }
+            if (e.KeyChar == (char)('-'))
+            {
+                if (text != "")
+                {
+                    MessageBox.Show("请输入正确的数字");
+                    text = "";
+                    e.Handled = true;
+                }
+            }
+            //小数点只能输入一次  
+            if (e.KeyChar == (char)('.') && ((TextBox)sender).Text.IndexOf('.') != -1)
+            {
+                MessageBox.Show("请输入正确的数字");
+                text = "";
+                e.Handled = true;
+            }
+            //第一位不能为小数点  
+            if (e.KeyChar == (char)('.') && ((TextBox)sender).Text == "")
+            {
+                MessageBox.Show("请输入正确的数字");
+                text = "";
+                e.Handled = true;
+            }
+            //第一位是0,第二位必须为小数点  
+            if (e.KeyChar != (char)('.') && ((TextBox)sender).Text == "0")
+            {
+                MessageBox.Show("请输入正确的数字");
+                text = "";
+                e.Handled = true;
+            }
+            //第一位是负号,第二位不能为小数点  
+            if (((TextBox)sender).Text == "-" && e.KeyChar == (char)('.'))
+            {
+                MessageBox.Show("请输入正确的数字");
+                text = "";
+                e.Handled = true;
+            }
+        }
+
+        //设定电压
+        private void button2_Click(object sender, EventArgs e)
+        {
+            iExtender.SetSEMVoltage(float.Parse(tBHVIn.Text));
+        }
+
+        //电压输入限制
+        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBHVIn.Text, sender, e);           
+        }
+
+        //获取工作距离
+        private void button3_Click(object sender, EventArgs e)
+        {
+            tBWD.Text = iExtender.GetWorkingDistance().ToString();
+        }
+
+        //获取放大倍数 
+        private void button4_Click(object sender, EventArgs e)
+        {
+            tBMag.Text = iExtender.GetMagnification().ToString();
+        }
+        //获取亮度
+        private void button5_Click(object sender, EventArgs e)
+        {
+            tBBright.Text = iExtender.GetBrightness().ToString();
+        }
+        //获取对比度
+        private void button6_Click(object sender, EventArgs e)
+        {
+            tBContast.Text = iExtender.GetContrast().ToString();
+        }
+        //设定工作距离
+        private void button7_Click(object sender, EventArgs e)
+        {
+            iExtender.SetWorkingDistance(float.Parse(tBWDIn.Text));
+        }
+        //设定放大倍数
+        private void button8_Click(object sender, EventArgs e)
+        {
+            iExtender.SetMagnification(float.Parse(tBMagIn.Text));
+        }
+        //设定亮度
+        private void button9_Click(object sender, EventArgs e)
+        {
+            iExtender.SetBrightness(float.Parse(tBrightIn.Text));
+        }
+        //设定对比度
+        private void button10_Click(object sender, EventArgs e)
+        {
+            iExtender.SetContrast(float.Parse(tBContrastIn.Text));
+        }
+
+        private void tBWDIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBWDIn.Text, sender, e);
+        }
+
+        private void tBMagIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBMagIn.Text, sender, e);
+        }
+
+        private void tBrightIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBrightIn.Text, sender, e);
+        }
+
+        private void tBContrastIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBContrastIn.Text, sender, e);
+        }
+
+        //获取X
+        private void button11_Click(object sender, EventArgs e)
+        {
+            tBX.Text = iExtender.GetStageAtX().ToString();
+        }
+        //获取Y
+        private void button12_Click(object sender, EventArgs e)
+        {
+            tBY.Text = iExtender.GetStageAtY().ToString();
+
+        }
+        //获取Z
+        private void button13_Click(object sender, EventArgs e)
+        {
+            tBZ.Text = iExtender.GetStageAtZ().ToString();
+
+        }
+        //获取T
+        private void button14_Click(object sender, EventArgs e)
+        {
+            tBT.Text = iExtender.GetStageAtT().ToString();
+
+        }
+        //获取R
+        private void button15_Click(object sender, EventArgs e)
+        {
+            tBR.Text = iExtender.GetStageAtR().ToString();
+
+        }
+        //获取全部
+        private void button21_Click(object sender, EventArgs e)
+        {
+            tBX.Text = iExtender.GetStageAtX().ToString();
+            tBY.Text = iExtender.GetStageAtY().ToString();
+            tBZ.Text = iExtender.GetStageAtZ().ToString();
+            tBT.Text = iExtender.GetStageAtT().ToString();
+            tBR.Text = iExtender.GetStageAtR().ToString();
+
+        }
+        //设定XY
+        private void button22_Click(object sender, EventArgs e)
+        {
+            iExtender.MoveStageXY(float.Parse(tBXIn.Text), float.Parse(tBYIn.Text));
+        }
+        //设定全部
+        private void button23_Click(object sender, EventArgs e)
+        {
+            float[] pos = new float[5];
+            pos[0] = float.Parse(tBXIn.Text);
+            pos[1] = float.Parse(tBYIn.Text);
+            pos[2] = float.Parse(tBZIn.Text);
+            pos[3] = float.Parse(tBTIn.Text);
+            pos[4] = float.Parse(tBRIn.Text);
+            iExtender.SetStagePosition(pos);
+        }
+        //设定X
+        private void button16_Click(object sender, EventArgs e)
+        {
+            iExtender.SetStageGotoX(float.Parse(tBXIn.Text));
+        }
+        //设定Y
+        private void button17_Click(object sender, EventArgs e)
+        {
+            iExtender.SetStageGotoY(float.Parse(tBYIn.Text));
+        }
+        //设定Z
+        private void button18_Click(object sender, EventArgs e)
+        {
+            iExtender.SetStageGotoZ(float.Parse(tBZIn.Text));
+        }
+        //设定T
+        private void button19_Click(object sender, EventArgs e)
+        {
+            iExtender.SetStageGotoT(float.Parse(tBTIn.Text));
+        }
+        //设定R
+        private void button20_Click(object sender, EventArgs e)
+        {
+            iExtender.SetStageGotoR(float.Parse(tBRIn.Text));
+        }
+
+        private void tBXIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBXIn.Text, sender, e);
+        }
+
+        private void tBYIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBYIn.Text, sender, e);
+        }
+
+        private void tBZIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBZIn.Text, sender, e);
+        }
+
+        private void tBTIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBTIn.Text, sender, e);
+        }
+
+        private void tBRIn_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            textBox_KeyPress(tBRIn.Text, sender, e);
+        }
+
+        private void button24_Click(object sender, EventArgs e)
+        {
+            iExtender.SetImageAcquistionSetting(1, 1, 1024);
+            string path = System.Environment.CurrentDirectory;
+            iExtender.GrabImage(path+"\\测试.tif", 0, 0, 0, 0, 0);
+            Bitmap ExtenderImage = iExtender.GetBitmap();
+            if (ExtenderImage != null)
+            {
+                pBImage.Image = ExtenderImage;
+            }
+        }
+
+        //点采集
+        private void button25_Click(object sender, EventArgs e)
+        {
+            long[] XrayData = new long[2000];
+            Dictionary<string, double> listElement = new Dictionary<string, double>();
+            iExtender.XrayPointCollectiong(1, 1, out XrayData, out listElement);
+
+            ShowData(XrayData, listElement);
+        }
+
+        void ShowData(long[] XrayData, Dictionary<string, double> listElement)
+        {
+            Series series = chart1.Series[0];
+            series.Points.Clear();
+
+            for (int i = 0; i < 2000; i++)
+            {
+                series.Points.AddXY(i, XrayData[i]);
+            }
+
+            this.dataGridView1.Rows.Clear();
+            int index = this.dataGridView1.Rows.Add();
+
+            var ie = listElement.GetEnumerator();
+            while (ie.MoveNext())
+            {
+                this.dataGridView1.Rows[index].Cells[0].Value = ie.Current.Key;
+                this.dataGridView1.Rows[index].Cells[1].Value = ie.Current.Value;
+            }
+
+        }
+
+        //面采集
+        private void button26_Click(object sender, EventArgs e)
+        {
+            long[] XrayData = new long[2000];
+            Dictionary<string, double> listElement = new Dictionary<string, double>();
+
+            List<Segment> listSeg = new List<Segment>();
+
+            Segment seg1 = new Segment();
+            seg1.X = 1;
+            seg1.Y = 1;
+            seg1.Length = 10;
+
+            listSeg.Add(seg1);
+
+            Segment seg2 = new Segment();
+            seg2.X = 1;
+            seg2.Y = 10;
+            seg2.Length = 10;
+
+            listSeg.Add(seg2);
+
+            iExtender.XrayAreaCollectiong(listSeg, out XrayData, out listElement);
+            ShowData(XrayData, listElement);
+        }
+    }
+}

+ 132 - 0
OxfordTest/Form1.resx

@@ -0,0 +1,132 @@
+<?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>
+  <metadata name="元素.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="含量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="元素.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="含量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>

+ 90 - 0
OxfordTest/OxfordTest.csproj

@@ -0,0 +1,90 @@
+<?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>{7566397D-632B-4939-8EB6-9AC620EE44F3}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>OxfordTest</RootNamespace>
+    <AssemblyName>OxfordTest</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="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Windows.Forms.DataVisualization" />
+    <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="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.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>
+    <ProjectReference Include="..\ExtenderControl\Extender.csproj">
+      <Project>{f5092f52-1fbd-4882-bb9c-399809d87779}</Project>
+      <Name>Extender</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 22 - 0
OxfordTest/Program.cs

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

+ 36 - 0
OxfordTest/Properties/AssemblyInfo.cs

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

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

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OxfordTest.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("OxfordTest.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
OxfordTest/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
OxfordTest/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 OxfordTest.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
OxfordTest/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>