|
@@ -17,6 +17,7 @@ using FileManager;
|
|
|
using WebManager;
|
|
|
|
|
|
using OpenCvSharp;
|
|
|
+using Extender;
|
|
|
|
|
|
namespace MeasureThread
|
|
|
{
|
|
@@ -442,6 +443,10 @@ namespace MeasureThread
|
|
|
static FactoryHardware factorySEM = FactoryHardware.Instance;
|
|
|
ISEMControl iSEM = factorySEM.ISEM;
|
|
|
|
|
|
+ //全局只有一个Extender
|
|
|
+ static ExtenderInterface factoryExtender = null;// ExtenderInterface.Instance;
|
|
|
+ IExtenderControl iExtender = null;// factoryExtender.IExtender;
|
|
|
+
|
|
|
//@的作用是不用转义字符\\只打一个就行
|
|
|
const String ImageName0 = @"Straighten.tif"; //传给客户,原始图像,为拉直操作
|
|
|
const String ImageName1 = @"FindCutPostion.tif"; //传给客户,作水平校正
|
|
@@ -451,6 +456,7 @@ namespace MeasureThread
|
|
|
const String ImageName4 = @"SEMTrapCP.tif";//传给客户,找到已经切割点
|
|
|
const String ImageName5 = @"SEMDegreeTrap.tif";//传给客户,水平校正
|
|
|
const String ImageName6 = @"SEMMagEnd.tif";//传给客户,测量层高
|
|
|
+ const String ImageName7 = @"EDSImage.tif";//计算感兴趣的区域
|
|
|
|
|
|
const String MacoInsertPt = "GIS Insert.MLF"; //传入PT针
|
|
|
const String MacoRetractPt = "GIS Retract.MLF"; //退出PT针
|
|
@@ -469,6 +475,7 @@ namespace MeasureThread
|
|
|
String FIBfocus_path = "";
|
|
|
String StigX_path = "";
|
|
|
String StigY_path = "";
|
|
|
+ String EDS_path = "";
|
|
|
String data_path = "";
|
|
|
|
|
|
int m_nWorkHoleNo = -1;
|
|
@@ -545,6 +552,12 @@ namespace MeasureThread
|
|
|
|
|
|
this.m_MsParam = m_measureFile.MParam;
|
|
|
|
|
|
+ if(m_measureFile.MParam.EDS == true)
|
|
|
+ {
|
|
|
+ factoryExtender = ExtenderInterface.Instance;
|
|
|
+ iExtender = factoryExtender.IExtender;
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -563,6 +576,51 @@ namespace MeasureThread
|
|
|
SendCutHolesStatus(this, arg);
|
|
|
}
|
|
|
|
|
|
+ public bool DoEDS()
|
|
|
+ {
|
|
|
+ EDSParam param = m_measureFile.MParam.EDSP;
|
|
|
+ double dDwellTime = param.DwellTime;
|
|
|
+ int nImageType = param.ImageType;
|
|
|
+ double dScanSizes = param.ScanSize;
|
|
|
+ iExtender.SetImageAcquistionSetting(dDwellTime, nImageType, dScanSizes);
|
|
|
+
|
|
|
+ string path = EDS_path;
|
|
|
+ iExtender.GrabImage(path + "\\EDSImage.tif", 0, 0, 0, 0, 0);
|
|
|
+
|
|
|
+ //送给客户,计算感兴趣的区域
|
|
|
+ if (param.PointMode == true)
|
|
|
+ {
|
|
|
+ //点采集
|
|
|
+ List<Point> listPoints = new List<Point>();
|
|
|
+
|
|
|
+ foreach (Point pt in listPoints)
|
|
|
+ {
|
|
|
+ long[] XrayData = new long[2000];
|
|
|
+ Dictionary<string, double> listElement = new Dictionary<string, double>();
|
|
|
+ iExtender.XrayPointCollectiong(param.PointTime, pt.X, pt.Y, out XrayData, out listElement);
|
|
|
+
|
|
|
+ //写入数据库
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (param.AreaMode == true)
|
|
|
+ {
|
|
|
+ //面采集
|
|
|
+ long[] XrayData = new long[2000];
|
|
|
+ Dictionary<string, double> listElement = new Dictionary<string, double>();
|
|
|
+
|
|
|
+ List<List<Segment>> listFeature = new List<List<Segment>>();
|
|
|
+
|
|
|
+ foreach (List < Segment> listSeg in listFeature)
|
|
|
+ {
|
|
|
+ iExtender.XrayAreaCollectiong(param.AreaTime, listSeg, out XrayData, out listElement);
|
|
|
+
|
|
|
+ //写入数据库
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
//测量流程
|
|
|
public void DoMeasure()
|
|
|
{
|
|
@@ -592,6 +650,8 @@ namespace MeasureThread
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ //增加EDS控制
|
|
|
+
|
|
|
//将停止键复位
|
|
|
key_stop = false;
|
|
|
|
|
@@ -637,23 +697,33 @@ namespace MeasureThread
|
|
|
//FIB对焦数据存放目录
|
|
|
FIBfocus_path = WorkingFolder + "\\" + m_cutHoles[i].HoleName + "\\FIBFocus";
|
|
|
m_MsParam.FIBFocus.Path = FIBfocus_path;
|
|
|
- if (!Directory.Exists(focus_path))
|
|
|
+ if (!Directory.Exists(FIBfocus_path))
|
|
|
{
|
|
|
- Directory.CreateDirectory(focus_path);
|
|
|
+ Directory.CreateDirectory(FIBfocus_path);
|
|
|
}
|
|
|
//StigX数据存放目录
|
|
|
StigX_path = WorkingFolder + "\\" + m_cutHoles[i].HoleName + "\\StigX";
|
|
|
m_MsParam.AutoStigX.Path = StigX_path;
|
|
|
- if (!Directory.Exists(focus_path))
|
|
|
+ if (!Directory.Exists(StigX_path))
|
|
|
{
|
|
|
- Directory.CreateDirectory(focus_path);
|
|
|
+ Directory.CreateDirectory(StigX_path);
|
|
|
}
|
|
|
//StigY数据存放目录
|
|
|
StigY_path = WorkingFolder + "\\" + m_cutHoles[i].HoleName + "\\StigY";
|
|
|
m_MsParam.AutoStigY.Path = StigY_path;
|
|
|
- if (!Directory.Exists(focus_path))
|
|
|
+ if (!Directory.Exists(StigY_path))
|
|
|
{
|
|
|
- Directory.CreateDirectory(focus_path);
|
|
|
+ Directory.CreateDirectory(StigY_path);
|
|
|
+ }
|
|
|
+ //EDS数据存放路径
|
|
|
+ if (m_measureFile.MParam.EDS == true)
|
|
|
+ {
|
|
|
+ EDS_path = WorkingFolder + "\\" + m_cutHoles[i].HoleName + "\\EDS";
|
|
|
+ m_MsParam.AutoStigY.Path = EDS_path;
|
|
|
+ if (!Directory.Exists(EDS_path))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(EDS_path);
|
|
|
+ }
|
|
|
}
|
|
|
//判断孔状态
|
|
|
if (m_cutHoles[i].STATE != State.Ready)
|