Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lima-camera-pco
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LimaGroup
Lima-camera-pco
Commits
8c3ddea5
Commit
8c3ddea5
authored
Jun 27, 2019
by
Roberto Arturo Homs-Regojo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Master work
parent
129000ad
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
144 additions
and
62 deletions
+144
-62
CMakeLists.txt
CMakeLists.txt
+45
-43
cmake/project-config.cmake.in
cmake/project-config.cmake.in
+18
-0
conda/camera/bld.bat
conda/camera/bld.bat
+5
-1
get_git_log.py
get_git_log.py
+38
-0
src/PcoCamera.cpp
src/PcoCamera.cpp
+27
-16
src/PcoCameraSip.cpp
src/PcoCameraSip.cpp
+9
-1
src/PcoCameraUtils.cpp
src/PcoCameraUtils.cpp
+2
-1
No files found.
CMakeLists.txt
View file @
8c3ddea5
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
#
CS40220 38043 Grenoble Cedex 9
# FRANCE
#
Copyright (C) : 2009-2017
#
European Synchrotron Radiation Facility
#
BP 220, Grenoble 38043
#
FRANCE
#
# Contact: lima@esrf.fr
#
Contact: lima@esrf.fr
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
This is free software; you can redistribute it and/or modify
#
it under the terms of the GNU General Public License as published by
#
the Free Software Foundation; either version 3 of the License, or
#
(at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
This software is distributed in the hope that it will be useful,
#
but WITHOUT ANY WARRANTY; without even the implied warranty of
#
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#
GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
You should have received a copy of the GNU General Public License
#
along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
cmake_minimum_required
(
VERSION 3.1
)
...
...
@@ -61,12 +61,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIR
# Set version
include
(
project_version
)
# Enable git hash in the version
option
(
WITH_GIT_VERSION
"compile python binding code?"
OFF
)
# Enable python binding code compilation using sip generator
if
(
CAMERA_MASTER_PROJECT
)
option
(
LIMA_ENABLE_PYTHON
"compile python binding code?"
OFF
)
endif
()
option
(
CAMERA_ENABLE_PYTHON
"compile python binding code?"
LIMA_ENABLE_PYTHON
)
if
(
LIM
A_ENABLE_PYTHON
)
if
(
CAMER
A_ENABLE_PYTHON
)
# Find python interpreter and libs
find_package
(
PythonInterp
)
find_package
(
PythonLibs
)
...
...
@@ -95,8 +96,6 @@ find_package(Pco REQUIRED)
file
(
GLOB_RECURSE PCO_INCS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include/*.h"
)
# Library definition
IF
(
WIN32
)
add_library
(
pco SHARED
src/PcoBinCtrlObj.cpp
...
...
@@ -134,12 +133,6 @@ endif()
# Generate export macros
generate_export_header
(
pco
)
# Set version and output name
set_target_properties
(
pco PROPERTIES
OUTPUT_NAME
"lima
${
PROJECT_NAME_LOWER
}
"
VERSION
"
${
PROJECT_VERSION
}
"
SOVERSION
"
${
PACKAGE_VERSION_MAJOR
}
.
${
PACKAGE_VERSION_MINOR
}
"
)
# Add dependencies
target_include_directories
(
pco
PUBLIC
"$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>"
...
...
@@ -147,11 +140,29 @@ target_include_directories(pco
PUBLIC
"$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>"
)
if
(
WITH_GIT_VERSION
)
target_compile_definitions
(
pco PUBLIC WITH_GIT_VERSION
)
endif
()
# Set LIMA_NO_DEBUG if LIMA_ENABLE_DEBUG is set
if
(
NOT LIMA_ENABLE_DEBUG
)
target_compile_definitions
(
pco PUBLIC LIMA_NO_DEBUG
)
endif
()
# Set version and output name
set_target_properties
(
pco PROPERTIES
OUTPUT_NAME
"lima
${
PROJECT_NAME_LOWER
}
"
VERSION
"
${
PROJECT_VERSION
}
"
SOVERSION
"
${
PACKAGE_VERSION_MAJOR
}
.
${
PACKAGE_VERSION_MINOR
}
"
)
target_link_libraries
(
pco PUBLIC limacore
)
target_compile_definitions
(
pco PUBLIC
${
PCO_DEFINITIONS
}
)
target_include_directories
(
pco PUBLIC $<BUILD_INTERFACE:
${
PCO_INCLUDE_DIRS
}
>
)
target_link_libraries
(
pco PUBLIC
${
PCO_LIBRARIES
}
)
if
(
WIN32
)
...
...
@@ -162,17 +173,17 @@ if(WIN32)
endif
()
# Binding code for python
if
(
LIM
A_ENABLE_PYTHON
)
if
(
CAMER
A_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
)
set
(
SIP_INSTALL_DIR
${
CMAKE_INSTALL_DATADIR
}
/sip/lima
)
set
(
CMAKE_INSTALL_DIR
${
CMAKE_INSTALL_DATADIR
}
/cmake/lima
)
include
(
package_config
)
set
(
PROJECT_LIBRARIES pco
)
set
(
SIP_INSTALL_DIR
${
CMAKE_INSTALL_DATADIR
}
/sip/lima
)
set
(
CMAKE_INSTALL_DIR
${
CMAKE_INSTALL_DATADIR
}
/cmake/lima
)
include
(
package_config
)
endif
()
## Installation
...
...
@@ -201,22 +212,13 @@ install(
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
if
(
LIM
A_ENABLE_PYTHON
)
if
(
CAMER
A_ENABLE_PYTHON
)
install
(
FILES
python/__init__.py
FILES python/__init__.py
DESTINATION
"
${
PYTHON_SITE_PACKAGES_DIR
}
/Lima/Pco"
)
endif
()
if
(
LIMA_ENABLE_PYTANGO_SERVER
)
install
(
FILES
tango/Pco.py
DESTINATION
"
${
PYTHON_SITE_PACKAGES_DIR
}
/Lima/Server/camera"
)
endif
()
## Tests
if
(
CAMERA_ENABLE_TESTS
)
enable_testing
()
...
...
cmake/project-config.cmake.in
0 → 100644
View file @
8c3ddea5
# Config file for @PROJECT_NAME_LOWER@
#
# It defines the following variables:
#
# @PROJECT_NAME_UPPER@_INCLUDE_DIRS - include directory
# @PROJECT_NAME_UPPER@_LIBRARIES - all dynamic libraries
# @PROJECT_NAME_UPPER@_STATIC_LIBRARIES - all static libraries
@PACKAGE_INIT@
# Add dependencies here
include(CMakeFindDependencyMacro)
find_dependency(Lima)
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")
check_required_components(@PROJECT_NAME_LOWER@)
conda/camera/bld.bat
View file @
8c3ddea5
cmake
-Bbuild -H
.
-G
"
%CMAKE_GENERATOR%
"
-DLIMA
_ENABLE_PYTHON
=
1
-DCAMERA
_ENABLE_TESTS
=
1
-DCMAKE
_INSTALL_PREFIX
=
%LIBRARY_PREFIX%
-DPYTHON
_SITE_PACKAGES_DIR
=
%SP_DIR%
-DCMAKE
_FIND_ROOT_PATH
=
%LIBRARY_PREFIX%
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%
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%
IF
%ERRORLEVEL%
NEQ
0
exit
/b
%ERRORLEVEL%
cmake
-
-build
build
-
-config
Release
-
-target
install
...
...
get_git_log.py
0 → 100644
View file @
8c3ddea5
import
os
import
datetime
strGit
=
"#define PCO_GIT_VERSION
\"
$Id: PCO %s at [%s] $
\"\n
"
fnVersion
=
"./include/PcoGitVersion.h"
fnSdkLin
=
"./sdkPco/PcoSdkVersion.h"
fnSdkWin
=
"./sdkPcoLin/include/PcoSdkVersion.h"
fOut
=
open
(
fnVersion
,
"w"
)
log
=
os
.
popen
(
'git log -n 1 --date=iso --format=format:"rev[%ad] head[%h][%H] ref[%d]" HEAD || echo "ERROR"'
).
read
()
dt
=
'{0:%Y/%m/%d %H:%M:%S}'
.
format
(
datetime
.
datetime
.
now
())
line
=
strGit
%
(
log
,
dt
)
fOut
.
write
(
line
)
try
:
fIn
=
open
(
fnSdkLin
,
"r"
)
lines
=
fIn
.
readlines
()
line
=
lines
[
0
]
fIn
.
close
()
except
:
line
=
"#define PCO_SDK_LIN_VERSION
\"
$Id: PCOSDK_LIN [not defined] $
\"
"
fOut
.
write
(
line
)
try
:
fIn
=
open
(
fnSdkWin
,
"r"
)
lines
=
fIn
.
readlines
()
line
=
lines
[
0
]
fIn
.
close
()
except
:
line
=
"#define PCO_SDK_WIN_VERSION
\"
$Id: PCOSDK_WIN [not defined] $
\"
"
fOut
.
write
(
line
)
line
=
strGit
%
(
log
,
dt
)
fOut
.
close
()
src/PcoCamera.cpp
View file @
8c3ddea5
...
...
@@ -77,27 +77,38 @@ 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
,
PCO_GIT_VERSION
"
\n
"
PROCLIB_GIT_VERSION
"
\n
"
LIBCONFIG_GIT_VERSION
"
\n
"
LIMA_GIT_VERSION
"
\n
"
TANGO_GIT_VERSION
"
\n
"
SPEC_GIT_VERSION
"
\n
"
# ifndef __linux__
PCO_SDK_WIN_VERSION
"
\n
"
# else
PCO_SDK_LIN_VERSION
"
\n
"
# endif
);
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
//=========================================================================================================
//=========================================================================================================
...
...
src/PcoCameraSip.cpp
View file @
8c3ddea5
...
...
@@ -1066,9 +1066,17 @@ void Camera::getGeneralCAPS1(std::string &o_sn)
char
*
ptr
=
buff
;
char
*
ptrMax
=
buff
+
sizeof
(
buff
);
DWORD
dwGeneralCaps1
=
m_pcoData
->
stcPcoDescription
.
dwGeneralCaps1
;
DWORD
dwGeneralCaps1
;
DWORD
dwVal
;
#ifndef __linux__
dwGeneralCaps1
=
m_pcoData
->
stcPcoDescription
.
dwGeneralCapsDESC1
;
#else
dwGeneralCaps1
=
m_pcoData
->
stcPcoDescription
.
dwGeneralCaps1
;
#endif
int
nib
[
8
];
int
i
,
j
;
...
...
src/PcoCameraUtils.cpp
View file @
8c3ddea5
...
...
@@ -2419,7 +2419,8 @@ 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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment