[wip] clang format

parent 0abb809b
Pipeline #12247 passed with stages
......@@ -111,9 +111,6 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
...
......
......@@ -448,12 +448,12 @@ int BufferCtrlObj::_assignImage2Buffer(DWORD &dwFrameFirst, DWORD &dwFrameLast,
void *myPcoBufferPtr = m_allocBuff.pcoAllocBufferPtr[bufIdx];
#if 0
if(myPcoBufferLen != myPcoBufferLenReal)
{
DEB_ALWAYS() << "ERROR myPcoBufferLen != myPcoBufferLenReal "
<< DEB_VAR2(myPcoBufferLen, myPcoBufferLenReal);
return -1;
}
if (myPcoBufferLen != myPcoBufferLenReal)
{
DEB_ALWAYS() << "ERROR myPcoBufferLen != myPcoBufferLenReal "
<< DEB_VAR2(myPcoBufferLen, myPcoBufferLenReal);
return -1;
}
#endif
......@@ -627,7 +627,7 @@ int BufferCtrlObj::_xferImag_buff2lima(DWORD &dwFrameIdx, int &bufIdx)
memcpy(ptrDest, ptrSrc, size);
}
//----- the image dwFrameIdx is already in the buffer -> callback
//----- the image dwFrameIdx is already in the buffer -> callback
// newFrameReady
//----- lima frame (0 ... N-1) PCO frame (1 ... N)
HwFrameInfoType frame_info;
......@@ -724,11 +724,11 @@ int BufferCtrlObj::_xferImag()
m_pcoData->traceAcq.nrImgRequested = dwRequestedFrames;
# if 0
if(!m_cam->_isRunAfterAssign())
{
DEB_TRACE() << "========================= recordingState 1 - BEFORE ASSIGN";
m_cam->_pco_SetRecordingState(1, error);
}
if (!m_cam->_isRunAfterAssign())
{
DEB_TRACE() << "========================= recordingState 1 - BEFORE ASSIGN";
m_cam->_pco_SetRecordingState(1, error);
}
# endif
// cleaning the buffers
......@@ -1005,22 +1005,20 @@ int BufferCtrlObj::_xferImag()
dwStatusDrv, errPco, iLoopsPolled);
DEB_ALWAYS() << msg;
}
DWORD dwFrameIdx1 = dwFrameIdx + 1;
if((dwFrameIdx + 1) >= dwRequestedFrames)
{
int error;
// ------------- stop the recording and clear buffers
DEB_ALWAYS()
<< "\n ... _pco_SetRecordingState(0) when: "
<< DEB_VAR2(dwFrameIdx1, dwRequestedFrames);
DWORD dwFrameIdx1 = dwFrameIdx + 1;
if ((dwFrameIdx + 1) >= dwRequestedFrames)
{
int error;
// ------------- stop the recording and clear buffers
DEB_ALWAYS() << "\n ... _pco_SetRecordingState(0) when: "
<< DEB_VAR2(dwFrameIdx1, dwRequestedFrames);
m_cam->_pco_SetRecordingState(0, error);
}
m_cam->_pco_SetRecordingState(0, error);
}
int xferRet = _xferImag_buff2lima(dwFrameIdx, bufIdx);
int xferRet = _xferImag_buff2lima(dwFrameIdx, bufIdx);
if (dbgTraceFifo)
{
printf("---TRACE _xferImag_buff2lima sBufNr[%d] dwFrameIdx[%d]\n",
......@@ -1522,7 +1520,7 @@ int BufferCtrlObj::_xferImag_getImage()
switch (_stopReq)
{
// case stopProcessing:
// case stopProcessing:
case stopRequest:
_retStatus = pcoAcqTransferStop;
break;
......@@ -1759,7 +1757,7 @@ int BufferCtrlObj::_xferImag_getImage_edge()
switch (_stopReq)
{
// case stopProcessing:
// case stopProcessing:
case stopRequest:
_retStatus = pcoAcqTransferStop;
break;
......@@ -2019,10 +2017,10 @@ int BufferCtrlObj::_xferImagMult()
}
#if 0
DEB_TRACE()
<< "\n PCO_GetImageEx() ===>"
<< "\n " << DEB_VAR5( dwFrameIdx, dwFrameIdxFirst, dwFrameIdxLast, dwFramesPerBuffer, dwRequestedFrames)
<< "\n " << DEB_VAR5(wSegment, sBufNr, _wArmWidth, _wArmHeight, _wBitPerPixel);
DEB_TRACE()
<< "\n PCO_GetImageEx() ===>"
<< "\n " << DEB_VAR5(dwFrameIdx, dwFrameIdxFirst, dwFrameIdxLast, dwFramesPerBuffer, dwRequestedFrames)
<< "\n " << DEB_VAR5(wSegment, sBufNr, _wArmWidth, _wArmHeight, _wBitPerPixel);
#endif
usElapsedTimeSet(usStartPco);
......@@ -2104,7 +2102,7 @@ int BufferCtrlObj::_xferImagMult()
switch (_stopReq)
{
// case stopProcessing:
// case stopProcessing:
case stopRequest:
_retStatus = pcoAcqTransferStop;
break;
......@@ -2133,23 +2131,23 @@ void BufferCtrlObj::_pcoAllocBuffers(bool max)
# if 0
if(!m_allocBuff.createEventsDone){
for(bufIdx=0; bufIdx <m_cam->m_pco_buffer_nrevents; bufIdx++) {
// Create two event objects
m_allocBuff.bufferAllocEvent[bufIdx] = CreateEvent(
NULL, // default security attributes
true, // auto-reset event object = false / manual reset = true
false, // initial state is nonsignaled
NULL); // unnamed object
if (!m_allocBuff.bufferAllocEvent[bufIdx])
{
THROW_HW_ERROR(NotSupported) << "CreateEvent error";
}
}
m_allocBuff.createEventsDone = true;
}
if (!m_allocBuff.createEventsDone) {
for (bufIdx = 0; bufIdx < m_cam->m_pco_buffer_nrevents; bufIdx++) {
// Create two event objects
m_allocBuff.bufferAllocEvent[bufIdx] = CreateEvent(
NULL, // default security attributes
true, // auto-reset event object = false / manual reset = true
false, // initial state is nonsignaled
NULL); // unnamed object
if (!m_allocBuff.bufferAllocEvent[bufIdx])
{
THROW_HW_ERROR(NotSupported) << "CreateEvent error";
}
}
m_allocBuff.createEventsDone = true;
}
# endif
# ifdef USING_PCO_ALLOCATED_BUFFERS
......@@ -2234,28 +2232,28 @@ void BufferCtrlObj::_pcoAllocBuffers(bool max)
}
# if 0
//-------------- allocate 2 buffers (0,1) and received the handle, mem ptr, events
for(bufIdx = 0; bufIdx <m_cam->m_pco_buffer_nrevents ; bufIdx ++)
{
m_allocBuff.pcoAllocBufferNr[bufIdx] = -1;
m_cam->_pco_AllocateBuffer(
&m_allocBuff.pcoAllocBufferNr[bufIdx], \
_dwAllocatedBufferSize, \
&m_allocBuff.pcoAllocBufferPtr[bufIdx], \
&m_allocBuff.bufferAllocEvent[bufIdx], error);
// PRINT ERROR , error, "PCO_AllocateBuffer");
DEB_TRACE() << fnId << " " << DEB_VAR2(bufIdx, _dwAllocatedBufferSize);
if(error) {
int nrEvents =m_cam->m_pco_buffer_nrevents;
DEB_ALWAYS() << sErr << "\n"
<< DEB_VAR3(nrEvents, bufIdx,_dwAllocatedBufferSize);
THROW_HW_ERROR(NotSupported) << sErr;
}
m_allocBuff.dwPcoAllocBufferSize[bufIdx] = _dwAllocatedBufferSize;
}
//-------------- allocate 2 buffers (0,1) and received the handle, mem ptr, events
for (bufIdx = 0; bufIdx < m_cam->m_pco_buffer_nrevents; bufIdx++)
{
m_allocBuff.pcoAllocBufferNr[bufIdx] = -1;
m_cam->_pco_AllocateBuffer(
&m_allocBuff.pcoAllocBufferNr[bufIdx], \
_dwAllocatedBufferSize, \
& m_allocBuff.pcoAllocBufferPtr[bufIdx], \
& m_allocBuff.bufferAllocEvent[bufIdx], error);
// PRINT ERROR , error, "PCO_AllocateBuffer");
DEB_TRACE() << fnId << " " << DEB_VAR2(bufIdx, _dwAllocatedBufferSize);
if (error) {
int nrEvents = m_cam->m_pco_buffer_nrevents;
DEB_ALWAYS() << sErr << "\n"
<< DEB_VAR3(nrEvents, bufIdx, _dwAllocatedBufferSize);
THROW_HW_ERROR(NotSupported) << sErr;
}
m_allocBuff.dwPcoAllocBufferSize[bufIdx] = _dwAllocatedBufferSize;
}
# endif
m_pcoData->bAllocatedBufferDone = m_allocBuff.pcoAllocBufferDone = true;
......@@ -2323,29 +2321,29 @@ void BufferCtrlObj::_pcoAllocBuffersFree()
#if 0
# ifdef USING_PCO_ALLOCATED_BUFFERS
// free the pco allocated buffers
// free the pco allocated buffers
error = 0;
char *sErr;
char* sErr;
if (m_allocBuff.pcoAllocBufferDone) {
if(m_allocBuff.pcoAllocBufferDone){
//SC2_SDK_FUNC int WINAPI PCO_FreeBuffer(HANDLE ph, SHORT sBufNr)
//-------------- allocate 2 buffers (0,1) and received the handle, mem ptr, events
for(int bufIdx = 0; bufIdx <m_pco_buffer_nrevents ; bufIdx ++) {
m_cam->_pco_FreeBuffer(m_allocBuff.pcoAllocBufferNr[bufIdx], error);
if(error) {
DEB_TRACE() << sErr;
THROW_HW_ERROR(NotSupported) << sErr;
}
m_allocBuff.pcoAllocBufferNr[bufIdx]= -1;
m_allocBuff.dwPcoAllocBufferSize[bufIdx] = 0;
m_allocBuff.pcoAllocBufferPtr[bufIdx] = NULL;
}
m_allocBuff.pcoAllocBufferDone = false;
}
//SC2_SDK_FUNC int WINAPI PCO_FreeBuffer(HANDLE ph, SHORT sBufNr)
//-------------- allocate 2 buffers (0,1) and received the handle, mem ptr, events
for (int bufIdx = 0; bufIdx < m_pco_buffer_nrevents; bufIdx++) {
m_cam->_pco_FreeBuffer(m_allocBuff.pcoAllocBufferNr[bufIdx], error);
if (error) {
DEB_TRACE() << sErr;
THROW_HW_ERROR(NotSupported) << sErr;
}
m_allocBuff.pcoAllocBufferNr[bufIdx] = -1;
m_allocBuff.dwPcoAllocBufferSize[bufIdx] = 0;
m_allocBuff.pcoAllocBufferPtr[bufIdx] = NULL;
}
m_allocBuff.pcoAllocBufferDone = false;
}
# endif
#endif
}
......@@ -3180,7 +3178,7 @@ int BufferCtrlObj::_xferImagMultDoubleImage()
switch (_stopReq)
{
// case stopProcessing:
// case stopProcessing:
case stopRequest:
_retStatus = pcoAcqTransferStop;
break;
......
......@@ -77,38 +77,37 @@ const char *_timestamp_pcocamera()
}
#ifdef WITH_GIT_VERSION
#include "PcoGitVersion.h"
# include "PcoGitVersion.h"
char * _timestamp_gitversion(char *buffVersion, int len)
char *_timestamp_gitversion(char *buffVersion, int len)
{
__sprintfSExt(buffVersion, len,
#ifdef PCO_GIT_VERSION
PCO_GIT_VERSION "\n"
#endif
#ifdef PCO_SDK_VERSION
PCO_SDK_VERSION "\n"
#endif
#ifdef PROCLIB_GIT_VERSION
PROCLIB_GIT_VERSION "\n"
#endif
#ifdef LIBCONFIG_GIT_VERSION
LIBCONFIG_GIT_VERSION "\n"
#endif
#ifdef LIMA_GIT_VERSION
LIMA_GIT_VERSION "\n"
#endif
#ifdef TANGO_GIT_VERSION
TANGO_GIT_VERSION "\n"
#endif
#ifdef SPEC_GIT_VERSION
SPEC_GIT_VERSION "\n"
#endif
"\n");
return buffVersion;
__sprintfSExt(buffVersion, len,
# ifdef PCO_GIT_VERSION
PCO_GIT_VERSION "\n"
# endif
# ifdef PCO_SDK_VERSION
PCO_SDK_VERSION "\n"
# endif
# ifdef PROCLIB_GIT_VERSION
PROCLIB_GIT_VERSION "\n"
# endif
# ifdef LIBCONFIG_GIT_VERSION
LIBCONFIG_GIT_VERSION "\n"
# endif
# ifdef LIMA_GIT_VERSION
LIMA_GIT_VERSION "\n"
# endif
# ifdef TANGO_GIT_VERSION
TANGO_GIT_VERSION "\n"
# endif
# ifdef SPEC_GIT_VERSION
SPEC_GIT_VERSION "\n"
# endif
"\n");
return buffVersion;
}
#endif
//=========================================================================================================
//=========================================================================================================
......@@ -1140,26 +1139,24 @@ void Camera::prepareAcq()
//==========================================================================================================
//==========================================================================================================
const char *sPcoAcqStatus[] =
{
"pcoAcqOK",
"pcoAcqIdle",
"pcoAcqStart",
"pcoAcqRecordStart",
"pcoAcqRecordEnd",
"pcoAcqRecordStop",
"pcoAcqRecordTimeout",
"pcoAcqTransferStart",
"pcoAcqTransferEnd",
"pcoAcqStop",
"pcoAcqTransferStop",
"pcoAcqWaitTimeout",
"pcoAcqWaitError",
"pcoAcqError",
"pcoAcqPcoError",
const char *sPcoAcqStatus[] = {
"pcoAcqOK",
"pcoAcqIdle",
"pcoAcqStart",
"pcoAcqRecordStart",
"pcoAcqRecordEnd",
"pcoAcqRecordStop",
"pcoAcqRecordTimeout",
"pcoAcqTransferStart",
"pcoAcqTransferEnd",
"pcoAcqStop",
"pcoAcqTransferStop",
"pcoAcqWaitTimeout",
"pcoAcqWaitError",
"pcoAcqError",
"pcoAcqPcoError",
};
//=====================================================================
//=====================================================================
......
......@@ -1075,8 +1075,6 @@ void Camera::getGeneralCAPS1(std::string &o_sn)
dwGeneralCaps1 = m_pcoData->stcPcoDescription.dwGeneralCaps1;
#endif
int nib[8];
int i, j;
......
......@@ -168,7 +168,7 @@ time_t getTimestamp()
//(..\..\..\..\src\PcoCamera.cpp) $
#define LEN_BUFF_DATE 128
#define LEN_BUFF_PATH PATH_MAX // 260 in win
#define LEN_BUFF_PATH PATH_MAX // 260 in win
#define TOKNR_DT 5
int __xlat_date(char *s1, char &ptrTo, int lenTo)
......@@ -2419,7 +2419,7 @@ void print_hex_dump_buff(void *ptr_buff, size_t len)
BYTE *ptr = (BYTE *)ptr_buff;
;
//printf("dump buff / len: %ld\n", len);
// printf("dump buff / len: %ld\n", len);
printf("dump buff / len: %zd\n", len);
while (len > 0)
......
......@@ -406,11 +406,11 @@ void _pco_acq_thread_dimax(void *argin)
m_sync->setStarted(false);
#if 0
if(requestStop == stopRequest)
{
Event *ev = new Event(Hardware,Event::Error,Event::Camera,Event::CamFault, errMsg);
m_cam->_getPcoHwEventCtrlObj()->reportEvent(ev);
}
if (requestStop == stopRequest)
{
Event* ev = new Event(Hardware, Event::Error, Event::Camera, Event::CamFault, errMsg);
m_cam->_getPcoHwEventCtrlObj()->reportEvent(ev);
}
#endif
......@@ -636,11 +636,11 @@ void _pco_acq_thread_dimax_trig_single(void *argin)
m_sync->setStarted(false);
#if 0
if(requestStop == stopRequest)
{
Event *ev = new Event(Hardware,Event::Error,Event::Camera,Event::CamFault, errMsg);
m_cam->_getPcoHwEventCtrlObj()->reportEvent(ev);
}
if (requestStop == stopRequest)
{
Event* ev = new Event(Hardware, Event::Error, Event::Camera, Event::CamFault, errMsg);
m_cam->_getPcoHwEventCtrlObj()->reportEvent(ev);
}
#endif
......@@ -690,9 +690,9 @@ void _pco_acq_thread_edge(void *argin)
m_sync->setExposing(status);
// m_sync->stopAcq();
printf("=== %s [%d]> _pco_SetRecordingState(0)\n", fnId, __LINE__);
const char *msg = m_cam->_pco_SetRecordingState(0, error);
printf("=== %s [%d]> _pco_SetRecordingState(0)\n", fnId, __LINE__);
const char *msg = m_cam->_pco_SetRecordingState(0, error);
if (error)
{
printf("=== %s [%d]> ERROR %s\n", fnId, __LINE__, msg);
......@@ -1069,19 +1069,19 @@ void Camera::startAcq()
_beginthread(_pco_acq_thread_edge, 0, (void *)this);
#if 0
AutoMutex lock(m_cond.mutex());
bool resWait;
int retry = 3;
int val, val0; val0 = pcoAcqRecordStart;
while( ((val = m_sync->getExposing()) != val0) && retry--)
{
DEB_TRACE() << "+++ getExposing / pcoAcqRecordStart - WAIT - " << DEB_VAR3(val, val0, retry);
resWait = m_cond.wait(2.);
}
DEB_TRACE() << "+++ getExposing / pcoAcqRecordStart - EXIT - " << DEB_VAR3(val, val0, retry);
lock.unlock();
AutoMutex lock(m_cond.mutex());
bool resWait;
int retry = 3;
int val, val0; val0 = pcoAcqRecordStart;
while (((val = m_sync->getExposing()) != val0) && retry--)
{
DEB_TRACE() << "+++ getExposing / pcoAcqRecordStart - WAIT - " << DEB_VAR3(val, val0, retry);
resWait = m_cond.wait(2.);
}
DEB_TRACE() << "+++ getExposing / pcoAcqRecordStart - EXIT - " << DEB_VAR3(val, val0, retry);
lock.unlock();
#endif
m_pcoData->traceAcq.msStartAcqEnd = msElapsedTime(tStart);
......@@ -1089,11 +1089,11 @@ void Camera::startAcq()
}
#if 0
if(_isCameraType(Pco2k | Pco4k)){
_beginthread( _pco_acq_thread_ringBuffer, 0, (void*) this);
m_pcoData->traceAcq.msStartAcqEnd = msElapsedTime(tStart);
return;
}
if (_isCameraType(Pco2k | Pco4k)) {
_beginthread(_pco_acq_thread_ringBuffer, 0, (void*)this);
m_pcoData->traceAcq.msStartAcqEnd = msElapsedTime(tStart);
return;
}
#endif
if (_isCameraType(Dimax | Pco2k | Pco4k))
......
......@@ -611,9 +611,9 @@ void SyncCtrlObj::getStatus(HwInterface::StatusType &status)
case pcoAcqRecordEnd:
case pcoAcqTransferStart:
status.acq = AcqRunning;
//status.det = DetIdle;
status.det = DetLatency;
break;
// status.det = DetIdle;
status.det = DetLatency;
break;
case pcoAcqRecordStop:
case pcoAcqRecordTimeout:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment