Commit 31b7ae61 authored by Roberto Arturo Homs-Regojo's avatar Roberto Arturo Homs-Regojo Committed by GitHub

Pco 1.603 (#3)

included camera subtype
extraction of the imgNr and date/time from the timestamp of the image
fixed the procedure for pco edge usb / different from pco edge cameralink
moved basic pco sdk fuctions to PcoCameraSdk.cpp (partial)
upgrade sdk118 to sdk120, added CLHS dll, included cameralinkHS
options for hwio signal
migration of attributes from talk cmd
fix the start recording (dimax) to be compatible with edge/cameralink
parent 398ce63f
2017/01/09 13:06:12 ==========================================
scp: copied local directory to segfs and /tmp_14_days:
from: [../../install/] and [./bat/]
to: [blissadm@lid00a:/segfs/bliss/projects/LIMA/build/depot_win/win_vc9/pco/install-2017-01-09_130606]
to: [/t/rhoms1/install-2017-01-09_130606]
to: [/t/rhoms1/install-beta]
2017/01/09 13:05:02 ==========================================
#define PCO_SDK_VERSION "$Id: PCOSDK [1.20] $"
#define PCO_GIT_VERSION "$Id: PCO rev[2017-01-09 13:02:47 +0100] head[5b89e7c][5b89e7c6ff3649cf2f5f55a11a991efda3099bb7] ref[ (HEAD, gitrh/pco-1.603, pco-1.603)] at [2017/01/09 13:05:01] $"
#define LIMA_GIT_VERSION "$Id: LIMA rev[2016-10-03 10:21:55 +0200] head[268f03c][268f03c8ade70b296bb86317a2310c24ca4d4707] ref[ (HEAD, gitrh/core-1.6, github/core-1.6, core-1.6)] at [2017/01/09 13:05:01] $"
#define PROCLIB_GIT_VERSION "$Id: PROCLIB rev[2016-01-15 15:44:08 +0100] head[3a08863][3a0886386e57a24ced072832d321d2dc43449e0b] ref[ (HEAD, github/master, github/HEAD, master)] at [2017/01/09 13:05:01] $"
#define LIBCONFIG_GIT_VERSION "$Id: LIBCONFIG rev[2013-02-07 18:08:29 +0100] head[89c411a][89c411a541d4ab4d66257ccb85749853fd685cbb] ref[ (HEAD, github/master, github/HEAD, master)] at [2017/01/09 13:05:01] $"
#define TANGO_GIT_VERSION "$Id: TANGO rev[2016-09-27 17:28:03 +0200] head[75531aa][75531aaf9bcda8b27a09b92cf355307847835d6c] ref[ (HEAD, github/master, github/HEAD, master)] at [2017/01/09 13:05:01] $"
#define SPEC_GIT_VERSION "$Id: SPEC rev[2016-10-10 09:40:10 +0200] head[65690d3][65690d3b7d24783256b279542a796c8a8a3f795f] ref[ (HEAD, github/master, github/HEAD, master)] at [2017/01/09 13:05:01] $"
2017/01/09 12:36:07 ==========================================
scp: copied local directory to segfs and /tmp_14_days:
from: [../../install/] and [./bat/]
to: [blissadm@lid00a:/segfs/bliss/projects/LIMA/build/depot_win/win_vc9/pco/install-2017-01-09_123602]
to: [/t/rhoms1/install-2017-01-09_123602]
to: [/t/rhoms1/install-beta]
- fix the start recording (dimax) to be compatible with edge/cameralink
2016/12/09 20:48:29 ==========================================
scp: copied local directory to segfs and /tmp_14_days:
from: [../../install/] and [./bat/]
to: [blissadm@lid00a:/segfs/bliss/projects/LIMA/build/depot_win/win_vc9/pco/install-2016-12-09_204823]
to: [/t/rhoms1/install-2016-12-09_204823]
to: [/t/rhoms1/install-beta]
- _pco_acq_thread_edge - hw error event timeout
- xferImag - included property acqTimeoutRetry (also in talk) / acqStop
- attributes functions (without talk)
2016/11/21 14:44:13 ==========================================
#define PCO_SDK_VERSION "$Id: PCOSDK [1.20] $"
#define PCO_GIT_VERSION "$Id: PCO rev[2016-11-21 12:32:06 +0100] head[398ce63][398ce63f665b03c72996dd061c78f65ee9212a9d] ref[ (HEAD, tag: pco-win64-1.602, gitrh/pco-1.603, github/master, github/HEAD, pco-1.603, master)] at [2016/11/21 14:44:13] $"
#define LIMA_GIT_VERSION "$Id: LIMA rev[2016-10-03 10:21:55 +0200] head[268f03c][268f03c8ade70b296bb86317a2310c24ca4d4707] ref[ (HEAD, gitrh/core-1.6, github/core-1.6, core-1.6)] at [2016/11/21 14:44:13] $"
#define PROCLIB_GIT_VERSION "$Id: PROCLIB rev[2016-01-15 15:44:08 +0100] head[3a08863][3a0886386e57a24ced072832d321d2dc43449e0b] ref[ (HEAD, github/master, github/HEAD, master)] at [2016/11/21 14:44:13] $"
#define LIBCONFIG_GIT_VERSION "$Id: LIBCONFIG rev[2013-02-07 18:08:29 +0100] head[89c411a][89c411a541d4ab4d66257ccb85749853fd685cbb] ref[ (HEAD, github/master, github/HEAD, master)] at [2016/11/21 14:44:13] $"
#define TANGO_GIT_VERSION "$Id: TANGO rev[2016-09-27 17:28:03 +0200] head[75531aa][75531aaf9bcda8b27a09b92cf355307847835d6c] ref[ (HEAD, github/master, github/HEAD, master)] at [2016/11/21 14:44:13] $"
#define SPEC_GIT_VERSION "$Id: SPEC rev[2016-10-10 09:40:10 +0200] head[65690d3][65690d3b7d24783256b279542a796c8a8a3f795f] ref[ (HEAD, github/master, github/HEAD, master)] at [2016/11/21 14:44:13] $"
2016/11/18 19:00:00 ==========================================
scp: copied local directory to segfs and /tmp_14_days:
from: [../../install/] and [./bat/]
......
......@@ -58,7 +58,9 @@
#define CAMERA_NAME_SIZE 128
#define MSG_SIZE 512
#define BUFF_XLAT_SIZE 128
#define MSG1K 1024
#define MSG1K (1024 * 1)
#define MSG4K (1024 * 4)
#define MSG8K (1024 * 8)
#define ID_TIMESTAMP "$Id: [" __DATE__ " " __TIME__ "] [" __TIMESTAMP__ "] [" __FILE__ "] $"
......
......@@ -319,6 +319,11 @@ struct stcPcoData {
int testForceFrameFirst0;
bool pcoLogActive;
int acqTimeoutRetry; // max nr of timeout during acq (wait for mult obj)
long reserved[32];
};
enum enumChange {
......@@ -428,6 +433,7 @@ namespace lima
double pcoGetFrameRate() { return m_pcoData->frameRate; }
PcoHwEventCtrlObj *_getPcoHwEventCtrlObj() {return m_HwEventCtrlObj;}
BufferCtrlObj* _getBufferCtrlObj() { return m_buffer;}
SyncCtrlObj* _getSyncCtrlObj() { return m_sync;}
struct stcPcoData * _getPcoData() {return m_pcoData; }
......@@ -541,7 +547,47 @@ namespace lima
bool _isRunAfterAssign();
public:
public:
//----------- attributes
void getAcqTimeoutRetry(int &val);
void setAcqTimeoutRetry(int val);
void getAdc(int &val);
void setAdc(int val);
void getAdcMax(int &val);
void getCamInfo(std::string &o_sn) ;
void getCamType(std::string &o_sn) ;
void getVersion(std::string &o_sn) ;
void getPixelRateInfo(std::string &o_sn) ;
void getClTransferParam(std::string &o_sn) ;
void getLastError(std::string &o_sn) ;
void getTraceAcq(std::string &o_sn) ;
void getPixelRateValidValues(std::string &o_sn) ;
void getCocRunTime(double &coc);
void getFrameRate(double &framerate);
void getLastImgRecorded(int & img);
void getLastImgAcquired(int & img);
void getMaxNbImages(int & nr);
void getPcoLogsEnabled(int & enabled);
void getPixelRate(int & val);
void setPixelRate(int val);
void getRollingShutter(int & val);
void setRollingShutter(int val);
public:
//----------- pco sdk functions
WORD _pco_GetActiveRamSegment(); // {return m_pcoData->wActiveRamSegment;}
......@@ -577,6 +623,9 @@ namespace lima
void _pco_GetGeneralCapsDESC(DWORD &capsDesc1, int &err);
void _pco_GetTransferParameter(void* buffer, int ilen, int &err);
};
}
}
......
......@@ -3,7 +3,7 @@ namespace Pco
class Camera
{
%TypeHeaderCode
#include "lima/HwInterface.h"
#include "lima/HwInterface.h"
#include <PcoCamera.h>
%End
public:
......@@ -15,14 +15,45 @@ namespace Pco
void startAcq();
void reset(int);
void getMaxWidthHeight(unsigned int& width,unsigned int& height /Out/);
void getBytesPerPixel(unsigned int& pixbytes /Out/);
int getNbAcquiredFrames();
char *talk(char *cmd);
void getAcqTimeoutRetry(int &val /Out/);
void setAcqTimeoutRetry(int val);
void getAdc(int & adc /Out/);
void setAdc(int val);
void getAdcMax(int & adc /Out/);
void getCamInfo(std::string &o_sn /Out/) ;
void getCamType(std::string &o_sn /Out/) ;
void getVersion(std::string &o_sn /Out/) ;
void getPixelRateInfo(std::string &o_sn /Out/) ;
void getClTransferParam(std::string &o_sn /Out/) ;
void getLastError(std::string &o_sn /Out/) ;
void getPixelRateValidValues(std::string &o_sn /Out/) ;
void getTraceAcq(std::string &o_sn /Out/) ;
void getCocRunTime(double & coc /Out/);
void getFrameRate(double & frameRate /Out/);
void getLastImgRecorded(int & img /Out/);
void getLastImgAcquired(int & img /Out/);
void getMaxNbImages(int & nr /Out/);
void getPcoLogsEnabled(int & enabled /Out/);
void getPixelRate(int & val /Out/);
void setPixelRate(int val);
void getRollingShutter(int & val /Out/);
void setRollingShutter(int val);
};
};
......
......@@ -386,7 +386,7 @@ int BufferCtrlObj::_xferImag()
char msg[RING_LOG_BUFFER_SIZE+1];
char *pmsg = msg;
m_cam->m_tmpLog->flush(-1);
int maxWaitTimeout = 3;
int maxWaitTimeout ; m_cam->getAcqTimeoutRetry(maxWaitTimeout);
bool checkImgNr = false;
int imgNrDiff = 0;
......@@ -434,12 +434,13 @@ int BufferCtrlObj::_xferImag()
msElapsedTimeSet(tStart);
m_pcoData->traceAcq.nrImgRequested = dwRequestedFrames;
#if 0
if(!m_cam->_isRunAfterAssign())
{
DEB_ALWAYS() << "========================= recordingState 1 - BEFORE ASSIGN";
m_cam->_pco_SetRecordingState(1, error);
}
#endif
// --------------- prepare the first buffer
// ------- in PCO DIMAX only 1 image can be retreived
......@@ -460,7 +461,8 @@ int BufferCtrlObj::_xferImag()
bool recording = m_cam->_getCameraState(CAMSTATE_RECORD_STATE);
bool runAfterAssign = m_cam->_isRunAfterAssign();
if((recording && !runAfterAssign) || (!recording && runAfterAssign))
if((!runAfterAssign) || (!recording && runAfterAssign))
{
if(error = _assignImage2Buffer(dwFrameFirst2assign, dwFrameLast2assign, dwRequestedFrames, bufIdx,live_mode))
{
......@@ -487,7 +489,7 @@ int BufferCtrlObj::_xferImag()
{
DWORD sleepMs = 1;
::Sleep(sleepMs);
DEB_ALWAYS() << "========================= recordingState 1 - AFTER ASSIGN";
DEB_ALWAYS() << "========================= recordingState 1 - AFTER ASSIGN (_xferImag)";
if(m_cam->_getDebug(DBG_WAITOBJ))
{
pmsg = "... EDGE - recordingState 1" ; m_cam->m_tmpLog->add(pmsg); DEB_ALWAYS() << pmsg;
......@@ -636,9 +638,7 @@ _RETRY:
m_cam->m_tmpLog->add(msg);
}
#endif
if(m_cam->_getCameraState(CAMSTATE_RECORD_STATE))
if( (m_cam->_getCameraState(CAMSTATE_RECORD_STATE) && m_cam->_isRunAfterAssign()) || (!m_cam->_isRunAfterAssign()) )
{
if(error = _assignImage2Buffer(dwFrameFirst2assign, dwFrameLast2assign, dwRequestedFrames, bufIdx, live_mode)) {
return pcoAcqPcoError;
......@@ -648,7 +648,6 @@ _RETRY:
{
DEB_ALWAYS() << "ERROR _assignImage2Buffer with recordState = 0 / IGNORED!!!!";
}
}
#ifdef DEBUG_XFER_IMAG
......@@ -661,6 +660,9 @@ _RETRY:
} // for(bufIdx = 0; bufIdx < PCO_BUFFER_NREVENTS; bufIdx++)
_RETRY_WAIT:
if((m_sync->_getRequestStop(_nrStop) == stopRequest) && (_nrStop > MAX_NR_STOP)) {goto _EXIT_STOP;}
// --------------- check if there is some buffer ready
if(m_cam->_getDebug(DBG_WAITOBJ)){
pmsg = "... WaitForMultipleObjects - waiting" ; m_cam->m_tmpLog->add(pmsg); DEB_ALWAYS() << pmsg;
......@@ -708,10 +710,10 @@ _RETRY_WAIT:
goto _RETRY;
case WAIT_TIMEOUT:
maxWaitTimeout--;
maxWaitTimeout--;
if(m_cam->_getDebug(DBG_WAITOBJ)){m_cam->m_tmpLog->dumpPrint(true);}
printf("=== %s> WAITOBJ ERROR - TIMEOUT [%d]\n", fnId, maxWaitTimeout);
if(maxWaitTimeout > 0 ) goto _RETRY_WAIT;
if(maxWaitTimeout) goto _RETRY_WAIT; // retry when >0 (counting down up to 0) / <0 infinite
return pcoAcqWaitTimeout;
default:
......@@ -855,7 +857,8 @@ int BufferCtrlObj::_xferImag_getImage()
int error;
bool live_mode;
DWORD dwFrameIdxFirst, dwFrameIdxLast;
int maxWaitTimeout = 10;
int maxWaitTimeout ; m_cam->getAcqTimeoutRetry(maxWaitTimeout);
WORD _wBitPerPixel;
char *sErr;
void *ptrLimaBuffer;
......@@ -1073,7 +1076,7 @@ int BufferCtrlObj::_xferImag_getImage_edge()
int error;
bool live_mode;
DWORD dwFrameIdxFirst, dwFrameIdxLast;
int maxWaitTimeout = 10;
int maxWaitTimeout ; m_cam->getAcqTimeoutRetry(maxWaitTimeout);
WORD _wBitPerPixel;
char *sErr;
void *ptrLimaBuffer;
......@@ -1156,6 +1159,7 @@ int BufferCtrlObj::_xferImag_getImage_edge()
{
char *pmsg = "... EDGE - recordingState 1" ; m_cam->m_tmpLog->add(pmsg); DEB_ALWAYS() << pmsg;
}
DEB_ALWAYS() << "========================= recordingState 1 - AFTER ASSIGN (_xferImag_getImage_edge";
m_cam->_pco_SetRecordingState(1, error);
}
......@@ -1328,7 +1332,7 @@ int BufferCtrlObj::_xferImagMult()
int error;
bool live_mode;
DWORD dwFrameIdxFirst, dwFrameIdxLast;
int maxWaitTimeout = 10;
int maxWaitTimeout ; m_cam->getAcqTimeoutRetry(maxWaitTimeout);
WORD _wBitPerPixel;
char *sErr;
void *ptrLimaBuffer;
......
......@@ -396,6 +396,7 @@ Camera::Camera(const char *params) :
char *value, *key;
bool ret;
int iValue;
/***
key = "test";
......@@ -407,6 +408,11 @@ Camera::Camera(const char *params) :
ret = paramsGet(key, value);
if(ret) {m_pcoData->testCmdMode = _atoi64(value);}
key = "acqTimeoutRetry";
ret = paramsGet(key, value);
iValue = ret ? atoi(value) : 3;
m_pcoData->acqTimeoutRetry = (iValue < 0 ) ? 0 : iValue;
DEB_ALWAYS()
<< ALWAYS_NL << DEB_VAR1(m_pcoData->version)
<< ALWAYS_NL << _checkLogFiles(true);
......@@ -427,7 +433,7 @@ void Camera::_init(){
DEB_ALWAYS() << _sprintComment(fnId, "[ENTRY]");
char msg[MSG_SIZE + 1];
char msg[MSG4K + 1];
//char *pMsg;
int error=0;
char *errMsg;
......@@ -436,10 +442,10 @@ void Camera::_init(){
_armRequired(true);
m_log.clear();
sprintf_s(msg, MSG_SIZE, "*** Pco log %s\n", getTimestamp(Iso));
sprintf_s(msg, sizeof(msg), "*** Pco log %s\n", getTimestamp(Iso));
m_log.append(msg);
DEB_ALWAYS() <<_getDllPath(FILE_PCO_DLL, msg, MSG_SIZE);
DEB_ALWAYS() <<_getDllPath(FILE_PCO_DLL, msg, sizeof(msg));
//PCO_FN0(error, pMsg,PCO_ResetLib);
......@@ -975,7 +981,8 @@ void Camera::startAcq()
if(!_isRunAfterAssign())
{
//_pco_SetRecordingState(1, error);
DEB_ALWAYS() << "========================= recordingState 1 - BEFORE ASSIGN (startAcq)";
_pco_SetRecordingState(1, error);
}
if(_isCameraType(Edge)){
......@@ -992,7 +999,6 @@ void Camera::startAcq()
}
#endif
// if(_isCameraType(Dimax)){
if(_isCameraType(Dimax | Pco2k | Pco4k)){
_pco_SetRecordingState(1, error);
if(iRequestedFrames > 0 ) {
......@@ -1058,11 +1064,8 @@ double usElapsedTimeTicsPerSec() {
}
//==========================================================================================================
//==========================================================================================================
void _pco_acq_thread_dimax(void *argin) {
DEF_FNID;
......@@ -1105,7 +1108,6 @@ void _pco_acq_thread_dimax(void *argin) {
bool nb_frames_fixed = false;
int nb_frames; m_sync->getNbFrames(nb_frames);
//m_pcoData->traceAcq.nrImgRequested = nb_frames;
m_pcoData->traceAcq.nrImgRequested0 = nb_frames;
m_sync->setAcqFrames(0);
......@@ -1211,7 +1213,6 @@ void _pco_acq_thread_dimax(void *argin) {
msElapsedTimeSet(tStart); // reset for xfer
if(nb_acq_frames < nb_frames) m_sync->setNbFrames(nb_acq_frames);
// if(m_buffer->_getRequestStop()) {
......@@ -1245,8 +1246,7 @@ void _pco_acq_thread_dimax(void *argin) {
} // if nb_frames_fixed
//m_sync->setExposing(status);
m_pcoData->dwMaxImageCnt[wSegment-1] =
m_pcoData->traceAcq.maxImgCount = _dwMaxImageCnt;
......@@ -1581,6 +1581,22 @@ void _pco_acq_thread_edge(void *argin) {
m_sync->setStarted(false); // updated
switch(status)
{
case pcoAcqRecordTimeout:
case pcoAcqWaitTimeout:
case pcoAcqWaitError:
case pcoAcqError:
case pcoAcqPcoError:
//Event *ev = new Event(Hardware,Event::Error,Event::Camera,Event::Default, "timeout");
Event *ev = new Event(Hardware,Event::Error,Event::Camera,Event::CamFault, "timeout");
m_cam->_getPcoHwEventCtrlObj()->reportEvent(ev);
break;
}
_endthread();
}
......@@ -2675,7 +2691,6 @@ void Camera::_setCameraState(long long flag, bool val)
bool Camera::_isRunAfterAssign()
{
return (_isCameraType(Edge) && _isInterfaceType(ifCameralink));
//return false;
}
//=================================================================================================
......
This diff is collapsed.
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