#pragma once /** @file @brief OTSControl DLL Interface provide for C# @author xiaoxing.zhang,Anna Hao @version 1.0.0.0 @date 2017/6/28 - 2017/6/28 1.0.0.0 xiaoxing.zhang developed SEM Interface - 2017/6/28 1.0.0.0 Anna Hao developed Scan Interface - 2017/6/29 1.0.0.0 Anna Hao developed EDS Interface - - 2017/7/3 1.0.0.0 xiaoxing.zhang Add log for SemInterface */ #include "BSEImg.h" #include "COTSHardwareMgr.h" #include "Bruker/OTSBrukerImpl_const.h" using namespace System; using namespace System::Drawing; const CString g_LogName = "_OTSControl"; CString g_cstLogData = ""; namespace NSOTSController { using namespace OTSController; public ref class COTSSimuControlClr { public: COTSSimuControlClr(); ~COTSSimuControlClr(); !COTSSimuControlClr(); public: bool Connect(); bool Disconnect(); bool SetWorkingDistance(double a_dWorkingDistance); bool GetWorkingDistance(double% a_dWorkingDistance); bool SetMagnification(double a_dMag); bool GetMagnification(double% a_dMag); }; public ref class COTSControlFunExport { public: COTSControlFunExport(String^ cstLogName) { // CString stLogName = cstLogName+g_LogName; m_LpHardWareMgr = NULL; m_LpSemBase = NULL; m_LpScanBase = NULL; m_LpEDSBase = NULL; this->InitDevPoint(); LogInfoTrace(__FILE__, __LINE__, "***************** Init OTSContrll ***************"); } ~COTSControlFunExport() { if (nullptr != m_LpHardWareMgr) { delete m_LpHardWareMgr; m_LpHardWareMgr = nullptr; } } !COTSControlFunExport() { if (nullptr != m_LpHardWareMgr) { delete m_LpHardWareMgr; m_LpHardWareMgr = nullptr; } } public: void InitDevPoint(); //获取当前电镜的ID号 int GetSemType() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemType ***************"); int ID = 0; ID = (int)m_LpSemBase->GetType(); //log LogTrace(__FILE__, __LINE__, " GetSemType(), ID = %d ", ID); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&& Exit GetSemType ***************"); return ID; } //和电镜建立通讯连接 bool ConncetSem() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter ConncetSem ***************"); BOOL bRev = m_LpSemBase->Connect(); //log LogInfoTrace(__FILE__, __LINE__, "ConncetSem(), bRev = %d", bRev); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit ConncetSem &&&&&&&&&&&&&&&&"); return bRev; } //断开电镜连接 bool DisConnectSem() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter DisConnectSem ***************"); BOOL bRev = m_LpSemBase->Disconnect(); LogInfoTrace(__FILE__, __LINE__, "DisConnectSem(), bRev = %d", bRev); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit DisConnectSem &&&&&&&&&&&&&&&&"); return bRev; } //获得扫描区域大小 Size GetSemScanField100() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemScanField100 ***************"); Size sz; CSize size = m_LpSemBase->GetScanField100(); sz.Width = size.cx; sz.Height = size.cy; LogTrace(__FILE__, __LINE__, "GetSemScanField100(), CSize.x = %d, CSize.y = %d", size.cx, size.cx); LogInfoTrace(__FILE__, __LINE__, " &&&&&&&&&&&&&&&&&& Exit GetSemScanField100 &&&&&&&&&&&&&&&& "); return sz; } //设置扫描区域大小 void SetSemScanField100(Size sz) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemScanField100 ***************"); LogTrace(__FILE__, __LINE__, "SetSemScanField100(sz.x = %d, sz.y = %d)", sz.Width, sz.Height); CSize size; size.cx = sz.Width; size.cy = sz.Height; m_LpSemBase->SetScanField100(size); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemScanField100 &&&&&&&&&&&&&&&& "); } bool GetSemBeamBlank(long% a_nBeamBlank) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemBeamBlank ***************"); long lBBlank = 0; BOOL bRev = m_LpSemBase->GetBeamBlank(lBBlank); a_nBeamBlank = lBBlank; LogTrace(__FILE__, __LINE__, "GetSemBeamBlank(long a_nBeamBlank = %f)", a_nBeamBlank); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemBeamBlank &&&&&&&&&&&&&&&&"); return bRev; } bool SetSemBeamBlank(long a_nBeamBlank) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemBeamBlank ***************"); LogInfoTrace(__FILE__, __LINE__, "SetSemBeamBlank(long a_nBeamBlank = %f)", a_nBeamBlank); BOOL bRev = m_LpSemBase->SetBeamBlank(a_nBeamBlank); LogTrace(__FILE__, __LINE__, "COTSControlFunExport::SetSemBeamBlank(long a_nBeamBlank = %f) ) bRev = %d ", a_nBeamBlank, bRev); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemBeamBlank &&&&&&&&&&&&&&&&"); return bRev; } //获得亮度 bool GetSemBrightness(double% a_dBrightness) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemBrightness ***************"); double dBriness = 0; BOOL bRev = m_LpSemBase->GetBrightness(dBriness); a_dBrightness = dBriness; LogTrace(__FILE__, __LINE__, "GetSemBrightness(double a_dBrightness = %f)", a_dBrightness); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemBrightness &&&&&&&&&&&&&&&&"); return bRev; } //设置亮度 bool SetSemBrightness(double a_dBrightness) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemBrightness ***************"); LogTrace(__FILE__, __LINE__, "SetSemBrightness(double a_dBrightness = %f)", a_dBrightness); BOOL bRev = m_LpSemBase->SetBrightness(a_dBrightness); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemBeamBlank &&&&&&&&&&&&&&&&"); return bRev; } //获得对比度 bool GetSemContrast(double% a_dContrast) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemContrast ***************"); double dContrast = 0; BOOL bRev = m_LpSemBase->GetContrast(dContrast); a_dContrast = dContrast; LogTrace(__FILE__, __LINE__, "GetSemContrast(double a_dContrast = %f)", a_dContrast); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemContrast &&&&&&&&&&&&&&&&"); return bRev; } //设置对比度 bool SetSemContrast(double a_dContrast) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemContrast ***************"); LogTrace(__FILE__, __LINE__, "SetSemContrast(double a_dContrast = %f)", a_dContrast); BOOL bRev = m_LpSemBase->SetContrast(a_dContrast); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemContrast &&&&&&&&&&&"); return bRev; } //获得Z轴的工作距离 bool GetSemWorkingDistance(double% a_dWorkingDistance) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemWorkingDistance ***************"); double dWDistance = 0; BOOL bRev = m_LpSemBase->GetWorkingDistance(dWDistance); a_dWorkingDistance = dWDistance; LogTrace(__FILE__, __LINE__, "GetSemWorkingDistance(double a_dWorkingDistance = %f)", a_dWorkingDistance); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemWorkingDistance &&&&&&&&&&&&&&&&"); return bRev; } // 设置Z轴工作距离 bool SetSemWorkingDistance(double a_dWorkingDistance) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemWorkingDistance ***************"); LogTrace(__FILE__, __LINE__, "SetSemWorkingDistance(double a_dWorkingDistance = %f)", a_dWorkingDistance); BOOL bRev = m_LpSemBase->SetWorkingDistance(a_dWorkingDistance); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemWorkingDistance &&&&&&&&&&&&&&&&"); return bRev; } // 获得电压值 bool GetSemHighTension(double% a_dKV) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemHighTension ***************"); double dDKV = 0; BOOL bRev = m_LpSemBase->GetHighTension(dDKV); a_dKV = dDKV; LogTrace(__FILE__, __LINE__, "GetSemHighTension(double a_dKV = %f)", a_dKV); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemHighTension &&&&&&&&&&&&&&&&"); return bRev; } // 设置电压值 bool SetSemHighTension(double a_dKV) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemHighTension ***************"); LogTrace(__FILE__, __LINE__, "SetSemHighTension(double a_dKV = %f)", a_dKV); BOOL bRev = m_LpSemBase->SetHighTension(a_dKV); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemHighTension &&&&&&&&&&&&&&&&"); return bRev; } //获得放大倍数 bool GetSemMagnification(double% a_dMagnification) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemMagnification ***************"); double dMagni = 0; BOOL bRev = m_LpSemBase->GetMagnification(dMagni); a_dMagnification = dMagni; LogTrace(__FILE__, __LINE__, "GetSemMagnification(double a_dMagnification = %f)", a_dMagnification); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemMagnification &&&&&&&&&&&&&&&&"); return bRev; } //设置放大倍数 bool SetSemMagnification(double a_dMagnification) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemMagnification ***************"); LogTrace(__FILE__, __LINE__, "SetSemMagnification(double a_dMagnification = %f)", a_dMagnification); BOOL bRev = m_LpSemBase->SetMagnification(a_dMagnification); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemMagnification &&&&&&&&&&&&&&&&"); return bRev; } //获得扫描区域尺寸 bool GetSemScanFieldSize(double% a_dScanFieldSizeX, double% a_dScanFieldSizeY) { LogInfoTrace(__FILE__, __LINE__, "****************** Enter GetSemScanFieldSize ***************"); double dFSizeX = 0; double dFSizeY = 0; BOOL bRev = m_LpSemBase->GetScanFieldSize(dFSizeX, dFSizeY); a_dScanFieldSizeX = dFSizeX; a_dScanFieldSizeY = dFSizeY; LogTrace(__FILE__, __LINE__, "GetSemScanFieldSize(double a_dScanFieldSizeX = %f, double a_dScanFieldSizeY = %f", a_dScanFieldSizeX, a_dScanFieldSizeY); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemScanFieldSize &&&&&&&&&&&&&&&&"); return bRev; } //设置扫描区域尺寸 bool SetSemScanFieldSizeX(double a_dScanFieldSizeX) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemScanFieldSizeX ***************"); LogTrace(__FILE__, __LINE__, "SetSemScanFieldSizeX(double a_dScanFieldSizeX = %f)", a_dScanFieldSizeX); BOOL bRev = m_LpSemBase->SetScanFieldSizeX(a_dScanFieldSizeX); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemScanFieldSizeX &&&&&&&&&&&&&&&&"); return bRev; } bool GetSemHTOnOff(BOOL% a_bHTValue) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemHTOnOff ***************"); BOOL bHTV = FALSE; BOOL bRev = m_LpSemBase->GetHTOnOff(bHTV); a_bHTValue = bHTV; LogTrace(__FILE__, __LINE__, "GetSemHTOnOff(BOOL a_bHTValue = %d)", a_bHTValue); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemHTOnOff &&&&&&&&&&&&&&&&"); return bRev; } bool SetSemHTOnOff(BOOL a_bHTValue) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemHTOnOff ***************"); LogTrace(__FILE__, __LINE__, "SetSemHTOnOff(BOOL a_bHTValue = %d)", a_bHTValue); BOOL bRev = m_LpSemBase->SetHTOnOff(a_bHTValue); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemHTOnOff &&&&&&&&&&&&&&&&"); return bRev; } //获得电镜位置 bool GetSemPositionXY(double% a_dPositionX, double% a_dPositionY, double% a_dPositionR) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemPositionXY ***************"); double dPosX = 0; double dPosY = 0; double dPosR = 0; BOOL bRev = m_LpSemBase->GetPositionXY(dPosX, dPosY, dPosR); a_dPositionX = dPosX; a_dPositionY = dPosY; a_dPositionR = dPosR; LogTrace(__FILE__, __LINE__, "GetSemPositionXY(double a_dPositionX = %f, double a_dPositionY = %f, double a_dPositionR = %f)", \ a_dPositionX, a_dPositionY, a_dPositionR); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemPositionXY &&&&&&&&&&&&&&&&"); return bRev; } //设置电镜位置 bool SetSemPositionXY(double a_dPositionX, double a_dPositionY, double a_dPositionR) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemPositionXY ***************"); LogTrace(__FILE__, __LINE__, "SetSemPositionXY(double a_dPositionX = %f, double a_dPositionY = %f, double a_dPositionR = %f)", \ a_dPositionX, a_dPositionY, a_dPositionR); BOOL bRev = m_LpSemBase->SetPositionXY(a_dPositionX, a_dPositionY, a_dPositionR); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemPositionXY &&&&&&&&&&&&&&&&"); return bRev; } //获得焦点尺寸 bool GetSemSpotSize(double% a_dSpotSize) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemSpotSize ***************"); double dPSize = 0; BOOL bRev = m_LpSemBase->GetSpotSize(dPSize); a_dSpotSize = dPSize; LogTrace(__FILE__, __LINE__, "GetSemSpotSize(double a_dSpotSize = %f)", a_dSpotSize); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemSpotSize &&&&&&&&&&&&&&&&"); return bRev; } //设置焦点尺寸 bool SetSemSpotSize(double a_dSpotSize) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemSpotSize ***************"); LogTrace(__FILE__, __LINE__, "SetSemSpotSize(double a_dSpotSize = %f)", a_dSpotSize); BOOL bRev = m_LpSemBase->SetSpotSize(a_dSpotSize); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemSpotSize &&&&&&&&&&&&&&&&"); return bRev; } // 获得扫描方式 bool GetSemScanMode(long% a_nScanMode) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemScanMode ***************"); long lSMode = 0; BOOL bRev = m_LpSemBase->GetScanMode(lSMode); a_nScanMode = lSMode; LogTrace(__FILE__, __LINE__, "GetSemScanMode(long a_nScanMode = %d)", a_nScanMode); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemScanMode &&&&&&&&&&&&&&&&"); return bRev; } //设置扫描方式 bool SetSemScanMode(long a_nScanMode) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemScanMode ***************"); LogTrace(__FILE__, __LINE__, "SetSemScanMode(long a_nScanMode = %d)", a_nScanMode); BOOL bRev = m_LpSemBase->SetScanMode(a_nScanMode); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemScanMode &&&&&&&&&&&&&&&&"); return bRev; } bool SetSemScanExternal(BOOL external) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetSemScanExternal ***************"); LogTrace(__FILE__, __LINE__, "SetSemScanExternal(BOOL external = %d)", external); BOOL bRev = m_LpSemBase->SetScanExternal(external); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetSemScanExternal &&&&&&&&&&&&&&&&"); return bRev; } int GetSemExternalMode() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetSemExternalMode ***************"); BOOL bRev = m_LpSemBase->GetExternalMode(); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetSemExternalMode &&&&&&&&&&&&&&&&"); return bRev; } //移动电镜到指定的位置 bool MoveSEMToPoint(double dPosX, double dPosY, double dRotation) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter MoveSEMToPoint ***************"); LogTrace(__FILE__, __LINE__, "MoveSEMToPoint(double dPosX = %f, double dPosY = %f, double dRotation = %f)", \ dPosX,dPosY,dRotation); double dRota = dRotation; CPoint cPos; cPos.x = (LONG)dPosX; cPos.y = (LONG)dPosY; BOOL bRev = m_LpSemBase->MoveSEMToPoint(cPos, dRotation); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit MoveSEMToPoint &&&&&&&&&&&&&&&&"); return bRev; } // 释放DLL void FreeDll() { LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit FreeDll &&&&&&&&&&&&&&&&"); if (NULL != m_LpHardWareMgr) { delete m_LpHardWareMgr; m_LpHardWareMgr = NULL; } } //EDS Interface //获取EDS名称 //函数名称:GetEDSName() //输入参数:无 //输出参数:类型:int,设备ID标识 String^ GetEDSName() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetEDSName ***************"); CString a_str = (m_LpEDSBase->GetName()); String^ strOut = gcnew String(a_str); LogTrace(__FILE__, __LINE__, _T("GetEDSName return %s"), a_str); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetEDSName &&&&&&&&&&&&&&&&"); return strOut; } //获取EDS类型,Bruker是3. //函数名称:int EDSGetType() //输入参数:无 //输出参数:类型:int,设备ID标识 int EDSGetType() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter EDSGetType ***************"); int a_type = (int)EDSController::EDS_ID::BRUKER; LogTrace(__FILE__, __LINE__, _T("EDSGetType return %d"), a_type); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit EDSGetType &&&&&&&&&&&&&&&&"); return a_type; } //EDS进程终止 //函数名称:void EDSFinishedInstance() //输入参数:无 //输出参数:无 void EDSFinishedInstance() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter EDSFinishedInstance ***************"); m_LpEDSBase->FinishedInstance(); LogTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit EDSFinishedInstance &&&&&&&&&&&&&&&&"); } //EDS初始化 //函数名称:bool EDSInit() //输入参数:无 //输出参数:类型:bool,true,设备申请成功 // false,设备申请失败 bool EDSInit() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter EDSInit ***************"); bool bRet = m_LpEDSBase->Init(); LogTrace(__FILE__, __LINE__, _T("EDSInit return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit EDSInit &&&&&&&&&&&&&&&&"); return bRet; } //是否支持Xray采集 //函数名称:bool IsSupportSetCollection() //输入参数:无 //输出参数:类型:bool,true,支持采集 // false,不支持采集 bool IsSupportSetCollection() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter IsSupportSetCollection ***************"); bool bRet = m_LpEDSBase->IsSupportSetCollection(); LogTrace(__FILE__, __LINE__, _T("IsSupportSetCollection return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit IsSupportSetCollection &&&&&&&&&&&&&&&&"); return bRet; } bool CollectSpectrum(DWORD a_nMilliseconds, Point a_oPoint, array^% a_XrayData) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter CollectSpectrum ***************"); CPoint pt; pt.x = a_oPoint.X; pt.y = a_oPoint.Y; bool bRet = m_LpEDSBase->CollectSpectrum(a_nMilliseconds, pt); DWORD* xrd; xrd = m_LpEDSBase->GetXRayData(); /* pin_ptr pi = &a_XrayData[0]; long *pinp = pi; memcpy(pinp, xrd, (long)EDSConst::XANA_CHANNELS);*/ for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit CollectSpectrum &&&&&&&&&&&&&&&&"); return bRet; } bool CollectSpectrum(DWORD a_nMilliseconds, array^% a_XrayData, DWORD a_nBufferSize) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter CollectSpectrum ***************"); long* aData = new long[a_nBufferSize]; memset(aData, 0, a_nBufferSize); bool bRet = m_LpEDSBase->CollectSpectrum(a_nMilliseconds, aData, a_nBufferSize); /*pin_ptr pi = &a_XrayData[0]; long *pinp = pi; memcpy(pinp, aData, a_nBufferSize);*/ for (int i = a_nBufferSize; i <(int) a_nBufferSize; i++) { a_XrayData[i] = aData[i]; } LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit CollectSpectrum &&&&&&&&&&&&&&&&"); delete[] aData; return bRet; } bool CollectSpectrum(DWORD a_nMilliseconds, array^% a_XrayData) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter CollectSpectrum ***************"); bool bRet = m_LpEDSBase->CollectSpectrum(a_nMilliseconds); DWORD* xrd; xrd = m_LpEDSBase->GetXRayData(); for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit CollectSpectrum &&&&&&&&&&&&&&&&"); return bRet; } bool GetXRayByPoints(DWORD a_nMilliseconds, array^% a_XrayData) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayByPoints ***************"); std::vector listXRayPoints; CPosXrayPtr pXRayPoint = CPosXrayPtr(new CPosXray()); pXRayPoint->SetPosition(CPoint(10, 10)); listXRayPoints.push_back(pXRayPoint); bool bRet = m_LpEDSBase->GetXRayByPoints(listXRayPoints, a_nMilliseconds); DWORD* xrd; pXRayPoint = listXRayPoints[0]; xrd = pXRayPoint->GetXrayData(); /*pin_ptr pi = &a_XrayData[0]; long *pinp = pi; memcpy(pinp, xrd, (DWORD)EDSConst::XANA_CHANNELS);*/ for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetXRayByPoints &&&&&&&&&&&&&&&&"); return bRet; } bool GetXRayByFeature(DWORD a_nMilliseconds, array^% a_XrayData) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayByFeature ***************"); std::vector listXRayPoints; CPosXrayPtr pXRayPoint = CPosXrayPtr(new CPosXray()); pXRayPoint->SetPosition(CPoint(10, 10)); listXRayPoints.push_back(pXRayPoint); std::vector listSegment; BrukerSegment oSegment; oSegment.XCount = 1; oSegment.XStart = 10; oSegment.Y = 10; listSegment.push_back(oSegment); std::vector>listFeatures; listFeatures.push_back(listSegment); bool bRet = m_LpEDSBase->GetXRayByFeatures(listXRayPoints, listFeatures, a_nMilliseconds); DWORD* xrd; pXRayPoint = listXRayPoints[0]; xrd = pXRayPoint->GetXrayData(); for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetXRayByFeature &&&&&&&&&&&&&&&&"); return bRet; } bool GetXRayByFeature(DWORD a_nMilliseconds, array^% a_XrayData, bool a_bflag) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayByFeature ***************"); std::vector listXRayPoints; CPosXrayPtr pXRayPoint = CPosXrayPtr(new CPosXray()); pXRayPoint->SetPosition(CPoint(10, 10)); listXRayPoints.push_back(pXRayPoint); CPosXrayPtr pXRayPoint1 = CPosXrayPtr(new CPosXray()); pXRayPoint1->SetPosition(CPoint(10, 20)); listXRayPoints.push_back(pXRayPoint1); std::vector listSegment; BrukerSegment oSegment; oSegment.XCount = 1; oSegment.XStart = 10; oSegment.Y = 10; listSegment.push_back(oSegment); std::vector listSegment2; BrukerSegment oSegment2; oSegment2.XCount = 1; oSegment2.XStart = 20; oSegment2.Y = 10; BrukerSegment oSegment3; oSegment3.XCount = 3; oSegment3.XStart = 20; oSegment3.Y = 20; listSegment2.push_back(oSegment2); listSegment2.push_back(oSegment3); std::vector>listFeatures; listFeatures.push_back(listSegment); listFeatures.push_back(listSegment2); bool bRet = FALSE; // set get quantify info flag m_LpEDSBase->SetQuantification(TRUE); if (a_bflag) { bRet = m_LpEDSBase->GetXRayByFeatures(listXRayPoints, listFeatures, a_nMilliseconds); } else { bRet = m_LpEDSBase->GetXRayByFeaturesFromMultiPoint(listXRayPoints, listFeatures, a_nMilliseconds); } DWORD* xrd; pXRayPoint = listXRayPoints[0]; xrd = pXRayPoint->GetXrayData(); /*pin_ptr pi = &a_XrayData[0]; long *pinp = pi; memcpy(pinp, xrd, (DWORD)EDSConst::XANA_CHANNELS);*/ for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetXRayByFeature &&&&&&&&&&&&&&&&"); return bRet; } // analysis elements bool GetXRayElements(DWORD a_nMilliseconds, array^% a_XrayData, int^ % a_nElementNum, String^ % a_strResult) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayElements ***************"); std::vector listXRayPoints; CPosXrayPtr pXRayPoint = CPosXrayPtr(new CPosXray()); pXRayPoint->SetPosition(CPoint(10, 10)); listXRayPoints.push_back(pXRayPoint); CPosXrayPtr pXRayPoint1 = CPosXrayPtr(new CPosXray()); pXRayPoint1->SetPosition(CPoint(20, 20)); listXRayPoints.push_back(pXRayPoint1); // set get quantify info flag m_LpEDSBase->SetQuantification(TRUE); bool bRet = m_LpEDSBase->GetXRayByPoints(listXRayPoints, a_nMilliseconds); //bool bRet = m_LpEDSBase->GetXRayByFeaturesFromMultiPoint(listXRayPoints, listFeatures, a_nMilliseconds); DWORD* xrd; pXRayPoint = listXRayPoints[1]; xrd = pXRayPoint->GetXrayData(); // element quantify data CElementChemistriesList& listElement = listXRayPoints[1]->GetElementQuantifyData(); int nElementNum = (int)listElement.size(); LogInfoTrace(__FILE__, __LINE__, _T("GetXRayElements: get %d kinds of elements"), a_nElementNum); CString strElementResult = _T(""); for(auto pElement: listElement) { CString strResult; CString strName = pElement->GetName(); double dPercent = pElement->GetPercentage(); strResult.Format(_T("%s: %f\n"), strName, dPercent); strElementResult += strResult; } LogInfoTrace(__FILE__, __LINE__, _T("GetXRayElements:result is strElementResult"), strElementResult); for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } a_nElementNum = nElementNum; a_strResult = gcnew String(strElementResult); LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetXRayElements &&&&&&&&&&&&&&&&"); return bRet; } // analysis elements bool GetXRayAndElements(DWORD a_nMilliseconds,int a_BSEX, int a_BSEY, array^% a_XrayData, int^ % a_nElementNum, String^ % a_strResult) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayElements ***************"); std::vector listXRayPoints; CPosXrayPtr pXRayPoint = CPosXrayPtr(new CPosXray()); pXRayPoint->SetPosition(CPoint(a_BSEX, a_BSEY)); listXRayPoints.push_back(pXRayPoint); CPosXrayPtr pXRayPoint1 = CPosXrayPtr(new CPosXray()); pXRayPoint1->SetPosition(CPoint(a_BSEX, a_BSEY)); listXRayPoints.push_back(pXRayPoint1); // set get quantify info flag m_LpEDSBase->SetQuantification(FALSE); bool bRet = m_LpEDSBase->GetXRayByPoints(listXRayPoints, a_nMilliseconds); //bool bRet = m_LpEDSBase->GetXRayByFeaturesFromMultiPoint(listXRayPoints, listFeatures, a_nMilliseconds); std::vector listXRayPointsTemp; CPosXrayPtr pXRayPointTemp = CPosXrayPtr(new CPosXray()); listXRayPointsTemp.push_back(pXRayPointTemp); for (int i = 0; i < 2; i++) { listXRayPointsTemp[0] = listXRayPoints[i]; m_LpEDSBase->SetQuantification(TRUE); bool bRet = m_LpEDSBase->GetXRayByPoints(listXRayPointsTemp, a_nMilliseconds); listXRayPoints[i] = listXRayPointsTemp[0]; } DWORD* xrd; pXRayPoint = listXRayPoints[1]; xrd = pXRayPoint->GetXrayData(); // element quantify data CElementChemistriesList& listElement = listXRayPoints[1]->GetElementQuantifyData(); int nElementNum = (int)listElement.size(); LogInfoTrace(__FILE__, __LINE__, _T("GetXRayElements: get %d kinds of elements"), a_nElementNum); CString strElementResult = _T(""); for (auto pElement : listElement) { CString strResult; CString strName = pElement->GetName(); double dPercent = pElement->GetPercentage(); strResult.Format(_T("%s: %f\n"), strName, dPercent); strElementResult += strResult; } LogInfoTrace(__FILE__, __LINE__, _T("GetXRayElements:result is strElementResult"), strElementResult); for (int i = 0; i < (int)EDSConst::XANA_CHANNELS; i++) { a_XrayData[i] = xrd[i]; } a_nElementNum = nElementNum; a_strResult = gcnew String(strElementResult); LogTrace(__FILE__, __LINE__, _T("CollectSpectrum return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetXRayElements &&&&&&&&&&&&&&&&"); return bRet; } /// Set Amp Time Index for all detectors bool SetAmpTimeIndex(long a_lvalue) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetAmpTimeIndex ***************"); bool bRet = m_LpEDSBase->SetAmpTimeIndex(a_lvalue); LogTrace(__FILE__, __LINE__, _T("SetAmpTimeIndex return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetAmpTimeIndex &&&&&&&&&&&&&&&&"); return bRet; } /// get live time float GetLiveTime(void) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetLiveTime ***************"); float fRet = m_LpEDSBase->GetLiveTime(); LogTrace(__FILE__, __LINE__, _T("SetAmpTimeIndex return %f"), fRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetLiveTime &&&&&&&&&&&&&&&&"); return fRet; } /// get x-ray point collection limit long GetMaxPointLimit(void) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetMaxPointLimit ***************"); long lRet = m_LpEDSBase->GetMaxPointLimit(); LogTrace(__FILE__, __LINE__, _T("GetMaxPointLimit return %ld"), lRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetMaxPointLimit &&&&&&&&&&&&&&&&"); return lRet; } DWORD GetNumberOfChannels(void) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetNumberOfChannels ***************"); DWORD nRet = m_LpEDSBase->GetNumberOfChannels(); LogTrace(__FILE__, __LINE__, _T("GetNumberOfChannels return %d"), nRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetNumberOfChannels &&&&&&&&&&&&&&&&"); return nRet; } //获取图像数据14741238434 int AcquireBSEImage(int a_nMatrixIndex, int nReads, int nDwell, array^% a_ImgData) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter AcquireBSEImage ***************"); int bRet = 0; CSize sz; int height, width; CBSEImgPtr pbseImg= nullptr; pbseImg = m_LpScanBase->AcquireBSEImage(a_nMatrixIndex, nReads, nDwell); sz = pbseImg->GetImageSize(); height = sz.cx; width = sz.cy; bRet = height * width; BYTE* lpData = pbseImg->GetImageDataPointer(); /*pin_ptr pi = &a_ImgData[0]; unsigned char *pinp = pi; memcpy(pinp, lpData, height * width); */ for (int i = 0; i < bRet; i++) { a_ImgData[i] = lpData[i]; } LogTrace(__FILE__, __LINE__, _T("AcquireBSEImage return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit AcquireBSEImage &&&&&&&&&&&&&&&&"); return bRet; // return 0; } // 初始化 bool ScanInit() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter ScanInit ***************"); bool bRet = m_LpScanBase->Init(); LogTrace(__FILE__, __LINE__, _T("ScanInit return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit ScanInit &&&&&&&&&&&&&&&&"); return bRet; } /// instance termination void ScanFinishedInstance() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter ScanFinishedInstance ***************"); m_LpScanBase->FinishedInstance(); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit ScanFinishedInstance &&&&&&&&&&&&&&&&"); } int GetScanType() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetScanType ***************"); int nRet = (int)ScanController::SCANNER_ID::BRUKER; LogTrace(__FILE__, __LINE__, _T("GetScanType return %d"), nRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetScanType &&&&&&&&&&&&&&&&"); return nRet; } Size GetMatrixSize(int a_nMatrixIndex) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetMatrixSize ***************"); CSize cs; cs = m_LpScanBase->GetMatrixSize(a_nMatrixIndex); Size aa; aa.Height = (int)cs.cy; aa.Width = (int)cs.cx; LogTrace(__FILE__, __LINE__, _T("GetMatrixSize return (%d,%d)"), cs.cx, cs.cy); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetMatrixSize &&&&&&&&&&&&&&&&"); return aa; } // move beam to point //bool MoveBeamTo(CPoint& a_beamPos); // Start Scan Table bool StartScanTable(int a_nMatrixIndex, unsigned int nP, array^ pnxx, array^ pnyy) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter StartScanTable ***************"); int*pnx = new int[nP]; int*pny = new int[nP]; memset(pnx, 0, sizeof(int)*nP); memset(pny, 0, sizeof(int)*nP); /*pin_ptr pix = &pnxx[0]; short *pinpx = pix; pin_ptr piy = &pnyy[0]; short *pinpy = piy;*/ bool bRet = false; if (m_LpScanBase->StartScanTable(a_nMatrixIndex, nP, pnx, pny)) { /*memcpy(pinpx, pnx, nP); memcpy(pinpy, pny, nP);*/ for (int i = 0; i <(int) nP; i++) { pnxx[i] = pnx[i]; pnyy[i] = pny[i]; } bRet = true; } else { bRet = false; } delete[] pny; delete[] pnx; LogTrace(__FILE__, __LINE__, _T("StartScanTable return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit StartScanTable &&&&&&&&&&&&&&&&"); return bRet; } // set Image Size bool SetImageSize(long nImageSize) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetImageSize ***************"); bool bRet = m_LpScanBase->SetImageSize(nImageSize); LogTrace(__FILE__, __LINE__, _T("SetImageSize return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetImageSize &&&&&&&&&&&&&&&&"); return bRet; } /// set dwell time bool SetDwellTime(long nDwellTime) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetDwellTime ***************"); bool bRet = m_LpScanBase->SetDwellTime(nDwellTime); LogTrace(__FILE__, __LINE__, _T("SetDwellTime return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetDwellTime &&&&&&&&&&&&&&&&"); return bRet; } Size GetFrameResolutionByIndex(const long a_nIndex) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetFrameResolutionByIndex ***************"); CSize cs; cs = m_LpScanBase->GetFrameResolutionByIndex(a_nIndex); Size aa; aa.Height = (int)cs.cx; aa.Width = (int)cs.cy; LogTrace(__FILE__, __LINE__, _T("GetFrameResolutionByIndex return (%d,%d)"), cs.cx, cs.cy); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetFrameResolutionByIndex &&&&&&&&&&&&&&&&"); return aa; } bool SetFrameResolutionByIndex(const long a_nIndex) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetFrameResolutionByIndex ***************"); bool bRet = m_LpScanBase->SetFrameResolutionByIndex(a_nIndex); LogTrace(__FILE__, __LINE__, _T("SetDwellTime return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetFrameResolutionByIndex &&&&&&&&&&&&&&&&"); return bRet; } long GetDwellTimeByIndex(const long a_nIndex) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetDwellTimeByIndex ***************"); long lRet = m_LpScanBase->GetDwellTimeByIndex(a_nIndex); LogTrace(__FILE__, __LINE__, _T("GetDwellTimeByIndex return %ld"), lRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetDwellTimeByIndex &&&&&&&&&&&&&&&&"); return lRet; } bool SetDwellTimeByIndex(const long a_nIndex) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetDwellTimeByIndex ***************"); bool bRet = m_LpScanBase->SetDwellTimeByIndex(a_nIndex); LogTrace(__FILE__, __LINE__, _T("SetDwellTimeByIndex return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetDwellTimeByIndex &&&&&&&&&&&&&&&&"); return bRet; } bool SetScanFieldSize(const int a_nWidth, const int a_nHeight) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetScanFieldSize ***************"); bool bRet =(bool)m_LpScanBase->SetScanFieldSize(a_nWidth, a_nHeight); LogTrace(__FILE__, __LINE__, _T("SetScanFieldSize is width = %d, height = %d"), a_nWidth, a_nHeight); LogTrace(__FILE__, __LINE__, _T("SetScanFieldSize return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetScanFieldSize &&&&&&&&&&&&&&&&"); return bRet; } bool SetEMPosition(const int a_nPosX, const int a_nPosY) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetEMPosition ***************"); bool bRet = (bool)m_LpScanBase->SetScanFieldSize(a_nPosX, a_nPosY); LogTrace(__FILE__, __LINE__, _T("SetEMPosition is posX = %d, posY = %d"), a_nPosX, a_nPosY); LogTrace(__FILE__, __LINE__, _T("SetEMPosition return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetEMPosition &&&&&&&&&&&&&&&&"); return bRet; } Size GetScanRange() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetScanRange ***************"); CSize cs = m_LpScanBase->GetScanRange(); Size aa; aa.Height = (int)cs.cx; aa.Width = (int)cs.cy; LogTrace(__FILE__, __LINE__, _T("GetScanRange return Size is(%d,%d)"), aa.Height, aa.Width); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetScanRange &&&&&&&&&&&&&&&&"); return aa; } int GetScanStepSize() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetScanStepSize ***************"); int nRet = m_LpScanBase->GetScanStepSize(); LogTrace(__FILE__, __LINE__, _T("GetScanStepSize return is %d"), nRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetScanStepSize &&&&&&&&&&&&&&&&"); return nRet; } int GetInterPixelDwell() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetInterPixelDwell ***************"); int nRet = m_LpScanBase->GetInterPixelDwell(); LogTrace(__FILE__, __LINE__, _T("GetInterPixelDwell return is %d"), nRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetInterPixelDwell &&&&&&&&&&&&&&&&"); return nRet; } int GetNumberOfReads() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetNumberOfReads ***************"); int nRet = m_LpScanBase->GetNumberOfReads(); LogTrace(__FILE__, __LINE__, _T("GetNumberOfReads return is %d"), nRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetNumberOfReads &&&&&&&&&&&&&&&&"); return nRet; } double GetMagnification() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetMagnification ***************"); double nRet = m_LpScanBase->GetMagnification(); LogTrace(__FILE__, __LINE__, _T("GetMagnification return is %f"), nRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit GetMagnification &&&&&&&&&&&&&&&&"); return nRet; } void SetScanRange(Size cs) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetScanRange ***************"); CSize sz; sz.cx = (LONG)cs.Height; sz.cy = (LONG)cs.Width; m_LpScanBase->SetScanRange(sz); LogTrace(__FILE__, __LINE__, _T("SetScanRange set (%d,%d)"), sz.cx, sz.cy); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetScanRange &&&&&&&&&&&&&&&&"); } void SetScanStepSize(int size) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetScanStepSize ***************"); m_LpScanBase->SetScanStepSize(size); LogTrace(__FILE__, __LINE__, _T("SetScanStepSize set %d"), size); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetScanStepSize &&&&&&&&&&&&&&&&"); } void SetInterPixelDwell(int i) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetInterPixelDwell ***************"); m_LpScanBase->SetInterPixelDwell(i); LogTrace(__FILE__, __LINE__, _T("SetInterPixelDwell set %d"), i); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetInterPixelDwell &&&&&&&&&&&&&&&&"); } void SetNumberOfReads(int i) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetNumberOfReads ***************"); m_LpScanBase->SetNumberOfReads(i); LogTrace(__FILE__, __LINE__, _T("SetNumberOfReads set %d"), i); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetNumberOfReads &&&&&&&&&&&&&&&&"); } void SetMagnification(double mag) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetMagnification ***************"); m_LpScanBase->SetMagnification(mag); LogTrace(__FILE__, __LINE__, _T("SetMagnification set %d"), mag); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetMagnification &&&&&&&&&&&&&&&&"); } bool ScanIsBruker() { LogInfoTrace(__FILE__, __LINE__, "***************** Enter ScanIsBruker ***************"); bool bRet = (bool)m_LpScanBase->IsBruker(); LogTrace(__FILE__, __LINE__, _T("ScanIsBruker return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit ScanIsBruker &&&&&&&&&&&&&&&&"); return bRet; } bool SetAndStartScan(void) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetAndStartScan ***************"); bool bRet = (bool)m_LpScanBase->SetAndStartScan(); LogTrace(__FILE__, __LINE__, _T("SetAndStartScan return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetAndStartScan &&&&&&&&&&&&&&&&"); return bRet; } bool MoveBeamTo(Point a_beamPos) { CPoint pt; pt.x = a_beamPos.X; pt.y = a_beamPos.Y; LogInfoTrace(__FILE__, __LINE__, "***************** Enter MoveBeamTo ***************"); bool bRet = (bool)m_LpScanBase->MoveBeamTo(pt); LogTrace(__FILE__, __LINE__, _T("MoveBeamTo return %d"), bRet); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit MoveBeamTo &&&&&&&&&&&&&&&&"); return bRet; } bool SetPointScan(int a_nMatrixIndex) { LogInfoTrace(__FILE__, __LINE__, "***************** Enter SetPointScan ***************"); bool bRet = (bool)m_LpScanBase->SetPointScan(a_nMatrixIndex); LogTrace(__FILE__, __LINE__, _T("SetPointScan set %d"), a_nMatrixIndex); LogInfoTrace(__FILE__, __LINE__, "&&&&&&&&&&&&&&&&&& Exit SetPointScan &&&&&&&&&&&&&&&&"); return bRet; } private: // COTSSEMBruker* m_LpSemBruker; COTSSemBase* m_LpSemBase; //Scan COTSScanBase* m_LpScanBase; //EDS COTSEDSBase* m_LpEDSBase; //COTSHardwareMgr COTSHardwareMgr* m_LpHardWareMgr; }; }