|
@@ -162,7 +162,7 @@ namespace OTSController {
|
|
|
BOOL COTSBrukerImpl::CheckConnection(BOOL& a_bConnected)
|
|
|
{
|
|
|
|
|
|
- if (BrukerDll::CheckConnection(m_nClientID))
|
|
|
+ if (BrukerDll::CheckConnection(m_nClientID)== 0)
|
|
|
{
|
|
|
// connected
|
|
|
a_bConnected = TRUE;
|
|
@@ -189,7 +189,7 @@ namespace OTSController {
|
|
|
|
|
|
// get SEM data (mag, KV and working distance)
|
|
|
double dMagnification, dHighVoltage, dWorkingDistance;
|
|
|
- if (!BrukerDll::GetSEMData(m_nClientID, dMagnification, dHighVoltage, dWorkingDistance))
|
|
|
+ if (BrukerDll::GetSEMData(m_nClientID, dMagnification, dHighVoltage, dWorkingDistance) != 0)
|
|
|
{
|
|
|
// failed to call get SEM data method (mag, KV and working distance)
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetSEMData: failed to call GetSEMBCData client id is %d"), m_nClientID);
|
|
@@ -205,7 +205,7 @@ namespace OTSController {
|
|
|
BOOL COTSBrukerImpl::SetSEMData(double a_dMagnification, double a_dHighVoltage, double a_dWorkingDistance)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::SetSEMData(m_nClientID, a_dMagnification, a_dHighVoltage, a_dWorkingDistance))
|
|
|
+ if (BrukerDll::SetSEMData(m_nClientID, a_dMagnification, a_dHighVoltage, a_dWorkingDistance) != 0)
|
|
|
{
|
|
|
// failed to call set SEM data method (mag, KV and working distance)
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetSEMData: failed to call GetSEMBCData client id = %d"), m_nClientID);
|
|
@@ -221,7 +221,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
double dBrightness = 0, dContrast = 0;
|
|
|
- if (!BrukerDll::GetSEMBCData(m_nClientID, dBrightness, dContrast))
|
|
|
+ if (BrukerDll::GetSEMBCData(m_nClientID, dBrightness, dContrast) != 0)
|
|
|
{
|
|
|
// failed to call get SEM data method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetBrightness: failed to call GetSEMBCData client id is %d"), m_nClientID);
|
|
@@ -237,7 +237,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
// set SEM data
|
|
|
- if (!BrukerDll::SetSEMBCData(m_nClientID, a_dBrightness, a_dContrast))
|
|
|
+ if (BrukerDll::SetSEMBCData(m_nClientID, a_dBrightness, a_dContrast) != 0)
|
|
|
{
|
|
|
// failed to call set SEM data method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetBrightness: failed to call SetSEMBCData client id is %d"), m_nClientID);
|
|
@@ -254,7 +254,7 @@ namespace OTSController {
|
|
|
|
|
|
|
|
|
// get Probe Current
|
|
|
- if (!BrukerDll::GetSEMProbeCurrent(m_nClientID, a_dKV))
|
|
|
+ if (BrukerDll::GetSEMProbeCurrent(m_nClientID, a_dKV) != 0)
|
|
|
{
|
|
|
// failed to call GetSEMSpotSize method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::GetProbeCurrent: failed to call GetSEMProbeCurrent method, client id = %d", m_nClientID);
|
|
@@ -269,7 +269,7 @@ namespace OTSController {
|
|
|
|
|
|
|
|
|
// set Probe Current
|
|
|
- if (!BrukerDll::SetSEMProbeCurrent(m_nClientID, a_dKV))
|
|
|
+ if (BrukerDll::SetSEMProbeCurrent(m_nClientID, a_dKV) != 0)
|
|
|
{
|
|
|
// failed to call GetSEMSpotSize method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::SetProbeCurrent: failed to call SetSEMProbeCurrent method, client id = %d", m_nClientID);
|
|
@@ -285,7 +285,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
// get spot size
|
|
|
- if (!BrukerDll::GetSEMSpotSize(m_nClientID, a_dSpotSize))
|
|
|
+ if (BrukerDll::GetSEMSpotSize(m_nClientID, a_dSpotSize)!=0)
|
|
|
{
|
|
|
// failed to call GetSEMSpotSize method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::GetSpotSize: failed to call GetSEMSpotSize method, client id = %d", m_nClientID);
|
|
@@ -299,7 +299,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
// set spot size
|
|
|
- if (!BrukerDll::SetSEMSpotSize(m_nClientID, a_dSpotSize))
|
|
|
+ if (BrukerDll::SetSEMSpotSize(m_nClientID, a_dSpotSize)!=0)
|
|
|
{
|
|
|
// failed to call SetSEMSpotSize method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::SetSEMSpotSize: failed to call SetSEMSpotSize method, client id = %d", m_nClientID);
|
|
@@ -321,7 +321,7 @@ namespace OTSController {
|
|
|
|
|
|
// get stage data
|
|
|
double dPositionX, dPositionY, dPositionZ, dTilt, dRotation;
|
|
|
- if (!BrukerDll::GetSEMStageData(m_nClientID, dPositionX, dPositionY, dPositionZ, dTilt, dRotation))
|
|
|
+ if (BrukerDll::GetSEMStageData(m_nClientID, dPositionX, dPositionY, dPositionZ, dTilt, dRotation)!=0)
|
|
|
{
|
|
|
// failed to call GetSEMStageData method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::GetSEMStageData: failed to call GetSEMStageData method, client id = %d", m_nClientID);
|
|
@@ -344,7 +344,7 @@ namespace OTSController {
|
|
|
double a_dRotation)
|
|
|
{
|
|
|
// set stage data
|
|
|
- if (!BrukerDll::SetSEMStageData(m_nClientID, a_dPositionX, a_dPositionY, a_dPositionZ, a_dTilt, a_dRotation))
|
|
|
+ if (BrukerDll::SetSEMStageData(m_nClientID, a_dPositionX, a_dPositionY, a_dPositionZ, a_dTilt, a_dRotation) != 0)
|
|
|
{
|
|
|
// failed to call SetSEMStageData method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::GetSEMStageData: failed to call SetSEMStageData method, client id = %d", m_nClientID);
|
|
@@ -360,7 +360,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
// set external on
|
|
|
- if (BrukerDll::SetSEMExternalOn(m_nClientID))
|
|
|
+ if (BrukerDll::SetSEMExternalOn(m_nClientID) == 0)
|
|
|
{
|
|
|
m_bSEMExternal = true;
|
|
|
LogWarn(__FILE__, __LINE__, _T("SetExternal On"));
|
|
@@ -381,7 +381,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
// set external off
|
|
|
- if (BrukerDll::SetSEMExternalOff(m_nClientID))
|
|
|
+ if (BrukerDll::SetSEMExternalOff(m_nClientID)==0)
|
|
|
{
|
|
|
m_bSEMExternal = false;
|
|
|
LogWarn(__FILE__, __LINE__, _T("SetExternal Off"));
|
|
@@ -432,7 +432,7 @@ namespace OTSController {
|
|
|
// turn high tension off
|
|
|
if (!a_bHTValue)
|
|
|
{
|
|
|
- if (!BrukerDll::SwitchSEMOff(m_nClientID, true, false, false))
|
|
|
+ if (BrukerDll::SwitchSEMOff(m_nClientID, true, false, false)!=0)
|
|
|
{
|
|
|
// failed to call sSwitchSEMOff method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::SetHTOnOff: failed to call sSwitchSEMOff (HV) method, client id = %d", m_nClientID );
|
|
@@ -441,7 +441,7 @@ namespace OTSController {
|
|
|
}
|
|
|
else if(a_bBeamCurrent)
|
|
|
{
|
|
|
- if (!BrukerDll::SwitchSEMOff(m_nClientID, false, true, false))
|
|
|
+ if (BrukerDll::SwitchSEMOff(m_nClientID, false, true, false)!=0)
|
|
|
{
|
|
|
// failed to call sSwitchSEMOff method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::SetHTOnOff: failed to call sSwitchSEMOff (Beam Current) method, client id = %d", m_nClientID );
|
|
@@ -450,7 +450,7 @@ namespace OTSController {
|
|
|
}
|
|
|
else if(a_bBeamBlank)
|
|
|
{
|
|
|
- if (!BrukerDll::SwitchSEMOff(m_nClientID, false, false, true))
|
|
|
+ if (BrukerDll::SwitchSEMOff(m_nClientID, false, false, true)!=0)
|
|
|
{
|
|
|
// failed to call sSwitchSEMOff method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "COTSBrukerImpl::SetHTOnOff: failed to call sSwitchSEMOff (Beam Blank) method, client id = %d", m_nClientID );
|
|
@@ -477,7 +477,7 @@ namespace OTSController {
|
|
|
uint32_t nAverage;
|
|
|
bool bCh1;
|
|
|
bool bCh2;
|
|
|
- if (!BrukerDll::ImageGetConfiguration(m_nClientID, nWidth, nHeight,nAverage, bCh1, bCh2))
|
|
|
+ if (BrukerDll::ImageGetConfiguration(m_nClientID, nWidth, nHeight,nAverage, bCh1, bCh2)!=0)
|
|
|
{
|
|
|
// failed to call ImageGetConfiguration method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "ImageGetConfiguration::ImageGetConfiguration: failed to call ImageGetConfiguration method, client id = %d", m_nClientID);
|
|
@@ -502,7 +502,7 @@ namespace OTSController {
|
|
|
|
|
|
|
|
|
// set image configuration
|
|
|
- if (!BrukerDll::ImageSetConfiguration(m_nClientID, a_nWidth, a_nHeight, a_nAverage, a_bCh1, a_bCh2))
|
|
|
+ if (BrukerDll::ImageSetConfiguration(m_nClientID, a_nWidth, a_nHeight, a_nAverage, a_bCh1, a_bCh2) != 0)
|
|
|
{
|
|
|
// failed to call ImageSetConfiguration method
|
|
|
LogErrorTrace(__FILE__, __LINE__, "ImageGetConfiguration::ImageSetConfiguration: failed to call ImageSetConfiguration method, client id = %d", m_nClientID);
|
|
@@ -549,7 +549,7 @@ namespace OTSController {
|
|
|
std::vector<BYTE> vecImage(nImageSize, 0);
|
|
|
|
|
|
BYTE showProgress = false;
|
|
|
- if (!BrukerDll::ImageAquireImage(m_nClientID, 1, showProgress, &vecImage[0], nImageSize, oImageInfo))
|
|
|
+ if (BrukerDll::ImageAquireImage(m_nClientID, 1, showProgress, &vecImage[0], nImageSize, oImageInfo) != 0)
|
|
|
{
|
|
|
// failed to call ImageAquireImage method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::AcquireImage: failed to call ImageAquireImage, client id is %d"), m_nClientID);
|
|
@@ -610,7 +610,7 @@ namespace OTSController {
|
|
|
{
|
|
|
|
|
|
// image set point
|
|
|
- if (!BrukerDll::ImageSetPoint(m_nClientID, (DWORD)a_oPoint.x, (DWORD)a_oPoint.y))
|
|
|
+ if (BrukerDll::ImageSetPoint(m_nClientID, (DWORD)a_oPoint.x, (DWORD)a_oPoint.y) != 0)
|
|
|
{
|
|
|
// failed to call ImageSetPoint method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::ImageSetPoint: failed to call ImageSetPoint, client id is %d"), m_nClientID);
|
|
@@ -829,7 +829,7 @@ namespace OTSController {
|
|
|
}
|
|
|
|
|
|
// quantify the spectrum in buffer
|
|
|
- if (!BrukerDll::QuantifySpectrum(m_nClientID, 1, a_pcMethod, a_pcParams, a_pcResultBuffer, a_nBufferSize))
|
|
|
+ if (BrukerDll::QuantifySpectrum(m_nClientID, 1, a_pcMethod, a_pcParams, a_pcResultBuffer, a_nBufferSize) != 0)
|
|
|
{
|
|
|
// failed to call QuantifySpectrum method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::QuantifySpectrum:Call QuantifySpectrum failed: client id is %d."), m_nClientID);
|
|
@@ -1066,7 +1066,7 @@ namespace OTSController {
|
|
|
char* pcParams = "ResultType=quantification";
|
|
|
char cResult[10000];
|
|
|
memset(cResult, 0, 10000);
|
|
|
- if (!BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE))
|
|
|
+ if (BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
|
|
|
{
|
|
|
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::ReadXRayPoints failed to call QuantifyPointListSpectrum method, error code %d"), -1);
|
|
@@ -1180,7 +1180,7 @@ namespace OTSController {
|
|
|
char* pcParams = "ResultType=quantification";
|
|
|
char cResult[10000];
|
|
|
memset(cResult, 0, 10000);
|
|
|
- if (!BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE))
|
|
|
+ if (BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
|
|
|
{
|
|
|
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::ReadXRayPoints failed to call QuantifyPointListSpectrum method, error code %d"), -1);
|
|
@@ -1360,7 +1360,7 @@ namespace OTSController {
|
|
|
long nBufferSize = (long)BRUKER_PARAM::BUF_LENGTH;
|
|
|
m_psServerName.reset(new char[(int)BRUKER_PARAM::BUF_LENGTH]);
|
|
|
memset(m_psServerName.get(), 0, nBufferSize);
|
|
|
- if (!BrukerDll::QueryServers(m_psServerName.get(), nBufferSize))
|
|
|
+ if (BrukerDll::QueryServers(m_psServerName.get(), nBufferSize) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::QueryServers: failed to call QueryServers method."));
|
|
|
return FALSE;
|
|
@@ -1428,15 +1428,15 @@ namespace OTSController {
|
|
|
|
|
|
|
|
|
// open client
|
|
|
- BOOL bRet = BrukerDll::OpenClient(a_sServerName, a_sUserName, a_sPassword, a_nStartNew, a_bGUI, a_nClientID);
|
|
|
- if (!bRet)
|
|
|
+ int32_t bRet = BrukerDll::OpenClient(a_sServerName, a_sUserName, a_sPassword, a_nStartNew, a_bGUI, a_nClientID);
|
|
|
+ if (bRet!=0)
|
|
|
{
|
|
|
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::OpenClient: failed to open client dll."));
|
|
|
-
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
- return bRet;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
// check detector states and set m_nSPU // Bruker四个有一个盒子,盒子共接4个探头
|
|
@@ -1526,7 +1526,7 @@ namespace OTSController {
|
|
|
BOOL bRet = FALSE;
|
|
|
if (bCombine)
|
|
|
{
|
|
|
- bRet = BrukerDll::CombineSpectrometer(m_nClientID, nCombineValue);
|
|
|
+ bRet = BrukerDll::CombineSpectrometer(m_nClientID, nCombineValue)==0;
|
|
|
LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetSPU: find combined."));
|
|
|
}
|
|
|
else
|
|
@@ -1561,7 +1561,7 @@ BOOL COTSBrukerImpl::CloseClient(void)
|
|
|
{
|
|
|
|
|
|
LogTrace(__FILE__, __LINE__, _T("Close Bruker client...")+ CString(std::to_string(m_nClientID).c_str()));
|
|
|
- if (!BrukerDll::CloseClient(m_nClientID))
|
|
|
+ if (BrukerDll::CloseClient(m_nClientID) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, " COTSBrukerImpl::CloseClient failed ");
|
|
|
return FALSE;
|
|
@@ -1608,7 +1608,7 @@ BOOL COTSBrukerImpl::StartSpectrumMeasurement()
|
|
|
DWORD nRealTime = 0;
|
|
|
|
|
|
// Success?
|
|
|
- if (!BrukerDll::StartSpectrumMeasurement(m_nClientID, m_nSPU, nRealTime))
|
|
|
+ if (BrukerDll::StartSpectrumMeasurement(m_nClientID, m_nSPU, nRealTime) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::::StartSpectrumMeasurement:Call StartSpectrumMeasurement failed: client id is %d"), m_nClientID);
|
|
|
return FALSE;
|
|
@@ -1627,7 +1627,7 @@ BOOL COTSBrukerImpl::IsSpectrumMeterRunning(BOOL& a_bRunning)
|
|
|
double nState;
|
|
|
double nPulseRate;
|
|
|
bool bRunning;
|
|
|
- if (!BrukerDll::GetSpectrumMeasureState(m_nClientID, 1, bRunning, nState, nPulseRate))
|
|
|
+ if (BrukerDll::GetSpectrumMeasureState(m_nClientID, 1, bRunning, nState, nPulseRate) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::IsSpectrumMeterRunning:Call GetSpectrumMeasureState failed: client id is %d"), m_nClientID);
|
|
|
return FALSE;
|
|
@@ -1643,7 +1643,7 @@ BOOL COTSBrukerImpl::IsSpectrumMeterRunning(BOOL& a_bRunning)
|
|
|
BOOL COTSBrukerImpl::StopSpectrumMeasure(void)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::StopSpectrumMeasurement(m_nClientID, 1))
|
|
|
+ if (BrukerDll::StopSpectrumMeasurement(m_nClientID, 1) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::StopSpectrumMeter:Call StopSpectrumMeasurement failed: client id is %d"), m_nClientID);
|
|
|
return FALSE;
|
|
@@ -1688,7 +1688,7 @@ BOOL COTSBrukerImpl::GetQuantificationMethods(std::vector<CString>& a_vMethods)
|
|
|
int32_t nBufferSize = CHAR_BUFFER_SIZE;
|
|
|
|
|
|
// get quantification method name strings
|
|
|
- if (!BrukerDll::GetQuantificationMethods(m_nClientID, AUTOMATIC_ONLY, cBuffer, nBufferSize))
|
|
|
+ if (BrukerDll::GetQuantificationMethods(m_nClientID, AUTOMATIC_ONLY, cBuffer, nBufferSize) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("Call GetQuantificationMethods failed: client id is %d"), m_nClientID);
|
|
|
return FALSE;
|
|
@@ -1780,7 +1780,7 @@ BOOL COTSBrukerImpl::QuantifySpectrumFile(LPCTSTR a_sFilePathName, CString a_str
|
|
|
memset(cResult, 0, (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE);
|
|
|
LogTrace(__FILE__,__LINE__,_T("To QuantifySpectrum"));
|
|
|
|
|
|
- if (!BrukerDll::QuantifySpectrum(m_nClientID, 0, cMethod, pcParams, cResult, (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE))
|
|
|
+ if (BrukerDll::QuantifySpectrum(m_nClientID, 0, cMethod, pcParams, cResult, (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__,__LINE__,_T("Call QuantifySpectrum failed: client id is %d."), m_nClientID);
|
|
|
return FALSE;
|
|
@@ -1826,7 +1826,7 @@ RTSpectrumHeaderRec* COTSBrukerImpl::GetSectrumHeader()
|
|
|
BOOL COTSBrukerImpl::GetSpectrum(long a_nBufferIndex, BrukerDll::PRTSpectrumHeaderRec a_poSpcHR, long a_nBufferSize)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::GetSpectrum(m_nClientID, a_nBufferIndex, a_poSpcHR, a_nBufferSize))
|
|
|
+ if (BrukerDll::GetSpectrum(m_nClientID, a_nBufferIndex, a_poSpcHR, a_nBufferSize) != 0)
|
|
|
{
|
|
|
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetSpectrum:Call GetSpectrum failed: client id is %d, error code is %d."), m_nClientID);
|
|
@@ -1849,7 +1849,7 @@ BOOL COTSBrukerImpl::LoadSpectrum(char* a_sFilePathName)
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (!BrukerDll::LoadSpectrum(m_nClientID, a_sFilePathName))
|
|
|
+ if (BrukerDll::LoadSpectrum(m_nClientID, a_sFilePathName) != 0)
|
|
|
{
|
|
|
// error, failed to call LoadSpectrum method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::LoadSpectrum: failed to call LoadSpectrum method. client id is %d."), m_nClientID);
|
|
@@ -1865,7 +1865,7 @@ BOOL COTSBrukerImpl::LoadSpectrum(char* a_sFilePathName)
|
|
|
BOOL COTSBrukerImpl::ReadSpectrum(void)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::ReadSpectrum(m_nClientID, 1))
|
|
|
+ if (BrukerDll::ReadSpectrum(m_nClientID, 1) != 0)
|
|
|
{
|
|
|
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::ReadSpectrum:Call ReadSpectrum failed: client id is %d"), m_nClientID);
|
|
@@ -1881,7 +1881,7 @@ BOOL COTSBrukerImpl::ReadSpectrum(void)
|
|
|
BOOL COTSBrukerImpl::PutSpectrum(char* a_pBuffer, long a_nBufferSize)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::PutSpectrum(m_nClientID, a_pBuffer, a_nBufferSize))
|
|
|
+ if (BrukerDll::PutSpectrum(m_nClientID, a_pBuffer, a_nBufferSize) != 0)
|
|
|
{
|
|
|
// error, fail to call PutSpectrum method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::PutSpectrum: failed to call PutSpectrum."), m_nClientID);
|
|
@@ -1918,7 +1918,7 @@ BOOL COTSBrukerImpl::CreateSpectrum(char* m_pParamBuffer, BrukerDll::PRTSpectrum
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (!BrukerDll::CreateSpectrum(m_pParamBuffer, a_poSpcHR, m_pResultBuffer, a_nBufferSize))
|
|
|
+ if (BrukerDll::CreateSpectrum(m_pParamBuffer, a_poSpcHR, m_pResultBuffer, a_nBufferSize) != 0)
|
|
|
{
|
|
|
// error, failed to call CreateSpectrum method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CreateSpectrum: failed to call CreateSpectrum method. client id is %d."), m_nClientID);
|
|
@@ -1939,7 +1939,7 @@ BOOL COTSBrukerImpl::ShowSpectrum(long a_nBufferIndex, char* a_pSpectumName)
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
|
- if (!BrukerDll::ShowSpectrum(m_nClientID, a_nBufferIndex, a_pSpectumName))
|
|
|
+ if (BrukerDll::ShowSpectrum(m_nClientID, a_nBufferIndex, a_pSpectumName) != 0)
|
|
|
{
|
|
|
// error, failed to call ShowSpectrum method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::ShowSpectrum: failed to call ShowSpectrum method. client id is %d."), m_nClientID);
|
|
@@ -1953,7 +1953,7 @@ BOOL COTSBrukerImpl::ShowSpectrum(long a_nBufferIndex, char* a_pSpectumName)
|
|
|
BOOL COTSBrukerImpl::GetSpectrometerParams(long a_nBufferIndex, char* a_pBuffer, int32_t& a_nBufferSize)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::GetSpectrometerParams(m_nClientID, a_nBufferIndex, a_pBuffer, a_nBufferSize))
|
|
|
+ if (BrukerDll::GetSpectrometerParams(m_nClientID, a_nBufferIndex, a_pBuffer, a_nBufferSize) != 0)
|
|
|
{
|
|
|
// error, failed to call GetSpectrometerParams method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetSpectrometerParams: failed to call GetSpectrometerParams method. client id is %d."), m_nClientID);
|
|
@@ -2049,7 +2049,7 @@ BOOL COTSBrukerImpl::CopySpectrum(long* a_pXRayData, DWORD a_nBufferSize)
|
|
|
BOOL COTSBrukerImpl::StartSpectrumLifeTimeMeasurement(DWORD a_nLifeTime)
|
|
|
{
|
|
|
|
|
|
- if (!BrukerDll::StartSpectrumLifeTimeMeasurement(m_nClientID, m_nSPU, a_nLifeTime))
|
|
|
+ if (BrukerDll::StartSpectrumLifeTimeMeasurement(m_nClientID, m_nSPU, a_nLifeTime) != 0)
|
|
|
{
|
|
|
// error, failed to call StartSpectrumLifeTimeMeasurement method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::StartSpectrumLifeTimeMeasurement: failed to call StartSpectrumLifeTimeMeasurement method. client id is %d"), m_nClientID);
|
|
@@ -2106,7 +2106,7 @@ BOOL COTSBrukerImpl::StartSpectrumRealTimeMeasurement(DWORD a_nRealTime)
|
|
|
{
|
|
|
|
|
|
|
|
|
- if (!BrukerDll::StartSpectrumMeasurement(m_nClientID, m_nSPU, a_nRealTime))
|
|
|
+ if (BrukerDll::StartSpectrumMeasurement(m_nClientID, m_nSPU, a_nRealTime) != 0)
|
|
|
{
|
|
|
// error, failed to call StartSpectrumMeasurement method
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::StartSpectrumRealTimeMeasurement: failed to call StartSpectrumMeasurement method. client id is %d."), m_nClientID);
|
|
@@ -2408,7 +2408,7 @@ BOOL COTSBrukerImpl::GetPointListSpectrum(long a_nIndex, long* a_pnSpec)
|
|
|
}
|
|
|
|
|
|
// Success?
|
|
|
- if (BrukerDll::GetPointListSpectrum(m_nClientID, a_nIndex, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (long)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE))
|
|
|
+ if (BrukerDll::GetPointListSpectrum(m_nClientID, a_nIndex, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (long)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) == 0)
|
|
|
{
|
|
|
if (!ConvertSpectrum((RTSpectrumHeaderRec*)m_psRTSpectrumBuffer.get(), a_pnSpec, (DWORD)BRUKER_PARAM::RT_SPECTRUM_CHANNELS))
|
|
|
{
|
|
@@ -2439,7 +2439,7 @@ BOOL COTSBrukerImpl::GetFeatureListSpectrum(long a_nIndex, long* a_pnSpec)
|
|
|
}
|
|
|
|
|
|
// Success?
|
|
|
- if (!(BrukerDll::GetFeatureListSpectrum(m_nClientID, a_nIndex, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE)))
|
|
|
+ if ((BrukerDll::GetFeatureListSpectrum(m_nClientID, a_nIndex, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE)) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetFeatureListSpectrum:failed, return"));
|
|
|
return FALSE;
|
|
@@ -2472,7 +2472,7 @@ BOOL COTSBrukerImpl::StartPointListMeasurement(
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (!BrukerDll::StartPointListMeasurement(m_nClientID, m_nSPU, a_nSegmentCount, a_poSegment, m_nMilliseconds))
|
|
|
+ if (BrukerDll::StartPointListMeasurement(m_nClientID, m_nSPU, a_nSegmentCount, a_poSegment, m_nMilliseconds) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::StartPointListMeasurement:Call StartPointListMeasurement failed: client id is %d(%d, %d, %d)"), m_nClientID, m_nSPU, a_nSegmentCount, m_nMilliseconds);
|
|
|
return FALSE;
|
|
@@ -2502,7 +2502,7 @@ BOOL COTSBrukerImpl::StartFeatureListMeasurement(
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
|
- if (!BrukerDll::StartFeatureListMeasurement(m_nClientID, m_nSPU, a_nFeatureCount, a_poFeature, a_pwdPixelTimes))
|
|
|
+ if (BrukerDll::StartFeatureListMeasurement(m_nClientID, m_nSPU, a_nFeatureCount, a_poFeature, a_pwdPixelTimes) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::StartFeatureListMeasurement:Call StartFeatureListMeasurement failed: client id is %d"), m_nClientID);
|
|
|
return FALSE;
|
|
@@ -2602,7 +2602,7 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_
|
|
|
char cResult[10000];
|
|
|
memset(cResult, 0, 10000);
|
|
|
|
|
|
- if (!BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE))
|
|
|
+ if (BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints failed to call QuantifyPointListSpectrum method at index %d, error code %d"), i, -1);
|
|
|
//return FALSE;
|
|
@@ -2799,7 +2799,7 @@ BOOL COTSBrukerImpl::SetXRayPointsByFeature(CPosXraysList& a_vXPoints, const DWO
|
|
|
char* pcParams = "ResultType=quantification";
|
|
|
char cResult[10000];
|
|
|
memset(cResult, 0, 10000);
|
|
|
- if (!BrukerDll::QuantifyFeatureListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE))
|
|
|
+ if (BrukerDll::QuantifyFeatureListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
|
|
|
{
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints failed to call QuantifyPointListSpectrum method, error code %d"), -1);
|
|
|
//return FALSE;
|