|
@@ -17,178 +17,56 @@ using System.Windows.Forms;
|
|
|
using System.IO;
|
|
|
using SmartSEMControl;
|
|
|
using FileManager;
|
|
|
+using System.Xml;
|
|
|
+using MeasureData;
|
|
|
+using System.Threading;
|
|
|
|
|
|
namespace HOZProject
|
|
|
{
|
|
|
public partial class FormUnitControl : Form
|
|
|
{
|
|
|
+ #region 系统参数
|
|
|
//全局只有一个fatorySEM
|
|
|
static FactoryHardware factorySEM = FactoryHardware.Instance;
|
|
|
ISEMControl iSEM = factorySEM.ISEM;
|
|
|
|
|
|
public XmlManager xmg = new XmlManager();
|
|
|
|
|
|
- #region 系统参数
|
|
|
+
|
|
|
private String path = Directory.GetCurrentDirectory();
|
|
|
+ private int st_flag = 0;
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
|
public FormUnitControl()
|
|
|
{
|
|
|
- InitializeComponent();
|
|
|
-
|
|
|
+ InitializeComponent();
|
|
|
|
|
|
+ Control.CheckForIllegalCrossThreadCalls = false;
|
|
|
+
|
|
|
+ if(iSEM.ConnectStatus())
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBIMAGING();
|
|
|
+ if(ret==0)
|
|
|
+ {
|
|
|
+ btnSEM.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if(ret==1)
|
|
|
+ {
|
|
|
+ btnFIB.BackColor = Color.Lime;
|
|
|
+ panelFIB.Visible = true;
|
|
|
+ }
|
|
|
+ else if(ret==2)
|
|
|
+ {
|
|
|
+ btnMILL.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ }
|
|
|
//Calling Notification for updated status
|
|
|
//CZEMApi.Notify += new _EMApiEvents_NotifyEventHandler(CZEMApi_Notify);
|
|
|
//CZEMApi.NotifyWithCurrentValue += new _EMApiEvents_NotifyWithCurrentValueEventHandler(CZEMApi_NotifyWithCurrentValue);
|
|
|
//加载参数
|
|
|
|
|
|
}
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 设备初始化按键
|
|
|
- private void btnInit_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- //if (sem.Init())
|
|
|
- //{
|
|
|
- // btnInit.BackColor = Color.Lime;
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // btnInit.BackColor = Color.Red;
|
|
|
- //}
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 设备关闭按键
|
|
|
- private void btnCloseCtrl_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- //if (sem.UnInit())
|
|
|
- //{
|
|
|
- // btnInit.BackColor = Control.DefaultBackColor;
|
|
|
- //}
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 设置参数更新通知
|
|
|
- private void btnSetNotify_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- //if (m_bInitialised)
|
|
|
- //{
|
|
|
- // // Magnification
|
|
|
- // if (CZEMApi.SetNotify("AP_MAG", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_MAG");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // Working distance
|
|
|
- // if (CZEMApi.SetNotify("AP_WD", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_WD");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // BRIGHTNESS 亮度
|
|
|
- // if (CZEMApi.SetNotify("AP_BRIGHTNESS", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_BRIGHTNESS");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // AP_CONTRAST,对比度
|
|
|
- // if (CZEMApi.SetNotify("AP_CONTRAST", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_CONTRAST");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // Vacuum
|
|
|
- // if (CZEMApi.SetNotify("DP_VACSTATUS", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_VACSTATUS");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // Gun / EHT state
|
|
|
- // if (CZEMApi.SetNotify("DP_RUNUPSTATE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_RUNUPSTATE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // actual KV / EHT
|
|
|
- // if (CZEMApi.SetNotify("AP_ACTUALKV", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_ACTUALKV");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // actual current
|
|
|
- // if (CZEMApi.SetNotify("AP_ACTUALCURRENT", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_ACTUALCURRENT");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // column type
|
|
|
- // if (CZEMApi.SetNotify("DP_COLUMN_TYPE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_COLUMN_TYPE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // mode
|
|
|
- // if (CZEMApi.SetNotify("DP_OPERATING_MODE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_OPERATING_MODE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // scan rate
|
|
|
- // if (CZEMApi.SetNotify("DP_SCANRATE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_SCANRATE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // auto function active
|
|
|
- // if (CZEMApi.SetNotify("DP_AUTO_FUNCTION", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_AUTO_FUNCTION");
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // // probe current
|
|
|
- // if (CZEMApi.SetNotify("AP_IPROBE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "AP_IPROBE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // detector
|
|
|
- // if (CZEMApi.SetNotify("DP_DETECTOR_TYPE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_DETECTOR_TYPE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // stage initialised
|
|
|
- // if (CZEMApi.SetNotify("DP_STAGE_INIT", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_STAGE_INIT");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // stage busy?
|
|
|
- // if (CZEMApi.SetNotify("DP_STAGE_IS", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_STAGE_IS");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // fib mode
|
|
|
- // if (CZEMApi.SetNotify("DP_FIB_MODE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_FIB_MODE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // // fib gun state
|
|
|
- // if (CZEMApi.SetNotify("DP_FIB_GUN_STATE", 1) != 0)
|
|
|
- // {
|
|
|
- // DisplayError("SetNotify", "DP_FIB_GUN_STATE");
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- //listmsg.Items.Add("Notification enabled");
|
|
|
- // }
|
|
|
- }
|
|
|
#endregion
|
|
|
|
|
|
#region 缩放Get
|
|
@@ -198,13 +76,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetMagnification();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblenlargeGet.Text = "NaN";
|
|
|
+ txtenlargeSet.Text = "NaN";
|
|
|
txtenlargeSet.Enabled = false;
|
|
|
btnenlargeSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblenlargeGet.Text = ret.ToString();
|
|
|
txtenlargeSet.Text = ret.ToString();
|
|
|
btnenlargeSet.Enabled = true;
|
|
|
}
|
|
@@ -229,13 +106,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetWorkingDistance();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblWDGet.Text = "NaN";
|
|
|
+ txtWDSet.Text = "NaN";
|
|
|
txtWDSet.Enabled = false;
|
|
|
btnWDSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblWDGet.Text = ret.ToString();
|
|
|
txtWDSet.Text = ret.ToString();
|
|
|
btnWDSet.Enabled = true;
|
|
|
}
|
|
@@ -259,13 +135,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetBrightness();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblBrightnessGet.Text = "NaN";
|
|
|
+ txtBrightnessSet.Text = "NaN";
|
|
|
txtBrightnessSet.Enabled = false;
|
|
|
btnBrightnessSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- lblBrightnessGet.Text = ret.ToString();
|
|
|
+ {
|
|
|
txtBrightnessSet.Text = ret.ToString();
|
|
|
btnBrightnessSet.Enabled = true;
|
|
|
}
|
|
@@ -289,13 +164,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetContrast();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblContrastGet.Text = "NaN";
|
|
|
+ txtContrastSet.Text = "NaN";
|
|
|
txtContrastSet.Enabled = false;
|
|
|
btnContrastSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblContrastGet.Text = ret.ToString();
|
|
|
txtContrastSet.Text = ret.ToString();
|
|
|
btnContrastSet.Enabled = true;
|
|
|
}
|
|
@@ -319,13 +193,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetAstigmatismX();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblAstigmatismXGet.Text = "NaN";
|
|
|
+ txtAstigmatismXSet.Text = "NaN";
|
|
|
txtAstigmatismXSet.Enabled = false;
|
|
|
btnAstigmatismXSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblAstigmatismXGet.Text = ret.ToString();
|
|
|
txtAstigmatismXSet.Text = ret.ToString();
|
|
|
btnAstigmatismXSet.Enabled = true;
|
|
|
}
|
|
@@ -349,13 +222,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetAstigmatismY();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblAstigmatismYGet.Text = "NaN";
|
|
|
+ txtAstigmatismYSet.Text = "NaN";
|
|
|
txtAstigmatismYSet.Enabled = false;
|
|
|
btnAstigmatismYSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblAstigmatismYGet.Text = ret.ToString();
|
|
|
txtAstigmatismYSet.Text = ret.ToString();
|
|
|
btnAstigmatismYSet.Enabled = true;
|
|
|
}
|
|
@@ -380,13 +252,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetTiltAngle();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblTiltAngleGet.Text = "NaN";
|
|
|
+ txtTiltAngleSet.Text = "NaN";
|
|
|
txtTiltAngleSet.Enabled = false;
|
|
|
btnTiltAngleSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblTiltAngleGet.Text = ret.ToString();
|
|
|
txtTiltAngleSet.Text = ret.ToString();
|
|
|
btnTiltAngleSet.Enabled = true;
|
|
|
}
|
|
@@ -425,13 +296,12 @@ namespace HOZProject
|
|
|
float ret = iSEM.GetScanRotation();
|
|
|
if (float.IsNaN(ret))
|
|
|
{
|
|
|
- lblScanRotationGet.Text = "NaN";
|
|
|
+ txtScanRotationSet.Text = "NaN";
|
|
|
txtScanRotationSet.Enabled = false;
|
|
|
btnScanRotationSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lblScanRotationGet.Text = ret.ToString();
|
|
|
txtScanRotationSet.Text = ret.ToString();
|
|
|
btnScanRotationSet.Enabled = true;
|
|
|
}
|
|
@@ -465,6 +335,58 @@ namespace HOZProject
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region 电子束
|
|
|
+ private void btnTiltCorrXGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetBeamShiftX();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtTiltCorrX.Text = "NaN";
|
|
|
+ txtTiltCorrX.Enabled = false;
|
|
|
+ btnTiltCorrXSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtTiltCorrX.Text = ret.ToString();
|
|
|
+ btnTiltCorrXSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnTiltCorrXSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtTiltCorrX.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetBeamShiftX(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnTiltCorrYGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetBeamShiftY();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtTiltCorrY.Text = "NaN";
|
|
|
+ txtTiltCorrY.Enabled = false;
|
|
|
+ btnTiltCorrYSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtTiltCorrY.Text = ret.ToString();
|
|
|
+ btnTiltCorrYSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnTiltCorrYSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtTiltCorrY.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetBeamShiftY(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 开启电压
|
|
|
private void btnOpenVoltage_Click(object sender, EventArgs e)
|
|
|
{
|
|
@@ -479,6 +401,32 @@ namespace HOZProject
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region 电子束校正
|
|
|
+ private void btnTiltCorr_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetTiltCorrection();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ btnTiltCorr.BackColor = Color.Red;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(ret==0)
|
|
|
+ {
|
|
|
+ btnTiltCorr.BackColor = Color.Blue;
|
|
|
+ iSEM.SetTiltCorrectionOn();
|
|
|
+ btnTiltCorr.Text = "电子束状态:On";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ btnTiltCorr.BackColor = Color.Lime;
|
|
|
+ iSEM.SetTiltCorrectionOff();
|
|
|
+ btnTiltCorr.Text = "电子束状态:Off";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 样品台位置获取
|
|
|
private void btnStageGetX_Click(object sender, EventArgs e)
|
|
|
{
|
|
@@ -646,16 +594,7 @@ namespace HOZProject
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- private void btnDoSemDriftCorrn_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- iSEM.SetTiltCorrectionOff();
|
|
|
- }
|
|
|
-
|
|
|
- private void button1_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- iSEM.SetTiltCorrectionOn();
|
|
|
- }
|
|
|
-
|
|
|
+ #region 窗体关闭
|
|
|
private void FormUnitControl_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
{
|
|
|
if(iSEM!=null)
|
|
@@ -663,11 +602,14 @@ namespace HOZProject
|
|
|
iSEM.Dispose();
|
|
|
}
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
+ #region 宏文件
|
|
|
private void btnCMDMCF_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
iSEM.CMDMCFFilename("OPTON");
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
private void btnCreatXml_Click(object sender, EventArgs e)
|
|
|
{
|
|
@@ -681,14 +623,431 @@ namespace HOZProject
|
|
|
List<KeyValuePair<String, String>> lkvp = new List<KeyValuePair<string, string>>();
|
|
|
lkvp.Add(new KeyValuePair<string, string>("key1","value1"));
|
|
|
lkvp.Add(new KeyValuePair<string, string>("key2", "value2"));
|
|
|
- xmg.CreateXmlFile(fn,"XMLData",lkvp);
|
|
|
+ xmg.CreateXmlFile(fn,"XMLData");
|
|
|
|
|
|
lkvp.Clear();
|
|
|
lkvp.Add(new KeyValuePair<string, string>("key3", "value3"));
|
|
|
lkvp.Add(new KeyValuePair<string, string>("key4", "value4"));
|
|
|
- xmg.CreateNode(fn, "XMLData", "子节点", "", lkvp);
|
|
|
- xmg.CreateNode(fn, "子节点", "子bb节点", "", lkvp);
|
|
|
+ //xmg.CreateNode(fn, "XMLData", "子节点", "", lkvp);
|
|
|
+ //xmg.CreateNode(fn, "子节点", "子bb节点", "", lkvp);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void button1_Click_1(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ XmlDocument doc = new XmlDocument();
|
|
|
+ doc.Load("test.xml");//载入xml文件
|
|
|
+
|
|
|
+ XmlNode root = doc.SelectSingleNode("XMLData");
|
|
|
+
|
|
|
+ MeasureFile mf = new MeasureFile();
|
|
|
+
|
|
|
+ mf.FileName = "abcdefg";
|
|
|
+ mf.Serialize(true, doc, root);
|
|
|
+
|
|
|
+ doc.Save("test.xml");
|
|
|
+ }
|
|
|
+
|
|
|
+ #region SEM模式
|
|
|
+ private void btnSEM_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if(iSEM.CmdFIBModeSEM())
|
|
|
+ {
|
|
|
+ btnFIB.BackColor = SystemColors.Control;
|
|
|
+ btnSEM.BackColor = Color.Lime;
|
|
|
+ btnMILL.BackColor = SystemColors.Control;
|
|
|
+ panelFIB.Visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB模式
|
|
|
+ private void btnFIB_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if(iSEM.CmdFIBModeFIB())
|
|
|
+ {
|
|
|
+ btnFIB.BackColor = Color.Lime;
|
|
|
+ btnSEM.BackColor = SystemColors.Control;
|
|
|
+ btnMILL.BackColor = SystemColors.Control;
|
|
|
+ panelFIB.Visible = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region MILL模式
|
|
|
+ private void btnMILL_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if(iSEM.CmdFIBModeMILL())
|
|
|
+ {
|
|
|
+ btnFIB.BackColor = SystemColors.Control;
|
|
|
+ btnSEM.BackColor = SystemColors.Control;
|
|
|
+ btnMILL.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 自动对焦1
|
|
|
+ private void btnAutoFocus1_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.CmdAutoFocusCoarse();
|
|
|
+ btnAutoFocus1.BackColor = Color.Red;
|
|
|
+ st_flag = 1;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 自动函数监测线程
|
|
|
+ private void AutoFunction()
|
|
|
+ {
|
|
|
+ float ret = 111;
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ ret = iSEM.GetAutoFunction();
|
|
|
+ if(ret==0)
|
|
|
+ {
|
|
|
+ if (st_flag == 1)
|
|
|
+ {
|
|
|
+ btnAutoFocus1.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if(st_flag==2)
|
|
|
+ {
|
|
|
+ btnAutoFocus2.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if (st_flag == 3)
|
|
|
+ {
|
|
|
+ btnAutoBrightness.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if (st_flag == 4)
|
|
|
+ {
|
|
|
+ btnAutoContrast.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if (st_flag == 5)
|
|
|
+ {
|
|
|
+ btnAutoBrightness.BackColor = Color.Lime;
|
|
|
+ btnAutoContrast.BackColor = Color.Lime;
|
|
|
+ btnAutoBC.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if (st_flag == 6)
|
|
|
+ {
|
|
|
+ btnAutoBCCancle.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ else if (st_flag == 7)
|
|
|
+ {
|
|
|
+ btnAutoStig.BackColor = Color.Lime;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 自动对焦2
|
|
|
+ private void btnAutoFocus2_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.CmdAutoFocusFine();
|
|
|
+ btnAutoFocus2.BackColor = Color.Red;
|
|
|
+ st_flag = 2;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 自动亮度、对比度
|
|
|
+ private void btnAutoBrightness_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetAutoVideoBrightness();
|
|
|
+ btnAutoBrightness.BackColor = Color.Red;
|
|
|
+ st_flag = 3;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnAutoContrast_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetAutoVideoBrightness();
|
|
|
+ btnAutoContrast.BackColor = Color.Red;
|
|
|
+ st_flag = 4;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnAutoBC_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetAutoVideoBrightness();
|
|
|
+ btnAutoBrightness.BackColor = Color.Red;
|
|
|
+ btnAutoContrast.BackColor = Color.Red;
|
|
|
+ btnAutoBC.BackColor = Color.Red;
|
|
|
+ st_flag = 5;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnAutoBCCancle_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetAutoVideoOff();
|
|
|
+ btnAutoBCCancle.BackColor = Color.Red;
|
|
|
+ st_flag = 6;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 自动消像散
|
|
|
+ private void btnAutoStig_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.CmdAutoStig();
|
|
|
+ btnAutoStig.BackColor = Color.Red;
|
|
|
+ st_flag = 7;
|
|
|
+ Thread.Sleep(1000);
|
|
|
+ Thread thread = new Thread(AutoFunction);
|
|
|
+ thread.Start();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB缩放Get
|
|
|
+ private void btnFIBMagGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBMagnification();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtFIBMag.Text = "NaN";
|
|
|
+ txtFIBMag.Enabled = false;
|
|
|
+ btnFIBMagSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtFIBMag.Text = ret.ToString();
|
|
|
+ btnFIBMagSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB缩放Set
|
|
|
+ private void btnFIBMagSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtFIBMag.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetFIBMagnification(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB焦距Get
|
|
|
+ private void btnFIBWDGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBObjectivePotential();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtFIBWD.Text = "NaN";
|
|
|
+ txtFIBWD.Enabled = false;
|
|
|
+ btnFIBWDSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtFIBWD.Text = ret.ToString();
|
|
|
+ btnFIBWDSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB焦距Set
|
|
|
+ private void btnFIBWDSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtFIBWD.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetFIBObjectivePotential(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB电子束移动
|
|
|
+ private void btnFIBBeamShiftXGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBBeamShiftX();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtFIBBeamShiftX.Text = "NaN";
|
|
|
+ txtFIBBeamShiftX.Enabled = false;
|
|
|
+ btnFIBBeamShiftXSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtFIBBeamShiftX.Text = ret.ToString();
|
|
|
+ btnFIBBeamShiftXSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnFIBBeamShiftXSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtFIBBeamShiftX.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetFIBBeamShiftX(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnFIBBeamShiftYGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBBeamShiftY();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtFIBBeamShiftY.Text = "NaN";
|
|
|
+ txtFIBBeamShiftY.Enabled = false;
|
|
|
+ btnFIBBeamShiftYSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtFIBBeamShiftY.Text = ret.ToString();
|
|
|
+ btnFIBBeamShiftYSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnFIBBeamShiftYSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtFIBBeamShiftY.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetFIBBeamShiftY(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 执行宏文件
|
|
|
+ private void btnMCF_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ OpenFileDialog sfd = new OpenFileDialog();
|
|
|
+ sfd.Title = "选择宏文件:";
|
|
|
+ sfd.InitialDirectory = @"C:\ProgramData\Carl Zeiss\SmartSEM\User\Default";
|
|
|
+ sfd.Filter = "MLF文件|*.MLF";
|
|
|
+ if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ string fn = Path.GetFileNameWithoutExtension(sfd.FileName).ToUpper();
|
|
|
+ iSEM.CMDMCFFilename(fn);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region FIB消像散
|
|
|
+ private void btnFIBAstigmatismXGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBAstigmatismX();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtFIBAstigmatismX.Text = "NaN";
|
|
|
+ txtFIBAstigmatismX.Enabled = false;
|
|
|
+ btnFIBAstigmatismXSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtFIBAstigmatismX.Text = ret.ToString();
|
|
|
+ btnFIBAstigmatismXSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnFIBAstigmatismXSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtFIBAstigmatismX.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetFIBAstigmatismX(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnFIBAstigmatismYGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float ret = iSEM.GetFIBAstigmatismY();
|
|
|
+ if (float.IsNaN(ret))
|
|
|
+ {
|
|
|
+ txtFIBAstigmatismY.Text = "NaN";
|
|
|
+ txtFIBAstigmatismY.Enabled = false;
|
|
|
+ btnFIBAstigmatismYSet.Enabled = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ txtFIBAstigmatismY.Text = ret.ToString();
|
|
|
+ btnFIBAstigmatismYSet.Enabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnFIBAstigmatismYSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float set = 0;
|
|
|
+ if (float.TryParse(txtFIBAstigmatismY.Text, out set))
|
|
|
+ {
|
|
|
+ iSEM.SetFIBAstigmatismY(set);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 移动样品台XY
|
|
|
+ private void btnMoveXY_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ float setx = 0;
|
|
|
+ float sety = 0;
|
|
|
+ if (!float.TryParse(txtStageX.Text, out setx))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!float.TryParse(txtStageY.Text,out sety))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ btnMoveXY.BackColor = Color.Red;
|
|
|
+ iSEM.MoveStageXY(setx, sety);
|
|
|
+ Thread.Sleep(500);
|
|
|
+ Thread th = new Thread(MoveStagexy);
|
|
|
+ th.Start();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void MoveStagexy()
|
|
|
+ {
|
|
|
+ float ret = 111;
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ ret = iSEM.GetStageIs();
|
|
|
+ if(ret==0)
|
|
|
+ {
|
|
|
+ btnMoveXY.BackColor = Color.Lime;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 获取分辨率
|
|
|
+ private void btnImageStoreGet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ int[] ret = iSEM.GetImageStore();
|
|
|
+ lblImageStore.Text = ret[0].ToString() + "*" + ret[1].ToString();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 设置分辨率
|
|
|
+ private void btnImageStoreSet_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (cmbImageStore.SelectedIndex > -1 && cmbImageStore.SelectedIndex < 12)
|
|
|
+ {
|
|
|
+ iSEM.SetImageStore(cmbImageStore.SelectedIndex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 样品台急停
|
|
|
+ private void btnAbort_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.CmdStageAbort();
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|