...
 
Commits (3)
......@@ -111,10 +111,7 @@ SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
TabWidth: 4
UseTab: Never
...
......@@ -62,12 +62,15 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIR
include(project_version)
# Enable git hash in the version
option(WITH_GIT_VERSION "compile python binding code?" OFF)
option(WITH_GIT_VERSION "Enable git hash in the version?" OFF)
# Enable python binding code compilation using sip generator
option(CAMERA_ENABLE_PYTHON "compile python binding code?" LIMA_ENABLE_PYTHON)
if (CAMERA_MASTER_PROJECT)
option(LIMA_ENABLE_PYTHON "compile python binding code?" OFF)
endif()
if (CAMERA_ENABLE_PYTHON)
if (LIMA_ENABLE_PYTHON)
# Find python interpreter and libs
find_package(PythonInterp)
find_package(PythonLibs)
......@@ -161,7 +164,7 @@ target_link_libraries(pco PUBLIC limacore)
target_compile_definitions(pco PUBLIC ${PCO_DEFINITIONS})
message("PCO_INCLUDE_DIRS: ${PCO_INCLUDE_DIRS}")
message("... PCO_INCLUDE_DIRS: ${PCO_INCLUDE_DIRS}")
target_include_directories(pco
PUBLIC "$<BUILD_INTERFACE:${PCO_INCLUDE_DIRS}>"
......@@ -177,11 +180,12 @@ if(WIN32)
endif()
# Binding code for python
if(CAMERA_ENABLE_PYTHON)
if(LIMA_ENABLE_PYTHON)
include(LimaTools)
limatools_run_sip_for_camera(pco)
endif()
# Generate and install package config file and version
if(CAMERA_MASTER_PROJECT)
set(PROJECT_LIBRARIES pco)
......@@ -216,11 +220,19 @@ install(
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if(CAMERA_ENABLE_PYTHON)
#if(CAMERA_ENABLE_PYTHON)
message("... LIMA_ENABLE_PYTHON: [${LIMA_ENABLE_PYTHON}]")
message("... PYTHON_SITE_PACKAGES_DIR: [${PYTHON_SITE_PACKAGES_DIR}]")
if(LIMA_ENABLE_PYTHON)
install(
FILES python/__init__.py
DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Pco"
)
install(
FILES tango/Pco.py
DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Server/camera"
)
endif()
## Tests
......
......@@ -30,9 +30,17 @@ set(PCO_SDKWIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sdkPco" CACHE PATH "location of
set(PCO_SDKLIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sdkPcoLin" CACHE PATH "location of PCO Linux SDK")
if(WIN32)
#=========================== WIN
find_path(PCO_INCLUDE_DIRS "PcoSdkVersion.h" ${PCO_SDKWIN_DIR})
find_library(PCO_LIBRARIES NAMES SC2_Cam.lib HINTS ${PCO_SDKWIN_DIR}/lib64)
list(APPEND PCO_INCLUDE_DIRS
${PCO_INCLUDE_DIRS}/include
)
#find_library(PCO_LIBRARIES NAMES SC2_Cam.lib HINTS ${PCO_SDKWIN_DIR}/lib64)
find_library(PCO_LIBRARIES SC2_Cam ${PCO_SDKWIN_DIR}/lib64)
else()
#=========================== LINUX
set(PCO_SDK_LIB_DIR "${PCO_SDKLIN_DIR}/pco_common/pco_lib" CACHE PATH "location of pco sdklib-lin")
set(SISO_DIR "$ENV{SISODIR5}" CACHE PATH "SISO BASE DIR")
......@@ -73,11 +81,16 @@ list(APPEND PCO_INCLUDE_DIRS
)
endif()
#=========================== endif
list(APPEND PCO_DEFINITIONS
WITH_GIT_VERSION
)
message("PCO_LIBRARIES ============================================")
message("PCO_INCLUDE_DIRS: ${PCO_INCLUDE_DIRS}")
message("PCO_LIBRARIES: ${PCO_LIBRARIES}")
message("==========================================================")
message("PCO_INCLUDE_DIRS: [${PCO_INCLUDE_DIRS}]")
message("PCO_LIBRARIES: [${PCO_LIBRARIES}]")
message("PCO_DEFINITIONS: [${PCO_DEFINITIONS}]")
message("==========================================================")
include(FindPackageHandleStandardArgs)
......@@ -86,6 +99,5 @@ find_package_handle_standard_args(PCO DEFAULT_MSG
PCO_INCLUDE_DIRS
)
list(APPEND PCO_DEFINITIONS WITH_GIT_VERSION)
......@@ -3,7 +3,7 @@ python get_git_log.py
rem cmake -Bbuild -H. -G "%CMAKE_GENERATOR%" -DCAMERA_ENABLE_PYTHON=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
rem cmake -Bbuild -H. -G "%CMAKE_GENERATOR%" -DCAMERA_ENABLE_PYTHON=1 -DWITH_GIT_VERSION=1 -DLIMA_ENABLE_DEBUG=0 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
cmake -Bbuild -H. -G "%CMAKE_GENERATOR%" -DCAMERA_ENABLE_PYTHON=1 -DWITH_GIT_VERSION=1 -DLIMA_ENABLE_DEBUG=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
cmake -Bbuild -H. -G "%CMAKE_GENERATOR%" -DLIMA_ENABLE_PYTHON=1 -DWITH_GIT_VERSION=1 -DLIMA_ENABLE_DEBUG=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
......
#from Lima import Core
#from limapco import *
#from Lima import Core
from limapco import Pco as _P
globals().update(_P.__dict__)
DIR_FROM="/c/Users/opid19/lim/out/install/x64-Release"
DIR_PCO_FROM="/c/Users/opid19/lim/camera/pco/tango"
DIR_TO="/c/Miniconda3/envs/pcodeb1"
cp -rp ${DIR_FROM}/python/Lib/site-packages/ ${DIR_TO}/Lib/
rm -fr ${DIR_TO}/Lib/site-packages/Lima/Server/camera/*
cp -p ${DIR_FROM}/python/Lib/site-packages/Lima/Server/camera/__init__.py ${DIR_TO}/Lib/site-packages/Lima/Server/camera/
cp -p ${DIR_FROM}/python/Lib/site-packages/Lima/Server/camera/Pco* ${DIR_TO}/Lib/site-packages/Lima/Server/camera/
#cp -p ${DIR_PCO_FROM}/Pco* ${DIR_TO}/Lib/site-packages/Lima/Server/camera/
cp -rp ${DIR_FROM}/lib/ ${DIR_TO}/Library/
cp -rp ${DIR_FROM}/bin/ ${DIR_TO}/Library/
find ${DIR_TO} -name "*lima*dll"
find ${DIR_TO} -name "*lima*lib"
find ${DIR_TO} -name "*lima*pyd"
This diff is collapsed.
......@@ -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",
};
//=====================================================================
//=====================================================================
......
......@@ -351,7 +351,13 @@ const char *Camera::_pco_SetRecordingState(int state, int &err)
usElapsedTimeSet(usStart);
#endif
// if(wRecState_new == wRecState_actual) {error = 0; return fnId; }
if (wRecState_new == wRecState_actual)
{
DEB_TRACE() << " SetRecordingState - BYPASSED "
<< DEB_VAR2(wRecState_new, wRecState_actual);
err = 0;
return fnId;
}
// ------------------------------------------ cancel images
if (wRecState_new == 0)
......
......@@ -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);
......@@ -729,15 +729,18 @@ void _pco_acq_thread_edge(void *argin)
case pcoAcqPcoError:
errMsg = "pcoAcqPcoError";
break;
default:
errMsg = NULL;
}
if (errMsg)
if (errMsg != NULL)
{
Event *ev = new Event(Hardware, Event::Error, Event::Camera,
Event::CamFault, errMsg);
m_cam->_getPcoHwEventCtrlObj()->reportEvent(ev);
}
printf("=== %s [%d]> TRACE %s\n", fnId, __LINE__, "exit thread");
_endthread();
}
......@@ -1069,19 +1072,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 +1092,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:
......