|
@@ -33,11 +33,11 @@ namespace HOZProject
|
|
|
|
|
|
public XmlManager xmg = new XmlManager();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
private String path = Directory.GetCurrentDirectory();
|
|
|
private int st_flag = 0;
|
|
|
|
|
|
- WebResult wr = new WebResult("127.0.0.1", "18080", "Huawei/WebServerTest");
|
|
|
+ WebResult wr = new WebResult("127.0.0.1", "18080");
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
@@ -47,19 +47,19 @@ namespace HOZProject
|
|
|
|
|
|
Control.CheckForIllegalCrossThreadCalls = false;
|
|
|
|
|
|
- if (iSEM.ConnectStatus())
|
|
|
+ if(iSEM.ConnectStatus())
|
|
|
{
|
|
|
float ret = iSEM.GetFIBIMAGING();
|
|
|
- if (ret == 0)
|
|
|
+ if(ret==0)
|
|
|
{
|
|
|
btnSEM.BackColor = Color.Lime;
|
|
|
}
|
|
|
- else if (ret == 1)
|
|
|
+ else if(ret==1)
|
|
|
{
|
|
|
btnFIB.BackColor = Color.Lime;
|
|
|
panelFIB.Visible = true;
|
|
|
}
|
|
|
- else if (ret == 2)
|
|
|
+ else if(ret==2)
|
|
|
{
|
|
|
btnMILL.BackColor = Color.Lime;
|
|
|
}
|
|
@@ -71,7 +71,7 @@ namespace HOZProject
|
|
|
|
|
|
}
|
|
|
#endregion
|
|
|
-
|
|
|
+
|
|
|
#region 缩放Get
|
|
|
private void btnenlargeGet_Click(object sender, EventArgs e)
|
|
|
{
|
|
@@ -143,7 +143,7 @@ namespace HOZProject
|
|
|
btnBrightnessSet.Enabled = false;
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
+ {
|
|
|
txtBrightnessSet.Text = ret.ToString();
|
|
|
btnBrightnessSet.Enabled = true;
|
|
|
}
|
|
@@ -273,6 +273,7 @@ namespace HOZProject
|
|
|
float set = 0;
|
|
|
if (float.TryParse(txtTiltAngleSet.Text, out set))
|
|
|
{
|
|
|
+ //iSEM.SetTiltAngleOn();
|
|
|
iSEM.SetTiltAngle(set);
|
|
|
}
|
|
|
}
|
|
@@ -317,7 +318,7 @@ namespace HOZProject
|
|
|
float set = 0;
|
|
|
if (float.TryParse(txtScanRotationSet.Text, out set))
|
|
|
{
|
|
|
-
|
|
|
+ //iSEM.SetScanRotationOn();
|
|
|
iSEM.SetScanRotation(set);
|
|
|
}
|
|
|
}
|
|
@@ -414,7 +415,7 @@ namespace HOZProject
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (ret == 0)
|
|
|
+ if(ret==0)
|
|
|
{
|
|
|
btnTiltCorr.BackColor = Color.Blue;
|
|
|
iSEM.SetTiltCorrectionOn();
|
|
@@ -600,7 +601,7 @@ namespace HOZProject
|
|
|
#region 窗体关闭
|
|
|
private void FormUnitControl_FormClosing(object sender, FormClosingEventArgs e)
|
|
|
{
|
|
|
- if (iSEM != null)
|
|
|
+ if(iSEM!=null)
|
|
|
{
|
|
|
iSEM.Dispose();
|
|
|
}
|
|
@@ -700,20 +701,20 @@ namespace HOZProject
|
|
|
#region SEM模式
|
|
|
private void btnSEM_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- if (iSEM.CmdFIBModeSEM())
|
|
|
+ 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())
|
|
|
+ if(iSEM.CmdFIBModeFIB())
|
|
|
{
|
|
|
btnFIB.BackColor = Color.Lime;
|
|
|
btnSEM.BackColor = SystemColors.Control;
|
|
@@ -726,7 +727,7 @@ namespace HOZProject
|
|
|
#region MILL模式
|
|
|
private void btnMILL_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- if (iSEM.CmdFIBModeMILL())
|
|
|
+ if(iSEM.CmdFIBModeMILL())
|
|
|
{
|
|
|
btnFIB.BackColor = SystemColors.Control;
|
|
|
btnSEM.BackColor = SystemColors.Control;
|
|
@@ -762,11 +763,11 @@ namespace HOZProject
|
|
|
{
|
|
|
float ret = 111;
|
|
|
Boolean state = false;
|
|
|
- while (true)
|
|
|
+ while(true)
|
|
|
{
|
|
|
Thread.Sleep(1000);
|
|
|
ret = iSEM.GetAutoFunction();
|
|
|
- if (ret == 0)
|
|
|
+ if(ret==0)
|
|
|
{
|
|
|
if (st_flag == 1 && state == true)
|
|
|
{
|
|
@@ -783,7 +784,7 @@ namespace HOZProject
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
- else if (st_flag == 2 && state)
|
|
|
+ else if(st_flag==2 && state)
|
|
|
{
|
|
|
btnAutoFocus2.BackColor = Color.Lime;
|
|
|
Thread.Sleep(1000);
|
|
@@ -886,9 +887,9 @@ namespace HOZProject
|
|
|
// fileStream.Dispose();
|
|
|
//}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- else if (ret > 0 && ret < 12)
|
|
|
+ else if(ret>0 && ret<12)
|
|
|
{
|
|
|
state = true;
|
|
|
}
|
|
@@ -951,7 +952,7 @@ namespace HOZProject
|
|
|
fileStream.Dispose();
|
|
|
}
|
|
|
Thread.Sleep(1000);
|
|
|
- iSEM.SetAutoVideoBrightness();
|
|
|
+ iSEM.SetAutoVideoContrast();
|
|
|
btnAutoContrast.BackColor = Color.Red;
|
|
|
st_flag = 4;
|
|
|
Thread.Sleep(1000);
|
|
@@ -971,7 +972,7 @@ namespace HOZProject
|
|
|
fileStream.Dispose();
|
|
|
}
|
|
|
Thread.Sleep(1000);
|
|
|
- iSEM.SetAutoVideoBrightness();
|
|
|
+ iSEM.SetAutoVideoBrightnessAndContrast();
|
|
|
btnAutoBrightness.BackColor = Color.Red;
|
|
|
btnAutoContrast.BackColor = Color.Red;
|
|
|
btnAutoBC.BackColor = Color.Red;
|
|
@@ -1133,9 +1134,8 @@ namespace HOZProject
|
|
|
sfd.Filter = "MLF文件|*.MLF";
|
|
|
if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
{
|
|
|
- string fn = Path.GetFileNameWithoutExtension(sfd.FileName).ToUpper();
|
|
|
- iSEM.CMDMCFFilename(fn);
|
|
|
-
|
|
|
+ //string fn = Path.GetFileNameWithoutExtension(sfd.FileName).ToUpper();
|
|
|
+ iSEM.CMDMCFFilename(sfd.FileName);
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -1201,7 +1201,7 @@ namespace HOZProject
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- if (!float.TryParse(txtStageY.Text, out sety))
|
|
|
+ if(!float.TryParse(txtStageY.Text,out sety))
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -1215,10 +1215,10 @@ namespace HOZProject
|
|
|
private void MoveStagexy()
|
|
|
{
|
|
|
float ret = 111;
|
|
|
- while (true)
|
|
|
+ while(true)
|
|
|
{
|
|
|
ret = iSEM.GetStageIs();
|
|
|
- if (ret == 0)
|
|
|
+ if(ret==0)
|
|
|
{
|
|
|
btnMoveXY.BackColor = Color.Lime;
|
|
|
break;
|
|
@@ -1265,25 +1265,26 @@ namespace HOZProject
|
|
|
|
|
|
private void btnExeEly_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- iSEM.CmdFIBLoadELY(@"E:\HOZ\MillStep2.ely");
|
|
|
+ OpenFileDialog sfd = new OpenFileDialog();
|
|
|
+ sfd.Title = "选择ELY文件:";
|
|
|
+ //sfd.InitialDirectory = @"C:\ProgramData\Carl Zeiss\SmartSEM\User\Default";
|
|
|
+ sfd.Filter = "ELY文件|*.ELY";
|
|
|
+ if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ iSEM.CmdFIBLoadELY(sfd.FileName);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void btnExeEly2_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- iSEM.CmdFIBLoadELY(@"E:\HOZ\MillStep4.ely");
|
|
|
+ iSEM.CmdFIBEXPOSUREELY();
|
|
|
}
|
|
|
|
|
|
private void btnFIBStatus_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- btnFIBStatus.Text = iSEM.GetFIBApiStatus().ToString();
|
|
|
+ btnFIBStatus.Text = iSEM.GetFIBMode().ToString();
|
|
|
}
|
|
|
|
|
|
- //测量线程测试
|
|
|
- private void button1_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- //FormMeasureTest Measure = new FormMeasureTest();
|
|
|
- //Measure.Show();
|
|
|
- }
|
|
|
|
|
|
private void btnPost1_Click(object sender, EventArgs e)
|
|
|
{
|
|
@@ -1365,84 +1366,54 @@ namespace HOZProject
|
|
|
lblstate6.Text = state.ToString();
|
|
|
}
|
|
|
|
|
|
- //private void btnPost1_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // double degree = 0;
|
|
|
- // int direction = 0;
|
|
|
- // int state = 0;
|
|
|
- // wr.Img_OffsetAngle_Direction("D:/aaaa.jpg", out degree, out direction, out state);
|
|
|
- // lbldegree1.Text = degree.ToString("0.0");
|
|
|
- // lbldirection1.Text = direction.ToString();
|
|
|
- // lblstate1.Text = state.ToString();
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost2_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // double offsetx = 0;
|
|
|
- // double offsety = 0;
|
|
|
- // int state = 0;
|
|
|
- // wr.Img_Cut_Position("D:/aaaa.jpg", out offsetx, out offsety, out state);
|
|
|
- // lbllocationx.Text = offsetx.ToString("0.0");
|
|
|
- // lbllocationy.Text = offsety.ToString("0.0");
|
|
|
- // lblstate2.Text = state.ToString();
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost3_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // int state = 0;
|
|
|
- // wr.Img_Cut_Success("D:/aaaa.jpg", "D:/bbbb.jpg", out state);
|
|
|
- // lblstate3.Text = state.ToString();
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost4_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // double offsetx = 0;
|
|
|
- // double offsety = 0;
|
|
|
- // int state = 0;
|
|
|
- // wr.Img_Trapezoid_Top_Center_Position("D:/aaaa.jpg", out offsetx, out offsety, out state);
|
|
|
- // lbltopcx.Text = offsetx.ToString("0.0");
|
|
|
- // lbltopcy.Text = offsety.ToString("0.0");
|
|
|
- // lblstate4.Text = state.ToString();
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost5_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // List<string> filenames = new List<string>();
|
|
|
- // filenames.Add("1111111");
|
|
|
- // filenames.Add("2222222");
|
|
|
- // filenames.Add("3333333");
|
|
|
- // lblfocuspath.Text = wr.Img_Auto_Focus(filenames);
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost6_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // List<string> filenames = new List<string>();
|
|
|
- // filenames.Add("1111111");
|
|
|
- // filenames.Add("2222222");
|
|
|
- // filenames.Add("3333333");
|
|
|
- // lblstigpath.Text = wr.Img_Auto_Focus(filenames);
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost7_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // double offsetx = 0;
|
|
|
- // double offsety = 0;
|
|
|
- // double degree = 0;
|
|
|
- // int direction = 0;
|
|
|
- // int state = 0;
|
|
|
- // wr.Img_Center_Position_OffsetAngle_Direction("D:/aaaa.jpg", out offsetx, out offsety, out degree, out direction, out state);
|
|
|
- // lblcenterx.Text = offsetx.ToString("0.0");
|
|
|
- // lblcentery.Text = offsety.ToString("0.0");
|
|
|
- // lbldegree2.Text = degree.ToString();
|
|
|
- // lbldirection2.Text = direction.ToString();
|
|
|
- // lblstate5.Text = state.ToString();
|
|
|
- //}
|
|
|
-
|
|
|
- //private void btnPost8_Click(object sender, EventArgs e)
|
|
|
- //{
|
|
|
- // int state = 0;
|
|
|
- // wr.Img_Measure_Size("D:/aaaa.jpg", "1000", "0.005", out state);
|
|
|
- // lblstate6.Text = state.ToString();
|
|
|
- //}
|
|
|
+ private void btnScanRotationSetLock_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetScanRotationOff();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void button1_Click_1(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetTiltAngleOff();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnTiltAngleSetOn_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetTiltAngleOn();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnScanRotationSetOn_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.SetScanRotationOn();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnExeEly3_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ iSEM.CmdFIBSTARTELY();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnCreateConfig_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ ConfigManager cfm = new ConfigManager();
|
|
|
+ cfm.PT_Depostion = chkpt0.Checked;
|
|
|
+ cfm.Template_File = txtTemplateFile.Text;
|
|
|
+ cfm.Sample_Name = txtSampleName.Text;
|
|
|
+ cfm.M_Config_Param.Voltage = Convert.ToDouble(txtvoltage.Text);
|
|
|
+ cfm.M_Config_Param.Magnification = Convert.ToDouble(txtMag.Text);
|
|
|
+ cfm.M_Config_Param.Pixel_Size = Convert.ToDouble(txtpixel.Text);
|
|
|
+ cfm.CreateXml(@"E:\test.cfg");
|
|
|
+ cfm.Save(@"E:\test.cfg");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void btnReadConfig_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ ConfigManager cfm = new ConfigManager();
|
|
|
+ cfm.Read(@"E:\test.cfg");
|
|
|
+ this.ckbPT.Checked = cfm.PT_Depostion;
|
|
|
+ this.lblTemplateFile.Text = cfm.Template_File;
|
|
|
+ this.lblSampleName.Text = cfm.Sample_Name;
|
|
|
+ this.lblvoltage.Text = cfm.M_Config_Param.Voltage.ToString();
|
|
|
+ this.lblmag.Text = cfm.M_Config_Param.Magnification.ToString();
|
|
|
+ this.lblpixel.Text = cfm.M_Config_Param.Pixel_Size.ToString();
|
|
|
+ }
|
|
|
}
|
|
|
}
|