Commit 398ce63f authored by Roberto Arturo Homs-Regojo's avatar Roberto Arturo Homs-Regojo Committed by GitHub

Pco 1.602 (#2)

* update setId

* update the working test version with usb3 / pco edge gold
- test running version
  comp[2015/12/11 13:17:57] PcoCamera.cpp
  install-2015-12-11_131825
  develop_02, remotes/github/develop_02
  d2f1fe0c 2015-12-11 14:26:34
- minor changes / temp save

* minor / included camera subtype / tmp save
- improve traceAcq
- test with pco gold 4.2m usb

* minor / log for 1.407

* minor tools / added ident.exe for cpInstall

* - tmp save / _xferImag_getImage_edge() / TESTCMDMODE_EDGE_XFER (0x2) test mode without events for edge gold usb
- logsbackup.bat, logsoff.bat, logson.bat (manage PCO log files)
- minor debug / trace / ...

* - minor / tmp save

* - temp save
- extraction of the imgNr and date/time from the timestamp of the image
- fix division by 0 when camera subType is not defined
- included checkImgNr in _xferImag_getImage_edge and _xferImag
- minor / format / trace

* - temp save / usb3
- fixed the procedure for pco edge usb / different from pco edge
  cameralink
-- start record before assign buffer
-- force cancel images always before record off / to avoid go to unknow
  state of the cam
-- long tests done with edge/cameralink

* - temp save
- added function _isRunAfterAssign() in order to manage the start record for all types
- minor: moved basic pco sdk fuctions to PcoCameraSdk.cpp (partial)
- long tests done with edge/usb3 OK

* - tmp save
- sip fix getMaxWidthHeight to int
- talk / included getVersion file
- minor / names
- vc project / included sip files

* upgrade sdk118 to sdk120

* sdk functions
  _pco_SetTimestampMode _pco_GetTimestampMode
  _pco_GetGeneralCapsDESC
  _pco_GetTransferParameter
minor fixes
temp save

* Camera::_isRunAfterAssign() - check for pco
beta test / wid16napco2
temp save

* update version

* - lima 1.60 + skd 1.20 / win64
- minor debug xferImag()
- beta test / wid16napco2

* version log

* - added new pco edge subtypes
- added CLHS dll
- tmp save

* - version / tmp sav

* - clTransferParameters / included cameralinkHS

* - pco dimax/2k/4k - fix pre recording state
- fix start record after assign for Edge USB3
- added _isInterfaceType()
- options for hwio signals
- options talk
- working test in wid15dimax2 / pco edge 5.5 ch hs me5
parent c89c8a27
This diff is collapsed.
......@@ -58,6 +58,7 @@
#define CAMERA_NAME_SIZE 128
#define MSG_SIZE 512
#define BUFF_XLAT_SIZE 128
#define MSG1K 1024
#define ID_TIMESTAMP "$Id: [" __DATE__ " " __TIME__ "] [" __TIMESTAMP__ "] [" __FILE__ "] $"
......
......@@ -121,6 +121,8 @@ void usElapsedTimeSet(LARGE_INTEGER &tick0) ;
long long usElapsedTime(LARGE_INTEGER &tick0) ;
double usElapsedTimeTicsPerSec() ;
#define DIM_ACTION_TIMESTAMP 10
enum actionTimestamp {tsConstructor = 0, tsStartAcq, tsStopAcq, tsPrepareAcq, tsReset};
enum timestampFmt {Iso=1, IsoHMS, FnFull, FnDate};
char *getTimestamp(timestampFmt fmtIdx, time_t xtime = 0) ;
......@@ -306,6 +308,11 @@ struct stcPcoData {
WORD wBitAlignment; // 0 = MSB (left) alignment
struct
{
time_t ts[DIM_ACTION_TIMESTAMP];
} action_timestamp;
stcPcoData();
void traceAcqClean();
void traceMsg(char *s);
......@@ -336,6 +343,16 @@ enum enumPcoFamily {
EdgeHS = 1<<7,
};
enum enumInterfaceTypes {
ifFirewire = 1<<0,
ifCameralink = 1<<1,
ifCameralinkHS = 1<<2,
ifUsb = 1<<3,
ifUsb3 = 1<<4,
ifEth = 1<<5,
ifSerial = 1<<6,
ifCoaxpress = 1<<7,
};
enum enumRoiError {
Xrange = 1<<0,
......@@ -421,6 +438,7 @@ namespace lima
int dumpRecordedImages(int &nrImages, int &error);
bool _isCameraType(int tp);
bool _isInterfaceType(int tp);
bool _isConfig(){return m_config; };
void _pco_set_shutter_rolling_edge(int &error);
void msgLog(char *s);
......@@ -431,6 +449,9 @@ namespace lima
void paramsInit(const char *str);
bool paramsGet(const char *key, char *&value);
time_t _getActionTimestamp(int action);
void _setActionTimestamp(int action);
private:
PcoHwEventCtrlObj *m_HwEventCtrlObj;
SyncCtrlObj* m_sync;
......
......@@ -52,7 +52,7 @@
char * _getComputerName(char *infoBuff, DWORD bufCharCount);
char * _getUserName(char *infoBuff, DWORD bufCharCount);
char * _getVSconfiguration(char *infoBuff, DWORD bufCharCount);
char * _getPcoSdkVersion(char *infoBuff, int strLen);
char * _getPcoSdkVersion(char *infoBuff, int strLen, char *lib);
char * _getDllPath(const char* pzFileName, char *path, size_t strLen);
......
......@@ -563,12 +563,14 @@ _RETRY:
int errPco = PCO_GetBufferStatus(m_handle, sBufNr, &dwStatusDll, &dwStatusDrv);
if((dwStatusDll != 0x80000000) || dwStatusDrv || errPco) {
printf("=== %s> got frame[%d / %d] bufIdx[%d] size[%ld] dest[%08lx] src[%08lx] \n"
"dwStatusDll[%08lx] dwStatusDrv[%08lx] errPco[%08lx] err[%s]\n", fnId,
char msg[MSG1K];
sprintf_s(msg,MSG1K,"SDK ERROR got frame[%d / %d] bufIdx[%d] size[%ld] dest[%08lx] src[%08lx] \n"
"dwStatusDll[%08lx] dwStatusDrv[%08lx] errPco[%08lx] err[%s]\n",
dwFrameIdx, dwRequestedFrames, bufIdx,
size, ((DWORD) ptrDest), ((DWORD) ptrSrc),
dwStatusDll, dwStatusDrv, errPco,
m_cam->_PcoCheckError(__LINE__, __FILE__, dwStatusDrv, error));
DEB_ALWAYS() << msg;
}
#ifdef DEBUG_XFER_IMAG
......
......@@ -244,7 +244,9 @@ stcPcoData::stcPcoData(){
ptr += sprintf_s(ptr, ptrMax - ptr, " computer name: %s\n", _getComputerName(buff, BUFFER_LEN));
ptr += sprintf_s(ptr, ptrMax - ptr, " user name: %s\n", _getUserName(buff, BUFFER_LEN));
ptr += sprintf_s(ptr, ptrMax - ptr, "VS configuration: %s\n", _getVSconfiguration(buff, BUFFER_LEN));
ptr += sprintf_s(ptr, ptrMax - ptr, " PCO SDK version: %s\n", _getPcoSdkVersion(buff, BUFFER_LEN));
ptr += sprintf_s(ptr, ptrMax - ptr, " PCO SDK version: %s\n", _getPcoSdkVersion(buff, BUFFER_LEN, "sc2_cam.dll"));
//ptr += sprintf_s(ptr, ptrMax - ptr, " %s\n", _getPcoSdkVersion(buff, BUFFER_LEN, "sc2_cl_me4.dll"));
//ptr += sprintf_s(ptr, ptrMax - ptr, " %s\n", _getPcoSdkVersion(buff, BUFFER_LEN, "sc2_clhs.dll"));
//ptr += sprintf_s(ptr, ptrMax - ptr, " lima pco dll: %s\n", _getDllPath(FILE_PCO_DLL, buff, BUFFER_LEN));
......@@ -413,6 +415,7 @@ Camera::Camera(const char *params) :
_init();
m_config = FALSE;
_setActionTimestamp(tsConstructor);
}
......@@ -754,6 +757,7 @@ void Camera::startAcq()
struct __timeb64 tStart;
msElapsedTimeSet(tStart);
//=====================================================================
DEF_FNID;
WORD state;
......@@ -990,6 +994,7 @@ void Camera::startAcq()
// if(_isCameraType(Dimax)){
if(_isCameraType(Dimax | Pco2k | Pco4k)){
_pco_SetRecordingState(1, error);
if(iRequestedFrames > 0 ) {
if((trig_mode == ExtTrigSingle) ) {
_beginthread( _pco_acq_thread_dimax_trig_single, 0, (void*) this);
......@@ -2371,7 +2376,7 @@ void Camera::_get_PixelSize(double& x_size,double &y_size)
}
if( _isCameraType(Dimax)) {
x_size = y_size = 11; // um / pco.dimax Users Manual V1.01
x_size = y_size = 11; // um / pco.dimax User's Manual V1.01
return;
}
......@@ -2456,6 +2461,45 @@ bool Camera::_isCameraType(int tp){
}
//=================================================================================================
//=================================================================================================
bool Camera::_isInterfaceType(int tp){
DEB_MEMBER_FUNCT();
DEF_FNID;
switch(_getInterfaceType()) {
case INTERFACE_FIREWIRE:
return !!(tp & ifFirewire) ;
case INTERFACE_CAMERALINK:
return !!(tp & (ifCameralink));
case INTERFACE_CAMERALINKHS:
return !!(tp & (ifCameralinkHS));
case INTERFACE_USB:
return !!(tp & (ifUsb));
case INTERFACE_USB3:
return !!(tp & (ifUsb3));
case INTERFACE_ETHERNET:
return !!(tp & (ifEth));
case INTERFACE_SERIAL:
return !!(tp & (ifSerial));
case INTERFACE_COAXPRESS:
return !!(tp & (ifCoaxpress));
default:
return FALSE;
}
}
//=================================================================================================
//=================================================================================================
......@@ -2624,12 +2668,30 @@ void Camera::_setCameraState(long long flag, bool val)
}
//=================================================================================================
//=================================================================================================
bool Camera::_isRunAfterAssign()
{
return _isCameraType(Edge);
return (_isCameraType(Edge) && _isInterfaceType(ifCameralink));
//return false;
}
//=================================================================================================
//=================================================================================================
time_t Camera::_getActionTimestamp(int action)
{
if((action < 0) || (action >= DIM_ACTION_TIMESTAMP)) return 0;
time_t ts = m_pcoData->action_timestamp.ts[action];
return ts ? ts : 1;
}
void Camera::_setActionTimestamp(int action)
{
if((action >= 0) && (action < DIM_ACTION_TIMESTAMP))
{
m_pcoData->action_timestamp.ts[action] = time(NULL);
}
}
......@@ -892,9 +892,12 @@ char * Camera::_pco_SetRecordingState(int state, int &error){
}
DEB_ALWAYS() << fnId << ": PCO_SetRecordingState " << DEB_VAR1(wRecState_new);
PCO_FN2(error, msg,PCO_SetRecordingState, m_handle, wRecState_new);
PCO_PRINT_ERR(error, msg); if(error) return msg;
if(wRecState_new != wRecState_actual)
{
DEB_ALWAYS() << fnId << ": PCO_SetRecordingState " << DEB_VAR1(wRecState_new);
PCO_FN2(error, msg,PCO_SetRecordingState, m_handle, wRecState_new);
PCO_PRINT_ERR(error, msg); if(error) return msg;
}
PCO_FN2(error, msg,PCO_GetRecordingState, m_handle, &wRecState_actual);
PCO_PRINT_ERR(error, msg); if(error) return msg;
......
This diff is collapsed.
......@@ -99,6 +99,8 @@ void Interface::reset(ResetLevel reset_level)
int intLevel = reset_level;
m_cam->_setActionTimestamp(tsReset);
DEB_ALWAYS() << fnId << ": " DEB_VAR2(reset_level, intLevel);
m_sync->stopAcq();
......@@ -115,6 +117,9 @@ void Interface::prepareAcq()
DEF_FNID;
DEB_ALWAYS() << _sprintComment(fnId, "[ENTRY]");
m_cam->_setActionTimestamp(tsPrepareAcq);
if(m_buffer)
m_buffer->prepareAcq();
}
......@@ -128,6 +133,8 @@ void Interface::startAcq()
DEB_ALWAYS() << _sprintComment(fnId, "[ENTRY]");
m_cam->_setActionTimestamp(tsStartAcq);
if(m_buffer)
m_buffer->getBuffer().setStartTimestamp(Timestamp::now());
m_sync->startAcq();
......@@ -141,7 +148,8 @@ void Interface::stopAcq()
DEF_FNID;
DEB_ALWAYS() << _sprintComment(fnId, "[ENTRY]");
m_sync->stopAcq();
m_cam->_setActionTimestamp(tsStopAcq);
m_sync->stopAcq();
}
//=========================================================================================================
......
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