123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681 |
- #include "stdafx.h"
- #include "OTSSEMBruker.h"
- namespace OTSController {
- // constructor
- COTSSEMBruker::COTSSEMBruker()
- : m_bConnected(FALSE)
- {
- }
- // destructor
- COTSSEMBruker::~COTSSEMBruker()
- {
- }
- // check if connected
- // return true if setup success
- BOOL COTSSEMBruker::IsConnected()
- {
- return m_bConnected;
- }
- // connect client dll
- BOOL COTSSEMBruker::Connect()
- {
- // doing nothing if m_pBrukerImplPtr is not nullptr
- if (!m_pBrukerImplPtr)
- {
- // get bruker initialize controller
- m_pBrukerImplPtr = COTSBrukerImpl::GetInstance();
- }
- // make sure m_pBrukerImplPtr is OK
- if (m_pBrukerImplPtr)
- {
- // initialize the bruker controller as a SEM controller
- LogTrace(__FILE__, __LINE__, _T("Init BrukerImpl..."));
- if (m_pBrukerImplPtr->Init(CONTROL_TYPE::BRUKER_SEM))
- {
- // check connection
- if (!m_pBrukerImplPtr->CheckConnection(m_bConnected))
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::Connect: failed to call CheckConnection."));
- m_pBrukerImplPtr.reset();
- m_bConnected = FALSE;
- return FALSE;
- }
- }
- // connection is ok?
- if (!m_bConnected)
- {
- // connection
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::Connect(): connecting failed."));
- m_pBrukerImplPtr.reset();
-
- return FALSE;
- }
- }
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::Disconnect()
- {
-
- if (m_bConnected)
- {
- m_pBrukerImplPtr->DisConnect();
- m_bConnected = false;
- return true;
- }
- else
- {
- return true;
- }
-
- }
- // set beam blank
- BOOL COTSSEMBruker::SetBeamBlank(long a_nBeamBlank)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBeamBlank: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // turn Bean off if a_nBeamBlank > 0
- if (a_nBeamBlank > 0)
- {
- if (!m_pBrukerImplPtr->SwitchSEMOff(FALSE, FALSE, TRUE))
- {
- // failed to call SwitchSEMOff method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBeamBlank : failed to call SwitchSEMOff method."));
- return FALSE;
- }
- }
- // ok, return TRUE
- return TRUE;
- }
- // set beam blank
- BOOL COTSSEMBruker::SetBeamCurrent(BOOL a_nBeamCurrent)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBeamBlank: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // turn Bean off if a_nBeamBlank > 0
- if (a_nBeamCurrent )
- {
- if (!m_pBrukerImplPtr->SwitchSEMOff(FALSE,TRUE , FALSE))
- {
- // failed to call SwitchSEMOff method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBeamBlank : failed to call SwitchSEMOff method."));
- return FALSE;
- }
- }
- // ok, return TRUE
- return TRUE;
- }
- // brightness
- BOOL COTSSEMBruker::GetBrightness(double& a_dBrightness)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetBrightness: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get brightness and contrast
- double dBrightness, dContrast;
- if (!m_pBrukerImplPtr->GetSEMBCData(dBrightness, dContrast))
- {
- // failed to call GetSEMBCData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetBrightness: failed to call GetSEMBCData method."));
- return FALSE;
- }
- a_dBrightness = dBrightness;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetBrightness(double a_dBrightness)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBrightness: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get current brightness and contrast
- double dBrightness, dContrast;
- if (!m_pBrukerImplPtr->GetSEMBCData(dBrightness, dContrast))
- {
- // failed to call GetSEMBCData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBrightness: failed to call GetSEMBCData method."));
- return FALSE;
- }
- // set brightness and contrast
- dBrightness = a_dBrightness;
- if (!m_pBrukerImplPtr->SetSEMBCData(dBrightness, dContrast))
- {
- // failed to call GetSEMBCData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetBrightness: failed to call SetSEMBCData method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // contrast
- BOOL COTSSEMBruker::GetContrast(double& a_dContrast)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetContrast: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get brightness and contrast
- double dBrightness, dContrast;
- if (!m_pBrukerImplPtr->GetSEMBCData(dBrightness, dContrast))
- {
- // failed to call GetSEMBCData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetContrast: failed to call GetSEMBCData method."));
- return FALSE;
- }
- a_dContrast = dContrast;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetContrast(double a_dContrast)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetContrast: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get current brightness and contrast
- double dBrightness, dContrast;
- if (!m_pBrukerImplPtr->GetSEMBCData(dBrightness, dContrast))
- {
- // failed to call GetSEMBCData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetContrast: failed to call GetSEMBCData method."));
- return FALSE;
- }
- // set brightness and contrast
- dContrast = a_dContrast;
- if (!m_pBrukerImplPtr->SetSEMBCData(dBrightness, dContrast))
- {
- // failed to call SetSEMBCData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetContrast: failed to call SetSEMBCData method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // working distance
- BOOL COTSSEMBruker::GetWorkingDistance(double& a_dWorkingDistance)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetWorkingDistance: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get mag, KV and working distance
- double dMagnification, dHighVoltage, dWorkingDistance;
- if (!m_pBrukerImplPtr->GetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call GetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetWorkingDistance: failed to call SetSEMData method."));
- return FALSE;
- }
- a_dWorkingDistance = dWorkingDistance;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetWorkingDistance(double a_dWorkingDistance)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetWorkingDistance: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get current mag, KV and working distance
- double dMagnification, dHighVoltage, dWorkingDistance;
- if (!m_pBrukerImplPtr->GetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call GetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetWorkingDistance: failed to call GetSEMData method."));
- return FALSE;
- }
- // set mag, KV and working distance
- dWorkingDistance = a_dWorkingDistance;
- if (!m_pBrukerImplPtr->SetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call SetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetWorkingDistance: failed to call SetSEMData method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // high tension (KV)
- BOOL COTSSEMBruker::GetHighTension(double& a_dKV)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetHighTension: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get mag, KV and working distance
- double dMagnification, dHighVoltage, dWorkingDistance;
- if (!m_pBrukerImplPtr->GetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call GetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetHighTension: failed to call SetSEMData method."));
- return FALSE;
- }
- a_dKV = dHighVoltage;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetHighTension(double a_dKV)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetHighTension: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get current mag, KV and working distance
- double dMagnification, dHighVoltage, dWorkingDistance;
- if (!m_pBrukerImplPtr->GetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call GetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetHighTension: failed to call GetSEMData method."));
- return FALSE;
- }
- // set mag, KV and working distance
- dHighVoltage = a_dKV;
- if (!m_pBrukerImplPtr->SetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call SetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetHighTension: failed to call SetSEMData method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // magnification
- BOOL COTSSEMBruker::GetMagnification(double& a_dMagnification)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetMagnification: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get mag, KV and working distance
- double dMagnification, dHighVoltage, dWorkingDistance;
- if (!m_pBrukerImplPtr->GetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call GetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetMagnification: failed to call SetSEMData method."));
- return FALSE;
- }
- a_dMagnification = dMagnification;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetMagnification(double a_dMagnification)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetMagnification: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get current mag, KV and working distance
- double dMagnification, dHighVoltage, dWorkingDistance;
- if (!m_pBrukerImplPtr->GetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call GetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetMagnification: failed to call GetSEMData method."));
- return FALSE;
- }
- // set mag, KV and working distance
- dMagnification = a_dMagnification;
- if (!m_pBrukerImplPtr->SetSEMData(dMagnification, dHighVoltage, dWorkingDistance))
- {
- // failed to call SetSEMData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetMagnification: failed to call SetSEMData method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // scan field size
- BOOL COTSSEMBruker::GetScanFieldSize(double& a_dScanFieldSizeX, double& a_dScanFieldSizeY)
- {
- // get magnification
- double dMag = 0;
- if (!GetMagnification(dMag))
- {
- // failed to call GetMagnification method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetScanFieldSize: failed to call GetMagnification method."));
- return FALSE;
- }
- // calculate scan field size
- double dScanFieldSizeX, dScanFieldSizeY;
- if (!MagToScanFieldSize(dMag, dScanFieldSizeX, dScanFieldSizeY))
- {
- // failed to call MagToScanFieldSize method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetScanFieldSize: failed to call MagToScanFieldSize method."));
- return FALSE;
- }
- // calculate scan field size and set output values
- a_dScanFieldSizeX = dScanFieldSizeX;
- a_dScanFieldSizeY = dScanFieldSizeY;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetScanFieldSizeX(double a_dScanFieldSizeX)
- {
- // calculate magnification
- double dMag = 0;
- if (!ScanFieldSizeToMag(dMag, a_dScanFieldSizeX))
- {
- // failed to call ScanFieldSizeToMag method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetScanFieldSizeX: filed to call ScanFieldSizeToMag method."));
- return FALSE;
- }
- // set magnification
- if(!SetMagnification(dMag))
- {
- // failed to call ScanFieldSizeToMag method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetScanFieldSizeX: filed to call SetMagnification method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // high tension off
- // note: a_bHTValue is FALSE will turn HT off
- BOOL COTSSEMBruker::SetHTOnOff(BOOL a_bHTValue)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetHTOnOff: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // turn HT off if a_bHTValue is FALSE
- if (!a_bHTValue)
- {
- if (!m_pBrukerImplPtr->SwitchSEMOff(TRUE, FALSE, FALSE))
- {
- // failed to call SwitchSEMOff method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetHTOnOff : failed to call SwitchSEMOff method."));
- return FALSE;
- }
- }
- // ok, return TRUE
- return TRUE;
- }
- // position
- BOOL COTSSEMBruker::GetPositionXY(double& a_dPositionX, double& a_dPositionY, double& a_dPositionR)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetPositionXY: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get position
- double dPositionX, dPositionY, dPositionZ, dTilt, dRotation;
- if (!m_pBrukerImplPtr->GetSEMStageData(dPositionX, dPositionY, dPositionZ, dTilt, dRotation))
- {
- // failed to call GetSEMStageData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetPositionXY : failed to call GetSEMStageData method."));
- return FALSE;
- }
- // need to convert dPositionX, dPositionY from SEM position to OTS position
- // set output values
- a_dPositionX = dPositionX;
- a_dPositionY = dPositionY;
- a_dPositionR = dRotation;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetPositionXY(double a_dPositionX, double a_dPositionY, double a_dPositionR)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetPositionXY: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get position
- double dPositionX, dPositionY, dPositionZ, dTilt, dRotation;
- if (!m_pBrukerImplPtr->GetSEMStageData(dPositionX, dPositionY, dPositionZ, dTilt, dRotation))
- {
- // failed to call GetSEMStageData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetPositionXY : failed to call GetSEMStageData method."));
- return FALSE;
- }
- // need to convert a_dPositionX, a_dPositionY from OTS position to SEM position
- // set position
- dPositionX = a_dPositionX;
- dPositionY = a_dPositionY;
- dRotation = a_dPositionR;
- LogTrace(__FILE__, __LINE__, _T("COTSSEMBruker::Start to SetPositionXY "));
- if (!m_pBrukerImplPtr->SetSEMStageData(dPositionX, dPositionY, dPositionZ, dTilt, dRotation))
- {
- // failed to call SetSEMStageData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetPositionXY : failed to call SetSEMStageData method."));
- return FALSE;
- }
- LogTrace(__FILE__, __LINE__, _T("COTSSEMBruker::Finished SetPositionXY "));
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetPositionXY(double a_dPositionX, double a_dPositionY)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetPositionXY: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get position
- double dPositionX, dPositionY, dPositionZ, dTilt, dRotation;
- if (!m_pBrukerImplPtr->GetSEMStageData(dPositionX, dPositionY, dPositionZ, dTilt, dRotation))
- {
- // failed to call GetSEMStageData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetPositionXY : failed to call GetSEMStageData method."));
- return FALSE;
- }
- // need to convert a_dPositionX, a_dPositionY from OTS position to SEM position
- // set position
- dPositionX = a_dPositionX;
- dPositionY = a_dPositionY;
- //dRotation = a_dPositionR;
- LogTrace(__FILE__, __LINE__, _T("COTSSEMBruker::Start to SetPositionXY "));
- if (!m_pBrukerImplPtr->SetSEMStageData(dPositionX, dPositionY, dPositionZ, dTilt, dRotation))
- {
- // failed to call SetSEMStageData method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetPositionXY : failed to call SetSEMStageData method."));
- return FALSE;
- }
- LogTrace(__FILE__, __LINE__, _T("COTSSEMBruker::Finished SetPositionXY "));
- // ok, return TRUE
- return TRUE;
- }
- // spot size
- BOOL COTSSEMBruker::GetSpotSize(double& a_dSpotSize)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetSpotSize: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // get spot size
- double dSpotSize;
- if (!m_pBrukerImplPtr->GetSEMSpotSize(dSpotSize))
- {
- // failed to call GetSEMSpotSize method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::GetSpotSize : failed to call GetSEMSpotSize method."));
- return FALSE;
- }
- a_dSpotSize = dSpotSize;
- // ok, return TRUE
- return TRUE;
- }
- BOOL COTSSEMBruker::SetSpotSize(double a_dSpotSize)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetSpotSize: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- // set spot size
- if (!m_pBrukerImplPtr->SetSEMSpotSize(a_dSpotSize))
- {
- // failed to call GetSEMSpotSize method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetSpotSize : failed to call SetSEMSpotSize method."));
- return FALSE;
- }
- // ok, return TRUE
- return TRUE;
- }
- // external mode
- BOOL COTSSEMBruker::SetScanExternal(BOOL a_bExternalOn)
- {
- // m_pBrukerImplPtr check
- ASSERT(m_pBrukerImplPtr);
- if (!m_pBrukerImplPtr)
- {
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetScanExternal: m_pBrukerImplPtr is invalid."));
- return FALSE;
- }
- if (a_bExternalOn)
- {
- // turn external on
- if (!m_pBrukerImplPtr->SetSEMExternalOn())
- {
- // failed to call GetSEMSpotSize method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetScanExternal: failed to call SetSEMExternalOn method."));
- return FALSE;
- }
- }
- else
- {
- // turn external off
- if (!m_pBrukerImplPtr->SetSEMExternalOff())
- {
- // failed to call SetSEMExternalOff method
- LogErrorTrace(__FILE__, __LINE__, _T("COTSSEMBruker::SetScanExternal: failed to call SetSEMExternalOff method."));
- return FALSE;
- }
- }
- // ok, return TRUE
- return TRUE;
- }
- }
|