|
@@ -704,6 +704,16 @@ namespace HOZProject
|
|
#region 自动对焦1
|
|
#region 自动对焦1
|
|
private void btnAutoFocus1_Click(object sender, EventArgs e)
|
|
private void btnAutoFocus1_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test1.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test1.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test1.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox1.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+ Thread.Sleep(1000);
|
|
iSEM.CmdAutoFocusCoarse();
|
|
iSEM.CmdAutoFocusCoarse();
|
|
btnAutoFocus1.BackColor = Color.Red;
|
|
btnAutoFocus1.BackColor = Color.Red;
|
|
st_flag = 1;
|
|
st_flag = 1;
|
|
@@ -719,6 +729,7 @@ namespace HOZProject
|
|
float ret = 111;
|
|
float ret = 111;
|
|
while(true)
|
|
while(true)
|
|
{
|
|
{
|
|
|
|
+ Thread.Sleep(1000);
|
|
ret = iSEM.GetAutoFunction();
|
|
ret = iSEM.GetAutoFunction();
|
|
if(ret==0)
|
|
if(ret==0)
|
|
{
|
|
{
|
|
@@ -752,6 +763,17 @@ namespace HOZProject
|
|
{
|
|
{
|
|
btnAutoStig.BackColor = Color.Lime;
|
|
btnAutoStig.BackColor = Color.Lime;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test2.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test2.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test2.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox2.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -761,6 +783,16 @@ namespace HOZProject
|
|
#region 自动对焦2
|
|
#region 自动对焦2
|
|
private void btnAutoFocus2_Click(object sender, EventArgs e)
|
|
private void btnAutoFocus2_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test1.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test1.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test1.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox1.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+ Thread.Sleep(1000);
|
|
iSEM.CmdAutoFocusFine();
|
|
iSEM.CmdAutoFocusFine();
|
|
btnAutoFocus2.BackColor = Color.Red;
|
|
btnAutoFocus2.BackColor = Color.Red;
|
|
st_flag = 2;
|
|
st_flag = 2;
|
|
@@ -773,6 +805,16 @@ namespace HOZProject
|
|
#region 自动亮度、对比度
|
|
#region 自动亮度、对比度
|
|
private void btnAutoBrightness_Click(object sender, EventArgs e)
|
|
private void btnAutoBrightness_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test1.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test1.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test1.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox1.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+ Thread.Sleep(1000);
|
|
iSEM.SetAutoVideoBrightness();
|
|
iSEM.SetAutoVideoBrightness();
|
|
btnAutoBrightness.BackColor = Color.Red;
|
|
btnAutoBrightness.BackColor = Color.Red;
|
|
st_flag = 3;
|
|
st_flag = 3;
|
|
@@ -783,6 +825,16 @@ namespace HOZProject
|
|
|
|
|
|
private void btnAutoContrast_Click(object sender, EventArgs e)
|
|
private void btnAutoContrast_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test1.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test1.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test1.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox1.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+ Thread.Sleep(1000);
|
|
iSEM.SetAutoVideoBrightness();
|
|
iSEM.SetAutoVideoBrightness();
|
|
btnAutoContrast.BackColor = Color.Red;
|
|
btnAutoContrast.BackColor = Color.Red;
|
|
st_flag = 4;
|
|
st_flag = 4;
|
|
@@ -793,6 +845,16 @@ namespace HOZProject
|
|
|
|
|
|
private void btnAutoBC_Click(object sender, EventArgs e)
|
|
private void btnAutoBC_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test1.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test1.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test1.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox1.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+ Thread.Sleep(1000);
|
|
iSEM.SetAutoVideoBrightness();
|
|
iSEM.SetAutoVideoBrightness();
|
|
btnAutoBrightness.BackColor = Color.Red;
|
|
btnAutoBrightness.BackColor = Color.Red;
|
|
btnAutoContrast.BackColor = Color.Red;
|
|
btnAutoContrast.BackColor = Color.Red;
|
|
@@ -817,6 +879,16 @@ namespace HOZProject
|
|
#region 自动消像散
|
|
#region 自动消像散
|
|
private void btnAutoStig_Click(object sender, EventArgs e)
|
|
private void btnAutoStig_Click(object sender, EventArgs e)
|
|
{
|
|
{
|
|
|
|
+ //抓图1
|
|
|
|
+ iSEM.GrabImage(path + "\\test1.tif", 0, 0, 1024, 768, 0);
|
|
|
|
+ if (File.Exists(path + "\\test1.tif"))
|
|
|
|
+ {
|
|
|
|
+ FileStream fileStream = new FileStream(path + "\\test1.tif", FileMode.Open, FileAccess.Read);
|
|
|
|
+ pictureBox1.Image = Image.FromStream(fileStream);
|
|
|
|
+ fileStream.Close();
|
|
|
|
+ fileStream.Dispose();
|
|
|
|
+ }
|
|
|
|
+ Thread.Sleep(1000);
|
|
iSEM.CmdAutoStig();
|
|
iSEM.CmdAutoStig();
|
|
btnAutoStig.BackColor = Color.Red;
|
|
btnAutoStig.BackColor = Color.Red;
|
|
st_flag = 7;
|
|
st_flag = 7;
|
|
@@ -1064,5 +1136,15 @@ namespace HOZProject
|
|
iSEM.CmdStageAbort();
|
|
iSEM.CmdStageAbort();
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
+
|
|
|
|
+ private void btnLive_Click(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ iSEM.ImageLive();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void btnFrozen_Click(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ iSEM.ImageFrozen();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|