#include "stdafx.h" #include "OTSScanSim.h" #include "otsdataconst.h" namespace OTSController { COTSScanSim::COTSScanSim() { } COTSScanSim::~COTSScanSim() { } /// instance termination /*void COTSScanSim::FinishedInstance() { }*/ // initialization BOOL COTSScanSim::Init() { // ok, return TRUE return TRUE; } // get the size of matrix. CSize COTSScanSim::GetMatrixSize(int /*a_nMatrixIndex*/) { return CSize(0); } // acquire BSE image CBSEImgPtr COTSScanSim::AcquireBSEImage(int /*a_nMatrixIndex*/, int /*nReads*/, int /*nDwell*/) { // BSE image CBSEImgPtr poBSEImgPtr = nullptr; // load simulation image poBSEImgPtr = AcquireBSEImageFromBitmapFile(); // check simulation image ASSERT(poBSEImgPtr); if (!poBSEImgPtr) { // failed to load simulation image LogErrorTrace(__FILE__, __LINE__, _T("COTSScanSim::AcquireBSEImage: failed to load simulation image")); } Sleep(1000);//simulate the real sem time delay. // return simulation image, nullptr if load simulation image failed return poBSEImgPtr; } // move beam to point BOOL COTSScanSim::MoveBeamTo(CPoint& a_beamPos) { return FALSE; } // start scan table BOOL COTSScanSim::StartScanTable(int /*a_nMatrixIndex*/, unsigned int /*nP*/, int* /*px*/, int* /*py*/) { return TRUE; } // set image size BOOL COTSScanSim::SetImageSize(long a_nImageSizeX,long nHeight) { return TRUE; } // set dwell time BOOL COTSScanSim::SetDwellTime(long a_nDwellTime) { return TRUE; } // get dwell time by index long COTSScanSim::GetDwellTimeByIndex(const long a_nIndex) { // check index if (a_nIndex < DWELLTIME_BRUKER_ID_MIN || a_nIndex > DWELLTIME_BRUKER_ID_MAX) { // invalid index ASSERT(FALSE); LogInfoTrace(__FILE__, __LINE__, _T("COTSScanSim::GetDwellTimeByIndex: invalid index")); return -1; } // get dwell time by index long nDwellTime = DWELLTIME_BRUKER_VALUES[a_nIndex]; return nDwellTime; } // set dwell time by index BOOL COTSScanSim::SetDwellTimeByIndex(const long a_nIndex) { // check index if (a_nIndex < DWELLTIME_BRUKER_ID_MIN || a_nIndex > DWELLTIME_BRUKER_ID_MIN) { // invalid index ASSERT(FALSE); LogInfoTrace(__FILE__, __LINE__, _T("COTSScanSim::SetDwellTimeByIndex: invalid index")); return FALSE; } // get dwell time long nDwellTime = DWELLTIME_BRUKER_VALUES[a_nIndex]; if (!SetDwellTime(nDwellTime)) { // failed to call SetDwellTime method LogErrorTrace(__FILE__, __LINE__, _T("COTSScanSim::SetDwellTimeByIndex: failed to call SetDwellTime method.")); return FALSE; } // ok, return TRUE return TRUE; } // scan field size BOOL COTSScanSim::SetScanFieldSize(const int a_nWidth, const int a_nHeight) { m_nScanFieldSizeX = a_nWidth; m_nScanFieldSizeY = a_nHeight; return TRUE; } // set the SEM position BOOL COTSScanSim::SetEMPosition(const int a_nPosX, const int a_nPosY) { m_nCurrentBSEPositionX = a_nPosX; m_nCurrentBSEPositionY = a_nPosY; return TRUE; } }