[wip] refactoring for linux & cosmetics

- new att getCAPS1
- linux / fixed stopAcq in dimax
- tmp save for rolling shutter switch in linux
parent c3b15958
Pipeline #10452 failed with stages
in 2 minutes and 4 seconds
......@@ -79,6 +79,11 @@ DECLARE_HANDLE(HWND);
#endif
#define WAITMS_1S 1000
#define WAITMS_100MS 100
#define WAITMS_10MS 10
#define WAITMS_1MS 1
//#define sprintf_s(buffer, buffer_size, stringbuffer, ...) (snprintf(buffer, buffer_size, stringbuffer, __VA_ARGS__))
......@@ -211,6 +216,7 @@ typedef int tPvErr;
}
#define PCO_CHECK_ERROR(er, fn) (PcoCheckError(__LINE__, __FILE__, ( er ) , ( fn ) ))
#define PCO_CHECK_ERROR_CAM(er, fn) (m_cam.PcoCheckError(__LINE__, __FILE__, ( er ) , ( fn ) ))
#ifndef __linux__
......
This diff is collapsed.
......@@ -16,39 +16,52 @@ LOG="./doc/VERSION.log"
DT=`date +"%Y/%m/%d %H:%M:%S"`
DIR="./"
PCO_DIR=`pwd`
LIMA_DIR="${PCO_DIR}/../.."
DIR="${PCO_DIR}"
PCOREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
PCOPATH=`cd ${DIR} ; pwd`
DIR="../.."
DIR="${LIMA_DIR}"
LIMAREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
LIMAPATH=`cd ${DIR} ; pwd`
DIR="../../third-party/Processlib"
DIR="${LIMA_DIR}/third-party/Processlib"
PROCLIBREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
PROCLIBPATH=`cd ${DIR} ; pwd`
DIR="../../third-party/libconfig"
DIR="${LIMA_DIR}/third-party/bitshuffle"
BITSHUFFLEREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
BITSHUFFLEPATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/third-party/hdf5"
HDF5REV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
HDF5PATH=`cd ${DIR} ; pwd`
DIR="${LIMA_DIR}/third-party/libconfig"
LIBCONFIGREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
LIBCONFIPATH=`cd ${DIR} ; pwd`
DIR="../../applications/tango/python"
DIR="${LIMA_DIR}/applications/tango/python"
TANGOREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
TANGOPATH=`cd ${DIR} ; pwd`
DIR="../../applications/spec"
DIR="${LIMA_DIR}/applications/spec"
SPECREV=`cd ${DIR} ; git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"`
SPECPATH=`cd ${DIR} ; pwd`
{
head -1 ${SDK_WIN_H}
head -1 ${SDK_LIN_H}
echo "#define PCO_GIT_VERSION \"\$Id: PCO ${PCOREV} at [${DT}] [${PCOPATH}] \$\""
echo "#define LIMA_GIT_VERSION \"\$Id: LIMA ${LIMAREV} at [${DT}] [${LIMAPATH}] \$\""
echo "#define PROCLIB_GIT_VERSION \"\$Id: PROCLIB ${PROCLIBREV} at [${DT}] [${PROCLIBPATH}] \$\""
echo "#define LIBCONFIG_GIT_VERSION \"\$Id: LIBCONFIG ${LIBCONFIGREV} at [${DT}] [${LIBCONFIGPATH}] \$\""
echo "#define TANGO_GIT_VERSION \"\$Id: TANGO ${TANGOREV} at [${DT}] [${TANGOPATH}] \$\""
echo "#define SPEC_GIT_VERSION \"\$Id: SPEC ${SPECREV} at [${DT}] [${SPECPATH}] \$\""
echo "#define PCO_GIT_VERSION \"\$Id: PCO ${PCOREV} at [${DT}] [${PCOPATH}] \$\""
echo "#define LIMA_GIT_VERSION \"\$Id: LIMA ${LIMAREV} at [${DT}] [${LIMAPATH}] \$\""
echo "#define PROCLIB_GIT_VERSION \"\$Id: PROCLIB ${PROCLIBREV} at [${DT}] [${PROCLIBPATH}] \$\""
echo "#define LIBCONFIG_GIT_VERSION \"\$Id: LIBCONFIG ${LIBCONFIGREV} at [${DT}] [${LIBCONFIGPATH}] \$\""
echo "#define HDF5_GIT_VERSION \"\$Id: HDF5 ${HDF5REV} at [${DT}] [${HDF5PATH}] \$\""
echo "#define BITSHUFFLE_GIT_VERSION \"\$Id: BITSHUFFLE ${BITSHUFFLEREV} at [${DT}] [${BITSHUFFLEPATH}] \$\""
echo "#define TANGO_GIT_VERSION \"\$Id: TANGO ${TANGOREV} at [${DT}] [${TANGOPATH}] \$\""
echo "#define SPEC_GIT_VERSION \"\$Id: SPEC ${SPECREV} at [${DT}] [${SPECPATH}] \$\""
} > ${FILE}
......
......@@ -80,6 +80,7 @@ namespace Pco
void getRollingShutter(int & val /Out/); // rollingShutter
void setRollingShutter(int val);
void getRollingShutterInfo(std::string &o_sn /Out/) ; // rollingShutterInfo
void setRollingShutterStr(std::string &i_sn); // rollingShutter string
void getTemperatureInfo(std::string &o_sn /Out/);
......@@ -112,6 +113,8 @@ namespace Pco
void setRecorderStopRequest(int val);
void getLastImgFifo(int & val /Out/);
void getGeneralCAPS1(std::string &o_sn /Out/);
private:
Camera(const Pco::Camera&);
......
......@@ -841,12 +841,12 @@ int BufferCtrlObj::_xferImag()
if((m_sync->_getRequestStop(_nrStop) == stopRequest) && (_nrStop > MAX_NR_STOP)) {goto _EXIT_STOP;}
//Sleep(msTimeout);
int eventRet; // = WaitForMultipleObjects(2, &events[0], FALSE, 10);
int eventRet; // = WaitForMultipleObjects(2, &events[0], false, 10);
eventRet = WaitForMultipleObjects(
nrEvents, // number of objects in array
m_allocBuff.bufferAllocEvent, // array of objects
FALSE, // wait for any object
false, // wait for any object
msTimeout); // ms wait timeout
//GetPendingBuffer(hCamera, &ipending);// <--- This can indicate that more than one buffer is ready
......@@ -1931,8 +1931,8 @@ void BufferCtrlObj::_pcoAllocBuffers(bool max) {
// 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
true, // auto-reset event object = false / manual reset = true
false, // initial state is nonsignaled
NULL); // unnamed object
if (!m_allocBuff.bufferAllocEvent[bufIdx])
......@@ -2455,7 +2455,7 @@ _RETRY_WAIT:
dwEvent = WaitForMultipleObjects(
m_cam->m_pco_buffer_nrevents, // number of objects in array
m_allocBuff.bufferAllocEvent, // array of objects
FALSE, // wait for any object
false, // wait for any object
EVENT_WAIT_TMOUT_MS); // ms wait
// The return value indicates which event is signaled
......
......@@ -442,6 +442,8 @@ void Camera::_init(){
int error=0;
#ifdef __linux__
// ----- linux [begin]
UNUSED const char *pcoFn;
//-------------------- linux
......@@ -515,7 +517,9 @@ void Camera::_init(){
// 0x08: "Falling edge active"
_pco_initHWIOSignal(0, 0x04, iErr);
// ----- linux [end]
#else
// ----- windows [begin]
char msg[MSG4K + 1];
......@@ -652,6 +656,8 @@ void Camera::_init(){
throw LIMA_HW_EXC(Error, "Camera not found!");
_pco_initHWIOSignal(0, 0x4, error);
// ----- windows [end]
#endif
_pco_SetCameraToCurrentTime(error);
......@@ -1265,10 +1271,10 @@ bool Camera::_isValid_pixelRate(DWORD dwPixelRate){
if(dwPixelRate > 0)
for(int i = 0; i < 4; i++) {
if(dwPixelRate == m_pcoData->stcPcoDescription.dwPixelRateDESC[i]) return TRUE;
if(dwPixelRate == m_pcoData->stcPcoDescription.dwPixelRateDESC[i]) return true;
}
return FALSE;
return false;
}
......@@ -1371,23 +1377,23 @@ bool Camera::_isCameraType(unsigned long long tp){
case CAMERATYPE_PCO_DIMAX_STD:
case CAMERATYPE_PCO_DIMAX_TV:
case CAMERATYPE_PCO_DIMAX_CS:
if(tp & (Dimax | camRAM)) {DEB_TRACE() << "Dimax [exit] "; return TRUE;}
if(tp & (Dimax | camRAM)) {DEB_TRACE() << "Dimax [exit] "; return true;}
switch(wCameraSubtype >> 8)
{
case 0x20:
if(tp & (DimaxHS1 | DimaxHS)) {DEB_TRACE() << "DimaxHS1 / HS [exit] "; return TRUE;}
if(tp & (DimaxHS1 | DimaxHS)) {DEB_TRACE() << "DimaxHS1 / HS [exit] "; return true;}
break;
case 0x21:
if(tp & (DimaxHS2 | DimaxHS)) {DEB_TRACE() << "DimaxHS2 / HS [exit] "; return TRUE;}
if(tp & (DimaxHS2 | DimaxHS)) {DEB_TRACE() << "DimaxHS2 / HS [exit] "; return true;}
break;
case 0x23:
if(tp & (DimaxHS4 | DimaxHS)) {DEB_TRACE() << "DimaxHS4 / HS [exit] "; return TRUE;}
if(tp & (DimaxHS4 | DimaxHS)) {DEB_TRACE() << "DimaxHS4 / HS [exit] "; return true;}
break;
default:
break;
}
DEB_TRACE() << "Dimax SUBTYPE NONE FALSE [exit] ";
return FALSE;
DEB_TRACE() << "Dimax SUBTYPE NONE false [exit] ";
return false;
case CAMERATYPE_PCO_EDGE_GL:
return !!(tp & (EdgeGL | Edge));
......@@ -1413,7 +1419,7 @@ bool Camera::_isCameraType(unsigned long long tp){
}
return FALSE;
return false;
}
......@@ -1451,7 +1457,7 @@ bool Camera::_isInterfaceType(int tp)
return !!(tp & (ifCoaxpress));
default:
return FALSE;
return false;
}
......@@ -1629,7 +1635,7 @@ void Camera::_setActionTimestamp(int action)
void Camera::getStatus(Camera::Status& status)
{
DEB_MEMBER_FUNCT();
AutoMutex aLock(m_cond.mutex());
//AutoMutex aLock(m_cond.mutex());
status = m_status;
DEB_RETURN() << DEB_VAR1(DEB_HEX(status));
}
......@@ -1639,9 +1645,13 @@ void Camera::getStatus(Camera::Status& status)
void Camera::_setStatus(Camera::Status status,bool force)
{
DEB_MEMBER_FUNCT();
DEF_FNID;
AutoMutex aLock(m_cond.mutex());
if(force || m_status != Camera::Fault)
m_status = status;
m_cond.broadcast();
aLock.unlock();
}
......@@ -1694,7 +1704,7 @@ void Camera::_pco_set_shutter_rolling_edge(int &error){
DEB_TRACE() << fnId << " [entry - edge] ";
m_config = TRUE;
m_config = true;
// DWORD m_dwSetup[10];
// WORD m_wLen = 10;
......@@ -1721,7 +1731,7 @@ void Camera::_pco_set_shutter_rolling_edge(int &error){
if(error)
{
DEB_ALWAYS() << fnId << " [ERROR PCO_GetCameraSetup] " << msg;
m_config = FALSE;
m_config = false;
return;
}
......@@ -1731,7 +1741,7 @@ void Camera::_pco_set_shutter_rolling_edge(int &error){
if(m_dwSetup[0] == dwRollingShRequested) {
DEB_TRACE() << "exit NO Change in ROLLING SHUTTER " << DEB_VAR2(dwRollingShNow, dwRollingShRequested);
m_config = FALSE;
m_config = false;
return;
}
......@@ -1753,7 +1763,7 @@ void Camera::_pco_set_shutter_rolling_edge(int &error){
if(error)
{
DEB_ALWAYS() << fnId << " [ERROR PCO_SetCameraSetup] " << cmsg;
m_config = FALSE;
m_config = false;
return;
}
......@@ -1780,7 +1790,7 @@ void Camera::_pco_set_shutter_rolling_edge(int &error){
DEB_TRACE() << fnId << " [exit] ";
m_config = FALSE;
m_config = false;
return;
}
......@@ -1796,7 +1806,7 @@ bool Camera::_isValid_rollingShutter(DWORD dwRolling)
case PCO_EDGE_SETUP_ROLLING_SHUTTER: return _isCapsDesc(capsRollingShutter); // 1
case PCO_EDGE_SETUP_GLOBAL_SHUTTER: return _isCapsDesc(capsGlobalShutter) ; // 2
case PCO_EDGE_SETUP_GLOBAL_RESET: return _isCapsDesc(capsGlobalResetShutter) ; //4
default: return FALSE;
default: return false;
}
}
......
This diff is collapsed.
......@@ -584,7 +584,7 @@ bool Camera::_isCapsDesc(int caps)
if(error)
{
DEB_ALWAYS() << "ERROR - _pco_GetGeneralCapsDESC";
return FALSE;
return false;
}
#else
_dwCaps1 = m_pcoData->stcPcoDescription.dwGeneralCaps1;
......@@ -633,7 +633,7 @@ bool Camera::_isCapsDesc(int caps)
return !(_dwCaps1 & BIT8);
default:
return FALSE;
return false;
}
}
......@@ -3054,12 +3054,12 @@ void Camera::_pco_SetDelayExposureTime(int &error, int ph){
m_sync->getLatTime(_delay);
double _delay0 = _delay;
doIt = TRUE;
doIt = true;
ph = 0;
if(ph != 0){
doIt = FALSE;
doIt = false;
WORD _wArmWidth, _wArmHeight, _wMaxWidth, _wMaxHeight;
_pco_GetSizes(&_wArmWidth, &_wArmHeight, &_wMaxWidth, &_wMaxHeight, error);
......@@ -3072,7 +3072,7 @@ void Camera::_pco_SetDelayExposureTime(int &error, int ph){
printf("--- %s>period[%g] -> cocRunTime[%g]\n", fnId, period , m_pcoData->cocRunTime);
if(period > m_pcoData->cocRunTime) {
_delay += period - m_pcoData->cocRunTime;
doIt = TRUE;
doIt = true;
printf("--- %s> delay forced [%g] -> [%g]\n", fnId, _delay0, _delay);
}
}
......@@ -3316,7 +3316,11 @@ void Camera::_pco_RebootCamera(int &err)
err = 0;
#ifdef __linux__
DEB_ALWAYS() << NOT_IMPLEMENTED ;
err = camera->PCO_RebootCamera();
PCO_CHECK_ERROR(err, "PCO_RebootCamera");
//DEB_ALWAYS() << NOT_IMPLEMENTED ;
return;
#else
......@@ -3444,7 +3448,53 @@ void Camera::_pco_GetCameraSetup(WORD& wType, DWORD& dwSetup, WORD& wLen, int &e
err = 0;
#ifdef __linux__
DEB_ALWAYS() << NOT_IMPLEMENTED ;
/// \brief Request the current camera setup
/// \anchor PCO_GetCameraSetup
///
/// This function is used to query the current operation mode of the camera. Some cameras can work at different
/// operation modes with different descriptor settings.\n
/// pco.edge:\n
/// To get the current shutter mode input index setup_id must be set to 0.\n
/// current shutter mode is returned in setup_flag[0]
/// - 0x00000001 = Rolling Shutter
/// - 0x00000002 = Global Shutter
/// - 0x00000004 = Global Reset
///
/// \param setup_id Identification code for selected setup type.
/// \param setup_flag Pointer to a DWORD array to get the current setup flags. If set to NULL in input only
/// the array length is returned.
/// - On input this variable can be set to NULL, then only array length is filled with correct value.
/// - On output the array is filled with the available information for the selected setup_id
/// \param length Pointer to a WORD variable
/// - On input to indicate the length of the Setup_flag array in DWORDs.
/// - On output the length of the setup_flag array in DWORDS
/// \return Error code or PCO_NOERROR on success
///
DWORD PCO_GetCameraSetup(WORD setup_id, DWORD *setup_flag, WORD *length);
// DWORD PCO_GetCameraSetup(WORD *setup_id, DWORD *setup_flag, WORD *length);
// DWORD PCO_SetCameraSetup(WORD setup_id, DWORD *setup_flag,WORD length);
// setup_flag[0]=PCO_EDGE_SETUP_ROLLING_SHUTTER;
// setup_flag[1]=0;
// setup_flag[2]=0;
// setup_flag[3]=0;
//WORD setup_id=0;
//int err = 0;
//DWORD setup_flag[4];
//WORD length=sizeof(setup_flag);
DWORD dwErr=PCO_NOERROR;
wType = 0;
//dwErr = camera->PCO_SetCameraSetup(setup_id, setup_flag, length); WORD setup_id=0;
dwErr = camera->PCO_GetCameraSetup(wType, &dwSetup, &wLen);
err=dwErr;
PCO_CHECK_ERROR(err, "PCO_GetCameraSetup");
DEB_ALWAYS() << fnId << " " << DEB_VAR2(wType, wLen);;
return;
#else
......@@ -3486,7 +3536,33 @@ void Camera::_pco_SetCameraSetup(WORD wType, DWORD& dwSetup, WORD wLen, int &err
err = 0;
#ifdef __linux__
DEB_ALWAYS() << NOT_IMPLEMENTED ;
/// \brief Sets the camera setup structure (see camera specific structures)
/// \anchor PCO_SetCameraSetup
///
/// pco.edge:\n
/// To get the current shutter mode input index setup_id must be set to 0.\n
/// current shutter mode is returned in setup_flag[0]
/// - 0x00000001 = Rolling Shutter
/// - 0x00000002 = Global Shutter
/// - 0x00000004 = Global Reset
/// When camera is set to a new shuttermode uit must be reinitialized by calling one of the reboot functions.
/// After rebooting, camera description must be read again see \ref PCO_GetCameraDescription.
///
/// \param setup_id Identification code for selected setup type.
/// \param setup_flag Flags to be set for the selected setup type.
/// \param length Number of valid DWORDs in setup_flag array.
/// \return Error code or PCO_NOERROR on success
///
// DWORD PCO_SetCameraSetup(WORD setup_id, DWORD *setup_flag,WORD length);
DWORD dwErr=PCO_NOERROR;
wType = 0;
dwErr = camera->PCO_SetCameraSetup(wType, &dwSetup, wLen);
err=dwErr;
PCO_CHECK_ERROR(err, "PCO_SetCameraSetup");
DEB_ALWAYS() << fnId << " " << DEB_VAR2(wType, wLen);;
return;
#else
......
......@@ -268,7 +268,11 @@ void Camera::_pco_Open_Cam(int &err)
{
delete camera;
camera = NULL;
THROW_HW_ERROR(Error) ;
const char *msg = "FATAL can NOT open the camera!!!";
DEB_ALWAYS() << msg;
THROW_FATAL(Hardware, Error) << msg;
}
DEB_ALWAYS() << "After open Camera" ;
......@@ -307,22 +311,26 @@ void Camera::_pco_Open_Grab(int &err)
}
else
{
DEB_ALWAYS() << "FATAL Wrong camera for this application";
camera->Close_Cam();
delete camera;
camera = NULL;
grabber = NULL;
THROW_HW_ERROR(Error) ;
const char *msg = "FATAL Wrong camera for this application";
DEB_ALWAYS() << msg;
THROW_FATAL(Hardware, Error) << msg;
}
if(!grabber)
if(!grabber)
{
DEB_ALWAYS() << "FATAL new grabber creation";
camera->Close_Cam();
delete camera;
camera = NULL;
grabber = NULL;
THROW_HW_ERROR(Error) ;
const char *msg = "FATAL new grabber creation";
DEB_ALWAYS() << msg;
THROW_FATAL(Hardware, Error) << msg;
}
grabber->SetLog(mylog);
......@@ -340,8 +348,10 @@ void Camera::_pco_Open_Grab(int &err)
camera->Close_Cam();
delete camera;
camera = NULL;
DEB_ALWAYS() << "FATAL Open_Grabber, close application";
THROW_HW_ERROR(Error) ;
const char *msg = "FATAL Open_Grabber, close application";
DEB_ALWAYS() << msg;
THROW_FATAL(Hardware, Error) << msg;
}
return;
......
......@@ -960,3 +960,177 @@ void Camera::getLastImgFifo(int &val)
val = m_pcoData->traceAcq.lastImgFifo;
}
//====================================================================
// SIP - attrib / EDGE - rolling shutter
//====================================================================
void Camera::getRollingShutter(int &val)
{
int error;
DWORD dwRolling;
if(!_isCameraType(Edge))
{
val = -1;
return;
}
_get_shutter_rolling_edge(dwRolling, error);
val = dwRolling;
}
//---------------------------------------------------------------------
//---------------------------------------------------------------------
// GeneralCaps1-Bits
// NO_GLOBAL_SHUTTER 0x00080000 Global shutter operation mode not available
// GLOBAL_RESET_MODE 0x00100000 Global reset operation mode not available
void Camera::setRollingShutter(int val)
{
DEB_MEMBER_FUNCT();
int error;
DWORD dwRolling, dwRollingNew;
dwRollingNew = (DWORD) val;
if(!_isValid_rollingShutter(dwRollingNew))
{
DEB_ALWAYS() << "ERROR requested Rolling Shutter not allowed " << DEB_VAR1(dwRollingNew);
error = -1;
return;
}
_get_shutter_rolling_edge(dwRolling, error);
// different modules for lin & win
// lin -> activate thread Camera::_AcqThread::threadFunction_SwitchEdge()
// win -> activate thread _pco_shutter_thread_edge
// -> m_cam->_pco_set_shutter_rolling_edge
if(dwRollingNew != dwRolling){
_set_shutter_rolling_edge(dwRollingNew, error);
}
}
void Camera::setRollingShutterStr(std::string &i_sn)
{
DEB_MEMBER_FUNCT();
const char *strIn = i_sn.c_str();
int _val;
if( (_stricmp(strIn, "1") == 0) || (_stricmp(strIn, "RS") == 0) )
{
_val = 1;
}
else if( (_stricmp(strIn, "2") == 0) || (_stricmp(strIn, "GS") == 0) )
{
_val = 2;
}
else if( (_stricmp(strIn, "4") == 0) || (_stricmp(strIn, "GR") == 0) )
{
_val = 4;
}
else
{
DEB_ALWAYS() << "ERROR requested Rolling Shutter not allowed " << DEB_VAR1(strIn);
return;
}
setRollingShutter(_val);
}
//---------------------------------------------------------------------
//---------------------------------------------------------------------
void Camera::getRollingShutterInfo(std::string &o_sn)
{
char *ptr = buff;
char *ptrMax = buff + sizeof(buff);
const char *sId;
int val;
bool bRS = _isCapsDesc(capsRollingShutter);
bool bGL = _isCapsDesc(capsGlobalShutter);
bool bGR = _isCapsDesc(capsGlobalResetShutter);
if( !(bRS || bGL || bGR))
{
ptr += __sprintfSExt(ptr, ptrMax-ptr, "Rolling Shutter is not allowed");
o_sn = buff;
return;
}
getRollingShutter(val);
switch(val)
{
case 1: sId = "RS" ; break;
case 2: sId = "GS" ; break;
case 4: sId = "GR" ; break;
default: sId = "ERROR" ; break;
}
ptr += __sprintfSExt(ptr, ptrMax-ptr, "actual[%d][%S] validValues: ", val);
if(bRS) ptr += __sprintfSExt(ptr, ptrMax-ptr, "rolling[%d][RS] ", (int) PCO_EDGE_SETUP_ROLLING_SHUTTER);
if(bGL) ptr += __sprintfSExt(ptr, ptrMax-ptr, "global[%d][GS] ",(int) PCO_EDGE_SETUP_GLOBAL_SHUTTER);
if(bGR) ptr += __sprintfSExt(ptr, ptrMax-ptr, "globalReset[%d][GR] ", (int) PCO_EDGE_SETUP_GLOBAL_RESET);
o_sn = buff;
return;
}
//=================================================================================================
//=================================================================================================
void Camera::getGeneralCAPS1(std::string &o_sn)
{
//error = camera->PCO_GetCameraDescription(&m_pcoData->stcPcoDescription);
char *ptr = buff;
char *ptrMax = buff + sizeof(buff);
DWORD dwGeneralCaps1 = m_pcoData->stcPcoDescription.dwGeneralCaps1;
DWORD dwVal;
int nib[8];
int i, j;
dwVal = dwGeneralCaps1;
for(i = 0; i<8 ; i++)
{
nib[i] = (dwVal & 0xF);
dwVal >>= 4;