|
|
@@ -11,6 +11,8 @@ using Newtonsoft.Json.Linq;
|
|
|
using OTSDataType;
|
|
|
using OTSModelSharp;
|
|
|
using System.Windows;
|
|
|
+using NSOTSController;
|
|
|
+using static OTSDataType.otsdataconst;
|
|
|
|
|
|
namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
@@ -65,7 +67,12 @@ namespace OTSIncAMeasureApp
|
|
|
//测量样品链表
|
|
|
List<COTSSample> m_MeasureSampleList = new List<COTSSample>();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
+
|
|
|
+ public OTS_MSR_THREAD_STATUS Status;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public OTSDataMgrFun(OTSIncAMeasureAppForm MeasureApp)
|
|
|
{
|
|
|
@@ -281,7 +288,7 @@ namespace OTSIncAMeasureApp
|
|
|
if (!m_ProjDataMgr.Save())
|
|
|
{
|
|
|
//取消保存
|
|
|
- m_MeasureAppFrom.Nloger.TraceLog("(OTSDataMgrFun.CreateNewFile) Save Cancel");
|
|
|
+ Nloger.Trace("(OTSDataMgrFun.CreateNewFile) Save Cancel");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -821,7 +828,7 @@ namespace OTSIncAMeasureApp
|
|
|
//获取样品孔名称
|
|
|
SampleMeasureArea.sHoleName = (m_ProjDataMgr.GetSampleList())[i].GetSampleHoleName();
|
|
|
//样品测量区域
|
|
|
- SampleMeasureArea.MeasureRect = (Rectangle)(m_ProjDataMgr.GetSampleList())[i].GetMsrArea();//.GetRectDomain();
|
|
|
+ SampleMeasureArea.MeasureRect = (Rectangle)(m_ProjDataMgr.GetSampleList())[i].GetMsrArea().GetRectDomain(); ;//.GetRectDomain();
|
|
|
SampleMeasureAreaList.Add(SampleMeasureArea);
|
|
|
}
|
|
|
return true;
|
|
|
@@ -1076,7 +1083,7 @@ namespace OTSIncAMeasureApp
|
|
|
|
|
|
//获取幁图数
|
|
|
//ref List<Point> pField: 幁图数
|
|
|
- public bool GetField(ref List<System.Windows.Point> pField, ref System.Drawing.Size iSzie)
|
|
|
+ public bool GetField(ref List<System.Drawing.Point> pField, ref System.Drawing.Size iSzie)
|
|
|
{
|
|
|
COTSSample WSample = m_ProjDataMgr.GetWorkingSample();
|
|
|
if (null == WSample)
|
|
|
@@ -1097,7 +1104,7 @@ namespace OTSIncAMeasureApp
|
|
|
pSEMDataMsr.SetTotalFields(m_ProjDataMgr.GetWorkingSample().GetSEMDataMsr().GetTotalFields());
|
|
|
pSEMDataMsr.SetWorkingDistance(m_ProjDataMgr.GetWorkingSample().GetSEMDataMsr().GetWorkingDistance());
|
|
|
CFieldMgr pFieldMgr = new CFieldMgr();
|
|
|
- List<System.Windows.Point> listPoint = new List<System.Windows.Point>();
|
|
|
+ List<System.Drawing.Point> listPoint = new List<System.Drawing.Point>();
|
|
|
listPoint.Clear();
|
|
|
//设置测量区域
|
|
|
CSEMDataMsr pSEMDataMsrTemp = pSEMDataMsr;
|
|
|
@@ -1129,7 +1136,7 @@ namespace OTSIncAMeasureApp
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- m_MeasureAppFrom.Nloger.TraceErrorLog("获取幁图数问题:" + ex.ToString());
|
|
|
+ Nloger.Error("获取幁图数问题:" + ex.ToString());
|
|
|
}
|
|
|
//初始化
|
|
|
if (!pFieldMgr.Init(pMsrArea, pImgScanParam, pSEMDataMsr, listPoint))
|
|
|
@@ -1144,12 +1151,12 @@ namespace OTSIncAMeasureApp
|
|
|
//获取幁图数
|
|
|
int iFieldCount = pFieldMgr.GetTotalFields();
|
|
|
|
|
|
- Rect oValue = new Rect();
|
|
|
+ System.Drawing.Rectangle oValue = new System.Drawing.Rectangle();
|
|
|
if (!pFieldMgr.GetFieldRectByIndex(0, oValue))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
- iSzie = ((Rect)oValue).Size;
|
|
|
+ iSzie = oValue.Size;
|
|
|
//将幁图数赋值给工作样品后
|
|
|
m_ProjDataMgr.GetWorkingSample().GetSEMDataMsr().SetTotalFields(iFieldCount);
|
|
|
return true;
|
|
|
@@ -1221,14 +1228,14 @@ namespace OTSIncAMeasureApp
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- COTSImgProcPrm ImgProcPrm = WSample.GetMsrParams().GetImageProcessParam();
|
|
|
+ OTSDataType.COTSImgProcPrm ImgProcPrm = WSample.GetMsrParams().GetImageProcessParam();
|
|
|
|
|
|
- if (!m_ProjDataMgr.RemoveBackGround(pBSEImageIn, ImgProcPrm, ref pBSEImageOut))
|
|
|
+ if (!m_ProjDataMgr.RemoveBackGround(pBSEImageIn, ImgProcPrm, pBSEImageOut))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- BSEImageNoBG = pBSEImageOut.GetImageDataPtr();
|
|
|
+ BSEImageNoBG = pBSEImageOut.GetImageDataPtr(); //public byte[] GetImageDataPtr();
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1494,7 +1501,7 @@ namespace OTSIncAMeasureApp
|
|
|
public void SetMeasureThreadStatus(MSR_THREAD_STATUS ThreadStatus)
|
|
|
{
|
|
|
//设置测量线程状态
|
|
|
- m_MsrThread.SetMsrLoopStatus((int)ThreadStatus);
|
|
|
+ m_MsrThread.SetMsrLoopStatus(Status);
|
|
|
}
|
|
|
|
|
|
//保存测量样品的
|
|
|
@@ -1505,7 +1512,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
- m_MeasureAppFrom.Nloger.TraceLog("(OTSDataMgrFun.SaveMeasureSampleInfo.GetNewProjMgrClr()) m_ProjDataMgr.GetSampleList().Count = " + m_ProjDataMgr.GetSampleList().Count.ToString());
|
|
|
+ Nloger.Trace("(OTSDataMgrFun.SaveMeasureSampleInfo.GetNewProjMgrClr()) m_ProjDataMgr.GetSampleList().Count = " + m_ProjDataMgr.GetSampleList().Count.ToString());
|
|
|
if (!m_ProjDataMgr.Save())
|
|
|
{
|
|
|
return false;
|
|
|
@@ -1539,13 +1546,13 @@ namespace OTSIncAMeasureApp
|
|
|
|
|
|
|
|
|
//获取新的工作文件对象
|
|
|
- public CProjMgr GetNewProjMgrClr()
|
|
|
+ public COTSProjMgrFile GetNewProjMgrClr()
|
|
|
{
|
|
|
if (null == m_MsrThread)
|
|
|
{
|
|
|
return null; ;
|
|
|
}
|
|
|
- return m_MsrThread.GetProjMgr();
|
|
|
+ return m_MsrThread.GetProjMgrFile();
|
|
|
}
|
|
|
|
|
|
// 获取测量结果信息
|
|
|
@@ -1605,7 +1612,7 @@ namespace OTSIncAMeasureApp
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- m_MeasureAppFrom.Nloger.TraceErrorLog("(OTSDataMgrFun.GetMsrRetData) Exception:"+ex.ToString());
|
|
|
+ Nloger.Error("(OTSDataMgrFun.GetMsrRetData) Exception:"+ex.ToString());
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -1621,7 +1628,7 @@ namespace OTSIncAMeasureApp
|
|
|
}
|
|
|
|
|
|
MsrSampleName = WSample.GetName();
|
|
|
- FieldList = WSample.GetMsrStatus().GetCpltedCenter();
|
|
|
+ FieldList = WSample.GetMsrStatus().GetCompletedFieldsCenter();
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -1713,6 +1720,8 @@ namespace OTSIncAMeasureApp
|
|
|
public class OTSBSEImageFun : OTSImageInterface
|
|
|
{
|
|
|
OTSIncAMeasureAppForm m_MsrApp = null;
|
|
|
+
|
|
|
+ public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
public OTSBSEImageFun(OTSIncAMeasureAppForm MsrApp)
|
|
|
{
|
|
|
m_MsrApp = MsrApp;
|
|
|
@@ -1730,7 +1739,7 @@ namespace OTSIncAMeasureApp
|
|
|
if (!IsConnec)
|
|
|
{
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.ConncetSem() = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
//实例电镜初始化
|
|
|
@@ -1738,7 +1747,7 @@ namespace OTSIncAMeasureApp
|
|
|
if (!IsScan)
|
|
|
{
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.ScanInit = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1754,7 +1763,7 @@ namespace OTSIncAMeasureApp
|
|
|
if (!cfun.GetSemScanMode(ref a_oldMode))
|
|
|
{
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemScanMode = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1763,7 +1772,7 @@ namespace OTSIncAMeasureApp
|
|
|
if (!cfun.SetSemScanMode(a_ExternalMode))
|
|
|
{
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetSemScanMode = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1776,7 +1785,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemBeamBlank = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1785,7 +1794,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetSemBeamBlank = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1800,7 +1809,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemMagnification = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1817,7 +1826,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.GetSemPositionXY = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1830,7 +1839,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetImageSize = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1844,7 +1853,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.SetDwellTime = false Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -1888,7 +1897,7 @@ namespace OTSIncAMeasureApp
|
|
|
{
|
|
|
cfun.SetSemScanMode(a_oldMode);
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) cfun.AcquireBSEImage = 0 Failed";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
|
|
|
//初始化电镜参数
|
|
|
if (!cfun.SetAndStartScan())
|
|
|
@@ -1901,9 +1910,9 @@ namespace OTSIncAMeasureApp
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
//记录日志
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(ex.Message.ToString());
|
|
|
+ Nloger.Error(ex.Message.ToString());
|
|
|
string strErrorInfo = "(OTSBSEImageFun.GetScanImage) Exception Error Happend";
|
|
|
- m_MsrApp.Nloger.TraceErrorLog(strErrorInfo);
|
|
|
+ Nloger.Error(strErrorInfo);
|
|
|
|
|
|
}
|
|
|
finally
|