| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147 | using System;using System.Collections;using System.IO;using System.Windows.Forms;using System.Xml;using OTSModelSharp.ServiceCenter;namespace OTSSysMgrApp{    public partial class SemTestForms : Form    {        #region 全部变量声明        //连接状态        bool ConnectionState = false;          static string xmlFilePath = System.Configuration.ConfigurationManager.ConnectionStrings["XMLFilePath"].ConnectionString;         static NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();        ISemController m_SemHardwareMgr = null;        //国际化        Language lan;        //国际化存储信息        Hashtable table;        #endregion        #region 构造方法        public SemTestForms()        {            InitializeComponent();            //控制类对象初始化                      m_SemHardwareMgr = SemController.GetSEMController();            //国际化            lan = new Language(this);            table = lan.GetNameTable(this.Name);        }            #endregion        #region 保存设置        /// <summary>        /// 保存设置        /// </summary>        /// <param name="Name">节点名称</param>        /// <param name="Value">节点参数值</param>        public void SaveSetting(string Name, string Value)        {            try            {                //判断XML文件中是否存在                if (!XMLOperationClass.ExistsXmlInfo(Name))                {                    //调用添加XML节点功能                    XMLOperationClass.AddXmlInfo(Name, Value);                }                else                {                    //调用修改XML节点功能                    XMLOperationClass.EditXmlInfo(Name, Value);                }            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());            }        }        #endregion        #region 修改设置        public void EditSetting(string Name, string Value)        {            try            {                //调用修改XML节点功能                XMLOperationClass.EditXmlInfo(Name, Value);            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());            }        }        #endregion        #region 判断文件路径        /// <summary>        /// 判断文件路径        /// </summary>        /// <param name="path"></param>        /// <returns></returns>        public bool CreateFile(string path)        {            Directory.CreateDirectory(path);            return false;        }        #endregion        #region 判断文件是否存在        /// <summary>        /// 判断文件是否存在        /// </summary>        /// <param name="path">文件路径</param>        /// <returns></returns>        public bool ExistsFile(string path)        {            try            {                if (File.Exists(path))                {                    return true;                }                return false;            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());                return false;            }        }        #endregion        public void GetBtnState(bool btnState)        {                       foreach (Control item in gbGetMethods.Controls)            {                if (item is Button)                {                                  ((Button)item).Enabled = btnState;                                  }            }            foreach (Control item in gbSetMethods.Controls)            {                if (item is Button)                {                                ((Button)item).Enabled = btnState;                                  }            }        }        #region 用户信息提示        /// <summary>        /// 提示        /// </summary>        /// <param name="Message"></param>        private void ShowMessage(int MessageType)        {            string message1 = table["message1"].ToString();            string message2 = table["message2"].ToString();            string message3 = table["message3"].ToString();            string message4 = table["message4"].ToString();            string message5 = table["message5"].ToString();            string message6 = table["message6"].ToString();            string message7 = table["message7"].ToString();            string message8 = table["message8"].ToString();            string message9 = table["message9"].ToString();            string message10 = table["message10"].ToString();            string MessageInfo = string.Empty;            switch (MessageType)            {                case 0:                    MessageInfo = message1;                    break;                case 1:                    MessageInfo = message2;                    break;                case 2:                    MessageInfo = message3;                    break;                case 3:                    MessageInfo = message4;                    break;                case 4:                    MessageInfo = message5;                    break;                case 5:                    MessageInfo = message6;                    break;                case 6:                    MessageInfo = message7;                    break;                case 7:                    MessageInfo = message8;                    break;                case 8:                    MessageInfo = message9;                    break;                case 9:                    MessageInfo = message10;                    break;            }            MessageBox.Show(MessageInfo, "Tip");        }        #endregion        #region 判断控制内容是否为空 与 判断输入的格式是否正确        /// <summary>        /// 判断控制内容是否为空        /// </summary>        /// <param name="tbContent"></param>        /// <returns></returns>        public bool IsNull(TextBox tbContent)        {            if (tbContent.Text.Trim().Equals(""))            {                //为空提示                ShowMessage(0);                //获取焦点                tbContent.Focus();                return false;            }            return true;        }        /// <summary>        ///         /// </summary>        /// <param name="objValue"></param>        /// <param name="objType"></param>        /// <returns></returns>        public bool IsType(object ObjValue, int ObjType)        {            try            {                switch (ObjType)                {                    case 1:                        int intValue = Convert.ToInt32(ObjValue);                        break;                    case 2:                        double douValue = Convert.ToDouble(ObjValue);                        break;                    case 3:                        float floValue = Convert.ToSingle(ObjValue);                        break;                }                return true;            }            catch (Exception)            {                //为空提示                ShowMessage(7);                return false;            }        }        /// <summary>        /// 判断是否连接        /// </summary>        /// <returns></returns>        public bool IsConnection()        {            try            {                if (ConnectionState)                {                    return true;                }                return false;            }            catch (Exception)            {                //为空提示                ShowMessage(7);                return false;            }        }        #endregion        #region 窗体控制的事件汇总        private void SemTestForms_Load(object sender, EventArgs e)        {            ////循环窗体中            foreach (Control item in gbGetMethods.Controls)            {                if (item is Button)                {                    //绑定按钮点击事件                    //item.Click += new System.EventHandler(btnGetInfo_Click);                    ((Button)item).Enabled = false;                }            }            foreach (Control item in gbSetMethods.Controls)            {                if (item is Button)                {                    //绑定按钮点击事件                    //item.Click += new System.EventHandler(btnSetInfo_Click);                    ((Button)item).Enabled = false;                }            }                  }        private void btnDone_Click(object sender, EventArgs e)        {                      //返回关闭窗口返回值            this.DialogResult = DialogResult.OK;        }        private void btnGetInfo_Click(object sender, EventArgs e)        {            if (!IsConnection())            {                return;            }            //获取响应按钮            Button btnTest = (Button)sender;            try            {                //节点名称与节点参数值                string Name = string.Empty;                string Value = string.Empty;                //判断本地中是否存在文件路径                if (ExistsFile(xmlFilePath))                {                    //遍历tabHardwareSet标签中所有的ComboBox控件                     foreach (Control control in this.gbGetMethods.Controls)                    {                        //判断类型名称                        if (control is TextBox)                        {                            Name = (control as TextBox).Name.Substring(2);                            if (btnTest.Name.Contains(Name))                            {                                //获取节点名称与节点参数值                                System.Xml.XmlNode xmlNode = XMLOperationClass.GetXMLInformationValue("S" + Name);                                (control as TextBox).Text = ((XmlElement)xmlNode).GetAttribute("Value");                            }                        }                        //判断类型名称                        if (control is CheckBox)                        {                            Name = (control as CheckBox).Name.Substring(2);                            if (btnTest.Name.Contains(Name))                            {                                //获取节点名称与节点参数值                                System.Xml.XmlNode xmlNode = XMLOperationClass.GetXMLInformationValue(Name);                                (control as CheckBox).Checked = ((XmlElement)xmlNode).GetAttribute("Value").Equals("true") ? true : false;                            }                        }                    }                }                else                {                    //如果文件不存在,则创建文件                    CreateFile(xmlFilePath);                }            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());            }        }        private void btnSetInfo_Click(object sender, EventArgs e)        {            if (!IsConnection())            {                return;            }            //获取响应按钮            Button btnTest = (Button)sender;            try            {                //节点名称与节点参数值                string Name = string.Empty;                string Value = string.Empty;                //判断本地中是否存在文件路径                if (ExistsFile(xmlFilePath))                {                    //遍历tabHardwareSet标签中所有的TextBox控件                     foreach (Control control in this.gbSetMethods.Controls)                    {                        //判断类型名称                        if (control is TextBox)                        {                            Name = (control as TextBox).Name.Substring(2);                            if (btnTest.Name.Contains(Name))                            {                                //获取节点名称与节点参数值                                Value = (control as TextBox).Text;                                SaveSetting(Name, Value);                            }                        }                        //判断类型名称                        if (control is CheckBox)                        {                            Name = (control as CheckBox).Name.Substring(2);                            if (btnTest.Name.Contains(Name))                            {                                //获取节点名称与节点参数值                                Value = (control as CheckBox).Checked ? "true" : "false";                                SaveSetting(Name, Value);                            }                        }                    }                }                else                {                    //如果文件不存在,则创建文件                    CreateFile(xmlFilePath);                }            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());            }        }        private void btnGetAll_Click(object sender, EventArgs e)        {                 }        private void BtnConnect_Click(object sender, EventArgs e)        {            if (!ConnectionState)            {                //和电镜建立通讯连接                ConnectionState = m_SemHardwareMgr.Connect();                ///获取当前电镜的ID号                //SemType = cfun.GetSemType();                if (!ConnectionState)                {                    ShowMessage(2);                    log.Error(table["message3"].ToString());                }                else                {                    string str = table["str1"].ToString();                                        BtnConnect.Text = str;                    GetBtnState(true);                    log.Info("The energy spectrum is connected");                }            }            else            {                string str = table["str2"].ToString();                               BtnConnect.Text = str;                ConnectionState = false;                GetBtnState(false);            }        }        private void SemTestForms_FormClosing(object sender, FormClosingEventArgs e)        {            //m_SemHardwareMgr.DisConnect();        }        private void btnGPositionXYR_Click(object sender, EventArgs e)        {            try            {                //赋值                double PositionX = 0;                double PositionY = 0;                double PositionR = 0;                //获取参数                bool result = m_SemHardwareMgr.GetSemPositionXY(ref PositionX, ref PositionY, ref PositionR);                if (result)                {                    //赋值 显示                    tbPositionX.Text = Convert.ToDouble(PositionX).ToString();                    tbPositionY.Text = Convert.ToDouble(PositionY).ToString();                    tbPositionR.Text = Convert.ToDouble(PositionR).ToString();                    log.Info("X,Y-axis coordinates:(" + tbPositionX.Text + "," + tbPositionY.Text+")");                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Failed to obtain the X and Y coordinates");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSPositionXYR_Click(object sender, EventArgs e)        {            try            {                //判断是否为空                if (!IsNull(tbSPositionX))                {                    this.Focus();                    return;                }                if (!IsType(tbSPositionX.Text, 2))                {                    this.Focus();                    return;                }                if (!IsNull(tbSPositionY))                {                    this.Focus();                    return;                }                if (!IsType(tbSPositionY.Text, 2))                {                    this.Focus();                    return;                }                //if (!IsNull(tbSPositionR))                //{                //    this.Focus();                //    return;                //}                //if (!IsType(tbSPositionR.Text, 2))                //{                //    this.Focus();                //    return;                //}                //赋值                double PositionX = Convert.ToDouble(tbSPositionX.Text);                double PositionY = Convert.ToDouble(tbSPositionY.Text);                //double PositionR = Convert.ToDouble(tbSPositionR.Text);                bool result = m_SemHardwareMgr.MoveSEMToPoint(PositionX, PositionY);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Set successfully, current X and Y coordinates should be:(" + PositionX.ToString() + "," + PositionY.ToString() + ")");                }                else                {                    ShowMessage(4);                    log.Error("Failed to set X and Y coordinates!");                }            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());            }        }        private void btnMoveSEMToPoint_Click(object sender, EventArgs e)        {            try            {                //判断是否为空                if (!IsNull(tbSPositionX))                {                    this.Focus();                    return;                }                if (!IsType(tbSPositionX.Text, 2))                {                    this.Focus();                    return;                }                if (!IsNull(tbSPositionY))                {                    this.Focus();                    return;                }                if (!IsType(tbSPositionY.Text, 2))                {                    this.Focus();                    return;                }                if (!IsNull(tbSPositionR))                {                    this.Focus();                    return;                }                if (!IsType(tbSPositionR.Text, 2))                {                    this.Focus();                    return;                }                //赋值                double PositionX = Convert.ToDouble(tbSPositionX.Text);                double PositionY = Convert.ToDouble(tbSPositionY.Text);                double PositionR = Convert.ToDouble(tbSPositionR.Text);                bool result = m_SemHardwareMgr.MoveSEMToPoint(PositionX, PositionY, PositionR);            }            catch (Exception ex)            {                //记录日志信息                log.Error(ex.Message.ToString());            }        }        private void btnGBeamBlank_Click(object sender, EventArgs e)        {            try            {                int a_nBeamBlank = 0;                               bool result = m_SemHardwareMgr.GetSemBeamBlank(ref a_nBeamBlank);                if (result)                {                    //赋值 显示                    tbBeamBlank.Text = Convert.ToString(a_nBeamBlank);                    log.Info("Beam baffle:" + a_nBeamBlank.ToString());                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Failed to obtain the Beam baffle!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSBeamBlank_Click(object sender, EventArgs e)        {            try            {                bool a_nBeamBlank = false;                //判断是否为空与类型                if (!IsNull(tbSBeamBlank))                {                    tbSBeamBlank.Focus();                    return;                }                if (!IsType(tbSBeamBlank.Text, 1))                {                    tbSBeamBlank.Focus();                    return;                }                              bool result = m_SemHardwareMgr.SetSemBeamBlank(true);            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnGBrightness_Click(object sender, EventArgs e)        {            try            {                double a_dBrightness = 0;                //获取参数                bool result = m_SemHardwareMgr.GetSemBrightness(ref a_dBrightness);                if (result)                {                    //赋值 显示                    tbBrightness.Text = Convert.ToString(a_dBrightness);                    log.Info("Brightness:" + tbBrightness.Text);                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Failed to obtain the Brightness");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSBrightness_Click(object sender, EventArgs e)        {            try            {                double a_dBrightness = 0;                //判断是否为空与类型                if (!IsNull(tbSBrightness))                {                    tbSBrightness.Focus();                    return;                }                if (!IsType(tbSBrightness.Text, 2))                {                    tbSBrightness.Focus();                    return;                }                //获取参数与设置参数                a_dBrightness = Convert.ToInt32(tbSBrightness.Text);                //获取参数                bool result = m_SemHardwareMgr.SetSemBrightness(a_dBrightness);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Setting successful!, the current brightness should be:" + tbSBrightness.Text);                }                else                {                    ShowMessage(4);                    log.Error("Brightness setting failed!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnGContrast_Click(object sender, EventArgs e)        {            try            {                double a_dContrast = 0;                //获取参数                bool result = m_SemHardwareMgr.GetSemContrast(ref a_dContrast);                if (result)                {                    //赋值 显示                    tbContrast.Text = Convert.ToString(a_dContrast);                    log.Info("Contrast:" + tbContrast.Text);                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Failed to obtain contrast!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSContrast_Click(object sender, EventArgs e)        {            try            {                double a_dContrast = 0;                //判断是否为空与类型                if (!IsNull(tbSContrast))                {                    tbSContrast.Focus();                    return;                }                if (!IsType(tbSContrast.Text, 2))                {                    tbSContrast.Focus();                    return;                }                //赋值                a_dContrast = Convert.ToInt32(tbSContrast.Text);                //获取结果参数                bool result = m_SemHardwareMgr.SetSemContrast(a_dContrast);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Set successfully, the current contrast should be:" + tbSContrast.Text);                }                else                {                    ShowMessage(4);                    log.Error("Contrast setting failed!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnGFWD_Click(object sender, EventArgs e)        {            try            {                double a_dWorkingDistance = 0;                //获取参数                bool result = m_SemHardwareMgr.GetWorkingDistance(ref a_dWorkingDistance);                if (result)                {                    //赋值 显示                    tbFWD.Text = Convert.ToString(a_dWorkingDistance);                    log.Info("WorkingDistance:" + tbFWD.Text);                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Fail to obtain the WorkingDistance!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSFWD_Click(object sender, EventArgs e)        {            try            {                double a_dWorkingDistance = 0;                //判断是否为空与类型                if (!IsNull(tbSFWD))                {                    tbSFWD.Focus();                    return;                }                if (!IsType(tbSFWD.Text, 2))                {                    tbSFWD.Focus();                    return;                }                //赋值                a_dWorkingDistance = Convert.ToDouble(tbSFWD.Text);                //获取结果参数                bool result = m_SemHardwareMgr.SetWorkingDistance(a_dWorkingDistance);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Setting successful!, the current working distance should be:"+ tbSFWD.Text);                }                else                {                    ShowMessage(4);                    log.Error("Working distance setting failed!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnGKV_Click(object sender, EventArgs e)        {            try            {                double a_dKV = 0;                //获取参数                bool result = m_SemHardwareMgr.GetSemHighTension(ref a_dKV);                if (result)                {                    //赋值 显示                    tbKV.Text = Convert.ToString(a_dKV);                    log.Info("Electron microscope voltage:" + tbKV.Text);                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Failed to obtain electron microscope voltage value!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSKV_Click(object sender, EventArgs e)        {            try            {                double a_dKV = 0;                //判断是否为空与类型                if (!IsNull(tbSKV))                {                    tbSKV.Focus();                    return;                }                if (!IsType(tbSKV.Text, 2))                {                    tbSKV.Focus();                    return;                }                //赋值                a_dKV = Convert.ToInt32(tbSKV.Text);                //获取结果参数                bool result = m_SemHardwareMgr.SetSemHighTension(a_dKV);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Setting successful!, the current voltage value should be:" + tbSKV.Text);                }                else                {                    ShowMessage(4);                    log.Error("Voltage setting failed!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnGMagnification_Click(object sender, EventArgs e)        {            try            {                double a_dMagnification = 0;                //获取参数                bool result = m_SemHardwareMgr.GetMagnification(ref a_dMagnification);                if (result)                {                    //赋值 显示                    tbMagnification.Text = Convert.ToString(a_dMagnification);                    log.Info("SemMagnification:" + tbMagnification.Text);                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Fail to obtain the SemMagnification!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSMagnification_Click(object sender, EventArgs e)        {            try            {                double a_dMagnification = 0;                //判断是否为空与类型                if (!IsNull(tbSMagnification))                {                    tbSMagnification.Focus();                    return;                }                if (!IsType(tbSMagnification.Text, 2))                {                    tbSMagnification.Focus();                    return;                }                //赋值                a_dMagnification = Convert.ToInt32(tbSMagnification.Text);                //获取结果参数                bool result = m_SemHardwareMgr.SetMagnification(a_dMagnification);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Setting successful!, the current magnification should be:");                }                else                {                    ShowMessage(4);                    log.Error("Magnification setting failed!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnGSpotSize_Click(object sender, EventArgs e)        {                    }        private void btnSSpotSize_Click(object sender, EventArgs e)        {                    }        private void btnHT_Click(object sender, EventArgs e)        {            try            {                double a_bHTValue = 0;                //获取参数                bool result = m_SemHardwareMgr.GetSemHighTension(ref a_bHTValue);                if (a_bHTValue > 0)                {                    //赋值 显示                    cbHT.Checked = true;                    log.Info("HT:" + cbHT.Checked.ToString());                }                else                {                    //配置结果提示                    ShowMessage(6);                    log.Error("Fail to obtain the HT!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }        private void btnSHT_Click(object sender, EventArgs e)        {            try            {                bool a_bHTValue = false;                //判断是否为空与类型                //赋值                a_bHTValue = cbSHT.Checked;                //获取结果参数                bool result = m_SemHardwareMgr.SetSemBeamBlank(a_bHTValue);                if (result)                {                    //配置结果提示                    ShowMessage(3);                    log.Info("Setting successful!, the current voltage should be:" + cbSHT.Checked.ToString());                }                else                {                    ShowMessage(4);                    log.Error("Voltage setting failed!");                }            }            catch (Exception ex)            {                //记录日志信息(异常日志)                log.Error(ex.Message.ToString());            }        }               private void btnGScanMode_Click(object sender, EventArgs e)        {                    }        private void btnScanMode_Click(object sender, EventArgs e)        {                  }        #endregion        private void btnGLienTime_Click(object sender, EventArgs e)        {        }        private void bVoltageClose_Click(object sender, EventArgs e)        {            bool a_HTValue = false;            bool result = m_SemHardwareMgr.SetSemBeamCurrentOff(a_HTValue);        }        private void bVoltageStatus_Click(object sender, EventArgs e)        {            bool a_HTValue = false;               bool result = m_SemHardwareMgr.SetSemBeamBlank(a_HTValue);        }        private void button1_Click(object sender, EventArgs e)        {            bool result = m_SemHardwareMgr.SetScanExternal(true);            if (!result)            {                MessageBox.Show("SetExternalOn failed!");                        }        }        private void button2_Click(object sender, EventArgs e)        {            bool result = m_SemHardwareMgr.SetScanExternal(false);            if (!result)            {                MessageBox.Show("SetExternalOn failed!");            }        }        private void label17_Click(object sender, EventArgs e)        {        }                    private void button3_Click_1(object sender, EventArgs e)        {            bool result = m_SemHardwareMgr.SetSemHTOff(false);        }        private void btn_HIGH_VACUUM_Click(object sender, EventArgs e)        {            m_SemHardwareMgr.RunHIGH_VACUUM();        }        private void btn_StopImageAcquisition_Click(object sender, EventArgs e)        {            m_SemHardwareMgr.StopImageAcquisition();        }        private void btn_FullFrame_Click(object sender, EventArgs e)        {            m_SemHardwareMgr.SetFullFrame();        }        private void btn_SetReducedArea_Click(object sender, EventArgs e)        {            m_SemHardwareMgr.SetReducedArea();        }    }}
 |