| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624 |
- #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<long>^% 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<long> 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<long>^% 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<long> 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<long>^% 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<long>^% a_XrayData)
- {
- LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayByPoints ***************");
- std::vector<CPosXrayPtr> 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<long> 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<long>^% a_XrayData)
- {
- LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayByFeature ***************");
- std::vector<CPosXrayPtr> listXRayPoints;
- CPosXrayPtr pXRayPoint = CPosXrayPtr(new CPosXray());
- pXRayPoint->SetPosition(CPoint(10, 10));
- listXRayPoints.push_back(pXRayPoint);
- std::vector<BrukerSegment> listSegment;
- BrukerSegment oSegment;
- oSegment.XCount = 1;
- oSegment.XStart = 10;
- oSegment.Y = 10;
- listSegment.push_back(oSegment);
- std::vector<std::vector<BrukerSegment>>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<long>^% a_XrayData, bool a_bflag)
- {
- LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayByFeature ***************");
- std::vector<CPosXrayPtr> 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<BrukerSegment> listSegment;
- BrukerSegment oSegment;
- oSegment.XCount = 1;
- oSegment.XStart = 10;
- oSegment.Y = 10;
- listSegment.push_back(oSegment);
- std::vector<BrukerSegment> 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<std::vector<BrukerSegment>>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<long> 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<long>^% a_XrayData, int^ % a_nElementNum, String^ % a_strResult)
- {
- LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayElements ***************");
- std::vector<CPosXrayPtr> 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<long>^% a_XrayData, int^ % a_nElementNum, String^ % a_strResult)
- {
- LogInfoTrace(__FILE__, __LINE__, "***************** Enter GetXRayElements ***************");
- std::vector<CPosXrayPtr> 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<CPosXrayPtr> 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<System::Byte>^% 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<unsigned char> 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<System::Int16>^ pnxx, array<System::Int16>^ 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<short> pix = &pnxx[0];
- short *pinpx = pix;
-
- pin_ptr<short> 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;
- };
- }
|