[WIP] test for talk

parent 5fcc1a2a
2018/06/15 14:30:18 ==========================================
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-2018-06-15_143012]
to: [/t/rhoms1/install-2018-06-15_143012]
to: [/t/rhoms1/install-beta]
2018/06/15 14:29:55 ==========================================
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-2018-06-15_142949]
to: [/t/rhoms1/install-2018-06-15_142949]
to: [/t/rhoms1/install-beta]
2018/06/15 14:08:54 ==========================================
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-2018-06-15_140850]
to: [/t/rhoms1/install-2018-06-15_140850]
to: [/t/rhoms1/install-beta]
2018/06/15 13:38:44 ==========================================
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-2018-06-15_133838]
to: [/t/rhoms1/install-2018-06-15_133838]
to: [/t/rhoms1/install-beta]
2018/06/15 13:13:11 ==========================================
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-2018-06-15_131305]
to: [/t/rhoms1/install-2018-06-15_131305]
to: [/t/rhoms1/install-beta]
2018/06/15 12:35:05 ==========================================
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-2018-06-15_123458]
to: [/t/rhoms1/install-2018-06-15_123458]
to: [/t/rhoms1/install-beta]
2018/06/15 12:33:26 ==========================================
#define PCO_SDK_LIN_VERSION "$Id: PCOSDK_LIN [pcoDev.1.1.14] $"
#define PCO_SDK_WIN_VERSION "$Id: PCOSDK_WIN [1.20] $"
#define PCO_LIMA_VERSION "$Id: PCOLIMA [1.7.7] $"
#define PCO_GIT_VERSION "$Id: PCO rev[2018-05-28 17:48:13 +0200] head[5fcc1a2][5fcc1a2a83ccb84855a909a8a2ce8fbc336af28d] ref[ (HEAD -> wip-stop-rec, gitrh/wip-stop-rec)] at [2018/06/15 12:33:24] $"
#define LIMA_GIT_VERSION "$Id: LIMA rev[2018-05-23 12:18:49 +0200] head[31a027d1][31a027d1269c578dcfd371ed39fb2ab50672bd41] ref[ (HEAD -> core-1.7, tag: pco-1.7.7, gitlab/core-1.7, github/core-1.7)] at [2018/06/15 12:33:24] $"
#define PROCLIB_GIT_VERSION "$Id: PROCLIB rev[2018-01-12 12:04:00 +0100] head[8175ab6][8175ab6cef2b729d69449e2845483df01262ee04] ref[ (HEAD)] at [2018/06/15 12:33:24] $"
#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 [2018/06/15 12:33:24] $"
#define TANGO_GIT_VERSION "$Id: TANGO rev[2018-05-23 11:04:34 +0200] head[c209ba6][c209ba61ce1dfa3c9038543909978fc89082d365] ref[ (HEAD -> core-1.7, gitlab/core-1.7, github/core-1.7)] at [2018/06/15 12:33:24] $"
#define SPEC_GIT_VERSION "$Id: SPEC rev[2018-02-20 19:16:00 +0100] head[043e98c][043e98cdab4c87a0e61dc0c89b46008785d13bf8] ref[ (HEAD -> master, github/master, github/HEAD)] at [2018/06/15 12:33:24] $"
2018/05/22 18:55:50 ==========================================
scp: copied local directory to segfs and /tmp_14_days:
from: [../../install/] and [./bat/]
......
......@@ -1151,6 +1151,9 @@ namespace lima
void getLastImgFifo(int & val);
char *__sprintfExt(char* _ptr, char* _ptrMax, const char* format, ...);
}; // class camera
} // namespace pco
} // namespace lima
......
......@@ -2831,7 +2831,7 @@ void Camera::_pco_GetFirmwareInfo(char *buf_in, int size_in, int &err)
PCO_FW_Vers strFirmwareVersion;
WORD wblock = 0;
int iCnt, err;
int iCnt;
// err = PCO_GetFirmwareInfo(m_handle, wblock++, &strFirmwareVersion);
err = PCO_GetFirmwareInfo(m_handle, wblock++, &strFirmwareVersion);
nrDev = (err == PCO_NOERROR) ? strFirmwareVersion.DeviceNum : 0;
......
......@@ -812,6 +812,7 @@ void Camera::getTimestampMode(int &val)
if(!err) val = mode;
}
//====================================================================
// SIP - attrib
//====================================================================
......
......@@ -127,11 +127,17 @@ char *getTimestamp(timestampFmt fmtIdx, time_t xtime) {
time_t getTimestamp() { return time(NULL); }
//====================================================================
//====================================================================
//$Id: [Oct 8 2013 15:21:07] [Tue Oct 8 15:21:07 2013] (..\..\..\..\src\PcoCamera.cpp) $
#define LEN_BUFF_DATE 128
#define LEN_BUFF_DATE 1024
#define TOKNR_DT 5
......@@ -675,8 +681,14 @@ const char *Camera::_talk(const char *_cmd, char *output, int lg){
key = keys[ikey] = "testCmd";
keys_desc[ikey++] = "DISABLED / debug tool";
if(_stricmp(cmd, key) == 0){
// syntax: talk testCmd mode 0x123
if((tokNr >= 1) && (_stricmp(tok[1], "mode")==0)){
//------------------------------------------
// mode 0x1234
if((tokNr >= 1) && (_stricmp(tok[1], "mode")==0))
{
ptr += sprintf_s(ptr, ptrMax - ptr, "testCmdMode [0x%llx]", m_pcoData->testCmdMode);
if(tokNr >= 2){
int nr;
......@@ -684,7 +696,8 @@ const char *Camera::_talk(const char *_cmd, char *output, int lg){
nr = sscanf_s(tok[2], "0x%llx", &_testCmdMode);
if(nr == 1) {
if(nr == 1)
{
m_pcoData->testCmdMode = _testCmdMode;
ptr += sprintf_s(ptr, ptrMax - ptr, " changed OK> ");
} else {
......@@ -695,10 +708,40 @@ const char *Camera::_talk(const char *_cmd, char *output, int lg){
return output;
}
//------------------------------------------
// str - __sprintfExt
if((tokNr >= 1) && (_stricmp(tok[1], "str")==0))
{
//unsigned long long _testCmdMode;
char *ptr1;
int idx = 5;
ptrMax = ptr+200;
DEB_ALWAYS() << "entry " << DEB_VAR1(ptr);
ptr1 = __sprintfExt(ptr, ptrMax, "++++ dummy\n");
DEB_ALWAYS() << "entry1 " << DEB_VAR2(ptr, ptr1);
ptr = ptr1;
ptr = __sprintfExt(ptr, ptrMax, "++++++ [%d]\n", idx);
ptr = __sprintfExt(ptr, ptrMax, "++++++ [%s]\n", getTimestamp());
ptr = __sprintfExt(ptr, ptrMax, "++++++ [%g]\n", idx*0.01);
for(idx =0; idx <50; idx++)
{
DEB_ALWAYS() << "entry x " << DEB_VAR1(idx);
ptr = __sprintfExt(ptr, ptrMax, "++++++ [%d] [%s] [%g]\n", idx, getTimestamp(), idx*0.01);
}
return output;
}
//--- test of close
#ifndef __linux__
if((tokNr >= 1) && (_stricmp(tok[1], "close")==0)){
if((tokNr >= 1) && (_stricmp(tok[1], "close")==0))
{
int error;
//char *msg;
......@@ -714,7 +757,8 @@ const char *Camera::_talk(const char *_cmd, char *output, int lg){
#endif
//--- test of callback "testCmd cb"
if((tokNr >= 1) && (_stricmp(tok[1], "cb")==0)){
if((tokNr >= 1) && (_stricmp(tok[1], "cb")==0))
{
Event *ev = new Event(Hardware,Event::Error,Event::Camera,Event::Default, "test cb");
m_HwEventCtrlObj->reportEvent(ev);
ptr += sprintf_s(ptr, ptrMax - ptr, "%s> done\n", tok[1]);
......@@ -722,7 +766,8 @@ const char *Camera::_talk(const char *_cmd, char *output, int lg){
}
//--- test of sleep
if((tokNr == 2) && (_stricmp(tok[1], "time")==0)){
if((tokNr == 2) && (_stricmp(tok[1], "time")==0))
{
long long us;
long long usStart;
......@@ -744,11 +789,11 @@ const char *Camera::_talk(const char *_cmd, char *output, int lg){
//------------------ testCmd not found
if(tokNr == 0) {
ptr += sprintf_s(ptr, ptrMax - ptr, "tokNr [%d] cmd [%s] No parameters", tokNr, cmd);
} else {
ptr += sprintf_s(ptr, ptrMax - ptr, "tokNr [%d] cmd [%s]\n", tokNr, cmd);
ptr += sprintf_s(ptr, ptrMax - ptr, "tokNr [%d] cmd [%s] UNKNOWN testCmd\n", tokNr, cmd);
for(int i = 1; i<= tokNr; i++) {
ptr += sprintf_s(ptr, ptrMax - ptr, "tok [%d] [%s]\n", i, tok[i]);
}
......@@ -3192,3 +3237,49 @@ double usElapsedTimeTicsPerSec() {
//==========================================================================================================
char *Camera::__sprintfExt(char* ptr, char* ptrMax, const char* format, ...)
{
DEB_MEMBER_FUNCT();
size_t nrMax = ptrMax - ptr;
int nr;
DEB_ALWAYS() << "ENTRY " << DEB_VAR3(nrMax, ptr, format);
if(nrMax <= 1)
{
*ptr = 0;
return ptr;
}
if(nrMax < 0)
{
*ptrMax = 0;
return ptrMax;
}
va_list args;
va_start (args, format);
DEB_ALWAYS() << "ENTRY 1 " << DEB_VAR3(nrMax, ptr, format);
nr = vsnprintf_s(ptr, nrMax, _TRUNCATE, format, args);
DEB_ALWAYS() << "ENTRY 2 " << DEB_VAR3(nr, ptr, format);
va_end (args);
if(nr <= 0)
{
*ptr = 0;
return ptr;
}
return ptr + nr;
}
//==========================================================================================================
//==========================================================================================================
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